agent-nuvira 3.5.6 → 3.5.9

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 (186) hide show
  1. package/.agents/skills/index.json +16 -0
  2. package/.agents/skills/motion/SKILL.md +27 -0
  3. package/README.md +56 -1
  4. package/dist/agents/agents/package-agent.d.ts +22 -0
  5. package/dist/agents/agents/package-agent.d.ts.map +1 -1
  6. package/dist/agents/agents/package-agent.js +92 -4
  7. package/dist/agents/agents/package-agent.js.map +1 -1
  8. package/dist/agents/release-preflight.d.ts +42 -5
  9. package/dist/agents/release-preflight.d.ts.map +1 -1
  10. package/dist/agents/release-preflight.js +82 -5
  11. package/dist/agents/release-preflight.js.map +1 -1
  12. package/dist/cli/chat.d.ts +76 -17
  13. package/dist/cli/chat.d.ts.map +1 -1
  14. package/dist/cli/chat.js +357 -127
  15. package/dist/cli/chat.js.map +1 -1
  16. package/dist/cli/code-map.d.ts +51 -0
  17. package/dist/cli/code-map.d.ts.map +1 -1
  18. package/dist/cli/code-map.js +174 -2
  19. package/dist/cli/code-map.js.map +1 -1
  20. package/dist/cli/credentials.d.ts.map +1 -1
  21. package/dist/cli/credentials.js +4 -1
  22. package/dist/cli/credentials.js.map +1 -1
  23. package/dist/cli/doctor.d.ts +31 -2
  24. package/dist/cli/doctor.d.ts.map +1 -1
  25. package/dist/cli/doctor.js +143 -7
  26. package/dist/cli/doctor.js.map +1 -1
  27. package/dist/cli/execute.js +5 -5
  28. package/dist/cli/execute.js.map +1 -1
  29. package/dist/cli/loop-executor.d.ts.map +1 -1
  30. package/dist/cli/loop-executor.js +80 -14
  31. package/dist/cli/loop-executor.js.map +1 -1
  32. package/dist/cli/parity.d.ts +12 -0
  33. package/dist/cli/parity.d.ts.map +1 -1
  34. package/dist/cli/parity.js +46 -1
  35. package/dist/cli/parity.js.map +1 -1
  36. package/dist/cli/tool-install-prompt.d.ts +2 -7
  37. package/dist/cli/tool-install-prompt.d.ts.map +1 -1
  38. package/dist/cli/tool-install-prompt.js +11 -28
  39. package/dist/cli/tool-install-prompt.js.map +1 -1
  40. package/dist/config/process-env.d.ts.map +1 -1
  41. package/dist/config/process-env.js +2 -2
  42. package/dist/config/process-env.js.map +1 -1
  43. package/dist/config/scratch-workspace.d.ts +134 -0
  44. package/dist/config/scratch-workspace.d.ts.map +1 -0
  45. package/dist/config/scratch-workspace.js +213 -0
  46. package/dist/config/scratch-workspace.js.map +1 -0
  47. package/dist/editing/types.d.ts +23 -1
  48. package/dist/editing/types.d.ts.map +1 -1
  49. package/dist/editing/types.js +51 -7
  50. package/dist/editing/types.js.map +1 -1
  51. package/dist/gateway/adapters.d.ts +24 -0
  52. package/dist/gateway/adapters.d.ts.map +1 -1
  53. package/dist/gateway/adapters.js +12 -0
  54. package/dist/gateway/adapters.js.map +1 -1
  55. package/dist/gateway/oversized-reply.d.ts +39 -0
  56. package/dist/gateway/oversized-reply.d.ts.map +1 -0
  57. package/dist/gateway/oversized-reply.js +54 -0
  58. package/dist/gateway/oversized-reply.js.map +1 -0
  59. package/dist/gateway/registry.d.ts +0 -10
  60. package/dist/gateway/registry.d.ts.map +1 -1
  61. package/dist/gateway/registry.js +148 -4
  62. package/dist/gateway/registry.js.map +1 -1
  63. package/dist/inference/route-resolver.d.ts +39 -0
  64. package/dist/inference/route-resolver.d.ts.map +1 -1
  65. package/dist/inference/route-resolver.js +51 -2
  66. package/dist/inference/route-resolver.js.map +1 -1
  67. package/dist/inference/thinking-replay.d.ts +86 -0
  68. package/dist/inference/thinking-replay.d.ts.map +1 -0
  69. package/dist/inference/thinking-replay.js +110 -0
  70. package/dist/inference/thinking-replay.js.map +1 -0
  71. package/dist/inference/tools.d.ts +9 -0
  72. package/dist/inference/tools.d.ts.map +1 -1
  73. package/dist/inference/tools.js +12 -1
  74. package/dist/inference/tools.js.map +1 -1
  75. package/dist/learning/assessment-protocol.d.ts +120 -0
  76. package/dist/learning/assessment-protocol.d.ts.map +1 -0
  77. package/dist/learning/assessment-protocol.js +236 -0
  78. package/dist/learning/assessment-protocol.js.map +1 -0
  79. package/dist/learning/assessment-turn-context.d.ts +54 -0
  80. package/dist/learning/assessment-turn-context.d.ts.map +1 -0
  81. package/dist/learning/assessment-turn-context.js +71 -0
  82. package/dist/learning/assessment-turn-context.js.map +1 -0
  83. package/dist/learning/exhaustion-report.d.ts +24 -1
  84. package/dist/learning/exhaustion-report.d.ts.map +1 -1
  85. package/dist/learning/exhaustion-report.js +18 -6
  86. package/dist/learning/exhaustion-report.js.map +1 -1
  87. package/dist/learning/perf-probe.d.ts +140 -0
  88. package/dist/learning/perf-probe.d.ts.map +1 -0
  89. package/dist/learning/perf-probe.js +316 -0
  90. package/dist/learning/perf-probe.js.map +1 -0
  91. package/dist/learning/quota-ledger.d.ts +24 -0
  92. package/dist/learning/quota-ledger.d.ts.map +1 -1
  93. package/dist/learning/quota-ledger.js +40 -0
  94. package/dist/learning/quota-ledger.js.map +1 -1
  95. package/dist/learning/runtime-dependencies.d.ts +183 -0
  96. package/dist/learning/runtime-dependencies.d.ts.map +1 -0
  97. package/dist/learning/runtime-dependencies.js +349 -0
  98. package/dist/learning/runtime-dependencies.js.map +1 -0
  99. package/dist/learning/self-check-discovery.d.ts +117 -0
  100. package/dist/learning/self-check-discovery.d.ts.map +1 -0
  101. package/dist/learning/self-check-discovery.js +334 -0
  102. package/dist/learning/self-check-discovery.js.map +1 -0
  103. package/dist/learning/skill-store.d.ts.map +1 -1
  104. package/dist/learning/skill-store.js +6 -5
  105. package/dist/learning/skill-store.js.map +1 -1
  106. package/dist/skills/bundled-skills-phase3.d.ts +14 -0
  107. package/dist/skills/bundled-skills-phase3.d.ts.map +1 -1
  108. package/dist/skills/bundled-skills-phase3.js +50 -0
  109. package/dist/skills/bundled-skills-phase3.js.map +1 -1
  110. package/dist/tools/child-agent-runtime.js +19 -1
  111. package/dist/tools/child-agent-runtime.js.map +1 -1
  112. package/dist/tools/credentials-tool.d.ts.map +1 -1
  113. package/dist/tools/credentials-tool.js +4 -1
  114. package/dist/tools/credentials-tool.js.map +1 -1
  115. package/dist/tools/loop-project-context.d.ts +7 -0
  116. package/dist/tools/loop-project-context.d.ts.map +1 -1
  117. package/dist/tools/loop-project-context.js +44 -0
  118. package/dist/tools/loop-project-context.js.map +1 -1
  119. package/dist/tools/modality/motion-presets.d.ts +62 -0
  120. package/dist/tools/modality/motion-presets.d.ts.map +1 -0
  121. package/dist/tools/modality/motion-presets.js +399 -0
  122. package/dist/tools/modality/motion-presets.js.map +1 -0
  123. package/dist/tools/modality/motion-tool.d.ts +62 -0
  124. package/dist/tools/modality/motion-tool.d.ts.map +1 -0
  125. package/dist/tools/modality/motion-tool.js +220 -0
  126. package/dist/tools/modality/motion-tool.js.map +1 -0
  127. package/dist/tools/modality/motion.d.ts +298 -0
  128. package/dist/tools/modality/motion.d.ts.map +1 -0
  129. package/dist/tools/modality/motion.js +514 -0
  130. package/dist/tools/modality/motion.js.map +1 -0
  131. package/dist/tools/pipeline-tool.d.ts.map +1 -1
  132. package/dist/tools/pipeline-tool.js +19 -1
  133. package/dist/tools/pipeline-tool.js.map +1 -1
  134. package/dist/tools/plan-store.d.ts +90 -6
  135. package/dist/tools/plan-store.d.ts.map +1 -1
  136. package/dist/tools/plan-store.js +140 -13
  137. package/dist/tools/plan-store.js.map +1 -1
  138. package/dist/tools/publish-tool.d.ts.map +1 -1
  139. package/dist/tools/publish-tool.js +9 -0
  140. package/dist/tools/publish-tool.js.map +1 -1
  141. package/dist/tools/registry.d.ts.map +1 -1
  142. package/dist/tools/registry.js +100 -3
  143. package/dist/tools/registry.js.map +1 -1
  144. package/dist/tools/tool-loop.d.ts +17 -0
  145. package/dist/tools/tool-loop.d.ts.map +1 -1
  146. package/dist/tools/tool-loop.js +70 -17
  147. package/dist/tools/tool-loop.js.map +1 -1
  148. package/dist/tools/toolsets.js +2 -2
  149. package/dist/tools/toolsets.js.map +1 -1
  150. package/dist/utils/workspace-need.d.ts +84 -0
  151. package/dist/utils/workspace-need.d.ts.map +1 -0
  152. package/dist/utils/workspace-need.js +227 -0
  153. package/dist/utils/workspace-need.js.map +1 -0
  154. package/dist/web-dashboard/chat-console.d.ts +22 -0
  155. package/dist/web-dashboard/chat-console.d.ts.map +1 -1
  156. package/dist/web-dashboard/chat-console.js +75 -11
  157. package/dist/web-dashboard/chat-console.js.map +1 -1
  158. package/dist/web-dashboard/hub-data.d.ts +9 -1
  159. package/dist/web-dashboard/hub-data.d.ts.map +1 -1
  160. package/dist/web-dashboard/hub-data.js +2 -0
  161. package/dist/web-dashboard/hub-data.js.map +1 -1
  162. package/dist/web-dashboard/project-context.d.ts +1 -1
  163. package/dist/web-dashboard/project-context.d.ts.map +1 -1
  164. package/dist/web-dashboard/project-context.js +13 -1
  165. package/dist/web-dashboard/project-context.js.map +1 -1
  166. package/dist/web-dashboard/server.d.ts +33 -0
  167. package/dist/web-dashboard/server.d.ts.map +1 -1
  168. package/dist/web-dashboard/server.js +229 -24
  169. package/dist/web-dashboard/server.js.map +1 -1
  170. package/dist/web-dashboard/src/types.d.ts +46 -0
  171. package/dist/web-dashboard/src/types.d.ts.map +1 -1
  172. package/dist/web-dashboard/workspace-guard.d.ts +20 -21
  173. package/dist/web-dashboard/workspace-guard.d.ts.map +1 -1
  174. package/dist/web-dashboard/workspace-guard.js +20 -153
  175. package/dist/web-dashboard/workspace-guard.js.map +1 -1
  176. package/dist/web-dashboard/workspace-resolution.d.ts +23 -5
  177. package/dist/web-dashboard/workspace-resolution.d.ts.map +1 -1
  178. package/dist/web-dashboard/workspace-resolution.js +22 -4
  179. package/dist/web-dashboard/workspace-resolution.js.map +1 -1
  180. package/package.json +1 -1
  181. package/src/web-dashboard/public/assets/index-CGYIlLpO.js +236 -0
  182. package/src/web-dashboard/public/assets/index-CGYIlLpO.js.map +1 -0
  183. package/src/web-dashboard/public/assets/{index-DeSsNU94.css → index-CzRU84ET.css} +1 -1
  184. package/src/web-dashboard/public/index.html +2 -2
  185. package/src/web-dashboard/public/assets/index-Do_O67Kv.js +0 -236
  186. package/src/web-dashboard/public/assets/index-Do_O67Kv.js.map +0 -1
@@ -0,0 +1,236 @@
1
+ var E$=Object.defineProperty;var _$=(e,t,n)=>t in e?E$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ea=(e,t,n)=>_$(e,typeof t!="symbol"?t+"":t,n);function C$(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const s=Object.getOwnPropertyDescriptor(r,a);s&&Object.defineProperty(e,a,s.get?s:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const s of a)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(a){const s={};return a.integrity&&(s.integrity=a.integrity),a.referrerPolicy&&(s.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?s.credentials="include":a.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(a){if(a.ep)return;a.ep=!0;const s=n(a);fetch(a.href,s)}})();var fi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Je(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var uC={exports:{}},xp={},dC={exports:{}},Fe={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Zu=Symbol.for("react.element"),A$=Symbol.for("react.portal"),T$=Symbol.for("react.fragment"),O$=Symbol.for("react.strict_mode"),P$=Symbol.for("react.profiler"),R$=Symbol.for("react.provider"),M$=Symbol.for("react.context"),I$=Symbol.for("react.forward_ref"),$$=Symbol.for("react.suspense"),L$=Symbol.for("react.memo"),D$=Symbol.for("react.lazy"),H0=Symbol.iterator;function B$(e){return e===null||typeof e!="object"?null:(e=H0&&e[H0]||e["@@iterator"],typeof e=="function"?e:null)}var fC={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},hC=Object.assign,pC={};function wl(e,t,n){this.props=e,this.context=t,this.refs=pC,this.updater=n||fC}wl.prototype.isReactComponent={};wl.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): 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")};wl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function mC(){}mC.prototype=wl.prototype;function sx(e,t,n){this.props=e,this.context=t,this.refs=pC,this.updater=n||fC}var ox=sx.prototype=new mC;ox.constructor=sx;hC(ox,wl.prototype);ox.isPureReactComponent=!0;var G0=Array.isArray,gC=Object.prototype.hasOwnProperty,lx={current:null},vC={key:!0,ref:!0,__self:!0,__source:!0};function yC(e,t,n){var r,a={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)gC.call(t,r)&&!vC.hasOwnProperty(r)&&(a[r]=t[r]);var l=arguments.length-2;if(l===1)a.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];a.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)a[r]===void 0&&(a[r]=l[r]);return{$$typeof:Zu,type:e,key:s,ref:o,props:a,_owner:lx.current}}function z$(e,t){return{$$typeof:Zu,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function cx(e){return typeof e=="object"&&e!==null&&e.$$typeof===Zu}function F$(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var q0=/\/+/g;function Dm(e,t){return typeof e=="object"&&e!==null&&e.key!=null?F$(""+e.key):t.toString(36)}function kf(e,t,n,r,a){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Zu:case A$:o=!0}}if(o)return o=e,a=a(o),e=r===""?"."+Dm(o,0):r,G0(a)?(n="",e!=null&&(n=e.replace(q0,"$&/")+"/"),kf(a,t,n,"",function(u){return u})):a!=null&&(cx(a)&&(a=z$(a,n+(!a.key||o&&o.key===a.key?"":(""+a.key).replace(q0,"$&/")+"/")+e)),t.push(a)),1;if(o=0,r=r===""?".":r+":",G0(e))for(var l=0;l<e.length;l++){s=e[l];var c=r+Dm(s,l);o+=kf(s,t,n,c,a)}else if(c=B$(e),typeof c=="function")for(e=c.call(e),l=0;!(s=e.next()).done;)s=s.value,c=r+Dm(s,l++),o+=kf(s,t,n,c,a);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function _d(e,t,n){if(e==null)return e;var r=[],a=0;return kf(e,r,"","",function(s){return t.call(n,s,a++)}),r}function U$(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Pn={current:null},Sf={transition:null},W$={ReactCurrentDispatcher:Pn,ReactCurrentBatchConfig:Sf,ReactCurrentOwner:lx};function bC(){throw Error("act(...) is not supported in production builds of React.")}Fe.Children={map:_d,forEach:function(e,t,n){_d(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return _d(e,function(){t++}),t},toArray:function(e){return _d(e,function(t){return t})||[]},only:function(e){if(!cx(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Fe.Component=wl;Fe.Fragment=T$;Fe.Profiler=P$;Fe.PureComponent=sx;Fe.StrictMode=O$;Fe.Suspense=$$;Fe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W$;Fe.act=bC;Fe.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=hC({},e.props),a=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=lx.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)gC.call(t,c)&&!vC.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:Zu,type:e.type,key:a,ref:s,props:r,_owner:o}};Fe.createContext=function(e){return e={$$typeof:M$,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:R$,_context:e},e.Consumer=e};Fe.createElement=yC;Fe.createFactory=function(e){var t=yC.bind(null,e);return t.type=e,t};Fe.createRef=function(){return{current:null}};Fe.forwardRef=function(e){return{$$typeof:I$,render:e}};Fe.isValidElement=cx;Fe.lazy=function(e){return{$$typeof:D$,_payload:{_status:-1,_result:e},_init:U$}};Fe.memo=function(e,t){return{$$typeof:L$,type:e,compare:t===void 0?null:t}};Fe.startTransition=function(e){var t=Sf.transition;Sf.transition={};try{e()}finally{Sf.transition=t}};Fe.unstable_act=bC;Fe.useCallback=function(e,t){return Pn.current.useCallback(e,t)};Fe.useContext=function(e){return Pn.current.useContext(e)};Fe.useDebugValue=function(){};Fe.useDeferredValue=function(e){return Pn.current.useDeferredValue(e)};Fe.useEffect=function(e,t){return Pn.current.useEffect(e,t)};Fe.useId=function(){return Pn.current.useId()};Fe.useImperativeHandle=function(e,t,n){return Pn.current.useImperativeHandle(e,t,n)};Fe.useInsertionEffect=function(e,t){return Pn.current.useInsertionEffect(e,t)};Fe.useLayoutEffect=function(e,t){return Pn.current.useLayoutEffect(e,t)};Fe.useMemo=function(e,t){return Pn.current.useMemo(e,t)};Fe.useReducer=function(e,t,n){return Pn.current.useReducer(e,t,n)};Fe.useRef=function(e){return Pn.current.useRef(e)};Fe.useState=function(e){return Pn.current.useState(e)};Fe.useSyncExternalStore=function(e,t,n){return Pn.current.useSyncExternalStore(e,t,n)};Fe.useTransition=function(){return Pn.current.useTransition()};Fe.version="18.3.1";dC.exports=Fe;var b=dC.exports;const X=Je(b),H$=C$({__proto__:null,default:X},[b]);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var G$=b,q$=Symbol.for("react.element"),K$=Symbol.for("react.fragment"),V$=Object.prototype.hasOwnProperty,Y$=G$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,X$={key:!0,ref:!0,__self:!0,__source:!0};function xC(e,t,n){var r,a={},s=null,o=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)V$.call(t,r)&&!X$.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)a[r]===void 0&&(a[r]=t[r]);return{$$typeof:q$,type:e,key:s,ref:o,props:a,_owner:Y$.current}}xp.Fragment=K$;xp.jsx=xC;xp.jsxs=xC;uC.exports=xp;var i=uC.exports,wC={exports:{}},ir={},kC={exports:{}},SC={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(M,z){var O=M.length;M.push(z);e:for(;0<O;){var J=O-1>>>1,F=M[J];if(0<a(F,z))M[J]=z,M[O]=F,O=J;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var z=M[0],O=M.pop();if(O!==z){M[0]=O;e:for(var J=0,F=M.length,L=F>>>1;J<L;){var ie=2*(J+1)-1,fe=M[ie],ve=ie+1,Ee=M[ve];if(0>a(fe,O))ve<F&&0>a(Ee,fe)?(M[J]=Ee,M[ve]=O,J=ve):(M[J]=fe,M[ie]=O,J=ie);else if(ve<F&&0>a(Ee,O))M[J]=Ee,M[ve]=O,J=ve;else break e}}return z}function a(M,z){var O=M.sortIndex-z.sortIndex;return O!==0?O:M.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,m=!1,g=!1,y=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(M){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=M)r(u),z.sortIndex=z.expirationTime,t(c,z);else break;z=n(u)}}function j(M){if(g=!1,w(M),!m)if(n(c)!==null)m=!0,D(S);else{var z=n(u);z!==null&&U(j,z.startTime-M)}}function S(M,z){m=!1,g&&(g=!1,v(E),E=-1),p=!0;var O=h;try{for(w(z),f=n(c);f!==null&&(!(f.expirationTime>z)||M&&!R());){var J=f.callback;if(typeof J=="function"){f.callback=null,h=f.priorityLevel;var F=J(f.expirationTime<=z);z=e.unstable_now(),typeof F=="function"?f.callback=F:f===n(c)&&r(c),w(z)}else r(c);f=n(c)}if(f!==null)var L=!0;else{var ie=n(u);ie!==null&&U(j,ie.startTime-z),L=!1}return L}finally{f=null,h=O,p=!1}}var x=!1,N=null,E=-1,P=5,_=-1;function R(){return!(e.unstable_now()-_<P)}function T(){if(N!==null){var M=e.unstable_now();_=M;var z=!0;try{z=N(!0,M)}finally{z?B():(x=!1,N=null)}}else x=!1}var B;if(typeof k=="function")B=function(){k(T)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,I=$.port2;$.port1.onmessage=T,B=function(){I.postMessage(null)}}else B=function(){y(T,0)};function D(M){N=M,x||(x=!0,B())}function U(M,z){E=y(function(){M(e.unstable_now())},z)}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(M){M.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,D(S))},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(M){switch(h){case 1:case 2:case 3:var z=3;break;default:z=h}var O=h;h=z;try{return M()}finally{h=O}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(M,z){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var O=h;h=M;try{return z()}finally{h=O}},e.unstable_scheduleCallback=function(M,z,O){var J=e.unstable_now();switch(typeof O=="object"&&O!==null?(O=O.delay,O=typeof O=="number"&&0<O?J+O:J):O=J,M){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=O+F,M={id:d++,callback:z,priorityLevel:M,startTime:O,expirationTime:F,sortIndex:-1},O>J?(M.sortIndex=O,t(u,M),n(c)===null&&M===n(u)&&(g?(v(E),E=-1):g=!0,U(j,O-J))):(M.sortIndex=F,t(c,M),m||p||(m=!0,D(S))),M},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(M){var z=h;return function(){var O=h;h=z;try{return M.apply(this,arguments)}finally{h=O}}}})(SC);kC.exports=SC;var Q$=kC.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Z$=b,rr=Q$;function oe(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;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."}var jC=new Set,qc={};function Fs(e,t){Ho(e,t),Ho(e+"Capture",t)}function Ho(e,t){for(qc[e]=t,e=0;e<t.length;e++)jC.add(t[e])}var Da=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wv=Object.prototype.hasOwnProperty,J$=/^[: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]*$/,K0={},V0={};function eL(e){return wv.call(V0,e)?!0:wv.call(K0,e)?!1:J$.test(e)?V0[e]=!0:(K0[e]=!0,!1)}function tL(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function nL(e,t,n,r){if(t===null||typeof t>"u"||tL(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Rn(e,t,n,r,a,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var hn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){hn[e]=new Rn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];hn[t]=new Rn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){hn[e]=new Rn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){hn[e]=new Rn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){hn[e]=new Rn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){hn[e]=new Rn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){hn[e]=new Rn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){hn[e]=new Rn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){hn[e]=new Rn(e,5,!1,e.toLowerCase(),null,!1,!1)});var ux=/[\-:]([a-z])/g;function dx(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ux,dx);hn[t]=new Rn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ux,dx);hn[t]=new Rn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ux,dx);hn[t]=new Rn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){hn[e]=new Rn(e,1,!1,e.toLowerCase(),null,!1,!1)});hn.xlinkHref=new Rn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){hn[e]=new Rn(e,1,!1,e.toLowerCase(),null,!0,!0)});function fx(e,t,n,r){var a=hn.hasOwnProperty(t)?hn[t]:null;(a!==null?a.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(nL(t,n,a,r)&&(n=null),r||a===null?eL(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=n===null?a.type===3?!1:"":n:(t=a.attributeName,r=a.attributeNamespace,n===null?e.removeAttribute(t):(a=a.type,n=a===3||a===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Ga=Z$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Cd=Symbol.for("react.element"),vo=Symbol.for("react.portal"),yo=Symbol.for("react.fragment"),hx=Symbol.for("react.strict_mode"),kv=Symbol.for("react.profiler"),NC=Symbol.for("react.provider"),EC=Symbol.for("react.context"),px=Symbol.for("react.forward_ref"),Sv=Symbol.for("react.suspense"),jv=Symbol.for("react.suspense_list"),mx=Symbol.for("react.memo"),ii=Symbol.for("react.lazy"),_C=Symbol.for("react.offscreen"),Y0=Symbol.iterator;function ec(e){return e===null||typeof e!="object"?null:(e=Y0&&e[Y0]||e["@@iterator"],typeof e=="function"?e:null)}var Ct=Object.assign,Bm;function kc(e){if(Bm===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Bm=t&&t[1]||""}return`
34
+ `+Bm+e}var zm=!1;function Fm(e,t){if(!e||zm)return"";zm=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var a=u.stack.split(`
35
+ `),s=r.stack.split(`
36
+ `),o=a.length-1,l=s.length-1;1<=o&&0<=l&&a[o]!==s[l];)l--;for(;1<=o&&0<=l;o--,l--)if(a[o]!==s[l]){if(o!==1||l!==1)do if(o--,l--,0>l||a[o]!==s[l]){var c=`
37
+ `+a[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{zm=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?kc(e):""}function rL(e){switch(e.tag){case 5:return kc(e.type);case 16:return kc("Lazy");case 13:return kc("Suspense");case 19:return kc("SuspenseList");case 0:case 2:case 15:return e=Fm(e.type,!1),e;case 11:return e=Fm(e.type.render,!1),e;case 1:return e=Fm(e.type,!0),e;default:return""}}function Nv(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case yo:return"Fragment";case vo:return"Portal";case kv:return"Profiler";case hx:return"StrictMode";case Sv:return"Suspense";case jv:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case EC:return(e.displayName||"Context")+".Consumer";case NC:return(e._context.displayName||"Context")+".Provider";case px:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case mx:return t=e.displayName||null,t!==null?t:Nv(e.type)||"Memo";case ii:t=e._payload,e=e._init;try{return Nv(e(t))}catch{}}return null}function aL(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Nv(t);case 8:return t===hx?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ti(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function CC(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function iL(e){var t=CC(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ad(e){e._valueTracker||(e._valueTracker=iL(e))}function AC(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=CC(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Lf(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ev(e,t){var n=t.checked;return Ct({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function X0(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ti(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function TC(e,t){t=t.checked,t!=null&&fx(e,"checked",t,!1)}function _v(e,t){TC(e,t);var n=Ti(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Cv(e,t.type,n):t.hasOwnProperty("defaultValue")&&Cv(e,t.type,Ti(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Q0(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Cv(e,t,n){(t!=="number"||Lf(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Sc=Array.isArray;function Ro(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Ti(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,r&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function Av(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(oe(91));return Ct({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Z0(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(oe(92));if(Sc(n)){if(1<n.length)throw Error(oe(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Ti(n)}}function OC(e,t){var n=Ti(t.value),r=Ti(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function J0(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function PC(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Tv(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?PC(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Td,RC=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,a){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Td=Td||document.createElement("div"),Td.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Td.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Kc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ac={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},sL=["Webkit","ms","Moz","O"];Object.keys(Ac).forEach(function(e){sL.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ac[t]=Ac[e]})});function MC(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ac.hasOwnProperty(e)&&Ac[e]?(""+t).trim():t+"px"}function IC(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,a=MC(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}var oL=Ct({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ov(e,t){if(t){if(oL[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(oe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(oe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(oe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(oe(62))}}function Pv(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Rv=null;function gx(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Mv=null,Mo=null,Io=null;function ek(e){if(e=td(e)){if(typeof Mv!="function")throw Error(oe(280));var t=e.stateNode;t&&(t=Np(t),Mv(e.stateNode,e.type,t))}}function $C(e){Mo?Io?Io.push(e):Io=[e]:Mo=e}function LC(){if(Mo){var e=Mo,t=Io;if(Io=Mo=null,ek(e),t)for(e=0;e<t.length;e++)ek(t[e])}}function DC(e,t){return e(t)}function BC(){}var Um=!1;function zC(e,t,n){if(Um)return e(t,n);Um=!0;try{return DC(e,t,n)}finally{Um=!1,(Mo!==null||Io!==null)&&(BC(),LC())}}function Vc(e,t){var n=e.stateNode;if(n===null)return null;var r=Np(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(oe(231,t,typeof n));return n}var Iv=!1;if(Da)try{var tc={};Object.defineProperty(tc,"passive",{get:function(){Iv=!0}}),window.addEventListener("test",tc,tc),window.removeEventListener("test",tc,tc)}catch{Iv=!1}function lL(e,t,n,r,a,s,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var Tc=!1,Df=null,Bf=!1,$v=null,cL={onError:function(e){Tc=!0,Df=e}};function uL(e,t,n,r,a,s,o,l,c){Tc=!1,Df=null,lL.apply(cL,arguments)}function dL(e,t,n,r,a,s,o,l,c){if(uL.apply(this,arguments),Tc){if(Tc){var u=Df;Tc=!1,Df=null}else throw Error(oe(198));Bf||(Bf=!0,$v=u)}}function Us(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 FC(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 tk(e){if(Us(e)!==e)throw Error(oe(188))}function fL(e){var t=e.alternate;if(!t){if(t=Us(e),t===null)throw Error(oe(188));return t!==e?null:e}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 tk(a),e;if(s===r)return tk(a),t;s=s.sibling}throw Error(oe(188))}if(n.return!==r.return)n=a,r=s;else{for(var o=!1,l=a.child;l;){if(l===n){o=!0,n=a,r=s;break}if(l===r){o=!0,r=a,n=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===n){o=!0,n=s,r=a;break}if(l===r){o=!0,r=s,n=a;break}l=l.sibling}if(!o)throw Error(oe(189))}}if(n.alternate!==r)throw Error(oe(190))}if(n.tag!==3)throw Error(oe(188));return n.stateNode.current===n?e:t}function UC(e){return e=fL(e),e!==null?WC(e):null}function WC(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=WC(e);if(t!==null)return t;e=e.sibling}return null}var HC=rr.unstable_scheduleCallback,nk=rr.unstable_cancelCallback,hL=rr.unstable_shouldYield,pL=rr.unstable_requestPaint,Rt=rr.unstable_now,mL=rr.unstable_getCurrentPriorityLevel,vx=rr.unstable_ImmediatePriority,GC=rr.unstable_UserBlockingPriority,zf=rr.unstable_NormalPriority,gL=rr.unstable_LowPriority,qC=rr.unstable_IdlePriority,wp=null,ua=null;function vL(e){if(ua&&typeof ua.onCommitFiberRoot=="function")try{ua.onCommitFiberRoot(wp,e,void 0,(e.current.flags&128)===128)}catch{}}var Br=Math.clz32?Math.clz32:xL,yL=Math.log,bL=Math.LN2;function xL(e){return e>>>=0,e===0?32:31-(yL(e)/bL|0)|0}var Od=64,Pd=4194304;function jc(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ff(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,a=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~a;l!==0?r=jc(l):(s&=o,s!==0&&(r=jc(s)))}else o=n&~a,o!==0?r=jc(o):s!==0&&(r=jc(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&a)&&(a=r&-r,s=t&-t,a>=s||a===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Br(t),a=1<<n,r|=e[n],t&=~a;return r}function wL(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function kL(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-Br(s),l=1<<o,c=a[o];c===-1?(!(l&n)||l&r)&&(a[o]=wL(l,t)):c<=t&&(e.expiredLanes|=l),s&=~l}}function Lv(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function KC(){var e=Od;return Od<<=1,!(Od&4194240)&&(Od=64),e}function Wm(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ju(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Br(t),e[t]=n}function SL(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var a=31-Br(n),s=1<<a;t[a]=0,r[a]=-1,e[a]=-1,n&=~s}}function yx(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Br(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}var nt=0;function VC(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var YC,bx,XC,QC,ZC,Dv=!1,Rd=[],bi=null,xi=null,wi=null,Yc=new Map,Xc=new Map,li=[],jL="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 submit".split(" ");function rk(e,t){switch(e){case"focusin":case"focusout":bi=null;break;case"dragenter":case"dragleave":xi=null;break;case"mouseover":case"mouseout":wi=null;break;case"pointerover":case"pointerout":Yc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xc.delete(t.pointerId)}}function nc(e,t,n,r,a,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[a]},t!==null&&(t=td(t),t!==null&&bx(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function NL(e,t,n,r,a){switch(t){case"focusin":return bi=nc(bi,e,t,n,r,a),!0;case"dragenter":return xi=nc(xi,e,t,n,r,a),!0;case"mouseover":return wi=nc(wi,e,t,n,r,a),!0;case"pointerover":var s=a.pointerId;return Yc.set(s,nc(Yc.get(s)||null,e,t,n,r,a)),!0;case"gotpointercapture":return s=a.pointerId,Xc.set(s,nc(Xc.get(s)||null,e,t,n,r,a)),!0}return!1}function JC(e){var t=ps(e.target);if(t!==null){var n=Us(t);if(n!==null){if(t=n.tag,t===13){if(t=FC(n),t!==null){e.blockedOn=t,ZC(e.priority,function(){XC(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 jf(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Bv(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Rv=r,n.target.dispatchEvent(r),Rv=null}else return t=td(n),t!==null&&bx(t),e.blockedOn=n,!1;t.shift()}return!0}function ak(e,t,n){jf(e)&&n.delete(t)}function EL(){Dv=!1,bi!==null&&jf(bi)&&(bi=null),xi!==null&&jf(xi)&&(xi=null),wi!==null&&jf(wi)&&(wi=null),Yc.forEach(ak),Xc.forEach(ak)}function rc(e,t){e.blockedOn===t&&(e.blockedOn=null,Dv||(Dv=!0,rr.unstable_scheduleCallback(rr.unstable_NormalPriority,EL)))}function Qc(e){function t(a){return rc(a,e)}if(0<Rd.length){rc(Rd[0],e);for(var n=1;n<Rd.length;n++){var r=Rd[n];r.blockedOn===e&&(r.blockedOn=null)}}for(bi!==null&&rc(bi,e),xi!==null&&rc(xi,e),wi!==null&&rc(wi,e),Yc.forEach(t),Xc.forEach(t),n=0;n<li.length;n++)r=li[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<li.length&&(n=li[0],n.blockedOn===null);)JC(n),n.blockedOn===null&&li.shift()}var $o=Ga.ReactCurrentBatchConfig,Uf=!0;function _L(e,t,n,r){var a=nt,s=$o.transition;$o.transition=null;try{nt=1,xx(e,t,n,r)}finally{nt=a,$o.transition=s}}function CL(e,t,n,r){var a=nt,s=$o.transition;$o.transition=null;try{nt=4,xx(e,t,n,r)}finally{nt=a,$o.transition=s}}function xx(e,t,n,r){if(Uf){var a=Bv(e,t,n,r);if(a===null)Jm(e,t,r,Wf,n),rk(e,r);else if(NL(a,e,t,n,r))r.stopPropagation();else if(rk(e,r),t&4&&-1<jL.indexOf(e)){for(;a!==null;){var s=td(a);if(s!==null&&YC(s),s=Bv(e,t,n,r),s===null&&Jm(e,t,r,Wf,n),s===a)break;a=s}a!==null&&r.stopPropagation()}else Jm(e,t,r,null,n)}}var Wf=null;function Bv(e,t,n,r){if(Wf=null,e=gx(r),e=ps(e),e!==null)if(t=Us(e),t===null)e=null;else if(n=t.tag,n===13){if(e=FC(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 Wf=e,null}function eA(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(mL()){case vx:return 1;case GC:return 4;case zf:case gL:return 16;case qC:return 536870912;default:return 16}default:return 16}}var hi=null,wx=null,Nf=null;function tA(){if(Nf)return Nf;var e,t=wx,n=t.length,r,a="value"in hi?hi.value:hi.textContent,s=a.length;for(e=0;e<n&&t[e]===a[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===a[s-r];r++);return Nf=a.slice(e,1<r?1-r:void 0)}function Ef(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 Md(){return!0}function ik(){return!1}function sr(e){function t(n,r,a,s,o){this._reactName=n,this._targetInst=a,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Md:ik,this.isPropagationStopped=ik,this}return Ct(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Md)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Md)},persist:function(){},isPersistent:Md}),t}var kl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kx=sr(kl),ed=Ct({},kl,{view:0,detail:0}),AL=sr(ed),Hm,Gm,ac,kp=Ct({},ed,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sx,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!==ac&&(ac&&e.type==="mousemove"?(Hm=e.screenX-ac.screenX,Gm=e.screenY-ac.screenY):Gm=Hm=0,ac=e),Hm)},movementY:function(e){return"movementY"in e?e.movementY:Gm}}),sk=sr(kp),TL=Ct({},kp,{dataTransfer:0}),OL=sr(TL),PL=Ct({},ed,{relatedTarget:0}),qm=sr(PL),RL=Ct({},kl,{animationName:0,elapsedTime:0,pseudoElement:0}),ML=sr(RL),IL=Ct({},kl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),$L=sr(IL),LL=Ct({},kl,{data:0}),ok=sr(LL),DL={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},BL={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"},zL={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function FL(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=zL[e])?!!t[e]:!1}function Sx(){return FL}var UL=Ct({},ed,{key:function(e){if(e.key){var t=DL[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ef(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?BL[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sx,charCode:function(e){return e.type==="keypress"?Ef(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ef(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),WL=sr(UL),HL=Ct({},kp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lk=sr(HL),GL=Ct({},ed,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sx}),qL=sr(GL),KL=Ct({},kl,{propertyName:0,elapsedTime:0,pseudoElement:0}),VL=sr(KL),YL=Ct({},kp,{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}),XL=sr(YL),QL=[9,13,27,32],jx=Da&&"CompositionEvent"in window,Oc=null;Da&&"documentMode"in document&&(Oc=document.documentMode);var ZL=Da&&"TextEvent"in window&&!Oc,nA=Da&&(!jx||Oc&&8<Oc&&11>=Oc),ck=" ",uk=!1;function rA(e,t){switch(e){case"keyup":return QL.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function aA(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var bo=!1;function JL(e,t){switch(e){case"compositionend":return aA(t);case"keypress":return t.which!==32?null:(uk=!0,ck);case"textInput":return e=t.data,e===ck&&uk?null:e;default:return null}}function eD(e,t){if(bo)return e==="compositionend"||!jx&&rA(e,t)?(e=tA(),Nf=wx=hi=null,bo=!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 nA&&t.locale!=="ko"?null:t.data;default:return null}}var tD={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 dk(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!tD[e.type]:t==="textarea"}function iA(e,t,n,r){$C(r),t=Hf(t,"onChange"),0<t.length&&(n=new kx("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Pc=null,Zc=null;function nD(e){gA(e,0)}function Sp(e){var t=ko(e);if(AC(t))return e}function rD(e,t){if(e==="change")return t}var sA=!1;if(Da){var Km;if(Da){var Vm="oninput"in document;if(!Vm){var fk=document.createElement("div");fk.setAttribute("oninput","return;"),Vm=typeof fk.oninput=="function"}Km=Vm}else Km=!1;sA=Km&&(!document.documentMode||9<document.documentMode)}function hk(){Pc&&(Pc.detachEvent("onpropertychange",oA),Zc=Pc=null)}function oA(e){if(e.propertyName==="value"&&Sp(Zc)){var t=[];iA(t,Zc,e,gx(e)),zC(nD,t)}}function aD(e,t,n){e==="focusin"?(hk(),Pc=t,Zc=n,Pc.attachEvent("onpropertychange",oA)):e==="focusout"&&hk()}function iD(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Sp(Zc)}function sD(e,t){if(e==="click")return Sp(t)}function oD(e,t){if(e==="input"||e==="change")return Sp(t)}function lD(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Hr=typeof Object.is=="function"?Object.is:lD;function Jc(e,t){if(Hr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)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 a=n[r];if(!wv.call(t,a)||!Hr(e[a],t[a]))return!1}return!0}function pk(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function mk(e,t){var n=pk(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}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=pk(n)}}function lA(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?lA(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cA(){for(var e=window,t=Lf();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Lf(e.document)}return t}function Nx(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")}function cD(e){var t=cA(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&lA(n.ownerDocument.documentElement,n)){if(r!==null&&Nx(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=n.textContent.length,s=Math.min(r.start,a);r=r.end===void 0?s:Math.min(r.end,a),!e.extend&&s>r&&(a=r,r=s,s=a),a=mk(n,s);var o=mk(n,r);a&&o&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var uD=Da&&"documentMode"in document&&11>=document.documentMode,xo=null,zv=null,Rc=null,Fv=!1;function gk(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Fv||xo==null||xo!==Lf(r)||(r=xo,"selectionStart"in r&&Nx(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}),Rc&&Jc(Rc,r)||(Rc=r,r=Hf(zv,"onSelect"),0<r.length&&(t=new kx("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=xo)))}function Id(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var wo={animationend:Id("Animation","AnimationEnd"),animationiteration:Id("Animation","AnimationIteration"),animationstart:Id("Animation","AnimationStart"),transitionend:Id("Transition","TransitionEnd")},Ym={},uA={};Da&&(uA=document.createElement("div").style,"AnimationEvent"in window||(delete wo.animationend.animation,delete wo.animationiteration.animation,delete wo.animationstart.animation),"TransitionEvent"in window||delete wo.transitionend.transition);function jp(e){if(Ym[e])return Ym[e];if(!wo[e])return e;var t=wo[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in uA)return Ym[e]=t[n];return e}var dA=jp("animationend"),fA=jp("animationiteration"),hA=jp("animationstart"),pA=jp("transitionend"),mA=new Map,vk="abort auxClick 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(" ");function Ri(e,t){mA.set(e,t),Fs(t,[e])}for(var Xm=0;Xm<vk.length;Xm++){var Qm=vk[Xm],dD=Qm.toLowerCase(),fD=Qm[0].toUpperCase()+Qm.slice(1);Ri(dD,"on"+fD)}Ri(dA,"onAnimationEnd");Ri(fA,"onAnimationIteration");Ri(hA,"onAnimationStart");Ri("dblclick","onDoubleClick");Ri("focusin","onFocus");Ri("focusout","onBlur");Ri(pA,"onTransitionEnd");Ho("onMouseEnter",["mouseout","mouseover"]);Ho("onMouseLeave",["mouseout","mouseover"]);Ho("onPointerEnter",["pointerout","pointerover"]);Ho("onPointerLeave",["pointerout","pointerover"]);Fs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Fs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Fs("onBeforeInput",["compositionend","keypress","textInput","paste"]);Fs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Fs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Fs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nc="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(" "),hD=new Set("cancel close invalid load scroll toggle".split(" ").concat(Nc));function yk(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,dL(r,t,void 0,e),e.currentTarget=null}function gA(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==s&&a.isPropagationStopped())break e;yk(a,l,u),s=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==s&&a.isPropagationStopped())break e;yk(a,l,u),s=c}}}if(Bf)throw e=$v,Bf=!1,$v=null,e}function gt(e,t){var n=t[qv];n===void 0&&(n=t[qv]=new Set);var r=e+"__bubble";n.has(r)||(vA(t,e,2,!1),n.add(r))}function Zm(e,t,n){var r=0;t&&(r|=4),vA(n,e,r,t)}var $d="_reactListening"+Math.random().toString(36).slice(2);function eu(e){if(!e[$d]){e[$d]=!0,jC.forEach(function(n){n!=="selectionchange"&&(hD.has(n)||Zm(n,!1,e),Zm(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$d]||(t[$d]=!0,Zm("selectionchange",!1,t))}}function vA(e,t,n,r){switch(eA(t)){case 1:var a=_L;break;case 4:a=CL;break;default:a=xx}n=a.bind(null,t,n,e),a=void 0,!Iv||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),r?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function Jm(e,t,n,r,a){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===a||l.nodeType===8&&l.parentNode===a)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;o=o.return}for(;l!==null;){if(o=ps(l),o===null)return;if(c=o.tag,c===5||c===6){r=s=o;continue e}l=l.parentNode}}r=r.return}zC(function(){var u=s,d=gx(n),f=[];e:{var h=mA.get(e);if(h!==void 0){var p=kx,m=e;switch(e){case"keypress":if(Ef(n)===0)break e;case"keydown":case"keyup":p=WL;break;case"focusin":m="focus",p=qm;break;case"focusout":m="blur",p=qm;break;case"beforeblur":case"afterblur":p=qm;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=sk;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=OL;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=qL;break;case dA:case fA:case hA:p=ML;break;case pA:p=VL;break;case"scroll":p=AL;break;case"wheel":p=XL;break;case"copy":case"cut":case"paste":p=$L;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=lk}var g=(t&4)!==0,y=!g&&e==="scroll",v=g?h!==null?h+"Capture":null:h;g=[];for(var k=u,w;k!==null;){w=k;var j=w.stateNode;if(w.tag===5&&j!==null&&(w=j,v!==null&&(j=Vc(k,v),j!=null&&g.push(tu(k,j,w)))),y)break;k=k.return}0<g.length&&(h=new p(h,m,null,n,d),f.push({event:h,listeners:g}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==Rv&&(m=n.relatedTarget||n.fromElement)&&(ps(m)||m[Ba]))break e;if((p||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=u,m=m?ps(m):null,m!==null&&(y=Us(m),m!==y||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=u),p!==m)){if(g=sk,j="onMouseLeave",v="onMouseEnter",k="mouse",(e==="pointerout"||e==="pointerover")&&(g=lk,j="onPointerLeave",v="onPointerEnter",k="pointer"),y=p==null?h:ko(p),w=m==null?h:ko(m),h=new g(j,k+"leave",p,n,d),h.target=y,h.relatedTarget=w,j=null,ps(d)===u&&(g=new g(v,k+"enter",m,n,d),g.target=w,g.relatedTarget=y,j=g),y=j,p&&m)t:{for(g=p,v=m,k=0,w=g;w;w=ao(w))k++;for(w=0,j=v;j;j=ao(j))w++;for(;0<k-w;)g=ao(g),k--;for(;0<w-k;)v=ao(v),w--;for(;k--;){if(g===v||v!==null&&g===v.alternate)break t;g=ao(g),v=ao(v)}g=null}else g=null;p!==null&&bk(f,h,p,g,!1),m!==null&&y!==null&&bk(f,y,m,g,!0)}}e:{if(h=u?ko(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var S=rD;else if(dk(h))if(sA)S=oD;else{S=iD;var x=aD}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(S=sD);if(S&&(S=S(e,u))){iA(f,S,n,d);break e}x&&x(e,h,u),e==="focusout"&&(x=h._wrapperState)&&x.controlled&&h.type==="number"&&Cv(h,"number",h.value)}switch(x=u?ko(u):window,e){case"focusin":(dk(x)||x.contentEditable==="true")&&(xo=x,zv=u,Rc=null);break;case"focusout":Rc=zv=xo=null;break;case"mousedown":Fv=!0;break;case"contextmenu":case"mouseup":case"dragend":Fv=!1,gk(f,n,d);break;case"selectionchange":if(uD)break;case"keydown":case"keyup":gk(f,n,d)}var N;if(jx)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else bo?rA(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(nA&&n.locale!=="ko"&&(bo||E!=="onCompositionStart"?E==="onCompositionEnd"&&bo&&(N=tA()):(hi=d,wx="value"in hi?hi.value:hi.textContent,bo=!0)),x=Hf(u,E),0<x.length&&(E=new ok(E,e,null,n,d),f.push({event:E,listeners:x}),N?E.data=N:(N=aA(n),N!==null&&(E.data=N)))),(N=ZL?JL(e,n):eD(e,n))&&(u=Hf(u,"onBeforeInput"),0<u.length&&(d=new ok("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=N))}gA(f,t)})}function tu(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Hf(e,t){for(var n=t+"Capture",r=[];e!==null;){var a=e,s=a.stateNode;a.tag===5&&s!==null&&(a=s,s=Vc(e,n),s!=null&&r.unshift(tu(e,s,a)),s=Vc(e,t),s!=null&&r.push(tu(e,s,a))),e=e.return}return r}function ao(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function bk(e,t,n,r,a){for(var s=t._reactName,o=[];n!==null&&n!==r;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&u!==null&&(l=u,a?(c=Vc(n,s),c!=null&&o.unshift(tu(n,c,l))):a||(c=Vc(n,s),c!=null&&o.push(tu(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var pD=/\r\n?/g,mD=/\u0000|\uFFFD/g;function xk(e){return(typeof e=="string"?e:""+e).replace(pD,`
38
+ `).replace(mD,"")}function Ld(e,t,n){if(t=xk(t),xk(e)!==t&&n)throw Error(oe(425))}function Gf(){}var Uv=null,Wv=null;function Hv(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Gv=typeof setTimeout=="function"?setTimeout:void 0,gD=typeof clearTimeout=="function"?clearTimeout:void 0,wk=typeof Promise=="function"?Promise:void 0,vD=typeof queueMicrotask=="function"?queueMicrotask:typeof wk<"u"?function(e){return wk.resolve(null).then(e).catch(yD)}:Gv;function yD(e){setTimeout(function(){throw e})}function eg(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(r===0){e.removeChild(a),Qc(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=a}while(n);Qc(t)}function ki(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==="$?")break;if(t==="/$")return null}}return e}function kk(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Sl=Math.random().toString(36).slice(2),sa="__reactFiber$"+Sl,nu="__reactProps$"+Sl,Ba="__reactContainer$"+Sl,qv="__reactEvents$"+Sl,bD="__reactListeners$"+Sl,xD="__reactHandles$"+Sl;function ps(e){var t=e[sa];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ba]||n[sa]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=kk(e);e!==null;){if(n=e[sa])return n;e=kk(e)}return t}e=n,n=e.parentNode}return null}function td(e){return e=e[sa]||e[Ba],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ko(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(oe(33))}function Np(e){return e[nu]||null}var Kv=[],So=-1;function Mi(e){return{current:e}}function xt(e){0>So||(e.current=Kv[So],Kv[So]=null,So--)}function ht(e,t){So++,Kv[So]=e.current,e.current=t}var Oi={},jn=Mi(Oi),zn=Mi(!1),Ts=Oi;function Go(e,t){var n=e.type.contextTypes;if(!n)return Oi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a={},s;for(s in n)a[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Fn(e){return e=e.childContextTypes,e!=null}function qf(){xt(zn),xt(jn)}function Sk(e,t,n){if(jn.current!==Oi)throw Error(oe(168));ht(jn,t),ht(zn,n)}function yA(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var a in r)if(!(a in t))throw Error(oe(108,aL(e)||"Unknown",a));return Ct({},n,r)}function Kf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Oi,Ts=jn.current,ht(jn,e),ht(zn,zn.current),!0}function jk(e,t,n){var r=e.stateNode;if(!r)throw Error(oe(169));n?(e=yA(e,t,Ts),r.__reactInternalMemoizedMergedChildContext=e,xt(zn),xt(jn),ht(jn,e)):xt(zn),ht(zn,n)}var Ca=null,Ep=!1,tg=!1;function bA(e){Ca===null?Ca=[e]:Ca.push(e)}function wD(e){Ep=!0,bA(e)}function Ii(){if(!tg&&Ca!==null){tg=!0;var e=0,t=nt;try{var n=Ca;for(nt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Ca=null,Ep=!1}catch(a){throw Ca!==null&&(Ca=Ca.slice(e+1)),HC(vx,Ii),a}finally{nt=t,tg=!1}}return null}var jo=[],No=0,Vf=null,Yf=0,mr=[],gr=0,Os=null,Aa=1,Ta="";function is(e,t){jo[No++]=Yf,jo[No++]=Vf,Vf=e,Yf=t}function xA(e,t,n){mr[gr++]=Aa,mr[gr++]=Ta,mr[gr++]=Os,Os=e;var r=Aa;e=Ta;var a=32-Br(r)-1;r&=~(1<<a),n+=1;var s=32-Br(t)+a;if(30<s){var o=a-a%5;s=(r&(1<<o)-1).toString(32),r>>=o,a-=o,Aa=1<<32-Br(t)+a|n<<a|r,Ta=s+e}else Aa=1<<s|n<<a|r,Ta=e}function Ex(e){e.return!==null&&(is(e,1),xA(e,1,0))}function _x(e){for(;e===Vf;)Vf=jo[--No],jo[No]=null,Yf=jo[--No],jo[No]=null;for(;e===Os;)Os=mr[--gr],mr[gr]=null,Ta=mr[--gr],mr[gr]=null,Aa=mr[--gr],mr[gr]=null}var tr=null,er=null,kt=!1,$r=null;function wA(e,t){var n=yr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Nk(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,tr=e,er=ki(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,tr=e,er=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Os!==null?{id:Aa,overflow:Ta}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=yr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,tr=e,er=null,!0):!1;default:return!1}}function Vv(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Yv(e){if(kt){var t=er;if(t){var n=t;if(!Nk(e,t)){if(Vv(e))throw Error(oe(418));t=ki(n.nextSibling);var r=tr;t&&Nk(e,t)?wA(r,n):(e.flags=e.flags&-4097|2,kt=!1,tr=e)}}else{if(Vv(e))throw Error(oe(418));e.flags=e.flags&-4097|2,kt=!1,tr=e}}}function Ek(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;tr=e}function Dd(e){if(e!==tr)return!1;if(!kt)return Ek(e),kt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Hv(e.type,e.memoizedProps)),t&&(t=er)){if(Vv(e))throw kA(),Error(oe(418));for(;t;)wA(e,t),t=ki(t.nextSibling)}if(Ek(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(oe(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){er=ki(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}er=null}}else er=tr?ki(e.stateNode.nextSibling):null;return!0}function kA(){for(var e=er;e;)e=ki(e.nextSibling)}function qo(){er=tr=null,kt=!1}function Cx(e){$r===null?$r=[e]:$r.push(e)}var kD=Ga.ReactCurrentBatchConfig;function ic(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(oe(309));var r=n.stateNode}if(!r)throw Error(oe(147,e));var a=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var l=a.refs;o===null?delete l[s]:l[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(oe(284));if(!n._owner)throw Error(oe(290,e))}return e}function Bd(e,t){throw e=Object.prototype.toString.call(t),Error(oe(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function _k(e){var t=e._init;return t(e._payload)}function SA(e){function t(v,k){if(e){var w=v.deletions;w===null?(v.deletions=[k],v.flags|=16):w.push(k)}}function n(v,k){if(!e)return null;for(;k!==null;)t(v,k),k=k.sibling;return null}function r(v,k){for(v=new Map;k!==null;)k.key!==null?v.set(k.key,k):v.set(k.index,k),k=k.sibling;return v}function a(v,k){return v=Ei(v,k),v.index=0,v.sibling=null,v}function s(v,k,w){return v.index=w,e?(w=v.alternate,w!==null?(w=w.index,w<k?(v.flags|=2,k):w):(v.flags|=2,k)):(v.flags|=1048576,k)}function o(v){return e&&v.alternate===null&&(v.flags|=2),v}function l(v,k,w,j){return k===null||k.tag!==6?(k=lg(w,v.mode,j),k.return=v,k):(k=a(k,w),k.return=v,k)}function c(v,k,w,j){var S=w.type;return S===yo?d(v,k,w.props.children,j,w.key):k!==null&&(k.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===ii&&_k(S)===k.type)?(j=a(k,w.props),j.ref=ic(v,k,w),j.return=v,j):(j=Rf(w.type,w.key,w.props,null,v.mode,j),j.ref=ic(v,k,w),j.return=v,j)}function u(v,k,w,j){return k===null||k.tag!==4||k.stateNode.containerInfo!==w.containerInfo||k.stateNode.implementation!==w.implementation?(k=cg(w,v.mode,j),k.return=v,k):(k=a(k,w.children||[]),k.return=v,k)}function d(v,k,w,j,S){return k===null||k.tag!==7?(k=Ss(w,v.mode,j,S),k.return=v,k):(k=a(k,w),k.return=v,k)}function f(v,k,w){if(typeof k=="string"&&k!==""||typeof k=="number")return k=lg(""+k,v.mode,w),k.return=v,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case Cd:return w=Rf(k.type,k.key,k.props,null,v.mode,w),w.ref=ic(v,null,k),w.return=v,w;case vo:return k=cg(k,v.mode,w),k.return=v,k;case ii:var j=k._init;return f(v,j(k._payload),w)}if(Sc(k)||ec(k))return k=Ss(k,v.mode,w,null),k.return=v,k;Bd(v,k)}return null}function h(v,k,w,j){var S=k!==null?k.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return S!==null?null:l(v,k,""+w,j);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Cd:return w.key===S?c(v,k,w,j):null;case vo:return w.key===S?u(v,k,w,j):null;case ii:return S=w._init,h(v,k,S(w._payload),j)}if(Sc(w)||ec(w))return S!==null?null:d(v,k,w,j,null);Bd(v,w)}return null}function p(v,k,w,j,S){if(typeof j=="string"&&j!==""||typeof j=="number")return v=v.get(w)||null,l(k,v,""+j,S);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Cd:return v=v.get(j.key===null?w:j.key)||null,c(k,v,j,S);case vo:return v=v.get(j.key===null?w:j.key)||null,u(k,v,j,S);case ii:var x=j._init;return p(v,k,w,x(j._payload),S)}if(Sc(j)||ec(j))return v=v.get(w)||null,d(k,v,j,S,null);Bd(k,j)}return null}function m(v,k,w,j){for(var S=null,x=null,N=k,E=k=0,P=null;N!==null&&E<w.length;E++){N.index>E?(P=N,N=null):P=N.sibling;var _=h(v,N,w[E],j);if(_===null){N===null&&(N=P);break}e&&N&&_.alternate===null&&t(v,N),k=s(_,k,E),x===null?S=_:x.sibling=_,x=_,N=P}if(E===w.length)return n(v,N),kt&&is(v,E),S;if(N===null){for(;E<w.length;E++)N=f(v,w[E],j),N!==null&&(k=s(N,k,E),x===null?S=N:x.sibling=N,x=N);return kt&&is(v,E),S}for(N=r(v,N);E<w.length;E++)P=p(N,v,E,w[E],j),P!==null&&(e&&P.alternate!==null&&N.delete(P.key===null?E:P.key),k=s(P,k,E),x===null?S=P:x.sibling=P,x=P);return e&&N.forEach(function(R){return t(v,R)}),kt&&is(v,E),S}function g(v,k,w,j){var S=ec(w);if(typeof S!="function")throw Error(oe(150));if(w=S.call(w),w==null)throw Error(oe(151));for(var x=S=null,N=k,E=k=0,P=null,_=w.next();N!==null&&!_.done;E++,_=w.next()){N.index>E?(P=N,N=null):P=N.sibling;var R=h(v,N,_.value,j);if(R===null){N===null&&(N=P);break}e&&N&&R.alternate===null&&t(v,N),k=s(R,k,E),x===null?S=R:x.sibling=R,x=R,N=P}if(_.done)return n(v,N),kt&&is(v,E),S;if(N===null){for(;!_.done;E++,_=w.next())_=f(v,_.value,j),_!==null&&(k=s(_,k,E),x===null?S=_:x.sibling=_,x=_);return kt&&is(v,E),S}for(N=r(v,N);!_.done;E++,_=w.next())_=p(N,v,E,_.value,j),_!==null&&(e&&_.alternate!==null&&N.delete(_.key===null?E:_.key),k=s(_,k,E),x===null?S=_:x.sibling=_,x=_);return e&&N.forEach(function(T){return t(v,T)}),kt&&is(v,E),S}function y(v,k,w,j){if(typeof w=="object"&&w!==null&&w.type===yo&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Cd:e:{for(var S=w.key,x=k;x!==null;){if(x.key===S){if(S=w.type,S===yo){if(x.tag===7){n(v,x.sibling),k=a(x,w.props.children),k.return=v,v=k;break e}}else if(x.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===ii&&_k(S)===x.type){n(v,x.sibling),k=a(x,w.props),k.ref=ic(v,x,w),k.return=v,v=k;break e}n(v,x);break}else t(v,x);x=x.sibling}w.type===yo?(k=Ss(w.props.children,v.mode,j,w.key),k.return=v,v=k):(j=Rf(w.type,w.key,w.props,null,v.mode,j),j.ref=ic(v,k,w),j.return=v,v=j)}return o(v);case vo:e:{for(x=w.key;k!==null;){if(k.key===x)if(k.tag===4&&k.stateNode.containerInfo===w.containerInfo&&k.stateNode.implementation===w.implementation){n(v,k.sibling),k=a(k,w.children||[]),k.return=v,v=k;break e}else{n(v,k);break}else t(v,k);k=k.sibling}k=cg(w,v.mode,j),k.return=v,v=k}return o(v);case ii:return x=w._init,y(v,k,x(w._payload),j)}if(Sc(w))return m(v,k,w,j);if(ec(w))return g(v,k,w,j);Bd(v,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,k!==null&&k.tag===6?(n(v,k.sibling),k=a(k,w),k.return=v,v=k):(n(v,k),k=lg(w,v.mode,j),k.return=v,v=k),o(v)):n(v,k)}return y}var Ko=SA(!0),jA=SA(!1),Xf=Mi(null),Qf=null,Eo=null,Ax=null;function Tx(){Ax=Eo=Qf=null}function Ox(e){var t=Xf.current;xt(Xf),e._currentValue=t}function Xv(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Lo(e,t){Qf=e,Ax=Eo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Dn=!0),e.firstContext=null)}function kr(e){var t=e._currentValue;if(Ax!==e)if(e={context:e,memoizedValue:t,next:null},Eo===null){if(Qf===null)throw Error(oe(308));Eo=e,Qf.dependencies={lanes:0,firstContext:e}}else Eo=Eo.next=e;return t}var ms=null;function Px(e){ms===null?ms=[e]:ms.push(e)}function NA(e,t,n,r){var a=t.interleaved;return a===null?(n.next=n,Px(t)):(n.next=a.next,a.next=n),t.interleaved=n,za(e,r)}function za(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var si=!1;function Rx(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function EA(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ma(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Si(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,qe&2){var a=r.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),r.pending=t,za(e,n)}return a=r.interleaved,a===null?(t.next=t,Px(r)):(t.next=a.next,a.next=t),r.interleaved=t,za(e,n)}function _f(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yx(e,n)}}function Ck(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var a=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?a=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?a=s=t:s=s.next=t}else a=s=t;n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Zf(e,t,n,r){var a=e.updateQueue;si=!1;var s=a.firstBaseUpdate,o=a.lastBaseUpdate,l=a.shared.pending;if(l!==null){a.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?s=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(s!==null){var f=a.baseState;o=0,d=u=c=null,l=s;do{var h=l.lane,p=l.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var m=e,g=l;switch(h=t,p=n,g.tag){case 1:if(m=g.payload,typeof m=="function"){f=m.call(p,f,h);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,h=typeof m=="function"?m.call(p,f,h):m,h==null)break e;f=Ct({},f,h);break e;case 2:si=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=a.effects,h===null?a.effects=[l]:h.push(l))}else p={eventTime:p,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=f):d=d.next=p,o|=h;if(l=l.next,l===null){if(l=a.shared.pending,l===null)break;h=l,l=h.next,h.next=null,a.lastBaseUpdate=h,a.shared.pending=null}}while(!0);if(d===null&&(c=f),a.baseState=c,a.firstBaseUpdate=u,a.lastBaseUpdate=d,t=a.shared.interleaved,t!==null){a=t;do o|=a.lane,a=a.next;while(a!==t)}else s===null&&(a.shared.lanes=0);Rs|=o,e.lanes=o,e.memoizedState=f}}function Ak(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],a=r.callback;if(a!==null){if(r.callback=null,r=n,typeof a!="function")throw Error(oe(191,a));a.call(r)}}}var nd={},da=Mi(nd),ru=Mi(nd),au=Mi(nd);function gs(e){if(e===nd)throw Error(oe(174));return e}function Mx(e,t){switch(ht(au,t),ht(ru,e),ht(da,nd),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Tv(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Tv(t,e)}xt(da),ht(da,t)}function Vo(){xt(da),xt(ru),xt(au)}function _A(e){gs(au.current);var t=gs(da.current),n=Tv(t,e.type);t!==n&&(ht(ru,e),ht(da,n))}function Ix(e){ru.current===e&&(xt(da),xt(ru))}var Nt=Mi(0);function Jf(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){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 ng=[];function $x(){for(var e=0;e<ng.length;e++)ng[e]._workInProgressVersionPrimary=null;ng.length=0}var Cf=Ga.ReactCurrentDispatcher,rg=Ga.ReactCurrentBatchConfig,Ps=0,Et=null,Gt=null,Zt=null,eh=!1,Mc=!1,iu=0,SD=0;function mn(){throw Error(oe(321))}function Lx(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Hr(e[n],t[n]))return!1;return!0}function Dx(e,t,n,r,a,s){if(Ps=s,Et=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Cf.current=e===null||e.memoizedState===null?_D:CD,e=n(r,a),Mc){s=0;do{if(Mc=!1,iu=0,25<=s)throw Error(oe(301));s+=1,Zt=Gt=null,t.updateQueue=null,Cf.current=AD,e=n(r,a)}while(Mc)}if(Cf.current=th,t=Gt!==null&&Gt.next!==null,Ps=0,Zt=Gt=Et=null,eh=!1,t)throw Error(oe(300));return e}function Bx(){var e=iu!==0;return iu=0,e}function aa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Zt===null?Et.memoizedState=Zt=e:Zt=Zt.next=e,Zt}function Sr(){if(Gt===null){var e=Et.alternate;e=e!==null?e.memoizedState:null}else e=Gt.next;var t=Zt===null?Et.memoizedState:Zt.next;if(t!==null)Zt=t,Gt=e;else{if(e===null)throw Error(oe(310));Gt=e,e={memoizedState:Gt.memoizedState,baseState:Gt.baseState,baseQueue:Gt.baseQueue,queue:Gt.queue,next:null},Zt===null?Et.memoizedState=Zt=e:Zt=Zt.next=e}return Zt}function su(e,t){return typeof t=="function"?t(e):t}function ag(e){var t=Sr(),n=t.queue;if(n===null)throw Error(oe(311));n.lastRenderedReducer=e;var r=Gt,a=r.baseQueue,s=n.pending;if(s!==null){if(a!==null){var o=a.next;a.next=s.next,s.next=o}r.baseQueue=a=s,n.pending=null}if(a!==null){s=a.next,r=r.baseState;var l=o=null,c=null,u=s;do{var d=u.lane;if((Ps&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=f,o=r):c=c.next=f,Et.lanes|=d,Rs|=d}u=u.next}while(u!==null&&u!==s);c===null?o=r:c.next=l,Hr(r,t.memoizedState)||(Dn=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){a=e;do s=a.lane,Et.lanes|=s,Rs|=s,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ig(e){var t=Sr(),n=t.queue;if(n===null)throw Error(oe(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,s=t.memoizedState;if(a!==null){n.pending=null;var o=a=a.next;do s=e(s,o.action),o=o.next;while(o!==a);Hr(s,t.memoizedState)||(Dn=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function CA(){}function AA(e,t){var n=Et,r=Sr(),a=t(),s=!Hr(r.memoizedState,a);if(s&&(r.memoizedState=a,Dn=!0),r=r.queue,zx(PA.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||Zt!==null&&Zt.memoizedState.tag&1){if(n.flags|=2048,ou(9,OA.bind(null,n,r,a,t),void 0,null),tn===null)throw Error(oe(349));Ps&30||TA(n,t,a)}return a}function TA(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Et.updateQueue,t===null?(t={lastEffect:null,stores:null},Et.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function OA(e,t,n,r){t.value=n,t.getSnapshot=r,RA(t)&&MA(e)}function PA(e,t,n){return n(function(){RA(t)&&MA(e)})}function RA(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Hr(e,n)}catch{return!0}}function MA(e){var t=za(e,1);t!==null&&zr(t,e,1,-1)}function Tk(e){var t=aa();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:su,lastRenderedState:e},t.queue=e,e=e.dispatch=ED.bind(null,Et,e),[t.memoizedState,e]}function ou(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Et.updateQueue,t===null?(t={lastEffect:null,stores:null},Et.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function IA(){return Sr().memoizedState}function Af(e,t,n,r){var a=aa();Et.flags|=e,a.memoizedState=ou(1|t,n,void 0,r===void 0?null:r)}function _p(e,t,n,r){var a=Sr();r=r===void 0?null:r;var s=void 0;if(Gt!==null){var o=Gt.memoizedState;if(s=o.destroy,r!==null&&Lx(r,o.deps)){a.memoizedState=ou(t,n,s,r);return}}Et.flags|=e,a.memoizedState=ou(1|t,n,s,r)}function Ok(e,t){return Af(8390656,8,e,t)}function zx(e,t){return _p(2048,8,e,t)}function $A(e,t){return _p(4,2,e,t)}function LA(e,t){return _p(4,4,e,t)}function DA(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function BA(e,t,n){return n=n!=null?n.concat([e]):null,_p(4,4,DA.bind(null,t,e),n)}function Fx(){}function zA(e,t){var n=Sr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Lx(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function FA(e,t){var n=Sr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Lx(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function UA(e,t,n){return Ps&21?(Hr(n,t)||(n=KC(),Et.lanes|=n,Rs|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Dn=!0),e.memoizedState=n)}function jD(e,t){var n=nt;nt=n!==0&&4>n?n:4,e(!0);var r=rg.transition;rg.transition={};try{e(!1),t()}finally{nt=n,rg.transition=r}}function WA(){return Sr().memoizedState}function ND(e,t,n){var r=Ni(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},HA(e))GA(t,n);else if(n=NA(e,t,n,r),n!==null){var a=On();zr(n,e,r,a),qA(n,t,r)}}function ED(e,t,n){var r=Ni(e),a={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(HA(e))GA(t,a);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,l=s(o,n);if(a.hasEagerState=!0,a.eagerState=l,Hr(l,o)){var c=t.interleaved;c===null?(a.next=a,Px(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}n=NA(e,t,a,r),n!==null&&(a=On(),zr(n,e,r,a),qA(n,t,r))}}function HA(e){var t=e.alternate;return e===Et||t!==null&&t===Et}function GA(e,t){Mc=eh=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function qA(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yx(e,n)}}var th={readContext:kr,useCallback:mn,useContext:mn,useEffect:mn,useImperativeHandle:mn,useInsertionEffect:mn,useLayoutEffect:mn,useMemo:mn,useReducer:mn,useRef:mn,useState:mn,useDebugValue:mn,useDeferredValue:mn,useTransition:mn,useMutableSource:mn,useSyncExternalStore:mn,useId:mn,unstable_isNewReconciler:!1},_D={readContext:kr,useCallback:function(e,t){return aa().memoizedState=[e,t===void 0?null:t],e},useContext:kr,useEffect:Ok,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Af(4194308,4,DA.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Af(4194308,4,e,t)},useInsertionEffect:function(e,t){return Af(4,2,e,t)},useMemo:function(e,t){var n=aa();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=aa();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ND.bind(null,Et,e),[r.memoizedState,e]},useRef:function(e){var t=aa();return e={current:e},t.memoizedState=e},useState:Tk,useDebugValue:Fx,useDeferredValue:function(e){return aa().memoizedState=e},useTransition:function(){var e=Tk(!1),t=e[0];return e=jD.bind(null,e[1]),aa().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Et,a=aa();if(kt){if(n===void 0)throw Error(oe(407));n=n()}else{if(n=t(),tn===null)throw Error(oe(349));Ps&30||TA(r,t,n)}a.memoizedState=n;var s={value:n,getSnapshot:t};return a.queue=s,Ok(PA.bind(null,r,s,e),[e]),r.flags|=2048,ou(9,OA.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=aa(),t=tn.identifierPrefix;if(kt){var n=Ta,r=Aa;n=(r&~(1<<32-Br(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=iu++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=SD++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},CD={readContext:kr,useCallback:zA,useContext:kr,useEffect:zx,useImperativeHandle:BA,useInsertionEffect:$A,useLayoutEffect:LA,useMemo:FA,useReducer:ag,useRef:IA,useState:function(){return ag(su)},useDebugValue:Fx,useDeferredValue:function(e){var t=Sr();return UA(t,Gt.memoizedState,e)},useTransition:function(){var e=ag(su)[0],t=Sr().memoizedState;return[e,t]},useMutableSource:CA,useSyncExternalStore:AA,useId:WA,unstable_isNewReconciler:!1},AD={readContext:kr,useCallback:zA,useContext:kr,useEffect:zx,useImperativeHandle:BA,useInsertionEffect:$A,useLayoutEffect:LA,useMemo:FA,useReducer:ig,useRef:IA,useState:function(){return ig(su)},useDebugValue:Fx,useDeferredValue:function(e){var t=Sr();return Gt===null?t.memoizedState=e:UA(t,Gt.memoizedState,e)},useTransition:function(){var e=ig(su)[0],t=Sr().memoizedState;return[e,t]},useMutableSource:CA,useSyncExternalStore:AA,useId:WA,unstable_isNewReconciler:!1};function Rr(e,t){if(e&&e.defaultProps){t=Ct({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Qv(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ct({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Cp={isMounted:function(e){return(e=e._reactInternals)?Us(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=On(),a=Ni(e),s=Ma(r,a);s.payload=t,n!=null&&(s.callback=n),t=Si(e,s,a),t!==null&&(zr(t,e,a,r),_f(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=On(),a=Ni(e),s=Ma(r,a);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Si(e,s,a),t!==null&&(zr(t,e,a,r),_f(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=On(),r=Ni(e),a=Ma(n,r);a.tag=2,t!=null&&(a.callback=t),t=Si(e,a,r),t!==null&&(zr(t,e,r,n),_f(t,e,r))}};function Pk(e,t,n,r,a,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!Jc(n,r)||!Jc(a,s):!0}function KA(e,t,n){var r=!1,a=Oi,s=t.contextType;return typeof s=="object"&&s!==null?s=kr(s):(a=Fn(t)?Ts:jn.current,r=t.contextTypes,s=(r=r!=null)?Go(e,a):Oi),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Cp,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=s),t}function Rk(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&&Cp.enqueueReplaceState(t,t.state,null)}function Zv(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},Rx(e);var s=t.contextType;typeof s=="object"&&s!==null?a.context=kr(s):(s=Fn(t)?Ts:jn.current,a.context=Go(e,s)),a.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Qv(e,t,s,n),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&Cp.enqueueReplaceState(a,a.state,null),Zf(e,n,a,r),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function Yo(e,t){try{var n="",r=t;do n+=rL(r),r=r.return;while(r);var a=n}catch(s){a=`
39
+ Error generating stack: `+s.message+`
40
+ `+s.stack}return{value:e,source:t,stack:a,digest:null}}function sg(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Jv(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var TD=typeof WeakMap=="function"?WeakMap:Map;function VA(e,t,n){n=Ma(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){rh||(rh=!0,cy=r),Jv(e,t)},n}function YA(e,t,n){n=Ma(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var a=t.value;n.payload=function(){return r(a)},n.callback=function(){Jv(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Jv(e,t),typeof r!="function"&&(ji===null?ji=new Set([this]):ji.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Mk(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new TD;var a=new Set;r.set(t,a)}else a=r.get(t),a===void 0&&(a=new Set,r.set(t,a));a.has(n)||(a.add(n),e=HD.bind(null,e,t,n),t.then(e,e))}function Ik(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function $k(e,t,n,r,a){return e.mode&1?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Ma(-1,1),t.tag=2,Si(n,t,1))),n.lanes|=1),e)}var OD=Ga.ReactCurrentOwner,Dn=!1;function Cn(e,t,n,r){t.child=e===null?jA(t,null,n,r):Ko(t,e.child,n,r)}function Lk(e,t,n,r,a){n=n.render;var s=t.ref;return Lo(t,a),r=Dx(e,t,n,r,s,a),n=Bx(),e!==null&&!Dn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Fa(e,t,a)):(kt&&n&&Ex(t),t.flags|=1,Cn(e,t,r,a),t.child)}function Dk(e,t,n,r,a){if(e===null){var s=n.type;return typeof s=="function"&&!Yx(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,XA(e,t,s,r,a)):(e=Rf(n.type,null,r,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&a)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:Jc,n(o,r)&&e.ref===t.ref)return Fa(e,t,a)}return t.flags|=1,e=Ei(s,r),e.ref=t.ref,e.return=t,t.child=e}function XA(e,t,n,r,a){if(e!==null){var s=e.memoizedProps;if(Jc(s,r)&&e.ref===t.ref)if(Dn=!1,t.pendingProps=r=s,(e.lanes&a)!==0)e.flags&131072&&(Dn=!0);else return t.lanes=e.lanes,Fa(e,t,a)}return ey(e,t,n,r,a)}function QA(e,t,n){var r=t.pendingProps,a=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ht(Co,Qn),Qn|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ht(Co,Qn),Qn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,ht(Co,Qn),Qn|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,ht(Co,Qn),Qn|=r;return Cn(e,t,a,n),t.child}function ZA(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ey(e,t,n,r,a){var s=Fn(n)?Ts:jn.current;return s=Go(t,s),Lo(t,a),n=Dx(e,t,n,r,s,a),r=Bx(),e!==null&&!Dn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Fa(e,t,a)):(kt&&r&&Ex(t),t.flags|=1,Cn(e,t,n,a),t.child)}function Bk(e,t,n,r,a){if(Fn(n)){var s=!0;Kf(t)}else s=!1;if(Lo(t,a),t.stateNode===null)Tf(e,t),KA(t,n,r),Zv(t,n,r,a),r=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=kr(u):(u=Fn(n)?Ts:jn.current,u=Go(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==r||c!==u)&&Rk(t,o,r,u),si=!1;var h=t.memoizedState;o.state=h,Zf(t,r,o,a),c=t.memoizedState,l!==r||h!==c||zn.current||si?(typeof d=="function"&&(Qv(t,n,d,r),c=t.memoizedState),(l=si||Pk(t,n,l,r,h,c,u))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=u,r=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,EA(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Rr(t.type,l),o.props=u,f=t.pendingProps,h=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=kr(c):(c=Fn(n)?Ts:jn.current,c=Go(t,c));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==f||h!==c)&&Rk(t,o,r,c),si=!1,h=t.memoizedState,o.state=h,Zf(t,r,o,a);var m=t.memoizedState;l!==f||h!==m||zn.current||si?(typeof p=="function"&&(Qv(t,n,p,r),m=t.memoizedState),(u=si||Pk(t,n,u,r,h,m,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return ty(e,t,n,r,s,a)}function ty(e,t,n,r,a,s){ZA(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return a&&jk(t,n,!1),Fa(e,t,s);r=t.stateNode,OD.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Ko(t,e.child,null,s),t.child=Ko(t,null,l,s)):Cn(e,t,l,s),t.memoizedState=r.state,a&&jk(t,n,!0),t.child}function JA(e){var t=e.stateNode;t.pendingContext?Sk(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Sk(e,t.context,!1),Mx(e,t.containerInfo)}function zk(e,t,n,r,a){return qo(),Cx(a),t.flags|=256,Cn(e,t,n,r),t.child}var ny={dehydrated:null,treeContext:null,retryLane:0};function ry(e){return{baseLanes:e,cachePool:null,transitions:null}}function eT(e,t,n){var r=t.pendingProps,a=Nt.current,s=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(a&2)!==0),l?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),ht(Nt,a&1),e===null)return Yv(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=Op(o,r,0,null),e=Ss(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=ry(n),t.memoizedState=ny,e):Ux(t,o));if(a=e.memoizedState,a!==null&&(l=a.dehydrated,l!==null))return PD(e,t,o,r,l,a,n);if(s){s=r.fallback,o=t.mode,a=e.child,l=a.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&t.child!==a?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Ei(a,c),r.subtreeFlags=a.subtreeFlags&14680064),l!==null?s=Ei(l,s):(s=Ss(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?ry(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=ny,r}return s=e.child,e=s.sibling,r=Ei(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Ux(e,t){return t=Op({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function zd(e,t,n,r){return r!==null&&Cx(r),Ko(t,e.child,null,n),e=Ux(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function PD(e,t,n,r,a,s,o){if(n)return t.flags&256?(t.flags&=-257,r=sg(Error(oe(422))),zd(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,a=t.mode,r=Op({mode:"visible",children:r.children},a,0,null),s=Ss(s,a,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&Ko(t,e.child,null,o),t.child.memoizedState=ry(o),t.memoizedState=ny,s);if(!(t.mode&1))return zd(e,t,o,null);if(a.data==="$!"){if(r=a.nextSibling&&a.nextSibling.dataset,r)var l=r.dgst;return r=l,s=Error(oe(419)),r=sg(s,r,void 0),zd(e,t,o,r)}if(l=(o&e.childLanes)!==0,Dn||l){if(r=tn,r!==null){switch(o&-o){case 4:a=2;break;case 16:a=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(r.suspendedLanes|o)?0:a,a!==0&&a!==s.retryLane&&(s.retryLane=a,za(e,a),zr(r,e,a,-1))}return Vx(),r=sg(Error(oe(421))),zd(e,t,o,r)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=GD.bind(null,e),a._reactRetry=t,null):(e=s.treeContext,er=ki(a.nextSibling),tr=t,kt=!0,$r=null,e!==null&&(mr[gr++]=Aa,mr[gr++]=Ta,mr[gr++]=Os,Aa=e.id,Ta=e.overflow,Os=t),t=Ux(t,r.children),t.flags|=4096,t)}function Fk(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Xv(e.return,t,n)}function og(e,t,n,r,a){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=a)}function tT(e,t,n){var r=t.pendingProps,a=r.revealOrder,s=r.tail;if(Cn(e,t,r.children,n),r=Nt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Fk(e,n,t);else if(e.tag===19)Fk(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ht(Nt,r),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&Jf(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),og(t,!1,a,n,s);break;case"backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Jf(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}og(t,!0,n,null,s);break;case"together":og(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Tf(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Fa(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Rs|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(oe(153));if(t.child!==null){for(e=t.child,n=Ei(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ei(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function RD(e,t,n){switch(t.tag){case 3:JA(t),qo();break;case 5:_A(t);break;case 1:Fn(t.type)&&Kf(t);break;case 4:Mx(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,a=t.memoizedProps.value;ht(Xf,r._currentValue),r._currentValue=a;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ht(Nt,Nt.current&1),t.flags|=128,null):n&t.child.childLanes?eT(e,t,n):(ht(Nt,Nt.current&1),e=Fa(e,t,n),e!==null?e.sibling:null);ht(Nt,Nt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return tT(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),ht(Nt,Nt.current),r)break;return null;case 22:case 23:return t.lanes=0,QA(e,t,n)}return Fa(e,t,n)}var nT,ay,rT,aT;nT=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};ay=function(){};rT=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,gs(da.current);var s=null;switch(n){case"input":a=Ev(e,a),r=Ev(e,r),s=[];break;case"select":a=Ct({},a,{value:void 0}),r=Ct({},r,{value:void 0}),s=[];break;case"textarea":a=Av(e,a),r=Av(e,r),s=[];break;default:typeof a.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Gf)}Ov(n,r);var o;n=null;for(u in a)if(!r.hasOwnProperty(u)&&a.hasOwnProperty(u)&&a[u]!=null)if(u==="style"){var l=a[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(qc.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var c=r[u];if(l=a!=null?a[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(s||(s=[]),s.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(s=s||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(s=s||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(qc.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&gt("scroll",e),s||l===c||(s=[])):(s=s||[]).push(u,c))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}};aT=function(e,t,n,r){n!==r&&(t.flags|=4)};function sc(e,t){if(!kt)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 gn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags&14680064,r|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function MD(e,t,n){var r=t.pendingProps;switch(_x(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gn(t),null;case 1:return Fn(t.type)&&qf(),gn(t),null;case 3:return r=t.stateNode,Vo(),xt(zn),xt(jn),$x(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Dd(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,$r!==null&&(fy($r),$r=null))),ay(e,t),gn(t),null;case 5:Ix(t);var a=gs(au.current);if(n=t.type,e!==null&&t.stateNode!=null)rT(e,t,n,r,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(oe(166));return gn(t),null}if(e=gs(da.current),Dd(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[sa]=t,r[nu]=s,e=(t.mode&1)!==0,n){case"dialog":gt("cancel",r),gt("close",r);break;case"iframe":case"object":case"embed":gt("load",r);break;case"video":case"audio":for(a=0;a<Nc.length;a++)gt(Nc[a],r);break;case"source":gt("error",r);break;case"img":case"image":case"link":gt("error",r),gt("load",r);break;case"details":gt("toggle",r);break;case"input":X0(r,s),gt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},gt("invalid",r);break;case"textarea":Z0(r,s),gt("invalid",r)}Ov(n,s),a=null;for(var o in s)if(s.hasOwnProperty(o)){var l=s[o];o==="children"?typeof l=="string"?r.textContent!==l&&(s.suppressHydrationWarning!==!0&&Ld(r.textContent,l,e),a=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(s.suppressHydrationWarning!==!0&&Ld(r.textContent,l,e),a=["children",""+l]):qc.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&gt("scroll",r)}switch(n){case"input":Ad(r),Q0(r,s,!0);break;case"textarea":Ad(r),J0(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Gf)}r=a,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=PC(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[sa]=t,e[nu]=r,nT(e,t,!1,!1),t.stateNode=e;e:{switch(o=Pv(n,r),n){case"dialog":gt("cancel",e),gt("close",e),a=r;break;case"iframe":case"object":case"embed":gt("load",e),a=r;break;case"video":case"audio":for(a=0;a<Nc.length;a++)gt(Nc[a],e);a=r;break;case"source":gt("error",e),a=r;break;case"img":case"image":case"link":gt("error",e),gt("load",e),a=r;break;case"details":gt("toggle",e),a=r;break;case"input":X0(e,r),a=Ev(e,r),gt("invalid",e);break;case"option":a=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},a=Ct({},r,{value:void 0}),gt("invalid",e);break;case"textarea":Z0(e,r),a=Av(e,r),gt("invalid",e);break;default:a=r}Ov(n,a),l=a;for(s in l)if(l.hasOwnProperty(s)){var c=l[s];s==="style"?IC(e,c):s==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&RC(e,c)):s==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Kc(e,c):typeof c=="number"&&Kc(e,""+c):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(qc.hasOwnProperty(s)?c!=null&&s==="onScroll"&&gt("scroll",e):c!=null&&fx(e,s,c,o))}switch(n){case"input":Ad(e),Q0(e,r,!1);break;case"textarea":Ad(e),J0(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Ti(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Ro(e,!!r.multiple,s,!1):r.defaultValue!=null&&Ro(e,!!r.multiple,r.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=Gf)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return gn(t),null;case 6:if(e&&t.stateNode!=null)aT(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(oe(166));if(n=gs(au.current),gs(da.current),Dd(t)){if(r=t.stateNode,n=t.memoizedProps,r[sa]=t,(s=r.nodeValue!==n)&&(e=tr,e!==null))switch(e.tag){case 3:Ld(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ld(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[sa]=t,t.stateNode=r}return gn(t),null;case 13:if(xt(Nt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(kt&&er!==null&&t.mode&1&&!(t.flags&128))kA(),qo(),t.flags|=98560,s=!1;else if(s=Dd(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(oe(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(oe(317));s[sa]=t}else qo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;gn(t),s=!1}else $r!==null&&(fy($r),$r=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Nt.current&1?qt===0&&(qt=3):Vx())),t.updateQueue!==null&&(t.flags|=4),gn(t),null);case 4:return Vo(),ay(e,t),e===null&&eu(t.stateNode.containerInfo),gn(t),null;case 10:return Ox(t.type._context),gn(t),null;case 17:return Fn(t.type)&&qf(),gn(t),null;case 19:if(xt(Nt),s=t.memoizedState,s===null)return gn(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)sc(s,!1);else{if(qt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Jf(e),o!==null){for(t.flags|=128,sc(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ht(Nt,Nt.current&1|2),t.child}e=e.sibling}s.tail!==null&&Rt()>Xo&&(t.flags|=128,r=!0,sc(s,!1),t.lanes=4194304)}else{if(!r)if(e=Jf(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),sc(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!kt)return gn(t),null}else 2*Rt()-s.renderingStartTime>Xo&&n!==1073741824&&(t.flags|=128,r=!0,sc(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Rt(),t.sibling=null,n=Nt.current,ht(Nt,r?n&1|2:n&1),t):(gn(t),null);case 22:case 23:return Kx(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Qn&1073741824&&(gn(t),t.subtreeFlags&6&&(t.flags|=8192)):gn(t),null;case 24:return null;case 25:return null}throw Error(oe(156,t.tag))}function ID(e,t){switch(_x(t),t.tag){case 1:return Fn(t.type)&&qf(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vo(),xt(zn),xt(jn),$x(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ix(t),null;case 13:if(xt(Nt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(oe(340));qo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return xt(Nt),null;case 4:return Vo(),null;case 10:return Ox(t.type._context),null;case 22:case 23:return Kx(),null;case 24:return null;default:return null}}var Fd=!1,xn=!1,$D=typeof WeakSet=="function"?WeakSet:Set,ye=null;function _o(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ot(e,t,r)}else n.current=null}function iy(e,t,n){try{n()}catch(r){Ot(e,t,r)}}var Uk=!1;function LD(e,t){if(Uv=Uf,e=cA(),Nx(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{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,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||a!==0&&f.nodeType!==3||(l=o+a),f!==s||r!==0&&f.nodeType!==3||(c=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++u===a&&(l=o),h===s&&++d===r&&(c=o),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Wv={focusedElem:e,selectionRange:n},Uf=!1,ye=t;ye!==null;)if(t=ye,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ye=e;else for(;ye!==null;){t=ye;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var g=m.memoizedProps,y=m.memoizedState,v=t.stateNode,k=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:Rr(t.type,g),y);v.__reactInternalSnapshotBeforeUpdate=k}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(oe(163))}}catch(j){Ot(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,ye=e;break}ye=t.return}return m=Uk,Uk=!1,m}function Ic(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var a=r=r.next;do{if((a.tag&e)===e){var s=a.destroy;a.destroy=void 0,s!==void 0&&iy(t,n,s)}a=a.next}while(a!==r)}}function Ap(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function sy(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function iT(e){var t=e.alternate;t!==null&&(e.alternate=null,iT(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[sa],delete t[nu],delete t[qv],delete t[bD],delete t[xD])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function sT(e){return e.tag===5||e.tag===3||e.tag===4}function Wk(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||sT(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.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function oy(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Gf));else if(r!==4&&(e=e.child,e!==null))for(oy(e,t,n),e=e.sibling;e!==null;)oy(e,t,n),e=e.sibling}function ly(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&&(e=e.child,e!==null))for(ly(e,t,n),e=e.sibling;e!==null;)ly(e,t,n),e=e.sibling}var un=null,Mr=!1;function ni(e,t,n){for(n=n.child;n!==null;)oT(e,t,n),n=n.sibling}function oT(e,t,n){if(ua&&typeof ua.onCommitFiberUnmount=="function")try{ua.onCommitFiberUnmount(wp,n)}catch{}switch(n.tag){case 5:xn||_o(n,t);case 6:var r=un,a=Mr;un=null,ni(e,t,n),un=r,Mr=a,un!==null&&(Mr?(e=un,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):un.removeChild(n.stateNode));break;case 18:un!==null&&(Mr?(e=un,n=n.stateNode,e.nodeType===8?eg(e.parentNode,n):e.nodeType===1&&eg(e,n),Qc(e)):eg(un,n.stateNode));break;case 4:r=un,a=Mr,un=n.stateNode.containerInfo,Mr=!0,ni(e,t,n),un=r,Mr=a;break;case 0:case 11:case 14:case 15:if(!xn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){a=r=r.next;do{var s=a,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&iy(n,t,o),a=a.next}while(a!==r)}ni(e,t,n);break;case 1:if(!xn&&(_o(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Ot(n,t,l)}ni(e,t,n);break;case 21:ni(e,t,n);break;case 22:n.mode&1?(xn=(r=xn)||n.memoizedState!==null,ni(e,t,n),xn=r):ni(e,t,n);break;default:ni(e,t,n)}}function Hk(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new $D),t.forEach(function(r){var a=qD.bind(null,e,r);n.has(r)||(n.add(r),r.then(a,a))})}}function Or(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r];try{var s=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:un=l.stateNode,Mr=!1;break e;case 3:un=l.stateNode.containerInfo,Mr=!0;break e;case 4:un=l.stateNode.containerInfo,Mr=!0;break e}l=l.return}if(un===null)throw Error(oe(160));oT(s,o,a),un=null,Mr=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(u){Ot(a,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)lT(t,e),t=t.sibling}function lT(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Or(t,e),ta(e),r&4){try{Ic(3,e,e.return),Ap(3,e)}catch(g){Ot(e,e.return,g)}try{Ic(5,e,e.return)}catch(g){Ot(e,e.return,g)}}break;case 1:Or(t,e),ta(e),r&512&&n!==null&&_o(n,n.return);break;case 5:if(Or(t,e),ta(e),r&512&&n!==null&&_o(n,n.return),e.flags&32){var a=e.stateNode;try{Kc(a,"")}catch(g){Ot(e,e.return,g)}}if(r&4&&(a=e.stateNode,a!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&s.type==="radio"&&s.name!=null&&TC(a,s),Pv(l,o);var u=Pv(l,s);for(o=0;o<c.length;o+=2){var d=c[o],f=c[o+1];d==="style"?IC(a,f):d==="dangerouslySetInnerHTML"?RC(a,f):d==="children"?Kc(a,f):fx(a,d,f,u)}switch(l){case"input":_v(a,s);break;case"textarea":OC(a,s);break;case"select":var h=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!s.multiple;var p=s.value;p!=null?Ro(a,!!s.multiple,p,!1):h!==!!s.multiple&&(s.defaultValue!=null?Ro(a,!!s.multiple,s.defaultValue,!0):Ro(a,!!s.multiple,s.multiple?[]:"",!1))}a[nu]=s}catch(g){Ot(e,e.return,g)}}break;case 6:if(Or(t,e),ta(e),r&4){if(e.stateNode===null)throw Error(oe(162));a=e.stateNode,s=e.memoizedProps;try{a.nodeValue=s}catch(g){Ot(e,e.return,g)}}break;case 3:if(Or(t,e),ta(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Qc(t.containerInfo)}catch(g){Ot(e,e.return,g)}break;case 4:Or(t,e),ta(e);break;case 13:Or(t,e),ta(e),a=e.child,a.flags&8192&&(s=a.memoizedState!==null,a.stateNode.isHidden=s,!s||a.alternate!==null&&a.alternate.memoizedState!==null||(Gx=Rt())),r&4&&Hk(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(xn=(u=xn)||d,Or(t,e),xn=u):Or(t,e),ta(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(ye=e,d=e.child;d!==null;){for(f=ye=d;ye!==null;){switch(h=ye,p=h.child,h.tag){case 0:case 11:case 14:case 15:Ic(4,h,h.return);break;case 1:_o(h,h.return);var m=h.stateNode;if(typeof m.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){Ot(r,n,g)}}break;case 5:_o(h,h.return);break;case 22:if(h.memoizedState!==null){qk(f);continue}}p!==null?(p.return=h,ye=p):qk(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(s=a.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(l=f.stateNode,c=f.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=MC("display",o))}catch(g){Ot(e,e.return,g)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(g){Ot(e,e.return,g)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Or(t,e),ta(e),r&4&&Hk(e);break;case 21:break;default:Or(t,e),ta(e)}}function ta(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(sT(n)){var r=n;break e}n=n.return}throw Error(oe(160))}switch(r.tag){case 5:var a=r.stateNode;r.flags&32&&(Kc(a,""),r.flags&=-33);var s=Wk(e);ly(e,s,a);break;case 3:case 4:var o=r.stateNode.containerInfo,l=Wk(e);oy(e,l,o);break;default:throw Error(oe(161))}}catch(c){Ot(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function DD(e,t,n){ye=e,cT(e)}function cT(e,t,n){for(var r=(e.mode&1)!==0;ye!==null;){var a=ye,s=a.child;if(a.tag===22&&r){var o=a.memoizedState!==null||Fd;if(!o){var l=a.alternate,c=l!==null&&l.memoizedState!==null||xn;l=Fd;var u=xn;if(Fd=o,(xn=c)&&!u)for(ye=a;ye!==null;)o=ye,c=o.child,o.tag===22&&o.memoizedState!==null?Kk(a):c!==null?(c.return=o,ye=c):Kk(a);for(;s!==null;)ye=s,cT(s),s=s.sibling;ye=a,Fd=l,xn=u}Gk(e)}else a.subtreeFlags&8772&&s!==null?(s.return=a,ye=s):Gk(e)}}function Gk(e){for(;ye!==null;){var t=ye;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:xn||Ap(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!xn)if(n===null)r.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:Rr(t.type,n.memoizedProps);r.componentDidUpdate(a,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&Ak(t,s,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Ak(t,o,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&Qc(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(oe(163))}xn||t.flags&512&&sy(t)}catch(h){Ot(t,t.return,h)}}if(t===e){ye=null;break}if(n=t.sibling,n!==null){n.return=t.return,ye=n;break}ye=t.return}}function qk(e){for(;ye!==null;){var t=ye;if(t===e){ye=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ye=n;break}ye=t.return}}function Kk(e){for(;ye!==null;){var t=ye;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ap(4,t)}catch(c){Ot(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var a=t.return;try{r.componentDidMount()}catch(c){Ot(t,a,c)}}var s=t.return;try{sy(t)}catch(c){Ot(t,s,c)}break;case 5:var o=t.return;try{sy(t)}catch(c){Ot(t,o,c)}}}catch(c){Ot(t,t.return,c)}if(t===e){ye=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ye=l;break}ye=t.return}}var BD=Math.ceil,nh=Ga.ReactCurrentDispatcher,Wx=Ga.ReactCurrentOwner,xr=Ga.ReactCurrentBatchConfig,qe=0,tn=null,Dt=null,fn=0,Qn=0,Co=Mi(0),qt=0,lu=null,Rs=0,Tp=0,Hx=0,$c=null,Ln=null,Gx=0,Xo=1/0,_a=null,rh=!1,cy=null,ji=null,Ud=!1,pi=null,ah=0,Lc=0,uy=null,Of=-1,Pf=0;function On(){return qe&6?Rt():Of!==-1?Of:Of=Rt()}function Ni(e){return e.mode&1?qe&2&&fn!==0?fn&-fn:kD.transition!==null?(Pf===0&&(Pf=KC()),Pf):(e=nt,e!==0||(e=window.event,e=e===void 0?16:eA(e.type)),e):1}function zr(e,t,n,r){if(50<Lc)throw Lc=0,uy=null,Error(oe(185));Ju(e,n,r),(!(qe&2)||e!==tn)&&(e===tn&&(!(qe&2)&&(Tp|=n),qt===4&&ci(e,fn)),Un(e,r),n===1&&qe===0&&!(t.mode&1)&&(Xo=Rt()+500,Ep&&Ii()))}function Un(e,t){var n=e.callbackNode;kL(e,t);var r=Ff(e,e===tn?fn:0);if(r===0)n!==null&&nk(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&nk(n),t===1)e.tag===0?wD(Vk.bind(null,e)):bA(Vk.bind(null,e)),vD(function(){!(qe&6)&&Ii()}),n=null;else{switch(VC(r)){case 1:n=vx;break;case 4:n=GC;break;case 16:n=zf;break;case 536870912:n=qC;break;default:n=zf}n=vT(n,uT.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function uT(e,t){if(Of=-1,Pf=0,qe&6)throw Error(oe(327));var n=e.callbackNode;if(Do()&&e.callbackNode!==n)return null;var r=Ff(e,e===tn?fn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=ih(e,r);else{t=r;var a=qe;qe|=2;var s=fT();(tn!==e||fn!==t)&&(_a=null,Xo=Rt()+500,ks(e,t));do try{UD();break}catch(l){dT(e,l)}while(!0);Tx(),nh.current=s,qe=a,Dt!==null?t=0:(tn=null,fn=0,t=qt)}if(t!==0){if(t===2&&(a=Lv(e),a!==0&&(r=a,t=dy(e,a))),t===1)throw n=lu,ks(e,0),ci(e,r),Un(e,Rt()),n;if(t===6)ci(e,r);else{if(a=e.current.alternate,!(r&30)&&!zD(a)&&(t=ih(e,r),t===2&&(s=Lv(e),s!==0&&(r=s,t=dy(e,s))),t===1))throw n=lu,ks(e,0),ci(e,r),Un(e,Rt()),n;switch(e.finishedWork=a,e.finishedLanes=r,t){case 0:case 1:throw Error(oe(345));case 2:ss(e,Ln,_a);break;case 3:if(ci(e,r),(r&130023424)===r&&(t=Gx+500-Rt(),10<t)){if(Ff(e,0)!==0)break;if(a=e.suspendedLanes,(a&r)!==r){On(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Gv(ss.bind(null,e,Ln,_a),t);break}ss(e,Ln,_a);break;case 4:if(ci(e,r),(r&4194240)===r)break;for(t=e.eventTimes,a=-1;0<r;){var o=31-Br(r);s=1<<o,o=t[o],o>a&&(a=o),r&=~s}if(r=a,r=Rt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*BD(r/1960))-r,10<r){e.timeoutHandle=Gv(ss.bind(null,e,Ln,_a),r);break}ss(e,Ln,_a);break;case 5:ss(e,Ln,_a);break;default:throw Error(oe(329))}}}return Un(e,Rt()),e.callbackNode===n?uT.bind(null,e):null}function dy(e,t){var n=$c;return e.current.memoizedState.isDehydrated&&(ks(e,t).flags|=256),e=ih(e,t),e!==2&&(t=Ln,Ln=n,t!==null&&fy(t)),e}function fy(e){Ln===null?Ln=e:Ln.push.apply(Ln,e)}function zD(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var a=n[r],s=a.getSnapshot;a=a.value;try{if(!Hr(s(),a))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 ci(e,t){for(t&=~Hx,t&=~Tp,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Br(t),r=1<<n;e[n]=-1,t&=~r}}function Vk(e){if(qe&6)throw Error(oe(327));Do();var t=Ff(e,0);if(!(t&1))return Un(e,Rt()),null;var n=ih(e,t);if(e.tag!==0&&n===2){var r=Lv(e);r!==0&&(t=r,n=dy(e,r))}if(n===1)throw n=lu,ks(e,0),ci(e,t),Un(e,Rt()),n;if(n===6)throw Error(oe(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ss(e,Ln,_a),Un(e,Rt()),null}function qx(e,t){var n=qe;qe|=1;try{return e(t)}finally{qe=n,qe===0&&(Xo=Rt()+500,Ep&&Ii())}}function Ms(e){pi!==null&&pi.tag===0&&!(qe&6)&&Do();var t=qe;qe|=1;var n=xr.transition,r=nt;try{if(xr.transition=null,nt=1,e)return e()}finally{nt=r,xr.transition=n,qe=t,!(qe&6)&&Ii()}}function Kx(){Qn=Co.current,xt(Co)}function ks(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,gD(n)),Dt!==null)for(n=Dt.return;n!==null;){var r=n;switch(_x(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&qf();break;case 3:Vo(),xt(zn),xt(jn),$x();break;case 5:Ix(r);break;case 4:Vo();break;case 13:xt(Nt);break;case 19:xt(Nt);break;case 10:Ox(r.type._context);break;case 22:case 23:Kx()}n=n.return}if(tn=e,Dt=e=Ei(e.current,null),fn=Qn=t,qt=0,lu=null,Hx=Tp=Rs=0,Ln=$c=null,ms!==null){for(t=0;t<ms.length;t++)if(n=ms[t],r=n.interleaved,r!==null){n.interleaved=null;var a=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=a,r.next=o}n.pending=r}ms=null}return e}function dT(e,t){do{var n=Dt;try{if(Tx(),Cf.current=th,eh){for(var r=Et.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}eh=!1}if(Ps=0,Zt=Gt=Et=null,Mc=!1,iu=0,Wx.current=null,n===null||n.return===null){qt=1,lu=t,Dt=null;break}e:{var s=e,o=n.return,l=n,c=t;if(t=fn,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=Ik(o);if(p!==null){p.flags&=-257,$k(p,o,l,s,t),p.mode&1&&Mk(s,u,t),t=p,c=u;var m=t.updateQueue;if(m===null){var g=new Set;g.add(c),t.updateQueue=g}else m.add(c);break e}else{if(!(t&1)){Mk(s,u,t),Vx();break e}c=Error(oe(426))}}else if(kt&&l.mode&1){var y=Ik(o);if(y!==null){!(y.flags&65536)&&(y.flags|=256),$k(y,o,l,s,t),Cx(Yo(c,l));break e}}s=c=Yo(c,l),qt!==4&&(qt=2),$c===null?$c=[s]:$c.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var v=VA(s,c,t);Ck(s,v);break e;case 1:l=c;var k=s.type,w=s.stateNode;if(!(s.flags&128)&&(typeof k.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(ji===null||!ji.has(w)))){s.flags|=65536,t&=-t,s.lanes|=t;var j=YA(s,l,t);Ck(s,j);break e}}s=s.return}while(s!==null)}pT(n)}catch(S){t=S,Dt===n&&n!==null&&(Dt=n=n.return);continue}break}while(!0)}function fT(){var e=nh.current;return nh.current=th,e===null?th:e}function Vx(){(qt===0||qt===3||qt===2)&&(qt=4),tn===null||!(Rs&268435455)&&!(Tp&268435455)||ci(tn,fn)}function ih(e,t){var n=qe;qe|=2;var r=fT();(tn!==e||fn!==t)&&(_a=null,ks(e,t));do try{FD();break}catch(a){dT(e,a)}while(!0);if(Tx(),qe=n,nh.current=r,Dt!==null)throw Error(oe(261));return tn=null,fn=0,qt}function FD(){for(;Dt!==null;)hT(Dt)}function UD(){for(;Dt!==null&&!hL();)hT(Dt)}function hT(e){var t=gT(e.alternate,e,Qn);e.memoizedProps=e.pendingProps,t===null?pT(e):Dt=t,Wx.current=null}function pT(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=ID(n,t),n!==null){n.flags&=32767,Dt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{qt=6,Dt=null;return}}else if(n=MD(n,t,Qn),n!==null){Dt=n;return}if(t=t.sibling,t!==null){Dt=t;return}Dt=t=e}while(t!==null);qt===0&&(qt=5)}function ss(e,t,n){var r=nt,a=xr.transition;try{xr.transition=null,nt=1,WD(e,t,n,r)}finally{xr.transition=a,nt=r}return null}function WD(e,t,n,r){do Do();while(pi!==null);if(qe&6)throw Error(oe(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(oe(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(SL(e,s),e===tn&&(Dt=tn=null,fn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ud||(Ud=!0,vT(zf,function(){return Do(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=xr.transition,xr.transition=null;var o=nt;nt=1;var l=qe;qe|=4,Wx.current=null,LD(e,n),lT(n,e),cD(Wv),Uf=!!Uv,Wv=Uv=null,e.current=n,DD(n),pL(),qe=l,nt=o,xr.transition=s}else e.current=n;if(Ud&&(Ud=!1,pi=e,ah=a),s=e.pendingLanes,s===0&&(ji=null),vL(n.stateNode),Un(e,Rt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],r(a.value,{componentStack:a.stack,digest:a.digest});if(rh)throw rh=!1,e=cy,cy=null,e;return ah&1&&e.tag!==0&&Do(),s=e.pendingLanes,s&1?e===uy?Lc++:(Lc=0,uy=e):Lc=0,Ii(),null}function Do(){if(pi!==null){var e=VC(ah),t=xr.transition,n=nt;try{if(xr.transition=null,nt=16>e?16:e,pi===null)var r=!1;else{if(e=pi,pi=null,ah=0,qe&6)throw Error(oe(331));var a=qe;for(qe|=4,ye=e.current;ye!==null;){var s=ye,o=s.child;if(ye.flags&16){var l=s.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(ye=u;ye!==null;){var d=ye;switch(d.tag){case 0:case 11:case 15:Ic(8,d,s)}var f=d.child;if(f!==null)f.return=d,ye=f;else for(;ye!==null;){d=ye;var h=d.sibling,p=d.return;if(iT(d),d===u){ye=null;break}if(h!==null){h.return=p,ye=h;break}ye=p}}}var m=s.alternate;if(m!==null){var g=m.child;if(g!==null){m.child=null;do{var y=g.sibling;g.sibling=null,g=y}while(g!==null)}}ye=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,ye=o;else e:for(;ye!==null;){if(s=ye,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Ic(9,s,s.return)}var v=s.sibling;if(v!==null){v.return=s.return,ye=v;break e}ye=s.return}}var k=e.current;for(ye=k;ye!==null;){o=ye;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,ye=w;else e:for(o=k;ye!==null;){if(l=ye,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Ap(9,l)}}catch(S){Ot(l,l.return,S)}if(l===o){ye=null;break e}var j=l.sibling;if(j!==null){j.return=l.return,ye=j;break e}ye=l.return}}if(qe=a,Ii(),ua&&typeof ua.onPostCommitFiberRoot=="function")try{ua.onPostCommitFiberRoot(wp,e)}catch{}r=!0}return r}finally{nt=n,xr.transition=t}}return!1}function Yk(e,t,n){t=Yo(n,t),t=VA(e,t,1),e=Si(e,t,1),t=On(),e!==null&&(Ju(e,1,t),Un(e,t))}function Ot(e,t,n){if(e.tag===3)Yk(e,e,n);else for(;t!==null;){if(t.tag===3){Yk(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ji===null||!ji.has(r))){e=Yo(n,e),e=YA(t,e,1),t=Si(t,e,1),e=On(),t!==null&&(Ju(t,1,e),Un(t,e));break}}t=t.return}}function HD(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=On(),e.pingedLanes|=e.suspendedLanes&n,tn===e&&(fn&n)===n&&(qt===4||qt===3&&(fn&130023424)===fn&&500>Rt()-Gx?ks(e,0):Hx|=n),Un(e,t)}function mT(e,t){t===0&&(e.mode&1?(t=Pd,Pd<<=1,!(Pd&130023424)&&(Pd=4194304)):t=1);var n=On();e=za(e,t),e!==null&&(Ju(e,t,n),Un(e,n))}function GD(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),mT(e,n)}function qD(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(oe(314))}r!==null&&r.delete(t),mT(e,n)}var gT;gT=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||zn.current)Dn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Dn=!1,RD(e,t,n);Dn=!!(e.flags&131072)}else Dn=!1,kt&&t.flags&1048576&&xA(t,Yf,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Tf(e,t),e=t.pendingProps;var a=Go(t,jn.current);Lo(t,n),a=Dx(null,t,r,e,a,n);var s=Bx();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Fn(r)?(s=!0,Kf(t)):s=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Rx(t),a.updater=Cp,t.stateNode=a,a._reactInternals=t,Zv(t,r,e,n),t=ty(null,t,r,!0,s,n)):(t.tag=0,kt&&s&&Ex(t),Cn(null,t,a,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Tf(e,t),e=t.pendingProps,a=r._init,r=a(r._payload),t.type=r,a=t.tag=VD(r),e=Rr(r,e),a){case 0:t=ey(null,t,r,e,n);break e;case 1:t=Bk(null,t,r,e,n);break e;case 11:t=Lk(null,t,r,e,n);break e;case 14:t=Dk(null,t,r,Rr(r.type,e),n);break e}throw Error(oe(306,r,""))}return t;case 0:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Rr(r,a),ey(e,t,r,a,n);case 1:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Rr(r,a),Bk(e,t,r,a,n);case 3:e:{if(JA(t),e===null)throw Error(oe(387));r=t.pendingProps,s=t.memoizedState,a=s.element,EA(e,t),Zf(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){a=Yo(Error(oe(423)),t),t=zk(e,t,r,n,a);break e}else if(r!==a){a=Yo(Error(oe(424)),t),t=zk(e,t,r,n,a);break e}else for(er=ki(t.stateNode.containerInfo.firstChild),tr=t,kt=!0,$r=null,n=jA(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(qo(),r===a){t=Fa(e,t,n);break e}Cn(e,t,r,n)}t=t.child}return t;case 5:return _A(t),e===null&&Yv(t),r=t.type,a=t.pendingProps,s=e!==null?e.memoizedProps:null,o=a.children,Hv(r,a)?o=null:s!==null&&Hv(r,s)&&(t.flags|=32),ZA(e,t),Cn(e,t,o,n),t.child;case 6:return e===null&&Yv(t),null;case 13:return eT(e,t,n);case 4:return Mx(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ko(t,null,r,n):Cn(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Rr(r,a),Lk(e,t,r,a,n);case 7:return Cn(e,t,t.pendingProps,n),t.child;case 8:return Cn(e,t,t.pendingProps.children,n),t.child;case 12:return Cn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,a=t.pendingProps,s=t.memoizedProps,o=a.value,ht(Xf,r._currentValue),r._currentValue=o,s!==null)if(Hr(s.value,o)){if(s.children===a.children&&!zn.current){t=Fa(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(s.tag===1){c=Ma(-1,n&-n),c.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Xv(s.return,n,t),l.lanes|=n;break}c=c.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(oe(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Xv(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Cn(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=t.pendingProps.children,Lo(t,n),a=kr(a),r=r(a),t.flags|=1,Cn(e,t,r,n),t.child;case 14:return r=t.type,a=Rr(r,t.pendingProps),a=Rr(r.type,a),Dk(e,t,r,a,n);case 15:return XA(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Rr(r,a),Tf(e,t),t.tag=1,Fn(r)?(e=!0,Kf(t)):e=!1,Lo(t,n),KA(t,r,a),Zv(t,r,a,n),ty(null,t,r,!0,e,n);case 19:return tT(e,t,n);case 22:return QA(e,t,n)}throw Error(oe(156,t.tag))};function vT(e,t){return HC(e,t)}function KD(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.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 yr(e,t,n,r){return new KD(e,t,n,r)}function Yx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function VD(e){if(typeof e=="function")return Yx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===px)return 11;if(e===mx)return 14}return 2}function Ei(e,t){var n=e.alternate;return n===null?(n=yr(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&14680064,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}function Rf(e,t,n,r,a,s){var o=2;if(r=e,typeof e=="function")Yx(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case yo:return Ss(n.children,a,s,t);case hx:o=8,a|=8;break;case kv:return e=yr(12,n,t,a|2),e.elementType=kv,e.lanes=s,e;case Sv:return e=yr(13,n,t,a),e.elementType=Sv,e.lanes=s,e;case jv:return e=yr(19,n,t,a),e.elementType=jv,e.lanes=s,e;case _C:return Op(n,a,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case NC:o=10;break e;case EC:o=9;break e;case px:o=11;break e;case mx:o=14;break e;case ii:o=16,r=null;break e}throw Error(oe(130,e==null?e:typeof e,""))}return t=yr(o,n,t,a),t.elementType=e,t.type=r,t.lanes=s,t}function Ss(e,t,n,r){return e=yr(7,e,r,t),e.lanes=n,e}function Op(e,t,n,r){return e=yr(22,e,r,t),e.elementType=_C,e.lanes=n,e.stateNode={isHidden:!1},e}function lg(e,t,n){return e=yr(6,e,null,t),e.lanes=n,e}function cg(e,t,n){return t=yr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function YD(e,t,n,r,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Wm(0),this.expirationTimes=Wm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wm(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function Xx(e,t,n,r,a,s,o,l,c){return e=new YD(e,t,n,l,c),t===1?(t=1,s===!0&&(t|=8)):t=0,s=yr(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Rx(s),e}function XD(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:vo,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function yT(e){if(!e)return Oi;e=e._reactInternals;e:{if(Us(e)!==e||e.tag!==1)throw Error(oe(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Fn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(oe(171))}if(e.tag===1){var n=e.type;if(Fn(n))return yA(e,n,t)}return t}function bT(e,t,n,r,a,s,o,l,c){return e=Xx(n,r,!0,e,a,s,o,l,c),e.context=yT(null),n=e.current,r=On(),a=Ni(n),s=Ma(r,a),s.callback=t??null,Si(n,s,a),e.current.lanes=a,Ju(e,a,r),Un(e,r),e}function Pp(e,t,n,r){var a=t.current,s=On(),o=Ni(a);return n=yT(n),t.context===null?t.context=n:t.pendingContext=n,t=Ma(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Si(a,t,o),e!==null&&(zr(e,a,o,s),_f(e,a,o)),o}function sh(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Xk(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Qx(e,t){Xk(e,t),(e=e.alternate)&&Xk(e,t)}function QD(){return null}var xT=typeof reportError=="function"?reportError:function(e){console.error(e)};function Zx(e){this._internalRoot=e}Rp.prototype.render=Zx.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(oe(409));Pp(e,t,null,null)};Rp.prototype.unmount=Zx.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ms(function(){Pp(null,e,null,null)}),t[Ba]=null}};function Rp(e){this._internalRoot=e}Rp.prototype.unstable_scheduleHydration=function(e){if(e){var t=QC();e={blockedOn:null,target:e,priority:t};for(var n=0;n<li.length&&t!==0&&t<li[n].priority;n++);li.splice(n,0,e),n===0&&JC(e)}};function Jx(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Mp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Qk(){}function ZD(e,t,n,r,a){if(a){if(typeof r=="function"){var s=r;r=function(){var u=sh(o);s.call(u)}}var o=bT(t,r,e,0,null,!1,!1,"",Qk);return e._reactRootContainer=o,e[Ba]=o.current,eu(e.nodeType===8?e.parentNode:e),Ms(),o}for(;a=e.lastChild;)e.removeChild(a);if(typeof r=="function"){var l=r;r=function(){var u=sh(c);l.call(u)}}var c=Xx(e,0,!1,null,null,!1,!1,"",Qk);return e._reactRootContainer=c,e[Ba]=c.current,eu(e.nodeType===8?e.parentNode:e),Ms(function(){Pp(t,c,n,r)}),c}function Ip(e,t,n,r,a){var s=n._reactRootContainer;if(s){var o=s;if(typeof a=="function"){var l=a;a=function(){var c=sh(o);l.call(c)}}Pp(t,o,e,a)}else o=ZD(n,t,e,a,r);return sh(o)}YC=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=jc(t.pendingLanes);n!==0&&(yx(t,n|1),Un(t,Rt()),!(qe&6)&&(Xo=Rt()+500,Ii()))}break;case 13:Ms(function(){var r=za(e,1);if(r!==null){var a=On();zr(r,e,1,a)}}),Qx(e,1)}};bx=function(e){if(e.tag===13){var t=za(e,134217728);if(t!==null){var n=On();zr(t,e,134217728,n)}Qx(e,134217728)}};XC=function(e){if(e.tag===13){var t=Ni(e),n=za(e,t);if(n!==null){var r=On();zr(n,e,t,r)}Qx(e,t)}};QC=function(){return nt};ZC=function(e,t){var n=nt;try{return nt=e,t()}finally{nt=n}};Mv=function(e,t,n){switch(t){case"input":if(_v(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=Np(r);if(!a)throw Error(oe(90));AC(r),_v(r,a)}}}break;case"textarea":OC(e,n);break;case"select":t=n.value,t!=null&&Ro(e,!!n.multiple,t,!1)}};DC=qx;BC=Ms;var JD={usingClientEntryPoint:!1,Events:[td,ko,Np,$C,LC,qx]},oc={findFiberByHostInstance:ps,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},e2={bundleType:oc.bundleType,version:oc.version,rendererPackageName:oc.rendererPackageName,rendererConfig:oc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ga.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=UC(e),e===null?null:e.stateNode},findFiberByHostInstance:oc.findFiberByHostInstance||QD,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Wd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wd.isDisabled&&Wd.supportsFiber)try{wp=Wd.inject(e2),ua=Wd}catch{}}ir.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=JD;ir.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Jx(t))throw Error(oe(200));return XD(e,t,null,n)};ir.createRoot=function(e,t){if(!Jx(e))throw Error(oe(299));var n=!1,r="",a=xT;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=Xx(e,1,!1,null,null,n,!1,r,a),e[Ba]=t.current,eu(e.nodeType===8?e.parentNode:e),new Zx(t)};ir.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(oe(188)):(e=Object.keys(e).join(","),Error(oe(268,e)));return e=UC(t),e=e===null?null:e.stateNode,e};ir.flushSync=function(e){return Ms(e)};ir.hydrate=function(e,t,n){if(!Mp(t))throw Error(oe(200));return Ip(null,e,t,!0,n)};ir.hydrateRoot=function(e,t,n){if(!Jx(e))throw Error(oe(405));var r=n!=null&&n.hydratedSources||null,a=!1,s="",o=xT;if(n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=bT(t,null,e,1,n??null,a,!1,s,o),e[Ba]=t.current,eu(e),r)for(e=0;e<r.length;e++)n=r[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new Rp(t)};ir.render=function(e,t,n){if(!Mp(t))throw Error(oe(200));return Ip(null,e,t,!1,n)};ir.unmountComponentAtNode=function(e){if(!Mp(e))throw Error(oe(40));return e._reactRootContainer?(Ms(function(){Ip(null,null,e,!1,function(){e._reactRootContainer=null,e[Ba]=null})}),!0):!1};ir.unstable_batchedUpdates=qx;ir.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Mp(n))throw Error(oe(200));if(e==null||e._reactInternals===void 0)throw Error(oe(38));return Ip(e,t,n,!1,r)};ir.version="18.3.1-next-f1338f8080-20240426";function wT(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(wT)}catch(e){console.error(e)}}wT(),wC.exports=ir;var t2=wC.exports,kT,Zk=t2;kT=Zk.createRoot,Zk.hydrateRoot;/**
41
+ * @remix-run/router v1.23.3
42
+ *
43
+ * Copyright (c) Remix Software Inc.
44
+ *
45
+ * This source code is licensed under the MIT license found in the
46
+ * LICENSE.md file in the root directory of this source tree.
47
+ *
48
+ * @license MIT
49
+ */function cu(){return cu=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},cu.apply(null,arguments)}var mi;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(mi||(mi={}));const Jk="popstate";function n2(e){e===void 0&&(e={});function t(r,a){let{pathname:s,search:o,hash:l}=r.location;return hy("",{pathname:s,search:o,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:oh(a)}return a2(t,n,null,e)}function _t(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ew(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function r2(){return Math.random().toString(36).substr(2,8)}function eS(e,t){return{usr:e.state,key:e.key,idx:t}}function hy(e,t,n,r){return n===void 0&&(n=null),cu({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?jl(t):t,{state:n,key:t&&t.key||r||r2()})}function oh(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function jl(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function a2(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:s=!1}=r,o=a.history,l=mi.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(cu({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){l=mi.Pop;let y=d(),v=y==null?null:y-u;u=y,c&&c({action:l,location:g.location,delta:v})}function h(y,v){l=mi.Push;let k=hy(g.location,y,v);u=d()+1;let w=eS(k,u),j=g.createHref(k);try{o.pushState(w,"",j)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;a.location.assign(j)}s&&c&&c({action:l,location:g.location,delta:1})}function p(y,v){l=mi.Replace;let k=hy(g.location,y,v);u=d();let w=eS(k,u),j=g.createHref(k);o.replaceState(w,"",j),s&&c&&c({action:l,location:g.location,delta:0})}function m(y){let v=a.location.origin!=="null"?a.location.origin:a.location.href,k=typeof y=="string"?y:oh(y);return k=k.replace(/ $/,"%20"),_t(v,"No window.location.(origin|href) available to create URL for href: "+k),new URL(k,v)}let g={get action(){return l},get location(){return e(a,o)},listen(y){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(Jk,f),c=y,()=>{a.removeEventListener(Jk,f),c=null}},createHref(y){return t(a,y)},createURL:m,encodeLocation(y){let v=m(y);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:p,go(y){return o.go(y)}};return g}var tS;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(tS||(tS={}));function i2(e,t,n){return n===void 0&&(n="/"),s2(e,t,n)}function s2(e,t,n,r){let a=typeof t=="string"?jl(t):t,s=Qo(a.pathname||"/",n);if(s==null)return null;let o=ST(e);o2(o);let l=null,c=y2(s);for(let u=0;l==null&&u<o.length;++u)l=g2(o[u],c);return l}function ST(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let a=(s,o,l)=>{let c={relativePath:l===void 0?s.path||"":l,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};c.relativePath.startsWith("/")&&(_t(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 u=_i([r,c.relativePath]),d=n.concat(c);s.children&&s.children.length>0&&(_t(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),ST(s.children,t,d,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:p2(u,s.index),routesMeta:d})};return e.forEach((s,o)=>{var l;if(s.path===""||!((l=s.path)!=null&&l.includes("?")))a(s,o);else for(let c of jT(s.path))a(s,o,c)}),t}function jT(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return a?[s,""]:[s];let o=jT(r.join("/")),l=[];return l.push(...o.map(c=>c===""?s:[s,c].join("/"))),a&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function o2(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:m2(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const l2=/^:[\w-]+$/,c2=3,u2=2,d2=1,f2=10,h2=-2,nS=e=>e==="*";function p2(e,t){let n=e.split("/"),r=n.length;return n.some(nS)&&(r+=h2),t&&(r+=u2),n.filter(a=>!nS(a)).reduce((a,s)=>a+(l2.test(s)?c2:s===""?d2:f2),r)}function m2(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function g2(e,t,n){let{routesMeta:r}=e,a={},s="/",o=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,d=s==="/"?t:t.slice(s.length)||"/",f=py({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),h=c.route;if(!f)return null;Object.assign(a,f.params),o.push({params:a,pathname:_i([s,f.pathname]),pathnameBase:S2(_i([s,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(s=_i([s,f.pathnameBase]))}return o}function py(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=v2(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let s=a[0],o=s.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:h,isOptional:p}=d;if(h==="*"){let g=l[f]||"";o=s.slice(0,s.length-g.length).replace(/(.)\/+$/,"$1")}const m=l[f];return p&&!m?u[h]=void 0:u[h]=(m||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:o,pattern:e}}function v2(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),ew(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=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function y2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ew(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Qo(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)||"/"}const b2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,x2=e=>b2.test(e);function w2(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?jl(e):e,s;if(n)if(x2(n))s=n;else{if(n.includes("//")){let o=n;n=NT(n),ew(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?s=rS(n.substring(1),"/"):s=rS(n,t)}else s=t;return{pathname:s,search:j2(r),hash:N2(a)}}function rS(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function ug(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 k2(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function tw(e,t){let n=k2(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function nw(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=jl(e):(a=cu({},e),_t(!a.pathname||!a.pathname.includes("?"),ug("?","pathname","search",a)),_t(!a.pathname||!a.pathname.includes("#"),ug("#","pathname","hash",a)),_t(!a.search||!a.search.includes("#"),ug("#","search","hash",a)));let s=e===""||a.pathname==="",o=s?"/":a.pathname,l;if(o==null)l=n;else{let f=t.length-1;if(!r&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;a.pathname=h.join("/")}l=f>=0?t[f]:"/"}let c=w2(a,l),u=o&&o!=="/"&&o.endsWith("/"),d=(s||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const NT=e=>e.replace(/\/\/+/g,"/"),_i=e=>NT(e.join("/")),S2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),j2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,N2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function E2(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const ET=["post","put","patch","delete"];new Set(ET);const _2=["get",...ET];new Set(_2);/**
50
+ * React Router v6.30.4
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */function uu(){return uu=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},uu.apply(null,arguments)}const $p=b.createContext(null),_T=b.createContext(null),qa=b.createContext(null),Lp=b.createContext(null),$i=b.createContext({outlet:null,matches:[],isDataRoute:!1}),CT=b.createContext(null);function C2(e,t){let{relative:n}=t===void 0?{}:t;Nl()||_t(!1);let{basename:r,navigator:a}=b.useContext(qa),{hash:s,pathname:o,search:l}=Dp(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:_i([r,o])),a.createHref({pathname:c,search:l,hash:s})}function Nl(){return b.useContext(Lp)!=null}function Li(){return Nl()||_t(!1),b.useContext(Lp).location}function AT(e){b.useContext(qa).static||b.useLayoutEffect(e)}function rw(){let{isDataRoute:e}=b.useContext($i);return e?F2():A2()}function A2(){Nl()||_t(!1);let e=b.useContext($p),{basename:t,future:n,navigator:r}=b.useContext(qa),{matches:a}=b.useContext($i),{pathname:s}=Li(),o=JSON.stringify(tw(a,n.v7_relativeSplatPath)),l=b.useRef(!1);return AT(()=>{l.current=!0}),b.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=nw(u,JSON.parse(o),s,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:_i([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,s,e])}function Dp(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=b.useContext(qa),{matches:a}=b.useContext($i),{pathname:s}=Li(),o=JSON.stringify(tw(a,r.v7_relativeSplatPath));return b.useMemo(()=>nw(e,JSON.parse(o),s,n==="path"),[e,o,s,n])}function T2(e,t){return O2(e,t)}function O2(e,t,n,r){Nl()||_t(!1);let{navigator:a}=b.useContext(qa),{matches:s}=b.useContext($i),o=s[s.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=Li(),d;if(t){var f;let y=typeof t=="string"?jl(t):t;c==="/"||(f=y.pathname)!=null&&f.startsWith(c)||_t(!1),d=y}else d=u;let h=d.pathname||"/",p=h;if(c!=="/"){let y=c.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(y.length).join("/")}let m=i2(e,{pathname:p}),g=$2(m&&m.map(y=>Object.assign({},y,{params:Object.assign({},l,y.params),pathname:_i([c,a.encodeLocation?a.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?c:_i([c,a.encodeLocation?a.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),s,n,r);return t&&g?b.createElement(Lp.Provider,{value:{location:uu({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:mi.Pop}},g):g}function P2(){let e=z2(),t=E2(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:a},n):null,null)}const R2=b.createElement(P2,null);class M2 extends b.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?b.createElement($i.Provider,{value:this.props.routeContext},b.createElement(CT.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function I2(e){let{routeContext:t,match:n,children:r}=e,a=b.useContext($p);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),b.createElement($i.Provider,{value:t},r)}function $2(e,t,n,r){var a;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(a=n)==null?void 0:a.errors;if(l!=null){let d=o.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||_t(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<o.length;d++){let f=o[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:h,errors:p}=n,m=f.route.loader&&h[f.route.id]===void 0&&(!p||p[f.route.id]===void 0);if(f.route.lazy||m){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,f,h)=>{let p,m=!1,g=null,y=null;n&&(p=l&&f.route.id?l[f.route.id]:void 0,g=f.route.errorElement||R2,c&&(u<0&&h===0?(U2("route-fallback"),m=!0,y=null):u===h&&(m=!0,y=f.route.hydrateFallbackElement||null)));let v=t.concat(o.slice(0,h+1)),k=()=>{let w;return p?w=g:m?w=y:f.route.Component?w=b.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,b.createElement(I2,{match:f,routeContext:{outlet:d,matches:v,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?b.createElement(M2,{location:n.location,revalidation:n.revalidation,component:g,error:p,children:k(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):k()},null)}var TT=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(TT||{}),OT=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(OT||{});function L2(e){let t=b.useContext($p);return t||_t(!1),t}function D2(e){let t=b.useContext(_T);return t||_t(!1),t}function B2(e){let t=b.useContext($i);return t||_t(!1),t}function PT(e){let t=B2(),n=t.matches[t.matches.length-1];return n.route.id||_t(!1),n.route.id}function z2(){var e;let t=b.useContext(CT),n=D2(),r=PT();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function F2(){let{router:e}=L2(TT.UseNavigateStable),t=PT(OT.UseNavigateStable),n=b.useRef(!1);return AT(()=>{n.current=!0}),b.useCallback(function(a,s){s===void 0&&(s={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,uu({fromRouteId:t},s)))},[e,t])}const aS={};function U2(e,t,n){aS[e]||(aS[e]=!0)}function W2(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function iS(e){let{to:t,replace:n,state:r,relative:a}=e;Nl()||_t(!1);let{future:s,static:o}=b.useContext(qa),{matches:l}=b.useContext($i),{pathname:c}=Li(),u=rw(),d=nw(t,tw(l,s.v7_relativeSplatPath),c,a==="path"),f=JSON.stringify(d);return b.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:a}),[u,f,a,n,r]),null}function Ge(e){_t(!1)}function H2(e){let{basename:t="/",children:n=null,location:r,navigationType:a=mi.Pop,navigator:s,static:o=!1,future:l}=e;Nl()&&_t(!1);let c=t.replace(/^\/*/,"/"),u=b.useMemo(()=>({basename:c,navigator:s,static:o,future:uu({v7_relativeSplatPath:!1},l)}),[c,l,s,o]);typeof r=="string"&&(r=jl(r));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:m="default"}=r,g=b.useMemo(()=>{let y=Qo(d,c);return y==null?null:{location:{pathname:y,search:f,hash:h,state:p,key:m},navigationType:a}},[c,d,f,h,p,m,a]);return g==null?null:b.createElement(qa.Provider,{value:u},b.createElement(Lp.Provider,{children:n,value:g}))}function G2(e){let{children:t,location:n}=e;return T2(my(t),n)}new Promise(()=>{});function my(e,t){t===void 0&&(t=[]);let n=[];return b.Children.forEach(e,(r,a)=>{if(!b.isValidElement(r))return;let s=[...t,a];if(r.type===b.Fragment){n.push.apply(n,my(r.props.children,s));return}r.type!==Ge&&_t(!1),!r.props.index||!r.props.children||_t(!1);let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=my(r.props.children,s)),n.push(o)}),n}/**
59
+ * React Router DOM v6.30.4
60
+ *
61
+ * Copyright (c) Remix Software Inc.
62
+ *
63
+ * This source code is licensed under the MIT license found in the
64
+ * LICENSE.md file in the root directory of this source tree.
65
+ *
66
+ * @license MIT
67
+ */function lh(){return lh=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},lh.apply(null,arguments)}function RT(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 q2(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function K2(e,t){return e.button===0&&(!t||t==="_self")&&!q2(e)}const V2=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Y2=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],X2="6";try{window.__reactRouterVersion=X2}catch{}const Q2=b.createContext({isTransitioning:!1}),Z2="startTransition",sS=H$[Z2];function J2(e){let{basename:t,children:n,future:r,window:a}=e,s=b.useRef();s.current==null&&(s.current=n2({window:a,v5Compat:!0}));let o=s.current,[l,c]=b.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=b.useCallback(f=>{u&&sS?sS(()=>c(f)):c(f)},[c,u]);return b.useLayoutEffect(()=>o.listen(d),[o,d]),b.useEffect(()=>W2(r),[r]),b.createElement(H2,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const eB=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",tB=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jt=b.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:s,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,h=RT(t,V2),{basename:p}=b.useContext(qa),m,g=!1;if(typeof u=="string"&&tB.test(u)&&(m=u,eB))try{let w=new URL(window.location.href),j=u.startsWith("//")?new URL(w.protocol+u):new URL(u),S=Qo(j.pathname,p);j.origin===w.origin&&S!=null?u=S+j.search+j.hash:g=!0}catch{}let y=C2(u,{relative:a}),v=rB(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:a,viewTransition:f});function k(w){r&&r(w),w.defaultPrevented||v(w)}return b.createElement("a",lh({},h,{href:m||y,onClick:g||s?r:k,ref:n,target:c}))}),oS=b.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:a=!1,className:s="",end:o=!1,style:l,to:c,viewTransition:u,children:d}=t,f=RT(t,Y2),h=Dp(c,{relative:f.relative}),p=Li(),m=b.useContext(_T),{navigator:g,basename:y}=b.useContext(qa),v=m!=null&&aB(h)&&u===!0,k=g.encodeLocation?g.encodeLocation(h).pathname:h.pathname,w=p.pathname,j=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;a||(w=w.toLowerCase(),j=j?j.toLowerCase():null,k=k.toLowerCase()),j&&y&&(j=Qo(j,y)||j);const S=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let x=w===k||!o&&w.startsWith(k)&&w.charAt(S)==="/",N=j!=null&&(j===k||!o&&j.startsWith(k)&&j.charAt(k.length)==="/"),E={isActive:x,isPending:N,isTransitioning:v},P=x?r:void 0,_;typeof s=="function"?_=s(E):_=[s,x?"active":null,N?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let R=typeof l=="function"?l(E):l;return b.createElement(Jt,lh({},f,{"aria-current":P,className:_,ref:n,style:R,to:c,viewTransition:u}),typeof d=="function"?d(E):d)});var gy;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(gy||(gy={}));var lS;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(lS||(lS={}));function nB(e){let t=b.useContext($p);return t||_t(!1),t}function rB(e,t){let{target:n,replace:r,state:a,preventScrollReset:s,relative:o,viewTransition:l}=t===void 0?{}:t,c=rw(),u=Li(),d=Dp(e,{relative:o});return b.useCallback(f=>{if(K2(f,n)){f.preventDefault();let h=r!==void 0?r:oh(u)===oh(d);c(e,{replace:h,state:a,preventScrollReset:s,relative:o,viewTransition:l})}},[u,c,d,r,a,n,e,s,o,l])}function aB(e,t){t===void 0&&(t={});let n=b.useContext(Q2);n==null&&_t(!1);let{basename:r}=nB(gy.useViewTransitionState),a=Dp(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=Qo(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Qo(n.nextLocation.pathname,r)||n.nextLocation.pathname;return py(a.pathname,o)!=null||py(a.pathname,s)!=null}async function it(e){if(!e.ok)return null;const t=e.headers.get("content-type")||"";if(!t.includes("application/json")&&!t.includes("text/json"))return t.includes("text/html")&&console.warn(`[dashboard] GET ${e.url||"/api/*"} returned HTML (${e.status}) instead of JSON — the dashboard server may be an older version. Stop it and start it again (agent-nuvira dashboard stop, or Ctrl+C in its terminal).`),null;try{return await e.json()}catch{return null}}const Ao="buff-dashboard-admin-token";function MT(){try{if(typeof window<"u"&&window.localStorage)return window.localStorage}catch{}return null}function iB(e){if(!e||typeof e!="object")return!1;const t=e,n=t.diff;return typeof t.dir=="string"&&typeof t.base=="string"&&typeof t.removed=="boolean"&&!!n&&typeof n=="object"&&Array.isArray(n.files)&&n.files.every(r=>typeof r=="string")&&typeof n.summary=="string"&&!!n.payload&&typeof n.payload=="object"&&typeof n.payload.summary=="string"&&Array.isArray(n.payload.files)&&n.payload.files.every(r=>!!r&&typeof r.path=="string"&&typeof r.body=="string")}function sB(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.id=="string"&&typeof t.replayed=="number"&&typeof t.modelCalls=="number"&&typeof t.saved=="boolean"&&typeof t.notice=="string"&&(t.callsAvoided===void 0||typeof t.callsAvoided=="number")}function oB(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.goal=="string"&&typeof t.planned=="boolean"&&Array.isArray(t.steps)&&!!t.stepCounts&&typeof t.stepCounts=="object"&&typeof t.stepCounts.total=="number"&&typeof t.verification=="string"&&["verified","unverified","blocked","not-applicable","delivered-and-read-back"].includes(t.verification)&&(t.summary===null||typeof t.summary=="string")&&Array.isArray(t.changedPaths)&&!!t.flags&&typeof t.flags=="object"}const vy=new Map;function lB(){const e=MT();if(e)try{const t=e.getItem(Ao);if(t)return t}catch{}return vy.get(Ao)??null}function cB(e){const t=MT();if(t)try{e?t.setItem(Ao,e):t.removeItem(Ao);return}catch{}e?vy.set(Ao,e):vy.delete(Ao)}function Xt(){return lB()}let yy=0;const by=new Set;function uB(){return yy}function dB(e){return by.add(e),()=>{by.delete(e)}}function fB(){yy+=1;for(const e of by)try{e(yy)}catch{}}function dg(e){cB(e),fB()}function mt(){const e=Xt();return e?{Authorization:`Bearer ${e}`}:{}}class hB{constructor(t=""){ea(this,"sse",null);ea(this,"listeners",new Set);ea(this,"connectionListeners",new Set);ea(this,"dagListeners",new Set);ea(this,"typingListeners",new Set);ea(this,"chatRetryListeners",new Set);ea(this,"reconnectTimer",null);ea(this,"baseUrl");ea(this,"lastData",null);this.baseUrl=t}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}onConnectionChange(t){return this.connectionListeners.add(t),()=>this.connectionListeners.delete(t)}onDAGEvent(t){return this.dagListeners.add(t),()=>this.dagListeners.delete(t)}onTypingEvent(t){return this.typingListeners.add(t),()=>this.typingListeners.delete(t)}onChatRetryEvent(t){return this.chatRetryListeners.add(t),()=>this.chatRetryListeners.delete(t)}connect(){this.sse||(this.sse=new EventSource(`${this.baseUrl}/api/sse`),this.sse.addEventListener("init",t=>{try{const n=JSON.parse(t.data);this.lastData=n,this.notify(n),this.notifyConnection(!0)}catch(n){console.error("Failed to parse SSE init data:",n)}}),this.sse.addEventListener("refresh",t=>{try{const n=JSON.parse(t.data);this.lastData=n,this.notify(n),this.notifyConnection(!0)}catch(n){console.error("Failed to parse SSE refresh data:",n)}}),this.sse.addEventListener("dag",t=>{try{const n=JSON.parse(t.data);if(this.notifyDAG(n),this.lastData){const r={...this.lastData,dag:n};this.lastData=r,this.notify(r)}}catch(n){console.error("Failed to parse SSE dag event:",n)}}),this.sse.addEventListener("quota",t=>{try{const n=JSON.parse(t.data);if(this.lastData&&n.quota){const r={...this.lastData,routing:{...this.lastData.routing||{},quota:n.quota},serverTime:n.serverTime||this.lastData.serverTime};this.lastData=r,this.notify(r)}}catch(n){console.error("Failed to parse SSE quota event:",n)}}),this.sse.addEventListener("conversation",t=>{try{const n=JSON.parse(t.data);if(this.lastData&&n.conversations){const r={...this.lastData,conversations:{total:n.total??n.conversations.length,recent:n.conversations},serverTime:n.serverTime||this.lastData.serverTime};this.lastData=r,this.notify(r)}}catch(n){console.error("Failed to parse SSE conversation event:",n)}}),this.sse.addEventListener("typing",t=>{try{const n=JSON.parse(t.data);for(const r of this.typingListeners)try{r(n)}catch{}}catch(n){console.error("Failed to parse SSE typing event:",n)}}),this.sse.addEventListener("chat-retry",t=>{try{const n=JSON.parse(t.data);if(!n||typeof n.sessionId!="string"||typeof n.content!="string")return;for(const r of this.chatRetryListeners)try{r(n)}catch{}}catch(n){console.error("Failed to parse SSE chat-retry event:",n)}}),this.sse.onerror=()=>{this.notifyConnection(!1),this.disconnect(),this.reconnect()},this.sse.onopen=()=>{this.notifyConnection(!0)})}disconnect(){this.sse&&(this.sse.close(),this.sse=null),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}reconnect(){this.reconnectTimer=setTimeout(()=>{this.connect()},3e3)}notify(t){this.listeners.forEach(n=>n(t))}notifyDAG(t){this.dagListeners.forEach(n=>n(t))}notifyConnection(t){this.connectionListeners.forEach(n=>n(t))}async fetchAll(){try{const t=await fetch(`${this.baseUrl}/api/all`),n=await it(t);return n?(this.lastData=n,n):null}catch{return null}}async fetchExecutionAudit(t){try{const n=new URLSearchParams;t!=null&&t.skillName&&n.set("skillName",t.skillName),t!=null&&t.status&&n.set("status",t.status),t!=null&&t.limit&&n.set("limit",String(t.limit));const r=n.toString(),a=await fetch(`${this.baseUrl}/api/executions${r?`?${r}`:""}`,{signal:AbortSignal.timeout(8e3)}),s=await it(a);return(s==null?void 0:s.entries)??[]}catch{return[]}}async fetchTraces(){try{const t=await fetch(`${this.baseUrl}/api/traces`,{signal:AbortSignal.timeout(8e3)}),n=await it(t);return n!=null&&n.traces?n.traces:null}catch{return null}}async fetchAcceptance(){try{const t=await fetch(`${this.baseUrl}/api/acceptance`,{signal:AbortSignal.timeout(8e3)}),n=await it(t);return!n||typeof n.labelled!="number"?null:n}catch{return null}}acceptanceExportUrl(t="json"){return`${this.baseUrl}/api/acceptance/export?format=${t}`}async importAcceptance(t,n){try{const r=await fetch(`${this.baseUrl}/api/acceptance/import`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:t,...n?{format:n}:{}})}),a=await it(r);return!a||typeof a.ok!="boolean"?null:a}catch{return null}}async fetchDecisions(t,n){try{const r=new URLSearchParams;t&&r.set("dir",t),n&&n.trim()&&r.set("for",n.trim());const a=await fetch(`${this.baseUrl}/api/decisions?${r.toString()}`,{signal:AbortSignal.timeout(8e3)}),s=await it(a);return!s||!Array.isArray(s.decisions)?null:s}catch{return null}}async reviseDecision(t,n,r,a){try{const s=await fetch(`${this.baseUrl}/api/decisions/revise`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dir:t,id:n,answer:r,...a?{note:a}:{}})}),o=await it(s);return!o||o.ok!==!0||!o.decision?null:o.decision}catch{return null}}async fetchGates(){try{const t=await fetch(`${this.baseUrl}/api/gates`,{signal:AbortSignal.timeout(8e3)}),n=await it(t);return!n||typeof n.events!="number"?null:n}catch{return null}}async fetchConsent(){try{const t=await fetch(`${this.baseUrl}/api/consent`,{signal:AbortSignal.timeout(8e3)}),n=await it(t);return!n||n.ok!==!0||!n.picture||!n.picture.denied?null:n.picture}catch{return null}}async fetchCapabilities(){try{const t=await fetch(`${this.baseUrl}/api/capabilities`,{signal:AbortSignal.timeout(8e3)}),n=await it(t);return!n||n.ok!==!0||!Array.isArray(n.verbs)?null:n}catch{return null}}async saveLearnedCommand(t,n,r){try{const a=await fetch(`${this.baseUrl}/api/capabilities/commands`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({verb:t,command:n,...r?{note:r}:{}})}),s=await it(a);return{ok:(s==null?void 0:s.ok)===!0,commands:s==null?void 0:s.commands,error:s==null?void 0:s.error}}catch{return{ok:!1,error:"Could not reach the server."}}}async forgetLearnedCommand(t){try{const n=await fetch(`${this.baseUrl}/api/capabilities/commands/forget`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({verb:t})}),r=await it(n);return{ok:(r==null?void 0:r.ok)===!0,commands:r==null?void 0:r.commands,error:r==null?void 0:r.error}}catch{return{ok:!1,error:"Could not reach the server."}}}async fetchSessionGrants(){try{const t=await fetch(`${this.baseUrl}/api/session-grants`,{signal:AbortSignal.timeout(8e3)}),n=await it(t);return!n||!Array.isArray(n.grants)?null:n.grants}catch{return null}}async revokeSessionGrant(t){try{const n=await fetch(`${this.baseUrl}/api/session-grants/clear`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:t})}),r=await it(n);return(r==null?void 0:r.ok)===!0}catch{return!1}}async fetchAdminChecks(){try{const t=await fetch(`${this.baseUrl}/api/admin/checks`,{signal:AbortSignal.timeout(15e3)}),n=await it(t);return!n||!Array.isArray(n.system)||!Array.isArray(n.enterprise)||!Array.isArray(n.providers)?null:n}catch{return null}}async fetchHub(){var t;try{const n=await fetch(`${this.baseUrl}/api/hub`,{signal:AbortSignal.timeout(8e3)}),r=await it(n);return!r||!Array.isArray((t=r.toolsets)==null?void 0:t.toolsets)?null:r}catch{return null}}async rateTrace(t,n){try{const r=await fetch(`${this.baseUrl}/api/traces/${encodeURIComponent(t)}/verdict`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({verdict:n}),signal:AbortSignal.timeout(8e3)}),a=await it(r);return a!=null&&a.ok&&a.rated?{traceId:a.rated.traceId,corpusLabeled:!!a.rated.corpusLabeled}:null}catch{return null}}async fetchTraceDetail(t){try{const n=await fetch(`${this.baseUrl}/api/traces/${encodeURIComponent(t)}`,{signal:AbortSignal.timeout(8e3)}),r=await it(n);return r&&Array.isArray(r.steps)?r:null}catch{return null}}async sendAdminRequest(t,n,r){try{const a=Xt(),s=await fetch(`${this.baseUrl}${t}`,{method:n,headers:{"Content-Type":"application/json",...a?{Authorization:`Bearer ${a}`}:{}},body:r!==void 0?JSON.stringify(r):void 0,signal:AbortSignal.timeout(15e3)}),o=s.headers.get("content-type")||"";let l=null;if(o.includes("application/json")||o.includes("text/json"))try{l=await s.json()}catch{l=null}return{status:s.status,data:l}}catch{return null}}async fetchAdminAuthStatus(){const t=await this.sendAdminRequest("/api/admin/auth-status","GET");if(!t||typeof t.data!="object"||t.data===null)return null;const n=t.data;return typeof n.configured!="boolean"||typeof n.authenticated!="boolean"?null:{configured:n.configured,authenticated:n.authenticated,user:typeof n.user=="string"?n.user:null,role:typeof n.role=="string"?n.role:null,mustChangePassword:n.mustChangePassword===!0}}async changeAdminPassword(t,n){const r=await this.sendAdminRequest("/api/admin/change-password","POST",{currentPassword:t,newPassword:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok?{ok:!0}:{ok:!1,error:a.error||"Could not change the password."}}async fetchAdminUsers(){const t=await this.sendAdminRequest("/api/admin/users","GET");if(!t)return{ok:!1,error:"Could not reach the dashboard server."};const n=t.data??{};return t.status===200&&n.ok&&Array.isArray(n.users)?n:{ok:!1,error:n.error||"Failed to load users.",forbidden:t.status===403,unauthorized:t.status===401}}async addAdminUser(t,n,r){const a=await this.sendAdminRequest("/api/admin/users","POST",{user:t,password:n,role:r});if(!a)return{ok:!1,error:"Could not reach the dashboard server."};const s=a.data??{};return a.status===200&&s.ok?s:{ok:!1,error:s.error||"Failed to add user.",forbidden:a.status===403,unauthorized:a.status===401}}async removeAdminUser(t){const n=await this.sendAdminRequest(`/api/admin/users/${encodeURIComponent(t)}`,"DELETE");if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?r:{ok:!1,error:r.error||"Failed to remove user.",forbidden:n.status===403,unauthorized:n.status===401}}async fetchAdminCatalog(){const t=await this.sendAdminRequest("/api/admin/catalog","GET"),n=t==null?void 0:t.data;return!n||!Array.isArray(n.providers)?null:n.providers}async adminSetup(t,n){const r=await this.sendAdminRequest("/api/admin/setup","POST",{user:t,password:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&typeof a.token=="string"?(dg(a.token),{ok:!0,user:a.user,token:a.token}):{ok:!1,error:a.error||"Setup failed.",unauthorized:r.status===401}}async adminLogin(t,n){const r=await this.sendAdminRequest("/api/admin/login","POST",{user:t,password:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&typeof a.token=="string"?(dg(a.token),{ok:!0,user:a.user,token:a.token}):{ok:!1,error:a.error||"Login failed.",unauthorized:r.status===401}}async adminLogout(){await this.sendAdminRequest("/api/admin/logout","POST"),dg(null)}async shutdown(t){const n=await this.sendAdminRequest("/api/admin/shutdown","POST",{target:t});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?r:{ok:!1,error:r.error||"Shutdown failed.",unauthorized:n.status===401,forbidden:n.status===403}}async saveProvider(t,n){const r=await this.sendAdminRequest(`/api/admin/providers/${encodeURIComponent(t)}`,"PUT",n);if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok?a:{ok:!1,error:a.error||"Save failed.",unauthorized:r.status===401}}async deleteProvider(t){const n=await this.sendAdminRequest(`/api/admin/providers/${encodeURIComponent(t)}`,"DELETE");if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?r:{ok:!1,error:r.error||"Remove failed.",unauthorized:n.status===401}}async testProvider(t){const n=await this.sendAdminRequest(`/api/admin/providers/${encodeURIComponent(t)}/test`,"POST");if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200?r:{ok:!1,error:r.error||"Test failed.",unauthorized:n.status===401}}async fetchOmniRouteStatus(){const t=await this.sendAdminRequest("/api/admin/omniroute","GET");if(!t)return null;const n=t.data??{};return t.status!==200||!n.status?null:n.status}async controlOmniRoute(t){const n=await this.sendAdminRequest("/api/admin/omniroute","POST",{action:t});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200?r:{ok:!1,error:r.error||"OmniRoute control failed.",unauthorized:n.status===401,forbidden:n.status===403}}async fetchAdminWorkspace(){const t=await this.sendAdminRequest("/api/admin/workspace","GET");if(!t)return null;const n=t.data??{};return t.status!==200||n.ok!==!0?null:{configured:typeof n.configured=="string"?n.configured:null,effective:typeof n.effective=="string"?n.effective:null,processCwd:typeof n.processCwd=="string"?n.processCwd:"",configuredValid:n.configuredValid===!0}}async saveAdminWorkspace(t){const n=await this.sendAdminRequest("/api/admin/workspace","PUT",{cwd:t});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok===!0?{ok:!0,workspace:{configured:typeof r.configured=="string"?r.configured:null,effective:typeof r.effective=="string"?r.effective:null,processCwd:typeof r.processCwd=="string"?r.processCwd:"",configuredValid:r.configuredValid===!0}}:{ok:!1,error:r.error||"Save failed.",unauthorized:n.status===401,forbidden:n.status===403}}async fetchAdminCache(){const t=await this.sendAdminRequest("/api/admin/cache","GET");if(!t)return null;const n=t.data;return!n||n.ok!==!0||!Array.isArray(n.workspaces)?null:n}async clearAdminCache(t){const n=await this.sendAdminRequest("/api/admin/cache/clear","POST",{scope:t});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?{ok:!0,removed:r.removed??0}:{ok:!1,error:r.error||"Could not clear the cache.",unauthorized:n.status===401,forbidden:n.status===403}}async fetchAdminServices(){const t=await this.sendAdminRequest("/api/admin/services","GET");if(!t)return null;const n=t.data;return!n||n.ok!==!0||!Array.isArray(n.services)?null:n}async saveService(t,n){const r=await this.sendAdminRequest(`/api/admin/services/${encodeURIComponent(t)}`,"PUT",{values:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok?a:{ok:!1,error:a.error||"Save failed.",unauthorized:r.status===401,forbidden:r.status===403}}async testService(t){const n=await this.sendAdminRequest(`/api/admin/services/${encodeURIComponent(t)}/test`,"POST");if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200?r:{ok:!1,error:r.error||"Test failed."}}async removeService(t){const n=await this.sendAdminRequest(`/api/admin/services/${encodeURIComponent(t)}`,"DELETE");if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?r:{ok:!1,error:r.error||"Remove failed.",unauthorized:n.status===401,forbidden:n.status===403}}async fetchAdminQuota(){const t=await this.sendAdminRequest("/api/admin/quota","GET");if(!t)return null;const n=t.data;return!n||!n.ok||typeof n.quota!="object"?null:n}async setToolsetEnabled(t,n){const r=await this.sendAdminRequest(`/api/admin/hub/toolsets/${encodeURIComponent(t)}`,"PUT",{enabled:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok?a:{ok:!1,error:a.error||"Toggle failed.",unauthorized:r.status===401,forbidden:r.status===403}}async setSkillEnabled(t,n){const r=await this.sendAdminRequest(`/api/admin/hub/skills/${encodeURIComponent(t)}`,"PUT",{enabled:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok?a:{ok:!1,error:a.error||"Toggle failed.",unauthorized:r.status===401,forbidden:r.status===403}}async fetchKnowledge(){try{const n=await(await fetch(`${this.baseUrl}/api/knowledge`,{headers:mt(),signal:AbortSignal.timeout(8e3)})).json();return Array.isArray(n.tags)?n.tags:null}catch{return null}}async knowledgeIngest(t,n){try{const r=await fetch(`${this.baseUrl}/api/knowledge/ingest`,{method:"POST",headers:{"Content-Type":"application/json",...mt()},body:JSON.stringify({tag:t,paths:n})}),a=await r.json();return r.status===200&&a.ok?{...a,ok:!0}:{ok:!1,error:a.error||"Ingest failed."}}catch(r){return{ok:!1,error:r instanceof Error?r.message:String(r)}}}async knowledgeQuery(t,n,r){try{const a=await fetch(`${this.baseUrl}/api/knowledge/query`,{method:"POST",headers:{"Content-Type":"application/json",...mt()},body:JSON.stringify({tag:t,question:n,topK:r})}),s=await a.json();return a.status===200&&s.ok?{...s,ok:!0}:{ok:!1,error:s.error||"Query failed."}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async knowledgeForget(t){try{const n=await fetch(`${this.baseUrl}/api/knowledge/forget`,{method:"POST",headers:{"Content-Type":"application/json",...mt()},body:JSON.stringify({tag:t})}),r=await n.json();return n.status===200&&r.ok?{...r,ok:!0}:{ok:!1,error:r.error||"Forget failed."}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async marketplaceSearch(t){try{const r=await(await fetch(`${this.baseUrl}/api/skills/marketplace?q=${encodeURIComponent(t)}`,{headers:mt()})).json();return Array.isArray(r.results)?r.results:[]}catch{return[]}}async marketplaceInstall(t){try{const n=await fetch(`${this.baseUrl}/api/skills/marketplace/install`,{method:"POST",headers:{"Content-Type":"application/json",...mt()},body:JSON.stringify({name:t})}),r=await n.json();return n.status===200&&r.ok?{ok:!0}:{ok:!1,error:r.error||"Install failed.",quarantined:r.quarantined===!0}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async marketplaceUninstall(t){try{const n=await fetch(`${this.baseUrl}/api/skills/marketplace/uninstall`,{method:"POST",headers:{"Content-Type":"application/json",...mt()},body:JSON.stringify({name:t})}),r=await n.json();return n.status===200&&r.ok?{ok:!0}:{ok:!1,error:r.error||"Uninstall failed."}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async sendChannelMessage(t,n){const r=await this.sendAdminRequest("/api/admin/hub/channels/send","POST",{target:t,text:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok?a:{ok:!1,error:a.error||"Send failed.",unauthorized:r.status===401,forbidden:r.status===403}}async gatewayPolicies(){const t=await this.sendAdminRequest("/api/admin/gateway/policies","GET");if(!t)return{ok:!1,error:"Could not reach the dashboard server."};const n=t.data??{};return t.status===200&&n.ok?{ok:!0,policies:n.policies,statusRecipients:n.statusRecipients,contacts:n.contacts,askUserWait:n.askUserWait,askUserTimeoutMs:n.askUserTimeoutMs}:{ok:!1,error:n.error||"Failed to read policies.",unauthorized:t.status===401,forbidden:t.status===403}}async saveGatewayPolicies(t,n,r,a){const s={policies:t};Array.isArray(n)&&(s.statusRecipients=n),Array.isArray(r)&&(s.contacts=r),a&&(s.askUserWait=a.wait,typeof a.timeoutMs=="number"&&(s.askUserTimeoutMs=a.timeoutMs));const o=await this.sendAdminRequest("/api/admin/gateway/policies","PUT",s);if(!o)return{ok:!1,error:"Could not reach the dashboard server."};const l=o.data??{};return o.status===200&&l.ok?l:{ok:!1,error:l.error||"Failed to save policies.",unauthorized:o.status===401,forbidden:o.status===403}}async fetchGatewayConversations(t={}){const n=new URLSearchParams;t.offset&&n.set("offset",String(t.offset)),t.limit&&n.set("limit",String(t.limit)),t.q&&n.set("q",t.q);const r=n.toString(),a=await this.sendAdminRequest(`/api/admin/gateway/conversations${r?`?${r}`:""}`,"GET");if(!a)return{ok:!1,error:"Could not reach the dashboard server."};const s=a.data??{};return a.status===200&&s.ok?{ok:!0,conversations:s.conversations,total:s.total,hasMore:s.hasMore}:{ok:!1,error:s.error||"Failed to load conversations.",unauthorized:a.status===401,forbidden:a.status===403}}async clearGatewayConversation(t){const n=await this.sendAdminRequest("/api/admin/gateway/conversations","DELETE",{key:t});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?{ok:!0}:{ok:!1,error:r.error||"Failed to clear conversation.",unauthorized:n.status===401,forbidden:n.status===403}}async addConversationTag(t,n){const r=await this.sendAdminRequest("/api/admin/gateway/conversations/tags","PUT",{action:"add",key:t,tag:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok?{ok:!0}:{ok:!1,error:a.error||"Failed to add tag.",unauthorized:r.status===401,forbidden:r.status===403}}async removeConversationTag(t,n){const r=await this.sendAdminRequest("/api/admin/gateway/conversations/tags","PUT",{action:"remove",key:t,tag:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok?{ok:!0}:{ok:!1,error:a.error||"Failed to remove tag.",unauthorized:r.status===401,forbidden:r.status===403}}async getAllConversationTags(){const t=await this.sendAdminRequest("/api/admin/gateway/conversations/tags","PUT",{action:"getAllTags"});if(!t)return{ok:!1,error:"Could not reach the dashboard server."};const n=t.data??{};return t.status===200&&n.ok?{ok:!0,tags:n.tags}:{ok:!1,error:n.error||"Failed to load tags.",unauthorized:t.status===401,forbidden:t.status===403}}async exportGatewayConversations(t){var n,r,a;try{const s=Xt(),o=await fetch(`${this.baseUrl}/api/admin/gateway/conversations/export`,{method:"POST",headers:{"Content-Type":"application/json",...s?{Authorization:`Bearer ${s}`}:{}},body:JSON.stringify({keys:t}),signal:AbortSignal.timeout(3e4)});if(o.status===200&&((n=o.headers.get("content-type"))!=null&&n.includes("application/zip"))){const c=await o.blob(),u=URL.createObjectURL(c),d=document.createElement("a");return d.href=u,d.download=((a=(r=o.headers.get("content-disposition"))==null?void 0:r.match(/filename="(.+)"/))==null?void 0:a[1])||"conversations.zip",document.body.appendChild(d),d.click(),document.body.removeChild(d),URL.revokeObjectURL(u),{ok:!0}}return{ok:!1,error:(await o.json().catch(()=>({}))).error||"Export failed."}}catch(s){return{ok:!1,error:s instanceof Error?s.message:String(s)}}}async getContacts(){const t=await this.sendAdminRequest("/api/admin/contacts","GET");if(!t)return{ok:!1,error:"Could not reach the dashboard server."};const n=t.data??{};return t.status===200&&n.ok?{ok:!0,contacts:n.contacts}:{ok:!1,error:n.error||"Failed to read contacts."}}async approveContact(t,n){return this.contactAction("approve",t,n)}async rejectContact(t,n){return this.contactAction("reject",t,n)}async deleteContact(t,n){return this.contactAction("delete",t,n)}async updateContact(t,n,r){const a=await this.sendAdminRequest("/api/admin/contacts","PUT",{action:"update",platform:t,id:n,...r});if(!a)return{ok:!1,error:"Could not reach the dashboard server."};const s=a.data??{};return a.status===200&&s.ok?s:{ok:!1,error:s.error||"Update failed."}}async contactAction(t,n,r){const a=await this.sendAdminRequest("/api/admin/contacts","PUT",{action:t,platform:n,nameOrId:r});if(!a)return{ok:!1,error:"Could not reach the dashboard server."};const s=a.data??{};return a.status===200&&s.ok?s:{ok:!1,error:s.error||`${t} failed.`}}async getPlatformConfigs(){const t=await this.sendAdminRequest("/api/config/platforms","GET");if(!t)return[];const n=t.data??{};return Array.isArray(n.platforms)?n.platforms:[]}async setPlatformConfig(t,n){const r=await this.sendAdminRequest(`/api/config/platforms/${encodeURIComponent(t)}`,"POST",{values:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok?a:{ok:!1,error:a.error||"Save failed.",unauthorized:r.status===401,forbidden:r.status===403}}async removePlatformConfig(t){const n=await this.sendAdminRequest(`/api/config/platforms/${encodeURIComponent(t)}`,"DELETE");if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?r:{ok:!1,error:r.error||"Remove failed.",unauthorized:n.status===401,forbidden:n.status===403}}async verifyPlatformConfig(t,n){const r=await this.sendAdminRequest(`/api/config/platforms/${encodeURIComponent(t)}/verify`,"POST",{values:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return{ok:a.ok??!1,info:a.info,error:a.error}}async saveAdminQuota(t){const n=await this.sendAdminRequest("/api/admin/quota","PUT",t);if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?r:{ok:!1,error:r.error||"Save failed.",unauthorized:n.status===401}}async getBedrockStatus(){const t=await this.sendAdminRequest("/api/bedrock/status","GET");return!t||t.status!==200?{configured:!1,region:"us-east-1",authMethod:"none",apiKeySet:!1,iamKeySet:!1}:t.data??{}}async setupBedrock(t){const n=await this.sendAdminRequest("/api/bedrock/setup","POST",{envVars:t});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?{ok:!0,envVarsWritten:r.envVarsWritten}:{ok:!1,error:r.error||"Save failed."}}async probeBedrock(t){const n=await this.sendAdminRequest("/api/bedrock/probe","POST",{region:t});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?{ok:!0,models:r.models}:{ok:!1,error:r.error||"Probe failed."}}async listTasks(){const t=await this.sendAdminRequest("/api/tasks","GET");if(!t)return null;const n=t.data??{};return{status:t.status,tasks:Array.isArray(n.tasks)?n.tasks:[]}}async startTask(t,n){const r=await this.sendAdminRequest("/api/tasks","POST",{args:t,timeoutMs:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok&&a.task?a:{ok:!1,error:a.error||"Start failed.",unauthorized:r.status===401,forbidden:r.status===403}}async getTask(t){const n=await this.sendAdminRequest(`/api/tasks/${encodeURIComponent(t)}`,"GET");if(!n)return null;const r=n.data??{};return{status:n.status,task:r.task??null}}async cancelTask(t){const n=await this.sendAdminRequest(`/api/tasks/${encodeURIComponent(t)}/cancel`,"POST");if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?r:{ok:!1,error:r.error||"Cancel failed.",unauthorized:n.status===401,forbidden:n.status===403}}subscribeTask(t,n){const r=Xt(),a=new EventSource(`${this.baseUrl}/api/tasks/${encodeURIComponent(t)}/events?token=${encodeURIComponent(r??"")}`);return a.addEventListener("log",s=>{var o;try{(o=n.onLog)==null||o.call(n,JSON.parse(s.data))}catch{}}),a.addEventListener("status",s=>{var o;try{const l=JSON.parse(s.data);l.status&&((o=n.onStatus)==null||o.call(n,l.status))}catch{}}),()=>a.close()}async getWhatsAppStatus(){const t=await this.sendAdminRequest("/api/whatsapp","GET");if(!t)return null;const n=t.data??{};return t.status===200&&n.ok&&n.status?{status:n.status,contacts:n.contacts??{}}:null}async startWhatsAppPair(t){const n=await this.sendAdminRequest("/api/whatsapp/pair","POST",{phone:t||void 0});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?r:{ok:!1,error:r.error||"Pairing failed to start.",unauthorized:n.status===401,forbidden:n.status===403}}async cancelWhatsAppPair(){const t=await this.sendAdminRequest("/api/whatsapp/cancel","POST");if(!t)return{ok:!1,error:"Could not reach the dashboard server."};const n=t.data??{};return t.status===200&&n.ok?n:{ok:!1,error:n.error||"Cancel failed.",unauthorized:t.status===401,forbidden:t.status===403}}async unpairWhatsApp(){const t=await this.sendAdminRequest("/api/whatsapp/unpair","POST");if(!t)return{ok:!1,error:"Could not reach the dashboard server."};const n=t.data??{};return t.status===200&&n.ok?n:{ok:!1,error:n.error||"Unpair failed.",unauthorized:t.status===401,forbidden:t.status===403}}subscribeWhatsApp(t){const n=Xt(),r=new EventSource(`${this.baseUrl}/api/whatsapp/events?token=${encodeURIComponent(n??"")}`);return r.addEventListener("qr",a=>{var s;try{const o=JSON.parse(a.data);o.qr&&((s=t.onQr)==null||s.call(t,o.qr))}catch{}}),r.addEventListener("code",a=>{var s;try{const o=JSON.parse(a.data);o.code&&((s=t.onCode)==null||s.call(t,o.code))}catch{}}),r.addEventListener("status",a=>{var s;try{(s=t.onStatus)==null||s.call(t,JSON.parse(a.data))}catch{}}),()=>r.close()}async chatResolve(t){const n=Xt();try{const r=await fetch(`${this.baseUrl}/api/chat/resolve`,{method:"POST",headers:{"Content-Type":"application/json",...n?{Authorization:`Bearer ${n}`}:{}},body:JSON.stringify({message:t}),signal:AbortSignal.timeout(1e4)}),a=await r.json();return r.status===200&&a.ok&&Array.isArray(a.matches)?{ok:!0,matches:a.matches}:{ok:!1,matches:[],error:typeof a.error=="string"?a.error:"Resolve failed."}}catch{return{ok:!1,matches:[],error:"Could not reach the dashboard server."}}}async listRoutableModels(){const t=Xt();try{const n=await fetch(`${this.baseUrl}/api/chat/routable-models`,{headers:t?{Authorization:`Bearer ${t}`}:{},signal:AbortSignal.timeout(1e4)}),r=await n.json();return n.status===200&&r.ok&&Array.isArray(r.models)?r.models:[]}catch{return[]}}async listProjects(){const t=Xt();try{const n=await fetch(`${this.baseUrl}/api/projects`,{headers:t?{Authorization:`Bearer ${t}`}:{},signal:AbortSignal.timeout(1e4)}),r=await n.json();return n.status===200&&r.ok&&Array.isArray(r.projects)?r.projects:[]}catch{return[]}}async attachProject(t){const n=Xt();try{const r=await fetch(`${this.baseUrl}/api/projects/attach`,{method:"POST",headers:{"Content-Type":"application/json",...n?{Authorization:`Bearer ${n}`}:{}},body:JSON.stringify({path:t}),signal:AbortSignal.timeout(3e4)}),a=await r.json();return r.status===200&&a.ok&&a.project?{ok:!0,project:a.project}:{ok:!1,error:typeof a.error=="string"?a.error:"Attach failed."}}catch{return{ok:!1,error:"Could not reach the dashboard server."}}}async browseDirectories(t,n){const r=Xt();try{const a=new URLSearchParams;t&&a.set("path",t),n!=null&&n.showDrives&&a.set("showDrives","1");const s=a.toString()?`?${a.toString()}`:"",o=await fetch(`${this.baseUrl}/api/browse${s}`,{headers:r?{Authorization:`Bearer ${r}`}:{},signal:AbortSignal.timeout(1e4)}),l=await o.json();return o.status===200&&l.ok&&Array.isArray(l.entries)?{ok:!0,path:l.path??"",entries:l.entries,parent:l.parent??null,isProject:l.isProject??!1,drives:l.drives,breadcrumbs:l.breadcrumbs}:{ok:!1,path:"",entries:[],parent:null,isProject:!1,error:typeof l.error=="string"?l.error:"Browse failed."}}catch{return{ok:!1,path:"",entries:[],parent:null,isProject:!1,error:"Could not reach the dashboard server."}}}async resolveFolder(t,n){const r=Xt();try{const a=await fetch(this.baseUrl+"/api/browse/resolve-folder",{method:"POST",headers:{"Content-Type":"application/json",...r?{Authorization:"Bearer "+r}:{}},body:JSON.stringify({name:t,subPath:n||""}),signal:AbortSignal.timeout(1e4)}),s=await a.json();return a.status===200&&s.ok&&s.path?{ok:!0,path:s.path}:{ok:!1,path:"",error:typeof s.error=="string"?s.error:"Could not resolve folder."}}catch{return{ok:!1,path:"",error:"Could not reach the dashboard server."}}}async listChatSessions(){const t=Xt();try{const n=await fetch(`${this.baseUrl}/api/sessions`,{headers:t?{Authorization:`Bearer ${t}`}:{},signal:AbortSignal.timeout(1e4)}),r=await n.json();return n.status===200&&r.ok&&Array.isArray(r.sessions)?r.sessions:[]}catch{return[]}}async deleteChatSession(t){const n=Xt();try{const r=await fetch(`${this.baseUrl}/api/sessions/${encodeURIComponent(t)}`,{method:"DELETE",headers:n?{Authorization:`Bearer ${n}`}:{},signal:AbortSignal.timeout(1e4)}),a=await r.json();return r.status===200&&a.ok?{ok:!0}:{ok:!1,error:a.error||"Could not delete the session."}}catch{return{ok:!1,error:"Network error — could not delete the session."}}}async renameChatSession(t,n){const r=Xt();try{const a=await fetch(`${this.baseUrl}/api/sessions/${encodeURIComponent(t)}/rename`,{method:"POST",headers:{"Content-Type":"application/json",...r?{Authorization:`Bearer ${r}`}:{}},body:JSON.stringify({title:n}),signal:AbortSignal.timeout(1e4)}),s=await a.json();return a.status===200&&s.ok?{ok:!0}:{ok:!1,error:s.error||"Could not rename the session."}}catch{return{ok:!1,error:"Network error — could not rename the session."}}}async getChatSession(t){const n=Xt();try{const r=await fetch(`${this.baseUrl}/api/sessions/${encodeURIComponent(t)}`,{headers:n?{Authorization:`Bearer ${n}`}:{},signal:AbortSignal.timeout(1e4)}),a=await r.json();return r.status===200&&a.ok&&a.session?a.session:null}catch{return null}}async chatSend(t,n,r,a){const s=Xt();try{const o=await fetch(`${this.baseUrl}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json",...s?{Authorization:`Bearer ${s}`}:{}},body:JSON.stringify({sessionId:t,message:n,provider:r==null?void 0:r.provider,model:r==null?void 0:r.model,...(r==null?void 0:r.strict)===void 0?{}:{strict:r.strict},projectPath:r==null?void 0:r.projectPath,attachments:r==null?void 0:r.attachments,...(r==null?void 0:r.worktree)===void 0?{}:{worktree:r.worktree},...(r==null?void 0:r.keepWorktree)===void 0?{}:{keepWorktree:r.keepWorktree},...(r==null?void 0:r.resume)===void 0?{}:{resume:r.resume}}),signal:a?AbortSignal.any([AbortSignal.timeout(3e5),a]):AbortSignal.timeout(3e5)}),l=await o.json();return o.status===200&&l.ok?{ok:!0,content:typeof l.content=="string"?l.content:"",followups:Array.isArray(l.followups)?l.followups:[],provider:typeof l.provider=="string"?l.provider:null,model:typeof l.model=="string"?l.model:null,...typeof l.routingNotice=="string"&&l.routingNotice?{routingNotice:l.routingNotice}:{},...typeof l.workspaceNotice=="string"&&l.workspaceNotice?{workspaceNotice:l.workspaceNotice}:{},...typeof l.workspacePath=="string"&&l.workspacePath?{workspacePath:l.workspacePath}:{},...typeof l.workspaceSource=="string"&&l.workspaceSource?{workspaceSource:l.workspaceSource}:{},generationFailed:l.generationFailed===!0,retryQueued:l.retryQueued===!0,...l.needsProject===!0?{needsProject:!0}:{},...l.refused===!0?{refused:!0}:{},...iB(l.worktree)?{worktree:l.worktree}:{},...sB(l.resume)?{resume:l.resume}:{},...Array.isArray(l.findings)?{findings:l.findings}:{},...oB(l.turnReport)?{turnReport:l.turnReport}:{}}:{ok:!1,error:typeof l.error=="string"?l.error:"The agent could not answer.",unauthorized:o.status===401,forbidden:o.status===403}}catch(o){const l=o==null?void 0:o.name;return l==="TimeoutError"?{ok:!1,turnStillRunning:!0,error:"The dashboard stopped waiting after 5 minutes — the turn is STILL RUNNING on the server. Its answer will appear here when it lands (nothing was lost — the turn keeps running)."}:l==="AbortError"?{ok:!1,error:"Cancelled."}:{ok:!1,error:"Could not reach the dashboard server."}}}async chatCancel(t){const n=await this.sendAdminRequest("/api/chat/cancel","POST",{sessionId:t});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?{ok:!0,cancelled:r.cancelled===!0}:{ok:!1,error:r.error||"Cancel failed."}}async chatReset(t){const n=await this.sendAdminRequest("/api/chat/reset","POST",{sessionId:t});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?{ok:!0}:{ok:!1,error:r.error||"Reset failed."}}async chatSupportBundle(t){var r,a,s;const n=Xt();try{const o=await fetch(`${this.baseUrl}/api/chat/${encodeURIComponent(t)}/support-bundle`,{method:"GET",headers:{...n?{Authorization:`Bearer ${n}`}:{}},signal:AbortSignal.timeout(3e4)});if(o.status===200&&((r=o.headers.get("content-type"))!=null&&r.includes("application/zip"))){const c=await o.blob(),u=URL.createObjectURL(c),d=document.createElement("a");return d.href=u,d.download=((s=(a=o.headers.get("content-disposition"))==null?void 0:a.match(/filename="(.+)"/))==null?void 0:s[1])||"nuvira-support.zip",document.body.appendChild(d),d.click(),document.body.removeChild(d),URL.revokeObjectURL(u),{ok:!0}}return{ok:!1,error:(await o.json().catch(()=>({}))).error||"Could not build the support bundle."}}catch(o){return{ok:!1,error:o instanceof Error?o.message:"Could not reach the dashboard server."}}}subscribeChat(t,n){const r=Xt(),a=new EventSource(`${this.baseUrl}/api/chat/${encodeURIComponent(t)}/events?token=${encodeURIComponent(r??"")}`);return a.addEventListener("progress",s=>{var o;try{const l=JSON.parse(s.data);l.line&&((o=n.onProgress)==null||o.call(n,l.line))}catch{}}),a.addEventListener("status",s=>{var o,l;try{const c=JSON.parse(s.data);c.status&&((o=n.onStatus)==null||o.call(n,c.status)),c.status==="done"&&c.answer&&typeof c.answer.content=="string"&&((l=n.onTurnDone)==null||l.call(n,{content:c.answer.content,followups:Array.isArray(c.answer.followups)?c.answer.followups:[],generationFailed:c.answer.generationFailed===!0,...c.answer.bounded===void 0?{}:{bounded:c.answer.bounded},...c.answer.provider===void 0?{}:{provider:c.answer.provider},...c.answer.model===void 0?{}:{model:c.answer.model}}))}catch{}}),a.addEventListener("token",s=>{var o;try{const l=JSON.parse(s.data);typeof l.text=="string"&&l.text.length>0&&((o=n.onToken)==null||o.call(n,l.text))}catch{}}),a.addEventListener("tool",s=>{var o;try{const l=JSON.parse(s.data);l.tool&&(l.phase==="started"||l.phase==="called")&&((o=n.onTool)==null||o.call(n,{id:l.id||`call_${Math.random().toString(36).slice(2,8)}`,tool:l.tool,phase:l.phase,args:l.args,ok:l.ok,result:l.result,error:l.error,durationMs:l.durationMs}))}catch{}}),a.addEventListener("plan",s=>{var o;try{const l=JSON.parse(s.data);l.goal&&Array.isArray(l.steps)&&((o=n.onPlan)==null||o.call(n,{goal:l.goal,steps:l.steps,revision:l.revision??0}))}catch{}}),a.addEventListener("diff",s=>{var o;try{const l=JSON.parse(s.data);Array.isArray(l.files)&&((o=n.onDiff)==null||o.call(n,{files:l.files,summary:l.summary??""}))}catch{}}),a.addEventListener("finding",s=>{var o;try{const c=JSON.parse(s.data).finding;c&&typeof c.claim=="string"&&(c.verdict==="CONFIRMED"||c.verdict==="PLAUSIBLE")&&((o=n.onFinding)==null||o.call(n,{claim:c.claim,verdict:c.verdict,outcome:typeof c.outcome=="string"?c.outcome:"",evidence:Array.isArray(c.evidence)?c.evidence:[],source:typeof c.source=="string"?c.source:""}))}catch{}}),a.addEventListener("skill_draft",s=>{var o;try{const l=JSON.parse(s.data);l.name&&l.markdown&&((o=n.onSkillDraft)==null||o.call(n,{name:l.name,description:l.description??"",markdown:l.markdown,updatedAt:l.updatedAt??0}))}catch{}}),a.addEventListener("secret_request",s=>{var o;try{const l=JSON.parse(s.data);l.skillName&&Array.isArray(l.missing)&&((o=n.onSecretRequest)==null||o.call(n,{skillName:l.skillName,missing:l.missing,persisted:l.persisted??{}}))}catch{}}),a.addEventListener("execution_result",s=>{var o;try{const l=JSON.parse(s.data);l.skillName&&l.runtime!==void 0&&((o=n.onExecutionResult)==null||o.call(n,{skillName:l.skillName,runtime:l.runtime,success:l.success??!1,durationMs:l.durationMs??0,exitCode:l.exitCode??0,stdout:l.stdout??"",stderr:l.stderr??"",timestamp:l.timestamp??Date.now()}))}catch{}}),a.addEventListener("question",s=>{var o;try{const l=JSON.parse(s.data);l.questionId&&l.question&&((o=n.onQuestion)==null||o.call(n,{questionId:l.questionId,question:l.question,choices:l.choices??[],multiSelect:l.multiSelect===!0}))}catch{}}),()=>a.close()}async chatRespond(t,n,r={}){try{const s=await(await fetch(`${this.baseUrl}/api/chat/${encodeURIComponent(t)}/respond`,{method:"POST",headers:{"Content-Type":"application/json",...mt()},body:JSON.stringify({questionId:n,...r})})).json();return{ok:s.ok===!0,error:s.error}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async skillDraftAccept(t){try{const r=await(await fetch(`${this.baseUrl}/api/skills/drafts/${encodeURIComponent(t)}/accept`,{method:"POST",headers:{...mt()}})).json();return{ok:r.ok===!0,error:r.error}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async skillDraftReject(t){try{const r=await(await fetch(`${this.baseUrl}/api/skills/drafts/${encodeURIComponent(t)}`,{method:"DELETE",headers:{...mt()}})).json();return{ok:r.ok===!0,error:r.error}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async saveSecrets(t){try{const r=await(await fetch(`${this.baseUrl}/api/skills/secrets`,{method:"POST",headers:{"Content-Type":"application/json",...mt()},body:JSON.stringify({vars:t})})).json();return{ok:r.ok===!0,error:r.error,saved:r.saved,refused:r.refused}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async fetchSkillEnv(){try{const t=await fetch(`${this.baseUrl}/api/skills/env`,{headers:{...mt()}}),n=await it(t);return(n==null?void 0:n.vars)??[]}catch{return[]}}async deleteSkillEnvVar(t){try{const r=await(await fetch(`${this.baseUrl}/api/skills/env/delete`,{method:"POST",headers:{"Content-Type":"application/json",...mt()},body:JSON.stringify({name:t})})).json();return{ok:r.ok===!0,removed:r.removed,error:r.error}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async testSkillEnvVar(t){try{const r=await(await fetch(`${this.baseUrl}/api/skills/env/test`,{method:"POST",headers:{"Content-Type":"application/json",...mt()},body:JSON.stringify({name:t})})).json();return{ok:r.ok===!0,usable:r.usable,detail:r.detail,error:r.error}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async fetchProcessEnv(){try{const t=await fetch(`${this.baseUrl}/api/process-env`,{headers:{...mt()}}),n=await it(t);return(n==null?void 0:n.vars)??[]}catch{return[]}}async fetchLimits(){try{const t=await fetch(`${this.baseUrl}/api/limits`),n=await it(t);return!n||typeof n.attachmentMaxBytes!="number"||n.attachmentMaxBytes<=0?null:{attachmentMaxBytes:n.attachmentMaxBytes,extractMaxChars:typeof n.extractMaxChars=="number"?n.extractMaxChars:0}}catch{return null}}async fetchContinuity(){try{const t=await fetch(`${this.baseUrl}/api/continuity`,{headers:{...mt()}}),n=await it(t);return!n||n.ok!==!0?null:{sessions:n.sessions??[],recall:n.recall??[],toggles:n.toggles??{sessionStore:!1,sessionRecall:!1}}}catch{return null}}async clearContinuity(t,n,r){try{const s=await(await fetch(`${this.baseUrl}/api/continuity/clear`,{method:"POST",headers:{"Content-Type":"application/json",...mt()},body:JSON.stringify({target:t,...n?{id:n}:{},...r?{olderThanMs:r}:{}})})).json();return{ok:s.ok===!0,removed:s.removed,error:s.error}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async fetchHistory(){try{const t=await fetch(`${this.baseUrl}/api/history`,{headers:{...mt()}});return await it(t)}catch{return null}}async clearHistory(t,n={}){try{const a=await(await fetch(`${this.baseUrl}/api/history/clear`,{method:"POST",headers:{"Content-Type":"application/json",...mt()},body:JSON.stringify({target:t,...n.id?{id:n.id}:{},...n.olderThanMs?{olderThanMs:n.olderThanMs}:{}})})).json();return{ok:a.ok===!0,removed:a.removed,error:a.error}}catch(r){return{ok:!1,error:r instanceof Error?r.message:String(r)}}}async fetchVerifyBacklog(){try{const t=await fetch(`${this.baseUrl}/api/models/verify-next`,{headers:{...mt()}});return await it(t)}catch{return null}}async startVerifyBacklog(t){try{const n=await fetch(`${this.baseUrl}/api/models/verify-next`,{method:"POST",headers:{"Content-Type":"application/json",...mt()},body:JSON.stringify({count:t})}),r=await it(n);return r?{ok:r.ok===!0,error:r.error,refusal:r.refusal,state:r.state}:{ok:!1,error:"The dashboard server did not respond."}}catch(n){return{ok:!1,error:n instanceof Error?n.message:"Could not start the run."}}}async saveProcessEnvVar(t,n){try{const a=await(await fetch(`${this.baseUrl}/api/process-env`,{method:"POST",headers:{"Content-Type":"application/json",...mt()},body:JSON.stringify({name:t,value:n})})).json();return{ok:a.ok===!0,row:a.row,error:a.error,reason:a.reason}}catch(r){return{ok:!1,error:r instanceof Error?r.message:String(r)}}}async deleteProcessEnvVar(t){try{const r=await(await fetch(`${this.baseUrl}/api/process-env/delete`,{method:"POST",headers:{"Content-Type":"application/json",...mt()},body:JSON.stringify({name:t})})).json();return{ok:r.ok===!0,removed:r.removed,row:r.row,error:r.error}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async fetchHooks(){try{const t=await fetch(`${this.baseUrl}/api/hooks`,{headers:{...mt()}}),n=await it(t);return!n||!Array.isArray(n.hooks)?null:n}catch{return null}}async saveHooks(t){try{const n=await fetch(`${this.baseUrl}/api/hooks`,{method:"PUT",headers:{"Content-Type":"application/json",...mt()},body:JSON.stringify({hooks:t})}),r=await n.json();return{ok:r.ok===!0,hooks:r.hooks,error:r.error,forbidden:n.status===403}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}}const K=new hB;async function pB(e=!1){const t=await K.sendAdminRequest(`/api/mcp${e?"?deep=1":""}`,"GET");return!t||t.status!==200?null:t.data}async function mB(e){const t=await K.sendAdminRequest("/api/mcp/settings","POST",{patch:e}),n=(t==null?void 0:t.data)??null;return t?n??{ok:t.status===200,error:`Server returned HTTP ${t.status}`}:{ok:!1,error:"Could not reach the dashboard server."}}async function gB(e){const t=await K.sendAdminRequest("/api/mcp/install","POST",e);return t?t.data??{ok:!1,error:`Server returned HTTP ${t.status}`}:{ok:!1,error:"Could not reach the dashboard server."}}async function vB(e){const t=await K.sendAdminRequest("/api/mcp/servers","POST",e);return t?t.data??{ok:!1,error:`Server returned HTTP ${t.status}`}:{ok:!1,error:"Could not reach the dashboard server."}}async function yB(e){const t=await K.sendAdminRequest("/api/mcp/uninstall","POST",{name:e});return t?t.data??{ok:!1,reason:`Server returned HTTP ${t.status}`}:{ok:!1,reason:"Could not reach the dashboard server."}}const du=["enterprise","neutral","pastel","executive","contrast","premium","premium-amoled"],Bp=["light","dark"],aw=[100,112,125,150],ch={enterprise:"Enterprise",neutral:"Neutral",pastel:"Pastel",executive:"Executive",contrast:"High contrast",premium:"Premium","premium-amoled":"Premium AMOLED"},IT="nuvira.dashboard.theme",cS={palette:"enterprise",mode:"dark",a11y:!1,fontScale:100};function Bo(e,t){return e.includes(t)}function bB(){return typeof window>"u"||typeof window.matchMedia!="function"?null:window.matchMedia("(prefers-color-scheme: dark)").matches}function $T(){const e=bB();return e===null?{...cS}:{...cS,mode:e?"dark":"light"}}function LT(){const e=$T();if(typeof localStorage>"u")return e;let t;try{const a=localStorage.getItem(IT);if(!a)return e;t=JSON.parse(a)}catch{return e}if(typeof t!="object"||t===null)return e;const n=t,r=Bo(aw,n.fontScale)?n.fontScale:e.fontScale;return{palette:Bo(du,n.palette)?n.palette:e.palette,mode:Bo(Bp,n.mode)?n.mode:e.mode,a11y:typeof n.a11y=="boolean"?n.a11y:e.a11y,fontScale:r}}function DT(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(IT,JSON.stringify(e))}catch{}}function iw(e,t){const n=typeof document<"u"?document.documentElement:void 0;n&&(n.setAttribute("data-palette",e.palette),n.setAttribute("data-mode",e.mode),n.setAttribute("data-a11y",e.a11y?"on":"off"),n.setAttribute("data-font-scale",String(e.fontScale)),n.style.colorScheme=e.mode)}function xB(e,t){const n={palette:Bo(du,t.palette)?t.palette:e.palette,mode:Bo(Bp,t.mode)?t.mode:e.mode,a11y:t.a11y??e.a11y,fontScale:Bo(aw,t.fontScale)?t.fontScale:e.fontScale};return n.a11y||(n.fontScale=100),n}let pr=LT();const xy=new Set;function BT(){for(const e of xy)e()}function wB(e){return xy.add(e),()=>{xy.delete(e)}}function uS(){return pr}function Hd(e){const t=xB(pr,e);t.palette===pr.palette&&t.mode===pr.mode&&t.a11y===pr.a11y&&t.fontScale===pr.fontScale||(pr=t,iw(pr),DT(pr),BT())}function kB(){pr=$T(),iw(pr),DT(pr),BT()}function SB(){return b.useSyncExternalStore(wB,uS,uS)}const dS={light:"Light",dark:"Dark"},fS={100:"100%",112:"112%",125:"125%",150:"150%"};function jB(){const e=SB(),[t,n]=b.useState(!1),r=b.useRef(null),a=b.useRef(null),s=b.useRef(null),o=b.useId(),l=`${o}-panel`;b.useEffect(()=>{if(!t)return;function u(f){var h;f.key==="Escape"&&(n(!1),(h=r.current)==null||h.focus())}function d(f){var p;const h=f.target;h&&((p=s.current)!=null&&p.contains(h))||n(!1)}return document.addEventListener("keydown",u),document.addEventListener("pointerdown",d),()=>{document.removeEventListener("keydown",u),document.removeEventListener("pointerdown",d)}},[t]),b.useEffect(()=>{var d,f,h;if(!t)return;(h=((d=a.current)==null?void 0:d.querySelector("input:checked"))??((f=a.current)==null?void 0:f.querySelector("input")))==null||h.focus()},[t]);const c=`${ch[e.palette]} palette, ${dS[e.mode].toLowerCase()} mode, text size ${fS[e.fontScale]}`+(e.a11y?", accessibility mode on":"");return i.jsxs("div",{className:"theme-switcher",ref:s,onBlur:u=>{const d=u.relatedTarget;d&&!u.currentTarget.contains(d)&&n(!1)},children:[i.jsxs("button",{type:"button",ref:r,className:"theme-trigger","aria-expanded":t,"aria-controls":t?l:void 0,onClick:()=>n(u=>!u),children:[i.jsx("span",{"aria-hidden":"true",children:"🎨"}),i.jsx("span",{children:"Appearance"})]}),t&&i.jsxs("div",{className:"theme-panel",id:l,ref:a,children:[i.jsxs("fieldset",{className:"theme-group",children:[i.jsx("legend",{className:"theme-group-label",children:"Palette"}),du.map(u=>i.jsxs("label",{className:"theme-option",children:[i.jsx("input",{type:"radio",name:`${o}-palette`,value:u,checked:e.palette===u,onChange:()=>Hd({palette:u})}),i.jsx("span",{className:"theme-swatch","data-swatch":u,"aria-hidden":"true"}),i.jsx("span",{className:"theme-option-label",children:ch[u]})]},u))]}),i.jsxs("fieldset",{className:"theme-group",children:[i.jsx("legend",{className:"theme-group-label",children:"Mode"}),Bp.map(u=>i.jsxs("label",{className:"theme-option",children:[i.jsx("input",{type:"radio",name:`${o}-mode`,value:u,checked:e.mode===u,onChange:()=>Hd({mode:u})}),i.jsx("span",{className:"theme-option-label",children:dS[u]})]},u))]}),i.jsxs("fieldset",{className:"theme-group",children:[i.jsx("legend",{className:"theme-group-label",children:"Text size"}),aw.map(u=>i.jsxs("label",{className:"theme-option",children:[i.jsx("input",{type:"radio",name:`${o}-scale`,value:u,checked:e.fontScale===u,onChange:()=>Hd({fontScale:u,a11y:e.a11y||u!==100})}),i.jsx("span",{className:"theme-option-label",children:fS[u]})]},u)),!e.a11y&&i.jsx("p",{className:"theme-hint",children:"A larger size turns on accessibility mode, which is what defines it."})]}),i.jsxs("div",{className:"theme-group",children:[i.jsxs("label",{className:"theme-switch",children:[i.jsx("input",{type:"checkbox",checked:e.a11y,onChange:u=>Hd({a11y:u.target.checked})}),i.jsx("span",{className:"theme-switch-track","aria-hidden":"true"}),i.jsx("span",{className:"theme-option-label",children:"Accessibility mode"})]}),i.jsx("p",{className:"theme-hint",children:"Larger targets, stronger borders and no motion. Off by default so it never changes the look for anyone who does not need it."})]}),i.jsx("button",{type:"button",className:"theme-reset",onClick:kB,children:"Reset to system default"}),i.jsx("p",{className:"sr-only",role:"status",children:c})]})]})}function NB(){const[e,t]=b.useState(null),[n,r]=b.useState(!1),[a,s]=b.useState(""),[o,l]=b.useState(""),[c,u]=b.useState(!1),[d,f]=b.useState(null),h=b.useRef(null),p=b.useCallback(()=>{K.fetchAdminAuthStatus().then(w=>t(w))},[]);b.useEffect(()=>{p()},[p]),b.useEffect(()=>{if(!n)return;function w(S){h.current&&!h.current.contains(S.target)&&r(!1)}function j(S){S.key==="Escape"&&r(!1)}return document.addEventListener("mousedown",w),document.addEventListener("keydown",j),()=>{document.removeEventListener("mousedown",w),document.removeEventListener("keydown",j)}},[n]);const m=(e==null?void 0:e.authenticated)===!0,g=(e==null?void 0:e.configured)===!0,y=async w=>{w.preventDefault(),u(!0),f(null);const j=g?await K.adminLogin(a,o):await K.adminSetup(a,o);j.ok?(s(""),l(""),r(!1),p()):f(j.error||(g?"Login failed.":"Setup failed.")),u(!1)},v=async()=>{r(!1),await K.adminLogout(),p()},k=e?m?`👤 ${e.user||"account"}${e.role?` · ${e.role}`:""}`:"👤 Sign in":"👤 Account";return i.jsxs("div",{className:"topbar-account",ref:h,children:[i.jsx("button",{type:"button",className:"topbar-action","aria-haspopup":"menu","aria-expanded":n,onClick:()=>r(w=>!w),children:k}),n?i.jsx("div",{className:"topbar-account-menu",role:"menu",children:m?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"topbar-account-user",children:[i.jsx("span",{children:(e==null?void 0:e.user)||"account"}),e!=null&&e.role?i.jsx("span",{className:`admin-role-badge admin-role-${e.role}`,children:e.role}):null]}),e!=null&&e.mustChangePassword?i.jsx("p",{className:"topbar-account-hint",children:"Still on the first-run password — change it on the Admin page before writes will work."}):null,i.jsx("button",{type:"button",className:"topbar-account-item",onClick:()=>void v(),children:"🚪 Log out"})]}):i.jsxs("form",{className:"topbar-account-form",onSubmit:y,children:[i.jsx("p",{className:"topbar-account-title",children:g?"Sign in":"Create the first admin"}),i.jsxs("label",{children:[i.jsx("span",{children:"Username"}),i.jsx("input",{type:"text",value:a,onChange:w=>s(w.target.value),autoComplete:"username",placeholder:"admin"})]}),i.jsxs("label",{children:[i.jsx("span",{children:"Password"}),i.jsx("input",{type:"password",value:o,onChange:w=>l(w.target.value),autoComplete:g?"current-password":"new-password",placeholder:"••••••••"})]}),d?i.jsx("div",{className:"admin-error",children:d}):null,i.jsx("button",{type:"submit",className:"admin-refresh-btn",disabled:c||!a||!o,children:c?"⏳ …":g?"🔐 Sign in":"🔐 Create admin"}),g?null:i.jsx("p",{className:"topbar-account-hint",children:"The first user is always an admin."})]})}):null]})}const zT=[{group:"General",items:[{keys:["?"],description:"Show the shortcut cheatsheet"},{keys:["F1"],description:"Open the Help page"},{keys:["Esc"],description:"Close a dialog or panel"},{keys:["g","c"],description:"Go to Chat"},{keys:["g","o"],description:"Go to Overview"},{keys:["g","t"],description:"Go to Tasks"},{keys:["g","m"],description:"Go to Models"},{keys:["g","s"],description:"Go to System"},{keys:["g","h"],description:"Go to Agent Hub"}]},{group:"Navigation",items:[{keys:["/"],description:"Focus the navigation filter"},{keys:["["],description:"Collapse / expand the navigation drawer"}]}],EB={c:"/chat",o:"/overview",t:"/tasks",m:"/models",s:"/system",h:"/hub"};function _B(e){var a;const t=e;if(!t||typeof t.tagName!="string")return!1;if(t.isContentEditable)return!0;const n=(a=t.getAttribute)==null?void 0:a.call(t,"contenteditable");if(n!=null&&n!=="false")return!0;const r=t.tagName.toLowerCase();return r==="input"||r==="textarea"||r==="select"}function CB({open:e,onClose:t}){const n=b.useId(),r=b.useRef(null),a=b.useRef(null);return b.useEffect(()=>{var l;if(!e)return;a.current=document.activeElement;const s=()=>{var c;return Array.from(((c=r.current)==null?void 0:c.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'))??[])};(l=s()[0])==null||l.focus();function o(c){if(c.key==="Escape"){c.stopPropagation(),t();return}if(c.key!=="Tab")return;const u=s();if(u.length===0)return;const d=u[0],f=u[u.length-1];c.shiftKey&&document.activeElement===d?(c.preventDefault(),f.focus()):!c.shiftKey&&document.activeElement===f&&(c.preventDefault(),d.focus())}return document.addEventListener("keydown",o),()=>{var c;document.removeEventListener("keydown",o),(c=a.current)==null||c.focus()}},[e,t]),e?i.jsx("div",{className:"modal-scrim",onClick:t,children:i.jsxs("div",{className:"shortcuts-dialog",role:"dialog","aria-modal":"true","aria-labelledby":n,ref:r,onClick:s=>s.stopPropagation(),children:[i.jsxs("div",{className:"shortcuts-head",children:[i.jsx("h2",{className:"shortcuts-title",id:n,children:"⌨️ Keyboard shortcuts"}),i.jsx("button",{type:"button",className:"btn-secondary",onClick:t,"aria-label":"Close keyboard shortcuts",children:"✕ Close"})]}),zT.map(s=>i.jsxs("section",{className:"shortcuts-group",children:[i.jsx("h3",{className:"shortcuts-group-title",children:s.group}),i.jsx("dl",{className:"shortcuts-list",children:s.items.map(o=>i.jsxs("div",{className:"shortcuts-row",children:[i.jsx("dt",{className:"shortcuts-keys",children:o.keys.map(l=>i.jsx("kbd",{className:"shortcuts-key",children:l},l))}),i.jsx("dd",{className:"shortcuts-description",children:o.description})]},o.description))})]},s.group)),i.jsxs("p",{className:"shortcuts-note",children:["Shortcuts are ignored while you are typing, so ",i.jsx("kbd",{className:"shortcuts-key",children:"?"})," in a question stays a question mark."]})]})}):null}const FT=[{path:"/overview",label:"Overview",icon:"📊"},{path:"/tasks",label:"Tasks",icon:"🚀"},{path:"/models",label:"Models",icon:"🧠"},{path:"/system",label:"System",icon:"⚙️"},{path:"/help",label:"Help",icon:"❓"}],wy=[{label:"Agent Management",items:[{path:"/chat",label:"Chat",icon:"💬"},{path:"/hub",label:"Agent Hub",icon:"🧰"},{path:"/capabilities",label:"Capabilities",icon:"📋"},{path:"/dag",label:"Execution",icon:"🔀"},{path:"/routing",label:"Routing",icon:"🤖"},{path:"/requests",label:"Requests",icon:"📨"},{path:"/hooks",label:"Hooks",icon:"🪝"}]},{label:"Analysis & Monitoring",items:[{path:"/traces",label:"Traces",icon:"🔍"},{path:"/evals",label:"Evals",icon:"🏆"},{path:"/benchmarks",label:"Benchmarks",icon:"📈"},{path:"/costs",label:"Costs",icon:"💰"}]},{label:"Resources",items:[{path:"/memory",label:"Memory",icon:"💾"},{path:"/knowledge",label:"Knowledge",icon:"📚"},{path:"/history",label:"History",icon:"📝"},{path:"/decisions",label:"Decisions",icon:"🧭"},{path:"/env",label:"Env Config",icon:"🔐"},{path:"/process-env",label:"Process Env",icon:"🌱"}]},{label:"Integrations",items:[{path:"/platforms",label:"Platforms",icon:"🌐"},{path:"/mcp",label:"MCP",icon:"🔌"},{path:"/gateway",label:"Gateway",icon:"📡"},{path:"/contacts",label:"Contacts",icon:"📇"},{path:"/bedrock",label:"Bedrock",icon:"🪨"}]},{label:"Runtime",items:[{path:"/models/timeline",label:"Timeline",icon:"📅"},{path:"/executions",label:"Executions",icon:"📜"},{path:"/admin",label:"Admin",icon:"🛠️"}]}];function AB(e){const t=e.trim().toLowerCase();return t?wy.map(n=>n.label.toLowerCase().includes(t)?n:{...n,items:n.items.filter(r=>r.label.toLowerCase().includes(t))}).filter(n=>n.items.length>0):wy}function TB({children:e,connected:t,lastUpdated:n,onRefresh:r,refreshing:a=!1}){const[s,o]=b.useState(!1),[l,c]=b.useState(""),[u,d]=b.useState(!1),f=b.useRef(null),h=b.useRef(null),p=b.useRef(0),m=b.useId(),g=Li(),y=rw(),v=t?"connected":"reconnecting",k=t?"Connected":"Reconnecting...",w=AB(l),j=()=>o(!1);return b.useEffect(()=>{function S(x){var N,E;if(!(x.metaKey||x.ctrlKey||x.altKey)&&!_B(x.target)){if(x.key==="Escape"){if(u)return;s&&(o(!1),(N=f.current)==null||N.focus());return}if(x.key==="?"){x.preventDefault(),d(!0);return}if(x.key==="F1"){x.preventDefault(),y("/help");return}if(x.key==="/"){x.preventDefault(),(E=h.current)==null||E.focus();return}if(x.key==="["){x.preventDefault(),o(P=>!P);return}if(x.key==="g"){p.current=Date.now();return}if(Date.now()-p.current<1500){const P=EB[x.key.toLowerCase()];p.current=0,P&&(x.preventDefault(),y(P))}}}return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[s,u,y]),b.useEffect(()=>{var S;s&&((S=h.current)==null||S.focus())},[s]),b.useEffect(()=>{j()},[g.pathname]),i.jsxs("div",{className:"layout",children:[i.jsxs("header",{className:"topbar",children:[i.jsx("button",{type:"button",ref:f,className:"topbar-menu","aria-label":"Toggle navigation","aria-controls":"app-nav","aria-expanded":s,onClick:()=>o(S=>!S),children:i.jsx("span",{"aria-hidden":"true",children:"☰"})}),i.jsxs("div",{className:"topbar-brand",children:[i.jsx("span",{className:"topbar-logo","aria-hidden":"true",children:"🤖"}),i.jsx("span",{className:"topbar-title",children:"Agent-Nuvira"})]}),i.jsx("nav",{className:"primary-nav","aria-label":"Primary",children:FT.map(S=>i.jsxs(oS,{to:S.path,end:!0,className:({isActive:x})=>`primary-link${x?" active":""}`,children:[i.jsx("span",{"aria-hidden":"true",children:S.icon})," ",S.label]},S.path))}),i.jsxs("div",{className:"topbar-actions",children:[i.jsxs("button",{type:"button",className:"topbar-action",onClick:r,disabled:a,"aria-busy":a,children:[i.jsx("span",{"aria-hidden":"true",children:"⟳"})," ",a?"Refreshing…":"Refresh"]}),i.jsxs("button",{type:"button",className:"topbar-action","aria-haspopup":"dialog","aria-expanded":u,onClick:()=>d(!0),children:[i.jsx("span",{"aria-hidden":"true",children:"⌨️"})," Shortcuts"]}),i.jsx(jB,{}),i.jsxs("a",{className:"topbar-action",href:"https://www.agent-nuvira.com",target:"_blank",rel:"noopener noreferrer",title:"Agent-Nuvira website — capabilities, commands, docs, setup",children:[i.jsx("span",{"aria-hidden":"true",children:"🌐"})," Website"]}),i.jsx(NB,{})]})]}),i.jsxs("div",{className:"layout-body",children:[s&&i.jsx("div",{className:"nav-scrim",onClick:j,"aria-hidden":"true"}),i.jsxs("nav",{className:`nav${s?" open":""}`,id:"app-nav","aria-label":"Sections",children:[i.jsxs("div",{className:"nav-search",children:[i.jsx("label",{className:"sr-only",htmlFor:m,children:"Filter navigation"}),i.jsx("input",{id:m,ref:h,type:"search",className:"nav-search-input",placeholder:"Search",value:l,onChange:S=>c(S.target.value)})]}),i.jsxs("div",{className:"nav-links",children:[w.map(S=>i.jsxs("section",{className:"nav-group",children:[i.jsx("h2",{className:"nav-group-title",children:S.label}),S.items.map(x=>i.jsxs(oS,{to:x.path,end:x.path==="/",className:({isActive:N})=>`nav-link${N?" active":""}`,children:[i.jsx("span",{className:"nav-icon","aria-hidden":"true",children:x.icon}),x.label]},x.path))]},S.label)),w.length===0&&i.jsxs("p",{className:"nav-empty",children:["No sections match “",l,"”."]})]}),i.jsxs("div",{className:"nav-footer",children:[i.jsx("span",{className:`status-dot ${v}`}),i.jsx("span",{className:"status-text",children:k}),i.jsx("span",{className:"last-updated",children:n})]})]}),i.jsx("main",{className:"main",children:e})]}),i.jsx(CB,{open:u,onClose:()=>d(!1)})]})}function UT(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=UT(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ye(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=UT(e))&&(r&&(r+=" "),r+=t);return r}var OB=Array.isArray,Wn=OB,PB=typeof fi=="object"&&fi&&fi.Object===Object&&fi,WT=PB,RB=WT,MB=typeof self=="object"&&self&&self.Object===Object&&self,IB=RB||MB||Function("return this")(),ga=IB,$B=ga,LB=$B.Symbol,rd=LB,hS=rd,HT=Object.prototype,DB=HT.hasOwnProperty,BB=HT.toString,lc=hS?hS.toStringTag:void 0;function zB(e){var t=DB.call(e,lc),n=e[lc];try{e[lc]=void 0;var r=!0}catch{}var a=BB.call(e);return r&&(t?e[lc]=n:delete e[lc]),a}var FB=zB,UB=Object.prototype,WB=UB.toString;function HB(e){return WB.call(e)}var GB=HB,pS=rd,qB=FB,KB=GB,VB="[object Null]",YB="[object Undefined]",mS=pS?pS.toStringTag:void 0;function XB(e){return e==null?e===void 0?YB:VB:mS&&mS in Object(e)?qB(e):KB(e)}var Ka=XB;function QB(e){return e!=null&&typeof e=="object"}var Va=QB,ZB=Ka,JB=Va,ez="[object Symbol]";function tz(e){return typeof e=="symbol"||JB(e)&&ZB(e)==ez}var El=tz,nz=Wn,rz=El,az=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,iz=/^\w*$/;function sz(e,t){if(nz(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||rz(e)?!0:iz.test(e)||!az.test(e)||t!=null&&e in Object(t)}var sw=sz;function oz(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Di=oz;const _l=Je(Di);var lz=Ka,cz=Di,uz="[object AsyncFunction]",dz="[object Function]",fz="[object GeneratorFunction]",hz="[object Proxy]";function pz(e){if(!cz(e))return!1;var t=lz(e);return t==dz||t==fz||t==uz||t==hz}var ow=pz;const Be=Je(ow);var mz=ga,gz=mz["__core-js_shared__"],vz=gz,fg=vz,gS=function(){var e=/[^.]+$/.exec(fg&&fg.keys&&fg.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function yz(e){return!!gS&&gS in e}var bz=yz,xz=Function.prototype,wz=xz.toString;function kz(e){if(e!=null){try{return wz.call(e)}catch{}try{return e+""}catch{}}return""}var GT=kz,Sz=ow,jz=bz,Nz=Di,Ez=GT,_z=/[\\^$.*+?()[\]{}|]/g,Cz=/^\[object .+?Constructor\]$/,Az=Function.prototype,Tz=Object.prototype,Oz=Az.toString,Pz=Tz.hasOwnProperty,Rz=RegExp("^"+Oz.call(Pz).replace(_z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Mz(e){if(!Nz(e)||jz(e))return!1;var t=Sz(e)?Rz:Cz;return t.test(Ez(e))}var Iz=Mz;function $z(e,t){return e==null?void 0:e[t]}var Lz=$z,Dz=Iz,Bz=Lz;function zz(e,t){var n=Bz(e,t);return Dz(n)?n:void 0}var Ws=zz,Fz=Ws,Uz=Fz(Object,"create"),zp=Uz,vS=zp;function Wz(){this.__data__=vS?vS(null):{},this.size=0}var Hz=Wz;function Gz(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var qz=Gz,Kz=zp,Vz="__lodash_hash_undefined__",Yz=Object.prototype,Xz=Yz.hasOwnProperty;function Qz(e){var t=this.__data__;if(Kz){var n=t[e];return n===Vz?void 0:n}return Xz.call(t,e)?t[e]:void 0}var Zz=Qz,Jz=zp,eF=Object.prototype,tF=eF.hasOwnProperty;function nF(e){var t=this.__data__;return Jz?t[e]!==void 0:tF.call(t,e)}var rF=nF,aF=zp,iF="__lodash_hash_undefined__";function sF(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=aF&&t===void 0?iF:t,this}var oF=sF,lF=Hz,cF=qz,uF=Zz,dF=rF,fF=oF;function Cl(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Cl.prototype.clear=lF;Cl.prototype.delete=cF;Cl.prototype.get=uF;Cl.prototype.has=dF;Cl.prototype.set=fF;var hF=Cl;function pF(){this.__data__=[],this.size=0}var mF=pF;function gF(e,t){return e===t||e!==e&&t!==t}var lw=gF,vF=lw;function yF(e,t){for(var n=e.length;n--;)if(vF(e[n][0],t))return n;return-1}var Fp=yF,bF=Fp,xF=Array.prototype,wF=xF.splice;function kF(e){var t=this.__data__,n=bF(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():wF.call(t,n,1),--this.size,!0}var SF=kF,jF=Fp;function NF(e){var t=this.__data__,n=jF(t,e);return n<0?void 0:t[n][1]}var EF=NF,_F=Fp;function CF(e){return _F(this.__data__,e)>-1}var AF=CF,TF=Fp;function OF(e,t){var n=this.__data__,r=TF(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var PF=OF,RF=mF,MF=SF,IF=EF,$F=AF,LF=PF;function Al(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Al.prototype.clear=RF;Al.prototype.delete=MF;Al.prototype.get=IF;Al.prototype.has=$F;Al.prototype.set=LF;var Up=Al,DF=Ws,BF=ga,zF=DF(BF,"Map"),cw=zF,yS=hF,FF=Up,UF=cw;function WF(){this.size=0,this.__data__={hash:new yS,map:new(UF||FF),string:new yS}}var HF=WF;function GF(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var qF=GF,KF=qF;function VF(e,t){var n=e.__data__;return KF(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Wp=VF,YF=Wp;function XF(e){var t=YF(this,e).delete(e);return this.size-=t?1:0,t}var QF=XF,ZF=Wp;function JF(e){return ZF(this,e).get(e)}var eU=JF,tU=Wp;function nU(e){return tU(this,e).has(e)}var rU=nU,aU=Wp;function iU(e,t){var n=aU(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var sU=iU,oU=HF,lU=QF,cU=eU,uU=rU,dU=sU;function Tl(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Tl.prototype.clear=oU;Tl.prototype.delete=lU;Tl.prototype.get=cU;Tl.prototype.has=uU;Tl.prototype.set=dU;var uw=Tl,qT=uw,fU="Expected a function";function dw(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(fU);var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],s=n.cache;if(s.has(a))return s.get(a);var o=e.apply(this,r);return n.cache=s.set(a,o)||s,o};return n.cache=new(dw.Cache||qT),n}dw.Cache=qT;var KT=dw;const hU=Je(KT);var pU=KT,mU=500;function gU(e){var t=pU(e,function(r){return n.size===mU&&n.clear(),r}),n=t.cache;return t}var vU=gU,yU=vU,bU=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xU=/\\(\\)?/g,wU=yU(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(bU,function(n,r,a,s){t.push(a?s.replace(xU,"$1"):r||n)}),t}),kU=wU;function SU(e,t){for(var n=-1,r=e==null?0:e.length,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a}var fw=SU,bS=rd,jU=fw,NU=Wn,EU=El,xS=bS?bS.prototype:void 0,wS=xS?xS.toString:void 0;function VT(e){if(typeof e=="string")return e;if(NU(e))return jU(e,VT)+"";if(EU(e))return wS?wS.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var _U=VT,CU=_U;function AU(e){return e==null?"":CU(e)}var YT=AU,TU=Wn,OU=sw,PU=kU,RU=YT;function MU(e,t){return TU(e)?e:OU(e,t)?[e]:PU(RU(e))}var XT=MU,IU=El;function $U(e){if(typeof e=="string"||IU(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var Hp=$U,LU=XT,DU=Hp;function BU(e,t){t=LU(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[DU(t[n++])];return n&&n==r?e:void 0}var hw=BU,zU=hw;function FU(e,t,n){var r=e==null?void 0:zU(e,t);return r===void 0?n:r}var QT=FU;const wr=Je(QT);function UU(e){return e==null}var WU=UU;const Xe=Je(WU);var HU=Ka,GU=Wn,qU=Va,KU="[object String]";function VU(e){return typeof e=="string"||!GU(e)&&qU(e)&&HU(e)==KU}var YU=VU;const Is=Je(YU);var ZT={exports:{}},rt={};/**
68
+ * @license React
69
+ * react-is.production.min.js
70
+ *
71
+ * Copyright (c) Facebook, Inc. and its affiliates.
72
+ *
73
+ * This source code is licensed under the MIT license found in the
74
+ * LICENSE file in the root directory of this source tree.
75
+ */var pw=Symbol.for("react.element"),mw=Symbol.for("react.portal"),Gp=Symbol.for("react.fragment"),qp=Symbol.for("react.strict_mode"),Kp=Symbol.for("react.profiler"),Vp=Symbol.for("react.provider"),Yp=Symbol.for("react.context"),XU=Symbol.for("react.server_context"),Xp=Symbol.for("react.forward_ref"),Qp=Symbol.for("react.suspense"),Zp=Symbol.for("react.suspense_list"),Jp=Symbol.for("react.memo"),em=Symbol.for("react.lazy"),QU=Symbol.for("react.offscreen"),JT;JT=Symbol.for("react.module.reference");function Nr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case pw:switch(e=e.type,e){case Gp:case Kp:case qp:case Qp:case Zp:return e;default:switch(e=e&&e.$$typeof,e){case XU:case Yp:case Xp:case em:case Jp:case Vp:return e;default:return t}}case mw:return t}}}rt.ContextConsumer=Yp;rt.ContextProvider=Vp;rt.Element=pw;rt.ForwardRef=Xp;rt.Fragment=Gp;rt.Lazy=em;rt.Memo=Jp;rt.Portal=mw;rt.Profiler=Kp;rt.StrictMode=qp;rt.Suspense=Qp;rt.SuspenseList=Zp;rt.isAsyncMode=function(){return!1};rt.isConcurrentMode=function(){return!1};rt.isContextConsumer=function(e){return Nr(e)===Yp};rt.isContextProvider=function(e){return Nr(e)===Vp};rt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===pw};rt.isForwardRef=function(e){return Nr(e)===Xp};rt.isFragment=function(e){return Nr(e)===Gp};rt.isLazy=function(e){return Nr(e)===em};rt.isMemo=function(e){return Nr(e)===Jp};rt.isPortal=function(e){return Nr(e)===mw};rt.isProfiler=function(e){return Nr(e)===Kp};rt.isStrictMode=function(e){return Nr(e)===qp};rt.isSuspense=function(e){return Nr(e)===Qp};rt.isSuspenseList=function(e){return Nr(e)===Zp};rt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Gp||e===Kp||e===qp||e===Qp||e===Zp||e===QU||typeof e=="object"&&e!==null&&(e.$$typeof===em||e.$$typeof===Jp||e.$$typeof===Vp||e.$$typeof===Yp||e.$$typeof===Xp||e.$$typeof===JT||e.getModuleId!==void 0)};rt.typeOf=Nr;ZT.exports=rt;var ZU=ZT.exports,JU=Ka,e3=Va,t3="[object Number]";function n3(e){return typeof e=="number"||e3(e)&&JU(e)==t3}var eO=n3;const r3=Je(eO);var a3=eO;function i3(e){return a3(e)&&e!=+e}var s3=i3;const ad=Je(s3);var Dr=function(t){return t===0?0:t>0?1:-1},vs=function(t){return Is(t)&&t.indexOf("%")===t.length-1},de=function(t){return r3(t)&&!ad(t)},o3=function(t){return Xe(t)},Kt=function(t){return de(t)||Is(t)},l3=0,tm=function(t){var n=++l3;return"".concat(t||"").concat(n)},$s=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!de(t)&&!Is(t))return r;var s;if(vs(t)){var o=t.indexOf("%");s=n*parseFloat(t.slice(0,o))/100}else s=+t;return ad(s)&&(s=r),a&&s>n&&(s=n),s},ui=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},c3=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},a=0;a<n;a++)if(!r[t[a]])r[t[a]]=!0;else return!0;return!1},io=function(t,n){return de(t)&&de(n)?function(r){return t+r*(n-t)}:function(){return n}};function ky(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):wr(r,t))===n})}var u3=function(t,n){return de(t)&&de(n)?t-n:Is(t)&&Is(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function zo(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function Sy(e){"@babel/helpers - typeof";return Sy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sy(e)}var d3=["viewBox","children"],f3=["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"],kS=["points","pathLength"],hg={svg:d3,polygon:kS,polyline:kS},gw=["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"],uh=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(b.isValidElement(t)&&(r=t.props),!_l(r))return null;var a={};return Object.keys(r).forEach(function(s){gw.includes(s)&&(a[s]=n||function(o){return r[s](r,o)})}),a},h3=function(t,n,r){return function(a){return t(n,r,a),null}},dh=function(t,n,r){if(!_l(t)||Sy(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(s){var o=t[s];gw.includes(s)&&typeof o=="function"&&(a||(a={}),a[s]=h3(o,n,r))}),a},p3=["children"],m3=["children"];function SS(e,t){if(e==null)return{};var n=g3(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function g3(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var jS={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Ia=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},NS=null,pg=null,vw=function e(t){if(t===NS&&Array.isArray(pg))return pg;var n=[];return b.Children.forEach(t,function(r){Xe(r)||(ZU.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),pg=n,NS=t,n};function Fr(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(a){return Ia(a)}):r=[Ia(t)],vw(e).forEach(function(a){var s=wr(a,"type.displayName")||wr(a,"type.name");r.indexOf(s)!==-1&&n.push(a)}),n}function Zn(e,t){var n=Fr(e,t);return n&&n[0]}var ES=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,a=n.height;return!(!de(r)||r<=0||!de(a)||a<=0)},v3=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],y3=function(t){return t&&t.type&&Is(t.type)&&v3.indexOf(t.type)>=0},b3=function(t,n,r,a){var s,o=(s=hg==null?void 0:hg[a])!==null&&s!==void 0?s:[];return n.startsWith("data-")||!Be(t)&&(a&&o.includes(n)||f3.includes(n))||r&&gw.includes(n)},Ve=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(b.isValidElement(t)&&(a=t.props),!_l(a))return null;var s={};return Object.keys(a).forEach(function(o){var l;b3((l=a)===null||l===void 0?void 0:l[o],o,n,r)&&(s[o]=a[o])}),s},jy=function e(t,n){if(t===n)return!0;var r=b.Children.count(t);if(r!==b.Children.count(n))return!1;if(r===0)return!0;if(r===1)return _S(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var a=0;a<r;a++){var s=t[a],o=n[a];if(Array.isArray(s)||Array.isArray(o)){if(!e(s,o))return!1}else if(!_S(s,o))return!1}return!0},_S=function(t,n){if(Xe(t)&&Xe(n))return!0;if(!Xe(t)&&!Xe(n)){var r=t.props||{},a=r.children,s=SS(r,p3),o=n.props||{},l=o.children,c=SS(o,m3);return a&&l?zo(s,c)&&jy(a,l):!a&&!l?zo(s,c):!1}return!1},CS=function(t,n){var r=[],a={};return vw(t).forEach(function(s,o){if(y3(s))r.push(s);else if(s){var l=Ia(s.type),c=n[l]||{},u=c.handler,d=c.once;if(u&&(!d||!a[l])){var f=u(s,l,o);r.push(f),a[l]=!0}}}),r},x3=function(t){var n=t&&t.type;return n&&jS[n]?jS[n]:null},w3=function(t,n){return vw(n).indexOf(t)},k3=["children","width","height","viewBox","className","style","title","desc"];function Ny(){return Ny=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ny.apply(this,arguments)}function S3(e,t){if(e==null)return{};var n=j3(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function j3(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Ey(e){var t=e.children,n=e.width,r=e.height,a=e.viewBox,s=e.className,o=e.style,l=e.title,c=e.desc,u=S3(e,k3),d=a||{width:n,height:r,x:0,y:0},f=Ye("recharts-surface",s);return X.createElement("svg",Ny({},Ve(u,!0,"svg"),{className:f,width:n,height:r,style:o,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),X.createElement("title",null,l),X.createElement("desc",null,c),t)}var N3=["children","className"];function _y(){return _y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_y.apply(this,arguments)}function E3(e,t){if(e==null)return{};var n=_3(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function _3(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var en=X.forwardRef(function(e,t){var n=e.children,r=e.className,a=E3(e,N3),s=Ye("recharts-layer",r);return X.createElement("g",_y({className:s},Ve(a,!0),{ref:t}),n)}),$a=function(t,n){for(var r=arguments.length,a=new Array(r>2?r-2:0),s=2;s<r;s++)a[s-2]=arguments[s]};function C3(e,t,n){var r=-1,a=e.length;t<0&&(t=-t>a?0:a+t),n=n>a?a:n,n<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(a);++r<a;)s[r]=e[r+t];return s}var A3=C3,T3=A3;function O3(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:T3(e,t,n)}var P3=O3,R3="\\ud800-\\udfff",M3="\\u0300-\\u036f",I3="\\ufe20-\\ufe2f",$3="\\u20d0-\\u20ff",L3=M3+I3+$3,D3="\\ufe0e\\ufe0f",B3="\\u200d",z3=RegExp("["+B3+R3+L3+D3+"]");function F3(e){return z3.test(e)}var tO=F3;function U3(e){return e.split("")}var W3=U3,nO="\\ud800-\\udfff",H3="\\u0300-\\u036f",G3="\\ufe20-\\ufe2f",q3="\\u20d0-\\u20ff",K3=H3+G3+q3,V3="\\ufe0e\\ufe0f",Y3="["+nO+"]",Cy="["+K3+"]",Ay="\\ud83c[\\udffb-\\udfff]",X3="(?:"+Cy+"|"+Ay+")",rO="[^"+nO+"]",aO="(?:\\ud83c[\\udde6-\\uddff]){2}",iO="[\\ud800-\\udbff][\\udc00-\\udfff]",Q3="\\u200d",sO=X3+"?",oO="["+V3+"]?",Z3="(?:"+Q3+"(?:"+[rO,aO,iO].join("|")+")"+oO+sO+")*",J3=oO+sO+Z3,e4="(?:"+[rO+Cy+"?",Cy,aO,iO,Y3].join("|")+")",t4=RegExp(Ay+"(?="+Ay+")|"+e4+J3,"g");function n4(e){return e.match(t4)||[]}var r4=n4,a4=W3,i4=tO,s4=r4;function o4(e){return i4(e)?s4(e):a4(e)}var l4=o4,c4=P3,u4=tO,d4=l4,f4=YT;function h4(e){return function(t){t=f4(t);var n=u4(t)?d4(t):void 0,r=n?n[0]:t.charAt(0),a=n?c4(n,1).join(""):t.slice(1);return r[e]()+a}}var p4=h4,m4=p4,g4=m4("toUpperCase"),v4=g4;const nm=Je(v4);function ft(e){return function(){return e}}const lO=Math.cos,fh=Math.sin,Gr=Math.sqrt,hh=Math.PI,rm=2*hh,Ty=Math.PI,Oy=2*Ty,os=1e-6,y4=Oy-os;function cO(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function b4(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return cO;const n=10**t;return function(r){this._+=r[0];for(let a=1,s=r.length;a<s;++a)this._+=Math.round(arguments[a]*n)/n+r[a]}}class x4{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?cO:b4(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,a){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+a}`}bezierCurveTo(t,n,r,a,s,o){this._append`C${+t},${+n},${+r},${+a},${this._x1=+s},${this._y1=+o}`}arcTo(t,n,r,a,s){if(t=+t,n=+n,r=+r,a=+a,s=+s,s<0)throw new Error(`negative radius: ${s}`);let o=this._x1,l=this._y1,c=r-t,u=a-n,d=o-t,f=l-n,h=d*d+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>os)if(!(Math.abs(f*c-u*d)>os)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-o,m=a-l,g=c*c+u*u,y=p*p+m*m,v=Math.sqrt(g),k=Math.sqrt(h),w=s*Math.tan((Ty-Math.acos((g+h-y)/(2*v*k)))/2),j=w/k,S=w/v;Math.abs(j-1)>os&&this._append`L${t+j*d},${n+j*f}`,this._append`A${s},${s},0,0,${+(f*p>d*m)},${this._x1=t+S*c},${this._y1=n+S*u}`}}arc(t,n,r,a,s,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(a),c=r*Math.sin(a),u=t+l,d=n+c,f=1^o,h=o?a-s:s-a;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>os||Math.abs(this._y1-d)>os)&&this._append`L${u},${d}`,r&&(h<0&&(h=h%Oy+Oy),h>y4?this._append`A${r},${r},0,1,${f},${t-l},${n-c}A${r},${r},0,1,${f},${this._x1=u},${this._y1=d}`:h>os&&this._append`A${r},${r},0,${+(h>=Ty)},${f},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+a}h${-r}Z`}toString(){return this._}}function yw(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new x4(t)}function bw(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function uO(e){this._context=e}uO.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 am(e){return new uO(e)}function dO(e){return e[0]}function fO(e){return e[1]}function hO(e,t){var n=ft(!0),r=null,a=am,s=null,o=yw(l);e=typeof e=="function"?e:e===void 0?dO:ft(e),t=typeof t=="function"?t:t===void 0?fO:ft(t);function l(c){var u,d=(c=bw(c)).length,f,h=!1,p;for(r==null&&(s=a(p=o())),u=0;u<=d;++u)!(u<d&&n(f=c[u],u,c))===h&&((h=!h)?s.lineStart():s.lineEnd()),h&&s.point(+e(f,u,c),+t(f,u,c));if(p)return s=null,p+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:ft(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:ft(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:ft(!!c),l):n},l.curve=function(c){return arguments.length?(a=c,r!=null&&(s=a(r)),l):a},l.context=function(c){return arguments.length?(c==null?r=s=null:s=a(r=c),l):r},l}function Gd(e,t,n){var r=null,a=ft(!0),s=null,o=am,l=null,c=yw(u);e=typeof e=="function"?e:e===void 0?dO:ft(+e),t=typeof t=="function"?t:ft(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?fO:ft(+n);function u(f){var h,p,m,g=(f=bw(f)).length,y,v=!1,k,w=new Array(g),j=new Array(g);for(s==null&&(l=o(k=c())),h=0;h<=g;++h){if(!(h<g&&a(y=f[h],h,f))===v)if(v=!v)p=h,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),m=h-1;m>=p;--m)l.point(w[m],j[m]);l.lineEnd(),l.areaEnd()}v&&(w[h]=+e(y,h,f),j[h]=+t(y,h,f),l.point(r?+r(y,h,f):w[h],n?+n(y,h,f):j[h]))}if(k)return l=null,k+""||null}function d(){return hO().defined(a).curve(o).context(s)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:ft(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ft(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:ft(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:ft(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ft(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ft(+f),u):n},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(n)},u.lineX1=function(){return d().x(r).y(t)},u.defined=function(f){return arguments.length?(a=typeof f=="function"?f:ft(!!f),u):a},u.curve=function(f){return arguments.length?(o=f,s!=null&&(l=o(s)),u):o},u.context=function(f){return arguments.length?(f==null?s=l=null:l=o(s=f),u):s},u}class pO{constructor(t,n){this._context=t,this._x=n}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(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function w4(e){return new pO(e,!0)}function k4(e){return new pO(e,!1)}const xw={draw(e,t){const n=Gr(t/hh);e.moveTo(n,0),e.arc(0,0,n,0,rm)}},S4={draw(e,t){const n=Gr(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()}},mO=Gr(1/3),j4=mO*2,N4={draw(e,t){const n=Gr(t/j4),r=n*mO;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},E4={draw(e,t){const n=Gr(t),r=-n/2;e.rect(r,r,n,n)}},_4=.8908130915292852,gO=fh(hh/10)/fh(7*hh/10),C4=fh(rm/10)*gO,A4=-lO(rm/10)*gO,T4={draw(e,t){const n=Gr(t*_4),r=C4*n,a=A4*n;e.moveTo(0,-n),e.lineTo(r,a);for(let s=1;s<5;++s){const o=rm*s/5,l=lO(o),c=fh(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*a,c*r+l*a)}e.closePath()}},mg=Gr(3),O4={draw(e,t){const n=-Gr(t/(mg*3));e.moveTo(0,n*2),e.lineTo(-mg*n,-n),e.lineTo(mg*n,-n),e.closePath()}},dr=-.5,fr=Gr(3)/2,Py=1/Gr(12),P4=(Py/2+1)*3,R4={draw(e,t){const n=Gr(t/P4),r=n/2,a=n*Py,s=r,o=n*Py+n,l=-s,c=o;e.moveTo(r,a),e.lineTo(s,o),e.lineTo(l,c),e.lineTo(dr*r-fr*a,fr*r+dr*a),e.lineTo(dr*s-fr*o,fr*s+dr*o),e.lineTo(dr*l-fr*c,fr*l+dr*c),e.lineTo(dr*r+fr*a,dr*a-fr*r),e.lineTo(dr*s+fr*o,dr*o-fr*s),e.lineTo(dr*l+fr*c,dr*c-fr*l),e.closePath()}};function M4(e,t){let n=null,r=yw(a);e=typeof e=="function"?e:ft(e||xw),t=typeof t=="function"?t:ft(t===void 0?64:+t);function a(){let s;if(n||(n=s=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,s+""||null}return a.type=function(s){return arguments.length?(e=typeof s=="function"?s:ft(s),a):e},a.size=function(s){return arguments.length?(t=typeof s=="function"?s:ft(+s),a):t},a.context=function(s){return arguments.length?(n=s??null,a):n},a}function ph(){}function mh(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 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(){switch(this._point){case 3:mh(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:mh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function I4(e){return new vO(e)}function yO(e){this._context=e}yO.prototype={areaStart:ph,areaEnd:ph,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:mh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function $4(e){return new yO(e)}function bO(e){this._context=e}bO.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:mh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function L4(e){return new bO(e)}function xO(e){this._context=e}xO.prototype={areaStart:ph,areaEnd:ph,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 D4(e){return new xO(e)}function AS(e){return e<0?-1:1}function TS(e,t,n){var r=e._x1-e._x0,a=t-e._x1,s=(e._y1-e._y0)/(r||a<0&&-0),o=(n-e._y1)/(a||r<0&&-0),l=(s*a+o*r)/(r+a);return(AS(s)+AS(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(l))||0}function OS(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function gg(e,t,n){var r=e._x0,a=e._y0,s=e._x1,o=e._y1,l=(s-r)/3;e._context.bezierCurveTo(r+l,a+l*t,s-l,o-l*n,s,o)}function gh(e){this._context=e}gh.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:gg(this,this._t0,OS(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,gg(this,OS(this,n=TS(this,e,t)),n);break;default:gg(this,this._t0,n=TS(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function wO(e){this._context=new kO(e)}(wO.prototype=Object.create(gh.prototype)).point=function(e,t){gh.prototype.point.call(this,t,e)};function kO(e){this._context=e}kO.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,a,s){this._context.bezierCurveTo(t,e,r,n,s,a)}};function B4(e){return new gh(e)}function z4(e){return new wO(e)}function SO(e){this._context=e}SO.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=PS(e),a=PS(t),s=0,o=1;o<n;++s,++o)this._context.bezierCurveTo(r[0][s],a[0][s],r[1][s],a[1][s],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 PS(e){var t,n=e.length-1,r,a=new Array(n),s=new Array(n),o=new Array(n);for(a[0]=0,s[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)a[t]=1,s[t]=4,o[t]=4*e[t]+2*e[t+1];for(a[n-1]=2,s[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=a[t]/s[t-1],s[t]-=r,o[t]-=r*o[t-1];for(a[n-1]=o[n-1]/s[n-1],t=n-2;t>=0;--t)a[t]=(o[t]-a[t+1])/s[t];for(s[n-1]=(e[n]+a[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-a[t+1];return[a,s]}function F4(e){return new SO(e)}function im(e,t){this._context=e,this._t=t}im.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 U4(e){return new im(e,.5)}function W4(e){return new im(e,0)}function H4(e){return new im(e,1)}function Zo(e,t){if((o=e.length)>1)for(var n=1,r,a,s=e[t[0]],o,l=s.length;n<o;++n)for(a=s,s=e[t[n]],r=0;r<l;++r)s[r][1]+=s[r][0]=isNaN(a[r][1])?a[r][0]:a[r][1]}function Ry(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function G4(e,t){return e[t]}function q4(e){const t=[];return t.key=e,t}function K4(){var e=ft([]),t=Ry,n=Zo,r=G4;function a(s){var o=Array.from(e.apply(this,arguments),q4),l,c=o.length,u=-1,d;for(const f of s)for(l=0,++u;l<c;++l)(o[l][u]=[0,+r(f,o[l].key,u,s)]).data=f;for(l=0,d=bw(t(o));l<c;++l)o[d[l]].index=l;return n(o,d),o}return a.keys=function(s){return arguments.length?(e=typeof s=="function"?s:ft(Array.from(s)),a):e},a.value=function(s){return arguments.length?(r=typeof s=="function"?s:ft(+s),a):r},a.order=function(s){return arguments.length?(t=s==null?Ry:typeof s=="function"?s:ft(Array.from(s)),a):t},a.offset=function(s){return arguments.length?(n=s??Zo,a):n},a}function V4(e,t){if((r=e.length)>0){for(var n,r,a=0,s=e[0].length,o;a<s;++a){for(o=n=0;n<r;++n)o+=e[n][a][1]||0;if(o)for(n=0;n<r;++n)e[n][a][1]/=o}Zo(e,t)}}function Y4(e,t){if((a=e.length)>0){for(var n=0,r=e[t[0]],a,s=r.length;n<s;++n){for(var o=0,l=0;o<a;++o)l+=e[o][n][1]||0;r[n][1]+=r[n][0]=-l/2}Zo(e,t)}}function X4(e,t){if(!(!((o=e.length)>0)||!((s=(a=e[t[0]]).length)>0))){for(var n=0,r=1,a,s,o;r<s;++r){for(var l=0,c=0,u=0;l<o;++l){for(var d=e[t[l]],f=d[r][1]||0,h=d[r-1][1]||0,p=(f-h)/2,m=0;m<l;++m){var g=e[t[m]],y=g[r][1]||0,v=g[r-1][1]||0;p+=y-v}c+=f,u+=p*f}a[r-1][1]+=a[r-1][0]=n,c&&(n-=u/c)}a[r-1][1]+=a[r-1][0]=n,Zo(e,t)}}function fu(e){"@babel/helpers - typeof";return fu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fu(e)}var Q4=["type","size","sizeType"];function My(){return My=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},My.apply(this,arguments)}function RS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function MS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RS(Object(n),!0).forEach(function(r){Z4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Z4(e,t,n){return t=J4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function J4(e){var t=e6(e,"string");return fu(t)=="symbol"?t:t+""}function e6(e,t){if(fu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(fu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function t6(e,t){if(e==null)return{};var n=n6(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function n6(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var jO={symbolCircle:xw,symbolCross:S4,symbolDiamond:N4,symbolSquare:E4,symbolStar:T4,symbolTriangle:O4,symbolWye:R4},r6=Math.PI/180,a6=function(t){var n="symbol".concat(nm(t));return jO[n]||xw},i6=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*r6;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},s6=function(t,n){jO["symbol".concat(nm(t))]=n},ww=function(t){var n=t.type,r=n===void 0?"circle":n,a=t.size,s=a===void 0?64:a,o=t.sizeType,l=o===void 0?"area":o,c=t6(t,Q4),u=MS(MS({},c),{},{type:r,size:s,sizeType:l}),d=function(){var y=a6(r),v=M4().type(y).size(i6(s,l,r));return v()},f=u.className,h=u.cx,p=u.cy,m=Ve(u,!0);return h===+h&&p===+p&&s===+s?X.createElement("path",My({},m,{className:Ye("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(p,")"),d:d()})):null};ww.registerSymbol=s6;function Jo(e){"@babel/helpers - typeof";return Jo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jo(e)}function Iy(){return Iy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Iy.apply(this,arguments)}function IS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function o6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IS(Object(n),!0).forEach(function(r){hu(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function l6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c6(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,EO(r.key),r)}}function u6(e,t,n){return t&&c6(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function d6(e,t,n){return t=vh(t),f6(e,NO()?Reflect.construct(t,n||[],vh(e).constructor):t.apply(e,n))}function f6(e,t){if(t&&(Jo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return h6(e)}function h6(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function NO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(NO=function(){return!!e})()}function vh(e){return vh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},vh(e)}function p6(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$y(e,t)}function $y(e,t){return $y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},$y(e,t)}function hu(e,t,n){return t=EO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EO(e){var t=m6(e,"string");return Jo(t)=="symbol"?t:t+""}function m6(e,t){if(Jo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Jo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var hr=32,kw=function(e){function t(){return l6(this,t),d6(this,t,arguments)}return p6(t,e),u6(t,[{key:"renderIcon",value:function(r){var a=this.props.inactiveColor,s=hr/2,o=hr/6,l=hr/3,c=r.inactive?a:r.color;if(r.type==="plainline")return X.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:s,x2:hr,y2:s,className:"recharts-legend-icon"});if(r.type==="line")return X.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(s,"h").concat(l,`
76
+ A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(s,`
77
+ H`).concat(hr,"M").concat(2*l,",").concat(s,`
78
+ A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(s),className:"recharts-legend-icon"});if(r.type==="rect")return X.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(hr/8,"h").concat(hr,"v").concat(hr*3/4,"h").concat(-hr,"z"),className:"recharts-legend-icon"});if(X.isValidElement(r.legendIcon)){var u=o6({},r);return delete u.legendIcon,X.cloneElement(r.legendIcon,u)}return X.createElement(ww,{fill:c,cx:s,cy:s,size:hr,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,a=this.props,s=a.payload,o=a.iconSize,l=a.layout,c=a.formatter,u=a.inactiveColor,d={x:0,y:0,width:hr,height:hr},f={display:l==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return s.map(function(p,m){var g=p.formatter||c,y=Ye(hu(hu({"recharts-legend-item":!0},"legend-item-".concat(m),!0),"inactive",p.inactive));if(p.type==="none")return null;var v=Be(p.value)?null:p.value;$a(!Be(p.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var k=p.inactive?u:p.color;return X.createElement("li",Iy({className:y,style:f,key:"legend-item-".concat(m)},dh(r.props,p,m)),X.createElement(Ey,{width:o,height:o,viewBox:d,style:h},r.renderIcon(p)),X.createElement("span",{className:"recharts-legend-item-text",style:{color:k}},g?g(v,p,m):v))})}},{key:"render",value:function(){var r=this.props,a=r.payload,s=r.layout,o=r.align;if(!a||!a.length)return null;var l={padding:0,margin:0,textAlign:s==="horizontal"?o:"left"};return X.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(b.PureComponent);hu(kw,"displayName","Legend");hu(kw,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var g6=Up;function v6(){this.__data__=new g6,this.size=0}var y6=v6;function b6(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var x6=b6;function w6(e){return this.__data__.get(e)}var k6=w6;function S6(e){return this.__data__.has(e)}var j6=S6,N6=Up,E6=cw,_6=uw,C6=200;function A6(e,t){var n=this.__data__;if(n instanceof N6){var r=n.__data__;if(!E6||r.length<C6-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new _6(r)}return n.set(e,t),this.size=n.size,this}var T6=A6,O6=Up,P6=y6,R6=x6,M6=k6,I6=j6,$6=T6;function Ol(e){var t=this.__data__=new O6(e);this.size=t.size}Ol.prototype.clear=P6;Ol.prototype.delete=R6;Ol.prototype.get=M6;Ol.prototype.has=I6;Ol.prototype.set=$6;var _O=Ol,L6="__lodash_hash_undefined__";function D6(e){return this.__data__.set(e,L6),this}var B6=D6;function z6(e){return this.__data__.has(e)}var F6=z6,U6=uw,W6=B6,H6=F6;function yh(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new U6;++t<n;)this.add(e[t])}yh.prototype.add=yh.prototype.push=W6;yh.prototype.has=H6;var CO=yh;function G6(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var AO=G6;function q6(e,t){return e.has(t)}var TO=q6,K6=CO,V6=AO,Y6=TO,X6=1,Q6=2;function Z6(e,t,n,r,a,s){var o=n&X6,l=e.length,c=t.length;if(l!=c&&!(o&&c>l))return!1;var u=s.get(e),d=s.get(t);if(u&&d)return u==t&&d==e;var f=-1,h=!0,p=n&Q6?new K6:void 0;for(s.set(e,t),s.set(t,e);++f<l;){var m=e[f],g=t[f];if(r)var y=o?r(g,m,f,t,e,s):r(m,g,f,e,t,s);if(y!==void 0){if(y)continue;h=!1;break}if(p){if(!V6(t,function(v,k){if(!Y6(p,k)&&(m===v||a(m,v,n,r,s)))return p.push(k)})){h=!1;break}}else if(!(m===g||a(m,g,n,r,s))){h=!1;break}}return s.delete(e),s.delete(t),h}var OO=Z6,J6=ga,eW=J6.Uint8Array,tW=eW;function nW(e){var t=-1,n=Array(e.size);return e.forEach(function(r,a){n[++t]=[a,r]}),n}var rW=nW;function aW(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Sw=aW,$S=rd,LS=tW,iW=lw,sW=OO,oW=rW,lW=Sw,cW=1,uW=2,dW="[object Boolean]",fW="[object Date]",hW="[object Error]",pW="[object Map]",mW="[object Number]",gW="[object RegExp]",vW="[object Set]",yW="[object String]",bW="[object Symbol]",xW="[object ArrayBuffer]",wW="[object DataView]",DS=$S?$S.prototype:void 0,vg=DS?DS.valueOf:void 0;function kW(e,t,n,r,a,s,o){switch(n){case wW:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case xW:return!(e.byteLength!=t.byteLength||!s(new LS(e),new LS(t)));case dW:case fW:case mW:return iW(+e,+t);case hW:return e.name==t.name&&e.message==t.message;case gW:case yW:return e==t+"";case pW:var l=oW;case vW:var c=r&cW;if(l||(l=lW),e.size!=t.size&&!c)return!1;var u=o.get(e);if(u)return u==t;r|=uW,o.set(e,t);var d=sW(l(e),l(t),r,a,s,o);return o.delete(e),d;case bW:if(vg)return vg.call(e)==vg.call(t)}return!1}var SW=kW;function jW(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}var PO=jW,NW=PO,EW=Wn;function _W(e,t,n){var r=t(e);return EW(e)?r:NW(r,n(e))}var CW=_W;function AW(e,t){for(var n=-1,r=e==null?0:e.length,a=0,s=[];++n<r;){var o=e[n];t(o,n,e)&&(s[a++]=o)}return s}var TW=AW;function OW(){return[]}var PW=OW,RW=TW,MW=PW,IW=Object.prototype,$W=IW.propertyIsEnumerable,BS=Object.getOwnPropertySymbols,LW=BS?function(e){return e==null?[]:(e=Object(e),RW(BS(e),function(t){return $W.call(e,t)}))}:MW,DW=LW;function BW(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var zW=BW,FW=Ka,UW=Va,WW="[object Arguments]";function HW(e){return UW(e)&&FW(e)==WW}var GW=HW,zS=GW,qW=Va,RO=Object.prototype,KW=RO.hasOwnProperty,VW=RO.propertyIsEnumerable,YW=zS(function(){return arguments}())?zS:function(e){return qW(e)&&KW.call(e,"callee")&&!VW.call(e,"callee")},jw=YW,bh={exports:{}};function XW(){return!1}var QW=XW;bh.exports;(function(e,t){var n=ga,r=QW,a=t&&!t.nodeType&&t,s=a&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===a,l=o?n.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||r;e.exports=u})(bh,bh.exports);var MO=bh.exports,ZW=9007199254740991,JW=/^(?:0|[1-9]\d*)$/;function e8(e,t){var n=typeof e;return t=t??ZW,!!t&&(n=="number"||n!="symbol"&&JW.test(e))&&e>-1&&e%1==0&&e<t}var Nw=e8,t8=9007199254740991;function n8(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=t8}var Ew=n8,r8=Ka,a8=Ew,i8=Va,s8="[object Arguments]",o8="[object Array]",l8="[object Boolean]",c8="[object Date]",u8="[object Error]",d8="[object Function]",f8="[object Map]",h8="[object Number]",p8="[object Object]",m8="[object RegExp]",g8="[object Set]",v8="[object String]",y8="[object WeakMap]",b8="[object ArrayBuffer]",x8="[object DataView]",w8="[object Float32Array]",k8="[object Float64Array]",S8="[object Int8Array]",j8="[object Int16Array]",N8="[object Int32Array]",E8="[object Uint8Array]",_8="[object Uint8ClampedArray]",C8="[object Uint16Array]",A8="[object Uint32Array]",vt={};vt[w8]=vt[k8]=vt[S8]=vt[j8]=vt[N8]=vt[E8]=vt[_8]=vt[C8]=vt[A8]=!0;vt[s8]=vt[o8]=vt[b8]=vt[l8]=vt[x8]=vt[c8]=vt[u8]=vt[d8]=vt[f8]=vt[h8]=vt[p8]=vt[m8]=vt[g8]=vt[v8]=vt[y8]=!1;function T8(e){return i8(e)&&a8(e.length)&&!!vt[r8(e)]}var O8=T8;function P8(e){return function(t){return e(t)}}var IO=P8,xh={exports:{}};xh.exports;(function(e,t){var n=WT,r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===r,o=s&&n.process,l=function(){try{var c=a&&a.require&&a.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l})(xh,xh.exports);var R8=xh.exports,M8=O8,I8=IO,FS=R8,US=FS&&FS.isTypedArray,$8=US?I8(US):M8,$O=$8,L8=zW,D8=jw,B8=Wn,z8=MO,F8=Nw,U8=$O,W8=Object.prototype,H8=W8.hasOwnProperty;function G8(e,t){var n=B8(e),r=!n&&D8(e),a=!n&&!r&&z8(e),s=!n&&!r&&!a&&U8(e),o=n||r||a||s,l=o?L8(e.length,String):[],c=l.length;for(var u in e)(t||H8.call(e,u))&&!(o&&(u=="length"||a&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||F8(u,c)))&&l.push(u);return l}var q8=G8,K8=Object.prototype;function V8(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||K8;return e===n}var Y8=V8;function X8(e,t){return function(n){return e(t(n))}}var LO=X8,Q8=LO,Z8=Q8(Object.keys,Object),J8=Z8,eH=Y8,tH=J8,nH=Object.prototype,rH=nH.hasOwnProperty;function aH(e){if(!eH(e))return tH(e);var t=[];for(var n in Object(e))rH.call(e,n)&&n!="constructor"&&t.push(n);return t}var iH=aH,sH=ow,oH=Ew;function lH(e){return e!=null&&oH(e.length)&&!sH(e)}var id=lH,cH=q8,uH=iH,dH=id;function fH(e){return dH(e)?cH(e):uH(e)}var sm=fH,hH=CW,pH=DW,mH=sm;function gH(e){return hH(e,mH,pH)}var vH=gH,WS=vH,yH=1,bH=Object.prototype,xH=bH.hasOwnProperty;function wH(e,t,n,r,a,s){var o=n&yH,l=WS(e),c=l.length,u=WS(t),d=u.length;if(c!=d&&!o)return!1;for(var f=c;f--;){var h=l[f];if(!(o?h in t:xH.call(t,h)))return!1}var p=s.get(e),m=s.get(t);if(p&&m)return p==t&&m==e;var g=!0;s.set(e,t),s.set(t,e);for(var y=o;++f<c;){h=l[f];var v=e[h],k=t[h];if(r)var w=o?r(k,v,h,t,e,s):r(v,k,h,e,t,s);if(!(w===void 0?v===k||a(v,k,n,r,s):w)){g=!1;break}y||(y=h=="constructor")}if(g&&!y){var j=e.constructor,S=t.constructor;j!=S&&"constructor"in e&&"constructor"in t&&!(typeof j=="function"&&j instanceof j&&typeof S=="function"&&S instanceof S)&&(g=!1)}return s.delete(e),s.delete(t),g}var kH=wH,SH=Ws,jH=ga,NH=SH(jH,"DataView"),EH=NH,_H=Ws,CH=ga,AH=_H(CH,"Promise"),TH=AH,OH=Ws,PH=ga,RH=OH(PH,"Set"),DO=RH,MH=Ws,IH=ga,$H=MH(IH,"WeakMap"),LH=$H,Ly=EH,Dy=cw,By=TH,zy=DO,Fy=LH,BO=Ka,Pl=GT,HS="[object Map]",DH="[object Object]",GS="[object Promise]",qS="[object Set]",KS="[object WeakMap]",VS="[object DataView]",BH=Pl(Ly),zH=Pl(Dy),FH=Pl(By),UH=Pl(zy),WH=Pl(Fy),ls=BO;(Ly&&ls(new Ly(new ArrayBuffer(1)))!=VS||Dy&&ls(new Dy)!=HS||By&&ls(By.resolve())!=GS||zy&&ls(new zy)!=qS||Fy&&ls(new Fy)!=KS)&&(ls=function(e){var t=BO(e),n=t==DH?e.constructor:void 0,r=n?Pl(n):"";if(r)switch(r){case BH:return VS;case zH:return HS;case FH:return GS;case UH:return qS;case WH:return KS}return t});var HH=ls,yg=_O,GH=OO,qH=SW,KH=kH,YS=HH,XS=Wn,QS=MO,VH=$O,YH=1,ZS="[object Arguments]",JS="[object Array]",qd="[object Object]",XH=Object.prototype,ej=XH.hasOwnProperty;function QH(e,t,n,r,a,s){var o=XS(e),l=XS(t),c=o?JS:YS(e),u=l?JS:YS(t);c=c==ZS?qd:c,u=u==ZS?qd:u;var d=c==qd,f=u==qd,h=c==u;if(h&&QS(e)){if(!QS(t))return!1;o=!0,d=!1}if(h&&!d)return s||(s=new yg),o||VH(e)?GH(e,t,n,r,a,s):qH(e,t,c,n,r,a,s);if(!(n&YH)){var p=d&&ej.call(e,"__wrapped__"),m=f&&ej.call(t,"__wrapped__");if(p||m){var g=p?e.value():e,y=m?t.value():t;return s||(s=new yg),a(g,y,n,r,s)}}return h?(s||(s=new yg),KH(e,t,n,r,a,s)):!1}var ZH=QH,JH=ZH,tj=Va;function zO(e,t,n,r,a){return e===t?!0:e==null||t==null||!tj(e)&&!tj(t)?e!==e&&t!==t:JH(e,t,n,r,zO,a)}var _w=zO,e5=_O,t5=_w,n5=1,r5=2;function a5(e,t,n,r){var a=n.length,s=a,o=!r;if(e==null)return!s;for(e=Object(e);a--;){var l=n[a];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++a<s;){l=n[a];var c=l[0],u=e[c],d=l[1];if(o&&l[2]){if(u===void 0&&!(c in e))return!1}else{var f=new e5;if(r)var h=r(u,d,c,e,t,f);if(!(h===void 0?t5(d,u,n5|r5,r,f):h))return!1}}return!0}var i5=a5,s5=Di;function o5(e){return e===e&&!s5(e)}var FO=o5,l5=FO,c5=sm;function u5(e){for(var t=c5(e),n=t.length;n--;){var r=t[n],a=e[r];t[n]=[r,a,l5(a)]}return t}var d5=u5;function f5(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var UO=f5,h5=i5,p5=d5,m5=UO;function g5(e){var t=p5(e);return t.length==1&&t[0][2]?m5(t[0][0],t[0][1]):function(n){return n===e||h5(n,e,t)}}var v5=g5;function y5(e,t){return e!=null&&t in Object(e)}var b5=y5,x5=XT,w5=jw,k5=Wn,S5=Nw,j5=Ew,N5=Hp;function E5(e,t,n){t=x5(t,e);for(var r=-1,a=t.length,s=!1;++r<a;){var o=N5(t[r]);if(!(s=e!=null&&n(e,o)))break;e=e[o]}return s||++r!=a?s:(a=e==null?0:e.length,!!a&&j5(a)&&S5(o,a)&&(k5(e)||w5(e)))}var _5=E5,C5=b5,A5=_5;function T5(e,t){return e!=null&&A5(e,t,C5)}var O5=T5,P5=_w,R5=QT,M5=O5,I5=sw,$5=FO,L5=UO,D5=Hp,B5=1,z5=2;function F5(e,t){return I5(e)&&$5(t)?L5(D5(e),t):function(n){var r=R5(n,e);return r===void 0&&r===t?M5(n,e):P5(t,r,B5|z5)}}var U5=F5;function W5(e){return e}var Rl=W5;function H5(e){return function(t){return t==null?void 0:t[e]}}var G5=H5,q5=hw;function K5(e){return function(t){return q5(t,e)}}var V5=K5,Y5=G5,X5=V5,Q5=sw,Z5=Hp;function J5(e){return Q5(e)?Y5(Z5(e)):X5(e)}var e9=J5,t9=v5,n9=U5,r9=Rl,a9=Wn,i9=e9;function s9(e){return typeof e=="function"?e:e==null?r9:typeof e=="object"?a9(e)?n9(e[0],e[1]):t9(e):i9(e)}var Bi=s9;function o9(e,t,n,r){for(var a=e.length,s=n+(r?1:-1);r?s--:++s<a;)if(t(e[s],s,e))return s;return-1}var WO=o9;function l9(e){return e!==e}var c9=l9;function u9(e,t,n){for(var r=n-1,a=e.length;++r<a;)if(e[r]===t)return r;return-1}var d9=u9,f9=WO,h9=c9,p9=d9;function m9(e,t,n){return t===t?p9(e,t,n):f9(e,h9,n)}var g9=m9,v9=g9;function y9(e,t){var n=e==null?0:e.length;return!!n&&v9(e,t,0)>-1}var b9=y9;function x9(e,t,n){for(var r=-1,a=e==null?0:e.length;++r<a;)if(n(t,e[r]))return!0;return!1}var w9=x9;function k9(){}var S9=k9,bg=DO,j9=S9,N9=Sw,E9=1/0,_9=bg&&1/N9(new bg([,-0]))[1]==E9?function(e){return new bg(e)}:j9,C9=_9,A9=CO,T9=b9,O9=w9,P9=TO,R9=C9,M9=Sw,I9=200;function $9(e,t,n){var r=-1,a=T9,s=e.length,o=!0,l=[],c=l;if(n)o=!1,a=O9;else if(s>=I9){var u=t?null:R9(e);if(u)return M9(u);o=!1,a=P9,c=new A9}else c=t?[]:l;e:for(;++r<s;){var d=e[r],f=t?t(d):d;if(d=n||d!==0?d:0,o&&f===f){for(var h=c.length;h--;)if(c[h]===f)continue e;t&&c.push(f),l.push(d)}else a(c,f,n)||(c!==l&&c.push(f),l.push(d))}return l}var L9=$9,D9=Bi,B9=L9;function z9(e,t){return e&&e.length?B9(e,D9(t)):[]}var F9=z9;const nj=Je(F9);function HO(e,t,n){return t===!0?nj(e,n):Be(t)?nj(e,t):e}function el(e){"@babel/helpers - typeof";return el=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},el(e)}var U9=["ref"];function rj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).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?rj(Object(n),!0).forEach(function(r){om(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function W9(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aj(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,qO(r.key),r)}}function H9(e,t,n){return t&&aj(e.prototype,t),n&&aj(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function G9(e,t,n){return t=wh(t),q9(e,GO()?Reflect.construct(t,n||[],wh(e).constructor):t.apply(e,n))}function q9(e,t){if(t&&(el(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return K9(e)}function K9(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function GO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(GO=function(){return!!e})()}function wh(e){return wh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},wh(e)}function V9(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Uy(e,t)}function Uy(e,t){return Uy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Uy(e,t)}function om(e,t,n){return t=qO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qO(e){var t=Y9(e,"string");return el(t)=="symbol"?t:t+""}function Y9(e,t){if(el(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(el(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function X9(e,t){if(e==null)return{};var n=Q9(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Q9(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Z9(e){return e.value}function J9(e,t){if(X.isValidElement(e))return X.cloneElement(e,t);if(typeof e=="function")return X.createElement(e,t);t.ref;var n=X9(t,U9);return X.createElement(kw,n)}var ij=1,js=function(e){function t(){var n;W9(this,t);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return n=G9(this,t,[].concat(a)),om(n,"lastBoundingBox",{width:-1,height:-1}),n}return V9(t,e),H9(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,a=this.getBBox();a?(Math.abs(a.width-this.lastBoundingBox.width)>ij||Math.abs(a.height-this.lastBoundingBox.height)>ij)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,r&&r(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Ea({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var a=this.props,s=a.layout,o=a.align,l=a.verticalAlign,c=a.margin,u=a.chartWidth,d=a.chartHeight,f,h;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&s==="vertical"){var p=this.getBBoxSnapshot();f={left:((u||0)-p.width)/2}}else f=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(l==="middle"){var m=this.getBBoxSnapshot();h={top:((d||0)-m.height)/2}}else h=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Ea(Ea({},f),h)}},{key:"render",value:function(){var r=this,a=this.props,s=a.content,o=a.width,l=a.height,c=a.wrapperStyle,u=a.payloadUniqBy,d=a.payload,f=Ea(Ea({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return X.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(p){r.wrapperNode=p}},J9(s,Ea(Ea({},this.props),{},{payload:HO(d,u,Z9)})))}}],[{key:"getWithHeight",value:function(r,a){var s=Ea(Ea({},this.defaultProps),r.props),o=s.layout;return o==="vertical"&&de(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||a}:null}}])}(b.PureComponent);om(js,"displayName","Legend");om(js,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var sj=rd,eG=jw,tG=Wn,oj=sj?sj.isConcatSpreadable:void 0;function nG(e){return tG(e)||eG(e)||!!(oj&&e&&e[oj])}var rG=nG,aG=PO,iG=rG;function KO(e,t,n,r,a){var s=-1,o=e.length;for(n||(n=iG),a||(a=[]);++s<o;){var l=e[s];t>0&&n(l)?t>1?KO(l,t-1,n,r,a):aG(a,l):r||(a[a.length]=l)}return a}var VO=KO;function sG(e){return function(t,n,r){for(var a=-1,s=Object(t),o=r(t),l=o.length;l--;){var c=o[e?l:++a];if(n(s[c],c,s)===!1)break}return t}}var oG=sG,lG=oG,cG=lG(),uG=cG,dG=uG,fG=sm;function hG(e,t){return e&&dG(e,t,fG)}var YO=hG,pG=id;function mG(e,t){return function(n,r){if(n==null)return n;if(!pG(n))return e(n,r);for(var a=n.length,s=t?a:-1,o=Object(n);(t?s--:++s<a)&&r(o[s],s,o)!==!1;);return n}}var gG=mG,vG=YO,yG=gG,bG=yG(vG),Cw=bG,xG=Cw,wG=id;function kG(e,t){var n=-1,r=wG(e)?Array(e.length):[];return xG(e,function(a,s,o){r[++n]=t(a,s,o)}),r}var XO=kG;function SG(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var jG=SG,lj=El;function NG(e,t){if(e!==t){var n=e!==void 0,r=e===null,a=e===e,s=lj(e),o=t!==void 0,l=t===null,c=t===t,u=lj(t);if(!l&&!u&&!s&&e>t||s&&o&&c&&!l&&!u||r&&o&&c||!n&&c||!a)return 1;if(!r&&!s&&!u&&e<t||u&&n&&a&&!r&&!s||l&&n&&a||!o&&a||!c)return-1}return 0}var EG=NG,_G=EG;function CG(e,t,n){for(var r=-1,a=e.criteria,s=t.criteria,o=a.length,l=n.length;++r<o;){var c=_G(a[r],s[r]);if(c){if(r>=l)return c;var u=n[r];return c*(u=="desc"?-1:1)}}return e.index-t.index}var AG=CG,xg=fw,TG=hw,OG=Bi,PG=XO,RG=jG,MG=IO,IG=AG,$G=Rl,LG=Wn;function DG(e,t,n){t.length?t=xg(t,function(s){return LG(s)?function(o){return TG(o,s.length===1?s[0]:s)}:s}):t=[$G];var r=-1;t=xg(t,MG(OG));var a=PG(e,function(s,o,l){var c=xg(t,function(u){return u(s)});return{criteria:c,index:++r,value:s}});return RG(a,function(s,o){return IG(s,o,n)})}var BG=DG;function zG(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var FG=zG,UG=FG,cj=Math.max;function WG(e,t,n){return t=cj(t===void 0?e.length-1:t,0),function(){for(var r=arguments,a=-1,s=cj(r.length-t,0),o=Array(s);++a<s;)o[a]=r[t+a];a=-1;for(var l=Array(t+1);++a<t;)l[a]=r[a];return l[t]=n(o),UG(e,this,l)}}var HG=WG;function GG(e){return function(){return e}}var qG=GG,KG=Ws,VG=function(){try{var e=KG(Object,"defineProperty");return e({},"",{}),e}catch{}}(),QO=VG,YG=qG,uj=QO,XG=Rl,QG=uj?function(e,t){return uj(e,"toString",{configurable:!0,enumerable:!1,value:YG(t),writable:!0})}:XG,ZG=QG,JG=800,eq=16,tq=Date.now;function nq(e){var t=0,n=0;return function(){var r=tq(),a=eq-(r-n);if(n=r,a>0){if(++t>=JG)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var rq=nq,aq=ZG,iq=rq,sq=iq(aq),oq=sq,lq=Rl,cq=HG,uq=oq;function dq(e,t){return uq(cq(e,t,lq),e+"")}var fq=dq,hq=lw,pq=id,mq=Nw,gq=Di;function vq(e,t,n){if(!gq(n))return!1;var r=typeof t;return(r=="number"?pq(n)&&mq(t,n.length):r=="string"&&t in n)?hq(n[t],e):!1}var lm=vq,yq=VO,bq=BG,xq=fq,dj=lm,wq=xq(function(e,t){if(e==null)return[];var n=t.length;return n>1&&dj(e,t[0],t[1])?t=[]:n>2&&dj(t[0],t[1],t[2])&&(t=[t[0]]),bq(e,yq(t,1),[])}),kq=wq;const Aw=Je(kq);function pu(e){"@babel/helpers - typeof";return pu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pu(e)}function Wy(){return Wy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wy.apply(this,arguments)}function Sq(e,t){return _q(e)||Eq(e,t)||Nq(e,t)||jq()}function jq(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
79
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nq(e,t){if(e){if(typeof e=="string")return fj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fj(e,t)}}function fj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Eq(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function _q(e){if(Array.isArray(e))return e}function hj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function wg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hj(Object(n),!0).forEach(function(r){Cq(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cq(e,t,n){return t=Aq(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Aq(e){var t=Tq(e,"string");return pu(t)=="symbol"?t:t+""}function Tq(e,t){if(pu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(pu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Oq(e){return Array.isArray(e)&&Kt(e[0])&&Kt(e[1])?e.join(" ~ "):e}var Pq=function(t){var n=t.separator,r=n===void 0?" : ":n,a=t.contentStyle,s=a===void 0?{}:a,o=t.itemStyle,l=o===void 0?{}:o,c=t.labelStyle,u=c===void 0?{}:c,d=t.payload,f=t.formatter,h=t.itemSorter,p=t.wrapperClassName,m=t.labelClassName,g=t.label,y=t.labelFormatter,v=t.accessibilityLayer,k=v===void 0?!1:v,w=function(){if(d&&d.length){var T={padding:0,margin:0},B=(h?Aw(d,h):d).map(function($,I){if($.type==="none")return null;var D=wg({display:"block",paddingTop:4,paddingBottom:4,color:$.color||"#000"},l),U=$.formatter||f||Oq,M=$.value,z=$.name,O=M,J=z;if(U&&O!=null&&J!=null){var F=U(M,z,$,I,d);if(Array.isArray(F)){var L=Sq(F,2);O=L[0],J=L[1]}else O=F}return X.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(I),style:D},Kt(J)?X.createElement("span",{className:"recharts-tooltip-item-name"},J):null,Kt(J)?X.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,X.createElement("span",{className:"recharts-tooltip-item-value"},O),X.createElement("span",{className:"recharts-tooltip-item-unit"},$.unit||""))});return X.createElement("ul",{className:"recharts-tooltip-item-list",style:T},B)}return null},j=wg({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},s),S=wg({margin:0},u),x=!Xe(g),N=x?g:"",E=Ye("recharts-default-tooltip",p),P=Ye("recharts-tooltip-label",m);x&&y&&d!==void 0&&d!==null&&(N=y(g,d));var _=k?{role:"status","aria-live":"assertive"}:{};return X.createElement("div",Wy({className:E,style:j},_),X.createElement("p",{className:P,style:S},X.isValidElement(N)?N:"".concat(N)),w())};function mu(e){"@babel/helpers - typeof";return mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mu(e)}function Kd(e,t,n){return t=Rq(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rq(e){var t=Mq(e,"string");return mu(t)=="symbol"?t:t+""}function Mq(e,t){if(mu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(mu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var cc="recharts-tooltip-wrapper",Iq={visibility:"hidden"};function $q(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Ye(cc,Kd(Kd(Kd(Kd({},"".concat(cc,"-right"),de(n)&&t&&de(t.x)&&n>=t.x),"".concat(cc,"-left"),de(n)&&t&&de(t.x)&&n<t.x),"".concat(cc,"-bottom"),de(r)&&t&&de(t.y)&&r>=t.y),"".concat(cc,"-top"),de(r)&&t&&de(t.y)&&r<t.y))}function pj(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,a=e.offsetTopLeft,s=e.position,o=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(s&&de(s[r]))return s[r];var d=n[r]-l-a,f=n[r]+a;if(t[r])return o[r]?d:f;if(o[r]){var h=d,p=c[r];return h<p?Math.max(f,c[r]):Math.max(d,c[r])}var m=f+l,g=c[r]+u;return m>g?Math.max(d,c[r]):Math.max(f,c[r])}function Lq(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function Dq(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,a=e.position,s=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,d,f;return o.height>0&&o.width>0&&n?(d=pj({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:a,reverseDirection:s,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),f=pj({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:a,reverseDirection:s,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=Lq({translateX:d,translateY:f,useTranslate3d:l})):u=Iq,{cssProperties:u,cssClasses:$q({translateX:d,translateY:f,coordinate:n})}}function tl(e){"@babel/helpers - typeof";return tl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tl(e)}function mj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).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?mj(Object(n),!0).forEach(function(r){Gy(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zq(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,JO(r.key),r)}}function Fq(e,t,n){return t&&zq(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Uq(e,t,n){return t=kh(t),Wq(e,ZO()?Reflect.construct(t,n||[],kh(e).constructor):t.apply(e,n))}function Wq(e,t){if(t&&(tl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Hq(e)}function Hq(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ZO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ZO=function(){return!!e})()}function kh(e){return kh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},kh(e)}function Gq(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hy(e,t)}function Hy(e,t){return Hy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Hy(e,t)}function Gy(e,t,n){return t=JO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JO(e){var t=qq(e,"string");return tl(t)=="symbol"?t:t+""}function qq(e,t){if(tl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(tl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var vj=1,Kq=function(e){function t(){var n;Bq(this,t);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return n=Uq(this,t,[].concat(a)),Gy(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),Gy(n,"handleKeyDown",function(o){if(o.key==="Escape"){var l,c,u,d;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=n.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(u=(d=n.props.coordinate)===null||d===void 0?void 0:d.y)!==null&&u!==void 0?u:0}})}}),n}return Gq(t,e),Fq(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>vj||Math.abs(r.height-this.state.lastBoundingBox.height)>vj)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,a=this.props,s=a.active,o=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.children,d=a.coordinate,f=a.hasPayload,h=a.isAnimationActive,p=a.offset,m=a.position,g=a.reverseDirection,y=a.useTranslate3d,v=a.viewBox,k=a.wrapperStyle,w=Dq({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:p,position:m,reverseDirection:g,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:v}),j=w.cssClasses,S=w.cssProperties,x=gj(gj({transition:h&&s?"transform ".concat(l,"ms ").concat(c):void 0},S),{},{pointerEvents:"none",visibility:!this.state.dismissed&&s&&f?"visible":"hidden",position:"absolute",top:0,left:0},k);return X.createElement("div",{tabIndex:-1,className:j,style:x,ref:function(E){r.wrapperNode=E}},u)}}])}(b.PureComponent),Vq=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},sd={isSsr:Vq()};function nl(e){"@babel/helpers - typeof";return nl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nl(e)}function yj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function bj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yj(Object(n),!0).forEach(function(r){Tw(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xq(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,tP(r.key),r)}}function Qq(e,t,n){return t&&Xq(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zq(e,t,n){return t=Sh(t),Jq(e,eP()?Reflect.construct(t,n||[],Sh(e).constructor):t.apply(e,n))}function Jq(e,t){if(t&&(nl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return eK(e)}function eK(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(eP=function(){return!!e})()}function Sh(e){return Sh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Sh(e)}function tK(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qy(e,t)}function qy(e,t){return qy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},qy(e,t)}function Tw(e,t,n){return t=tP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tP(e){var t=nK(e,"string");return nl(t)=="symbol"?t:t+""}function nK(e,t){if(nl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function rK(e){return e.dataKey}function aK(e,t){return X.isValidElement(e)?X.cloneElement(e,t):typeof e=="function"?X.createElement(e,t):X.createElement(Pq,t)}var bn=function(e){function t(){return Yq(this,t),Zq(this,t,arguments)}return tK(t,e),Qq(t,[{key:"render",value:function(){var r=this,a=this.props,s=a.active,o=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.content,d=a.coordinate,f=a.filterNull,h=a.isAnimationActive,p=a.offset,m=a.payload,g=a.payloadUniqBy,y=a.position,v=a.reverseDirection,k=a.useTranslate3d,w=a.viewBox,j=a.wrapperStyle,S=m??[];f&&S.length&&(S=HO(m.filter(function(N){return N.value!=null&&(N.hide!==!0||r.props.includeHidden)}),g,rK));var x=S.length>0;return X.createElement(Kq,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:h,active:s,coordinate:d,hasPayload:x,offset:p,position:y,reverseDirection:v,useTranslate3d:k,viewBox:w,wrapperStyle:j},aK(u,bj(bj({},this.props),{},{payload:S})))}}])}(b.PureComponent);Tw(bn,"displayName","Tooltip");Tw(bn,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!sd.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var iK=ga,sK=function(){return iK.Date.now()},oK=sK,lK=/\s/;function cK(e){for(var t=e.length;t--&&lK.test(e.charAt(t)););return t}var uK=cK,dK=uK,fK=/^\s+/;function hK(e){return e&&e.slice(0,dK(e)+1).replace(fK,"")}var pK=hK,mK=pK,xj=Di,gK=El,wj=NaN,vK=/^[-+]0x[0-9a-f]+$/i,yK=/^0b[01]+$/i,bK=/^0o[0-7]+$/i,xK=parseInt;function wK(e){if(typeof e=="number")return e;if(gK(e))return wj;if(xj(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=xj(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=mK(e);var n=yK.test(e);return n||bK.test(e)?xK(e.slice(2),n?2:8):vK.test(e)?wj:+e}var nP=wK,kK=Di,kg=oK,kj=nP,SK="Expected a function",jK=Math.max,NK=Math.min;function EK(e,t,n){var r,a,s,o,l,c,u=0,d=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(SK);t=kj(t)||0,kK(n)&&(d=!!n.leading,f="maxWait"in n,s=f?jK(kj(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h);function p(x){var N=r,E=a;return r=a=void 0,u=x,o=e.apply(E,N),o}function m(x){return u=x,l=setTimeout(v,t),d?p(x):o}function g(x){var N=x-c,E=x-u,P=t-N;return f?NK(P,s-E):P}function y(x){var N=x-c,E=x-u;return c===void 0||N>=t||N<0||f&&E>=s}function v(){var x=kg();if(y(x))return k(x);l=setTimeout(v,g(x))}function k(x){return l=void 0,h&&r?p(x):(r=a=void 0,o)}function w(){l!==void 0&&clearTimeout(l),u=0,r=c=a=l=void 0}function j(){return l===void 0?o:k(kg())}function S(){var x=kg(),N=y(x);if(r=arguments,a=this,c=x,N){if(l===void 0)return m(c);if(f)return clearTimeout(l),l=setTimeout(v,t),p(c)}return l===void 0&&(l=setTimeout(v,t)),o}return S.cancel=w,S.flush=j,S}var _K=EK,CK=_K,AK=Di,TK="Expected a function";function OK(e,t,n){var r=!0,a=!0;if(typeof e!="function")throw new TypeError(TK);return AK(n)&&(r="leading"in n?!!n.leading:r,a="trailing"in n?!!n.trailing:a),CK(e,t,{leading:r,maxWait:t,trailing:a})}var PK=OK;const rP=Je(PK);function gu(e){"@babel/helpers - typeof";return gu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gu(e)}function Sj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Vd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Sj(Object(n),!0).forEach(function(r){RK(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function RK(e,t,n){return t=MK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MK(e){var t=IK(e,"string");return gu(t)=="symbol"?t:t+""}function IK(e,t){if(gu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(gu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $K(e,t){return zK(e)||BK(e,t)||DK(e,t)||LK()}function LK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
80
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DK(e,t){if(e){if(typeof e=="string")return jj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jj(e,t)}}function jj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function BK(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function zK(e){if(Array.isArray(e))return e}var ds=b.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,a=r===void 0?{width:-1,height:-1}:r,s=e.width,o=s===void 0?"100%":s,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,d=u===void 0?0:u,f=e.minHeight,h=e.maxHeight,p=e.children,m=e.debounce,g=m===void 0?0:m,y=e.id,v=e.className,k=e.onResize,w=e.style,j=w===void 0?{}:w,S=b.useRef(null),x=b.useRef();x.current=k,b.useImperativeHandle(t,function(){return Object.defineProperty(S.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),S.current},configurable:!0})});var N=b.useState({containerWidth:a.width,containerHeight:a.height}),E=$K(N,2),P=E[0],_=E[1],R=b.useCallback(function(B,$){_(function(I){var D=Math.round(B),U=Math.round($);return I.containerWidth===D&&I.containerHeight===U?I:{containerWidth:D,containerHeight:U}})},[]);b.useEffect(function(){var B=function(z){var O,J=z[0].contentRect,F=J.width,L=J.height;R(F,L),(O=x.current)===null||O===void 0||O.call(x,F,L)};g>0&&(B=rP(B,g,{trailing:!0,leading:!1}));var $=new ResizeObserver(B),I=S.current.getBoundingClientRect(),D=I.width,U=I.height;return R(D,U),$.observe(S.current),function(){$.disconnect()}},[R,g]);var T=b.useMemo(function(){var B=P.containerWidth,$=P.containerHeight;if(B<0||$<0)return null;$a(vs(o)||vs(c),`The width(%s) and height(%s) are both fixed numbers,
81
+ maybe you don't need to use a ResponsiveContainer.`,o,c),$a(!n||n>0,"The aspect(%s) must be greater than zero.",n);var I=vs(o)?B:o,D=vs(c)?$:c;n&&n>0&&(I?D=I/n:D&&(I=D*n),h&&D>h&&(D=h)),$a(I>0||D>0,`The width(%s) and height(%s) of chart should be greater than 0,
82
+ please check the style of container, or the props width(%s) and height(%s),
83
+ or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
84
+ height and width.`,I,D,o,c,d,f,n);var U=!Array.isArray(p)&&Ia(p.type).endsWith("Chart");return X.Children.map(p,function(M){return X.isValidElement(M)?b.cloneElement(M,Vd({width:I,height:D},U?{style:Vd({height:"100%",width:"100%",maxHeight:D,maxWidth:I},M.props.style)}:{})):M})},[n,p,c,h,f,d,P,o]);return X.createElement("div",{id:y?"".concat(y):void 0,className:Ye("recharts-responsive-container",v),style:Vd(Vd({},j),{},{width:o,height:c,minWidth:d,minHeight:f,maxHeight:h}),ref:S},T)}),vu=function(t){return null};vu.displayName="Cell";function yu(e){"@babel/helpers - typeof";return yu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yu(e)}function Nj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ky(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Nj(Object(n),!0).forEach(function(r){FK(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function FK(e,t,n){return t=UK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UK(e){var t=WK(e,"string");return yu(t)=="symbol"?t:t+""}function WK(e,t){if(yu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(yu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var so={widthCache:{},cacheCount:0},HK=2e3,GK={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},Ej="recharts_measurement_span";function qK(e){var t=Ky({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var Dc=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||sd.isSsr)return{width:0,height:0};var r=qK(n),a=JSON.stringify({text:t,copyStyle:r});if(so.widthCache[a])return so.widthCache[a];try{var s=document.getElementById(Ej);s||(s=document.createElement("span"),s.setAttribute("id",Ej),s.setAttribute("aria-hidden","true"),document.body.appendChild(s));var o=Ky(Ky({},GK),r);Object.assign(s.style,o),s.textContent="".concat(t);var l=s.getBoundingClientRect(),c={width:l.width,height:l.height};return so.widthCache[a]=c,++so.cacheCount>HK&&(so.cacheCount=0,so.widthCache={}),c}catch{return{width:0,height:0}}},KK=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function bu(e){"@babel/helpers - typeof";return bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bu(e)}function jh(e,t){return QK(e)||XK(e,t)||YK(e,t)||VK()}function VK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
85
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function YK(e,t){if(e){if(typeof e=="string")return _j(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _j(e,t)}}function _j(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function XK(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function QK(e){if(Array.isArray(e))return e}function ZK(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cj(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eV(r.key),r)}}function JK(e,t,n){return t&&Cj(e.prototype,t),n&&Cj(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function eV(e){var t=tV(e,"string");return bu(t)=="symbol"?t:t+""}function tV(e,t){if(bu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(bu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Aj=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Tj=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,nV=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,rV=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,aP={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},aV=Object.keys(aP),To="NaN";function iV(e,t){return e*aP[t]}var Yd=function(){function e(t,n){ZK(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!nV.test(n)&&(this.num=NaN,this.unit=""),aV.includes(n)&&(this.num=iV(t,n),this.unit="px")}return JK(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,a=(r=rV.exec(n))!==null&&r!==void 0?r:[],s=jh(a,3),o=s[1],l=s[2];return new e(parseFloat(o),l??"")}}])}();function iP(e){if(e.includes(To))return To;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=Aj.exec(t))!==null&&n!==void 0?n:[],a=jh(r,4),s=a[1],o=a[2],l=a[3],c=Yd.parse(s??""),u=Yd.parse(l??""),d=o==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return To;t=t.replace(Aj,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,h=(f=Tj.exec(t))!==null&&f!==void 0?f:[],p=jh(h,4),m=p[1],g=p[2],y=p[3],v=Yd.parse(m??""),k=Yd.parse(y??""),w=g==="+"?v.add(k):v.subtract(k);if(w.isNaN())return To;t=t.replace(Tj,w.toString())}return t}var Oj=/\(([^()]*)\)/;function sV(e){for(var t=e;t.includes("(");){var n=Oj.exec(t),r=jh(n,2),a=r[1];t=t.replace(Oj,iP(a))}return t}function oV(e){var t=e.replace(/\s+/g,"");return t=sV(t),t=iP(t),t}function lV(e){try{return oV(e)}catch{return To}}function Sg(e){var t=lV(e.slice(5,-1));return t===To?"":t}var cV=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],uV=["dx","dy","angle","className","breakAll"];function Vy(){return Vy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vy.apply(this,arguments)}function Pj(e,t){if(e==null)return{};var n=dV(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function dV(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Rj(e,t){return mV(e)||pV(e,t)||hV(e,t)||fV()}function fV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
86
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hV(e,t){if(e){if(typeof e=="string")return Mj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Mj(e,t)}}function Mj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pV(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function mV(e){if(Array.isArray(e))return e}var sP=/[ \f\n\r\t\v\u2028\u2029]+/,oP=function(t){var n=t.children,r=t.breakAll,a=t.style;try{var s=[];Xe(n)||(r?s=n.toString().split(""):s=n.toString().split(sP));var o=s.map(function(c){return{word:c,width:Dc(c,a).width}}),l=r?0:Dc(" ",a).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},gV=function(t,n,r,a,s){var o=t.maxLines,l=t.children,c=t.style,u=t.breakAll,d=de(o),f=l,h=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return I.reduce(function(D,U){var M=U.word,z=U.width,O=D[D.length-1];if(O&&(a==null||s||O.width+z+r<Number(a)))O.words.push(M),O.width+=z+r;else{var J={words:[M],width:z};D.push(J)}return D},[])},p=h(n),m=function(I){return I.reduce(function(D,U){return D.width>U.width?D:U})};if(!d)return p;for(var g="…",y=function(I){var D=f.slice(0,I),U=oP({breakAll:u,style:c,children:D+g}).wordsWithComputedWidth,M=h(U),z=M.length>o||m(M).width>Number(a);return[z,M]},v=0,k=f.length-1,w=0,j;v<=k&&w<=f.length-1;){var S=Math.floor((v+k)/2),x=S-1,N=y(x),E=Rj(N,2),P=E[0],_=E[1],R=y(S),T=Rj(R,1),B=T[0];if(!P&&!B&&(v=S+1),P&&B&&(k=S-1),!P&&B){j=_;break}w++}return j||p},Ij=function(t){var n=Xe(t)?[]:t.toString().split(sP);return[{words:n}]},vV=function(t){var n=t.width,r=t.scaleToFit,a=t.children,s=t.style,o=t.breakAll,l=t.maxLines;if((n||r)&&!sd.isSsr){var c,u,d=oP({breakAll:o,children:a,style:s});if(d){var f=d.wordsWithComputedWidth,h=d.spaceWidth;c=f,u=h}else return Ij(a);return gV({breakAll:o,children:a,maxLines:l,style:s},c,u,n,r)}return Ij(a)},$j="#808080",Nh=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,s=a===void 0?0:a,o=t.lineHeight,l=o===void 0?"1em":o,c=t.capHeight,u=c===void 0?"0.71em":c,d=t.scaleToFit,f=d===void 0?!1:d,h=t.textAnchor,p=h===void 0?"start":h,m=t.verticalAnchor,g=m===void 0?"end":m,y=t.fill,v=y===void 0?$j:y,k=Pj(t,cV),w=b.useMemo(function(){return vV({breakAll:k.breakAll,children:k.children,maxLines:k.maxLines,scaleToFit:f,style:k.style,width:k.width})},[k.breakAll,k.children,k.maxLines,f,k.style,k.width]),j=k.dx,S=k.dy,x=k.angle,N=k.className,E=k.breakAll,P=Pj(k,uV);if(!Kt(r)||!Kt(s))return null;var _=r+(de(j)?j:0),R=s+(de(S)?S:0),T;switch(g){case"start":T=Sg("calc(".concat(u,")"));break;case"middle":T=Sg("calc(".concat((w.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:T=Sg("calc(".concat(w.length-1," * -").concat(l,")"));break}var B=[];if(f){var $=w[0].width,I=k.width;B.push("scale(".concat((de(I)?I/$:1)/$,")"))}return x&&B.push("rotate(".concat(x,", ").concat(_,", ").concat(R,")")),B.length&&(P.transform=B.join(" ")),X.createElement("text",Vy({},Ve(P,!0),{x:_,y:R,className:Ye("recharts-text",N),textAnchor:p,fill:v.includes("url")?$j:v}),w.map(function(D,U){var M=D.words.join(E?"":" ");return X.createElement("tspan",{x:_,dy:U===0?T:l,key:"".concat(M,"-").concat(U)},M)}))};function Ci(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function yV(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ow(e){let t,n,r;e.length!==2?(t=Ci,n=(l,c)=>Ci(e(l),c),r=(l,c)=>e(l)-c):(t=e===Ci||e===yV?e:bV,n=e,r=e);function a(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;n(l[f],c)<0?u=f+1:d=f}while(u<d)}return u}function s(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;n(l[f],c)<=0?u=f+1:d=f}while(u<d)}return u}function o(l,c,u=0,d=l.length){const f=a(l,c,u,d-1);return f>u&&r(l[f-1],c)>-r(l[f],c)?f-1:f}return{left:a,center:o,right:s}}function bV(){return 0}function lP(e){return e===null?NaN:+e}function*xV(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const wV=Ow(Ci),od=wV.right;Ow(lP).center;class Lj extends Map{constructor(t,n=jV){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,a]of t)this.set(r,a)}get(t){return super.get(Dj(this,t))}has(t){return super.has(Dj(this,t))}set(t,n){return super.set(kV(this,t),n)}delete(t){return super.delete(SV(this,t))}}function Dj({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function kV({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function SV({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function jV(e){return e!==null&&typeof e=="object"?e.valueOf():e}function NV(e=Ci){if(e===Ci)return cP;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function cP(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const EV=Math.sqrt(50),_V=Math.sqrt(10),CV=Math.sqrt(2);function Eh(e,t,n){const r=(t-e)/Math.max(0,n),a=Math.floor(Math.log10(r)),s=r/Math.pow(10,a),o=s>=EV?10:s>=_V?5:s>=CV?2:1;let l,c,u;return a<0?(u=Math.pow(10,-a)/o,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,a)*o,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=n&&n<2?Eh(e,t,n*2):[l,c,u]}function Yy(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[a,s,o]=r?Eh(t,e,n):Eh(e,t,n);if(!(s>=a))return[];const l=s-a+1,c=new Array(l);if(r)if(o<0)for(let u=0;u<l;++u)c[u]=(s-u)/-o;else for(let u=0;u<l;++u)c[u]=(s-u)*o;else if(o<0)for(let u=0;u<l;++u)c[u]=(a+u)/-o;else for(let u=0;u<l;++u)c[u]=(a+u)*o;return c}function Xy(e,t,n){return t=+t,e=+e,n=+n,Eh(e,t,n)[2]}function Qy(e,t,n){t=+t,e=+e,n=+n;const r=t<e,a=r?Xy(t,e,n):Xy(e,t,n);return(r?-1:1)*(a<0?1/-a:a)}function Bj(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function zj(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function uP(e,t,n=0,r=1/0,a){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(a=a===void 0?cP:NV(a);r>n;){if(r-n>600){const c=r-n+1,u=t-n+1,d=Math.log(c),f=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),p=Math.max(n,Math.floor(t-u*f/c+h)),m=Math.min(r,Math.floor(t+(c-u)*f/c+h));uP(e,t,p,m,a)}const s=e[t];let o=n,l=r;for(uc(e,n,t),a(e[r],s)>0&&uc(e,n,r);o<l;){for(uc(e,o,l),++o,--l;a(e[o],s)<0;)++o;for(;a(e[l],s)>0;)--l}a(e[n],s)===0?uc(e,n,l):(++l,uc(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function uc(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function AV(e,t,n){if(e=Float64Array.from(xV(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return zj(e);if(t>=1)return Bj(e);var r,a=(r-1)*t,s=Math.floor(a),o=Bj(uP(e,s).subarray(0,s+1)),l=zj(e.subarray(s+1));return o+(l-o)*(a-s)}}function TV(e,t,n=lP){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,a=(r-1)*t,s=Math.floor(a),o=+n(e[s],s,e),l=+n(e[s+1],s+1,e);return o+(l-o)*(a-s)}}function OV(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(a);++r<a;)s[r]=e+r*n;return s}function Er(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ya(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}const Zy=Symbol("implicit");function Pw(){var e=new Lj,t=[],n=[],r=Zy;function a(s){let o=e.get(s);if(o===void 0){if(r!==Zy)return r;e.set(s,o=t.push(s)-1)}return n[o%n.length]}return a.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new Lj;for(const o of s)e.has(o)||e.set(o,t.push(o)-1);return a},a.range=function(s){return arguments.length?(n=Array.from(s),a):n.slice()},a.unknown=function(s){return arguments.length?(r=s,a):r},a.copy=function(){return Pw(t,n).unknown(r)},Er.apply(a,arguments),a}function xu(){var e=Pw().unknown(void 0),t=e.domain,n=e.range,r=0,a=1,s,o,l=!1,c=0,u=0,d=.5;delete e.unknown;function f(){var h=t().length,p=a<r,m=p?a:r,g=p?r:a;s=(g-m)/Math.max(1,h-c+u*2),l&&(s=Math.floor(s)),m+=(g-m-s*(h-c))*d,o=s*(1-c),l&&(m=Math.round(m),o=Math.round(o));var y=OV(h).map(function(v){return m+s*v});return n(p?y.reverse():y)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([r,a]=h,r=+r,a=+a,f()):[r,a]},e.rangeRound=function(h){return[r,a]=h,r=+r,a=+a,l=!0,f()},e.bandwidth=function(){return o},e.step=function(){return s},e.round=function(h){return arguments.length?(l=!!h,f()):l},e.padding=function(h){return arguments.length?(c=Math.min(1,u=+h),f()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),f()):c},e.paddingOuter=function(h){return arguments.length?(u=+h,f()):u},e.align=function(h){return arguments.length?(d=Math.max(0,Math.min(1,h)),f()):d},e.copy=function(){return xu(t(),[r,a]).round(l).paddingInner(c).paddingOuter(u).align(d)},Er.apply(f(),arguments)}function dP(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return dP(t())},e}function Bc(){return dP(xu.apply(null,arguments).paddingInner(1))}function Rw(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function fP(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ld(){}var wu=.7,_h=1/wu,Fo="\\s*([+-]?\\d+)\\s*",ku="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",PV=/^#([0-9a-f]{3,8})$/,RV=new RegExp(`^rgb\\(${Fo},${Fo},${Fo}\\)$`),MV=new RegExp(`^rgb\\(${fa},${fa},${fa}\\)$`),IV=new RegExp(`^rgba\\(${Fo},${Fo},${Fo},${ku}\\)$`),$V=new RegExp(`^rgba\\(${fa},${fa},${fa},${ku}\\)$`),LV=new RegExp(`^hsl\\(${ku},${fa},${fa}\\)$`),DV=new RegExp(`^hsla\\(${ku},${fa},${fa},${ku}\\)$`),Fj={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};Rw(ld,Su,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Uj,formatHex:Uj,formatHex8:BV,formatHsl:zV,formatRgb:Wj,toString:Wj});function Uj(){return this.rgb().formatHex()}function BV(){return this.rgb().formatHex8()}function zV(){return hP(this).formatHsl()}function Wj(){return this.rgb().formatRgb()}function Su(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=PV.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Hj(t):n===3?new Bn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Xd(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Xd(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=RV.exec(e))?new Bn(t[1],t[2],t[3],1):(t=MV.exec(e))?new Bn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=IV.exec(e))?Xd(t[1],t[2],t[3],t[4]):(t=$V.exec(e))?Xd(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=LV.exec(e))?Kj(t[1],t[2]/100,t[3]/100,1):(t=DV.exec(e))?Kj(t[1],t[2]/100,t[3]/100,t[4]):Fj.hasOwnProperty(e)?Hj(Fj[e]):e==="transparent"?new Bn(NaN,NaN,NaN,0):null}function Hj(e){return new Bn(e>>16&255,e>>8&255,e&255,1)}function Xd(e,t,n,r){return r<=0&&(e=t=n=NaN),new Bn(e,t,n,r)}function FV(e){return e instanceof ld||(e=Su(e)),e?(e=e.rgb(),new Bn(e.r,e.g,e.b,e.opacity)):new Bn}function Jy(e,t,n,r){return arguments.length===1?FV(e):new Bn(e,t,n,r??1)}function Bn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Rw(Bn,Jy,fP(ld,{brighter(e){return e=e==null?_h:Math.pow(_h,e),new Bn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?wu:Math.pow(wu,e),new Bn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Bn(Ns(this.r),Ns(this.g),Ns(this.b),Ch(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:Gj,formatHex:Gj,formatHex8:UV,formatRgb:qj,toString:qj}));function Gj(){return`#${ys(this.r)}${ys(this.g)}${ys(this.b)}`}function UV(){return`#${ys(this.r)}${ys(this.g)}${ys(this.b)}${ys((isNaN(this.opacity)?1:this.opacity)*255)}`}function qj(){const e=Ch(this.opacity);return`${e===1?"rgb(":"rgba("}${Ns(this.r)}, ${Ns(this.g)}, ${Ns(this.b)}${e===1?")":`, ${e})`}`}function Ch(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ns(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ys(e){return e=Ns(e),(e<16?"0":"")+e.toString(16)}function Kj(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Lr(e,t,n,r)}function hP(e){if(e instanceof Lr)return new Lr(e.h,e.s,e.l,e.opacity);if(e instanceof ld||(e=Su(e)),!e)return new Lr;if(e instanceof Lr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),s=Math.max(t,n,r),o=NaN,l=s-a,c=(s+a)/2;return l?(t===s?o=(n-r)/l+(n<r)*6:n===s?o=(r-t)/l+2:o=(t-n)/l+4,l/=c<.5?s+a:2-s-a,o*=60):l=c>0&&c<1?0:o,new Lr(o,l,c,e.opacity)}function WV(e,t,n,r){return arguments.length===1?hP(e):new Lr(e,t,n,r??1)}function Lr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Rw(Lr,WV,fP(ld,{brighter(e){return e=e==null?_h:Math.pow(_h,e),new Lr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?wu:Math.pow(wu,e),new Lr(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,a=2*n-r;return new Bn(jg(e>=240?e-240:e+120,a,r),jg(e,a,r),jg(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Lr(Vj(this.h),Qd(this.s),Qd(this.l),Ch(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(){const e=Ch(this.opacity);return`${e===1?"hsl(":"hsla("}${Vj(this.h)}, ${Qd(this.s)*100}%, ${Qd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Vj(e){return e=(e||0)%360,e<0?e+360:e}function Qd(e){return Math.max(0,Math.min(1,e||0))}function jg(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Mw=e=>()=>e;function HV(e,t){return function(n){return e+n*t}}function GV(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function qV(e){return(e=+e)==1?pP:function(t,n){return n-t?GV(t,n,e):Mw(isNaN(t)?n:t)}}function pP(e,t){var n=t-e;return n?HV(e,n):Mw(isNaN(e)?t:e)}const Yj=function e(t){var n=qV(t);function r(a,s){var o=n((a=Jy(a)).r,(s=Jy(s)).r),l=n(a.g,s.g),c=n(a.b,s.b),u=pP(a.opacity,s.opacity);return function(d){return a.r=o(d),a.g=l(d),a.b=c(d),a.opacity=u(d),a+""}}return r.gamma=e,r}(1);function KV(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(s){for(a=0;a<n;++a)r[a]=e[a]*(1-s)+t[a]*s;return r}}function VV(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function YV(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),s=new Array(n),o;for(o=0;o<r;++o)a[o]=Ml(e[o],t[o]);for(;o<n;++o)s[o]=t[o];return function(l){for(o=0;o<r;++o)s[o]=a[o](l);return s}}function XV(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ah(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function QV(e,t){var n={},r={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=Ml(e[a],t[a]):r[a]=t[a];return function(s){for(a in n)r[a]=n[a](s);return r}}var eb=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ng=new RegExp(eb.source,"g");function ZV(e){return function(){return e}}function JV(e){return function(t){return e(t)+""}}function e7(e,t){var n=eb.lastIndex=Ng.lastIndex=0,r,a,s,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=eb.exec(e))&&(a=Ng.exec(t));)(s=a.index)>n&&(s=t.slice(n,s),l[o]?l[o]+=s:l[++o]=s),(r=r[0])===(a=a[0])?l[o]?l[o]+=a:l[++o]=a:(l[++o]=null,c.push({i:o,x:Ah(r,a)})),n=Ng.lastIndex;return n<t.length&&(s=t.slice(n),l[o]?l[o]+=s:l[++o]=s),l.length<2?c[0]?JV(c[0].x):ZV(t):(t=c.length,function(u){for(var d=0,f;d<t;++d)l[(f=c[d]).i]=f.x(u);return l.join("")})}function Ml(e,t){var n=typeof t,r;return t==null||n==="boolean"?Mw(t):(n==="number"?Ah:n==="string"?(r=Su(t))?(t=r,Yj):e7:t instanceof Su?Yj:t instanceof Date?XV:VV(t)?KV:Array.isArray(t)?YV:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?QV:Ah)(e,t)}function Iw(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function t7(e,t){t===void 0&&(t=e,e=Ml);for(var n=0,r=t.length-1,a=t[0],s=new Array(r<0?0:r);n<r;)s[n]=e(a,a=t[++n]);return function(o){var l=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return s[l](o-l)}}function n7(e){return function(){return e}}function Th(e){return+e}var Xj=[0,1];function Tn(e){return e}function tb(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:n7(isNaN(t)?NaN:.5)}function r7(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function a7(e,t,n){var r=e[0],a=e[1],s=t[0],o=t[1];return a<r?(r=tb(a,r),s=n(o,s)):(r=tb(r,a),s=n(s,o)),function(l){return s(r(l))}}function i7(e,t,n){var r=Math.min(e.length,t.length)-1,a=new Array(r),s=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)a[o]=tb(e[o],e[o+1]),s[o]=n(t[o],t[o+1]);return function(l){var c=od(e,l,1,r)-1;return s[c](a[c](l))}}function cd(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function cm(){var e=Xj,t=Xj,n=Ml,r,a,s,o=Tn,l,c,u;function d(){var h=Math.min(e.length,t.length);return o!==Tn&&(o=r7(e[0],e[h-1])),l=h>2?i7:a7,c=u=null,f}function f(h){return h==null||isNaN(h=+h)?s:(c||(c=l(e.map(r),t,n)))(r(o(h)))}return f.invert=function(h){return o(a((u||(u=l(t,e.map(r),Ah)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Th),d()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),d()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),n=Iw,d()},f.clamp=function(h){return arguments.length?(o=h?!0:Tn,d()):o!==Tn},f.interpolate=function(h){return arguments.length?(n=h,d()):n},f.unknown=function(h){return arguments.length?(s=h,f):s},function(h,p){return r=h,a=p,d()}}function $w(){return cm()(Tn,Tn)}function s7(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Oh(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 rl(e){return e=Oh(Math.abs(e)),e?e[1]:NaN}function o7(e,t){return function(n,r){for(var a=n.length,s=[],o=0,l=e[0],c=0;a>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),s.push(n.substring(a-=l,a+l)),!((c+=l+1)>r));)l=e[o=(o+1)%e.length];return s.reverse().join(t)}}function l7(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var c7=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ju(e){if(!(t=c7.exec(e)))throw new Error("invalid format: "+e);var t;return new Lw({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]})}ju.prototype=Lw.prototype;function Lw(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+""}Lw.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 u7(e){e:for(var t=e.length,n=1,r=-1,a;n<t;++n)switch(e[n]){case".":r=a=n;break;case"0":r===0&&(r=n),a=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(a+1):e}var Ph;function d7(e,t){var n=Oh(e,t);if(!n)return Ph=void 0,e.toPrecision(t);var r=n[0],a=n[1],s=a-(Ph=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=r.length;return s===o?r:s>o?r+new Array(s-o+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+Oh(e,Math.max(0,t+s-1))[0]}function Qj(e,t){var n=Oh(e,t);if(!n)return e+"";var r=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+r:r.length>a+1?r.slice(0,a+1)+"."+r.slice(a+1):r+new Array(a-r.length+2).join("0")}const Zj={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:s7,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)=>Qj(e*100,t),r:Qj,s:d7,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Jj(e){return e}var e1=Array.prototype.map,t1=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function f7(e){var t=e.grouping===void 0||e.thousands===void 0?Jj:o7(e1.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?Jj:l7(e1.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f,h){f=ju(f);var p=f.fill,m=f.align,g=f.sign,y=f.symbol,v=f.zero,k=f.width,w=f.comma,j=f.precision,S=f.trim,x=f.type;x==="n"?(w=!0,x="g"):Zj[x]||(j===void 0&&(j=12),S=!0,x="g"),(v||p==="0"&&m==="=")&&(v=!0,p="0",m="=");var N=(h&&h.prefix!==void 0?h.prefix:"")+(y==="$"?n:y==="#"&&/[boxX]/.test(x)?"0"+x.toLowerCase():""),E=(y==="$"?r:/[%p]/.test(x)?o:"")+(h&&h.suffix!==void 0?h.suffix:""),P=Zj[x],_=/[defgprs%]/.test(x);j=j===void 0?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,j)):Math.max(0,Math.min(20,j));function R(T){var B=N,$=E,I,D,U;if(x==="c")$=P(T)+$,T="";else{T=+T;var M=T<0||1/T<0;if(T=isNaN(T)?c:P(Math.abs(T),j),S&&(T=u7(T)),M&&+T==0&&g!=="+"&&(M=!1),B=(M?g==="("?g:l:g==="-"||g==="("?"":g)+B,$=(x==="s"&&!isNaN(T)&&Ph!==void 0?t1[8+Ph/3]:"")+$+(M&&g==="("?")":""),_){for(I=-1,D=T.length;++I<D;)if(U=T.charCodeAt(I),48>U||U>57){$=(U===46?a+T.slice(I+1):T.slice(I))+$,T=T.slice(0,I);break}}}w&&!v&&(T=t(T,1/0));var z=B.length+T.length+$.length,O=z<k?new Array(k-z+1).join(p):"";switch(w&&v&&(T=t(O+T,O.length?k-$.length:1/0),O=""),m){case"<":T=B+T+$+O;break;case"=":T=B+O+T+$;break;case"^":T=O.slice(0,z=O.length>>1)+B+T+$+O.slice(z);break;default:T=O+B+T+$;break}return s(T)}return R.toString=function(){return f+""},R}function d(f,h){var p=Math.max(-8,Math.min(8,Math.floor(rl(h)/3)))*3,m=Math.pow(10,-p),g=u((f=ju(f),f.type="f",f),{suffix:t1[8+p/3]});return function(y){return g(m*y)}}return{format:u,formatPrefix:d}}var Zd,Dw,mP;h7({thousands:",",grouping:[3],currency:["$",""]});function h7(e){return Zd=f7(e),Dw=Zd.format,mP=Zd.formatPrefix,Zd}function p7(e){return Math.max(0,-rl(Math.abs(e)))}function m7(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(rl(t)/3)))*3-rl(Math.abs(e)))}function g7(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,rl(t)-rl(e))+1}function gP(e,t,n,r){var a=Qy(e,t,n),s;switch(r=ju(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=m7(a,o))&&(r.precision=s),mP(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=g7(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=p7(a))&&(r.precision=s-(r.type==="%")*2);break}}return Dw(r)}function zi(e){var t=e.domain;return e.ticks=function(n){var r=t();return Yy(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return gP(a[0],a[a.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),a=0,s=r.length-1,o=r[a],l=r[s],c,u,d=10;for(l<o&&(u=o,o=l,l=u,u=a,a=s,s=u);d-- >0;){if(u=Xy(o,l,n),u===c)return r[a]=o,r[s]=l,t(r);if(u>0)o=Math.floor(o/u)*u,l=Math.ceil(l/u)*u;else if(u<0)o=Math.ceil(o*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function Rh(){var e=$w();return e.copy=function(){return cd(e,Rh())},Er.apply(e,arguments),zi(e)}function vP(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Th),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return vP(e).unknown(t)},e=arguments.length?Array.from(e,Th):[0,1],zi(n)}function yP(e,t){e=e.slice();var n=0,r=e.length-1,a=e[n],s=e[r],o;return s<a&&(o=n,n=r,r=o,o=a,a=s,s=o),e[n]=t.floor(a),e[r]=t.ceil(s),e}function n1(e){return Math.log(e)}function r1(e){return Math.exp(e)}function v7(e){return-Math.log(-e)}function y7(e){return-Math.exp(-e)}function b7(e){return isFinite(e)?+("1e"+e):e<0?0:e}function x7(e){return e===10?b7:e===Math.E?Math.exp:t=>Math.pow(e,t)}function w7(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 a1(e){return(t,n)=>-e(-t,n)}function Bw(e){const t=e(n1,r1),n=t.domain;let r=10,a,s;function o(){return a=w7(r),s=x7(r),n()[0]<0?(a=a1(a),s=a1(s),e(v7,y7)):e(n1,r1),t}return t.base=function(l){return arguments.length?(r=+l,o()):r},t.domain=function(l){return arguments.length?(n(l),o()):n()},t.ticks=l=>{const c=n();let u=c[0],d=c[c.length-1];const f=d<u;f&&([u,d]=[d,u]);let h=a(u),p=a(d),m,g;const y=l==null?10:+l;let v=[];if(!(r%1)&&p-h<y){if(h=Math.floor(h),p=Math.ceil(p),u>0){for(;h<=p;++h)for(m=1;m<r;++m)if(g=h<0?m/s(-h):m*s(h),!(g<u)){if(g>d)break;v.push(g)}}else for(;h<=p;++h)for(m=r-1;m>=1;--m)if(g=h>0?m/s(-h):m*s(h),!(g<u)){if(g>d)break;v.push(g)}v.length*2<y&&(v=Yy(u,d,y))}else v=Yy(h,p,Math.min(p-h,y)).map(s);return f?v.reverse():v},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=ju(c)).precision==null&&(c.trim=!0),c=Dw(c)),l===1/0)return c;const u=Math.max(1,r*l/t.ticks().length);return d=>{let f=d/s(Math.round(a(d)));return f*r<r-.5&&(f*=r),f<=u?c(d):""}},t.nice=()=>n(yP(n(),{floor:l=>s(Math.floor(a(l))),ceil:l=>s(Math.ceil(a(l)))})),t}function bP(){const e=Bw(cm()).domain([1,10]);return e.copy=()=>cd(e,bP()).base(e.base()),Er.apply(e,arguments),e}function i1(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function s1(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function zw(e){var t=1,n=e(i1(t),s1(t));return n.constant=function(r){return arguments.length?e(i1(t=+r),s1(t)):t},zi(n)}function xP(){var e=zw(cm());return e.copy=function(){return cd(e,xP()).constant(e.constant())},Er.apply(e,arguments)}function o1(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function k7(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function S7(e){return e<0?-e*e:e*e}function Fw(e){var t=e(Tn,Tn),n=1;function r(){return n===1?e(Tn,Tn):n===.5?e(k7,S7):e(o1(n),o1(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},zi(t)}function Uw(){var e=Fw(cm());return e.copy=function(){return cd(e,Uw()).exponent(e.exponent())},Er.apply(e,arguments),e}function j7(){return Uw.apply(null,arguments).exponent(.5)}function l1(e){return Math.sign(e)*e*e}function N7(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function wP(){var e=$w(),t=[0,1],n=!1,r;function a(s){var o=N7(e(s));return isNaN(o)?r:n?Math.round(o):o}return a.invert=function(s){return e.invert(l1(s))},a.domain=function(s){return arguments.length?(e.domain(s),a):e.domain()},a.range=function(s){return arguments.length?(e.range((t=Array.from(s,Th)).map(l1)),a):t.slice()},a.rangeRound=function(s){return a.range(s).round(!0)},a.round=function(s){return arguments.length?(n=!!s,a):n},a.clamp=function(s){return arguments.length?(e.clamp(s),a):e.clamp()},a.unknown=function(s){return arguments.length?(r=s,a):r},a.copy=function(){return wP(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Er.apply(a,arguments),zi(a)}function kP(){var e=[],t=[],n=[],r;function a(){var o=0,l=Math.max(1,t.length);for(n=new Array(l-1);++o<l;)n[o-1]=TV(e,o/l);return s}function s(o){return o==null||isNaN(o=+o)?r:t[od(n,o)]}return s.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[l]:e[e.length-1]]},s.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Ci),a()},s.range=function(o){return arguments.length?(t=Array.from(o),a()):t.slice()},s.unknown=function(o){return arguments.length?(r=o,s):r},s.quantiles=function(){return n.slice()},s.copy=function(){return kP().domain(e).range(t).unknown(r)},Er.apply(s,arguments)}function SP(){var e=0,t=1,n=1,r=[.5],a=[0,1],s;function o(c){return c!=null&&c<=c?a[od(r,c,0,n)]:s}function l(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},o.range=function(c){return arguments.length?(n=(a=Array.from(c)).length-1,l()):a.slice()},o.invertExtent=function(c){var u=a.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},o.unknown=function(c){return arguments.length&&(s=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return SP().domain([e,t]).range(a).unknown(s)},Er.apply(zi(o),arguments)}function jP(){var e=[.5],t=[0,1],n,r=1;function a(s){return s!=null&&s<=s?t[od(e,s,0,r)]:n}return a.domain=function(s){return arguments.length?(e=Array.from(s),r=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(s){return arguments.length?(t=Array.from(s),r=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(s){var o=t.indexOf(s);return[e[o-1],e[o]]},a.unknown=function(s){return arguments.length?(n=s,a):n},a.copy=function(){return jP().domain(e).range(t).unknown(n)},Er.apply(a,arguments)}const Eg=new Date,_g=new Date;function Vt(e,t,n,r){function a(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return a.floor=s=>(e(s=new Date(+s)),s),a.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),a.round=s=>{const o=a(s),l=a.ceil(s);return s-o<l-s?o:l},a.offset=(s,o)=>(t(s=new Date(+s),o==null?1:Math.floor(o)),s),a.range=(s,o,l)=>{const c=[];if(s=a.ceil(s),l=l==null?1:Math.floor(l),!(s<o)||!(l>0))return c;let u;do c.push(u=new Date(+s)),t(s,l),e(s);while(u<s&&s<o);return c},a.filter=s=>Vt(o=>{if(o>=o)for(;e(o),!s(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!s(o););else for(;--l>=0;)for(;t(o,1),!s(o););}),n&&(a.count=(s,o)=>(Eg.setTime(+s),_g.setTime(+o),e(Eg),e(_g),Math.floor(n(Eg,_g))),a.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?a.filter(r?o=>r(o)%s===0:o=>a.count(0,o)%s===0):a)),a}const Mh=Vt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Mh.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Vt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Mh);Mh.range;const Oa=1e3,br=Oa*60,Pa=br*60,Ua=Pa*24,Ww=Ua*7,c1=Ua*30,Cg=Ua*365,bs=Vt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Oa)},(e,t)=>(t-e)/Oa,e=>e.getUTCSeconds());bs.range;const Hw=Vt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Oa)},(e,t)=>{e.setTime(+e+t*br)},(e,t)=>(t-e)/br,e=>e.getMinutes());Hw.range;const Gw=Vt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*br)},(e,t)=>(t-e)/br,e=>e.getUTCMinutes());Gw.range;const qw=Vt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Oa-e.getMinutes()*br)},(e,t)=>{e.setTime(+e+t*Pa)},(e,t)=>(t-e)/Pa,e=>e.getHours());qw.range;const Kw=Vt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Pa)},(e,t)=>(t-e)/Pa,e=>e.getUTCHours());Kw.range;const ud=Vt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*br)/Ua,e=>e.getDate()-1);ud.range;const um=Vt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ua,e=>e.getUTCDate()-1);um.range;const NP=Vt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ua,e=>Math.floor(e/Ua));NP.range;function Hs(e){return Vt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*br)/Ww)}const dm=Hs(0),Ih=Hs(1),E7=Hs(2),_7=Hs(3),al=Hs(4),C7=Hs(5),A7=Hs(6);dm.range;Ih.range;E7.range;_7.range;al.range;C7.range;A7.range;function Gs(e){return Vt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/Ww)}const fm=Gs(0),$h=Gs(1),T7=Gs(2),O7=Gs(3),il=Gs(4),P7=Gs(5),R7=Gs(6);fm.range;$h.range;T7.range;O7.range;il.range;P7.range;R7.range;const Vw=Vt(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());Vw.range;const Yw=Vt(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());Yw.range;const Wa=Vt(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());Wa.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Vt(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)});Wa.range;const Ha=Vt(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());Ha.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Vt(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)});Ha.range;function EP(e,t,n,r,a,s){const o=[[bs,1,Oa],[bs,5,5*Oa],[bs,15,15*Oa],[bs,30,30*Oa],[s,1,br],[s,5,5*br],[s,15,15*br],[s,30,30*br],[a,1,Pa],[a,3,3*Pa],[a,6,6*Pa],[a,12,12*Pa],[r,1,Ua],[r,2,2*Ua],[n,1,Ww],[t,1,c1],[t,3,3*c1],[e,1,Cg]];function l(u,d,f){const h=d<u;h&&([u,d]=[d,u]);const p=f&&typeof f.range=="function"?f:c(u,d,f),m=p?p.range(u,+d+1):[];return h?m.reverse():m}function c(u,d,f){const h=Math.abs(d-u)/f,p=Ow(([,,y])=>y).right(o,h);if(p===o.length)return e.every(Qy(u/Cg,d/Cg,f));if(p===0)return Mh.every(Math.max(Qy(u,d,f),1));const[m,g]=o[h/o[p-1][2]<o[p][2]/h?p-1:p];return m.every(g)}return[l,c]}const[M7,I7]=EP(Ha,Yw,fm,NP,Kw,Gw),[$7,L7]=EP(Wa,Vw,dm,ud,qw,Hw);function Ag(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 Tg(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 dc(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function D7(e){var t=e.dateTime,n=e.date,r=e.time,a=e.periods,s=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,u=fc(a),d=hc(a),f=fc(s),h=hc(s),p=fc(o),m=hc(o),g=fc(l),y=hc(l),v=fc(c),k=hc(c),w={a:U,A:M,b:z,B:O,c:null,d:m1,e:m1,f:oY,g:vY,G:bY,H:aY,I:iY,j:sY,L:_P,m:lY,M:cY,p:J,q:F,Q:y1,s:b1,S:uY,u:dY,U:fY,V:hY,w:pY,W:mY,x:null,X:null,y:gY,Y:yY,Z:xY,"%":v1},j={a:L,A:ie,b:fe,B:ve,c:null,d:g1,e:g1,f:jY,g:MY,G:$Y,H:wY,I:kY,j:SY,L:AP,m:NY,M:EY,p:Ee,q:ee,Q:y1,s:b1,S:_Y,u:CY,U:AY,V:TY,w:OY,W:PY,x:null,X:null,y:RY,Y:IY,Z:LY,"%":v1},S={a:_,A:R,b:T,B,c:$,d:h1,e:h1,f:eY,g:f1,G:d1,H:p1,I:p1,j:X7,L:J7,m:Y7,M:Q7,p:P,q:V7,Q:nY,s:rY,S:Z7,u:W7,U:H7,V:G7,w:U7,W:q7,x:I,X:D,y:f1,Y:d1,Z:K7,"%":tY};w.x=x(n,w),w.X=x(r,w),w.c=x(t,w),j.x=x(n,j),j.X=x(r,j),j.c=x(t,j);function x(Q,ae){return function(ce){var G=[],xe=-1,we=0,Pe=Q.length,ge,Ie,me;for(ce instanceof Date||(ce=new Date(+ce));++xe<Pe;)Q.charCodeAt(xe)===37&&(G.push(Q.slice(we,xe)),(Ie=u1[ge=Q.charAt(++xe)])!=null?ge=Q.charAt(++xe):Ie=ge==="e"?" ":"0",(me=ae[ge])&&(ge=me(ce,Ie)),G.push(ge),we=xe+1);return G.push(Q.slice(we,xe)),G.join("")}}function N(Q,ae){return function(ce){var G=dc(1900,void 0,1),xe=E(G,Q,ce+="",0),we,Pe;if(xe!=ce.length)return null;if("Q"in G)return new Date(G.Q);if("s"in G)return new Date(G.s*1e3+("L"in G?G.L:0));if(ae&&!("Z"in G)&&(G.Z=0),"p"in G&&(G.H=G.H%12+G.p*12),G.m===void 0&&(G.m="q"in G?G.q:0),"V"in G){if(G.V<1||G.V>53)return null;"w"in G||(G.w=1),"Z"in G?(we=Tg(dc(G.y,0,1)),Pe=we.getUTCDay(),we=Pe>4||Pe===0?$h.ceil(we):$h(we),we=um.offset(we,(G.V-1)*7),G.y=we.getUTCFullYear(),G.m=we.getUTCMonth(),G.d=we.getUTCDate()+(G.w+6)%7):(we=Ag(dc(G.y,0,1)),Pe=we.getDay(),we=Pe>4||Pe===0?Ih.ceil(we):Ih(we),we=ud.offset(we,(G.V-1)*7),G.y=we.getFullYear(),G.m=we.getMonth(),G.d=we.getDate()+(G.w+6)%7)}else("W"in G||"U"in G)&&("w"in G||(G.w="u"in G?G.u%7:"W"in G?1:0),Pe="Z"in G?Tg(dc(G.y,0,1)).getUTCDay():Ag(dc(G.y,0,1)).getDay(),G.m=0,G.d="W"in G?(G.w+6)%7+G.W*7-(Pe+5)%7:G.w+G.U*7-(Pe+6)%7);return"Z"in G?(G.H+=G.Z/100|0,G.M+=G.Z%100,Tg(G)):Ag(G)}}function E(Q,ae,ce,G){for(var xe=0,we=ae.length,Pe=ce.length,ge,Ie;xe<we;){if(G>=Pe)return-1;if(ge=ae.charCodeAt(xe++),ge===37){if(ge=ae.charAt(xe++),Ie=S[ge in u1?ae.charAt(xe++):ge],!Ie||(G=Ie(Q,ce,G))<0)return-1}else if(ge!=ce.charCodeAt(G++))return-1}return G}function P(Q,ae,ce){var G=u.exec(ae.slice(ce));return G?(Q.p=d.get(G[0].toLowerCase()),ce+G[0].length):-1}function _(Q,ae,ce){var G=p.exec(ae.slice(ce));return G?(Q.w=m.get(G[0].toLowerCase()),ce+G[0].length):-1}function R(Q,ae,ce){var G=f.exec(ae.slice(ce));return G?(Q.w=h.get(G[0].toLowerCase()),ce+G[0].length):-1}function T(Q,ae,ce){var G=v.exec(ae.slice(ce));return G?(Q.m=k.get(G[0].toLowerCase()),ce+G[0].length):-1}function B(Q,ae,ce){var G=g.exec(ae.slice(ce));return G?(Q.m=y.get(G[0].toLowerCase()),ce+G[0].length):-1}function $(Q,ae,ce){return E(Q,t,ae,ce)}function I(Q,ae,ce){return E(Q,n,ae,ce)}function D(Q,ae,ce){return E(Q,r,ae,ce)}function U(Q){return o[Q.getDay()]}function M(Q){return s[Q.getDay()]}function z(Q){return c[Q.getMonth()]}function O(Q){return l[Q.getMonth()]}function J(Q){return a[+(Q.getHours()>=12)]}function F(Q){return 1+~~(Q.getMonth()/3)}function L(Q){return o[Q.getUTCDay()]}function ie(Q){return s[Q.getUTCDay()]}function fe(Q){return c[Q.getUTCMonth()]}function ve(Q){return l[Q.getUTCMonth()]}function Ee(Q){return a[+(Q.getUTCHours()>=12)]}function ee(Q){return 1+~~(Q.getUTCMonth()/3)}return{format:function(Q){var ae=x(Q+="",w);return ae.toString=function(){return Q},ae},parse:function(Q){var ae=N(Q+="",!1);return ae.toString=function(){return Q},ae},utcFormat:function(Q){var ae=x(Q+="",j);return ae.toString=function(){return Q},ae},utcParse:function(Q){var ae=N(Q+="",!0);return ae.toString=function(){return Q},ae}}}var u1={"-":"",_:" ",0:"0"},nn=/^\s*\d+/,B7=/^%/,z7=/[\\^$*+?|[\]().{}]/g;function Ke(e,t,n){var r=e<0?"-":"",a=(r?-e:e)+"",s=a.length;return r+(s<n?new Array(n-s+1).join(t)+a:a)}function F7(e){return e.replace(z7,"\\$&")}function fc(e){return new RegExp("^(?:"+e.map(F7).join("|")+")","i")}function hc(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function U7(e,t,n){var r=nn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function W7(e,t,n){var r=nn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function H7(e,t,n){var r=nn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function G7(e,t,n){var r=nn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function q7(e,t,n){var r=nn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function d1(e,t,n){var r=nn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function f1(e,t,n){var r=nn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function K7(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 V7(e,t,n){var r=nn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Y7(e,t,n){var r=nn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function h1(e,t,n){var r=nn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function X7(e,t,n){var r=nn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function p1(e,t,n){var r=nn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Q7(e,t,n){var r=nn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Z7(e,t,n){var r=nn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function J7(e,t,n){var r=nn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function eY(e,t,n){var r=nn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function tY(e,t,n){var r=B7.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function nY(e,t,n){var r=nn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function rY(e,t,n){var r=nn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function m1(e,t){return Ke(e.getDate(),t,2)}function aY(e,t){return Ke(e.getHours(),t,2)}function iY(e,t){return Ke(e.getHours()%12||12,t,2)}function sY(e,t){return Ke(1+ud.count(Wa(e),e),t,3)}function _P(e,t){return Ke(e.getMilliseconds(),t,3)}function oY(e,t){return _P(e,t)+"000"}function lY(e,t){return Ke(e.getMonth()+1,t,2)}function cY(e,t){return Ke(e.getMinutes(),t,2)}function uY(e,t){return Ke(e.getSeconds(),t,2)}function dY(e){var t=e.getDay();return t===0?7:t}function fY(e,t){return Ke(dm.count(Wa(e)-1,e),t,2)}function CP(e){var t=e.getDay();return t>=4||t===0?al(e):al.ceil(e)}function hY(e,t){return e=CP(e),Ke(al.count(Wa(e),e)+(Wa(e).getDay()===4),t,2)}function pY(e){return e.getDay()}function mY(e,t){return Ke(Ih.count(Wa(e)-1,e),t,2)}function gY(e,t){return Ke(e.getFullYear()%100,t,2)}function vY(e,t){return e=CP(e),Ke(e.getFullYear()%100,t,2)}function yY(e,t){return Ke(e.getFullYear()%1e4,t,4)}function bY(e,t){var n=e.getDay();return e=n>=4||n===0?al(e):al.ceil(e),Ke(e.getFullYear()%1e4,t,4)}function xY(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ke(t/60|0,"0",2)+Ke(t%60,"0",2)}function g1(e,t){return Ke(e.getUTCDate(),t,2)}function wY(e,t){return Ke(e.getUTCHours(),t,2)}function kY(e,t){return Ke(e.getUTCHours()%12||12,t,2)}function SY(e,t){return Ke(1+um.count(Ha(e),e),t,3)}function AP(e,t){return Ke(e.getUTCMilliseconds(),t,3)}function jY(e,t){return AP(e,t)+"000"}function NY(e,t){return Ke(e.getUTCMonth()+1,t,2)}function EY(e,t){return Ke(e.getUTCMinutes(),t,2)}function _Y(e,t){return Ke(e.getUTCSeconds(),t,2)}function CY(e){var t=e.getUTCDay();return t===0?7:t}function AY(e,t){return Ke(fm.count(Ha(e)-1,e),t,2)}function TP(e){var t=e.getUTCDay();return t>=4||t===0?il(e):il.ceil(e)}function TY(e,t){return e=TP(e),Ke(il.count(Ha(e),e)+(Ha(e).getUTCDay()===4),t,2)}function OY(e){return e.getUTCDay()}function PY(e,t){return Ke($h.count(Ha(e)-1,e),t,2)}function RY(e,t){return Ke(e.getUTCFullYear()%100,t,2)}function MY(e,t){return e=TP(e),Ke(e.getUTCFullYear()%100,t,2)}function IY(e,t){return Ke(e.getUTCFullYear()%1e4,t,4)}function $Y(e,t){var n=e.getUTCDay();return e=n>=4||n===0?il(e):il.ceil(e),Ke(e.getUTCFullYear()%1e4,t,4)}function LY(){return"+0000"}function v1(){return"%"}function y1(e){return+e}function b1(e){return Math.floor(+e/1e3)}var oo,OP,PP;DY({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 DY(e){return oo=D7(e),OP=oo.format,oo.parse,PP=oo.utcFormat,oo.utcParse,oo}function BY(e){return new Date(e)}function zY(e){return e instanceof Date?+e:+new Date(+e)}function Xw(e,t,n,r,a,s,o,l,c,u){var d=$w(),f=d.invert,h=d.domain,p=u(".%L"),m=u(":%S"),g=u("%I:%M"),y=u("%I %p"),v=u("%a %d"),k=u("%b %d"),w=u("%B"),j=u("%Y");function S(x){return(c(x)<x?p:l(x)<x?m:o(x)<x?g:s(x)<x?y:r(x)<x?a(x)<x?v:k:n(x)<x?w:j)(x)}return d.invert=function(x){return new Date(f(x))},d.domain=function(x){return arguments.length?h(Array.from(x,zY)):h().map(BY)},d.ticks=function(x){var N=h();return e(N[0],N[N.length-1],x??10)},d.tickFormat=function(x,N){return N==null?S:u(N)},d.nice=function(x){var N=h();return(!x||typeof x.range!="function")&&(x=t(N[0],N[N.length-1],x??10)),x?h(yP(N,x)):d},d.copy=function(){return cd(d,Xw(e,t,n,r,a,s,o,l,c,u))},d}function FY(){return Er.apply(Xw($7,L7,Wa,Vw,dm,ud,qw,Hw,bs,OP).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function UY(){return Er.apply(Xw(M7,I7,Ha,Yw,fm,um,Kw,Gw,bs,PP).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function hm(){var e=0,t=1,n,r,a,s,o=Tn,l=!1,c;function u(f){return f==null||isNaN(f=+f)?c:o(a===0?.5:(f=(s(f)-n)*a,l?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,n=s(e=+e),r=s(t=+t),a=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(f){return arguments.length?(l=!!f,u):l},u.interpolator=function(f){return arguments.length?(o=f,u):o};function d(f){return function(h){var p,m;return arguments.length?([p,m]=h,o=f(p,m),u):[o(0),o(1)]}}return u.range=d(Ml),u.rangeRound=d(Iw),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return s=f,n=f(e),r=f(t),a=n===r?0:1/(r-n),u}}function Fi(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function RP(){var e=zi(hm()(Tn));return e.copy=function(){return Fi(e,RP())},Ya.apply(e,arguments)}function MP(){var e=Bw(hm()).domain([1,10]);return e.copy=function(){return Fi(e,MP()).base(e.base())},Ya.apply(e,arguments)}function IP(){var e=zw(hm());return e.copy=function(){return Fi(e,IP()).constant(e.constant())},Ya.apply(e,arguments)}function Qw(){var e=Fw(hm());return e.copy=function(){return Fi(e,Qw()).exponent(e.exponent())},Ya.apply(e,arguments)}function WY(){return Qw.apply(null,arguments).exponent(.5)}function $P(){var e=[],t=Tn;function n(r){if(r!=null&&!isNaN(r=+r))return t((od(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let a of r)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(Ci),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,a)=>t(a/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(a,s)=>AV(e,s/r))},n.copy=function(){return $P(t).domain(e)},Ya.apply(n,arguments)}function pm(){var e=0,t=.5,n=1,r=1,a,s,o,l,c,u=Tn,d,f=!1,h;function p(g){return isNaN(g=+g)?h:(g=.5+((g=+d(g))-s)*(r*g<r*s?l:c),u(f?Math.max(0,Math.min(1,g)):g))}p.domain=function(g){return arguments.length?([e,t,n]=g,a=d(e=+e),s=d(t=+t),o=d(n=+n),l=a===s?0:.5/(s-a),c=s===o?0:.5/(o-s),r=s<a?-1:1,p):[e,t,n]},p.clamp=function(g){return arguments.length?(f=!!g,p):f},p.interpolator=function(g){return arguments.length?(u=g,p):u};function m(g){return function(y){var v,k,w;return arguments.length?([v,k,w]=y,u=t7(g,[v,k,w]),p):[u(0),u(.5),u(1)]}}return p.range=m(Ml),p.rangeRound=m(Iw),p.unknown=function(g){return arguments.length?(h=g,p):h},function(g){return d=g,a=g(e),s=g(t),o=g(n),l=a===s?0:.5/(s-a),c=s===o?0:.5/(o-s),r=s<a?-1:1,p}}function LP(){var e=zi(pm()(Tn));return e.copy=function(){return Fi(e,LP())},Ya.apply(e,arguments)}function DP(){var e=Bw(pm()).domain([.1,1,10]);return e.copy=function(){return Fi(e,DP()).base(e.base())},Ya.apply(e,arguments)}function BP(){var e=zw(pm());return e.copy=function(){return Fi(e,BP()).constant(e.constant())},Ya.apply(e,arguments)}function Zw(){var e=Fw(pm());return e.copy=function(){return Fi(e,Zw()).exponent(e.exponent())},Ya.apply(e,arguments)}function HY(){return Zw.apply(null,arguments).exponent(.5)}const x1=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:xu,scaleDiverging:LP,scaleDivergingLog:DP,scaleDivergingPow:Zw,scaleDivergingSqrt:HY,scaleDivergingSymlog:BP,scaleIdentity:vP,scaleImplicit:Zy,scaleLinear:Rh,scaleLog:bP,scaleOrdinal:Pw,scalePoint:Bc,scalePow:Uw,scaleQuantile:kP,scaleQuantize:SP,scaleRadial:wP,scaleSequential:RP,scaleSequentialLog:MP,scaleSequentialPow:Qw,scaleSequentialQuantile:$P,scaleSequentialSqrt:WY,scaleSequentialSymlog:IP,scaleSqrt:j7,scaleSymlog:xP,scaleThreshold:jP,scaleTime:FY,scaleUtc:UY,tickFormat:gP},Symbol.toStringTag,{value:"Module"}));var GY=El;function qY(e,t,n){for(var r=-1,a=e.length;++r<a;){var s=e[r],o=t(s);if(o!=null&&(l===void 0?o===o&&!GY(o):n(o,l)))var l=o,c=s}return c}var zP=qY;function KY(e,t){return e>t}var VY=KY,YY=zP,XY=VY,QY=Rl;function ZY(e){return e&&e.length?YY(e,QY,XY):void 0}var JY=ZY;const mm=Je(JY);function eX(e,t){return e<t}var tX=eX,nX=zP,rX=tX,aX=Rl;function iX(e){return e&&e.length?nX(e,aX,rX):void 0}var sX=iX;const gm=Je(sX);var oX=fw,lX=Bi,cX=XO,uX=Wn;function dX(e,t){var n=uX(e)?oX:cX;return n(e,lX(t))}var fX=dX,hX=VO,pX=fX;function mX(e,t){return hX(pX(e,t),1)}var gX=mX;const vX=Je(gX);var yX=_w;function bX(e,t){return yX(e,t)}var xX=bX;const Jw=Je(xX);var Il=1e9,wX={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},t0,St=!0,jr="[DecimalError] ",Es=jr+"Invalid argument: ",e0=jr+"Exponent out of range: ",$l=Math.floor,cs=Math.pow,kX=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Jn,Qt=1e7,yt=7,FP=9007199254740991,Lh=$l(FP/yt),be={};be.absoluteValue=be.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};be.comparedTo=be.cmp=function(e){var t,n,r,a,s=this;if(e=new s.constructor(e),s.s!==e.s)return s.s||-e.s;if(s.e!==e.e)return s.e>e.e^s.s<0?1:-1;for(r=s.d.length,a=e.d.length,t=0,n=r<a?r:a;t<n;++t)if(s.d[t]!==e.d[t])return s.d[t]>e.d[t]^s.s<0?1:-1;return r===a?0:r>a^s.s<0?1:-1};be.decimalPlaces=be.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*yt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};be.dividedBy=be.div=function(e){return La(this,new this.constructor(e))};be.dividedToIntegerBy=be.idiv=function(e){var t=this,n=t.constructor;return ut(La(t,new n(e),0,1),n.precision)};be.equals=be.eq=function(e){return!this.cmp(e)};be.exponent=function(){return Bt(this)};be.greaterThan=be.gt=function(e){return this.cmp(e)>0};be.greaterThanOrEqualTo=be.gte=function(e){return this.cmp(e)>=0};be.isInteger=be.isint=function(){return this.e>this.d.length-2};be.isNegative=be.isneg=function(){return this.s<0};be.isPositive=be.ispos=function(){return this.s>0};be.isZero=function(){return this.s===0};be.lessThan=be.lt=function(e){return this.cmp(e)<0};be.lessThanOrEqualTo=be.lte=function(e){return this.cmp(e)<1};be.logarithm=be.log=function(e){var t,n=this,r=n.constructor,a=r.precision,s=a+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Jn))throw Error(jr+"NaN");if(n.s<1)throw Error(jr+(n.s?"NaN":"-Infinity"));return n.eq(Jn)?new r(0):(St=!1,t=La(Nu(n,s),Nu(e,s),s),St=!0,ut(t,a))};be.minus=be.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?HP(t,e):UP(t,(e.s=-e.s,e))};be.modulo=be.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(e=new r(e),!e.s)throw Error(jr+"NaN");return n.s?(St=!1,t=La(n,e,0,1).times(e),St=!0,n.minus(t)):ut(new r(n),a)};be.naturalExponential=be.exp=function(){return WP(this)};be.naturalLogarithm=be.ln=function(){return Nu(this)};be.negated=be.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};be.plus=be.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?UP(t,e):HP(t,(e.s=-e.s,e))};be.precision=be.sd=function(e){var t,n,r,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Es+e);if(t=Bt(a)+1,r=a.d.length-1,n=r*yt+1,r=a.d[r],r){for(;r%10==0;r/=10)n--;for(r=a.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};be.squareRoot=be.sqrt=function(){var e,t,n,r,a,s,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(jr+"NaN")}for(e=Bt(l),St=!1,a=Math.sqrt(+l),a==0||a==1/0?(t=ca(l.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=$l((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(a.toString()),n=c.precision,a=o=n+3;;)if(s=r,r=s.plus(La(l,s,o+2)).times(.5),ca(s.d).slice(0,o)===(t=ca(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(ut(s,n+1,0),s.times(s).eq(l)){r=s;break}}else if(t!="9999")break;o+=4}return St=!0,ut(r,n)};be.times=be.mul=function(e){var t,n,r,a,s,o,l,c,u,d=this,f=d.constructor,h=d.d,p=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,n=d.e+e.e,c=h.length,u=p.length,c<u&&(s=h,h=p,p=s,o=c,c=u,u=o),s=[],o=c+u,r=o;r--;)s.push(0);for(r=u;--r>=0;){for(t=0,a=c+r;a>r;)l=s[a]+p[r]*h[a-r-1]+t,s[a--]=l%Qt|0,t=l/Qt|0;s[a]=(s[a]+t)%Qt|0}for(;!s[--o];)s.pop();return t?++n:s.shift(),e.d=s,e.e=n,St?ut(e,f.precision):e};be.toDecimalPlaces=be.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(pa(e,0,Il),t===void 0?t=r.rounding:pa(t,0,8),ut(n,e+Bt(n)+1,t))};be.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=Ls(r,!0):(pa(e,0,Il),t===void 0?t=a.rounding:pa(t,0,8),r=ut(new a(r),e+1,t),n=Ls(r,!0,e+1)),n};be.toFixed=function(e,t){var n,r,a=this,s=a.constructor;return e===void 0?Ls(a):(pa(e,0,Il),t===void 0?t=s.rounding:pa(t,0,8),r=ut(new s(a),e+Bt(a)+1,t),n=Ls(r.abs(),!1,e+Bt(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};be.toInteger=be.toint=function(){var e=this,t=e.constructor;return ut(new t(e),Bt(e)+1,t.rounding)};be.toNumber=function(){return+this};be.toPower=be.pow=function(e){var t,n,r,a,s,o,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(Jn);if(l=new c(l),!l.s){if(e.s<1)throw Error(jr+"Infinity");return l}if(l.eq(Jn))return l;if(r=c.precision,e.eq(Jn))return ut(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,s=l.s,o){if((n=d<0?-d:d)<=FP){for(a=new c(Jn),t=Math.ceil(r/yt+4),St=!1;n%2&&(a=a.times(l),k1(a.d,t)),n=$l(n/2),n!==0;)l=l.times(l),k1(l.d,t);return St=!0,e.s<0?new c(Jn).div(a):ut(a,r)}}else if(s<0)throw Error(jr+"NaN");return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,St=!1,a=e.times(Nu(l,r+u)),St=!0,a=WP(a),a.s=s,a};be.toPrecision=function(e,t){var n,r,a=this,s=a.constructor;return e===void 0?(n=Bt(a),r=Ls(a,n<=s.toExpNeg||n>=s.toExpPos)):(pa(e,1,Il),t===void 0?t=s.rounding:pa(t,0,8),a=ut(new s(a),e,t),n=Bt(a),r=Ls(a,e<=n||n<=s.toExpNeg,e)),r};be.toSignificantDigits=be.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(pa(e,1,Il),t===void 0?t=r.rounding:pa(t,0,8)),ut(new r(n),e,t)};be.toString=be.valueOf=be.val=be.toJSON=be[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Bt(e),n=e.constructor;return Ls(e,t<=n.toExpNeg||t>=n.toExpPos)};function UP(e,t){var n,r,a,s,o,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),St?ut(t,f):t;if(c=e.d,u=t.d,o=e.e,a=t.e,c=c.slice(),s=o-a,s){for(s<0?(r=c,s=-s,l=u.length):(r=u,a=o,l=c.length),o=Math.ceil(f/yt),l=o>l?o+1:l+1,s>l&&(s=l,r.length=1),r.reverse();s--;)r.push(0);r.reverse()}for(l=c.length,s=u.length,l-s<0&&(s=l,r=u,u=c,c=r),n=0;s;)n=(c[--s]=c[s]+u[s]+n)/Qt|0,c[s]%=Qt;for(n&&(c.unshift(n),++a),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=a,St?ut(t,f):t}function pa(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Es+e)}function ca(e){var t,n,r,a=e.length-1,s="",o=e[0];if(a>0){for(s+=o,t=1;t<a;t++)r=e[t]+"",n=yt-r.length,n&&(s+=oi(n)),s+=r;o=e[t],r=o+"",n=yt-r.length,n&&(s+=oi(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return s+o}var La=function(){function e(r,a){var s,o=0,l=r.length;for(r=r.slice();l--;)s=r[l]*a+o,r[l]=s%Qt|0,o=s/Qt|0;return o&&r.unshift(o),r}function t(r,a,s,o){var l,c;if(s!=o)c=s>o?1:-1;else for(l=c=0;l<s;l++)if(r[l]!=a[l]){c=r[l]>a[l]?1:-1;break}return c}function n(r,a,s){for(var o=0;s--;)r[s]-=o,o=r[s]<a[s]?1:0,r[s]=o*Qt+r[s]-a[s];for(;!r[0]&&r.length>1;)r.shift()}return function(r,a,s,o){var l,c,u,d,f,h,p,m,g,y,v,k,w,j,S,x,N,E,P=r.constructor,_=r.s==a.s?1:-1,R=r.d,T=a.d;if(!r.s)return new P(r);if(!a.s)throw Error(jr+"Division by zero");for(c=r.e-a.e,N=T.length,S=R.length,p=new P(_),m=p.d=[],u=0;T[u]==(R[u]||0);)++u;if(T[u]>(R[u]||0)&&--c,s==null?k=s=P.precision:o?k=s+(Bt(r)-Bt(a))+1:k=s,k<0)return new P(0);if(k=k/yt+2|0,u=0,N==1)for(d=0,T=T[0],k++;(u<S||d)&&k--;u++)w=d*Qt+(R[u]||0),m[u]=w/T|0,d=w%T|0;else{for(d=Qt/(T[0]+1)|0,d>1&&(T=e(T,d),R=e(R,d),N=T.length,S=R.length),j=N,g=R.slice(0,N),y=g.length;y<N;)g[y++]=0;E=T.slice(),E.unshift(0),x=T[0],T[1]>=Qt/2&&++x;do d=0,l=t(T,g,N,y),l<0?(v=g[0],N!=y&&(v=v*Qt+(g[1]||0)),d=v/x|0,d>1?(d>=Qt&&(d=Qt-1),f=e(T,d),h=f.length,y=g.length,l=t(f,g,h,y),l==1&&(d--,n(f,N<h?E:T,h))):(d==0&&(l=d=1),f=T.slice()),h=f.length,h<y&&f.unshift(0),n(g,f,y),l==-1&&(y=g.length,l=t(T,g,N,y),l<1&&(d++,n(g,N<y?E:T,y))),y=g.length):l===0&&(d++,g=[0]),m[u++]=d,l&&g[0]?g[y++]=R[j]||0:(g=[R[j]],y=1);while((j++<S||g[0]!==void 0)&&k--)}return m[0]||m.shift(),p.e=c,ut(p,o?s+Bt(p)+1:s)}}();function WP(e,t){var n,r,a,s,o,l,c=0,u=0,d=e.constructor,f=d.precision;if(Bt(e)>16)throw Error(e0+Bt(e));if(!e.s)return new d(Jn);for(St=!1,l=f,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(r=Math.log(cs(2,u))/Math.LN10*2+5|0,l+=r,n=a=s=new d(Jn),d.precision=l;;){if(a=ut(a.times(e),l),n=n.times(++c),o=s.plus(La(a,n,l)),ca(o.d).slice(0,l)===ca(s.d).slice(0,l)){for(;u--;)s=ut(s.times(s),l);return d.precision=f,t==null?(St=!0,ut(s,f)):s}s=o}}function Bt(e){for(var t=e.e*yt,n=e.d[0];n>=10;n/=10)t++;return t}function Og(e,t,n){if(t>e.LN10.sd())throw St=!0,n&&(e.precision=n),Error(jr+"LN10 precision limit exceeded");return ut(new e(e.LN10),t)}function oi(e){for(var t="";e--;)t+="0";return t}function Nu(e,t){var n,r,a,s,o,l,c,u,d,f=1,h=10,p=e,m=p.d,g=p.constructor,y=g.precision;if(p.s<1)throw Error(jr+(p.s?"NaN":"-Infinity"));if(p.eq(Jn))return new g(0);if(t==null?(St=!1,u=y):u=t,p.eq(10))return t==null&&(St=!0),Og(g,u);if(u+=h,g.precision=u,n=ca(m),r=n.charAt(0),s=Bt(p),Math.abs(s)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)p=p.times(e),n=ca(p.d),r=n.charAt(0),f++;s=Bt(p),r>1?(p=new g("0."+n),s++):p=new g(r+"."+n.slice(1))}else return c=Og(g,u+2,y).times(s+""),p=Nu(new g(r+"."+n.slice(1)),u-h).plus(c),g.precision=y,t==null?(St=!0,ut(p,y)):p;for(l=o=p=La(p.minus(Jn),p.plus(Jn),u),d=ut(p.times(p),u),a=3;;){if(o=ut(o.times(d),u),c=l.plus(La(o,new g(a),u)),ca(c.d).slice(0,u)===ca(l.d).slice(0,u))return l=l.times(2),s!==0&&(l=l.plus(Og(g,u+2,y).times(s+""))),l=La(l,new g(f),u),g.precision=y,t==null?(St=!0,ut(l,y)):l;l=c,a+=2}}function w1(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=$l(n/yt),e.d=[],r=(n+1)%yt,n<0&&(r+=yt),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=yt;r<a;)e.d.push(+t.slice(r,r+=yt));t=t.slice(r),r=yt-t.length}else r-=a;for(;r--;)t+="0";if(e.d.push(+t),St&&(e.e>Lh||e.e<-Lh))throw Error(e0+n)}else e.s=0,e.e=0,e.d=[0];return e}function ut(e,t,n){var r,a,s,o,l,c,u,d,f=e.d;for(o=1,s=f[0];s>=10;s/=10)o++;if(r=t-o,r<0)r+=yt,a=t,u=f[d=0];else{if(d=Math.ceil((r+1)/yt),s=f.length,d>=s)return e;for(u=s=f[d],o=1;s>=10;s/=10)o++;r%=yt,a=r-yt+o}if(n!==void 0&&(s=cs(10,o-a-1),l=u/s%10|0,c=t<0||f[d+1]!==void 0||u%s,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?a>0?u/cs(10,o-a):0:f[d-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(s=Bt(e),f.length=1,t=t-s-1,f[0]=cs(10,(yt-t%yt)%yt),e.e=$l(-t/yt)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=d,s=1,d--):(f.length=d+1,s=cs(10,yt-r),f[d]=a>0?(u/cs(10,o-a)%cs(10,a)|0)*s:0),c)for(;;)if(d==0){(f[0]+=s)==Qt&&(f[0]=1,++e.e);break}else{if(f[d]+=s,f[d]!=Qt)break;f[d--]=0,s=1}for(r=f.length;f[--r]===0;)f.pop();if(St&&(e.e>Lh||e.e<-Lh))throw Error(e0+Bt(e));return e}function HP(e,t){var n,r,a,s,o,l,c,u,d,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),St?ut(t,p):t;if(c=e.d,f=t.d,r=t.e,u=e.e,c=c.slice(),o=u-r,o){for(d=o<0,d?(n=c,o=-o,l=f.length):(n=f,r=u,l=c.length),a=Math.max(Math.ceil(p/yt),l)+2,o>a&&(o=a,n.length=1),n.reverse(),a=o;a--;)n.push(0);n.reverse()}else{for(a=c.length,l=f.length,d=a<l,d&&(l=a),a=0;a<l;a++)if(c[a]!=f[a]){d=c[a]<f[a];break}o=0}for(d&&(n=c,c=f,f=n,t.s=-t.s),l=c.length,a=f.length-l;a>0;--a)c[l++]=0;for(a=f.length;a>o;){if(c[--a]<f[a]){for(s=a;s&&c[--s]===0;)c[s]=Qt-1;--c[s],c[a]+=Qt}c[a]-=f[a]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,St?ut(t,p):t):new h(0)}function Ls(e,t,n){var r,a=Bt(e),s=ca(e.d),o=s.length;return t?(n&&(r=n-o)>0?s=s.charAt(0)+"."+s.slice(1)+oi(r):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(a<0?"e":"e+")+a):a<0?(s="0."+oi(-a-1)+s,n&&(r=n-o)>0&&(s+=oi(r))):a>=o?(s+=oi(a+1-o),n&&(r=n-a-1)>0&&(s=s+"."+oi(r))):((r=a+1)<o&&(s=s.slice(0,r)+"."+s.slice(r)),n&&(r=n-o)>0&&(a+1===o&&(s+="."),s+=oi(r))),e.s<0?"-"+s:s}function k1(e,t){if(e.length>t)return e.length=t,!0}function GP(e){var t,n,r;function a(s){var o=this;if(!(o instanceof a))return new a(s);if(o.constructor=a,s instanceof a){o.s=s.s,o.e=s.e,o.d=(s=s.d)?s.slice():s;return}if(typeof s=="number"){if(s*0!==0)throw Error(Es+s);if(s>0)o.s=1;else if(s<0)s=-s,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(s===~~s&&s<1e7){o.e=0,o.d=[s];return}return w1(o,s.toString())}else if(typeof s!="string")throw Error(Es+s);if(s.charCodeAt(0)===45?(s=s.slice(1),o.s=-1):o.s=1,kX.test(s))w1(o,s);else throw Error(Es+s)}if(a.prototype=be,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=GP,a.config=a.set=SX,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 a.config(e),a}function SX(e){if(!e||typeof e!="object")throw Error(jr+"Object expected");var t,n,r,a=["precision",1,Il,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<a.length;t+=3)if((r=e[n=a[t]])!==void 0)if($l(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(Es+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Es+n+": "+r);return this}var t0=GP(wX);Jn=new t0(1);const ot=t0;function jX(e){return CX(e)||_X(e)||EX(e)||NX()}function NX(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
87
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function EX(e,t){if(e){if(typeof e=="string")return nb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nb(e,t)}}function _X(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function CX(e){if(Array.isArray(e))return nb(e)}function nb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var AX=function(t){return t},qP={},KP=function(t){return t===qP},S1=function(t){return function n(){return arguments.length===0||arguments.length===1&&KP(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},TX=function e(t,n){return t===1?n:S1(function(){for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];var o=a.filter(function(l){return l!==qP}).length;return o>=t?n.apply(void 0,a):e(t-o,S1(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=a.map(function(f){return KP(f)?c.shift():f});return n.apply(void 0,jX(d).concat(c))}))})},vm=function(t){return TX(t.length,t)},rb=function(t,n){for(var r=[],a=t;a<n;++a)r[a-t]=a;return r},OX=vm(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),PX=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return AX;var a=n.reverse(),s=a[0],o=a.slice(1);return function(){return o.reduce(function(l,c){return c(l)},s.apply(void 0,arguments))}},ab=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},VP=function(t){var n=null,r=null;return function(){for(var a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];return n&&s.every(function(l,c){return l===n[c]})||(n=s,r=t.apply(void 0,s)),r}};function RX(e){var t;return e===0?t=1:t=Math.floor(new ot(e).abs().log(10).toNumber())+1,t}function MX(e,t,n){for(var r=new ot(e),a=0,s=[];r.lt(t)&&a<1e5;)s.push(r.toNumber()),r=r.add(n),a++;return s}var IX=vm(function(e,t,n){var r=+e,a=+t;return r+n*(a-r)}),$X=vm(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),LX=vm(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const ym={rangeStep:MX,getDigitCount:RX,interpolateNumber:IX,uninterpolateNumber:$X,uninterpolateTruncation:LX};function ib(e){return zX(e)||BX(e)||YP(e)||DX()}function DX(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
88
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BX(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function zX(e){if(Array.isArray(e))return sb(e)}function Eu(e,t){return WX(e)||UX(e,t)||YP(e,t)||FX()}function FX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
89
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function YP(e,t){if(e){if(typeof e=="string")return sb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sb(e,t)}}function sb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function UX(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,a=!1,s=void 0;try{for(var o=e[Symbol.iterator](),l;!(r=(l=o.next()).done)&&(n.push(l.value),!(t&&n.length===t));r=!0);}catch(c){a=!0,s=c}finally{try{!r&&o.return!=null&&o.return()}finally{if(a)throw s}}return n}}function WX(e){if(Array.isArray(e))return e}function XP(e){var t=Eu(e,2),n=t[0],r=t[1],a=n,s=r;return n>r&&(a=r,s=n),[a,s]}function QP(e,t,n){if(e.lte(0))return new ot(0);var r=ym.getDigitCount(e.toNumber()),a=new ot(10).pow(r),s=e.div(a),o=r!==1?.05:.1,l=new ot(Math.ceil(s.div(o).toNumber())).add(n).mul(o),c=l.mul(a);return t?c:new ot(Math.ceil(c))}function HX(e,t,n){var r=1,a=new ot(e);if(!a.isint()&&n){var s=Math.abs(e);s<1?(r=new ot(10).pow(ym.getDigitCount(e)-1),a=new ot(Math.floor(a.div(r).toNumber())).mul(r)):s>1&&(a=new ot(Math.floor(e)))}else e===0?a=new ot(Math.floor((t-1)/2)):n||(a=new ot(Math.floor(e)));var o=Math.floor((t-1)/2),l=PX(OX(function(c){return a.add(new ot(c-o).mul(r)).toNumber()}),rb);return l(0,t)}function ZP(e,t,n,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new ot(0),tickMin:new ot(0),tickMax:new ot(0)};var s=QP(new ot(t).sub(e).div(n-1),r,a),o;e<=0&&t>=0?o=new ot(0):(o=new ot(e).add(t).div(2),o=o.sub(new ot(o).mod(s)));var l=Math.ceil(o.sub(e).div(s).toNumber()),c=Math.ceil(new ot(t).sub(o).div(s).toNumber()),u=l+c+1;return u>n?ZP(e,t,n,r,a+1):(u<n&&(c=t>0?c+(n-u):c,l=t>0?l:l+(n-u)),{step:s,tickMin:o.sub(new ot(l).mul(s)),tickMax:o.add(new ot(c).mul(s))})}function GX(e){var t=Eu(e,2),n=t[0],r=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(a,2),l=XP([n,r]),c=Eu(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(ib(rb(0,a-1).map(function(){return 1/0}))):[].concat(ib(rb(0,a-1).map(function(){return-1/0})),[d]);return n>r?ab(f):f}if(u===d)return HX(u,a,s);var h=ZP(u,d,o,s),p=h.step,m=h.tickMin,g=h.tickMax,y=ym.rangeStep(m,g.add(new ot(.1).mul(p)),p);return n>r?ab(y):y}function qX(e,t){var n=Eu(e,2),r=n[0],a=n[1],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=XP([r,a]),l=Eu(o,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[r,a];if(c===u)return[c];var d=Math.max(t,2),f=QP(new ot(u).sub(c).div(d-1),s,0),h=[].concat(ib(ym.rangeStep(new ot(c),new ot(u).sub(new ot(.99).mul(f)),f)),[u]);return r>a?ab(h):h}var KX=VP(GX),VX=VP(qX),YX="Invariant failed";function Ds(e,t){throw new Error(YX)}var XX=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function sl(e){"@babel/helpers - typeof";return sl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sl(e)}function Dh(){return Dh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dh.apply(this,arguments)}function QX(e,t){return tQ(e)||eQ(e,t)||JX(e,t)||ZX()}function ZX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
90
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JX(e,t){if(e){if(typeof e=="string")return j1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return j1(e,t)}}function j1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function eQ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function tQ(e){if(Array.isArray(e))return e}function nQ(e,t){if(e==null)return{};var n=rQ(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function rQ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function aQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iQ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,tR(r.key),r)}}function sQ(e,t,n){return t&&iQ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function oQ(e,t,n){return t=Bh(t),lQ(e,JP()?Reflect.construct(t,n||[],Bh(e).constructor):t.apply(e,n))}function lQ(e,t){if(t&&(sl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cQ(e)}function cQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function JP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(JP=function(){return!!e})()}function Bh(e){return Bh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Bh(e)}function uQ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ob(e,t)}function ob(e,t){return ob=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},ob(e,t)}function eR(e,t,n){return t=tR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tR(e){var t=dQ(e,"string");return sl(t)=="symbol"?t:t+""}function dQ(e,t){if(sl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(sl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var bm=function(e){function t(){return aQ(this,t),oQ(this,t,arguments)}return uQ(t,e),sQ(t,[{key:"render",value:function(){var r=this.props,a=r.offset,s=r.layout,o=r.width,l=r.dataKey,c=r.data,u=r.dataPointFormatter,d=r.xAxis,f=r.yAxis,h=nQ(r,XX),p=Ve(h,!1);this.props.direction==="x"&&d.type!=="number"&&Ds();var m=c.map(function(g){var y=u(g,l),v=y.x,k=y.y,w=y.value,j=y.errorVal;if(!j)return null;var S=[],x,N;if(Array.isArray(j)){var E=QX(j,2);x=E[0],N=E[1]}else x=N=j;if(s==="vertical"){var P=d.scale,_=k+a,R=_+o,T=_-o,B=P(w-x),$=P(w+N);S.push({x1:$,y1:R,x2:$,y2:T}),S.push({x1:B,y1:_,x2:$,y2:_}),S.push({x1:B,y1:R,x2:B,y2:T})}else if(s==="horizontal"){var I=f.scale,D=v+a,U=D-o,M=D+o,z=I(w-x),O=I(w+N);S.push({x1:U,y1:O,x2:M,y2:O}),S.push({x1:D,y1:z,x2:D,y2:O}),S.push({x1:U,y1:z,x2:M,y2:z})}return X.createElement(en,Dh({className:"recharts-errorBar",key:"bar-".concat(S.map(function(J){return"".concat(J.x1,"-").concat(J.x2,"-").concat(J.y1,"-").concat(J.y2)}))},p),S.map(function(J){return X.createElement("line",Dh({},J,{key:"line-".concat(J.x1,"-").concat(J.x2,"-").concat(J.y1,"-").concat(J.y2)}))}))});return X.createElement(en,{className:"recharts-errorBars"},m)}}])}(X.Component);eR(bm,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});eR(bm,"displayName","ErrorBar");function _u(e){"@babel/helpers - typeof";return _u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_u(e)}function N1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ts(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?N1(Object(n),!0).forEach(function(r){fQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fQ(e,t,n){return t=hQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hQ(e){var t=pQ(e,"string");return _u(t)=="symbol"?t:t+""}function pQ(e,t){if(_u(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(_u(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var nR=function(t){var n=t.children,r=t.formattedGraphicalItems,a=t.legendWidth,s=t.legendContent,o=Zn(n,js);if(!o)return null;var l=js.defaultProps,c=l!==void 0?ts(ts({},l),o.props):{},u;return o.props&&o.props.payload?u=o.props&&o.props.payload:s==="children"?u=(r||[]).reduce(function(d,f){var h=f.item,p=f.props,m=p.sectors||p.data||[];return d.concat(m.map(function(g){return{type:o.props.iconType||h.props.legendType,value:g.name,color:g.fill,payload:g}}))},[]):u=(r||[]).map(function(d){var f=d.item,h=f.type.defaultProps,p=h!==void 0?ts(ts({},h),f.props):{},m=p.dataKey,g=p.name,y=p.legendType,v=p.hide;return{inactive:v,dataKey:m,type:c.iconType||y||"square",color:n0(f),value:g||m,payload:p}}),ts(ts(ts({},c),js.getWithHeight(o,a)),{},{payload:u,item:o})};function Cu(e){"@babel/helpers - typeof";return Cu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cu(e)}function E1(e){return yQ(e)||vQ(e)||gQ(e)||mQ()}function mQ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
91
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gQ(e,t){if(e){if(typeof e=="string")return lb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lb(e,t)}}function vQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function yQ(e){if(Array.isArray(e))return lb(e)}function lb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Pt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_1(Object(n),!0).forEach(function(r){Uo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Uo(e,t,n){return t=bQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bQ(e){var t=xQ(e,"string");return Cu(t)=="symbol"?t:t+""}function xQ(e,t){if(Cu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Cu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ma(e,t,n){return Xe(e)||Xe(t)?n:Kt(t)?wr(e,t,n):Be(t)?t(e):n}function zc(e,t,n,r){var a=vX(e,function(l){return ma(l,t)});if(n==="number"){var s=a.filter(function(l){return de(l)||parseFloat(l)});return s.length?[gm(s),mm(s)]:[1/0,-1/0]}var o=r?a.filter(function(l){return!Xe(l)}):a;return o.map(function(l){return Kt(l)||l instanceof Date?l:""})}var wQ=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,o=-1,l=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(l<=1)return 0;if(s&&s.axisType==="angleAxis"&&Math.abs(Math.abs(s.range[1]-s.range[0])-360)<=1e-6)for(var c=s.range,u=0;u<l;u++){var d=u>0?a[u-1].coordinate:a[l-1].coordinate,f=a[u].coordinate,h=u>=l-1?a[0].coordinate:a[u+1].coordinate,p=void 0;if(Dr(f-d)!==Dr(h-f)){var m=[];if(Dr(h-f)===Dr(c[1]-c[0])){p=h;var g=f+c[1]-c[0];m[0]=Math.min(g,(g+d)/2),m[1]=Math.max(g,(g+d)/2)}else{p=d;var y=h+c[1]-c[0];m[0]=Math.min(f,(y+f)/2),m[1]=Math.max(f,(y+f)/2)}var v=[Math.min(f,(p+f)/2),Math.max(f,(p+f)/2)];if(t>v[0]&&t<=v[1]||t>=m[0]&&t<=m[1]){o=a[u].index;break}}else{var k=Math.min(d,h),w=Math.max(d,h);if(t>(k+f)/2&&t<=(w+f)/2){o=a[u].index;break}}}else for(var j=0;j<l;j++)if(j===0&&t<=(r[j].coordinate+r[j+1].coordinate)/2||j>0&&j<l-1&&t>(r[j].coordinate+r[j-1].coordinate)/2&&t<=(r[j].coordinate+r[j+1].coordinate)/2||j===l-1&&t>(r[j].coordinate+r[j-1].coordinate)/2){o=r[j].index;break}return o},n0=function(t){var n,r=t,a=r.type.displayName,s=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Pt(Pt({},t.type.defaultProps),t.props):t.props,o=s.stroke,l=s.fill,c;switch(a){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},kQ=function(t){var n=t.barSize,r=t.totalSize,a=t.stackGroups,s=a===void 0?{}:a;if(!s)return{};for(var o={},l=Object.keys(s),c=0,u=l.length;c<u;c++)for(var d=s[l[c]].stackGroups,f=Object.keys(d),h=0,p=f.length;h<p;h++){var m=d[f[h]],g=m.items,y=m.cateAxisId,v=g.filter(function(N){return Ia(N.type).indexOf("Bar")>=0});if(v&&v.length){var k=v[0].type.defaultProps,w=k!==void 0?Pt(Pt({},k),v[0].props):v[0].props,j=w.barSize,S=w[y];o[S]||(o[S]=[]);var x=Xe(j)?n:j;o[S].push({item:v[0],stackList:v.slice(1),barSize:Xe(x)?void 0:$s(x,r,0)})}}return o},SQ=function(t){var n=t.barGap,r=t.barCategoryGap,a=t.bandSize,s=t.sizeList,o=s===void 0?[]:s,l=t.maxBarSize,c=o.length;if(c<1)return null;var u=$s(n,a,0,!0),d,f=[];if(o[0].barSize===+o[0].barSize){var h=!1,p=a/c,m=o.reduce(function(j,S){return j+S.barSize||0},0);m+=(c-1)*u,m>=a&&(m-=(c-1)*u,u=0),m>=a&&p>0&&(h=!0,p*=.9,m=c*p);var g=(a-m)/2>>0,y={offset:g-u,size:0};d=o.reduce(function(j,S){var x={item:S.item,position:{offset:y.offset+y.size+u,size:h?p:S.barSize}},N=[].concat(E1(j),[x]);return y=N[N.length-1].position,S.stackList&&S.stackList.length&&S.stackList.forEach(function(E){N.push({item:E,position:y})}),N},f)}else{var v=$s(r,a,0,!0);a-2*v-(c-1)*u<=0&&(u=0);var k=(a-2*v-(c-1)*u)/c;k>1&&(k>>=0);var w=l===+l?Math.min(k,l):k;d=o.reduce(function(j,S,x){var N=[].concat(E1(j),[{item:S.item,position:{offset:v+(k+u)*x+(k-w)/2,size:w}}]);return S.stackList&&S.stackList.length&&S.stackList.forEach(function(E){N.push({item:E,position:N[N.length-1].position})}),N},f)}return d},jQ=function(t,n,r,a){var s=r.children,o=r.width,l=r.margin,c=o-(l.left||0)-(l.right||0),u=nR({children:s,legendWidth:c});if(u){var d=a||{},f=d.width,h=d.height,p=u.align,m=u.verticalAlign,g=u.layout;if((g==="vertical"||g==="horizontal"&&m==="middle")&&p!=="center"&&de(t[p]))return Pt(Pt({},t),{},Uo({},p,t[p]+(f||0)));if((g==="horizontal"||g==="vertical"&&p==="center")&&m!=="middle"&&de(t[m]))return Pt(Pt({},t),{},Uo({},m,t[m]+(h||0)))}return t},NQ=function(t,n,r){return Xe(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},rR=function(t,n,r,a,s){var o=n.props.children,l=Fr(o,bm).filter(function(u){return NQ(a,s,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,d){var f=ma(d,r);if(Xe(f))return u;var h=Array.isArray(f)?[gm(f),mm(f)]:[f,f],p=c.reduce(function(m,g){var y=ma(d,g,0),v=h[0]-Math.abs(Array.isArray(y)?y[0]:y),k=h[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(v,m[0]),Math.max(k,m[1])]},[1/0,-1/0]);return[Math.min(p[0],u[0]),Math.max(p[1],u[1])]},[1/0,-1/0])}return null},EQ=function(t,n,r,a,s){var o=n.map(function(l){return rR(t,l,r,s,a)}).filter(function(l){return!Xe(l)});return o&&o.length?o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},aR=function(t,n,r,a,s){var o=n.map(function(c){var u=c.props.dataKey;return r==="number"&&u&&rR(t,c,u,a)||zc(t,u,r,s)});if(r==="number")return o.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,u){for(var d=0,f=u.length;d<f;d++)l[u[d]]||(l[u[d]]=!0,c.push(u[d]));return c},[])},iR=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},sR=function(t,n,r,a){if(a)return t.map(function(c){return c.coordinate});var s,o,l=t.map(function(c){return c.coordinate===n&&(s=!0),c.coordinate===r&&(o=!0),c.coordinate});return s||l.push(n),o||l.push(r),l},Ra=function(t,n,r){if(!t)return null;var a=t.scale,s=t.duplicateDomain,o=t.type,l=t.range,c=t.realScaleType==="scaleBand"?a.bandwidth()/2:2,u=(n||r)&&o==="category"&&a.bandwidth?a.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?Dr(l[0]-l[1])*2*u:u,n&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(f){var h=s?s.indexOf(f):f;return{coordinate:a(h)+u,value:f,offset:u}});return d.filter(function(f){return!ad(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,h){return{coordinate:a(f)+u,value:f,index:h,offset:u}}):a.ticks&&!r?a.ticks(t.tickCount).map(function(f){return{coordinate:a(f)+u,value:f,offset:u}}):a.domain().map(function(f,h){return{coordinate:a(f)+u,value:s?s[f]:f,index:h,offset:u}})},Pg=new WeakMap,Jd=function(t,n){if(typeof n!="function")return t;Pg.has(t)||Pg.set(t,new WeakMap);var r=Pg.get(t);if(r.has(n))return r.get(n);var a=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,a),a},_Q=function(t,n,r){var a=t.scale,s=t.type,o=t.layout,l=t.axisType;if(a==="auto")return o==="radial"&&l==="radiusAxis"?{scale:xu(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:Rh(),realScaleType:"linear"}:s==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:Bc(),realScaleType:"point"}:s==="category"?{scale:xu(),realScaleType:"band"}:{scale:Rh(),realScaleType:"linear"};if(Is(a)){var c="scale".concat(nm(a));return{scale:(x1[c]||Bc)(),realScaleType:x1[c]?c:"point"}}return Be(a)?{scale:a}:{scale:Bc(),realScaleType:"point"}},C1=1e-4,CQ=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,a=t.range(),s=Math.min(a[0],a[1])-C1,o=Math.max(a[0],a[1])+C1,l=t(n[0]),c=t(n[r-1]);(l<s||l>o||c<s||c>o)&&t.domain([n[0],n[r-1]])}},AQ=function(t,n){if(!t)return null;for(var r=0,a=t.length;r<a;r++)if(t[r].item===n)return t[r].position;return null},TQ=function(t,n){if(!n||n.length!==2||!de(n[0])||!de(n[1]))return t;var r=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]),s=[t[0],t[1]];return(!de(t[0])||t[0]<r)&&(s[0]=r),(!de(t[1])||t[1]>a)&&(s[1]=a),s[0]>a&&(s[0]=a),s[1]<r&&(s[1]=r),s},OQ=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r<a;++r)for(var s=0,o=0,l=0;l<n;++l){var c=ad(t[l][r][1])?t[l][r][0]:t[l][r][1];c>=0?(t[l][r][0]=s,t[l][r][1]=s+c,s=t[l][r][1]):(t[l][r][0]=o,t[l][r][1]=o+c,o=t[l][r][1])}},PQ=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r<a;++r)for(var s=0,o=0;o<n;++o){var l=ad(t[o][r][1])?t[o][r][0]:t[o][r][1];l>=0?(t[o][r][0]=s,t[o][r][1]=s+l,s=t[o][r][1]):(t[o][r][0]=0,t[o][r][1]=0)}},RQ={sign:OQ,expand:V4,none:Zo,silhouette:Y4,wiggle:X4,positive:PQ},MQ=function(t,n,r){var a=n.map(function(l){return l.props.dataKey}),s=RQ[r],o=K4().keys(a).value(function(l,c){return+ma(l,c,0)}).order(Ry).offset(s);return o(t)},IQ=function(t,n,r,a,s,o){if(!t)return null;var l=o?n.reverse():n,c={},u=l.reduce(function(f,h){var p,m=(p=h.type)!==null&&p!==void 0&&p.defaultProps?Pt(Pt({},h.type.defaultProps),h.props):h.props,g=m.stackId,y=m.hide;if(y)return f;var v=m[r],k=f[v]||{hasStack:!1,stackGroups:{}};if(Kt(g)){var w=k.stackGroups[g]||{numericAxisId:r,cateAxisId:a,items:[]};w.items.push(h),k.hasStack=!0,k.stackGroups[g]=w}else k.stackGroups[tm("_stackId_")]={numericAxisId:r,cateAxisId:a,items:[h]};return Pt(Pt({},f),{},Uo({},v,k))},c),d={};return Object.keys(u).reduce(function(f,h){var p=u[h];if(p.hasStack){var m={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(g,y){var v=p.stackGroups[y];return Pt(Pt({},g),{},Uo({},y,{numericAxisId:r,cateAxisId:a,items:v.items,stackedData:MQ(t,v.items,s)}))},m)}return Pt(Pt({},f),{},Uo({},h,p))},d)},$Q=function(t,n){var r=n.realScaleType,a=n.type,s=n.tickCount,o=n.originalDomain,l=n.allowDecimals,c=r||n.scale;if(c!=="auto"&&c!=="linear")return null;if(s&&a==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=KX(u,s,l);return t.domain([gm(d),mm(d)]),{niceTicks:d}}if(s&&a==="number"){var f=t.domain(),h=VX(f,s,l);return{niceTicks:h}}return null},A1=function(t){var n=t.axis,r=t.ticks,a=t.offset,s=t.bandSize,o=t.entry,l=t.index;if(n.type==="category")return r[l]?r[l].coordinate+a:null;var c=ma(o,n.dataKey,n.domain[l]);return Xe(c)?null:n.scale(c)-s/2+a},LQ=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var a=Math.min(r[0],r[1]),s=Math.max(r[0],r[1]);return a<=0&&s>=0?0:s<0?s:a}return r[0]},DQ=function(t,n){var r,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Pt(Pt({},t.type.defaultProps),t.props):t.props,s=a.stackId;if(Kt(s)){var o=n[s];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},BQ=function(t){return t.reduce(function(n,r){return[gm(r.concat([n[0]]).filter(de)),mm(r.concat([n[1]]).filter(de))]},[1/0,-1/0])},oR=function(t,n,r){return Object.keys(t).reduce(function(a,s){var o=t[s],l=o.stackedData,c=l.reduce(function(u,d){var f=BQ(d.slice(n,r+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(c[0],a[0]),Math.max(c[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},T1=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,O1=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,cb=function(t,n,r){if(Be(t))return t(n,r);if(!Array.isArray(t))return n;var a=[];if(de(t[0]))a[0]=r?t[0]:Math.min(t[0],n[0]);else if(T1.test(t[0])){var s=+T1.exec(t[0])[1];a[0]=n[0]-s}else Be(t[0])?a[0]=t[0](n[0]):a[0]=n[0];if(de(t[1]))a[1]=r?t[1]:Math.max(t[1],n[1]);else if(O1.test(t[1])){var o=+O1.exec(t[1])[1];a[1]=n[1]+o}else Be(t[1])?a[1]=t[1](n[1]):a[1]=n[1];return a},zh=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!r||a>0)return a}if(t&&n&&n.length>=2){for(var s=Aw(n,function(f){return f.coordinate}),o=1/0,l=1,c=s.length;l<c;l++){var u=s[l],d=s[l-1];o=Math.min((u.coordinate||0)-(d.coordinate||0),o)}return o===1/0?0:o}return r?void 0:0},P1=function(t,n,r){return!t||!t.length||Jw(t,wr(r,"type.defaultProps.domain"))?n:t},lR=function(t,n){var r=t.type.defaultProps?Pt(Pt({},t.type.defaultProps),t.props):t.props,a=r.dataKey,s=r.name,o=r.unit,l=r.formatter,c=r.tooltipType,u=r.chartType,d=r.hide;return Pt(Pt({},Ve(t,!1)),{},{dataKey:a,unit:o,formatter:l,name:s||a,color:n0(t),value:ma(n,a),type:c,payload:n,chartType:u,hide:d})};function Au(e){"@babel/helpers - typeof";return Au=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Au(e)}function R1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function M1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?R1(Object(n),!0).forEach(function(r){zQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zQ(e,t,n){return t=FQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FQ(e){var t=UQ(e,"string");return Au(t)=="symbol"?t:t+""}function UQ(e,t){if(Au(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Au(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Fh=Math.PI/180,WQ=function(t){return t*180/Math.PI},dn=function(t,n,r,a){return{x:t+Math.cos(-Fh*a)*r,y:n+Math.sin(-Fh*a)*r}},HQ=function(t,n){var r=t.x,a=t.y,s=n.x,o=n.y;return Math.sqrt(Math.pow(r-s,2)+Math.pow(a-o,2))},GQ=function(t,n){var r=t.x,a=t.y,s=n.cx,o=n.cy,l=HQ({x:r,y:a},{x:s,y:o});if(l<=0)return{radius:l};var c=(r-s)/l,u=Math.acos(c);return a>o&&(u=2*Math.PI-u),{radius:l,angle:WQ(u),angleInRadian:u}},qQ=function(t){var n=t.startAngle,r=t.endAngle,a=Math.floor(n/360),s=Math.floor(r/360),o=Math.min(a,s);return{startAngle:n-o*360,endAngle:r-o*360}},KQ=function(t,n){var r=n.startAngle,a=n.endAngle,s=Math.floor(r/360),o=Math.floor(a/360),l=Math.min(s,o);return t+l*360},I1=function(t,n){var r=t.x,a=t.y,s=GQ({x:r,y:a},n),o=s.radius,l=s.angle,c=n.innerRadius,u=n.outerRadius;if(o<c||o>u)return!1;if(o===0)return!0;var d=qQ(n),f=d.startAngle,h=d.endAngle,p=l,m;if(f<=h){for(;p>h;)p-=360;for(;p<f;)p+=360;m=p>=f&&p<=h}else{for(;p>f;)p-=360;for(;p<h;)p+=360;m=p>=h&&p<=f}return m?M1(M1({},n),{},{radius:o,angle:KQ(p,n)}):null};function Tu(e){"@babel/helpers - typeof";return Tu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tu(e)}var VQ=["offset"];function YQ(e){return JQ(e)||ZQ(e)||QQ(e)||XQ()}function XQ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
92
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QQ(e,t){if(e){if(typeof e=="string")return ub(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ub(e,t)}}function ZQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function JQ(e){if(Array.isArray(e))return ub(e)}function ub(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function eZ(e,t){if(e==null)return{};var n=tZ(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tZ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function $1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ht(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$1(Object(n),!0).forEach(function(r){nZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nZ(e,t,n){return t=rZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rZ(e){var t=aZ(e,"string");return Tu(t)=="symbol"?t:t+""}function aZ(e,t){if(Tu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Tu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ou(){return Ou=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ou.apply(this,arguments)}var iZ=function(t){var n=t.value,r=t.formatter,a=Xe(t.children)?n:t.children;return Be(r)?r(a):a},sZ=function(t,n){var r=Dr(n-t),a=Math.min(Math.abs(n-t),360);return r*a},oZ=function(t,n,r){var a=t.position,s=t.viewBox,o=t.offset,l=t.className,c=s,u=c.cx,d=c.cy,f=c.innerRadius,h=c.outerRadius,p=c.startAngle,m=c.endAngle,g=c.clockWise,y=(f+h)/2,v=sZ(p,m),k=v>=0?1:-1,w,j;a==="insideStart"?(w=p+k*o,j=g):a==="insideEnd"?(w=m-k*o,j=!g):a==="end"&&(w=m+k*o,j=g),j=v<=0?j:!j;var S=dn(u,d,y,w),x=dn(u,d,y,w+(j?1:-1)*359),N="M".concat(S.x,",").concat(S.y,`
93
+ A`).concat(y,",").concat(y,",0,1,").concat(j?0:1,`,
94
+ `).concat(x.x,",").concat(x.y),E=Xe(t.id)?tm("recharts-radial-line-"):t.id;return X.createElement("text",Ou({},r,{dominantBaseline:"central",className:Ye("recharts-radial-bar-label",l)}),X.createElement("defs",null,X.createElement("path",{id:E,d:N})),X.createElement("textPath",{xlinkHref:"#".concat(E)},n))},lZ=function(t){var n=t.viewBox,r=t.offset,a=t.position,s=n,o=s.cx,l=s.cy,c=s.innerRadius,u=s.outerRadius,d=s.startAngle,f=s.endAngle,h=(d+f)/2;if(a==="outside"){var p=dn(o,l,u+r,h),m=p.x,g=p.y;return{x:m,y:g,textAnchor:m>=o?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var y=(c+u)/2,v=dn(o,l,y,h),k=v.x,w=v.y;return{x:k,y:w,textAnchor:"middle",verticalAnchor:"middle"}},cZ=function(t){var n=t.viewBox,r=t.parentViewBox,a=t.offset,s=t.position,o=n,l=o.x,c=o.y,u=o.width,d=o.height,f=d>=0?1:-1,h=f*a,p=f>0?"end":"start",m=f>0?"start":"end",g=u>=0?1:-1,y=g*a,v=g>0?"end":"start",k=g>0?"start":"end";if(s==="top"){var w={x:l+u/2,y:c-f*a,textAnchor:"middle",verticalAnchor:p};return Ht(Ht({},w),r?{height:Math.max(c-r.y,0),width:u}:{})}if(s==="bottom"){var j={x:l+u/2,y:c+d+h,textAnchor:"middle",verticalAnchor:m};return Ht(Ht({},j),r?{height:Math.max(r.y+r.height-(c+d),0),width:u}:{})}if(s==="left"){var S={x:l-y,y:c+d/2,textAnchor:v,verticalAnchor:"middle"};return Ht(Ht({},S),r?{width:Math.max(S.x-r.x,0),height:d}:{})}if(s==="right"){var x={x:l+u+y,y:c+d/2,textAnchor:k,verticalAnchor:"middle"};return Ht(Ht({},x),r?{width:Math.max(r.x+r.width-x.x,0),height:d}:{})}var N=r?{width:u,height:d}:{};return s==="insideLeft"?Ht({x:l+y,y:c+d/2,textAnchor:k,verticalAnchor:"middle"},N):s==="insideRight"?Ht({x:l+u-y,y:c+d/2,textAnchor:v,verticalAnchor:"middle"},N):s==="insideTop"?Ht({x:l+u/2,y:c+h,textAnchor:"middle",verticalAnchor:m},N):s==="insideBottom"?Ht({x:l+u/2,y:c+d-h,textAnchor:"middle",verticalAnchor:p},N):s==="insideTopLeft"?Ht({x:l+y,y:c+h,textAnchor:k,verticalAnchor:m},N):s==="insideTopRight"?Ht({x:l+u-y,y:c+h,textAnchor:v,verticalAnchor:m},N):s==="insideBottomLeft"?Ht({x:l+y,y:c+d-h,textAnchor:k,verticalAnchor:p},N):s==="insideBottomRight"?Ht({x:l+u-y,y:c+d-h,textAnchor:v,verticalAnchor:p},N):_l(s)&&(de(s.x)||vs(s.x))&&(de(s.y)||vs(s.y))?Ht({x:l+$s(s.x,u),y:c+$s(s.y,d),textAnchor:"end",verticalAnchor:"end"},N):Ht({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},N)},uZ=function(t){return"cx"in t&&de(t.cx)};function wn(e){var t=e.offset,n=t===void 0?5:t,r=eZ(e,VQ),a=Ht({offset:n},r),s=a.viewBox,o=a.position,l=a.value,c=a.children,u=a.content,d=a.className,f=d===void 0?"":d,h=a.textBreakAll;if(!s||Xe(l)&&Xe(c)&&!b.isValidElement(u)&&!Be(u))return null;if(b.isValidElement(u))return b.cloneElement(u,a);var p;if(Be(u)){if(p=b.createElement(u,a),b.isValidElement(p))return p}else p=iZ(a);var m=uZ(s),g=Ve(a,!0);if(m&&(o==="insideStart"||o==="insideEnd"||o==="end"))return oZ(a,p,g);var y=m?lZ(a):cZ(a);return X.createElement(Nh,Ou({className:Ye("recharts-label",f)},g,y,{breakAll:h}),p)}wn.displayName="Label";var cR=function(t){var n=t.cx,r=t.cy,a=t.angle,s=t.startAngle,o=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,d=t.outerRadius,f=t.x,h=t.y,p=t.top,m=t.left,g=t.width,y=t.height,v=t.clockWise,k=t.labelViewBox;if(k)return k;if(de(g)&&de(y)){if(de(f)&&de(h))return{x:f,y:h,width:g,height:y};if(de(p)&&de(m))return{x:p,y:m,width:g,height:y}}return de(f)&&de(h)?{x:f,y:h,width:0,height:0}:de(n)&&de(r)?{cx:n,cy:r,startAngle:s||a||0,endAngle:o||a||0,innerRadius:u||0,outerRadius:d||c||l||0,clockWise:v}:t.viewBox?t.viewBox:{}},dZ=function(t,n){return t?t===!0?X.createElement(wn,{key:"label-implicit",viewBox:n}):Kt(t)?X.createElement(wn,{key:"label-implicit",viewBox:n,value:t}):b.isValidElement(t)?t.type===wn?b.cloneElement(t,{key:"label-implicit",viewBox:n}):X.createElement(wn,{key:"label-implicit",content:t,viewBox:n}):Be(t)?X.createElement(wn,{key:"label-implicit",content:t,viewBox:n}):_l(t)?X.createElement(wn,Ou({viewBox:n},t,{key:"label-implicit"})):null:null},fZ=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var a=t.children,s=cR(t),o=Fr(a,wn).map(function(c,u){return b.cloneElement(c,{viewBox:n||s,key:"label-".concat(u)})});if(!r)return o;var l=dZ(t.label,n||s);return[l].concat(YQ(o))};wn.parseViewBox=cR;wn.renderCallByParent=fZ;function hZ(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var pZ=hZ;const mZ=Je(pZ);function Pu(e){"@babel/helpers - typeof";return Pu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pu(e)}var gZ=["valueAccessor"],vZ=["data","dataKey","clockWise","id","textBreakAll"];function yZ(e){return kZ(e)||wZ(e)||xZ(e)||bZ()}function bZ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
95
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xZ(e,t){if(e){if(typeof e=="string")return db(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return db(e,t)}}function wZ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kZ(e){if(Array.isArray(e))return db(e)}function db(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Uh(){return Uh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Uh.apply(this,arguments)}function L1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function D1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?L1(Object(n),!0).forEach(function(r){SZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function SZ(e,t,n){return t=jZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jZ(e){var t=NZ(e,"string");return Pu(t)=="symbol"?t:t+""}function NZ(e,t){if(Pu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Pu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function B1(e,t){if(e==null)return{};var n=EZ(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function EZ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var _Z=function(t){return Array.isArray(t.value)?mZ(t.value):t.value};function _s(e){var t=e.valueAccessor,n=t===void 0?_Z:t,r=B1(e,gZ),a=r.data,s=r.dataKey,o=r.clockWise,l=r.id,c=r.textBreakAll,u=B1(r,vZ);return!a||!a.length?null:X.createElement(en,{className:"recharts-label-list"},a.map(function(d,f){var h=Xe(s)?n(d,f):ma(d&&d.payload,s),p=Xe(l)?{}:{id:"".concat(l,"-").concat(f)};return X.createElement(wn,Uh({},Ve(d,!0),u,p,{parentViewBox:d.parentViewBox,value:h,textBreakAll:c,viewBox:wn.parseViewBox(Xe(o)?d:D1(D1({},d),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}_s.displayName="LabelList";function CZ(e,t){return e?e===!0?X.createElement(_s,{key:"labelList-implicit",data:t}):X.isValidElement(e)||Be(e)?X.createElement(_s,{key:"labelList-implicit",data:t,content:e}):_l(e)?X.createElement(_s,Uh({data:t},e,{key:"labelList-implicit"})):null:null}function AZ(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,a=Fr(r,_s).map(function(o,l){return b.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!n)return a;var s=CZ(e.label,t);return[s].concat(yZ(a))}_s.renderCallByParent=AZ;function Ru(e){"@babel/helpers - typeof";return Ru=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ru(e)}function fb(){return fb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fb.apply(this,arguments)}function z1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function F1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?z1(Object(n),!0).forEach(function(r){TZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TZ(e,t,n){return t=OZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OZ(e){var t=PZ(e,"string");return Ru(t)=="symbol"?t:t+""}function PZ(e,t){if(Ru(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ru(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var RZ=function(t,n){var r=Dr(n-t),a=Math.min(Math.abs(n-t),359.999);return r*a},ef=function(t){var n=t.cx,r=t.cy,a=t.radius,s=t.angle,o=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,d=c*(l?1:-1)+a,f=Math.asin(c/d)/Fh,h=u?s:s+o*f,p=dn(n,r,d,h),m=dn(n,r,a,h),g=u?s-o*f:s,y=dn(n,r,d*Math.cos(f*Fh),g);return{center:p,circleTangency:m,lineTangency:y,theta:f}},uR=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,s=t.outerRadius,o=t.startAngle,l=t.endAngle,c=RZ(o,l),u=o+c,d=dn(n,r,s,o),f=dn(n,r,s,u),h="M ".concat(d.x,",").concat(d.y,`
96
+ A `).concat(s,",").concat(s,`,0,
97
+ `).concat(+(Math.abs(c)>180),",").concat(+(o>u),`,
98
+ `).concat(f.x,",").concat(f.y,`
99
+ `);if(a>0){var p=dn(n,r,a,o),m=dn(n,r,a,u);h+="L ".concat(m.x,",").concat(m.y,`
100
+ A `).concat(a,",").concat(a,`,0,
101
+ `).concat(+(Math.abs(c)>180),",").concat(+(o<=u),`,
102
+ `).concat(p.x,",").concat(p.y," Z")}else h+="L ".concat(n,",").concat(r," Z");return h},MZ=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,s=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,f=Dr(d-u),h=ef({cx:n,cy:r,radius:s,angle:u,sign:f,cornerRadius:o,cornerIsExternal:c}),p=h.circleTangency,m=h.lineTangency,g=h.theta,y=ef({cx:n,cy:r,radius:s,angle:d,sign:-f,cornerRadius:o,cornerIsExternal:c}),v=y.circleTangency,k=y.lineTangency,w=y.theta,j=c?Math.abs(u-d):Math.abs(u-d)-g-w;if(j<0)return l?"M ".concat(m.x,",").concat(m.y,`
103
+ a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
104
+ a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
105
+ `):uR({cx:n,cy:r,innerRadius:a,outerRadius:s,startAngle:u,endAngle:d});var S="M ".concat(m.x,",").concat(m.y,`
106
+ A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(p.x,",").concat(p.y,`
107
+ A`).concat(s,",").concat(s,",0,").concat(+(j>180),",").concat(+(f<0),",").concat(v.x,",").concat(v.y,`
108
+ A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(k.x,",").concat(k.y,`
109
+ `);if(a>0){var x=ef({cx:n,cy:r,radius:a,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),N=x.circleTangency,E=x.lineTangency,P=x.theta,_=ef({cx:n,cy:r,radius:a,angle:d,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),R=_.circleTangency,T=_.lineTangency,B=_.theta,$=c?Math.abs(u-d):Math.abs(u-d)-P-B;if($<0&&o===0)return"".concat(S,"L").concat(n,",").concat(r,"Z");S+="L".concat(T.x,",").concat(T.y,`
110
+ A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(R.x,",").concat(R.y,`
111
+ A`).concat(a,",").concat(a,",0,").concat(+($>180),",").concat(+(f>0),",").concat(N.x,",").concat(N.y,`
112
+ A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(E.x,",").concat(E.y,"Z")}else S+="L".concat(n,",").concat(r,"Z");return S},IZ={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},dR=function(t){var n=F1(F1({},IZ),t),r=n.cx,a=n.cy,s=n.innerRadius,o=n.outerRadius,l=n.cornerRadius,c=n.forceCornerRadius,u=n.cornerIsExternal,d=n.startAngle,f=n.endAngle,h=n.className;if(o<s||d===f)return null;var p=Ye("recharts-sector",h),m=o-s,g=$s(l,m,0,!0),y;return g>0&&Math.abs(d-f)<360?y=MZ({cx:r,cy:a,innerRadius:s,outerRadius:o,cornerRadius:Math.min(g,m/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):y=uR({cx:r,cy:a,innerRadius:s,outerRadius:o,startAngle:d,endAngle:f}),X.createElement("path",fb({},Ve(n,!0),{className:p,d:y,role:"img"}))};function Mu(e){"@babel/helpers - typeof";return Mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mu(e)}function hb(){return hb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hb.apply(this,arguments)}function U1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function W1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?U1(Object(n),!0).forEach(function(r){$Z(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $Z(e,t,n){return t=LZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LZ(e){var t=DZ(e,"string");return Mu(t)=="symbol"?t:t+""}function DZ(e,t){if(Mu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Mu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var H1={curveBasisClosed:$4,curveBasisOpen:L4,curveBasis:I4,curveBumpX:w4,curveBumpY:k4,curveLinearClosed:D4,curveLinear:am,curveMonotoneX:B4,curveMonotoneY:z4,curveNatural:F4,curveStep:U4,curveStepAfter:H4,curveStepBefore:W4},tf=function(t){return t.x===+t.x&&t.y===+t.y},pc=function(t){return t.x},mc=function(t){return t.y},BZ=function(t,n){if(Be(t))return t;var r="curve".concat(nm(t));return(r==="curveMonotone"||r==="curveBump")&&n?H1["".concat(r).concat(n==="vertical"?"Y":"X")]:H1[r]||am},zZ=function(t){var n=t.type,r=n===void 0?"linear":n,a=t.points,s=a===void 0?[]:a,o=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,d=BZ(r,l),f=u?s.filter(function(g){return tf(g)}):s,h;if(Array.isArray(o)){var p=u?o.filter(function(g){return tf(g)}):o,m=f.map(function(g,y){return W1(W1({},g),{},{base:p[y]})});return l==="vertical"?h=Gd().y(mc).x1(pc).x0(function(g){return g.base.x}):h=Gd().x(pc).y1(mc).y0(function(g){return g.base.y}),h.defined(tf).curve(d),h(m)}return l==="vertical"&&de(o)?h=Gd().y(mc).x1(pc).x0(o):de(o)?h=Gd().x(pc).y1(mc).y0(o):h=hO().x(pc).y(mc),h.defined(tf).curve(d),h(f)},G1=function(t){var n=t.className,r=t.points,a=t.path,s=t.pathRef;if((!r||!r.length)&&!a)return null;var o=r&&r.length?zZ(t):a;return b.createElement("path",hb({},Ve(t,!1),uh(t),{className:Ye("recharts-curve",n),d:o,ref:s}))},fR={exports:{}},FZ="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",UZ=FZ,WZ=UZ;function hR(){}function pR(){}pR.resetWarningCache=hR;var HZ=function(){function e(r,a,s,o,l,c){if(c!==WZ){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:pR,resetWarningCache:hR};return n.PropTypes=n,n};fR.exports=HZ();var GZ=fR.exports;const Ze=Je(GZ),{getOwnPropertyNames:qZ,getOwnPropertySymbols:KZ}=Object,{hasOwnProperty:VZ}=Object.prototype;function Rg(e,t){return function(r,a,s){return e(r,a,s)&&t(r,a,s)}}function nf(e){return function(n,r,a){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,a);const{cache:s}=a,o=s.get(n),l=s.get(r);if(o&&l)return o===r&&l===n;s.set(n,r),s.set(r,n);const c=e(n,r,a);return s.delete(n),s.delete(r),c}}function YZ(e){return e!=null?e[Symbol.toStringTag]:void 0}function q1(e){return qZ(e).concat(KZ(e))}const XZ=Object.hasOwn||((e,t)=>VZ.call(e,t));function qs(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const QZ="__v",ZZ="__o",JZ="_owner",{getOwnPropertyDescriptor:K1,keys:V1}=Object;function eJ(e,t){return e.byteLength===t.byteLength&&Wh(new Uint8Array(e),new Uint8Array(t))}function tJ(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function nJ(e,t){return e.byteLength===t.byteLength&&Wh(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function rJ(e,t){return qs(e.getTime(),t.getTime())}function aJ(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function iJ(e,t){return e===t}function Y1(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const a=new Array(r),s=e.entries();let o,l,c=0;for(;(o=s.next())&&!o.done;){const u=t.entries();let d=!1,f=0;for(;(l=u.next())&&!l.done;){if(a[f]){f++;continue}const h=o.value,p=l.value;if(n.equals(h[0],p[0],c,f,e,t,n)&&n.equals(h[1],p[1],h[0],p[0],e,t,n)){d=a[f]=!0;break}f++}if(!d)return!1;c++}return!0}const sJ=qs;function oJ(e,t,n){const r=V1(e);let a=r.length;if(V1(t).length!==a)return!1;for(;a-- >0;)if(!mR(e,t,n,r[a]))return!1;return!0}function gc(e,t,n){const r=q1(e);let a=r.length;if(q1(t).length!==a)return!1;let s,o,l;for(;a-- >0;)if(s=r[a],!mR(e,t,n,s)||(o=K1(e,s),l=K1(t,s),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function lJ(e,t){return qs(e.valueOf(),t.valueOf())}function cJ(e,t){return e.source===t.source&&e.flags===t.flags}function X1(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const a=new Array(r),s=e.values();let o,l;for(;(o=s.next())&&!o.done;){const c=t.values();let u=!1,d=0;for(;(l=c.next())&&!l.done;){if(!a[d]&&n.equals(o.value,l.value,o.value,l.value,e,t,n)){u=a[d]=!0;break}d++}if(!u)return!1}return!0}function Wh(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function uJ(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function mR(e,t,n,r){return(r===JZ||r===ZZ||r===QZ)&&(e.$$typeof||t.$$typeof)?!0:XZ(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const dJ="[object ArrayBuffer]",fJ="[object Arguments]",hJ="[object Boolean]",pJ="[object DataView]",mJ="[object Date]",gJ="[object Error]",vJ="[object Map]",yJ="[object Number]",bJ="[object Object]",xJ="[object RegExp]",wJ="[object Set]",kJ="[object String]",SJ={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},jJ="[object URL]",NJ=Object.prototype.toString;function EJ({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:a,areFunctionsEqual:s,areMapsEqual:o,areNumbersEqual:l,areObjectsEqual:c,arePrimitiveWrappersEqual:u,areRegExpsEqual:d,areSetsEqual:f,areTypedArraysEqual:h,areUrlsEqual:p,unknownTagComparators:m}){return function(y,v,k){if(y===v)return!0;if(y==null||v==null)return!1;const w=typeof y;if(w!==typeof v)return!1;if(w!=="object")return w==="number"?l(y,v,k):w==="function"?s(y,v,k):!1;const j=y.constructor;if(j!==v.constructor)return!1;if(j===Object)return c(y,v,k);if(Array.isArray(y))return t(y,v,k);if(j===Date)return r(y,v,k);if(j===RegExp)return d(y,v,k);if(j===Map)return o(y,v,k);if(j===Set)return f(y,v,k);const S=NJ.call(y);if(S===mJ)return r(y,v,k);if(S===xJ)return d(y,v,k);if(S===vJ)return o(y,v,k);if(S===wJ)return f(y,v,k);if(S===bJ)return typeof y.then!="function"&&typeof v.then!="function"&&c(y,v,k);if(S===jJ)return p(y,v,k);if(S===gJ)return a(y,v,k);if(S===fJ)return c(y,v,k);if(SJ[S])return h(y,v,k);if(S===dJ)return e(y,v,k);if(S===pJ)return n(y,v,k);if(S===hJ||S===yJ||S===kJ)return u(y,v,k);if(m){let x=m[S];if(!x){const N=YZ(y);N&&(x=m[N])}if(x)return x(y,v,k)}return!1}}function _J({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:eJ,areArraysEqual:n?gc:tJ,areDataViewsEqual:nJ,areDatesEqual:rJ,areErrorsEqual:aJ,areFunctionsEqual:iJ,areMapsEqual:n?Rg(Y1,gc):Y1,areNumbersEqual:sJ,areObjectsEqual:n?gc:oJ,arePrimitiveWrappersEqual:lJ,areRegExpsEqual:cJ,areSetsEqual:n?Rg(X1,gc):X1,areTypedArraysEqual:n?Rg(Wh,gc):Wh,areUrlsEqual:uJ,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const a=nf(r.areArraysEqual),s=nf(r.areMapsEqual),o=nf(r.areObjectsEqual),l=nf(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:a,areMapsEqual:s,areObjectsEqual:o,areSetsEqual:l})}return r}function CJ(e){return function(t,n,r,a,s,o,l){return e(t,n,l)}}function AJ({circular:e,comparator:t,createState:n,equals:r,strict:a}){if(n)return function(l,c){const{cache:u=e?new WeakMap:void 0,meta:d}=n();return t(l,c,{cache:u,equals:r,meta:d,strict:a})};if(e)return function(l,c){return t(l,c,{cache:new WeakMap,equals:r,meta:void 0,strict:a})};const s={cache:void 0,equals:r,meta:void 0,strict:a};return function(l,c){return t(l,c,s)}}const TJ=Ui();Ui({strict:!0});Ui({circular:!0});Ui({circular:!0,strict:!0});Ui({createInternalComparator:()=>qs});Ui({strict:!0,createInternalComparator:()=>qs});Ui({circular:!0,createInternalComparator:()=>qs});Ui({circular:!0,createInternalComparator:()=>qs,strict:!0});function Ui(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:a=!1}=e,s=_J(e),o=EJ(s),l=n?n(o):CJ(o);return AJ({circular:t,comparator:o,createState:r,equals:l,strict:a})}function OJ(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function Q1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function a(s){n<0&&(n=s),s-n>t?(e(s),n=-1):OJ(a)};requestAnimationFrame(r)}function pb(e){"@babel/helpers - typeof";return pb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pb(e)}function PJ(e){return $J(e)||IJ(e)||MJ(e)||RJ()}function RJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
113
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MJ(e,t){if(e){if(typeof e=="string")return Z1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Z1(e,t)}}function Z1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function IJ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function $J(e){if(Array.isArray(e))return e}function LJ(){var e={},t=function(){return null},n=!1,r=function a(s){if(!n){if(Array.isArray(s)){if(!s.length)return;var o=s,l=PJ(o),c=l[0],u=l.slice(1);if(typeof c=="number"){Q1(a.bind(null,u),c);return}a(c),Q1(a.bind(null,u));return}pb(s)==="object"&&(e=s,t(e)),typeof s=="function"&&s()}};return{stop:function(){n=!0},start:function(s){n=!1,r(s)},subscribe:function(s){return t=s,function(){t=function(){return null}}}}}function Iu(e){"@babel/helpers - typeof";return Iu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Iu(e)}function J1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function eN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?J1(Object(n),!0).forEach(function(r){gR(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gR(e,t,n){return t=DJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DJ(e){var t=BJ(e,"string");return Iu(t)==="symbol"?t:String(t)}function BJ(e,t){if(Iu(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Iu(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zJ=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,a){return r.filter(function(s){return a.includes(s)})})},FJ=function(t){return t},UJ=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},Fc=function(t,n){return Object.keys(n).reduce(function(r,a){return eN(eN({},r),{},gR({},a,t(a,n[a])))},{})},tN=function(t,n,r){return t.map(function(a){return"".concat(UJ(a)," ").concat(n,"ms ").concat(r)}).join(",")};function WJ(e,t){return qJ(e)||GJ(e,t)||vR(e,t)||HJ()}function HJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
114
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GJ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function qJ(e){if(Array.isArray(e))return e}function KJ(e){return XJ(e)||YJ(e)||vR(e)||VJ()}function VJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
115
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vR(e,t){if(e){if(typeof e=="string")return mb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mb(e,t)}}function YJ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function XJ(e){if(Array.isArray(e))return mb(e)}function mb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Hh=1e-4,yR=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},bR=function(t,n){return t.map(function(r,a){return r*Math.pow(n,a)}).reduce(function(r,a){return r+a})},nN=function(t,n){return function(r){var a=yR(t,n);return bR(a,r)}},QJ=function(t,n){return function(r){var a=yR(t,n),s=[].concat(KJ(a.map(function(o,l){return o*l}).slice(1)),[0]);return bR(s,r)}},rN=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0],s=n[1],o=n[2],l=n[3];if(n.length===1)switch(n[0]){case"linear":a=0,s=0,o=1,l=1;break;case"ease":a=.25,s=.1,o=.25,l=1;break;case"ease-in":a=.42,s=0,o=1,l=1;break;case"ease-out":a=.42,s=0,o=.58,l=1;break;case"ease-in-out":a=0,s=0,o=.58,l=1;break;default:{var c=n[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(y){return parseFloat(y)}),d=WJ(u,4);a=d[0],s=d[1],o=d[2],l=d[3]}}}var f=nN(a,o),h=nN(s,l),p=QJ(a,o),m=function(v){return v>1?1:v<0?0:v},g=function(v){for(var k=v>1?1:v,w=k,j=0;j<8;++j){var S=f(w)-k,x=p(w);if(Math.abs(S-k)<Hh||x<Hh)return h(w);w=m(w-S/x)}return h(w)};return g.isStepper=!1,g},ZJ=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,a=t.damping,s=a===void 0?8:a,o=t.dt,l=o===void 0?17:o,c=function(d,f,h){var p=-(d-f)*r,m=h*s,g=h+(p-m)*l/1e3,y=h*l/1e3+d;return Math.abs(y-f)<Hh&&Math.abs(g)<Hh?[f,0]:[y,g]};return c.isStepper=!0,c.dt=l,c},JJ=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0];if(typeof a=="string")switch(a){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return rN(a);case"spring":return ZJ();default:if(a.split("(")[0]==="cubic-bezier")return rN(a)}return typeof a=="function"?a:null};function $u(e){"@babel/helpers - typeof";return $u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$u(e)}function aN(e){return nee(e)||tee(e)||xR(e)||eee()}function eee(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
116
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tee(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function nee(e){if(Array.isArray(e))return vb(e)}function iN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function cn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iN(Object(n),!0).forEach(function(r){gb(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gb(e,t,n){return t=ree(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ree(e){var t=aee(e,"string");return $u(t)==="symbol"?t:String(t)}function aee(e,t){if($u(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($u(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function iee(e,t){return lee(e)||oee(e,t)||xR(e,t)||see()}function see(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
117
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xR(e,t){if(e){if(typeof e=="string")return vb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vb(e,t)}}function vb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function oee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function lee(e){if(Array.isArray(e))return e}var Gh=function(t,n,r){return t+(n-t)*r},yb=function(t){var n=t.from,r=t.to;return n!==r},cee=function e(t,n,r){var a=Fc(function(s,o){if(yb(o)){var l=t(o.from,o.to,o.velocity),c=iee(l,2),u=c[0],d=c[1];return cn(cn({},o),{},{from:u,velocity:d})}return o},n);return r<1?Fc(function(s,o){return yb(o)?cn(cn({},o),{},{velocity:Gh(o.velocity,a[s].velocity,r),from:Gh(o.from,a[s].from,r)}):o},n):e(t,a,r-1)};const uee=function(e,t,n,r,a){var s=zJ(e,t),o=s.reduce(function(y,v){return cn(cn({},y),{},gb({},v,[e[v],t[v]]))},{}),l=s.reduce(function(y,v){return cn(cn({},y),{},gb({},v,{from:e[v],velocity:0,to:t[v]}))},{}),c=-1,u,d,f=function(){return null},h=function(){return Fc(function(v,k){return k.from},l)},p=function(){return!Object.values(l).filter(yb).length},m=function(v){u||(u=v);var k=v-u,w=k/n.dt;l=cee(n,l,w),a(cn(cn(cn({},e),t),h())),u=v,p()||(c=requestAnimationFrame(f))},g=function(v){d||(d=v);var k=(v-d)/r,w=Fc(function(S,x){return Gh.apply(void 0,aN(x).concat([n(k)]))},o);if(a(cn(cn(cn({},e),t),w)),k<1)c=requestAnimationFrame(f);else{var j=Fc(function(S,x){return Gh.apply(void 0,aN(x).concat([n(1)]))},o);a(cn(cn(cn({},e),t),j))}};return f=n.isStepper?m:g,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(c)}}};function ol(e){"@babel/helpers - typeof";return ol=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ol(e)}var dee=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function fee(e,t){if(e==null)return{};var n=hee(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function hee(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,s;for(s=0;s<r.length;s++)a=r[s],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function Mg(e){return vee(e)||gee(e)||mee(e)||pee()}function pee(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
118
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mee(e,t){if(e){if(typeof e=="string")return bb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bb(e,t)}}function gee(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vee(e){if(Array.isArray(e))return bb(e)}function bb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function sN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Pr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sN(Object(n),!0).forEach(function(r){Ec(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ec(e,t,n){return t=wR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,wR(r.key),r)}}function xee(e,t,n){return t&&bee(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function wR(e){var t=wee(e,"string");return ol(t)==="symbol"?t:String(t)}function wee(e,t){if(ol(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ol(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kee(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xb(e,t)}function xb(e,t){return xb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},xb(e,t)}function See(e){var t=jee();return function(){var r=qh(e),a;if(t){var s=qh(this).constructor;a=Reflect.construct(r,arguments,s)}else a=r.apply(this,arguments);return wb(this,a)}}function wb(e,t){if(t&&(ol(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kb(e)}function kb(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jee(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function qh(e){return qh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},qh(e)}var Pi=function(e){kee(n,e);var t=See(n);function n(r,a){var s;yee(this,n),s=t.call(this,r,a);var o=s.props,l=o.isActive,c=o.attributeName,u=o.from,d=o.to,f=o.steps,h=o.children,p=o.duration;if(s.handleStyleChange=s.handleStyleChange.bind(kb(s)),s.changeStyle=s.changeStyle.bind(kb(s)),!l||p<=0)return s.state={style:{}},typeof h=="function"&&(s.state={style:d}),wb(s);if(f&&f.length)s.state={style:f[0].style};else if(u){if(typeof h=="function")return s.state={style:u},wb(s);s.state={style:c?Ec({},c,u):u}}else s.state={style:{}};return s}return xee(n,[{key:"componentDidMount",value:function(){var a=this.props,s=a.isActive,o=a.canBegin;this.mounted=!0,!(!s||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var s=this.props,o=s.isActive,l=s.canBegin,c=s.attributeName,u=s.shouldReAnimate,d=s.to,f=s.from,h=this.state.style;if(l){if(!o){var p={style:c?Ec({},c,d):d};this.state&&h&&(c&&h[c]!==d||!c&&h!==d)&&this.setState(p);return}if(!(TJ(a.to,d)&&a.canBegin&&a.isActive)){var m=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var g=m||u?f:a.to;if(this.state&&h){var y={style:c?Ec({},c,g):g};(c&&h[c]!==g||!c&&h!==g)&&this.setState(y)}this.runAnimation(Pr(Pr({},this.props),{},{from:g,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var s=this,o=a.from,l=a.to,c=a.duration,u=a.easing,d=a.begin,f=a.onAnimationEnd,h=a.onAnimationStart,p=uee(o,l,JJ(u),c,this.changeStyle),m=function(){s.stopJSAnimation=p()};this.manager.start([h,d,m,c,f])}},{key:"runStepAnimation",value:function(a){var s=this,o=a.steps,l=a.begin,c=a.onAnimationStart,u=o[0],d=u.style,f=u.duration,h=f===void 0?0:f,p=function(g,y,v){if(v===0)return g;var k=y.duration,w=y.easing,j=w===void 0?"ease":w,S=y.style,x=y.properties,N=y.onAnimationEnd,E=v>0?o[v-1]:y,P=x||Object.keys(S);if(typeof j=="function"||j==="spring")return[].concat(Mg(g),[s.runJSAnimation.bind(s,{from:E.style,to:S,duration:k,easing:j}),k]);var _=tN(P,k,j),R=Pr(Pr(Pr({},E.style),S),{},{transition:_});return[].concat(Mg(g),[R,k,N]).filter(FJ)};return this.manager.start([c].concat(Mg(o.reduce(p,[d,Math.max(h,l)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=LJ());var s=a.begin,o=a.duration,l=a.attributeName,c=a.to,u=a.easing,d=a.onAnimationStart,f=a.onAnimationEnd,h=a.steps,p=a.children,m=this.manager;if(this.unSubscribe=m.subscribe(this.handleStyleChange),typeof u=="function"||typeof p=="function"||u==="spring"){this.runJSAnimation(a);return}if(h.length>1){this.runStepAnimation(a);return}var g=l?Ec({},l,c):c,y=tN(Object.keys(g),o,u);m.start([d,s,Pr(Pr({},g),{},{transition:y}),o,f])}},{key:"render",value:function(){var a=this.props,s=a.children;a.begin;var o=a.duration;a.attributeName,a.easing;var l=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var c=fee(a,dee),u=b.Children.count(s),d=this.state.style;if(typeof s=="function")return s(d);if(!l||u===0||o<=0)return s;var f=function(p){var m=p.props,g=m.style,y=g===void 0?{}:g,v=m.className,k=b.cloneElement(p,Pr(Pr({},c),{},{style:Pr(Pr({},y),d),className:v}));return k};return u===1?f(b.Children.only(s)):X.createElement("div",null,b.Children.map(s,function(h){return f(h)}))}}]),n}(b.PureComponent);Pi.displayName="Animate";Pi.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Pi.propTypes={from:Ze.oneOfType([Ze.object,Ze.string]),to:Ze.oneOfType([Ze.object,Ze.string]),attributeName:Ze.string,duration:Ze.number,begin:Ze.number,easing:Ze.oneOfType([Ze.string,Ze.func]),steps:Ze.arrayOf(Ze.shape({duration:Ze.number.isRequired,style:Ze.object.isRequired,easing:Ze.oneOfType([Ze.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Ze.func]),properties:Ze.arrayOf("string"),onAnimationEnd:Ze.func})),children:Ze.oneOfType([Ze.node,Ze.func]),isActive:Ze.bool,canBegin:Ze.bool,onAnimationEnd:Ze.func,shouldReAnimate:Ze.bool,onAnimationStart:Ze.func,onAnimationReStart:Ze.func};function Lu(e){"@babel/helpers - typeof";return Lu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lu(e)}function Kh(){return Kh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kh.apply(this,arguments)}function Nee(e,t){return Aee(e)||Cee(e,t)||_ee(e,t)||Eee()}function Eee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
119
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _ee(e,t){if(e){if(typeof e=="string")return oN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oN(e,t)}}function oN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Cee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function Aee(e){if(Array.isArray(e))return e}function lN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function cN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lN(Object(n),!0).forEach(function(r){Tee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tee(e,t,n){return t=Oee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oee(e){var t=Pee(e,"string");return Lu(t)=="symbol"?t:t+""}function Pee(e,t){if(Lu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Lu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var uN=function(t,n,r,a,s){var o=Math.min(Math.abs(r)/2,Math.abs(a)/2),l=a>=0?1:-1,c=r>=0?1:-1,u=a>=0&&r>=0||a<0&&r<0?1:0,d;if(o>0&&s instanceof Array){for(var f=[0,0,0,0],h=0,p=4;h<p;h++)f[h]=s[h]>o?o:s[h];d="M".concat(t,",").concat(n+l*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+c*f[0],",").concat(n)),d+="L ".concat(t+r-c*f[1],",").concat(n),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`,
120
+ `).concat(t+r,",").concat(n+l*f[1])),d+="L ".concat(t+r,",").concat(n+a-l*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`,
121
+ `).concat(t+r-c*f[2],",").concat(n+a)),d+="L ".concat(t+c*f[3],",").concat(n+a),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`,
122
+ `).concat(t,",").concat(n+a-l*f[3])),d+="Z"}else if(o>0&&s===+s&&s>0){var m=Math.min(o,s);d="M ".concat(t,",").concat(n+l*m,`
123
+ A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t+c*m,",").concat(n,`
124
+ L `).concat(t+r-c*m,",").concat(n,`
125
+ A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t+r,",").concat(n+l*m,`
126
+ L `).concat(t+r,",").concat(n+a-l*m,`
127
+ A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t+r-c*m,",").concat(n+a,`
128
+ L `).concat(t+c*m,",").concat(n+a,`
129
+ A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t,",").concat(n+a-l*m," Z")}else d="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(a," h ").concat(-r," Z");return d},Ree=function(t,n){if(!t||!n)return!1;var r=t.x,a=t.y,s=n.x,o=n.y,l=n.width,c=n.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(s,s+l),d=Math.max(s,s+l),f=Math.min(o,o+c),h=Math.max(o,o+c);return r>=u&&r<=d&&a>=f&&a<=h}return!1},Mee={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},r0=function(t){var n=cN(cN({},Mee),t),r=b.useRef(),a=b.useState(-1),s=Nee(a,2),o=s[0],l=s[1];b.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var j=r.current.getTotalLength();j&&l(j)}catch{}},[]);var c=n.x,u=n.y,d=n.width,f=n.height,h=n.radius,p=n.className,m=n.animationEasing,g=n.animationDuration,y=n.animationBegin,v=n.isAnimationActive,k=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var w=Ye("recharts-rectangle",p);return k?X.createElement(Pi,{canBegin:o>0,from:{width:d,height:f,x:c,y:u},to:{width:d,height:f,x:c,y:u},duration:g,animationEasing:m,isActive:k},function(j){var S=j.width,x=j.height,N=j.x,E=j.y;return X.createElement(Pi,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:g,isActive:v,easing:m},X.createElement("path",Kh({},Ve(n,!0),{className:w,d:uN(N,E,S,x,h),ref:r})))}):X.createElement("path",Kh({},Ve(n,!0),{className:w,d:uN(c,u,d,f,h)}))};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)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Sb.apply(this,arguments)}var kR=function(t){var n=t.cx,r=t.cy,a=t.r,s=t.className,o=Ye("recharts-dot",s);return n===+n&&r===+r&&a===+a?b.createElement("circle",Sb({},Ve(t,!1),uh(t),{className:o,cx:n,cy:r,r:a})):null};function Du(e){"@babel/helpers - typeof";return Du=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Du(e)}var Iee=["x","y","top","left","width","height","className"];function jb(){return jb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jb.apply(this,arguments)}function dN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function $ee(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dN(Object(n),!0).forEach(function(r){Lee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lee(e,t,n){return t=Dee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dee(e){var t=Bee(e,"string");return Du(t)=="symbol"?t:t+""}function Bee(e,t){if(Du(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Du(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zee(e,t){if(e==null)return{};var n=Fee(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Fee(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Uee=function(t,n,r,a,s,o){return"M".concat(t,",").concat(s,"v").concat(a,"M").concat(o,",").concat(n,"h").concat(r)},Wee=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,s=a===void 0?0:a,o=t.top,l=o===void 0?0:o,c=t.left,u=c===void 0?0:c,d=t.width,f=d===void 0?0:d,h=t.height,p=h===void 0?0:h,m=t.className,g=zee(t,Iee),y=$ee({x:r,y:s,top:l,left:u,width:f,height:p},g);return!de(r)||!de(s)||!de(f)||!de(p)||!de(l)||!de(u)?null:X.createElement("path",jb({},Ve(y,!0),{className:Ye("recharts-cross",m),d:Uee(r,s,f,p,l,u)}))},Hee=LO,Gee=Hee(Object.getPrototypeOf,Object),qee=Gee,Kee=Ka,Vee=qee,Yee=Va,Xee="[object Object]",Qee=Function.prototype,Zee=Object.prototype,SR=Qee.toString,Jee=Zee.hasOwnProperty,ete=SR.call(Object);function tte(e){if(!Yee(e)||Kee(e)!=Xee)return!1;var t=Vee(e);if(t===null)return!0;var n=Jee.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&SR.call(n)==ete}var nte=tte;const rte=Je(nte);var ate=Ka,ite=Va,ste="[object Boolean]";function ote(e){return e===!0||e===!1||ite(e)&&ate(e)==ste}var lte=ote;const cte=Je(lte);function Bu(e){"@babel/helpers - typeof";return Bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bu(e)}function Vh(){return Vh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vh.apply(this,arguments)}function ute(e,t){return pte(e)||hte(e,t)||fte(e,t)||dte()}function dte(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
130
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fte(e,t){if(e){if(typeof e=="string")return fN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fN(e,t)}}function fN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function hte(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function pte(e){if(Array.isArray(e))return e}function hN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function pN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hN(Object(n),!0).forEach(function(r){mte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mte(e,t,n){return t=gte(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gte(e){var t=vte(e,"string");return Bu(t)=="symbol"?t:t+""}function vte(e,t){if(Bu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mN=function(t,n,r,a,s){var o=r-a,l;return l="M ".concat(t,",").concat(n),l+="L ".concat(t+r,",").concat(n),l+="L ".concat(t+r-o/2,",").concat(n+s),l+="L ".concat(t+r-o/2-a,",").concat(n+s),l+="L ".concat(t,",").concat(n," Z"),l},yte={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},bte=function(t){var n=pN(pN({},yte),t),r=b.useRef(),a=b.useState(-1),s=ute(a,2),o=s[0],l=s[1];b.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var w=r.current.getTotalLength();w&&l(w)}catch{}},[]);var c=n.x,u=n.y,d=n.upperWidth,f=n.lowerWidth,h=n.height,p=n.className,m=n.animationEasing,g=n.animationDuration,y=n.animationBegin,v=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||h!==+h||d===0&&f===0||h===0)return null;var k=Ye("recharts-trapezoid",p);return v?X.createElement(Pi,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:h,x:c,y:u},to:{upperWidth:d,lowerWidth:f,height:h,x:c,y:u},duration:g,animationEasing:m,isActive:v},function(w){var j=w.upperWidth,S=w.lowerWidth,x=w.height,N=w.x,E=w.y;return X.createElement(Pi,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:g,easing:m},X.createElement("path",Vh({},Ve(n,!0),{className:k,d:mN(N,E,j,S,x),ref:r})))}):X.createElement("g",null,X.createElement("path",Vh({},Ve(n,!0),{className:k,d:mN(c,u,d,f,h)})))},xte=["option","shapeType","propTransformer","activeClassName","isActive"];function zu(e){"@babel/helpers - typeof";return zu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zu(e)}function wte(e,t){if(e==null)return{};var n=kte(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function kte(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function gN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Yh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gN(Object(n),!0).forEach(function(r){Ste(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ste(e,t,n){return t=jte(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jte(e){var t=Nte(e,"string");return zu(t)=="symbol"?t:t+""}function Nte(e,t){if(zu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(zu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ete(e,t){return Yh(Yh({},t),e)}function _te(e,t){return e==="symbols"}function vN(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return X.createElement(r0,n);case"trapezoid":return X.createElement(bte,n);case"sector":return X.createElement(dR,n);case"symbols":if(_te(t))return X.createElement(ww,n);break;default:return null}}function Cte(e){return b.isValidElement(e)?e.props:e}function Ate(e){var t=e.option,n=e.shapeType,r=e.propTransformer,a=r===void 0?Ete:r,s=e.activeClassName,o=s===void 0?"recharts-active-shape":s,l=e.isActive,c=wte(e,xte),u;if(b.isValidElement(t))u=b.cloneElement(t,Yh(Yh({},c),Cte(t)));else if(Be(t))u=t(c);else if(rte(t)&&!cte(t)){var d=a(t,c);u=X.createElement(vN,{shapeType:n,elementProps:d})}else{var f=c;u=X.createElement(vN,{shapeType:n,elementProps:f})}return l?X.createElement(en,{className:o},u):u}function xm(e,t){return t!=null&&"trapezoids"in e.props}function wm(e,t){return t!=null&&"sectors"in e.props}function Fu(e,t){return t!=null&&"points"in e.props}function Tte(e,t){var n,r,a=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,s=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return a&&s}function Ote(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function Pte(e,t){var n=e.x===t.x,r=e.y===t.y,a=e.z===t.z;return n&&r&&a}function Rte(e,t){var n;return xm(e,t)?n=Tte:wm(e,t)?n=Ote:Fu(e,t)&&(n=Pte),n}function Mte(e,t){var n;return xm(e,t)?n="trapezoids":wm(e,t)?n="sectors":Fu(e,t)&&(n="points"),n}function Ite(e,t){if(xm(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}if(wm(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}return Fu(e,t)?t.payload:{}}function $te(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,a=Mte(n,t),s=Ite(n,t),o=r.filter(function(c,u){var d=Jw(s,c),f=n.props[a].filter(function(m){var g=Rte(n,t);return g(m,t)}),h=n.props[a].indexOf(f[f.length-1]),p=u===h;return d&&p}),l=r.indexOf(o[o.length-1]);return l}var Lte=Math.ceil,Dte=Math.max;function Bte(e,t,n,r){for(var a=-1,s=Dte(Lte((t-e)/(n||1)),0),o=Array(s);s--;)o[r?s:++a]=e,e+=n;return o}var zte=Bte,Fte=nP,yN=1/0,Ute=17976931348623157e292;function Wte(e){if(!e)return e===0?e:0;if(e=Fte(e),e===yN||e===-yN){var t=e<0?-1:1;return t*Ute}return e===e?e:0}var jR=Wte,Hte=zte,Gte=lm,Ig=jR;function qte(e){return function(t,n,r){return r&&typeof r!="number"&&Gte(t,n,r)&&(n=r=void 0),t=Ig(t),n===void 0?(n=t,t=0):n=Ig(n),r=r===void 0?t<n?1:-1:Ig(r),Hte(t,n,r,e)}}var Kte=qte,Vte=Kte,Yte=Vte(),Xte=Yte;const Xh=Je(Xte);function Uu(e){"@babel/helpers - typeof";return Uu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uu(e)}function bN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function xN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bN(Object(n),!0).forEach(function(r){NR(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NR(e,t,n){return t=Qte(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qte(e){var t=Zte(e,"string");return Uu(t)=="symbol"?t:t+""}function Zte(e,t){if(Uu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Uu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Jte=["Webkit","Moz","O","ms"],ene=function(t,n){var r=t.replace(/(\w)/,function(s){return s.toUpperCase()}),a=Jte.reduce(function(s,o){return xN(xN({},s),{},NR({},o+r,n))},{});return a[t]=n,a};function ll(e){"@babel/helpers - typeof";return ll=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ll(e)}function Qh(){return Qh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qh.apply(this,arguments)}function wN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function $g(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wN(Object(n),!0).forEach(function(r){Xn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kN(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_R(r.key),r)}}function nne(e,t,n){return t&&kN(e.prototype,t),n&&kN(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function rne(e,t,n){return t=Zh(t),ane(e,ER()?Reflect.construct(t,n||[],Zh(e).constructor):t.apply(e,n))}function ane(e,t){if(t&&(ll(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ine(e)}function ine(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ER(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ER=function(){return!!e})()}function Zh(e){return Zh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Zh(e)}function sne(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nb(e,t)}function Nb(e,t){return Nb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Nb(e,t)}function Xn(e,t,n){return t=_R(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _R(e){var t=one(e,"string");return ll(t)=="symbol"?t:t+""}function one(e,t){if(ll(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ll(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var lne=function(t){var n=t.data,r=t.startIndex,a=t.endIndex,s=t.x,o=t.width,l=t.travellerWidth;if(!n||!n.length)return{};var c=n.length,u=Bc().domain(Xh(0,c)).range([s,s+o-l]),d=u.domain().map(function(f){return u(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(r),endX:u(a),scale:u,scaleValues:d}},SN=function(t){return t.changedTouches&&!!t.changedTouches.length},cl=function(e){function t(n){var r;return tne(this,t),r=rne(this,t,[n]),Xn(r,"handleDrag",function(a){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(a):r.state.isSlideMoving&&r.handleSlideDrag(a)}),Xn(r,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&r.handleDrag(a.changedTouches[0])}),Xn(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=r.props,s=a.endIndex,o=a.onDragEnd,l=a.startIndex;o==null||o({endIndex:s,startIndex:l})}),r.detachDragEndListener()}),Xn(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Xn(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Xn(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Xn(r,"handleSlideDragStart",function(a){var s=SN(a)?a.changedTouches[0]:a;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:s.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return sne(t,e),nne(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var a=r.startX,s=r.endX,o=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,d=u.length-1,f=Math.min(a,s),h=Math.max(a,s),p=t.getIndexInRange(o,f),m=t.getIndexInRange(o,h);return{startIndex:p-p%c,endIndex:m===d?d:m-m%c}}},{key:"getTextOfTick",value:function(r){var a=this.props,s=a.data,o=a.tickFormatter,l=a.dataKey,c=ma(s[r],l,r);return Be(o)?o(c,r):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var a=this.state,s=a.slideMoveStartX,o=a.startX,l=a.endX,c=this.props,u=c.x,d=c.width,f=c.travellerWidth,h=c.startIndex,p=c.endIndex,m=c.onChange,g=r.pageX-s;g>0?g=Math.min(g,u+d-f-l,u+d-f-o):g<0&&(g=Math.max(g,u-o,u-l));var y=this.getIndex({startX:o+g,endX:l+g});(y.startIndex!==h||y.endIndex!==p)&&m&&m(y),this.setState({startX:o+g,endX:l+g,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,a){var s=SN(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:s.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var a=this.state,s=a.brushMoveStartX,o=a.movingTravellerId,l=a.endX,c=a.startX,u=this.state[o],d=this.props,f=d.x,h=d.width,p=d.travellerWidth,m=d.onChange,g=d.gap,y=d.data,v={startX:this.state.startX,endX:this.state.endX},k=r.pageX-s;k>0?k=Math.min(k,f+h-p-u):k<0&&(k=Math.max(k,f-u)),v[o]=u+k;var w=this.getIndex(v),j=w.startIndex,S=w.endIndex,x=function(){var E=y.length-1;return o==="startX"&&(l>c?j%g===0:S%g===0)||l<c&&S===E||o==="endX"&&(l>c?S%g===0:j%g===0)||l>c&&S===E};this.setState(Xn(Xn({},o,u+k),"brushMoveStartX",r.pageX),function(){m&&x()&&m(w)})}},{key:"handleTravellerMoveKeyboard",value:function(r,a){var s=this,o=this.state,l=o.scaleValues,c=o.startX,u=o.endX,d=this.state[a],f=l.indexOf(d);if(f!==-1){var h=f+r;if(!(h===-1||h>=l.length)){var p=l[h];a==="startX"&&p>=u||a==="endX"&&p<=c||this.setState(Xn({},a,p),function(){s.props.onChange(s.getIndex({startX:s.state.startX,endX:s.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,a=r.x,s=r.y,o=r.width,l=r.height,c=r.fill,u=r.stroke;return X.createElement("rect",{stroke:u,fill:c,x:a,y:s,width:o,height:l})}},{key:"renderPanorama",value:function(){var r=this.props,a=r.x,s=r.y,o=r.width,l=r.height,c=r.data,u=r.children,d=r.padding,f=b.Children.only(u);return f?X.cloneElement(f,{x:a,y:s,width:o,height:l,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,a){var s,o,l=this,c=this.props,u=c.y,d=c.travellerWidth,f=c.height,h=c.traveller,p=c.ariaLabel,m=c.data,g=c.startIndex,y=c.endIndex,v=Math.max(r,this.props.x),k=$g($g({},Ve(this.props,!1)),{},{x:v,y:u,width:d,height:f}),w=p||"Min value: ".concat((s=m[g])===null||s===void 0?void 0:s.name,", Max value: ").concat((o=m[y])===null||o===void 0?void 0:o.name);return X.createElement(en,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(S){["ArrowLeft","ArrowRight"].includes(S.key)&&(S.preventDefault(),S.stopPropagation(),l.handleTravellerMoveKeyboard(S.key==="ArrowRight"?1:-1,a))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,k))}},{key:"renderSlide",value:function(r,a){var s=this.props,o=s.y,l=s.height,c=s.stroke,u=s.travellerWidth,d=Math.min(r,a)+u,f=Math.max(Math.abs(a-r)-u,0);return X.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:d,y:o,width:f,height:l})}},{key:"renderText",value:function(){var r=this.props,a=r.startIndex,s=r.endIndex,o=r.y,l=r.height,c=r.travellerWidth,u=r.stroke,d=this.state,f=d.startX,h=d.endX,p=5,m={pointerEvents:"none",fill:u};return X.createElement(en,{className:"recharts-brush-texts"},X.createElement(Nh,Qh({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-p,y:o+l/2},m),this.getTextOfTick(a)),X.createElement(Nh,Qh({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+c+p,y:o+l/2},m),this.getTextOfTick(s)))}},{key:"render",value:function(){var r=this.props,a=r.data,s=r.className,o=r.children,l=r.x,c=r.y,u=r.width,d=r.height,f=r.alwaysShowText,h=this.state,p=h.startX,m=h.endX,g=h.isTextActive,y=h.isSlideMoving,v=h.isTravellerMoving,k=h.isTravellerFocused;if(!a||!a.length||!de(l)||!de(c)||!de(u)||!de(d)||u<=0||d<=0)return null;var w=Ye("recharts-brush",s),j=X.Children.count(o)===1,S=ene("userSelect","none");return X.createElement(en,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:S},this.renderBackground(),j&&this.renderPanorama(),this.renderSlide(p,m),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(m,"endX"),(g||y||v||k||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var a=r.x,s=r.y,o=r.width,l=r.height,c=r.stroke,u=Math.floor(s+l/2)-1;return X.createElement(X.Fragment,null,X.createElement("rect",{x:a,y:s,width:o,height:l,fill:c,stroke:"none"}),X.createElement("line",{x1:a+1,y1:u,x2:a+o-1,y2:u,fill:"none",stroke:"#fff"}),X.createElement("line",{x1:a+1,y1:u+2,x2:a+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,a){var s;return X.isValidElement(r)?s=X.cloneElement(r,a):Be(r)?s=r(a):s=t.renderDefaultTraveller(a),s}},{key:"getDerivedStateFromProps",value:function(r,a){var s=r.data,o=r.width,l=r.x,c=r.travellerWidth,u=r.updateId,d=r.startIndex,f=r.endIndex;if(s!==a.prevData||u!==a.prevUpdateId)return $g({prevData:s,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},s&&s.length?lne({data:s,width:o,x:l,travellerWidth:c,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(a.scale&&(o!==a.prevWidth||l!==a.prevX||c!==a.prevTravellerWidth)){a.scale.range([l,l+o-c]);var h=a.scale.domain().map(function(p){return a.scale(p)});return{prevData:s,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o,startX:a.scale(r.startIndex),endX:a.scale(r.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(r,a){for(var s=r.length,o=0,l=s-1;l-o>1;){var c=Math.floor((o+l)/2);r[c]>a?l=c:o=c}return a>=r[l]?l:o}}])}(b.PureComponent);Xn(cl,"displayName","Brush");Xn(cl,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var cne=Cw;function une(e,t){var n;return cne(e,function(r,a,s){return n=t(r,a,s),!n}),!!n}var dne=une,fne=AO,hne=Bi,pne=dne,mne=Wn,gne=lm;function vne(e,t,n){var r=mne(e)?fne:pne;return n&&gne(e,t,n)&&(t=void 0),r(e,hne(t))}var yne=vne;const bne=Je(yne);var ha=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},jN=QO;function xne(e,t,n){t=="__proto__"&&jN?jN(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var wne=xne,kne=wne,Sne=YO,jne=Bi;function Nne(e,t){var n={};return t=jne(t),Sne(e,function(r,a,s){kne(n,a,t(r,a,s))}),n}var Ene=Nne;const _ne=Je(Ene);function Cne(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}var Ane=Cne,Tne=Cw;function One(e,t){var n=!0;return Tne(e,function(r,a,s){return n=!!t(r,a,s),n}),n}var Pne=One,Rne=Ane,Mne=Pne,Ine=Bi,$ne=Wn,Lne=lm;function Dne(e,t,n){var r=$ne(e)?Rne:Mne;return n&&Lne(e,t,n)&&(t=void 0),r(e,Ine(t))}var Bne=Dne;const CR=Je(Bne);var zne=["x","y"];function Wu(e){"@babel/helpers - typeof";return Wu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wu(e)}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)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Eb.apply(this,arguments)}function NN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function vc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NN(Object(n),!0).forEach(function(r){Fne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fne(e,t,n){return t=Une(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Une(e){var t=Wne(e,"string");return Wu(t)=="symbol"?t:t+""}function Wne(e,t){if(Wu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Wu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Hne(e,t){if(e==null)return{};var n=Gne(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Gne(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function qne(e,t){var n=e.x,r=e.y,a=Hne(e,zne),s="".concat(n),o=parseInt(s,10),l="".concat(r),c=parseInt(l,10),u="".concat(t.height||a.height),d=parseInt(u,10),f="".concat(t.width||a.width),h=parseInt(f,10);return vc(vc(vc(vc(vc({},t),a),o?{x:o}:{}),c?{y:c}:{}),{},{height:d,width:h,name:t.name,radius:t.radius})}function EN(e){return X.createElement(Ate,Eb({shapeType:"rectangle",propTransformer:qne,activeClassName:"recharts-active-bar"},e))}var Kne=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,a){if(typeof t=="number")return t;var s=de(r)||o3(r);return s?t(r,a):(s||Ds(),n)}},Vne=["value","background"],AR;function ul(e){"@babel/helpers - typeof";return ul=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ul(e)}function Yne(e,t){if(e==null)return{};var n=Xne(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Xne(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Jh(){return Jh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jh.apply(this,arguments)}function _N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function $t(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_N(Object(n),!0).forEach(function(r){gi(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_N(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CN(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,OR(r.key),r)}}function Zne(e,t,n){return t&&CN(e.prototype,t),n&&CN(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Jne(e,t,n){return t=ep(t),ere(e,TR()?Reflect.construct(t,n||[],ep(e).constructor):t.apply(e,n))}function ere(e,t){if(t&&(ul(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tre(e)}function tre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function TR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(TR=function(){return!!e})()}function ep(e){return ep=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ep(e)}function nre(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_b(e,t)}function _b(e,t){return _b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},_b(e,t)}function gi(e,t,n){return t=OR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OR(e){var t=rre(e,"string");return ul(t)=="symbol"?t:t+""}function rre(e,t){if(ul(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ul(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var yn=function(e){function t(){var n;Qne(this,t);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return n=Jne(this,t,[].concat(a)),gi(n,"state",{isAnimationFinished:!1}),gi(n,"id",tm("recharts-bar-")),gi(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),gi(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return nre(t,e),Zne(t,[{key:"renderRectanglesStatically",value:function(r){var a=this,s=this.props,o=s.shape,l=s.dataKey,c=s.activeIndex,u=s.activeBar,d=Ve(this.props,!1);return r&&r.map(function(f,h){var p=h===c,m=p?u:o,g=$t($t($t({},d),f),{},{isActive:p,option:m,index:h,dataKey:l,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return X.createElement(en,Jh({className:"recharts-bar-rectangle"},dh(a.props,f,h),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(h)}),X.createElement(EN,g))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,a=this.props,s=a.data,o=a.layout,l=a.isAnimationActive,c=a.animationBegin,u=a.animationDuration,d=a.animationEasing,f=a.animationId,h=this.state.prevData;return X.createElement(Pi,{begin:c,duration:u,isActive:l,easing:d,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(p){var m=p.t,g=s.map(function(y,v){var k=h&&h[v];if(k){var w=io(k.x,y.x),j=io(k.y,y.y),S=io(k.width,y.width),x=io(k.height,y.height);return $t($t({},y),{},{x:w(m),y:j(m),width:S(m),height:x(m)})}if(o==="horizontal"){var N=io(0,y.height),E=N(m);return $t($t({},y),{},{y:y.y+y.height-E,height:E})}var P=io(0,y.width),_=P(m);return $t($t({},y),{},{width:_})});return X.createElement(en,null,r.renderRectanglesStatically(g))})}},{key:"renderRectangles",value:function(){var r=this.props,a=r.data,s=r.isAnimationActive,o=this.state.prevData;return s&&a&&a.length&&(!o||!Jw(o,a))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(a)}},{key:"renderBackground",value:function(){var r=this,a=this.props,s=a.data,o=a.dataKey,l=a.activeIndex,c=Ve(this.props.background,!1);return s.map(function(u,d){u.value;var f=u.background,h=Yne(u,Vne);if(!f)return null;var p=$t($t($t($t($t({},h),{},{fill:"#eee"},f),c),dh(r.props,u,d)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:d,className:"recharts-bar-background-rectangle"});return X.createElement(EN,Jh({key:"background-bar-".concat(d),option:r.props.background,isActive:d===l},p))})}},{key:"renderErrorBar",value:function(r,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var s=this.props,o=s.data,l=s.xAxis,c=s.yAxis,u=s.layout,d=s.children,f=Fr(d,bm);if(!f)return null;var h=u==="vertical"?o[0].height/2:o[0].width/2,p=function(y,v){var k=Array.isArray(y.value)?y.value[1]:y.value;return{x:y.x,y:y.y,value:k,errorVal:ma(y,v)}},m={clipPath:r?"url(#clipPath-".concat(a,")"):null};return X.createElement(en,m,f.map(function(g){return X.cloneElement(g,{key:"error-bar-".concat(a,"-").concat(g.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,offset:h,dataPointFormatter:p})}))}},{key:"render",value:function(){var r=this.props,a=r.hide,s=r.data,o=r.className,l=r.xAxis,c=r.yAxis,u=r.left,d=r.top,f=r.width,h=r.height,p=r.isAnimationActive,m=r.background,g=r.id;if(a||!s||!s.length)return null;var y=this.state.isAnimationFinished,v=Ye("recharts-bar",o),k=l&&l.allowDataOverflow,w=c&&c.allowDataOverflow,j=k||w,S=Xe(g)?this.id:g;return X.createElement(en,{className:v},k||w?X.createElement("defs",null,X.createElement("clipPath",{id:"clipPath-".concat(S)},X.createElement("rect",{x:k?u:u-f/2,y:w?d:d-h/2,width:k?f:f*2,height:w?h:h*2}))):null,X.createElement(en,{className:"recharts-bar-rectangles",clipPath:j?"url(#clipPath-".concat(S,")"):null},m?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(j,S),(!p||y)&&_s.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:a.curData}:r.data!==a.curData?{curData:r.data}:null}}])}(b.PureComponent);AR=yn;gi(yn,"displayName","Bar");gi(yn,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!sd.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});gi(yn,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,a=e.bandSize,s=e.xAxis,o=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,h=e.offset,p=AQ(r,n);if(!p)return null;var m=t.layout,g=n.type.defaultProps,y=g!==void 0?$t($t({},g),n.props):n.props,v=y.dataKey,k=y.children,w=y.minPointSize,j=m==="horizontal"?o:s,S=u?j.scale.domain():null,x=LQ({numericAxis:j}),N=Fr(k,vu),E=f.map(function(P,_){var R,T,B,$,I,D;u?R=TQ(u[d+_],S):(R=ma(P,v),Array.isArray(R)||(R=[x,R]));var U=Kne(w,AR.defaultProps.minPointSize)(R[1],_);if(m==="horizontal"){var M,z=[o.scale(R[0]),o.scale(R[1])],O=z[0],J=z[1];T=A1({axis:s,ticks:l,bandSize:a,offset:p.offset,entry:P,index:_}),B=(M=J??O)!==null&&M!==void 0?M:void 0,$=p.size;var F=O-J;if(I=Number.isNaN(F)?0:F,D={x:T,y:o.y,width:$,height:o.height},Math.abs(U)>0&&Math.abs(I)<Math.abs(U)){var L=Dr(I||U)*(Math.abs(U)-Math.abs(I));B-=L,I+=L}}else{var ie=[s.scale(R[0]),s.scale(R[1])],fe=ie[0],ve=ie[1];if(T=fe,B=A1({axis:o,ticks:c,bandSize:a,offset:p.offset,entry:P,index:_}),$=ve-fe,I=p.size,D={x:s.x,y:B,width:s.width,height:I},Math.abs(U)>0&&Math.abs($)<Math.abs(U)){var Ee=Dr($||U)*(Math.abs(U)-Math.abs($));$+=Ee}}return $t($t($t({},P),{},{x:T,y:B,width:$,height:I,value:u?R:R[1],payload:P,background:D},N&&N[_]&&N[_].props),{},{tooltipPayload:[lR(n,P)],tooltipPosition:{x:T+$/2,y:B+I/2}})});return $t({data:E,layout:m},h)});function Hu(e){"@babel/helpers - typeof";return Hu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hu(e)}function are(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AN(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,PR(r.key),r)}}function ire(e,t,n){return t&&AN(e.prototype,t),n&&AN(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function TN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ir(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TN(Object(n),!0).forEach(function(r){km(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function km(e,t,n){return t=PR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PR(e){var t=sre(e,"string");return Hu(t)=="symbol"?t:t+""}function sre(e,t){if(Hu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Hu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ore=function(t,n,r,a,s){var o=t.width,l=t.height,c=t.layout,u=t.children,d=Object.keys(n),f={left:r.left,leftMirror:r.left,right:o-r.right,rightMirror:o-r.right,top:r.top,topMirror:r.top,bottom:l-r.bottom,bottomMirror:l-r.bottom},h=!!Zn(u,yn);return d.reduce(function(p,m){var g=n[m],y=g.orientation,v=g.domain,k=g.padding,w=k===void 0?{}:k,j=g.mirror,S=g.reversed,x="".concat(y).concat(j?"Mirror":""),N,E,P,_,R;if(g.type==="number"&&(g.padding==="gap"||g.padding==="no-gap")){var T=v[1]-v[0],B=1/0,$=g.categoricalDomain.sort(u3);if($.forEach(function(ie,fe){fe>0&&(B=Math.min((ie||0)-($[fe-1]||0),B))}),Number.isFinite(B)){var I=B/T,D=g.layout==="vertical"?r.height:r.width;if(g.padding==="gap"&&(N=I*D/2),g.padding==="no-gap"){var U=$s(t.barCategoryGap,I*D),M=I*D/2;N=M-U-(M-U)/D*U}}}a==="xAxis"?E=[r.left+(w.left||0)+(N||0),r.left+r.width-(w.right||0)-(N||0)]:a==="yAxis"?E=c==="horizontal"?[r.top+r.height-(w.bottom||0),r.top+(w.top||0)]:[r.top+(w.top||0)+(N||0),r.top+r.height-(w.bottom||0)-(N||0)]:E=g.range,S&&(E=[E[1],E[0]]);var z=_Q(g,s,h),O=z.scale,J=z.realScaleType;O.domain(v).range(E),CQ(O);var F=$Q(O,Ir(Ir({},g),{},{realScaleType:J}));a==="xAxis"?(R=y==="top"&&!j||y==="bottom"&&j,P=r.left,_=f[x]-R*g.height):a==="yAxis"&&(R=y==="left"&&!j||y==="right"&&j,P=f[x]-R*g.width,_=r.top);var L=Ir(Ir(Ir({},g),F),{},{realScaleType:J,x:P,y:_,scale:O,width:a==="xAxis"?r.width:g.width,height:a==="yAxis"?r.height:g.height});return L.bandSize=zh(L,F),!g.hide&&a==="xAxis"?f[x]+=(R?-1:1)*L.height:g.hide||(f[x]+=(R?-1:1)*L.width),Ir(Ir({},p),{},km({},m,L))},{})},RR=function(t,n){var r=t.x,a=t.y,s=n.x,o=n.y;return{x:Math.min(r,s),y:Math.min(a,o),width:Math.abs(s-r),height:Math.abs(o-a)}},lre=function(t){var n=t.x1,r=t.y1,a=t.x2,s=t.y2;return RR({x:n,y:r},{x:a,y:s})},MR=function(){function e(t){are(this,e),this.scale=t}return ire(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.bandAware,s=r.position;if(n!==void 0){if(s)switch(s){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(n)+l}default:return this.scale(n)}if(a){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+c}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),a=r[0],s=r[r.length-1];return a<=s?n>=a&&n<=s:n>=s&&n<=a}}],[{key:"create",value:function(n){return new e(n)}}])}();km(MR,"EPS",1e-4);var a0=function(t){var n=Object.keys(t).reduce(function(r,a){return Ir(Ir({},r),{},km({},a,MR.create(t[a])))},{});return Ir(Ir({},n),{},{apply:function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=s.bandAware,l=s.position;return _ne(a,function(c,u){return n[u].apply(c,{bandAware:o,position:l})})},isInRange:function(a){return CR(a,function(s,o){return n[o].isInRange(s)})}})};function cre(e){return(e%180+180)%180}var ure=function(t){var n=t.width,r=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=cre(a),o=s*Math.PI/180,l=Math.atan(r/n),c=o>l&&o<Math.PI-l?r/Math.sin(o):n/Math.cos(o);return Math.abs(c)},dre=Bi,fre=id,hre=sm;function pre(e){return function(t,n,r){var a=Object(t);if(!fre(t)){var s=dre(n);t=hre(t),n=function(l){return s(a[l],l,a)}}var o=e(t,n,r);return o>-1?a[s?t[o]:o]:void 0}}var mre=pre,gre=jR;function vre(e){var t=gre(e),n=t%1;return t===t?n?t-n:t:0}var yre=vre,bre=WO,xre=Bi,wre=yre,kre=Math.max;function Sre(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var a=n==null?0:wre(n);return a<0&&(a=kre(r+a,0)),bre(e,xre(t),a)}var jre=Sre,Nre=mre,Ere=jre,_re=Nre(Ere),Cre=_re;const Are=Je(Cre);var Tre=hU(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),i0=b.createContext(void 0),s0=b.createContext(void 0),IR=b.createContext(void 0),$R=b.createContext({}),LR=b.createContext(void 0),DR=b.createContext(0),BR=b.createContext(0),ON=function(t){var n=t.state,r=n.xAxisMap,a=n.yAxisMap,s=n.offset,o=t.clipPathId,l=t.children,c=t.width,u=t.height,d=Tre(s);return X.createElement(i0.Provider,{value:r},X.createElement(s0.Provider,{value:a},X.createElement($R.Provider,{value:s},X.createElement(IR.Provider,{value:d},X.createElement(LR.Provider,{value:o},X.createElement(DR.Provider,{value:u},X.createElement(BR.Provider,{value:c},l)))))))},Ore=function(){return b.useContext(LR)},zR=function(t){var n=b.useContext(i0);n==null&&Ds();var r=n[t];return r==null&&Ds(),r},Pre=function(){var t=b.useContext(i0);return ui(t)},Rre=function(){var t=b.useContext(s0),n=Are(t,function(r){return CR(r.domain,Number.isFinite)});return n||ui(t)},FR=function(t){var n=b.useContext(s0);n==null&&Ds();var r=n[t];return r==null&&Ds(),r},Mre=function(){var t=b.useContext(IR);return t},Ire=function(){return b.useContext($R)},o0=function(){return b.useContext(BR)},l0=function(){return b.useContext(DR)};function dl(e){"@babel/helpers - typeof";return dl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dl(e)}function $re(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lre(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,WR(r.key),r)}}function Dre(e,t,n){return t&&Lre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bre(e,t,n){return t=tp(t),zre(e,UR()?Reflect.construct(t,n||[],tp(e).constructor):t.apply(e,n))}function zre(e,t){if(t&&(dl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Fre(e)}function Fre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function UR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(UR=function(){return!!e})()}function tp(e){return tp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},tp(e)}function Ure(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Cb(e,t)}function Cb(e,t){return Cb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Cb(e,t)}function PN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function RN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PN(Object(n),!0).forEach(function(r){c0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function c0(e,t,n){return t=WR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WR(e){var t=Wre(e,"string");return dl(t)=="symbol"?t:t+""}function Wre(e,t){if(dl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(dl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Hre(e,t){return Vre(e)||Kre(e,t)||qre(e,t)||Gre()}function Gre(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
131
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qre(e,t){if(e){if(typeof e=="string")return MN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return MN(e,t)}}function MN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Kre(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function Vre(e){if(Array.isArray(e))return e}function Ab(){return Ab=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ab.apply(this,arguments)}var Yre=function(t,n){var r;return X.isValidElement(t)?r=X.cloneElement(t,n):Be(t)?r=t(n):r=X.createElement("line",Ab({},n,{className:"recharts-reference-line-line"})),r},Xre=function(t,n,r,a,s,o,l,c,u){var d=s.x,f=s.y,h=s.width,p=s.height;if(r){var m=u.y,g=t.y.apply(m,{position:o});if(ha(u,"discard")&&!t.y.isInRange(g))return null;var y=[{x:d+h,y:g},{x:d,y:g}];return c==="left"?y.reverse():y}if(n){var v=u.x,k=t.x.apply(v,{position:o});if(ha(u,"discard")&&!t.x.isInRange(k))return null;var w=[{x:k,y:f+p},{x:k,y:f}];return l==="top"?w.reverse():w}if(a){var j=u.segment,S=j.map(function(x){return t.apply(x,{position:o})});return ha(u,"discard")&&bne(S,function(x){return!t.isInRange(x)})?null:S}return null};function Qre(e){var t=e.x,n=e.y,r=e.segment,a=e.xAxisId,s=e.yAxisId,o=e.shape,l=e.className,c=e.alwaysShow,u=Ore(),d=zR(a),f=FR(s),h=Mre();if(!u||!h)return null;$a(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=a0({x:d.scale,y:f.scale}),m=Kt(t),g=Kt(n),y=r&&r.length===2,v=Xre(p,m,g,y,h,e.position,d.orientation,f.orientation,e);if(!v)return null;var k=Hre(v,2),w=k[0],j=w.x,S=w.y,x=k[1],N=x.x,E=x.y,P=ha(e,"hidden")?"url(#".concat(u,")"):void 0,_=RN(RN({clipPath:P},Ve(e,!0)),{},{x1:j,y1:S,x2:N,y2:E});return X.createElement(en,{className:Ye("recharts-reference-line",l)},Yre(o,_),wn.renderCallByParent(e,lre({x1:j,y1:S,x2:N,y2:E})))}var u0=function(e){function t(){return $re(this,t),Bre(this,t,arguments)}return Ure(t,e),Dre(t,[{key:"render",value:function(){return X.createElement(Qre,this.props)}}])}(X.Component);c0(u0,"displayName","ReferenceLine");c0(u0,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function Tb(){return Tb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tb.apply(this,arguments)}function fl(e){"@babel/helpers - typeof";return fl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fl(e)}function IN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function $N(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IN(Object(n),!0).forEach(function(r){Sm(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jre(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,GR(r.key),r)}}function eae(e,t,n){return t&&Jre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function tae(e,t,n){return t=np(t),nae(e,HR()?Reflect.construct(t,n||[],np(e).constructor):t.apply(e,n))}function nae(e,t){if(t&&(fl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rae(e)}function rae(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function HR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(HR=function(){return!!e})()}function np(e){return np=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},np(e)}function aae(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ob(e,t)}function Ob(e,t){return Ob=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Ob(e,t)}function Sm(e,t,n){return t=GR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GR(e){var t=iae(e,"string");return fl(t)=="symbol"?t:t+""}function iae(e,t){if(fl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(fl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var sae=function(t){var n=t.x,r=t.y,a=t.xAxis,s=t.yAxis,o=a0({x:a.scale,y:s.scale}),l=o.apply({x:n,y:r},{bandAware:!0});return ha(t,"discard")&&!o.isInRange(l)?null:l},jm=function(e){function t(){return Zre(this,t),tae(this,t,arguments)}return aae(t,e),eae(t,[{key:"render",value:function(){var r=this.props,a=r.x,s=r.y,o=r.r,l=r.alwaysShow,c=r.clipPathId,u=Kt(a),d=Kt(s);if($a(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var f=sae(this.props);if(!f)return null;var h=f.x,p=f.y,m=this.props,g=m.shape,y=m.className,v=ha(this.props,"hidden")?"url(#".concat(c,")"):void 0,k=$N($N({clipPath:v},Ve(this.props,!0)),{},{cx:h,cy:p});return X.createElement(en,{className:Ye("recharts-reference-dot",y)},t.renderDot(g,k),wn.renderCallByParent(this.props,{x:h-o,y:p-o,width:2*o,height:2*o}))}}])}(X.Component);Sm(jm,"displayName","ReferenceDot");Sm(jm,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Sm(jm,"renderDot",function(e,t){var n;return X.isValidElement(e)?n=X.cloneElement(e,t):Be(e)?n=e(t):n=X.createElement(kR,Tb({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function Pb(){return Pb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pb.apply(this,arguments)}function hl(e){"@babel/helpers - typeof";return hl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hl(e)}function LN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function DN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LN(Object(n),!0).forEach(function(r){Nm(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lae(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,KR(r.key),r)}}function cae(e,t,n){return t&&lae(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function uae(e,t,n){return t=rp(t),dae(e,qR()?Reflect.construct(t,n||[],rp(e).constructor):t.apply(e,n))}function dae(e,t){if(t&&(hl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fae(e)}function fae(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qR=function(){return!!e})()}function rp(e){return rp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},rp(e)}function hae(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Rb(e,t)}function Rb(e,t){return Rb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Rb(e,t)}function Nm(e,t,n){return t=KR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KR(e){var t=pae(e,"string");return hl(t)=="symbol"?t:t+""}function pae(e,t){if(hl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(hl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var mae=function(t,n,r,a,s){var o=s.x1,l=s.x2,c=s.y1,u=s.y2,d=s.xAxis,f=s.yAxis;if(!d||!f)return null;var h=a0({x:d.scale,y:f.scale}),p={x:t?h.x.apply(o,{position:"start"}):h.x.rangeMin,y:r?h.y.apply(c,{position:"start"}):h.y.rangeMin},m={x:n?h.x.apply(l,{position:"end"}):h.x.rangeMax,y:a?h.y.apply(u,{position:"end"}):h.y.rangeMax};return ha(s,"discard")&&(!h.isInRange(p)||!h.isInRange(m))?null:RR(p,m)},Em=function(e){function t(){return oae(this,t),uae(this,t,arguments)}return hae(t,e),cae(t,[{key:"render",value:function(){var r=this.props,a=r.x1,s=r.x2,o=r.y1,l=r.y2,c=r.className,u=r.alwaysShow,d=r.clipPathId;$a(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=Kt(a),h=Kt(s),p=Kt(o),m=Kt(l),g=this.props.shape;if(!f&&!h&&!p&&!m&&!g)return null;var y=mae(f,h,p,m,this.props);if(!y&&!g)return null;var v=ha(this.props,"hidden")?"url(#".concat(d,")"):void 0;return X.createElement(en,{className:Ye("recharts-reference-area",c)},t.renderRect(g,DN(DN({clipPath:v},Ve(this.props,!0)),y)),wn.renderCallByParent(this.props,y))}}])}(X.Component);Nm(Em,"displayName","ReferenceArea");Nm(Em,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});Nm(Em,"renderRect",function(e,t){var n;return X.isValidElement(e)?n=X.cloneElement(e,t):Be(e)?n=e(t):n=X.createElement(r0,Pb({},t,{className:"recharts-reference-area-rect"})),n});function VR(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],a=0;a<e.length;a+=t)r.push(e[a]);return r}function gae(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return ure(r,n)}function vae(e,t,n){var r=n==="width",a=e.x,s=e.y,o=e.width,l=e.height;return t===1?{start:r?a:s,end:r?a+o:s+l}:{start:r?a+o:s+l,end:r?a:s}}function ap(e,t,n,r,a){if(e*t<e*r||e*t>e*a)return!1;var s=n();return e*(t-e*s/2-r)>=0&&e*(t+e*s/2-a)<=0}function yae(e,t){return VR(e,t+1)}function bae(e,t,n,r,a){for(var s=(r||[]).slice(),o=t.start,l=t.end,c=0,u=1,d=o,f=function(){var m=r==null?void 0:r[c];if(m===void 0)return{v:VR(r,u)};var g=c,y,v=function(){return y===void 0&&(y=n(m,g)),y},k=m.coordinate,w=c===0||ap(e,k,v,d,l);w||(c=0,d=o,u+=1),w&&(d=k+e*(v()/2+a),c+=u)},h;u<=s.length;)if(h=f(),h)return h.v;return[]}function Gu(e){"@babel/helpers - typeof";return Gu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gu(e)}function BN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function vn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BN(Object(n),!0).forEach(function(r){xae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xae(e,t,n){return t=wae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wae(e){var t=kae(e,"string");return Gu(t)=="symbol"?t:t+""}function kae(e,t){if(Gu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Gu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sae(e,t,n,r,a){for(var s=(r||[]).slice(),o=s.length,l=t.start,c=t.end,u=function(h){var p=s[h],m,g=function(){return m===void 0&&(m=n(p,h)),m};if(h===o-1){var y=e*(p.coordinate+e*g()/2-c);s[h]=p=vn(vn({},p),{},{tickCoord:y>0?p.coordinate-y*e:p.coordinate})}else s[h]=p=vn(vn({},p),{},{tickCoord:p.coordinate});var v=ap(e,p.tickCoord,g,l,c);v&&(c=p.tickCoord-e*(g()/2+a),s[h]=vn(vn({},p),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return s}function jae(e,t,n,r,a,s){var o=(r||[]).slice(),l=o.length,c=t.start,u=t.end;if(s){var d=r[l-1],f=n(d,l-1),h=e*(d.coordinate+e*f/2-u);o[l-1]=d=vn(vn({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate});var p=ap(e,d.tickCoord,function(){return f},c,u);p&&(u=d.tickCoord-e*(f/2+a),o[l-1]=vn(vn({},d),{},{isShow:!0}))}for(var m=s?l-1:l,g=function(k){var w=o[k],j,S=function(){return j===void 0&&(j=n(w,k)),j};if(k===0){var x=e*(w.coordinate-e*S()/2-c);o[k]=w=vn(vn({},w),{},{tickCoord:x<0?w.coordinate-x*e:w.coordinate})}else o[k]=w=vn(vn({},w),{},{tickCoord:w.coordinate});var N=ap(e,w.tickCoord,S,c,u);N&&(c=w.tickCoord+e*(S()/2+a),o[k]=vn(vn({},w),{},{isShow:!0}))},y=0;y<m;y++)g(y);return o}function d0(e,t,n){var r=e.tick,a=e.ticks,s=e.viewBox,o=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,d=e.unit,f=e.angle;if(!a||!a.length||!r)return[];if(de(c)||sd.isSsr)return yae(a,typeof c=="number"&&de(c)?c:0);var h=[],p=l==="top"||l==="bottom"?"width":"height",m=d&&p==="width"?Dc(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},g=function(w,j){var S=Be(u)?u(w.value,j):w.value;return p==="width"?gae(Dc(S,{fontSize:t,letterSpacing:n}),m,f):Dc(S,{fontSize:t,letterSpacing:n})[p]},y=a.length>=2?Dr(a[1].coordinate-a[0].coordinate):1,v=vae(s,y,p);return c==="equidistantPreserveStart"?bae(y,v,g,a,o):(c==="preserveStart"||c==="preserveStartEnd"?h=jae(y,v,g,a,o,c==="preserveStartEnd"):h=Sae(y,v,g,a,o),h.filter(function(k){return k.isShow}))}var Nae=["viewBox"],Eae=["viewBox"],_ae=["ticks"];function pl(e){"@babel/helpers - typeof";return pl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pl(e)}function Oo(){return Oo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Oo.apply(this,arguments)}function zN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ut(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zN(Object(n),!0).forEach(function(r){f0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lg(e,t){if(e==null)return{};var n=Cae(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Cae(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Aae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FN(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,XR(r.key),r)}}function Tae(e,t,n){return t&&FN(e.prototype,t),n&&FN(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Oae(e,t,n){return t=ip(t),Pae(e,YR()?Reflect.construct(t,n||[],ip(e).constructor):t.apply(e,n))}function Pae(e,t){if(t&&(pl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Rae(e)}function Rae(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function YR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(YR=function(){return!!e})()}function ip(e){return ip=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ip(e)}function Mae(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mb(e,t)}function Mb(e,t){return Mb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Mb(e,t)}function f0(e,t,n){return t=XR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XR(e){var t=Iae(e,"string");return pl(t)=="symbol"?t:t+""}function Iae(e,t){if(pl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(pl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ll=function(e){function t(n){var r;return Aae(this,t),r=Oae(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return Mae(t,e),Tae(t,[{key:"shouldComponentUpdate",value:function(r,a){var s=r.viewBox,o=Lg(r,Nae),l=this.props,c=l.viewBox,u=Lg(l,Eae);return!zo(s,c)||!zo(o,u)||!zo(a,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var a=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];a&&this.setState({fontSize:window.getComputedStyle(a).fontSize,letterSpacing:window.getComputedStyle(a).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var a=this.props,s=a.x,o=a.y,l=a.width,c=a.height,u=a.orientation,d=a.tickSize,f=a.mirror,h=a.tickMargin,p,m,g,y,v,k,w=f?-1:1,j=r.tickSize||d,S=de(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":p=m=r.coordinate,y=o+ +!f*c,g=y-w*j,k=g-w*h,v=S;break;case"left":g=y=r.coordinate,m=s+ +!f*l,p=m-w*j,v=p-w*h,k=S;break;case"right":g=y=r.coordinate,m=s+ +f*l,p=m+w*j,v=p+w*h,k=S;break;default:p=m=r.coordinate,y=o+ +f*c,g=y+w*j,k=g+w*h,v=S;break}return{line:{x1:p,y1:g,x2:m,y2:y},tick:{x:v,y:k}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,a=r.orientation,s=r.mirror,o;switch(a){case"left":o=s?"start":"end";break;case"right":o=s?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,a=r.orientation,s=r.mirror,o="end";switch(a){case"left":case"right":o="middle";break;case"top":o=s?"start":"end";break;default:o=s?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.x,s=r.y,o=r.width,l=r.height,c=r.orientation,u=r.mirror,d=r.axisLine,f=Ut(Ut(Ut({},Ve(this.props,!1)),Ve(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var h=+(c==="top"&&!u||c==="bottom"&&u);f=Ut(Ut({},f),{},{x1:a,y1:s+h*l,x2:a+o,y2:s+h*l})}else{var p=+(c==="left"&&!u||c==="right"&&u);f=Ut(Ut({},f),{},{x1:a+p*o,y1:s,x2:a+p*o,y2:s+l})}return X.createElement("line",Oo({},f,{className:Ye("recharts-cartesian-axis-line",wr(d,"className"))}))}},{key:"renderTicks",value:function(r,a,s){var o=this,l=this.props,c=l.tickLine,u=l.stroke,d=l.tick,f=l.tickFormatter,h=l.unit,p=d0(Ut(Ut({},this.props),{},{ticks:r}),a,s),m=this.getTickTextAnchor(),g=this.getTickVerticalAnchor(),y=Ve(this.props,!1),v=Ve(d,!1),k=Ut(Ut({},y),{},{fill:"none"},Ve(c,!1)),w=p.map(function(j,S){var x=o.getTickLineCoord(j),N=x.line,E=x.tick,P=Ut(Ut(Ut(Ut({textAnchor:m,verticalAnchor:g},y),{},{stroke:"none",fill:u},v),E),{},{index:S,payload:j,visibleTicksCount:p.length,tickFormatter:f});return X.createElement(en,Oo({className:"recharts-cartesian-axis-tick",key:"tick-".concat(j.value,"-").concat(j.coordinate,"-").concat(j.tickCoord)},dh(o.props,j,S)),c&&X.createElement("line",Oo({},k,N,{className:Ye("recharts-cartesian-axis-tick-line",wr(c,"className"))})),d&&t.renderTickItem(d,P,"".concat(Be(f)?f(j.value,S):j.value).concat(h||"")))});return X.createElement("g",{className:"recharts-cartesian-axis-ticks"},w)}},{key:"render",value:function(){var r=this,a=this.props,s=a.axisLine,o=a.width,l=a.height,c=a.ticksGenerator,u=a.className,d=a.hide;if(d)return null;var f=this.props,h=f.ticks,p=Lg(f,_ae),m=h;return Be(c)&&(m=h&&h.length>0?c(this.props):c(p)),o<=0||l<=0||!m||!m.length?null:X.createElement(en,{className:Ye("recharts-cartesian-axis",u),ref:function(y){r.layerReference=y}},s&&this.renderAxisLine(),this.renderTicks(m,this.state.fontSize,this.state.letterSpacing),wn.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,a,s){var o,l=Ye(a.className,"recharts-cartesian-axis-tick-value");return X.isValidElement(r)?o=X.cloneElement(r,Ut(Ut({},a),{},{className:l})):Be(r)?o=r(Ut(Ut({},a),{},{className:l})):o=X.createElement(Nh,Oo({},a,{className:"recharts-cartesian-axis-tick-value"}),s),o}}])}(b.Component);f0(Ll,"displayName","CartesianAxis");f0(Ll,"defaultProps",{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"});var $ae=["x1","y1","x2","y2","key"],Lae=["offset"];function Bs(e){"@babel/helpers - typeof";return Bs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bs(e)}function UN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function kn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UN(Object(n),!0).forEach(function(r){Dae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dae(e,t,n){return t=Bae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bae(e){var t=zae(e,"string");return Bs(t)=="symbol"?t:t+""}function zae(e,t){if(Bs(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bs(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xs(){return xs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xs.apply(this,arguments)}function WN(e,t){if(e==null)return{};var n=Fae(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Fae(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Uae=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,a=t.x,s=t.y,o=t.width,l=t.height,c=t.ry;return X.createElement("rect",{x:a,y:s,ry:c,width:o,height:l,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function QR(e,t){var n;if(X.isValidElement(e))n=X.cloneElement(e,t);else if(Be(e))n=e(t);else{var r=t.x1,a=t.y1,s=t.x2,o=t.y2,l=t.key,c=WN(t,$ae),u=Ve(c,!1);u.offset;var d=WN(u,Lae);n=X.createElement("line",xs({},d,{x1:r,y1:a,x2:s,y2:o,fill:"none",key:l}))}return n}function Wae(e){var t=e.x,n=e.width,r=e.horizontal,a=r===void 0?!0:r,s=e.horizontalPoints;if(!a||!s||!s.length)return null;var o=s.map(function(l,c){var u=kn(kn({},e),{},{x1:t,y1:l,x2:t+n,y2:l,key:"line-".concat(c),index:c});return QR(a,u)});return X.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function Hae(e){var t=e.y,n=e.height,r=e.vertical,a=r===void 0?!0:r,s=e.verticalPoints;if(!a||!s||!s.length)return null;var o=s.map(function(l,c){var u=kn(kn({},e),{},{x1:l,y1:t,x2:l,y2:t+n,key:"line-".concat(c),index:c});return QR(a,u)});return X.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function Gae(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,a=e.y,s=e.width,o=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var d=l.map(function(h){return Math.round(h+a-a)}).sort(function(h,p){return h-p});a!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var m=!d[p+1],g=m?a+o-h:d[p+1]-h;if(g<=0)return null;var y=p%t.length;return X.createElement("rect",{key:"react-".concat(p),y:h,x:r,height:g,width:s,stroke:"none",fill:t[y],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return X.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function qae(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,a=e.fillOpacity,s=e.x,o=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!n||!r||!r.length)return null;var d=u.map(function(h){return Math.round(h+s-s)}).sort(function(h,p){return h-p});s!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var m=!d[p+1],g=m?s+l-h:d[p+1]-h;if(g<=0)return null;var y=p%r.length;return X.createElement("rect",{key:"react-".concat(p),x:h,y:o,width:g,height:c,stroke:"none",fill:r[y],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return X.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var Kae=function(t,n){var r=t.xAxis,a=t.width,s=t.height,o=t.offset;return sR(d0(kn(kn(kn({},Ll.defaultProps),r),{},{ticks:Ra(r,!0),viewBox:{x:0,y:0,width:a,height:s}})),o.left,o.left+o.width,n)},Vae=function(t,n){var r=t.yAxis,a=t.width,s=t.height,o=t.offset;return sR(d0(kn(kn(kn({},Ll.defaultProps),r),{},{ticks:Ra(r,!0),viewBox:{x:0,y:0,width:a,height:s}})),o.top,o.top+o.height,n)},lo={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function di(e){var t,n,r,a,s,o,l=o0(),c=l0(),u=Ire(),d=kn(kn({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:lo.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:lo.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:lo.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:lo.horizontalFill,vertical:(s=e.vertical)!==null&&s!==void 0?s:lo.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:lo.verticalFill,x:de(e.x)?e.x:u.left,y:de(e.y)?e.y:u.top,width:de(e.width)?e.width:u.width,height:de(e.height)?e.height:u.height}),f=d.x,h=d.y,p=d.width,m=d.height,g=d.syncWithTicks,y=d.horizontalValues,v=d.verticalValues,k=Pre(),w=Rre();if(!de(p)||p<=0||!de(m)||m<=0||!de(f)||f!==+f||!de(h)||h!==+h)return null;var j=d.verticalCoordinatesGenerator||Kae,S=d.horizontalCoordinatesGenerator||Vae,x=d.horizontalPoints,N=d.verticalPoints;if((!x||!x.length)&&Be(S)){var E=y&&y.length,P=S({yAxis:w?kn(kn({},w),{},{ticks:E?y:w.ticks}):void 0,width:l,height:c,offset:u},E?!0:g);$a(Array.isArray(P),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Bs(P),"]")),Array.isArray(P)&&(x=P)}if((!N||!N.length)&&Be(j)){var _=v&&v.length,R=j({xAxis:k?kn(kn({},k),{},{ticks:_?v:k.ticks}):void 0,width:l,height:c,offset:u},_?!0:g);$a(Array.isArray(R),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Bs(R),"]")),Array.isArray(R)&&(N=R)}return X.createElement("g",{className:"recharts-cartesian-grid"},X.createElement(Uae,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),X.createElement(Wae,xs({},d,{offset:u,horizontalPoints:x,xAxis:k,yAxis:w})),X.createElement(Hae,xs({},d,{offset:u,verticalPoints:N,xAxis:k,yAxis:w})),X.createElement(Gae,xs({},d,{horizontalPoints:x})),X.createElement(qae,xs({},d,{verticalPoints:N})))}di.displayName="CartesianGrid";function ml(e){"@babel/helpers - typeof";return ml=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ml(e)}function Yae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xae(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eM(r.key),r)}}function Qae(e,t,n){return t&&Xae(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zae(e,t,n){return t=sp(t),Jae(e,ZR()?Reflect.construct(t,n||[],sp(e).constructor):t.apply(e,n))}function Jae(e,t){if(t&&(ml(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return eie(e)}function eie(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ZR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ZR=function(){return!!e})()}function sp(e){return sp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},sp(e)}function tie(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ib(e,t)}function Ib(e,t){return Ib=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Ib(e,t)}function JR(e,t,n){return t=eM(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eM(e){var t=nie(e,"string");return ml(t)=="symbol"?t:t+""}function nie(e,t){if(ml(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ml(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function $b(){return $b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$b.apply(this,arguments)}function rie(e){var t=e.xAxisId,n=o0(),r=l0(),a=zR(t);return a==null?null:b.createElement(Ll,$b({},a,{className:Ye("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return Ra(o,!0)}}))}var oa=function(e){function t(){return Yae(this,t),Zae(this,t,arguments)}return tie(t,e),Qae(t,[{key:"render",value:function(){return b.createElement(rie,this.props)}}])}(b.Component);JR(oa,"displayName","XAxis");JR(oa,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function gl(e){"@babel/helpers - typeof";return gl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gl(e)}function aie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iie(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,rM(r.key),r)}}function sie(e,t,n){return t&&iie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function oie(e,t,n){return t=op(t),lie(e,tM()?Reflect.construct(t,n||[],op(e).constructor):t.apply(e,n))}function lie(e,t){if(t&&(gl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cie(e)}function cie(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tM=function(){return!!e})()}function op(e){return op=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},op(e)}function uie(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Lb(e,t)}function Lb(e,t){return Lb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Lb(e,t)}function nM(e,t,n){return t=rM(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rM(e){var t=die(e,"string");return gl(t)=="symbol"?t:t+""}function die(e,t){if(gl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(gl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Db(){return Db=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Db.apply(this,arguments)}var fie=function(t){var n=t.yAxisId,r=o0(),a=l0(),s=FR(n);return s==null?null:b.createElement(Ll,Db({},s,{className:Ye("recharts-".concat(s.axisType," ").concat(s.axisType),s.className),viewBox:{x:0,y:0,width:r,height:a},ticksGenerator:function(l){return Ra(l,!0)}}))},la=function(e){function t(){return aie(this,t),oie(this,t,arguments)}return uie(t,e),sie(t,[{key:"render",value:function(){return b.createElement(fie,this.props)}}])}(b.Component);nM(la,"displayName","YAxis");nM(la,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function HN(e){return gie(e)||mie(e)||pie(e)||hie()}function hie(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
132
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pie(e,t){if(e){if(typeof e=="string")return Bb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bb(e,t)}}function mie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function gie(e){if(Array.isArray(e))return Bb(e)}function Bb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var zb=function(t,n,r,a,s){var o=Fr(t,u0),l=Fr(t,jm),c=[].concat(HN(o),HN(l)),u=Fr(t,Em),d="".concat(a,"Id"),f=a[0],h=n;if(c.length&&(h=c.reduce(function(g,y){if(y.props[d]===r&&ha(y.props,"extendDomain")&&de(y.props[f])){var v=y.props[f];return[Math.min(g[0],v),Math.max(g[1],v)]}return g},h)),u.length){var p="".concat(f,"1"),m="".concat(f,"2");h=u.reduce(function(g,y){if(y.props[d]===r&&ha(y.props,"extendDomain")&&de(y.props[p])&&de(y.props[m])){var v=y.props[p],k=y.props[m];return[Math.min(g[0],v,k),Math.max(g[1],v,k)]}return g},h)}return s&&s.length&&(h=s.reduce(function(g,y){return de(y)?[Math.min(g[0],y),Math.max(g[1],y)]:g},h)),h},aM={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function a(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function s(c,u,d,f,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new a(d,f||c,h),m=n?n+u:u;return c._events[m]?c._events[m].fn?c._events[m]=[c._events[m],p]:c._events[m].push(p):(c._events[m]=p,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],d,f;if(this._eventsCount===0)return u;for(f in d=this._events)t.call(d,f)&&u.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=n?n+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,p=f.length,m=new Array(p);h<p;h++)m[h]=f[h].fn;return m},l.prototype.listenerCount=function(u){var d=n?n+u:u,f=this._events[d];return f?f.fn?1:f.length:0},l.prototype.emit=function(u,d,f,h,p,m){var g=n?n+u:u;if(!this._events[g])return!1;var y=this._events[g],v=arguments.length,k,w;if(y.fn){switch(y.once&&this.removeListener(u,y.fn,void 0,!0),v){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,d),!0;case 3:return y.fn.call(y.context,d,f),!0;case 4:return y.fn.call(y.context,d,f,h),!0;case 5:return y.fn.call(y.context,d,f,h,p),!0;case 6:return y.fn.call(y.context,d,f,h,p,m),!0}for(w=1,k=new Array(v-1);w<v;w++)k[w-1]=arguments[w];y.fn.apply(y.context,k)}else{var j=y.length,S;for(w=0;w<j;w++)switch(y[w].once&&this.removeListener(u,y[w].fn,void 0,!0),v){case 1:y[w].fn.call(y[w].context);break;case 2:y[w].fn.call(y[w].context,d);break;case 3:y[w].fn.call(y[w].context,d,f);break;case 4:y[w].fn.call(y[w].context,d,f,h);break;default:if(!k)for(S=1,k=new Array(v-1);S<v;S++)k[S-1]=arguments[S];y[w].fn.apply(y[w].context,k)}}return!0},l.prototype.on=function(u,d,f){return s(this,u,d,f,!1)},l.prototype.once=function(u,d,f){return s(this,u,d,f,!0)},l.prototype.removeListener=function(u,d,f,h){var p=n?n+u:u;if(!this._events[p])return this;if(!d)return o(this,p),this;var m=this._events[p];if(m.fn)m.fn===d&&(!h||m.once)&&(!f||m.context===f)&&o(this,p);else{for(var g=0,y=[],v=m.length;g<v;g++)(m[g].fn!==d||h&&!m[g].once||f&&m[g].context!==f)&&y.push(m[g]);y.length?this._events[p]=y.length===1?y[0]:y:o(this,p)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=n?n+u:u,this._events[d]&&o(this,d)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l})(aM);var vie=aM.exports;const yie=Je(vie);var Dg=new yie,Bg="recharts.syncMouseEvents";function qu(e){"@babel/helpers - typeof";return qu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qu(e)}function bie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xie(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,iM(r.key),r)}}function wie(e,t,n){return t&&xie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function zg(e,t,n){return t=iM(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iM(e){var t=kie(e,"string");return qu(t)=="symbol"?t:t+""}function kie(e,t){if(qu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Sie=function(){function e(){bie(this,e),zg(this,"activeIndex",0),zg(this,"coordinateList",[]),zg(this,"layout","horizontal")}return wie(e,[{key:"setDetails",value:function(n){var r,a=n.coordinateList,s=a===void 0?null:a,o=n.container,l=o===void 0?null:o,c=n.layout,u=c===void 0?null:c,d=n.offset,f=d===void 0?null:d,h=n.mouseHandlerCallback,p=h===void 0?null:h;this.coordinateList=(r=s??this.coordinateList)!==null&&r!==void 0?r:[],this.container=l??this.container,this.layout=u??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=p??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var a=this.container.getBoundingClientRect(),s=a.x,o=a.y,l=a.height,c=this.coordinateList[this.activeIndex].coordinate,u=((n=window)===null||n===void 0?void 0:n.scrollX)||0,d=((r=window)===null||r===void 0?void 0:r.scrollY)||0,f=s+c+u,h=o+this.offset.top+l/2+d;this.mouseHandlerCallback({pageX:f,pageY:h})}}}])}();function jie(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e==null?void 0:e[0],a=e==null?void 0:e[1];if(r&&a&&de(r)&&de(a))return!0}return!1}function Nie(e,t,n,r){var a=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-a,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function sM(e){var t=e.cx,n=e.cy,r=e.radius,a=e.startAngle,s=e.endAngle,o=dn(t,n,r,a),l=dn(t,n,r,s);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:a,endAngle:s}}function Eie(e,t,n){var r,a,s,o;if(e==="horizontal")r=t.x,s=r,a=n.top,o=n.top+n.height;else if(e==="vertical")a=t.y,o=a,r=n.left,s=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,u=t.innerRadius,d=t.outerRadius,f=t.angle,h=dn(l,c,u,f),p=dn(l,c,d,f);r=h.x,a=h.y,s=p.x,o=p.y}else return sM(t);return[{x:r,y:a},{x:s,y:o}]}function Ku(e){"@babel/helpers - typeof";return Ku=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ku(e)}function GN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function rf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GN(Object(n),!0).forEach(function(r){_ie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _ie(e,t,n){return t=Cie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cie(e){var t=Aie(e,"string");return Ku(t)=="symbol"?t:t+""}function Aie(e,t){if(Ku(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ku(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Tie(e){var t,n,r=e.element,a=e.tooltipEventType,s=e.isActive,o=e.activeCoordinate,l=e.activePayload,c=e.offset,u=e.activeTooltipIndex,d=e.tooltipAxisBandSize,f=e.layout,h=e.chartName,p=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!p||!s||!o||h!=="ScatterChart"&&a!=="axis")return null;var m,g=G1;if(h==="ScatterChart")m=o,g=Wee;else if(h==="BarChart")m=Nie(f,o,c,d),g=r0;else if(f==="radial"){var y=sM(o),v=y.cx,k=y.cy,w=y.radius,j=y.startAngle,S=y.endAngle;m={cx:v,cy:k,startAngle:j,endAngle:S,innerRadius:w,outerRadius:w},g=dR}else m={points:Eie(f,o,c)},g=G1;var x=rf(rf(rf(rf({stroke:"#ccc",pointerEvents:"none"},c),m),Ve(p,!1)),{},{payload:l,payloadIndex:u,className:Ye("recharts-tooltip-cursor",p.className)});return b.isValidElement(p)?b.cloneElement(p,x):b.createElement(g,x)}var Oie=["item"],Pie=["children","className","width","height","style","compact","title","desc"];function vl(e){"@babel/helpers - typeof";return vl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vl(e)}function Po(){return Po=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Po.apply(this,arguments)}function qN(e,t){return Iie(e)||Mie(e,t)||lM(e,t)||Rie()}function Rie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
133
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function Iie(e){if(Array.isArray(e))return e}function KN(e,t){if(e==null)return{};var n=$ie(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function $ie(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Lie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Die(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,cM(r.key),r)}}function Bie(e,t,n){return t&&Die(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function zie(e,t,n){return t=lp(t),Fie(e,oM()?Reflect.construct(t,n||[],lp(e).constructor):t.apply(e,n))}function Fie(e,t){if(t&&(vl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Uie(e)}function Uie(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(oM=function(){return!!e})()}function lp(e){return lp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},lp(e)}function Wie(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fb(e,t)}function Fb(e,t){return Fb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Fb(e,t)}function yl(e){return qie(e)||Gie(e)||lM(e)||Hie()}function Hie(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
134
+ 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 Ub(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ub(e,t)}}function Gie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function qie(e){if(Array.isArray(e))return Ub(e)}function Ub(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function VN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function te(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VN(Object(n),!0).forEach(function(r){Te(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Te(e,t,n){return t=cM(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cM(e){var t=Kie(e,"string");return vl(t)=="symbol"?t:t+""}function Kie(e,t){if(vl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(vl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Vie={xAxis:["bottom","top"],yAxis:["left","right"]},Yie={width:"100%",height:"100%"},uM={x:0,y:0};function af(e){return e}var Xie=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Qie=function(t,n,r,a){var s=n.find(function(d){return d&&d.index===r});if(s){if(t==="horizontal")return{x:s.coordinate,y:a.y};if(t==="vertical")return{x:a.x,y:s.coordinate};if(t==="centric"){var o=s.coordinate,l=a.radius;return te(te(te({},a),dn(a.cx,a.cy,l,o)),{},{angle:o,radius:l})}var c=s.coordinate,u=a.angle;return te(te(te({},a),dn(a.cx,a.cy,c,u)),{},{angle:u,radius:c})}return uM},_m=function(t,n){var r=n.graphicalItems,a=n.dataStartIndex,s=n.dataEndIndex,o=(r??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(yl(l),yl(u)):l},[]);return o.length>0?o:t&&t.length&&de(a)&&de(s)?t.slice(a,s+1):[]};function dM(e){return e==="number"?[0,"auto"]:void 0}var Wb=function(t,n,r,a){var s=t.graphicalItems,o=t.tooltipAxis,l=_m(n,t);return r<0||!s||!s.length||r>=l.length?null:s.reduce(function(c,u){var d,f=(d=u.props.data)!==null&&d!==void 0?d:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var p=f===void 0?l:f;h=ky(p,o.dataKey,a)}else h=f&&f[r]||l[r];return h?[].concat(yl(c),[lR(u,h)]):c},[])},YN=function(t,n,r,a){var s=a||{x:t.chartX,y:t.chartY},o=Xie(s,r),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=wQ(o,l,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,h=Wb(t,n,d,f),p=Qie(r,l,d,s);return{activeTooltipIndex:d,activeLabel:f,activePayload:h,activeCoordinate:p}}return null},Zie=function(t,n){var r=n.axes,a=n.graphicalItems,s=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,h=t.stackOffset,p=iR(d,s);return r.reduce(function(m,g){var y,v=g.type.defaultProps!==void 0?te(te({},g.type.defaultProps),g.props):g.props,k=v.type,w=v.dataKey,j=v.allowDataOverflow,S=v.allowDuplicatedCategory,x=v.scale,N=v.ticks,E=v.includeHidden,P=v[o];if(m[P])return m;var _=_m(t.data,{graphicalItems:a.filter(function(F){var L,ie=o in F.props?F.props[o]:(L=F.type.defaultProps)===null||L===void 0?void 0:L[o];return ie===P}),dataStartIndex:c,dataEndIndex:u}),R=_.length,T,B,$;jie(v.domain,j,k)&&(T=cb(v.domain,null,j),p&&(k==="number"||x!=="auto")&&($=zc(_,w,"category")));var I=dM(k);if(!T||T.length===0){var D,U=(D=v.domain)!==null&&D!==void 0?D:I;if(w){if(T=zc(_,w,k),k==="category"&&p){var M=c3(T);S&&M?(B=T,T=Xh(0,R)):S||(T=P1(U,T,g).reduce(function(F,L){return F.indexOf(L)>=0?F:[].concat(yl(F),[L])},[]))}else if(k==="category")S?T=T.filter(function(F){return F!==""&&!Xe(F)}):T=P1(U,T,g).reduce(function(F,L){return F.indexOf(L)>=0||L===""||Xe(L)?F:[].concat(yl(F),[L])},[]);else if(k==="number"){var z=EQ(_,a.filter(function(F){var L,ie,fe=o in F.props?F.props[o]:(L=F.type.defaultProps)===null||L===void 0?void 0:L[o],ve="hide"in F.props?F.props.hide:(ie=F.type.defaultProps)===null||ie===void 0?void 0:ie.hide;return fe===P&&(E||!ve)}),w,s,d);z&&(T=z)}p&&(k==="number"||x!=="auto")&&($=zc(_,w,"category"))}else p?T=Xh(0,R):l&&l[P]&&l[P].hasStack&&k==="number"?T=h==="expand"?[0,1]:oR(l[P].stackGroups,c,u):T=aR(_,a.filter(function(F){var L=o in F.props?F.props[o]:F.type.defaultProps[o],ie="hide"in F.props?F.props.hide:F.type.defaultProps.hide;return L===P&&(E||!ie)}),k,d,!0);if(k==="number")T=zb(f,T,P,s,N),U&&(T=cb(U,T,j));else if(k==="category"&&U){var O=U,J=T.every(function(F){return O.indexOf(F)>=0});J&&(T=O)}}return te(te({},m),{},Te({},P,te(te({},v),{},{axisType:s,domain:T,categoricalDomain:$,duplicateDomain:B,originalDomain:(y=v.domain)!==null&&y!==void 0?y:I,isCategorical:p,layout:d})))},{})},Jie=function(t,n){var r=n.graphicalItems,a=n.Axis,s=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,h=_m(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:u}),p=h.length,m=iR(d,s),g=-1;return r.reduce(function(y,v){var k=v.type.defaultProps!==void 0?te(te({},v.type.defaultProps),v.props):v.props,w=k[o],j=dM("number");if(!y[w]){g++;var S;return m?S=Xh(0,p):l&&l[w]&&l[w].hasStack?(S=oR(l[w].stackGroups,c,u),S=zb(f,S,w,s)):(S=cb(j,aR(h,r.filter(function(x){var N,E,P=o in x.props?x.props[o]:(N=x.type.defaultProps)===null||N===void 0?void 0:N[o],_="hide"in x.props?x.props.hide:(E=x.type.defaultProps)===null||E===void 0?void 0:E.hide;return P===w&&!_}),"number",d),a.defaultProps.allowDataOverflow),S=zb(f,S,w,s)),te(te({},y),{},Te({},w,te(te({axisType:s},a.defaultProps),{},{hide:!0,orientation:wr(Vie,"".concat(s,".").concat(g%2),null),domain:S,originalDomain:j,isCategorical:m,layout:d})))}return y},{})},ese=function(t,n){var r=n.axisType,a=r===void 0?"xAxis":r,s=n.AxisComp,o=n.graphicalItems,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.children,f="".concat(a,"Id"),h=Fr(d,s),p={};return h&&h.length?p=Zie(t,{axes:h,graphicalItems:o,axisType:a,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(p=Jie(t,{Axis:s,graphicalItems:o,axisType:a,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),p},tse=function(t){var n=ui(t),r=Ra(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:Aw(r,function(a){return a.coordinate}),tooltipAxis:n,tooltipAxisBandSize:zh(n,r)}},XN=function(t){var n=t.children,r=t.defaultShowTooltip,a=Zn(n,cl),s=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(s=a.props.startIndex),a.props.endIndex>=0&&(o=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:s,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},nse=function(t){return!t||!t.length?!1:t.some(function(n){var r=Ia(n&&n.type);return r&&r.indexOf("Bar")>=0})},QN=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},rse=function(t,n){var r=t.props,a=t.graphicalItems,s=t.xAxisMap,o=s===void 0?{}:s,l=t.yAxisMap,c=l===void 0?{}:l,u=r.width,d=r.height,f=r.children,h=r.margin||{},p=Zn(f,cl),m=Zn(f,js),g=Object.keys(c).reduce(function(S,x){var N=c[x],E=N.orientation;return!N.mirror&&!N.hide?te(te({},S),{},Te({},E,S[E]+N.width)):S},{left:h.left||0,right:h.right||0}),y=Object.keys(o).reduce(function(S,x){var N=o[x],E=N.orientation;return!N.mirror&&!N.hide?te(te({},S),{},Te({},E,wr(S,"".concat(E))+N.height)):S},{top:h.top||0,bottom:h.bottom||0}),v=te(te({},y),g),k=v.bottom;p&&(v.bottom+=p.props.height||cl.defaultProps.height),m&&n&&(v=jQ(v,a,r,n));var w=u-v.left-v.right,j=d-v.top-v.bottom;return te(te({brushBottom:k},v),{},{width:Math.max(w,0),height:Math.max(j,0)})},ase=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},ise=function(t){var n=t.chartName,r=t.GraphicalChild,a=t.defaultTooltipEventType,s=a===void 0?"axis":a,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,f=t.defaultProps,h=function(v,k){var w=k.graphicalItems,j=k.stackGroups,S=k.offset,x=k.updateId,N=k.dataStartIndex,E=k.dataEndIndex,P=v.barSize,_=v.layout,R=v.barGap,T=v.barCategoryGap,B=v.maxBarSize,$=QN(_),I=$.numericAxisName,D=$.cateAxisName,U=nse(w),M=[];return w.forEach(function(z,O){var J=_m(v.data,{graphicalItems:[z],dataStartIndex:N,dataEndIndex:E}),F=z.type.defaultProps!==void 0?te(te({},z.type.defaultProps),z.props):z.props,L=F.dataKey,ie=F.maxBarSize,fe=F["".concat(I,"Id")],ve=F["".concat(D,"Id")],Ee={},ee=c.reduce(function(_e,pt){var We=k["".concat(pt.axisType,"Map")],lt=F["".concat(pt.axisType,"Id")];We&&We[lt]||pt.axisType==="zAxis"||Ds();var Yt=We[lt];return te(te({},_e),{},Te(Te({},pt.axisType,Yt),"".concat(pt.axisType,"Ticks"),Ra(Yt)))},Ee),Q=ee[D],ae=ee["".concat(D,"Ticks")],ce=j&&j[fe]&&j[fe].hasStack&&DQ(z,j[fe].stackGroups),G=Ia(z.type).indexOf("Bar")>=0,xe=zh(Q,ae),we=[],Pe=U&&kQ({barSize:P,stackGroups:j,totalSize:ase(ee,D)});if(G){var ge,Ie,me=Xe(ie)?B:ie,Qe=(ge=(Ie=zh(Q,ae,!0))!==null&&Ie!==void 0?Ie:me)!==null&&ge!==void 0?ge:0;we=SQ({barGap:R,barCategoryGap:T,bandSize:Qe!==xe?Qe:xe,sizeList:Pe[ve],maxBarSize:me}),Qe!==xe&&(we=we.map(function(_e){return te(te({},_e),{},{position:te(te({},_e.position),{},{offset:_e.position.offset-Qe/2})})}))}var De=z&&z.type&&z.type.getComposedData;De&&M.push({props:te(te({},De(te(te({},ee),{},{displayedData:J,props:v,dataKey:L,item:z,bandSize:xe,barPosition:we,offset:S,stackedData:ce,layout:_,dataStartIndex:N,dataEndIndex:E}))),{},Te(Te(Te({key:z.key||"item-".concat(O)},I,ee[I]),D,ee[D]),"animationId",x)),childIndex:w3(z,v.children),item:z})}),M},p=function(v,k){var w=v.props,j=v.dataStartIndex,S=v.dataEndIndex,x=v.updateId;if(!ES({props:w}))return null;var N=w.children,E=w.layout,P=w.stackOffset,_=w.data,R=w.reverseStackOrder,T=QN(E),B=T.numericAxisName,$=T.cateAxisName,I=Fr(N,r),D=IQ(_,I,"".concat(B,"Id"),"".concat($,"Id"),P,R),U=c.reduce(function(F,L){var ie="".concat(L.axisType,"Map");return te(te({},F),{},Te({},ie,ese(w,te(te({},L),{},{graphicalItems:I,stackGroups:L.axisType===B&&D,dataStartIndex:j,dataEndIndex:S}))))},{}),M=rse(te(te({},U),{},{props:w,graphicalItems:I}),k==null?void 0:k.legendBBox);Object.keys(U).forEach(function(F){U[F]=d(w,U[F],M,F.replace("Map",""),n)});var z=U["".concat($,"Map")],O=tse(z),J=h(w,te(te({},U),{},{dataStartIndex:j,dataEndIndex:S,updateId:x,graphicalItems:I,stackGroups:D,offset:M}));return te(te({formattedGraphicalItems:J,graphicalItems:I,offset:M,stackGroups:D},O),U)},m=function(y){function v(k){var w,j,S;return Lie(this,v),S=zie(this,v,[k]),Te(S,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Te(S,"accessibilityManager",new Sie),Te(S,"handleLegendBBoxUpdate",function(x){if(x){var N=S.state,E=N.dataStartIndex,P=N.dataEndIndex,_=N.updateId;S.setState(te({legendBBox:x},p({props:S.props,dataStartIndex:E,dataEndIndex:P,updateId:_},te(te({},S.state),{},{legendBBox:x}))))}}),Te(S,"handleReceiveSyncEvent",function(x,N,E){if(S.props.syncId===x){if(E===S.eventEmitterSymbol&&typeof S.props.syncMethod!="function")return;S.applySyncEvent(N)}}),Te(S,"handleBrushChange",function(x){var N=x.startIndex,E=x.endIndex;if(N!==S.state.dataStartIndex||E!==S.state.dataEndIndex){var P=S.state.updateId;S.setState(function(){return te({dataStartIndex:N,dataEndIndex:E},p({props:S.props,dataStartIndex:N,dataEndIndex:E,updateId:P},S.state))}),S.triggerSyncEvent({dataStartIndex:N,dataEndIndex:E})}}),Te(S,"handleMouseEnter",function(x){var N=S.getMouseInfo(x);if(N){var E=te(te({},N),{},{isTooltipActive:!0});S.setState(E),S.triggerSyncEvent(E);var P=S.props.onMouseEnter;Be(P)&&P(E,x)}}),Te(S,"triggeredAfterMouseMove",function(x){var N=S.getMouseInfo(x),E=N?te(te({},N),{},{isTooltipActive:!0}):{isTooltipActive:!1};S.setState(E),S.triggerSyncEvent(E);var P=S.props.onMouseMove;Be(P)&&P(E,x)}),Te(S,"handleItemMouseEnter",function(x){S.setState(function(){return{isTooltipActive:!0,activeItem:x,activePayload:x.tooltipPayload,activeCoordinate:x.tooltipPosition||{x:x.cx,y:x.cy}}})}),Te(S,"handleItemMouseLeave",function(){S.setState(function(){return{isTooltipActive:!1}})}),Te(S,"handleMouseMove",function(x){x.persist(),S.throttleTriggeredAfterMouseMove(x)}),Te(S,"handleMouseLeave",function(x){S.throttleTriggeredAfterMouseMove.cancel();var N={isTooltipActive:!1};S.setState(N),S.triggerSyncEvent(N);var E=S.props.onMouseLeave;Be(E)&&E(N,x)}),Te(S,"handleOuterEvent",function(x){var N=x3(x),E=wr(S.props,"".concat(N));if(N&&Be(E)){var P,_;/.*touch.*/i.test(N)?_=S.getMouseInfo(x.changedTouches[0]):_=S.getMouseInfo(x),E((P=_)!==null&&P!==void 0?P:{},x)}}),Te(S,"handleClick",function(x){var N=S.getMouseInfo(x);if(N){var E=te(te({},N),{},{isTooltipActive:!0});S.setState(E),S.triggerSyncEvent(E);var P=S.props.onClick;Be(P)&&P(E,x)}}),Te(S,"handleMouseDown",function(x){var N=S.props.onMouseDown;if(Be(N)){var E=S.getMouseInfo(x);N(E,x)}}),Te(S,"handleMouseUp",function(x){var N=S.props.onMouseUp;if(Be(N)){var E=S.getMouseInfo(x);N(E,x)}}),Te(S,"handleTouchMove",function(x){x.changedTouches!=null&&x.changedTouches.length>0&&S.throttleTriggeredAfterMouseMove(x.changedTouches[0])}),Te(S,"handleTouchStart",function(x){x.changedTouches!=null&&x.changedTouches.length>0&&S.handleMouseDown(x.changedTouches[0])}),Te(S,"handleTouchEnd",function(x){x.changedTouches!=null&&x.changedTouches.length>0&&S.handleMouseUp(x.changedTouches[0])}),Te(S,"handleDoubleClick",function(x){var N=S.props.onDoubleClick;if(Be(N)){var E=S.getMouseInfo(x);N(E,x)}}),Te(S,"handleContextMenu",function(x){var N=S.props.onContextMenu;if(Be(N)){var E=S.getMouseInfo(x);N(E,x)}}),Te(S,"triggerSyncEvent",function(x){S.props.syncId!==void 0&&Dg.emit(Bg,S.props.syncId,x,S.eventEmitterSymbol)}),Te(S,"applySyncEvent",function(x){var N=S.props,E=N.layout,P=N.syncMethod,_=S.state.updateId,R=x.dataStartIndex,T=x.dataEndIndex;if(x.dataStartIndex!==void 0||x.dataEndIndex!==void 0)S.setState(te({dataStartIndex:R,dataEndIndex:T},p({props:S.props,dataStartIndex:R,dataEndIndex:T,updateId:_},S.state)));else if(x.activeTooltipIndex!==void 0){var B=x.chartX,$=x.chartY,I=x.activeTooltipIndex,D=S.state,U=D.offset,M=D.tooltipTicks;if(!U)return;if(typeof P=="function")I=P(M,x);else if(P==="value"){I=-1;for(var z=0;z<M.length;z++)if(M[z].value===x.activeLabel){I=z;break}}var O=te(te({},U),{},{x:U.left,y:U.top}),J=Math.min(B,O.x+O.width),F=Math.min($,O.y+O.height),L=M[I]&&M[I].value,ie=Wb(S.state,S.props.data,I),fe=M[I]?{x:E==="horizontal"?M[I].coordinate:J,y:E==="horizontal"?F:M[I].coordinate}:uM;S.setState(te(te({},x),{},{activeLabel:L,activeCoordinate:fe,activePayload:ie,activeTooltipIndex:I}))}else S.setState(x)}),Te(S,"renderCursor",function(x){var N,E=S.state,P=E.isTooltipActive,_=E.activeCoordinate,R=E.activePayload,T=E.offset,B=E.activeTooltipIndex,$=E.tooltipAxisBandSize,I=S.getTooltipEventType(),D=(N=x.props.active)!==null&&N!==void 0?N:P,U=S.props.layout,M=x.key||"_recharts-cursor";return X.createElement(Tie,{key:M,activeCoordinate:_,activePayload:R,activeTooltipIndex:B,chartName:n,element:x,isActive:D,layout:U,offset:T,tooltipAxisBandSize:$,tooltipEventType:I})}),Te(S,"renderPolarAxis",function(x,N,E){var P=wr(x,"type.axisType"),_=wr(S.state,"".concat(P,"Map")),R=x.type.defaultProps,T=R!==void 0?te(te({},R),x.props):x.props,B=_&&_[T["".concat(P,"Id")]];return b.cloneElement(x,te(te({},B),{},{className:Ye(P,B.className),key:x.key||"".concat(N,"-").concat(E),ticks:Ra(B,!0)}))}),Te(S,"renderPolarGrid",function(x){var N=x.props,E=N.radialLines,P=N.polarAngles,_=N.polarRadius,R=S.state,T=R.radiusAxisMap,B=R.angleAxisMap,$=ui(T),I=ui(B),D=I.cx,U=I.cy,M=I.innerRadius,z=I.outerRadius;return b.cloneElement(x,{polarAngles:Array.isArray(P)?P:Ra(I,!0).map(function(O){return O.coordinate}),polarRadius:Array.isArray(_)?_:Ra($,!0).map(function(O){return O.coordinate}),cx:D,cy:U,innerRadius:M,outerRadius:z,key:x.key||"polar-grid",radialLines:E})}),Te(S,"renderLegend",function(){var x=S.state.formattedGraphicalItems,N=S.props,E=N.children,P=N.width,_=N.height,R=S.props.margin||{},T=P-(R.left||0)-(R.right||0),B=nR({children:E,formattedGraphicalItems:x,legendWidth:T,legendContent:u});if(!B)return null;var $=B.item,I=KN(B,Oie);return b.cloneElement($,te(te({},I),{},{chartWidth:P,chartHeight:_,margin:R,onBBoxUpdate:S.handleLegendBBoxUpdate}))}),Te(S,"renderTooltip",function(){var x,N=S.props,E=N.children,P=N.accessibilityLayer,_=Zn(E,bn);if(!_)return null;var R=S.state,T=R.isTooltipActive,B=R.activeCoordinate,$=R.activePayload,I=R.activeLabel,D=R.offset,U=(x=_.props.active)!==null&&x!==void 0?x:T;return b.cloneElement(_,{viewBox:te(te({},D),{},{x:D.left,y:D.top}),active:U,label:I,payload:U?$:[],coordinate:B,accessibilityLayer:P})}),Te(S,"renderBrush",function(x){var N=S.props,E=N.margin,P=N.data,_=S.state,R=_.offset,T=_.dataStartIndex,B=_.dataEndIndex,$=_.updateId;return b.cloneElement(x,{key:x.key||"_recharts-brush",onChange:Jd(S.handleBrushChange,x.props.onChange),data:P,x:de(x.props.x)?x.props.x:R.left,y:de(x.props.y)?x.props.y:R.top+R.height+R.brushBottom-(E.bottom||0),width:de(x.props.width)?x.props.width:R.width,startIndex:T,endIndex:B,updateId:"brush-".concat($)})}),Te(S,"renderReferenceElement",function(x,N,E){if(!x)return null;var P=S,_=P.clipPathId,R=S.state,T=R.xAxisMap,B=R.yAxisMap,$=R.offset,I=x.type.defaultProps||{},D=x.props,U=D.xAxisId,M=U===void 0?I.xAxisId:U,z=D.yAxisId,O=z===void 0?I.yAxisId:z;return b.cloneElement(x,{key:x.key||"".concat(N,"-").concat(E),xAxis:T[M],yAxis:B[O],viewBox:{x:$.left,y:$.top,width:$.width,height:$.height},clipPathId:_})}),Te(S,"renderActivePoints",function(x){var N=x.item,E=x.activePoint,P=x.basePoint,_=x.childIndex,R=x.isRange,T=[],B=N.props.key,$=N.item.type.defaultProps!==void 0?te(te({},N.item.type.defaultProps),N.item.props):N.item.props,I=$.activeDot,D=$.dataKey,U=te(te({index:_,dataKey:D,cx:E.x,cy:E.y,r:4,fill:n0(N.item),strokeWidth:2,stroke:"#fff",payload:E.payload,value:E.value},Ve(I,!1)),uh(I));return T.push(v.renderActiveDot(I,U,"".concat(B,"-activePoint-").concat(_))),P?T.push(v.renderActiveDot(I,te(te({},U),{},{cx:P.x,cy:P.y}),"".concat(B,"-basePoint-").concat(_))):R&&T.push(null),T}),Te(S,"renderGraphicChild",function(x,N,E){var P=S.filterFormatItem(x,N,E);if(!P)return null;var _=S.getTooltipEventType(),R=S.state,T=R.isTooltipActive,B=R.tooltipAxis,$=R.activeTooltipIndex,I=R.activeLabel,D=S.props.children,U=Zn(D,bn),M=P.props,z=M.points,O=M.isRange,J=M.baseLine,F=P.item.type.defaultProps!==void 0?te(te({},P.item.type.defaultProps),P.item.props):P.item.props,L=F.activeDot,ie=F.hide,fe=F.activeBar,ve=F.activeShape,Ee=!!(!ie&&T&&U&&(L||fe||ve)),ee={};_!=="axis"&&U&&U.props.trigger==="click"?ee={onClick:Jd(S.handleItemMouseEnter,x.props.onClick)}:_!=="axis"&&(ee={onMouseLeave:Jd(S.handleItemMouseLeave,x.props.onMouseLeave),onMouseEnter:Jd(S.handleItemMouseEnter,x.props.onMouseEnter)});var Q=b.cloneElement(x,te(te({},P.props),ee));function ae(pt){return typeof B.dataKey=="function"?B.dataKey(pt.payload):null}if(Ee)if($>=0){var ce,G;if(B.dataKey&&!B.allowDuplicatedCategory){var xe=typeof B.dataKey=="function"?ae:"payload.".concat(B.dataKey.toString());ce=ky(z,xe,I),G=O&&J&&ky(J,xe,I)}else ce=z==null?void 0:z[$],G=O&&J&&J[$];if(ve||fe){var we=x.props.activeIndex!==void 0?x.props.activeIndex:$;return[b.cloneElement(x,te(te(te({},P.props),ee),{},{activeIndex:we})),null,null]}if(!Xe(ce))return[Q].concat(yl(S.renderActivePoints({item:P,activePoint:ce,basePoint:G,childIndex:$,isRange:O})))}else{var Pe,ge=(Pe=S.getItemByXY(S.state.activeCoordinate))!==null&&Pe!==void 0?Pe:{graphicalItem:Q},Ie=ge.graphicalItem,me=Ie.item,Qe=me===void 0?x:me,De=Ie.childIndex,_e=te(te(te({},P.props),ee),{},{activeIndex:De});return[b.cloneElement(Qe,_e),null,null]}return O?[Q,null,null]:[Q,null]}),Te(S,"renderCustomized",function(x,N,E){return b.cloneElement(x,te(te({key:"recharts-customized-".concat(E)},S.props),S.state))}),Te(S,"renderMap",{CartesianGrid:{handler:af,once:!0},ReferenceArea:{handler:S.renderReferenceElement},ReferenceLine:{handler:af},ReferenceDot:{handler:S.renderReferenceElement},XAxis:{handler:af},YAxis:{handler:af},Brush:{handler:S.renderBrush,once:!0},Bar:{handler:S.renderGraphicChild},Line:{handler:S.renderGraphicChild},Area:{handler:S.renderGraphicChild},Radar:{handler:S.renderGraphicChild},RadialBar:{handler:S.renderGraphicChild},Scatter:{handler:S.renderGraphicChild},Pie:{handler:S.renderGraphicChild},Funnel:{handler:S.renderGraphicChild},Tooltip:{handler:S.renderCursor,once:!0},PolarGrid:{handler:S.renderPolarGrid,once:!0},PolarAngleAxis:{handler:S.renderPolarAxis},PolarRadiusAxis:{handler:S.renderPolarAxis},Customized:{handler:S.renderCustomized}}),S.clipPathId="".concat((w=k.id)!==null&&w!==void 0?w:tm("recharts"),"-clip"),S.throttleTriggeredAfterMouseMove=rP(S.triggeredAfterMouseMove,(j=k.throttleDelay)!==null&&j!==void 0?j:1e3/60),S.state={},S}return Wie(v,y),Bie(v,[{key:"componentDidMount",value:function(){var w,j;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(j=this.props.margin.top)!==null&&j!==void 0?j:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var w=this.props,j=w.children,S=w.data,x=w.height,N=w.layout,E=Zn(j,bn);if(E){var P=E.props.defaultIndex;if(!(typeof P!="number"||P<0||P>this.state.tooltipTicks.length-1)){var _=this.state.tooltipTicks[P]&&this.state.tooltipTicks[P].value,R=Wb(this.state,S,P,_),T=this.state.tooltipTicks[P].coordinate,B=(this.state.offset.top+x)/2,$=N==="horizontal",I=$?{x:T,y:B}:{y:T,x:B},D=this.state.formattedGraphicalItems.find(function(M){var z=M.item;return z.type.name==="Scatter"});D&&(I=te(te({},I),D.props.points[P].tooltipPosition),R=D.props.points[P].tooltipPayload);var U={activeTooltipIndex:P,isTooltipActive:!0,activeLabel:_,activePayload:R,activeCoordinate:I};this.setState(U),this.renderCursor(E),this.accessibilityManager.setIndex(P)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,j){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==j.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var S,x;this.accessibilityManager.setDetails({offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(x=this.props.margin.top)!==null&&x!==void 0?x:0}})}return null}},{key:"componentDidUpdate",value:function(w){jy([Zn(w.children,bn)],[Zn(this.props.children,bn)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=Zn(this.props.children,bn);if(w&&typeof w.props.shared=="boolean"){var j=w.props.shared?"axis":"item";return l.indexOf(j)>=0?j:s}return s}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var j=this.container,S=j.getBoundingClientRect(),x=KK(S),N={chartX:Math.round(w.pageX-x.left),chartY:Math.round(w.pageY-x.top)},E=S.width/j.offsetWidth||1,P=this.inRange(N.chartX,N.chartY,E);if(!P)return null;var _=this.state,R=_.xAxisMap,T=_.yAxisMap,B=this.getTooltipEventType(),$=YN(this.state,this.props.data,this.props.layout,P);if(B!=="axis"&&R&&T){var I=ui(R).scale,D=ui(T).scale,U=I&&I.invert?I.invert(N.chartX):null,M=D&&D.invert?D.invert(N.chartY):null;return te(te({},N),{},{xValue:U,yValue:M},$)}return $?te(te({},N),$):null}},{key:"inRange",value:function(w,j){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,x=this.props.layout,N=w/S,E=j/S;if(x==="horizontal"||x==="vertical"){var P=this.state.offset,_=N>=P.left&&N<=P.left+P.width&&E>=P.top&&E<=P.top+P.height;return _?{x:N,y:E}:null}var R=this.state,T=R.angleAxisMap,B=R.radiusAxisMap;if(T&&B){var $=ui(T);return I1({x:N,y:E},$)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,j=this.getTooltipEventType(),S=Zn(w,bn),x={};S&&j==="axis"&&(S.props.trigger==="click"?x={onClick:this.handleClick}:x={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var N=uh(this.props,this.handleOuterEvent);return te(te({},N),x)}},{key:"addListener",value:function(){Dg.on(Bg,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Dg.removeListener(Bg,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,j,S){for(var x=this.state.formattedGraphicalItems,N=0,E=x.length;N<E;N++){var P=x[N];if(P.item===w||P.props.key===w.key||j===Ia(P.item.type)&&S===P.childIndex)return P}return null}},{key:"renderClipPath",value:function(){var w=this.clipPathId,j=this.state.offset,S=j.left,x=j.top,N=j.height,E=j.width;return X.createElement("defs",null,X.createElement("clipPath",{id:w},X.createElement("rect",{x:S,y:x,height:N,width:E})))}},{key:"getXScales",value:function(){var w=this.state.xAxisMap;return w?Object.entries(w).reduce(function(j,S){var x=qN(S,2),N=x[0],E=x[1];return te(te({},j),{},Te({},N,E.scale))},{}):null}},{key:"getYScales",value:function(){var w=this.state.yAxisMap;return w?Object.entries(w).reduce(function(j,S){var x=qN(S,2),N=x[0],E=x[1];return te(te({},j),{},Te({},N,E.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(w){var j;return(j=this.state.xAxisMap)===null||j===void 0||(j=j[w])===null||j===void 0?void 0:j.scale}},{key:"getYScaleByAxisId",value:function(w){var j;return(j=this.state.yAxisMap)===null||j===void 0||(j=j[w])===null||j===void 0?void 0:j.scale}},{key:"getItemByXY",value:function(w){var j=this.state,S=j.formattedGraphicalItems,x=j.activeItem;if(S&&S.length)for(var N=0,E=S.length;N<E;N++){var P=S[N],_=P.props,R=P.item,T=R.type.defaultProps!==void 0?te(te({},R.type.defaultProps),R.props):R.props,B=Ia(R.type);if(B==="Bar"){var $=(_.data||[]).find(function(M){return Ree(w,M)});if($)return{graphicalItem:P,payload:$}}else if(B==="RadialBar"){var I=(_.data||[]).find(function(M){return I1(w,M)});if(I)return{graphicalItem:P,payload:I}}else if(xm(P,x)||wm(P,x)||Fu(P,x)){var D=$te({graphicalItem:P,activeTooltipItem:x,itemData:T.data}),U=T.activeIndex===void 0?D:T.activeIndex;return{graphicalItem:te(te({},P),{},{childIndex:U}),payload:Fu(P,x)?T.data[D]:P.props.data[D]}}}return null}},{key:"render",value:function(){var w=this;if(!ES(this))return null;var j=this.props,S=j.children,x=j.className,N=j.width,E=j.height,P=j.style,_=j.compact,R=j.title,T=j.desc,B=KN(j,Pie),$=Ve(B,!1);if(_)return X.createElement(ON,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},X.createElement(Ey,Po({},$,{width:N,height:E,title:R,desc:T}),this.renderClipPath(),CS(S,this.renderMap)));if(this.props.accessibilityLayer){var I,D;$.tabIndex=(I=this.props.tabIndex)!==null&&I!==void 0?I:0,$.role=(D=this.props.role)!==null&&D!==void 0?D:"application",$.onKeyDown=function(M){w.accessibilityManager.keyboardEvent(M)},$.onFocus=function(){w.accessibilityManager.focus()}}var U=this.parseEventsOfWrapper();return X.createElement(ON,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},X.createElement("div",Po({className:Ye("recharts-wrapper",x),style:te({position:"relative",cursor:"default",width:N,height:E},P)},U,{ref:function(z){w.container=z}}),X.createElement(Ey,Po({},$,{width:N,height:E,title:R,desc:T,style:Yie}),this.renderClipPath(),CS(S,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(b.Component);Te(m,"displayName",n),Te(m,"defaultProps",te({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),Te(m,"getDerivedStateFromProps",function(y,v){var k=y.dataKey,w=y.data,j=y.children,S=y.width,x=y.height,N=y.layout,E=y.stackOffset,P=y.margin,_=v.dataStartIndex,R=v.dataEndIndex;if(v.updateId===void 0){var T=XN(y);return te(te(te({},T),{},{updateId:0},p(te(te({props:y},T),{},{updateId:0}),v)),{},{prevDataKey:k,prevData:w,prevWidth:S,prevHeight:x,prevLayout:N,prevStackOffset:E,prevMargin:P,prevChildren:j})}if(k!==v.prevDataKey||w!==v.prevData||S!==v.prevWidth||x!==v.prevHeight||N!==v.prevLayout||E!==v.prevStackOffset||!zo(P,v.prevMargin)){var B=XN(y),$={chartX:v.chartX,chartY:v.chartY,isTooltipActive:v.isTooltipActive},I=te(te({},YN(v,w,N)),{},{updateId:v.updateId+1}),D=te(te(te({},B),$),I);return te(te(te({},D),p(te({props:y},D),v)),{},{prevDataKey:k,prevData:w,prevWidth:S,prevHeight:x,prevLayout:N,prevStackOffset:E,prevMargin:P,prevChildren:j})}if(!jy(j,v.prevChildren)){var U,M,z,O,J=Zn(j,cl),F=J&&(U=(M=J.props)===null||M===void 0?void 0:M.startIndex)!==null&&U!==void 0?U:_,L=J&&(z=(O=J.props)===null||O===void 0?void 0:O.endIndex)!==null&&z!==void 0?z:R,ie=F!==_||L!==R,fe=!Xe(w),ve=fe&&!ie?v.updateId:v.updateId+1;return te(te({updateId:ve},p(te(te({props:y},v),{},{updateId:ve,dataStartIndex:F,dataEndIndex:L}),v)),{},{prevChildren:j,dataStartIndex:F,dataEndIndex:L})}return null}),Te(m,"renderActiveDot",function(y,v,k){var w;return b.isValidElement(y)?w=b.cloneElement(y,v):Be(y)?w=y(v):w=X.createElement(kR,v),X.createElement(en,{className:"recharts-active-dot",key:k},w)});var g=b.forwardRef(function(v,k){return X.createElement(m,Po({},v,{ref:k}))});return g.displayName=m.displayName,g},fs=ise({chartName:"BarChart",GraphicalChild:yn,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:oa},{axisType:"yAxis",AxisComp:la}],formatAxisMap:ore});const sse=new Intl.NumberFormat("en-US");function bt(e){return sse.format(e)}function Hb(e){return e==null||e<1e-5?"$0.00":e<.01?"$"+e.toFixed(6):"$"+e.toFixed(4)}function Gb(e){if(!Number.isFinite(e)||e<0)return"0s";const t=Math.floor(e/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60);return n<60?`${n}m ${String(t%60).padStart(2,"0")}s`:`${Math.floor(n/60)}h ${String(n%60).padStart(2,"0")}m`}function tt(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":bt(e)}function ose(e,t){var a,s;const n=[];if(t){const o=t.toolsets.toolsets.filter(l=>l.enabled).reduce((l,c)=>l+c.toolCount,0);n.push({key:"tools",icon:"🔧",value:tt(o),label:"Active Tools",tone:"accent"})}const r=((a=t==null?void 0:t.conversations)==null?void 0:a.total)??((s=e==null?void 0:e.conversations)==null?void 0:s.total);if(r!==void 0&&n.push({key:"conversations",icon:"💬",value:tt(r),label:"Active Conversations",tone:"ok"}),t&&n.push({key:"skills",icon:"🧩",value:tt(t.skills.total),label:"Skills Loaded",tone:"warn"}),e){const o=e.cost,l=o.billedUsd!==void 0;n.push({key:"cost",icon:"💰",value:Hb(l?o.billedUsd:o.totalCost),label:l?"Billed":"Total Cost",tone:"danger"})}return n}function Wi({tiles:e}){return e.length===0?null:i.jsx("ul",{className:"metric-tiles",children:e.map(t=>i.jsxs("li",{className:`metric-tile metric-tile--${t.tone}`,children:[i.jsx("span",{className:"metric-tile-icon","aria-hidden":"true",children:t.icon}),i.jsxs("span",{children:[i.jsx("span",{className:"metric-tile-value",children:t.value}),i.jsx("span",{className:"metric-tile-label",children:t.label})]})]},t.key))})}function Oe({icon:e,title:t,description:n,actions:r}){return i.jsxs("header",{className:"page-header",children:[i.jsxs("div",{className:"page-header-text",children:[i.jsxs("h1",{className:"page-header-title",children:[i.jsx("span",{"aria-hidden":"true",children:e})," ",t]}),n?i.jsx("p",{className:"page-header-description",children:n}):null]}),r?i.jsx("div",{className:"page-header-actions",children:r}):null]})}const lse=6e4;function h0(e=lse){const[t,n]=b.useState(null);return b.useEffect(()=>{let r=!1;const a=()=>{fetch("/api/model-counts").then(o=>o.ok?o.json():null).then(o=>{!r&&o&&typeof o.trackedModels=="number"&&n(o)}).catch(()=>{})};a();const s=setInterval(a,e);return()=>{r=!0,clearInterval(s)}},[e]),t}function qr(){const[e,t]=b.useState(uB);return b.useEffect(()=>dB(t),[]),e}const cse={local:"var(--accent-green)",groq:"var(--accent-blue)",gemini:"var(--accent-purple)",nim:"var(--accent-cyan)",openrouter:"var(--accent-yellow)"};function ZN(e){if(!e)return!1;const t=new Date;return t.setHours(0,0,0,0),e>=t.getTime()}function Fg({title:e,children:t,action:n}){return i.jsxs("section",{className:"summary-card",children:[i.jsx("h2",{className:"summary-card-title",children:e}),i.jsx("div",{className:"summary-rows",children:t}),n?i.jsx("div",{className:"summary-card-action",children:n}):null]})}function Vn({value:e,label:t}){return i.jsxs("p",{className:"summary-row",children:[i.jsx("span",{className:"summary-row-value",children:e}),i.jsx("span",{className:"summary-row-label",children:t})]})}function use({data:e,onRefresh:t,refreshing:n=!1}){var _,R,T,B,$;const[r,a]=b.useState(null),[s,o]=b.useState(null),l=h0(),c=qr();if(b.useEffect(()=>{let I=!1;return K.fetchHub().then(D=>{!I&&D&&a(D)}),K.listTasks().then(D=>{!I&&D&&o(D)}),()=>{I=!0}},[c]),!e)return i.jsxs(i.Fragment,{children:[i.jsx(Oe,{icon:"📊",title:"System Overview",description:"Cost, memory, benchmarks and routing — read live from the dashboard server."}),i.jsxs("div",{className:"loading-state",children:[i.jsx("div",{className:"loading-spinner"}),i.jsx("p",{children:"Connecting to dashboard..."})]})]});const{cost:u,history:d,benchmarks:f,memory:h,health:p}=e,m=[{icon:"💰",value:Hb(u.billedUsd??u.totalCost),label:u.billedUsd!==void 0?"Billed":"Total Cost"},{icon:"📞",value:tt(u.totalRequests),label:"API Requests"},{icon:"🧠",value:tt(h.total),label:"Trajectories"},{icon:"📝",value:tt(d.total),label:"Chat Sessions"},{icon:"🏆",value:tt(f.totalRuns),label:"Benchmark Runs"},{icon:"📦",value:tt(p.vectors),label:"Vector Entries"}],g=Object.entries(u.byProvider||{}).map(([I,D])=>({name:I,value:D})).sort((I,D)=>D.value-I.value),y=Object.entries(h.byFingerprint||{}).map(([I,D])=>({name:I.length>15?I.slice(0,13)+"..":I,value:D})).sort((I,D)=>D.value-I.value).slice(0,8),v=ose(e,r),k=(s==null?void 0:s.tasks)??[],w=s!==null&&s.status===401,j=k.filter(I=>I.status==="running").length,S=k.filter(I=>ZN(I.finishedAt)&&(I.status==="failed"||I.status==="error")).length,x=k.filter(I=>ZN(I.finishedAt)&&I.status==="done").length,N=e.modelRegistry,E=((_=r==null?void 0:r.channels)==null?void 0:_.platforms)??[],P=E.filter(I=>I.configured).length;return i.jsxs(i.Fragment,{children:[i.jsx(Oe,{icon:"📊",title:"System Overview",description:"Cost, memory, benchmarks and routing — read live from the dashboard server.",actions:t?i.jsx("button",{type:"button",className:"btn-secondary",onClick:t,disabled:n,"aria-busy":n,children:n?"Refreshing…":"⟳ Refresh data"}):null}),i.jsx(Wi,{tiles:v}),i.jsxs("div",{className:"overview-summary",children:[i.jsxs("div",{className:"summary-cards",children:[i.jsx(Fg,{title:"Task Summary",action:i.jsx(Jt,{className:"summary-card-link",to:"/tasks",children:"Open console →"}),children:w?i.jsx("p",{className:"summary-note",children:"Sign in to Admin to see task history."}):s===null?i.jsx("p",{className:"summary-note",children:"Loading task history…"}):i.jsxs(i.Fragment,{children:[i.jsx(Vn,{value:tt(j),label:"Running now"}),i.jsx(Vn,{value:tt(x),label:"Completed today"}),S>0&&i.jsx(Vn,{value:tt(S),label:"Failed today"})]})}),N&&i.jsxs(Fg,{title:"Models",action:i.jsx(Jt,{className:"summary-card-link",to:"/models",children:"Manage →"}),children:[i.jsx(Vn,{value:tt(N.routableNow??N.verified),label:"Routable now"}),i.jsx(Vn,{value:tt(N.verified),label:"Verified (proven)"}),i.jsx(Vn,{value:tt((l==null?void 0:l.trackedModels)??N.total),label:"Tracked models (registry)"}),i.jsx(Vn,{value:tt((l==null?void 0:l.trackedProviders)??((R=N.providers)==null?void 0:R.length)??0),label:"Tracked providers (registry)"}),l&&i.jsxs(i.Fragment,{children:[i.jsx(Vn,{value:tt(l.listedModels),label:"Listed models (live probe)"}),i.jsx(Vn,{value:tt(l.listedProviders),label:"Listed providers (live probe)"})]}),N.parked>0&&i.jsx(Vn,{value:tt(N.parked),label:"Quota-parked"})]}),r&&i.jsxs(Fg,{title:"Gateway Status",action:i.jsx(Jt,{className:"summary-card-link",to:"/gateway",children:"Gateway ops →"}),children:[i.jsx(Vn,{value:`${P}/${E.length}`,label:"Platforms configured"}),i.jsx(Vn,{value:tt(r.skills.total),label:"Skills loaded"}),i.jsx(Vn,{value:tt(r.toolsets.enabled),label:"Toolsets enabled"})]})]}),i.jsxs("aside",{className:"quick-actions","aria-labelledby":"quick-actions-title",children:[i.jsx("h2",{className:"summary-card-title",id:"quick-actions-title",children:"Quick Actions"}),i.jsxs(Jt,{className:"quick-action",to:"/tasks",children:[i.jsx("span",{"aria-hidden":"true",children:"🚀"})," Run a CLI command"]}),i.jsxs(Jt,{className:"quick-action",to:"/hub",children:[i.jsx("span",{"aria-hidden":"true",children:"🧰"})," Skills & channels"]}),i.jsxs(Jt,{className:"quick-action",to:"/models",children:[i.jsx("span",{"aria-hidden":"true",children:"🧠"})," Model registry"]}),i.jsxs(Jt,{className:"quick-action",to:"/traces",children:[i.jsx("span",{"aria-hidden":"true",children:"🔍"})," Reasoning traces"]}),i.jsxs(Jt,{className:"quick-action",to:"/system",children:[i.jsx("span",{"aria-hidden":"true",children:"⚙️"})," Doctor checks"]})]})]}),i.jsx("h2",{className:"section-subtitle",children:"Key metrics"}),i.jsx("div",{className:"stats-grid",children:m.map(I=>i.jsxs("div",{className:"stat-card",children:[i.jsx("div",{className:"stat-icon",children:I.icon}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",children:I.value}),i.jsx("div",{className:"stat-label",children:I.label})]})]},I.label))}),i.jsxs("div",{className:"memory-health-card",children:[i.jsx("h2",{className:"section-subtitle",children:"🧠 Memory Health"}),i.jsxs("div",{className:"memory-health-stats",children:[i.jsxs("div",{className:"memory-health-stat",children:[i.jsx("span",{className:"memory-health-value",children:tt(h.total)}),i.jsx("span",{className:"memory-health-label",children:"Trajectories"})]}),i.jsxs("div",{className:"memory-health-stat",children:[i.jsx("span",{className:"memory-health-value",children:tt(((T=h.facts)==null?void 0:T.total)||0)}),i.jsx("span",{className:"memory-health-label",children:"Facts Learned"})]}),i.jsxs("div",{className:"memory-health-stat",children:[i.jsx("span",{className:"memory-health-value",children:tt(((B=h.recall)==null?void 0:B.last7d)||0)}),i.jsx("span",{className:"memory-health-label",children:"Recalls This Week"})]}),i.jsxs("div",{className:"memory-health-stat",children:[i.jsx("span",{className:"memory-health-value",children:p.patterns||0}),i.jsx("span",{className:"memory-health-label",children:"Coding Patterns"})]})]}),i.jsxs("p",{className:"memory-health-status",children:["Memory tier: ",i.jsx("code",{children:h.backend||"local"})," · ","Vector index: ",i.jsx("code",{children:h.vectorBackend||"unknown"}),($=h.recall)!=null&&$.last7d?` · ${h.recall.last7d} recall(s) this week`:" · no recalls yet"]})]}),i.jsx("h2",{className:"section-subtitle",children:"💰 Cost by Provider"}),i.jsx("div",{className:"chart-container",children:g.length>0?i.jsx(ds,{width:"100%",height:260,children:i.jsxs(fs,{data:g,margin:{top:20,right:20,left:10,bottom:40},children:[i.jsx(di,{strokeDasharray:"3 3"}),i.jsx(oa,{dataKey:"name",tick:{fontSize:11}}),i.jsx(la,{tick:{fontSize:11},tickFormatter:I=>"$"+I.toFixed(4)}),i.jsx(bn,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8},labelStyle:{color:"var(--text-primary)"},formatter:I=>[Hb(I),"Cost"]}),i.jsx(yn,{dataKey:"value",radius:[4,4,0,0],children:g.map(I=>i.jsx(vu,{fillOpacity:.8,style:{fill:cse[I.name]||"var(--accent-blue)"}},I.name))})]})}):i.jsx("div",{className:"empty-state",children:"No cost data yet."})}),i.jsx("h2",{className:"section-subtitle",children:"📊 Trajectories by Project Type"}),i.jsx("div",{className:"chart-container",children:y.length>0?i.jsx(ds,{width:"100%",height:260,children:i.jsxs(fs,{data:y,margin:{top:20,right:20,left:10,bottom:40},children:[i.jsx(di,{strokeDasharray:"3 3"}),i.jsx(oa,{dataKey:"name",tick:{fontSize:11}}),i.jsx(la,{tick:{fontSize:11}}),i.jsx(bn,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8},labelStyle:{color:"var(--text-primary)"}}),i.jsx(yn,{dataKey:"value",radius:[4,4,0,0],fillOpacity:.8,fill:"var(--accent-purple)",style:{fill:"var(--accent-purple)"}})]})}):i.jsx("div",{className:"empty-state",children:"No trajectory data yet."})})]})}function dse(){return i.jsxs("div",{className:"panel",children:[i.jsx(Oe,{icon:"❓",title:"Help",description:"What this dashboard is, how to get work done in it, and every keyboard shortcut."}),i.jsxs("section",{className:"help-section",children:[i.jsx("h2",{className:"section-title",children:"Start here"}),i.jsxs("ol",{className:"help-steps",children:[i.jsxs("li",{children:[i.jsx("strong",{children:"Talk to the agent in Chat."})," It is the front door — the other pages are views of what has already happened. ",i.jsx(Jt,{to:"/chat",children:"Open Chat"}),"."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Run a command from Tasks."})," The Command Console executes the same CLI you would type in a terminal, and it can group-browse every command for you."," ",i.jsx(Jt,{to:"/tasks",children:"Open Command Console"}),"."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Sign in for anything that changes something."})," Running a task, editing environment secrets and the Agent Hub toggles all need an admin session. Controls that need one are disabled and say so."," ",i.jsx(Jt,{to:"/admin",children:"Go to Admin"}),"."]})]})]}),i.jsxs("section",{className:"help-section",children:[i.jsx("h2",{className:"section-title",children:"How the dashboard is laid out"}),i.jsxs("dl",{className:"help-anatomy",children:[i.jsx("dt",{children:"Top bar"}),i.jsxs("dd",{children:["The cross-cutting views on the left; on the right, ",i.jsx("strong",{children:"Refresh"})," (re-fetches everything the page shows), ",i.jsx("strong",{children:"Shortcuts"})," (the cheatsheet), and ",i.jsx("strong",{children:"Appearance"})," (theme and accessibility)."]}),i.jsx("dt",{children:"Navigation rail"}),i.jsx("dd",{children:"Every remaining destination, grouped by what it is for. The filter box narrows it as you type. Below the width where it becomes a drawer, it opens from the ☰ button."}),i.jsx("dt",{children:"Page body"}),i.jsx("dd",{children:"One page per destination. Each starts with its own title and, where it has one, a short description of what you are looking at."}),i.jsx("dt",{children:"Status footer"}),i.jsx("dd",{children:"Whether the dashboard is connected to the local server, and when it last received data. “Reconnecting” means the live stream dropped and is being retried — the pages keep the last data they had."})]})]}),i.jsxs("section",{className:"help-section",children:[i.jsx("h2",{className:"section-title",children:"Keyboard shortcuts"}),i.jsx("div",{className:"help-shortcuts",children:zT.map(e=>i.jsxs("div",{className:"shortcuts-group",children:[i.jsx("h3",{className:"shortcuts-group-title",children:e.group}),i.jsx("dl",{className:"shortcuts-list",children:e.items.map(t=>i.jsxs("div",{className:"shortcuts-row",children:[i.jsx("dt",{className:"shortcuts-keys",children:t.keys.map(n=>i.jsx("kbd",{className:"shortcuts-key",children:n},n))}),i.jsx("dd",{className:"shortcuts-description",children:t.description})]},t.description))})]},e.group))}),i.jsxs("p",{className:"help-note",children:["Shortcuts are ignored while you are typing, so ",i.jsx("kbd",{className:"shortcuts-key",children:"?"})," in a question stays a question mark. The ",i.jsx("kbd",{className:"shortcuts-key",children:"g"})," chords expire about a second and a half after the prefix, so a stray ",i.jsx("kbd",{className:"shortcuts-key",children:"g"})," cannot navigate somewhere later."]})]}),i.jsxs("section",{className:"help-section",children:[i.jsx("h2",{className:"section-title",children:"Appearance & accessibility"}),i.jsxs("p",{className:"help-body",children:[i.jsx("strong",{children:"Appearance"})," in the top bar offers ",du.length," palettes in light and dark, plus a text size and an accessibility mode. Your choice is remembered in this browser only — nothing is sent anywhere."]}),i.jsxs("dl",{className:"help-anatomy",children:[i.jsx("dt",{children:"Palette"}),i.jsxs("dd",{children:[du.map(e=>ch[e]).join(" · "),". The"," ",ch.contrast," palette is the one to pick when you need maximum legibility."]}),i.jsx("dt",{children:"Mode"}),i.jsxs("dd",{children:[Bp.map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" or "),". “Reset to system default” goes back to what your operating system asks for."]}),i.jsx("dt",{children:"Text size"}),i.jsx("dd",{children:"Scales the whole interface, not just the body text. Choosing a larger size turns accessibility mode on, because that is what defines it."}),i.jsx("dt",{children:"Accessibility mode"}),i.jsx("dd",{children:"Larger click targets, a thicker focus ring and no motion. Off by default so it never changes the look for anyone who does not need it."})]}),i.jsx("p",{className:"help-note",children:"Focus is always visible: every control draws a ring when reached by keyboard. Opportunistic hover-only effects are never the only cue for a state, and a selected state is carried by a filled shape plus weight rather than a faint tint."})]}),i.jsxs("section",{className:"help-section",children:[i.jsx("h2",{className:"section-title",children:"Where everything lives"}),i.jsxs("dl",{className:"help-anatomy",children:[i.jsx("dt",{children:"Top bar"}),i.jsx("dd",{className:"help-links",children:FT.map(e=>i.jsxs(Jt,{to:e.path,children:[i.jsx("span",{"aria-hidden":"true",children:e.icon})," ",e.label]},e.path))})]}),wy.map(e=>i.jsxs("dl",{className:"help-anatomy help-group",children:[i.jsx("dt",{children:e.label}),i.jsx("dd",{className:"help-links",children:e.items.map(t=>i.jsxs(Jt,{to:t.path,children:[i.jsx("span",{"aria-hidden":"true",children:t.icon})," ",t.label]},t.path))})]},e.label))]}),i.jsxs("section",{className:"help-section",children:[i.jsx("h2",{className:"section-title",children:"If something looks wrong"}),i.jsxs("dl",{className:"help-anatomy",children:[i.jsx("dt",{children:"A control is disabled"}),i.jsxs("dd",{children:["It needs an admin session. Sign in from ",i.jsx(Jt,{to:"/admin",children:"Admin"}),"; the page will say which session it wants."]}),i.jsx("dt",{children:"A task failed"}),i.jsx("dd",{children:"Open it from the Command Console's History — the full output and the exit code are kept per run."}),i.jsx("dt",{children:"The footer says “Reconnecting”"}),i.jsx("dd",{children:"The live stream dropped. The dashboard retries on its own and keeps showing the last data it received; Refresh forces a fresh fetch."}),i.jsx("dt",{children:"A page is empty"}),i.jsxs("dd",{children:["Most pages report “no data yet” rather than a zero, because a zero and an absent source look identical. Check ",i.jsx(Jt,{to:"/system",children:"System"})," for the health checks behind it."]})]})]})]})}const JN={planner:"📋","context-gatherer":"📂",writer:"✏️",reviewer:"👁️",tester:"🧪",debugger:"🐛",runner:"▶️",git:"🔀",package:"📦","github-release":"🏷️",security:"🔒",orchestrator:"🎯"},eE={planner:"var(--accent-blue)","context-gatherer":"var(--accent-cyan)",writer:"var(--accent-yellow)",reviewer:"var(--accent-purple)",tester:"var(--accent-green)",debugger:"var(--accent-red)",runner:"var(--accent-blue)",git:"var(--accent-yellow)",package:"var(--accent-yellow)","github-release":"var(--accent-green)",security:"var(--accent-red)",orchestrator:"var(--accent-yellow)"},Ug={planner:"Planner","context-gatherer":"Context",writer:"Writer",reviewer:"Reviewer",tester:"Tester",debugger:"Debugger",runner:"Runner",git:"Git",package:"Package","github-release":"Release",security:"Security",orchestrator:"Orchestrator"},tE={pending:{icon:"⏳",label:"Pending"},running:{icon:"▶️",label:"Running"},completed:{icon:"✅",label:"Done"},failed:{icon:"❌",label:"Failed"}},fse={pending:"var(--text-muted)",running:"var(--accent-blue)",completed:"var(--accent-green)",failed:"var(--accent-red)"};function hse(e){if(!e||e.nodes.length===0)return null;const t=e.nodes.map(s=>s.startedAt||0).filter(Boolean),n=e.nodes.map(s=>s.completedAt||0).filter(Boolean),r=t.length>0?Math.min(...t):Date.now(),a=n.length>0?Math.max(...n):Date.now();return{id:`live-${r}`,goal:e.pipeline||"Active execution",startedAt:r,endedAt:n.length>0?a:void 0,success:e.nodes.length>0&&e.nodes.every(s=>s.status==="completed"),totalDurationMs:Math.max(0,a-r),phases:e.nodes.map(s=>({id:s.id,agentType:s.agentType,status:s.status,description:s.description,complexity:s.complexity,summary:s.summary,startedAt:s.startedAt,completedAt:s.completedAt,durationMs:s.startedAt&&s.completedAt?s.completedAt-s.startedAt:void 0}))}}function pse(e,t){const n=[],r=new Set,a=hse(e);a&&(n.push(a),r.add(a.id));for(const s of(t==null?void 0:t.runs)||[])r.has(s.id)||(n.push(s),r.add(s.id));return n}function ri(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m ${Math.floor(e%6e4/1e3)}s`}function nE(e){return e?new Date(e).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}function mse(e,t){if(e.length===0)return{laid:[],total:0};const n=e.length,r=e.map(d=>d.durationMs&&d.durationMs>0?d.durationMs:0),a=r.reduce((d,f)=>d+f,0),s=a>0?e.map((d,f)=>r[f]>0?r[f]:a/n):e.map(()=>1),o=s.reduce((d,f)=>d+f,0)||1;let l=0;const c=e.map((d,f)=>{const h=s[f]/o,p=l;return l+=h,{...d,start:p,width:h,dur:s[f]}}),u=t>0?t:o;return{laid:c,total:u}}function gse({runs:e,selectedRunId:t,onSelectRun:n,onScrub:r}){const[a,s]=b.useState(null),o=e.find(N=>N.id===(t??a))??e[0]??null,[l,c]=b.useState(0),[u,d]=b.useState(!1),f=b.useRef(null),h=b.useRef(!1),p=b.useRef(r);b.useEffect(()=>{p.current=r},[r]),b.useEffect(()=>{var N;!o&&e.length>0?s(e[0].id):o&&!e.some(E=>E.id===o.id)&&s(((N=e[0])==null?void 0:N.id)??null)},[e,o]);const{laid:m,total:g}=b.useMemo(()=>mse((o==null?void 0:o.phases)||[],(o==null?void 0:o.totalDurationMs)||0),[o]),y=g>0?Math.min(1,Math.max(0,l/g)):0,v=b.useMemo(()=>{if(g<=0)return null;const N=y*g;return m.find(E=>N>=E.start*g&&N<(E.start+E.width)*g)||null},[m,y,g]);b.useEffect(()=>{var N;(N=p.current)==null||N.call(p,(v==null?void 0:v.id)??null)},[v==null?void 0:v.id]),b.useEffect(()=>{if(!u)return;const N=setInterval(()=>{c(E=>E+g/2e3*50)},50);return()=>clearInterval(N)},[u,g]),b.useEffect(()=>{u&&g>0&&l>=g&&(d(!1),c(0))},[u,g,l]);const k=b.useCallback(N=>{const E=f.current;if(!E||g<=0)return;const P=E.getBoundingClientRect(),_=P.width||1,R=Math.min(1,Math.max(0,(N-P.left)/_));c(R*g)},[g]),w=N=>{h.current=!0,d(!1),k(N.clientX)};if(b.useEffect(()=>{const N=P=>{h.current&&k(P.clientX)},E=()=>{h.current=!1};return window.addEventListener("pointermove",N),window.addEventListener("pointerup",E),()=>{window.removeEventListener("pointermove",N),window.removeEventListener("pointerup",E)}},[k]),!o)return i.jsx("div",{className:"phase-timeline phase-timeline-empty",children:i.jsx("p",{children:"No pipeline runs yet. Run an agent task to see its phase timeline here."})});const j=o.id.startsWith("live-"),S=o.phases.filter(N=>N.status==="completed").length,x=o.phases.filter(N=>N.status==="failed").length;return i.jsxs("div",{className:"phase-timeline",children:[i.jsxs("div",{className:"phase-timeline-header",children:[i.jsx("div",{className:"phase-timeline-runs",children:e.map(N=>i.jsxs("button",{className:`phase-run-chip ${N.id===o.id?"active":""} ${N.id.startsWith("live-")?"live":""}`,onClick:()=>{s(N.id),c(0),d(!1),n==null||n(N.id)},title:N.goal,children:[N.id.startsWith("live-")&&i.jsx("span",{className:"dag-live-dot"}),N.engine&&i.jsx("span",{className:`phase-run-chip-engine phase-run-chip-engine-${N.engine}`,children:N.engine==="loop"?"🔁":"⬡"}),N.goal.length>32?N.goal.slice(0,30)+"…":N.goal,i.jsx("span",{className:"phase-run-chip-time",children:nE(N.startedAt)})]},N.id))}),i.jsxs("div",{className:"phase-timeline-meta",children:[j&&i.jsx("span",{className:"dag-live-badge",children:"LIVE"}),o.engine&&i.jsx("span",{className:`dag-engine-badge dag-engine-${o.engine}`,title:o.engine==="loop"?"Loop turn (per-tool telemetry below)":"Orchestrator pipeline",children:o.engine==="loop"?"🔁 loop":"⬡ pipeline"}),i.jsxs("span",{className:"phase-meta-item",children:[o.phases.length," steps"]}),i.jsxs("span",{className:"phase-meta-item phase-meta-ok",children:["✅ ",S]}),x>0&&i.jsxs("span",{className:"phase-meta-item phase-meta-bad",children:["❌ ",x]}),o.turnTelemetry&&i.jsxs("span",{className:"phase-meta-item",title:`tool calls: ${o.turnTelemetry.toolCallCount}, errored: ${o.turnTelemetry.erroredToolCount}${o.turnTelemetry.bounded?", bounded":""}${o.turnTelemetry.provider?`, ${o.turnTelemetry.provider}${o.turnTelemetry.model?`/${o.turnTelemetry.model}`:""}`:""}`,children:["🔧 ",o.turnTelemetry.toolCallCount,o.turnTelemetry.erroredToolCount>0&&i.jsxs("span",{className:"phase-meta-bad",children:[" (",o.turnTelemetry.erroredToolCount," err)"]})]}),i.jsxs("span",{className:"phase-meta-item",children:["⏱ ",ri(g)]})]})]}),i.jsxs("div",{className:"phase-timeline-controls",children:[i.jsx("button",{className:`phase-play-btn ${u?"paused":""}`,onClick:()=>{u?d(!1):(l>=g&&c(0),d(!0))},"aria-label":u?"Pause scrub":"Play scrub",children:u?"⏸ Pause":"▶ Play"}),i.jsxs("span",{className:"phase-time-label",children:[ri(l)," / ",ri(g)]}),i.jsx("input",{className:"phase-range",type:"range",min:0,max:g||1,step:1,value:Math.min(l,g||1),onChange:N=>{d(!1),c(Number(N.target.value))},"aria-label":"Scrub pipeline timeline"})]}),i.jsxs("div",{className:"phase-track-wrap",children:[i.jsxs("div",{ref:f,className:"phase-track",onPointerDown:w,style:{cursor:"grab"},children:[m.map(N=>{const E=eE[N.agentType]||"var(--accent-blue)",P=fse[N.status],_=(v==null?void 0:v.id)===N.id;return i.jsxs("button",{className:`phase-block phase-block-${N.status} ${_?"active":""}`,style:{left:`${N.start*100}%`,width:`${Math.max(N.width*100,2)}%`,background:`linear-gradient(180deg, ${E}cc, ${E}66)`,boxShadow:_?`0 0 0 2px ${P}`:void 0},onClick:R=>{R.stopPropagation(),d(!1),c((N.start+N.width/2)*g)},title:`${Ug[N.agentType]||N.agentType}: ${N.description}`,children:[i.jsx("span",{className:"phase-block-icon",children:JN[N.agentType]||"⚙️"}),i.jsx("span",{className:"phase-block-label",children:Ug[N.agentType]||N.agentType})]},N.id)}),i.jsx("div",{className:"phase-caret",style:{left:`${y*100}%`},onPointerDown:N=>{N.stopPropagation(),w(N)},title:`${ri(l)} elapsed`})]}),i.jsxs("div",{className:"phase-ticks",children:[i.jsx("span",{children:"0"}),i.jsx("span",{children:ri(Math.round(g/2))}),i.jsx("span",{children:ri(g)})]})]}),i.jsx("div",{className:"phase-detail",children:v?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"phase-detail-title",children:[i.jsx("span",{className:"phase-detail-icon",children:JN[v.agentType]||"⚙️"}),i.jsx("span",{className:"phase-detail-agent",style:{color:eE[v.agentType]||"var(--accent-blue)"},children:Ug[v.agentType]||v.agentType}),i.jsxs("span",{className:`phase-status-badge phase-status-${v.status}`,children:[tE[v.status].icon," ",tE[v.status].label]})]}),i.jsx("p",{className:"phase-detail-desc",children:v.description}),i.jsxs("div",{className:"phase-detail-meta",children:[i.jsxs("span",{children:["⏱ ",v.durationMs?ri(v.dur):`~${ri(v.dur)}`]}),v.startedAt?i.jsxs("span",{children:["🕐 ",nE(v.startedAt)]}):null,v.complexity?i.jsxs("span",{children:["🎯 ",v.complexity]}):null]}),v.summary&&i.jsx("p",{className:"phase-detail-summary",children:v.summary})]}):i.jsxs("div",{className:"phase-detail-gap",children:[i.jsx("span",{className:"phase-detail-icon",children:"⏳"}),i.jsx("span",{children:"Between steps — waiting for the next agent."})]})})]})}function Wg(e){return e===void 0?"—":`$${e.toFixed(5)}`}function rE(e){if(e===void 0||!Number.isFinite(e)||e<0)return"—";if(e<1e3)return`${Math.round(e)}ms`;const t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;const n=Math.floor(t/60);return n<60?`${n}m ${String(Math.round(t%60)).padStart(2,"0")}s`:`${Math.floor(n/60)}h ${String(n%60).padStart(2,"0")}m`}function Hg(e){return e===void 0?"—":e.toLocaleString("en-US")}function vse({jobs:e}){const t=b.useMemo(()=>e.filter(u=>u.batchStats.length>0),[e]),[n,r]=b.useState(null);if(t.length===0)return null;const a=t.find(u=>u.id===n)??t[0],s=a.batchStats,o=s.filter(u=>u.durationMs!==void 0),l=o.reduce((u,d)=>u+(d.durationMs??0),0),c=o.length>0?l/o.length:void 0;return i.jsxs("div",{className:"dag-timeline-section","data-testid":"batch-economy",children:[i.jsxs("h2",{className:"section-subtitle",children:["📊 Per-batch cost & latency"," ",i.jsx("span",{className:"timeline-subtitle",children:"— measured, not estimated"})]}),t.length>1&&i.jsx("div",{className:"dag-loop-turn-meta",style:{marginBottom:8},children:t.slice(0,5).map(u=>i.jsx("button",{type:"button",className:"dag-loop-turn-chip",onClick:()=>r(u.id),style:{cursor:"pointer",opacity:u.id===a.id?1:.55,fontWeight:u.id===a.id?600:400},children:u.progressLine??u.goal.slice(0,40)},u.id))}),i.jsxs("div",{className:"dag-loop-turn-meta",style:{marginBottom:8},children:[i.jsxs("span",{className:"dag-loop-turn-chip",children:[a.kind==="long-form"?"📖":"🛠️"," ",a.status]}),i.jsxs("span",{className:"dag-loop-turn-chip",children:[a.progress,"% done"]}),i.jsxs("span",{className:"dag-loop-turn-chip",children:[a.batches," batch",a.batches===1?"":"es"]}),i.jsxs("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-dim",children:[Hg(a.tokens)," tokens · ",Wg(a.costUsd)]}),a.stopReason&&i.jsxs("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-dim",children:["stopped: ",a.stopReason]})]}),i.jsx("div",{className:"dag-table-wrapper",children:i.jsxs("table",{className:"dag-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Batch"}),i.jsx("th",{children:"Done"}),i.jsx("th",{children:"Tokens"}),i.jsx("th",{children:"Cost"}),i.jsx("th",{children:"Time"})]})}),i.jsxs("tbody",{children:[s.map(u=>i.jsxs("tr",{children:[i.jsx("td",{children:u.index}),i.jsx("td",{children:`${Math.round(u.progress)}%`}),i.jsx("td",{children:Hg(u.tokens)}),i.jsx("td",{children:Wg(u.costUsd)}),i.jsx("td",{children:rE(u.durationMs)})]},u.index)),s.some(u=>u.error)&&i.jsx("tr",{children:i.jsxs("td",{colSpan:5,style:{opacity:.75},children:["✗ failures:"," ",s.filter(u=>u.error).map(u=>`#${u.index} ${u.error}`).join(" · ")]})}),i.jsxs("tr",{children:[i.jsx("td",{children:i.jsx("strong",{children:"total"})}),i.jsx("td",{children:i.jsx("strong",{children:`${a.progress}%`})}),i.jsx("td",{children:i.jsx("strong",{children:Hg(a.tokens)})}),i.jsx("td",{children:i.jsx("strong",{children:Wg(a.costUsd)})}),i.jsx("td",{children:i.jsx("strong",{children:c===void 0?"—":`~${rE(c)} avg`})})]})]})]})})]})}const aE={planner:"📋","context-gatherer":"📂",writer:"✏️",reviewer:"👁️",tester:"🧪",debugger:"🐛",runner:"▶️",git:"🔀",package:"📦","github-release":"🏷️",security:"🔒",orchestrator:"🎯"},Gg={planner:"var(--accent-blue)","context-gatherer":"var(--accent-cyan)",writer:"var(--accent-yellow)",reviewer:"var(--accent-purple)",tester:"var(--accent-green)",debugger:"var(--accent-red)",runner:"var(--accent-blue)",git:"var(--accent-yellow)",package:"var(--accent-yellow)","github-release":"var(--accent-green)",security:"var(--accent-red)",orchestrator:"var(--accent-yellow)"},yse={pending:{bg:"var(--bg-card)",stroke:"var(--border)",text:"var(--text-muted)"},running:{bg:"color-mix(in srgb, var(--accent-blue) 12%, transparent)",stroke:"var(--accent-blue)",text:"var(--accent-blue)"},completed:{bg:"color-mix(in srgb, var(--accent-green) 12%, transparent)",stroke:"var(--accent-green)",text:"var(--accent-green)"},failed:{bg:"color-mix(in srgb, var(--accent-red) 12%, transparent)",stroke:"var(--accent-red)",text:"var(--accent-red)"}},iE={pending:"⏳ Pending",running:"▶️ Running",completed:"✅ Done",failed:"❌ Failed"},co={trivial:{icon:"🟢",color:"var(--accent-green)"},simple:{icon:"🔵",color:"var(--accent-blue)"},moderate:{icon:"🟡",color:"var(--accent-yellow)"},complex:{icon:"🟠",color:"var(--accent-yellow)"},critical:{icon:"🔴",color:"var(--accent-red)"}},qg={planner:"Planner","context-gatherer":"Context",writer:"Writer",reviewer:"Reviewer",tester:"Tester",debugger:"Debugger",runner:"Runner",git:"Git",package:"Package","github-release":"Release",security:"Security",orchestrator:"Orchestrator"};function bse(e,t,n=160,r=68,a=40,s=24,o=40){if(e.length===0)return{layoutNodes:[],svgW:400,svgH:200};const l=new Map,c=new Set;function u(y){if(l.has(y))return l.get(y);if(c.has(y))return 0;c.add(y);const v=t.filter(j=>j.to===y);if(v.length===0)return l.set(y,0),0;const w=Math.max(...v.map(j=>u(j.from)))+1;return l.set(y,w),w}for(const y of e)u(y.id);const d=new Map;for(const y of e){const v=l.get(y.id)??0;d.has(v)||d.set(v,[]),d.get(v).push(y)}const f=Math.max(...d.keys()),h=Math.max(...Array.from(d.values()).map(y=>y.length)),p=(f+1)*(n+a)+o*2-a,m=Math.max(h,1)*(r+s)+o*2-s,g=[];for(const y of e){const v=l.get(y.id)??0,k=d.get(v),w=k.indexOf(y),j=k.length,S=j*(r+s)-s,x=m/2-S/2;g.push({...y,x:o+v*(n+a),y:x+w*(r+s),w:n,h:r,step:v,totalInStep:j,indexInStep:w})}return{layoutNodes:g,svgW:p,svgH:m}}function Kg(e,t){if(!e)return"--";const n=(t||Date.now())-e;return n<1e3?`${n}ms`:n<6e4?`${(n/1e3).toFixed(1)}s`:`${Math.floor(n/6e4)}m ${Math.floor(n%6e4/1e3)}s`}function sE(e){return e?new Date(e).toLocaleTimeString("en-US",{minute:"2-digit",second:"2-digit"}):""}function xse({memoryTotal:e}){return i.jsxs(i.Fragment,{children:[i.jsx(Oe,{icon:"🔀",title:"Agent Execution DAG"}),i.jsx("p",{className:"section-description",children:"Live visualization of the agent execution pipeline. When an agent task runs, you'll see each step appear here in real time as it moves through planning → context gathering → writing → review → testing."}),i.jsxs("div",{className:"dag-empty",children:[i.jsx("div",{className:"dag-empty-icon",children:"🔀"}),i.jsx("h2",{children:"No Active Pipeline"}),i.jsx("p",{children:"Run an agent task to see the execution pipeline appear here in real time."}),e!==void 0&&e>0&&i.jsxs("p",{className:"dag-empty-hint",children:[i.jsx("code",{children:e})," past executions are stored in memory."]})]})]})}function wse({data:e}){var O,J;const t=e==null?void 0:e.dag,n=(O=e==null?void 0:e.memory)==null?void 0:O.total,[r,a]=b.useState(null),[s,o]=b.useState(null),[l,c]=b.useState(void 0),[u,d]=b.useState(void 0),[f,h]=b.useState(void 0);b.useEffect(()=>K.onDAGEvent(L=>{a(L),c(L.engine),d(L.engineExplanation),h(L.loopTurn)}),[]);const p=t||r,m=r?l:(t==null?void 0:t.engine)??l,g=r?u:(t==null?void 0:t.engineExplanation)??u,y=r?f:(t==null?void 0:t.loopTurn)??f,v=b.useMemo(()=>pse(p,e==null?void 0:e.pipelineRuns),[p,e==null?void 0:e.pipelineRuns]),k=F=>{o(F)},w=!!(p&&(p.nodes.length>0||p.active)),j=v.length>0,S=!!y,x=((J=e==null?void 0:e.unattendedJobs)==null?void 0:J.jobs)??[],N=x.some(F=>F.batchStats.length>0);if(!w&&!j&&!S&&!N)return i.jsx(xse,{memoryTotal:n});const{nodes:E,edges:P,pipeline:_,active:R}=p??{nodes:[],edges:[],pipeline:null,active:!1},{layoutNodes:T,svgW:B,svgH:$}=bse(E,P),I=E.filter(F=>F.status==="running").length,D=E.filter(F=>F.status==="completed").length,U=E.filter(F=>F.status==="failed").length,M=E.filter(F=>F.status==="pending").length,z=E.length;return i.jsxs(i.Fragment,{children:[i.jsx(Oe,{icon:"🔀",title:"Agent Execution DAG"}),j&&i.jsxs("div",{className:"dag-timeline-section",children:[i.jsxs("h2",{className:"section-subtitle",children:["⏱ Run Timeline ",i.jsx("span",{className:"timeline-subtitle",children:"— scrub to replay · click a run to switch"})]}),i.jsx(gse,{runs:v,onScrub:k})]}),i.jsx(vse,{jobs:x}),y&&i.jsxs("div",{className:"dag-loop-turn-card","data-testid":"dag-loop-turn-card",children:[i.jsxs("div",{className:"dag-loop-turn-header",children:[i.jsx("span",{className:"dag-loop-turn-icon",children:"🔁"}),i.jsxs("span",{className:"dag-loop-turn-title",children:["Loop turn — ",y.title||"chat turn"]}),y.active&&i.jsx("span",{className:"dag-loop-turn-live",children:"● recording"})]}),i.jsxs("div",{className:"dag-loop-turn-meta",children:[i.jsxs("span",{className:"dag-loop-turn-chip",children:["🔧 ",y.toolCallCount," tool call",y.toolCallCount===1?"":"s"]}),y.erroredToolCount>0&&i.jsxs("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-error",children:["❌ ",y.erroredToolCount," errored"]}),y.provider&&i.jsxs("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-dim",children:[y.provider,y.model?` · ${y.model}`:""]}),typeof y.startedAt=="number"&&i.jsxs("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-dim",children:["⏱ ",Kg(y.startedAt,y.endedAt)]}),y.bounded&&i.jsx("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-error",children:"⛔ bounded"}),y.generationFailed&&i.jsx("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-error",children:"💀 generation failed"}),y.cancelled&&i.jsx("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-dim",children:"✖ cancelled"})]}),y.toolCalls.length>0&&i.jsx("div",{className:"dag-loop-turn-tools",children:y.toolCalls.slice(-12).map((F,L)=>i.jsxs("span",{className:`dag-loop-tool ${F.ok===!1?"dag-loop-tool-error":""}`,title:F.error||`${F.tool}${F.durationMs!==void 0?` · ${F.durationMs}ms`:""}`,children:[F.ok===!1?"❌":"✓"," ",F.tool]},`${F.tool}-${L}`))})]}),w&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:`dag-status-bar ${R?"active":""}`,children:[i.jsxs("div",{className:"dag-pipeline-name",children:[R&&i.jsx("span",{className:"dag-live-dot"}),_||"Execution Pipeline"]}),i.jsxs("div",{className:"dag-pipeline-meta",children:[R&&i.jsx("span",{className:"dag-live-badge",children:"LIVE"}),m&&i.jsx("span",{className:`dag-engine-badge dag-engine-${m}`,title:g||(m==="loop"?"Single agentic loop":"Orchestrator pipeline"),"data-testid":"dag-engine-badge",children:m==="loop"?"🔁 loop engine":"⬡ pipeline engine"}),i.jsxs("span",{className:"dag-step-count",children:[z," steps"]}),I>0&&i.jsxs("span",{className:"dag-running-badge",children:["▶ ",I," running"]}),M>0&&i.jsxs("span",{className:"dag-pending-badge",children:["⏳ ",M," pending"]}),i.jsxs("span",{className:"dag-completed-badge",children:["✅ ",D," done"]}),U>0&&i.jsxs("span",{className:"dag-failed-badge",children:["❌ ",U," failed"]})]})]}),i.jsx("div",{className:"dag-container",children:i.jsxs("svg",{width:B,height:$,viewBox:`0 0 ${B} ${$}`,children:[i.jsxs("defs",{children:[P.map(F=>i.jsx("marker",{id:`arrow-${F.from}-${F.to}`,markerWidth:"8",markerHeight:"6",refX:"8",refY:"3",orient:"auto",children:i.jsx("polygon",{points:"0 0, 8 3, 0 6",style:{fill:"var(--accent-blue)"}})},`arrow-${F.from}-${F.to}`)),i.jsxs("filter",{id:"glow",children:[i.jsx("feGaussianBlur",{stdDeviation:"3",result:"coloredBlur"}),i.jsxs("feMerge",{children:[i.jsx("feMergeNode",{in:"coloredBlur"}),i.jsx("feMergeNode",{in:"SourceGraphic"})]})]})]}),P.map(F=>{const L=T.find(G=>G.id===F.from),ie=T.find(G=>G.id===F.to);if(!L||!ie)return null;const fe=L.x+L.w,ve=L.y+L.h/2,Ee=ie.x,ee=ie.y+ie.h/2,Q=(fe+Ee)/2,ae=ie.status,ce=ae==="failed"?"var(--accent-red)":ae==="running"?"var(--accent-blue)":ae==="completed"?"var(--accent-green)":"var(--border)";return i.jsx("g",{children:i.jsx("path",{d:`M ${fe} ${ve} C ${Q} ${ve}, ${Q} ${ee}, ${Ee} ${ee}`,fill:"none",style:{stroke:ce},strokeWidth:ae==="pending"?1.5:2.5,strokeOpacity:ae==="pending"?.3:.8,markerEnd:`url(#arrow-${F.from}-${F.to})`,className:"dag-edge"})},`edge-${F.from}-${F.to}`)}),T.map(F=>{const L=yse[F.status];Gg[F.agentType];const ie=aE[F.agentType]||"⚙️",fe=qg[F.agentType]||F.agentType,ve=s===F.id,Ee=F.status==="running";return i.jsxs("g",{onClick:()=>o(ve?null:F.id),style:{cursor:"pointer"},className:"dag-node-group",children:[ve&&i.jsx("rect",{x:F.x-4,y:F.y-4,width:F.w+8,height:F.h+8,rx:10,ry:10,fill:"none",style:{stroke:"var(--accent-blue)"},strokeWidth:2,strokeOpacity:.5}),i.jsx("rect",{x:F.x,y:F.y,width:F.w,height:F.h,rx:8,ry:8,style:{fill:L.bg,stroke:L.stroke},strokeWidth:Ee?2.5:1.5,strokeOpacity:.9,className:Ee?"dag-node-running":"",filter:Ee?"url(#glow)":void 0}),i.jsxs("text",{x:F.x+10,y:F.y+22,style:{fill:"var(--text-primary)"},fontSize:10,fontWeight:600,children:[ie," ",fe]}),i.jsx("text",{x:F.x+F.w-10,y:F.y+22,textAnchor:"end",style:{fill:L.text},fontSize:9,fontWeight:500,children:iE[F.status]}),i.jsx("text",{x:F.x+10,y:F.y+40,style:{fill:"var(--text-secondary)"},fontSize:9,children:F.description.length>28?F.description.slice(0,26)+"..":F.description}),F.complexity&&co[F.complexity]&&i.jsxs("text",{x:F.x+10,y:F.y+54,style:{fill:co[F.complexity].color},fontSize:8,fontWeight:600,children:[co[F.complexity].icon," ",F.complexity]}),i.jsx("text",{x:F.x+10,y:F.y+56,style:{fill:"var(--text-muted)"},fontSize:8,children:Kg(F.startedAt,F.completedAt)}),i.jsx("text",{x:F.x+F.w-10,y:F.y+56,textAnchor:"end",style:{fill:"var(--text-muted)"},fontSize:8,children:sE(F.startedAt||F.completedAt)}),(F.status==="failed"||ve)&&F.summary&&i.jsx("foreignObject",{x:Math.max(10,F.x-80),y:F.y+F.h+6,width:F.w+160,height:36,children:i.jsx("div",{className:"dag-node-summary",style:{color:F.status==="failed"?"var(--accent-red)":"var(--text-secondary)",fontSize:"10px",lineHeight:1.4,background:"var(--scrim)",padding:"4px 8px",borderRadius:"4px",border:`1px solid ${F.status==="failed"?"color-mix(in srgb, var(--accent-red) 30%, transparent)":"color-mix(in srgb, var(--border) 50%, transparent)"}`,maxHeight:"32px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F.summary})})]},`node-${F.id}`)})]})}),i.jsx("h2",{className:"section-subtitle",children:"Step Details"}),i.jsx("div",{className:"dag-table-wrapper",children:i.jsxs("table",{className:"dag-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Step"}),i.jsx("th",{children:"Agent"}),i.jsx("th",{children:"Complexity"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Duration"}),i.jsx("th",{children:"Time"}),i.jsx("th",{children:"Summary"})]})}),i.jsx("tbody",{children:T.map(F=>i.jsxs("tr",{className:`dag-row dag-row-${F.status}`,children:[i.jsx("td",{className:"dag-cell-step",children:F.step}),i.jsxs("td",{className:"dag-cell-agent",children:[i.jsx("span",{className:"dag-agent-dot",style:{background:Gg[F.agentType]||"var(--accent-blue)"}}),qg[F.agentType]||F.agentType]}),i.jsx("td",{className:"dag-cell-complexity",children:F.complexity&&co[F.complexity]?i.jsxs("span",{style:{color:co[F.complexity].color,fontSize:12},children:[co[F.complexity].icon," ",F.complexity]}):i.jsx("span",{style:{color:"var(--text-muted)",fontSize:12},children:"—"})}),i.jsx("td",{className:`dag-cell-status dag-status-${F.status}`,children:iE[F.status]}),i.jsx("td",{className:"dag-cell-duration",children:Kg(F.startedAt,F.completedAt)}),i.jsx("td",{className:"dag-cell-time",children:sE(F.startedAt||F.completedAt)}),i.jsx("td",{className:"dag-cell-summary",children:F.summary||F.description||"--"})]},F.id))})]})}),i.jsx("h2",{className:"section-subtitle",children:"Agent Types"}),i.jsxs("div",{className:"dag-legend",children:[Object.entries(aE).map(([F,L])=>i.jsxs("div",{className:"legend-item",children:[i.jsx("span",{className:"legend-dot",style:{background:Gg[F]||"var(--accent-blue)"}}),i.jsx("span",{className:"legend-icon",children:L}),i.jsx("span",{className:"legend-label",children:qg[F]||F})]},F)),i.jsxs("div",{className:"legend-item",children:[i.jsx("span",{className:"legend-dot",style:{background:"transparent",border:"2px dashed var(--accent-blue)"}}),i.jsx("span",{className:"legend-icon",children:"⚡"}),i.jsx("span",{className:"legend-label",children:"Live node"})]})]})]})]})}function Wt(e){return e==null||e<1e-5?"$0.00":e<.01?"$"+e.toFixed(6):"$"+e.toFixed(4)}function na(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":bt(e)}function oE(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function kse({data:e}){if(!e)return i.jsxs(i.Fragment,{children:[i.jsx(Oe,{icon:"💰",title:"Cost Tracking"}),i.jsx("div",{className:"loading-state",children:i.jsx("p",{children:"Loading cost data..."})})]});const{cost:t}=e,n=t.billedUsd!==void 0,r=t.billedUsd??t.totalCost,a=Object.entries(t.byProvider||{}).sort(([,c],[,u])=>u-c),s=Object.entries(t.byModel||{}).sort(([,c],[,u])=>u-c).slice(0,10),o=a.reduce((c,[,u])=>c+u,0),l=[];return t.recomputedCalls&&l.push(`${t.recomputedCalls} row(s) predate cost classification and were re-derived here (the ledger file was not rewritten).`),t.testOriginCalls&&l.push(`${t.testOriginCalls} test-origin row(s) excluded — a test run is not your usage.`),i.jsxs(i.Fragment,{children:[i.jsx(Oe,{icon:"💰",title:"Cost Tracking"}),i.jsxs("div",{className:"cost-summary",children:[i.jsxs("div",{className:"cost-total",children:[i.jsx("span",{className:"cost-label",children:n?"🧾 Billed (evidence)":"Ledger total (as recorded)"}),i.jsx("span",{className:"cost-amount",children:Wt(r)}),n?i.jsxs("span",{className:"cost-label",children:["🧾 exact ",Wt(t.billedReportedUsd)," · 📋 list-estimated ",Wt(t.billedListedUsd)]}):i.jsx("span",{className:"cost-label",children:"this server predates the billed/value split"})]}),i.jsxs("div",{className:"cost-total",children:[i.jsx("span",{className:"cost-label",children:"Total Tokens"}),i.jsx("span",{className:"cost-amount",children:na(t.totalTokens)})]}),i.jsxs("div",{className:"cost-total",children:[i.jsx("span",{className:"cost-label",children:"Total Requests"}),i.jsx("span",{className:"cost-amount",children:na(t.totalRequests)})]})]}),n&&i.jsxs("div",{className:"cost-summary cost-summary-sub",children:[i.jsxs("div",{className:"cost-total",children:[i.jsx("span",{className:"cost-label",children:"🎁 Value absorbed by free/subscription"}),i.jsx("span",{className:"cost-amount",children:Wt(t.notBilledValueUsd)}),i.jsxs("span",{className:"cost-label",children:[na(t.notBilledValueCalls)," calls — at list price, NOT billed"]})]}),i.jsxs("div",{className:"cost-total",children:[i.jsx("span",{className:"cost-label",children:"❓ List-priced, billing tier undeclared"}),i.jsx("span",{className:"cost-amount",children:Wt(t.unverifiedListedUsd)}),i.jsxs("span",{className:"cost-label",children:[na(t.unverifiedListedCalls)," calls — not counted as spend"]})]}),i.jsxs("div",{className:"cost-total",children:[i.jsx("span",{className:"cost-label",children:"⚪ Unpriced (no price evidence / gateway)"}),i.jsx("span",{className:"cost-amount",children:na(t.unpricedCalls)}),i.jsxs("span",{className:"cost-label",children:[na(t.unpricedTokens)," tokens, no dollars"]})]})]}),i.jsxs("div",{className:"cost-summary cost-summary-sub",children:[i.jsxs("div",{className:"cost-total",children:[i.jsx("span",{className:"cost-label",children:"📏 Measured (exact wire tokens)"}),i.jsx("span",{className:"cost-amount",children:Wt(t.measuredCost)}),i.jsxs("span",{className:"cost-label",children:[na(t.measuredCalls)," calls"]})]}),i.jsxs("div",{className:"cost-total",children:[i.jsx("span",{className:"cost-label",children:"📐 Estimated (length-based)"}),i.jsx("span",{className:"cost-amount",children:Wt(t.estimatedCost)}),i.jsxs("span",{className:"cost-label",children:[na(t.estimatedCalls)," calls"]})]}),i.jsxs("div",{className:"cost-total",children:[i.jsx("span",{className:"cost-label",children:"🧾 of which provider-reported (exact billed)"}),i.jsx("span",{className:"cost-amount",children:Wt(t.reportedCost)}),i.jsxs("span",{className:"cost-label",children:[na(t.reportedCalls)," calls"]})]})]}),n&&i.jsxs("p",{className:"cost-note",children:["Billed = calls with evidence (the provider's own figure, or a list price on an account you declared",i.jsx("code",{children:" providers.<id>.billingTier paid"}),"). Value is what a free tier saved; unverified rows are priced but unclaimed. Reconcile against a provider invoice with",i.jsx("code",{children:" nuvira stats cost reconcile --provider <id> --amount <usd>"}),".",l.length>0&&i.jsxs(i.Fragment,{children:[" ",l.join(" ")]})]}),i.jsx("h2",{className:"section-subtitle",children:"Checked against a provider invoice"}),i.jsx("div",{className:"cost-list",children:!t.reconciliations||t.reconciliations.length===0?i.jsxs("div",{className:"empty-state",children:[`Nothing checked yet. Everything above is an ESTIMATE of money owed — the only "actual" figure is the provider's own, and this ledger cannot see it. Enter one with `,i.jsx("code",{children:" nuvira stats cost reconcile --provider <id> --amount <usd>"}),"."]}):t.reconciliations.map(c=>i.jsxs("div",{className:"cost-row",children:[i.jsx("span",{className:"cost-row-name",children:c.provider}),i.jsx("div",{className:"cost-row-bar",children:i.jsx("div",{className:"cost-row-fill",style:{width:`${c.invoiceUsd>0?Math.min(100,c.billedUsd/c.invoiceUsd*100):0}%`}})}),i.jsxs("span",{className:"cost-row-value",children:["invoice ",Wt(c.invoiceUsd)]}),i.jsxs("span",{className:"cost-row-reported",title:"What this ledger could evidence for the same window",children:["ledger ",Wt(c.billedUsd)]}),i.jsxs("span",{className:"cost-row-reported",title:c.verdict==="match"?"The invoice and this ledger agree":c.verdict==="under-evidenced"?"The provider charged more than this ledger can prove":"This ledger claims more than the provider charged",children:[c.verdict==="match"?"✅ match":c.verdict==="under-evidenced"?"⚠️ under-evidenced":"⚠️ over-recorded",c.verdict!=="match"?` by ${Wt(Math.abs(c.deltaUsd))}`:""]}),c.tier&&i.jsxs("span",{className:"cost-row-reported",title:"Billing tier the invoice PROVED — not assumed",children:["🔑 key is ",c.tier]}),i.jsxs("span",{className:"request-time",children:["checked ",oE(c.recordedAt)]})]},`${c.provider}-${c.recordedAt}`))}),i.jsx("h2",{className:"section-subtitle",children:"By Provider"}),i.jsx("div",{className:"cost-list",children:a.length===0?i.jsx("div",{className:"empty-state",children:"No costs recorded yet."}):a.map(([c,u])=>{var y,v,k,w,j;const d=o>0?(u/o*100).toFixed(1):"0",f=(y=t.byProviderReported)==null?void 0:y[c],h=(v=t.byProviderBilled)==null?void 0:v[c],p=(k=t.byProviderUnverified)==null?void 0:k[c],m=(w=t.byProviderValue)==null?void 0:w[c],g=(j=t.byProviderUnpricedCalls)==null?void 0:j[c];return i.jsxs("div",{className:"cost-row",children:[i.jsx("span",{className:"cost-row-name",children:c}),i.jsx("div",{className:"cost-row-bar",children:i.jsx("div",{className:"cost-row-fill",style:{width:`${d}%`}})}),i.jsx("span",{className:"cost-row-value",children:Wt(u)}),typeof f=="number"&&i.jsxs("span",{className:"cost-row-reported",title:"Provider-reported (exact billed) cost",children:["🧾 ",Wt(f)]}),typeof h=="number"&&h>0&&i.jsxs("span",{className:"cost-row-reported",title:"Billed (evidence) for this provider",children:["billed ",Wt(h)]}),typeof m=="number"&&m>0&&i.jsxs("span",{className:"cost-row-reported",title:"List-price value absorbed by a free/subscription tier — not spend",children:["value ",Wt(m)]}),typeof p=="number"&&p>0&&i.jsxs("span",{className:"cost-row-reported",title:"List-priced with the billing tier undeclared — not counted as spend",children:["unverified ",Wt(p)]}),typeof g=="number"&&g>0&&i.jsxs("span",{className:"cost-row-reported",title:"Calls with no price evidence (unknown provider, or a pass-through gateway)",children:[g," uncosted"]})]},c)})}),i.jsx("h2",{className:"section-subtitle",children:"By Model"}),i.jsx("div",{className:"cost-list",children:s.length===0?i.jsx("div",{className:"empty-state",children:"No model costs recorded yet."}):s.map(([c,u])=>{var p;const d=o>0?(u/o*100).toFixed(1):"0",f=c.length>30?c.slice(0,28)+"..":c,h=(p=t.byModelValue)==null?void 0:p[c];return i.jsxs("div",{className:"cost-row",children:[i.jsx("span",{className:"cost-row-name",children:f}),i.jsx("div",{className:"cost-row-bar",children:i.jsx("div",{className:"cost-row-fill",style:{width:`${d}%`}})}),i.jsx("span",{className:"cost-row-value",children:Wt(u)}),typeof h=="number"&&h>0&&i.jsxs("span",{className:"cost-row-reported",title:"List-price value absorbed by a free/subscription tier — not spend",children:["value ",Wt(h)]})]},c)})}),i.jsx("h2",{className:"section-subtitle",children:"Recent Requests"}),i.jsx("div",{className:"request-list",children:!t.recent||t.recent.length===0?i.jsx("div",{className:"empty-state",children:"No requests recorded yet."}):t.recent.slice(0,30).map((c,u)=>i.jsxs("div",{className:"request-row",children:[i.jsx("span",{className:"request-time",children:oE(c.timestamp)}),i.jsx("span",{className:"request-provider",children:c.provider||"--"}),i.jsx("span",{className:"request-model",children:c.model||"--"}),i.jsxs("span",{className:"request-cost",children:[c.reported?"🧾 ":"",Wt(c.costUsd)]}),i.jsxs("span",{className:"request-tokens",children:[na(c.totalTokens)," tok"]})]},u))})]})}function Sse(e){return e==null?"$0.00":"$"+e.toFixed(6)}function sf(e){return e==null?"0%":(e*100).toFixed(1)+"%"}function jse({data:e}){if(!e)return i.jsxs(i.Fragment,{children:[i.jsx(Oe,{icon:"📈",title:"Benchmark Results"}),i.jsx("div",{className:"loading-state",children:i.jsx("p",{children:"Loading benchmark data..."})})]});const{benchmarks:t,evals:n}=e,r=t.latest,a=t.runs||[],s=(n==null?void 0:n.runs)||[],o=(n==null?void 0:n.latest)||null,l=s.map(u=>({name:u.model.length>12?u.model.slice(0,10)+"..":u.model,score:Math.round(u.summary.avgCompositeScore*100),completion:Math.round(u.summary.completionRate*100),tests:Math.round(u.summary.testPassRate*100),recovery:Math.round(u.summary.recoveryRate*100),efficiency:Math.round(u.summary.avgTokenEfficiency*100),fullModel:u.model,provider:u.provider})).reverse(),c=a.map(u=>({name:u.model.length>12?u.model.slice(0,10)+"..":u.model,passRate:u.summary.totalTasks>0?Math.round(u.summary.tasksPassed/u.summary.totalTasks*100):0,quality:Math.round(u.summary.avgQualityScore*100),latency:u.summary.medianLatencyMs,cost:u.summary.totalCostUsd,fullModel:u.model,provider:u.provider})).reverse();return i.jsxs(i.Fragment,{children:[i.jsx(Oe,{icon:"📈",title:"Benchmark Results"}),i.jsx("div",{className:"benchmark-latest",children:r?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"benchmark-header",children:[i.jsx("strong",{children:"Latest Run:"})," ",r.provider,"/",r.model]}),i.jsxs("div",{className:"benchmark-stats",children:[i.jsxs("div",{className:"benchmark-stat pass",children:[i.jsxs("div",{className:"benchmark-stat-value",children:[r.summary.tasksPassed,"/",r.summary.totalTasks]}),i.jsx("div",{className:"benchmark-stat-label",children:"Passed"})]}),i.jsxs("div",{className:"benchmark-stat quality",children:[i.jsx("div",{className:"benchmark-stat-value",children:sf(r.summary.avgQualityScore)}),i.jsx("div",{className:"benchmark-stat-label",children:"Quality"})]}),i.jsxs("div",{className:"benchmark-stat latency",children:[i.jsxs("div",{className:"benchmark-stat-value",children:[r.summary.medianLatencyMs,"ms"]}),i.jsx("div",{className:"benchmark-stat-label",children:"Latency"})]}),i.jsxs("div",{className:"benchmark-stat fail",children:[i.jsx("div",{className:"benchmark-stat-value",children:Sse(r.summary.totalCostUsd)}),i.jsx("div",{className:"benchmark-stat-label",children:"Cost"})]})]})]}):i.jsxs("div",{className:"empty-state",children:["No benchmark runs yet. Run ",i.jsx("code",{children:"nuvira benchmark"})," to start."]})}),c.length>1&&i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"Pass Rate by Model"}),i.jsx("div",{className:"chart-container",children:i.jsx(ds,{width:"100%",height:260,children:i.jsxs(fs,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[i.jsx(di,{strokeDasharray:"3 3"}),i.jsx(oa,{dataKey:"name",tick:{fontSize:11}}),i.jsx(la,{domain:[0,100],tick:{fontSize:11},tickFormatter:u=>u+"%"}),i.jsx(bn,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8},labelStyle:{color:"var(--text-primary)"},formatter:u=>[u+"%","Pass Rate"]}),i.jsx(yn,{dataKey:"passRate",radius:[4,4,0,0],children:c.map((u,d)=>i.jsx(vu,{fillOpacity:.8,style:{fill:u.passRate>=80?"var(--accent-green)":u.passRate>=50?"var(--accent-yellow)":"var(--accent-red)"}},d))})]})})}),i.jsx("h2",{className:"section-subtitle",children:"Latency by Model"}),i.jsx("div",{className:"chart-container",children:i.jsx(ds,{width:"100%",height:260,children:i.jsxs(fs,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[i.jsx(di,{strokeDasharray:"3 3"}),i.jsx(oa,{dataKey:"name",tick:{fontSize:11}}),i.jsx(la,{tick:{fontSize:11},tickFormatter:u=>u+"ms"}),i.jsx(bn,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8},labelStyle:{color:"var(--text-primary)"},formatter:u=>[u+"ms","Latency"]}),i.jsx(yn,{dataKey:"latency",radius:[4,4,0,0],fillOpacity:.8,fill:"var(--accent-yellow)",style:{fill:"var(--accent-yellow)"}})]})})}),i.jsx("h2",{className:"section-subtitle",children:"Cost by Model"}),i.jsx("div",{className:"chart-container",children:i.jsx(ds,{width:"100%",height:260,children:i.jsxs(fs,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[i.jsx(di,{strokeDasharray:"3 3"}),i.jsx(oa,{dataKey:"name",tick:{fontSize:11}}),i.jsx(la,{tick:{fontSize:11},tickFormatter:u=>"$"+u.toFixed(6)}),i.jsx(bn,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8},labelStyle:{color:"var(--text-primary)"},formatter:u=>["$"+u.toFixed(6),"Cost"]}),i.jsx(yn,{dataKey:"cost",radius:[4,4,0,0],fillOpacity:.8,fill:"var(--accent-purple)",style:{fill:"var(--accent-purple)"}})]})})})]}),i.jsx("h2",{className:"section-subtitle",children:"🎯 Agent Evaluation"}),i.jsx("p",{className:"section-hint",style:{color:"var(--text-secondary)",fontSize:12,marginBottom:16},children:"End-to-end coding tasks run through the full agent pipeline — measures if the agent is actually improving."}),i.jsx("div",{className:"benchmark-latest",children:o?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"benchmark-header",children:[i.jsx("strong",{children:"Latest Eval Run:"})," ",o.provider,"/",o.model]}),i.jsxs("div",{className:"benchmark-stats",children:[i.jsxs("div",{className:"benchmark-stat pass",children:[i.jsxs("div",{className:"benchmark-stat-value",children:[o.summary.tasksPassed,"/",o.summary.totalTasks]}),i.jsx("div",{className:"benchmark-stat-label",children:"Tests Passed"})]}),i.jsxs("div",{className:"benchmark-stat quality",children:[i.jsx("div",{className:"benchmark-stat-value",children:sf(o.summary.avgCompositeScore)}),i.jsx("div",{className:"benchmark-stat-label",children:"Composite Score"})]}),i.jsxs("div",{className:"benchmark-stat latency",children:[i.jsx("div",{className:"benchmark-stat-value",children:sf(o.summary.recoveryRate)}),i.jsx("div",{className:"benchmark-stat-label",children:"Recovery Rate"})]}),i.jsxs("div",{className:"benchmark-stat fail",children:[i.jsx("div",{className:"benchmark-stat-value",children:o.summary.totalRollbacks}),i.jsx("div",{className:"benchmark-stat-label",children:"Rollbacks"})]}),i.jsxs("div",{className:"benchmark-stat deps",children:[i.jsx("div",{className:"benchmark-stat-value",children:sf(o.summary.dependencyInstallRate)}),i.jsx("div",{className:"benchmark-stat-label",children:"Deps Installed"})]})]})]}):i.jsxs("div",{className:"empty-state",children:["No eval runs yet. Run ",i.jsx("code",{children:"nuvira eval run"})," to measure the agent end-to-end."]})}),l.length>1&&i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"Composite Score by Model"}),i.jsx("div",{className:"chart-container",children:i.jsx(ds,{width:"100%",height:260,children:i.jsxs(fs,{data:l,margin:{top:20,right:20,left:10,bottom:40},children:[i.jsx(di,{strokeDasharray:"3 3"}),i.jsx(oa,{dataKey:"name",tick:{fontSize:11}}),i.jsx(la,{domain:[0,100],tick:{fontSize:11},tickFormatter:u=>u+"%"}),i.jsx(bn,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8},labelStyle:{color:"var(--text-primary)"},formatter:u=>[u+"%","Composite Score"]}),i.jsx(yn,{dataKey:"score",radius:[4,4,0,0],children:l.map((u,d)=>i.jsx(vu,{fillOpacity:.8,style:{fill:u.score>=80?"var(--accent-green)":u.score>=50?"var(--accent-yellow)":"var(--accent-red)"}},d))})]})})}),i.jsx("h2",{className:"section-subtitle",children:"Metric Breakdown (completion / tests / recovery / token efficiency)"}),i.jsx("div",{className:"chart-container",children:i.jsx(ds,{width:"100%",height:260,children:i.jsxs(fs,{data:l,margin:{top:20,right:20,left:10,bottom:40},children:[i.jsx(di,{strokeDasharray:"3 3"}),i.jsx(oa,{dataKey:"name",tick:{fontSize:11}}),i.jsx(la,{domain:[0,100],tick:{fontSize:11},tickFormatter:u=>u+"%"}),i.jsx(bn,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8},labelStyle:{color:"var(--text-primary)"}}),i.jsx(js,{}),i.jsx(yn,{dataKey:"completion",name:"Completion",radius:[4,4,0,0],fillOpacity:.8,fill:"var(--accent-green)",style:{fill:"var(--accent-green)"}}),i.jsx(yn,{dataKey:"tests",name:"Tests",radius:[4,4,0,0],fillOpacity:.8,fill:"var(--accent-blue)",style:{fill:"var(--accent-blue)"}}),i.jsx(yn,{dataKey:"recovery",name:"Recovery",radius:[4,4,0,0],fillOpacity:.8,fill:"var(--accent-yellow)",style:{fill:"var(--accent-yellow)"}}),i.jsx(yn,{dataKey:"efficiency",name:"Token Eff.",radius:[4,4,0,0],fillOpacity:.8,fill:"var(--accent-purple)",style:{fill:"var(--accent-purple)"}})]})})})]}),i.jsx("h2",{className:"section-subtitle",children:"Eval Run History"}),i.jsx("div",{className:"benchmark-list",children:s.length===0?i.jsxs("div",{className:"empty-state",children:["No eval runs yet. Run ",i.jsx("code",{children:"nuvira eval run"})," to start."]}):s.map(u=>{const d=Math.round(u.summary.avgCompositeScore*100),f=d>=80?"high":d>=50?"medium":"low";return i.jsxs("div",{className:"benchmark-item",children:[i.jsx("span",{className:"benchmark-date",children:new Date(u.startedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})}),i.jsxs("span",{className:"benchmark-model",children:[u.provider,"/",u.model]}),i.jsxs("span",{className:`benchmark-score ${f}`,children:[d,"%"]})]},u.id)})}),i.jsx("h2",{className:"section-subtitle",children:"Run History"}),i.jsx("div",{className:"benchmark-list",children:a.length===0?i.jsxs("div",{className:"empty-state",children:["No benchmark runs yet. Run ",i.jsx("code",{children:"nuvira benchmark"})," to start."]}):a.map(u=>{const d=u.summary.totalTasks>0?Math.round(u.summary.tasksPassed/u.summary.totalTasks*100):0,f=d>=80?"high":d>=50?"medium":"low";return i.jsxs("div",{className:"benchmark-item",children:[i.jsx("span",{className:"benchmark-date",children:new Date(u.startedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})}),i.jsxs("span",{className:"benchmark-model",children:[u.provider,"/",u.model]}),i.jsxs("span",{className:`benchmark-score ${f}`,children:[d,"%"]})]},u.id)})})]})}const Nse={pass:"✅",warn:"⚠️",fail:"❌"},Ese={pass:"PASS",warn:"WARN",fail:"FAIL"};function fM(e){const t={pass:0,warn:0,fail:0};for(const n of e)t[n.status]!==void 0&&(t[n.status]+=1);return t}function hM(e){const t=[];return e.fail>0&&t.push(`${e.fail} failing`),e.warn>0&&t.push(`${e.warn} warning${e.warn===1?"":"s"}`),e.pass>0&&t.push(`${e.pass} passing`),t.length>0?t.join(" · "):"no checks"}function qb({check:e}){return i.jsxs("div",{className:"admin-check-row","data-status":e.status,"data-testid":`check-${e.name}`,children:[i.jsxs("span",{className:`admin-check-badge admin-check-${e.status}`,children:[Nse[e.status]," ",Ese[e.status]]}),i.jsxs("div",{className:"admin-check-body",children:[i.jsx("div",{className:"admin-check-name",children:e.name}),i.jsx("div",{className:"admin-check-message",children:e.message}),e.detail?i.jsx("div",{className:"admin-check-detail",children:e.detail}):null,e.fix?i.jsxs("div",{className:"admin-check-fix",children:["💡 ",e.fix]}):null]})]})}function _se({text:e}){const[t,n]=b.useState(!1),r=async()=>{const a=navigator.clipboard;if(a!=null&&a.writeText)try{await a.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{}};return i.jsx("button",{type:"button",className:"admin-refresh-btn",title:"Copy this install command",onClick:()=>void r(),"data-testid":`copy-${e.slice(0,12)}`,children:t?"✓ Copied":"⧉ Copy"})}function Cse({tools:e,summary:t}){if(!e)return i.jsxs("section",{style:{marginBottom:18},"data-testid":"runtime-tools",children:[i.jsx("h2",{className:"section-subtitle",children:"Runtime Tools"}),i.jsxs("p",{style:{fontSize:11,color:"var(--text-secondary)",margin:"4px 0 10px"},children:["This dashboard server did not report the runtime tools — restart it (",i.jsx("code",{children:"nuvira dashboard stop"}),", then start it again) and reload this page."]})]});const n=e.filter(s=>!s.present),r=n.filter(s=>s.need==="recommended"),a=e.length-n.length;return i.jsxs("section",{style:{marginBottom:18},"data-testid":"runtime-tools",children:[i.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[i.jsx("h2",{className:"section-subtitle",style:{margin:0},children:"Runtime Tools"}),i.jsx("span",{style:{fontSize:12,color:n.length===0?"var(--accent-green)":"var(--text-secondary)"},"data-testid":"runtime-tools-summary",children:t??`${a} of ${e.length} installed`})]}),i.jsxs("p",{style:{fontSize:11,color:"var(--text-secondary)",margin:"4px 0 10px"},children:["Software the agent uses but does not ship. A missing one is not a fault — the feature that needs it reports itself as skipped — and the command below is the one for the machine this dashboard is running on. The whole list, with manual steps, is in ",i.jsx("code",{children:"docs/DEPENDENCIES.md"}),"."]}),e.map(s=>i.jsxs("div",{className:"admin-check-row","data-status":s.present?"pass":"warn","data-testid":`runtime-tool-${s.id}`,children:[i.jsx("span",{className:`admin-check-badge admin-check-${s.present?"pass":"warn"}`,children:s.present?"✅ INSTALLED":"⚠️ NOT INSTALLED"}),i.jsxs("div",{className:"admin-check-body",children:[i.jsxs("div",{className:"admin-check-name",children:[s.label," ",i.jsx("span",{style:{fontSize:11,color:"var(--text-secondary)"},children:s.need==="recommended"?"· recommended":"· optional"})]}),i.jsx("div",{className:"admin-check-message",children:s.enables}),s.present?i.jsxs("div",{className:"admin-check-detail",children:["Needed by: ",s.neededBy.join(", ")]}):i.jsxs("div",{className:"admin-check-fix","data-testid":`install-${s.id}`,children:[s.installCommand?i.jsxs(i.Fragment,{children:["💡 Install:"," ",i.jsx("code",{children:s.installCommand})," ",i.jsx(_se,{text:s.installCommand}),s.needsHumanInput?i.jsxs("div",{style:{marginTop:4},children:["Needs your password or a GUI installer — run it yourself; ",i.jsx("code",{children:"nuvira doctor --fix"})," will print it for you rather than driving it."]}):i.jsxs("div",{style:{marginTop:4},children:["Or let the agent do it: ",i.jsx("code",{children:"nuvira doctor --fix"})]})]}):i.jsx(i.Fragment,{children:"💡 No one-line installer on this OS — see docs/DEPENDENCIES.md"}),s.note?i.jsxs("div",{style:{marginTop:4},children:["ℹ️ ",s.note]}):null]})]})]},s.id)),r.length>0?i.jsxs("p",{style:{fontSize:11,color:"var(--text-secondary)",margin:"8px 0 0"},"data-testid":"runtime-tools-hint",children:[r.length," recommended tool",r.length===1?"":"s"," missing:"," ",r.map(s=>s.label).join(", "),". ",i.jsx("code",{children:"nuvira doctor --fix"})," installs them all, asking before each one."]}):null]})}function lE(e){return`${(e*100).toFixed(1)}%`}function Ase(e){return e>=.9?"ok":e>=.7?"warn":"danger"}function yc(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":bt(e)}function Tse(e){if(!e)return"never";const t=Math.floor((Date.now()-e)/1e3);if(t<60)return`${t}s ago`;const n=Math.floor(t/60);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ${n%60}m ago`:`${Math.floor(r/24)}d ago`}function cE({title:e,blurb:t,checks:n,testId:r}){const a=fM(n);return i.jsxs("section",{style:{marginBottom:18},"data-testid":r,children:[i.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[i.jsx("h2",{className:"section-subtitle",style:{margin:0},children:e}),i.jsx("span",{style:{fontSize:12,color:a.fail>0?"var(--accent-red)":a.warn>0?"var(--accent-yellow)":"var(--accent-green)"},"data-testid":`${r}-summary`,children:hM(a)})]}),i.jsx("p",{style:{fontSize:11,color:"var(--text-secondary)",margin:"4px 0 10px"},children:t}),i.jsx("div",{className:"admin-check-list",children:n.length>0?n.map(s=>i.jsx(qb,{check:s},s.name)):i.jsxs("div",{className:"empty-state",children:["No ",e.toLowerCase()," checks returned."]})})]})}function Ose({data:e,connected:t,lastUpdated:n}){const[r,a]=b.useState(null),[s,o]=b.useState(null),[l,c]=b.useState(!1),u=b.useCallback(async()=>{c(!0),o(null);const v=await K.fetchAdminChecks();v?a(v):o("Could not reach the dashboard server, or it is older than this page. Run `nuvira dashboard` to start it."),c(!1)},[]);b.useEffect(()=>{u()},[u]);const d=e==null?void 0:e.health,f=(d==null?void 0:d.agentStats)??null,h=[...(r==null?void 0:r.system)??[],...(r==null?void 0:r.enterprise)??[]],p=fM(h),m=((r==null?void 0:r.providers)??[]).filter(v=>v.configured).length,g=((r==null?void 0:r.providers)??[]).length,y=f?Object.entries(f.agents).map(([v,k])=>({agent:v,...k})).sort((v,k)=>k.totalRuns-v.totalRuns||v.agent.localeCompare(k.agent)):[];return i.jsxs(i.Fragment,{children:[i.jsx(Oe,{icon:"⚙️",title:"System Health"}),i.jsxs("p",{className:"section-description",style:{fontSize:12,color:"var(--text-secondary)",marginBottom:14},children:["The same checks ",i.jsx("code",{children:"nuvira doctor"})," runs, executed on demand — pass / warn / fail, with the fix for anything that is not passing. The store counters at the bottom are how big the agent's memory files are; they are not a health verdict."]}),i.jsxs("div",{className:"health-grid",style:{marginBottom:18},children:[i.jsxs("div",{className:"health-card",children:[i.jsx("span",{className:"health-icon",children:t?"🟢":"🟠"}),i.jsxs("div",{className:"health-body",children:[i.jsx("div",{className:"health-title",children:"Live Stream"}),i.jsx("div",{className:"health-value","data-testid":"connection-state",children:t?"● Connected":"● Reconnecting…"})]})]}),i.jsxs("div",{className:"health-card",children:[i.jsx("span",{className:"health-icon",children:"⏱️"}),i.jsxs("div",{className:"health-body",children:[i.jsx("div",{className:"health-title",children:"Last Update"}),i.jsx("div",{className:"health-value",children:n})]})]}),i.jsxs("div",{className:"health-card",children:[i.jsx("span",{className:"health-icon",children:"🩺"}),i.jsxs("div",{className:"health-body",children:[i.jsx("div",{className:"health-title",children:"Doctor"}),i.jsx("div",{className:"health-value","data-testid":"doctor-verdict",style:{color:p.fail>0?"var(--accent-red)":p.warn>0?"var(--accent-yellow)":"var(--accent-green)"},children:r?hM(p):l?"running…":"--"})]})]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:6},children:[i.jsx("h2",{className:"section-subtitle",style:{margin:0},children:"Doctor Checks"}),i.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:l,onClick:()=>void u(),"data-testid":"run-checks",children:l?"⏳ Running…":"↻ Run checks again"}),g>0?i.jsxs("span",{style:{fontSize:11,color:"var(--text-secondary)"},children:[m," of ",g," providers configured — per-provider detail is on the Admin tab"]}):null]}),s?i.jsx("div",{className:"admin-row-msg admin-row-msg-err",style:{marginBottom:12},children:s}):null,!r&&!s?i.jsx("div",{className:"loading-state",children:"Running checks…"}):null,r?i.jsxs(i.Fragment,{children:[i.jsx(cE,{title:"System",blurb:"Runtime, filesystem, configuration and the local model surface.",checks:r.system,testId:"checks-system"}),i.jsx(cE,{title:"Enterprise",blurb:"Governance, audit, RBAC and the controls an operator is accountable for.",checks:r.enterprise,testId:"checks-enterprise"}),i.jsx(Cse,{tools:r.runtimeTools,summary:r.runtimeToolsSummary})]}):null,i.jsx("h2",{className:"section-subtitle",children:"Agent Performance"}),f?i.jsxs(i.Fragment,{children:[i.jsx(Wi,{tiles:[{key:"runs",icon:"🩺",value:yc(f.totalRuns),label:"Recorded runs",tone:"accent"},{key:"success-rate",icon:"✅",value:lE(f.overallSuccessRate),label:"Overall success rate",tone:Ase(f.overallSuccessRate)}]}),y.length>0?i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:18},children:y.map(v=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,fontSize:12,padding:"4px 0",borderBottom:"1px solid var(--border-light)"},"data-testid":`agent-stats-${v.agent}`,children:[i.jsx("span",{style:{flex:1,color:"var(--text-primary)"},children:v.agent}),i.jsxs("span",{style:{color:"var(--text-secondary)"},children:[yc(v.totalRuns)," runs"]}),i.jsx("span",{style:{color:v.successRate>=.9?"var(--accent-green)":v.successRate>=.7?"var(--accent-yellow)":"var(--accent-red)"},children:lE(v.successRate)}),i.jsx("span",{style:{color:"var(--text-secondary)",minWidth:78,textAlign:"right"},children:Tse(v.lastRun)})]},v.agent))}):i.jsx("p",{style:{fontSize:11,color:"var(--text-secondary)",marginBottom:18},children:"No agent runs recorded yet — this fills in as agents execute."})]}):i.jsx("p",{style:{fontSize:11,color:"var(--text-secondary)",marginBottom:18},children:"No agent-stats file yet. Run a task and the per-agent success rates appear here."}),i.jsx("h2",{className:"section-subtitle",children:"Learning Stores"}),i.jsx("p",{style:{fontSize:11,color:"var(--text-secondary)",margin:"4px 0 10px"},children:"What the agent has learned into disk. Sizes, not verdicts."}),i.jsxs("div",{className:"health-grid",children:[i.jsxs("div",{className:"health-card",children:[i.jsx("span",{className:"health-icon",children:"💾"}),i.jsxs("div",{className:"health-body",children:[i.jsx("div",{className:"health-title",children:"Memory Directory"}),i.jsx("div",{className:"health-path",children:(d==null?void 0:d.memoryDir)||"~/.nuvira/memory/"})]})]}),i.jsxs("div",{className:"health-card",children:[i.jsx("span",{className:"health-icon",children:"📝"}),i.jsxs("div",{className:"health-body",children:[i.jsx("div",{className:"health-title",children:"Coding Patterns"}),i.jsx("div",{className:"health-value",children:yc(d==null?void 0:d.patterns)})]})]}),i.jsxs("div",{className:"health-card",children:[i.jsx("span",{className:"health-icon",children:"👍"}),i.jsxs("div",{className:"health-body",children:[i.jsx("div",{className:"health-title",children:"User Feedback"}),i.jsxs("div",{className:"health-value",children:[yc(d==null?void 0:d.feedback)," ratings"]})]})]}),i.jsxs("div",{className:"health-card",children:[i.jsx("span",{className:"health-icon",children:"🧠"}),i.jsxs("div",{className:"health-body",children:[i.jsx("div",{className:"health-title",children:"Vector Index"}),i.jsxs("div",{className:"health-value",children:[yc(d==null?void 0:d.vectors)," entries"]})]})]})]}),e?null:i.jsx("p",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:10},children:"Waiting for the first data frame from the dashboard server — the checks above do not depend on it."}),i.jsx("h2",{className:"section-subtitle",children:"Server Info"}),i.jsxs("div",{className:"server-info",children:[i.jsxs("div",{className:"info-row",children:[i.jsx("span",{className:"info-label",children:"Stream"}),i.jsx("span",{className:"info-value",children:t?"● Connected":"● Reconnecting…"})]}),i.jsxs("div",{className:"info-row",children:[i.jsx("span",{className:"info-label",children:"Last Updated"}),i.jsx("span",{className:"info-value",children:n})]}),i.jsxs("div",{className:"info-row",children:[i.jsx("span",{className:"info-label",children:"Checks run at"}),i.jsx("span",{className:"info-value",children:r!=null&&r.serverTime?new Date(r.serverTime).toLocaleString():"--"})]}),i.jsxs("div",{className:"info-row",children:[i.jsx("span",{className:"info-label",children:"Data Directory"}),i.jsx("span",{className:"info-value",children:(d==null?void 0:d.memoryDir)||"~/.nuvira/memory/"})]})]})]})}const Pse=new Set(["local","lmstudio","vllm"]),Rse=new Set([]),cp={available:{bg:"var(--ok-soft)",text:"var(--accent-green)",dot:"var(--accent-green)",cardBorder:"var(--accent-green)",cardBg:"var(--ok-soft)"},limited:{bg:"var(--warn-soft)",text:"var(--accent-yellow)",dot:"var(--accent-yellow)",cardBorder:"var(--accent-yellow)",cardBg:"var(--warn-soft)"},unavailable:{bg:"var(--danger-soft)",text:"var(--accent-red)",dot:"var(--accent-red)",cardBorder:"var(--accent-red)",cardBg:"var(--danger-soft)"}},Mse=[3,4,5],pM=12e3,uE=[300,700],Ise=6e4,$se=5e3;function Lse(e){return new Promise(t=>setTimeout(t,e))}async function mM(e,t){const n=new AbortController,r=setTimeout(()=>n.abort(),t);try{return await fetch(e,{signal:n.signal})}finally{clearTimeout(r)}}function gM(e){return e instanceof TypeError||e instanceof Error&&e.name==="AbortError"}async function Dse(e){let t=null,n=!1;for(let r=0;;r++){try{const a=await mM("/api/models",pM);if(!a.ok)t=a.status;else{const s=await it(a);if(s&&Array.isArray(s.providers))return s;throw new Error("Model health endpoint returned an unexpected response — is the dashboard server up to date?")}}catch(a){if(!gM(a))throw a;n=!0,e==null||e()}if(r>=uE.length)throw new Error(n?"Dashboard server unreachable — is it still running? Retrying automatically…":`Model health endpoint failed (HTTP ${t})`);await Lse(uE[r])}}async function Bse(e){for(let t=0;;t++)try{const n=await mM("/api/model-registry",pM);return n.ok?await it(n):null}catch(n){if(!gM(n)||t>=1)return null;e==null||e()}}function zse(e){return e==="available"?"Available":e==="limited"?"Limited":"Unavailable"}function Fse(e){return e==="available"?"Ready":e==="limited"?"Limited":"Down"}function vM(e){return{local:"💻",groq:"🟢",nim:"🔶",gemini:"🔷",openrouter:"🟣",openai:"🤖",anthropic:"🔮",mistral:"🌀",cohere:"🧠",together:"🟢",deepinfra:"🌐",fireworks:"🎆",perplexity:"❓",azure:"🔵",anyscale:"🔷",lmstudio:"🎨",vllm:"⚡"}[e]||"🔌"}function p0(e){return{local:"Ollama",groq:"Groq",nim:"NVIDIA NIM",gemini:"Gemini",openrouter:"OpenRouter",openai:"OpenAI",anthropic:"Anthropic",mistral:"Mistral",cohere:"Cohere",together:"Together AI",deepinfra:"DeepInfra",fireworks:"Fireworks AI",perplexity:"Perplexity",azure:"Azure OpenAI",anyscale:"Anyscale",lmstudio:"LM Studio",vllm:"vLLM / TGI"}[e]||e}function dE({status:e,label:t}){const n=cp[e];return i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,background:n.bg,color:n.text,padding:"3px 10px",borderRadius:12,fontSize:12,fontWeight:500,border:`1px solid ${n.text}22`},children:[i.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:n.dot}}),t]})}function Use({onRefresh:e,loading:t}){return i.jsxs("div",{className:"stats-grid mini",style:{marginBottom:16},children:[i.jsx("button",{onClick:e,disabled:t,className:"stat-card",style:{cursor:t?"not-allowed":"pointer",opacity:t?.6:1,border:"1px solid var(--border)",justifyContent:"center",fontSize:13},children:t?"⏳ Testing...":"🔄 Refresh Status"}),i.jsx("div",{className:"stat-card",style:{border:"1px solid var(--border)"},children:i.jsx("div",{style:{fontSize:13,color:"var(--text-secondary)",textAlign:"center",width:"100%"},children:"Tests all configured providers and their API keys in real time"})})]})}function Wse({data:e}){const t=e.totalModels;if(t===0)return null;const n=e.available||0,r=e.limited||0,a=e.unavailable||0;return i.jsxs("div",{style:{marginBottom:16},children:[i.jsxs("div",{style:{background:"var(--bg-primary)",borderRadius:8,overflow:"hidden",height:10,display:"flex",border:"1px solid var(--border-light)"},children:[n>0&&i.jsx("div",{style:{width:`${n/t*100}%`,background:"var(--accent-green)",transition:"width 0.5s"},title:`${n} available`}),r>0&&i.jsx("div",{style:{width:`${r/t*100}%`,background:"var(--accent-yellow)",transition:"width 0.5s"},title:`${r} limited`}),a>0&&i.jsx("div",{style:{width:`${a/t*100}%`,background:"var(--accent-red)",transition:"width 0.5s"},title:`${a} unavailable`})]}),i.jsxs("div",{style:{display:"flex",gap:16,marginTop:6,fontSize:12,color:"var(--text-secondary)"},children:[i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-green)"},children:"●"})," Ready"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-yellow)"},children:"●"})," Limited"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-red)"},children:"●"})," Unavailable"]})]}),typeof e.routable=="number"&&i.jsxs("div",{style:{marginTop:6,fontSize:12,color:"var(--text-secondary)",lineHeight:1.5},children:[i.jsx("strong",{style:{color:"var(--text-primary)"},children:t})," listed by providers ·"," ",i.jsx("strong",{style:{color:e.routable>0?"var(--accent-green)":"var(--accent-yellow)"},children:e.routable})," ","routable right now (verified, un-parked, not stale)",typeof e.registryTotal=="number"&&e.registryTotal>0&&i.jsxs(i.Fragment,{children:[" ","· registry tracks"," ",i.jsx("strong",{style:{color:"var(--text-primary)"},children:e.registryVerified??0})," of"," ",i.jsx("strong",{style:{color:"var(--text-primary)"},children:e.registryTotal})," verified"]})]})]})}function of({provider:e}){const[t,n]=b.useState(!1),r=cp[e.overallStatus].text,a={available:e.models.filter(s=>s.status==="available").length,limited:e.models.filter(s=>s.status==="limited").length,unavailable:e.models.filter(s=>s.status==="unavailable").length};return i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:`1px solid ${r}44`,borderLeft:`4px solid ${r}`,marginBottom:12,overflow:"hidden"},children:[i.jsxs("div",{onClick:()=>n(!t),style:{padding:"14px 18px",cursor:"pointer",display:"flex",alignItems:"center",gap:14,userSelect:"none"},children:[i.jsx("span",{style:{fontSize:24},children:e.icon}),i.jsxs("div",{style:{flex:1},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:2},children:[i.jsx("span",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)"},children:e.providerLabel}),i.jsx(dE,{status:e.overallStatus,label:zse(e.overallStatus)})]}),i.jsxs("div",{style:{fontSize:13,color:"var(--text-secondary)"},children:[e.models.length," model",e.models.length!==1?"s":"",a.available>0&&i.jsxs("span",{style:{color:"var(--accent-green)"},children:[" · ",a.available," ready"]}),a.limited>0&&i.jsxs("span",{style:{color:"var(--accent-yellow)"},children:[" · ",a.limited," limited"]}),a.unavailable>0&&i.jsxs("span",{style:{color:"var(--accent-red)"},children:[" · ",a.unavailable," unavailable"]})]})]}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",textAlign:"right"},children:[i.jsx("div",{style:{marginBottom:2,color:e.apiConfigured?"var(--accent-green)":"var(--accent-red)"},children:e.apiConfigured?"✅ Key set":"❌ No key"}),i.jsx("div",{style:{color:e.apiAccessible?"var(--accent-green)":"var(--accent-red)"},children:e.apiAccessible?"✅ Connected":"❌ Offline"})]}),i.jsx("span",{style:{color:"var(--text-secondary)",fontSize:18,transition:"transform 0.2s",transform:t?"rotate(90deg)":"rotate(0deg)"},children:"▶"})]}),t&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{padding:"10px 18px",background:"var(--bg-primary)",fontSize:13,color:"var(--text-secondary)",display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:8,borderTop:"1px solid var(--border-light)"},children:[i.jsx("span",{children:e.notes}),e.freeTierInfo&&i.jsxs("span",{style:{color:"var(--accent-yellow)"},children:["🎁 ",e.freeTierInfo]})]}),i.jsx("div",{style:{overflowX:"auto",borderTop:"1px solid var(--border-light)"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)",color:"var(--text-secondary)"},children:[i.jsx("th",{style:{padding:"8px 18px",textAlign:"left",fontWeight:500},children:"Model"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Status"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Quota"}),i.jsx("th",{style:{padding:"8px 18px",textAlign:"left",fontWeight:500},children:"Details"})]})}),i.jsx("tbody",{children:e.models.map((s,o)=>i.jsxs("tr",{style:{borderBottom:o<e.models.length-1?"1px solid var(--border-light)":"none",background:s.status==="unavailable"?"var(--bg-primary)":"transparent"},children:[i.jsxs("td",{style:{padding:"8px 18px",color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:[i.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:cp[s.status].dot,marginRight:8}}),s.name]}),i.jsx("td",{style:{padding:"8px 12px"},children:i.jsx(dE,{status:s.status,label:Fse(s.status)})}),i.jsx("td",{style:{padding:"8px 12px",color:"var(--text-secondary)",fontSize:12,fontFamily:"'SFMono-Regular', Consolas, monospace"},children:s.rateLimitRemaining!==void 0?s.rateLimitTotal?`${s.rateLimitRemaining}/${s.rateLimitTotal}`:`${s.rateLimitRemaining} left`:"—"}),i.jsx("td",{style:{padding:"8px 18px",color:"var(--text-secondary)",fontSize:12},children:s.statusReason})]},s.id))})]})})]})]})}function yM(e){if(e<=0)return"now";const t=Math.floor(e/36e5),n=Math.floor(e%36e5/6e4);return t>0?`${t}h ${n}m`:n>0?`${n}m`:`${Math.ceil(e/1e3)}s`}function Hse(e){return e==="verified"?{text:"var(--accent-green)",bg:"var(--ok-soft)",dot:"var(--accent-green)"}:e==="unavailable"?{text:"var(--accent-red)",bg:"var(--danger-soft)",dot:"var(--accent-red)"}:{text:"var(--text-secondary)",bg:"var(--bg-hover)",dot:"var(--bg-hover)"}}function Gse({rate:e}){const t=Math.round(e*100);return i.jsxs("span",{title:`⏸ flaky mid-stream ${t}% — started streaming, died before finish; the router deprioritizes flaky models (P4 M4.4)`,style:{marginLeft:8,fontSize:10,padding:"1px 6px",borderRadius:8,whiteSpace:"nowrap",background:"var(--purple-soft)",border:"1px solid var(--accent-purple)",color:"var(--accent-purple)"},children:["⏸ flaky ",t,"%"]})}function qse({tokens:e}){const t=e>=1048576?`${(e/1048576).toFixed(1).replace(/\.0$/,"")}M`:e>=1024?`${(e/1024).toFixed(0)}K`:`${e}`;return i.jsxs("span",{title:`⏳ context window ${bt(e)} tokens — live from the provider's model list (v1.60.x); feeds the router's context preflight`,style:{marginLeft:8,fontSize:10,padding:"1px 6px",borderRadius:8,whiteSpace:"nowrap",background:"var(--info-soft)",border:"1px solid var(--accent-blue)",color:"var(--accent-blue)"},children:["⏳ ",t]})}function Kse({history:e}){if(!e||e.length<2)return null;const t=46,n=14,r=1.5,a=Math.max(.01,...e.map(d=>d.rate)),s=e.map((d,f)=>{const h=r+f/(e.length-1)*(t-r*2),p=n-r-d.rate/a*(n-r*2);return`${h.toFixed(1)},${p.toFixed(1)}`}).join(" "),o=e[0].rate,l=e[e.length-1].rate,c=l<o,u=Math.round(l*100);return i.jsxs("svg",{width:t,height:n,viewBox:`0 0 ${t} ${n}`,style:{marginLeft:8,verticalAlign:"middle",cursor:"default"},"aria-label":"Flakiness trend",children:[i.jsx("title",{children:c?`Flakiness healing — ${u}% now, trending down (clean successes decay the signal)`:`Flakiness climbing — ${u}% now (recent mid-stream interruptions)`}),i.jsx("polyline",{points:s,fill:"none",style:{stroke:"var(--accent-purple)"},strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",opacity:.9}),i.jsx("circle",{cx:t-r,cy:n-r-l/a*(n-r*2),r:2,style:{fill:c?"var(--accent-green)":"var(--accent-purple)"}})]})}function Vse({entry:e}){const t=Hse(e.status),n=e.remainingTokens>=0?`${bt(e.remainingTokens)} left`:"unlimited";return i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)"},children:[i.jsxs("td",{style:{padding:"8px 12px",color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:[i.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:t.dot,marginRight:8}}),e.model.length>32?e.model.slice(0,29)+"…":e.model,(e.partialRate??0)>0&&i.jsx(Gse,{rate:e.partialRate??0}),e.partialHistory&&e.partialHistory.length>=2&&i.jsx(Kse,{history:e.partialHistory}),e.parked&&i.jsx("span",{style:{marginLeft:8,fontSize:10,padding:"1px 6px",borderRadius:8,background:"var(--danger-soft)",border:"1px solid var(--accent-red)",color:"var(--accent-red)"},children:"⏸ parked"}),e.measuredSamples?i.jsxs("span",{style:{marginLeft:8,fontSize:10,padding:"1px 6px",borderRadius:8,whiteSpace:"nowrap",background:"var(--ok-soft)",border:"1px solid var(--accent-green)",color:"var(--accent-green)"},children:["📏 ",e.measuredInputTokens,"→",e.measuredOutputTokens," tok"]}):i.jsx("span",{style:{marginLeft:8,fontSize:10,padding:"1px 6px",borderRadius:8,whiteSpace:"nowrap",background:"var(--bg-hover)",border:"1px solid var(--border-hover)",color:"var(--text-secondary)"},children:"📐 est"}),e.contextWindowTokens&&i.jsx(qse,{tokens:e.contextWindowTokens})]}),i.jsx("td",{style:{padding:"8px 12px"},children:i.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:11,fontWeight:600,background:t.bg,color:t.text,padding:"2px 8px",borderRadius:6},children:e.status==="verified"?"✓ Verified":e.status==="unavailable"?"✗ Unavailable":"◌ Unverified"})}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:e.remainingTokens>=0&&e.remainingTokens<=100?"var(--accent-yellow)":"var(--text-secondary)"},children:n}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",color:"var(--text-secondary)",fontSize:12,whiteSpace:"nowrap"},children:e.resetsInMs>0?yM(e.resetsInMs):"—"}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",color:"var(--text-secondary)",fontSize:12,fontFamily:"'SFMono-Regular', Consolas, monospace"},children:e.latencyMs!==void 0?`${e.latencyMs}ms`:"—"}),i.jsx("td",{style:{padding:"8px 12px",color:"var(--text-muted)",fontSize:11,maxWidth:180,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.lastError||(e.source?`learned via ${e.source}`:"")})]})}function Yse({provider:e}){const[t,n]=b.useState(!1),r=e.verified>0?"var(--accent-green)":e.unavailable>0?"var(--accent-red)":"var(--border-hover)";return i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:`1px solid ${r}44`,borderLeft:`4px solid ${r}`,marginBottom:12,overflow:"hidden"},children:[i.jsxs("div",{onClick:()=>n(!t),style:{padding:"14px 18px",cursor:"pointer",display:"flex",alignItems:"center",gap:14,userSelect:"none"},children:[i.jsx("span",{style:{fontSize:24},children:vM(e.provider)}),i.jsxs("div",{style:{flex:1},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:2},children:[i.jsx("span",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)"},children:p0(e.provider)}),i.jsx("span",{style:{fontSize:11,padding:"2px 8px",borderRadius:10,background:e.parked>0?"var(--danger-soft)":"var(--ok-soft)",border:`1px solid ${e.parked>0?"var(--accent-red)":"var(--accent-green)"}`,color:e.parked>0?"var(--accent-red)":"var(--accent-green)"},children:e.parked>0?`${e.parked} parked`:"routable"}),(e.flaky??0)>0&&i.jsxs("span",{style:{fontSize:11,padding:"2px 8px",borderRadius:10,background:"var(--purple-soft)",border:"1px solid var(--accent-purple)",color:"var(--accent-purple)"},children:["⏸ ",e.flaky," flaky"]})]}),i.jsxs("div",{style:{fontSize:13,color:"var(--text-secondary)"},children:[e.verified," verified · ",e.unverified," unverified · ",e.unavailable," unavailable"]})]}),i.jsx("span",{style:{color:"var(--text-secondary)",fontSize:18,transition:"transform 0.2s",transform:t?"rotate(90deg)":"rotate(0deg)"},children:"▶"})]}),t&&i.jsx("div",{style:{overflowX:"auto",borderTop:"1px solid var(--border-light)"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)",color:"var(--text-secondary)"},children:[i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Model"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Availability"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"right",fontWeight:500},children:"Tokens left"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"right",fontWeight:500},children:"Resets in"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"right",fontWeight:500},children:"Latency"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Reason / Source"})]})}),i.jsx("tbody",{children:e.models.map(a=>i.jsx(Vse,{entry:a},a.model))})]})})]})}function Xse(e){if(!e)return null;const t=Object.entries(e.consecutive).filter(([,n])=>n>0);return t.length===0?null:i.jsxs("div",{style:{background:"color-mix(in srgb, var(--accent-yellow) 8%, transparent)",border:"1px solid var(--accent-yellow)",borderRadius:10,padding:"10px 14px",marginBottom:14,fontSize:12,color:"var(--accent-yellow)",display:"flex",gap:10,alignItems:"flex-start"},children:[i.jsx("span",{style:{fontSize:15,lineHeight:"18px"},children:"🧹"}),i.jsxs("div",{children:[i.jsx("div",{style:{fontWeight:600,color:"var(--accent-yellow)",marginBottom:2},children:"Key hygiene in progress"}),i.jsx("div",{children:t.map(([n,r])=>i.jsxs("span",{style:{display:"inline-block",marginRight:12},children:[i.jsx("code",{style:{color:"var(--text-primary)"},children:n})," ",r,"/",e.threshold," consecutive auth failures",r>=e.threshold?" — key auto-cleared 🚫":" — key will be auto-cleared at the threshold"]},n))}),i.jsxs("div",{style:{marginTop:4,color:"var(--accent-yellow)"},children:["After ",e.threshold," consecutive 401/403s the invalid key is removed from config; run"," ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"nuvira config set providers.<provider>.apiKey <real-key>"})," to re-enable."]})]})]})}function Qse({data:e}){return e.enabled?i.jsxs(i.Fragment,{children:[i.jsx(Oe,{icon:"📦",title:"Model Availability Registry"}),i.jsxs("p",{className:"section-description",children:["The unified sub-ms FAISS/JSON snapshot the Auto router consults on every pick: verified vs unavailable models plus quota telemetry (tokens remaining, reset windows) mirrored from the ledger. Each row's ",i.jsx("strong",{children:"⏳ chip"})," is the LIVE provider-advertised context window (v1.60.x) — the real spec the router's context preflight uses, recorded by the probe from each provider's model list (Ollama /api/tags + /api/show, OpenRouter, Gemini, NIM). State changes during a session are reported to the watch daemon and recorded here immediately."]}),i.jsx(Wi,{tiles:[{key:"tracked-models",icon:"📦",value:String(e.total),label:"Tracked models (registry)",tone:"accent"},{key:"verified",icon:"✅",value:String(e.verified),label:"Verified",tone:"ok"},{key:"unverified",icon:"◌",value:String(e.unverified),label:"Unverified",tone:"accent"},{key:"unavailable",icon:"⛔",value:String(e.unavailable),label:"Unavailable",tone:"danger"},{key:"parked",icon:"⏸",value:String(e.parked),label:"Quota-parked",tone:"warn"},{key:"flaky",icon:"⏸",value:String(e.flaky??0),label:"Flaky mid-stream",tone:"warn"},{key:"deleted-local",icon:"🗑️",value:String(e.deletedLocal??0),label:"Deleted locally",tone:"accent"}]}),Xse(e.keyHygiene),e.providers.map(t=>i.jsx(Yse,{provider:t},t.provider)),i.jsx("div",{style:{textAlign:"center",fontSize:12,color:"var(--text-muted)",marginTop:12},children:"Backend snapshot · auto-refreshes every 60s"})]}):i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:"1px dashed var(--border)",padding:"20px 24px",marginTop:24,textAlign:"center"},children:[i.jsx("div",{style:{fontSize:24,marginBottom:8},children:"📦"}),i.jsx("div",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"Model Availability Registry"}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-muted)"},children:["No registry data yet — run ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"nuvira models refresh"})," or use Auto routing; the registry learns from real usage and probes."]})]})}const Zse={chat:"💬",execute:"⚙️",plan:"🗺️",edit:"✏️",skill:"🧩",learn:"📚",ci:"🔁",doctor:"🩺",probe:"🔭","spot-check":"🧪",telemetry:"📡",usage:"🧮"};function Jse(e){return{chat:"Chat",execute:"Execute",plan:"Plan",edit:"Edit",skill:"Skill",learn:"Learn",ci:"CI Review",doctor:"Doctor Probe",probe:"Probe","spot-check":"Spot-check",telemetry:"Usage mirror"}[e]||e.charAt(0).toUpperCase()+e.slice(1)}function eoe(e){return Zse[e]||"🎯"}function toe(e){return e?new Date(e).toLocaleDateString()+" "+new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"—"}function ws({provider:e,model:t,reason:n,killed:r,transient:a,partial:s,streamedChunks:o}){const l=r===!0,c=a===!0,u=s===!0,d=u?"var(--accent-purple)":c?"var(--accent-yellow)":l?"var(--accent-red)":"var(--accent-green)",f=u?"var(--purple-soft)":c?"var(--warn-soft)":l?"var(--danger-soft)":"var(--ok-soft)";return i.jsxs("span",{title:u?`Mid-stream interruption — started streaming${typeof o=="number"?` ~${o} chunks in`:""}, died before finish (P4 M4.4); router deprioritizes flaky mid-stream providers${n?` · ${n}`:""}`:c?`Transient failure — health decayed, no flip${n?` · ${n}`:""}`:l?`Killed by this action — predictively skipped by routing${n?` · ${n}`:""}`:"Verified by this action — trusted by routing",style:{display:"inline-flex",alignItems:"center",gap:6,background:f,border:`1px solid ${d}`,color:d,padding:"3px 9px",borderRadius:8,fontSize:11,fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap",transition:"transform 0.15s",cursor:"default"},onMouseEnter:h=>{h.currentTarget.style.transform="scale(1.05)"},onMouseLeave:h=>{h.currentTarget.style.transform="scale(1)"},children:[i.jsx("span",{style:{opacity:.85},children:u?"⏸":c?"~":l?"✗":"✓"}),e,"/",t.length>30?t.slice(0,27)+"…":t,(l||u)&&n&&i.jsxs("span",{style:{color:`${d}99`,fontSize:10,fontWeight:400},children:["· ",n]})]})}function noe(e){const t=new Map;for(const r of e)t.set(`${r.provider}|${r.model}|${r.outcome}`,r);const n={unavailable:0,partial:1,verified:2,error:3};return[...t.values()].sort((r,a)=>n[r.outcome]-n[a.outcome]||a.at-r.at)}function roe(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.verified+n.killed+n.transient+(n.partial||0)>0)return t}return Math.max(0,e.length-1)}function aoe({timeline:e}){const[t,n]=b.useState(()=>roe(e||[])),[r,a]=b.useState(!1),s=b.useRef(null),o=b.useRef(!1),l=(e==null?void 0:e.length)??0,c=Math.max(0,Math.min(t,l-1));b.useEffect(()=>{n(g=>Math.min(g,Math.max(0,l-1)))},[l]);const u=b.useCallback(g=>{const y=s.current;if(!y||l<=0)return;const v=y.getBoundingClientRect(),k=v.width||1,w=Math.min(1,Math.max(0,(g-v.left)/k));n(Math.min(l-1,Math.floor(w*l)))},[l]),d=g=>{o.current=!0,a(!1),u(g.clientX)};if(b.useEffect(()=>{const g=v=>{o.current&&u(v.clientX)},y=()=>{o.current=!1};return window.addEventListener("pointermove",g),window.addEventListener("pointerup",y),()=>{window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",y)}},[u]),b.useEffect(()=>{if(!r||l<=1)return;const g=setInterval(()=>{n(y=>Math.min(l-1,y+1))},300);return()=>clearInterval(g)},[r,l]),b.useEffect(()=>{r&&l>1&&t>=l-1&&(a(!1),n(0))},[r,l,t]),!e||l===0)return null;const f=Math.max(1,...e.map(g=>g.verified+g.killed+g.transient+(g.partial||0))),h=g=>new Date(g).toLocaleDateString([],{month:"short",day:"numeric"}),p=e[c],m=p?noe(p.events||[]):[];return i.jsxs("div",{style:{marginTop:12,paddingTop:10,borderTop:"1px solid var(--border-light)"},children:[i.jsxs("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-secondary)",marginBottom:8,textTransform:"uppercase",letterSpacing:.4,display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[i.jsxs("span",{children:["📈 Learned from real usage — last ",l," days"]}),i.jsx("span",{style:{fontWeight:400,color:"var(--text-muted)",letterSpacing:0},children:"— drag across days · click a day · play to sweep"})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8},children:[i.jsx("button",{onClick:()=>{r?a(!1):(t>=l-1&&n(0),a(!0))},disabled:l<=1,"aria-label":r?"Pause scrub":"Play scrub",style:{background:"var(--bg-hover)",border:`1px solid ${r?"var(--accent-red)":"var(--border)"}`,color:"var(--text-primary)",padding:"3px 10px",borderRadius:6,cursor:l<=1?"not-allowed":"pointer",fontSize:11,fontWeight:600,transition:"all 0.15s",whiteSpace:"nowrap",opacity:l<=1?.5:1},children:r?"⏸ Pause":"▶ Play"}),i.jsxs("span",{style:{fontSize:11,color:"var(--text-secondary)",whiteSpace:"nowrap"},children:[h(p.day)," · ✓ ",p.verified," · ✗ ",p.killed,p.transient>0?` · ~ ${p.transient}`:"",p.partial>0?` · ⏸ ${p.partial}`:""]}),i.jsx("input",{type:"range",min:0,max:Math.max(0,l-1),step:1,value:c,onChange:g=>{a(!1),n(Number(g.target.value))},"aria-label":"Scrub action timeline",style:{flex:1,accentColor:"var(--accent-blue)",cursor:"pointer",minWidth:80}})]}),i.jsx("div",{ref:s,onPointerDown:d,style:{position:"relative",display:"flex",alignItems:"flex-end",gap:3,height:64,padding:"0 2px",cursor:"grab",userSelect:"none",touchAction:"none"},children:e.map((g,y)=>{const v=g.verified+g.killed+g.transient+(g.partial||0),k=g.verified/f*56,w=g.killed/f*56,j=g.transient/f*56,S=(g.partial||0)/f*56,x=y===c;return i.jsxs("div",{onClick:()=>{a(!1),n(y)},title:`${h(g.day)} — ✓ ${g.verified} verified · ✗ ${g.killed} killed · ~ ${g.transient} transient${(g.partial||0)>0?` · ⏸ ${g.partial} partial`:""}`,style:{flex:1,display:"flex",flexDirection:"column-reverse",alignItems:"center",gap:0,cursor:"pointer"},children:[i.jsxs("div",{style:{position:"relative",width:"100%",borderRadius:3,overflow:x?"visible":"hidden",background:v===0?"var(--bg-hover)":"transparent",height:v===0?4:56,display:"flex",flexDirection:"column-reverse",boxShadow:x?"0 0 0 1.5px var(--accent-blue)":void 0,opacity:v===0?.5:1,transition:"box-shadow 0.15s"},children:[x&&i.jsx("div",{style:{position:"absolute",top:-3,bottom:-3,width:2,left:"50%",transform:"translateX(-50%)",background:"var(--accent-blue)",borderRadius:2,pointerEvents:"none",boxShadow:"0 0 8px color-mix(in srgb, var(--accent-blue) 53%, transparent)",zIndex:1}}),g.verified>0&&i.jsx("div",{style:{height:k,background:"var(--accent-green)",minHeight:3}}),g.killed>0&&i.jsx("div",{style:{height:w,background:"var(--accent-red)",minHeight:3}}),g.transient>0&&i.jsx("div",{style:{height:j,background:"var(--accent-yellow)",minHeight:3}}),g.partial>0&&i.jsx("div",{style:{height:S,background:"var(--accent-purple)",minHeight:3}})]}),i.jsx("div",{style:{fontSize:9,color:x?"var(--accent-blue)":"var(--text-muted)",marginTop:4,whiteSpace:"nowrap",fontWeight:x?700:400},children:h(g.day)})]},g.day)})}),i.jsxs("div",{style:{display:"flex",gap:14,marginTop:6,fontSize:11,color:"var(--text-secondary)"},children:[i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-green)"},children:"■"})," verified"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-red)"},children:"■"})," killed"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-yellow)"},children:"■"})," transient"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-purple)"},children:"■"})," partial"]})]}),i.jsxs("div",{style:{marginTop:10,background:"var(--bg-card)",border:"1px solid var(--border-light)",borderRadius:8,padding:"10px 12px"},children:[i.jsxs("div",{style:{fontSize:12,fontWeight:600,color:"var(--text-primary)",marginBottom:6},children:[h(p.day)," ",i.jsx("span",{style:{color:"var(--text-secondary)",fontWeight:400},children:"— what this action learned that day"})]}),m.length===0?i.jsx("div",{style:{fontSize:12,color:"var(--text-muted)"},children:"No learning recorded that day — nothing verified, killed, or partial."}):i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:m.map(g=>g.outcome==="unavailable"?i.jsx(ws,{provider:g.provider,model:g.model,reason:g.errorType,killed:!0},`${g.provider}|${g.model}|${g.outcome}`):g.outcome==="verified"?i.jsx(ws,{provider:g.provider,model:g.model},`${g.provider}|${g.model}|${g.outcome}`):g.outcome==="partial"?i.jsx(ws,{provider:g.provider,model:g.model,reason:g.errorType,partial:!0,streamedChunks:g.streamedChunks},`${g.provider}|${g.model}|${g.outcome}`):i.jsx(ws,{provider:g.provider,model:g.model,reason:g.errorType,transient:!0},`${g.provider}|${g.model}|${g.outcome}`))})]})]})}function ioe({entry:e}){var a,s;const[t,n]=b.useState(!0),r=(e.partial||0)>0?"var(--accent-purple)":e.killed>0?"var(--accent-red)":e.verified>0?"var(--accent-green)":"var(--accent-yellow)";return i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:`1px solid ${r}33`,borderLeft:`4px solid ${r}`,marginBottom:12,overflow:"hidden"},children:[i.jsxs("div",{onClick:()=>n(!t),style:{padding:"12px 16px",cursor:"pointer",display:"flex",alignItems:"center",gap:12,userSelect:"none"},children:[i.jsx("span",{style:{fontSize:20},children:eoe(e.action)}),i.jsxs("div",{style:{flex:1},children:[i.jsx("div",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)",marginBottom:2},children:Jse(e.action)}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",display:"flex",gap:14,flexWrap:"wrap"},children:[i.jsxs("span",{children:[i.jsxs("span",{style:{color:"var(--accent-green)"},children:["✓ ",e.verified]})," verified"]}),i.jsxs("span",{children:[i.jsxs("span",{style:{color:"var(--accent-red)"},children:["✗ ",e.killed]})," killed"]}),e.transient>0&&i.jsxs("span",{children:[i.jsxs("span",{style:{color:"var(--accent-yellow)"},children:["~ ",e.transient]})," transient"]}),(e.partial||0)>0&&i.jsxs("span",{children:[i.jsxs("span",{style:{color:"var(--accent-purple)"},children:["⏸ ",e.partial]})," partial"]})]})]}),i.jsx("span",{style:{color:"var(--text-secondary)",fontSize:16,transition:"transform 0.2s",transform:t?"rotate(90deg)":"rotate(0deg)"},children:"▶"})]}),t&&i.jsxs("div",{style:{padding:"12px 16px",borderTop:"1px solid var(--border-light)",background:"var(--bg-primary)"},children:[e.killedModels.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--accent-red)",marginBottom:6,textTransform:"uppercase",letterSpacing:.4},children:"⛔ Killed — skipped predictively by routing"}),i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:14},children:e.killedModels.map(o=>i.jsx(ws,{provider:o.provider,model:o.model,reason:o.reason,killed:!0},`${o.provider}|${o.model}`))})]}),e.verifiedModels.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--accent-green)",marginBottom:6,textTransform:"uppercase",letterSpacing:.4},children:"✅ Verified — trusted by routing"}),i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:e.verifiedModels.map(o=>i.jsx(ws,{provider:o.provider,model:o.model},`${o.provider}|${o.model}`))})]}),(((a=e.partialModels)==null?void 0:a.length)||0)>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--accent-purple)",marginBottom:6,textTransform:"uppercase",letterSpacing:.4},children:"⏸ Partial — mid-stream interruption (flaky provider, deprioritized)"}),i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:14},children:e.partialModels.map(o=>i.jsx(ws,{provider:o.provider,model:o.model,reason:o.reason,partial:!0,streamedChunks:o.streamedChunks},`${o.provider}|${o.model}`))})]}),e.killedModels.length===0&&e.verifiedModels.length===0&&(((s=e.partialModels)==null?void 0:s.length)||0)===0&&i.jsx("div",{style:{fontSize:12,color:"var(--text-muted)"},children:"Only transient failures — health decayed, no model flipped."}),i.jsx(aoe,{timeline:e.timeline})]})]})}function soe({registry:e}){const t=e.actionTelemetry;if(!t)return null;if(!t.enabled)return i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:"1px dashed var(--border)",padding:"18px 24px",marginTop:24,textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,marginBottom:6},children:"🎓"}),i.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"Learned from real usage — per action"}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-muted)",lineHeight:1.5},children:["No per-action telemetry yet. As you use ",i.jsx("strong",{style:{color:"var(--text-secondary)"},children:"chat"}),","," ",i.jsx("strong",{style:{color:"var(--text-secondary)"},children:"execute"}),", ",i.jsx("strong",{style:{color:"var(--text-secondary)"},children:"plan"}),", and ",i.jsx("strong",{style:{color:"var(--text-secondary)"},children:"edit"}),", each action's verified / killed provider × model combos appear here — showing exactly what routing learned from real usage."]})]});const n=[{key:"telemetry-events",icon:"📊",value:String(t.total),label:"Telemetry events",tone:"accent"},{key:"actions-learning",icon:"🎯",value:String(t.actions.length),label:"Actions learning",tone:"accent"},{key:"last-update",icon:"⏱️",value:toe(t.updatedAt),label:"Last update",tone:"accent"}];return t.synthetic>0&&n.push({key:"synthetic",icon:"🧪",value:String(t.synthetic),label:"Test-origin, excluded",tone:"warn"}),i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"🎓 Learned from real usage — per action"}),i.jsxs("p",{className:"section-description",children:["Every LLM call writes through to the health store with its action tag. This panel shows which provider × model each action ",i.jsx("span",{style:{color:"var(--accent-green)"},children:"verified"})," (routable) or"," ",i.jsx("span",{style:{color:"var(--accent-red)"},children:"killed"})," (predictively skipped) — the exact feed that turns “fail gemini → fail nim → local” into “straight to local”."]}),i.jsx(Wi,{tiles:n}),t.actions.map(r=>i.jsx(ioe,{entry:r},r.action)),i.jsx("div",{style:{textAlign:"center",fontSize:12,color:"var(--text-muted)",marginTop:12},children:"All actions share one health store — a provider killed by any action is skipped by all others"})]})}function lf({icon:e,title:t,count:n}){return n===0?null:i.jsxs("h3",{style:{fontSize:15,fontWeight:600,color:"var(--text-primary)",margin:"24px 0 12px 0",display:"flex",alignItems:"center",gap:8},children:[i.jsx("span",{children:e})," ",t,i.jsx("span",{style:{fontSize:12,color:"var(--text-secondary)",fontWeight:400,background:"var(--bg-card)",padding:"1px 8px",borderRadius:8},children:n})]})}function ooe({value:e,onChange:t,totalCount:n}){return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:14},children:[i.jsxs("div",{style:{flex:1,position:"relative",display:"flex",alignItems:"center",background:"var(--bg-card)",borderRadius:8,border:"1px solid var(--border)",transition:"border-color 0.2s"},children:[i.jsx("span",{style:{position:"absolute",left:12,fontSize:14,color:"var(--text-muted)",pointerEvents:"none"},children:"🔍"}),i.jsx("input",{type:"text",value:e,onChange:r=>t(r.target.value),placeholder:"Search models by name or provider...",style:{width:"100%",padding:"10px 12px 10px 36px",background:"transparent",border:"none",color:"var(--text-primary)",fontSize:13,outline:"none",fontFamily:"inherit"},onFocus:r=>{r.currentTarget.parentElement.style.borderColor="var(--accent-blue)"},onBlur:r=>{r.currentTarget.parentElement.style.borderColor="var(--border)"}}),e&&i.jsx("button",{onClick:()=>t(""),style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",padding:"8px 12px",fontSize:14,lineHeight:1},children:"✕"})]}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",whiteSpace:"nowrap"},children:[n," model",n!==1?"s":""]})]})}function loe({value:e,onChange:t}){return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:12,color:"var(--text-secondary)",marginBottom:14},children:[i.jsx("span",{children:"Columns:"}),Mse.map(n=>i.jsx("button",{onClick:()=>t(n),style:{padding:"4px 12px",borderRadius:6,background:e===n?"var(--accent-blue)":"var(--bg-hover)",color:e===n?"var(--text-on-accent)":"var(--text-secondary)",border:`1px solid ${e===n?"var(--accent-blue)":"var(--border)"}`,cursor:"pointer",fontSize:12,fontWeight:e===n?600:400,transition:"all 0.15s"},children:n},n))]})}function coe({model:e,provider:t}){const n=cp[e.status];return i.jsx("td",{style:{padding:10,verticalAlign:"top"},children:i.jsxs("div",{style:{background:n.cardBg,border:`1px solid ${n.cardBorder}44`,borderRadius:10,padding:14,display:"flex",flexDirection:"column",gap:8,height:"100%",transition:"all 0.2s ease",position:"relative",overflow:"hidden",cursor:"default"},onMouseEnter:r=>{r.currentTarget.style.borderColor=n.cardBorder,r.currentTarget.style.boxShadow=`0 2px 10px ${n.cardBorder}22`},onMouseLeave:r=>{r.currentTarget.style.borderColor=`${n.cardBorder}44`,r.currentTarget.style.boxShadow="none"},children:[i.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:3,background:n.cardBorder,opacity:.6}}),i.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",paddingTop:2},children:e.name.length>28?e.name.slice(0,25)+"…":e.name}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)"},children:[vM(t)," ",p0(t)]}),i.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:5,background:n.bg,color:n.text,padding:"3px 8px",borderRadius:6,fontSize:11,fontWeight:600,alignSelf:"flex-start"},children:[i.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:n.dot}}),e.status==="available"?"Available":e.status==="limited"?"Limited":"Unavailable"]}),e.routable===!1&&i.jsx("div",{style:{fontSize:10,color:"var(--accent-yellow)",lineHeight:1.3,marginTop:2},children:e.registryStatus==="unavailable"?e.registryDead?"✗ Not served here — this id does not exist on the endpoint":"✗ Your key cannot use this model (auth / entitlement / access)":e.registryStatus==="verified"?"◌ Parked or gone stale — not routable now":e.registryStatus==="unverified"?"◌ Listed but never verified — the router cannot pick it":"◌ Not in the registry — never probed"}),e.routable===!1&&e.registryError&&i.jsx("div",{style:{fontSize:10,color:"var(--text-muted)",lineHeight:1.3,marginTop:1},children:e.registryError.length>60?e.registryError.slice(0,57)+"…":e.registryError}),e.entitlement&&e.entitlement.tier!=="unknown"&&i.jsx("div",{title:e.entitlement.basis,style:{fontSize:10,lineHeight:1.3,marginTop:2,color:e.entitlement.tier==="free"?"var(--accent-green)":"var(--text-secondary)"},children:e.entitlement.tier==="free"?"🎁 free":"💸 metered"}),e.status!=="available"&&e.statusReason&&i.jsx("div",{style:{fontSize:10,color:"var(--text-muted)",lineHeight:1.3,marginTop:2},children:e.statusReason.length>45?e.statusReason.slice(0,42)+"…":e.statusReason}),e.parked&&e.resetsInMs!==void 0&&e.resetsInMs>0&&i.jsxs("div",{style:{fontSize:10,color:"var(--accent-yellow)",lineHeight:1.3,marginTop:4,padding:"3px 6px",borderRadius:4,background:"var(--warn-soft)",border:"1px solid color-mix(in srgb, var(--accent-yellow) 27%, transparent)"},children:["⏳ Resets in ",yM(e.resetsInMs)]})]})})}function uoe({providers:e,colsPerRow:t,searchQuery:n}){const r=[];for(const l of e)for(const c of l.models)r.push({model:c,provider:l.provider});if(r.length===0)return null;let a=r;if(n.trim()){const l=n.toLowerCase().trim();a=r.filter(({model:c,provider:u})=>c.name.toLowerCase().includes(l)||p0(u).toLowerCase().includes(l)||u.toLowerCase().includes(l))}const s={available:0,limited:1,unavailable:2};a.sort((l,c)=>s[l.model.status]-s[c.model.status]);const o=[];for(let l=0;l<a.length;l+=t)o.push(a.slice(l,l+t));return i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"📋 Model Health Overview"}),i.jsx("p",{className:"section-description",children:"All models across all providers, color-coded by health status. Each cell shows: Model · Provider · Health."}),i.jsx("div",{style:{overflowX:"auto"},children:i.jsx("table",{style:{width:"100%",borderCollapse:"separate",borderSpacing:10,tableLayout:"fixed"},children:i.jsx("tbody",{children:o.length>0?o.map((l,c)=>i.jsxs("tr",{children:[l.map(({model:u,provider:d})=>i.jsx(coe,{model:u,provider:d},`${d}-${u.id}`)),l.length<t&&Array.from({length:t-l.length}).map((u,d)=>i.jsx("td",{style:{padding:10}},`empty-${d}`))]},c)):i.jsx("tr",{children:i.jsxs("td",{colSpan:t,style:{textAlign:"center",padding:40,color:"var(--text-muted)",fontSize:13},children:['No models match your search "',n,'"']})})})})}),n.trim()&&a.length>0&&i.jsxs("div",{style:{textAlign:"right",fontSize:11,color:"var(--text-muted)",marginTop:4},children:["Showing ",a.length," of ",r.length," models"]})]})}function doe(){return i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:"1px dashed var(--border)",padding:"20px 24px",marginTop:24,textAlign:"center"},children:[i.jsx("div",{style:{fontSize:24,marginBottom:8},children:"🎙️"}),i.jsx("div",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"Speech / TTS Provider"}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-muted)"},children:["Speech/TTS provider support coming soon."," ",i.jsx("a",{href:"https://github.com/imdheerajKube/agent-nuvira-documentation/issues/new",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-blue)",textDecoration:"none",cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.textDecoration="underline"},onMouseLeave:e=>{e.currentTarget.style.textDecoration="none"},children:"Request a provider"})]})]})}function foe(){return i.jsxs("div",{style:{background:"var(--bg-primary)",borderRadius:10,padding:14,marginBottom:20,border:"1px solid var(--border-light)",fontSize:13,color:"var(--text-secondary)",display:"flex",flexWrap:"wrap",gap:20},children:[i.jsxs("div",{children:[i.jsx("div",{style:{fontWeight:600,color:"var(--text-primary)",marginBottom:6},children:"Color Coding"}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-green)"},children:"●"})," ",i.jsx("strong",{style:{color:"var(--text-primary)"},children:"Green"})," — Working with rate limit available"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-yellow)"},children:"●"})," ",i.jsx("strong",{style:{color:"var(--text-primary)"},children:"Amber"})," — Slow / low rate limit / needs action"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-red)"},children:"●"})," ",i.jsx("strong",{style:{color:"var(--text-primary)"},children:"Red"})," — API key missing / payment needed / unreachable"]})]})]}),i.jsxs("div",{children:[i.jsx("div",{style:{fontWeight:600,color:"var(--text-primary)",marginBottom:6},children:"Provider Sections"}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:3,fontSize:12},children:[i.jsxs("span",{children:["✅ ",i.jsx("strong",{children:"Cloud"})," — Online providers with active API keys"]}),i.jsxs("span",{children:["🏠 ",i.jsx("strong",{children:"Local"})," — Locally running inference servers"]}),i.jsxs("span",{children:["⛔ ",i.jsx("strong",{children:"Unavailable"})," — Missing keys or unreachable endpoints"]}),i.jsxs("span",{children:["🎙️ ",i.jsx("strong",{children:"Speech"})," — Text-to-speech / speech-to-text providers (coming)"]})]})]})]})}function hoe(){const[e,t]=b.useState(null);if(b.useEffect(()=>{let r=!0;return K.fetchAcceptance().then(a=>{r&&t(a)}),()=>{r=!1}},[]),!e)return null;const n=Object.entries(e.byPair);return i.jsxs("div",{style:{background:"var(--bg-card)",border:"1px solid var(--border-light)",borderRadius:12,padding:"14px 18px",marginBottom:16},children:[i.jsx("h2",{style:{fontSize:15,fontWeight:600,color:"var(--text-primary)",margin:"0 0 6px 0"},children:"⭐ Acceptance (read-only)"}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:6},children:[e.labelled," labelled turn",e.labelled===1?"":"s"," — 👍 ",e.accepted," / 👎 ",e.rejected,Object.keys(e.bySource).length>0?` · by source: ${Object.entries(e.bySource).map(([r,a])=>`${r} ${a}`).join(", ")}`:""]}),n.length>0&&i.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:6},children:n.map(([r,a])=>{const s=a.accepted+a.rejected;return i.jsxs("div",{children:[r,": 👍 ",a.accepted," / 👎 ",a.rejected," (",Math.round(100*a.accepted/s),"%, n=",s,")"]},r)})}),i.jsx("div",{style:{fontSize:12,color:e.fit.ok?"var(--accent-green)":"var(--text-secondary)"},children:e.fit.ok?`fit TRAINED — P(accepted | features) n=${e.fit.n} (${e.fit.positives}👍/${e.fit.negatives}👎)`:`fit NOT trained — ${e.fit.reason??"insufficient labels"} · rate a turn with \`nuvira rate good|bad\``})]})}function poe(){const[e,t]=b.useState(null),[n,r]=b.useState(null),[a,s]=b.useState(null);b.useEffect(()=>{let u=!0;return Promise.all([K.fetchGates(),K.fetchConsent(),K.fetchSessionGrants()]).then(([d,f,h])=>{u&&(t(d),r(f),s(h))}),()=>{u=!1}},[]);async function o(u){await K.revokeSessionGrant(u)&&s(f=>(f??[]).filter(h=>h.sessionId!==u))}if(!e&&!n&&!a)return null;const l={fontSize:15,fontWeight:600,color:"var(--text-primary)",margin:"0 0 6px 0"},c={fontSize:12,color:"var(--text-secondary)"};return i.jsxs("div",{style:{background:"var(--bg-card)",border:"1px solid var(--border-light)",borderRadius:12,padding:"14px 18px",marginBottom:16},children:[i.jsx("h2",{style:l,children:"🛡️ Gates & Consent"}),e&&i.jsxs("div",{style:{...c,marginBottom:8},children:["harness friction — ",e.traces," trace",e.traces===1?"":"s"," · ",e.events," gate/refusal events · per turn mean ",e.perTurn.mean," (median ",e.perTurn.median,", p90 ",e.perTurn.p90,", max ",e.perTurn.max,") · narration ",e.narration.turns,e.byGate.length>0?i.jsxs("div",{style:{marginTop:4},children:["top gates: ",e.byGate.slice(0,5).map(u=>`${u.key} ${u.count}`).join(" · ")]}):null]}),a&&i.jsx("div",{style:{...c,marginBottom:8},children:a.length===0?i.jsx("span",{children:"No session grants are live — every state change still asks."}):a.map(u=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:2},children:[i.jsxs("span",{children:[i.jsx("strong",{children:u.sessionId})," — allowed ",u.categories.join(", ")]}),i.jsx("button",{type:"button",onClick:()=>o(u.sessionId),style:{fontSize:11,padding:"1px 8px",borderRadius:6,border:"1px solid var(--border-light)",background:"transparent",color:"var(--text-secondary)",cursor:"pointer"},children:"End"})]},u.sessionId))}),n&&i.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(240px, 1fr))",gap:12},children:[n.denied,n.grantable,n.decided].map(u=>i.jsxs("div",{children:[i.jsx("div",{style:{fontSize:12,fontWeight:600,color:"var(--text-primary)"},children:u.title}),i.jsx("div",{style:{...c,marginBottom:4},children:u.note}),u.examples.map(d=>i.jsxs("div",{style:c,children:["• ",d.action," ",i.jsxs("span",{style:{opacity:.7},children:["(",d.evidence,")"]})]},d.action))]},u.title))})]})}function moe(){var w;const[e,t]=b.useState(null),[n,r]=b.useState(null),[a,s]=b.useState(!0),[o,l]=b.useState(null),[c,u]=b.useState(4),[d,f]=b.useState(""),h=h0(),p=b.useRef(!0),m=b.useRef(null),g=b.useRef(!1);function y(){m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{p.current&&v()},$se)}async function v(){s(!0),l(null),g.current=!1;try{const[j,S]=await Promise.all([Dse(()=>{g.current=!0}),Bse(()=>{g.current=!0})]);if(!p.current)return;t(j),r(S),g.current&&y()}catch(j){if(!p.current)return;l(j instanceof Error&&j.message?j.message:"Failed to fetch model status"),g.current&&y()}finally{p.current&&s(!1)}}b.useEffect(()=>{p.current=!0,v();const j=setInterval(v,Ise);return()=>{p.current=!1,clearInterval(j),m.current&&clearTimeout(m.current)}},[]);function k(j){const S=[],x=[],N=[],E=[],P={available:0,limited:1,unavailable:2};for(const _ of j.providers)Rse.has(_.provider)?N.push(_):Pse.has(_.provider)?x.push(_):_.overallStatus==="available"?S.push(_):E.push(_);return S.sort((_,R)=>P[_.overallStatus]-P[R.overallStatus]),x.sort((_,R)=>P[_.overallStatus]-P[R.overallStatus]),N.sort((_,R)=>P[_.overallStatus]-P[R.overallStatus]),E.sort((_,R)=>P[_.overallStatus]-P[R.overallStatus]),{available:S,local:x,speech:N,unavailable:E}}return i.jsxs(i.Fragment,{children:[i.jsx(Oe,{icon:"🧠",title:"Model Provider Status",description:"Real-time health check of all AI providers and their available models. Providers are grouped into sections: Available cloud → Local → Unavailable."}),i.jsx(Use,{onRefresh:v,loading:a}),i.jsx(foe,{}),i.jsx(hoe,{}),i.jsx(poe,{}),a&&!e&&i.jsxs("div",{className:"loading-state",children:[i.jsx("div",{className:"loading-spinner"}),i.jsx("p",{children:"Testing provider connections…"})]}),o&&i.jsxs("div",{className:"empty-state",style:{color:"var(--accent-red)",border:"1px solid color-mix(in srgb, var(--accent-red) 27%, transparent)",borderRadius:10,padding:16,marginBottom:16},children:["⚠️ ",o]}),e&&i.jsxs(i.Fragment,{children:[i.jsx(Wi,{tiles:[{key:"listed-models",icon:"🧠",value:String(e.totalModels),label:"Listed models (live probe)",tone:"accent"},{key:"tracked-models",icon:"📦",value:String((h==null?void 0:h.trackedModels)??(n==null?void 0:n.total)??0),label:"Tracked models (registry)",tone:"accent"},{key:"available",icon:"✅",value:String(e.available),label:"Available",tone:"ok"},{key:"limited",icon:"🟡",value:String(e.limited),label:"Limited",tone:"warn"},{key:"unavailable",icon:"🔴",value:String(e.unavailable),label:"Unavailable",tone:"danger"},{key:"listed-providers",icon:"🔌",value:String(e.providers.length),label:"Listed providers (live probe)",tone:"accent"},{key:"tracked-providers",icon:"🗂️",value:String((h==null?void 0:h.trackedProviders)??((w=n==null?void 0:n.providers)==null?void 0:w.length)??0),label:"Tracked providers (registry)",tone:"accent"}]}),i.jsx(Wse,{data:e}),(()=>{const{available:j,local:S,speech:x,unavailable:N}=k(e);return i.jsxs(i.Fragment,{children:[i.jsx(lf,{icon:"✅",title:"Available Cloud Providers",count:j.length}),j.map(E=>i.jsx(of,{provider:E},E.provider)),i.jsx(lf,{icon:"🏠",title:"Local Providers",count:S.length}),S.map(E=>i.jsx(of,{provider:E},E.provider)),i.jsx(lf,{icon:"⛔",title:"Unavailable Providers",count:N.length}),N.map(E=>i.jsx(of,{provider:E},E.provider)),i.jsx(lf,{icon:"🎙️",title:"Speech / TTS Providers",count:x.length}),x.map(E=>i.jsx(of,{provider:E},E.provider))]})})(),i.jsx(ooe,{value:d,onChange:f,totalCount:e.providers.reduce((j,S)=>j+S.models.length,0)}),i.jsx(loe,{value:c,onChange:u}),i.jsx(uoe,{providers:e.providers,colsPerRow:c,searchQuery:d}),n&&i.jsx(Qse,{data:n}),n&&i.jsx(soe,{registry:n}),e&&!n&&i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:"1px dashed var(--border)",padding:"14px 20px",marginTop:24,fontSize:12,color:"var(--text-secondary)",lineHeight:1.6},children:["📦 Registry & telemetry sections are hidden — this dashboard server did not return model-registry data (it may be an"," ",i.jsx("strong",{style:{color:"var(--text-primary)"},children:"older version"}),"). Restart the dashboard from the latest install to see them."]}),i.jsx(doe,{}),i.jsxs("div",{style:{textAlign:"center",fontSize:12,color:"var(--text-muted)",marginTop:16},children:["Last checked: ",new Date(e.lastChecked).toLocaleTimeString()," · ","Auto-refreshes every 60s"]})]})]})}const goe={local:"💻",groq:"🟢",nim:"🔶",gemini:"🔷",openrouter:"🟣"},voe={local:"Ollama (Local)",groq:"Groq",nim:"NVIDIA NIM",gemini:"Gemini",openrouter:"OpenRouter"},yoe={trivial:"🟢",simple:"🔵",moderate:"🟡",complex:"🟠",critical:"🔴"},bM={trivial:"🟢 trivial",simple:"🔵 simple",moderate:"🟡 moderate",complex:"🟠 complex",critical:"🔴 critical"},boe={chat:"💬 chat",orchestrator:"🔀 orchestrator",explain:"🔍 explain",benchmark:"📈 benchmark",eval:"🎯 eval"},ns=[{key:"request",icon:"🎯",title:"Request"},{key:"candidates",icon:"⚖️",title:"Candidates"},{key:"exclusions",icon:"🚫",title:"Exclusions"},{key:"pick",icon:"✅",title:"Pick"}],xoe=2400;function Vg(e){return goe[e]||"🔌"}function fE(e){return voe[e]||e}function m0(e){return e&&boe[e]||e||"unknown"}function woe(e){const t=Date.now()-e;return t<6e4?"just now":t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`}function hE(e){const t=Math.ceil(e/6e4);return t>=60?`${Math.floor(t/60)}h ${t%60}m`:`${t}m`}const koe=8;function pE(e,t){const n=t.quota,r=n==null?void 0:n.entries.find(s=>s.provider===e);return r!=null&&r.parked?r.resetsInMs>0?`quota exhausted — auto re-enables in ${hE(r.resetsInMs)}`:"quota exhausted — parked":r&&r.cooldownRemaining>0?`circuit-breaker cooldown — ${hE(r.cooldownRemaining)} remaining`:t.providers.some(s=>s.provider===e)?"ranked below the candidate cutoff for this complexity":"not scored for this complexity (no benchmark quality data)"}function Soe(e){var s,o,l;const t=new Set;for(const c of e.providers)t.add(c.provider);if(e.usage)for(const c of Object.keys(e.usage.byProvider))t.add(c);if(e.bestModels)for(const c of e.bestModels)t.add(c.model.split("/")[0]);if(e.quota)for(const c of e.quota.entries)t.add(c.provider);const n=new Map(e.preference.map(c=>[c.complexity,c])),r=[],a=[...e.history??[]].sort((c,u)=>(u.timestamp??0)-(c.timestamp??0));for(const c of a.slice(0,koe)){const u=n.get(c.complexity),d=(s=u==null?void 0:u.providers)!=null&&s.length?u.providers.map(m=>({provider:m.provider,score:m.score,reason:m.reason})):[{provider:c.provider,score:c.score,reason:"actual pick recorded"}];d.some(m=>m.provider===c.provider)||d.push({provider:c.provider,score:c.score,reason:"actual pick recorded"});const f=new Set(d.map(m=>m.provider)),h=[...t].filter(m=>!f.has(m)).map(m=>({provider:m,reason:pE(m,e)})),p=(o=d.find(m=>m.provider===c.provider))==null?void 0:o.reason;r.push({id:c.id,label:`${m0(c.source)} · ${c.complexity} · ${(c.task||c.agentType).slice(0,26)}`,real:!0,complexity:c.complexity,task:c.task||c.agentType,agentType:c.agentType,source:c.source,timestamp:c.timestamp,winner:`${c.provider}/${c.model}`,winnerScore:c.score,winnerReason:p,candidates:d,exclusions:h})}if(r.length===0)for(const c of e.preference){const u=c.winner.split("/"),d=c.providers.map(m=>({provider:m.provider,score:m.score,reason:m.reason})),f=new Set(d.map(m=>m.provider)),h=[...t].filter(m=>!f.has(m)).map(m=>({provider:m,reason:pE(m,e)})),p=u[0];r.push({id:`profile-${c.complexity}`,label:`${bM[c.complexity]||c.complexity} — what the router would pick`,real:!1,complexity:c.complexity,task:p?`A ${c.complexity} task (auto-routed)`:`A ${c.complexity} task`,agentType:"chat",winner:c.winner,winnerScore:c.score,winnerReason:(l=d.find(m=>m.provider===p))==null?void 0:l.reason,candidates:d,exclusions:h})}return r}function joe(e,t){switch(e){case"request":return`A ${t.complexity} task arrives${t.source?` from ${m0(t.source)}`:""} and must be routed.`;case"candidates":return`${t.candidates.length} provider${t.candidates.length!==1?"s":""} are scored against the ${t.complexity} weight profile.`;case"exclusions":return t.exclusions.length>0?`${t.exclusions.length} provider${t.exclusions.length!==1?"s":""} known to the system are skipped before scoring.`:"Every known provider was scored — nothing was skipped.";case"pick":return t.winnerReason?`The top score wins: ${t.winner.split("/")[0]} ranked first — ${t.winnerReason}.`:`The top score wins: ${t.winner}.`}}function Noe({value:e,color:t}){const n=Math.min(100,Math.max(0,e*100));return i.jsx("div",{style:{flex:1,background:"var(--bg-primary)",borderRadius:4,height:6,overflow:"hidden",border:"1px solid var(--border-light)"},children:i.jsx("div",{style:{width:`${n}%`,background:t,height:"100%",transition:"width 0.4s ease"}})})}function Eoe({icon:e,title:t,narration:n}){return i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:10,marginBottom:14},children:[i.jsx("span",{style:{fontSize:20,lineHeight:"24px"},children:e}),i.jsxs("div",{children:[i.jsx("div",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)"},children:t}),i.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",marginTop:2},children:n})]})]})}function _oe({routing:e}){const t=b.useMemo(()=>Soe(e),[e]),[n,r]=b.useState(""),[a,s]=b.useState(0),[o,l]=b.useState(!1);if(b.useEffect(()=>{t.length!==0&&(t.some(p=>p.id===n)||(r(t[0].id),s(0)))},[t,n]),b.useEffect(()=>{if(!o||t.length===0)return;const p=setInterval(()=>{s(m=>(m+1)%ns.length)},xoe);return()=>clearInterval(p)},[o,t.length]),t.length===0)return null;const c=t.find(p=>p.id===n)??t[0],u=ns[a],d=()=>{s(p=>(p+ns.length-1)%ns.length),l(!1)},f=()=>{s(p=>(p+1)%ns.length),l(!1)},h=()=>l(p=>!p);return i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:"1px solid var(--border-light)",padding:"18px 20px",marginBottom:16},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:4},children:[i.jsx("span",{style:{fontSize:20},children:"🎬"}),i.jsx("h3",{style:{fontSize:15,fontWeight:600,color:"var(--text-primary)",margin:0},children:"Why did the router pick this?"}),c.real&&i.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:"var(--ok-soft)",border:"1px solid var(--accent-green)",color:"var(--accent-green)"},children:"✓ real decision"})]}),i.jsx("p",{style:{fontSize:12,color:"var(--text-secondary)",margin:"2px 0 12px 0"},children:"Narrated step-by-step replay of a routing decision — request, candidates, exclusions, and the pick. Scrubbable, or hit play."}),i.jsx("select",{"aria-label":"Routing decision to replay",value:n,onChange:p=>{r(p.target.value),s(0),l(!1)},style:{width:"100%",marginBottom:16,padding:"8px 10px",background:"var(--bg-primary)",color:"var(--text-primary)",fontSize:12,border:"1px solid var(--border)",borderRadius:8,outline:"none"},children:t.map(p=>i.jsxs("option",{value:p.id,style:{background:"var(--bg-primary)",color:"var(--text-primary)"},children:[p.real?"● ":"○ ",p.label]},p.id))}),i.jsx(Eoe,{icon:u.icon,title:`${a+1}. ${u.title}${a>0?` — ${c.complexity}`:""}`,narration:joe(u.key,c)}),u.key==="request"&&i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"14px 16px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",marginBottom:8},children:[i.jsxs("span",{style:{fontSize:12,padding:"2px 10px",borderRadius:12,background:"var(--bg-card)",border:"1px solid var(--border)",color:"var(--text-primary)"},children:[yoe[c.complexity]||"•"," ",bM[c.complexity]||c.complexity]}),i.jsxs("span",{style:{fontSize:12,padding:"2px 10px",borderRadius:12,background:"var(--bg-card)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:["🤖 ",c.agentType]}),c.source&&i.jsx("span",{style:{fontSize:12,padding:"2px 10px",borderRadius:12,background:"var(--bg-card)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:m0(c.source)}),c.timestamp&&i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)",marginLeft:"auto"},children:woe(c.timestamp)})]}),i.jsx("div",{style:{fontSize:13,color:"var(--text-primary)"},children:c.task})]}),u.key==="candidates"&&i.jsxs("div",{children:[c.candidates.map((p,m)=>{const g=p.provider===c.winner.split("/")[0];return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",background:g?"var(--ok-soft)":"var(--bg-primary)",border:`1px solid ${g?"var(--accent-green)":"var(--border-light)"}`,borderRadius:8,marginBottom:6},children:[i.jsxs("span",{style:{width:18,fontSize:11,color:"var(--text-muted)",textAlign:"right"},children:[m+1,"."]}),i.jsxs("span",{style:{width:104,color:g?"var(--accent-green)":"var(--text-primary)",fontWeight:g?600:400,whiteSpace:"nowrap",fontSize:12},children:[Vg(p.provider)," ",fE(p.provider).split(" ")[0],g&&" 👑"]}),i.jsx(Noe,{value:p.score,color:g?"var(--accent-green)":"var(--accent-blue)"}),i.jsx("span",{style:{width:44,textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11,color:"var(--text-secondary)"},children:p.score.toFixed(3)})]},p.provider)}),c.candidates.length>0&&i.jsxs("div",{style:{marginTop:10},children:[i.jsx("div",{style:{fontSize:11,color:"var(--text-muted)",marginBottom:4},children:"Why each ranked where it did"}),c.candidates.map(p=>i.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:3},children:[i.jsx("span",{style:{color:"var(--text-primary)"},children:p.provider}),": ",p.reason||"scored"]},p.provider))]})]}),u.key==="exclusions"&&(c.exclusions.length>0?i.jsx("div",{children:c.exclusions.map(p=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:8,marginBottom:6},children:[i.jsx("span",{style:{fontSize:13},children:"🚫"}),i.jsxs("span",{style:{width:110,color:"var(--text-primary)",whiteSpace:"nowrap",fontSize:12},children:[Vg(p.provider)," ",fE(p.provider).split(" ")[0]]}),i.jsx("span",{style:{flex:1,fontSize:12,color:"var(--text-secondary)"},children:p.reason})]},p.provider))}):i.jsx("div",{style:{background:"var(--bg-primary)",border:"1px dashed var(--border)",borderRadius:10,padding:"14px 16px",color:"var(--text-secondary)",fontSize:13},children:"✅ No exclusions — every provider known to the system was scored for this decision."})),u.key==="pick"&&i.jsxs("div",{style:{background:"var(--ok-soft)",border:"1px solid var(--accent-green)",borderRadius:10,padding:"16px 18px"},children:[i.jsx("div",{style:{fontSize:12,color:"var(--accent-green)",fontWeight:600,marginBottom:6},children:"🏆 ROUTER PICK"}),i.jsxs("div",{style:{fontSize:16,fontWeight:700,color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace",marginBottom:4},children:[Vg(c.winner.split("/")[0])," ",c.winner]}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:10},children:["composite score ",i.jsx("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace",color:"var(--accent-green)"},children:c.winnerScore.toFixed(3)}),!c.real&&" · profile preview"]}),c.winnerReason&&i.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",borderTop:"1px solid color-mix(in srgb, var(--accent-green) 33%, transparent)",paddingTop:8},children:[i.jsx("span",{style:{color:"var(--text-primary)"},children:"Why:"})," ",c.winnerReason]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginTop:16},children:[i.jsx("button",{onClick:d,"aria-label":"Previous step",style:Yg,children:"◀"}),i.jsx("button",{onClick:h,"aria-label":o?"Pause playback":"Play playback",style:{...Yg,minWidth:84,color:o?"var(--accent-yellow)":"var(--accent-green)"},children:o?"⏸ Pause":"▶ Play"}),i.jsx("button",{onClick:f,"aria-label":"Next step",style:Yg,children:"▶"}),i.jsx("div",{style:{display:"flex",gap:6,marginLeft:8},children:ns.map((p,m)=>i.jsx("button",{"aria-label":`Go to step ${m+1}: ${p.title}`,onClick:()=>{s(m),l(!1)},style:{width:22,height:22,borderRadius:11,border:"none",cursor:"pointer",fontSize:10,lineHeight:"22px",padding:0,background:m===a?"var(--accent-blue)":"var(--bg-hover)",color:m===a?"var(--bg-primary)":"var(--text-secondary)"},title:p.title,children:p.icon},p.key))}),i.jsxs("span",{style:{marginLeft:"auto",fontSize:11,color:"var(--text-muted)"},children:["step ",a+1,"/",ns.length]})]})]})}const Yg={background:"var(--bg-hover)",color:"var(--text-primary)",border:"1px solid var(--border)",borderRadius:8,padding:"6px 12px",fontSize:13,cursor:"pointer",transition:"background 0.15s"},Coe={local:"💻",groq:"🟢",nim:"🔶",gemini:"🔷",openrouter:"🟣"},Aoe={local:"Ollama (Local)",groq:"Groq",nim:"NVIDIA NIM",gemini:"Gemini",openrouter:"OpenRouter"},xM={trivial:"🟢",simple:"🔵",moderate:"🟡",complex:"🟠",critical:"🔴"};function Ur(e){return Coe[e]||"🔌"}function Ai(e){return Aoe[e]||e}function up(e,t=1){return`${(e*100).toFixed(t)}%`}function Toe(e){return`$${e.toFixed(6)}`}function ar({icon:e,title:t,subtitle:n,children:r}){return i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:"1px solid var(--border-light)",padding:"18px 20px",marginBottom:16},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:4},children:[i.jsx("span",{style:{fontSize:20},children:e}),i.jsx("h3",{style:{fontSize:15,fontWeight:600,color:"var(--text-primary)",margin:0},children:t})]}),n&&i.jsx("p",{style:{fontSize:12,color:"var(--text-secondary)",margin:"2px 0 12px 0"},children:n}),!n&&i.jsx("div",{style:{height:6}}),r]})}function g0({value:e,color:t}){const n=Math.min(100,Math.max(0,e*100));return i.jsx("div",{style:{flex:1,background:"var(--bg-primary)",borderRadius:4,height:6,overflow:"hidden",border:"1px solid var(--border-light)"},children:i.jsx("div",{style:{width:`${n}%`,background:t,height:"100%",transition:"width 0.4s ease"}})})}function vi(e,t,n="var(--text-secondary)"){return{fontSize:10,padding:"1px 7px",borderRadius:9,background:e,border:`1px solid ${t}`,color:n,fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap"}}function Ooe(){return i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px dashed var(--border)",borderRadius:10,padding:"18px 20px",color:"var(--text-secondary)",fontSize:13,textAlign:"center"},children:["📊 No routing data yet — run ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"nuvira benchmark"})," to populate provider quality scores, or use Auto routing (",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"nuvira model switch auto"}),") to build per-agent best-model stats over time."]})}const Poe={chat:"💬 chat",orchestrator:"🔀 orchestrator",explain:"🔍 explain",benchmark:"📈 benchmark",eval:"🎯 eval"},Roe={trivial:"🟢 trivial",simple:"🔵 simple",moderate:"🟡 moderate",complex:"🟠 complex",critical:"🔴 critical"};function wM(e){return Poe[e]||e}function kM(e){const t=Date.now()-e;return t<6e4?"just now":t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`}function mE(e){if(e<=0)return"now";const t=Math.floor(e/36e5),n=Math.floor(e%36e5/6e4);return t>0?`${t}h ${n}m`:n>0?`${n}m`:`${Math.ceil(e/1e3)}s`}function Moe({label:e,value:t,total:n,color:r}){const a=n>0?t/n*100:0;return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:5},children:[i.jsx("span",{style:{width:110,color:"var(--text-primary)",whiteSpace:"nowrap",fontSize:12},children:e}),i.jsx("div",{style:{flex:1,background:"var(--bg-primary)",borderRadius:4,height:6,overflow:"hidden",border:"1px solid var(--border-light)"},children:i.jsx("div",{style:{width:`${Math.min(100,a)}%`,background:r,height:"100%",transition:"width 0.4s ease"}})}),i.jsx("span",{style:{width:34,textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11,color:"var(--text-secondary)"},children:t})]})}function Ioe({usage:e}){if(!e.total)return null;const t=e.total,n=Object.entries(e.byProvider).sort((a,s)=>s[1]-a[1]).slice(0,6),r=Object.entries(e.byModel).sort((a,s)=>s[1]-a[1]).slice(0,5);return i.jsxs(ar,{icon:"🧮",title:"Routing Usage — actual picks over time",subtitle:"Recorded from live chat, orchestrator runs, explain snapshots, benchmark --routing, and eval --routing",children:[i.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:14},children:[i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:e.total}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"total decisions"})]}),i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:e.last24h>0?"var(--accent-green)":"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:e.last24h}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"last 24h"})]})]}),i.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:6},children:"By provider"}),n.map(([a,s])=>i.jsx(Moe,{label:`${Ur(a)} ${Ai(a).split(" ")[0]}`,value:s,total:t,color:"var(--accent-blue)"},a)),Object.keys(e.bySource).length>0&&i.jsx("div",{style:{marginTop:12,display:"flex",gap:6,flexWrap:"wrap"},children:Object.entries(e.bySource).sort((a,s)=>s[1]-a[1]).map(([a,s])=>i.jsxs("span",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:20,padding:"3px 10px",fontSize:11,color:"var(--text-primary)"},children:[wM(a)," · ",s]},a))}),r.length>0&&i.jsxs("div",{style:{marginTop:14},children:[i.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:6},children:"Most-picked models"}),r.map(([a,s])=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:5},children:[i.jsx("span",{style:{flex:1,color:"var(--text-primary)",fontSize:12,fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:a,children:a.length>42?a.slice(0,39)+"…":a}),i.jsx("span",{style:{width:34,textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11,color:"var(--text-secondary)"},children:s})]},a))]})]})}function $oe({history:e}){return e.length?i.jsx(ar,{icon:"🕓",title:"Audit Trail — routing decision timeline",subtitle:"Every explain snapshot (and routing-mode pick) persisted for transparency",children:i.jsx("div",{style:{maxHeight:320,overflowY:"auto",paddingRight:4},children:e.map(t=>i.jsxs("div",{style:{display:"flex",gap:10,padding:"8px 4px",borderBottom:"1px solid var(--border-light)"},children:[i.jsx("div",{style:{width:52,flexShrink:0,fontSize:11,color:"var(--text-muted)",paddingTop:2},children:kM(t.timestamp)}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[i.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:wM(t.source)}),i.jsxs("span",{style:{fontSize:12,fontWeight:600,color:"var(--accent-green)",fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:`${t.provider}/${t.model}`,children:[Ur(t.provider)," ",t.provider,"/",t.model.length>26?t.model.slice(0,23)+"…":t.model]}),t.complexity&&i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)"},children:Roe[t.complexity]||t.complexity}),t.agenticCapable===!1&&i.jsx("span",{style:vi("var(--danger-soft)","var(--accent-red)"),title:t.overrideReason?`override: ${t.overrideReason}`:void 0,children:"⚠️ weak model"}),t.fallbackFrom&&i.jsxs("span",{style:vi("var(--bg-tertiary)","var(--border-hover)"),children:["↩ from ",t.fallbackFrom]})]}),i.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",marginTop:3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:t.task,children:t.task||t.agentType})]})]},t.id))})}):null}function Loe({routing:e}){return e.preference.length?i.jsx(ar,{icon:"🤖",title:"Auto Router — What the agent would pick",subtitle:"Complexity-weighted scoring across reasoning, speed, cost, privacy, and reliability (real provider pricing)",children:i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)",color:"var(--text-secondary)"},children:[i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Complexity"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Winner"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Score"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"All providers"})]})}),i.jsx("tbody",{children:e.preference.map(t=>i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)"},children:[i.jsxs("td",{style:{padding:"10px 12px",color:"var(--text-primary)",whiteSpace:"nowrap"},children:[xM[t.complexity]||"•"," ",t.complexity]}),i.jsx("td",{style:{padding:"10px 12px",whiteSpace:"nowrap"},children:i.jsxs("span",{style:{color:"var(--accent-green)",fontWeight:600},children:[Ur(t.winner.split("/")[0])," ",t.winner]})}),i.jsx("td",{style:{padding:"10px 12px",fontFamily:"'SFMono-Regular', Consolas, monospace",color:"var(--text-secondary)"},children:t.score.toFixed(3)}),i.jsx("td",{style:{padding:"10px 12px",minWidth:300},children:t.providers.map((n,r)=>i.jsxs("div",{style:{marginBottom:5},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[i.jsxs("span",{style:{width:16,fontSize:11,color:"var(--text-muted)",textAlign:"right"},children:[r+1,"."]}),i.jsxs("span",{style:{width:90,color:"var(--text-primary)",whiteSpace:"nowrap",fontSize:12},children:[Ur(n.provider)," ",Ai(n.provider).split(" ")[0]]}),i.jsx(g0,{value:n.score,color:r===0?"var(--accent-green)":"var(--accent-blue)"}),i.jsx("span",{style:{width:40,textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11,color:"var(--text-secondary)"},children:n.score.toFixed(2)})]}),(n.capabilityFit!==void 0||n.costSource||n.contextUtilization!==void 0)&&i.jsxs("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingLeft:16,marginTop:2},children:[n.capabilityFit!==void 0&&i.jsxs("span",{style:vi("var(--bg-tertiary)","var(--border-hover)"),children:["🎯 fit ",n.capabilityFit,"%"]}),n.costSource==="measured"&&n.costBasis?i.jsxs("span",{style:vi("var(--ok-soft)","var(--accent-green)","var(--accent-green)"),children:["📏 measured ",bt(n.costBasis.inputTokens),"→",bt(n.costBasis.outputTokens)," tok"]}):i.jsx("span",{style:vi("var(--bg-tertiary)","var(--border-hover)"),children:"📐 estimated"}),n.contextUtilization!==void 0&&n.contextWindowTokens!==void 0&&i.jsxs("span",{style:vi("var(--bg-tertiary)","var(--accent-blue)","var(--accent-blue)"),children:["⏳ ctx ",n.contextUtilization,"% (",bt(n.contextWindowTokens)," tok)"]})]})]},n.provider))})]},t.complexity))})]})})}):null}function Doe({routing:e}){return e.providers.length?i.jsx(ar,{icon:"📈",title:"Provider Benchmark Quality",subtitle:"Measured from your own `nuvira benchmark` runs — blended into Auto routing decisions",children:i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)",color:"var(--text-secondary)"},children:[i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Provider"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Runs"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Avg Quality"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Pass Rate"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Total Cost"})]})}),i.jsx("tbody",{children:e.providers.map(t=>i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)"},children:[i.jsxs("td",{style:{padding:"10px 12px",color:"var(--text-primary)",whiteSpace:"nowrap"},children:[Ur(t.provider)," ",Ai(t.provider)]}),i.jsx("td",{style:{padding:"10px 12px",color:"var(--text-secondary)"},children:t.runs}),i.jsx("td",{style:{padding:"10px 12px"},children:i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[i.jsx(g0,{value:t.avgQuality,color:"var(--accent-blue)"}),i.jsx("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:"var(--text-secondary)",width:44,textAlign:"right"},children:up(t.avgQuality)})]})}),i.jsx("td",{style:{padding:"10px 12px",color:t.passRate>=.8?"var(--accent-green)":"var(--accent-yellow)"},children:up(t.passRate)}),i.jsx("td",{style:{padding:"10px 12px",fontFamily:"'SFMono-Regular', Consolas, monospace",color:"var(--text-secondary)"},children:Toe(t.totalCostUsd)})]},t.provider))})]})})}):null}const gE=["trivial","simple","moderate","complex","critical"];function Boe(e){return e>=.7?"var(--accent-green)":e>=.45?"var(--accent-yellow)":"var(--accent-red)"}function zoe({bandit:e}){const t=Object.keys(e.priors).sort();if(!e.enabled||t.length===0)return null;const n=e.learningHistory.slice(-15).reverse();return i.jsxs(ar,{icon:"🎰",title:"Bandit Learning — Thompson-sampling priors",subtitle:"Beta(α, β) per provider × complexity bucket, learned from real task outcomes (routing.bandit = true). Higher expected win rate = more successful history.",children:[i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)",color:"var(--text-secondary)"},children:[i.jsx("th",{style:{padding:"8px 10px",textAlign:"left",fontWeight:500},children:"Provider"}),gE.map(r=>i.jsxs("th",{style:{padding:"8px 10px",textAlign:"center",fontWeight:500},children:[xM[r]||"•"," ",r]},r))]})}),i.jsx("tbody",{children:t.map(r=>i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)"},children:[i.jsxs("td",{style:{padding:"8px 10px",color:"var(--text-primary)",whiteSpace:"nowrap"},children:[Ur(r)," ",Ai(r).split(" ")[0]]}),gE.map(a=>{var o;const s=(o=e.priors[r])==null?void 0:o[a];return!s||s.alpha===0&&s.beta===0?i.jsx("td",{style:{padding:"8px 10px",textAlign:"center",color:"var(--text-muted)"},children:"·"},a):i.jsxs("td",{style:{padding:"8px 10px",textAlign:"center"},children:[i.jsxs("div",{style:{fontSize:13,fontWeight:600,color:Boe(s.expectedWinRate),fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[(s.expectedWinRate*100).toFixed(0),"%"]}),i.jsxs("div",{style:{fontSize:10,color:"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["α",s.alpha," β",s.beta]})]},a)})]},r))})]})}),n.length>0&&i.jsxs("div",{style:{marginTop:16},children:[i.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:8},children:"Recent learning history"}),i.jsx("div",{style:{maxHeight:180,overflowY:"auto",paddingRight:4},children:n.map((r,a)=>{const s=r.outcome==="success"?"✅":r.outcome==="escalated"?"🔄":"❌",o=new Date(r.timestamp).toLocaleTimeString();return i.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",padding:"5px 4px",borderBottom:"1px solid var(--border-light)"},children:[i.jsx("span",{children:s}),i.jsx("span",{style:{color:"var(--text-primary)",fontSize:12,width:110,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:r.provider,children:r.provider}),i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)",width:80},children:r.complexity}),i.jsxs("span",{style:{fontSize:11,color:"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["reward ",r.reward.toFixed(2)]}),i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)",marginLeft:"auto"},children:o})]},a)})})]}),i.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:12},children:["Cold-start Beta(1,1) behaves like the heuristic router until outcomes accumulate. Enable learning with ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"nuvira config set routing.bandit true"}),"."]})]})}function Foe(e,t=1){return`${e>0?"+":""}${(e*100).toFixed(t)}%`}function Uoe({state:e}){const t={pass:{bg:"var(--ok-soft)",border:"var(--accent-green)",color:"var(--accent-green)",label:"✓ pass"},fail:{bg:"var(--danger-soft)",border:"var(--accent-red)",color:"var(--accent-red)",label:"✗ fail"},neutral:{bg:"var(--bg-tertiary)",border:"var(--border-hover)",color:"var(--text-secondary)",label:"○ neutral"}}[e];return i.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:t.bg,border:`1px solid ${t.border}`,color:t.color},children:t.label})}function Woe({promotion:e}){if(!e.decisionCount)return null;const t=e.promoted?{icon:"🎖️",label:"Promoted — the bandit beats the heuristic",color:"var(--accent-green)"}:e.sufficient?{icon:"⚠️",label:"Not promoted — the bandit is not (yet) better",color:"var(--accent-yellow)"}:{icon:"⏳",label:"Collecting data — need more diverged decisions",color:"var(--accent-blue)"},n=e.minDecisions>0?Math.min(100,Math.round(e.divergedCount/e.minDecisions*100)):0,r=[{key:"quality",label:"Quality ↑",delta:e.qualityDelta,state:e.criteria.quality?"pass":"fail",note:"needs > +2%"},{key:"cost",label:"Cost ↓",delta:e.costDelta,state:e.criteria.cost?"pass":"fail",note:"regression < +1%"},{key:"latency",label:"Latency ↓",delta:e.latencyDelta,state:e.latencyMeasured?e.criteria.latency?"pass":"fail":"neutral",note:e.latencyMeasured?"regression < +5%":"no latency measurements yet"}];return i.jsxs(ar,{icon:"🎖️",title:"Promotion Gate — is the bandit better than the heuristic?",subtitle:"A/B verdict from real trajectories (router-promotion.jsonl): quality must improve >2% while cost and latency don't regress (ruflo ADR-150)",children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:14},children:[i.jsx("span",{style:{fontSize:22},children:t.icon}),i.jsx("span",{style:{fontSize:14,fontWeight:600,color:t.color},children:t.label})]}),i.jsxs("div",{style:{marginBottom:14},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:11,color:"var(--text-secondary)",marginBottom:5},children:[i.jsxs("span",{children:[e.divergedCount," diverged decisions"]}),i.jsxs("span",{children:["need ",e.minDecisions," for a verdict"]})]}),i.jsx("div",{style:{background:"var(--bg-primary)",borderRadius:4,height:8,overflow:"hidden",border:"1px solid var(--border-light)"},children:i.jsx("div",{style:{width:`${n}%`,background:e.sufficient?"var(--accent-green)":"var(--accent-blue)",height:"100%",transition:"width 0.4s ease"}})}),i.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:4},children:[e.decisionCount," total decisions logged"]})]}),r.map(a=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"7px 0",borderBottom:"1px solid var(--border-light)"},children:[i.jsx("span",{style:{width:70,fontSize:12,color:"var(--text-primary)"},children:a.label}),i.jsx("span",{style:{width:92,fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:"var(--text-secondary)"},children:Foe(a.delta)}),i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)",flex:1},children:a.note}),i.jsx(Uoe,{state:a.state})]},a.key)),i.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:12},children:["Run auto-routed tasks with ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"routing.bandit true"})," to accumulate A/B decisions. The gate does not disable the bandit — it tells you whether it's actually winning."]})]})}function Hoe({ml:e}){if(!e.enabled||e.recordCount===0)return null;const t=e.providers.filter(r=>r.trusted),n=e.providers.filter(r=>!r.trusted);return i.jsxs(ar,{icon:"🧠",title:"ML Router — learned from similar tasks",subtitle:"Task-feature kNN (ruflo neural-router analog): outcomes of the most similar PAST tasks nudge each provider's score. Win rate is similarity-weighted; factor = 1 + 0.5 × (winRate − 0.5), trusted only after 5 similar-task samples.",children:[i.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:14},children:[i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:bt(e.recordCount)}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"learned tasks"})]}),i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--accent-green)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--accent-green)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:t.length}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"trusted providers"})]}),i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--accent-yellow)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--accent-yellow)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:n.length}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"still learning"})]})]}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:e.providers.map(r=>i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"10px 14px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[i.jsx("span",{children:Ur(r.provider)}),i.jsx("span",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)"},children:Ai(r.provider)}),r.trusted?i.jsxs("span",{style:vi("color-mix(in srgb, var(--accent-green) 15%, transparent)","var(--accent-green)","var(--accent-green)"),children:["trusted · ",r.samples," samples"]}):i.jsxs("span",{style:vi("color-mix(in srgb, var(--accent-yellow) 15%, transparent)","var(--accent-yellow)","var(--accent-yellow)"),children:[r.samples,"/5 samples"]}),r.model&&i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)",fontFamily:"'SFMono-Regular', Consolas, monospace",marginLeft:"auto"},children:r.model.length>30?r.model.slice(0,27)+"…":r.model})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[i.jsxs("div",{style:{width:70,fontSize:11,color:"var(--text-secondary)"},children:["win ",up(r.winRate,0)]}),i.jsx(g0,{value:r.winRate,color:r.winRate>=.5?"var(--accent-green)":"var(--accent-red)"}),i.jsxs("div",{style:{width:74,fontSize:11,color:"var(--text-secondary)",textAlign:"right"},children:["factor ",i.jsxs("span",{style:{color:r.trusted&&r.factor!==1?"var(--accent-blue)":"var(--text-muted)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[r.factor.toFixed(2),"×"]})]})]})]},r.provider))}),i.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:12},children:["Enabled with ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"nuvira config set routing.mlRouter true"})," — the factor only adjusts scores when the provider has ≥ 5 similar-task wins (cold start is neutral)."]})]})}function Goe({routing:e}){return e.bestModels.length?i.jsx(ar,{icon:"🏆",title:"Best Model per Agent (from your runs)",subtitle:"Success-rate-ranked models from agent-stats — the Auto router boosts the proven winner",children:i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:10},children:e.bestModels.map(t=>i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 14px",minWidth:200,flex:"1 1 200px",transition:"border-color 0.2s, box-shadow 0.2s"},onMouseEnter:n=>{n.currentTarget.style.borderColor="var(--accent-green)",n.currentTarget.style.boxShadow="0 2px 10px color-mix(in srgb, var(--accent-green) 13%, transparent)"},onMouseLeave:n=>{n.currentTarget.style.borderColor="var(--border-light)",n.currentTarget.style.boxShadow="none"},children:[i.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:4},children:[Ur(t.model.split("/")[0])," ",t.agentType]}),i.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:t.model,children:t.model.length>34?t.model.slice(0,31)+"…":t.model}),i.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:6},children:[i.jsxs("span",{style:{color:t.successRate>=.8?"var(--accent-green)":"var(--accent-yellow)"},children:[up(t.successRate,0)," success"]})," · ",t.runs," run",t.runs!==1?"s":""]})]},`${t.agentType}-${t.model}`))})}):null}function qoe({retrieval:e}){var l,c;if(!e.enabled&&e.repoChunks===0)return null;const t=e.totalSavedTokens??0,n=e.avgPctReduced??0,r=e.lastCall,a=e.totalCalls??0,s=e.totalRetrievals??0,o=e.totalFailovers??0;return i.jsxs(ar,{icon:"🧠",title:"Vector Retrieval — token savings",subtitle:"Large contexts are chunked, embedded locally (bge-small-en-v1.5), and reduced to the top-k relevant chunks before the LLM — saving tokens so free quotas stretch further. Complements the quota ledger: retrieval saves, the ledger manages.",children:[i.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:14},children:[i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--accent-green)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--accent-green)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:bt(t)}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"tokens saved"})]}),i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsxs("div",{style:{fontSize:22,fontWeight:700,color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[n.toFixed(1),"%"]}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"avg context reduction"})]}),i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--accent-yellow)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--accent-yellow)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:bt(e.repoChunks)}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"repo chunks indexed"})]})]}),i.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",fontSize:12,color:"var(--text-secondary)",marginBottom:14},children:[i.jsxs("span",{children:["📞 ",a," context calls · 🧠 ",s," retrievals used · ⚠️ ",o," failovers (full-context fallback)"]}),e.dimensions>0&&i.jsxs("span",{children:["· ",e.dimensions,"-dim embeddings"]})]}),r&&r.used!==!1&&((l=r.hits)==null?void 0:l.length)>0&&i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 16px",marginBottom:12},children:[i.jsxs("div",{style:{fontSize:12,fontWeight:600,color:"var(--text-primary)",marginBottom:8},children:["Latest retrieval — ",bt(r.originalTokens)," → ",bt(r.reducedTokens)," tokens",i.jsxs("span",{style:{color:"var(--accent-green)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[" (−",(c=r.pctReduced)==null?void 0:c.toFixed(0),"%)"]})]}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)"},children:r.hits.slice(0,5).map(u=>i.jsxs("div",{style:{marginTop:3},children:[i.jsx("span",{style:{color:"var(--accent-blue)"},children:"▸"})," ",u.filePath," ",i.jsxs("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["(sim ",u.similarity.toFixed(3),")"]})]},u.filePath))})]}),i.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)"},children:["Pre-index your repo with ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"nuvira retrieval index <dir>"}),", query it with"," ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:'nuvira retrieval query "<question>"'}),", and see the same stats with"," ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"nuvira retrieval stats"}),"."]})]})}function Koe({quota:e}){var c;if((!e.enabled||e.entries.length===0)&&(((c=e.events)==null?void 0:c.length)??0)===0)return null;const t=e.entries.reduce((u,d)=>u+d.tokensConsumed,0),n=e.entries.reduce((u,d)=>u+d.requests,0),r=e.entries.filter(u=>u.parked).length,a=e.freeTokens??t-(e.paidTokens??0),s=e.paidTokens??0,o=e.estimatedSavedUsd??0,l=t>0?a/t*100:0;return i.jsxs(ar,{icon:"📒",title:"Quota Ledger — free-tier usage & auto re-enable",subtitle:"Tokens/requests per provider × model with reset windows. Exhausted providers are parked (excluded from Auto routing) and re-enable when the window rolls.",children:[i.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:14},children:[i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:bt(t)}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"tokens tracked"})]}),i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:n}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"requests"})]}),i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:r>0?"var(--accent-yellow)":"var(--accent-green)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:r}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"parked"})]})]}),i.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:16},children:[i.jsxs("div",{style:{flex:"1 1 200px",background:"var(--bg-primary)",borderRadius:10,padding:"12px 16px",border:"1px solid var(--accent-green)"},children:[i.jsx("div",{style:{fontSize:20,fontWeight:700,color:"var(--accent-green)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:bt(a)}),i.jsxs("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:["tokens on free/local · ",l.toFixed(0),"% of usage"]}),i.jsxs("div",{style:{fontSize:12,color:"var(--accent-green)",marginTop:4,fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["💰 est. $",o.toFixed(4)," saved"]})]}),i.jsxs("div",{style:{flex:"1 1 200px",background:"var(--bg-primary)",borderRadius:10,padding:"12px 16px",border:"1px solid var(--accent-yellow)"},children:[i.jsx("div",{style:{fontSize:20,fontWeight:700,color:s>0?"var(--accent-yellow)":"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:bt(s)}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"tokens on paid providers (spend triggered)"}),i.jsxs("div",{style:{fontSize:12,color:s>0?"var(--accent-yellow)":"var(--text-secondary)",marginTop:4},children:[e.paidRequests??0," paid request",e.paidRequests===1?"":"s"]})]})]}),i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)",color:"var(--text-secondary)"},children:[i.jsx("th",{style:{padding:"8px 10px",textAlign:"left",fontWeight:500},children:"Provider / Model"}),i.jsx("th",{style:{padding:"8px 10px",textAlign:"right",fontWeight:500},children:"Tokens"}),i.jsx("th",{style:{padding:"8px 10px",textAlign:"right",fontWeight:500},children:"Requests"}),i.jsx("th",{style:{padding:"8px 10px",textAlign:"right",fontWeight:500},children:"Resets in"}),i.jsx("th",{style:{padding:"8px 10px",textAlign:"center",fontWeight:500},children:"State"})]})}),i.jsx("tbody",{children:e.entries.map(u=>i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)"},children:[i.jsxs("td",{style:{padding:"8px 10px",whiteSpace:"nowrap"},children:[i.jsxs("span",{style:{color:"var(--text-primary)"},children:[Ur(u.provider)," ",Ai(u.provider).split(" ")[0]]}),i.jsxs("span",{style:{color:"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[" / ",u.model.length>24?u.model.slice(0,21)+"…":u.model]})]}),i.jsx("td",{style:{padding:"8px 10px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",color:"var(--text-secondary)"},children:bt(u.tokensConsumed)}),i.jsx("td",{style:{padding:"8px 10px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",color:"var(--text-secondary)"},children:u.requests}),i.jsx("td",{style:{padding:"8px 10px",textAlign:"right",color:"var(--text-secondary)",whiteSpace:"nowrap"},children:mE(u.resetsInMs)}),i.jsx("td",{style:{padding:"8px 10px",textAlign:"center"},children:u.parked?i.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:"var(--danger-soft)",border:"1px solid var(--accent-red)",color:"var(--accent-red)"},children:"⏸ parked"}):i.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:"var(--ok-soft)",border:"1px solid var(--accent-green)",color:"var(--accent-green)"},children:"✓ available"})})]},`${u.provider}|${u.model}`))})]})}),i.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:12},children:["Configure limits with ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"nuvira config set routing.quota.gemini.requestsPerWindow 1500"}),"; the ledger always tracks usage but only parks when limits are set."]}),e.parkedAccounts&&e.parkedAccounts.length>0&&i.jsxs("div",{style:{marginTop:18},children:[i.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)",marginBottom:10},children:"🔑 Parked Accounts — multi-account key rotation"}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginBottom:8},children:"Accounts skipped predictively by the failover walk (rate-limit / auth). Fingerprints only — raw keys are never stored."}),i.jsx("div",{style:{maxHeight:180,overflowY:"auto",background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"8px 0"},children:e.parkedAccounts.map((u,d)=>{const f=u.reason==="auth"?"auth":u.reason==="rate-limit"?"rate-limit":u.reason||"cooldown",h=u.reason==="rate-limit"?"var(--accent-yellow)":"var(--accent-red)";return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"6px 14px",borderBottom:d<e.parkedAccounts.length-1?"1px solid var(--bg-card)":"none"},children:[i.jsx("span",{style:{fontSize:13},children:"🔒"}),i.jsxs("span",{style:{width:90,flexShrink:0,fontSize:12,color:"var(--text-primary)"},children:[Ur(u.provider)," ",Ai(u.provider).split(" ")[0]]}),i.jsxs("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11,color:"var(--text-secondary)"},title:u.accountId,children:["#",u.accountId.slice(0,8)]}),i.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:"var(--bg-card)",border:`1px solid ${h}`,color:h,textAlign:"center"},children:f}),i.jsx("span",{style:{flex:1}}),i.jsxs("span",{style:{fontSize:11,color:"var(--text-muted)",whiteSpace:"nowrap"},children:["re-admits in ",mE(u.remainingMs)]})]},`${u.provider}-${u.accountId}-${d}`)})})]}),e.events&&e.events.length>0&&i.jsxs("div",{style:{marginTop:18},children:[i.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)",marginBottom:10},children:"🛟 Failover Timeline — quota management & mid-session swaps"}),i.jsx("div",{style:{maxHeight:220,overflowY:"auto",background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"8px 0"},children:e.events.map((u,d)=>{const f=u.type==="parked"?"⏸":u.type==="re-enabled"?"🔁":u.type==="released"?"✅":"⚡",h=u.type==="parked"?"var(--accent-red)":u.type==="re-enabled"||u.type==="released"?"var(--accent-green)":"var(--accent-yellow)",p=u.type==="parked"?"parked":u.type==="re-enabled"?"re-enabled":u.type==="released"?"released":"failover";return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"6px 14px",borderBottom:d<e.events.length-1?"1px solid var(--bg-card)":"none"},children:[i.jsx("span",{style:{fontSize:13},children:f}),i.jsx("span",{style:{width:80,flexShrink:0,fontSize:11,padding:"1px 8px",borderRadius:10,background:"var(--bg-card)",border:`1px solid ${h}`,color:h,textAlign:"center"},children:p}),i.jsxs("span",{style:{flex:1,fontSize:12,color:"var(--text-primary)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[Ur(u.provider)," ",Ai(u.provider)]}),u.reason&&i.jsx("span",{style:{fontSize:11,color:"var(--text-secondary)"},children:u.reason}),i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)",whiteSpace:"nowrap"},children:kM(u.timestamp)})]},`${u.timestamp}-${d}`)})})]})]})}function Mf({ok:e,children:t}){return i.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:11,padding:"3px 9px",borderRadius:8,background:e===!1?"var(--danger-soft)":"var(--ok-soft)",border:`1px solid ${e===!1?"var(--accent-red)":"var(--accent-green)"}`,color:e===!1?"var(--accent-red)":"var(--accent-green)",whiteSpace:"nowrap"},children:t})}function Voe({governance:e}){var r,a,s,o,l;if(!e.enabled)return i.jsx(ar,{icon:"⚖️",title:"Admin Governance Policy",subtitle:"Hard-constraint rules the Auto router enforces on every pick",children:i.jsxs("div",{style:{fontSize:13,color:"var(--text-secondary)"},children:[i.jsx("span",{style:{color:"var(--accent-green)"},children:"Fully permissive"})," — no governance rules active; any provider × model is eligible.",i.jsxs("div",{style:{marginTop:6,fontSize:12,color:"var(--text-muted)"},children:["Add rules with ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"nuvira admin allow <provider>"})," ·"," ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"nuvira admin deny <provider>"})," ·"," ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"nuvira admin max-cost <usd>"})]})]})});const t=[];(r=e.allowProviders)!=null&&r.length&&t.push({label:"allow providers",items:e.allowProviders}),(a=e.denyProviders)!=null&&a.length&&t.push({label:"deny providers",items:e.denyProviders,deny:!0}),(s=e.allowModels)!=null&&s.length&&t.push({label:"allow models",items:e.allowModels}),(o=e.denyModels)!=null&&o.length&&t.push({label:"deny models",items:e.denyModels,deny:!0});const n=[];return e.maxCostUsd!==void 0&&n.push(`max cost $${e.maxCostUsd}`),e.minPrivacyForPii!==void 0&&e.minPrivacyForPii<1&&n.push(`PII min privacy ${e.minPrivacyForPii}`),(l=e.piiPatterns)!=null&&l.length&&n.push(`PII guard (${e.piiPatterns.length} patterns)`),e.allowUnblock===!1&&n.push("unblock admin-hard"),i.jsxs(ar,{icon:"⚖️",title:"Admin Governance Policy",subtitle:"Hard-constraint rules — violating providers are eliminated, never just scored lower",children:[i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:10},children:[t.map(c=>i.jsxs(Mf,{ok:!c.deny,children:[c.deny?"⛔":"✅"," ",c.label,": ",c.items.join(", ")]},c.label)),n.map(c=>i.jsx(Mf,{children:c},c)),t.length===0&&n.length===0&&i.jsx(Mf,{ok:!1,children:"policy configured but no rules active"})]}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-muted)"},children:["Managed via ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"nuvira admin"})," — the same policy the CLI’s"," ",i.jsx("code",{children:"model explain"})," surfaces as governance-blocked."]})]})}function Yoe({rbac:e}){const t=n=>n==="admin"?"var(--accent-yellow)":n==="operator"?"var(--accent-green)":"var(--text-secondary)";return i.jsxs(ar,{icon:"🔐",title:"RBAC Identity",subtitle:"Who may write policy — role file ~/.nuvira/rbac.json",children:[i.jsxs("div",{style:{fontSize:13,marginBottom:10},children:[i.jsx("span",{style:{color:"var(--text-secondary)"},children:"You are "}),i.jsx("code",{style:{color:"var(--accent-blue)"},children:e.identity}),i.jsx("span",{style:{color:"var(--text-secondary)"},children:" as "}),e.role?i.jsx("span",{style:{color:t(e.role),fontWeight:600},children:e.role}):i.jsx("span",{style:{color:"var(--text-secondary)"},children:"unassigned"})]}),e.legacy?i.jsxs("div",{style:{fontSize:12,color:"var(--text-muted)"},children:[i.jsx("span",{style:{color:"var(--accent-green)"},children:"Legacy single-user mode"})," — no roles assigned; policy writes are open to every user. Assign roles with"," ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"nuvira admin role add <you> admin"}),"."]}):i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:[e.users.map(n=>i.jsxs(Mf,{ok:n.role!=="viewer",children:[n.user," · ",n.role,n.via==="oidc"?" (oidc)":""]},n.user)),i.jsxs("div",{style:{width:"100%",fontSize:12,color:"var(--text-muted)",marginTop:4},children:["Policy ",i.jsx("em",{children:"writes"})," require ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"admin"}),"; reads are open to every role."]})]})]})}function Xoe({data:e}){var p,m,g,y,v,k,w,j,S,x;const t=e==null?void 0:e.routing,n=t&&(t.preference.length>0||t.providers.length>0||t.bestModels.length>0),r=!!((p=t==null?void 0:t.usage)!=null&&p.total),a=!!((m=t==null?void 0:t.history)!=null&&m.length),s=!!t&&(((g=t.history)==null?void 0:g.length)??0)>0||!!((y=t==null?void 0:t.preference)!=null&&y.length),o=!!((v=t==null?void 0:t.bandit)!=null&&v.enabled),l=!!((k=t==null?void 0:t.promotion)!=null&&k.decisionCount),c=!!((w=t==null?void 0:t.ml)!=null&&w.enabled)&&(t.ml.recordCount??0)>0,u=!!((j=t==null?void 0:t.quota)!=null&&j.enabled),d=!!((S=t==null?void 0:t.retrieval)!=null&&S.enabled)||!!((x=t==null?void 0:t.retrieval)!=null&&x.repoChunks),f=!!(t!=null&&t.governance),h=!!(t!=null&&t.rbac);return i.jsxs(i.Fragment,{children:[i.jsx(Oe,{icon:"🤖",title:"Auto Routing Insights"}),i.jsxs("p",{className:"section-description",children:["Which providers and models the Auto router prefers — from real pricing, benchmark quality, per-agent success stats, and the Thompson-sampling bandit. Run"," ",i.jsx("code",{children:"nuvira benchmark"})," and use Auto routing to build this up over time."]}),!n&&!r&&!a&&!o&&!l&&!c&&!u&&!d&&!f&&!h?i.jsx(Ooe,{}):i.jsxs(i.Fragment,{children:[s&&t&&i.jsx(_oe,{routing:t}),f&&t.governance&&i.jsx(Voe,{governance:t.governance}),(t==null?void 0:t.rbac)&&i.jsx(Yoe,{rbac:t.rbac}),r&&i.jsx(Ioe,{usage:t.usage}),a&&i.jsx($oe,{history:t.history}),o&&i.jsx(zoe,{bandit:t.bandit}),l&&i.jsx(Woe,{promotion:t.promotion}),c&&t.ml&&i.jsx(Hoe,{ml:t.ml}),u&&i.jsx(Koe,{quota:t.quota}),d&&i.jsx(qoe,{retrieval:t.retrieval}),i.jsx(Loe,{routing:t}),i.jsx(Doe,{routing:t}),i.jsx(Goe,{routing:t})]}),t&&t.providers.length===0&&t.bestModels.length===0&&t.preference.length>0&&i.jsx("div",{style:{fontSize:12,color:"var(--text-muted)",marginTop:4},children:"Auto-router preference is always available (static profiles + real pricing); quality metrics appear once you run benchmarks and agent tasks."})]})}const vE={chat:"💬",execute:"⚙️",plan:"🗺️",edit:"✏️",skill:"🧩",learn:"📚",ci:"🔁",doctor:"🩺",probe:"🔭","spot-check":"🧪",telemetry:"📡",usage:"🧮","ide-chat":"💬","ide-inline":"✍️","ide-execute":"⚙️"};function Qoe(e){return new Date(e).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function cf(e){return e!==void 0?`${e}ms`:"—"}function Zoe(e){return e===0?"var(--accent-green)":e<.2?"var(--accent-yellow)":"var(--accent-red)"}function Joe(e){return e===0?"ok":e<.2?"warn":"danger"}function ele({pair:e}){const t=e.traces.length<=3?e.traces.join(", "):`${e.traces.slice(0,3).join(", ")} +${e.traces.length-3} more`;return i.jsx("span",{title:`⚠️ ${e.steps} step(s) across ${e.traces.length} trace(s) served by a pair that cannot hold an agentic task — this row's error rate is not a quality measurement (traces: ${t})`,style:{marginLeft:6,fontSize:10,padding:"1px 6px",borderRadius:8,whiteSpace:"nowrap",background:"var(--purple-soft)",border:"1px solid var(--accent-red)",color:"var(--accent-red)"},children:"⚠️ degraded"})}function tle({data:e}){const t=e.rows,n=t.reduce((f,h)=>f+h.requests,0),r=t.reduce((f,h)=>f+Math.round(h.errorRate*h.requests),0),a=t.reduce((f,h)=>f+(h.costUsd??0),0),s=t.flatMap(f=>f.latency?[f.latency.avg]:[]),o=s.length>0?Math.round(s.reduce((f,h)=>f+h,0)/s.length):void 0,l=new Set(t.map(f=>f.action)).size,c=n>0?r/n:0,u=[{key:"requests",icon:"📨",value:bt(n),label:"Requests",tone:"accent"},{key:"groups",icon:"🎯",value:String(t.length),label:"provider × model × action groups",tone:"accent"},{key:"latency",icon:"⚡",value:o!==void 0?`${o}ms`:"—",label:`Avg latency${o!==void 0?` (${s.length} groups)`:" (no samples)"}`,tone:o!==void 0?"ok":"accent"},{key:"error-rate",icon:"📛",value:n>0?`${(c*100).toFixed(1)}%`:"—",label:`Overall error rate (${bt(r)} failures)`,tone:Joe(c)},{key:"cost",icon:"💰",value:a>0?`$${a.toFixed(4)}`:"—",label:`Measured cost${l>0?` · ${l} actions`:""}`,tone:"warn"}],d=e.degraded??[];return d.length>0&&u.push({key:"degraded",icon:"⚠️",value:String(d.length),label:"Degraded pair(s) — served steps without agentic capability (derived from traces)",tone:"danger"}),i.jsx(Wi,{tiles:u})}function nle({data:e}){const[t,n]=b.useState(""),[r,a]=b.useState("all"),s=e==null?void 0:e.requests,o=b.useMemo(()=>{if(!s)return[];const d=t.trim().toLowerCase();return s.rows.filter(f=>r!=="all"&&f.action!==r?!1:d?`${f.provider} ${f.model} ${f.action}`.toLowerCase().includes(d):!0)},[s,t,r]),l=i.jsx(Oe,{icon:"📨",title:"Requests — per provider × model × action",description:"Aggregated from the same action-telemetry log as the Models panel — every Auto-routed call, grouped by action × provider × model. Latency percentiles appear once ≥3 samples exist; cost when the caller reported usage."});if(!e)return i.jsxs(i.Fragment,{children:[l,i.jsx("div",{className:"loading-state",children:i.jsx("p",{children:"Loading requests..."})})]});if(!s||!s.enabled||s.rows.length===0)return i.jsxs(i.Fragment,{children:[l,i.jsxs("div",{className:"empty-state",style:{padding:"40px 24px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:28,marginBottom:10},children:"📨"}),i.jsxs("p",{className:"section-description",style:{maxWidth:560,margin:"0 auto"},children:["No request telemetry yet. As you use ",i.jsx("strong",{children:"chat"}),", ",i.jsx("strong",{children:"execute"}),","," ",i.jsx("strong",{children:"plan"})," and ",i.jsx("strong",{children:"edit"})," under Auto routing, every call writes to the action-telemetry log and this panel aggregates it: request counts, p50/p95/p99 latency, error rate and measured cost — the same feed that drives the Models panel."]})]})]});const c=[...new Set(s.rows.map(d=>d.action))].sort(),u=new Map((s.degraded??[]).map(d=>[`${d.provider}|${d.model}`,d]));return i.jsxs(i.Fragment,{children:[l,i.jsx(tle,{data:s}),u.size>0&&i.jsxs("div",{style:{margin:"0 0 14px",padding:"10px 14px",borderRadius:10,background:"var(--purple-soft)",border:"1px solid var(--accent-red)",color:"var(--text-secondary)",fontSize:12,lineHeight:1.5},children:[i.jsxs("strong",{style:{color:"var(--accent-red)"},children:["⚠️ ",u.size," pair(s) below cannot hold an agentic task."]})," ","Their error rates come from the action log, which records that a provider"," ",i.jsx("em",{children:"answered"})," — not that the answer was usable — and cannot be rewritten (it is hash-chained). The truth is derived read-only from the reasoning traces:"," ",[...u.values()].map(d=>`${d.provider}/${d.model} (${d.steps} step(s))`).join(", "),"."]}),i.jsxs("div",{style:{display:"flex",gap:12,marginBottom:14,flexWrap:"wrap",alignItems:"center"},children:[i.jsxs("select",{value:r,onChange:d=>a(d.target.value),"aria-label":"Filter by action",style:{background:"var(--bg-card)",color:"var(--text-primary)",border:"1px solid var(--border)",borderRadius:8,padding:"8px 10px",fontSize:13,cursor:"pointer"},children:[i.jsx("option",{value:"all",children:"All actions"}),c.map(d=>i.jsxs("option",{value:d,children:[vE[d]||"🎯"," ",d]},d))]}),i.jsxs("div",{style:{flex:1,minWidth:220,position:"relative"},children:[i.jsx("span",{style:{position:"absolute",left:10,top:8,color:"var(--text-muted)",fontSize:13},children:"🔍"}),i.jsx("input",{type:"text",value:t,onChange:d=>n(d.target.value),placeholder:"Search provider, model or action...",style:{width:"100%",padding:"8px 12px 8px 32px",background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8,color:"var(--text-primary)",fontSize:13,outline:"none"}})]}),i.jsxs("span",{style:{fontSize:12,color:"var(--text-secondary)",whiteSpace:"nowrap"},children:[o.length," of ",s.rows.length," groups"]})]}),i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)",color:"var(--text-secondary)",textAlign:"left"},children:[i.jsx("th",{style:{padding:"8px 12px",fontWeight:500},children:"Action"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500},children:"Provider"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500},children:"Model"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"Requests"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"Error rate"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"Latency avg"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"p50"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"p95"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"p99"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"Measured cost"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"Last seen"})]})}),i.jsx("tbody",{children:o.length===0?i.jsx("tr",{children:i.jsx("td",{colSpan:11,style:{padding:28,textAlign:"center",color:"var(--text-muted)"},children:"No request groups match your filter."})}):o.map(d=>{var f;return i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)"},children:[i.jsx("td",{style:{padding:"8px 12px",whiteSpace:"nowrap"},children:i.jsxs("span",{style:{fontSize:11,padding:"2px 8px",borderRadius:8,background:"var(--bg-hover)",color:"var(--text-secondary)",border:"1px solid var(--border)"},children:[vE[d.action]||"🎯"," ",d.action]})}),i.jsx("td",{style:{padding:"8px 12px",color:"var(--text-primary)",whiteSpace:"nowrap"},children:d.provider}),i.jsxs("td",{style:{padding:"8px 12px",color:"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,maxWidth:260,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:d.callIds.length>0?`Correlation ids: ${d.callIds.join(", ")}`:void 0,children:[d.model.length>42?d.model.slice(0,39)+"…":d.model,d.callIds.length>0&&i.jsxs("span",{style:{color:"var(--text-muted)",marginLeft:6},title:d.callIds.join(", "),children:["🔗",d.callIds.length]}),u.has(`${d.provider}|${d.model}`)&&i.jsx(ele,{pair:u.get(`${d.provider}|${d.model}`)})]}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:d.requests}),i.jsxs("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:Zoe(d.errorRate)},children:[(d.errorRate*100).toFixed(1),"%",(d.partials??0)>0&&i.jsxs("span",{title:`⏸ ${d.partials} mid-stream interruption(s) — started streaming, died before finish; the router deprioritizes flaky providers (P4 M4.4)`,style:{display:"inline-flex",alignItems:"center",gap:3,marginLeft:6,fontSize:10,padding:"1px 6px",borderRadius:8,whiteSpace:"nowrap",background:"var(--purple-soft)",border:"1px solid var(--accent-purple)",color:"var(--accent-purple)"},children:["⏸ ",d.partials]})]}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:cf((f=d.latency)==null?void 0:f.avg)}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:d.latency&&d.latency.samples>=3?cf(d.latency.p50):"—"}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:d.latency&&d.latency.samples>=3?cf(d.latency.p95):"—"}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:d.latency&&d.latency.samples>=3?cf(d.latency.p99):"—"}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:d.costUsd?"var(--accent-yellow)":"var(--text-muted)"},children:d.costUsd!==void 0?`$${d.costUsd.toFixed(4)}`:"—"}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",color:"var(--text-muted)",fontSize:11,whiteSpace:"nowrap"},children:Qoe(d.lastAt)})]},`${d.action}|${d.provider}|${d.model}`)})})]})}),i.jsx("div",{style:{textAlign:"center",fontSize:12,color:"var(--text-muted)",marginTop:12},children:"Auto-refreshes with the dashboard feed · percentile columns need ≥3 latency samples per group"})]})}const rle={local:"💻",groq:"🟢",nim:"🔶",gemini:"🔷",openrouter:"🟣"},ale={planner:"🗺️",writer:"✍️",reviewer:"🔎",tester:"🧪",debugger:"🐛",runner:"🏃","context-gatherer":"📂",memory:"🧠","self-improver":"📈"};function ile(e){return rle[e]||"🔌"}function sle(e){return ale[e]||"🤖"}function SM(e){const t=Date.now()-e;return t<6e4?"just now":t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${new Date(e).toLocaleDateString()}`}function v0(e){return e===void 0?"—":e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m ${Math.floor(e%6e4/1e3)}s`}function Uc(e){return e==null?"0":e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function ole(e){var n,r;if(!e)return null;const t={bg:"var(--bg-primary)",border:"var(--border)"};return e.degradedBy&&e.degradedBy.length>0?{text:`⬇️ degraded — ${e.degradedBy.map(s=>`${s.provider}/${s.model}`).join(", ")} is not agentic-capable, so part of this answer is a weak model's`,color:"var(--accent-yellow)",bg:"var(--warn-soft)",border:"var(--accent-yellow)"}:e.undeliveredChange?{text:"⚠️ unchanged workspace — a change was requested and a plan delivered instead",color:"var(--accent-yellow)",bg:"var(--warn-soft)",border:"var(--accent-yellow)"}:e.unbackedHealthClaim?{text:"⚠️ unbacked verdict — vouched for the product with nothing exercising it",color:"var(--accent-yellow)",bg:"var(--warn-soft)",border:"var(--accent-yellow)"}:e.unverifiedClaim?{text:"⚠️ unverified claim — said it acted, but no tool ran",color:"var(--accent-yellow)",bg:"var(--warn-soft)",border:"var(--accent-yellow)"}:e.unfulfilledPromise?{text:"⚠️ unfulfilled promise — announced an action it never performed",color:"var(--accent-yellow)",bg:"var(--warn-soft)",border:"var(--accent-yellow)"}:e.unverifiedBuildClaim?{text:"⚠️ unverified build claim — a build failed but the reply reported success",color:"var(--accent-yellow)",bg:"var(--warn-soft)",border:"var(--accent-yellow)"}:e.unverifiedEditClaim?{text:"⚠️ unverified edit claim — asserted a fix, but nothing verified it",color:"var(--accent-yellow)",bg:"var(--warn-soft)",border:"var(--accent-yellow)"}:e.unverifiedEdit?{text:`⚠️ unverified edit — ${((n=e.tools)==null?void 0:n.length)??0} tool(s), no test/typecheck/browser run`,color:"var(--accent-yellow)",bg:"var(--warn-soft)",border:"var(--accent-yellow)"}:e.kind==="acted"?{text:e.delivered?"✅ action performed — message sent":`🔧 acted — ${((r=e.tools)==null?void 0:r.length)??0} tool(s)`,color:"var(--accent-green)",bg:"var(--ok-soft)",border:"var(--accent-green)"}:e.kind==="answered"?{text:"💬 answered — no action taken",color:"var(--text-secondary)",...t}:e.kind==="incomplete"?{text:"⏳ incomplete — ended with work still outstanding",color:"var(--accent-yellow)",bg:"var(--warn-soft)",border:"var(--accent-yellow)"}:e.kind==="cancelled"?{text:"⏹ cancelled",color:"var(--text-secondary)",...t}:{text:"❌ generation failed",color:"var(--accent-red)",bg:"var(--danger-soft)",border:"var(--accent-red)"}}function yE(e){const t=e.filter(n=>n.verdict==="CONFIRMED"&&y0(n).length>0).length;return`${e.length} finding${e.length===1?"":"s"}: ${t} confirmed, ${e.length-t} plausible`}function y0(e){return(e.evidence??[]).filter(t=>typeof(t==null?void 0:t.ref)=="string"&&t.ref.trim().length>0)}function lle({finding:e}){const t=y0(e),n=e.verdict==="CONFIRMED"&&t.length>0;return i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderLeft:`3px solid ${n?"var(--accent-green)":"var(--accent-yellow)"}`,borderRadius:8,padding:"8px 12px",marginBottom:8},children:[i.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[i.jsx("span",{style:{fontSize:13},children:n?"✅":"🔎"}),i.jsx("span",{style:{flex:1,fontSize:12.5,fontWeight:600,color:"var(--text-primary)"},children:e.claim}),i.jsx("span",{style:{fontSize:9.5,fontWeight:700,letterSpacing:"0.04em",padding:"1px 7px",borderRadius:10,border:"1px solid",color:n?"var(--accent-green)":"var(--accent-yellow)",background:n?"var(--ok-soft)":"var(--warn-soft)",borderColor:n?"var(--accent-green)":"var(--accent-yellow)"},children:n?"CONFIRMED":"PLAUSIBLE"})]}),e.outcome?i.jsx("div",{style:{marginTop:3,fontSize:11.5,color:"var(--text-secondary)"},children:e.outcome}):null,t.length>0?i.jsx("ul",{style:{listStyle:"none",margin:"5px 0 0",padding:0},children:t.map((r,a)=>i.jsxs("li",{style:{fontSize:11,color:"var(--text-secondary)",marginBottom:3},children:[i.jsx("span",{style:{fontSize:9.5,textTransform:"uppercase",letterSpacing:"0.04em",color:"var(--accent-blue)",marginRight:5},children:r.kind}),i.jsx("span",{style:{color:"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:r.ref}),r.detail?i.jsxs("span",{style:{marginLeft:5},children:["(",r.detail,")"]}):null]},a))}):i.jsx("div",{style:{marginTop:5,fontSize:11,color:"var(--accent-yellow)"},children:"no evidence — reported as PLAUSIBLE, not verified"}),e.source?i.jsxs("div",{style:{marginTop:4,fontSize:10,color:"var(--text-muted)"},children:["source: ",e.source]}):null]})}function dp({icon:e,title:t,subtitle:n,children:r}){return i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:"1px solid var(--border-light)",padding:"18px 20px",marginBottom:16},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:4},children:[i.jsx("span",{style:{fontSize:20},children:e}),i.jsx("h2",{style:{fontSize:15,fontWeight:600,color:"var(--text-primary)",margin:0},children:t})]}),n&&i.jsx("p",{style:{fontSize:12,color:"var(--text-secondary)",margin:"2px 0 12px 0"},children:n}),!n&&i.jsx("div",{style:{height:6}}),r]})}function cle(){return i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px dashed var(--border)",borderRadius:10,padding:"18px 20px",color:"var(--text-secondary)",fontSize:13,textAlign:"center"},children:["🔍 No reasoning traces yet — every LLM call in a ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"nuvira execute"})," pipeline is recorded to ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"reasoning-traces.json"}),". Run a pipeline, then replay it here or with ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"nuvira trace replay <id>"}),"."]})}function ule(){const[e,t]=b.useState(null),[n,r]=b.useState(!1),[a,s]=b.useState(null),o=b.useCallback(()=>{K.fetchAcceptance().then(u=>{u?(t(u),r(!1)):r(!0)})},[]);b.useEffect(()=>{o()},[o]);const l=b.useCallback(async u=>{if(u){s("Importing…");try{const d=await u.text(),f=await K.importAcceptance(d);if(!f||!f.ok){s(f!=null&&f.error?`Import failed: ${f.error}`:"Import failed.");return}s(`Imported ${f.imported??0}: ${f.added??0} new, ${f.updated??0} present (store ${f.total??0}).`),o()}catch{s("Import failed.")}}},[o]);if(n&&!e)return null;const c=e?Object.entries(e.byPair):[];return i.jsx(dp,{icon:"⭐",title:"Acceptance (read-only)",subtitle:"The one label the harness cannot derive: whether YOU wanted the turn. Rate it with the 👍/👎 control on a trace below, run `nuvira rate good|bad`, or let the behavioural tier infer it. Nothing routes on this.",children:e===null?i.jsx("div",{style:{color:"var(--text-secondary)",fontSize:13},children:"Loading…"}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{fontSize:13,color:"var(--text-primary)",marginBottom:6},children:[e.labelled," labelled turn",e.labelled===1?"":"s"," — 👍 ",e.accepted," / 👎 ",e.rejected]}),Object.keys(e.bySource).length>0&&i.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:6},children:["by source: ",Object.entries(e.bySource).map(([u,d])=>`${u} ${d}`).join(", ")]}),c.length>0&&i.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:6},children:c.map(([u,d])=>{const f=d.accepted+d.rejected;return i.jsxs("div",{children:[u,": 👍 ",d.accepted," / 👎 ",d.rejected," (",Math.round(100*d.accepted/f),"%, n=",f,")"]},u)})}),i.jsx("div",{style:{fontSize:12,color:e.fit.ok?"var(--accent-green)":"var(--text-secondary)"},children:e.fit.ok?`fit TRAINED — P(accepted | features) n=${e.fit.n} (${e.fit.positives}👍/${e.fit.negatives}👎)`:`fit NOT trained — ${e.fit.reason??"insufficient labels"}`}),i.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center",flexWrap:"wrap",marginTop:10},children:[i.jsx("span",{style:{fontSize:12,color:"var(--text-secondary)"},children:"Ship / join:"}),i.jsx("a",{href:K.acceptanceExportUrl("json"),download:!0,style:{fontSize:12,color:"var(--accent-blue)"},children:"Export JSON"}),i.jsx("a",{href:K.acceptanceExportUrl("csv"),download:!0,style:{fontSize:12,color:"var(--accent-blue)"},children:"Export CSV"}),i.jsxs("label",{style:{fontSize:12,color:"var(--accent-blue)",cursor:"pointer"},children:["Import…",i.jsx("input",{type:"file",accept:".json,.csv,application/json,text/csv",style:{display:"none"},onChange:u=>{var d;l((d=u.target.files)==null?void 0:d[0]),u.currentTarget.value=""}})]}),a&&i.jsx("span",{style:{fontSize:12,color:"var(--text-secondary)"},children:a})]})]})})}function dle({step:e}){const[t,n]=b.useState(!1),r=e.success?"var(--accent-green)":"var(--accent-red)",a=e.success?"ok":"failed";return i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:8,marginBottom:8,overflow:"hidden"},children:[i.jsxs("button",{onClick:()=>n(!t),style:{width:"100%",background:"none",border:"none",cursor:"pointer",padding:"10px 14px",textAlign:"left",display:"flex",alignItems:"center",gap:10,color:"inherit"},children:[i.jsx("span",{style:{width:26,fontSize:16},children:sle(e.agentType)}),i.jsx("span",{style:{width:130,fontSize:12,fontWeight:600,color:"var(--text-primary)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:e.agentType,children:e.agentType}),i.jsxs("span",{style:{flex:1,fontSize:12,color:"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:`${e.provider}/${e.model}`,children:[ile(e.provider)," ",e.provider,"/",e.model]}),i.jsx("span",{style:{width:70,fontSize:11,color:"var(--text-muted)",textAlign:"right"},children:v0(e.latencyMs)}),i.jsxs("span",{style:{width:86,fontSize:11,color:"var(--text-muted)",fontFamily:"'SFMono-Regular', Consolas, monospace",textAlign:"right"},children:[Uc(e.inputTokens),"→",Uc(e.outputTokens)," tok"]}),i.jsx("span",{style:{width:46,fontSize:11,color:r,textAlign:"right"},children:a}),i.jsx("span",{style:{width:22,fontSize:11,textAlign:"right"},children:e.escalated?i.jsx("span",{title:"Repair escalated to a stronger routed model (v1.60.4)",children:"🚀"}):""}),i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)"},children:t?"▾":"▸"})]}),t&&i.jsxs("div",{style:{padding:"0 14px 12px 50px",fontSize:12},children:[e.taskId&&i.jsxs("div",{style:{color:"var(--text-muted)",marginBottom:4},children:["Task: ",i.jsx("span",{style:{color:"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:e.taskId})]}),e.description&&i.jsx("div",{style:{color:"var(--text-secondary)",marginBottom:6},children:e.description}),e.routing&&i.jsxs("div",{style:{marginBottom:6},children:[i.jsxs("span",{style:{fontSize:10,padding:"1px 8px",borderRadius:10,background:e.escalated?"var(--warn-soft)":"var(--bg-tertiary)",border:e.escalated?"1px solid var(--accent-yellow)":"1px solid var(--accent-blue)",color:e.escalated?"var(--accent-yellow)":"var(--accent-blue)"},children:[e.escalated?"🚀 escalated auto → ":"🤖 auto → ",e.routing.provider,"/",e.routing.model," · score ",e.routing.score.toFixed(3)," · ",e.routing.complexity]}),e.escalated&&i.jsx("div",{style:{color:"var(--accent-yellow)",marginTop:4,fontSize:11},children:"Repair escalated to a stronger routed model (next complexity level)."}),e.routing.explanation&&i.jsx("div",{style:{color:"var(--text-muted)",marginTop:4,fontSize:11},children:e.routing.explanation}),e.routing.agenticCapable===!1&&i.jsxs("div",{style:{color:"var(--accent-red)",marginTop:4,fontSize:11,fontWeight:600},children:["⚠️ not agentic-capable",e.routing.overrideReason?` (${e.routing.overrideReason})`:""," — a software ask on this model may fabricate results"]})]}),e.layers&&i.jsxs("div",{style:{marginBottom:6,fontSize:11,color:"var(--text-muted)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[i.jsx("span",{style:{color:"var(--accent-blue)"},children:"sys"})," ",e.layers.systemChars,"c/#",e.layers.systemDigest," ·"," ",i.jsx("span",{style:{color:"var(--accent-green)"},children:"ctx"})," ",e.layers.contextChars,"c/#",e.layers.contextDigest," ·"," ",i.jsx("span",{style:{color:"var(--accent-yellow)"},children:"vol"})," ",e.layers.volatileChars,"c/#",e.layers.volatileDigest,i.jsxs("div",{style:{color:"var(--text-muted)",marginTop:2},children:["a constant ",i.jsx("span",{style:{color:"var(--accent-blue)"},children:"sys"})," digest across steps ⇒ the stable layer is prompt-cacheable"]})]}),e.error&&i.jsxs("div",{style:{color:"var(--accent-red)",marginBottom:6},children:["⚠️ ",e.error.slice(0,300)]}),i.jsxs("div",{style:{color:"var(--text-muted)",margin:"6px 0 3px 0"},children:["Prompt ",i.jsxs("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["#",e.promptDigest]})," · ",e.promptPreview.length,"+ chars:"]}),i.jsx("pre",{style:{background:"var(--bg-card)",border:"1px solid var(--border-light)",borderRadius:6,padding:8,margin:0,color:"var(--text-secondary)",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:180,overflowY:"auto",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11},children:e.promptPreview.slice(0,900)}),i.jsxs("div",{style:{color:"var(--text-muted)",margin:"8px 0 3px 0"},children:["Response (",Uc(e.responseLength)," chars):"]}),i.jsx("pre",{style:{background:"var(--bg-card)",border:"1px solid var(--border-light)",borderRadius:6,padding:8,margin:0,color:"var(--text-secondary)",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:240,overflowY:"auto",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11},children:e.responsePreview.slice(0,1200)})]})]})}function fle({trace:e}){var h,p;const[t,n]=b.useState(e.steps??null),[r,a]=b.useState(!1),[s,o]=b.useState(((h=e.userVerdict)==null?void 0:h.verdict)??null),[l,c]=b.useState(!1),u=b.useCallback(async m=>{c(!0),await K.rateTrace(e.id,m)&&o(m),c(!1)},[e.id]);b.useEffect(()=>{if(e.steps){n(e.steps);return}let m=!1;return K.fetchTraceDetail(e.id).then(g=>{m||(g!=null&&g.steps?n(g.steps):a(!0))}),()=>{m=!0}},[e.id,e.steps]);const d=e.success===!0?"✅":e.success===!1?"❌":"⏳",f=e.success===!0?"success":e.success===!1?"failed":"in progress";return i.jsxs(dp,{icon:d,title:`${e.id} — ${f}`,subtitle:e.goal,children:[i.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginBottom:12},children:[i.jsxs("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:["🕓 ",SM(e.startedAt)]}),(()=>{const m=ole(e.outcome);return m?i.jsx("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:m.bg,border:`1px solid ${m.border}`,color:m.color},children:m.text}):null})(),i.jsxs("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:["⏱ ",v0(e.durationMs)]}),i.jsxs("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:["🔢 ",(t==null?void 0:t.length)??"?"," call(s)"]}),i.jsxs("span",{style:{display:"inline-flex",gap:6,alignItems:"center",marginLeft:4},children:[i.jsx("span",{style:{fontSize:11,color:"var(--text-secondary)"},children:"Was this what you wanted?"}),["accepted","rejected"].map(m=>i.jsx("button",{type:"button",disabled:l,"aria-pressed":s===m,onClick:()=>void u(m),style:{fontSize:11,padding:"2px 10px",borderRadius:12,cursor:l?"default":"pointer",background:s===m?"var(--accent, var(--bg-hover))":"var(--bg-primary)",border:`1px solid ${s===m?"var(--accent, var(--border))":"var(--border)"}`,color:s===m?"var(--text-inverse, var(--text-primary))":"var(--text-secondary)",fontWeight:s===m?600:400},children:m==="accepted"?"👍 Yes":"👎 No"},m)),s?i.jsx("span",{style:{fontSize:11,color:"var(--text-secondary)"},children:"recorded"}):i.jsx("span",{style:{fontSize:11,color:"var(--text-secondary)"},children:"not rated"})]}),t&&t.some(m=>m.escalated)&&i.jsxs("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"var(--warn-soft)",border:"1px solid var(--accent-yellow)",color:"var(--accent-yellow)"},children:["🚀 ",t.filter(m=>m.escalated).length," escalated repair(s)"]}),e.totalTokens!==void 0&&i.jsxs("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:["🧮 ",Uc(e.totalTokens)," tok"]}),e.findings&&e.findings.length>0&&i.jsx("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:`🔎 ${yE(e.findings)}`}),((p=e.outcome)==null?void 0:p.unverifiedPaths)&&e.outcome.unverifiedPaths.length>0&&i.jsx("span",{title:e.outcome.unverifiedPaths.join(", "),style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"var(--warn-soft)",border:"1px solid var(--accent-yellow)",color:"var(--accent-yellow)"},children:`⚠️ ${e.outcome.unverifiedPaths.length} path(s) unverified`})]}),e.findings&&e.findings.length>0?i.jsxs("div",{style:{marginBottom:12},children:[i.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:6},children:`🔎 Findings — ${yE(e.findings)}`}),e.findings.map((m,g)=>i.jsx(lle,{finding:m},`finding-${g}`))]}):null,e.turnReport?i.jsxs("div",{style:{marginBottom:12},children:[i.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:6},children:`📋 Turn report — ${e.turnReport.summary??e.turnReport.verification}`}),i.jsxs("div",{style:{fontSize:11,marginBottom:6},children:[i.jsx("span",{style:{textTransform:"uppercase",letterSpacing:"0.04em",fontSize:10,border:"1px solid currentColor",borderRadius:12,padding:"1px 8px",color:e.turnReport.verification==="verified"?"var(--accent-green)":e.turnReport.verification==="unverified"?"var(--accent-yellow)":e.turnReport.verification==="blocked"?"var(--accent-red)":"var(--text-secondary)"},children:e.turnReport.verification}),e.turnReport.changedPaths.length>0?i.jsx("span",{style:{marginLeft:8,color:"var(--text-secondary)"},children:`${e.turnReport.changedPaths.length} file(s) changed`}):null,e.turnReport.planCarried?i.jsx("span",{style:{marginLeft:8,color:"var(--text-secondary)"},children:"plan carried from an earlier turn — not advanced this turn"}):null]}),e.turnReport.unverifiedPaths&&e.turnReport.unverifiedPaths.length>0?i.jsxs("div",{style:{marginBottom:6,fontSize:11,color:"var(--accent-yellow)"},children:[`⚠️ ${e.turnReport.unverifiedPaths.length} changed path(s) no check exercised: `,i.jsxs("code",{children:[e.turnReport.unverifiedPaths.slice(0,6).join(", "),e.turnReport.unverifiedPaths.length>6?` +${e.turnReport.unverifiedPaths.length-6} more`:""]})]}):null,e.turnReport.steps.length>0?i.jsx("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",gap:3},children:e.turnReport.steps.map(m=>i.jsxs("li",{style:{fontSize:12},children:[i.jsx("span",{"aria-hidden":"true",children:m.status==="done"?"✅":m.status==="running"?"🔄":m.status==="blocked"?"⛔":"⬜"})," ",m.description,m.evidence?i.jsxs("span",{style:{color:"var(--accent-yellow)",fontSize:11},children:[" (",m.evidence,")"]}):null]},m.id))}):null]}):null,e.systemPrompt&&i.jsxs("details",{style:{marginBottom:12},children:[i.jsxs("summary",{style:{cursor:"pointer",fontSize:12,color:"var(--accent-blue)"},children:["🧬 System prompt — stable layer (",e.systemPromptChars??e.systemPrompt.length," chars)"]}),i.jsx("pre",{style:{background:"var(--bg-card)",border:"1px solid var(--border-light)",borderRadius:6,padding:10,margin:"8px 0 0 0",color:"var(--text-secondary)",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:320,overflowY:"auto",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11},children:e.systemPrompt})]}),r&&i.jsx("div",{style:{color:"var(--accent-red)",fontSize:12,marginBottom:10},children:"Could not load trace steps (trace may have been deleted)."}),t===null&&!r&&i.jsx("div",{style:{color:"var(--text-secondary)",fontSize:12},children:"Loading steps…"}),t&&t.length===0&&i.jsx("div",{style:{color:"var(--text-secondary)",fontSize:12},children:"No LLM calls recorded in this trace."}),t&&t.map(m=>i.jsx(dle,{step:m},m.seq))]})}function hle({traces:e}){const[t,n]=b.useState(null);return t?i.jsxs(i.Fragment,{children:[i.jsx("button",{onClick:()=>n(null),style:{background:"var(--bg-hover)",border:"1px solid var(--border)",color:"var(--text-primary)",borderRadius:8,padding:"6px 14px",fontSize:12,cursor:"pointer",marginBottom:12},children:"← Back to traces"}),i.jsx(fle,{trace:t})]}):i.jsx("div",{children:e.map(r=>{const a=r.success===!0?"✅":r.success===!1?"❌":"⏳",s=r.steps?[...new Set(r.steps.map(o=>o.agentType))].join(", "):"";return i.jsxs("button",{onClick:()=>n(r),style:{width:"100%",background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 16px",marginBottom:8,cursor:"pointer",textAlign:"left",color:"inherit",transition:"border-color 0.2s, box-shadow 0.2s"},onMouseEnter:o=>{o.currentTarget.style.borderColor="var(--accent-blue)",o.currentTarget.style.boxShadow="0 2px 10px color-mix(in srgb, var(--accent-blue) 13%, transparent)"},onMouseLeave:o=>{o.currentTarget.style.borderColor="var(--border-light)",o.currentTarget.style.boxShadow="none"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[i.jsx("span",{children:a}),i.jsx("span",{style:{fontSize:11,color:"var(--accent-blue)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:r.id}),i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)",marginLeft:"auto"},children:SM(r.startedAt)})]}),i.jsx("div",{style:{fontSize:13,color:"var(--text-primary)",marginBottom:6},children:r.goal}),i.jsxs("div",{style:{display:"flex",gap:10,flexWrap:"wrap",fontSize:11,color:"var(--text-secondary)"},children:[i.jsxs("span",{children:["🔢 ",r.stepCount??0," call(s)"]}),i.jsxs("span",{children:["⏱ ",v0(r.durationMs)]}),r.failedSteps?i.jsxs("span",{style:{color:"var(--accent-red)"},children:["❌ ",r.failedSteps," failed"]}):i.jsx("span",{style:{color:"var(--accent-green)"},children:"✓ all ok"}),r.totalTokens!==void 0&&i.jsxs("span",{children:["🧮 ",Uc(r.totalTokens)," tok"]}),r.findings&&r.findings.length>0&&i.jsx("span",{style:{color:"var(--accent-yellow)"},children:`🔎 ${r.findings.filter(o=>o.verdict==="CONFIRMED"&&y0(o).length>0).length}/${r.findings.length} confirmed`}),s&&i.jsxs("span",{children:["🤖 ",s.slice(0,60)]})]})]},r.id)})})}function ple(){const[e,t]=b.useState(null),[n,r]=b.useState(!1),a=b.useCallback(()=>{K.fetchTraces().then(s=>{s?(t(s),r(!1)):r(!0)})},[]);return b.useEffect(()=>{a();const s=setInterval(a,15e3);return()=>clearInterval(s)},[a]),i.jsxs("div",{className:"panel",children:[i.jsx(Oe,{icon:"🔍",title:"Reasoning Traces",description:"Every LLM call in each pipeline — agent × model × prompt digest × response × tokens × latency × routing snapshot (assessment P0)."}),i.jsx(ule,{}),e===null&&!n&&i.jsx(dp,{icon:"⏳",title:"Loading…",children:i.jsx("div",{style:{color:"var(--text-secondary)",fontSize:13},children:"Fetching reasoning traces…"})}),n&&e===null&&i.jsx(dp,{icon:"⚠️",title:"Could not reach the dashboard server",children:i.jsxs("div",{style:{color:"var(--text-secondary)",fontSize:13},children:["The traces endpoint is unavailable right now — retrying automatically. Run"," ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"nuvira trace list"})," in the terminal to inspect traces directly."]})}),e!==null&&e.length===0&&i.jsx(cle,{}),e!==null&&e.length>0&&i.jsx(hle,{traces:e})]})}function Xg(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)&&t>=0?t:null}function mle({authed:e,role:t}){const[n,r]=b.useState(null),[a,s]=b.useState({}),[o,l]=b.useState(""),[c,u]=b.useState(!1),[d,f]=b.useState(null),[h,p]=b.useState(null),m=e&&(t==="admin"||t==="operator"),g=e&&t==="admin",y=b.useCallback(async()=>{var N,E,P;const S=await K.fetchAdminQuota();if(!S){p("Could not load budget config.");return}p(null),r(S);const x={};for(const _ of S.providers){const R=S.quota[_]||{};x[_]={provider:_,tokens:((N=R.tokensPerWindow)==null?void 0:N.toString())??"",requests:((E=R.requestsPerWindow)==null?void 0:E.toString())??"",windowMs:((P=R.windowMs)==null?void 0:P.toString())??""}}s(x),l(S.costUsd===null?"":String(S.costUsd))},[]);b.useEffect(()=>{y()},[y]);const v=(S,x,N)=>{s(E=>({...E,[S]:{...E[S]||{provider:S},[x]:N}}))},k=async()=>{u(!0),f(null);const S={};for(const E of Object.values(a)){const P={},_=Xg(E.tokens),R=Xg(E.requests),T=Xg(E.windowMs);_!==null&&(P.tokensPerWindow=_),R!==null&&(P.requestsPerWindow=R),T!==null&&(P.windowMs=T),S[E.provider]=Object.keys(P).length>0?P:null}const x={quota:S};if(g)if(o.trim()!==""){const E=Number(o);if(!Number.isFinite(E)||E<0){f({ok:!1,text:"Cost cap must be a non-negative number."}),u(!1);return}x.costUsd=E}else x.costUsd=null;const N=await K.saveAdminQuota(x);u(!1),N.ok?(f({ok:!0,text:"Budget saved — the quota ledger + auto-router will enforce it."}),y()):f({ok:!1,text:N.error||"Save failed."})},w=S=>{const x=n==null?void 0:n.quota[S];return!!x&&(x.tokensPerWindow!==void 0||x.requestsPerWindow!==void 0||x.windowMs!==void 0)},j=S=>"admin-input";return i.jsxs("div",{className:"admin-quota-panel",children:[i.jsx("h2",{className:"section-subtitle",children:"💰 Daily Budget (routing.quota — your plan, your say)"}),i.jsxs("p",{className:"admin-quota-note",children:["Free-tier providers enforce tokens-per-day caps the API doesn't advertise — only you know your plan's allowance. Declare it here and the agent paces around it (parks the provider at the cap, auto-resumes at window rollover) instead of exhausting your budget mid-task. Unset = current behavior. Same config as ",i.jsx("code",{children:"nuvira model quota set"}),"."]}),h?i.jsx("div",{className:"admin-error",children:h}):null,n?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"admin-quota-table",children:[i.jsxs("div",{className:"admin-quota-row admin-quota-head",children:[i.jsx("span",{children:"Provider"}),i.jsx("span",{children:"Tokens / window"}),i.jsx("span",{children:"Requests / window"}),i.jsx("span",{children:"Window (ms)"}),i.jsx("span",{children:"Status"})]}),n.providers.map(S=>{var x,N,E;return i.jsxs("div",{className:"admin-quota-row",children:[i.jsx("span",{className:"admin-provider-type",children:S}),i.jsx("input",{className:j(!m),type:"number",min:0,placeholder:"unset",disabled:!m,value:((x=a[S])==null?void 0:x.tokens)??"",onChange:P=>v(S,"tokens",P.target.value)}),i.jsx("input",{className:j(!m),type:"number",min:0,placeholder:"unset",disabled:!m,value:((N=a[S])==null?void 0:N.requests)??"",onChange:P=>v(S,"requests",P.target.value)}),i.jsx("input",{className:j(!m),type:"number",min:0,placeholder:"86400000 (24h)",disabled:!m,value:((E=a[S])==null?void 0:E.windowMs)??"",onChange:P=>v(S,"windowMs",P.target.value)}),i.jsx("span",{className:`admin-role-badge ${w(S)?"admin-role-admin":"admin-role-viewer"}`,children:w(S)?"declared":"unset"})]},S)})]}),i.jsxs("div",{className:"admin-quota-row admin-quota-cost",children:[i.jsx("span",{className:"admin-provider-type",children:"Max cost / call (USD, admin)"}),i.jsx("input",{className:j(!g),type:"number",min:0,step:.01,placeholder:"unset",disabled:!g,value:o,onChange:S=>l(S.target.value)}),i.jsx("span",{className:"admin-quota-cost-hint",children:"governance.maxCostUsd — hard admin cap"})]}),m||g?i.jsxs("div",{className:"admin-quota-actions",children:[i.jsx("button",{className:"admin-mini-btn",onClick:()=>void k(),disabled:c,children:c?"⏳ Saving…":"💾 Save budget"}),d?i.jsx("span",{className:d.ok?"admin-quota-ok":"admin-quota-err",children:d.text}):null]}):i.jsxs("div",{className:"admin-readonly-note",children:["🔒 Read-only for ",i.jsx("code",{children:t})," — budget limits need ",i.jsx("code",{children:"admin"})," or"," ",i.jsx("code",{children:"operator"}),"; the cost cap needs ",i.jsx("code",{children:"admin"}),"."]})]}):i.jsx("div",{className:"empty-state",children:"Loading budget…"})]})}const gle=["image","video","search","vision","speech"],vle={image:"🖼️ Image generation",video:"🎬 Video generation",search:"🔎 Web search & page reading",vision:"👁️ Vision / interpretation",speech:"🔊 Speech (TTS / STT)"};function yle({authed:e,role:t}){const[n,r]=b.useState([]),[a,s]=b.useState({}),[o,l]=b.useState(null),[c,u]=b.useState({}),[d,f]=b.useState(null),h=e&&t==="admin",p=b.useCallback(async()=>{const S=await K.fetchAdminServices();if(!S){f("Could not load service configuration — is the dashboard server up to date?");return}f(null),r(S.services)},[]);b.useEffect(()=>{p()},[p]);const m=(S,x)=>`${S}:${x}`,g=(S,x,N)=>{s(E=>({...E,[m(S,x)]:N}))},y=async S=>{const x={};for(const E of S.envVars){const P=a[m(S.id,E.varName)];P!==void 0&&P.trim()!==""&&(x[E.varName]=P.trim())}if(Object.keys(x).length===0){u(E=>({...E,[S.id]:"ℹ️ Type a value to save."}));return}l(S.id),u(E=>({...E,[S.id]:""}));const N=await K.saveService(S.id,x);if(N.ok&&N.service){const E=N.service;r(P=>P.map(_=>_.id===S.id?E:_)),s(P=>{const _={...P};for(const R of S.envVars)delete _[m(S.id,R.varName)];return _}),u(P=>({...P,[S.id]:"✅ Saved — the agent will use it on the next call."}))}else u(E=>({...E,[S.id]:`❌ ${N.error||"Save failed."}`}));l(null)},v=async S=>{l(S.id),u(N=>({...N,[S.id]:"⏳ Testing…"}));const x=await K.testService(S.id);u(N=>({...N,[S.id]:x.ok?`✅ ${x.detail||"Reachable"}`:`❌ ${x.error||x.detail||"Unreachable"}`})),l(null)},k=async S=>{if(!window.confirm(`Remove ${S.label}'s stored key(s)? The agent will fall back to another configured backend.`))return;l(S.id);const x=await K.removeService(S.id);if(x.ok&&x.service){const N=x.service;r(E=>E.map(P=>P.id===S.id?N:P)),s(E=>{const P={...E};for(const _ of S.envVars)delete P[m(S.id,_.varName)];return P}),u(E=>{var P;return{...E,[S.id]:`🗑️ Removed ${((P=x.removed)==null?void 0:P.join(", "))||"key(s)"}.`}})}else u(N=>({...N,[S.id]:`❌ ${x.error||"Remove failed."}`}));l(null)},w=gle.map(S=>({cap:S,services:n.filter(x=>x.capability===S)})).filter(S=>S.services.length>0),j=n.filter(S=>S.configured).length;return i.jsxs("div",{className:"service-providers-panel",children:[i.jsx("h2",{className:"section-subtitle",children:"🔌 Service Provider API Keys (image · video · search · vision · speech)"}),i.jsxs("p",{className:"admin-subtitle",children:["These are the third-party services the agent calls directly — separate from the LLM providers above. Each row maps to a real environment variable the tool path reads; keys are written to the credential env file and picked up by the agent on the next call.",n.length>0?` ${j} of ${n.length} services ready.`:""]}),h?null:i.jsxs("div",{className:"admin-readonly-note",children:["🔒 Read-only — configuring service keys requires the ",i.jsx("code",{children:"admin"})," role (credential.write). Secret values are shown redacted."]}),d?i.jsx("div",{className:"admin-error",children:d}):null,n.length===0&&!d?i.jsx("div",{className:"empty-state",children:"Loading service configuration…"}):null,w.map(S=>i.jsxs("section",{className:"service-providers-group",children:[i.jsx("h3",{className:"process-env-group-title",children:vle[S.cap]??S.cap}),i.jsx("div",{className:"admin-table-wrapper",children:i.jsxs("table",{className:"admin-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Service"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Configuration"}),i.jsx("th",{children:"Actions"})]})}),i.jsx("tbody",{children:S.services.map(x=>i.jsxs("tr",{children:[i.jsxs("td",{className:"admin-provider-type",children:[x.icon," ",x.label,i.jsx("div",{className:"admin-provider-sub",children:x.id}),i.jsx("div",{className:"admin-hint",children:x.description}),x.sharedNote?i.jsxs("div",{className:"admin-hint",children:["🔗 ",x.sharedNote]}):null,x.docsUrl?i.jsx("div",{className:"admin-hint",children:i.jsx("a",{href:x.docsUrl,target:"_blank",rel:"noreferrer",children:"Get a key ↗"})}):null]}),i.jsxs("td",{children:[i.jsx("span",{className:`admin-check-badge ${x.configured?"admin-check-pass":"admin-check-warn"}`,children:x.configured?"✅ Ready":"⚠️ Not set"}),x.keyless?i.jsx("div",{className:"admin-hint",children:"no key needed"}):null,x.free?i.jsx("div",{className:"admin-hint",children:"free"}):null]}),i.jsx("td",{children:x.envVars.length===0?i.jsx("div",{className:"admin-hint",children:"Nothing to configure — works out of the box."}):x.envVars.map(N=>{const E=m(x.id,N.varName),P=a[E]??"",_=!N.secret&&N.set?N.value:"";return i.jsxs("div",{className:"service-env-row",children:[i.jsxs("label",{className:"service-env-label",htmlFor:E,children:[i.jsx("code",{children:N.varName}),i.jsx("span",{className:"admin-hint",children:N.prompt})]}),h?i.jsx("input",{id:E,className:"admin-input",type:N.secret?"password":"text","aria-label":`${x.id} ${N.varName}`,placeholder:N.set?N.secret?"•••••• set — type to replace":_:"not set",value:P,onChange:R=>g(x.id,N.varName,R.target.value),autoComplete:"new-password"}):i.jsx("div",{className:"admin-hint",children:N.set?N.value:"—"})]},N.varName)})}),i.jsxs("td",{children:[x.envVars.length===0?i.jsx("div",{className:"admin-hint",children:"always available"}):h?i.jsxs("div",{className:"admin-row-actions",children:[i.jsx("button",{className:"admin-mini-btn",disabled:o===x.id,onClick:()=>void y(x),children:"💾 Save"}),i.jsx("button",{className:"admin-mini-btn",disabled:o===x.id,title:"Probes the SAVED configuration — save first to test a new key",onClick:()=>void v(x),children:"🔌 Test"}),i.jsx("button",{className:"admin-mini-btn admin-mini-danger",disabled:o===x.id,onClick:()=>void k(x),children:"🗑 Remove"})]}):i.jsx("div",{className:"admin-hint",children:"read-only"}),c[x.id]?i.jsx("div",{className:"admin-row-msg",children:c[x.id]}):null]})]},x.id))})]})})]},S.cap))]})}const ble={env:"Environment",config:"Config",vault:"Vault",local:"Local (no key)",none:"Not configured"};function xle(){const[e,t]=b.useState(null),[n,r]=b.useState(!0),[a,s]=b.useState(null),[o,l]=b.useState(null),[c,u]=b.useState(!1),[d,f]=b.useState(!1),[h,p]=b.useState(""),[m,g]=b.useState(""),[y,v]=b.useState(null),[k,w]=b.useState(null),[j,S]=b.useState(""),x=qr(),[N,E]=b.useState(""),[P,_]=b.useState(""),[R,T]=b.useState(null),[B,$]=b.useState(!1),[I,D]=b.useState([]),[U,M]=b.useState(null),[z,O]=b.useState(""),[J,F]=b.useState(""),[L,ie]=b.useState("viewer"),[fe,ve]=b.useState(null),[Ee,ee]=b.useState(""),[Q,ae]=b.useState(null),[ce,G]=b.useState(!1),[xe,we]=b.useState(null),[Pe,ge]=b.useState(null),[Ie,me]=b.useState(null),[Qe,De]=b.useState([]),[_e,pt]=b.useState({}),[We,lt]=b.useState(null),[Yt,q]=b.useState({}),[Z,se]=b.useState(""),[pe,ke]=b.useState(null),[$e,zt]=b.useState(null),[Le,rn]=b.useState(null),[Mn,wt]=b.useState(null),[Mt,an]=b.useState(!1),or=b.useCallback(async()=>{r(!0),s(null);const W=await K.fetchAdminChecks();t(W),W||s("Could not reach the dashboard server, or the server is older than this panel. Run `nuvira dashboard` to start it."),r(!1)},[]),In=b.useCallback(async()=>{const W=await K.fetchAdminCatalog();W&&W.length>0&&De(W)},[]),Gn=b.useCallback(async()=>{const W=await K.fetchAdminUsers();W.ok&&W.users&&D(W.users)},[]),At=b.useCallback(async()=>{const W=await K.fetchAdminWorkspace();W&&(ve(W),ee(W.configured??""))},[]),Ft=b.useCallback(async()=>{const W=await K.fetchAdminCache();W&&we(W)},[]),lr=b.useCallback(async()=>{rn(await K.fetchOmniRouteStatus())},[]),cr=async W=>{me(W??"__none__"),ge(null);const ne=await K.clearAdminCache(W);ne.ok?(ge(`✅ Cleared ${ne.removed??0} cached answer(s) for ${W??"the no-workspace bucket"}.`),Ft()):ne.unauthorized?(pn(),ge(`❌ ${ne.error||"Session expired — log in again."}`)):ge(`❌ ${ne.error||"Could not clear the cache."}`),me(null)},zl=async W=>{W.preventDefault(),G(!0),ae(null);const ne=await K.saveAdminWorkspace(Ee.trim());ne.ok&&ne.workspace?(ve(ne.workspace),ee(ne.workspace.configured??""),ae(ne.workspace.effective?`✅ Unattached chat turns now run in ${ne.workspace.effective}`:"✅ Cleared — unattached project asks will ask you to attach a folder.")):ne.unauthorized?(pn(),ae(`❌ ${ne.error||"Session expired — log in again."}`)):ae(`❌ ${ne.error||"Could not save the workspace."}`),G(!1)};b.useEffect(()=>{let W=!0;return K.fetchAdminAuthStatus().then(ne=>{if(W){if(!ne){s("Could not reach the dashboard server, or the server is older than this panel. Run `nuvira dashboard` to start it."),r(!1);return}l({configured:ne.configured,authenticated:ne.authenticated}),u(ne.authenticated),v(ne.role??null),w(ne.user??null),f(ne.mustChangePassword===!0),ne.authenticated?(or(),In(),Gn(),At(),Ft(),lr()):r(!1)}}),()=>{W=!1}},[or,In,Gn,At,Ft,lr,x]);const Tt=y==="admin",ya=y==="admin"||y==="operator",pn=()=>{u(!1),l(W=>W&&{...W,authenticated:!1}),T("Session expired — log in again.")},Xs=async W=>{W.preventDefault(),$(!0),T(null);const ne=await K.adminLogin(j,N);ne.ok?(u(!0),l({configured:!0,authenticated:!0}),v(ne.role??"admin"),w(ne.user??null),S(""),E(""),K.fetchAdminAuthStatus().then(je=>{je&&f(je.mustChangePassword===!0)}),or(),In(),Gn(),At(),Ft()):T(ne.error||"Login failed."),$(!1)},sn=async W=>{if(W.preventDefault(),$(!0),T(null),N.length<8){T("Password must be at least 8 characters."),$(!1);return}if(N!==P){T("Passwords do not match."),$(!1);return}const ne=await K.adminSetup(j,N);ne.ok?(u(!0),l({configured:!0,authenticated:!0}),v(ne.role??"admin"),w(ne.user??null),S(""),E(""),_(""),or(),In(),Gn()):T(ne.error||"Setup failed."),$(!1)},ba=async()=>{await K.adminLogout(),u(!1),l(W=>W&&{...W,authenticated:!1}),v(null),w(null),t(null),pt({}),q({}),D([])},Kr=async()=>{if(!window.confirm("Stop the running gateway? Channels will stop responding until you restart it with `nuvira gateway start`."))return;zt("gateway"),ke(null);const W=await K.shutdown("gateway");zt(null),W.ok?ke(W.stopped?"✅ Gateway stopped.":`ℹ️ ${W.reason||"No running gateway found — nothing to stop."}`):(ke(`❌ ${W.error||"Stop failed."}`),W.unauthorized&&pn())},_r=async W=>{if(W==="stop"&&!window.confirm("Stop the OmniRoute gateway? Anything routing through it will fail until it is started again."))return;an(!0),wt(null);const ne=await K.controlOmniRoute(W);ne.status&&rn(ne.status),ne.ok?wt(`✅ ${ne.detail??(W==="stop"?"OmniRoute stopped.":"OmniRoute started.")}`):ne.unauthorized?(pn(),wt(`❌ ${ne.error||"Session expired — log in again."}`)):wt(`❌ ${ne.detail??ne.reason??ne.error??"OmniRoute control failed."}`),an(!1)},xa=async()=>{window.confirm("Shut down the dashboard? This page will disconnect and the server will exit. Restart with `nuvira dashboard`.")&&(zt("dashboard"),ke("🛑 Shutting down the dashboard — this page will disconnect…"),await K.shutdown("dashboard"),zt(null),ke("ℹ️ The dashboard server did not stop (see the server terminal). You can also stop it with `nuvira dashboard stop`."))},wa=async W=>{if(W.preventDefault(),M(null),J.length<8){M("Password must be at least 8 characters.");return}const ne=await K.addAdminUser(z,J,L);ne.ok?(O(""),F(""),M("✅ User added"),Gn()):(M(`❌ ${ne.error||"Failed to add user"}`),ne.unauthorized&&pn())},qn=async W=>{if(!window.confirm(`Remove dashboard user '${W}'?`))return;M(null);const ne=await K.removeAdminUser(W);ne.ok?(M(`✅ Removed ${W}`),Gn()):(M(`❌ ${ne.error||"Failed to remove user"}`),ne.unauthorized&&pn())},Gi=(W,ne,je)=>{pt(Se=>({...Se,[W]:{...Se[W]||{},[ne]:je}}))},qi=async W=>{lt(W),q({});const ne=_e[W]||{},je=await K.saveProvider(W,ne);je.ok?(t(Se=>{if(!Se)return Se;const Kn=Se.providers.some(En=>En.type===W)?Se.providers.map(En=>En.type===W&&je.provider?je.provider:En):je.provider?[...Se.providers,je.provider]:Se.providers;return{...Se,providers:Kn}}),pt(Se=>{const on={...Se};return delete on[W],on}),q(Se=>({...Se,[W]:"✅ Saved"}))):(q(Se=>({...Se,[W]:`❌ ${je.error||"Save failed"}`})),je.unauthorized&&pn()),lt(null)},Qs=async W=>{if(!window.confirm(`Remove ${W}'s API key and configuration? This cannot be undone.`))return;lt(W),q({});const ne=await K.deleteProvider(W);ne.ok?ne.envSourced?(t(je=>je&&{...je,providers:je.providers.map(Se=>Se.type===W&&ne.provider||Se)}),q(je=>({...je,[W]:`⚠️ Key comes from ${ne.envVar?`$${ne.envVar}`:"an env var"} — unset it there to remove it (config can't override the env).`}))):(t(je=>je&&{...je,providers:je.providers.filter(Se=>Se.type!==W)}),pt(je=>{const Se={...je};return delete Se[W],Se})):(q(je=>({...je,[W]:`❌ ${ne.error||"Remove failed"}`})),ne.unauthorized&&pn()),lt(null)},Qa=async(W,ne)=>{lt(W),q({});const je=await K.saveProvider(W,{enabled:ne});je.ok?(t(Se=>{if(!Se)return Se;const Kn=Se.providers.some(En=>En.type===W)?Se.providers.map(En=>En.type===W&&je.provider?je.provider:En):je.provider?[...Se.providers,je.provider]:Se.providers;return{...Se,providers:Kn}}),q(Se=>({...Se,[W]:ne?"✅ Routing ON":"⏸ Routing OFF (pin only)"}))):(q(Se=>({...Se,[W]:`❌ ${je.error||"Toggle failed"}`})),je.unauthorized&&pn()),lt(null)},et=async W=>{lt(W);const ne=await K.testProvider(W);q(je=>{var Se;return{...je,[W]:ne.ok?`✅ Connected — ${((Se=ne.models)==null?void 0:Se.length)??0} model(s) reachable`:`❌ ${ne.error||"Connection failed"}`}}),lt(null)},Zs=()=>{Z&&(pt(W=>({...W,[Z]:{}})),se(""))};if(a&&!o)return i.jsxs("div",{className:"admin-header",children:[i.jsx(Oe,{icon:"🛠️",title:"Admin"}),i.jsx("div",{className:"admin-error",children:a})]});if(!o||!c&&n)return i.jsxs("div",{className:"admin-header",children:[i.jsx(Oe,{icon:"🛠️",title:"Admin"}),i.jsxs("div",{className:"loading-state",children:[i.jsx("div",{className:"loading-spinner"}),i.jsx("p",{children:"Loading…"})]})]});if(!c){const W=!o.configured;return i.jsxs("div",{className:"admin-header",children:[i.jsx(Oe,{icon:"🛠️",title:`Admin — ${W?"Set up access":"Log in"}`}),i.jsx("p",{className:"admin-subtitle",children:W?"Create the admin user-id and password that gate the dashboard write surface (API-key/provider configuration). The CLI keeps working exactly as before — this only guards the GUI.":"The write surface (API-key/provider configuration) is gated by the admin credentials. Read-only checks stay open."}),i.jsxs("form",{className:"admin-gate-form",onSubmit:W?sn:Xs,children:[i.jsxs("label",{children:[i.jsx("span",{children:"Username"}),i.jsx("input",{type:"text",value:j,onChange:ne=>S(ne.target.value),autoComplete:"username",placeholder:"admin"})]}),i.jsxs("label",{children:[i.jsx("span",{children:"Password"}),i.jsx("input",{type:"password",value:N,onChange:ne=>E(ne.target.value),autoComplete:W?"new-password":"current-password",placeholder:"••••••••"})]}),W?i.jsxs("label",{children:[i.jsx("span",{children:"Confirm password"}),i.jsx("input",{type:"password",value:P,onChange:ne=>_(ne.target.value),autoComplete:"new-password",placeholder:"••••••••"})]}):null,R?i.jsx("div",{className:"admin-error",children:R}):null,i.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:B||!j||!N,children:B?"⏳ …":W?"🔐 Create admin":"🔐 Log in"}),W?i.jsxs("p",{className:"admin-hint",children:["Automation alternative: set ",i.jsx("code",{children:"NUVIRA_DASHBOARD_ADMIN_USER"})," and"," ",i.jsx("code",{children:"NUVIRA_DASHBOARD_ADMIN_PASSWORD"})," in the dashboard's environment."]}):null]})]})}if(d){const W=h.length>0&&h.length<8,ne=m.length>0&&m!==h,je=async Se=>{if(Se.preventDefault(),W||ne||!h)return;$(!0),T(null);const on=await K.changeAdminPassword(N,h);on.ok?(f(!1),E(""),p(""),g(""),or(),In(),Gn()):T(on.error||"Could not change the password."),$(!1)};return i.jsxs("div",{className:"admin-header",children:[i.jsx(Oe,{icon:"🔐",title:"Set your own password"}),i.jsxs("p",{className:"admin-subtitle",children:["This dashboard is running on its ",i.jsx("strong",{children:"published default password"}),", so anyone who can reach this port can sign in. Until you replace it, the agent will refuse to save anything — API keys, provider settings, users."]}),i.jsxs("form",{className:"admin-gate-form",onSubmit:je,children:[i.jsxs("label",{children:[i.jsx("span",{children:"Current password"}),i.jsx("input",{type:"password",value:N,onChange:Se=>E(Se.target.value),autoComplete:"current-password",placeholder:"admin"})]}),i.jsxs("label",{children:[i.jsx("span",{children:"New password"}),i.jsx("input",{type:"password",value:h,onChange:Se=>p(Se.target.value),autoComplete:"new-password",placeholder:"at least 8 characters"})]}),W?i.jsx("div",{className:"admin-error",children:"Use at least 8 characters."}):null,i.jsxs("label",{children:[i.jsx("span",{children:"Confirm new password"}),i.jsx("input",{type:"password",value:m,onChange:Se=>g(Se.target.value),autoComplete:"new-password",placeholder:"repeat it"})]}),ne?i.jsx("div",{className:"admin-error",children:"The two passwords do not match."}):null,R?i.jsx("div",{className:"admin-error",children:R}):null,i.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:B||!N||!h||W||ne,children:B?"⏳ …":"🔐 Save new password"})]})]})}const ka=(e==null?void 0:e.system.filter(W=>W.status==="pass").length)??0,Sa=(e==null?void 0:e.system.filter(W=>W.status==="warn").length)??0,Za=(e==null?void 0:e.system.filter(W=>W.status==="fail").length)??0,Ki=(e==null?void 0:e.enterprise.filter(W=>W.status==="pass").length)??0,Ja=(e==null?void 0:e.enterprise.filter(W=>W.status==="warn").length)??0,Vi=(e==null?void 0:e.enterprise.filter(W=>W.status==="fail").length)??0,Yi=(e==null?void 0:e.providers)??[],Vr=Object.keys(_e).filter(W=>!Yi.some(ne=>ne.type===W)),Cr=[...Yi,...Vr.map(W=>({type:W,configured:!1,keySource:"none",keyMasked:null}))],ja=W=>{const ne=Qe.find(je=>je.id===W);return ne||{label:W}};return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"admin-header",children:[i.jsx(Oe,{icon:"🛠️",title:i.jsxs(i.Fragment,{children:["Admin — Command Runner & Configuration",k?i.jsxs("span",{className:`admin-role-badge admin-role-${y||"viewer"}`,children:[" ",k," · ",y||"viewer"]}):null]})}),i.jsxs("div",{className:"admin-header-actions",children:[i.jsx("button",{className:"admin-refresh-btn",onClick:()=>void or(),disabled:n,children:n?"⏳ Running checks…":"🔄 Refresh (run all commands)"}),Tt||y==="operator"?i.jsx("button",{className:"admin-logout-btn",onClick:()=>void Kr(),disabled:$e!==null,title:"Stop the running gateway (nuvira gateway stop)",children:$e==="gateway"?"⏳ Stopping…":"⏻ Stop gateway"}):null,Tt?i.jsx("button",{className:"admin-logout-btn",onClick:()=>void xa(),disabled:$e!==null,title:"Shut down this dashboard server (nuvira dashboard stop)",children:$e==="dashboard"?"⏳ Stopping…":"🛑 Stop dashboard"}):null,i.jsx("button",{className:"admin-logout-btn",onClick:()=>void ba(),children:"🚪 Log out"})]})]}),pe?i.jsx("div",{className:"admin-error",children:pe}):null,Tt?null:i.jsxs("div",{className:"admin-readonly-note",children:["🔒 Your role (",i.jsx("code",{children:y||"viewer"}),") is read-only here — provider configuration and user management require the ",i.jsx("code",{children:"admin"})," role. The CLI enforces the same governance policy (rbac.json)."]}),i.jsx("p",{className:"admin-subtitle",children:"The dashboard executes the same state commands as the CLI — no command needed. Provider keys are masked here and every write goes through the same config the CLI uses."}),a?i.jsx("div",{className:"admin-error",children:a}):null,e?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"admin-summary-grid",children:[i.jsxs("div",{className:"admin-summary-card admin-summary-pass",children:[i.jsx("div",{className:"admin-summary-value",children:ka+Ki}),i.jsx("div",{className:"admin-summary-label",children:"✅ Passing"})]}),i.jsxs("div",{className:"admin-summary-card admin-summary-warn",children:[i.jsx("div",{className:"admin-summary-value",children:Sa+Ja}),i.jsx("div",{className:"admin-summary-label",children:"⚠️ Warnings"})]}),i.jsxs("div",{className:"admin-summary-card admin-summary-fail",children:[i.jsx("div",{className:"admin-summary-value",children:Za+Vi}),i.jsx("div",{className:"admin-summary-label",children:"❌ Failing"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:Cr.length}),i.jsx("div",{className:"admin-summary-label",children:"Providers"})]})]}),Tt?i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"👥 Dashboard Users (role.manage)"}),i.jsxs("div",{className:"admin-users-list",children:[I.map(W=>i.jsxs("div",{className:"admin-user-row",children:[i.jsx("span",{className:"admin-user-name",children:W.user}),i.jsx("span",{className:`admin-role-badge admin-role-${W.role}`,children:W.role}),i.jsxs("span",{className:"admin-user-since",children:["since ",new Date(W.createdAt).toLocaleDateString()]}),W.user!==k?i.jsx("button",{className:"admin-mini-btn admin-mini-danger",onClick:()=>void qn(W.user),children:"🗑 Remove user"}):i.jsx("span",{className:"admin-hint",children:"you"})]},W.user)),I.length===0?i.jsx("div",{className:"empty-state",children:"No dashboard users yet."}):null]}),i.jsxs("form",{className:"admin-gate-form admin-user-form",onSubmit:wa,children:[i.jsxs("label",{children:[i.jsx("span",{children:"Username"}),i.jsx("input",{type:"text",value:z,onChange:W=>O(W.target.value),autoComplete:"off"})]}),i.jsxs("label",{children:[i.jsx("span",{children:"Password (min 8 chars)"}),i.jsx("input",{type:"password",value:J,onChange:W=>F(W.target.value),autoComplete:"new-password"})]}),i.jsxs("label",{children:[i.jsx("span",{children:"Role"}),i.jsxs("select",{value:L,onChange:W=>ie(W.target.value),children:[i.jsx("option",{value:"viewer",children:"viewer — read-only"}),i.jsx("option",{value:"operator",children:"operator — read-only in the dashboard today"}),i.jsx("option",{value:"admin",children:"admin — full control"})]})]}),U?i.jsx("div",{className:"admin-row-msg",children:U}):null,i.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:!z||!J,children:"➕ Add user"})]})]}):null,Tt||y==="operator"?i.jsxs("div",{className:"admin-omniroute",children:[i.jsxs("h2",{className:"section-subtitle",children:["🔀 External gateway: OmniRoute (port ",(Le==null?void 0:Le.port)??20128,")"]}),i.jsxs("p",{className:"admin-hint",children:["OmniRoute is a separate local process nuvira does not embed. The provider row below decides whether agent-nuvira ",i.jsx("em",{children:"routes"})," to it; this controls whether the gateway itself is up. A 401 from its API still counts as running."]}),i.jsxs("div",{className:"admin-omniroute-row",children:[i.jsx("span",{className:`admin-check-badge ${Le!=null&&Le.reachable?"admin-check-pass":"admin-check-warn"}`,children:Le===null?"… checking":Le.reachable?"✅ Reachable":Le.running?"⚠️ Process up, not answering":"❌ Not running"}),i.jsxs("span",{className:"admin-hint",children:[(Le==null?void 0:Le.detail)??"Probing…"," · ",(Le==null?void 0:Le.baseUrl)??"http://127.0.0.1:20128/v1",(Le==null?void 0:Le.pid)!=null?` · PID ${Le.pid}`:""]}),i.jsx("button",{className:"admin-mini-btn",disabled:Mt,onClick:()=>void _r("start"),title:"Run `omniroute` in the background and wait until it answers",children:"▶ Start"}),i.jsx("button",{className:"admin-mini-btn admin-mini-danger",disabled:Mt||!(Le!=null&&Le.running),onClick:()=>void _r("stop"),title:"SIGTERM the running OmniRoute gateway",children:"⏹ Stop"}),i.jsx("button",{className:"admin-mini-btn",disabled:Mt,onClick:()=>void lr(),children:"⟳ Recheck"})]}),Mn?i.jsx("div",{className:"admin-row-msg",children:Mn}):null]}):null,i.jsx("h2",{className:"section-subtitle",children:"🔑 Provider Configuration (keys masked)"}),i.jsx("div",{className:"admin-table-wrapper",children:i.jsxs("table",{className:"admin-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Provider"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Key"}),i.jsx("th",{children:"Base URL"}),i.jsx("th",{children:"Model"}),i.jsx("th",{children:"Actions"})]})}),i.jsxs("tbody",{children:[Cr.map(W=>{const ne=ja(W.type),je=_e[W.type]||{},Se=W.type==="bedrock";return i.jsxs("tr",{children:[i.jsxs("td",{className:"admin-provider-type",children:[ne.icon?`${ne.icon} `:"",ne.label,i.jsxs("div",{className:"admin-provider-sub",children:[W.type," · ",ble[W.keySource]||W.keySource]}),W.keySource==="env"?i.jsxs("div",{className:"admin-hint",children:["comes from ",ne.envVar||"env var"," — change it there, config can't override it"]}):W.keySource==="vault"?i.jsx("div",{className:"admin-hint",children:"stored in the OS keyring (vault)"}):null,ne.description?i.jsx("div",{className:"admin-provider-desc",children:ne.description}):null,ne.setup?i.jsxs("div",{className:"admin-provider-setup",children:[i.jsx("strong",{children:"Setup:"})," ",ne.setup]}):null]}),i.jsxs("td",{children:[i.jsx("span",{className:`admin-check-badge ${W.configured?"admin-check-pass":"admin-check-warn"}`,children:W.configured?"✅ Configured":"⚠️ Not configured"}),W.enabled===!1?i.jsx("span",{className:"admin-check-badge admin-check-warn",title:"Kept out of automatic routing; an explicit --provider pin still reaches it",children:"⏸ Off (pin only)"}):null]}),i.jsx("td",{children:Se?i.jsxs("div",{className:"admin-hint",children:["Configured on the ",i.jsx("a",{href:"/bedrock",children:"AWS Bedrock page"})," — region, auth (bearer / IAM), and model-access approval live there, not here."]}):ne.keyless?i.jsx("div",{className:"admin-hint",children:"No key needed (probed)"}):Tt?i.jsx("input",{className:"admin-input admin-key-input",type:"password","aria-label":`${W.type} API key`,placeholder:W.keyMasked||"set a new key…",value:je.apiKey??"",onChange:on=>Gi(W.type,"apiKey",on.target.value),autoComplete:"new-password"}):i.jsx("div",{className:"admin-hint",children:W.keyMasked||"—"})}),i.jsx("td",{children:Tt?i.jsx("input",{className:"admin-input",type:"text","aria-label":`${W.type} base URL`,placeholder:W.baseUrl||"default endpoint",value:je.baseUrl??"",onChange:on=>Gi(W.type,"baseUrl",on.target.value)}):i.jsx("div",{className:"admin-hint",children:W.baseUrl?W.baseUrl.replace(/^https?:\/\/(?:[^@/]*@)?/,""):"default endpoint"})}),i.jsx("td",{children:Tt?i.jsx("input",{className:"admin-input",type:"text","aria-label":`${W.type} model`,placeholder:W.model||"default model",value:je.model??"",onChange:on=>Gi(W.type,"model",on.target.value)}):i.jsx("div",{className:"admin-hint",children:W.model||"default model"})}),i.jsx("td",{children:Tt?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"admin-row-actions",children:[i.jsx("button",{className:"admin-mini-btn",disabled:We===W.type,title:"Include this provider in automatic routing, or keep it off and pin it explicitly",onClick:()=>void Qa(W.type,W.enabled===!1),children:W.enabled===!1?"▶ Turn on":"⏸ Turn off"}),i.jsx("button",{className:"admin-mini-btn",disabled:We===W.type,onClick:()=>void qi(W.type),children:"💾 Save"}),i.jsx("button",{className:"admin-mini-btn",disabled:We===W.type,title:"Tests the SAVED configuration — save first to test a new key",onClick:()=>void et(W.type),children:"🔌 Test"}),i.jsx("button",{className:"admin-mini-btn admin-mini-danger",disabled:We===W.type,onClick:()=>void Qs(W.type),children:"🗑 Remove"})]}),Yt[W.type]?i.jsx("div",{className:"admin-row-msg",children:Yt[W.type]}):null]}):i.jsx("div",{className:"admin-hint",children:"read-only"})})]},W.type)}),Cr.length===0?i.jsx("tr",{children:i.jsx("td",{colSpan:6,className:"admin-empty-cell",children:"No providers configured yet."})}):null]})]})}),Tt&&Qe.length>0?i.jsxs("div",{className:"admin-add-provider",children:[i.jsxs("select",{className:"admin-input",value:Z,onChange:W=>se(W.target.value),children:[i.jsx("option",{value:"",children:"Add a provider…"}),Qe.filter(W=>!Cr.some(ne=>ne.type===W.id)).map(W=>i.jsxs("option",{value:W.id,children:[W.icon?`${W.icon} `:"",W.label," (",W.id,")"]},W.id))]}),i.jsx("button",{className:"admin-mini-btn",disabled:!Z,onClick:Zs,children:"➕ Add"})]}):null,i.jsx("h2",{className:"section-subtitle",children:"📁 Workspace (chat turns with no attached folder)"}),i.jsx("p",{className:"admin-hint",children:"A chat turn runs against a directory. An attached folder always wins; with none attached, this is where the turn lands. Leave it empty and an ask that needs a project — an assessment, a file, an image — asks you to attach a folder instead of scanning the server's own working directory."}),i.jsxs("form",{className:"admin-gate-form",onSubmit:zl,children:[i.jsxs("label",{children:[i.jsx("span",{children:"Working directory"}),i.jsx("input",{type:"text",value:Ee,onChange:W=>ee(W.target.value),placeholder:"/Users/you/Documents/my-project",disabled:ce||!c||!ya})]}),fe?i.jsxs("p",{className:"admin-hint",children:[fe.effective?i.jsxs(i.Fragment,{children:["Effective: ",i.jsx("code",{children:fe.effective})]}):i.jsxs(i.Fragment,{children:["Not set — unattached project asks will ask for a folder (server cwd: ",i.jsx("code",{children:fe.processCwd}),")"]}),fe.configured&&!fe.configuredValid?" ⚠️ The saved path no longer exists and is being ignored.":""]}):null,Q?i.jsx("div",{className:"admin-row-msg",children:Q}):null,ya?i.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:ce||!c,children:ce?"⏳ Saving…":"💾 Save workspace"}):i.jsx("span",{className:"admin-hint",children:"🔒 Changing the workspace requires admin or operator."})]}),i.jsx("h2",{className:"section-subtitle",children:"🧠 Response Cache (answers by workspace)"}),i.jsx("p",{className:"admin-hint",children:"The cache is keyed by the folder an answer was produced in. If a project has changed and an ask replays an old answer, clear that project — every other project keeps its cached answers."}),Pe?i.jsx("div",{className:"admin-row-msg",children:Pe}):null,xe&&xe.workspaces.length>0?i.jsx("div",{className:"admin-table-wrapper",children:i.jsxs("table",{className:"admin-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Workspace"}),i.jsx("th",{children:"Answers"}),i.jsx("th",{children:"Newest"}),i.jsx("th",{children:"Models"}),i.jsx("th",{children:"Sample"}),i.jsx("th",{})]})}),i.jsx("tbody",{children:xe.workspaces.map(W=>{var ne;return i.jsxs("tr",{children:[i.jsx("td",{className:"admin-provider-type",children:W.scope?i.jsx("code",{children:W.scope}):i.jsx("em",{children:"no workspace attached"})}),i.jsx("td",{children:W.count}),i.jsx("td",{className:"admin-hint",children:new Date(W.newestAt).toLocaleString()}),i.jsxs("td",{className:"admin-hint",children:[W.models.slice(0,2).join(", "),W.models.length>2?` +${W.models.length-2}`:""]}),i.jsx("td",{className:"admin-hint",children:((ne=W.samples[0])==null?void 0:ne.prompt)??""}),i.jsx("td",{children:i.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:Ie!==null||!ya,onClick:()=>void cr(W.scope),children:Ie===(W.scope??"__none__")?"⏳ …":"🗑 Clear"})})]},W.scope??"__none__")})})]})}):i.jsx("div",{className:"empty-state",children:"No cached answers — every turn reached a model."}),xe&&xe.total>0?i.jsxs("p",{className:"admin-hint",children:[xe.total," cached answer",xe.total===1?"":"s"," across"," ",xe.workspaces.length," workspace",xe.workspaces.length===1?"":"s","."]}):null,i.jsx(yle,{authed:c,role:y||"viewer"}),i.jsx(mle,{authed:c,role:y||"viewer"}),i.jsx("h2",{className:"section-subtitle",children:"⚙️ System Checks (nuvira doctor)"}),i.jsx("div",{className:"admin-check-list",children:e.system.map(W=>i.jsx(qb,{check:W},W.name))}),i.jsx("h2",{className:"section-subtitle",children:"🏥 Enterprise Self-Check (doctor --enterprise)"}),i.jsx("div",{className:"admin-check-list",children:e.enterprise.length>0?e.enterprise.map(W=>i.jsx(qb,{check:W},W.name)):i.jsx("div",{className:"empty-state",children:"No enterprise checks returned."})})]}):n?i.jsxs("div",{className:"loading-state",children:[i.jsx("div",{className:"loading-spinner"}),i.jsx("p",{children:"Running all state checks…"})]}):null]})}function jM(e){return String(e??"").replace(/\d{3,}/g,t=>t.slice(0,2)+"***")}const wle={idle:"Not paired",pairing:"⏳ Pairing…",paired:"✅ Paired",failed:"❌ Pairing failed",cancelled:"⏹ Cancelled",error:"💥 Pairing error"};function kle({authed:e,canWrite:t,sessionExpired:n,reveal:r=!1}){const[a,s]=b.useState(null),[o,l]=b.useState({}),[c,u]=b.useState(""),[d,f]=b.useState(!1),[h,p]=b.useState(null),m=b.useRef(null),g=b.useCallback(async()=>{const x=await K.getWhatsAppStatus();x&&(s(x.status),l(x.contacts??{}))},[]);b.useEffect(()=>{if(g(),!e||typeof EventSource>"u")return;const x=K.subscribeWhatsApp({onQr:N=>s(E=>E&&{...E,qr:N,state:"pairing"}),onCode:N=>s(E=>E&&{...E,pairingCode:N}),onStatus:N=>{s(N),(N.state==="paired"||N.state==="failed"||N.state==="error"||N.state==="cancelled")&&f(!1)}});return m.current=x,()=>{x(),m.current=null}},[e,g]);const y=async x=>{f(!0),p(null);const N=await x();if(!N.ok&&N.error&&/Not authenticated|Session expired/i.test(N.error)){n(),f(!1);return}N.ok?(p({kind:"ok",text:"Done."}),await g()):p({kind:"err",text:N.error||"Action failed."}),f(!1)},v=x=>{p(null),y(()=>K.startWhatsAppPair(x?c.trim():void 0)).then(()=>u(""))},k=()=>{p(null),y(()=>K.cancelWhatsAppPair())},w=()=>{window.confirm("Remove the paired WhatsApp session from this machine? You will need to scan a QR to pair again.")&&(p(null),y(()=>K.unpairWhatsApp()))},j=(a==null?void 0:a.state)??"idle",S=j==="pairing";return i.jsxs("div",{className:"wa-panel",children:[i.jsxs("div",{className:"wa-panel-head",children:[i.jsx("span",{className:"wa-panel-title",children:"🟢 WhatsApp bridge"}),a?i.jsx("span",{className:`wa-badge ${a.paired?"wa-badge-paired":S?"wa-badge-pairing":""}`,children:wle[j]}):i.jsx("span",{className:"admin-hint",children:"loading…"})]}),i.jsxs("p",{className:"admin-hint",children:["The personal Baileys bridge (no Meta Business account) — pair once, and the gateway can send & receive WhatsApp. Session: ",i.jsx("code",{children:(a==null?void 0:a.sessionDir)??"~/.nuvira/whatsapp/session"}),". Same engine as"," ",i.jsx("code",{children:"nuvira whatsapp pair"}),"."]}),S?i.jsxs("div",{className:"wa-pairing",children:[a!=null&&a.qr?i.jsxs("div",{className:"wa-qr-box",children:[i.jsx("img",{className:"wa-qr-img",src:a.qr,alt:"WhatsApp pairing QR code"}),i.jsxs("p",{className:"admin-hint",children:["Open WhatsApp on the phone → ",i.jsx("strong",{children:"Linked devices → Link a device → scan"}),". The QR refreshes automatically while this window is open."]})]}):a!=null&&a.phone?i.jsxs("div",{className:"wa-code-box",children:[i.jsxs("p",{className:"admin-hint",children:["On the phone with ",i.jsx("strong",{children:a.phone}),": WhatsApp → Linked devices → Link a device →"," ",i.jsx("strong",{children:"“Link with phone number instead”"})," → enter:"]}),i.jsx("div",{className:"wa-code",children:a.pairingCode??"… waiting for code"})]}):i.jsx("div",{className:"wa-code-box",children:i.jsx("p",{className:"admin-hint",children:"Waiting for WhatsApp to hand over a QR… (it usually appears within a few seconds)"})}),a!=null&&a.phone?null:i.jsxs("div",{className:"admin-hint",children:["Tip: on a phone, “Link with phone number instead” needs the number format"," ",i.jsx("code",{children:"918844433322"})," (country code included) — enter it below instead of scanning."]}),a!=null&&a.error?i.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:a.error}):null,t&&e?i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:k,disabled:d,children:d?"⏳…":"⏹ Cancel pairing"}):null]}):i.jsxs("div",{className:"wa-actions",children:[t&&e?a!=null&&a.paired?i.jsxs("div",{className:"wa-action-row",children:[i.jsx("button",{className:"admin-refresh-btn wa-unpair-btn",type:"button",onClick:w,disabled:d,children:d?"⏳…":"🗑 Unpair (remove session)"}),i.jsx("span",{className:"admin-hint",children:"Removes creds.json — you will need to scan a QR again."})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"wa-action-row",children:[i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>v(!1),disabled:d,children:d?"⏳…":"🔳 Pair with a QR"}),i.jsx("span",{className:"admin-hint",children:"Scans from the phone you want to link."})]}),i.jsxs("div",{className:"wa-action-row wa-phone-row",children:[i.jsx("input",{type:"text",className:"wa-phone-input",value:c,onChange:x=>u(x.target.value),placeholder:"or pair with a number — e.g. 918844433322",disabled:d,maxLength:16}),i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>v(!0),disabled:d||!c.trim(),children:"Pair by number"})]})]}):null,j==="failed"||j==="error"||j==="cancelled"?i.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:(a==null?void 0:a.error)||(j==="cancelled"?"Pairing cancelled.":"Pairing failed — try again.")}):null,e?t?null:i.jsx("div",{className:"admin-row-msg",children:"Your role can view pairing status but not change it (requires admin or operator)."}):i.jsx("div",{className:"admin-row-msg",children:"Log in (admin or operator) to pair, cancel, or unpair."}),h?i.jsx("div",{className:`admin-row-msg${h.kind==="ok"?"":" admin-row-msg-err"}`,children:h.text}):null]}),i.jsxs("div",{className:"wa-contacts",children:[i.jsxs("div",{className:"wa-contacts-head",children:[i.jsx("span",{className:"wa-panel-title",children:"📇 Send-by-name contacts"}),i.jsxs("span",{className:"admin-hint",children:[Object.keys(o).length," mapped"]})]}),i.jsxs("p",{className:"admin-hint",children:["These names are for ",i.jsx("strong",{children:"sending messages by name"})," (e.g."," ",i.jsx("code",{children:'nuvira gateway send whatsapp:Name "…"'}),") — they do"," ",i.jsx("strong",{children:"NOT"})," let these numbers trigger the agent."]}),i.jsx("div",{className:"hub-alias-list",children:Object.keys(o).length===0?i.jsxs("span",{className:"admin-hint",children:["(none — add one with ",i.jsx("code",{children:"nuvira whatsapp contact add <Name> <number>"}),")"]}):Object.entries(o).map(([x,N])=>i.jsxs("div",{className:"hub-alias-row",children:[i.jsx("span",{className:"hub-chip",children:x}),i.jsxs("span",{className:"admin-hint",children:["→ ",r?N:jM(N)]})]},x))}),i.jsxs("p",{className:"admin-hint",style:{marginTop:8},children:["To let a number ",i.jsx("strong",{children:"trigger the agent"})," (respond to its messages), add it to the"," ",i.jsx("strong",{children:"verified list"})," in the ",i.jsx("strong",{children:"Permissions tab above"}),", or run"," ",i.jsx("code",{children:"nuvira config gateway allow whatsapp user <number>"}),"."]})]})]})}function Sle({canWrite:e,sessionExpired:t,mode:n="grid"}){const[r,a]=b.useState(null),[s,o]=b.useState(null),[l,c]=b.useState(null),[u,d]=b.useState(null),[f,h]=b.useState(null),[p,m]=b.useState(0),[g,y]=b.useState({}),[v,k]=b.useState(!1),[w,j]=b.useState(null),S=b.useRef(!0),x=b.useCallback(async()=>{const B=await K.getPlatformConfigs();S.current&&a(B)},[t]);b.useEffect(()=>(x(),()=>{S.current=!1}),[x]);const N=async(B,$)=>{c(B),d(null);const I=await K.setPlatformConfig(B,$);if(S.current){if(c(null),I.unauthorized||I.forbidden){t(I.error);return}d({kind:I.ok?"ok":"err",text:I.ok?"Saved — transport active.":I.error||"Save failed."}),I.ok&&(o(null),x())}},E=async B=>{if(!window.confirm(`Remove ${B} transport config? Tokens will be deleted from ~/.nuvira/.env.`))return;c(B),d(null);const $=await K.removePlatformConfig(B);if(S.current){if(c(null),$.unauthorized||$.forbidden){t($.error);return}d({kind:$.ok?"ok":"err",text:$.ok?"Removed.":$.error||"Remove failed."}),$.ok&&x()}},P={telegram:{steps:["Open Telegram and search for @BotFather","Send /newbot to BotFather and follow the prompts",'Give your bot a name (e.g. "My Agent Bot")','Give your bot a username (must end with "bot", e.g. "my_agent_bot")',"BotFather will give you a token — paste it in the field below","Open your bot in Telegram and send it a message (e.g. /start)"],postSetup:["Start the gateway: nuvira gateway start (or from the Gateway tab)","Open your bot in Telegram and send a message — the agent replies!"]},discord:{steps:["Go to https://discord.com/developers/applications",'Click "New Application" → give it a name → Create','Go to "Bot" in the left sidebar → click "Add Bot"','Under "Token", click "Copy" to copy the bot token','Enable "Message Content Intent" under Privileged Gateway Intents',"Invite the bot to your server with the OAuth2 URL generator"],postSetup:["Start the gateway: nuvira gateway start","Mention the bot in a Discord channel or send it a DM","The agent will reply automatically!"]},slack:{steps:["Go to https://api.slack.com/apps",'Click "Create New App" → "From scratch"',"Add Bot Token Scopes: chat:write, im:read, im:write","Install the app to your workspace","Copy the Bot User OAuth Token (starts with xoxb-)"],postSetup:["Start the gateway: nuvira gateway start","DM the bot or mention it in a channel","The agent will reply automatically!"]},email:{steps:["You need an SMTP relay (Gmail, SendGrid, Mailgun, etc.)","For Gmail: use smtp.gmail.com:587 with an App Password","For SendGrid/Mailgun: get SMTP credentials from their dashboard"],postSetup:["Start the gateway: nuvira gateway start","Send an email to the configured address","The agent will reply via email!"]}},_=B=>{e&&(h(B),m(0),y(Object.fromEntries(B.envVars.map($=>[$.varName,$.value]))),j(null))},R=async()=>{if(!f||!e)return;k(!0),j(null);const B=await K.setPlatformConfig(f.platform,g);if(k(!1),B.unauthorized||B.forbidden){t(B.error);return}B.ok?(j({kind:"ok",text:"✅ Token saved! The transport is now active."}),x()):j({kind:"err",text:B.error||"Save failed."})};if(r===null)return i.jsx("div",{className:"empty-state",children:"Loading platform transports…"});const T=f?P[f.platform]:null;return n==="table"?i.jsxs(i.Fragment,{children:[f&&T?i.jsx("div",{className:"wizard-overlay",onClick:()=>h(null),children:i.jsxs("div",{className:"wizard-modal",onClick:B=>B.stopPropagation(),children:[i.jsxs("div",{className:"wizard-header",children:[i.jsx("span",{className:"wizard-icon",children:"🚀"}),i.jsxs("span",{className:"wizard-title",children:["Getting Started: ",f.label]}),i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>h(null),children:"✕"})]}),i.jsx("div",{className:"wizard-body",children:p===0?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"wizard-section-title",children:"📋 Steps to create your bot:"}),i.jsx("ol",{className:"wizard-steps",children:T.steps.map((B,$)=>i.jsx("li",{children:B},$))}),i.jsxs("div",{className:"wizard-nav",children:[i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>m(1),children:"I have my token →"}),f.setupUrl?i.jsx("a",{href:f.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"📖 Docs"}):null]})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"wizard-section-title",children:"🔑 Paste your token:"}),f.envVars.map(B=>i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:B.prompt}),i.jsx("input",{type:B.secret?"password":"text",value:g[B.varName]??"",onChange:$=>y(I=>({...I,[B.varName]:$.target.value})),placeholder:B.secret?"••••••••":"value",autoComplete:"off",spellCheck:!1,autoFocus:!0})]},B.varName)),w?i.jsx("div",{className:`admin-row-msg${w.kind==="ok"?"":" admin-row-msg-err"}`,children:w.text}):null,i.jsxs("div",{className:"wizard-nav",children:[i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>m(0),children:"← Back"}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void R(),disabled:v||!e,children:v?"⏳ Saving…":"💾 Save token"})]}),(w==null?void 0:w.kind)==="ok"?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"wizard-section-title",children:"📋 Next steps:"}),i.jsx("ol",{className:"wizard-steps",children:T.postSetup.map((B,$)=>i.jsx("li",{children:B},$))})]}):null]})})]})}):null,u?i.jsx("div",{className:`admin-row-msg${u.kind==="ok"?"":" admin-row-msg-err"}`,children:u.text}):null,i.jsx("div",{className:"platform-config-table-wrapper",children:i.jsxs("table",{className:"platform-config-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Platform"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Configuration"}),i.jsx("th",{children:"CLI Command"})]})}),i.jsx("tbody",{children:r.map(B=>i.jsxs(X.Fragment,{children:[i.jsxs("tr",{className:`platform-config-row ${B.configured?"configured":""}`,children:[i.jsxs("td",{className:"platform-config-name",children:[i.jsx("span",{className:"hub-platform-label",children:B.label}),i.jsx("span",{className:"hub-card-id",children:B.platform})]}),i.jsxs("td",{children:[i.jsx("span",{className:`status-dot ${B.configured?"connected":"reconnecting"}`}),i.jsx("span",{className:"platform-config-status-text",children:B.configured?"Active":"Not configured"})]}),i.jsxs("td",{className:"platform-config-actions",children:[B.configured?null:i.jsx("button",{type:"button",className:"wizard-start-btn",onClick:()=>_(B),disabled:!e,children:"🚀 Getting Started"}),B.setupUrl?i.jsx("a",{href:B.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"📖 Docs"}):null,i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>o(s===B.platform?null:B.platform),disabled:!e,children:s===B.platform?"▴ Close":B.configured?"✎ Edit":"⚙ Configure"}),B.configured?i.jsx("button",{type:"button",className:"admin-mini-btn contact-delete-btn",onClick:()=>void E(B.platform),disabled:!e,children:"🗑️"}):null]}),i.jsx("td",{className:"platform-config-cli",children:i.jsxs("code",{children:["nuvira gateway setup ",B.platform]})})]}),s===B.platform?i.jsx("tr",{className:"platform-config-expanded",children:i.jsx("td",{colSpan:4,children:i.jsxs("div",{className:"platform-config-form",children:[B.envVars.map($=>i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:$.prompt}),i.jsx("input",{type:$.secret?"password":"text",value:$.value,readOnly:!0,className:"platform-config-readonly",placeholder:$.secret?"••••••••":"value"})]},$.varName)),i.jsxs("p",{className:"admin-hint",children:["Tokens are in ",i.jsx("code",{children:"~/.nuvira/.env"})," — edit there or use the wizard above."]})]})})}):null]},B.platform))})]})})]}):i.jsxs(i.Fragment,{children:[f&&T?i.jsx("div",{className:"wizard-overlay",onClick:()=>h(null),children:i.jsxs("div",{className:"wizard-modal",onClick:B=>B.stopPropagation(),children:[i.jsxs("div",{className:"wizard-header",children:[i.jsx("span",{className:"wizard-icon",children:"🚀"}),i.jsxs("span",{className:"wizard-title",children:["Getting Started: ",f.label]}),i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>h(null),children:"✕"})]}),i.jsx("div",{className:"wizard-body",children:p===0?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"wizard-section-title",children:"📋 Steps to create your bot:"}),i.jsx("ol",{className:"wizard-steps",children:T.steps.map((B,$)=>i.jsx("li",{children:B},$))}),i.jsxs("div",{className:"wizard-nav",children:[i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>m(1),children:"I have my token →"}),f.setupUrl?i.jsx("a",{href:f.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"📖 Open docs in new tab"}):null]})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"wizard-section-title",children:"🔑 Paste your token:"}),f.envVars.map(B=>i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:B.prompt}),i.jsx("input",{type:B.secret?"password":"text",value:g[B.varName]??"",onChange:$=>y(I=>({...I,[B.varName]:$.target.value})),placeholder:B.secret?"••••••••":"value",autoComplete:"off",spellCheck:!1,autoFocus:!0})]},B.varName)),w?i.jsx("div",{className:`admin-row-msg${w.kind==="ok"?"":" admin-row-msg-err"}`,children:w.text}):null,i.jsxs("div",{className:"wizard-nav",children:[i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>m(0),children:"← Back"}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void R(),disabled:v||!e,children:v?"⏳ Saving…":"💾 Save token"})]}),(w==null?void 0:w.kind)==="ok"?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"wizard-section-title",children:"📋 Next steps:"}),i.jsx("ol",{className:"wizard-steps",children:T.postSetup.map((B,$)=>i.jsx("li",{children:B},$))})]}):null]})})]})}):null,i.jsxs("div",{className:"platform-config",children:[i.jsx("h2",{className:"section-subtitle",children:"⚙️ Platform transports (nuvira config gateway)"}),u?i.jsx("div",{className:`admin-row-msg${u.kind==="ok"?"":" admin-row-msg-err"}`,children:u.text}):null,i.jsx("div",{className:"hub-platform-grid",children:r.map(B=>i.jsx(jle,{entry:B,canWrite:e,busy:l===B.platform,expanded:s===B.platform,onToggle:()=>o(s===B.platform?null:B.platform),onSave:$=>void N(B.platform,$),onRemove:()=>void E(B.platform),onStartWizard:()=>_(B)},B.platform))}),i.jsxs("p",{className:"admin-hint",children:["Tokens are written to ",i.jsx("code",{children:"~/.nuvira/.env"})," (loaded by both the CLI and this dashboard at startup) — no env vars to hand-export. The WhatsApp personal bridge is configured separately above via QR/code pairing."]})]})]})}function jle(e){const{entry:t,canWrite:n,busy:r,expanded:a,onToggle:s,onSave:o,onRemove:l,onStartWizard:c}=e,[u,d]=b.useState(()=>Object.fromEntries(t.envVars.map(h=>[h.varName,h.value]))),f=(h,p)=>{d(m=>({...m,[h]:p}))};return i.jsxs("div",{className:`hub-platform${t.configured?" configured":""}`,children:[i.jsxs("div",{className:"hub-platform-head",children:[i.jsx("span",{className:`status-dot ${t.configured?"connected":"reconnecting"}`}),i.jsx("span",{className:"hub-platform-label",children:t.label}),i.jsx("span",{className:"hub-card-id",children:t.platform}),t.configured?null:i.jsx("button",{type:"button",className:"wizard-start-btn",onClick:c,disabled:!n,title:"Step-by-step setup wizard",children:"🚀 Getting Started"}),t.setupUrl?i.jsx("a",{href:t.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",title:"Setup documentation",children:"📖 Docs"}):null,i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:s,disabled:!n,children:a?"▴ Collapse":t.configured?"✎ Edit":"⚙ Configure"})]}),!a&&t.setupHint&&!t.configured?i.jsx("div",{className:"platform-setup-hint",children:t.setupHint}):null,a?i.jsxs("div",{className:"platform-config-form",children:[t.setupHint?i.jsx("div",{className:"platform-setup-hint",children:t.setupHint}):null,t.envVars.map(h=>i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:h.prompt}),i.jsx("input",{type:h.secret?"password":"text",value:u[h.varName]??"",onChange:p=>f(h.varName,p.target.value),placeholder:h.secret?"••••••••":"value",autoComplete:"off",spellCheck:!1,maxLength:512})]},h.varName)),i.jsxs("div",{className:"platform-config-actions",children:[i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>o(u),disabled:r||!n,children:r?"⏳ Saving…":"💾 Save"}),t.configured?i.jsx("button",{type:"button",className:"hub-remove-btn",onClick:l,disabled:r||!n,children:"🗑 Remove"}):null]})]}):i.jsx("div",{className:"hub-platform-env",children:t.envVars.map(h=>i.jsxs("div",{children:[i.jsx("code",{children:h.varName})," ",h.set?"✓ set":"— unset"]},h.varName))})]})}const uf=e=>e.id&&e.kind!=="link"?e.id:void 0,Nle=e=>!!(e&&e.startsWith("video/")),Ele=e=>!!(e&&e.startsWith("image/")),bE=(e,t)=>`/api/artifact-file?session=${encodeURIComponent(e)}&artifact=${encodeURIComponent(t)}`,_le=[{id:"tools",label:"Tools",icon:"🧰"},{id:"channels",label:"Channels",icon:"📡"},{id:"conversations",label:"Conversations",icon:"💬"},{id:"artifacts",label:"Artifacts",icon:"📦"},{id:"skills",label:"Skills",icon:"🧠"},{id:"subagents",label:"Subagents",icon:"🤖"}],Cle={pending:"⏳ pending",sent:"✅ sent",failed:"❌ failed"},Ale=5e3,Tle={spawning:"⏳ spawning",running:"▶ running",completed:"✅ completed",failed:"❌ failed",timeout:"⏰ timed out",killed:"⛔ killed"};function Ole(e){const t=typeof document<"u"?document.documentElement:null,n=(r,a)=>!t||typeof getComputedStyle!="function"?a:getComputedStyle(t).getPropertyValue(r).trim()||a;return{canvas:n("--bg-primary","Canvas"),text:n("--text-primary","CanvasText"),muted:n("--text-muted","GrayText"),userBubble:n("--accent-blue","Highlight"),onUserBubble:n("--text-on-accent","HighlightText"),agentBubble:n("--bg-card","ButtonFace")}}function uo(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Ple(e,t,n=new Date){const r=uo(e.displayName),a=uo(e.platform),s=e.messages.map(o=>{const l=o.role==="user",c=l?"user":"assistant",u=uo(l?e.displayName:"Agent");return`<div class="msg msg-${c}">
135
+ <div class="bubble bubble-${c}">${uo(o.content)}</div>
136
+ <div class="timestamp">${u} · ${uo(new Date(o.ts).toLocaleString())}</div>
137
+ </div>`}).join(`
138
+ `);return`<!DOCTYPE html>
139
+ <html lang="en">
140
+ <head>
141
+ <meta charset="utf-8">
142
+ <title>Conversation with ${r}</title>
143
+ <style>
144
+ body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; max-width: 700px; margin: 40px auto; padding: 0 20px; background: ${t.canvas}; color: ${t.text}; line-height: 1.6; }
145
+ h1 { font-size: 20px; margin-bottom: 4px; }
146
+ .meta { color: ${t.muted}; font-size: 13px; margin-bottom: 20px; }
147
+ .msg { margin-bottom: 16px; }
148
+ .msg-user { text-align: right; }
149
+ .msg-assistant { text-align: left; }
150
+ .bubble { display: inline-block; max-width: 80%; padding: 10px 14px; border-radius: 12px; font-size: 14px; white-space: pre-wrap; word-break: break-word; text-align: left; }
151
+ .bubble-user { background: ${t.userBubble}; color: ${t.onUserBubble}; border-bottom-right-radius: 4px; }
152
+ .bubble-assistant { background: ${t.agentBubble}; color: ${t.text}; border-bottom-left-radius: 4px; }
153
+ .timestamp { font-size: 11px; color: ${t.muted}; margin-top: 2px; }
154
+ @media print { body { margin: 0; } }
155
+ </style>
156
+ </head>
157
+ <body>
158
+ <h1>Conversation with ${r}</h1>
159
+ <div class="meta">Platform: ${a} · ${e.messageCount} messages · Exported: ${uo(n.toLocaleString())}</div>
160
+ ${s}
161
+ </body>
162
+ </html>`}function Rle(){var Zi,Vl,ln,wd,kd,Sd,Yl,Xl,Ql,jd,Zl,Jr,Jl,Nd,Ed;const[e,t]=b.useState("tools"),[n,r]=b.useState(null),[a,s]=b.useState(!0),[o,l]=b.useState(null),[c,u]=b.useState(!1),[d,f]=b.useState(null),[h,p]=b.useState(!1),[m,g]=b.useState(null),[y,v]=b.useState(null),[k,w]=b.useState(""),j=qr(),[S,x]=b.useState(""),[N,E]=b.useState(null),[P,_]=b.useState(!1),[R,T]=b.useState(null),[B,$]=b.useState(null),[I,D]=b.useState({}),[U,M]=b.useState(""),[z,O]=b.useState(""),[J,F]=b.useState(!1),[L,ie]=b.useState(null),[fe,ve]=b.useState(!1),[Ee,ee]=b.useState({}),[Q,ae]=b.useState(!1),[ce,G]=b.useState(null),[xe,we]=b.useState({}),[Pe,ge]=b.useState({}),[Ie,me]=b.useState({}),[Qe,De]=b.useState(!1),[_e,pt]=b.useState(null),[We,lt]=b.useState(""),[Yt,q]=b.useState(null),[Z,se]=b.useState(!1),[pe,ke]=b.useState(new Map),[$e,zt]=b.useState(new Set),[Le,rn]=b.useState(!1),[Mn,wt]=b.useState([]),[Mt,an]=b.useState(""),[or,In]=b.useState(null),[Gn,At]=b.useState(""),[Ft,lr]=b.useState([]),[cr,zl]=b.useState(0),[Tt,ya]=b.useState(0),[pn,Xs]=b.useState(!0),[sn,ba]=b.useState(!1),[Kr,_r]=b.useState(!1),xa=20,wa=b.useRef(null),qn=b.useCallback(async(C=!1)=>{if(sn)return;const V=C?0:Tt;ba(!0);try{const re=await K.fetchGatewayConversations({offset:V,limit:xa,q:We||void 0});re.ok&&re.conversations&&(lr(A=>C?re.conversations:[...A,...re.conversations]),zl(re.total??0),ya(V+re.conversations.length),Xs(re.hasMore??!1))}catch{}ba(!1)},[sn,Tt,We]);b.useEffect(()=>{e==="conversations"&&!Kr&&!sn&&(_r(!0),qn(!0))},[e,Kr,sn,qn]),b.useEffect(()=>{const C=wa.current;if(!C)return;const V=new IntersectionObserver(re=>{var A;(A=re[0])!=null&&A.isIntersecting&&pn&&!sn&&qn(!1)},{threshold:.1});return V.observe(C),()=>V.disconnect()},[pn,sn,qn]),b.useEffect(()=>{const C=setTimeout(()=>{e==="conversations"&&Kr&&(lr([]),ya(0),Xs(!0),qn(!0))},300);return()=>clearTimeout(C)},[We]),b.useEffect(()=>K.onTypingEvent(V=>{ke(re=>{const A=new Map(re),H=`${V.platform}:${V.channelId}`;return V.typing?A.set(H,{platform:V.platform,channelId:V.channelId,startedAt:Date.now()}):A.delete(H),A})}),[]);const Gi=b.useCallback((C,V)=>{V.stopPropagation(),zt(re=>{const A=new Set(re);return A.has(C)?A.delete(C):A.add(C),A})},[]),qi=b.useCallback(()=>{zt(C=>C.size===Ft.length?new Set:new Set(Ft.map(V=>V.key)))},[Ft]),Qs=b.useCallback(async()=>{if($e.size!==0){rn(!0);try{await K.exportGatewayConversations([...$e])}catch{}rn(!1)}},[$e]);b.useEffect(()=>{e==="conversations"&&K.getAllConversationTags().then(C=>{C.ok&&C.tags&&wt(C.tags)})},[e]);const Qa=b.useCallback(async(C,V)=>{if(!V.trim())return;(await K.addConversationTag(C,V.trim())).ok&&(lr(A=>A.map(H=>H.key===C?{...H,tags:[...H.tags??[],V.trim().toLowerCase()]}:H)),wt(A=>A.includes(V.trim().toLowerCase())?A:[...A,V.trim().toLowerCase()].sort())),In(null),At("")},[]),et=b.useCallback(async(C,V)=>{(await K.removeConversationTag(C,V)).ok&&lr(A=>A.map(H=>H.key===C?{...H,tags:(H.tags??[]).filter(Y=>Y!==V)}:H))},[]),Zs=b.useCallback((C,V)=>{V.stopPropagation();const re=C.contactName||C.channelId,A=[`Conversation with ${re} (${C.platform})`,`Exported: ${new Date().toLocaleString()}`,`Messages: ${C.messageCount}`,"─".repeat(50),""];if(C.messages)for(const Re of C.messages){const ue=Re.role==="user"?re:"Agent",Ne=new Date(Re.ts).toLocaleString();A.push(`[${Ne}] ${ue}:`),A.push(Re.content),A.push("")}const H=new Blob([A.join(`
163
+ `)],{type:"text/plain;charset=utf-8"}),Y=URL.createObjectURL(H),he=document.createElement("a");he.href=Y,he.download=`conversation-${C.platform}-${C.channelId.replace(/[^\w]/g,"_")}-${new Date().toISOString().slice(0,10)}.txt`,document.body.appendChild(he),he.click(),document.body.removeChild(he),URL.revokeObjectURL(Y)},[]),ka=b.useCallback((C,V)=>{V.stopPropagation();const re=C.contactName||C.channelId,A=C.messages??[],H=Ple({displayName:re,platform:C.platform,messageCount:C.messageCount,messages:A},Ole()),Y=window.open("","_blank");Y&&(Y.document.write(H),Y.document.close(),setTimeout(()=>Y.print(),300))},[]);b.useEffect(()=>{var V;const C=(V=n==null?void 0:n.conversations)==null?void 0:V.recent;!C||C.length===0||Kr&&(Tt>xa||We||lr(re=>{const A=new Set(re.map(ue=>ue.key)),H=C.map(ue=>({...ue})),Y=new Map(re.map(ue=>[ue.key,ue]));for(const ue of H)Y.has(ue.key)&&Y.set(ue.key,ue);const Re=[...H.filter(ue=>!A.has(ue.key)),...Y.values()];return Re.sort((ue,Ne)=>Ne.lastActiveAt-ue.lastActiveAt),Re}))},[(Zi=n==null?void 0:n.conversations)==null?void 0:Zi.recent]);const[Sa,Za]=b.useState(""),[Ki,Ja]=b.useState([]),[Vi,Yi]=b.useState(!1),[Vr,Cr]=b.useState(!1),[ja,W]=b.useState(null),[ne,je]=b.useState(null),[Se,on]=b.useState({}),[Kn,En]=b.useState([]),[Ar,Xi]=b.useState([]),[Js,md]=b.useState(""),Yr=C=>Qe?String(C??""):jM(C),Fl=C=>{const V=C.match(/^(\d+)@/);if(!V)return"";const re=V[1];return re.length===12&&re.startsWith("91")?`+${re.slice(0,2)} ${re.slice(2,7)} ${re.slice(7)}`:re.length===10?`+91 ${re.slice(0,5)} ${re.slice(5)}`:`+${re}`},Ul=C=>{const V=Fl(C.channelId),re=Yr(C.channelId);return C.contactName?{name:C.contactName,phone:V||re}:{name:V||re,phone:""}},ei=b.useCallback(C=>{var V,re;r(C),(V=C==null?void 0:C.channels)!=null&&V.statusRecipients&&Xi(C.channels.statusRecipients),(re=C==null?void 0:C.channels)!=null&&re.contacts&&En(C.channels.contacts),C||l("Could not reach the dashboard server, or the server is older than this panel. Run `nuvira dashboard` to start it."),s(!1)},[]),He=b.useCallback(async()=>{u(!0),l(null),ei(await K.fetchHub()),u(!1)},[ei]);b.useEffect(()=>{He(),K.fetchAdminAuthStatus().then(C=>{C&&(f({configured:C.configured,authenticated:C.authenticated}),p(C.authenticated),g(C.role??null),v(C.user??null))})},[He,j]);const eo=((Vl=n==null?void 0:n.subagents)==null?void 0:Vl.running)??0;b.useEffect(()=>{if(eo===0)return;const C=setInterval(()=>{K.fetchHub().then(V=>{V&&ei(V)})},Ale);return()=>clearInterval(C)},[eo,ei]);const at=h&&(m==="admin"||m==="operator"),It=b.useRef(!1);b.useEffect(()=>{at&&!It.current&&(It.current=!0,De(!0))},[at]);const Xr=async C=>{C==null||C.preventDefault();const V=Sa.trim();if(!V)return;Cr(!0),W(null);const re=await K.marketplaceSearch(V);Ja(re),Yi(!0),Cr(!1)},Qi=async C=>{if(!h){W({kind:"err",text:"🔐 Log in (or set up admin access) to install skills."});return}if(!at){W({kind:"err",text:"Your role cannot install skills — admin or operator only."});return}je(C),W(null);const V=await K.marketplaceInstall(C);V.ok?(W({kind:"ok",text:`✅ Installed ${C} (quarantine checked) — it appears in the Skills list and loads via the skill tool next turn.`}),He()):W({kind:"err",text:V.quarantined?`⛔ ${V.error||"checksum mismatch — quarantined"}`:`❌ ${V.error||"Install failed."}`}),je(null)},Wl=async C=>{if(!h){W({kind:"err",text:"🔐 Log in (or set up admin access) to uninstall skills."});return}if(!at){W({kind:"err",text:"Your role cannot uninstall skills — admin or operator only."});return}je(C),W(null);const V=await K.marketplaceUninstall(C);V.ok?(W({kind:"ok",text:`🗑️ Uninstalled ${C} — removed from .agents/skills/ and provenance.`}),He()):W({kind:"err",text:`❌ ${V.error||"Uninstall failed."}`}),je(null)},Qr=()=>{p(!1),f(C=>C&&{...C,authenticated:!1}),E("Session expired — log in again to toggle capabilities.")},gd=async C=>{C.preventDefault(),_(!0),E(null);const V=await K.adminLogin(k,S);if(V.ok){p(!0),f({configured:!0,authenticated:!0}),g(V.role??"admin"),v(V.user??null),w(""),x("");const re=R;T(null),re&&await Zr(re.kind,re.name,re.enabled)}else E(V.error||"Login failed.");_(!1)},Im=async C=>{if(C.preventDefault(),_(!0),E(null),S.length<8){E("Password must be at least 8 characters."),_(!1);return}const V=await K.adminSetup(k,S);if(V.ok){p(!0),f({configured:!0,authenticated:!0}),g(V.role??"admin"),v(V.user??null),w(""),x("");const re=R;T(null),re&&await Zr(re.kind,re.name,re.enabled)}else E(V.error||"Setup failed.");_(!1)},Hl=async()=>{await K.adminLogout(),p(!1),f(C=>C&&{...C,authenticated:!1}),g(null),v(null)},Zr=async(C,V,re)=>{$(V);const A=C==="skill"?await K.setSkillEnabled(V,re):await K.setToolsetEnabled(V,re);A.ok?(D(H=>({...H,[V]:`✅ ${re?"Enabled":"Disabled"} — live for new agent runs`})),He()):A.unauthorized?Qr():(D(H=>({...H,[V]:`❌ ${A.error||"Toggle failed"}`})),A.forbidden&&E(A.error||"Your role cannot change capabilities.")),$(null)},$m=(C,V)=>{if(!h){T({kind:"toolset",name:C,enabled:V});return}Zr("toolset",C,V)},Gl=(C,V)=>{if(!h){T({kind:"skill",name:C,enabled:V});return}Zr("skill",C,V)},Lm=async C=>{if(C.preventDefault(),!h){ie({kind:"err",text:"🔐 Log in (or set up admin access) to send test messages."});return}if(!at){ie({kind:"err",text:"🔒 Your role cannot send channel messages — requires the admin or operator role."});return}F(!0),ie(null);const V=await K.sendChannelMessage(U.trim(),z);V.ok?(ie({kind:"ok",text:`✅ Sent to ${U.trim()} (${V.platform}:${Yr(V.channelId??"")})`}),O("")):V.unauthorized?(Qr(),ie({kind:"err",text:V.error||"Session expired — log in again."})):ie({kind:"err",text:V.error||"Send failed."}),F(!1)},vd=(C,V)=>{var A,H;return(((H=(A=n==null?void 0:n.channels)==null?void 0:A.policies)==null?void 0:H[C])??{})[V]??[]},yd=C=>C==="user"?"allowedUsers":C==="group"?"allowedGroups":"outboundSenders",to=(C,V,re)=>{const A=re.trim();A&&ee(H=>{var Ne;const Y={...H[C]??{}},he=yd(V),ue=[...((Ne=H[C])==null?void 0:Ne[he])??vd(C,he)];return ue.includes(A)||ue.push(A),Y[he]=ue,{...H,[C]:Y}})},ql=(C,V,re)=>{ee(A=>{var Ne;const H=yd(V),Y=vd(C,H),Re=(((Ne=A[C])==null?void 0:Ne[H])??Y).filter(ur=>ur!==re);if(Re.length===0&&Y.length===0){const ur={...A[C]??{}};delete ur[H];const ro={...A};return Object.keys(ur).length===0?delete ro[C]:ro[C]=ur,ro}const ue={...A[C]??{}};return ue[H]=Re,{...A,[C]:ue}})},ti=(C,V)=>{const re=C.trim().toLowerCase(),A=V.trim().toLowerCase();if(re==="*"||A==="*"||re===A)return!0;const H=re.replace(/\D+/g,""),Y=A.replace(/\D+/g,"");return H.length>0&&H===Y},bd=C=>{const V=(Se[C]??"").trim(),re=(xe[C]??"").trim();re&&(to(C,"user",re),V&&En(A=>[...A.filter(Y=>!(Y.platform===C&&(ti(Y.id,re)||Y.name.toLowerCase()===V.toLowerCase()))),{name:V,platform:C,id:re,addedAt:Date.now()}]),we(A=>({...A,[C]:""})),on(A=>({...A,[C]:""})))},Tr=(C,V)=>{ql(C,"user",V),En(re=>re.filter(A=>!(A.platform===C&&ti(A.id,V))))},Na=(C,V)=>{ee(re=>{const A={...re[C]??{}};return V==="silentDrop"?A.silentDrop=A.silentDrop===!1:A[V]?delete A[V]:A[V]=!0,{...re,[C]:A}})},Kl=Object.keys(Ee).length>0||Kn.length!==(((wd=(ln=n==null?void 0:n.channels)==null?void 0:ln.contacts)==null?void 0:wd.length)??0)||Kn.some((C,V)=>{var re,A;return!((A=(re=n==null?void 0:n.channels)==null?void 0:re.contacts)!=null&&A[V])||C.platform!==n.channels.contacts[V].platform||C.id!==n.channels.contacts[V].id||C.name!==n.channels.contacts[V].name})||Ar.length!==(((Sd=(kd=n==null?void 0:n.channels)==null?void 0:kd.statusRecipients)==null?void 0:Sd.length)??0)||Ar.some((C,V)=>{var re,A;return C!==((A=(re=n==null?void 0:n.channels)==null?void 0:re.statusRecipients)==null?void 0:A[V])}),no=async()=>{var V;if(!h){G({kind:"err",text:"🔐 Log in (or set up admin access) to change permissions."});return}if(!at){G({kind:"err",text:"🔒 Your role cannot change permissions — requires the admin or operator role."});return}ae(!0),G(null);const C=await K.saveGatewayPolicies(Ee,Ar,Kn);if(C.ok){const re=(V=C.contactErrors)!=null&&V.length?`
164
+ ⚠️ Some contacts were rejected: ${C.contactErrors.join("; ")}`:"";G({kind:re?"warn":"ok",text:`✅ Permissions + saved contacts + status recipients saved — the running gateway applies them immediately.${re}`}),ee({}),He()}else C.unauthorized?(Qr(),G({kind:"err",text:C.error||"Session expired — log in again."})):G({kind:"err",text:C.error||"Failed to save permissions."});ae(!1)};if(a)return i.jsxs("div",{className:"admin-header",children:[i.jsx(Oe,{icon:"🧰",title:"Agent Hub"}),i.jsxs("div",{className:"loading-state",children:[i.jsx("div",{className:"loading-spinner"}),i.jsx("p",{children:"Loading hub…"})]})]});const xd=!h&&R!==null;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"admin-header",children:[i.jsx(Oe,{icon:"🧰",title:i.jsxs(i.Fragment,{children:["Agent Hub",y?i.jsxs("span",{className:`admin-role-badge admin-role-${m||"viewer"}`,children:[" ",y," · ",m||"viewer"]}):null]})}),i.jsxs("div",{className:"admin-header-actions",children:[i.jsxs("label",{className:"hub-reveal-toggle",children:[i.jsx("input",{type:"checkbox",checked:Qe,onChange:C=>De(C.target.checked),disabled:!at}),"Show full ids"]}),at?null:i.jsx("span",{className:"admin-hint",children:"🔒 admins/operators only"}),i.jsx("button",{className:"admin-refresh-btn",onClick:()=>void He(),disabled:c,children:c?"⏳ Refreshing…":"🔄 Refresh"}),h?i.jsx("button",{className:"admin-logout-btn",onClick:()=>void Hl(),children:"🚪 Log out"}):null]})]}),i.jsxs("p",{className:"admin-subtitle",children:["Capabilities, messaging, artifacts and skills in one place — a single 4-view management page. Toggles persist to ",i.jsx("code",{children:"buffconfig"})," and are honored by the runtime immediately (never cosmetic)."]}),o?i.jsx("div",{className:"admin-error",children:o}):null,xd?i.jsxs("div",{className:"admin-header",children:[i.jsx("h2",{className:"section-subtitle",children:d!=null&&d.configured?`🔐 Log in to ${R.enabled?"enable":"disable"} '${R.name}'`:`🔐 Set up admin access to ${R.enabled?"enable":"disable"} '${R.name}'`}),i.jsxs("form",{className:"admin-gate-form",onSubmit:d!=null&&d.configured?gd:Im,children:[i.jsxs("label",{children:[i.jsx("span",{children:"Username"}),i.jsx("input",{type:"text",value:k,onChange:C=>w(C.target.value),autoComplete:"username",placeholder:"admin"})]}),i.jsxs("label",{children:[i.jsx("span",{children:"Password"}),i.jsx("input",{type:"password",value:S,onChange:C=>x(C.target.value),autoComplete:d!=null&&d.configured?"current-password":"new-password",placeholder:"••••••••"})]}),N?i.jsx("div",{className:"admin-error",children:N}):null,i.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:P||!k||!S,children:P?"⏳ …":d!=null&&d.configured?"🔐 Log in & apply":"🔐 Create admin & apply"}),d!=null&&d.configured?null:i.jsxs("p",{className:"admin-hint",children:["The first user is always an admin. Automation alternative: set"," ",i.jsx("code",{children:"NUVIRA_DASHBOARD_ADMIN_USER"})," / ",i.jsx("code",{children:"NUVIRA_DASHBOARD_ADMIN_PASSWORD"}),"."]})]})]}):null,!xd&&!at&&h?i.jsxs("div",{className:"admin-readonly-note",children:["🔒 Your role (",i.jsx("code",{children:m||"viewer"}),") can view but not change capabilities — toggles require the ",i.jsx("code",{children:"admin"})," or ",i.jsx("code",{children:"operator"})," role."]}):null,i.jsx("div",{className:"hub-tabs",role:"tablist",children:_le.map(C=>{var re,A,H;const V=C.id==="tools"?n?`${n.toolsets.enabled}/${n.toolsets.toolsets.length}`:"":C.id==="channels"?n?String(n.channels.delivery.total):"":C.id==="conversations"?n?String(((re=n.conversations)==null?void 0:re.total)??0):"":C.id==="artifacts"?n?String(n.artifacts.totalSessions):"":C.id==="subagents"?n?`${((A=n.subagents)==null?void 0:A.running)??0}/${((H=n.subagents)==null?void 0:H.total)??0}`:"":n?`${n.skills.enabled}/${n.skills.total}`:"";return i.jsxs("button",{role:"tab","aria-selected":e===C.id,className:`hub-tab${e===C.id?" active":""}`,onClick:()=>t(C.id),children:[C.icon," ",C.label,V?i.jsx("span",{className:"hub-tab-count",children:V}):null]},C.id)})}),e==="tools"&&n?i.jsxs("div",{role:"tabpanel",children:[i.jsxs("div",{className:"admin-summary-grid",children:[i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.toolsets.enabled}),i.jsx("div",{className:"admin-summary-label",children:"Enabled toolsets"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.toolsets.disabled}),i.jsx("div",{className:"admin-summary-label",children:"Disabled toolsets"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.toolsets.totalTools}),i.jsx("div",{className:"admin-summary-label",children:"Registered tools"})]})]}),i.jsx("div",{className:"hub-toolset-grid",children:n.toolsets.toolsets.map(C=>i.jsxs("div",{className:`hub-card${C.enabled?"":" hub-card-disabled"}`,children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsxs("div",{className:"hub-card-title",children:[i.jsx("span",{className:"hub-card-name",children:C.label}),i.jsx("span",{className:"hub-card-id",children:C.name})]}),i.jsx("button",{role:"switch","aria-checked":C.enabled,"aria-label":`${C.enabled?"Disable":"Enable"} ${C.label}`,className:`hub-switch${C.enabled?" on":""}`,disabled:B===C.name||R!==null||h&&!at,onClick:()=>$m(C.name,!C.enabled),children:i.jsx("span",{className:"hub-switch-knob"})})]}),i.jsx("p",{className:"hub-card-desc",children:C.description}),i.jsx("div",{className:"hub-card-tools",children:C.tools.length>0?C.tools.map(V=>i.jsx("span",{className:"hub-chip",children:V},V)):i.jsx("span",{className:"admin-hint",children:"gates dynamic MCP tools (no static names)"})}),I[C.name]?i.jsx("div",{className:"admin-row-msg",children:I[C.name]}):null,C.enabled?null:i.jsx("div",{className:"hub-card-note",children:"⛔ Removed from the model schema — calls return an explicit error"})]},C.name))})]}):null,e==="channels"&&n?i.jsxs("div",{role:"tabpanel",children:[i.jsxs("div",{className:"admin-summary-grid",children:[i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.channels.delivery.pending}),i.jsx("div",{className:"admin-summary-label",children:"⏳ Queued for retry"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.channels.delivery.sent}),i.jsx("div",{className:"admin-summary-label",children:"✅ Delivered"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.channels.delivery.failed}),i.jsx("div",{className:"admin-summary-label",children:"❌ Failed (max retries)"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.channels.aliases.length}),i.jsx("div",{className:"admin-summary-label",children:"Channel aliases"})]})]}),i.jsx("h2",{className:"section-subtitle",children:"📮 Delivery ledger (guaranteed delivery)"}),n.channels.delivery.recent.length>0?i.jsx("div",{className:"admin-table-wrapper",children:i.jsxs("table",{className:"admin-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Target"}),i.jsx("th",{children:"Platform"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Attempts"}),i.jsx("th",{children:"Next retry"}),i.jsx("th",{children:"Message"})]})}),i.jsx("tbody",{children:n.channels.delivery.recent.map(C=>i.jsxs("tr",{children:[i.jsx("td",{className:"admin-provider-type",children:Yr(C.target)}),i.jsx("td",{children:C.platform}),i.jsx("td",{children:i.jsx("span",{className:`admin-check-badge admin-check-${C.status==="sent"?"pass":C.status==="failed"?"fail":"warn"}`,children:Cle[C.status]||C.status})}),i.jsxs("td",{children:[C.attempts,"/5"]}),i.jsx("td",{children:C.status==="pending"?`${Math.max(0,Math.round((C.nextAttemptAt-Date.now())/1e3))}s`:"—"}),i.jsx("td",{className:"admin-hint",children:C.lastError?`⚠️ ${C.lastError}`:(C.text||"").slice(0,60)})]},C.id))})]})}):i.jsx("div",{className:"empty-state",children:"Delivery ledger is empty — every gateway send has gone through."}),i.jsx("h2",{className:"section-subtitle",children:"📥 Inbox (received messages)"}),n.channels.inbox.recent.length>0?i.jsx("div",{className:"admin-table-wrapper",children:i.jsxs("table",{className:"admin-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Platform"}),i.jsx("th",{children:"From"}),i.jsx("th",{children:"Message"}),i.jsx("th",{children:"Handled"}),i.jsx("th",{children:"When"})]})}),i.jsx("tbody",{children:n.channels.inbox.recent.map(C=>i.jsxs("tr",{children:[i.jsxs("td",{className:"admin-provider-type",children:[C.platform,C.isGroup?i.jsx("span",{className:"hub-chip",children:"group"}):null]}),i.jsx("td",{children:Yr(C.from||C.senderId||C.channelId)}),i.jsx("td",{className:"admin-hint",children:(C.text||"").slice(0,60)}),i.jsxs("td",{children:[i.jsx("span",{className:`admin-check-badge admin-check-${C.handled==="pipeline"?"pass":C.handled==="refused"?"fail":"warn"}`,children:C.handled}),C.reply?i.jsx("div",{className:"admin-hint",children:C.reply.slice(0,C.handled==="attachment_failed"?160:40)}):null]}),i.jsx("td",{className:"admin-hint",children:new Date(C.at).toLocaleString()})]},C.id))})]})}):i.jsx("div",{className:"empty-state",children:"Inbox is empty — messages the gateway receives will appear here."}),i.jsxs("p",{className:"admin-hint",children:[n.channels.inbox.total," received · ",n.channels.inbox.pipeline," triggered the pipeline ·"," ",n.channels.inbox.help," got the help line · ",n.channels.inbox.refused," refused by policy ·"," ",n.channels.inbox.duplicate??0," duplicate re-deliveries ignored ·"," ",n.channels.inbox.attachmentFailed??0," attachment(s) could not be read."]}),i.jsx("h2",{className:"section-subtitle",children:"🔌 Platform transports"}),i.jsx(Sle,{canWrite:at,sessionExpired:Qr,mode:"table"}),i.jsx("h2",{className:"section-subtitle",children:"🔗 Channel aliases (nuvira gateway status)"}),n.channels.aliases.length>0?i.jsx("div",{className:"hub-alias-list",children:n.channels.aliases.map(C=>i.jsxs("div",{className:"hub-alias-row",children:[i.jsx("span",{className:"hub-chip",children:C.alias}),i.jsxs("span",{className:"admin-hint",children:["→ ",C.platform,":",Yr(C.channelId)]})]},C.alias))}):i.jsxs("div",{className:"empty-state",children:["No aliases yet — register one with ",i.jsx("code",{children:"nuvira gateway alias <name> <platform> <channelId>"}),"."]}),Kl?i.jsxs("div",{className:"hub-unsaved-banner",role:"status",children:[i.jsxs("span",{children:["⚠️ ",i.jsx("strong",{children:"Unsaved changes"})," — what you see below is a ",i.jsx("em",{children:"draft"}),". Press"," ",i.jsx("strong",{children:"💾 Save permissions"})," to apply it to the gateway; leaving the page discards it."]}),i.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:Q,onClick:()=>void no(),children:Q?"⏳ Saving…":"💾 Save permissions"})]}):null,i.jsx("div",{style:{cursor:"pointer",userSelect:"none",display:"flex",alignItems:"center",gap:8,marginBottom:8},onClick:()=>ve(!fe),children:i.jsxs("h2",{className:"section-subtitle",style:{margin:0},children:[fe?"▼":"▶"," 🔐 Permissions — who can TRIGGER the agent"]})}),i.jsxs("p",{className:"admin-hint",style:{marginBottom:fe?10:0},children:["This list controls ",i.jsx("strong",{children:"who may trigger the agent"})," when they message you on each platform (WhatsApp, Telegram, email, …). Click to ",fe?"collapse":"expand"," and manage permissions."]}),fe?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"admin-hint",style:{marginBottom:10},children:["⚠ ",i.jsx("strong",{children:"Not the same as send-by-name contacts:"})," a WhatsApp contact name (from"," ",i.jsx("code",{children:"nuvira whatsapp contact add"}),", shown in the WhatsApp bridge panel below) only lets"," ",i.jsx("em",{children:"you"})," send ",i.jsx("em",{children:"to"})," it by name — it does ",i.jsx("strong",{children:"not"})," let that number trigger the agent. Add the number here (or ",i.jsx("code",{children:"nuvira config gateway allow <platform> user <id>"}),") to grant inbound access."]}),i.jsx("div",{className:"hub-permissions",children:n.channels.platforms.map(C=>{const V={...n.channels.policies[C.platform]??{},...Ee[C.platform]??{}},re=V.allowedUsers??[],A=V.allowedGroups??[];return i.jsxs("div",{className:"hub-card",children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsx("span",{className:"hub-chip",children:C.label}),i.jsx("span",{className:"hub-card-id",children:C.platform}),V.disabled?i.jsx("span",{className:"hub-chip",children:"disabled"}):null]}),i.jsx("div",{className:"admin-hint",style:{margin:"4px 0 8px"},children:"Allowed users — who may trigger the agent"}),i.jsxs("div",{className:"hub-alias-list",children:[re.length===0?i.jsxs("span",{className:"admin-hint",children:["(blank — no one may trigger; add ",i.jsx("code",{children:"Allow-All"})," to allow everyone)"]}):null,re.map(H=>{var he,Re,ue,Ne;const Y=(((he=Ee[C.platform])==null?void 0:he.allowedUsers)??[]).includes(H)&&!(((Ne=(ue=(Re=n==null?void 0:n.channels)==null?void 0:Re.policies)==null?void 0:ue[C.platform])==null?void 0:Ne.allowedUsers)??[]).includes(H);return i.jsxs("div",{className:"hub-alias-row",children:[i.jsxs("span",{className:`hub-chip${Y?" hub-chip-pending":""}`,title:Y?"Not saved yet — press 💾 Save permissions":void 0,children:[Yr(H),Y?" · unsaved":""]}),i.jsx("button",{className:"admin-refresh-btn",disabled:Q,onClick:()=>Tr(C.platform,H),children:"✕"})]},`u-${H}`)})]}),i.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 10px"},children:[i.jsx("input",{type:"text",value:Se[C.platform]??"",onChange:H=>on(Y=>({...Y,[C.platform]:H.target.value})),placeholder:"Name (optional)",disabled:Q}),i.jsx("input",{type:"text",value:xe[C.platform]??"",onChange:H=>we(Y=>({...Y,[C.platform]:H.target.value})),placeholder:"Contact no / sender id, or Allow-All",disabled:Q}),i.jsx("button",{className:"admin-refresh-btn",disabled:Q||!(xe[C.platform]??"").trim(),onClick:()=>bd(C.platform),children:"+ User"})]}),i.jsx("div",{className:"admin-hint",style:{margin:"4px 0 8px"},children:"Allowed groups"}),i.jsxs("div",{className:"hub-alias-list",children:[A.length===0?i.jsx("span",{className:"admin-hint",children:"(none — any group may trigger)"}):null,A.map(H=>{var he,Re,ue,Ne;const Y=(((he=Ee[C.platform])==null?void 0:he.allowedGroups)??[]).includes(H)&&!(((Ne=(ue=(Re=n==null?void 0:n.channels)==null?void 0:Re.policies)==null?void 0:ue[C.platform])==null?void 0:Ne.allowedGroups)??[]).includes(H);return i.jsxs("div",{className:"hub-alias-row",children:[i.jsxs("span",{className:`hub-chip${Y?" hub-chip-pending":""}`,title:Y?"Not saved yet — press 💾 Save permissions":void 0,children:[H,Y?" · unsaved":""]}),i.jsx("button",{className:"admin-refresh-btn",disabled:Q,onClick:()=>ql(C.platform,"group",H),children:"✕"})]},`g-${H}`)})]}),i.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 10px"},children:[i.jsx("input",{type:"text",value:Pe[C.platform]??"",onChange:H=>ge(Y=>({...Y,[C.platform]:H.target.value})),placeholder:"group id, e.g. 1203630283471234@g.us",disabled:Q}),i.jsx("button",{className:"admin-refresh-btn",disabled:Q||!(Pe[C.platform]??"").trim(),onClick:()=>{to(C.platform,"group",Pe[C.platform]??""),ge(H=>({...H,[C.platform]:""}))},children:"+ Group"})]}),i.jsx("div",{className:"admin-hint",style:{margin:"12px 0 4px"},children:"Send authority — who may tell the agent to send to OTHER people"}),i.jsx("div",{className:"admin-hint",style:{margin:"0 0 6px",opacity:.8},children:(V.outboundSenders??[]).length===0?"Open — anyone above who can trigger the agent can also direct outbound sends. Add senders to restrict it.":"Restricted to the senders below (Allow-All = everyone)."}),i.jsx("div",{className:"hub-alias-list",children:(V.outboundSenders??[]).map(H=>{var he,Re,ue,Ne;const Y=(((he=Ee[C.platform])==null?void 0:he.outboundSenders)??[]).includes(H)&&!(((Ne=(ue=(Re=n==null?void 0:n.channels)==null?void 0:Re.policies)==null?void 0:ue[C.platform])==null?void 0:Ne.outboundSenders)??[]).includes(H);return i.jsxs("div",{className:"hub-alias-row",children:[i.jsxs("span",{className:`hub-chip${Y?" hub-chip-pending":""}`,title:Y?"Not saved yet — press 💾 Save permissions":void 0,children:[Yr(H),Y?" · unsaved":""]}),i.jsx("button",{className:"admin-refresh-btn",disabled:Q,onClick:()=>ql(C.platform,"send",H),children:"✕"})]},`s-${H}`)})}),i.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 10px"},children:[i.jsx("input",{type:"text",value:Ie[C.platform]??"",onChange:H=>me(Y=>({...Y,[C.platform]:H.target.value})),placeholder:"sender id, or Allow-All",disabled:Q}),i.jsx("button",{className:"admin-refresh-btn",disabled:Q||!(Ie[C.platform]??"").trim(),onClick:()=>{to(C.platform,"send",Ie[C.platform]??""),me(H=>({...H,[C.platform]:""}))},children:"+ Sender"})]}),i.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 0"},children:[i.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginRight:12},children:[i.jsx("input",{type:"checkbox",checked:V.silentDrop!==!1,disabled:Q,onChange:()=>Na(C.platform,"silentDrop")}),i.jsx("span",{className:"admin-hint",children:"Silent (no reply to unapproved) — default"})]}),i.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginRight:12},children:[i.jsx("input",{type:"checkbox",checked:!!V.requireMention,disabled:Q,onChange:()=>Na(C.platform,"requireMention")}),i.jsx("span",{className:"admin-hint",children:"Groups: mention only"})]}),i.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginRight:12},children:[i.jsx("input",{type:"checkbox",checked:!!V.disabled,disabled:Q,onChange:()=>Na(C.platform,"disabled")}),i.jsx("span",{className:"admin-hint",children:"Disabled (off)"})]}),i.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[i.jsx("input",{type:"checkbox",checked:!!V.requireApprovedTarget,disabled:Q,onChange:()=>Na(C.platform,"requireApprovedTarget")}),i.jsx("span",{className:"admin-hint",children:"Require approved recipients for sends"})]})]})]},C.platform)})})]}):null,i.jsx("h2",{className:"section-subtitle",style:{marginTop:22},children:"📇 Telegram User Onboarding"}),i.jsxs("div",{className:"onboarding-summary",children:[i.jsx("p",{className:"admin-hint",style:{marginBottom:12},children:"Users who message your bot are auto-registered here. Approve them to enable outbound messaging."}),(()=>{const C=Kn.filter(A=>A.status==="pending").length,V=Kn.filter(A=>A.status==="approved").length,re=Kn.filter(A=>A.status==="rejected").length;return i.jsxs("div",{className:"onboarding-stats",children:[i.jsxs("span",{className:"onboarding-stat pending",children:["⏳ ",C," pending"]}),i.jsxs("span",{className:"onboarding-stat approved",children:["✅ ",V," approved"]}),i.jsxs("span",{className:"onboarding-stat rejected",children:["🚫 ",re," rejected"]})]})})(),i.jsxs("div",{className:"onboarding-steps",children:[i.jsxs("div",{className:"onboarding-step",children:[i.jsx("span",{className:"onboarding-step-num",children:"1"}),i.jsxs("span",{children:["User sends any message to ",i.jsx("code",{children:"@agent_nuvira_bot"})]})]}),i.jsxs("div",{className:"onboarding-step",children:[i.jsx("span",{className:"onboarding-step-num",children:"2"}),i.jsxs("span",{children:["Bot auto-registers them as ",i.jsx("strong",{children:"⏳ pending"})]})]}),i.jsxs("div",{className:"onboarding-step",children:[i.jsx("span",{className:"onboarding-step-num",children:"3"}),i.jsx("span",{children:"Admin approves → they can receive outbound messages"})]})]}),i.jsx("a",{href:"/contacts",className:"admin-refresh-btn",style:{marginTop:12,display:"inline-block",textDecoration:"none"},children:"📋 Go to Contacts tab to manage →"})]}),i.jsx("h2",{className:"section-subtitle",style:{marginTop:22},children:"📊 Status recipients"}),i.jsxs("p",{className:"admin-hint",children:["Contacts/groups that ALWAYS receive the pipeline completion summary, whoever triggered it. Use a contact name, number, or ",i.jsx("code",{children:"platform:channelId"})," — e.g."," ",i.jsx("code",{children:"whatsapp:Name"}),", ",i.jsx("code",{children:"whatsapp:+91***"}),", ",i.jsx("code",{children:"telegram:123456"}),","," ",i.jsx("code",{children:"slack:ops"}),"."]}),Ar.length>0?i.jsx("div",{className:"hub-alias-list",children:Ar.map(C=>{var V,re;return i.jsxs("div",{className:"hub-alias-row",children:[i.jsx("span",{className:"hub-chip",children:"📊"}),i.jsx("span",{className:"admin-hint",children:((re=(V=n==null?void 0:n.channels)==null?void 0:V.statusRecipientDisplay)==null?void 0:re[C])??C}),i.jsx("button",{className:"admin-refresh-btn",disabled:Q,onClick:()=>Xi(A=>A.filter(H=>H!==C)),children:"✕"})]},C)})}):i.jsx("div",{className:"empty-state",style:{padding:"14px"},children:"No status recipients — add one below."}),i.jsxs("div",{className:"hub-send-form",children:[i.jsx("input",{type:"text",value:Js,onChange:C=>md(C.target.value),placeholder:"whatsapp:Name or whatsapp:+91***",disabled:Q,maxLength:128}),i.jsx("button",{className:"admin-refresh-btn",disabled:Q||!Js.trim()||Ar.includes(Js.trim()),onClick:()=>{Xi(C=>[...C,Js.trim()]),md("")},children:"+ Add"})]}),i.jsxs("div",{className:"hub-send-form",style:{marginTop:10},children:[i.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:Q,onClick:()=>void no(),children:Q?"⏳ Saving…":"💾 Save permissions"}),Object.keys(Ee).length>0?i.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:Q,onClick:()=>ee({}),children:"Discard draft"}):null]}),ce?i.jsx("div",{className:`admin-row-msg${ce.kind==="err"?" admin-row-msg-err":""}`,children:ce.text}):null,i.jsx("h2",{className:"section-subtitle",children:"📤 Test a channel (nuvira gateway send)"}),i.jsxs("form",{className:"hub-send-form",onSubmit:C=>void Lm(C),children:[i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:"Target — an alias or platform:channelId"}),i.jsx("input",{type:"text",value:U,onChange:C=>M(C.target.value),placeholder:"ops or slack:C0123 or email:team@example.com",disabled:J,maxLength:128})]}),i.jsxs("label",{className:"hub-send-message",children:[i.jsx("span",{className:"admin-hint",children:"Message"}),i.jsx("input",{type:"text",value:z,onChange:C=>O(C.target.value),placeholder:"nightly build done 🎉",disabled:J,maxLength:4e3})]}),i.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:J||!U.trim()||!z,children:J?"⏳ Sending…":"📤 Send test message"})]}),L?i.jsx("div",{className:`admin-row-msg${L.kind==="ok"?"":" admin-row-msg-err"}`,children:L.text}):null,i.jsxs("p",{className:"admin-hint",children:["Sends through the same gateway the CLI uses — the dashboard process must have the platform's env token set (e.g. ",i.jsx("code",{children:"NUVIRA_SMTP_HOST"}),"). Requires admin or operator."]}),i.jsx("h2",{className:"section-subtitle",children:"🟢 WhatsApp bridge (nuvira whatsapp pair)"}),i.jsx(kle,{authed:h,canWrite:at,sessionExpired:Qr,reveal:Qe})]}):null,e==="conversations"&&n?i.jsxs("div",{role:"tabpanel",children:[i.jsxs("div",{className:"admin-summary-grid",children:[i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:((Yl=n.conversations)==null?void 0:Yl.total)??0}),i.jsx("div",{className:"admin-summary-label",children:"Stored conversations"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:Ft.filter(C=>Date.now()-C.lastActiveAt<864e5).length}),i.jsx("div",{className:"admin-summary-label",children:"Active today"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:Ft.filter(C=>C.platform==="whatsapp").length}),i.jsx("div",{className:"admin-summary-label",children:"WhatsApp"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:Ft.filter(C=>C.platform==="telegram").length}),i.jsx("div",{className:"admin-summary-label",children:"Telegram"})]})]}),((Xl=n.conversations)==null?void 0:Xl.analytics)&&n.conversations.analytics.totalConversations>0&&i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>se(!Z),style:{marginBottom:12},children:Z?"📊 Hide Analytics":"📊 Show Analytics"}),Z?i.jsxs("div",{className:"hub-session-list",style:{marginBottom:16},children:[i.jsxs("div",{className:"admin-summary-grid",children:[i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.conversations.analytics.totalMessages}),i.jsx("div",{className:"admin-summary-label",children:"Total messages"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.conversations.analytics.avgMessagesPerConversation}),i.jsx("div",{className:"admin-summary-label",children:"Avg msgs/conversation"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.conversations.analytics.avgUserMessageLength}),i.jsx("div",{className:"admin-summary-label",children:"Avg user msg length"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.conversations.analytics.avgAssistantMessageLength}),i.jsx("div",{className:"admin-summary-label",children:"Avg assistant msg length"})]})]}),i.jsxs("div",{className:"hub-card",style:{marginTop:12},children:[i.jsx("div",{className:"hub-card-top",children:i.jsx("div",{className:"hub-card-title",children:i.jsx("span",{className:"hub-card-name",children:"🏆 Most Active Contacts"})})}),i.jsx("div",{style:{marginTop:8},children:n.conversations.analytics.topContacts.map((C,V)=>{var H;const re=((H=n.conversations.analytics.topContacts[0])==null?void 0:H.messageCount)||1,A=Math.round(C.messageCount/re*100);return i.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:6,fontSize:13},children:[i.jsx("span",{style:{width:24,textAlign:"center",fontWeight:600,color:V<3?"var(--accent-yellow)":"var(--muted)"},children:V===0?"🥇":V===1?"🥈":V===2?"🥉":`${V+1}.`}),i.jsxs("span",{style:{flex:1,marginLeft:8},children:[C.platform==="whatsapp"?"📱":"✈️"," ",C.name]}),i.jsx("span",{style:{width:60,textAlign:"right",fontWeight:600},children:C.messageCount}),i.jsx("div",{style:{width:100,height:8,background:"var(--border)",borderRadius:4,marginLeft:8},children:i.jsx("div",{style:{width:`${A}%`,height:"100%",background:"var(--accent-blue)",borderRadius:4}})})]},V)})})]}),i.jsxs("div",{className:"hub-card",style:{marginTop:12},children:[i.jsx("div",{className:"hub-card-top",children:i.jsx("div",{className:"hub-card-title",children:i.jsx("span",{className:"hub-card-name",children:"🕐 Peak Hours"})})}),i.jsx("div",{style:{display:"flex",alignItems:"flex-end",height:80,marginTop:8,gap:2},children:n.conversations.analytics.hourlyDistribution.map(({hour:C,count:V})=>{const re=Math.max(...n.conversations.analytics.hourlyDistribution.map(H=>H.count),1),A=Math.round(V/re*70);return i.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center"},children:i.jsx("div",{style:{width:"100%",height:A,background:C>=9&&C<=21?"var(--accent-blue)":"var(--text-muted)",borderRadius:2},title:`${C}:00 — ${V} messages`})},C)})}),i.jsx("div",{style:{display:"flex",fontSize:10,color:"var(--muted)",marginTop:4},children:[0,6,12,18,23].map(C=>i.jsxs("span",{style:{flex:1,textAlign:C===0?"left":C===23?"right":"center"},children:[C,":00"]},C))})]}),i.jsxs("div",{className:"hub-card",style:{marginTop:12},children:[i.jsx("div",{className:"hub-card-top",children:i.jsx("div",{className:"hub-card-title",children:i.jsx("span",{className:"hub-card-name",children:"📱 Platform Breakdown"})})}),i.jsx("div",{style:{marginTop:8},children:n.conversations.analytics.platformBreakdown.map(C=>i.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:6,fontSize:13},children:[i.jsx("span",{className:"hub-chip",style:{width:80,textAlign:"center"},children:C.platform}),i.jsxs("span",{style:{marginLeft:8,flex:1},children:[C.conversations," conversations"]}),i.jsxs("span",{style:{fontWeight:600},children:[C.messages," msgs"]})]},C.platform))})]}),i.jsxs("div",{className:"hub-card",style:{marginTop:12},children:[i.jsx("div",{className:"hub-card-top",children:i.jsx("div",{className:"hub-card-title",children:i.jsx("span",{className:"hub-card-name",children:"📈 Daily Volume (14 days)"})})}),i.jsx("div",{style:{display:"flex",alignItems:"flex-end",height:60,marginTop:8,gap:2},children:n.conversations.analytics.dailyVolume.map(({date:C,count:V})=>{const re=Math.max(...n.conversations.analytics.dailyVolume.map(H=>H.count),1),A=Math.round(V/re*50);return i.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center"},children:i.jsx("div",{style:{width:"100%",height:A,background:"var(--accent-green)",borderRadius:2},title:`${C}: ${V} messages`})},C)})}),i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:10,color:"var(--muted)",marginTop:4},children:[i.jsx("span",{children:(Ql=n.conversations.analytics.dailyVolume[0])==null?void 0:Ql.date}),i.jsx("span",{children:(jd=n.conversations.analytics.dailyVolume[n.conversations.analytics.dailyVolume.length-1])==null?void 0:jd.date})]})]})]}):null]}),i.jsx("h2",{className:"section-subtitle",children:"💬 Per-contact chat history"}),i.jsx("p",{className:"admin-hint",children:"Conversation history is stored per-contact and survives gateway restarts. Messages older than 7 days are auto-pruned. Click a conversation to expand the full chat thread."}),Ft.length>0||sn?i.jsxs(i.Fragment,{children:[Mn.length>0&&i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginBottom:8},children:[i.jsx("span",{className:"admin-hint",style:{marginRight:4},children:"Filter by tag:"}),Mn.map(C=>i.jsxs("button",{type:"button",onClick:()=>an(Mt===C?"":C),style:{padding:"2px 10px",borderRadius:12,fontSize:11,cursor:"pointer",border:`1px solid ${Mt===C?"var(--accent-blue)":"var(--border)"}`,background:Mt===C?"color-mix(in srgb, var(--accent-blue) 13%, transparent)":"transparent",color:Mt===C?"var(--accent-blue)":"var(--muted)"},children:["🏷️ ",C]},C))]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12,flexWrap:"wrap"},children:[i.jsx("input",{type:"text",value:We,onChange:C=>lt(C.target.value),placeholder:"🔍 Search by contact name, phone number, or message content…",style:{flex:1,minWidth:200}}),i.jsxs("span",{className:"admin-hint",children:[cr," conversation",cr===1?"":"s",We?` matching "${We}"`:""]}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:qi,style:{fontSize:12,padding:"4px 10px"},children:$e.size===Ft.length?"☑ Deselect All":"☐ Select All"}),$e.size>0&&i.jsx("button",{type:"button",className:"admin-refresh-btn",disabled:Le,onClick:()=>void Qs(),style:{fontSize:12,padding:"4px 10px",background:"var(--accent-blue)",color:"var(--text-on-accent)",border:"none"},children:Le?"⏳ Exporting…":`📦 Export ${$e.size} as ZIP`})]}),i.jsxs("div",{className:"hub-session-list",children:[Ft.filter(C=>!Mt||(C.tags??[]).includes(Mt)).map(C=>{const V=Date.now()-C.lastActiveAt,re=V<6e4?"just now":V<36e5?`${Math.round(V/6e4)}m ago`:V<864e5?`${Math.round(V/36e5)}h ago`:`${Math.round(V/864e5)}d ago`,A=_e===C.key,{name:H,phone:Y}=Ul(C),he=async ue=>{if(ue.stopPropagation(),!h||!at){G({kind:"err",text:"🔐 Log in (admin/operator) to clear conversations."});return}q(C.key);try{await K.clearGatewayConversation(C.key),He()}catch{}q(null)},Re=$e.has(C.key);return i.jsxs("div",{className:"hub-card",style:{cursor:"pointer",borderLeft:`3px solid ${C.platform==="whatsapp"?"#25d366":C.platform==="telegram"?"#0088cc":"var(--text-muted)"}`,opacity:$e.size>0&&!Re?.5:1,transition:"opacity 0.2s"},onClick:()=>pt(A?null:C.key),children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[i.jsx("input",{type:"checkbox",checked:Re,onClick:ue=>Gi(C.key,ue),onChange:()=>{},style:{cursor:"pointer",width:16,height:16}}),i.jsxs("div",{className:"hub-card-title",children:[i.jsxs("span",{className:"hub-card-name",children:[C.platform==="whatsapp"?"📱":C.platform==="telegram"?"✈️":"💬"," ",H]}),i.jsxs("span",{className:"hub-card-id",children:[Y&&i.jsx("span",{style:{color:"var(--text-secondary, var(--text-secondary))",marginRight:6},children:Y}),C.platform," · ",re]})]})]}),i.jsxs("div",{className:"hub-card-actions",style:{gap:6},children:[i.jsxs("span",{className:"hub-chip",children:[C.messageCount," msgs"]}),A&&C.messages&&C.messages.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"hub-mini-btn",onClick:ue=>Zs(C,ue),title:"Export as text file",children:"📄"}),i.jsx("button",{type:"button",className:"hub-mini-btn",onClick:ue=>ka(C,ue),title:"Export as PDF (opens print dialog)",children:"📑"})]}),i.jsx("button",{type:"button",className:"hub-mini-btn",disabled:Yt===C.key,onClick:he,title:"Clear conversation history",style:{color:"var(--accent-red)"},children:"🗑️"}),i.jsx("span",{style:{fontSize:18,transition:"transform 0.2s",transform:A?"rotate(180deg)":"none"},children:"▼"})]})]}),i.jsxs("p",{className:"hub-card-desc",style:{fontStyle:"italic",color:"var(--text-muted, var(--text-muted))"},children:[i.jsx("span",{style:{color:"var(--text-primary, var(--text-primary))",fontWeight:500},children:"Last message:"})," ",C.lastUserMessage.slice(0,120),C.lastUserMessage.length>120?"…":""]}),i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginTop:4},children:[(C.tags??[]).map(ue=>i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:2,padding:"2px 8px",borderRadius:12,fontSize:11,background:"color-mix(in srgb, var(--accent-blue) 13%, transparent)",color:"var(--accent-blue)",border:"1px solid color-mix(in srgb, var(--accent-blue) 25%, transparent)"},children:["🏷️ ",ue,i.jsx("button",{type:"button",onClick:Ne=>{Ne.stopPropagation(),et(C.key,ue)},style:{background:"none",border:"none",color:"var(--accent-blue)",cursor:"pointer",padding:0,fontSize:12,lineHeight:1},children:"×"})]},ue)),or===C.key?i.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:2},children:i.jsx("input",{type:"text",value:Gn,onChange:ue=>At(ue.target.value),onKeyDown:ue=>{ue.key==="Enter"&&Qa(C.key,Gn),ue.key==="Escape"&&(In(null),At(""))},placeholder:"tag name",autoFocus:!0,onClick:ue=>ue.stopPropagation(),style:{width:80,padding:"1px 6px",fontSize:11,borderRadius:8,border:"1px solid var(--border)"}})}):i.jsx("button",{type:"button",onClick:ue=>{ue.stopPropagation(),In(C.key),At("")},style:{display:"inline-flex",alignItems:"center",gap:2,padding:"2px 8px",borderRadius:12,fontSize:11,background:"var(--border)",color:"var(--muted)",border:"none",cursor:"pointer"},children:"+ tag"})]}),A&&C.messages&&C.messages.length>0?i.jsxs("div",{className:"conversation-thread",style:{marginTop:10,borderTop:"1px solid var(--border)",paddingTop:10,maxHeight:400,overflowY:"auto"},children:[C.messages.map((ue,Ne)=>i.jsxs("div",{style:{marginBottom:8,display:"flex",flexDirection:"column",alignItems:ue.role==="user"?"flex-end":"flex-start"},children:[i.jsxs("div",{style:{maxWidth:"80%",padding:"8px 12px",borderRadius:12,backgroundColor:ue.role==="user"?"var(--accent-blue)":"var(--bg-card, var(--bg-card))",color:ue.role==="user"?"var(--text-on-accent)":"var(--text-primary, var(--text-primary))",fontSize:13,lineHeight:1.5,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:[ue.content.slice(0,500),ue.content.length>500?"…":""]}),i.jsxs("span",{style:{fontSize:10,color:"var(--muted)",marginTop:2,padding:"0 4px"},children:[ue.role==="user"?"👤":"🤖"," ",new Date(ue.ts).toLocaleString()]})]},Ne)),pe.has(C.key)&&i.jsxs("div",{style:{marginBottom:8,display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[i.jsxs("div",{style:{padding:"8px 16px",borderRadius:12,backgroundColor:"var(--bg-card, var(--bg-card))",fontSize:13,display:"flex",alignItems:"center",gap:4},children:[i.jsx("span",{style:{animation:"typingBlink 1.4s infinite ease-in-out"},children:"●"}),i.jsx("span",{style:{animation:"typingBlink 1.4s infinite ease-in-out 0.2s"},children:"●"}),i.jsx("span",{style:{animation:"typingBlink 1.4s infinite ease-in-out 0.4s"},children:"●"})]}),i.jsx("span",{style:{fontSize:10,color:"var(--muted)",marginTop:2,padding:"0 4px"},children:"🤖 typing…"})]})]}):A?i.jsx("p",{className:"admin-hint",style:{marginTop:8},children:"No message details available."}):null]},C.key)}),pn&&!sn&&i.jsx("div",{ref:wa,style:{height:1}}),sn&&i.jsxs("div",{className:"loading-state",style:{padding:12},children:[i.jsx("div",{className:"loading-spinner"}),i.jsx("span",{className:"admin-hint",style:{marginLeft:8},children:"Loading more conversations…"})]}),!sn&&!pn&&Ft.length>0&&i.jsxs("p",{className:"admin-hint",style:{textAlign:"center",padding:12},children:["All ",cr," conversation",cr===1?"":"s"," loaded."]})]})]}):sn?i.jsxs("div",{className:"loading-state",children:[i.jsx("div",{className:"loading-spinner"}),i.jsx("p",{className:"admin-hint",children:"Loading conversations…"})]}):i.jsx("div",{className:"empty-state",children:"No conversations stored yet. Conversations are created when users message the agent via WhatsApp/Telegram/etc."})]}):null,e==="artifacts"&&n?i.jsxs("div",{role:"tabpanel",children:[i.jsxs("div",{className:"admin-summary-grid",children:[i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.artifacts.totalSessions}),i.jsx("div",{className:"admin-summary-label",children:"Sessions"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.artifacts.totalArtifacts}),i.jsx("div",{className:"admin-summary-label",children:"Artifacts"})]})]}),n.artifacts.sessions.length>0?i.jsx("div",{className:"hub-session-list",children:n.artifacts.sessions.map(C=>i.jsxs("div",{className:"hub-card",children:[i.jsx("div",{className:"hub-card-top",children:i.jsxs("div",{className:"hub-card-title",children:[i.jsx("span",{className:"hub-card-name",children:C.sessionId}),i.jsxs("span",{className:"hub-card-id",children:[C.count," artifact",C.count===1?"":"s"," · ",new Date(C.latestAt).toLocaleString()]})]})}),C.recent.length>0?i.jsx("ul",{className:"hub-artifact-list",children:C.recent.map((V,re)=>i.jsxs("li",{children:[i.jsx("span",{className:"hub-chip",children:V.kind}),i.jsx("span",{className:"hub-artifact-title",children:V.title||"(untitled)"}),uf(V)&&Nle(V.mime)?i.jsx("video",{className:"hub-artifact-media",controls:!0,preload:"metadata","data-testid":"artifact-video",src:bE(C.sessionId,uf(V))}):uf(V)&&Ele(V.mime)?i.jsx("img",{className:"hub-artifact-media","data-testid":"artifact-image",alt:V.title||"artifact",src:bE(C.sessionId,uf(V))}):V.preview?i.jsx("div",{className:"hub-artifact-preview",children:V.preview}):null]},re))}):i.jsx("div",{className:"admin-hint",children:"No artifact details."})]},C.sessionId))}):i.jsx("div",{className:"empty-state",children:"No artifacts yet — tools that return a deliverable payload land here per session."})]}):null,e==="skills"&&n?i.jsxs("div",{role:"tabpanel",children:[i.jsxs("div",{className:"admin-summary-grid",children:[i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.skills.enabled}),i.jsx("div",{className:"admin-summary-label",children:"Enabled skills"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.skills.disabled}),i.jsx("div",{className:"admin-summary-label",children:"Disabled skills"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.skills.hub.length}),i.jsx("div",{className:"admin-summary-label",children:"Hub skills (SKILL.md)"})]})]}),i.jsx("h2",{className:"section-subtitle",children:"📚 Compiled skills (SkillStore — matched at plan time)"}),n.skills.compiled.length>0?i.jsx("div",{className:"hub-session-list",children:n.skills.compiled.map(C=>i.jsxs("div",{className:`hub-card${C.enabled?"":" hub-card-disabled"}`,children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsxs("div",{className:"hub-card-title",children:[i.jsx("span",{className:"hub-card-name",children:C.name}),i.jsxs("span",{className:"hub-card-id",children:[C.id,C.version?` · v${C.version}`:""]})]}),i.jsxs("div",{className:"hub-card-actions",children:[C.bundled===!0?i.jsx("span",{className:"hub-chip hub-chip-bundled",children:"🧠 bundled"}):i.jsx("span",{className:"hub-chip",children:"community"}),i.jsx("button",{role:"switch","aria-checked":C.enabled,"aria-label":`${C.enabled?"Disable":"Enable"} ${C.name}`,className:`hub-switch${C.enabled?" on":""}`,disabled:B===C.id||R!==null||h&&!at,onClick:()=>Gl(C.id,!C.enabled),children:i.jsx("span",{className:"hub-switch-knob"})})]})]}),i.jsx("p",{className:"hub-card-desc",children:C.description}),i.jsxs("div",{className:"hub-card-tools",children:[typeof C.usageCount=="number"?i.jsxs("span",{className:"hub-chip",children:[C.usageCount," uses"]}):null,C.enabled?null:i.jsx("span",{className:"hub-chip",children:"disabled"})]}),I[C.id]?i.jsx("div",{className:"admin-row-msg",children:I[C.id]}):null,C.enabled?null:i.jsx("div",{className:"hub-card-note",children:"⛔ Excluded from skill matching — not injected into the planner"})]},`c-${C.id}`))}):i.jsx("div",{className:"empty-state",children:"No compiled skills."}),i.jsx("h2",{className:"section-subtitle",children:"🌍 Hub skills (installed SKILL.md)"}),n.skills.hub.length>0?i.jsx("div",{className:"hub-session-list",children:n.skills.hub.map(C=>i.jsxs("div",{className:`hub-card${C.enabled?"":" hub-card-disabled"}`,children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsxs("div",{className:"hub-card-title",children:[i.jsx("span",{className:"hub-card-name",children:C.name}),i.jsx("span",{className:"hub-card-id",children:C.id})]}),i.jsxs("div",{className:"hub-card-actions",children:[i.jsx("button",{type:"button",className:"hub-mini-btn",disabled:ne===C.id||h&&!at,onClick:()=>void Wl(C.id),children:"🗑 Uninstall"}),i.jsx("button",{role:"switch","aria-checked":C.enabled,"aria-label":`${C.enabled?"Disable":"Enable"} ${C.name}`,className:`hub-switch${C.enabled?" on":""}`,disabled:B===C.id||R!==null||h&&!at,onClick:()=>Gl(C.id,!C.enabled),children:i.jsx("span",{className:"hub-switch-knob"})})]})]}),i.jsx("p",{className:"hub-card-desc",children:C.description}),i.jsxs("div",{className:"hub-card-tools",children:[i.jsx("span",{className:"hub-chip",children:"SKILL.md"}),C.enabled?null:i.jsx("span",{className:"hub-chip",children:"disabled"})]}),I[C.id]?i.jsx("div",{className:"admin-row-msg",children:I[C.id]}):null,C.enabled?null:i.jsx("div",{className:"hub-card-note",children:"⛔ Excluded from skill matching — not injected into the planner"})]},`h-${C.id}`))}):i.jsxs("div",{className:"empty-state",children:["No hub skills installed — search the marketplace below or run ",i.jsx("code",{children:"nuvira skills install <name>"}),"."]}),i.jsx("h2",{className:"section-subtitle",children:"🛒 Marketplace (community skills)"}),i.jsxs("form",{className:"hub-market-search",onSubmit:Xr,children:[i.jsx("input",{type:"text",value:Sa,onChange:C=>Za(C.target.value),placeholder:"Search community skills (e.g. code-assist, deploy, testing)…"}),i.jsx("button",{type:"submit",className:"admin-refresh-btn",disabled:Vr,children:Vr?"Searching…":"🔎 Search"})]}),ja?i.jsx("div",{className:`admin-row-msg${ja.kind==="err"?" admin-row-msg-err":""}`,children:ja.text}):null,Vi&&!Vr?Ki.length>0?i.jsx("div",{className:"hub-session-list",children:Ki.map(C=>i.jsxs("div",{className:"hub-card",children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsxs("div",{className:"hub-card-title",children:[i.jsx("span",{className:"hub-card-name",children:C.name}),i.jsxs("span",{className:"hub-card-id",children:["v",C.version," · ",C.sourceKind]})]}),i.jsx("button",{type:"button",className:"admin-refresh-btn",disabled:ne===C.name||h&&!at,onClick:()=>void Qi(C.name),children:ne===C.name?"Installing…":"⬇ Install"})]}),i.jsx("p",{className:"hub-card-desc",children:C.description}),i.jsxs("div",{className:"hub-card-tools",children:[i.jsx("span",{className:"hub-chip",children:C.author}),C.tags.slice(0,3).map(V=>i.jsx("span",{className:"hub-chip",children:V},V))]})]},`m-${C.name}`))}):i.jsxs("div",{className:"empty-state",children:['No skills match "',Sa,'" — try a broader term, or add a registry to ',i.jsx("code",{children:"skills.registries"})," in config."]}):null]}):null,e==="subagents"&&n?i.jsxs("div",{role:"tabpanel",children:[i.jsxs("div",{className:"admin-summary-grid",children:[i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:((Zl=n.subagents)==null?void 0:Zl.total)??0}),i.jsx("div",{className:"admin-summary-label",children:"Runs recorded"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:((Jr=n.subagents)==null?void 0:Jr.running)??0}),i.jsx("div",{className:"admin-summary-label",children:"Running now"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:((Jl=n.subagents)==null?void 0:Jl.failed)??0}),i.jsx("div",{className:"admin-summary-label",children:"Failed"})]})]}),i.jsxs("p",{className:"admin-hint",children:["Each run is a separate child process. A transport of ",i.jsx("code",{children:"json"})," means the provider has no native tool protocol and the shared JSON fallback carried the tool calls; a refusal code means the run stopped deliberately instead of returning an answer."]}),(((Nd=n.subagents)==null?void 0:Nd.recent)??[]).length>0?i.jsx("div",{className:"hub-session-list",children:(((Ed=n.subagents)==null?void 0:Ed.recent)??[]).map(C=>i.jsxs("div",{className:"hub-card",children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsxs("div",{className:"hub-card-title",children:[i.jsx("span",{className:"hub-card-name",children:C.goal||"(no goal recorded)"}),i.jsxs("span",{className:"hub-card-id",children:[C.id.slice(0,8),C.startedAt?` · ${new Date(C.startedAt).toLocaleString()}`:""]})]}),i.jsx("div",{className:"hub-card-actions",children:i.jsx("span",{className:"hub-chip",children:Tle[C.status]??C.status})})]}),i.jsxs("div",{className:"hub-card-tools",children:[i.jsxs("span",{className:"hub-chip",children:["🔌 ",C.provider??"provider unknown",C.model?` · ${C.model}`:""]}),i.jsxs("span",{className:"hub-chip",children:["🛠 ",C.transport??"transport unknown"," transport"]}),i.jsxs("span",{className:"hub-chip",children:[C.llmCalls," model call",C.llmCalls===1?"":"s"]}),i.jsxs("span",{className:"hub-chip",children:[C.toolCalls," tool call",C.toolCalls===1?"":"s"]}),typeof C.durationMs=="number"?i.jsxs("span",{className:"hub-chip",children:[(C.durationMs/1e3).toFixed(1),"s"]}):null]}),C.refusalCode?i.jsxs("div",{className:"hub-card-note",children:["⛔ Refused before answering — code ",i.jsx("code",{children:C.refusalCode})]}):null,C.error?i.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:C.error}):null,C.resultPreview?i.jsx("div",{className:"hub-artifact-preview",children:C.resultPreview}):null]},C.id))}):i.jsxs("div",{className:"empty-state",children:["No subagent runs recorded yet — a run shows up here once the agent spawns one (the ",i.jsx("code",{children:"subagent"})," tool), and only if it actually started."]})]}):null]})}const Mle=298,Ile=58,$le=[{name:"admin",description:"Admin governance policy for Auto routing (P6 M6.5) — allow/deny providers & models, hard cost cap, PII privacy, unblock control",commands:[{name:"admin policy",description:"Show the current governance policy + enforcement status",flags:["--json"]},{name:"admin allow",description:"Add providers to the allow-list (empty = all providers allowed)",flags:[]},{name:"admin deny",description:"Add providers to the deny-list (wins over the allow-list)",flags:[]},{name:"admin allow-model",description:"Add models to the allow-list — a provider survives only if one of its candidate models is listed",flags:[]},{name:"admin deny-model",description:"Add models to the deny-list (wins over the allow-list)",flags:[]},{name:"admin max-cost",description:"Set the admin hard max cost per call (USD); joins routing.maxCostUsd (stricter wins)",flags:[]},{name:"admin pii-min",description:"Set the minimum privacy score (0-1) required when a task matches a PII pattern (default 1.0 = local-only)",flags:[]},{name:"admin unblock",description:"Control whether `nuvira models unblock` may override REGISTRY-learned blocks (false = admin-hard)",flags:[]},{name:"admin clear",description:"Remove one governance rule (the policy becomes permissive on that field)",flags:[]},{name:"admin role",description:"Manage RBAC roles over the admin surface (P6 M6.1 — requires admin role)",flags:[]},{name:"admin role add",description:"Assign a role to a user (first assignment exits legacy single-user mode)",flags:[]},{name:"admin role remove",description:"Remove a user's role assignment (if none remain, legacy permissive mode resumes)",flags:[]},{name:"admin role list",description:"List all role assignments",flags:[]},{name:"admin whoami",description:"Show the current identity and its effective RBAC permissions",flags:[]},{name:"admin cron",description:"Scheduled tool invocations (J2 — cron/jobs.py)",flags:[]},{name:"admin cron add",description:'Add a cron job: nuvira admin cron add nightly-build "0 3 * * *" build',flags:["--args <args>","--channel <channel>","--dry-run"]},{name:"admin cron list",description:"List cron jobs with schedule + next run",flags:[]},{name:"admin cron remove",description:"Remove a cron job",flags:[]},{name:"admin cron run",description:"Run a cron job NOW (invoke its tool immediately)",flags:[]}]},{name:"chat",description:"Start an interactive chat session with AI",commands:[]},{name:"edit",description:"Edit a file using AI assistance",commands:[]},{name:"plan",description:"Generate an implementation plan for a codebase task",commands:[]},{name:"config",description:"Manage Nuvira configuration",commands:[{name:"config set",description:"Set a configuration value",flags:[]},{name:"config get",description:"Get a configuration value",flags:[]},{name:"config list",description:"List all providers and their status",flags:[]},{name:"config init",description:"Initialize configuration interactively",flags:[]},{name:"config vault",description:"Secret vault management (Phase A1)",flags:[]},{name:"config vault status",description:"Show the active vault tier and migration state",flags:[]},{name:"config vault log",description:"Show recent vault access-log entries (K3 tamper-evident audit)",flags:["--limit <limit>"]},{name:"config vault migrate-keys",description:"Move plaintext provider API keys from buffconfig.json into the vault",flags:[]},{name:"config gateway",description:"Manage gateway platform transports (tokens written to ~/.nuvira/.env)",flags:[]},{name:"config gateway list",description:"Show every platform transport and its env-var status",flags:[]},{name:"config gateway set",description:"Configure a platform transport (interactive wizard, or --set VAR=value)",flags:["--set <set>"]},{name:"config gateway remove",description:"Remove a platform transport from the env file",flags:["--yes"]},{name:"config gateway allow",description:"Allow a user/group to trigger the agent on a platform (written to gateway.policies in config)",flags:[]},{name:"config gateway disallow",description:"Remove a user/group from the allowed list of a platform",flags:[]},{name:"config gateway reply",description:"Set how unapproved senders are handled on a platform: polite (⛔ message) or silent (no reply)",flags:[]},{name:"config gateway send-authority",description:"Manage who may command the agent to send to OTHER people (gateway_send). Outbound-only gate — separate from `allow` (who may trigger).",flags:[]},{name:"config gateway notify",description:"Manage status recipients — contacts/groups that ALWAYS get pipeline completion summaries",flags:[]},{name:"config gateway ask-user-wait",description:"Ask-and-wait for clarifying questions on messaging channels: when a turn asks the sender a question, hold it for their reply instead of assuming option 1",flags:[]},{name:"config service",description:"Manage third-party service keys (image/video/search/vision/speech) in ~/.nuvira/.env",flags:[]},{name:"config service list",description:"Show every service backend and its env-var status",flags:[]},{name:"config service set",description:"Set a service key: config service set <serviceId> <ENV_VAR> <value> (or --set VAR=value)",flags:["--set <set>"]},{name:"config service unset",description:"Remove a service key (all vars, or one with [varName]) from the env file",flags:["--yes"]},{name:"config limit",description:"Show or change the size limits for document extraction and attachments",flags:[]},{name:"config limit list",description:"Show the effective extraction and attachment limits",flags:[]},{name:"config limit set",description:"Set a limit: config limit set <extract-max-chars|attachment-max-kb> <value>",flags:[]},{name:"config limit unset",description:"Restore a limit to its default",flags:[]},{name:"config capability",description:"Show or change the capability mode (balanced | max)",flags:[]},{name:"config capability show",description:"Show the effective capability mode",flags:[]},{name:"config capability set",description:"Set the capability mode: config capability set <balanced|max>",flags:[]},{name:"config capability unset",description:"Restore the default capability mode (balanced)",flags:[]},{name:"config catalog-feed",description:"Show or change the OpenRouter catalogue feed (cost/ecosystem priors only)",flags:[]},{name:"config catalog-feed show",description:"Show whether the catalogue feed is on, and how old its snapshot is",flags:[]},{name:"config catalog-feed set",description:"Enable or disable: config catalog-feed set <on|off>",flags:[]},{name:"config catalog-feed unset",description:"Remove the setting, restoring the default (off)",flags:[]},{name:"config catalog-feed refresh",description:"Fetch a fresh catalogue snapshot now (never runs during a turn)",flags:[]}]},{name:"cache",description:"Manage inference cache",commands:[{name:"cache stats",description:"Show cache statistics",flags:[]},{name:"cache clear",description:"Clear cached responses — all of them, or one workspace (project folder)",flags:["--unscoped"]}]},{name:"models",description:"List available models from inference providers",commands:[{name:"models refresh",description:"Probe providers and spot-check models, updating the Model Availability Registry",flags:["--json","--no-spot-check"]},{name:"models status",description:"Show the Model Availability Registry (verified / unavailable / quota-parked models)",flags:["--json","--verbose"]},{name:"models unblock",description:"Manually release a registry-blocked provider (escape hatch) and re-probe it against the live API",flags:["--json","--no-spot-check"]},{name:"models warm",description:"Run one warmup cycle now: keep hot models warm, verify new ones, refresh the stale pool",flags:["--json"]},{name:"models excluded",description:"Show which providers routing is currently skipping, and why (failure cooldowns, registry blocks, governance policy)",flags:["--json"]},{name:"models staleness",description:"Show model staleness: last probe time, days since verification, and removal risk",flags:["--json"]},{name:"models watch",description:"Run the model-registry maintenance daemon: probe + spot-check on a schedule",flags:["--interval <interval>","--no-spot-check"]}]},{name:"execute",description:"Run a multi-agent pipeline to accomplish a goal",commands:[]},{name:"run",description:"Execute a shell command and show output (lightweight alternative to the full pipeline)",commands:[]},{name:"workflow",description:"Run, manage, and share workflow templates",commands:[{name:"workflow list",description:"Show available workflow templates (built-in + installed)",flags:[]},{name:"workflow run",description:"Run a workflow template",flags:["--dry-run","--model <model>","--provider <provider>","--verbose"]},{name:"workflow search",description:"Search the GitHub workflow template registry",flags:["--refresh"]},{name:"workflow install",description:"Install a workflow template from the GitHub registry",flags:[]},{name:"workflow publish",description:"Prepare a local workflow template for publishing to the registry",flags:[]},{name:"workflow info",description:"Show detailed information about a registry template",flags:[]},{name:"workflow upgrade",description:"Check for and apply template upgrades from the registry",flags:[]}]},{name:"whatsapp",description:"WhatsApp bridge (Baileys) — pair a personal number via QR and check status (I8)",commands:[{name:"whatsapp pair",description:"Pair WhatsApp (personal number — no Meta Business account, no paid API)",flags:["--phone <phone>","--timeout <timeout>"]},{name:"whatsapp status",description:"Show bridge session path + pairing state",flags:[]},{name:"whatsapp contacts",description:"List resolvable contacts (mapping file + learned) — connects briefly to learn names from live traffic",flags:["--timeout <timeout>"]},{name:"whatsapp contact",description:'Manage the WhatsApp contact-name mapping (send by name: nuvira gateway send whatsapp:<Name> "message")',flags:[]},{name:"whatsapp contact add",description:"Map a display name to a number (E.164, no +): nuvira whatsapp contact add Name 919876543210",flags:[]},{name:"whatsapp contact remove",description:"Remove a mapped contact name",flags:[]}]},{name:"plugins",description:"Manage provider plugins, agent plugins, and workflow templates",commands:[{name:"plugins list",description:"List all discovered plugins and workflows",flags:[]},{name:"plugins scan",description:"Force re-scan all plugin directories",flags:[]}]},{name:"learn",description:"Self-improvement system — agent stats, patterns, and optimization",commands:[{name:"learn stats",description:"Show per-agent performance statistics",flags:[]},{name:"learn patterns",description:"Show extracted coding patterns",flags:["--extract","--model <model>","--provider <provider>"]},{name:"learn lessons",description:"Show failure lessons — what past runs learned from mistakes",flags:["--extract","--model <model>","--provider <provider>"]},{name:"learn optimize",description:"Generate optimized model-to-agent routing recommendations",flags:[]},{name:"learn status",description:"Show overall self-improvement status",flags:[]},{name:"learn clear",description:"Reset all learning data (stats, patterns, memory)",flags:["--force"]},{name:"learn compare",description:"Compare benchmark results between two models",flags:["--all","--last"]},{name:"learn feedback",description:"Rate a trajectory or view feedback statistics",flags:["--comment <comment>","--rating <rating>","--stats","--trajectory <trajectory>"]},{name:"learn quality",description:"Show pattern quality and decay metrics",flags:["--details"]},{name:"learn gc",description:"Garbage-collect low-quality patterns",flags:["--dry-run"]}]},{name:"init",description:"Scaffold a new project from a template",commands:[]},{name:"stats",description:"View usage statistics and cost tracking",commands:[{name:"stats cost",description:"Show API cost tracking details",flags:["--clear"]},{name:"stats cost reconcile",description:"Compare this ledger to a provider's OWN invoice for a window (the only 'actual' figure)",flags:["--amount <amount>","--days <days>","--declare-tier [declare_tier]","--json","--note <note>","--provider <provider>","--since <since>","--until <until>"]},{name:"stats cost reprice",description:"Re-price legacy ledger rows with the ONE price source; drop test rows (dry run by default)",flags:["--apply","--file <file>","--json","--keep-test-rows"]},{name:"stats history",description:"Show conversation history statistics",flags:[]}]},{name:"history",description:"Browse and search conversation history",commands:[{name:"history list",description:"Show all saved conversations",flags:["--limit <limit>"]},{name:"history search",description:"Search conversations by keyword or semantic similarity",flags:["--limit <limit>","--semantic"]},{name:"history show",description:"Show a specific conversation",flags:[]},{name:"history clear",description:"Clear all conversation history",flags:[]},{name:"history prune",description:"Remove conversations older than the retention period",flags:["--days <days>"]},{name:"history reindex",description:"Rebuild the semantic search index for all past conversations (embeds each session for vector search)",flags:[]}]},{name:"skill",description:"Manage and run compiled skills — reusable execution plans derived from past trajectories",commands:[{name:"skill list",description:"List all compiled skills",flags:["--quality <quality>"]},{name:"skill show",description:"Show detailed skill definition",flags:[]},{name:"skill run",description:"Run a skill — resolves parameters and invokes the multi-agent pipeline",flags:["--auto-route","--dry-run","--memory","--model <model>","--params <params>","--provider <provider>","--verbose"]},{name:"skill compile",description:"Force skill compilation from stored trajectories",flags:["--model <model>","--provider <provider>"]},{name:"skill search",description:"Search skills by name, tag, or description",flags:[]},{name:"skill gc",description:"Garbage-collect low-quality skills",flags:["--dry-run"]},{name:"skill quality",description:"Show skill quality and decay metrics",flags:["--details"]},{name:"skill clear",description:"Remove all compiled skills",flags:["--force"]}]},{name:"skills",description:"Skills hub — search, install, update, and audit community skills (J3)",commands:[{name:"skills search",description:"Search all configured skill registries (I7 P1 multi-source)",flags:["--refresh","--source <source>"]},{name:"skills install",description:"Install a skill from the configured registries into <project>/.agents/skills/ (sandboxed, checksummed)",flags:["--project <project>","--source <source>"]},{name:"skills uninstall",description:"Uninstall a skill: removes .agents/skills/<name> and its provenance record",flags:["--project <project>"]},{name:"skills update",description:"Update installed skills to newer registry versions (checksum-verified)",flags:["--project <project>"]},{name:"skills bundle",description:"P6b — skill bundles: group skills under one id and load them together (Hermes parity)",flags:["--create","--delete","--description <description>","--name <name>","--skills <skills>"]},{name:"skills list",description:"List installed skills with provenance (origin: registry vs local)",flags:["--origin <origin>","--project <project>"]}]},{name:"gateway",description:"Multi-channel gateway — talk to the agent from Telegram/Discord/Slack/WhatsApp/Email/Signal (J1)",commands:[{name:"gateway status",description:"Show configured adapters and reachable channels",flags:[]},{name:"gateway send",description:"Send a message to a channel alias or platform:channelId",flags:[]},{name:"gateway send-media",description:"Send a media file (image/video/audio/document) — type from the file extension; WhatsApp/Telegram/Discord",flags:["--caption <caption>"]},{name:"gateway alias",description:"Manage channel aliases",flags:[]},{name:"gateway alias add",description:"Register an alias: nuvira gateway alias add ops slack C0123",flags:[]},{name:"gateway alias remove",description:"Remove an alias",flags:[]},{name:"gateway contact",description:"Manage contacts for outbound messaging (name → platform:id resolution)",flags:[]},{name:"gateway contact list",description:"List all contacts with status, platform, and ID",flags:["--pending","--platform <platform>"]},{name:"gateway contact approve",description:"Approve a contact for outbound messaging",flags:["--platform <platform>"]},{name:"gateway contact reject",description:"Reject a contact (block outbound messages)",flags:["--platform <platform>"]},{name:"gateway contact delete",description:"Delete a contact permanently",flags:["--platform <platform>"]},{name:"gateway contact add",description:"Manually add a contact (e.g. nuvira gateway contact add Anuj telegram 616825477)",flags:["--phone <phone>"]},{name:"gateway delivery",description:"Show the delivery ledger (failed sends awaiting retry) and optionally drain it",flags:["--flush"]},{name:"gateway logs",description:"Show the structured gateway log (send failures, refused senders, pipeline outcomes)",flags:["--event <event>","--limit <limit>","--path"]},{name:"gateway history",description:"Manage per-contact conversation history (gateway chat memory)",flags:[]},{name:"gateway history list",description:"List all stored conversations with last message preview",flags:["--platform <platform>"]},{name:"gateway history show",description:"Show conversation history for a contact (e.g. nuvira gateway history show whatsapp:918800663237)",flags:["--limit <limit>"]},{name:"gateway history clear",description:"Clear conversation history for a contact",flags:[]},{name:"gateway history prune",description:"Remove conversations older than 7 days",flags:[]},{name:"gateway start",description:"Run all configured adapters in the foreground (Ctrl-C to stop; --supervise auto-restarts on crash)",flags:["--host <host>","--no-events","--port <port>","--supervise"]},{name:"gateway stop",description:"Stop a running gateway gracefully (SIGTERM — from any terminal)",flags:["--port <port>"]},{name:"gateway setup",description:"Interactive setup wizard for a messaging platform (e.g. nuvira gateway setup telegram)",flags:[]}]},{name:"omniroute",description:"Start / stop / inspect the external OmniRoute AI gateway (default port 20128)",commands:[{name:"omniroute status",description:"Probe the OmniRoute gateway and report whether it is reachable",flags:[]},{name:"omniroute start",description:"Start the OmniRoute gateway in the background and wait for it to answer",flags:[]},{name:"omniroute stop",description:"Stop the running OmniRoute gateway",flags:[]}]},{name:"model",description:"Manage inference providers and models — switch, list, inspect, and recommend",commands:[{name:"model list",description:"List all providers and their configuration status",flags:["--all","--json"]},{name:"model switch",description:"Switch active provider/model (interactive or via argument). Use `auto` for smart routing",flags:["--model <model>","--provider <provider>"]},{name:"model info",description:"Show current active provider and model configuration",flags:["--verbose"]},{name:"model recommend",description:"Show model routing recommendations",flags:[]},{name:"model explain",description:"Explain Auto model routing — why a provider/model would be picked for a task",flags:["--agent <agent>","--context-tokens <context_tokens>","--exclude-provider <exclude_provider>","--json","--since <since>"]},{name:"model health",description:"Quick health check for the currently active provider",flags:["--provider <provider>","--verbose"]},{name:"model bandit",description:"Show learning-router bandit state (Thompson-sampling priors per provider × complexity bucket). Action: reset",flags:["--json"]},{name:"model ml",description:"Show the ML task-similarity router state (learned outcomes per provider, kNN over task features). Action: reset",flags:["--json"]},{name:"model quota",description:"Show the central quota ledger (tokens/requests per provider × model, reset windows, parked state). Actions: reset | set <provider> | clear <provider>",flags:["--cost-usd <cost_usd>","--json","--requests <requests>","--tokens <tokens>","--window-ms <window_ms>"]}]},{name:"benchmark",description:"Run standardized model benchmarks against coding tasks",commands:[{name:"benchmark run",description:"Run the benchmark suite",flags:["--budget <budget>","--format <format>","--model <model>","--provider <provider>","--routing","--tasks <tasks>"]},{name:"benchmark list",description:"List available benchmark tasks",flags:[]},{name:"benchmark results",description:"Show previous benchmark results",flags:["--compare","--format <format>","--last"]},{name:"benchmark clear",description:"Clear all benchmark data",flags:[]}]},{name:"eval",description:"Run the Agent-Nuvira evaluation framework — measures if the agent is actually improving",commands:[{name:"eval run",description:"Run the evaluation suite",flags:["--budget <budget>","--engine <engine>","--format <format>","--keep-workspaces","--model <model>","--pace","--provider <provider>","--routing","--suite <suite>","--tasks <tasks>"]},{name:"eval parity",description:"Measure the capability gap: run the hard tasks under balanced AND max, then compare",flags:["--engine <engine>","--model <model>","--provider <provider>","--tasks <tasks>"]},{name:"eval verify-seeds",description:"Prove every seeded bug is genuinely broken (and genuinely fixable) — no provider needed",flags:["--tasks <tasks>"]},{name:"eval list",description:"List available eval tasks",flags:[]},{name:"eval results",description:"Show previous eval runs",flags:["--compare","--format <format>","--last"]},{name:"eval score",description:"Show the evaluation scoring rules",flags:[]},{name:"eval clear",description:"Clear all eval data",flags:[]}]},{name:"sandbox",description:"Manage Docker sandbox isolation for code execution",commands:[{name:"sandbox status",description:"Check Docker availability and sandbox status",flags:[]},{name:"sandbox config",description:"Show or update sandbox configuration",flags:["--cpu <cpu>","--disable","--disk <disk>","--enable","--image <image>","--memory <memory>","--network","--timeout <timeout>"]},{name:"sandbox images",description:"List available pre-defined sandbox images",flags:[]},{name:"sandbox run",description:"Run a command inside a new sandbox container",flags:["--cpu <cpu>","--image <image>","--memory <memory>","--network","--project <project>","--timeout <timeout>"]},{name:"sandbox cleanup",description:"Destroy all active sandbox containers",flags:[]}]},{name:"doctor",description:"Run diagnostic checks on all provider configurations and system health",commands:[]},{name:"memory",description:"Manage agent memory store — compression, pruning, and optimization",commands:[{name:"memory stats",description:"Show memory store statistics",flags:[]},{name:"memory optimize",description:"Run automatic memory compression and pruning",flags:["--aggressive","--dry-run"]},{name:"memory prune",description:"Prune old or low-quality trajectories",flags:["--max-age <max_age>","--max-count <max_count>","--min-score <min_score>","--verbose"]},{name:"memory summarize",description:"Summarize old trajectories by merging similar ones",flags:["--retention <retention>","--verbose"]},{name:"memory info",description:"Show detailed compression analysis",flags:[]},{name:"memory backend",description:"Show the active vector-search backend and why it was chosen",flags:["--check"]},{name:"memory list",description:"List all memory entries (facts, preferences, lessons, observations)",flags:["--limit <limit>","--type <type>"]},{name:"memory search",description:"Search memory entries by content",flags:["--limit <limit>","--type <type>"]},{name:"memory add",description:"Add a memory entry",flags:["--tags <tags>","--type <type>"]},{name:"memory delete",description:"Delete a memory entry by ID",flags:[]},{name:"memory export",description:"Export all memories to a JSON file",flags:["--output <output>"]},{name:"memory import",description:"Import memories from a JSON file",flags:["--merge"]},{name:"memory facts",description:"Fact & preference memory (project-scoped, cross-session)",flags:[]},{name:"memory facts list",description:"List facts, optionally for a project (git slug or cwd:<hash>)",flags:["--project <project>"]},{name:"memory facts add",description:"Manually store a fact for the current project",flags:["--project <project>","--tags <tags>"]},{name:"memory facts stats",description:"Show fact-store statistics",flags:[]},{name:"memory clear",description:"Clear all stored trajectories and reset memory",flags:["--force"]}]},{name:"dashboard",description:"Launch the web-based dashboard for visualizing agent execution and system status",commands:[{name:"dashboard stop",description:"Stop a running dashboard gracefully (SIGTERM — from any terminal)",flags:["--port <port>"]}]},{name:"agent",description:"Scaffold and manage custom agent-nuvira agents",commands:[{name:"agent create",description:"Create a new custom agent project from a template",flags:["--agent-name <agent_name>","--description <description>","--dir <dir>"]},{name:"agent list",description:"List all discovered custom agent plugins",flags:[]},{name:"agent info",description:"Show details about a discovered agent plugin",flags:[]}]},{name:"federation",description:"Connect to and manage remote agent instances",commands:[{name:"federation status",description:"Show federation connection status and configuration",flags:[]},{name:"federation start",description:"Start the federation server (listens for incoming connections)",flags:["--auth <auth>","--daemon","--host <host>","--oidc-public-key <oidc_public_key>","--port <port>","--secret <secret>"]},{name:"federation connect",description:"Connect to a remote federation server",flags:["--port <port>","--secret <secret>"]},{name:"federation disconnect",description:"Disconnect from the remote federation server",flags:[]},{name:"federation run",description:"Run a task on the remote federation server",flags:["--agent <agent>","--model <model>","--no-stream","--provider <provider>","--timeout <timeout>"]},{name:"federation health",description:"Check the health of the remote federation server",flags:[]},{name:"federation config",description:"Show or update federation configuration",flags:["--set-port <set_port>","--set-secret <set_secret>","--show"]},{name:"federation a2a",description:"A2A (Agent-to-Agent) protocol — discover and connect to external A2A-compliant agents",flags:[]},{name:"federation a2a discover",description:"Discover an A2A-compliant agent and fetch its AgentCard",flags:[]},{name:"federation a2a start",description:"Start the A2A server (listens for incoming A2A connections)",flags:["--host <host>","--port <port>"]},{name:"federation a2a status",description:"Check the health and status of a remote A2A agent",flags:[]},{name:"federation a2a run",description:"Delegate a task to a remote A2A-compliant agent",flags:["--agent <agent>","--skill <skill>","--timeout <timeout>"]}]},{name:"team",description:"Team collaboration — shared config, git-synced memory, and review workflow",commands:[{name:"team init",description:"Initialize team configuration in the working directory",flags:["--branch <branch>","--repo <repo>"]},{name:"team join",description:"Clone and join an existing team repository",flags:[]},{name:"team sync",description:"Sync team memory with remote (pull latest + push local changes)",flags:[]},{name:"team status",description:"Show team configuration and memory status",flags:[]},{name:"team share",description:"Share local trajectories and patterns with the team",flags:[]},{name:"team review",description:"Manage review bundles — agent PR → review → merge workflow",flags:[]},{name:"team review list",description:"List all review bundles",flags:["--limit <limit>"]},{name:"team review show",description:"Show a specific review bundle with full details",flags:[]},{name:"team review approve",description:"Approve a review bundle (sets status to approved)",flags:["--message <message>"]},{name:"team review request-changes",description:"Request changes on a review bundle",flags:[]},{name:"team review reject",description:"Reject a review bundle",flags:[]},{name:"team review merge",description:"Merge an approved review into the working directory",flags:[]},{name:"team review create",description:"Create a review bundle from specified files",flags:["--files <files>","--model <model>","--provider <provider>"]}]},{name:"sdk",description:"Create and manage custom agents with the Agent-Nuvira SDK",commands:[{name:"sdk scaffold",description:"Generate a new custom agent project",flags:["--agent-type <agent_type>","--template <template>"]},{name:"sdk templates",description:"List available scaffold templates",flags:[]},{name:"sdk info",description:"Show SDK package info and version",flags:[]},{name:"sdk register",description:"Register a custom agent with the orchestrator",flags:["--description <description>","--icon <icon>","--orchestrator-path <orchestrator_path>"]},{name:"sdk unregister",description:"Remove a custom agent from the orchestrator",flags:["--class-name <class_name>","--orchestrator-path <orchestrator_path>"]}]},{name:"provider",description:"List and check health of all inference providers",commands:[{name:"provider list",description:"Show all providers with color-coded status table",flags:["--all"]},{name:"provider health",description:"Show detailed health checks for one or all providers",flags:["--verbose","--watch"]}]},{name:"security",description:"Scan code, prompts, or files for security issues",commands:[{name:"security scan",description:"Scan for PII, injection attempts, or dangerous code patterns",flags:["--code","--file <file>","--generated","--json","--pii","--prompt","--stdin","--strict"]}]},{name:"audit",description:"Verify and export the tamper-evident (hash-chained) audit trail (P6 M6.3)",commands:[{name:"audit verify",description:"Verify hash-chain integrity of audit stores (tamper detection)",flags:["--file <file>","--json"]},{name:"audit export",description:"Export an audit store as SIEM-friendly CEF lines",flags:["--file <file>","--out <out>"]}]},{name:"sbom",description:"Generate and verify the CycloneDX software bill of materials (P6 M6.6)",commands:[]},{name:"feedback",description:"Record, view, and manage user feedback on agent outputs",commands:[{name:"feedback record",description:"Record feedback for a trajectory (interactive)",flags:["--comment <comment>","--negative","--neutral","--positive"]},{name:"feedback list",description:"Show recent feedback entries",flags:["--limit <limit>","--trajectory <trajectory>"]},{name:"feedback stats",description:"Show aggregated feedback statistics",flags:[]},{name:"feedback clear",description:"Clear all feedback data",flags:[]}]},{name:"nlu",description:"NLU request understanding — debug intent/entity/action resolution",commands:[{name:"nlu debug",description:"Debug how a request is understood (rule path + optional LLM verify)",flags:["--llm"]},{name:"nlu learnings",description:"Show the routing corrections learned from CONFIRMED misreadings (the agent improving itself)",flags:["--forget <forget>","--json"]}]},{name:"intent",description:"Plain-English → CLI routing — resolve an ask into the exact `nuvira` command(s) to run",commands:[{name:"intent resolve",description:'Resolve a plain-English ask (e.g. "stop the dashboard", "add Rahul to whatsapp") into CLI commands',flags:["--json","--semantic"]},{name:"intent eval",description:"Score deterministic vs semantic matching over a labeled ask corpus (novel phrasings included)",flags:["--json"]}]},{name:"code-map",description:"Project symbol map — functions, classes, methods with line numbers (AST engine)",commands:[]},{name:"tools",description:"Inspect the agent tool registry (pipeline + experience tools)",commands:[{name:"tools list",description:"List every registered tool (the H1 tool-calling surface)",flags:[]},{name:"tools show",description:"Show a tool's description and input schema",flags:[]},{name:"tools toolsets",description:"List toolset groups (capability gating) with enabled state; enable/disable a group",flags:["--disable <disable>","--enable <enable>"]},{name:"tools install",description:"Install the optional dependency an optional tool needs (see `nuvira tools optional`)",flags:["--package-only"]},{name:"tools optional",description:"List tools that are shipped but need an optional dependency installed",flags:[]}]},{name:"parity",description:"Surface-parity harness — prove the same experience on chat, execute, dashboard, gateway and subagents",commands:[{name:"parity surfaces",description:"Compare the surface registry against the real import graph",flags:[]},{name:"parity debt",description:"Check the anti-silo debt ratchet (observed surface debt must equal the frozen list)",flags:[]},{name:"parity matrix",description:"Show every capability × surface and any unproven `supported` claim",flags:[]},{name:"parity faults",description:"List the declared faults the harness can inject, and what each one proves",flags:[]},{name:"parity run",description:"Drive all five surfaces through the real harness and report the verdict",flags:[]}]},{name:"session",description:"Project-scoped session continuity (debug surface — `continue` is the primary path)",commands:[{name:"session list",description:"List recent sessions, optionally filtered by project + time range",flags:["--limit <limit>","--project <project>","--since <since>"]},{name:"session summarize",description:"Show summary + metadata for one session (transcript: nuvira history show)",flags:[]},{name:"session resume",description:"Run D1 auto-recall for a project and print the recall card",flags:["--project <project>","--since <since>"]}]},{name:"state",description:"Print this project’s tracked state in one read: plan, open sessions, per-file verification debt, git drift",commands:[]},{name:"marketplace",description:"Browse and install community plugins and workflow templates",commands:[{name:"marketplace browse",description:"Browse all available marketplace items",flags:["--plugins","--refresh","--workflows"]},{name:"marketplace search",description:"Search across plugins and workflow templates",flags:[]},{name:"marketplace install",description:"Install a workflow template from the registry",flags:[]},{name:"marketplace info",description:"Show detailed information about a marketplace item",flags:[]}]},{name:"mcp",description:"Manage MCP (Model Context Protocol) server connections",commands:[{name:"mcp list",description:"List all discovered MCP servers and their tools",flags:[]},{name:"mcp connect",description:"Connect to an MCP server",flags:["--all"]},{name:"mcp call",description:"Call a tool on an MCP server",flags:["--args <args>","--server <server>"]},{name:"mcp info",description:"Show detailed information for an MCP server",flags:[]},{name:"mcp refresh",description:"Re-discover and reconnect to all MCP servers",flags:[]},{name:"mcp catalog",description:"List MCP capability slots, their variants, and what each one needs on this machine",flags:["--search <search>"]},{name:"mcp install",description:"Install a catalog capability, choosing the best variant this machine can actually run",flags:["--command <command>","--env <env>","--force","--no-verify","--runtime <runtime>","--variant <variant>"]},{name:"mcp add",description:"Add a server that is NOT in the catalog — any stdio command or remote URL, like a config file",flags:["--arg <arg>","--command <command>","--env <env>","--force","--header <header>","--json <json>","--no-verify","--transport <transport>","--url <url>"]},{name:"mcp settings",description:"Show the resolved mcp.* configuration (caps, auto-connect, subagent inheritance)",flags:[]},{name:"mcp authorize",description:"Authorize an OAuth MCP server (opens the consent page, captures the loopback redirect, stores the token)",flags:["--no-browser","--redirect-uri <redirect_uri>"]},{name:"mcp uninstall",description:"Remove an installed MCP server config",flags:[]},{name:"mcp serve",description:"Expose the agent's H1 tools as an MCP server over stdio (MCP clients / IDEs / other agents can connect)",flags:["--memory","--with <with>"]}]},{name:"ci",description:"Headless CI/CD mode — structured JSON output and exit codes for pipelines",commands:[{name:"ci execute",description:"Execute a goal and emit JSON result (exit 0 = success, 1 = failure)",flags:["--context-limit <context_limit>","--context-prune <context_prune>","--github-annotations","--memory","--model <model>","--planner-model <planner_model>","--provider <provider>","--reviewer-model <reviewer_model>","--sandbox","--timeout <timeout>","--writer-model <writer_model>"]},{name:"ci check",description:"Run a gate check (exit 0 = pass, 1 = fail) — minimal output, ideal for workflow gates",flags:["--model <model>","--provider <provider>","--verbose"]},{name:"ci review",description:"Review one or more files and emit JSON findings",flags:["--context <context>","--format <format>","--model <model>","--provider <provider>"]}]},{name:"publish",description:"Autonomous publish workflow — version, build, publish to npm & GitHub",commands:[]},{name:"credentials",description:"Store GitHub/npm release credentials so the agent can release without re-entering them",commands:[{name:"credentials status",description:"Show which release credentials are available, and where each came from",flags:[]},{name:"credentials set",description:"Store a credential in the nuvira credential store",flags:["--stdin","--value <value>"]},{name:"credentials forget",description:"Delete a stored credential",flags:[]},{name:"credentials verify",description:"Check the stored GitHub and npm tokens against the live services",flags:[]}]},{name:"bedrock",description:"AWS Bedrock setup and management (dedicated onboarding for Bedrock)",commands:[{name:"bedrock setup",description:"Interactive wizard to configure AWS Bedrock (credentials, region, model access)",flags:[]},{name:"bedrock status",description:"Show current Bedrock configuration and connectivity status",flags:[]},{name:"bedrock test",description:"Probe Bedrock models and test inference",flags:["--region <region>"]}]},{name:"phase",description:"Phase-wise project scope execution — multi-goal pipelines",commands:[{name:"phase create",description:"Create a new phase scope with ordered goals",flags:["--output <output>"]},{name:"phase execute",description:"Execute a phase scope from start to finish",flags:["--dry-run","--model <model>","--non-interactive","--provider <provider>","--skip-tests","--verbose"]},{name:"phase resume",description:"Resume a saved phase scope from where it left off",flags:["--model <model>","--provider <provider>","--skip-tests","--verbose"]},{name:"phase status",description:"Show progress of a phase scope",flags:[]},{name:"phase delete",description:"Delete a saved phase scope",flags:[]},{name:"phase list",description:"List all saved phase scopes",flags:[]}]},{name:"retrieval",description:"Vector retrieval — token-efficient context via local embeddings",commands:[{name:"retrieval stats",description:"Show token-savings transparency (how many tokens retrieval saved)",flags:[]},{name:"retrieval index",description:"Index a repo/file into the retrieval store (chunks embedded locally)",flags:[]},{name:"retrieval query",description:"Semantic search over the indexed repo (top-k chunks)",flags:[]},{name:"retrieval clear",description:"Clear the retrieval index and token-savings stats",flags:[]}]},{name:"knowledge",description:"Knowledge base — answer questions from your own tagged documents (vector retrieval)",commands:[{name:"knowledge add",description:"Ingest files or folders under a tag (extracted, chunked and embedded once)",flags:[]},{name:"knowledge query",description:"Retrieve the most relevant passages for a question, scoped to a tag",flags:["--top-k <top_k>"]},{name:"knowledge toc",description:"List a tag's documents and the headings in each",flags:[]},{name:"knowledge read",description:"Print a document, or one named section, VERBATIM (not a summary)",flags:["--section <section>"]},{name:"knowledge remove",description:"Remove ONE document from a tag (its chunks, stored text and manifest row)",flags:[]},{name:"knowledge sync",description:"Bring a tag up to date with its folders — hash-gated, prunes files that vanished",flags:[]},{name:"knowledge list",description:"List knowledge tags with document and chunk counts",flags:[]},{name:"knowledge stats",description:"Show details for one knowledge tag",flags:[]},{name:"knowledge forget",description:"Remove a tag's vectors and manifest entry",flags:[]}]},{name:"hooks",description:"Declarative lifecycle hooks — list/add/remove the rules that deny, notify or secret-scan tool calls (the same hooks.json the dashboard Hooks page edits; a hook is data, never code)",commands:[{name:"hooks list",description:"List built-in and user hooks with their seam, action and state",flags:[]},{name:"hooks add",description:"Declare a new hook (it is enabled unless --disabled is given)",flags:["--action <action>","--arg <arg>","--cwd <cwd>","--deny-on-hit","--disabled","--event <event>","--id <id>","--label <label>","--message <message>","--reason <reason>","--surface <surface>","--tool <tool>"]},{name:"hooks remove",description:"Remove a user hook (a built-in cannot be deleted — disable it instead)",flags:[]},{name:"hooks enable",description:"Turn a hook on (works on a built-in too)",flags:[]},{name:"hooks disable",description:"Turn a hook off",flags:[]}]},{name:"trace",description:"Inspect and replay per-step reasoning traces (every LLM call in a pipeline)",commands:[{name:"trace list",description:"Show recent traces",flags:["--limit <limit>"]},{name:"trace show",description:"Show a single trace (goal, timing, step summary)",flags:[]},{name:"trace replay",description:"Step-by-step replay of a trace — every LLM call with prompt digest, model, tokens, latency, and routing",flags:["--full"]},{name:"trace degraded",description:"List provider × model pairs that served steps without agentic capability (derived, read-only, from the traces)",flags:["--limit <limit>"]},{name:"trace clear",description:"Delete all stored traces",flags:[]}]},{name:"rate",description:"Rate the last turn (good|bad) — records the one label a quality signal can be fit to (also on the dashboard Trace tab)",commands:[]},{name:"decisions",description:"The must-ask decisions recorded for this project — list, search, and revise them (written by ask_user)",commands:[{name:"decisions show",description:"",flags:["--json"]},{name:"decisions revise",description:"",flags:["--answer <answer>","--note <note>"]}]},{name:"continuity",description:"Session continuity — what is stored, and how to forget it",commands:[{name:"continuity list",description:"Show the continuity switches, stored sessions, and the semantic recall index",flags:[]},{name:"continuity clear",description:"Forget stored continuity data (no flags = both sessions and recall)",flags:["--recall","--sessions"]}]},{name:"website",description:"Open the Agent-Nuvira website — capabilities, commands, docs, setup",commands:[]}],_c={commandCount:Mle,groupCount:Ile,groups:$le},xE=_c.groups;function Lle(e,t){return e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)}function Dle({onPick:e}){const[t,n]=b.useState(""),r=b.useId(),a=t.trim().toLowerCase(),s=b.useMemo(()=>a?xE.map(l=>l.name.toLowerCase().includes(a)?l:{...l,commands:l.commands.filter(c=>Lle(c,a))}).filter(l=>l.commands.length>0):xE,[a]),o=s.reduce((l,c)=>l+c.commands.length,0);return i.jsxs("section",{className:"command-browser",children:[i.jsxs("div",{className:"command-browser-head",children:[i.jsx("h2",{className:"section-title command-browser-title",children:"Browse commands"}),i.jsx("p",{className:"command-browser-count",children:a?`${o} of ${_c.commandCount} commands match “${t.trim()}”`:`${_c.commandCount} commands in ${_c.groupCount} groups`})]}),i.jsx("label",{className:"sr-only",htmlFor:r,children:"Filter commands"}),i.jsx("input",{id:r,type:"search",className:"admin-input command-browser-search",placeholder:"Filter commands — e.g. eval, memory, gateway status",value:t,onChange:l=>n(l.target.value),autoComplete:"off",spellCheck:!1}),s.length===0?i.jsxs("p",{className:"command-browser-empty",children:["No command matches “",t.trim(),"”. Clear the filter to see all ",_c.groupCount," groups."]}):i.jsx("div",{className:"command-browser-groups",children:s.map(l=>i.jsxs("details",{className:"command-group",open:a?!0:void 0,children:[i.jsxs("summary",{className:"command-group-summary",children:[i.jsx("code",{className:"command-group-name",children:l.name}),i.jsx("span",{className:"command-group-description",children:l.description}),i.jsx("span",{className:"command-group-count",children:l.commands.length})]}),i.jsx("ul",{className:"command-list",children:l.commands.map(c=>i.jsx("li",{className:"command-item",children:i.jsxs("button",{type:"button",className:"command-use",onClick:()=>e(c.name),title:`Insert “${c.name}” into the command box`,children:[i.jsx("span",{className:"command-item-name",children:c.name}),i.jsx("span",{className:"command-item-description",children:c.description}),c.flags.length>0&&i.jsx("span",{className:"command-item-flags",children:c.flags.map(u=>i.jsx("code",{children:u},u))})]})},c.name))})]},`${l.name}:${a?"filtering":"browsing"}`))})]})}const wE={running:"⏳ running",done:"✅ done",failed:"❌ failed",cancelled:"⏹ cancelled",timeout:"⏰ timed out",error:"💥 error",hung:"🚫 stopped (hung)"};function kE(e){switch(e){case"done":return"task-status-done";case"running":return"task-status-running";case"failed":return"task-status-failed";case"cancelled":return"task-status-cancelled";case"timeout":return"task-status-timeout";case"hung":return"task-status-timeout";default:return"task-status-error"}}function Ble(e){const t=[];let n="",r=null;for(const a of e.trim())r?a===r?r=null:n+=a:a==='"'||a==="'"?r=a:/\s/.test(a)?n&&(t.push(n),n=""):n+=a;return n&&t.push(n),t}function SE(e){return e===null?"—":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function zle(e){const t=Math.max(0,Math.floor((Date.now()-e)/1e3));if(t<60)return`${t}s ago`;const n=Math.floor(t/60);return n<60?`${n}m ago`:`${Math.floor(n/60)}h ago`}function Fle(){const[e,t]=b.useState(null),n=qr(),[r,a]=b.useState(""),[s,o]=b.useState(0),[l,c]=b.useState(!1),[u,d]=b.useState(""),[f,h]=b.useState(null),[p,m]=b.useState([]),[g,y]=b.useState(!0),v=b.useRef(null),k=b.useRef(null),w=b.useRef(null),j=b.useCallback(async()=>{const R=await K.listTasks();R&&m(R.tasks)},[]);b.useEffect(()=>{K.fetchAdminAuthStatus().then(R=>{t(R?{configured:R.configured,authenticated:R.authenticated,role:R.role??null}:{configured:!1,authenticated:!1,role:null}),R!=null&&R.authenticated&&j()})},[j,n]),b.useEffect(()=>{var R,T;if(g&&(f==null?void 0:f.status)==="running")try{(T=(R=v.current)==null?void 0:R.scrollIntoView)==null||T.call(R,{block:"end"})}catch{}},[f==null?void 0:f.logs.length,f==null?void 0:f.status,g]),b.useEffect(()=>()=>{var R;return(R=w.current)==null?void 0:R.call(w)},[]);const S=b.useCallback((R,T)=>{var $;if(($=w.current)==null||$.call(w),h(R),d(""),!T)return;const B=K.subscribeTask(R.id,{onLog:I=>h(D=>D&&D.id===R.id?{...D,logs:[...D.logs,I]}:D),onStatus:I=>h(D=>D&&D.id===R.id?{...D,status:I}:D)});w.current=B},[]),x=b.useCallback(async()=>{const R=Ble(r);if(R.length===0){d("Type a command first — e.g. `eval run --task smoke-test` or `gateway status`.");return}c(!0),d("");const T=await K.startTask(R,s*1e3);if(c(!1),!T.ok||!T.task){d(T.error||"Failed to start task.");return}a(""),j(),S(T.task,!0)},[r,s,S,j]),N=b.useCallback(async R=>{await K.cancelTask(R)},[]),E=b.useCallback(R=>{var T;a(`${R} `),d(""),(T=k.current)==null||T.focus()},[]),P=b.useCallback(async R=>{const T=await K.getTask(R);T!=null&&T.task&&S(T.task,!1)},[S]),_=b.useCallback(()=>{var R;(R=w.current)==null||R.call(w),h(null)},[]);return e?e.authenticated?i.jsxs("div",{className:"panel",children:[i.jsx(Oe,{icon:"🚀",title:"Command Console"}),i.jsx("p",{className:"admin-subtitle",children:"Run any agent-nuvira command — the same CLI, executed by the dashboard. Messaging, skills, tools, eval, memory, traces and more."}),i.jsxs("form",{className:"task-run-form",onSubmit:R=>{R.preventDefault(),x()},children:[i.jsx("input",{ref:k,className:"admin-input task-cmd-input",placeholder:"eval run --task smoke-test · gateway status · skill list · memory stats",value:r,onChange:R=>a(R.target.value),autoComplete:"off",spellCheck:!1}),i.jsxs("select",{className:"admin-input task-timeout-select",title:"Task timeout — 'until finished' runs with no cutoff",value:s,onChange:R=>o(Number(R.target.value)),children:[i.jsx("option",{value:0,children:"until finished"}),i.jsx("option",{value:60,children:"1 min"}),i.jsx("option",{value:300,children:"5 min"}),i.jsx("option",{value:600,children:"10 min"}),i.jsx("option",{value:1800,children:"30 min"})]}),i.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:l||r.trim()==="",children:l?"⏳ Starting…":"▶ Run"})]}),u&&i.jsx("div",{className:"admin-error",children:u}),i.jsxs("p",{className:"task-hint",children:["Long-running commands stream their output live, and run ",i.jsx("strong",{children:"until they finish"})," unless you pick a cutoff — the elapsed time is shown beside the status, and Cancel stops one."]}),i.jsx(Dle,{onPick:E}),f&&i.jsxs("div",{className:"task-console-wrap",children:[i.jsxs("div",{className:"task-console-header",children:[i.jsx("code",{className:"task-console-cmd",children:f.command}),i.jsx("span",{className:`task-status ${kE(f.status)}`,children:wE[f.status]}),i.jsxs("span",{className:"task-meta",children:["exit ",f.exitCode??"—"," · ",SE(f.durationMs)]}),f.status==="running"&&i.jsx("button",{className:"admin-mini-btn task-cancel-btn",onClick:()=>void N(f.id),children:"⏹ Cancel"}),i.jsx("button",{className:"admin-mini-btn",onClick:_,children:"✕ Close"})]}),i.jsxs("div",{className:"task-console",children:[f.logs.map((R,T)=>i.jsx("div",{className:`task-line task-line-${R.stream}`,children:R.text},T)),f.logs.length===0&&f.status==="running"&&i.jsx("div",{className:"task-line task-line-system",children:"⏳ waiting for output…"}),i.jsx("div",{ref:v})]}),i.jsxs("label",{className:"task-autoscroll",children:[i.jsx("input",{type:"checkbox",checked:g,onChange:R=>y(R.target.checked)})," auto-scroll"]})]}),i.jsx("h2",{className:"task-history-title",children:"History"}),p.length===0?i.jsx("div",{className:"empty-state",children:"No tasks yet — run your first command above."}):i.jsx("div",{className:"admin-table-wrapper",children:i.jsxs("table",{className:"admin-table task-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Command"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Exit"}),i.jsx("th",{children:"Duration"}),i.jsx("th",{children:"When"})]})}),i.jsx("tbody",{children:p.map(R=>i.jsxs("tr",{className:(f==null?void 0:f.id)===R.id?"task-row-active":"",onClick:()=>void P(R.id),children:[i.jsx("td",{children:i.jsx("code",{children:R.command})}),i.jsx("td",{children:i.jsx("span",{className:`task-status ${kE(R.status)}`,children:wE[R.status]})}),i.jsx("td",{children:R.exitCode??"—"}),i.jsx("td",{children:SE(R.durationMs)}),i.jsx("td",{children:zle(R.startedAt)})]},R.id))})]})})]}):i.jsxs("div",{className:"panel",children:[i.jsx(Oe,{icon:"🚀",title:"Command Console"}),i.jsxs("div",{className:"empty-state",children:[i.jsxs("p",{children:[i.jsx("strong",{children:"Log in to run tasks."})," The console executes commands on this machine, so it needs an admin session (like the Agent Hub toggles)."]}),i.jsx("p",{children:e.configured?i.jsx(Jt,{className:"admin-refresh-btn",to:"/admin",children:"🔐 Log in"}):i.jsx(Jt,{className:"admin-refresh-btn",to:"/admin",children:"🔐 Create admin account"})})]})]}):i.jsxs("div",{className:"panel",children:[i.jsx(Oe,{icon:"🚀",title:"Command Console"}),i.jsx("div",{className:"loading-state",children:"Loading…"})]})}function Ule(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Wle=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Hle=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Gle={};function jE(e,t){return(Gle.jsx?Hle:Wle).test(e)}const qle=/[ \t\n\f\r]/g;function Kle(e){return typeof e=="object"?e.type==="text"?NE(e.value):!1:NE(e)}function NE(e){return e.replace(qle,"")===""}class dd{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}dd.prototype.normal={};dd.prototype.property={};dd.prototype.space=void 0;function NM(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new dd(n,r,t)}function Kb(e){return e.toLowerCase()}class Hn{constructor(t,n){this.attribute=n,this.property=t}}Hn.prototype.attribute="";Hn.prototype.booleanish=!1;Hn.prototype.boolean=!1;Hn.prototype.commaOrSpaceSeparated=!1;Hn.prototype.commaSeparated=!1;Hn.prototype.defined=!1;Hn.prototype.mustUseProperty=!1;Hn.prototype.number=!1;Hn.prototype.overloadedBoolean=!1;Hn.prototype.property="";Hn.prototype.spaceSeparated=!1;Hn.prototype.space=void 0;let Vle=0;const Me=Ks(),Lt=Ks(),Vb=Ks(),le=Ks(),ct=Ks(),Cs=Ks(),Yn=Ks();function Ks(){return 2**++Vle}const Yb=Object.freeze(Object.defineProperty({__proto__:null,boolean:Me,booleanish:Lt,commaOrSpaceSeparated:Yn,commaSeparated:Cs,number:le,overloadedBoolean:Vb,spaceSeparated:ct},Symbol.toStringTag,{value:"Module"})),Qg=Object.keys(Yb);class b0 extends Hn{constructor(t,n,r,a){let s=-1;if(super(t,n),EE(this,"space",a),typeof r=="number")for(;++s<Qg.length;){const o=Qg[s];EE(this,Qg[s],(r&Yb[o])===Yb[o])}}}b0.prototype.defined=!0;function EE(e,t,n){n&&(e[t]=n)}function Dl(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const s=new b0(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Kb(r)]=r,n[Kb(s.attribute)]=r}return new dd(t,n,e.space)}const EM=Dl({properties:{ariaActiveDescendant:null,ariaAtomic:Lt,ariaAutoComplete:null,ariaBusy:Lt,ariaChecked:Lt,ariaColCount:le,ariaColIndex:le,ariaColSpan:le,ariaControls:ct,ariaCurrent:null,ariaDescribedBy:ct,ariaDetails:null,ariaDisabled:Lt,ariaDropEffect:ct,ariaErrorMessage:null,ariaExpanded:Lt,ariaFlowTo:ct,ariaGrabbed:Lt,ariaHasPopup:null,ariaHidden:Lt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ct,ariaLevel:le,ariaLive:null,ariaModal:Lt,ariaMultiLine:Lt,ariaMultiSelectable:Lt,ariaOrientation:null,ariaOwns:ct,ariaPlaceholder:null,ariaPosInSet:le,ariaPressed:Lt,ariaReadOnly:Lt,ariaRelevant:null,ariaRequired:Lt,ariaRoleDescription:ct,ariaRowCount:le,ariaRowIndex:le,ariaRowSpan:le,ariaSelected:Lt,ariaSetSize:le,ariaSort:null,ariaValueMax:le,ariaValueMin:le,ariaValueNow:le,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function _M(e,t){return t in e?e[t]:t}function CM(e,t){return _M(e,t.toLowerCase())}const Yle=Dl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Cs,acceptCharset:ct,accessKey:ct,action:null,allow:null,allowFullScreen:Me,allowPaymentRequest:Me,allowUserMedia:Me,alpha:Me,alt:null,as:null,async:Me,autoCapitalize:null,autoComplete:ct,autoFocus:Me,autoPlay:Me,blocking:ct,capture:null,charSet:null,checked:Me,cite:null,className:ct,closedBy:null,colorSpace:null,cols:le,colSpan:le,command:null,commandFor:null,content:null,contentEditable:Lt,controls:Me,controlsList:ct,coords:le|Cs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Me,defer:Me,dir:null,dirName:null,disabled:Me,download:Vb,draggable:Lt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Me,formTarget:null,headers:ct,height:le,hidden:Vb,high:le,href:null,hrefLang:null,htmlFor:ct,httpEquiv:ct,id:null,imageSizes:null,imageSrcSet:null,inert:Me,inputMode:null,integrity:null,is:null,isMap:Me,itemId:null,itemProp:ct,itemRef:ct,itemScope:Me,itemType:ct,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Me,low:le,manifest:null,max:null,maxLength:le,media:null,method:null,min:null,minLength:le,multiple:Me,muted:Me,name:null,nonce:null,noModule:Me,noValidate:Me,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Me,optimum:le,pattern:null,ping:ct,placeholder:null,playsInline:Me,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Me,referrerPolicy:null,rel:ct,required:Me,reversed:Me,rows:le,rowSpan:le,sandbox:ct,scope:null,scoped:Me,seamless:Me,selected:Me,shadowRootClonable:Me,shadowRootCustomElementRegistry:Me,shadowRootDelegatesFocus:Me,shadowRootMode:null,shadowRootSerializable:Me,shape:null,size:le,sizes:null,slot:null,span:le,spellCheck:Lt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:le,step:null,style:null,tabIndex:le,target:null,title:null,translate:null,type:null,typeMustMatch:Me,useMap:null,value:Lt,width:le,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ct,axis:null,background:null,bgColor:null,border:le,borderColor:null,bottomMargin:le,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Me,declare:Me,event:null,face:null,frame:null,frameBorder:null,hSpace:le,leftMargin:le,link:null,longDesc:null,lowSrc:null,marginHeight:le,marginWidth:le,noResize:Me,noHref:Me,noShade:Me,noWrap:Me,object:null,profile:null,prompt:null,rev:null,rightMargin:le,rules:null,scheme:null,scrolling:Lt,standby:null,summary:null,text:null,topMargin:le,valueType:null,version:null,vAlign:null,vLink:null,vSpace:le,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Me,disablePictureInPicture:Me,disableRemotePlayback:Me,exportParts:Cs,part:ct,prefix:null,property:null,results:le,security:null,unselectable:null},space:"html",transform:CM}),Xle=Dl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Yn,accentHeight:le,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:le,amplitude:le,arabicForm:null,ascent:le,attributeName:null,attributeType:null,azimuth:le,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:le,by:null,calcMode:null,capHeight:le,className:ct,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:le,diffuseConstant:le,direction:null,display:null,dur:null,divisor:le,dominantBaseline:null,download:Me,dx:null,dy:null,edgeMode:null,editable:null,elevation:le,enableBackground:null,end:null,event:null,exponent:le,externalResourcesRequired:null,fill:null,fillOpacity:le,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Cs,g2:Cs,glyphName:Cs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:le,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:le,horizOriginX:le,horizOriginY:le,id:null,ideographic:le,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:le,k:le,k1:le,k2:le,k3:le,k4:le,kernelMatrix:Yn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:le,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:le,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:le,overlineThickness:le,paintOrder:null,panose1:null,path:null,pathLength:le,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ct,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:le,pointsAtY:le,pointsAtZ:le,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Yn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Yn,rev:Yn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Yn,requiredFeatures:Yn,requiredFonts:Yn,requiredFormats:Yn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:le,specularExponent:le,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:le,strikethroughThickness:le,string:null,stroke:null,strokeDashArray:Yn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:le,strokeOpacity:le,strokeWidth:null,style:null,surfaceScale:le,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Yn,tabIndex:le,tableValues:null,target:null,targetX:le,targetY:le,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Yn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:le,underlineThickness:le,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:le,values:null,vAlphabetic:le,vMathematical:le,vectorEffect:null,vHanging:le,vIdeographic:le,version:null,vertAdvY:le,vertOriginX:le,vertOriginY:le,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:le,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:_M}),AM=Dl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),TM=Dl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:CM}),OM=Dl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Qle={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Zle=/[A-Z]/g,_E=/-[a-z]/g,Jle=/^data[-\w.:]+$/i;function ece(e,t){const n=Kb(t);let r=t,a=Hn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Jle.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(_E,nce);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!_E.test(s)){let o=s.replace(Zle,tce);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}a=b0}return new a(r,t)}function tce(e){return"-"+e.toLowerCase()}function nce(e){return e.charAt(1).toUpperCase()}const rce=NM([EM,Yle,AM,TM,OM],"html"),x0=NM([EM,Xle,AM,TM,OM],"svg");function ace(e){return e.join(" ").trim()}var w0={},CE=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ice=/\n/g,sce=/^\s*/,oce=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,lce=/^:\s*/,cce=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,uce=/^[;\s]*/,dce=/^\s+|\s+$/g,fce=`
165
+ `,AE="/",TE="*",hs="",hce="comment",pce="declaration";function mce(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function a(m){var g=m.match(ice);g&&(n+=g.length);var y=m.lastIndexOf(fce);r=~y?m.length-y:r+m.length}function s(){var m={line:n,column:r};return function(g){return g.position=new o(m),u(),g}}function o(m){this.start=m,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function l(m){var g=new Error(t.source+":"+n+":"+r+": "+m);if(g.reason=m,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function c(m){var g=m.exec(e);if(g){var y=g[0];return a(y),e=e.slice(y.length),g}}function u(){c(sce)}function d(m){var g;for(m=m||[];g=f();)g!==!1&&m.push(g);return m}function f(){var m=s();if(!(AE!=e.charAt(0)||TE!=e.charAt(1))){for(var g=2;hs!=e.charAt(g)&&(TE!=e.charAt(g)||AE!=e.charAt(g+1));)++g;if(g+=2,hs===e.charAt(g-1))return l("End of comment missing");var y=e.slice(2,g-2);return r+=2,a(y),e=e.slice(g),r+=2,m({type:hce,comment:y})}}function h(){var m=s(),g=c(oce);if(g){if(f(),!c(lce))return l("property missing ':'");var y=c(cce),v=m({type:pce,property:OE(g[0].replace(CE,hs)),value:y?OE(y[0].replace(CE,hs)):hs});return c(uce),v}}function p(){var m=[];d(m);for(var g;g=h();)g!==!1&&(m.push(g),d(m));return m}return u(),p()}function OE(e){return e?e.replace(dce,hs):hs}var gce=mce,vce=fi&&fi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(w0,"__esModule",{value:!0});w0.default=bce;const yce=vce(gce);function bce(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,yce.default)(e),a=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:l}=s;a?t(o,l,s):l&&(n=n||{},n[o]=l)}),n}var Cm={};Object.defineProperty(Cm,"__esModule",{value:!0});Cm.camelCase=void 0;var xce=/^--[a-zA-Z0-9_-]+$/,wce=/-([a-z])/g,kce=/^[^-]+$/,Sce=/^-(webkit|moz|ms|o|khtml)-/,jce=/^-(ms)-/,Nce=function(e){return!e||kce.test(e)||xce.test(e)},Ece=function(e,t){return t.toUpperCase()},PE=function(e,t){return"".concat(t,"-")},_ce=function(e,t){return t===void 0&&(t={}),Nce(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(jce,PE):e=e.replace(Sce,PE),e.replace(wce,Ece))};Cm.camelCase=_ce;var Cce=fi&&fi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ace=Cce(w0),Tce=Cm;function Xb(e,t){var n={};return!e||typeof e!="string"||(0,Ace.default)(e,function(r,a){r&&a&&(n[(0,Tce.camelCase)(r,t)]=a)}),n}Xb.default=Xb;var Oce=Xb;const Pce=Je(Oce),PM=RM("end"),k0=RM("start");function RM(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Rce(e){const t=k0(e),n=PM(e);if(t&&n)return{start:t,end:n}}function Wc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?RE(e.position):"start"in e||"end"in e?RE(e):"line"in e||"column"in e?Qb(e):""}function Qb(e){return ME(e&&e.line)+":"+ME(e&&e.column)}function RE(e){return Qb(e&&e.start)+"-"+Qb(e&&e.end)}function ME(e){return e&&typeof e=="number"?e:1}class Nn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?a=t:!s.cause&&t&&(o=!0,a=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?s.ruleId=r:(s.source=r.slice(0,c),s.ruleId=r.slice(c+1))}if(!s.place&&s.ancestors&&s.ancestors){const c=s.ancestors[s.ancestors.length-1];c&&(s.place=c.position)}const l=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=l?l.line:void 0,this.name=Wc(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Nn.prototype.file="";Nn.prototype.name="";Nn.prototype.reason="";Nn.prototype.message="";Nn.prototype.stack="";Nn.prototype.column=void 0;Nn.prototype.line=void 0;Nn.prototype.ancestors=void 0;Nn.prototype.cause=void 0;Nn.prototype.fatal=void 0;Nn.prototype.place=void 0;Nn.prototype.ruleId=void 0;Nn.prototype.source=void 0;const S0={}.hasOwnProperty,Mce=new Map,Ice=/[A-Z]/g,$ce=new Set(["table","tbody","thead","tfoot","tr"]),Lce=new Set(["td","th"]),MM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Dce(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=qce(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Gce(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?x0:rce,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=IM(a,e,void 0);return s&&typeof s!="string"?s:a.create(e,a.Fragment,{children:s||void 0},void 0)}function IM(e,t,n){if(t.type==="element")return Bce(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return zce(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Uce(e,t,n);if(t.type==="mdxjsEsm")return Fce(e,t);if(t.type==="root")return Wce(e,t,n);if(t.type==="text")return Hce(e,t)}function Bce(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=x0,e.schema=a),e.ancestors.push(t);const s=LM(e,t.tagName,!1),o=Kce(e,t);let l=N0(e,t);return $ce.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!Kle(c):!0})),$M(e,o,s,t),j0(o,l),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function zce(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Vu(e,t.position)}function Fce(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Vu(e,t.position)}function Uce(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=x0,e.schema=a),e.ancestors.push(t);const s=t.name===null?e.Fragment:LM(e,t.name,!0),o=Vce(e,t),l=N0(e,t);return $M(e,o,s,t),j0(o,l),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function Wce(e,t,n){const r={};return j0(r,N0(e,t)),e.create(t,e.Fragment,r,n)}function Hce(e,t){return t.value}function $M(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function j0(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Gce(e,t,n){return r;function r(a,s,o,l){const u=Array.isArray(o.children)?n:t;return l?u(s,o,l):u(s,o)}}function qce(e,t){return n;function n(r,a,s,o){const l=Array.isArray(s.children),c=k0(r);return t(a,s,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function Kce(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&S0.call(t.properties,a)){const s=Yce(e,a,t.properties[a]);if(s){const[o,l]=s;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&Lce.has(t.tagName)?r=l:n[o]=l}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Vce(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Vu(e,t.position);else{const a=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,s=e.evaluater.evaluateExpression(l.expression)}else Vu(e,t.position);else s=r.value===null?!0:r.value;n[a]=s}return n}function N0(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:Mce;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const c=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(c){const u=a.get(c)||0;o=c+"-"+u,a.set(c,u+1)}}const l=IM(e,s,o);l!==void 0&&n.push(l)}return n}function Yce(e,t,n){const r=ece(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Ule(n):ace(n)),r.property==="style"){let a=typeof n=="object"?n:Xce(e,String(n));return e.stylePropertyNameCase==="css"&&(a=Qce(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?Qle[r.property]||r.property:r.attribute,n]}}function Xce(e,t){try{return Pce(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new Nn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=MM+"#cannot-parse-style-attribute",a}}function LM(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let s=-1,o;for(;++s<a.length;){const l=jE(a[s])?{type:"Identifier",name:a[s]}:{type:"Literal",value:a[s]};o=o?{type:"MemberExpression",object:o,property:l,computed:!!(s&&l.type==="Literal"),optional:!1}:l}r=o}else r=jE(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return S0.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);Vu(e)}function Vu(e,t){const n=new Nn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=MM+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Qce(e){const t={};let n;for(n in e)S0.call(e,n)&&(t[Zce(n)]=e[n]);return t}function Zce(e){let t=e.replace(Ice,Jce);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Jce(e){return"-"+e.toLowerCase()}const Zg={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},eue={};function E0(e,t){const n=eue,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return DM(e,r,a)}function DM(e,t,n){if(tue(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return IE(e.children,t,n)}return Array.isArray(e)?IE(e,t,n):""}function IE(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=DM(e[a],t,n);return r.join("")}function tue(e){return!!(e&&typeof e=="object")}const $E=document.createElement("i");function _0(e){const t="&"+e+";";$E.innerHTML=t;const n=$E.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function nr(e,t,n,r){const a=e.length;let s=0,o;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function vr(e,t){return e.length>0?(nr(e,e.length,0,t),e):t}const LE={}.hasOwnProperty;function BM(e){const t={};let n=-1;for(;++n<e.length;)nue(t,e[n]);return t}function nue(e,t){let n;for(n in t){const a=(LE.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){LE.call(a,o)||(a[o]=[]);const l=s[o];rue(a[o],Array.isArray(l)?l:l?[l]:[])}}}function rue(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);nr(e,0,0,r)}function zM(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Wr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const An=Hi(/[A-Za-z]/),Sn=Hi(/[\dA-Za-z]/),aue=Hi(/[#-'*+\--9=?A-Z^-~]/);function fp(e){return e!==null&&(e<32||e===127)}const Zb=Hi(/\d/),iue=Hi(/[\dA-Fa-f]/),sue=Hi(/[!-/:-@[-`{-~]/);function Ce(e){return e!==null&&e<-2}function dt(e){return e!==null&&(e<0||e===32)}function ze(e){return e===-2||e===-1||e===32}const Am=Hi(new RegExp("\\p{P}|\\p{S}","u")),zs=Hi(/\s/);function Hi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Bl(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&Sn(e.charCodeAt(n+1))&&Sn(e.charCodeAt(n+2)))a=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const l=e.charCodeAt(n+1);s<56320&&l>56319&&l<57344?(o=String.fromCharCode(s,l),a=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+a+1,o=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function Ue(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(c){return ze(c)?(e.enter(n),l(c)):t(c)}function l(c){return ze(c)&&s++<a?(e.consume(c),l):(e.exit(n),t(c))}}const oue={tokenize:lue};function lue(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Ue(e,t,"linePrefix")}function a(l){return e.enter("paragraph"),s(l)}function s(l){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,o(l)}function o(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return Ce(l)?(e.consume(l),e.exit("chunkText"),s):(e.consume(l),o)}}const cue={tokenize:uue},DE={tokenize:due};function uue(e){const t=this,n=[];let r=0,a,s,o;return l;function l(w){if(r<n.length){const j=n[r];return t.containerState=j[1],e.attempt(j[0].continuation,c,u)(w)}return u(w)}function c(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&k();const j=t.events.length;let S=j,x;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){x=t.events[S][1].end;break}v(r);let N=j;for(;N<t.events.length;)t.events[N][1].end={...x},N++;return nr(t.events,S+1,0,t.events.slice(j)),t.events.length=N,u(w)}return l(w)}function u(w){if(r===n.length){if(!a)return h(w);if(a.currentConstruct&&a.currentConstruct.concrete)return m(w);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(DE,d,f)(w)}function d(w){return a&&k(),v(r),h(w)}function f(w){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(w)}function h(w){return t.containerState={},e.attempt(DE,p,m)(w)}function p(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function m(w){if(w===null){a&&k(),v(0),e.consume(w);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:s}),g(w)}function g(w){if(w===null){y(e.exit("chunkFlow"),!0),v(0),e.consume(w);return}return Ce(w)?(e.consume(w),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(w),g)}function y(w,j){const S=t.sliceStream(w);if(j&&S.push(null),w.previous=s,s&&(s.next=w),s=w,a.defineSkip(w.start),a.write(S),t.parser.lazy[w.start.line]){let x=a.events.length;for(;x--;)if(a.events[x][1].start.offset<o&&(!a.events[x][1].end||a.events[x][1].end.offset>o))return;const N=t.events.length;let E=N,P,_;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){if(P){_=t.events[E][1].end;break}P=!0}for(v(r),x=N;x<t.events.length;)t.events[x][1].end={..._},x++;nr(t.events,E+1,0,t.events.slice(N)),t.events.length=x}}function v(w){let j=n.length;for(;j-- >w;){const S=n[j];t.containerState=S[1],S[0].exit.call(t,e)}n.length=w}function k(){a.write([null]),s=void 0,a=void 0,t.containerState._closeFlow=void 0}}function due(e,t,n){return Ue(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function bl(e){if(e===null||dt(e)||zs(e))return 1;if(Am(e))return 2}function Tm(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const s=e[a].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const Jb={name:"attention",resolveAll:fue,tokenize:hue};function fue(e,t){let n=-1,r,a,s,o,l,c,u,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[n][1].start};BE(f,-c),BE(h,c),o={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=vr(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=vr(u,[["enter",a,t],["enter",o,t],["exit",o,t],["enter",s,t]]),u=vr(u,Tm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=vr(u,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=vr(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,nr(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function hue(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=bl(r);let s;return o;function o(c){return s=c,e.enter("attentionSequence"),l(c)}function l(c){if(c===s)return e.consume(c),l;const u=e.exit("attentionSequence"),d=bl(c),f=!d||d===2&&a||n.includes(c),h=!a||a===2&&d||n.includes(r);return u._open=!!(s===42?f:f&&(a||!h)),u._close=!!(s===42?h:h&&(d||!f)),t(c)}}function BE(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const pue={name:"autolink",tokenize:mue};function mue(e,t,n){let r=0;return a;function a(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(p){return An(p)?(e.consume(p),o):p===64?n(p):u(p)}function o(p){return p===43||p===45||p===46||Sn(p)?(r=1,l(p)):u(p)}function l(p){return p===58?(e.consume(p),r=0,c):(p===43||p===45||p===46||Sn(p))&&r++<32?(e.consume(p),l):(r=0,u(p))}function c(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||fp(p)?n(p):(e.consume(p),c)}function u(p){return p===64?(e.consume(p),d):aue(p)?(e.consume(p),u):n(p)}function d(p){return Sn(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||Sn(p))&&r++<63){const m=p===45?h:f;return e.consume(p),m}return n(p)}}const fd={partial:!0,tokenize:gue};function gue(e,t,n){return r;function r(s){return ze(s)?Ue(e,a,"linePrefix")(s):a(s)}function a(s){return s===null||Ce(s)?t(s):n(s)}}const FM={continuation:{tokenize:yue},exit:bue,name:"blockQuote",tokenize:vue};function vue(e,t,n){const r=this;return a;function a(o){if(o===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return ze(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function yue(e,t,n){const r=this;return a;function a(o){return ze(o)?Ue(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(FM,t,n)(o)}}function bue(e){e.exit("blockQuote")}const UM={name:"characterEscape",tokenize:xue};function xue(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),a}function a(s){return sue(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const WM={name:"characterReference",tokenize:wue};function wue(e,t,n){const r=this;let a=0,s,o;return l;function l(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),c}function c(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),s=31,o=Sn,d(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=iue,d):(e.enter("characterReferenceValue"),s=7,o=Zb,d(f))}function d(f){if(f===59&&a){const h=e.exit("characterReferenceValue");return o===Sn&&!_0(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(f)&&a++<s?(e.consume(f),d):n(f)}}const zE={partial:!0,tokenize:Sue},FE={concrete:!0,name:"codeFenced",tokenize:kue};function kue(e,t,n){const r=this,a={partial:!0,tokenize:S};let s=0,o=0,l;return c;function c(x){return u(x)}function u(x){const N=r.events[r.events.length-1];return s=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[1],!0).length:0,l=x,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(x)}function d(x){return x===l?(o++,e.consume(x),d):o<3?n(x):(e.exit("codeFencedFenceSequence"),ze(x)?Ue(e,f,"whitespace")(x):f(x))}function f(x){return x===null||Ce(x)?(e.exit("codeFencedFence"),r.interrupt?t(x):e.check(zE,g,j)(x)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===null||Ce(x)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(x)):ze(x)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ue(e,p,"whitespace")(x)):x===96&&x===l?n(x):(e.consume(x),h)}function p(x){return x===null||Ce(x)?f(x):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===null||Ce(x)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(x)):x===96&&x===l?n(x):(e.consume(x),m)}function g(x){return e.attempt(a,j,y)(x)}function y(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),v}function v(x){return s>0&&ze(x)?Ue(e,k,"linePrefix",s+1)(x):k(x)}function k(x){return x===null||Ce(x)?e.check(zE,g,j)(x):(e.enter("codeFlowValue"),w(x))}function w(x){return x===null||Ce(x)?(e.exit("codeFlowValue"),k(x)):(e.consume(x),w)}function j(x){return e.exit("codeFenced"),t(x)}function S(x,N,E){let P=0;return _;function _(I){return x.enter("lineEnding"),x.consume(I),x.exit("lineEnding"),R}function R(I){return x.enter("codeFencedFence"),ze(I)?Ue(x,T,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):T(I)}function T(I){return I===l?(x.enter("codeFencedFenceSequence"),B(I)):E(I)}function B(I){return I===l?(P++,x.consume(I),B):P>=o?(x.exit("codeFencedFenceSequence"),ze(I)?Ue(x,$,"whitespace")(I):$(I)):E(I)}function $(I){return I===null||Ce(I)?(x.exit("codeFencedFence"),N(I)):E(I)}}}function Sue(e,t,n){const r=this;return a;function a(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Jg={name:"codeIndented",tokenize:Nue},jue={partial:!0,tokenize:Eue};function Nue(e,t,n){const r=this;return a;function a(u){return e.enter("codeIndented"),Ue(e,s,"linePrefix",5)(u)}function s(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?c(u):Ce(u)?e.attempt(jue,o,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Ce(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function Eue(e,t,n){const r=this;return a;function a(o){return r.parser.lazy[r.now().line]?n(o):Ce(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):Ue(e,s,"linePrefix",5)(o)}function s(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):Ce(o)?a(o):n(o)}}const _ue={name:"codeText",previous:Aue,resolve:Cue,tokenize:Tue};function Cue(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function Aue(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Tue(e,t,n){let r=0,a,s;return o;function o(f){return e.enter("codeText"),e.enter("codeTextSequence"),l(f)}function l(f){return f===96?(e.consume(f),r++,l):(e.exit("codeTextSequence"),c(f))}function c(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),c):f===96?(s=e.enter("codeTextSequence"),a=0,d(f)):Ce(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||Ce(f)?(e.exit("codeTextData"),c(f)):(e.consume(f),u)}function d(f){return f===96?(e.consume(f),a++,d):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(s.type="codeTextData",u(f))}}class Oue{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&bc(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),bc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),bc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);bc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);bc(this.left,n.reverse())}}}function bc(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function HM(e){const t={};let n=-1,r,a,s,o,l,c,u;const d=new Oue(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,s=0,s<c.length&&c[s][1].type==="lineEndingBlank"&&(s+=2),s<c.length&&c[s][1].type==="content"))for(;++s<c.length&&c[s][1].type!=="content";)c[s][1].type==="chunkText"&&(c[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Pue(d,n)),n=t[n],u=!0);else if(r[1]._container){for(s=n,a=void 0;s--;)if(o=d.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(a&&(d.get(a)[1].type="lineEndingBlank"),o[1].type="lineEnding",a=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;a&&(r[1].end={...d.get(a)[1].start},l=d.slice(a,n),l.unshift(r),d.splice(a,n-a+1,l))}}return nr(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function Pue(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const s=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const l=o.events,c=[],u={};let d,f,h=-1,p=n,m=0,g=0;const y=[g];for(;p;){for(;e.get(++a)[1]!==p;);s.push(a),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),f&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(d),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++h<l.length;)l[h][0]==="exit"&&l[h-1][0]==="enter"&&l[h][1].type===l[h-1][1].type&&l[h][1].start.line!==l[h][1].end.line&&(g=h+1,y.push(g),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):y.pop(),h=y.length;h--;){const v=l.slice(y[h],y[h+1]),k=s.pop();c.push([k,k+v.length-1]),e.splice(k,2,v)}for(c.reverse(),h=-1;++h<c.length;)u[m+c[h][0]]=m+c[h][1],m+=c[h][1]-c[h][0]-1;return u}const Rue={resolve:Iue,tokenize:$ue},Mue={partial:!0,tokenize:Lue};function Iue(e){return HM(e),e}function $ue(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(l)}function a(l){return l===null?s(l):Ce(l)?e.check(Mue,o,s)(l):(e.consume(l),a)}function s(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function o(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function Lue(e,t,n){const r=this;return a;function a(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Ue(e,s,"linePrefix")}function s(o){if(o===null||Ce(o))return n(o);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function GM(e,t,n,r,a,s,o,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(v){return v===60?(e.enter(r),e.enter(a),e.enter(s),e.consume(v),e.exit(s),h):v===null||v===32||v===41||fp(v)?n(v):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(v))}function h(v){return v===62?(e.enter(s),e.consume(v),e.exit(s),e.exit(a),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===62?(e.exit("chunkString"),e.exit(l),h(v)):v===null||v===60||Ce(v)?n(v):(e.consume(v),v===92?m:p)}function m(v){return v===60||v===62||v===92?(e.consume(v),p):p(v)}function g(v){return!d&&(v===null||v===41||dt(v))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(v)):d<u&&v===40?(e.consume(v),d++,g):v===41?(e.consume(v),d--,g):v===null||v===32||v===40||fp(v)?n(v):(e.consume(v),v===92?y:g)}function y(v){return v===40||v===41||v===92?(e.consume(v),g):g(v)}}function qM(e,t,n,r,a,s){const o=this;let l=0,c;return u;function u(p){return e.enter(r),e.enter(a),e.consume(p),e.exit(a),e.enter(s),d}function d(p){return l>999||p===null||p===91||p===93&&!c||p===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(s),e.enter(a),e.consume(p),e.exit(a),e.exit(r),t):Ce(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||Ce(p)||l++>999?(e.exit("chunkString"),d(p)):(e.consume(p),c||(c=!ze(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),l++,f):f(p)}}function KM(e,t,n,r,a,s){let o;return l;function l(h){return h===34||h===39||h===40?(e.enter(r),e.enter(a),e.consume(h),e.exit(a),o=h===40?41:h,c):n(h)}function c(h){return h===o?(e.enter(a),e.consume(h),e.exit(a),e.exit(r),t):(e.enter(s),u(h))}function u(h){return h===o?(e.exit(s),c(o)):h===null?n(h):Ce(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Ue(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===o||h===null||Ce(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===o||h===92?(e.consume(h),d):d(h)}}function Hc(e,t){let n;return r;function r(a){return Ce(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):ze(a)?Ue(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const Due={name:"definition",tokenize:zue},Bue={partial:!0,tokenize:Fue};function zue(e,t,n){const r=this;let a;return s;function s(p){return e.enter("definition"),o(p)}function o(p){return qM.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return a=Wr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),c):n(p)}function c(p){return dt(p)?Hc(e,u)(p):u(p)}function u(p){return GM(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(Bue,f,f)(p)}function f(p){return ze(p)?Ue(e,h,"whitespace")(p):h(p)}function h(p){return p===null||Ce(p)?(e.exit("definition"),r.parser.defined.push(a),t(p)):n(p)}}function Fue(e,t,n){return r;function r(l){return dt(l)?Hc(e,a)(l):n(l)}function a(l){return KM(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return ze(l)?Ue(e,o,"whitespace")(l):o(l)}function o(l){return l===null||Ce(l)?t(l):n(l)}}const Uue={name:"hardBreakEscape",tokenize:Wue};function Wue(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),a}function a(s){return Ce(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const Hue={name:"headingAtx",resolve:Gue,tokenize:que};function Gue(e,t){let n=e.length-2,r=3,a,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},nr(e,r,n-r+1,[["enter",a,t],["enter",s,t],["exit",s,t],["exit",a,t]])),e}function que(e,t,n){let r=0;return a;function a(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&r++<6?(e.consume(d),o):d===null||dt(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||Ce(d)?(e.exit("atxHeading"),t(d)):ze(d)?Ue(e,l,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||dt(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const Kue=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],UE=["pre","script","style","textarea"],Vue={concrete:!0,name:"htmlFlow",resolveTo:Que,tokenize:Zue},Yue={partial:!0,tokenize:ede},Xue={partial:!0,tokenize:Jue};function Que(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Zue(e,t,n){const r=this;let a,s,o,l,c;return u;function u(L){return d(L)}function d(L){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(L),f}function f(L){return L===33?(e.consume(L),h):L===47?(e.consume(L),s=!0,g):L===63?(e.consume(L),a=3,r.interrupt?t:O):An(L)?(e.consume(L),o=String.fromCharCode(L),y):n(L)}function h(L){return L===45?(e.consume(L),a=2,p):L===91?(e.consume(L),a=5,l=0,m):An(L)?(e.consume(L),a=4,r.interrupt?t:O):n(L)}function p(L){return L===45?(e.consume(L),r.interrupt?t:O):n(L)}function m(L){const ie="CDATA[";return L===ie.charCodeAt(l++)?(e.consume(L),l===ie.length?r.interrupt?t:T:m):n(L)}function g(L){return An(L)?(e.consume(L),o=String.fromCharCode(L),y):n(L)}function y(L){if(L===null||L===47||L===62||dt(L)){const ie=L===47,fe=o.toLowerCase();return!ie&&!s&&UE.includes(fe)?(a=1,r.interrupt?t(L):T(L)):Kue.includes(o.toLowerCase())?(a=6,ie?(e.consume(L),v):r.interrupt?t(L):T(L)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(L):s?k(L):w(L))}return L===45||Sn(L)?(e.consume(L),o+=String.fromCharCode(L),y):n(L)}function v(L){return L===62?(e.consume(L),r.interrupt?t:T):n(L)}function k(L){return ze(L)?(e.consume(L),k):_(L)}function w(L){return L===47?(e.consume(L),_):L===58||L===95||An(L)?(e.consume(L),j):ze(L)?(e.consume(L),w):_(L)}function j(L){return L===45||L===46||L===58||L===95||Sn(L)?(e.consume(L),j):S(L)}function S(L){return L===61?(e.consume(L),x):ze(L)?(e.consume(L),S):w(L)}function x(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),c=L,N):ze(L)?(e.consume(L),x):E(L)}function N(L){return L===c?(e.consume(L),c=null,P):L===null||Ce(L)?n(L):(e.consume(L),N)}function E(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||dt(L)?S(L):(e.consume(L),E)}function P(L){return L===47||L===62||ze(L)?w(L):n(L)}function _(L){return L===62?(e.consume(L),R):n(L)}function R(L){return L===null||Ce(L)?T(L):ze(L)?(e.consume(L),R):n(L)}function T(L){return L===45&&a===2?(e.consume(L),D):L===60&&a===1?(e.consume(L),U):L===62&&a===4?(e.consume(L),J):L===63&&a===3?(e.consume(L),O):L===93&&a===5?(e.consume(L),z):Ce(L)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(Yue,F,B)(L)):L===null||Ce(L)?(e.exit("htmlFlowData"),B(L)):(e.consume(L),T)}function B(L){return e.check(Xue,$,F)(L)}function $(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),I}function I(L){return L===null||Ce(L)?B(L):(e.enter("htmlFlowData"),T(L))}function D(L){return L===45?(e.consume(L),O):T(L)}function U(L){return L===47?(e.consume(L),o="",M):T(L)}function M(L){if(L===62){const ie=o.toLowerCase();return UE.includes(ie)?(e.consume(L),J):T(L)}return An(L)&&o.length<8?(e.consume(L),o+=String.fromCharCode(L),M):T(L)}function z(L){return L===93?(e.consume(L),O):T(L)}function O(L){return L===62?(e.consume(L),J):L===45&&a===2?(e.consume(L),O):T(L)}function J(L){return L===null||Ce(L)?(e.exit("htmlFlowData"),F(L)):(e.consume(L),J)}function F(L){return e.exit("htmlFlow"),t(L)}}function Jue(e,t,n){const r=this;return a;function a(o){return Ce(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function ede(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(fd,t,n)}}const tde={name:"htmlText",tokenize:nde};function nde(e,t,n){const r=this;let a,s,o;return l;function l(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),c}function c(O){return O===33?(e.consume(O),u):O===47?(e.consume(O),S):O===63?(e.consume(O),w):An(O)?(e.consume(O),E):n(O)}function u(O){return O===45?(e.consume(O),d):O===91?(e.consume(O),s=0,m):An(O)?(e.consume(O),k):n(O)}function d(O){return O===45?(e.consume(O),p):n(O)}function f(O){return O===null?n(O):O===45?(e.consume(O),h):Ce(O)?(o=f,U(O)):(e.consume(O),f)}function h(O){return O===45?(e.consume(O),p):f(O)}function p(O){return O===62?D(O):O===45?h(O):f(O)}function m(O){const J="CDATA[";return O===J.charCodeAt(s++)?(e.consume(O),s===J.length?g:m):n(O)}function g(O){return O===null?n(O):O===93?(e.consume(O),y):Ce(O)?(o=g,U(O)):(e.consume(O),g)}function y(O){return O===93?(e.consume(O),v):g(O)}function v(O){return O===62?D(O):O===93?(e.consume(O),v):g(O)}function k(O){return O===null||O===62?D(O):Ce(O)?(o=k,U(O)):(e.consume(O),k)}function w(O){return O===null?n(O):O===63?(e.consume(O),j):Ce(O)?(o=w,U(O)):(e.consume(O),w)}function j(O){return O===62?D(O):w(O)}function S(O){return An(O)?(e.consume(O),x):n(O)}function x(O){return O===45||Sn(O)?(e.consume(O),x):N(O)}function N(O){return Ce(O)?(o=N,U(O)):ze(O)?(e.consume(O),N):D(O)}function E(O){return O===45||Sn(O)?(e.consume(O),E):O===47||O===62||dt(O)?P(O):n(O)}function P(O){return O===47?(e.consume(O),D):O===58||O===95||An(O)?(e.consume(O),_):Ce(O)?(o=P,U(O)):ze(O)?(e.consume(O),P):D(O)}function _(O){return O===45||O===46||O===58||O===95||Sn(O)?(e.consume(O),_):R(O)}function R(O){return O===61?(e.consume(O),T):Ce(O)?(o=R,U(O)):ze(O)?(e.consume(O),R):P(O)}function T(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),a=O,B):Ce(O)?(o=T,U(O)):ze(O)?(e.consume(O),T):(e.consume(O),$)}function B(O){return O===a?(e.consume(O),a=void 0,I):O===null?n(O):Ce(O)?(o=B,U(O)):(e.consume(O),B)}function $(O){return O===null||O===34||O===39||O===60||O===61||O===96?n(O):O===47||O===62||dt(O)?P(O):(e.consume(O),$)}function I(O){return O===47||O===62||dt(O)?P(O):n(O)}function D(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),t):n(O)}function U(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),M}function M(O){return ze(O)?Ue(e,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):z(O)}function z(O){return e.enter("htmlTextData"),o(O)}}const C0={name:"labelEnd",resolveAll:sde,resolveTo:ode,tokenize:lde},rde={tokenize:cde},ade={tokenize:ude},ide={tokenize:dde};function sde(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&nr(e,0,e.length,n),e}function ode(e,t){let n=e.length,r=0,a,s,o,l;for(;n--;)if(a=e[n][1],s){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(s=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(o=n);const c={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},d={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[o-2][1].start}};return l=[["enter",c,t],["enter",u,t]],l=vr(l,e.slice(s+1,s+r+3)),l=vr(l,[["enter",d,t]]),l=vr(l,Tm(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),l=vr(l,[["exit",d,t],e[o-2],e[o-1],["exit",u,t]]),l=vr(l,e.slice(o+1)),l=vr(l,[["exit",c,t]]),nr(e,s,e.length,l),e}function lde(e,t,n){const r=this;let a=r.events.length,s,o;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){s=r.events[a][1];break}return l;function l(h){return s?s._inactive?f(h):(o=r.parser.defined.includes(Wr(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),c):n(h)}function c(h){return h===40?e.attempt(rde,d,o?d:f)(h):h===91?e.attempt(ade,d,o?u:f)(h):o?d(h):f(h)}function u(h){return e.attempt(ide,d,f)(h)}function d(h){return t(h)}function f(h){return s._balanced=!0,n(h)}}function cde(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),a}function a(f){return dt(f)?Hc(e,s)(f):s(f)}function s(f){return f===41?d(f):GM(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return dt(f)?Hc(e,c)(f):d(f)}function l(f){return n(f)}function c(f){return f===34||f===39||f===40?KM(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function u(f){return dt(f)?Hc(e,d)(f):d(f)}function d(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function ude(e,t,n){const r=this;return a;function a(l){return qM.call(r,e,s,o,"reference","referenceMarker","referenceString")(l)}function s(l){return r.parser.defined.includes(Wr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function o(l){return n(l)}}function dde(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),a}function a(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const fde={name:"labelStartImage",resolveAll:C0.resolveAll,tokenize:hde};function hde(e,t,n){const r=this;return a;function a(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),s}function s(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),o):n(l)}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const pde={name:"labelStartLink",resolveAll:C0.resolveAll,tokenize:mde};function mde(e,t,n){const r=this;return a;function a(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const ev={name:"lineEnding",tokenize:gde};function gde(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ue(e,t,"linePrefix")}}const If={name:"thematicBreak",tokenize:vde};function vde(e,t,n){let r=0,a;return s;function s(u){return e.enter("thematicBreak"),o(u)}function o(u){return a=u,l(u)}function l(u){return u===a?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||Ce(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===a?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),ze(u)?Ue(e,l,"whitespace")(u):l(u))}}const $n={continuation:{tokenize:wde},exit:Sde,name:"list",tokenize:xde},yde={partial:!0,tokenize:jde},bde={partial:!0,tokenize:kde};function xde(e,t,n){const r=this,a=r.events[r.events.length-1];let s=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,o=0;return l;function l(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Zb(p)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(If,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(p)}return n(p)}function c(p){return Zb(p)&&++o<10?(e.consume(p),c):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(fd,r.interrupt?n:d,e.attempt(yde,h,f))}function d(p){return r.containerState.initialBlankLine=!0,s++,h(p)}function f(p){return ze(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function wde(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(fd,a,s);function a(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ue(e,t,"listItemIndent",r.containerState.size+1)(l)}function s(l){return r.containerState.furtherBlankLines||!ze(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(bde,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ue(e,e.attempt($n,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function kde(e,t,n){const r=this;return Ue(e,a,"listItemIndent",r.containerState.size+1);function a(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function Sde(e){e.exit(this.containerState.type)}function jde(e,t,n){const r=this;return Ue(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(s){const o=r.events[r.events.length-1];return!ze(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const WE={name:"setextUnderline",resolveTo:Nde,tokenize:Ede};function Nde(e,t){let n=e.length,r,a,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",s?(e.splice(a,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function Ede(e,t,n){const r=this;let a;return s;function s(u){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),a=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===a?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),ze(u)?Ue(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Ce(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const _de={tokenize:Cde};function Cde(e){const t=this,n=e.attempt(fd,r,e.attempt(this.parser.constructs.flowInitial,a,Ue(e,e.attempt(this.parser.constructs.flow,a,e.attempt(Rue,a)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Ade={resolveAll:YM()},Tde=VM("string"),Ode=VM("text");function VM(e){return{resolveAll:YM(e==="text"?Pde:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],s=n.attempt(a,o,l);return o;function o(d){return u(d)?s(d):l(d)}function l(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return u(d)?(n.exit("data"),s(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const f=a[d];let h=-1;if(f)for(;++h<f.length;){const p=f[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function YM(e){return t;function t(n,r){let a=-1,s;for(;++a<=n.length;)s===void 0?n[a]&&n[a][1].type==="data"&&(s=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==s+2&&(n[s][1].end=n[a-1][1].end,n.splice(s+2,a-s-2),a=s+2),s=void 0);return e?e(n,r):n}}function Pde(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let s=a.length,o=-1,l=0,c;for(;s--;){const u=a[s];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)l++,o--;if(o)break;o=-1}else if(u===-2)c=!0,l++;else if(u!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const u={type:n===e.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:r.start._bufferIndex+o,_index:r.start._index+s,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const Rde={42:$n,43:$n,45:$n,48:$n,49:$n,50:$n,51:$n,52:$n,53:$n,54:$n,55:$n,56:$n,57:$n,62:FM},Mde={91:Due},Ide={[-2]:Jg,[-1]:Jg,32:Jg},$de={35:Hue,42:If,45:[WE,If],60:Vue,61:WE,95:If,96:FE,126:FE},Lde={38:WM,92:UM},Dde={[-5]:ev,[-4]:ev,[-3]:ev,33:fde,38:WM,42:Jb,60:[pue,tde],91:pde,92:[Uue,UM],93:C0,95:Jb,96:_ue},Bde={null:[Jb,Ade]},zde={null:[42,95]},Fde={null:[]},Ude=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:zde,contentInitial:Mde,disable:Fde,document:Rde,flow:$de,flowInitial:Ide,insideSpan:Bde,string:Lde,text:Dde},Symbol.toStringTag,{value:"Module"}));function Wde(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},s=[];let o=[],l=[];const c={attempt:N(S),check:N(x),consume:k,enter:w,exit:j,interrupt:N(x,{interrupt:!0})},u={code:null,containerState:{},defineSkip:g,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:f};let d=t.tokenize.call(u,c);return t.resolveAll&&s.push(t),u;function f(R){return o=vr(o,R),y(),o[o.length-1]!==null?[]:(E(t,0),u.events=Tm(s,u.events,u),u.events)}function h(R,T){return Gde(p(R),T)}function p(R){return Hde(o,R)}function m(){const{_bufferIndex:R,_index:T,line:B,column:$,offset:I}=r;return{_bufferIndex:R,_index:T,line:B,column:$,offset:I}}function g(R){a[R.line]=R.column,_()}function y(){let R;for(;r._index<o.length;){const T=o[r._index];if(typeof T=="string")for(R=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===R&&r._bufferIndex<T.length;)v(T.charCodeAt(r._bufferIndex));else v(T)}}function v(R){d=d(R)}function k(R){Ce(R)?(r.line++,r.column=1,r.offset+=R===-3?2:1,_()):R!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=R}function w(R,T){const B=T||{};return B.type=R,B.start=m(),u.events.push(["enter",B,u]),l.push(B),B}function j(R){const T=l.pop();return T.end=m(),u.events.push(["exit",T,u]),T}function S(R,T){E(R,T.from)}function x(R,T){T.restore()}function N(R,T){return B;function B($,I,D){let U,M,z,O;return Array.isArray($)?F($):"tokenize"in $?F([$]):J($);function J(ve){return Ee;function Ee(ee){const Q=ee!==null&&ve[ee],ae=ee!==null&&ve.null,ce=[...Array.isArray(Q)?Q:Q?[Q]:[],...Array.isArray(ae)?ae:ae?[ae]:[]];return F(ce)(ee)}}function F(ve){return U=ve,M=0,ve.length===0?D:L(ve[M])}function L(ve){return Ee;function Ee(ee){return O=P(),z=ve,ve.partial||(u.currentConstruct=ve),ve.name&&u.parser.constructs.disable.null.includes(ve.name)?fe():ve.tokenize.call(T?Object.assign(Object.create(u),T):u,c,ie,fe)(ee)}}function ie(ve){return R(z,O),I}function fe(ve){return O.restore(),++M<U.length?L(U[M]):D}}}function E(R,T){R.resolveAll&&!s.includes(R)&&s.push(R),R.resolve&&nr(u.events,T,u.events.length-T,R.resolve(u.events.slice(T),u)),R.resolveTo&&(u.events=R.resolveTo(u.events,u))}function P(){const R=m(),T=u.previous,B=u.currentConstruct,$=u.events.length,I=Array.from(l);return{from:$,restore:D};function D(){r=R,u.previous=T,u.currentConstruct=B,u.events.length=$,l=I,_()}}function _(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function Hde(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,s=t.end._bufferIndex;let o;if(n===a)o=[e[n].slice(r,s)];else{if(o=e.slice(n,a),r>-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}s>0&&o.push(e[a].slice(0,s))}return o}function Gde(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
166
+ `;break}case-3:{o=`\r
167
+ `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&a)continue;o=" ";break}default:o=String.fromCharCode(s)}a=s===-2,r.push(o)}return r.join("")}function qde(e){const r={constructs:BM([Ude,...(e||{}).extensions||[]]),content:a(oue),defined:[],document:a(cue),flow:a(_de),lazy:{},string:a(Tde),text:a(Ode)};return r;function a(s){return o;function o(l){return Wde(r,s,l)}}}function Kde(e){for(;!HM(e););return e}const HE=/[\0\t\n\r]/g;function Vde(){let e=1,t="",n=!0,r;return a;function a(s,o,l){const c=[];let u,d,f,h,p;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),f=0,t="",n&&(s.charCodeAt(0)===65279&&f++,n=void 0);f<s.length;){if(HE.lastIndex=f,u=HE.exec(s),h=u&&u.index!==void 0?u.index:s.length,p=s.charCodeAt(h),!u){t=s.slice(f);break}if(p===10&&f===h&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),f<h&&(c.push(s.slice(f,h)),e+=h-f),p){case 0:{c.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,c.push(-2);e++<d;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return l&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const Yde=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Xde(e){return e.replace(Yde,Qde)}function Qde(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),s=a===120||a===88;return zM(n.slice(s?2:1),s?16:10)}return _0(n)||e}const XM={}.hasOwnProperty;function Zde(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Jde(n)(Kde(qde(n).document().write(Vde()(e,t,!0))))}function Jde(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Qe),autolinkProtocol:P,autolinkEmail:P,atxHeading:s(Pe),blockQuote:s(ae),characterEscape:P,characterReference:P,codeFenced:s(ce),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(ce,o),codeText:s(G,o),codeTextData:P,data:P,codeFlowValue:P,definition:s(xe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(we),hardBreakEscape:s(ge),hardBreakTrailing:s(ge),htmlFlow:s(Ie,o),htmlFlowData:P,htmlText:s(Ie,o),htmlTextData:P,image:s(me),label:o,link:s(Qe),listItem:s(_e),listItemValue:h,listOrdered:s(De,f),listUnordered:s(De),paragraph:s(pt),reference:L,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(Pe),strong:s(We),thematicBreak:s(Yt)},exit:{atxHeading:c(),atxHeadingSequence:S,autolink:c(),autolinkEmail:Q,autolinkProtocol:ee,blockQuote:c(),characterEscapeValue:_,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:ve,characterReference:Ee,codeFenced:c(y),codeFencedFence:g,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:_,codeIndented:c(v),codeText:c(I),codeTextData:_,data:_,definition:c(),definitionDestinationString:j,definitionLabelString:k,definitionTitleString:w,emphasis:c(),hardBreakEscape:c(T),hardBreakTrailing:c(T),htmlFlow:c(B),htmlFlowData:_,htmlText:c($),htmlTextData:_,image:c(U),label:z,labelText:M,lineEnding:R,link:c(D),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ie,resourceDestinationString:O,resourceTitleString:J,resource:F,setextHeading:c(E),setextHeadingLineSequence:N,setextHeadingText:x,strong:c(),thematicBreak:c()}};QM(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(q){let Z={type:"root",children:[]};const se={stack:[Z],tokenStack:[],config:t,enter:l,exit:u,buffer:o,resume:d,data:n},pe=[];let ke=-1;for(;++ke<q.length;)if(q[ke][1].type==="listOrdered"||q[ke][1].type==="listUnordered")if(q[ke][0]==="enter")pe.push(ke);else{const $e=pe.pop();ke=a(q,$e,ke)}for(ke=-1;++ke<q.length;){const $e=t[q[ke][0]];XM.call($e,q[ke][1].type)&&$e[q[ke][1].type].call(Object.assign({sliceSerialize:q[ke][2].sliceSerialize},se),q[ke][1])}if(se.tokenStack.length>0){const $e=se.tokenStack[se.tokenStack.length-1];($e[1]||GE).call(se,void 0,$e[0])}for(Z.position={start:ai(q.length>0?q[0][1].start:{line:1,column:1,offset:0}),end:ai(q.length>0?q[q.length-2][1].end:{line:1,column:1,offset:0})},ke=-1;++ke<t.transforms.length;)Z=t.transforms[ke](Z)||Z;return Z}function a(q,Z,se){let pe=Z-1,ke=-1,$e=!1,zt,Le,rn,Mn;for(;++pe<=se;){const wt=q[pe];switch(wt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{wt[0]==="enter"?ke++:ke--,Mn=void 0;break}case"lineEndingBlank":{wt[0]==="enter"&&(zt&&!Mn&&!ke&&!rn&&(rn=pe),Mn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Mn=void 0}if(!ke&&wt[0]==="enter"&&wt[1].type==="listItemPrefix"||ke===-1&&wt[0]==="exit"&&(wt[1].type==="listUnordered"||wt[1].type==="listOrdered")){if(zt){let Mt=pe;for(Le=void 0;Mt--;){const an=q[Mt];if(an[1].type==="lineEnding"||an[1].type==="lineEndingBlank"){if(an[0]==="exit")continue;Le&&(q[Le][1].type="lineEndingBlank",$e=!0),an[1].type="lineEnding",Le=Mt}else if(!(an[1].type==="linePrefix"||an[1].type==="blockQuotePrefix"||an[1].type==="blockQuotePrefixWhitespace"||an[1].type==="blockQuoteMarker"||an[1].type==="listItemIndent"))break}rn&&(!Le||rn<Le)&&(zt._spread=!0),zt.end=Object.assign({},Le?q[Le][1].start:wt[1].end),q.splice(Le||pe,0,["exit",zt,wt[2]]),pe++,se++}if(wt[1].type==="listItemPrefix"){const Mt={type:"listItem",_spread:!1,start:Object.assign({},wt[1].start),end:void 0};zt=Mt,q.splice(pe,0,["enter",Mt,wt[2]]),pe++,se++,rn=void 0,Mn=!0}}}return q[Z][1]._spread=$e,se}function s(q,Z){return se;function se(pe){l.call(this,q(pe),pe),Z&&Z.call(this,pe)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(q,Z,se){this.stack[this.stack.length-1].children.push(q),this.stack.push(q),this.tokenStack.push([Z,se||void 0]),q.position={start:ai(Z.start),end:void 0}}function c(q){return Z;function Z(se){q&&q.call(this,se),u.call(this,se)}}function u(q,Z){const se=this.stack.pop(),pe=this.tokenStack.pop();if(pe)pe[0].type!==q.type&&(Z?Z.call(this,q,pe[0]):(pe[1]||GE).call(this,q,pe[0]));else throw new Error("Cannot close `"+q.type+"` ("+Wc({start:q.start,end:q.end})+"): it’s not open");se.position.end=ai(q.end)}function d(){return E0(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(q){if(this.data.expectingFirstListItemValue){const Z=this.stack[this.stack.length-2];Z.start=Number.parseInt(this.sliceSerialize(q),10),this.data.expectingFirstListItemValue=void 0}}function p(){const q=this.resume(),Z=this.stack[this.stack.length-1];Z.lang=q}function m(){const q=this.resume(),Z=this.stack[this.stack.length-1];Z.meta=q}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const q=this.resume(),Z=this.stack[this.stack.length-1];Z.value=q.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const q=this.resume(),Z=this.stack[this.stack.length-1];Z.value=q.replace(/(\r?\n|\r)$/g,"")}function k(q){const Z=this.resume(),se=this.stack[this.stack.length-1];se.label=Z,se.identifier=Wr(this.sliceSerialize(q)).toLowerCase()}function w(){const q=this.resume(),Z=this.stack[this.stack.length-1];Z.title=q}function j(){const q=this.resume(),Z=this.stack[this.stack.length-1];Z.url=q}function S(q){const Z=this.stack[this.stack.length-1];if(!Z.depth){const se=this.sliceSerialize(q).length;Z.depth=se}}function x(){this.data.setextHeadingSlurpLineEnding=!0}function N(q){const Z=this.stack[this.stack.length-1];Z.depth=this.sliceSerialize(q).codePointAt(0)===61?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function P(q){const se=this.stack[this.stack.length-1].children;let pe=se[se.length-1];(!pe||pe.type!=="text")&&(pe=lt(),pe.position={start:ai(q.start),end:void 0},se.push(pe)),this.stack.push(pe)}function _(q){const Z=this.stack.pop();Z.value+=this.sliceSerialize(q),Z.position.end=ai(q.end)}function R(q){const Z=this.stack[this.stack.length-1];if(this.data.atHardBreak){const se=Z.children[Z.children.length-1];se.position.end=ai(q.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Z.type)&&(P.call(this,q),_.call(this,q))}function T(){this.data.atHardBreak=!0}function B(){const q=this.resume(),Z=this.stack[this.stack.length-1];Z.value=q}function $(){const q=this.resume(),Z=this.stack[this.stack.length-1];Z.value=q}function I(){const q=this.resume(),Z=this.stack[this.stack.length-1];Z.value=q}function D(){const q=this.stack[this.stack.length-1];if(this.data.inReference){const Z=this.data.referenceType||"shortcut";q.type+="Reference",q.referenceType=Z,delete q.url,delete q.title}else delete q.identifier,delete q.label;this.data.referenceType=void 0}function U(){const q=this.stack[this.stack.length-1];if(this.data.inReference){const Z=this.data.referenceType||"shortcut";q.type+="Reference",q.referenceType=Z,delete q.url,delete q.title}else delete q.identifier,delete q.label;this.data.referenceType=void 0}function M(q){const Z=this.sliceSerialize(q),se=this.stack[this.stack.length-2];se.label=Xde(Z),se.identifier=Wr(Z).toLowerCase()}function z(){const q=this.stack[this.stack.length-1],Z=this.resume(),se=this.stack[this.stack.length-1];if(this.data.inReference=!0,se.type==="link"){const pe=q.children;se.children=pe}else se.alt=Z}function O(){const q=this.resume(),Z=this.stack[this.stack.length-1];Z.url=q}function J(){const q=this.resume(),Z=this.stack[this.stack.length-1];Z.title=q}function F(){this.data.inReference=void 0}function L(){this.data.referenceType="collapsed"}function ie(q){const Z=this.resume(),se=this.stack[this.stack.length-1];se.label=Z,se.identifier=Wr(this.sliceSerialize(q)).toLowerCase(),this.data.referenceType="full"}function fe(q){this.data.characterReferenceType=q.type}function ve(q){const Z=this.sliceSerialize(q),se=this.data.characterReferenceType;let pe;se?(pe=zM(Z,se==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):pe=_0(Z);const ke=this.stack[this.stack.length-1];ke.value+=pe}function Ee(q){const Z=this.stack.pop();Z.position.end=ai(q.end)}function ee(q){_.call(this,q);const Z=this.stack[this.stack.length-1];Z.url=this.sliceSerialize(q)}function Q(q){_.call(this,q);const Z=this.stack[this.stack.length-1];Z.url="mailto:"+this.sliceSerialize(q)}function ae(){return{type:"blockquote",children:[]}}function ce(){return{type:"code",lang:null,meta:null,value:""}}function G(){return{type:"inlineCode",value:""}}function xe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function we(){return{type:"emphasis",children:[]}}function Pe(){return{type:"heading",depth:0,children:[]}}function ge(){return{type:"break"}}function Ie(){return{type:"html",value:""}}function me(){return{type:"image",title:null,url:"",alt:null}}function Qe(){return{type:"link",title:null,url:"",children:[]}}function De(q){return{type:"list",ordered:q.type==="listOrdered",start:null,spread:q._spread,children:[]}}function _e(q){return{type:"listItem",spread:q._spread,checked:null,children:[]}}function pt(){return{type:"paragraph",children:[]}}function We(){return{type:"strong",children:[]}}function lt(){return{type:"text",value:""}}function Yt(){return{type:"thematicBreak"}}}function ai(e){return{line:e.line,column:e.column,offset:e.offset}}function QM(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?QM(e,r):efe(e,r)}}function efe(e,t){let n;for(n in t)if(XM.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function GE(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Wc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Wc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Wc({start:t.start,end:t.end})+") is still open")}function tfe(e){const t=this;t.parser=n;function n(r){return Zde(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function nfe(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function rfe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
168
+ `}]}function afe(e,t){const n=t.value?t.value+`
169
+ `:"",r={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function ife(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sfe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ofe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=Bl(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let o,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=s+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function lfe(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cfe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function ZM(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const a=e.all(t),s=a[0];s&&s.type==="text"?s.value="["+s.value:a.unshift({type:"text",value:"["});const o=a[a.length-1];return o&&o.type==="text"?o.value+=r:a.push({type:"text",value:r}),a}function ufe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ZM(e,t);const a={src:Bl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const s={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,s),e.applyData(t,s)}function dfe(e,t){const n={src:Bl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function ffe(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function hfe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ZM(e,t);const a={href:Bl(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const s={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function pfe(e,t){const n={href:Bl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function mfe(e,t,n){const r=e.all(t),a=n?gfe(n):JM(t),s={},o=[];if(typeof t.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const d=r[l];(a||l!==0||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
170
+ `}),d.type==="element"&&d.tagName==="p"&&!a?o.push(...d.children):o.push(d)}const c=r[r.length-1];c&&(a||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
171
+ `});const u={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,u),e.applyData(t,u)}function gfe(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=JM(n[r])}return t}function JM(e){const t=e.spread;return t??e.children.length>1}function vfe(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<r.length;){const o=r[a];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function yfe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bfe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function xfe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wfe(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),a.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=k0(t.children[1]),c=PM(t.children[t.children.length-1]);l&&c&&(o.position={start:l,end:c}),a.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,s),e.applyData(t,s)}function kfe(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let c=-1;const u=[];for(;++c<l;){const f=t.children[c],h={},p=o?o[c]:void 0;p&&(h.align=p);let m={type:"element",tagName:s,properties:h,children:[]};f&&(m.children=e.all(f),e.patch(f,m),m=e.applyData(f,m)),u.push(m)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,d),e.applyData(t,d)}function Sfe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const qE=9,KE=32;function jfe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const s=[];for(;r;)s.push(VE(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return s.push(VE(t.slice(a),a>0,!1)),s.join("")}function VE(e,t,n){let r=0,a=e.length;if(t){let s=e.codePointAt(r);for(;s===qE||s===KE;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(a-1);for(;s===qE||s===KE;)a--,s=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function Nfe(e,t){const n={type:"text",value:jfe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Efe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const _fe={blockquote:nfe,break:rfe,code:afe,delete:ife,emphasis:sfe,footnoteReference:ofe,heading:lfe,html:cfe,imageReference:ufe,image:dfe,inlineCode:ffe,linkReference:hfe,link:pfe,listItem:mfe,list:vfe,paragraph:yfe,root:bfe,strong:xfe,table:wfe,tableCell:Sfe,tableRow:kfe,text:Nfe,thematicBreak:Efe,toml:df,yaml:df,definition:df,footnoteDefinition:df};function df(){}const eI=-1,Om=0,Gc=1,hp=2,A0=3,T0=4,O0=5,P0=6,tI=7,nI=8,rI=typeof self=="object"?self:globalThis,YE=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new rI[e](t)},Cfe=(e,t)=>{const n=(a,s)=>(e.set(s,a),a),r=a=>{if(e.has(a))return e.get(a);const[s,o]=t[a];switch(s){case Om:case eI:return n(o,a);case Gc:{const l=n([],a);for(const c of o)l.push(r(c));return l}case hp:{const l=n({},a);for(const[c,u]of o)l[r(c)]=r(u);return l}case A0:return n(new Date(o),a);case T0:{const{source:l,flags:c}=o;return n(new RegExp(l,c),a)}case O0:{const l=n(new Map,a);for(const[c,u]of o)l.set(r(c),r(u));return l}case P0:{const l=n(new Set,a);for(const c of o)l.add(r(c));return l}case tI:{const{name:l,message:c}=o;return n(typeof rI[l]=="function"?YE(l,c):new Error(c),a)}case nI:return n(BigInt(o),a);case"BigInt":return n(Object(BigInt(o)),a);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(YE(s,o),a)};return r},XE=e=>Cfe(new Map,e)(0),us="",{toString:Afe}={},{keys:Tfe}=Object,xc=e=>{const t=typeof e;if(t!=="object"||!e)return[Om,t];const n=Afe.call(e).slice(8,-1);switch(n){case"Array":return[Gc,us];case"Object":return[hp,us];case"Date":return[A0,us];case"RegExp":return[T0,us];case"Map":return[O0,us];case"Set":return[P0,us];case"DataView":return[Gc,n]}return n.includes("Array")?[Gc,n]:e instanceof Error?[tI,e.name||"Error"]:[hp,n]},ff=([e,t])=>e===Om&&(t==="function"||t==="symbol"),Ofe=(e,t,n,r)=>{const a=(o,l)=>{const c=r.push(o)-1;return n.set(l,c),c},s=o=>{if(n.has(o))return n.get(o);let[l,c]=xc(o);switch(l){case Om:{let d=o;switch(c){case"bigint":l=nI,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return a([eI],o)}return a([l,d],o)}case Gc:{if(c){let h=o;return c==="DataView"?h=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(o)),a([c,[...h]],o)}const d=[],f=a([l,d],o);for(const h of o)d.push(s(h));return f}case hp:{if(c)switch(c){case"BigInt":return a([c,o.toString()],o);case"Boolean":case"Number":case"String":return a([c,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const d=[],f=a([l,d],o);for(const h of Tfe(o))(e||!ff(xc(o[h])))&&d.push([s(h),s(o[h])]);return f}case A0:return a([l,isNaN(o.getTime())?us:o.toISOString()],o);case T0:{const{source:d,flags:f}=o;return a([l,{source:d,flags:f}],o)}case O0:{const d=[],f=a([l,d],o);for(const[h,p]of o)(e||!(ff(xc(h))||ff(xc(p))))&&d.push([s(h),s(p)]);return f}case P0:{const d=[],f=a([l,d],o);for(const h of o)(e||!ff(xc(h)))&&d.push(s(h));return f}}const{message:u}=o;return a([l,{name:c,message:u}],o)};return s},QE=(e,{json:t,lossy:n}={})=>{const r=[];return Ofe(!(t||n),!!t,new Map,r)(e),r},pp=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?XE(QE(e,t)):structuredClone(e):(e,t)=>XE(QE(e,t));function Pfe(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Rfe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Mfe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Pfe,r=e.options.footnoteBackLabel||Rfe,a=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[c]);if(!u)continue;const d=e.all(u),f=String(u.identifier).toUpperCase(),h=Bl(f.toLowerCase());let p=0;const m=[],g=e.footnoteCounts.get(f);for(;g!==void 0&&++p<=g;){m.length>0&&m.push({type:"text",value:" "});let k=typeof n=="string"?n:n(c,p);typeof k=="string"&&(k={type:"text",value:k}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,p),className:["data-footnote-backref"]},children:Array.isArray(k)?k:[k]})}const y=d[d.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const k=y.children[y.children.length-1];k&&k.type==="text"?k.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...m)}else d.push(...m);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,v),l.push(v)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...pp(o),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
172
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
173
+ `}]}}const hd=function(e){if(e==null)return Dfe;if(typeof e=="function")return Pm(e);if(typeof e=="object")return Array.isArray(e)?Ife(e):$fe(e);if(typeof e=="string")return Lfe(e);throw new Error("Expected function, string, or object as test")};function Ife(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=hd(e[n]);return Pm(r);function r(...a){let s=-1;for(;++s<t.length;)if(t[s].apply(this,a))return!0;return!1}}function $fe(e){const t=e;return Pm(n);function n(r){const a=r;let s;for(s in e)if(a[s]!==t[s])return!1;return!0}}function Lfe(e){return Pm(t);function t(n){return n&&n.type===e}}function Pm(e){return t;function t(n,r,a){return!!(Bfe(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function Dfe(){return!0}function Bfe(e){return e!==null&&typeof e=="object"&&"type"in e}const aI=[],zfe=!0,ex=!1,Ffe="skip";function iI(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const s=hd(a),o=r?-1:1;l(e,void 0,[])();function l(c,u,d){const f=c&&typeof c=="object"?c:{};if(typeof f.type=="string"){const p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(c.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=aI,m,g,y;if((!t||s(c,u,d[d.length-1]||void 0))&&(p=Ufe(n(c,d)),p[0]===ex))return p;if("children"in c&&c.children){const v=c;if(v.children&&p[0]!==Ffe)for(g=(r?v.children.length:-1)+o,y=d.concat(v);g>-1&&g<v.children.length;){const k=v.children[g];if(m=l(k,g,y)(),m[0]===ex)return m;g=typeof m[1]=="number"?m[1]:g+o}}return p}}}function Ufe(e){return Array.isArray(e)?e:typeof e=="number"?[zfe,e]:e==null?aI:[e]}function Rm(e,t,n,r){let a,s,o;typeof t=="function"&&typeof n!="function"?(s=void 0,o=t,a=n):(s=t,o=n,a=r),iI(e,s,l,a);function l(c,u){const d=u[u.length-1],f=d?d.children.indexOf(c):void 0;return o(c,f,d)}}const tx={}.hasOwnProperty,Wfe={};function Hfe(e,t){const n=t||Wfe,r=new Map,a=new Map,s=new Map,o={..._fe,...n.handlers},l={all:u,applyData:qfe,definitionById:r,footnoteById:a,footnoteCounts:s,footnoteOrder:[],handlers:o,one:c,options:n,patch:Gfe,wrap:Vfe};return Rm(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const f=d.type==="definition"?r:a,h=String(d.identifier).toUpperCase();f.has(h)||f.set(h,d)}}),l;function c(d,f){const h=d.type,p=l.handlers[h];if(tx.call(l.handlers,h)&&p)return p(l,d,f);if(l.options.passThrough&&l.options.passThrough.includes(h)){if("children"in d){const{children:g,...y}=d,v=pp(y);return v.children=l.all(d),v}return pp(d)}return(l.options.unknownHandler||Kfe)(l,d,f)}function u(d){const f=[];if("children"in d){const h=d.children;let p=-1;for(;++p<h.length;){const m=l.one(h[p],d);if(m){if(p&&h[p-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=ZE(m.value)),!Array.isArray(m)&&m.type==="element")){const g=m.children[0];g&&g.type==="text"&&(g.value=ZE(g.value))}Array.isArray(m)?f.push(...m):f.push(m)}}}return f}}function Gfe(e,t){e.position&&(t.position=Rce(e))}function qfe(e,t){let n=t;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&s&&Object.assign(n.properties,pp(s)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function Kfe(e,t){const n=t.data||{},r="value"in t&&!(tx.call(n,"hProperties")||tx.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Vfe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
174
+ `});++r<e.length;)r&&n.push({type:"text",value:`
175
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
176
+ `}),n}function ZE(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function JE(e,t){const n=Hfe(e,t),r=n.one(e,void 0),a=Mfe(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&s.children.push({type:"text",value:`
177
+ `},a),s}function Yfe(e,t){return e&&"run"in e?async function(n,r){const a=JE(n,{file:r,...t});await e.run(a,r)}:function(n,r){return JE(n,{file:r,...e||t})}}function e_(e){if(e)throw e}var $f=Object.prototype.hasOwnProperty,sI=Object.prototype.toString,t_=Object.defineProperty,n_=Object.getOwnPropertyDescriptor,r_=function(t){return typeof Array.isArray=="function"?Array.isArray(t):sI.call(t)==="[object Array]"},a_=function(t){if(!t||sI.call(t)!=="[object Object]")return!1;var n=$f.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&$f.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var a;for(a in t);return typeof a>"u"||$f.call(t,a)},i_=function(t,n){t_&&n.name==="__proto__"?t_(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},s_=function(t,n){if(n==="__proto__")if($f.call(t,n)){if(n_)return n_(t,n).value}else return;return t[n]},Xfe=function e(){var t,n,r,a,s,o,l=arguments[0],c=1,u=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});c<u;++c)if(t=arguments[c],t!=null)for(n in t)r=s_(l,n),a=s_(t,n),l!==a&&(d&&a&&(a_(a)||(s=r_(a)))?(s?(s=!1,o=r&&r_(r)?r:[]):o=r&&a_(r)?r:{},i_(l,{name:n,newValue:e(d,o,a)})):typeof a<"u"&&i_(l,{name:n,newValue:a}));return l};const tv=Je(Xfe);function nx(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Qfe(){const e=[],t={run:n,use:r};return t;function n(...a){let s=-1;const o=a.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...a);function l(c,...u){const d=e[++s];let f=-1;if(c){o(c);return}for(;++f<a.length;)(u[f]===null||u[f]===void 0)&&(u[f]=a[f]);a=u,d?Zfe(d,l)(...u):o(null,...u)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function Zfe(e,t){let n;return r;function r(...o){const l=e.length>o.length;let c;l&&o.push(a);try{c=e.apply(this,o)}catch(u){const d=u;if(l&&n)throw d;return a(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(s,a):c instanceof Error?a(c):s(c))}function a(o,...l){n||(n=!0,t(o,...l))}function s(o){a(null,o)}}const ia={basename:Jfe,dirname:ehe,extname:the,join:nhe,sep:"/"};function Jfe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');pd(e);let n=0,r=-1,a=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(s){n=a+1;break}}else r<0&&(s=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(s){n=a+1;break}}else o<0&&(s=!0,o=a+1),l>-1&&(e.codePointAt(a)===t.codePointAt(l--)?l<0&&(r=a):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function ehe(e){if(pd(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function the(e){pd(e);let t=e.length,n=-1,r=0,a=-1,s=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?a<0?a=t:s!==1&&(s=1):a>-1&&(s=-1)}return a<0||n<0||s===0||s===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function nhe(...e){let t=-1,n;for(;++t<e.length;)pd(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":rhe(n)}function rhe(e){pd(e);const t=e.codePointAt(0)===47;let n=ahe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function ahe(e,t){let n="",r=0,a=-1,s=0,o=-1,l,c;for(;++o<=e.length;){if(o<e.length)l=e.codePointAt(o);else{if(l===47)break;l=47}if(l===47){if(!(a===o-1||s===1))if(a!==o-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),a=o,s=0;continue}}else if(n.length>0){n="",r=0,a=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,o):n=e.slice(a+1,o),r=o-a-1;a=o,s=0}else l===46&&s>-1?s++:s=-1}return n}function pd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ihe={cwd:she};function she(){return"/"}function rx(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function ohe(e){if(typeof e=="string")e=new URL(e);else if(!rx(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return lhe(e)}function lhe(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const nv=["history","path","basename","stem","extname","dirname"];class oI{constructor(t){let n;t?rx(t)?n={path:t}:typeof t=="string"||che(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":ihe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<nv.length;){const s=nv[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let a;for(a in n)nv.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?ia.basename(this.path):void 0}set basename(t){av(t,"basename"),rv(t,"basename"),this.path=ia.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ia.dirname(this.path):void 0}set dirname(t){o_(this.basename,"dirname"),this.path=ia.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ia.extname(this.path):void 0}set extname(t){if(rv(t,"extname"),o_(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ia.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){rx(t)&&(t=ohe(t)),av(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ia.basename(this.path,this.extname):void 0}set stem(t){av(t,"stem"),rv(t,"stem"),this.path=ia.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new Nn(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function rv(e,t){if(e&&e.includes(ia.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ia.sep+"`")}function av(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function o_(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function che(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const uhe=function(e){const r=this.constructor.prototype,a=r[e],s=function(){return a.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},dhe={}.hasOwnProperty;class R0 extends uhe{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Qfe()}copy(){const t=new R0;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(tv(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ov("data",this.frozen),this.namespace[t]=n,this):dhe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ov("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=hf(t),r=this.parser||this.Parser;return iv("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),iv("process",this.parser||this.Parser),sv("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(s,o){const l=hf(t),c=r.parse(l);r.run(c,l,function(d,f,h){if(d||!f||!h)return u(d);const p=f,m=r.stringify(p,h);phe(m)?h.value=m:h.result=m,u(d,h)});function u(d,f){d||!f?o(d):s?s(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),iv("processSync",this.parser||this.Parser),sv("processSync",this.compiler||this.Compiler),this.process(t,a),c_("processSync","process",n),r;function a(s,o){n=!0,e_(s),r=o}}run(t,n,r){l_(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(o,l){const c=hf(n);a.run(t,c,u);function u(d,f,h){const p=f||t;d?l(d):o?o(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,a;return this.run(t,n,s),c_("runSync","run",r),a;function s(o,l){e_(o),a=l,r=!0}}stringify(t,n){this.freeze();const r=hf(n),a=this.compiler||this.Compiler;return sv("stringify",a),l_(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(ov("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...f]=u;c(d,f)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(u.plugins),u.settings&&(a.settings=tv(!0,a.settings,u.settings))}function l(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const f=u[d];s(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===u){h=f;break}if(h===-1)r.push([u,...d]);else if(d.length>0){let[p,...m]=d;const g=r[h][1];nx(g)&&nx(p)&&(p=tv(!0,g,p)),r[h]=[u,p,...m]}}}}const fhe=new R0().freeze();function iv(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function sv(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ov(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function l_(e){if(!nx(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function c_(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function hf(e){return hhe(e)?e:new oI(e)}function hhe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function phe(e){return typeof e=="string"||mhe(e)}function mhe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ghe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",u_=[],d_={allowDangerousHtml:!0},vhe=/^(https?|ircs?|mailto|xmpp)$/i,yhe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function bhe(e){const t=xhe(e),n=whe(e);return khe(t.runSync(t.parse(n),n),e)}function xhe(e){const t=e.rehypePlugins||u_,n=e.remarkPlugins||u_,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...d_}:d_;return fhe().use(tfe).use(n).use(Yfe,r).use(t)}function whe(e){const t=e.children||"",n=new oI;return typeof t=="string"&&(n.value=t),n}function khe(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,s=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||She;for(const d of yhe)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+ghe+d.id,void 0);return Rm(e,u),Dce(e,{Fragment:i.Fragment,components:a,ignoreInvalidStyle:!0,jsx:i.jsx,jsxs:i.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return o?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let p;for(p in Zg)if(Object.hasOwn(Zg,p)&&Object.hasOwn(d.properties,p)){const m=d.properties[p],g=Zg[p];(g===null||g.includes(d.tagName))&&(d.properties[p]=c(String(m||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(d,f,h)),p&&h&&typeof f=="number")return l&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function She(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||vhe.test(e.slice(0,t))?e:""}function f_(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function jhe(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Nhe(e,t,n){const a=hd((n||{}).ignore||[]),s=Ehe(t);let o=-1;for(;++o<s.length;)iI(e,"text",l);function l(u,d){let f=-1,h;for(;++f<d.length;){const p=d[f],m=h?h.children:void 0;if(a(p,m?m.indexOf(p):void 0,h))return;h=p}if(h)return c(u,d)}function c(u,d){const f=d[d.length-1],h=s[o][0],p=s[o][1];let m=0;const y=f.children.indexOf(u);let v=!1,k=[];h.lastIndex=0;let w=h.exec(u.value);for(;w;){const j=w.index,S={index:w.index,input:w.input,stack:[...d,u]};let x=p(...w,S);if(typeof x=="string"&&(x=x.length>0?{type:"text",value:x}:void 0),x===!1?h.lastIndex=j+1:(m!==j&&k.push({type:"text",value:u.value.slice(m,j)}),Array.isArray(x)?k.push(...x):x&&k.push(x),m=j+w[0].length,v=!0),!h.global)break;w=h.exec(u.value)}return v?(m<u.value.length&&k.push({type:"text",value:u.value.slice(m)}),f.children.splice(y,1,...k)):k=[u],y+k.length}}function Ehe(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const a=n[r];t.push([_he(a[0]),Che(a[1])])}return t}function _he(e){return typeof e=="string"?new RegExp(jhe(e),"g"):e}function Che(e){return typeof e=="function"?e:function(){return e}}const lv="phrasing",cv=["autolink","link","image","label"];function Ahe(){return{transforms:[$he],enter:{literalAutolink:Ohe,literalAutolinkEmail:uv,literalAutolinkHttp:uv,literalAutolinkWww:uv},exit:{literalAutolink:Ihe,literalAutolinkEmail:Mhe,literalAutolinkHttp:Phe,literalAutolinkWww:Rhe}}}function The(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:lv,notInConstruct:cv},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:lv,notInConstruct:cv},{character:":",before:"[ps]",after:"\\/",inConstruct:lv,notInConstruct:cv}]}}function Ohe(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function uv(e){this.config.enter.autolinkProtocol.call(this,e)}function Phe(e){this.config.exit.autolinkProtocol.call(this,e)}function Rhe(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Mhe(e){this.config.exit.autolinkEmail.call(this,e)}function Ihe(e){this.exit(e)}function $he(e){Nhe(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Lhe],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Dhe]],{ignore:["link","linkReference"]})}function Lhe(e,t,n,r,a){let s="";if(!lI(a)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!Bhe(n)))return!1;const o=zhe(n+r);if(!o[0])return!1;const l={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[l,{type:"text",value:o[1]}]:l}function Dhe(e,t,n,r){return!lI(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Bhe(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function zhe(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const a=f_(e,"(");let s=f_(e,")");for(;r!==-1&&a>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function lI(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||zs(n)||Am(n))&&(!t||n!==47)}cI.peek=Yhe;function Fhe(){this.buffer()}function Uhe(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Whe(){this.buffer()}function Hhe(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Ghe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Wr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function qhe(e){this.exit(e)}function Khe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Wr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Vhe(e){this.exit(e)}function Yhe(){return"["}function cI(e,t,n,r){const a=n.createTracker(r);let s=a.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return s+=a.move(n.safe(n.associationId(e),{after:"]",before:s})),l(),o(),s+=a.move("]"),s}function Xhe(){return{enter:{gfmFootnoteCallString:Fhe,gfmFootnoteCall:Uhe,gfmFootnoteDefinitionLabelString:Whe,gfmFootnoteDefinition:Hhe},exit:{gfmFootnoteCallString:Ghe,gfmFootnoteCall:qhe,gfmFootnoteDefinitionLabelString:Khe,gfmFootnoteDefinition:Vhe}}}function Qhe(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:cI},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,s,o){const l=s.createTracker(o);let c=l.move("[^");const u=s.enter("footnoteDefinition"),d=s.enter("label");return c+=l.move(s.safe(s.associationId(r),{before:c,after:"]"})),d(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((t?`
178
+ `:" ")+s.indentLines(s.containerFlow(r,l.current()),t?uI:Zhe))),u(),c}}function Zhe(e,t,n){return t===0?e:uI(e,t,n)}function uI(e,t,n){return(n?"":" ")+e}const Jhe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];dI.peek=ape;function epe(){return{canContainEols:["delete"],enter:{strikethrough:npe},exit:{strikethrough:rpe}}}function tpe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Jhe}],handlers:{delete:dI}}}function npe(e){this.enter({type:"delete",children:[]},e)}function rpe(e){this.exit(e)}function dI(e,t,n,r){const a=n.createTracker(r),s=n.enter("strikethrough");let o=a.move("~~");return o+=n.containerPhrasing(e,{...a.current(),before:o,after:"~"}),o+=a.move("~~"),s(),o}function ape(){return"~"}function ipe(e){return e.length}function spe(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||ipe,s=[],o=[],l=[],c=[];let u=0,d=-1;for(;++d<e.length;){const g=[],y=[];let v=-1;for(e[d].length>u&&(u=e[d].length);++v<e[d].length;){const k=ope(e[d][v]);if(n.alignDelimiters!==!1){const w=a(k);y[v]=w,(c[v]===void 0||w>c[v])&&(c[v]=w)}g.push(k)}o[d]=g,l[d]=y}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)s[f]=h_(r[f]);else{const g=h_(r);for(;++f<u;)s[f]=g}f=-1;const h=[],p=[];for(;++f<u;){const g=s[f];let y="",v="";g===99?(y=":",v=":"):g===108?y=":":g===114&&(v=":");let k=n.alignDelimiters===!1?1:Math.max(1,c[f]-y.length-v.length);const w=y+"-".repeat(k)+v;n.alignDelimiters!==!1&&(k=y.length+k+v.length,k>c[f]&&(c[f]=k),p[f]=k),h[f]=w}o.splice(1,0,h),l.splice(1,0,p),d=-1;const m=[];for(;++d<o.length;){const g=o[d],y=l[d];f=-1;const v=[];for(;++f<u;){const k=g[f]||"";let w="",j="";if(n.alignDelimiters!==!1){const S=c[f]-(y[f]||0),x=s[f];x===114?w=" ".repeat(S):x===99?S%2?(w=" ".repeat(S/2+.5),j=" ".repeat(S/2-.5)):(w=" ".repeat(S/2),j=w):j=" ".repeat(S)}n.delimiterStart!==!1&&!f&&v.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&k==="")&&(n.delimiterStart!==!1||f)&&v.push(" "),n.alignDelimiters!==!1&&v.push(w),v.push(k),n.alignDelimiters!==!1&&v.push(j),n.padding!==!1&&v.push(" "),(n.delimiterEnd!==!1||f!==u-1)&&v.push("|")}m.push(n.delimiterEnd===!1?v.join("").replace(/ +$/,""):v.join(""))}return m.join(`
179
+ `)}function ope(e){return e==null?"":String(e)}function h_(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function lpe(e,t,n,r){const a=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),cpe);return a(),o}function cpe(e,t,n){return">"+(n?"":" ")+e}function upe(e,t){return p_(e,t.inConstruct,!0)&&!p_(e,t.notInConstruct,!1)}function p_(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function m_(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
180
+ `&&upe(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\
181
+ `}function dpe(e,t){const n=String(e);let r=n.indexOf(t),a=r,s=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===a?++s>o&&(o=s):s=1,a=r+t.length,r=n.indexOf(t,a);return o}function fpe(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function hpe(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function ppe(e,t,n,r){const a=hpe(n),s=e.value||"",o=a==="`"?"GraveAccent":"Tilde";if(fpe(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(s,mpe);return f(),h}const l=n.createTracker(r),c=a.repeat(Math.max(dpe(s,a)+1,3)),u=n.enter("codeFenced");let d=l.move(c);if(e.lang){const f=n.enter(`codeFencedLang${o}`);d+=l.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...l.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${o}`);d+=l.move(" "),d+=l.move(n.safe(e.meta,{before:d,after:`
182
+ `,encode:["`"],...l.current()})),f()}return d+=l.move(`
183
+ `),s&&(d+=l.move(s+`
184
+ `)),d+=l.move(c),u(),d}function mpe(e,t,n){return(n?"":" ")+e}function M0(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function gpe(e,t,n,r){const a=M0(n),s=a==='"'?"Quote":"Apostrophe",o=n.enter("definition");let l=n.enter("label");const c=n.createTracker(r);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":`
185
+ `,...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=c.move(" "+a),u+=c.move(n.safe(e.title,{before:u,after:a,...c.current()})),u+=c.move(a),l()),o(),u}function vpe(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Yu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function mp(e,t,n){const r=bl(e),a=bl(t);return r===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}fI.peek=ype;function fI(e,t,n,r){const a=vpe(n),s=n.enter("emphasis"),o=n.createTracker(r),l=o.move(a);let c=o.move(n.containerPhrasing(e,{after:a,before:l,...o.current()}));const u=c.charCodeAt(0),d=mp(r.before.charCodeAt(r.before.length-1),u,a);d.inside&&(c=Yu(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=mp(r.after.charCodeAt(0),f,a);h.inside&&(c=c.slice(0,-1)+Yu(f));const p=o.move(a);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function ype(e,t,n){return n.options.emphasis||"*"}function bpe(e,t){let n=!1;return Rm(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,ex}),!!((!e.depth||e.depth<3)&&E0(e)&&(t.options.setext||n))}function xpe(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(bpe(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:`
186
+ `,after:`
187
+ `});return f(),d(),h+`
188
+ `+(a===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
189
+ `))+1))}const o="#".repeat(a),l=n.enter("headingAtx"),c=n.enter("phrasing");s.move(o+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
190
+ `,...s.current()});return/^[\t ]/.test(u)&&(u=Yu(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),c(),l(),u}hI.peek=wpe;function hI(e){return e.value||""}function wpe(){return"<"}pI.peek=kpe;function pI(e,t,n,r){const a=M0(n),s=a==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const c=n.createTracker(r);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=c.move(" "+a),u+=c.move(n.safe(e.title,{before:u,after:a,...c.current()})),u+=c.move(a),l()),u+=c.move(")"),o(),u}function kpe(){return"!"}mI.peek=Spe;function mI(e,t,n,r){const a=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=d,s(),a==="full"||!u||u!==f?c+=l.move(f+"]"):a==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function Spe(){return"!"}gI.peek=jpe;function gI(e,t,n){let r=e.value||"",a="`",s=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const o=n.unsafe[s],l=n.compilePattern(o);let c;if(o.atBreak)for(;c=l.exec(r);){let u=c.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(c.index+1)}}return a+r+a}function jpe(){return"`"}function vI(e,t){const n=E0(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}yI.peek=Npe;function yI(e,t,n,r){const a=M0(n),s=a==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,c;if(vI(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let f=o.move("<");return f+=o.move(n.containerPhrasing(e,{before:f,after:">",...o.current()})),f+=o.move(">"),l(),n.stack=d,f}l=n.enter("link"),c=n.enter("label");let u=o.move("[");return u+=o.move(n.containerPhrasing(e,{before:u,after:"](",...o.current()})),u+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(n.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(c=n.enter("destinationRaw"),u+=o.move(n.safe(e.url,{before:u,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=n.enter(`title${s}`),u+=o.move(" "+a),u+=o.move(n.safe(e.title,{before:u,after:a,...o.current()})),u+=o.move(a),c()),u+=o.move(")"),l(),u}function Npe(e,t,n){return vI(e,n)?"<":"["}bI.peek=Epe;function bI(e,t,n,r){const a=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=d,s(),a==="full"||!u||u!==f?c+=l.move(f+"]"):a==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function Epe(){return"["}function I0(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function _pe(e){const t=I0(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Cpe(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function xI(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Ape(e,t,n,r){const a=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?Cpe(n):I0(n);const l=e.ordered?o==="."?")":".":_pe(n);let c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),xI(n)===o&&d){let f=-1;for(;++f<e.children.length;){const h=e.children[f];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(o=l),n.bulletCurrent=o;const u=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=s,a(),u}function Tpe(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Ope(e,t,n,r){const a=Tpe(n);let s=n.bulletCurrent||I0(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(r);l.move(s+" ".repeat(o-s.length)),l.shift(o);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.current()),d);return c(),u;function d(f,h,p){return h?(p?"":" ".repeat(o))+f:(p?s:s+" ".repeat(o-s.length))+f}}function Ppe(e,t,n,r){const a=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,r);return s(),a(),o}const Rpe=hd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Mpe(e,t,n,r){return(e.children.some(function(o){return Rpe(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Ipe(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}wI.peek=$pe;function wI(e,t,n,r){const a=Ipe(n),s=n.enter("strong"),o=n.createTracker(r),l=o.move(a+a);let c=o.move(n.containerPhrasing(e,{after:a,before:l,...o.current()}));const u=c.charCodeAt(0),d=mp(r.before.charCodeAt(r.before.length-1),u,a);d.inside&&(c=Yu(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=mp(r.after.charCodeAt(0),f,a);h.inside&&(c=c.slice(0,-1)+Yu(f));const p=o.move(a+a);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function $pe(e,t,n){return n.options.strong||"*"}function Lpe(e,t,n,r){return n.safe(e.value,r)}function Dpe(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Bpe(e,t,n){const r=(xI(n)+(n.options.ruleSpaces?" ":"")).repeat(Dpe(n));return n.options.ruleSpaces?r.slice(0,-1):r}const kI={blockquote:lpe,break:m_,code:ppe,definition:gpe,emphasis:fI,hardBreak:m_,heading:xpe,html:hI,image:pI,imageReference:mI,inlineCode:gI,link:yI,linkReference:bI,list:Ape,listItem:Ope,paragraph:Ppe,root:Mpe,strong:wI,text:Lpe,thematicBreak:Bpe};function zpe(){return{enter:{table:Fpe,tableData:g_,tableHeader:g_,tableRow:Wpe},exit:{codeText:Hpe,table:Upe,tableData:dv,tableHeader:dv,tableRow:dv}}}function Fpe(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function Upe(e){this.exit(e),this.data.inTable=void 0}function Wpe(e){this.enter({type:"tableRow",children:[]},e)}function dv(e){this.exit(e)}function g_(e){this.enter({type:"tableCell",children:[]},e)}function Hpe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Gpe));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Gpe(e,t){return t==="|"?t:e}function qpe(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
191
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:o,tableCell:c,tableRow:l}};function o(p,m,g,y){return u(d(p,g,y),p.align)}function l(p,m,g,y){const v=f(p,g,y),k=u([v]);return k.slice(0,k.indexOf(`
192
+ `))}function c(p,m,g,y){const v=g.enter("tableCell"),k=g.enter("phrasing"),w=g.containerPhrasing(p,{...y,before:s,after:s});return k(),v(),w}function u(p,m){return spe(p,{align:m,alignDelimiters:r,padding:n,stringLength:a})}function d(p,m,g){const y=p.children;let v=-1;const k=[],w=m.enter("table");for(;++v<y.length;)k[v]=f(y[v],m,g);return w(),k}function f(p,m,g){const y=p.children;let v=-1;const k=[],w=m.enter("tableRow");for(;++v<y.length;)k[v]=c(y[v],p,m,g);return w(),k}function h(p,m,g){let y=kI.inlineCode(p,m,g);return g.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function Kpe(){return{exit:{taskListCheckValueChecked:v_,taskListCheckValueUnchecked:v_,paragraph:Ype}}}function Vpe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Xpe}}}function v_(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Ype(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const a=t.children;let s=-1,o;for(;++s<a.length;){const l=a[s];if(l.type==="paragraph"){o=l;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Xpe(e,t,n,r){const a=e.children[0],s=typeof e.checked=="boolean"&&a&&a.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",l=n.createTracker(r);s&&l.move(o);let c=kI.listItem(e,t,n,{...r,...l.current()});return s&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(d){return d+o}}function Qpe(){return[Ahe(),Xhe(),epe(),zpe(),Kpe()]}function Zpe(e){return{extensions:[The(),Qhe(e),tpe(),qpe(e),Vpe()]}}const Jpe={tokenize:ime,partial:!0},SI={tokenize:sme,partial:!0},jI={tokenize:ome,partial:!0},NI={tokenize:lme,partial:!0},eme={tokenize:cme,partial:!0},EI={name:"wwwAutolink",tokenize:rme,previous:CI},_I={name:"protocolAutolink",tokenize:ame,previous:AI},Xa={name:"emailAutolink",tokenize:nme,previous:TI},va={};function tme(){return{text:va}}let rs=48;for(;rs<123;)va[rs]=Xa,rs++,rs===58?rs=65:rs===91&&(rs=97);va[43]=Xa;va[45]=Xa;va[46]=Xa;va[95]=Xa;va[72]=[Xa,_I];va[104]=[Xa,_I];va[87]=[Xa,EI];va[119]=[Xa,EI];function nme(e,t,n){const r=this;let a,s;return o;function o(f){return!ax(f)||!TI.call(r,r.previous)||$0(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(f))}function l(f){return ax(f)?(e.consume(f),l):f===64?(e.consume(f),c):n(f)}function c(f){return f===46?e.check(eme,d,u)(f):f===45||f===95||Sn(f)?(s=!0,e.consume(f),c):d(f)}function u(f){return e.consume(f),a=!0,c}function d(f){return s&&a&&An(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function rme(e,t,n){const r=this;return a;function a(o){return o!==87&&o!==119||!CI.call(r,r.previous)||$0(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Jpe,e.attempt(SI,e.attempt(jI,s),n),n)(o))}function s(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function ame(e,t,n){const r=this;let a="",s=!1;return o;function o(f){return(f===72||f===104)&&AI.call(r,r.previous)&&!$0(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(f),e.consume(f),l):n(f)}function l(f){if(An(f)&&a.length<5)return a+=String.fromCodePoint(f),e.consume(f),l;if(f===58){const h=a.toLowerCase();if(h==="http"||h==="https")return e.consume(f),c}return n(f)}function c(f){return f===47?(e.consume(f),s?u:(s=!0,c)):n(f)}function u(f){return f===null||fp(f)||dt(f)||zs(f)||Am(f)?n(f):e.attempt(SI,e.attempt(jI,d),n)(f)}function d(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function ime(e,t,n){let r=0;return a;function a(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),a):o===46&&r===3?(e.consume(o),s):n(o)}function s(o){return o===null?n(o):t(o)}}function sme(e,t,n){let r,a,s;return o;function o(u){return u===46||u===95?e.check(NI,c,l)(u):u===null||dt(u)||zs(u)||u!==45&&Am(u)?c(u):(s=!0,e.consume(u),o)}function l(u){return u===95?r=!0:(a=r,r=void 0),e.consume(u),o}function c(u){return a||r||!s?n(u):t(u)}}function ome(e,t){let n=0,r=0;return a;function a(o){return o===40?(n++,e.consume(o),a):o===41&&r<n?s(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(NI,t,s)(o):o===null||dt(o)||zs(o)?t(o):(e.consume(o),a)}function s(o){return o===41&&r++,e.consume(o),a}}function lme(e,t,n){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),r):l===38?(e.consume(l),s):l===93?(e.consume(l),a):l===60||l===null||dt(l)||zs(l)?t(l):n(l)}function a(l){return l===null||l===40||l===91||dt(l)||zs(l)?t(l):r(l)}function s(l){return An(l)?o(l):n(l)}function o(l){return l===59?(e.consume(l),r):An(l)?(e.consume(l),o):n(l)}}function cme(e,t,n){return r;function r(s){return e.consume(s),a}function a(s){return Sn(s)?n(s):t(s)}}function CI(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||dt(e)}function AI(e){return!An(e)}function TI(e){return!(e===47||ax(e))}function ax(e){return e===43||e===45||e===46||e===95||Sn(e)}function $0(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const ume={tokenize:yme,partial:!0};function dme(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:mme,continuation:{tokenize:gme},exit:vme}},text:{91:{name:"gfmFootnoteCall",tokenize:pme},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:fme,resolveTo:hme}}}}function fme(e,t,n){const r=this;let a=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;a--;){const c=r.events[a][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!o||!o._balanced)return n(c);const u=Wr(r.sliceSerialize({start:o.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function hme(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function pme(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return l;function l(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),c}function c(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(s>999||f===93&&!o||f===null||f===91||dt(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return a.includes(Wr(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return dt(f)||(o=!0),s++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),s++,u):u(f)}}function mme(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,l;return c;function c(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(m)}function d(m){if(o>999||m===93&&!l||m===null||m===91||dt(m))return n(m);if(m===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return s=Wr(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return dt(m)||(l=!0),o++,e.consume(m),m===92?f:d}function f(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),a.includes(s)||a.push(s),Ue(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function gme(e,t,n){return e.check(fd,t,e.attempt(ume,t,n))}function vme(e){e.exit("gfmFootnoteDefinition")}function yme(e,t,n){const r=this;return Ue(e,a,"gfmFootnoteDefinitionIndent",5);function a(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function bme(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(o,l){let c=-1;for(;++c<o.length;)if(o[c][0]==="enter"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._close){let u=c;for(;u--;)if(o[u][0]==="exit"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._open&&o[c][1].end.offset-o[c][1].start.offset===o[u][1].end.offset-o[u][1].start.offset){o[c][1].type="strikethroughSequence",o[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},o[u][1].start),end:Object.assign({},o[c][1].end)},f={type:"strikethroughText",start:Object.assign({},o[u][1].end),end:Object.assign({},o[c][1].start)},h=[["enter",d,l],["enter",o[u][1],l],["exit",o[u][1],l],["enter",f,l]],p=l.parser.constructs.insideSpan.null;p&&nr(h,h.length,0,Tm(p,o.slice(u+1,c),l)),nr(h,h.length,0,[["exit",f,l],["enter",o[c][1],l],["exit",o[c][1],l],["exit",d,l]]),nr(o,u-1,c-u+3,h),c=u+h.length-2;break}}for(c=-1;++c<o.length;)o[c][1].type==="strikethroughSequenceTemporary"&&(o[c][1].type="data");return o}function s(o,l,c){const u=this.previous,d=this.events;let f=0;return h;function h(m){return u===126&&d[d.length-1][1].type!=="characterEscape"?c(m):(o.enter("strikethroughSequenceTemporary"),p(m))}function p(m){const g=bl(u);if(m===126)return f>1?c(m):(o.consume(m),f++,p);if(f<2&&!n)return c(m);const y=o.exit("strikethroughSequenceTemporary"),v=bl(m);return y._open=!v||v===2&&!!g,y._close=!g||g===2&&!!v,l(m)}}}class xme{constructor(){this.map=[]}add(t,n,r){wme(this,t,n,r)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let a=r.pop();for(;a;){for(const s of a)t.push(s);a=r.pop()}this.map.length=0}}function wme(e,t,n,r){let a=0;if(!(n===0&&r.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...r);return}a+=1}e.map.push([t,n,r])}}function kme(e,t){let n=!1;const r=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function Sme(){return{flow:{null:{name:"table",tokenize:jme,resolveAll:Nme}}}}function jme(e,t,n){const r=this;let a=0,s=0,o;return l;function l(_){let R=r.events.length-1;for(;R>-1;){const $=r.events[R][1].type;if($==="lineEnding"||$==="linePrefix")R--;else break}const T=R>-1?r.events[R][1].type:null,B=T==="tableHead"||T==="tableRow"?x:c;return B===x&&r.parser.lazy[r.now().line]?n(_):B(_)}function c(_){return e.enter("tableHead"),e.enter("tableRow"),u(_)}function u(_){return _===124||(o=!0,s+=1),d(_)}function d(_){return _===null?n(_):Ce(_)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),p):n(_):ze(_)?Ue(e,d,"whitespace")(_):(s+=1,o&&(o=!1,a+=1),_===124?(e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),f(_)))}function f(_){return _===null||_===124||dt(_)?(e.exit("data"),d(_)):(e.consume(_),_===92?h:f)}function h(_){return _===92||_===124?(e.consume(_),f):f(_)}function p(_){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(_):(e.enter("tableDelimiterRow"),o=!1,ze(_)?Ue(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):m(_))}function m(_){return _===45||_===58?y(_):_===124?(o=!0,e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),g):S(_)}function g(_){return ze(_)?Ue(e,y,"whitespace")(_):y(_)}function y(_){return _===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(_),e.exit("tableDelimiterMarker"),v):_===45?(s+=1,v(_)):_===null||Ce(_)?j(_):S(_)}function v(_){return _===45?(e.enter("tableDelimiterFiller"),k(_)):S(_)}function k(_){return _===45?(e.consume(_),k):_===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(_),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(_))}function w(_){return ze(_)?Ue(e,j,"whitespace")(_):j(_)}function j(_){return _===124?m(_):_===null||Ce(_)?!o||a!==s?S(_):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(_)):S(_)}function S(_){return n(_)}function x(_){return e.enter("tableRow"),N(_)}function N(_){return _===124?(e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),N):_===null||Ce(_)?(e.exit("tableRow"),t(_)):ze(_)?Ue(e,N,"whitespace")(_):(e.enter("data"),E(_))}function E(_){return _===null||_===124||dt(_)?(e.exit("data"),N(_)):(e.consume(_),_===92?P:E)}function P(_){return _===92||_===124?(e.consume(_),E):E(_)}}function Nme(e,t){let n=-1,r=!0,a=0,s=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,u,d,f;const h=new xme;for(;++n<e.length;){const p=e[n],m=p[1];p[0]==="enter"?m.type==="tableHead"?(l=!1,c!==0&&(y_(h,t,c,u,d),d=void 0,c=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,f=void 0,s=[0,0,0,0],o=[0,n+1,0,0],l&&(l=!1,d={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",d,t]])),a=m.type==="tableDelimiterRow"?2:d?3:1):a&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],f=pf(h,t,s,a,void 0,f),s=[0,0,0,0]),o[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(o[0]=o[1],f=pf(h,t,s,a,void 0,f)),s=o,o=[s[1],n,0,0])):m.type==="tableHead"?(l=!0,c=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(c=n,s[1]!==0?(o[0]=o[1],f=pf(h,t,s,a,n,f)):o[1]!==0&&(f=pf(h,t,o,a,n,f)),a=0):a&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(o[3]=n)}for(c!==0&&y_(h,t,c,u,d),h.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=kme(t.events,n))}return e}function pf(e,t,n,r,a,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(s.end=Object.assign({},po(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const c=po(t.events,n[1]);if(s={type:o,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const u=po(t.events,n[2]),d=po(t.events,n[3]),f={type:l,start:Object.assign({},u),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const h=t.events[n[2]],p=t.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,g=n[3]-n[2]-1;e.add(m,g,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return a!==void 0&&(s.end=Object.assign({},po(t.events,a)),e.add(a,0,[["exit",s,t]]),s=void 0),s}function y_(e,t,n,r,a){const s=[],o=po(t.events,n);a&&(a.end=Object.assign({},o),s.push(["exit",a,t])),r.end=Object.assign({},o),s.push(["exit",r,t]),e.add(n+1,0,s)}function po(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Eme={name:"tasklistCheck",tokenize:Cme};function _me(){return{text:{91:Eme}}}function Cme(e,t,n){const r=this;return a;function a(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),s)}function s(c){return dt(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return Ce(c)?t(c):ze(c)?e.check({tokenize:Ame},t,n)(c):n(c)}}function Ame(e,t,n){return Ue(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function Tme(e){return BM([tme(),dme(),bme(e),Sme(),_me()])}const Ome={};function Pme(e){const t=this,n=e||Ome,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(Tme(n)),s.push(Qpe()),o.push(Zpe(n))}const b_=function(e,t,n){const r=hd(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]},Vs=function(e){if(e==null)return Ime;if(typeof e=="string")return Mme(e);if(typeof e=="object")return Rme(e);if(typeof e=="function")return L0(e);throw new Error("Expected function, string, or array as `test`")};function Rme(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Vs(e[n]);return L0(r);function r(...a){let s=-1;for(;++s<t.length;)if(t[s].apply(this,a))return!0;return!1}}function Mme(e){return L0(t);function t(n){return n.tagName===e}}function L0(e){return t;function t(n,r,a){return!!($me(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function Ime(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function $me(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const x_=/\n/g,w_=/[\t ]+/g,ix=Vs("br"),k_=Vs(Hme),Lme=Vs("p"),S_=Vs("tr"),Dme=Vs(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",Wme,Gme]),OI=Vs(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function Bme(e,t){const n=t||{},r="children"in e?e.children:[],a=OI(e),s=MI(e,{whitespace:n.whitespace||"normal"}),o=[];(e.type==="text"||e.type==="comment")&&o.push(...RI(e,{breakBefore:!0,breakAfter:!0}));let l=-1;for(;++l<r.length;)o.push(...PI(r[l],e,{whitespace:s,breakBefore:l?void 0:a,breakAfter:l<r.length-1?ix(r[l+1]):a}));const c=[];let u;for(l=-1;++l<o.length;){const d=o[l];typeof d=="number"?u!==void 0&&d>u&&(u=d):d&&(u!==void 0&&u>-1&&c.push(`
193
+ `.repeat(u)||" "),u=-1,c.push(d))}return c.join("")}function PI(e,t,n){return e.type==="element"?zme(e,t,n):e.type==="text"?n.whitespace==="normal"?RI(e,n):Fme(e):[]}function zme(e,t,n){const r=MI(e,n),a=e.children||[];let s=-1,o=[];if(Dme(e))return o;let l,c;for(ix(e)||S_(e)&&b_(t,e,S_)?c=`
194
+ `:Lme(e)?(l=2,c=2):OI(e)&&(l=1,c=1);++s<a.length;)o=o.concat(PI(a[s],e,{whitespace:r,breakBefore:s?void 0:l,breakAfter:s<a.length-1?ix(a[s+1]):c}));return k_(e)&&b_(t,e,k_)&&o.push(" "),l&&o.unshift(l),c&&o.push(c),o}function RI(e,t){const n=String(e.value),r=[],a=[];let s=0;for(;s<=n.length;){x_.lastIndex=s;const c=x_.exec(n),u=c&&"index"in c?c.index:n.length;r.push(Ume(n.slice(s,u).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),s===0?t.breakBefore:!0,u===n.length?t.breakAfter:!0)),s=u+1}let o=-1,l;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(a.push(r[o]),l=void 0):r[o]?(typeof l=="number"&&a.push(l),a.push(r[o]),l=0):(o===0||o===r.length-1)&&a.push(0);return a}function Fme(e){return[String(e.value)]}function Ume(e,t,n){const r=[];let a=0,s;for(;a<e.length;){w_.lastIndex=a;const o=w_.exec(e);s=o?o.index:e.length,!a&&!s&&o&&!t&&r.push(""),a!==s&&r.push(e.slice(a,s)),a=o?s+o[0].length:s}return a!==s&&!n&&r.push(""),r.join(" ")}function MI(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function Wme(e){return!!(e.properties||{}).hidden}function Hme(e){return e.tagName==="td"||e.tagName==="th"}function Gme(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function qme(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+t.optional(a)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},p=t.optional(a)+e.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],y=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],v=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],j={type:g,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:y},S={className:"function.dispatch",relevance:0,keywords:{_hint:v},begin:t.concat(/\b/,`(?!${m.join("|")})`,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},x=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],N={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:j,contains:x.concat([{begin:/\(/,end:/\)/,keywords:j,contains:x.concat(["self"]),relevance:0}]),relevance:0},E={className:"function",begin:"("+o+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:j,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:j,relevance:0},{begin:p,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:j,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(N,E,S,x,[f,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:j,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:j},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Kme(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=qme(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function Vme(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const a={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,a]};a.contains.push(l);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],p=e.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},g=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],y=["true","false"],v={match:/(\/[a-z._-]+)+/},k=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],w=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],j=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],S=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:g,literal:y,built_in:[...k,...w,"set","shopt",...j,...S]},contains:[p,e.SHEBANG(),m,f,s,o,v,l,c,u,d,n]}}function Yme(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",o="("+r+"|"+t.optional(a)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},p=t.optional(a)+e.IDENT_RE+"\\s*\\(",y={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},v=[f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],k={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:y,contains:v.concat([{begin:/\(/,end:/\)/,keywords:y,contains:v.concat(["self"]),relevance:0}]),relevance:0},w={begin:"("+o+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:y,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:y,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:y,disableAutodetect:!0,illegal:"</",contains:[].concat(k,w,v,[f,{begin:e.IDENT_RE+"::",keywords:y},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:y}}}function Xme(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+t.optional(a)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},p=t.optional(a)+e.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],y=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],v=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],j={type:g,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:y},S={className:"function.dispatch",relevance:0,keywords:{_hint:v},begin:t.concat(/\b/,`(?!${m.join("|")})`,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},x=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],N={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:j,contains:x.concat([{begin:/\(/,end:/\)/,keywords:j,contains:x.concat(["self"]),relevance:0}]),relevance:0},E={className:"function",begin:"("+o+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:j,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:j,relevance:0},{begin:p,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:j,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(N,E,S,x,[f,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:j,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:j},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Qme(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],a=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],s=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],o={keyword:a.concat(s),built_in:t,literal:r},l=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9'_]+|(\\b[\\d'_]+(\\.[\\d'_]*)?|\\.[\\d'_]+)([eE][-+]?[\\d'_]+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=e.inherit(d,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:o},p=e.inherit(h,{illegal:/\n/}),m={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,p]},g={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},y=e.inherit(g,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});h.contains=[g,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],p.contains=[y,m,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const v={variants:[u,g,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},k={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},w=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",j={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},v,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,k,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,k,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+w+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,k],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[v,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},j]}}const Zme=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Jme=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],ege=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],tge=[...Jme,...ege],nge=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),rge=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),age=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),ige=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function sge(e){const t=e.regex,n=Zme(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},a="and or not only",s=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",l=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+rge.join("|")+")"},{begin:":(:)?("+age.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ige.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,n.UNICODE_RANGE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:nge.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+tge.join("|")+")\\b"}]}}function oge(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+,\d+ +\+\d+ +@@/,/^@@ +-\d+ +\+\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function lge(e){const s={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:s,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:s,illegal:/["']/}]}]}}function cge(e){const t=e.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(n,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function uge(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const a={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},s={className:"literal",begin:/\bon|off|true|false|yes|no\b/},o={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},l={begin:/\[/,end:/\]/,contains:[r,s,a,o,n,"self"],relevance:0},c=/[A-Za-z0-9_-]+/,u=/"(\\"|[^"])*"/,d=/'[^']*'/,f=t.either(c,u,d),h=t.concat(f,"(\\s*\\.\\s*",f,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:h,className:"attr",starts:{end:/$/,contains:[r,l,s,a,o,n]}}]}}var mo="[0-9](_*[0-9])*",mf=`\\.(${mo})`,gf="[0-9a-fA-F](_*[0-9a-fA-F])*",j_={className:"number",variants:[{begin:`(\\b(${mo})((${mf})|\\.)?|(${mf}))[eE][+-]?(${mo})[fFdD]?\\b`},{begin:`\\b(${mo})((${mf})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${mf})[fFdD]?\\b`},{begin:`\\b(${mo})[fFdD]\\b`},{begin:`\\b0[xX]((${gf})\\.?|(${gf})?\\.(${gf}))[pP][+-]?(${mo})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${gf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function II(e,t,n){return n===-1?"":e.replace(t,r=>II(e,t,n-1))}function dge(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+II("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),c={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,j_,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},j_,u]}}const N_="[A-Za-z$_][0-9A-Za-z$_]*",fge=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],hge=["true","false","null","undefined","NaN","Infinity"],$I=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],LI=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],DI=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],pge=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],mge=[].concat(DI,$I,LI);function gge(e){const t=e.regex,n=(M,{after:z})=>{const O="</"+M[0].slice(1);return M.input.indexOf(O,z)!==-1},r=N_,a={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,z)=>{const O=M[0].length+M.index,J=M.input[O];if(J==="<"||J===","){z.ignoreMatch();return}J===">"&&(n(M,{after:O})||z.ignoreMatch());let F;const L=M.input.substring(O);if(F=L.match(/^\s*=/)){z.ignoreMatch();return}if((F=L.match(/^\s+extends\s+/))&&F.index===0){z.ignoreMatch();return}}},l={$pattern:N_,keyword:fge,literal:hge,built_in:mge,"variable.language":pge},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},k={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,y,{match:/\$\d+/},f];h.contains=w.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(w)});const j=[].concat(k,h.contains),S=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(j)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},N={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},E={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...$I,...LI]}},P={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},_={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function T(M){return t.concat("(?!",M.join("|"),")")}const B={match:t.concat(/\b/,T([...DI,"super","import","await"].map(M=>`${M}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},$={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},I={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",U={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:E},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),P,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,y,k,{match:/\$\d+/},f,E,{scope:"attr",match:r+t.lookahead(":"),relevance:0},U,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[k,e.REGEXP_MODE,{className:"function",begin:D,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},_,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},$,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},B,R,N,I,{match:/\$[(.]/}]}}const vge="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",yge={scope:"number",match:vge,relevance:0};function bge(e){const t={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],a={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:r},contains:[t,n,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,yge,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var go="[0-9](_*[0-9])*",vf=`\\.(${go})`,yf="[0-9a-fA-F](_*[0-9a-fA-F])*",xge={className:"number",variants:[{begin:`(\\b(${go})((${vf})|\\.)?|(${vf}))[eE][+-]?(${go})[fFdD]?\\b`},{begin:`\\b(${go})((${vf})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${vf})[fFdD]?\\b`},{begin:`\\b(${go})[fFdD]\\b`},{begin:`\\b0[xX]((${yf})\\.?|(${yf})?\\.(${yf}))[pP][+-]?(${go})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${yf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function wge(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},a={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,a]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,a]}]};a.contains.push(o);const l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},c={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"}),"self"]}]},u=xge,d=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},h=f;return h.variants[1].contains=[f],f.variants[1].contains=[h],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,d,n,r,l,c,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[f,e.C_LINE_COMMENT_MODE,d],relevance:0},e.C_LINE_COMMENT_MODE,d,l,c,o,e.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,c]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
195
+ `},u]}}const kge=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Sge=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],jge=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Nge=[...Sge,...jge],Ege=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),BI=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),zI=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),_ge=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),Cge=BI.concat(zI).sort().reverse();function Age(e){const t=kge(e),n=Cge,r="and or not only",a="[\\w-]+",s="("+a+"|@\\{"+a+"\\})",o=[],l=[],c=function(w){return{className:"string",begin:"~?"+w+".*?"+w}},u=function(w,j,S){return{className:w,begin:j,relevance:S}},d={$pattern:/[a-z-]+/,keyword:r,attribute:Ege.join(" ")},f={begin:"\\(",end:"\\)",contains:l,keywords:d,relevance:0};l.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,c("'"),c('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.UNICODE_RANGE,t.HEXCOLOR,f,u("variable","@@?"+a,10),u("variable","@\\{"+a+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:a+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const h=l.concat({begin:/\{/,end:/\}/,contains:o}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},m={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+_ge.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},g={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:l,relevance:0}},y={className:"variable",variants:[{begin:"@"+a+"\\s*:",relevance:15},{begin:"@"+a}],starts:{end:"[;}]",returnEnd:!0,contains:h}},v={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,u("keyword","all\\b"),u("variable","@\\{"+a+"\\}"),{begin:"\\b("+Nge.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,u("selector-tag",s,0),u("selector-id","#"+s),u("selector-class","\\."+s,0),u("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+BI.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+zI.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},k={begin:a+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[v]};return o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,g,y,k,m,v,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function Tge(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},a=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:a.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:a}].concat(a)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function Oge(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,n]},a={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},s={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},o={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,r,a,s,o]}}function Pge(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},a={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=e.inherit(u,{contains:[]}),h=e.inherit(d,{contains:[]});u.contains.push(h),d.contains.push(f);let p=[n,c];return[u,d,f,h].forEach(v=>{v.contains=v.contains.concat(p)}),p=p.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},n,s,u,d,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},a,r,c,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Rge(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},c={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+c.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:c,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function Mge(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,a={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:a},o={begin:/->\{/,end:/\}/},l={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[l]},u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[e.BACKSLASH_ESCAPE,s,c],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(g,y,v="\\1")=>{const k=v==="\\1"?v:t.concat(v,y);return t.concat(t.concat("(?:",g,")"),y,/(?:\\.|[^\\\/])*?/,k,/(?:\\.|[^\\\/])*?/,v,r)},p=(g,y,v)=>t.concat(t.concat("(?:",g,")"),y,/(?:\\.|[^\\\/])*?/,v,r),m=[c,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:h("s|tr|y",t.either(...f,{capture:!0}))},{begin:h("s|tr|y","\\(","\\)")},{begin:h("s|tr|y","\\[","\\]")},{begin:h("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p("(?:m|qr)?",/\//,/\//)},{begin:p("m|qr",t.either(...f,{capture:!0}),/\1/)},{begin:p("m|qr",/\(/,/\)/)},{begin:p("m|qr",/\[/,/\]/)},{begin:p("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=m,o.contains=m,{name:"Perl",aliases:["pl","pm"],keywords:a,contains:m}}function Ige(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),a=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),s=t.concat(/[A-Z]+/,n),o={scope:"variable",match:"\\$+"+r},l={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=e.inherit(e.APOS_STRING_MODE,{illegal:null}),d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":($,I)=>{I.data._beginMatch=$[1]||$[2]},"on:end":($,I)=>{I.data._beginMatch!==$[1]&&I.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[
196
+ ]`,m={scope:"string",variants:[d,u,f,h]},g={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},y=["false","null","true"],v=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],k=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],j={keyword:v,literal:($=>{const I=[];return $.forEach(D=>{I.push(D),D.toLowerCase()===D?I.push(D.toUpperCase()):I.push(D.toLowerCase())}),I})(y),built_in:k},S=$=>$.map(I=>I.replace(/\|\d+$/,"")),x={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",S(k).join("\\b|"),"\\b)"),a],scope:{1:"keyword",4:"title.class"}}]},N=t.concat(r,"\\b(?!\\()"),E={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),N],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[a,t.concat(/::/,t.lookahead(/(?!class\b)/)),N],scope:{1:"title.class",3:"variable.constant"}},{match:[a,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[a,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},P={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},_={relevance:0,begin:/\(/,end:/\)/,keywords:j,contains:[P,o,E,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,m,g,x]},R={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",S(v).join("\\b|"),"|",S(k).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[_]};_.contains.push(R);const T=[P,E,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,m,g,x],B={begin:t.concat(/#\[\s*\\?/,t.either(a,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:y,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:y,keyword:["new","array"]},contains:["self",...T]},...T,{scope:"meta",variants:[{match:a},{match:s}]}]};return{case_insensitive:!1,keywords:j,contains:[B,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},o,R,E,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},x,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:j,contains:["self",B,o,E,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,m,g]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},m,g]}}function $ge(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function Lge(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Dge(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},d={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",p=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,m=`\\b|${r.join("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${p}))[eE][+-]?(${h})[jJ]?(?=${m})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${h})[jJ](?=${m})`}]},y={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},v={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,g,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,g,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,g,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,y,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[v]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,v,f]}]}}function Bge(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function zge(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),a=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[a,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[s,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:a},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function Fge(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),a=t.concat(r,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:o},f={className:"string",contains:[e.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,d]})]}]},h="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",m={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},g={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},x=[f,{variants:[{match:[/class\s+/,a,/\s+<\s+/,a]},{match:[/\b(class|module)\s+/,a]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,a],scope:{2:"title.class"},keywords:o},{relevance:0,match:[a,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[g]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},m,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,u),relevance:0}].concat(c,u);d.contains=x,g.contains=x;const _=[{begin:/^\s*=>/,starts:{end:"$",contains:x}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:x}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(_).concat(u).concat(x)}}function Uge(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),a=t.concat(n,e.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,a,t.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],c=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:d,keyword:l,literal:c,built_in:u},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+o},{begin:"\\b0o([0-7_]+)"+o},{begin:"\\b0x([A-Fa-f0-9_]+)"+o},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+o}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:u,type:d}},{className:"punctuation",begin:"->"},s]}}const Wge=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Hge=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Gge=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],qge=[...Hge,...Gge],Kge=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Vge=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Yge=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Xge=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Qge(e){const t=Wge(e),n=Yge,r=Vge,a="@[a-z-]+",s="and or not only",l={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+qge.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Xge.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,l,t.HEXCOLOR,t.CSS_NUMBER_MODE,t.UNICODE_RANGE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:a,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:Kge.join(" ")},contains:[{begin:a,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function Zge(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function Jge(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},a={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=d,m=[...u,...c].filter(S=>!d.includes(S)),g={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},y={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},v={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function k(S){return t.concat(/\b/,t.either(...S.map(x=>x.replace(/\s+/,"\\s+"))),/\b/)}const w={scope:"keyword",match:k(h),relevance:0};function j(S,{exceptions:x,when:N}={}){const E=N;return x=x||[],S.map(P=>P.match(/\|\d+$/)||x.includes(P)?P:E(P)?`${P}|0`:P)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:j(m,{when:S=>S.length<3}),literal:s,type:l,built_in:f},contains:[{scope:"type",match:k(o)},w,v,g,r,a,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,y]}}function FI(e){return e?typeof e=="string"?e:e.source:null}function wc(e){return st("(?=",e,")")}function st(...e){return e.map(n=>FI(n)).join("")}function eve(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function _n(...e){return"("+(eve(e).capture?"":"?:")+e.map(r=>FI(r)).join("|")+")"}const D0=e=>st(/\b/,e,/\w$/.test(e)?/\b/:/\B/),tve=["Protocol","Type"].map(D0),E_=["init","self"].map(D0),nve=["Any","Self"],fv=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],__=["false","nil","true"],rve=["assignment","associativity","higherThan","left","lowerThan","none","right"],ave=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],C_=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],UI=_n(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),WI=_n(UI,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),hv=st(UI,WI,"*"),HI=_n(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),gp=_n(HI,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),ra=st(HI,gp,"*"),bf=st(/[A-Z]/,gp,"*"),ive=["attached","autoclosure",st(/convention\(/,_n("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",st(/objc\(/,ra,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],sve=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function ove(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],a={match:[/\./,_n(...tve,...E_)],className:{2:"keyword"}},s={match:st(/\./,_n(...fv)),relevance:0},o=fv.filter(ge=>typeof ge=="string").concat(["_|0"]),l=fv.filter(ge=>typeof ge!="string").concat(nve).map(D0),c={variants:[{className:"keyword",match:_n(...l,...E_)}]},u={$pattern:_n(/\b\w+/,/#\w+/),keyword:o.concat(ave),literal:__},d=[a,s,c],f={match:st(/\./,_n(...C_)),relevance:0},h={className:"built_in",match:st(/\b/,_n(...C_),/(?=\()/)},p=[f,h],m={match:/->/,relevance:0},g={className:"operator",relevance:0,variants:[{match:hv},{match:`\\.(\\.|${WI})+`}]},y=[m,g],v="([0-9]_*)+",k="([0-9a-fA-F]_*)+",w={className:"number",relevance:0,variants:[{match:`\\b(${v})(\\.(${v}))?([eE][+-]?(${v}))?\\b`},{match:`\\b0x(${k})(\\.(${k}))?([pP][+-]?(${v}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},j=(ge="")=>({className:"subst",variants:[{match:st(/\\/,ge,/[0\\tnr"']/)},{match:st(/\\/,ge,/u\{[0-9a-fA-F]{1,8}\}/)}]}),S=(ge="")=>({className:"subst",match:st(/\\/,ge,/[\t ]*(?:[\r\n]|\r\n)/)}),x=(ge="")=>({className:"subst",label:"interpol",begin:st(/\\/,ge,/\(/),end:/\)/}),N=(ge="")=>({begin:st(ge,/"""/),end:st(/"""/,ge),contains:[j(ge),S(ge),x(ge)]}),E=(ge="")=>({begin:st(ge,/"/),end:st(/"/,ge),contains:[j(ge),x(ge)]}),P={className:"string",variants:[N(),N("#"),N("##"),N("###"),E(),E("#"),E("##"),E("###")]},_=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],R={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:_},T=ge=>{const Ie=st(ge,/\//),me=st(/\//,ge);return{begin:Ie,end:me,contains:[..._,{scope:"comment",begin:`#(?!.*${me})`,end:/$/}]}},B={scope:"regexp",variants:[T("###"),T("##"),T("#"),R]},$={match:st(/`/,ra,/`/)},I={className:"variable",match:/\$\d+/},D={className:"variable",match:`\\$${gp}+`},U=[$,I,D],M={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:sve,contains:[...y,w,P]}]}},z={scope:"keyword",match:st(/@/,_n(...ive),wc(_n(/\(/,/\s+/)))},O={scope:"meta",match:st(/@/,ra)},J=[M,z,O],F={match:wc(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:st(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,gp,"+")},{className:"type",match:bf,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:st(/\s+&\s+/,wc(bf)),relevance:0}]},L={begin:/</,end:/>/,keywords:u,contains:[...r,...d,...J,m,F]};F.contains.push(L);const ie={match:st(ra,/\s*:/),keywords:"_|0",relevance:0},fe={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",ie,...r,B,...d,...p,...y,w,P,...U,...J,F]},ve={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,F]},Ee={begin:_n(wc(st(ra,/\s*:/)),wc(st(ra,/\s+/,ra,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:ra}]},ee={begin:/\(/,end:/\)/,keywords:u,contains:[Ee,...r,...d,...y,w,P,...J,F,fe],endsParent:!0,illegal:/["']/},Q={match:[/(func|macro)/,/\s+/,_n($.match,ra,hv)],className:{1:"keyword",3:"title.function"},contains:[ve,ee,t],illegal:[/\[/,/%/]},ae={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ve,ee,t],illegal:/\[|%/},ce={match:[/operator/,/\s+/,hv],className:{1:"keyword",3:"title"}},G={begin:[/precedencegroup/,/\s+/,bf],className:{1:"keyword",3:"title"},contains:[F],keywords:[...rve,...__],end:/}/},xe={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},we={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Pe={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,ra,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[ve,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:bf},...d],relevance:0}]};for(const ge of P.variants){const Ie=ge.contains.find(Qe=>Qe.label==="interpol");Ie.keywords=u;const me=[...d,...p,...y,w,P,...U];Ie.contains=[...me,{begin:/\(/,end:/\)/,contains:["self",...me]}]}return{name:"Swift",keywords:u,contains:[...r,Q,ae,xe,we,Pe,ce,G,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},B,...d,...p,...y,w,P,...U,...J,F,fe]}}const vp="[A-Za-z$_][0-9A-Za-z$_]*",GI=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],qI=["true","false","null","undefined","NaN","Infinity"],KI=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],VI=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],YI=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],XI=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],QI=[].concat(YI,KI,VI);function lve(e){const t=e.regex,n=(M,{after:z})=>{const O="</"+M[0].slice(1);return M.input.indexOf(O,z)!==-1},r=vp,a={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,z)=>{const O=M[0].length+M.index,J=M.input[O];if(J==="<"||J===","){z.ignoreMatch();return}J===">"&&(n(M,{after:O})||z.ignoreMatch());let F;const L=M.input.substring(O);if(F=L.match(/^\s*=/)){z.ignoreMatch();return}if((F=L.match(/^\s+extends\s+/))&&F.index===0){z.ignoreMatch();return}}},l={$pattern:vp,keyword:GI,literal:qI,built_in:QI,"variable.language":XI},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},k={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,y,{match:/\$\d+/},f];h.contains=w.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(w)});const j=[].concat(k,h.contains),S=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(j)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},N={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},E={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...KI,...VI]}},P={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},_={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function T(M){return t.concat("(?!",M.join("|"),")")}const B={match:t.concat(/\b/,T([...YI,"super","import","await"].map(M=>`${M}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},$={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},I={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",U={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:E},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),P,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,y,k,{match:/\$\d+/},f,E,{scope:"attr",match:r+t.lookahead(":"),relevance:0},U,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[k,e.REGEXP_MODE,{className:"function",begin:D,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},_,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},$,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},B,R,N,I,{match:/\$[(.]/}]}}function cve(e){const t=e.regex,n=lve(e),r=vp,a=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:a},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:vp,keyword:GI.concat(c),literal:qI,built_in:QI.concat(a),"variable.language":XI},d={className:"meta",begin:"@"+r},f=(g,y,v)=>{const k=g.contains.findIndex(w=>w.label===y);if(k===-1)throw new Error("can not find mode to replace");g.contains.splice(k,1,v)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(g=>g.scope==="attr"),p=Object.assign({},h,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,p]),n.contains=n.contains.concat([d,s,o,p]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",l);const m=n.contains.find(g=>g.label==="func.def");return m.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function uve(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},a=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,c={className:"literal",variants:[{begin:t.concat(/# */,t.either(s,a),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(s,a),/ +/,t.either(o,l),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},f=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),h=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,c,u,d,f,h,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[h]}]}}function dve(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],a={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},c={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,o,a,e.QUOTE_STRING_MODE,c,u,l]}}function fve(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,a={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(s,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),c=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[a]},{begin:/'/,end:/'/,contains:[a]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[s,c,l,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,o,c,l]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},a,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function hve(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},a={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,a]},l=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},p={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},m={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},y=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,g,s,o],v=[...y];return v.pop(),v.push(l),p.contains=v,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:y}}const pve={arduino:Kme,bash:Vme,c:Yme,cpp:Xme,csharp:Qme,css:sge,diff:oge,go:lge,graphql:cge,ini:uge,java:dge,javascript:gge,json:bge,kotlin:wge,less:Age,lua:Tge,makefile:Oge,markdown:Pge,objectivec:Rge,perl:Mge,php:Ige,"php-template":$ge,plaintext:Lge,python:Dge,"python-repl":Bge,r:zge,ruby:Fge,rust:Uge,scss:Qge,shell:Zge,sql:Jge,swift:ove,typescript:cve,vbnet:uve,wasm:dve,xml:fve,yaml:hve};function ZI(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&ZI(n)}),e}class A_{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function JI(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function yi(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(r){for(const a in r)n[a]=r[a]}),n}const mve="</span>",T_=e=>!!e.scope,gve=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,a)=>`${r}${"_".repeat(a+1)}`)].join(" ")}return`${t}${e}`};class vve{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=JI(t)}openNode(t){if(!T_(t))return;const n=gve(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){T_(t)&&(this.buffer+=mve)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const O_=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class B0{constructor(){this.rootNode=O_(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=O_({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(r=>this._walk(t,r)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{B0._collapse(n)}))}}class yve extends B0{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new vve(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Xu(e){return e?typeof e=="string"?e:e.source:null}function e$(e){return Ys("(?=",e,")")}function bve(e){return Ys("(?:",e,")*")}function xve(e){return Ys("(?:",e,")?")}function Ys(...e){return e.map(n=>Xu(n)).join("")}function wve(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function z0(...e){return"("+(wve(e).capture?"":"?:")+e.map(r=>Xu(r)).join("|")+")"}function t$(e){return new RegExp(e.toString()+"|").exec("").length-1}function kve(e,t){const n=e&&e.exec(t);return n&&n.index===0}const Sve=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function F0(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const a=n;let s=Xu(r),o="";for(;s.length>0;){const l=Sve.exec(s);if(!l){o+=s;break}o+=s.substring(0,l.index),s=s.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?o+="\\"+String(Number(l[1])+a):(o+=l[0],l[0]==="("&&n++)}return o}).map(r=>`(${r})`).join(t)}const jve=/\b\B/,n$="[a-zA-Z]\\w*",U0="[a-zA-Z_]\\w*",r$="\\b\\d+(\\.\\d+)?",a$="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",i$="\\b(0b[01]+)",Nve="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Eve=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Ys(t,/.*\b/,e.binary,/\b.*/)),yi({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Qu={begin:"\\\\[\\s\\S]",relevance:0},_ve={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Qu]},Cve={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Qu]},Ave={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Mm=function(e,t,n={}){const r=yi({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const a=z0("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:Ys(/[ ]+/,"(",a,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},Tve=Mm("//","$"),Ove=Mm("/\\*","\\*/"),Pve=Mm("#","$"),Rve={scope:"number",begin:r$,relevance:0},Mve={scope:"number",begin:a$,relevance:0},Ive={scope:"number",begin:i$,relevance:0},$ve={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Qu,{begin:/\[/,end:/\]/,relevance:0,contains:[Qu]}]},Lve={scope:"title",begin:n$,relevance:0},Dve={scope:"title",begin:U0,relevance:0},Bve={begin:"\\.\\s*"+U0,relevance:0},zve=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var xf=Object.freeze({__proto__:null,APOS_STRING_MODE:_ve,BACKSLASH_ESCAPE:Qu,BINARY_NUMBER_MODE:Ive,BINARY_NUMBER_RE:i$,COMMENT:Mm,C_BLOCK_COMMENT_MODE:Ove,C_LINE_COMMENT_MODE:Tve,C_NUMBER_MODE:Mve,C_NUMBER_RE:a$,END_SAME_AS_BEGIN:zve,HASH_COMMENT_MODE:Pve,IDENT_RE:n$,MATCH_NOTHING_RE:jve,METHOD_GUARD:Bve,NUMBER_MODE:Rve,NUMBER_RE:r$,PHRASAL_WORDS_MODE:Ave,QUOTE_STRING_MODE:Cve,REGEXP_MODE:$ve,RE_STARTERS_RE:Nve,SHEBANG:Eve,TITLE_MODE:Lve,UNDERSCORE_IDENT_RE:U0,UNDERSCORE_TITLE_MODE:Dve});function Fve(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function Uve(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function Wve(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Fve,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Hve(e,t){Array.isArray(e.illegal)&&(e.illegal=z0(...e.illegal))}function Gve(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function qve(e,t){e.relevance===void 0&&(e.relevance=1)}const Kve=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=Ys(n.beforeMatch,e$(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},Vve=["of","and","for","in","not","or","if","then","parent","list","value"],Yve="keyword";function s$(e,t,n=Yve){const r=Object.create(null);return typeof e=="string"?a(n,e.split(" ")):Array.isArray(e)?a(n,e):Object.keys(e).forEach(function(s){Object.assign(r,s$(e[s],t,s))}),r;function a(s,o){t&&(o=o.map(l=>l.toLowerCase())),o.forEach(function(l){const c=l.split("|");r[c[0]]=[s,Xve(c[0],c[1])]})}}function Xve(e,t){return t?Number(t):Qve(e)?0:1}function Qve(e){return Vve.includes(e.toLowerCase())}const P_={},As=e=>{console.error(e)},R_=(e,...t)=>{console.log(`WARN: ${e}`,...t)},fo=(e,t)=>{P_[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),P_[`${e}/${t}`]=!0)},yp=new Error;function o$(e,t,{key:n}){let r=0;const a=e[n],s={},o={};for(let l=1;l<=t.length;l++)o[l+r]=a[l],s[l+r]=!0,r+=t$(t[l-1]);e[n]=o,e[n]._emit=s,e[n]._multi=!0}function Zve(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw As("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),yp;if(typeof e.beginScope!="object"||e.beginScope===null)throw As("beginScope must be object"),yp;o$(e,e.begin,{key:"beginScope"}),e.begin=F0(e.begin,{joinWith:""})}}function Jve(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw As("skip, excludeEnd, returnEnd not compatible with endScope: {}"),yp;if(typeof e.endScope!="object"||e.endScope===null)throw As("endScope must be object"),yp;o$(e,e.end,{key:"endScope"}),e.end=F0(e.end,{joinWith:""})}}function eye(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function tye(e){eye(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Zve(e),Jve(e)}function nye(e){function t(o,l){return new RegExp(Xu(o),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,l]),this.matchAt+=t$(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(F0(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(l);if(!c)return null;const u=c.findIndex((f,h)=>h>0&&f!==void 0),d=this.matchIndexes[u];return c.splice(0,u),Object.assign(c,d)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const c=new n;return this.rules.slice(l).forEach(([u,d])=>c.addRule(u,d)),c.compile(),this.multiRegexes[l]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,c){this.rules.push([l,c]),c.type==="begin"&&this.count++}exec(l){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(l);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(l)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function a(o){const l=new r;return o.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),o.terminatorEnd&&l.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&l.addRule(o.illegal,{type:"illegal"}),l}function s(o,l){const c=o;if(o.isCompiled)return c;[Uve,Gve,tye,Kve].forEach(d=>d(o,l)),e.compilerExtensions.forEach(d=>d(o,l)),o.__beforeBegin=null,[Wve,Hve,qve].forEach(d=>d(o,l)),o.isCompiled=!0;let u=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),u=o.keywords.$pattern,delete o.keywords.$pattern),u=u||/\w+/,o.keywords&&(o.keywords=s$(o.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),l&&(o.begin||(o.begin=/\B|\b/),c.beginRe=t(c.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(c.endRe=t(c.end)),c.terminatorEnd=Xu(c.end)||"",o.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(o.end?"|":"")+l.terminatorEnd)),o.illegal&&(c.illegalRe=t(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(d){return rye(d==="self"?o:d)})),o.contains.forEach(function(d){s(d,c)}),o.starts&&s(o.starts,l),c.matcher=a(c),c}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=yi(e.classNameAliases||{}),s(e)}function l$(e){return e?e.endsWithParent||l$(e.starts):!1}function rye(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return yi(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:l$(e)?yi(e,{starts:e.starts?yi(e.starts):null}):Object.isFrozen(e)?yi(e):e}var aye="11.11.2";class iye extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const pv=JI,M_=yi,I_=Symbol("nomatch"),sye=7,c$=function(e){const t=Object.create(null),n=Object.create(null),r=[];let a=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:yve};function c(D){return l.noHighlightRe.test(D)}function u(D){let U=D.className+" ";U+=D.parentNode?D.parentNode.className:"";const M=l.languageDetectRe.exec(U);if(M){const z=E(M[1]);return z||(R_(s.replace("{}",M[1])),R_("Falling back to no-highlight mode for this block.",D)),z?M[1]:"no-highlight"}return U.split(/\s+/).find(z=>c(z)||E(z))}function d(D,U,M){let z="",O="";typeof U=="object"?(z=D,M=U.ignoreIllegals,O=U.language):(fo("10.7.0","highlight(lang, code, ...args) has been deprecated."),fo("10.7.0",`Please use highlight(code, options) instead.
197
+ https://github.com/highlightjs/highlight.js/issues/2277`),O=D,z=U),M===void 0&&(M=!0);const J={code:z,language:O};$("before:highlight",J);const F=J.result?J.result:f(J.language,J.code,M);return F.code=J.code,$("after:highlight",F),F}function f(D,U,M,z){const O=Object.create(null);function J(q,Z){return q.keywords[Z]}function F(){if(!me.keywords){De.addText(_e);return}let q=0;me.keywordPatternRe.lastIndex=0;let Z=me.keywordPatternRe.exec(_e),se="";for(;Z;){se+=_e.substring(q,Z.index);const pe=Pe.case_insensitive?Z[0].toLowerCase():Z[0],ke=J(me,pe);if(ke){const[$e,zt]=ke;if(De.addText(se),se="",O[pe]=(O[pe]||0)+1,O[pe]<=sye&&(pt+=zt),$e.startsWith("_"))se+=Z[0];else{const Le=Pe.classNameAliases[$e]||$e;fe(Z[0],Le)}}else se+=Z[0];q=me.keywordPatternRe.lastIndex,Z=me.keywordPatternRe.exec(_e)}se+=_e.substring(q),De.addText(se)}function L(){if(_e==="")return;let q=null;if(typeof me.subLanguage=="string"){if(!t[me.subLanguage]){De.addText(_e);return}q=f(me.subLanguage,_e,!0,Qe[me.subLanguage]),Qe[me.subLanguage]=q._top}else q=p(_e,me.subLanguage.length?me.subLanguage:null);me.relevance>0&&(pt+=q.relevance),De.__addSublanguage(q._emitter,q.language)}function ie(){me.subLanguage!=null?L():F(),_e=""}function fe(q,Z){q!==""&&(De.startScope(Z),De.addText(q),De.endScope())}function ve(q,Z){let se=1;const pe=Z.length-1;for(;se<=pe;){if(!q._emit[se]){se++;continue}const ke=Pe.classNameAliases[q[se]]||q[se],$e=Z[se];ke?fe($e,ke):(_e=$e,F(),_e=""),se++}}function Ee(q,Z){return q.scope&&typeof q.scope=="string"&&De.openNode(Pe.classNameAliases[q.scope]||q.scope),q.beginScope&&(q.beginScope._wrap?(fe(_e,Pe.classNameAliases[q.beginScope._wrap]||q.beginScope._wrap),_e=""):q.beginScope._multi&&(ve(q.beginScope,Z),_e="")),me=Object.create(q,{parent:{value:me}}),me}function ee(q,Z,se){let pe=kve(q.endRe,se);if(pe){if(q["on:end"]){const ke=new A_(q);q["on:end"](Z,ke),ke.isMatchIgnored&&(pe=!1)}if(pe){for(;q.endsParent&&q.parent;)q=q.parent;return q}}if(q.endsWithParent)return ee(q.parent,Z,se)}function Q(q){return me.matcher.regexIndex===0?(_e+=q[0],1):(Yt=!0,0)}function ae(q){const Z=q[0],se=q.rule,pe=new A_(se),ke=[se.__beforeBegin,se["on:begin"]];for(const $e of ke)if($e&&($e(q,pe),pe.isMatchIgnored))return Q(Z);return se.skip?_e+=Z:(se.excludeBegin&&(_e+=Z),ie(),!se.returnBegin&&!se.excludeBegin&&(_e=Z)),Ee(se,q),se.returnBegin?0:Z.length}function ce(q){const Z=q[0],se=U.substring(q.index),pe=ee(me,q,se);if(!pe)return I_;const ke=me;me.endScope&&me.endScope._wrap?(ie(),fe(Z,me.endScope._wrap)):me.endScope&&me.endScope._multi?(ie(),ve(me.endScope,q)):ke.skip?_e+=Z:(ke.returnEnd||ke.excludeEnd||(_e+=Z),ie(),ke.excludeEnd&&(_e=Z));do me.scope&&De.closeNode(),!me.skip&&!me.subLanguage&&(pt+=me.relevance),me=me.parent;while(me!==pe.parent);return pe.starts&&Ee(pe.starts,q),ke.returnEnd?0:Z.length}function G(){const q=[];for(let Z=me;Z!==Pe;Z=Z.parent)Z.scope&&q.unshift(Z.scope);q.forEach(Z=>De.openNode(Z))}let xe={};function we(q,Z){const se=Z&&Z[0];if(_e+=q,se==null)return ie(),0;if(xe.type==="begin"&&Z.type==="end"&&xe.index===Z.index&&se===""){if(_e+=U.slice(Z.index,Z.index+1),!a){const pe=new Error(`0 width match regex (${D})`);throw pe.languageName=D,pe.badRule=xe.rule,pe}return 1}if(xe=Z,Z.type==="begin")return ae(Z);if(Z.type==="illegal"&&!M){const pe=new Error('Illegal lexeme "'+se+'" for mode "'+(me.scope||"<unnamed>")+'"');throw pe.mode=me,pe}else if(Z.type==="end"){const pe=ce(Z);if(pe!==I_)return pe}if(Z.type==="illegal"&&se==="")return Z.index===U.length||(_e+=`
198
+ `),1;if(lt>1e5&&lt>Z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return _e+=se,se.length}const Pe=E(D);if(!Pe)throw As(s.replace("{}",D)),new Error('Unknown language: "'+D+'"');const ge=nye(Pe);let Ie="",me=z||ge;const Qe={},De=new l.__emitter(l);G();let _e="",pt=0,We=0,lt=0,Yt=!1;try{if(Pe.__emitTokens)Pe.__emitTokens(U,De);else{for(me.matcher.considerAll();;){lt++,Yt?Yt=!1:me.matcher.considerAll(),me.matcher.lastIndex=We;const q=me.matcher.exec(U);if(!q)break;const Z=U.substring(We,q.index),se=we(Z,q);We=q.index+se}we(U.substring(We))}return De.finalize(),Ie=De.toHTML(),{language:D,value:Ie,relevance:pt,illegal:!1,_emitter:De,_top:me}}catch(q){if(q.message&&q.message.includes("Illegal"))return{language:D,value:pv(U),illegal:!0,relevance:0,_illegalBy:{message:q.message,index:We,context:U.slice(We-100,We+100),mode:q.mode,resultSoFar:Ie},_emitter:De};if(a)return{language:D,value:pv(U),illegal:!1,relevance:0,errorRaised:q,_emitter:De,_top:me};throw q}}function h(D){const U={value:pv(D),illegal:!1,relevance:0,_top:o,_emitter:new l.__emitter(l)};return U._emitter.addText(D),U}function p(D,U){U=U||l.languages||Object.keys(t);const M=h(D),z=U.filter(E).filter(_).map(ie=>f(ie,D,!1));z.unshift(M);const O=z.sort((ie,fe)=>{if(ie.relevance!==fe.relevance)return fe.relevance-ie.relevance;if(ie.language&&fe.language){if(E(ie.language).supersetOf===fe.language)return 1;if(E(fe.language).supersetOf===ie.language)return-1}return 0}),[J,F]=O,L=J;return L.secondBest=F,L}function m(D,U,M){const z=U&&n[U]||M;D.classList.add("hljs"),D.classList.add(`language-${z}`)}function g(D){let U=null;const M=u(D);if(c(M))return;if($("before:highlightElement",{el:D,language:M}),D.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",D);return}if(D.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(D)),l.throwUnescapedHTML))throw new iye("One of your code blocks includes unescaped HTML.",D.innerHTML);U=D;const z=U.textContent,O=M?d(z,{language:M,ignoreIllegals:!0}):p(z);D.innerHTML=O.value,D.dataset.highlighted="yes",m(D,M,O.language),D.result={language:O.language,re:O.relevance,relevance:O.relevance},O.secondBest&&(D.secondBest={language:O.secondBest.language,relevance:O.secondBest.relevance}),$("after:highlightElement",{el:D,result:O,text:z})}function y(D){l=M_(l,D)}const v=()=>{j(),fo("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function k(){j(),fo("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let w=!1;function j(){function D(){j()}if(document.readyState==="loading"){w||window.addEventListener("DOMContentLoaded",D,!1),w=!0;return}document.querySelectorAll(l.cssSelector).forEach(g)}function S(D,U){let M=null;try{M=U(e)}catch(z){if(As("Language definition for '{}' could not be registered.".replace("{}",D)),a)As(z);else throw z;M=o}M.name||(M.name=D),t[D]=M,M.rawDefinition=U.bind(null,e),M.aliases&&P(M.aliases,{languageName:D})}function x(D){delete t[D];for(const U of Object.keys(n))n[U]===D&&delete n[U]}function N(){return Object.keys(t)}function E(D){return D=(D||"").toLowerCase(),t[D]||t[n[D]]}function P(D,{languageName:U}){typeof D=="string"&&(D=[D]),D.forEach(M=>{n[M.toLowerCase()]=U})}function _(D){const U=E(D);return U&&!U.disableAutodetect}function R(D){D["before:highlightBlock"]&&!D["before:highlightElement"]&&(D["before:highlightElement"]=U=>{D["before:highlightBlock"](Object.assign({block:U.el},U))}),D["after:highlightBlock"]&&!D["after:highlightElement"]&&(D["after:highlightElement"]=U=>{D["after:highlightBlock"](Object.assign({block:U.el},U))})}function T(D){R(D),r.push(D)}function B(D){const U=r.indexOf(D);U!==-1&&r.splice(U,1)}function $(D,U){const M=D;r.forEach(function(z){z[M]&&z[M](U)})}function I(D){return fo("10.7.0","highlightBlock will be removed entirely in v12.0"),fo("10.7.0","Please use highlightElement now."),g(D)}Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:j,highlightElement:g,highlightBlock:I,configure:y,initHighlighting:v,initHighlightingOnLoad:k,registerLanguage:S,unregisterLanguage:x,listLanguages:N,getLanguage:E,registerAliases:P,autoDetection:_,inherit:M_,addPlugin:T,removePlugin:B}),e.debugMode=function(){a=!1},e.safeMode=function(){a=!0},e.versionString=aye,e.regex={concat:Ys,lookahead:e$,either:z0,optional:xve,anyNumberOfTimes:bve};for(const D in xf)typeof xf[D]=="object"&&ZI(xf[D]);return Object.assign(e,xf),e},xl=c$({});xl.newInstance=()=>c$({});var oye=xl;xl.HighlightJS=xl;xl.default=xl;const lye=Je(oye),$_={},cye="hljs-";function uye(e){const t=lye.newInstance();return e&&s(e),{highlight:n,highlightAuto:r,listLanguages:a,register:s,registerAlias:o,registered:l};function n(c,u,d){const f=d||$_,h=typeof f.prefix=="string"?f.prefix:cye;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:dye,classPrefix:h});const p=t.highlight(u,{ignoreIllegals:!0,language:c});if(p.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:p.errorRaised});const m=p._emitter.root,g=m.data;return g.language=p.language,g.relevance=p.relevance,m}function r(c,u){const f=(u||$_).subset||a();let h=-1,p=0,m;for(;++h<f.length;){const g=f[h];if(!t.getLanguage(g))continue;const y=n(g,c,u);y.data&&y.data.relevance!==void 0&&y.data.relevance>p&&(p=y.data.relevance,m=y)}return m||{type:"root",children:[],data:{language:void 0,relevance:p}}}function a(){return t.listLanguages()}function s(c,u){if(typeof c=="string")t.registerLanguage(c,u);else{let d;for(d in c)Object.hasOwn(c,d)&&t.registerLanguage(d,c[d])}}function o(c,u){if(typeof c=="string")t.registerAliases(typeof u=="string"?u:[...u],{languageName:c});else{let d;for(d in c)if(Object.hasOwn(c,d)){const f=c[d];t.registerAliases(typeof f=="string"?f:[...f],{languageName:d})}}}function l(c){return!!t.getLanguage(c)}}class dye{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const r=this.stack[this.stack.length-1],a=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:a}):r.children.push(...a)}openNode(t){const n=this,r=t.split(".").map(function(o,l){return l?o+"_".repeat(l):n.options.classPrefix+o}),a=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:r},children:[]};a.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const fye={};function hye(e){const t=e||fye,n=t.aliases,r=t.detect||!1,a=t.languages||pve,s=t.plainText,o=t.prefix,l=t.subset;let c="hljs";const u=uye(a);if(n&&u.registerAlias(n),o){const d=o.indexOf("-");c=d===-1?o:o.slice(0,d)}return function(d,f){Rm(d,"element",function(h,p,m){if(h.tagName!=="code"||!m||m.type!=="element"||m.tagName!=="pre")return;const g=pye(h);if(g===!1||!g&&!r||g&&s&&s.includes(g))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(c)||h.properties.className.unshift(c);const y=Bme(h,{whitespace:"pre"});let v;try{v=g?u.highlight(g,y,{prefix:o}):u.highlightAuto(y,{prefix:o,subset:l})}catch(k){const w=k;if(g&&/Unknown language/.test(w.message)){f.message("Cannot highlight as `"+g+"`, it’s not registered",{ancestors:[m,h],cause:w,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw w}!g&&v.data&&v.data.language&&h.properties.className.push("language-"+v.data.language),v.children.length>0&&(h.children=v.children)})}}function pye(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let r;for(;++n<t.length;){const a=String(t[n]);if(a==="no-highlight"||a==="nohighlight")return!1;!r&&a.slice(0,5)==="lang-"&&(r=a.slice(5)),!r&&a.slice(0,9)==="language-"&&(r=a.slice(9))}return r}const bp="[A-Za-z$_][0-9A-Za-z$_]*",u$=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],d$=["true","false","null","undefined","NaN","Infinity"],f$=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],h$=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],p$=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],m$=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],g$=[].concat(p$,f$,h$);function mye(e){const t=e.regex,n=(M,{after:z})=>{const O="</"+M[0].slice(1);return M.input.indexOf(O,z)!==-1},r=bp,a={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,z)=>{const O=M[0].length+M.index,J=M.input[O];if(J==="<"||J===","){z.ignoreMatch();return}J===">"&&(n(M,{after:O})||z.ignoreMatch());let F;const L=M.input.substring(O);if(F=L.match(/^\s*=/)){z.ignoreMatch();return}if((F=L.match(/^\s+extends\s+/))&&F.index===0){z.ignoreMatch();return}}},l={$pattern:bp,keyword:u$,literal:d$,built_in:g$,"variable.language":m$},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},k={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,y,{match:/\$\d+/},f];h.contains=w.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(w)});const j=[].concat(k,h.contains),S=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(j)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},N={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},E={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...f$,...h$]}},P={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},_={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function T(M){return t.concat("(?!",M.join("|"),")")}const B={match:t.concat(/\b/,T([...p$,"super","import","await"].map(M=>`${M}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},$={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},I={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",U={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:E},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),P,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,y,k,{match:/\$\d+/},f,E,{scope:"attr",match:r+t.lookahead(":"),relevance:0},U,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[k,e.REGEXP_MODE,{className:"function",begin:D,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},_,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},$,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},B,R,N,I,{match:/\$[(.]/}]}}function L_(e){const t=e.regex,n=mye(e),r=bp,a=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:a},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:bp,keyword:u$.concat(c),literal:d$,built_in:g$.concat(a),"variable.language":m$},d={className:"meta",begin:"@"+r},f=(g,y,v)=>{const k=g.contains.findIndex(w=>w.label===y);if(k===-1)throw new Error("can not find mode to replace");g.contains.splice(k,1,v)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(g=>g.scope==="attr"),p=Object.assign({},h,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,p]),n.contains=n.contains.concat([d,s,o,p]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",l);const m=n.contains.find(g=>g.label==="func.def");return m.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}const D_="[A-Za-z$_][0-9A-Za-z$_]*",gye=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],vye=["true","false","null","undefined","NaN","Infinity"],v$=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],y$=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],b$=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],yye=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],bye=[].concat(b$,v$,y$);function B_(e){const t=e.regex,n=(M,{after:z})=>{const O="</"+M[0].slice(1);return M.input.indexOf(O,z)!==-1},r=D_,a={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,z)=>{const O=M[0].length+M.index,J=M.input[O];if(J==="<"||J===","){z.ignoreMatch();return}J===">"&&(n(M,{after:O})||z.ignoreMatch());let F;const L=M.input.substring(O);if(F=L.match(/^\s*=/)){z.ignoreMatch();return}if((F=L.match(/^\s+extends\s+/))&&F.index===0){z.ignoreMatch();return}}},l={$pattern:D_,keyword:gye,literal:vye,built_in:bye,"variable.language":yye},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},k={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,y,{match:/\$\d+/},f];h.contains=w.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(w)});const j=[].concat(k,h.contains),S=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(j)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},N={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},E={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...v$,...y$]}},P={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},_={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function T(M){return t.concat("(?!",M.join("|"),")")}const B={match:t.concat(/\b/,T([...b$,"super","import","await"].map(M=>`${M}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},$={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},I={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",U={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:E},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),P,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,y,k,{match:/\$\d+/},f,E,{scope:"attr",match:r+t.lookahead(":"),relevance:0},U,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[k,e.REGEXP_MODE,{className:"function",begin:D,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},_,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},$,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},B,R,N,I,{match:/\$[(.]/}]}}const xye="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",wye={scope:"number",match:xye,relevance:0};function kye(e){const t={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],a={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:r},contains:[t,n,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,wye,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Sye(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const a={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,a]};a.contains.push(l);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],p=e.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},g=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],y=["true","false"],v={match:/(\/[a-z._-]+)+/},k=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],w=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],j=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],S=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:g,literal:y,built_in:[...k,...w,"set","shopt",...j,...S]},contains:[p,e.SHEBANG(),m,f,s,o,v,l,c,u,d,n]}}function z_(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[./~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function F_(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","lazy","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","aiter","all","anext","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozendict","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","sentinel","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},d={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,u]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",p=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,m=`\\b|${r.join("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${p}))[eE][+-]?(${h})[jJ]?(?=${m})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${h})[jJ](?=${m})`}]},y={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},v={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,g,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,g,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,g,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,y,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[v]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,v,f]}]}}function U_(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={match:/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/},a={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=e.inherit(u,{contains:[]}),h=e.inherit(d,{contains:[]});u.contains.push(h),d.contains.push(f);let p=[n,c];return[u,d,f,h].forEach(v=>{v.contains=v.contains.concat(p)}),p=p.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},n,s,r,u,d,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},a,c,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function W_(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},a={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,a]},l=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},p={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},m={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},y=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,g,s,o],v=[...y];return v.pop(),v.push(l),p.contains=v,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:y}}function jye(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+,\d+ +\+\d+ +@@/,/^@@ +-\d+ +\+\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function Nye(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},a={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=d,m=[...u,...c].filter(S=>!d.includes(S)),g={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},y={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},v={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function k(S){return t.concat(/\b/,t.either(...S.map(x=>x.replace(/\s+/,"\\s+"))),/\b/)}const w={scope:"keyword",match:k(h),relevance:0};function j(S,{exceptions:x,when:N}={}){const E=N;return x=x||[],S.map(P=>P.match(/\|\d+$/)||x.includes(P)?P:E(P)?`${P}|0`:P)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:j(m,{when:S=>S.length<3}),literal:s,type:l,built_in:f},contains:[{scope:"type",match:k(o)},w,v,g,r,a,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,y]}}function H_(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,a={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(s,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),c=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[a]},{begin:/'/,end:/'/,contains:[a]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[s,c,l,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,o,c,l]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},a,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:"css"}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:"javascript"}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}const Eye=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),_ye=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Cye=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Aye=[..._ye,...Cye],Tye=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Oye=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Pye=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Rye=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","corner-bottom-left-shape","corner-bottom-right-shape","corner-shape","corner-top-left-shape","corner-top-right-shape","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Mye(e){const t=e.regex,n=Eye(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},a="and or not only",s=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",l=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Oye.join("|")+")"},{begin:":(:)?("+Pye.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Rye.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,n.UNICODE_RANGE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:Tye.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Aye.join("|")+")\\b"}]}}function G_(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}const Iye={ts:L_,typescript:L_,js:B_,javascript:B_,json:kye,bash:Sye,shell:z_,sh:z_,python:F_,py:F_,markdown:U_,md:U_,yaml:W_,yml:W_,diff:jye,sql:Nye,html:H_,xml:H_,css:Mye,text:G_,plaintext:G_};function x$(e){if(e==null)return"";const t=e;return typeof t.value=="string"?t.value:Array.isArray(t.children)?t.children.map(x$).join(""):""}function $ye({lang:e,code:t,children:n}){const[r,a]=b.useState(!1),s=async()=>{var o;try{await((o=navigator.clipboard)==null?void 0:o.writeText(t)),a(!0),setTimeout(()=>a(!1),1500)}catch{}};return i.jsxs("div",{className:"md-code-block",children:[i.jsxs("div",{className:"md-code-head",children:[i.jsx("span",{className:"md-code-lang",children:e}),i.jsx("button",{type:"button",className:"md-code-copy",onClick:()=>void s(),children:r?"✓ Copied":"⧉ Copy"})]}),i.jsx("pre",{className:"md-code-pre",children:i.jsx("code",{children:n})})]})}function Lye({node:e,children:t}){var o,l,c,u;const n=(o=e==null?void 0:e.children)==null?void 0:o[0],a=((u=(Array.isArray((l=n==null?void 0:n.properties)==null?void 0:l.className)?(c=n==null?void 0:n.properties)==null?void 0:c.className:[]).find(d=>typeof d=="string"&&d.startsWith("language-")))==null?void 0:u.slice(9))??"text",s=b.useMemo(()=>x$(n),[n]);return i.jsx($ye,{lang:a,code:s,children:t})}function q_({text:e}){const t=b.useMemo(()=>({h1:({node:n,...r})=>i.jsx("h1",{className:"md-heading md-h1",...r}),h2:({node:n,...r})=>i.jsx("h2",{className:"md-heading md-h2",...r}),h3:({node:n,...r})=>i.jsx("h3",{className:"md-heading md-h3",...r}),h4:({node:n,...r})=>i.jsx("h4",{className:"md-heading md-h4",...r}),h5:({node:n,...r})=>i.jsx("h5",{className:"md-heading md-h5",...r}),h6:({node:n,...r})=>i.jsx("h6",{className:"md-heading md-h6",...r}),p:({node:n,...r})=>i.jsx("p",{className:"md-para",...r}),ul:({node:n,...r})=>i.jsx("ul",{className:"md-list md-ul",...r}),ol:({node:n,...r})=>i.jsx("ol",{className:"md-list md-ol",...r}),blockquote:({node:n,...r})=>i.jsx("blockquote",{className:"md-quote",...r}),hr:({node:n,...r})=>i.jsx("hr",{className:"md-hr",...r}),table:({node:n,...r})=>i.jsx("table",{className:"md-table",...r}),a:({node:n,...r})=>i.jsx("a",{target:"_blank",rel:"noreferrer",...r}),pre:Lye}),[]);return i.jsx("div",{className:"md-root",children:i.jsx(bhe,{remarkPlugins:[Pme],rehypePlugins:[[hye,{languages:Iye}]],components:t,children:e??""})})}const K_=/```([\w+-]*)\n([\s\S]*?)```/g;function Dye(e){if(!e.trim())return[];const t=[];let n=null;for(const r of e.split(`
199
+ `))r.startsWith("diff --git ")?(n&&t.push(n),n={path:r.split(" b/").slice(1).join(" b/").replace(/^b\//,""),body:r}):n&&(n.body+=`
200
+ ${r}`);return n&&t.push(n),t}function Bye(e){return/(^|\n)\s*(PASS|FAIL|✅|❌|✗|✓|\bok\b)/i.test(e)||/\b\d+\s+(passed|failed)\b/i.test(e)||/(tests?|build|suite|checks?)\s+(passed|failed|complete|green|red|ok)/i.test(e)||/(exit code|process exited|finished with)/i.test(e)}function zye(e){return/(^|\n)\s*(FAIL|❌|✗)/i.test(e)||/\bfailed\b/i.test(e)?"fail":/(^|\n)\s*(PASS|✅|✓)/i.test(e)||/\bpassed\b/i.test(e)?"pass":"unknown"}function Fye(e){for(const t of e.split(`
201
+ `)){const n=t.trim();if(n)return n.length>80?`${n.slice(0,77)}…`:n}return"Command output"}const V_=/https?:\/\/[^\s)\]}"'<>]+/i,Y_=/(🚀|deploy(?:ed|ment|ing)?|live at|published|available at|open the)/i;function Uye(e){return e.replace(/[.,;:!?]+$/,"")}function Wye(e){const t=e.split(`
202
+ `),n=[],r=new Set;for(let a=0;a<t.length;a+=1){const s=t[a];let o=s.match(Y_);!o&&a+1<t.length&&/deploy(?:ed|ment|ing)?:\s*$/i.test(s.trim())&&(o=t[a+1].match(Y_));const l=s.match(V_)||(a+1<t.length?t[a+1].match(V_):null);if(!o||!l)continue;const c=Uye(l[0]);r.has(c)||(r.add(c),n.push({url:c,title:s.trim().slice(0,80)||"Deployment"}))}return n}function wf(e){const t=[],n=[],r=[];K_.lastIndex=0;let a;for(;(a=K_.exec(e))!==null;){const s=(a[1]||"").toLowerCase(),o=a[2];if(s==="diff"||o.includes("diff --git ")){const l=Dye(o);l.length>0&&t.push({files:l,summary:`${l.length} file${l.length===1?"":"s"} changed`})}else Bye(o)&&n.push({verdict:zye(o),title:Fye(o),body:o})}for(const s of Wye(e))r.push(s);return{diffs:t,results:n,deploys:r}}const Hye=3e5,Gye=3e3,qye=10,Kye=5e3,Vye=2e3,Yye=/\.(pdf|docx|xlsx|pptx)$/i,Xye=/\.(png|jpe?g|gif|webp|bmp|tiff?)$/i,Qye=/\.(txt|md|markdown|text|log|csv|tsv|json|xml|yaml|yml|html?|htaccess|css|js|mjs|cjs|jsx|ts|tsx|py|rb|go|rs|java|kt|c|h|cpp|cs|php|sh|bash|zsh|sql|ini|toml|cfg|conf|env)$/i;function Zye(e){let t="";for(let r=0;r<e.length;r+=32768)t+=String.fromCharCode(...e.subarray(r,r+32768));return btoa(t)}function Jye(e,t){const n=t.includes(0),r=t.length===0?1:t.reduce((a,s)=>s===9||s===10||s===13||s>=32&&s<127||s>=128?a+1:a,0)/t.length;return!n&&r>.9?{how:"text"}:Yye.test(e)?{how:"binary"}:Qye.test(e)?{how:"text"}:Xye.test(e)?{how:"unsupported",reason:`"${e}" is an image, and this composer only sends text and documents. Save it into the project folder and ask me to describe it — I can read images from there.`}:{how:"unsupported",reason:`"${e}" is not a text file and not a document type I can read. Attach a PDF, DOCX, XLSX, PPTX, or a text/CSV/JSON/Markdown file — or put the file in the project folder and ask me to read it.`}}function ebe(e){const t=["pending","running","done","blocked"].includes(e.status),n=typeof e.note=="string"&&e.note.trim()?e.note.trim():void 0;return{id:e.id,description:e.description,status:t?e.status:"pending",...n?{note:n}:{}}}function tbe(e){return e==="read_file"||e==="glob"||e==="list_dir"?"📖":e==="edit_file"||e==="write_file"?"✏️":e==="run_terminal"||e==="run_cli"?"⚙️":e==="web_search"||e==="read_page"?"🌐":e==="delegate"||e==="spawn_subagents"?"👥":e==="ask_user"?"🤔":"🔧"}function nbe(e){const t=String(e??"").trim().toLowerCase();return t==="max"||t==="maximum"||t==="unlimited"||t==="performance"||t==="performance-first"?"max":"balanced"}function Cc({diff:e,selectable:t=!1,onCommitAccepted:n,lockedHint:r}){const[a,s]=b.useState(null),o=new Set(a??e.files.map(d=>d.path)),l=d=>{s(f=>{const h=f??e.files.map(p=>p.path);return h.includes(d)?h.filter(p=>p!==d):[...h,d]})},c=e.files.reduce((d,f)=>{var h;return d+(((h=f.body.match(/^\+/gm))==null?void 0:h.length)??0)},0),u=e.files.reduce((d,f)=>{var h;return d+(((h=f.body.match(/^-/gm))==null?void 0:h.length)??0)},0);return i.jsxs("div",{className:"chat-diff-card",children:[i.jsxs("div",{className:"chat-diff-head",children:[i.jsx("span",{className:"chat-diff-icon",children:"🔧"}),i.jsx("span",{className:"chat-diff-title",children:"git diff"}),i.jsxs("span",{className:"chat-diff-meta",children:[e.files.length," file",e.files.length===1?"":"s"," · +",c," −",u]})]}),i.jsx("div",{className:"chat-diff-files",children:e.files.map(d=>{const f=o.has(d.path);return i.jsxs("details",{className:`chat-diff-file${f?"":" chat-diff-file-rejected"}`,open:e.files.length===1,children:[i.jsxs("summary",{className:"chat-diff-file-path",children:[t?i.jsx("button",{type:"button",className:`chat-diff-toggle${f?" chat-diff-toggle-on":""}`,title:f?"Accepted — click to reject":"Rejected — click to accept",onClick:h=>{h.preventDefault(),h.stopPropagation(),l(d.path)},children:f?"✓":"✗"}):null,d.path]}),i.jsx("pre",{className:"chat-diff-body",children:d.body.split(`
203
+ `).map((h,p)=>{const m=h.startsWith("+")?"diff-add":h.startsWith("-")?"diff-del":h.startsWith("@@")?"diff-hunk":"";return i.jsx("div",{className:`chat-diff-line ${m}`,children:h||" "},p)})})]},d.path)})}),t&&n?i.jsxs("div",{className:"chat-diff-actions",children:[i.jsxs("button",{className:"admin-refresh-btn",type:"button",disabled:o.size===0,onClick:()=>n([...o]),children:["Commit accepted (",o.size,")"]}),i.jsx("span",{className:"admin-hint",children:"Only accepted files are committed — the agent re-confirms with a question card."})]}):r?i.jsx("div",{className:"chat-diff-actions",children:i.jsxs("span",{className:"admin-hint chat-diff-locked",children:["🔒 ",r]})}):null]})}function w$({text:e,label:t}){const[n,r]=b.useState(!1),a=async()=>{var s;try{await((s=navigator.clipboard)==null?void 0:s.writeText(e)),r(!0),setTimeout(()=>r(!1),1500)}catch{}};return i.jsx("button",{type:"button",className:"chat-card-copy",title:`Copy ${t}`,onClick:()=>void a(),children:n?"✓ Copied":"⧉ Copy"})}function rbe({result:e}){const t=e.verdict==="pass"?"✅":e.verdict==="fail"?"❌":"📋";return i.jsxs("div",{className:`chat-result-card chat-result-${e.verdict}`,children:[i.jsxs("div",{className:"chat-result-head",children:[i.jsx("span",{className:"chat-result-icon",children:t}),i.jsx("span",{className:"chat-result-title",children:e.title}),i.jsx("span",{className:"chat-result-meta",children:e.verdict}),i.jsx(w$,{text:e.body,label:"result output"})]}),i.jsx("pre",{className:"chat-result-body",children:e.body})]})}function abe({deploy:e}){return i.jsxs("div",{className:"chat-deploy-card",children:[i.jsxs("div",{className:"chat-deploy-head",children:[i.jsx("span",{className:"chat-deploy-icon",children:"🚀"}),i.jsx("span",{className:"chat-deploy-title",children:e.title||"Deployment"}),i.jsx(w$,{text:e.url,label:"deployment URL"})]}),i.jsx("a",{className:"chat-deploy-url",href:e.url,target:"_blank",rel:"noopener noreferrer",children:e.url})]})}function ibe({children:e}){const t=b.useRef(null),n=r=>{if(!t.current)return;const a=Array.from(t.current.querySelectorAll("[data-artifact-card]"));if(a.length===0)return;const s=a.indexOf(document.activeElement);let o=-1;r.key==="ArrowDown"?o=s+1>=a.length?0:s+1:r.key==="ArrowUp"?o=s-1<0?a.length-1:s-1:r.key==="Home"?o=0:r.key==="End"&&(o=a.length-1),o>=0&&o!==s&&(r.preventDefault(),a[o].focus())};return i.jsx("div",{className:"chat-artifacts",ref:t,role:"group","aria-label":"Artifacts",onKeyDown:n,children:e})}function X_({draft:e,onAccept:t,onReject:n,onEdit:r}){const a=e.status??"pending",s=e.markdown.split(`
204
+ `),o=s.findIndex(c=>c.startsWith("# "))>=0?s.findIndex(c=>c.startsWith("# ")):0,l=s.slice(o,o+14).join(`
205
+ `);return i.jsxs("div",{className:`chat-draft-card${a==="saved"?" chat-draft-saved":""}${a==="rejected"?" chat-draft-rejected":""}`,children:[i.jsxs("div",{className:"chat-draft-head",children:[i.jsx("span",{className:"chat-draft-icon",children:"🧠"}),i.jsxs("span",{className:"chat-draft-title",children:["New skill draft: ",e.name]}),i.jsx("span",{className:"chat-draft-meta",children:"pending your review"})]}),i.jsx("p",{className:"chat-draft-desc",children:e.description}),i.jsx("pre",{className:"chat-draft-body",children:l}),a==="saving"?i.jsx("div",{className:"admin-hint",children:"Saving…"}):a==="saved"?i.jsx("div",{className:"admin-hint",children:"✅ Saved — the skill is live: load it in chat or see it in the Agent Hub Skills tab."}):a==="rejected"?i.jsx("div",{className:"admin-hint",children:"🗑️ Rejected — the draft was discarded, nothing was saved."}):i.jsxs("div",{className:"chat-draft-actions",children:[i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>t(e.name),children:"✅ Accept"}),i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>r(e.name),children:"✏️ Edit"}),i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>n(e.name),children:"↩ Reject"})]})]})}function sbe({request:e,onSave:t}){const[n,r]=b.useState({}),[a,s]=b.useState(!1),o=e.missing.every(u=>{var d;return(d=n[u])==null?void 0:d.trim()}),l=e.missing.filter(u=>e.persisted[u]),c=e.missing.filter(u=>!e.persisted[u]);return i.jsxs("div",{className:"chat-secret-card",children:[i.jsxs("div",{className:"chat-secret-head",children:[i.jsx("span",{className:"chat-secret-icon",children:"🔐"}),i.jsxs("span",{className:"chat-secret-title",children:[e.skillName," needs environment variables"]})]}),l.length>0?i.jsxs("div",{className:"chat-secret-persisted",children:["Already configured: ",l.map(u=>i.jsx("code",{children:u},u)).join(", ")]}):null,c.length>0&&!a?i.jsxs("div",{className:"chat-secret-fields",children:[c.map(u=>i.jsxs("div",{className:"chat-secret-row",children:[i.jsxs("label",{className:"chat-secret-label",htmlFor:`secret-${u}`,children:[u,":"]}),i.jsx("input",{id:`secret-${u}`,className:"chat-secret-input",type:"password",placeholder:`Enter ${u} value…`,value:n[u]??"",onChange:d=>r(f=>({...f,[u]:d.target.value}))})]},u)),i.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:!o,onClick:()=>{t(n),s(!0)},children:"💾 Save to ~/.nuvira/.env"})]}):a?i.jsx("div",{className:"admin-hint",children:"✅ Saved — the skill will pick up these values on next load."}):i.jsx("div",{className:"admin-hint",children:"All required env vars are already configured."})]})}function obe({result:e}){const[t,n]=b.useState(!1),r=e.success?"✅":"❌",a=e.success?"Success":`Failed (exit ${e.exitCode})`,s=e.success?"chat-exec-success":"chat-exec-failure",o=new Date(e.timestamp).toLocaleTimeString();return i.jsxs("div",{className:`chat-exec-card ${s}`,children:[i.jsxs("div",{className:"chat-exec-head",onClick:()=>n(!t),style:{cursor:"pointer"},children:[i.jsx("span",{className:"chat-exec-icon",children:"📜"}),i.jsx("span",{className:"chat-exec-title",children:e.skillName}),i.jsxs("span",{className:"chat-exec-status",children:[r," ",a]}),i.jsxs("span",{className:"chat-exec-meta",children:[e.runtime," · ",e.durationMs,"ms · ",o]}),i.jsx("span",{className:"chat-exec-expand",children:t?"▼":"▶"})]}),t&&i.jsxs("div",{className:"chat-exec-body",children:[e.stdout&&i.jsxs("div",{className:"chat-exec-section",children:[i.jsx("div",{className:"chat-exec-section-title",children:"stdout"}),i.jsx("pre",{className:"chat-exec-output",children:e.stdout})]}),e.stderr&&i.jsxs("div",{className:"chat-exec-section chat-exec-stderr",children:[i.jsx("div",{className:"chat-exec-section-title",children:"stderr"}),i.jsx("pre",{className:"chat-exec-output",children:e.stderr})]}),i.jsxs("div",{className:"chat-exec-details",children:[i.jsxs("span",{children:["Runtime: ",e.runtime]}),i.jsxs("span",{children:["Exit code: ",e.exitCode]}),i.jsxs("span",{children:["Duration: ",e.durationMs,"ms"]})]})]})]})}function lbe(e){return e==="done"?"✅":e==="running"?"🔄":e==="blocked"?"⛔":"⬜"}function cbe(e){return e==="done"?"done":e==="running"?"in progress":e==="blocked"?"blocked":"pending"}function Q_({plan:e}){const t=e.steps.length,n=e.steps.filter(c=>c.status==="done").length,r=e.steps.filter(c=>c.status==="blocked").length,a=t===0?0:Math.round(n/t*100),s=t>0&&n===t,o=t>0&&e.steps.every(c=>c.status==="done"||c.status==="blocked"),l=e.steps.some(c=>c.note);return i.jsxs("div",{className:`chat-plan-card${s?" chat-plan-complete":""}`,children:[i.jsxs("div",{className:"chat-plan-head",children:[i.jsx("span",{className:"chat-plan-icon",children:"🗂️"}),i.jsx("span",{className:"chat-plan-goal",children:e.goal}),i.jsxs("span",{className:"chat-plan-count",children:[n,"/",t," done · ",a,"%"]})]}),i.jsx("div",{className:"chat-plan-bar",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":a,children:i.jsx("span",{className:"chat-plan-bar-fill",style:{width:`${a}%`}})}),i.jsxs("table",{className:"chat-plan-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{className:"chat-plan-col-n",children:"#"}),i.jsx("th",{children:"Step"}),i.jsx("th",{className:"chat-plan-col-status",children:"Status"}),l?i.jsx("th",{children:"Notes"}):null]})}),i.jsx("tbody",{children:e.steps.map((c,u)=>i.jsxs("tr",{className:`chat-plan-row chat-plan-row-${c.status}`,children:[i.jsx("td",{className:"chat-plan-col-n",children:u+1}),i.jsx("td",{className:"chat-plan-step-text",children:c.description}),i.jsxs("td",{className:"chat-plan-col-status",children:[i.jsx("span",{className:"chat-plan-step-icon",children:lbe(c.status)})," ",cbe(c.status)]}),l?i.jsx("td",{className:"chat-plan-note",children:c.note??""}):null]},c.id))})]}),o?i.jsx("div",{className:"chat-plan-settled",children:s?`✅ Plan complete — ${n}/${t} steps achieved`:`📋 Plan settled — ${n}/${t} achieved, ${r} blocked`}):null]})}function Z_({tools:e,live:t}){return!e||e.length===0?null:i.jsx("div",{className:`chat-tool-cards${t?" chat-tool-cards-live":""}`,children:e.map(n=>{const r=n.phase==="started"||n.ok===void 0,a=n.ok===!1;return i.jsxs("div",{className:`chat-tool-card${r?" chat-tool-running":a?" chat-tool-err":" chat-tool-ok"}`,children:[i.jsxs("div",{className:"chat-tool-head",children:[i.jsx("span",{className:"chat-tool-icon",children:tbe(n.tool)}),i.jsx("span",{className:"chat-tool-name",children:n.tool}),n.args?i.jsx("code",{className:"chat-tool-args",children:n.args}):null,i.jsx("span",{className:"chat-tool-status",title:r?"running":a?"failed":"done",children:r?"⏳":a?"✗":"✓"}),n.durationMs!==void 0&&!r?i.jsxs("span",{className:"chat-tool-dur",children:[n.durationMs,"ms"]}):null]}),n.error||n.result?i.jsxs("details",{className:"chat-tool-detail",children:[i.jsx("summary",{children:a?"Error":"Result"}),i.jsx("pre",{className:"chat-tool-body",children:n.error||n.result})]}):null]},n.id)})})}function k$(e){return(e.evidence??[]).filter(t=>typeof(t==null?void 0:t.ref)=="string"&&t.ref.trim().length>0)}function ube(e){const t=e.filter(n=>n.verdict==="CONFIRMED"&&k$(n).length>0).length;return`${e.length} finding${e.length===1?"":"s"}: ${t} confirmed, ${e.length-t} plausible`}function J_({findings:e}){return!e||e.length===0?null:i.jsxs("details",{className:"chat-steps chat-findings",children:[i.jsx("summary",{children:`🔎 ${ube(e)}`}),i.jsx("div",{className:"chat-finding-cards",children:e.map((t,n)=>{const r=k$(t),a=t.verdict==="CONFIRMED"&&r.length>0;return i.jsxs("div",{className:`chat-finding-card ${a?"chat-finding-confirmed":"chat-finding-plausible"}`,children:[i.jsxs("div",{className:"chat-finding-head",children:[i.jsx("span",{className:"chat-finding-icon","aria-hidden":"true",children:a?"✅":"🔎"}),i.jsx("span",{className:"chat-finding-claim",children:t.claim}),i.jsx("span",{className:`chat-finding-verdict ${a?"chat-finding-verdict-ok":"chat-finding-verdict-guess"}`,title:a?"a check was performed and is shown below":"reasoned, not verified",children:a?"CONFIRMED":"PLAUSIBLE"})]}),t.outcome?i.jsx("div",{className:"chat-finding-outcome",children:t.outcome}):null,r.length>0?i.jsx("ul",{className:"chat-finding-evidence",children:r.map((s,o)=>i.jsxs("li",{children:[i.jsx("span",{className:"chat-finding-kind",children:s.kind}),i.jsx("code",{className:"chat-finding-ref",children:s.ref}),s.detail?i.jsxs("span",{className:"chat-finding-detail",children:["(",s.detail,")"]}):null]},o))}):i.jsx("div",{className:"chat-finding-noevidence",children:"no evidence — reported as PLAUSIBLE, not verified"}),t.source?i.jsxs("div",{className:"chat-finding-source",children:["source: ",t.source]}):null]},`${n}-${t.claim}`)})})]})}function dbe({worktree:e}){return i.jsxs("div",{className:"chat-worktree-card",children:[i.jsxs("div",{className:"chat-worktree-head",children:[i.jsx("span",{className:"chat-worktree-icon","aria-hidden":"true",children:"🌿"}),i.jsx("span",{className:"chat-worktree-title",children:"Ran in an isolated worktree"}),i.jsx("span",{className:`chat-worktree-state ${e.removed?"chat-worktree-gone":"chat-worktree-kept"}`,children:e.removed?"removed":"kept"})]}),i.jsxs("div",{className:"chat-worktree-meta",children:[i.jsx("code",{className:"chat-worktree-dir",title:e.dir,children:e.dir}),i.jsxs("span",{className:"admin-hint",children:["base ",e.base.slice(0,7)]})]}),i.jsx("div",{className:"chat-worktree-note admin-hint",children:e.removed?"the diff below is what is left of it — nothing was written into the project tree":"the directory above is still on disk"}),i.jsx(Cc,{diff:e.diff.payload})]})}function fbe({resume:e}){return i.jsxs("details",{className:"chat-resume-card",children:[i.jsxs("summary",{className:"chat-resume-head",children:[i.jsx("span",{className:"chat-resume-icon","aria-hidden":"true",children:"↩️"}),i.jsx("span",{className:"chat-resume-title",children:"Resumed a recorded run"}),i.jsxs("span",{className:"chat-resume-count",children:[i.jsxs("span",{children:[e.replayed," step",e.replayed===1?"":"s"," replayed"]}),i.jsxs("span",{children:[e.modelCalls," model call",e.modelCalls===1?"":"s"," made"]})]}),i.jsx("span",{className:`chat-resume-state ${e.saved?"chat-resume-saved":"chat-resume-unsaved"}`,title:e.saved?"the record was written back, so a later resume can replay this run":"the record could NOT be written — a later resume will replay nothing from this run",children:e.saved?"recorded":"not recorded"}),i.jsx("span",{className:"chat-card-caret","aria-hidden":"true",children:"▸"})]}),i.jsxs("div",{className:"chat-resume-meta",children:[typeof e.callsAvoided=="number"&&e.callsAvoided>0&&i.jsxs("span",{className:"chat-resume-saved-calls",title:"model calls the resume did not re-pay for",children:[e.callsAvoided," model call",e.callsAvoided===1?"":"s"," saved"]}),i.jsx("code",{className:"chat-resume-id",title:"the checkpoint record this run used",children:e.id})]}),i.jsx("div",{className:"chat-resume-note",children:e.notice})]})}function hbe({report:e}){const t=e.verification==="verified"?"VERIFIED":e.verification==="unverified"?"UNVERIFIED":e.verification==="blocked"?"BLOCKED":"no changes",n=[];return e.flags.unverifiedActionClaim&&n.push("claimed an action no tool ran"),e.flags.unverifiedEditClaim&&n.push("claimed a fix nothing verified"),e.flags.unverifiedBuildClaim&&n.push("claimed a failing build worked"),e.flags.unverifiedEdit&&n.push("edited without verifying"),e.flags.undeliveredArtifact&&n.push("deliverable never written"),e.flags.unfulfilledPromise&&n.push("promised an action it did not take"),e.flags.noActionTaken&&n.push("no action taken"),e.flags.undeliveredChange&&n.push("asked for a change, delivered a plan"),e.flags.unbackedHealthClaim&&n.push("verdict on the product nothing exercised"),i.jsxs("details",{className:`chat-turn-card chat-turn-${e.verification}`,children:[i.jsxs("summary",{className:"chat-turn-head",children:[i.jsx("span",{className:"chat-turn-icon","aria-hidden":"true",children:"📋"}),i.jsx("span",{className:"chat-turn-title",children:"Turn report"}),e.planned?i.jsxs("span",{className:"chat-turn-count",title:e.planCarried?"the tracked plan was carried from an earlier turn — THIS turn did not advance it":"plan steps recorded as done this turn",children:[e.stepCounts.done,"/",e.stepCounts.total," steps",e.planCarried?" · carried":""]}):null,e.summary?i.jsx("span",{className:"chat-turn-headline",title:e.summary,children:e.summary}):null,i.jsx("span",{className:"chat-turn-verdict",title:"derived from recorded evidence, never the model's own narration",children:t}),i.jsx("span",{className:"chat-card-caret","aria-hidden":"true",children:"▸"})]}),i.jsxs("div",{className:"chat-turn-body",children:[e.steps.length>0?i.jsx("ul",{className:"chat-turn-steps",children:e.steps.map(r=>i.jsxs("li",{className:`chat-turn-step chat-turn-step-${r.status}`,children:[i.jsx("span",{className:"chat-turn-step-icon","aria-hidden":"true",children:r.status==="done"?"✅":r.status==="running"?"🔄":r.status==="blocked"?"⛔":"⬜"}),i.jsx("span",{className:"chat-turn-step-text",children:r.description}),r.note?i.jsx("span",{className:"chat-turn-step-note",children:r.note}):null,r.evidence?i.jsx("span",{className:"chat-turn-step-evidence",children:r.evidence}):null]},r.id))}):null,e.changedPaths.length>0?i.jsxs("div",{className:"chat-turn-files",children:[e.changedPaths.length," file",e.changedPaths.length===1?"":"s"," changed:"," ",i.jsxs("code",{children:[e.changedPaths.slice(0,6).join(", "),e.changedPaths.length>6?` +${e.changedPaths.length-6} more`:""]})]}):null,e.planCarried?i.jsx("div",{className:"chat-turn-carried",children:"📋 that plan is carried from an earlier turn — THIS turn did not advance it."}):null,e.unverifiedPaths&&e.unverifiedPaths.length>0?i.jsxs("div",{className:"chat-turn-owed",children:["⚠️ ",e.unverifiedPaths.length," changed path",e.unverifiedPaths.length===1?"":"s"," no check exercised:"," ",i.jsxs("code",{children:[e.unverifiedPaths.slice(0,6).join(", "),e.unverifiedPaths.length>6?` +${e.unverifiedPaths.length-6} more`:""]})]}):null,n.length>0?i.jsx("div",{className:"chat-turn-flags",children:n.map(r=>i.jsxs("span",{className:"chat-turn-flag",children:["⚠️ ",r]},r))}):null]})]})}function mv(){try{if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID()}catch{}return`chat-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}const S$="nuvira.dashboard.chat.activeSession";function pbe(){try{const e=sessionStorage.getItem(S$);return e&&e.length>0&&e.length<=64?e:null}catch{return null}}function gv(e){try{sessionStorage.setItem(S$,e)}catch{}}function mbe(e,t){const n=t.trim().toLowerCase(),r=n?e.filter(u=>`${u.title} ${u.preview} ${u.firstUser}`.toLowerCase().includes(n)):e,a=[],s=new Date,o=new Date(s.getFullYear(),s.getMonth(),s.getDate()).getTime(),l=864e5,c=[{label:"Today",match:u=>u>=o},{label:"Yesterday",match:u=>u>=o-l&&u<o},{label:"This week",match:u=>u>=o-7*l&&u<o-l},{label:"Older",match:()=>!0}];for(const u of c){const d=r.filter(f=>u.match(f.updatedAt));d.length>0&&a.push({label:u.label,items:d})}return a}function gbe({ceilingRecovery:e}={}){var re;const[t,n]=b.useState(null),r=qr(),[a,s]=b.useState(Hye);b.useEffect(()=>{K.fetchLimits().then(A=>{A&&A.attachmentMaxBytes>0&&s(A.attachmentMaxBytes)})},[]),b.useEffect(()=>{K.fetchProcessEnv().then(A=>{const H=A.find(Y=>Y.name==="NUVIRA_CAPABILITY_MODE");H&&P(nbe(H.processValue??H.fileValue))})},[]),b.useEffect(()=>{K.listRoutableModels().then(A=>U(A))},[]);const[o,l]=b.useState([]),[c,u]=b.useState(""),[d,f]=b.useState(!1),[h,p]=b.useState(""),[m,g]=b.useState(null),[y,v]=b.useState(!1),[k,w]=b.useState(!1),[j,S]=b.useState(!1),[x,N]=b.useState(""),[E,P]=b.useState("balanced"),[_,R]=b.useState(""),[T,B]=b.useState(null),[$,I]=b.useState(!0),[D,U]=b.useState([]),[M,z]=b.useState(null),[O,J]=b.useState([]),[F,L]=b.useState([]),[ie,fe]=b.useState(null),[ve,Ee]=b.useState(null),[ee,Q]=b.useState(null),[ae,ce]=b.useState([]),[G,xe]=b.useState([]),[we,Pe]=b.useState([]),ge=b.useRef([]),Ie=b.useRef([]),me=b.useRef(null),Qe=b.useRef(null),De=b.useRef(null),_e=b.useRef([]),[pt,We]=b.useState(""),lt=b.useRef(""),Yt=b.useRef(null),[q,Z]=b.useState(null),[se,pe]=b.useState(!1),ke=b.useRef(!1),$e=b.useRef(!1),[zt,Le]=b.useState(0),rn=b.useRef(null),[Mn,wt]=b.useState(null),[Mt,an]=b.useState(null),[or,In]=b.useState(null),Gn=b.useRef(null),At=b.useRef(pbe()??mv()),Ft=b.useRef(""),[lr,cr]=b.useState([]),[zl,Tt]=b.useState(!0),[ya,pn]=b.useState(""),[Xs,sn]=b.useState(null),[ba,Kr]=b.useState(""),[_r,xa]=b.useState([]),[wa,qn]=b.useState(null),[Gi,qi]=b.useState(!1),Qs=b.useRef(null),Qa=b.useRef(null),[et,Zs]=b.useState(null),[ka,Sa]=b.useState(null),[Za,Ki]=b.useState([]),[Ja,Vi]=b.useState(""),[Yi,Vr]=b.useState(""),[Cr,ja]=b.useState(!1),[W,ne]=b.useState(""),[je,Se]=b.useState([]),[on,Kn]=b.useState(null),[En,Ar]=b.useState(!1),[Xi,Js]=b.useState([]),[md,Yr]=b.useState([]),[Fl,Ul]=b.useState(""),ei=b.useRef(null),He=b.useRef(null),eo=b.useRef(null),at=b.useRef(null),[It,Xr]=b.useState(null),[Qi,Wl]=b.useState(new Set),[Qr,gd]=b.useState("");b.useEffect(()=>{K.fetchAdminAuthStatus().then(A=>{n(A?{configured:A.configured,authenticated:A.authenticated,role:A.role??null}:{configured:!1,authenticated:!1,role:null})})},[r]),b.useEffect(()=>{var A,H;try{(H=(A=eo.current)==null?void 0:A.scrollTo)==null||H.call(A,{top:eo.current.scrollHeight})}catch{}},[o,d,O]),b.useEffect(()=>()=>{var A;(A=He.current)==null||A.call(He),He.current=null},[]);const Im=b.useCallback(async A=>{var he,Re;(he=He.current)==null||he.call(He),He.current=null;const H=await K.getChatSession(A);if(!H)return;At.current=A,gv(A),l(H.turns.map(ue=>({role:ue.role,content:ue.content,...ue.role==="assistant"?{followups:[],artifacts:wf(ue.content)}:{}}))),J([]),ge.current=[],L([]),Ie.current=[],fe(null),me.current=null,Ee(null),Qe.current=null,Q(null),De.current=null,ce([]),_e.current=[],lt.current="",We(""),Z(null),p(""),z(null),Xr(null),Tt(!0),B(H.pinnedProvider&&H.pinnedModel?{provider:H.pinnedProvider,model:H.pinnedModel}:null),I(H.pinnedStrict===!0);const Y=H.projectPath;if(Y){if(Sa(Y),(et==null?void 0:et.path)===Y)return;(Re=at.current)==null||Re.call(at,Y)}else Sa(null)},[et]),Hl=b.useCallback(()=>{var A;(A=He.current)==null||A.call(He),He.current=null,At.current=mv(),gv(At.current),Sa(null),B(null),l([]),J([]),ge.current=[],L([]),Ie.current=[],fe(null),me.current=null,Ee(null),Qe.current=null,Q(null),De.current=null,ce([]),_e.current=[],lt.current="",We(""),Z(null),p(""),z(null),Xr(null),xa([]),qn(null),u(""),Tt(!0)},[]),Zr=b.useCallback(A=>{xa(H=>[...H,A].slice(-10))},[]),$m=b.useCallback(A=>{xa(H=>H.filter((Y,he)=>he!==A))},[]),Gl=b.useCallback(async A=>{if(!A)return;if(A.size>a){p(`Attachment "${A.name}" is too large (max ${Math.round(a/1024)} KB). Raise the cap in Admin → Process Environment (NUVIRA_ATTACHMENT_MAX_BYTES).`);return}const H=new Uint8Array(await A.slice(0,8192).arrayBuffer()),Y=Jye(A.name,H);if(Y.how==="unsupported"){p(Y.reason);return}if(Y.how==="binary"){const Re=new Uint8Array(await A.arrayBuffer());Zr({name:A.name,content:Zye(Re),kind:"file",encoding:"base64"});return}const he=await A.text();Zr({name:A.name,content:he,kind:"file",encoding:"text"})},[Zr]),Lm=b.useCallback(A=>{const H=A.currentTarget,Y=A.clipboardData.getData("text")||"";Y.length>=Vye&&(Qa.current={start:H.selectionStart,end:H.selectionEnd},qn({text:Y}))},[]),vd=b.useCallback(()=>{const A=wa;if(!A)return;const H=Qa.current;u(Y=>H?Y.slice(0,H.start)+Y.slice(H.end):Y),Zr({name:"pasted-text.txt",content:A.text,kind:"paste",encoding:"text"}),qn(null),Qa.current=null},[wa,Zr]),yd=b.useCallback(A=>{sn(A.id),Kr(A.title==="(untitled conversation)"?"":A.title)},[]),to=b.useCallback(async A=>{const H=await K.renameChatSession(A,ba);H.ok?cr(Y=>Y.map(he=>he.id===A?{...he,title:ba.trim()||he.title}:he)):p(H.error||"Could not rename the session."),sn(null),Kr("")},[ba]),ql=b.useCallback(async A=>{const H=await K.deleteChatSession(A);H.ok?(cr(Y=>Y.filter(he=>he.id!==A)),At.current===A&&Hl()):p(H.error||"Could not delete the session.")},[Hl]),ti=(t==null?void 0:t.authenticated)===!0&&(t.role==="admin"||t.role==="operator"),bd=b.useRef(!1);b.useEffect(()=>{if(!ti||bd.current)return;bd.current=!0;const A=At.current;let H=!1,Y=null;const he=async()=>{const Re=await K.getChatSession(A);H||Re&&(Yt.current||l(Re.turns.map(ue=>({role:ue.role,content:ue.content,...ue.role==="assistant"?{followups:[],artifacts:wf(ue.content)}:{}}))),f(Re.busy===!0),Re.busy===!0&&(rn.current=Re.busySince??Date.now()),pe(Re.busy===!0),Re.pendingQuestion?Xr(Re.pendingQuestion):Re.busy||Xr(null),Re.busy&&(Y=setTimeout(()=>void he(),2500)))};return he(),()=>{H=!0,Y&&clearTimeout(Y)}},[ti]),b.useEffect(()=>{if(!se){Le(0),rn.current=null;return}const A=()=>Date.now()-(rn.current??Date.now());Le(A());const H=setInterval(()=>Le(A()),Kye);return()=>clearInterval(H)},[se]),b.useEffect(()=>{ti&&(K.listChatSessions().then(A=>{Array.isArray(A)&&cr(A)}),K.listProjects().then(A=>{Array.isArray(A)&&Ki(A)}))},[ti]);const Tr=b.useCallback(async A=>{const H=A.trim();if(!H)return;Vr("");const Y=await K.attachProject(H);if(Y.ok&&Y.project){Zs(Y.project),Vi("");const he=await K.listProjects();Array.isArray(he)&&Ki(he)}else Vr(Y.error||"Could not attach that directory.")},[]);at.current=Tr;const Na=b.useCallback(async A=>{ja(!0),Ar(!0),Ul("");const H=await K.browseDirectories(A,{showDrives:!A});H.ok&&(ne(H.path),Se(H.entries),Kn(H.parent),H.drives&&Js(H.drives),H.breadcrumbs&&Yr(H.breadcrumbs)),Ar(!1)},[]),Kl=b.useCallback(async A=>{Ar(!0),Ul("");const H=await K.browseDirectories(A);H.ok&&(ne(H.path),Se(H.entries),Kn(H.parent),H.breadcrumbs&&Yr(H.breadcrumbs)),Ar(!1)},[]),no=b.useCallback(async()=>{if(!W)return;const A=await K.browseDirectories(W);A.ok&&Se(A.entries)},[W]);b.useEffect(()=>K.onChatRetryEvent(H=>{if(H.sessionId!==At.current){K.listChatSessions().then(Y=>{Array.isArray(Y)&&cr(Y)});return}l(Y=>[...Y,{role:"assistant",content:H.content}]),H.kind==="answer"&&Z(null)}),[]),b.useEffect(()=>(Cr&&W&&(ei.current=setInterval(()=>{no()},5e3)),()=>{ei.current&&clearInterval(ei.current)}),[Cr,W,no]);const xd=b.useCallback(async()=>{if(typeof window<"u"&&"showDirectoryPicker"in window)try{const Y=(await window.showDirectoryPicker({mode:"read"})).name;if(!Y){Na();return}Vr(""),f(!0);const he=await K.resolveFolder(Y);f(!1),he.ok&&he.path?(Vi(he.path),Tr(he.path)):Vr('Folder "'+Y+'" found — selecting it now. If this is wrong, type the full path below.');return}catch(H){if((H==null?void 0:H.name)==="AbortError")return}Na()},[Na,Tr]),Zi=b.useCallback(A=>{if($e.current)return;$e.current=!0,ke.current=!1;const H=A.content||"(the agent produced no text — try rephrasing)";l(Y=>[...Y,{role:"assistant",content:H,error:A.generationFailed===!0,followups:A.followups??[],steps:ge.current,tools:Ie.current,plan:me.current,diff:Qe.current,draft:De.current,findings:_e.current,artifacts:wf(H)}]),lt.current="",We(""),p(""),Z(null),pe(!1),f(!1),Tt(!0)},[]),Vl=b.useCallback(async(A,H)=>{const Y=(e==null?void 0:e.pollMs)??Gye,he=(e==null?void 0:e.maxMisses)??qye;let Re=0;for(;;){if(await new Promise(ur=>setTimeout(ur,Y)),$e.current||!ke.current)return;const ue=await K.getChatSession(A);if(!ue){if(++Re>=he){ke.current=!1,pe(!1),f(!1),p("Lost contact with the server while this turn was running. The turn itself was not cancelled — its answer is in this conversation (reopen it) or in Traces.");return}continue}if(Re=0,ue.busy===!0){ue.pendingQuestion&&Xr(ue.pendingQuestion),typeof ue.busySince=="number"&&(rn.current=ue.busySince);continue}const Ne=[...ue.turns].reverse().find(ur=>ur.role==="assistant");Ne?Zi({content:Ne.content,followups:[]}):(ke.current=!1,pe(!1),f(!1),Z(H));return}},[Zi,e==null?void 0:e.pollMs,e==null?void 0:e.maxMisses]),ln=b.useCallback(async(A,H)=>{var ur,ro,W0;const Y=A.trim(),he=Array.isArray(H)?H:_r;if(!Y&&he.length===0||d)return;p(""),z(null),J([]),ge.current=[],L([]),Ie.current=[],fe(null),me.current=null,Ee(null),Qe.current=null,Q(null),De.current=null,ce([]),_e.current=[],l(Ae=>[...Ae,{role:"user",content:Y,attachments:he.length>0?he:void 0}]),u(""),xa([]),qn(null),Ft.current=Y||`[${he.length} attachment(s)]`,rn.current=Date.now(),f(!0),Tt(!1);const Re=At.current,ue=new AbortController;Yt.current=ue,Z(null),ke.current=!1,$e.current=!1,pe(!1),(ur=He.current)==null||ur.call(He),He.current=K.subscribeChat(Re,{onToken:Ae=>{lt.current+=Ae,We(lt.current)},onProgress:Ae=>{ge.current=[...ge.current,Ae],J(ge.current)},onQuestion:Ae=>{Xr(Ae),Wl(new Set)},onTool:Ae=>{const jt=[...Ie.current],Ji=jt.findIndex(N$=>N$.id===Ae.id),es={id:Ae.id,tool:Ae.tool,phase:Ae.phase,args:Ae.args,ok:Ae.ok,result:Ae.result,error:Ae.error,durationMs:Ae.durationMs};Ji>=0?jt[Ji]=es:jt.push(es),Ie.current=jt,L(jt)},onPlan:Ae=>{const jt={goal:Ae.goal,steps:Ae.steps.map(ebe),revision:Ae.revision};me.current=jt,fe(jt)},onDiff:Ae=>{const jt={files:Ae.files,summary:Ae.summary};Qe.current=jt,Ee(jt)},onSkillDraft:Ae=>{const jt={name:Ae.name,description:Ae.description,markdown:Ae.markdown,updatedAt:Ae.updatedAt,status:"pending"};De.current=jt,Q(jt)},onFinding:Ae=>{_e.current=[..._e.current,Ae],ce(_e.current)},onSecretRequest:Ae=>{xe(jt=>{const Ji=jt.findIndex(es=>es.skillName===Ae.skillName);if(Ji>=0){const es=[...jt];return es[Ji]=Ae,es}return[...jt,Ae]})},onExecutionResult:Ae=>{Pe(jt=>[...jt,Ae])},onTurnDone:Ae=>{ke.current&&Zi(Ae)}});const Ne=await K.chatSend(Re,Y||`(see ${he.length} attachment${he.length===1?"":"s"})`,{...T?{provider:T.provider,model:T.model}:{},...T?{strict:$}:{},projectPath:et==null?void 0:et.path,attachments:he.map(Ae=>({name:Ae.name,content:Ae.content,kind:Ae.kind,encoding:Ae.encoding??"text"})),...y?{worktree:!0,keepWorktree:k}:{},...j?{resume:x.trim()||!0}:{}},ue.signal);if(Yt.current=null,(ro=He.current)==null||ro.call(He),He.current=null,lt.current="",We(""),Ne.ok){z(Ne.generationFailed?null:`${Ne.provider??"provider"}${Ne.model?` / ${Ne.model}`:" (auto-routed)"}`),wt(Ne.routingNotice??null),an(Ne.workspaceNotice??null);const Ae=Ne.workspaceSource==="scratch"?Ne.workspacePath??null:null;In(Ae),!Ae&&Ne.workspacePath&&Ne.workspacePath!==(et==null?void 0:et.path)&&((W0=at.current)==null||W0.call(at,Ne.workspacePath)),Z(Ne.generationFailed&&!Ne.retryQueued&&!Ne.refused?Y:null);const jt=Ne.content||"(the agent produced no text — try rephrasing)";l(Ji=>[...Ji,{role:"assistant",content:jt,error:Ne.generationFailed,followups:Ne.followups,steps:ge.current,tools:Ie.current,plan:me.current,diff:Qe.current,draft:De.current,findings:Ne.findings??_e.current,worktree:Ne.worktree,resume:Ne.resume,turnReport:Ne.turnReport,refused:Ne.refused,needsProject:Ne.needsProject,artifacts:wf(jt)}])}else ue.signal.aborted?(p(""),Z(null)):Ne.turnStillRunning?(p(""),Z(null),pe(!0),ke.current=!0,$e.current=!1,Vl(Re,Y)):Ne.unauthorized?(n(Ae=>Ae&&{...Ae,authenticated:!1}),p("Session expired — log in again to chat.")):(p(Ne.error||"The agent could not answer — check that a provider API key is set for the dashboard process."),Z(Y));Ne.ok===!1&&Ne.turnStillRunning||(f(!1),Tt(!0))},[d,et,_r,y,k,j,x,T,$,Zi,Vl]),wd=b.useCallback(()=>{var A;(A=Yt.current)==null||A.abort(),K.chatCancel(At.current)},[]),kd=b.useCallback(async()=>{const A=E==="max"?"balanced":"max";R("");const H=await K.saveProcessEnvVar("NUVIRA_CAPABILITY_MODE",A);H.ok?(P(A),R(A==="max"?"⚡ Max capability is on for the next turn.":"⚖️ Back to balanced.")):R(H.error||"Could not change the capability mode.")},[E]),Sd=b.useCallback(async()=>{g(null);const A=await K.chatSupportBundle(At.current);g(A.ok?{kind:"ok",text:"Support bundle downloaded — attach it to your bug report."}:{kind:"err",text:A.error||"Could not build the support bundle."})},[]),Yl=b.useCallback(async A=>{Q(Y=>Y&&{...Y,status:"saving"});const H=await K.skillDraftAccept(A);Q(Y=>Y&&{...Y,status:H.ok?"saved":"error"}),H.ok||p(H.error||"Could not accept the draft.")},[]),Xl=b.useCallback(async A=>{const H=await K.skillDraftReject(A);H.ok?Q(Y=>Y&&{...Y,status:"rejected"}):p(H.error||"Could not reject the draft.")},[]),Ql=b.useCallback(A=>{ln(`Revise the skill draft "${A}" — improve it per your best judgment and present it again.`)},[ln]),jd=b.useCallback(async A=>{const H=await K.saveSecrets(A);if(!H.ok){p(H.error||"Could not save secrets.");return}const Y=H.refused??[];Y.length>0&&p(Y.map(he=>he.reason==="provider-credential"?`${he.name} is a provider credential — set it up as a provider, skills never receive it.`:`${he.name} was not saved (${he.reason}).`).join(" "))},[]),Zl=b.useCallback(A=>{if(A.length===0)return;const H=et?` in the attached project ${et.path}`:"";ln(`Commit exactly these files that I accepted on the diff card (and nothing else)${H}: ${A.join(", ")}. Show me a short confirmation before finishing.`)},[ln,et]),Jr=b.useCallback(async A=>{const H=It;if(!H)return;Xr(null),gd(""),Wl(new Set);const Y=await K.chatRespond(At.current,H.questionId,A);Y.ok||p(Y.error||"The question could not be answered — try sending your message again.")},[It]),Jl=b.useCallback(()=>{if(!It)return;const A=Qr.trim(),H=It.multiSelect?[...Qi]:[...Qi][0];It.multiSelect?Jr({index:[...Qi],...A?{custom:A}:{}}):Jr(A?{index:-1,custom:A}:H!==void 0?{index:H}:{index:-1})},[It,Qi,Qr,Jr]),Nd=b.useCallback(()=>{It&&Jr({index:-1})},[It,Jr]),Ed=b.useCallback(A=>{Wl(H=>{const Y=new Set(H);return It!=null&&It.multiSelect?Y.has(A)?Y.delete(A):Y.add(A):(Y.clear(),Y.add(A)),Y})},[It]),C=b.useCallback(async()=>{var H;(H=He.current)==null||H.call(He),He.current=null,At.current=mv(),gv(At.current),l([]),J([]),ge.current=[],L([]),Ie.current=[],fe(null),me.current=null,Ee(null),Qe.current=null,Q(null),De.current=null,ce([]),_e.current=[],lt.current="",We(""),Z(null),p(""),z(null),Xr(null);const A=await K.listChatSessions();Array.isArray(A)&&cr(A)},[]),V=((re=[...o].reverse().find(A=>{var H;return A.role==="assistant"&&!A.error&&(((H=A.followups)==null?void 0:H.length)??0)>0}))==null?void 0:re.followups)??[];return i.jsxs("div",{className:"panel",children:[i.jsx(Oe,{icon:"💬",title:"Chat with the agent",actions:i.jsxs("div",{className:"chat-head-actions",children:[M?i.jsx("span",{className:"admin-hint",children:M}):null,i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void C(),disabled:d||o.length===0,children:"🗑 New conversation"})]})}),t!=null&&t.authenticated?ti?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"chat-project-bar",children:et?i.jsxs("div",{className:"chat-project-attached",children:[i.jsx("span",{className:"chat-project-icon",children:"📁"}),i.jsx("span",{className:"chat-project-name",children:et.name}),i.jsxs("span",{className:"chat-project-meta",children:[et.fileCount," files · ",et.symbolCount," symbols",et.truncated?" · truncated map":""]}),i.jsx("span",{className:"chat-project-path",title:et.path,children:et.path}),i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>Zs(null),children:"✕ detach"})]}):i.jsxs("div",{className:"chat-project-pick",children:[i.jsx("span",{className:"chat-project-icon",children:"📁"}),i.jsx("span",{className:"chat-project-hint",children:"Select Project Folder"}),Za.find(A=>A.kind==="cwd")?i.jsxs("span",{className:"chat-project-cwd",title:"Working directory used when no folder is attached",children:["⚙️ ",Za.find(A=>A.kind==="cwd").path]}):null,Za.length>0?i.jsx("span",{className:"chat-project-chips",children:Za.filter(A=>A.kind!=="cwd").slice(0,3).map(A=>i.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Tr(A.path),children:A.name},A.path))}):null,i.jsx("input",{className:"chat-project-input",ref:Gn,value:Ja,onChange:A=>Vi(A.target.value),onKeyDown:A=>{A.key==="Enter"&&(A.preventDefault(),Tr(Ja))},placeholder:"or type a path, e.g. ~/code/my-app",disabled:d}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void Tr(Ja),disabled:d||!Ja.trim(),children:"Attach"}),i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>void xd(),title:"Pick a project folder using your system's folder picker (Finder / Explorer)",children:"🗂️ Browse"}),Yi?i.jsx("span",{className:"chat-project-error",children:Yi}):null,Cr?i.jsxs("div",{className:"chat-browse-popover",children:[i.jsxs("div",{className:"chat-browse-head",children:[i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>ja(!1),title:"Close",children:"✕"}),i.jsx("div",{className:"chat-browse-breadcrumbs",children:Xi.length>0&&!W?i.jsx("span",{className:"admin-hint",children:"Select a drive or home folder:"}):i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"chat-breadcrumb",onClick:()=>void Na(),children:"🏠"}),md.map((A,H)=>i.jsxs("span",{children:[i.jsx("span",{className:"chat-breadcrumb-sep",children:"/"}),i.jsx("button",{type:"button",className:"chat-breadcrumb",onClick:()=>void Kl(A.path),children:A.name})]},A.path))]})})]}),Xi.length>0&&!W?i.jsx("div",{className:"chat-browse-drives",children:Xi.map(A=>i.jsx("button",{type:"button",className:"chat-browse-drive",onClick:()=>void Kl(A.path),children:A.name},A.path))}):null,je.length>5?i.jsx("div",{className:"chat-browse-search",children:i.jsx("input",{type:"text",className:"chat-browse-filter",placeholder:"🔍 Filter folders…",value:Fl,onChange:A=>Ul(A.target.value),autoFocus:!0})}):null,i.jsx("div",{className:"chat-browse-list",children:En?i.jsx("span",{className:"admin-hint",children:"Loading…"}):je.length===0?i.jsx("span",{className:"admin-hint",children:"No subdirectories found"}):je.filter(A=>!Fl||A.name.toLowerCase().includes(Fl.toLowerCase())).map(A=>i.jsxs("button",{type:"button",className:"chat-browse-entry",onClick:()=>void Kl(A.path),children:[i.jsx("span",{className:"chat-browse-entry-icon",children:"📁"}),i.jsx("span",{className:"chat-browse-entry-name",children:A.name}),A.modified?i.jsx("span",{className:"chat-browse-entry-date",children:new Date(A.modified).toLocaleDateString()}):null]},A.path))}),i.jsxs("div",{className:"chat-browse-foot",children:[i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>void no(),title:"Refresh folder list",children:"🔄"}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>{ja(!1),Tr(W)},disabled:!W,children:"📁 Select this folder"})]})]}):null]})}),ka&&(!et||et.path!==ka)?i.jsxs("div",{className:"chat-session-project-banner",children:[i.jsxs("span",{children:["⚠️ This conversation was working in ",i.jsx("code",{children:ka})]}),et?i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void Tr(ka),children:"📁 Switch to it"}):i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void Tr(ka),children:"📁 Attach it"})]}):null,i.jsxs("div",{className:"chat-layout",children:[zl?i.jsxs("div",{className:"chat-sidebar",children:[i.jsxs("div",{className:"chat-sidebar-head",children:[i.jsx("span",{children:"📁 Sessions"}),i.jsxs("div",{className:"chat-sidebar-head-actions",children:[i.jsx("button",{type:"button",className:"chat-mini-action",title:"New chat",onClick:Hl,children:"+ New"}),i.jsx("button",{type:"button",className:"chat-mini-action",title:"Collapse history",onClick:()=>Tt(!1),children:"▸"})]})]}),i.jsx("input",{className:"chat-session-search",placeholder:"Search conversations…",value:ya,onChange:A=>pn(A.target.value)}),lr.length===0?i.jsx("div",{className:"chat-sidebar-empty",children:"No past conversations yet."}):i.jsx("div",{className:"chat-sidebar-list",children:mbe(lr,ya).map(({label:A,items:H})=>i.jsxs("div",{className:"chat-session-group",children:[i.jsx("div",{className:"chat-session-group-label",children:A}),H.map(Y=>i.jsx("div",{className:`chat-session-item${Y.id===At.current?" chat-session-active":""}`,children:Xs===Y.id?i.jsxs("div",{className:"chat-session-rename",children:[i.jsx("input",{autoFocus:!0,value:ba,onChange:he=>Kr(he.target.value),onKeyDown:he=>{he.key==="Enter"&&to(Y.id),he.key==="Escape"&&sn(null)},placeholder:"Session title"}),i.jsx("button",{type:"button",className:"chat-mini-action",onClick:()=>void to(Y.id),children:"✓"})]}):i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"chat-session-main",onClick:()=>void Im(Y.id),title:Y.preview||Y.title,children:[i.jsx("span",{className:"chat-session-title",children:Y.title}),i.jsx("span",{className:"chat-session-preview",children:Y.firstUser||Y.preview}),i.jsxs("span",{className:"chat-session-meta",children:[Y.projectPath?`📁 ${Y.projectPath.split("/").pop()} · `:"",Y.turnCount," msg",Y.turnCount===1?"":"s"," · ",new Date(Y.updatedAt).toLocaleString()]})]}),i.jsxs("span",{className:"chat-session-actions",children:[i.jsx("button",{type:"button",className:"chat-mini-action",title:"Rename",onClick:()=>yd(Y),children:"✏️"}),i.jsx("button",{type:"button",className:"chat-mini-action",title:"Delete",onClick:()=>void ql(Y.id),children:"🗑"})]})]})},Y.id))]},A))})]}):i.jsx("div",{className:"chat-rail",children:i.jsx("button",{type:"button",className:"chat-rail-btn",onClick:()=>Tt(!0),title:"Show history",children:"📁"})}),i.jsxs("div",{className:"chat-main",children:[i.jsxs("div",{className:"chat-thread",ref:eo,role:"log","aria-live":"polite",children:[o.length===0?i.jsxs("div",{className:"empty-state",children:[i.jsx("p",{className:"empty-state-title",children:"Say anything — the agent decides what to do (answer, fix code, plan, run the pipeline)."}),i.jsxs("div",{className:"empty-state-chips",children:[i.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void ln("what's the state of this project?"),children:"📋 assess this project"}),i.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void ln("run the test suite"),children:"🧪 run the tests"}),i.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void ln("stop the gateway"),children:"⏹ stop the gateway"}),i.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void ln("load the code-assessment skill and assess this project"),children:"🧠 load the code-assessment skill"}),i.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void ln("learn the workflow I just did as a skill"),children:"📚 learn a workflow as a skill"}),i.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void ln("publish the current version"),children:"🚀 publish the release"})]})]}):o.map((A,H)=>i.jsxs("div",{className:`chat-bubble chat-${A.role}${A.error?" chat-error":""}`,children:[i.jsx("div",{className:"chat-bubble-role",children:A.role==="user"?"You":"🤖 Agent"}),A.role==="assistant"?i.jsx("div",{className:"chat-bubble-text",children:i.jsx(q_,{text:A.content})}):i.jsx("div",{className:"chat-bubble-text",children:A.content}),A.role==="user"&&A.attachments&&A.attachments.length>0?i.jsxs("details",{className:"chat-steps",open:A.attachments.length===1,children:[i.jsxs("summary",{children:["📎 ",A.attachments.length," attachment",A.attachments.length===1?"":"s",":"," ",A.attachments.map(Y=>Y.name).join(", ")]}),A.attachments.map((Y,he)=>i.jsxs("div",{className:"chat-attach-content",children:[i.jsxs("div",{className:"admin-hint",children:[Y.name," — ",bt(Y.content.length)," chars"]}),i.jsx("pre",{children:Y.content})]},he))]}):null,A.role==="assistant"&&A.diff?i.jsxs("details",{className:"chat-steps",open:!0,children:[i.jsxs("summary",{children:["Changes: ",A.diff.summary]}),i.jsx(Cc,{diff:A.diff,selectable:!0,onCommitAccepted:Zl})]}):null,A.role==="assistant"&&A.artifacts&&(A.artifacts.diffs.length>0||A.artifacts.results.length>0||A.artifacts.deploys.length>0)?i.jsxs(ibe,{children:[A.artifacts.diffs.map((Y,he)=>i.jsx("div",{"data-artifact-card":!0,tabIndex:0,role:"group","aria-label":`Diff: ${Y.summary}`,className:"chat-artifact-item",children:et?i.jsx(Cc,{diff:Y,selectable:!0,onCommitAccepted:Zl}):i.jsx(Cc,{diff:Y,lockedHint:"Attach a project to review and commit these changes."})},`diff-${he}`)),A.artifacts.results.map((Y,he)=>i.jsx("div",{"data-artifact-card":!0,tabIndex:0,role:"group","aria-label":`Result: ${Y.title}`,className:"chat-artifact-item",children:i.jsx(rbe,{result:Y})},`result-${he}`)),A.artifacts.deploys.map((Y,he)=>i.jsx("div",{"data-artifact-card":!0,tabIndex:0,role:"group","aria-label":`Deployment: ${Y.url}`,className:"chat-artifact-item",children:i.jsx(abe,{deploy:Y})},`deploy-${he}`))]}):null,A.role==="assistant"&&A.draft?i.jsxs("details",{className:"chat-steps",open:!0,children:[i.jsxs("summary",{children:["Skill draft: ",A.draft.name]}),i.jsx(X_,{draft:A.draft,onAccept:Yl,onReject:Xl,onEdit:Ql})]}):null,A.role==="assistant"&&A.plan?i.jsxs("details",{className:"chat-steps",open:!0,children:[i.jsxs("summary",{children:["Plan: ",A.plan.goal]}),i.jsx(Q_,{plan:A.plan})]}):null,A.role==="assistant"&&A.refused?i.jsx("div",{className:"chat-refused-line",children:"⛔ This turn did not run — the isolation it asked for could not be made. Nothing was written, and the reason is above."}):null,A.role==="assistant"&&A.needsProject?i.jsx("div",{className:"chat-refused-line",children:"📁 Nothing was run — attach a project folder above, then send the message again."}):null,A.role==="assistant"&&A.worktree?i.jsx(dbe,{worktree:A.worktree}):null,A.role==="assistant"&&A.resume?i.jsx(fbe,{resume:A.resume}):null,A.role==="assistant"&&A.turnReport?i.jsx(hbe,{report:A.turnReport}):null,A.role==="assistant"&&A.findings&&A.findings.length>0?i.jsx(J_,{findings:A.findings}):null,A.role==="assistant"&&A.tools&&A.tools.length>0?i.jsxs("details",{className:"chat-steps chat-tool-details",children:[i.jsxs("summary",{children:[A.tools.length," tool call",A.tools.length===1?"":"s"]}),i.jsx(Z_,{tools:A.tools})]}):null,A.role==="assistant"&&A.steps&&A.steps.length>0?i.jsxs("details",{className:"chat-steps",children:[i.jsxs("summary",{children:[A.steps.length," step",A.steps.length===1?"":"s"]}),i.jsx("div",{className:"chat-step-line",children:A.steps.map((Y,he)=>i.jsx("div",{children:Y.trim()},he))})]}):null]},H)),d?i.jsxs("div",{className:"chat-bubble chat-assistant",children:[i.jsx("div",{className:"chat-bubble-role",children:"🤖 Agent"}),ie?i.jsx(Q_,{plan:ie}):null,ve?i.jsx(Cc,{diff:ve}):null,y&&d?i.jsx("div",{className:"chat-resume-line",children:"🌿 this turn is running in its own git worktree — the diff arrives with the answer"}):null,j&&d?i.jsx("div",{className:"chat-resume-line",children:"↩️ this turn is replaying the recorded steps of this ask that are unchanged — the count arrives with the answer"}):null,ae.length>0?i.jsx(J_,{findings:ae}):null,ee?i.jsx(X_,{draft:ee,onAccept:Yl,onReject:Xl,onEdit:Ql}):null,G.map(A=>i.jsx(sbe,{request:A,onSave:jd},A.skillName)),we.map((A,H)=>i.jsx(obe,{result:A},`${A.skillName}-${H}`)),i.jsx(Z_,{tools:F,live:!0}),pt?i.jsx("div",{className:"chat-bubble-text chat-streaming",children:i.jsx(q_,{text:pt})}):null,i.jsx("div",{className:"chat-working",children:O.length>0?i.jsx("span",{className:"chat-working-lines",children:O.map((A,H)=>i.jsx("div",{className:"chat-step-line",children:A.trim()},H))}):i.jsxs(i.Fragment,{children:["💭 thinking… ",i.jsx("span",{className:"chat-dots"})]})})]}):null]}),h?i.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:h}):null,se&&It?i.jsxs("div",{className:"admin-row-msg chat-routing-notice",children:["❓ Waiting for ",i.jsx("strong",{children:"your"})," answer — choose one of the options above and the turn continues where it stopped. Nothing is stuck: the server is holding this turn open for you, and the agent has not been told anything yet (its own words: it asked instead of guessing)."]}):se?i.jsxs("div",{className:"admin-row-msg chat-routing-notice",children:["⏳ Still working on the server — ",Gb(zt)," elapsed on this turn, counted from when it started (not from when this page stopped waiting for the reply). This is a long-running turn, not a failure: the answer will appear here by itself when it lands, and you can close this page and come back."]}):null,Mn?i.jsxs("div",{className:"admin-row-msg chat-routing-notice",children:[i.jsxs("span",{children:["ℹ️ ",Mn]})," ",i.jsx("button",{className:"chat-routing-notice-dismiss",type:"button","aria-label":"Dismiss routing notice",onClick:()=>wt(null),children:"✕"})]}):null,Mt?i.jsxs("div",{className:"admin-row-msg chat-routing-notice",children:[i.jsxs("span",{children:["📁 ",Mt]})," ",i.jsx("button",{className:"chat-routing-notice-dismiss",type:"button","aria-label":"Dismiss workspace notice",onClick:()=>an(null),children:"✕"})]}):null,or?i.jsxs("div",{className:"admin-row-msg chat-scratch-notice","data-testid":"chat-scratch-notice",children:[i.jsxs("span",{children:["🗂️ No folder was attached, so this turn used a temporary workspace:"," ",i.jsx("code",{className:"chat-scratch-path",children:or})]})," ",i.jsx("button",{type:"button",className:"admin-mini-btn",title:"Attach this folder to the chat and keep working in it",onClick:()=>{var H;const A=or;In(null),(H=at.current)==null||H.call(at,A)},children:"✓ Use as my project path"})," ",i.jsx("button",{type:"button",className:"admin-mini-btn",title:"Attach a folder of your own — the next turn runs inside it",onClick:()=>{var A;In(null),(A=Gn.current)==null||A.focus()},children:"📁 Attach my own folder"})," ",i.jsx("button",{type:"button",className:"chat-routing-notice-dismiss","aria-label":"Dismiss temporary workspace notice",onClick:()=>In(null),children:"✕"})]}):null,m?i.jsx("div",{className:`admin-row-msg${m.kind==="err"?" admin-row-msg-err":""}`,children:m.text}):null,q&&!d?i.jsxs("div",{className:"chat-retry-row",children:[i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void ln(q),children:"↻ Retry"}),i.jsx("span",{className:"admin-hint",children:"Re-send the last message — the turn failed."})]}):null,It?i.jsxs("div",{className:"chat-resolve-card chat-question-card",children:[i.jsx("div",{className:"chat-resolve-head",children:i.jsxs("strong",{children:["🤔 ",It.question]})}),i.jsx("div",{className:"chat-resolve-options",children:It.choices.map((A,H)=>i.jsxs("button",{type:"button",className:`chat-chip${Qi.has(H)?" chat-chip-selected":""}`,onClick:()=>Ed(H),children:[A.label,A.description?i.jsxs("span",{className:"admin-hint",children:[" — ",A.description]}):null]},`${A.label}-${H}`))}),i.jsx("input",{className:"chat-question-custom",type:"text",placeholder:"✏️ Or type your own answer…",value:Qr,onChange:A=>gd(A.target.value),onKeyDown:A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),Jl())}}),i.jsxs("div",{className:"chat-resolve-foot",children:[i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:Jl,children:Qr.trim()?"Send answer":It.multiSelect?"Submit":"Choose"}),i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:Nd,children:"Skip — best judgment"})]})]}):null,V.length>0&&!d?i.jsxs("div",{className:"chat-followups",children:[i.jsx("span",{className:"admin-hint",children:"Next steps:"}),V.map((A,H)=>i.jsx("button",{className:"chat-chip",type:"button",onClick:()=>void ln(A.prompt),children:A.label||A.prompt},H))]}):null,i.jsxs("form",{className:`chat-composer${Gi?" chat-composer-drag":""}`,onSubmit:A=>{A.preventDefault(),ln(c)},onDragOver:A=>{A.preventDefault(),qi(!0)},onDragLeave:()=>qi(!1),onDrop:A=>{var Y;A.preventDefault(),qi(!1);const H=Array.from(((Y=A.dataTransfer)==null?void 0:Y.files)??[]);for(const he of H.slice(0,10))Gl(he)},children:[wa?i.jsxs("div",{className:"chat-paste-offer",children:[i.jsxs("span",{className:"admin-hint",children:["📄 You pasted ",bt(wa.text.length)," characters. Attach it as a file instead?"]}),i.jsx("button",{type:"button",className:"chat-chip",onClick:vd,children:"Attach as text"}),i.jsx("button",{type:"button",className:"chat-mini-action",onClick:()=>{qn(null),Qa.current=null},children:"Keep inline"})]}):null,_r.length>0?i.jsx("div",{className:"chat-attach-row",children:_r.map((A,H)=>i.jsxs("span",{className:"chat-attach-chip",title:A.encoding==="base64"?`${A.name} (${bt(A.content.length)} base64 chars — read on the server)`:`${A.name} (${bt(A.content.length)} chars)`,children:["📎 ",A.name,i.jsx("span",{className:"admin-hint",children:A.encoding==="base64"?`${Math.round(A.content.length*3/4096)} KB`:`${bt(A.content.length)}c`}),i.jsx("button",{type:"button",className:"chat-mini-action",onClick:()=>$m(H),children:"✕"})]},`${A.name}-${H}`))}):null,i.jsxs("div",{className:"chat-controls",children:[i.jsx("input",{ref:Qs,type:"file",accept:".pdf,.docx,.xlsx,.pptx,.txt,.md,.markdown,.text,.log,.csv,.tsv,.json,.xml,.yaml,.yml,.html,.htm,text/*",style:{display:"none"},onChange:A=>{var Y;const H=(Y=A.target.files)==null?void 0:Y[0];H&&Gl(H),A.target.value=""}}),i.jsx("button",{type:"button",className:"chat-attach-btn",title:"Attach a file (up to 300 KB): PDF, DOCX, XLSX, PPTX or text — documents are read on the server",disabled:d||_r.length>=10,onClick:()=>{var A;return(A=Qs.current)==null?void 0:A.click()},children:"📎 attach"}),i.jsx("button",{type:"button",className:"chat-attach-btn","aria-label":"Download support bundle",title:"Download a support bundle for this chat: the session debug log (which backend served each turn) plus the conversation. Needs NUVIRA_DEBUG_LOG=1 in the dashboard process.",onClick:()=>void Sd(),children:"🐞 debug"}),i.jsxs("button",{type:"button",className:`chat-attach-btn${y?" chat-attach-btn-on":""}`,"aria-label":"Run turns in an isolated git worktree","aria-pressed":y,title:y?"Turns run in their own git worktree and report the diff — click to run in the project tree again":"Run turns in their own git worktree of the attached project, and report the diff against the base commit. Refuses rather than running in your tree when the directory cannot be isolated. Needs an attached project (or the server's own git working directory).",onClick:()=>{v(A=>!A),g(null)},children:["🌿",y?" isolated":" isolate"]}),i.jsxs("button",{type:"button",className:`chat-attach-btn${j?" chat-attach-btn-on":""}`,"aria-label":"Replay this ask's recorded steps instead of paying for them again","aria-pressed":j,title:j?"Recorded steps whose input is unchanged are replayed instead of paid for — click to run fresh again":"Replay the steps of an earlier run of this same ask whose input is unchanged, instead of paying for them again. The record is keyed by the ask and the directory; name a checkpoint id below to resume a specific one. A step whose input CHANGED is paid for again.",onClick:()=>{S(A=>!A),g(null)},children:["↩️",j?" resuming":" resume"]}),j?i.jsx("input",{className:"chat-resume-input",value:x,onChange:A=>N(A.target.value),placeholder:"checkpoint id (blank = this ask's record)",title:"Resume this specific checkpoint record. Blank resumes the record for this ask in this directory.","aria-label":"Checkpoint id to resume",disabled:d}):null,y?i.jsxs("button",{type:"button",className:`chat-attach-btn${k?" chat-attach-btn-on":""}`,"aria-pressed":k,title:k?"The worktree is KEPT after the turn so you can look inside it":"The worktree is measured and removed after each turn",onClick:()=>w(A=>!A),children:["📌",k?" keep":" drop"]}):null,i.jsxs("select",{className:"chat-model-picker","aria-label":"Model: Auto or a specific routable model",title:T?`Pinned to ${T.provider}/${T.model} for this chat. Choose Auto to let the agent route again.`:"Auto (default): the agent picks the best routable model each turn. Choose one to pin it for this chat.",value:T?`${T.provider}|${T.model}`:"",disabled:d,onChange:A=>{const H=A.target.value;if(!H){B(null);return}const Y=H.indexOf("|");B({provider:H.slice(0,Y),model:H.slice(Y+1)})},children:[i.jsx("option",{value:"",children:"🤖 Auto (agent decides)"}),T&&!D.some(A=>A.provider===T.provider&&A.model===T.model)?i.jsxs("option",{value:`${T.provider}|${T.model}`,children:[T.provider,"/",T.model," · pinned"]}):null,D.map(A=>i.jsxs("option",{value:`${A.provider}|${A.model}`,children:[A.provider,"/",A.model," · ",A.band," (",A.capability.toFixed(2),")"]},`${A.provider}|${A.model}`))]}),T?i.jsx("button",{type:"button",className:`chat-attach-btn${$?" chat-attach-btn-on":""}`,"aria-label":"Strict model pin: use this model only","aria-pressed":$,disabled:d,title:$?`This chat runs on ${T.provider}/${T.model} only. If it is unavailable the turn STOPS and says which model did not answer, instead of substituting another one.`:`Fallback allowed: auto routing may substitute another model if ${T.provider}/${T.model} is unavailable. Turn the lock on to work with this model only.`,onClick:()=>I(A=>!A),children:$?"🔒 pinned only":"🔓 fallback allowed"}):null,i.jsx("button",{type:"button",className:`chat-attach-btn${E==="max"?" chat-attach-btn-on":""}`,"aria-label":"Capability mode: balanced or max","aria-pressed":E==="max",disabled:d,title:E==="max"?"Max capability: every turn routes to a strong model (a reasoning floor — not merely “paid”), cost ceilings are lifted, paid models are always allowed, and the loop gets its longest reasoning budget. Click to return to balanced.":"Balanced (default): the best model for complex/critical work and cheaper models for simple work, escalating when a stall is detected. Click for max capability — cost is not a concern.",onClick:()=>void kd(),children:E==="max"?"⚡ max":"⚖️ balanced"}),_?i.jsx("span",{className:"admin-hint",children:_}):null]}),i.jsxs("div",{className:"chat-input-row",children:[i.jsx("textarea",{className:"chat-input-box",value:c,onChange:A=>u(A.target.value),onPaste:Lm,onKeyDown:A=>{A.key==="Enter"&&!A.shiftKey?(A.preventDefault(),ln(c)):A.key==="ArrowUp"&&c===""&&Ft.current&&(A.preventDefault(),u(Ft.current))},placeholder:"Message the agent… (Enter to send · Shift+Enter for a new line · ↑ recalls last · 📎 attach a file or paste a large document)",disabled:d,maxLength:8e3,rows:1,autoFocus:!0}),d?i.jsx("button",{className:"admin-mini-btn chat-cancel-btn",type:"button",onClick:wd,children:"⏹ Cancel"}):null,i.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:d||!c.trim()&&_r.length===0,children:d?"⏳ Working…":"➤ Send"})]})]}),i.jsxs("p",{className:"admin-hint",children:["Each message runs the full agent loop in the dashboard process (same engine as"," ",i.jsx("code",{children:'nuvira chat "<prompt>"'}),") — the provider API keys must be configured in the dashboard process. Clarifications (",i.jsx("code",{children:"ask_user"}),") appear as a question card here — choose an answer or skip (best judgment)."]})]})]})]}):i.jsx("div",{className:"admin-login-hint",children:i.jsx("p",{children:"Your role can view the dashboard but not chat (requires admin or operator)."})}):i.jsxs("div",{className:"admin-login-hint",children:[i.jsx("p",{children:"Log in (admin or operator) to chat with the agent. Configure the dashboard admin credential first if this is a fresh setup."}),(t==null?void 0:t.configured)===!1?i.jsxs("p",{className:"admin-hint",children:["Run ",i.jsx("code",{children:"nuvira dashboard"})," once, or set ",i.jsx("code",{children:"NUVIRA_DASHBOARD_ADMIN_USER"})," / ",i.jsx("code",{children:"NUVIRA_DASHBOARD_ADMIN_PASSWORD"}),"."]}):null]})]})}const vbe={running:"⏳ running",done:"✅ done",failed:"❌ failed",cancelled:"⏹ cancelled",timeout:"⏰ timed out",error:"💥 error",hung:"🚫 stopped (hung)"},ybe=0;function j$({presets:e,customPlaceholder:t,timeoutMs:n=ybe,hint:r}){const[a,s]=b.useState(null),o=qr(),[l,c]=b.useState(!1),[u,d]=b.useState(""),[f,h]=b.useState(""),[p,m]=b.useState(null),[g,y]=b.useState([]),[v,k]=b.useState(0),w=b.useRef(null),j=b.useRef(null),S=b.useRef(Date.now());b.useEffect(()=>{K.fetchAdminAuthStatus().then(P=>{s(P?{authenticated:P.authenticated,role:P.role??null}:{authenticated:!1,role:null})})},[o]),b.useEffect(()=>{var P,_;try{(_=(P=w.current)==null?void 0:P.scrollIntoView)==null||_.call(P,{block:"end"})}catch{}},[g]),b.useEffect(()=>()=>{var P;(P=j.current)==null||P.call(j)},[]);const x=(a==null?void 0:a.authenticated)===!0&&(a.role==="admin"||a.role==="operator"),N=b.useCallback(async(P,_)=>{var $;if(l)return;c(!0),d(""),y([]),S.current=Date.now(),k(0);const R=await K.startTask(P,_??n);if(!R.ok||!R.task){d(R.error||"Could not start the command."),c(!1);return}const T=R.task;m(T);const B=await K.getTask(T.id);B!=null&&B.task&&y(B.task.logs.map(I=>({stream:I.stream,text:I.text}))),($=j.current)==null||$.call(j),j.current=K.subscribeTask(T.id,{onLog:I=>y(D=>[...D,{stream:I.stream,text:I.text}]),onStatus:I=>{m(D=>D&&{...D,status:I}),I!=="running"&&c(!1)}})},[l,n]),E=b.useCallback(async()=>{p&&await K.cancelTask(p.id)},[p]);return b.useEffect(()=>{if(!l)return;const P=setInterval(()=>k(Date.now()-S.current),1e3);return()=>clearInterval(P)},[l]),i.jsxs("div",{className:"ops-console",children:[a!=null&&a.authenticated?x?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"ops-presets",children:e.map(P=>i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void N(P.args,P.timeoutMs),disabled:l,children:P.label},P.label))}),i.jsxs("div",{className:"ops-custom-row",children:[i.jsx("input",{type:"text",value:f,onChange:P=>h(P.target.value),placeholder:t,disabled:l,maxLength:160}),i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void N(f.trim().split(/\s+/)),disabled:l||!f.trim(),children:"Run"})]}),r?i.jsx("p",{className:"admin-hint",children:r}):null]}):i.jsx("div",{className:"admin-login-hint",children:"Your role can view but not run commands (requires admin or operator)."}):i.jsx("div",{className:"admin-login-hint",children:"Log in (admin or operator) to run commands."}),u?i.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:u}):null,p?i.jsxs("div",{className:"ops-console-box",children:[i.jsxs("div",{className:"ops-console-head",children:[i.jsxs("span",{children:[p.command," · ",i.jsx("span",{className:p.status==="running"?"task-status-running":"",children:vbe[p.status]})," · ",i.jsx("span",{className:"task-elapsed",children:p.status==="running"?Gb(v):Gb(p.durationMs??v)})]}),p.status==="running"?i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void E(),children:"⏹ Cancel"}):null]}),i.jsxs("pre",{className:"ops-console",role:"log",children:[g.length>0?g.map((P,_)=>i.jsx("div",{children:P.text},_)):i.jsx("div",{className:"admin-hint",children:"Waiting for output…"}),i.jsx("div",{ref:w})]})]}):null]})}const bbe=[{label:"⚡ Quick smoke",args:["eval","run","--tasks","quick","--format","text"]},{label:"⏱ Medium suite",args:["eval","run","--tasks","medium","--format","text"]},{label:"🐢 Slow suite",args:["eval","run","--tasks","slow","--format","text"]},{label:"🏆 M2B parity",args:["eval","run","--suite","m2b","--format","text"]},{label:"📦 Full suite",args:["eval","run","--suite","full","--format","text"]}];function eC(e){return typeof e!="number"?"—":`${Math.round(e*100)}%`}function xbe(e){return new Date(e).toLocaleString()}function wbe({data:e}){var n;const t=((n=e==null?void 0:e.evals)==null?void 0:n.runs)??[];return i.jsxs("div",{className:"panel",children:[i.jsx(Oe,{icon:"🏆",title:"Evals — run nuvira eval from the GUI"}),i.jsx(j$,{presets:bbe,customPlaceholder:"e.g. eval run --tasks my-task --provider groq --model llama",timeoutMs:9e5,hint:i.jsxs(i.Fragment,{children:["Runs the real ",i.jsx("code",{children:"nuvira eval run"})," as an isolated process — same engine, same ledger, same results as the CLI. Long suites can take minutes; you can cancel mid-run."]})}),i.jsx("h2",{className:"section-subtitle",children:"📜 Past runs (auto-refreshes)"}),t.length>0?i.jsx("div",{className:"admin-table-wrapper",children:i.jsxs("table",{className:"admin-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Started"}),i.jsx("th",{children:"Provider"}),i.jsx("th",{children:"Model"}),i.jsx("th",{children:"Tasks"}),i.jsx("th",{children:"Pass"}),i.jsx("th",{children:"Completion"}),i.jsx("th",{children:"Composite"}),i.jsx("th",{children:"Cost"})]})}),i.jsx("tbody",{children:t.map(r=>i.jsxs("tr",{children:[i.jsx("td",{children:xbe(r.startedAt)}),i.jsx("td",{className:"admin-provider-type",children:r.provider}),i.jsx("td",{children:r.model}),i.jsx("td",{children:r.summary.totalTasks}),i.jsxs("td",{children:[r.summary.tasksPassed,"/",r.summary.totalTasks]}),i.jsx("td",{children:eC(r.summary.completionRate)}),i.jsx("td",{children:eC(r.summary.avgCompositeScore)}),i.jsxs("td",{children:["$",(r.summary.totalCostUsd??0).toFixed(4)]})]},r.id))})]})}):i.jsx("div",{className:"empty-state",children:"No eval runs yet — start one above (or `nuvira eval run` from the CLI)."})]})}const kbe=[{label:"🌐 Gateway status",args:["gateway","status"]},{label:"📮 Delivery ledger",args:["gateway","delivery"]},{label:"▶️ Start gateway (foreground)",args:["gateway","start","--no-events"],timeoutMs:0},{label:"⏰ Cron jobs",args:["admin","cron","list"]}];function Sbe(){return i.jsxs("div",{className:"panel",children:[i.jsx(Oe,{icon:"🌐",title:"Gateway ops — run nuvira gateway from the GUI"}),i.jsx(j$,{presets:kbe,customPlaceholder:"e.g. admin cron run nightly or gateway alias add ops email:team@example.com",timeoutMs:0,hint:i.jsxs(i.Fragment,{children:["Each command runs as the real CLI in an isolated process (the P1 task runner) — the same engine as your terminal — and runs ",i.jsx("strong",{children:"until it finishes or you press Cancel"})," (no 5-minute cutoff). The elapsed time is shown beside the status, and work continues after you switch tabs (the process lives on the dashboard server, not the page). The delivery ledger also has its own view in"," ",i.jsx("strong",{children:"Agent Hub → Channels"}),"."]})})]})}const vv={telegram:{icon:"✈️",category:"Chat",steps:["Open Telegram and search for @BotFather","Send /newbot and follow the prompts",'Give your bot a name (e.g. "My Agent Bot")','Give your bot a username ending in "bot"',"BotFather gives you a token — paste it in Step 2","Open your bot in Telegram and send /start"],testTarget:"telegram:"},discord:{icon:"🎮",category:"Chat",steps:["Go to discord.com/developers/applications",'Click "New Application" and give it a name','Go to Bot tab and click "Add Bot"',"Copy the bot token",'Enable "Message Content Intent"',"Invite bot to your server (OAuth2 URL generator)"],testTarget:"discord:"},slack:{icon:"💬",category:"Chat",steps:["Go to api.slack.com/apps","Create New App from scratch","Add Bot Token Scopes: chat:write, im:read, im:write","Install to workspace","Copy the Bot User OAuth Token (xoxb-...)"],testTarget:"slack:"},whatsapp:{icon:"📱",category:"Chat",steps:["Run: nuvira whatsapp pair (or from Gateway tab)","Scan the QR code with WhatsApp","Pairing completes automatically"],testTarget:""},whatsapp_cloud:{icon:"☁️",category:"Chat",steps:["Go to developers.facebook.com","Set up WhatsApp Cloud API","Copy token + Phone ID"],testTarget:"whatsapp_cloud:"},email:{icon:"📧",category:"Chat",steps:["Get SMTP credentials (Gmail, SendGrid, etc.)","For Gmail: use App Password at smtp.gmail.com:587","Paste SMTP host + user below"],testTarget:""},signal:{icon:"🔒",category:"Chat",steps:["Run signal-cli-rest-api Docker container","Register a Signal account","Paste account number below"],testTarget:""},dingtalk:{icon:"🔔",category:"Webhooks",steps:["Open DingTalk and create a group","Add custom robot and copy webhook URL","Paste URL below"],testTarget:""},feishu:{icon:"🐦",category:"Webhooks",steps:["Open Feishu and create a bot","Copy webhook URL and paste below"],testTarget:""},wecom:{icon:"🏢",category:"Webhooks",steps:["Open WeCom and create a group bot","Copy webhook URL and paste below"],testTarget:""},mattermost:{icon:"📋",category:"Webhooks",steps:["Open Mattermost, go to Integrations","Create incoming webhook and copy URL"],testTarget:""},matrix:{icon:"🔗",category:"Chat",steps:["Get your Matrix homeserver URL","Create a bot user and get access token","Paste URL + token below"],testTarget:""},webhook:{icon:"🪝",category:"Webhooks",steps:["Enter your webhook URL","The agent sends outbound webhooks to this URL"],testTarget:""},bluebubbles:{icon:"💙",category:"Chat",steps:["Set up BlueBubbles server","Copy server URL + password"],testTarget:""},ntfy:{icon:"📢",category:"Notifications",steps:["Choose an ntfy topic (or use ntfy.sh)","Paste the topic below"],testTarget:""},teams:{icon:"👥",category:"Webhooks",steps:["Open Microsoft Teams, go to channel","Connectors, Incoming Webhook, create","Copy webhook URL"],testTarget:""},google_chat:{icon:"💬",category:"Webhooks",steps:["Open Google Chat, space settings","Create webhook and copy URL"],testTarget:""},weixin:{icon:"🔴",category:"Chat",steps:["Get Weixin iLink bot token","Paste token below"],testTarget:""},sms:{icon:"📲",category:"Chat",steps:["Get Twilio account SID + auth token","Register a phone number","Paste credentials below"],testTarget:""},irc:{icon:"💻",category:"Chat",steps:["Choose an IRC server (e.g. irc.libera.chat)","Set nickname + channel and paste below"],testTarget:""},simplex:{icon:"📨",category:"Chat",steps:["Run local simplex-chat daemon","Paste WebSocket URL (ws://127.0.0.1:5225)"],testTarget:""},homeassistant:{icon:"🏠",category:"IoT",steps:["Open Home Assistant Profile","Create long-lived access token and paste below"],testTarget:""}};function jbe(){const[e,t]=b.useState(null),[n,r]=b.useState("all"),[a,s]=b.useState(null),[o,l]=b.useState(0),[c,u]=b.useState({}),[d,f]=b.useState(!1),[h,p]=b.useState(null),[m,g]=b.useState({status:"idle"}),[y,v]=b.useState(""),[k,w]=b.useState("Hello from agent-nuvira!"),[j,S]=b.useState(!1),[x,N]=b.useState(null),E=b.useRef(!0),P=b.useCallback(async()=>{const M=await K.getPlatformConfigs();E.current&&t(M)},[]);b.useEffect(()=>(P(),()=>{E.current=!1}),[P]);const _=M=>{s(M),l(0),u(Object.fromEntries(M.envVars.map(O=>[O.varName,O.value]))),p(null),g({status:"idle"});const z=vv[M.platform];v((z==null?void 0:z.testTarget)??""),w("Hello from agent-nuvira!"),N(null)},R=async()=>{if(!a)return;g({status:"checking"});const M=await K.verifyPlatformConfig(a.platform,c);M.ok?(g({status:"ok",info:M.info}),p({kind:"ok",text:"Verified! "+(M.info?"Connected as "+M.info+".":"Token is valid.")})):(g({status:"err",error:M.error}),p({kind:"err",text:M.error||"Verification failed."}))},T=async()=>{if(!a)return;f(!0),p(null);const M=await K.setPlatformConfig(a.platform,c);f(!1),M.ok?(p({kind:"ok",text:"Token saved! Verifying..."}),P(),l(2),R()):p({kind:"err",text:M.error||"Save failed."})},B=async()=>{if(!a||!y)return;S(!0),N(null);const M=await K.sendChannelMessage(y,k);S(!1),M.ok?N({kind:"ok",text:"Message sent via "+M.platform+"! Check your "+a.label+" app."}):N({kind:"err",text:M.error||"Send failed. Make sure the gateway is running (Gateway tab)."})};if(e===null)return i.jsx("div",{className:"empty-state",children:"Loading platforms..."});const $=e.filter(M=>M.configured).length,I=e.filter(M=>n==="configured"?M.configured:n==="unconfigured"?!M.configured:!0),D=a?vv[a.platform]:null;function U(M){return o===M?"wizard-step-dot active":"wizard-step-dot"}return i.jsxs("div",{className:"panel",children:[i.jsx(Oe,{icon:"🌐",title:"Platforms — Messaging Gateway Onboarding"}),i.jsxs("div",{className:"platforms-summary",children:[i.jsxs("div",{className:"platforms-summary-stat",children:[i.jsx("span",{className:"platforms-summary-number",children:$}),i.jsx("span",{className:"platforms-summary-label",children:"configured"})]}),i.jsxs("div",{className:"platforms-summary-stat",children:[i.jsx("span",{className:"platforms-summary-number",children:e.length-$}),i.jsx("span",{className:"platforms-summary-label",children:"available"})]}),i.jsx("div",{className:"platforms-summary-filters",children:["all","configured","unconfigured"].map(M=>i.jsx("button",{type:"button",className:n===M?"platforms-filter-btn active":"platforms-filter-btn",onClick:()=>r(M),children:M==="all"?"All":M==="configured"?"Configured":"Not set up"},M))})]}),i.jsx("div",{className:"platforms-grid",children:I.map(M=>{const z=vv[M.platform];return i.jsxs("div",{className:M.configured?"platform-card configured":"platform-card",children:[i.jsxs("div",{className:"platform-card-head",children:[i.jsx("span",{className:"platform-card-icon",children:(z==null?void 0:z.icon)??"🔌"}),i.jsxs("div",{className:"platform-card-info",children:[i.jsx("span",{className:"platform-card-name",children:M.label}),i.jsx("span",{className:"platform-card-category",children:(z==null?void 0:z.category)??"Platform"})]}),i.jsx("span",{className:M.configured?"status-dot connected":"status-dot reconnecting"})]}),i.jsx("div",{className:"platform-card-vars",children:M.envVars.map(O=>i.jsxs("span",{className:O.set?"platform-var-chip set":"platform-var-chip",children:[O.varName," ",O.set?"done":"--"]},O.varName))}),i.jsxs("div",{className:"platform-card-actions",children:[M.configured?i.jsx("span",{className:"platform-card-badge",children:"Active"}):i.jsx("button",{type:"button",className:"wizard-start-btn",onClick:()=>_(M),children:"Setup"}),M.setupUrl?i.jsx("a",{href:M.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"Docs"}):null]}),!M.configured&&M.setupHint?i.jsx("div",{className:"platform-card-hint",children:M.setupHint}):null]},M.platform)})}),i.jsxs("div",{className:"platforms-cli-hint",children:[i.jsx("span",{className:"admin-hint",children:"Prefer the terminal? "}),i.jsx("code",{children:"nuvira gateway setup telegram"}),i.jsx("span",{className:"admin-hint",children:" — same wizard from your CLI"})]}),a&&D?i.jsx("div",{className:"wizard-overlay",onClick:()=>s(null),children:i.jsxs("div",{className:"wizard-modal",onClick:M=>M.stopPropagation(),children:[i.jsxs("div",{className:"wizard-header",children:[i.jsx("span",{className:"wizard-icon",children:D.icon}),i.jsxs("span",{className:"wizard-title",children:["Getting Started: ",a.label]}),i.jsxs("div",{className:"wizard-steps-indicator",children:[i.jsx("span",{className:U(0),children:"1"}),i.jsx("span",{className:U(1),children:"2"}),i.jsx("span",{className:U(2),children:"3"})]}),i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>s(null),children:"X"})]}),i.jsxs("div",{className:"wizard-body",children:[o===0&&i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"wizard-section-title",children:["Step 1: Create your bot on ",a.label]}),i.jsx("ol",{className:"wizard-steps",children:D.steps.map((M,z)=>i.jsx("li",{children:M},z))}),i.jsxs("div",{className:"wizard-nav",children:[i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>l(1),children:"I have my token — Step 2"}),a.setupUrl?i.jsx("a",{href:a.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"Open docs"}):null]})]}),o===1&&i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"wizard-section-title",children:"Step 2: Paste your token"}),a.envVars.map(M=>i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:M.prompt}),i.jsx("input",{type:M.secret?"password":"text",value:c[M.varName]??"",onChange:z=>u(O=>({...O,[M.varName]:z.target.value})),placeholder:M.secret?"paste your token here":"value",autoComplete:"off",spellCheck:!1,autoFocus:!0})]},M.varName)),h?i.jsx("div",{className:h.kind==="ok"?"admin-row-msg":"admin-row-msg admin-row-msg-err",children:h.text}):null,i.jsxs("div",{className:"wizard-nav",children:[i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>l(0),children:"Back"}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void T(),disabled:d,children:d?"Saving...":"Save & Verify"})]})]}),o===2&&i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"wizard-section-title",children:"Step 3: Verify and test"}),m.status==="checking"&&i.jsx("div",{className:"wizard-verify-status",children:"Verifying token..."}),m.status==="ok"&&i.jsxs("div",{className:"wizard-verify-status ok",children:["Connected as ",m.info]}),m.status==="err"&&i.jsx("div",{className:"wizard-verify-status err",children:m.error}),m.status==="idle"&&(h==null?void 0:h.kind)==="ok"&&i.jsx("div",{className:"wizard-verify-status ok",children:h.text}),y&&i.jsxs("div",{className:"wizard-test-section",children:[i.jsx("p",{className:"wizard-section-title",children:"Send a test message:"}),i.jsx("div",{className:"wizard-test-row",children:i.jsx("input",{className:"wizard-test-input",value:y,onChange:M=>v(M.target.value),placeholder:"telegram:YOUR_CHAT_ID"})}),i.jsxs("div",{className:"wizard-test-row",children:[i.jsx("input",{className:"wizard-test-input",value:k,onChange:M=>w(M.target.value),placeholder:"Hello from agent-nuvira!"}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void B(),disabled:j||!y,children:j?"Sending...":"Send test"})]}),x?i.jsx("div",{className:x.kind==="ok"?"admin-row-msg":"admin-row-msg admin-row-msg-err",children:x.text}):null]}),i.jsxs("div",{className:"wizard-nav",children:[i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>l(1),children:"Edit token"}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>s(null),children:"Done"})]}),!y&&i.jsxs("p",{className:"wizard-hint",children:["Token saved! Start the gateway from the Gateway tab, then send a message from your ",a.label," app."]})]})]})]})}):null]})}const Nbe=[{value:"us-east-1",label:"us-east-1 (N. Virginia) — most models"},{value:"us-west-2",label:"us-west-2 (Oregon) — most models"},{value:"eu-west-1",label:"eu-west-1 (Ireland) — EU coverage"},{value:"ap-southeast-1",label:"ap-southeast-1 (Singapore)"},{value:"ap-northeast-1",label:"ap-northeast-1 (Tokyo)"}],tC=[{name:"Anthropic Claude",models:["claude-haiku-4.5","claude-sonnet-4.6","claude-fable-5","claude-opus-4.6"],checked:!0},{name:"Meta Llama",models:["llama3-1-8b","llama3-1-70b","llama3-3-70b","llama4-scout","llama4-maverick"],checked:!0},{name:"Mistral AI",models:["mistral-large-3","devstral-2","ministral-3"],checked:!1},{name:"DeepSeek",models:["deepseek-v3.2","deepseek-r1"],checked:!1},{name:"Amazon Nova",models:["nova-pro","nova-lite"],checked:!1},{name:"OpenAI on Bedrock",models:["gpt-5.6-terra","gpt-oss-120b"],checked:!1},{name:"Qwen",models:["qwen3-coder-next","qwen3-32b"],checked:!1},{name:"Google Gemma",models:["gemma-3-12b"],checked:!1},{name:"xAI",models:["grok-4.6"],checked:!1}];function Ebe({canWrite:e,sessionExpired:t}){const[n,r]=b.useState(null),[a,s]=b.useState(null),[o,l]=b.useState(!1),[c,u]=b.useState("overview"),d=b.useRef(!0),[f,h]=b.useState("bearer"),[p,m]=b.useState(""),[g,y]=b.useState(""),[v,k]=b.useState(""),[w,j]=b.useState("us-east-1"),[S,x]=b.useState(tC.filter($=>$.checked).map($=>$.name)),[N,E]=b.useState(!1),[P,_]=b.useState(null),R=b.useCallback(async()=>{const $=await K.getBedrockStatus();d.current&&r($)},[]);b.useEffect(()=>(R(),()=>{d.current=!1}),[R]);const T=async()=>{l(!0),s(null);try{const $=await K.probeBedrock((n==null?void 0:n.region)||"us-east-1");if(!d.current)return;$.ok&&$.models&&(s($.models),u("test"))}catch{}finally{d.current&&l(!1)}},B=async()=>{E(!0),_(null);try{const $={BEDROCK_REGION:w};f==="bearer"&&p?$.AWS_BEARER_TOKEN=p:f==="iam"&&(g&&($.AWS_ACCESS_KEY_ID=g),v&&($.AWS_SECRET_ACCESS_KEY=v));const I=await K.setupBedrock($);if(!d.current)return;I.ok?(_({kind:"ok",text:"✅ Configuration saved! Running connectivity test…"}),u("overview"),await R(),setTimeout(()=>void T(),500)):_({kind:"err",text:I.error||"Save failed"})}catch{d.current&&_({kind:"err",text:"Could not reach the dashboard server."})}finally{d.current&&E(!1)}};return n===null?i.jsx("div",{className:"empty-state",children:"Loading Bedrock status…"}):i.jsxs("div",{className:"bedrock-onboarding",children:[i.jsx(Oe,{icon:"🟠",title:"AWS Bedrock"}),i.jsxs("p",{className:"admin-subtitle",children:["Bedrock gives you access to Claude, Llama, Mistral, DeepSeek, and more — all through a single AWS account. Unlike other providers, Bedrock requires a ",i.jsx("strong",{children:"region"}),", ",i.jsx("strong",{children:"AWS credentials"}),", and explicit ",i.jsx("strong",{children:"model access approval"}),"."]}),P?i.jsx("div",{className:`admin-row-msg${P.kind==="ok"?"":" admin-row-msg-err"}`,children:P.text}):null,i.jsxs("div",{className:"bedrock-status-bar",children:[i.jsxs("div",{className:"bedrock-status-item",children:[i.jsx("span",{className:`status-dot ${n.configured?"connected":"reconnecting"}`}),i.jsx("span",{children:n.configured?"Configured":"Not configured"})]}),i.jsxs("div",{className:"bedrock-status-item",children:[i.jsx("span",{className:"bedrock-status-label",children:"Region:"}),i.jsx("code",{children:n.region})]}),i.jsxs("div",{className:"bedrock-status-item",children:[i.jsx("span",{className:"bedrock-status-label",children:"Auth:"}),i.jsx("code",{children:n.authMethod==="bearer"?"API Key":n.authMethod==="iam"?"IAM":"None"})]}),i.jsxs("div",{className:"bedrock-status-actions",children:[e?i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>u(c==="setup"?"overview":"setup"),children:c==="setup"?"✕ Cancel":"⚙ Setup Wizard"}):null,n.configured?i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void T(),disabled:o,children:o?"⏳ Probing…":"🔍 Test Models"}):null]})]}),c==="setup"&&i.jsxs("div",{className:"bedrock-setup-wizard",children:[i.jsx("h2",{className:"section-subtitle",children:"🚀 Bedrock Setup Wizard"}),i.jsxs("div",{className:"bedrock-wizard-step",children:[i.jsx("h4",{children:"Step 1: Authentication"}),i.jsxs("div",{className:"bedrock-auth-options",children:[i.jsxs("label",{className:`bedrock-auth-option ${f==="bearer"?"selected":""}`,children:[i.jsx("input",{type:"radio",name:"authMethod",checked:f==="bearer",onChange:()=>h("bearer")}),i.jsxs("div",{children:[i.jsx("strong",{children:"Bedrock API Key"}),i.jsx("span",{children:"Simpler — get from Bedrock → Settings → API keys"})]})]}),i.jsxs("label",{className:`bedrock-auth-option ${f==="iam"?"selected":""}`,children:[i.jsx("input",{type:"radio",name:"authMethod",checked:f==="iam",onChange:()=>h("iam")}),i.jsxs("div",{children:[i.jsx("strong",{children:"IAM Credentials"}),i.jsx("span",{children:"Full AWS SDK auth — AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY"})]})]})]}),f==="bearer"?i.jsxs("div",{className:"bedrock-wizard-fields",children:[i.jsxs("div",{className:"bedrock-setup-hint",children:[i.jsx("strong",{children:"How to get a Bedrock API key:"}),i.jsxs("ol",{children:[i.jsxs("li",{children:["Open ",i.jsx("a",{href:"https://console.aws.amazon.com/bedrock/",target:"_blank",rel:"noopener noreferrer",children:"AWS Bedrock Console"})]}),i.jsxs("li",{children:["Go to ",i.jsx("strong",{children:"Settings"})," → ",i.jsx("strong",{children:"API keys"})]}),i.jsx("li",{children:"Create a new key and paste it below"})]})]}),i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:"Bedrock API Key (Bearer token)"}),i.jsx("input",{type:"password",value:p,onChange:$=>m($.target.value),placeholder:"••••••••••••",autoComplete:"off",spellCheck:!1})]})]}):i.jsxs("div",{className:"bedrock-wizard-fields",children:[i.jsxs("div",{className:"bedrock-setup-hint",children:[i.jsx("strong",{children:"IAM credentials"})," give full AWS SDK access. Create an IAM user with Bedrock permissions."]}),i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:"AWS_ACCESS_KEY_ID"}),i.jsx("input",{type:"text",value:g,onChange:$=>y($.target.value),placeholder:"AKIA...",autoComplete:"off",spellCheck:!1})]}),i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:"AWS_SECRET_ACCESS_KEY"}),i.jsx("input",{type:"password",value:v,onChange:$=>k($.target.value),placeholder:"••••••••••••",autoComplete:"off",spellCheck:!1})]})]})]}),i.jsxs("div",{className:"bedrock-wizard-step",children:[i.jsx("h4",{children:"Step 2: AWS Region"}),i.jsxs("p",{className:"admin-hint",children:["Models vary by region. ",i.jsx("strong",{children:"us-east-1"})," and ",i.jsx("strong",{children:"us-west-2"})," have the most models. ⚠️ Do NOT use eu-north-1 unless models are explicitly enabled there."]}),i.jsx("select",{className:"bedrock-region-select",value:w,onChange:$=>j($.target.value),children:Nbe.map($=>i.jsx("option",{value:$.value,children:$.label},$.value))})]}),i.jsxs("div",{className:"bedrock-wizard-step",children:[i.jsx("h4",{children:"Step 3: Model Access"}),i.jsx("p",{className:"admin-hint",children:"Bedrock requires you to request access for each model family."}),i.jsx("div",{className:"bedrock-model-access-hint",children:i.jsx("a",{href:`https://console.aws.amazon.com/bedrock/home?region=${w}#/modelaccess`,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn",children:"📖 Open Model Access in AWS Console"})}),i.jsx("div",{className:"bedrock-family-grid",children:tC.map($=>i.jsxs("label",{className:`bedrock-family-card ${S.includes($.name)?"selected":""}`,children:[i.jsx("input",{type:"checkbox",checked:S.includes($.name),onChange:I=>{I.target.checked?x(D=>[...D,$.name]):x(D=>D.filter(U=>U!==$.name))}}),i.jsxs("div",{children:[i.jsx("strong",{children:$.name}),i.jsxs("span",{children:[$.models.length," model(s)"]})]})]},$.name))}),i.jsx("p",{className:"admin-hint",style:{marginTop:8},children:"In the AWS Console, select the families above and submit. Approval is usually instant for Anthropic and Meta models."})]}),i.jsxs("div",{className:"bedrock-wizard-actions",children:[i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void B(),disabled:N||f==="bearer"&&!p||f==="iam"&&(!g||!v),children:N?"⏳ Saving…":"💾 Save & Test"}),i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>u("overview"),children:"Cancel"})]})]}),c==="test"&&a&&i.jsxs("div",{className:"bedrock-probe-results",children:[i.jsxs("h2",{className:"section-subtitle",children:["🔍 Model Probe Results (",n.region,")"]}),i.jsx("div",{className:"bedrock-probe-grid",children:a.map($=>i.jsxs("div",{className:`bedrock-probe-card bedrock-probe-${$.status}`,children:[i.jsx("span",{className:"bedrock-probe-icon",children:$.status==="accessible"?"✅":$.status==="permission-denied"?"🔒":$.status==="not-found"?"⚫":"❌"}),i.jsx("span",{className:"bedrock-probe-id",children:$.modelId}),i.jsx("span",{className:"bedrock-probe-status",children:$.status==="accessible"?"Ready":$.status==="permission-denied"?`Need access (HTTP ${$.httpStatus})`:$.status==="not-found"?"Not in this region":"Error"})]},$.modelId))}),a.some($=>$.status==="permission-denied")&&i.jsxs("div",{className:"bedrock-probe-action",children:[i.jsxs("p",{children:["Some models exist in ",n.region," but access is not approved."]}),i.jsx("a",{href:`https://console.aws.amazon.com/bedrock/home?region=${n.region}#/modelaccess`,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn",children:"🔓 Request Model Access in AWS Console →"})]}),i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>u("overview"),style:{marginTop:12},children:"← Back"})]}),!n.configured&&c==="overview"&&i.jsxs("div",{className:"bedrock-getting-started",children:[i.jsx("h2",{className:"section-subtitle",children:"📋 Getting Started with Bedrock"}),i.jsxs("div",{className:"bedrock-steps",children:[i.jsxs("div",{className:"bedrock-step",children:[i.jsx("span",{className:"bedrock-step-num",children:"1"}),i.jsxs("div",{children:[i.jsx("strong",{children:"Create an AWS account"})," (or use existing)",i.jsxs("span",{children:["New to AWS? Sign up at ",i.jsx("a",{href:"https://aws.amazon.com/",target:"_blank",rel:"noopener noreferrer",children:"aws.amazon.com"})]})]})]}),i.jsxs("div",{className:"bedrock-step",children:[i.jsx("span",{className:"bedrock-step-num",children:"2"}),i.jsxs("div",{children:[i.jsx("strong",{children:"Get Bedrock API key"}),i.jsx("span",{children:"Bedrock → Settings → API keys → Create key"})]})]}),i.jsxs("div",{className:"bedrock-step",children:[i.jsx("span",{className:"bedrock-step-num",children:"3"}),i.jsxs("div",{children:[i.jsx("strong",{children:"Request model access"}),i.jsx("span",{children:"Bedrock → Model access → Select Claude, Llama, etc. → Submit"})]})]}),i.jsxs("div",{className:"bedrock-step",children:[i.jsx("span",{className:"bedrock-step-num",children:"4"}),i.jsxs("div",{children:[i.jsx("strong",{children:"Configure in this wizard"}),i.jsx("span",{children:'Click "Setup Wizard" above to enter your credentials'})]})]})]})]}),n.configured&&c==="overview"&&!a&&i.jsx("div",{className:"bedrock-quick-status",children:i.jsxs("p",{className:"admin-hint",children:["Bedrock is configured. Click ",i.jsx("strong",{children:"🔍 Test Models"})," to verify connectivity and discover which models are accessible in ",n.region,"."]})})]})}const yv=["whatsapp","whatsapp_cloud","telegram","signal","slack","discord","email"];function _be(){const[e,t]=b.useState([]),[n,r]=b.useState(!0),[a,s]=b.useState("all"),[o,l]=b.useState(null),[c,u]=b.useState(""),[d,f]=b.useState(""),[h,p]=b.useState(null),[m,g]=b.useState({}),[y,v]=b.useState({}),[k,w]=b.useState({}),[j,S]=b.useState(null),[x,N]=b.useState(!1),[E,P]=b.useState(!1),[_,R]=b.useState(!1),[T,B]=b.useState(12e4),$=b.useCallback(async()=>{r(!0);const ee=await K.getContacts();ee.ok&&ee.contacts&&t(ee.contacts);const Q=await K.gatewayPolicies();if(Q.ok&&Q.policies){const ae={};for(const ce of yv){const G=Q.policies[ce];G&&(ae[ce]={...G.outboundSenders!==void 0?{outboundSenders:G.outboundSenders}:{},...G.requireApprovedTarget!==void 0?{requireApprovedTarget:G.requireApprovedTarget}:{}})}g(ae),v(ae)}P(Q.askUserWait===!0),R(Q.askUserWait===!0),typeof Q.askUserTimeoutMs=="number"&&B(Q.askUserTimeoutMs),r(!1)},[]);b.useEffect(()=>{$()},[$]);const I=e.filter(ee=>a==="all"||ee.status===a),D=async ee=>{p(null);const Q=await K.approveContact(ee.platform,ee.name);p(Q.ok?{kind:"ok",text:`✅ ${ee.name} approved.`}:{kind:"err",text:Q.error||"Failed."}),$()},U=async ee=>{p(null);const Q=await K.rejectContact(ee.platform,ee.name);p(Q.ok?{kind:"ok",text:`🚫 ${ee.name} rejected.`}:{kind:"err",text:Q.error||"Failed."}),$()},M=async ee=>{p(null);const Q=await K.deleteContact(ee.platform,ee.name);p(Q.ok?{kind:"ok",text:`🗑️ ${ee.name} deleted.`}:{kind:"err",text:Q.error||"Failed."}),$()},z=async()=>{if(!o)return;p(null);const ee=await K.updateContact(o.platform,o.id,{name:c,phone:d});p(ee.ok?{kind:"ok",text:`✅ ${c} updated.`}:{kind:"err",text:ee.error||"Failed."}),l(null),$()},O=ee=>ee==="approved"?i.jsx("span",{className:"contact-status-badge approved",children:"✅ Approved"}):ee==="pending"?i.jsx("span",{className:"contact-status-badge pending",children:"⏳ Pending"}):i.jsx("span",{className:"contact-status-badge rejected",children:"🚫 Rejected"}),J=ee=>({telegram:"✈️",whatsapp:"📱",whatsapp_cloud:"📱",email:"📧",slack:"💬",discord:"🎮"})[ee]||"🔌",F=ee=>ee?new Date(ee).toLocaleString():"—",L=ee=>{const Q=(k[ee]??"").trim();Q&&(g(ae=>{var xe;const ce={...ae[ee]??{}},G=ce.outboundSenders??((xe=y[ee])==null?void 0:xe.outboundSenders)??[];return G.some(we=>we.toLowerCase()===Q.toLowerCase())||(ce.outboundSenders=[...G,Q]),{...ae,[ee]:ce}}),w(ae=>({...ae,[ee]:""})))},ie=(ee,Q)=>{g(ae=>{var xe;const ce={...ae[ee]??{}},G=ce.outboundSenders??((xe=y[ee])==null?void 0:xe.outboundSenders)??[];return ce.outboundSenders=G.filter(we=>we.toLowerCase()!==Q.toLowerCase()),{...ae,[ee]:ce}})},fe=ee=>{g(Q=>{const ae={...Q[ee]??{}};return ae.requireApprovedTarget=ae.requireApprovedTarget!==!0,{...Q,[ee]:ae}})},ve=ee=>{g(Q=>{const ae={...Q[ee]??{}};return delete ae.outboundSenders,{...Q,[ee]:ae}})},Ee=async()=>{N(!0),S(null);const ee={};for(const ce of yv){const G=m[ce]??{},xe=y[ce]??{};(JSON.stringify(G.outboundSenders??null)!==JSON.stringify(xe.outboundSenders??null)||!!G.requireApprovedTarget!=!!xe.requireApprovedTarget)&&(ee[ce]={...G.outboundSenders!==void 0?{outboundSenders:G.outboundSenders}:{outboundSenders:null},requireApprovedTarget:!!G.requireApprovedTarget})}const Q=E!==_;if(Object.keys(ee).length===0&&!Q){N(!1),S({kind:"ok",text:"No changes to save."});return}const ae=await K.saveGatewayPolicies(ee,void 0,void 0,{wait:E,timeoutMs:T});ae.ok?(S({kind:"ok",text:"✅ Send authority saved."}),$()):S({kind:"err",text:ae.error||"Failed to save send authority."}),N(!1)};return i.jsxs("div",{className:"panel contacts-page",children:[i.jsx(Oe,{icon:"📇",title:"Contacts — Outbound Messaging Directory",description:"Manage who the bot can send messages to. Users auto-register on first Telegram message."}),h&&i.jsxs("div",{className:`admin-row-msg ${h.kind==="err"?"admin-row-msg-err":""}`,children:[h.text,i.jsx("button",{className:"admin-mini-btn",onClick:()=>p(null),children:"✕"})]}),i.jsxs("div",{className:"contacts-filters",children:[["all","approved","pending","rejected"].map(ee=>i.jsx("button",{type:"button",className:a===ee?"platforms-filter-btn active":"platforms-filter-btn",onClick:()=>s(ee),children:ee==="all"?`All (${e.length})`:ee==="approved"?`✅ Approved (${e.filter(Q=>Q.status==="approved").length})`:ee==="pending"?`⏳ Pending (${e.filter(Q=>Q.status==="pending").length})`:`🚫 Rejected (${e.filter(Q=>Q.status==="rejected").length})`},ee)),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void $(),children:"🔄 Refresh"})]}),n?i.jsx("div",{className:"empty-state",children:"Loading contacts..."}):I.length===0?i.jsxs("div",{className:"empty-state",children:[i.jsxs("p",{children:["No contacts",a!=="all"?` with status "${a}"`:"","."]}),i.jsx("p",{className:"admin-hint",children:'Contacts auto-register when users message the bot on Telegram. They appear here as "Pending" until you approve them.'})]}):i.jsx("div",{className:"contacts-table-wrapper",children:i.jsxs("table",{className:"contacts-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Platform"}),i.jsx("th",{children:"Name"}),i.jsx("th",{children:"ID"}),i.jsx("th",{children:"Phone"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Registered"}),i.jsx("th",{children:"Actions"})]})}),i.jsx("tbody",{children:I.map(ee=>i.jsxs("tr",{className:`contact-row status-${ee.status}`,children:[i.jsxs("td",{children:[J(ee.platform)," ",ee.platform]}),i.jsx("td",{className:"contact-name",children:ee.name}),i.jsx("td",{className:"contact-id",children:i.jsx("code",{children:ee.id})}),i.jsx("td",{className:"contact-phone",children:ee.phone||"—"}),i.jsx("td",{children:O(ee.status)}),i.jsx("td",{className:"contact-date",children:F(ee.registeredAt||ee.addedAt)}),i.jsxs("td",{className:"contact-actions",children:[ee.status!=="approved"&&i.jsx("button",{className:"admin-mini-btn contact-approve-btn",onClick:()=>void D(ee),children:"✅ Approve"}),ee.status!=="rejected"&&i.jsx("button",{className:"admin-mini-btn contact-reject-btn",onClick:()=>void U(ee),children:"🚫 Reject"}),i.jsx("button",{className:"admin-mini-btn",onClick:()=>{l(ee),u(ee.name),f(ee.phone||"")},children:"✏️ Edit"}),i.jsx("button",{className:"admin-mini-btn contact-delete-btn",onClick:()=>void M(ee),children:"🗑️"})]})]},`${ee.platform}:${ee.id}`))})]})}),i.jsxs("div",{className:"panel-header",style:{marginTop:28},children:[i.jsx("h2",{children:"🔐 Send authority — who may message others"}),i.jsxs("p",{className:"admin-hint",children:["Controls who can ask the agent to send a message to ",i.jsx("strong",{children:"someone else"})," through the gateway (e.g. “send this poem to my brother on WhatsApp”). This is separate from a contact’s approval status above, which only gates sending ",i.jsx("em",{children:"to"})," that person. Left empty, a platform ",i.jsx("strong",{children:"inherits"})," its allowed-users list (open). Add ",i.jsx("code",{children:"Allow-All"})," to allow everyone, or list specific senders to restrict it."]})]}),j&&i.jsxs("div",{className:`admin-row-msg ${j.kind==="err"?"admin-row-msg-err":""}`,children:[j.text,i.jsx("button",{className:"admin-mini-btn",onClick:()=>S(null),children:"✕"})]}),i.jsx("div",{className:"hub-permissions",children:yv.map(ee=>{const Q=m[ee]??{},ae=Q.outboundSenders??[],ce=Q.outboundSenders===void 0;return i.jsxs("div",{className:"hub-card",children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsxs("span",{className:"hub-chip",children:[J(ee)," ",ee]}),ce?i.jsx("span",{className:"hub-chip",children:"open"}):i.jsx("span",{className:"hub-chip",children:"restricted"})]}),i.jsx("div",{className:"hub-alias-list",children:ce?i.jsx("span",{className:"admin-hint",children:"Open — anyone who can trigger the agent may send to others."}):ae.length===0?i.jsx("span",{className:"admin-hint",children:"(empty — nobody may send to others)"}):ae.map(G=>i.jsxs("div",{className:"hub-alias-row",children:[i.jsx("span",{className:"hub-chip",children:G}),i.jsx("button",{className:"admin-refresh-btn",disabled:x,onClick:()=>ie(ee,G),children:"✕"})]},`sa-${ee}-${G}`))}),i.jsxs("div",{className:"hub-send-form",children:[i.jsx("input",{type:"text","aria-label":`Allowed sender for ${ee}`,value:k[ee]??"",onChange:G=>w(xe=>({...xe,[ee]:G.target.value})),placeholder:"sender id, or Allow-All",disabled:x}),i.jsx("button",{className:"admin-refresh-btn",disabled:x||!(k[ee]??"").trim(),onClick:()=>L(ee),children:"+ Sender"}),ce?null:i.jsx("button",{className:"admin-refresh-btn",disabled:x,onClick:()=>ve(ee),children:"↺ Reset to open"})]}),i.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginTop:6},children:[i.jsx("input",{type:"checkbox",checked:!!Q.requireApprovedTarget,disabled:x,onChange:()=>fe(ee)}),i.jsx("span",{className:"admin-hint",children:"Require approved recipients"})]})]},`sa-${ee}`)})}),i.jsxs("div",{className:"hub-card",style:{marginTop:16},children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsx("span",{className:"hub-chip",children:"🧠 Clarifying questions"}),E?i.jsx("span",{className:"hub-chip",children:"wait for reply"}):i.jsx("span",{className:"hub-chip",children:"assume option 1"}),E!==_?i.jsx("span",{className:"hub-chip",children:"· unsaved"}):null]}),i.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginTop:6},children:[i.jsx("input",{type:"checkbox",checked:E,disabled:x,onChange:()=>P(ee=>!ee)}),i.jsxs("span",{className:"admin-hint",children:["When the agent asks a question on a channel, ",i.jsx("strong",{children:"wait for the sender's reply"})," before acting. Off (default): the question is sent and the ",i.jsx("em",{children:"first"})," option is assumed immediately — so a reply typed afterwards arrives too late to change anything."]})]}),E?i.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginTop:6},children:[i.jsx("span",{className:"admin-hint",children:"Reply window (seconds)"}),i.jsx("input",{type:"number",min:5,max:600,value:Math.round(T/1e3),disabled:x,onChange:ee=>B(Math.max(5,Math.min(600,Number(ee.target.value)||120))*1e3),style:{width:90}}),i.jsx("span",{className:"admin-hint",children:"then the first option is used, and the timeout is logged."})]}):null]}),i.jsx("div",{style:{marginTop:12},children:i.jsx("button",{className:"admin-refresh-btn",disabled:x,onClick:()=>void Ee(),children:"💾 Save send authority"})}),o&&i.jsx("div",{className:"wizard-overlay",onClick:()=>l(null),children:i.jsxs("div",{className:"wizard-modal",onClick:ee=>ee.stopPropagation(),children:[i.jsxs("div",{className:"wizard-header",children:[i.jsx("span",{className:"wizard-icon",children:"✏️"}),i.jsxs("span",{className:"wizard-title",children:["Edit Contact: ",o.name]}),i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>l(null),children:"✕"})]}),i.jsxs("div",{className:"wizard-body",children:[i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:"Name"}),i.jsx("input",{type:"text",value:c,onChange:ee=>u(ee.target.value)})]}),i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:"Phone (optional, for flexible lookup)"}),i.jsx("input",{type:"text",value:d,onChange:ee=>f(ee.target.value),placeholder:"+918800123456"})]}),i.jsxs("p",{className:"admin-hint",children:["Platform: ",i.jsx("strong",{children:o.platform})," | ID: ",i.jsx("code",{children:o.id})]}),i.jsxs("div",{className:"wizard-nav",children:[i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>l(null),children:"Cancel"}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void z(),children:"Save"})]})]})]})})]})}const nC=["proven-dead","proof-expired","parked","never-verified"];function Wo(e){if(e<=0)return"never";const t=Math.floor(e/1e3),n=Math.floor(t/60),r=Math.floor(n/60),a=Math.floor(r/24);return a>30?`${a}d ago`:a>0?`${a}d ${r%24}h ago`:r>0?`${r}h ${n%60}m ago`:n>0?`${n}m ago`:`${t}s ago`}function Cbe(e){if(e<=0)return"never";const t=(Date.now()-e)/(24*60*60*1e3);return t<1?`${(t*24).toFixed(1)}h`:`${t.toFixed(2)}d`}function Abe({entry:e}){const t=Date.now(),n=t-e.lastProbedAt,r=t-e.lastVerifiedAt,a=t-e.lastUsedAt,s=Math.min(100,n/(30*24*60*60*1e3)*100),o=e.lastVerifiedAt>0?Math.min(100,r/(30*24*60*60*1e3)*100):-1,l=e.lastUsedAt>0?Math.min(100,a/(30*24*60*60*1e3)*100):-1;return i.jsxs("div",{className:"timeline-bar-container",children:[i.jsx("div",{className:"timeline-bar",title:`Last probed: ${Wo(n)}`,children:i.jsx("div",{className:"timeline-bar-fill probe",style:{width:`${s}%`}})}),o>=0&&i.jsx("div",{className:"timeline-bar small",title:`Last verified: ${Wo(r)}`,children:i.jsx("div",{className:"timeline-bar-fill verify",style:{width:`${o}%`}})}),l>=0&&i.jsx("div",{className:"timeline-bar small",title:`Last used: ${Wo(a)}`,children:i.jsx("div",{className:"timeline-bar-fill use",style:{width:`${l}%`}})})]})}function rC(e){return{fontSize:11,padding:"2px 8px",borderRadius:4,background:`${e}20`,color:e,border:`1px solid ${e}40`,whiteSpace:"nowrap"}}function Tbe(){const[e,t]=b.useState(null),[n,r]=b.useState(!0),[a,s]=b.useState(null),[o,l]=b.useState("all"),[c,u]=b.useState("provider"),d=b.useRef(!0),f=h0(),h=b.useCallback(async()=>{try{const z=await fetch("/api/model-timeline");if(!z.ok)throw new Error("Failed to fetch timeline data");const O=await z.json();d.current&&(t(O),s(null))}catch(z){d.current&&s(z instanceof Error?z.message:"Failed to load timeline")}finally{d.current&&r(!1)}},[]),[p,m]=b.useState(null),[g,y]=b.useState(10),[v,k]=b.useState(!1),[w,j]=b.useState(null),S=b.useRef(!1),x=b.useCallback(async()=>{const z=await K.fetchVerifyBacklog();if(!d.current)return;m(z);const O=(z==null?void 0:z.status)==="running";S.current&&!O&&h(),S.current=O},[h]);b.useEffect(()=>{d.current=!0,h(),x();const z=setInterval(()=>void h(),3e4);return()=>{d.current=!1,clearInterval(z)}},[h,x]);const N=(p==null?void 0:p.status)==="running";b.useEffect(()=>{if(!N)return;const z=setInterval(()=>void x(),1e3);return()=>clearInterval(z)},[N,x]);const E=b.useCallback(async()=>{k(!0),j(null);const z=await K.startVerifyBacklog(g);if(d.current){if(z.state&&m(z.state),!z.ok){const O=z.refusal??z.error??"Could not start the run.";j({text:O,kind:z.refusal?"info":"error"})}k(!1)}},[g]);if(n)return i.jsxs("div",{className:"admin-header",children:[i.jsx(Oe,{icon:"📅",title:"Model Discovery Timeline"}),i.jsxs("div",{className:"loading-state",children:[i.jsx("div",{className:"loading-spinner"}),i.jsx("p",{children:"Loading timeline..."})]})]});if(a)return i.jsxs("div",{className:"admin-header",children:[i.jsx(Oe,{icon:"📅",title:"Model Discovery Timeline"}),i.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:a})]});if(e&&!e.counts)return i.jsxs("div",{className:"admin-header",children:[i.jsx(Oe,{icon:"📅",title:"Model Discovery Timeline"}),i.jsxs("div",{className:"admin-row-msg admin-row-msg-err",children:["This dashboard server predates the reachability view. Restart it (",i.jsx("code",{children:"nuvira dashboard stop"}),", then start it again) and reload this page."]})]});const P=(e==null?void 0:e.entries)??[],_=e==null?void 0:e.counts,R=e==null?void 0:e.reachabilityCopy,T=e==null?void 0:e.freshnessCopy,B=_?nC.reduce((z,O)=>z+(_[O]??0),0):0,$=[{key:"tracked-models",icon:"🧠",value:tt((e==null?void 0:e.totalModels)??0),label:"Tracked models (registry)",tone:"accent"},{key:"tracked-providers",icon:"🏢",value:tt((f==null?void 0:f.trackedProviders)??0),label:"Tracked providers (registry)",tone:"accent"}];f&&$.push({key:"listed-models",icon:"📡",value:tt(f.listedModels),label:"Listed models (live probe)",tone:"warn"},{key:"listed-providers",icon:"🛰️",value:tt(f.listedProviders),label:"Listed providers (live probe)",tone:"warn"}),$.push({key:"routable",icon:"✅",value:tt((_==null?void 0:_.routable)??0),label:"Routable now",tone:"ok"},{key:"not-routable",icon:"🚫",value:tt(B),label:"Not routable",tone:"danger"});const I=P.filter(z=>o==="routable"?z.reachability==="routable":o==="not-routable"?z.reachability!=="routable":!0),D=[...I].sort((z,O)=>c==="provider"?z.provider.localeCompare(O.provider)||z.model.localeCompare(O.model):O.lastProbedAt-z.lastProbedAt),U=new Map;for(const z of D){const O=U.get(z.provider);O?O.push(z):U.set(z.provider,[z])}const M=z=>({background:z?"var(--accent-green)":"var(--bg-hover)",border:`1px solid ${z?"var(--accent-green)":"var(--border)"}`,padding:"4px 12px",fontSize:12,cursor:"pointer"});return i.jsxs(i.Fragment,{children:[i.jsx(Oe,{icon:"📅",title:"Model Discovery Timeline"}),i.jsxs("p",{className:"section-description",children:["The registry's age profile: when each tracked model was last probed, last ",i.jsx("em",{children:"verified"}),", and last used — and which ones routing can actually reach. The Models page answers “is it usable right now”; this one answers “what is ageing out”."]}),i.jsx(Wi,{tiles:$}),_?i.jsx("div",{style:{display:"flex",gap:14,flexWrap:"wrap",marginBottom:14,fontSize:11},children:nC.map(z=>{const O=R==null?void 0:R[z];return i.jsxs("span",{title:O==null?void 0:O.blurb,children:[i.jsx("span",{style:{color:(O==null?void 0:O.color)??"var(--text-secondary)"},children:"■"})," ",i.jsxs("span",{style:{color:"var(--text-secondary)"},children:[(O==null?void 0:O.label)??z,": ",i.jsx("strong",{style:{color:"var(--text-primary)"},children:_[z]??0})]})]},z)})}):null,p?i.jsxs("div",{style:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8,padding:"12px 14px",marginBottom:16},"data-testid":"verify-backlog-panel",children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[i.jsx("span",{style:{fontWeight:600,color:"var(--text-primary)"},children:"Work the backlog down"}),i.jsxs("span",{style:{fontSize:11,color:"var(--text-secondary)",flex:1,minWidth:260},children:["Each check is a real 1-token generation against one of your provider keys — not a listing lookup. A never-verified model is an ",i.jsx("em",{children:"unknown"}),", not a broken one: a check either proves it routable or marks it proven dead. Runs are bounded and one at a time."]}),i.jsxs("label",{style:{fontSize:11,color:"var(--text-secondary)",display:"flex",alignItems:"center",gap:6},children:["How many",i.jsx("input",{type:"number",min:1,max:p.maxCount??25,value:g,disabled:v||N,"aria-label":"how many models to verify",onChange:z=>y(Number(z.target.value)),style:{width:64,background:"var(--bg-primary)",color:"var(--text-primary)",border:"1px solid var(--border)",borderRadius:4,padding:"3px 6px",fontSize:12}})]}),i.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:v||N||!(g>0),onClick:()=>void E(),style:{background:"var(--accent-green)",border:"1px solid var(--accent-green)",padding:"4px 12px",fontSize:12,cursor:v||N?"default":"pointer"},"data-testid":"verify-backlog-start",children:N?"⏳ Verifying…":v?"Starting…":`▶ Verify next ${g} now`})]}),N?i.jsxs("div",{className:"env-var-notice","data-testid":"verify-backlog-progress",children:["Probing"," ",i.jsx("code",{children:p.current?`${p.current.provider}/${p.current.model}`:"…"})," ","— ",p.processed,"/",p.planned," done · ",p.verified," verified · ",p.unavailable," proven dead"]}):null,!N&&p.status==="done"?i.jsxs("div",{className:"env-var-notice","data-testid":"verify-backlog-summary",children:["✅ ",p.verified," verified · ⛔ ",p.unavailable," proven unavailable · ⚠️ ",p.errored," errored · ⏭"," ",p.skipped," skipped",p.remaining!==null?` — ${p.remaining} still never verified`:""]}):null,(p.results??[]).length>0?i.jsx("div",{style:{display:"flex",gap:10,flexWrap:"wrap",marginTop:8},children:(p.results??[]).map(z=>i.jsxs("span",{style:{fontSize:11,color:"var(--text-secondary)"},title:z.outcome==="verified"?"Proven routable — a 1-token call succeeded":z.outcome==="unavailable"?"Proven dead — the provider refused it (403/404), re-probing will not help":z.outcome==="skipped"?"Skipped — verified recently enough":"Errored — transient, still unknown, will be retried next run",children:[z.outcome==="verified"?"✅":z.outcome==="unavailable"?"⛔":z.outcome==="skipped"?"⏭":"⚠️"," ",i.jsxs("code",{children:[z.provider,"/",z.model]})]},`${z.provider}:${z.model}`))}):null,w?i.jsx("div",{className:`env-var-notice${w.kind==="error"?" env-var-notice-error":""}`,"data-testid":"verify-backlog-message",children:w.text}):p.status==="idle"&&p.refusal?i.jsx("div",{className:"env-var-notice","data-testid":"verify-backlog-message",children:p.refusal}):null]}):null,i.jsxs("div",{style:{display:"flex",gap:8,marginBottom:16,flexWrap:"wrap"},children:[i.jsx("div",{style:{display:"flex",gap:4},children:["all","routable","not-routable"].map(z=>i.jsx("button",{className:`admin-refresh-btn ${o===z?"active":""}`,onClick:()=>l(z),style:M(o===z),children:z==="all"?"All":z==="routable"?"Routable":"Not routable"},z))}),i.jsx("div",{style:{display:"flex",gap:4},children:["provider","lastProbed"].map(z=>i.jsxs("button",{className:`admin-refresh-btn ${c===z?"active":""}`,onClick:()=>u(z),style:M(c===z),children:["Sort: ",z==="lastProbed"?"Last seen":"Provider"]},z))}),i.jsx("button",{className:"admin-refresh-btn",onClick:()=>void h(),style:{background:"var(--bg-hover)",border:"1px solid var(--border)",padding:"4px 12px",fontSize:12,cursor:"pointer"},children:"🔄 Refresh"})]}),i.jsxs("div",{style:{display:"flex",gap:16,marginBottom:4,fontSize:11,color:"var(--text-secondary)",flexWrap:"wrap"},children:[i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-blue)"},children:"■"})," Probe (last seen in the provider's catalog)"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-green)"},children:"■"})," Verified (last success)"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-yellow)"},children:"■"})," Used (last invocation)"]})]}),i.jsxs("div",{style:{marginBottom:12,fontSize:11,color:"var(--text-secondary)"},children:[i.jsx("strong",{style:{color:"var(--text-primary)"},children:"Fresh"})," means the provider still lists it."," ",i.jsx("strong",{style:{color:"var(--text-primary)"},children:"Routable"})," means a turn has been proven to work on it within"," ",(e==null?void 0:e.freshDays)??7," days. A fresh model that was never verified is an unknown, not a failure — background spot-checks work through those a few at a time."]}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from(U.entries()).map(([z,O])=>{const J=O.filter(F=>F.reachability==="routable").length;return i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:8,border:"1px solid var(--border)",overflow:"hidden"},children:[i.jsxs("div",{style:{padding:"10px 14px",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",gap:8},children:[i.jsx("span",{style:{fontSize:16},children:z==="groq"?"⚡":z==="gemini"?"🌀":z==="local"?"💻":"🤖"}),i.jsx("span",{style:{fontWeight:600,color:"var(--text-primary)"},children:z}),i.jsxs("span",{style:{fontSize:12,color:"var(--text-secondary)"},children:["(",O.length," shown · ",J," routable)"]})]}),i.jsx("div",{style:{padding:"8px 14px"},children:O.map(F=>{const L=Date.now(),ie=R==null?void 0:R[F.reachability],fe=T==null?void 0:T[F.freshness],ve=(ie==null?void 0:ie.color)??"var(--text-secondary)";return i.jsxs("div",{"data-testid":`timeline-row-${F.provider}-${F.model}`,style:{display:"flex",alignItems:"center",gap:12,padding:"6px 0",borderBottom:"1px solid var(--border-light)"},children:[i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsx("div",{style:{fontSize:13,color:"var(--text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F.model}),i.jsxs("div",{style:{fontSize:11,color:"var(--text-secondary)",display:"flex",gap:12,flexWrap:"wrap"},children:[i.jsxs("span",{children:["Probed: ",Wo(L-F.lastProbedAt)]}),i.jsxs("span",{children:["Verified: ",F.lastVerifiedAt>0?Wo(L-F.lastVerifiedAt):"never"]}),F.lastUsedAt>0&&i.jsxs("span",{children:["Used: ",Wo(L-F.lastUsedAt)]}),F.latencyMs!==void 0&&i.jsxs("span",{children:[F.latencyMs,"ms"]}),F.errorRate>0&&i.jsxs("span",{style:{color:F.errorRate>.5?"var(--accent-red)":"var(--accent-yellow)"},children:["err ",(F.errorRate*100).toFixed(0),"%"]}),F.daysSinceVerify!==null&&F.daysSinceVerify>7&&i.jsxs("span",{style:{color:"var(--accent-yellow)"},children:["proof ",Cbe(F.lastVerifiedAt)," old"]})]})]}),i.jsx(Abe,{entry:F}),fe&&i.jsx("span",{style:rC(fe.color),title:fe.blurb,children:fe.label}),i.jsx("span",{style:rC(ve),title:(ie==null?void 0:ie.blurb)??F.reachability,"data-testid":`reachability-${F.provider}-${F.model}`,children:((ie==null?void 0:ie.label)??F.reachability).toUpperCase()})]},F.model)})})]},z)})}),I.length===0&&i.jsx("div",{style:{textAlign:"center",padding:"40px 20px",color:"var(--text-secondary)"},children:o==="routable"&&P.length>0?"No model is routable right now — every tracked model is unverified, parked, expired or dead. The Models page shows what each provider would offer live.":"No models match the current filter"})]})}const aC=7*24*60*60*1e3;function iC(e){const t=Math.max(0,Math.round((Date.now()-e)/6e4));if(t<1)return"just now";if(t<60)return`${t}m ago`;const n=Math.round(t/60);return n<24?`${n}h ago`:`${Math.round(n/24)}d ago`}function sC(e){return(e||"").split(/[\\/]/).filter(Boolean).slice(-2).join("/")||e}function Obe(){const[e,t]=b.useState(null),[n,r]=b.useState(!1),[a,s]=b.useState(!1),[o,l]=b.useState(null),c=b.useCallback(async()=>{const p=await K.fetchContinuity();t(p),r(!0)},[]);b.useEffect(()=>{let p=!0;return K.fetchContinuity().then(m=>{p&&(t(m),r(!0))}),()=>{p=!1}},[]);const u=b.useCallback(async(p,m,g)=>{s(!0),l(null);const y=await K.clearContinuity(p,m,g);y.ok?l(`Removed ${y.removed??0} record(s).`):l(y.error||"Could not clear that."),await c(),s(!1)},[c]);if(!n)return i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"🔗 Continuity"}),i.jsx("div",{className:"loading-state",children:i.jsx("p",{children:"Loading continuity data…"})})]});const d=e===null,f=(e==null?void 0:e.sessions)??[],h=(e==null?void 0:e.recall)??[];return i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"🔗 Continuity"}),i.jsx("p",{className:"memory-namespace-note",children:"The conversation snapshots that let a crashed or killed turn be resumed, and the index of past asks used for semantic recall. Both are history — they never decide that work is done. Turn the switches on or off on the Process Environment page."}),d?i.jsxs("p",{className:"memory-namespace-note",children:["Continuity data is unavailable — this dashboard server has no ",i.jsx("code",{children:"/api/continuity"})," endpoint."]}):i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"memory-backend",children:["Session store: ",i.jsx("code",{children:e.toggles.sessionStore?"ON":"OFF"})," · ","Semantic recall: ",i.jsx("code",{children:e.toggles.sessionRecall?"ON":"OFF"})]}),o?i.jsx("div",{className:"env-var-notice",children:o}):null,i.jsxs("h3",{className:"section-subtitle",children:["Stored sessions (",f.length,")"]}),f.length===0?i.jsx("p",{className:"memory-namespace-note",children:"No session snapshots yet."}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"memory-list",children:f.map(p=>i.jsxs("div",{className:"memory-item",children:[i.jsxs("span",{className:"memory-project",children:[p.open?"↩️ OPEN":"✓ closed"," · ",p.goal]}),i.jsxs("span",{className:"memory-count",children:[sC(p.cwd)," · ",p.steps," step(s) · ",iC(p.savedAt)]}),i.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",disabled:a,"aria-label":`Forget session ${p.goal}`,onClick:()=>void u("session",p.id),children:"🗑️ Forget"})]},p.id))}),i.jsxs("div",{className:"admin-row-actions",children:[i.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",disabled:a,title:"Delete only session snapshots saved more than 7 days ago",onClick:()=>void u("sessions",void 0,aC),children:"🗑️ Forget older than a week"}),i.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",disabled:a||f.length===0,onClick:()=>void u("sessions"),children:"🗑️ Forget all sessions"})]})]}),i.jsxs("h3",{className:"section-subtitle",children:["Recalled past asks (",h.length,")"]}),h.length===0?i.jsx("p",{className:"memory-namespace-note",children:"Nothing indexed for recall yet."}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"memory-list",children:h.map(p=>i.jsxs("div",{className:"memory-item",children:[i.jsxs("span",{className:"memory-project",children:[p.outcome,": ",p.goal]}),i.jsxs("span",{className:"memory-count",children:[sC(p.projectPath)," · ",iC(p.savedAt)]}),i.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",disabled:a,"aria-label":`Forget recall entry ${p.goal}`,onClick:()=>void u("recall-entry",p.id),children:"🗑️ Forget"})]},p.id))}),i.jsxs("div",{className:"admin-row-actions",children:[i.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",disabled:a,title:"Delete only recall entries indexed more than 7 days ago",onClick:()=>void u("recall",void 0,aC),children:"🗑️ Forget older than a week"}),i.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",disabled:a||h.length===0,onClick:()=>void u("recall"),children:"🗑️ Forget all recall entries"})]})]})]})]})}function as(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":bt(e)}function Pbe(e){return e==null?"0%":(e*100).toFixed(1)+"%"}const oC={"faiss-native":"native FAISS","faiss-ivf":"FAISS-style IVF-flat ANN",json:"exact flat cosine (JSON)"};function Rbe({data:e}){var c,u;if(!e)return i.jsxs(i.Fragment,{children:[i.jsx(Oe,{icon:"💾",title:"Memory Store"}),i.jsx("div",{className:"loading-state",children:i.jsx("p",{children:"Loading memory data..."})})]});const{memory:t,health:n}=e,r=Object.entries(t.byFingerprint||{}).sort(([,d],[,f])=>f-d),a=Object.entries(((c=t.facts)==null?void 0:c.byProject)||{}).sort(([,d],[,f])=>f-d),s=[...t.vectorNamespaces||[]].sort((d,f)=>f.entries-d.entries),o=t.recall||{total:0,today:0,last7d:0},l=[{key:"trajectories",icon:"🧭",value:as(t.total),label:"Trajectories",tone:"accent"},{key:"avg-score",icon:"⭐",value:Pbe(t.avgScore),label:"Avg Score",tone:"ok"},{key:"facts",icon:"📌",value:as((u=t.facts)==null?void 0:u.total),label:"Facts",tone:"warn"},{key:"recall",icon:"🔁",value:as(o.total),label:"Recall Hits",tone:"ok"},{key:"patterns",icon:"🧩",value:as(n==null?void 0:n.patterns),label:"Coding Patterns",tone:"warn"},{key:"feedback",icon:"👍",value:as(n==null?void 0:n.feedback),label:"Feedback Ratings",tone:"ok"}];return i.jsxs(i.Fragment,{children:[i.jsx(Oe,{icon:"💾",title:"Memory Store"}),i.jsx(Wi,{tiles:l}),i.jsxs("p",{className:"memory-backend",children:["Memory tier: ",i.jsx("code",{children:t.backend||"local"})," · ","Vector index: ",i.jsx("code",{children:t.vectorBackend||"unknown"}),t.vectorBackend&&oC[t.vectorBackend]?` (${oC[t.vectorBackend]})`:"",o.last7d>0?` · ${as(o.last7d)} recall(s) this week, ${as(o.today)} today`:" · no recalls yet"]}),i.jsx(Obe,{}),r.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"By Project Type"}),i.jsx("div",{className:"memory-list",children:r.map(([d,f])=>i.jsxs("div",{className:"memory-item",children:[i.jsx("span",{className:"memory-project",children:d}),i.jsxs("span",{className:"memory-count",children:[f," trajectory(ies)"]})]},d))})]}),a.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"Facts by Project"}),i.jsx("div",{className:"memory-list",children:a.map(([d,f])=>i.jsxs("div",{className:"memory-item",children:[i.jsx("span",{className:"memory-project",children:d}),i.jsxs("span",{className:"memory-count",children:[f," fact(s)"]})]},d))})]}),s.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"Vector Index by Namespace"}),i.jsxs("p",{className:"memory-namespace-note",children:["Each namespace is its own index file. ",i.jsx("code",{children:"default"})," holds only successful trajectories and indexed sessions — facts, repo chunks and the model registry have their own namespaces — so a small ",i.jsx("code",{children:"default"})," count is corpus size, not a broken index."]}),i.jsx("div",{className:"memory-list",children:s.map(d=>i.jsxs("div",{className:"memory-item",children:[i.jsx("span",{className:"memory-project",children:d.name}),i.jsxs("span",{className:"memory-count",children:[d.entries," vector(s)"]})]},d.name))})]})]})}function bv(e){const t=e.replace(/[\\/]+$/,""),n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n>=0?t.slice(n+1):t}function Mbe(){const[e,t]=b.useState({configured:!1,authenticated:!1,role:null}),n=qr(),[r,a]=b.useState(null),[s,o]=b.useState(null),[l,c]=b.useState(null),[u,d]=b.useState(""),[f,h]=b.useState(""),[p,m]=b.useState(!1),[g,y]=b.useState(""),[v,k]=b.useState(""),[w,j]=b.useState(null),[S,x]=b.useState(!1),N=e.authenticated&&(e.role==="admin"||e.role==="operator"),E=b.useCallback(async()=>{const T=await K.fetchKnowledge();a(T)},[]);b.useEffect(()=>{K.fetchAdminAuthStatus().then(T=>{t(T?{configured:T.configured,authenticated:T.authenticated,role:T.role??null}:{configured:!1,authenticated:!1,role:null})}),E()},[E,n]);const P=b.useCallback(async()=>{var B;o(null),c(null);const T=f.split(`
206
+ `).map($=>$.trim()).filter(Boolean);if(!u.trim()||T.length===0){o("A tag and at least one file or folder path are required.");return}m(!0);try{const $=await K.knowledgeIngest(u,T);if(!$.ok)o($.error||"Ingest failed.");else{const I=(B=$.skipped)!=null&&B.length?` Skipped: ${$.skipped.map(D=>`${bv(D.path)} (${D.reason})`).join("; ")}`:"";c(`Ingested ${$.files??0} document(s) / ${$.chunks??0} chunk(s) under '${$.tag}'.${I}`),h(""),await E()}}finally{m(!1)}},[u,f,E]),_=b.useCallback(async()=>{if(o(null),j(null),!g.trim()||!v.trim()){o("A tag and a question are required.");return}x(!0);try{const T=await K.knowledgeQuery(g,v);T.ok?j(T.hits??[]):o(T.error||"Query failed.")}finally{x(!1)}},[g,v]),R=b.useCallback(async T=>{o(null),c(null);const B=await K.knowledgeForget(T);B.ok?c(`Removed knowledge tag '${T}'.`):o(B.error||`Could not remove '${T}'.`),await E()},[E]);return i.jsxs("div",{children:[i.jsx(Oe,{icon:"📚",title:"Knowledge Base",description:"Tag your own documents once; answer questions scoped to a tag. The data part comes from your documents, the general part from the model."}),i.jsxs("div",{className:"env-var-header",children:[i.jsx("span",{className:"env-var-title",children:"Documents and vectors live in ~/.nuvira/memory — never in a repository or package."}),i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void E(),children:"↻ Refresh"})]}),e.authenticated?null:i.jsx("div",{className:"admin-hint",children:e.configured?"Log in to view or manage knowledge tags.":"Set up an admin account to manage knowledge tags."}),s?i.jsx("div",{className:"admin-error",children:s}):null,l?i.jsx("div",{className:"admin-hint",children:l}):null,i.jsx("h2",{className:"section-title",children:"Tags"}),r&&r.length===0?i.jsx("div",{className:"admin-hint",children:"No knowledge tags yet. Ingest a document below to create one."}):null,r&&r.length>0?i.jsx("div",{className:"admin-table-wrapper",children:i.jsxs("table",{className:"admin-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Tag"}),i.jsx("th",{children:"Chunks"}),i.jsx("th",{children:"Documents"}),N?i.jsx("th",{}):null]})}),i.jsx("tbody",{children:r.map(T=>i.jsxs("tr",{children:[i.jsx("td",{children:T.tag}),i.jsx("td",{children:T.chunkCount}),i.jsx("td",{children:T.documents.map(B=>i.jsxs("div",{title:B.path,children:[bv(B.path)," (",B.chunks," chunk",B.chunks===1?"":"s",")"]},B.path))}),N?i.jsx("td",{children:i.jsx("button",{className:"admin-mini-danger",type:"button",onClick:()=>void R(T.tag),"aria-label":`Remove knowledge tag ${T.tag}`,children:"Forget"})}):null]},T.tag))})]})}):null,N?i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-title",children:"Ingest under a tag"}),i.jsx("div",{className:"admin-hint",children:"One file or folder path per line (PDF, DOCX, XLSX, PPTX, Markdown, CSV, JSON, plain text). Tags are normalized: “Dheeraj Health Report” becomes “dheeraj-health-report”."}),i.jsxs("div",{className:"admin-gate-form",children:[i.jsx("input",{className:"admin-input",type:"text",placeholder:"tag (e.g. dheeraj-health-report)",value:u,onChange:T=>d(T.target.value),"aria-label":"Knowledge tag"}),i.jsx("textarea",{className:"admin-input",rows:3,placeholder:`/path/to/labs.pdf
207
+ /path/to/notes/`,value:f,onChange:T=>h(T.target.value),"aria-label":"Paths to ingest"}),i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void P(),disabled:p,children:p?"Ingesting…":"Ingest"})]})]}):null,i.jsx("h2",{className:"section-title",children:"Ask a tagged knowledge base"}),i.jsxs("div",{className:"admin-gate-form",children:[i.jsx("input",{className:"admin-input",type:"text",placeholder:"tag",list:"knowledge-tags",value:g,onChange:T=>y(T.target.value),"aria-label":"Tag to query"}),i.jsx("datalist",{id:"knowledge-tags",children:(r??[]).map(T=>i.jsx("option",{value:T.tag},T.tag))}),i.jsx("input",{className:"admin-input",type:"text",placeholder:"what is my LDL and how do I lower it",value:v,onChange:T=>k(T.target.value),"aria-label":"Question"}),i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void _(),disabled:S,children:S?"Searching…":"Query"})]}),w&&w.length===0?i.jsx("div",{className:"admin-hint",children:"No passages matched that tag — check the tag name, or ingest documents first."}):null,w&&w.length>0?i.jsx("div",{children:w.map((T,B)=>i.jsxs("div",{className:"admin-summary-card",children:[i.jsxs("div",{className:"admin-summary-label",children:[bv(T.sourcePath)," · chunk ",T.chunkIndex+1," · sim ",T.similarity.toFixed(3)]}),i.jsx("div",{className:"admin-summary-value",style:{whiteSpace:"pre-wrap",fontWeight:400},children:T.text.slice(0,600)})]},`${T.sourcePath}-${T.chunkIndex}-${B}`))}):null]})}const Ibe=7*24*60*60*1e3;function $be(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Lbe({data:e}){const[t,n]=b.useState(null),[r,a]=b.useState(!1),[s,o]=b.useState(null),l=t??(e==null?void 0:e.history),c=b.useCallback(async(d,f={})=>{a(!0),o(null);const h=await K.clearHistory(d,f);h.ok?o(d==="all"?`Removed ${h.removed??0} conversation(s).`:d==="older"?h.removed?`Removed ${h.removed} conversation(s) older than a week.`:"Nothing older than a week — nothing removed.":`Removed ${h.removed?h.removed:0} conversation(s).`):o(h.error||"Could not delete that.");const p=await K.fetchHistory();p&&n(p),a(!1)},[]);if(!l)return i.jsxs(i.Fragment,{children:[i.jsx(Oe,{icon:"📝",title:"Conversation History"}),i.jsx("div",{className:"loading-state",children:i.jsx("p",{children:"Loading history..."})})]});const u=l.recent||[];return i.jsxs(i.Fragment,{children:[i.jsx(Oe,{icon:"📝",title:"Conversation History"}),i.jsxs("div",{className:"history-stats",children:[i.jsxs("span",{className:"history-count",children:["Total: ",i.jsx("strong",{children:l.total})," sessions"]}),i.jsxs("div",{className:"admin-row-actions",children:[i.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",disabled:r,title:"Delete only conversations started more than 7 days ago",onClick:()=>void c("older",{olderThanMs:Ibe}),children:"🗑️ Forget older than a week"}),i.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",disabled:r||l.total===0,onClick:()=>{window.confirm("Delete ALL stored conversations? This cannot be undone.")&&c("all")},children:"🗑️ Clear all history"})]})]}),s?i.jsx("div",{className:"env-var-notice",children:s}):null,i.jsx("div",{className:"history-list",children:u.length===0?i.jsx("div",{className:"empty-state",children:"No conversations recorded yet."}):u.map(d=>i.jsxs("div",{className:"history-item",children:[i.jsx("div",{className:"history-summary",children:d.summary||"Untitled"}),i.jsxs("div",{className:"history-meta",children:[i.jsxs("span",{children:["📅 ",$be(d.startedAt)]}),i.jsxs("span",{children:["🤖 ",d.provider||"--"]}),i.jsxs("span",{children:["💬 ",d.messageCount||0," msgs"]}),d.tags&&d.tags.length>0&&i.jsxs("span",{children:["🏷️ ",d.tags.map(f=>i.jsx("span",{className:"history-tag",children:f},f))]}),i.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",disabled:r,"aria-label":`Forget conversation ${d.summary||d.id}`,onClick:()=>void c("session",{id:d.id}),children:"🗑️ Forget"})]})]},d.id))})]})}function Dbe(e){const t=Math.max(0,Math.round((Date.now()-e)/6e4));if(t<1)return"just now";if(t<60)return`${t}m ago`;const n=Math.round(t/60);return n<24?`${n}h ago`:`${Math.round(n/24)}d ago`}function Bbe(){const[e,t]=b.useState([]),[n,r]=b.useState(""),[a,s]=b.useState(""),[o,l]=b.useState(null),[c,u]=b.useState(!1),[d,f]=b.useState(!1),[h,p]=b.useState(null),[m,g]=b.useState(null),[y,v]=b.useState(""),[k,w]=b.useState(""),j=b.useCallback(async(E,P)=>{const _=await K.fetchDecisions(E,P);l(_),u(!0)},[]);b.useEffect(()=>{let E=!0;return K.listProjects().then(P=>{var R,T;if(!E)return;t(P);const _=((R=P.find(B=>B.kind==="cwd"))==null?void 0:R.path)??((T=P[0])==null?void 0:T.path)??"";r(_),j(_)}),()=>{E=!1}},[j]);const S=b.useCallback(()=>{n&&j(n,a.trim()||void 0)},[n,a,j]),x=b.useCallback(async E=>{if(!n||!y.trim())return;f(!0),p(null),await K.reviseDecision(n,E,y.trim(),k.trim()||void 0)?(p(`Revised ${E} — the previous answer is kept in its history.`),g(null),v(""),w(""),await j(n,a.trim()||void 0)):p("Could not revise that decision — it may no longer exist."),f(!1)},[n,y,k,a,j]),N=(o==null?void 0:o.decisions)??[];return i.jsxs(i.Fragment,{children:[i.jsx(Oe,{icon:"🧭",title:"Decisions",description:"The choices the agent asked YOU to make (ask_user), kept so you can refer back and revise them. Written to the project's .nuvira/decisions.jsonl — never a substitute for asking."}),c?o===null?i.jsxs("p",{className:"memory-namespace-note",children:["Decision data is unavailable — this dashboard server has no ",i.jsx("code",{children:"/api/decisions"})," endpoint."]}):i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"Workspace"}),e.length>1?i.jsxs("label",{className:"memory-backend",children:["Project:"," ",i.jsx("select",{value:n,onChange:E=>{r(E.target.value),j(E.target.value,a.trim()||void 0)},children:e.map(E=>i.jsxs("option",{value:E.path,children:[E.name," (",E.kind,")"]},E.path))})]}):i.jsx("p",{className:"memory-backend",children:i.jsx("code",{children:o.dir})}),i.jsxs("div",{className:"admin-row-actions",children:[i.jsx("input",{type:"search",value:a,placeholder:"Find decisions relevant to an ask…","aria-label":"Search decisions relevant to an ask",onChange:E=>s(E.target.value),onKeyDown:E=>{E.key==="Enter"&&S()}}),i.jsx("button",{className:"admin-mini-btn",type:"button",disabled:!n,onClick:S,children:"🔎 Search"}),o.relevant?i.jsx("button",{className:"admin-mini-btn",type:"button",disabled:!n,onClick:()=>{s(""),j(n)},children:"✕ Clear"}):null]}),h?i.jsx("div",{className:"env-var-notice",children:h}):null,i.jsx("h2",{className:"section-subtitle",children:o.relevant?`Relevant decisions (${N.length})`:`Recorded decisions (${N.length})`}),N.length===0?i.jsx("p",{className:"memory-namespace-note",children:o.relevant?"No recorded decision matches that ask.":"None yet — a decision is recorded when the agent has to ask you one."}):i.jsx("div",{className:"memory-list",children:N.map(E=>{var P;return i.jsxs("div",{className:"memory-item",children:[i.jsxs("div",{children:[i.jsxs("span",{className:"memory-project",children:[E.status==="revised"?"✏️":"✅"," ",E.question]}),i.jsxs("div",{className:"memory-count",children:["→ ",E.answer||"(none)"," · ",Dbe(E.at)," · ",E.source," · ",E.id,E.status==="revised"?` · revised ${((P=E.revisions)==null?void 0:P.length)??0}×`:""]}),E.choices&&E.choices.length>0?i.jsxs("div",{className:"memory-count",children:["offered: ",E.choices.join(" | ")]}):null]}),m===E.id?i.jsxs("div",{children:[i.jsx("input",{type:"text",value:y,placeholder:"New answer","aria-label":`New answer for ${E.question}`,onChange:_=>v(_.target.value)}),i.jsx("input",{type:"text",value:k,placeholder:"Why it changed (optional)","aria-label":`Note for ${E.question}`,onChange:_=>w(_.target.value)}),i.jsx("button",{className:"admin-mini-btn",type:"button",disabled:d||!y.trim(),onClick:()=>void x(E.id),children:"💾 Save"}),i.jsx("button",{className:"admin-mini-btn",type:"button",disabled:d,onClick:()=>{g(null),v(""),w("")},children:"✕ Cancel"})]}):i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>{g(E.id),v(E.answer),w("")},children:"✏️ Revise"})]},E.id)})})]}):i.jsx("div",{className:"loading-state",children:i.jsx("p",{children:"Loading decisions…"})})]})}function zbe({onFetch:e,onClear:t,onExport:n}){const[r,a]=b.useState([]),[s,o]=b.useState(!1),[l,c]=b.useState(""),[u,d]=b.useState(""),[f,h]=b.useState(null),[p,m]=b.useState(null);b.useEffect(()=>{g()},[l,u]);const g=async()=>{o(!0);try{const j=await e({skillName:l||void 0,status:u||void 0,limit:100});a(j);const S=j.length,x=j.filter(P=>P.status==="success").length,N=j.filter(P=>P.status==="failure").length,E=S>0?Math.round(j.reduce((P,_)=>P+_.durationMs,0)/S):0;m({total:S,success:x,failure:N,avgDuration:E})}catch(j){console.error("Failed to fetch execution history:",j)}finally{o(!1)}},y=async j=>{if(n)try{const S=await n(j),x=new Blob([S],{type:j==="json"?"application/json":"text/csv"}),N=URL.createObjectURL(x),E=document.createElement("a");E.href=N,E.download=`execution-history.${j}`,E.click(),URL.revokeObjectURL(N)}catch(S){console.error("Failed to export history:",S)}},v=async()=>{if(t&&confirm("Are you sure you want to clear all execution history?"))try{await t(),a([]),m(null)}catch(j){console.error("Failed to clear history:",j)}},k=j=>{switch(j){case"success":return"✅";case"failure":return"❌";case"timeout":return"⏰";case"rejected":return"🚫";case"error":return"💥";default:return"❓"}},w=j=>{switch(j){case"python":return"🐍";case"node":return"🟢";case"shell":return"🖥️";case"ruby":return"💎";case"go":return"🔵";case"rust":return"🦀";default:return"📜"}};return i.jsxs("div",{className:"execution-history",children:[i.jsx(Oe,{icon:"📜",title:"Execution History",actions:i.jsxs("div",{className:"execution-history-actions",children:[i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>y("json"),children:"📥 Export JSON"}),i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>y("csv"),children:"📥 Export CSV"}),t&&i.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",onClick:v,children:"🗑️ Clear"})]})}),p&&i.jsxs("div",{className:"execution-history-stats",children:[i.jsxs("div",{className:"stat-item",children:[i.jsx("span",{className:"stat-value",children:p.total}),i.jsx("span",{className:"stat-label",children:"Total"})]}),i.jsxs("div",{className:"stat-item stat-success",children:[i.jsx("span",{className:"stat-value",children:p.success}),i.jsx("span",{className:"stat-label",children:"Success"})]}),i.jsxs("div",{className:"stat-item stat-failure",children:[i.jsx("span",{className:"stat-value",children:p.failure}),i.jsx("span",{className:"stat-label",children:"Failed"})]}),i.jsxs("div",{className:"stat-item",children:[i.jsxs("span",{className:"stat-value",children:[p.avgDuration,"ms"]}),i.jsx("span",{className:"stat-label",children:"Avg Duration"})]})]}),i.jsxs("div",{className:"execution-history-filters",children:[i.jsx("input",{className:"env-var-input",type:"text","aria-label":"Filter by skill name",placeholder:"Filter by skill name...",value:l,onChange:j=>c(j.target.value)}),i.jsxs("select",{className:"env-var-input","aria-label":"Filter by status",value:u,onChange:j=>d(j.target.value),children:[i.jsx("option",{value:"",children:"All statuses"}),i.jsx("option",{value:"success",children:"Success"}),i.jsx("option",{value:"failure",children:"Failure"}),i.jsx("option",{value:"timeout",children:"Timeout"}),i.jsx("option",{value:"rejected",children:"Rejected"}),i.jsx("option",{value:"error",children:"Error"})]})]}),i.jsx("div",{className:"execution-history-list",children:s?i.jsx("div",{className:"execution-history-empty",children:"Loading..."}):r.length===0?i.jsx("div",{className:"execution-history-empty",children:"No execution history found. Execute a skill to see results here."}):r.map(j=>i.jsxs("div",{className:`execution-history-entry ${j.status}`,onClick:()=>h((f==null?void 0:f.id)===j.id?null:j),children:[i.jsxs("div",{className:"entry-header",children:[i.jsx("span",{className:"entry-icon",children:k(j.status)}),i.jsx("span",{className:"entry-skill",children:j.skillName}),i.jsxs("span",{className:"entry-runtime",children:[w(j.runtime)," ",j.runtime]}),i.jsxs("span",{className:"entry-duration",children:[j.durationMs,"ms"]}),i.jsx("span",{className:"entry-time",children:new Date(j.timestamp).toLocaleString()}),i.jsx("span",{className:"entry-expand",children:(f==null?void 0:f.id)===j.id?"▼":"▶"})]}),(f==null?void 0:f.id)===j.id&&i.jsxs("div",{className:"entry-details",children:[i.jsxs("div",{className:"entry-detail-row",children:[i.jsx("span",{className:"detail-label",children:"Status:"}),i.jsx("span",{className:"detail-value",children:j.status})]}),i.jsxs("div",{className:"entry-detail-row",children:[i.jsx("span",{className:"detail-label",children:"Runtime:"}),i.jsx("span",{className:"detail-value",children:j.runtime})]}),i.jsxs("div",{className:"entry-detail-row",children:[i.jsx("span",{className:"detail-label",children:"Duration:"}),i.jsxs("span",{className:"detail-value",children:[j.durationMs,"ms"]})]}),j.exitCode!==void 0&&i.jsxs("div",{className:"entry-detail-row",children:[i.jsx("span",{className:"detail-label",children:"Exit Code:"}),i.jsx("span",{className:"detail-value",children:j.exitCode})]}),j.error&&i.jsxs("div",{className:"entry-detail-row",children:[i.jsx("span",{className:"detail-label",children:"Error:"}),i.jsx("span",{className:"detail-value entry-error",children:j.error})]}),j.command&&i.jsxs("div",{className:"entry-detail-row",children:[i.jsx("span",{className:"detail-label",children:"Command:"}),i.jsx("code",{className:"detail-value",children:j.command})]})]})]},j.id))})]})}function Fbe({envVars:e,onSave:t,onDelete:n,onTest:r,readOnly:a=!1}){const[s,o]=b.useState(null),[l,c]=b.useState(""),[u,d]=b.useState(!1),[f,h]=b.useState(""),[p,m]=b.useState(""),[g,y]=b.useState(null),[v,k]=b.useState({}),w=[...e].sort((N,E)=>N.requiredBy&&!E.requiredBy?-1:!N.requiredBy&&E.requiredBy?1:N.name.localeCompare(E.name)),j=N=>{t(N,l),o(null),c("")},S=()=>{f&&p&&(t(f,p),h(""),m(""),d(!1))},x=async N=>{if(r){y(N);try{const E=await r(N);k(P=>({...P,[N]:E}))}catch{k(E=>({...E,[N]:!1}))}finally{y(null)}}};return i.jsxs("div",{className:"env-var-editor",children:[i.jsxs("div",{className:"env-var-header",children:[i.jsx("h2",{className:"env-var-title",children:"🔐 Environment Variables"}),!a&&i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>d(!u),children:u?"✕ Cancel":"+ Add Variable"})]}),u&&!a&&i.jsxs("div",{className:"env-var-add-form",children:[i.jsx("input",{className:"env-var-input",type:"text",placeholder:"Variable name (e.g., MY_API_KEY)",value:f,onChange:N=>h(N.target.value)}),i.jsx("input",{className:"env-var-input",type:"password",placeholder:"Value",value:p,onChange:N=>m(N.target.value)}),i.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:!f||!p,onClick:S,children:"💾 Save"})]}),i.jsx("div",{className:"env-var-list",children:w.length===0?i.jsx("div",{className:"env-var-empty",children:"No environment variables configured. Add one to get started."}):w.map(N=>i.jsxs("div",{className:`env-var-row ${N.isSet?"env-var-set":"env-var-missing"} ${N.isProviderCredential?"env-var-blocked":""}`,children:[i.jsxs("div",{className:"env-var-row-header",children:[i.jsxs("span",{className:"env-var-name",children:[N.name,N.requiredBy&&i.jsxs("span",{className:"env-var-required-badge",children:["required by ",N.requiredBy]}),N.isProviderCredential&&i.jsx("span",{className:"env-var-blocked-badge",children:"🔒 provider credential (blocked)"})]}),i.jsx("span",{className:"env-var-status",children:N.isSet?"✅ Set":"❌ Not set"})]}),N.description&&i.jsx("div",{className:"env-var-description",children:N.description}),s===N.name?i.jsxs("div",{className:"env-var-edit",children:[i.jsx("input",{className:"env-var-input",type:"password",value:l,onChange:E=>c(E.target.value),placeholder:"Enter new value..."}),i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>j(N.name),children:"💾 Save"}),i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>o(null),children:"Cancel"})]}):i.jsxs("div",{className:"env-var-actions",children:[!a&&!N.isProviderCredential&&i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>{o(N.name),c("")},children:"✏️ Edit"}),r&&i.jsx("button",{className:"admin-mini-btn",type:"button",disabled:g===N.name,onClick:()=>x(N.name),children:g===N.name?"⏳ Testing...":"🧪 Test"}),!a&&i.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",onClick:()=>n(N.name),children:"🗑️ Delete"}),v[N.name]!==void 0&&i.jsx("span",{className:`env-var-test-result ${v[N.name]?"env-var-test-pass":"env-var-test-fail"}`,children:v[N.name]?"✅ Valid":"❌ Invalid"})]})]},N.name))}),i.jsx("div",{className:"env-var-help",children:i.jsxs("p",{children:[i.jsx("strong",{children:"Tip:"})," Environment variables are stored in ",i.jsx("code",{children:"~/.nuvira/.env"})," and injected into skill executions. Provider credentials (ANTHROPIC_API_KEY, OPENAI_API_KEY, etc.) are automatically blocked from skill execution for security."]})})]})}function Ube(){const[e,t]=b.useState({configured:!1,authenticated:!1,role:null}),n=qr(),[r,a]=b.useState([]),[s,o]=b.useState(!0),[l,c]=b.useState(null),[u,d]=b.useState(null),f=e.authenticated&&(e.role==="admin"||e.role==="operator"),h=b.useCallback(async()=>{o(!0);const y=await K.fetchSkillEnv();a(y),o(!1)},[]);b.useEffect(()=>{K.fetchAdminAuthStatus().then(y=>{t(y?{configured:y.configured,authenticated:y.authenticated,role:y.role??null}:{configured:!1,authenticated:!1,role:null})}),h()},[h,n]);const p=b.useCallback(async(y,v)=>{var j;c(null),d(null);const k=await K.saveSecrets({[y]:v}),w=(j=k.refused)==null?void 0:j.find(S=>S.name===y);!k.ok||w?c(w?Wbe(y,w.reason):k.error||`Could not save ${y}.`):d(`Saved ${y}.`),await h()},[h]),m=b.useCallback(async y=>{c(null),d(null);const v=await K.deleteSkillEnvVar(y);v.ok?d(v.removed?`Deleted ${y}.`:`${y} was not stored in the env file.`):c(v.error||`Could not delete ${y}.`),await h()},[h]),g=b.useCallback(async y=>{const v=await K.testSkillEnvVar(y);return v.ok?(c(null),d(v.detail||`${y}: ${v.usable?"usable by skills":"not usable by skills"}`),v.usable===!0):(c(v.error||`Could not test ${y}.`),!1)},[]);return i.jsxs("div",{children:[i.jsx(Oe,{icon:"🔐",title:"Skill Environment Variables"}),i.jsxs("div",{className:"env-var-header",children:[i.jsx("span",{className:"env-var-title",children:"Values are masked; only names and set/unset state are shown."}),i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void h(),children:"↻ Refresh"})]}),i.jsxs("div",{className:"admin-hint",children:["Secrets here are injected into skill executions that declare them (",i.jsx("code",{children:"required_environment_variables"}),"). Provider credentials are listed but locked — they belong to provider setup, and skills never receive them."]}),e.authenticated?null:i.jsx("div",{className:"admin-hint",children:e.configured?"Log in to view or edit skill secrets.":"Set up an admin account to manage skill secrets."}),e.authenticated&&!f?i.jsx("div",{className:"admin-hint",children:"Read-only — admins and operators can change these values."}):null,l?i.jsx("div",{className:"env-var-notice env-var-notice-error",children:l}):null,u?i.jsx("div",{className:"env-var-notice",children:u}):null,s?i.jsx("div",{className:"loading-state",children:"Loading…"}):i.jsx(Fbe,{envVars:r,onSave:(y,v)=>void p(y,v),onDelete:y=>void m(y),onTest:g,readOnly:!f})]})}function Wbe(e,t){switch(t){case"provider-credential":return`${e} is a provider credential — configure it in provider setup instead. Skills never receive it.`;case"invalid-name":return`${e} is not a valid environment variable name.`;case"write-failed":return`${e} could not be written to the env file.`;default:return`${e} was not saved (${t}).`}}const Hbe=[{id:"turn",title:"Turn behaviour",blurb:"How each turn runs. Unset means nobody has asked for anything, which is not the same as asking for no."},{id:"observability",title:"Observability",blurb:"What a run records about itself. Both are off by default and off unless asked for."},{id:"hooks",title:"Tool hooks",blurb:"A command run around every tool call, with the call on stdin as JSON. For a phase, a value here REPLACES the hooks declared in tools.hooks."}];function Gbe(){const[e,t]=b.useState({configured:!1,authenticated:!1,role:null}),n=qr(),[r,a]=b.useState([]),[s,o]=b.useState(!0),[l,c]=b.useState(null),[u,d]=b.useState(null),[f,h]=b.useState({}),[p,m]=b.useState(null),g=e.authenticated&&(e.role==="admin"||e.role==="operator"),y=b.useCallback(async()=>{o(!0),a(await K.fetchProcessEnv()),o(!1)},[]);b.useEffect(()=>{K.fetchAdminAuthStatus().then(w=>{t(w?{configured:w.configured,authenticated:w.authenticated,role:w.role??null}:{configured:!1,authenticated:!1,role:null})}),y()},[y,n]);const v=b.useCallback(async(w,j)=>{m(w),c(null),d(null);const S=await K.saveProcessEnvVar(w,j);if(!S.ok||!S.row)c(S.error||`Could not set ${w}.`);else{const x=S.row;a(N=>N.map(E=>E.name===x.name?x:E)),h(N=>({...N,[w]:""})),d(`${w} = ${x.fileValue}. Takes effect on the next turn; the dashboard picked it up immediately.`)}m(null)},[]),k=b.useCallback(async w=>{m(w),c(null),d(null);const j=await K.deleteProcessEnvVar(w);if(!j.ok||!j.row)c(j.error||`Could not unset ${w}.`);else{const S=j.row;a(x=>x.map(N=>N.name===S.name?S:N)),h(x=>({...x,[w]:""})),d(j.removed?`${w} removed from the env file. ${S.unsetMeans}`:`${w} had no line in the env file. ${S.unsetMeans}`)}m(null)},[]);return i.jsxs("div",{children:[i.jsx(Oe,{icon:"🌱",title:"Process Environment"}),i.jsxs("div",{className:"env-var-header",children:[i.jsx("span",{className:"env-var-title",children:"These are the switches Agent-Nuvira reads for how a run behaves. Values are written to the credential env file and are not masked — do not put a secret in a hook command."}),i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void y(),children:"↻ Refresh"})]}),i.jsxs("div",{className:"admin-hint",children:["A value exported in your shell ",i.jsx("strong",{children:"wins over this file"}),", for the dashboard and for every CLI run in that shell. A row that says ",i.jsx("em",{children:"shell value wins"})," is reporting exactly that, and writes here will not change it."]}),e.authenticated?null:i.jsx("div",{className:"admin-hint",children:e.configured?"Log in to view or change the process environment.":"Set up an admin account to change the process environment."}),e.authenticated&&!g?i.jsx("div",{className:"admin-hint",children:"Read-only — admins and operators can change these values."}):null,l?i.jsx("div",{className:"env-var-notice env-var-notice-error",children:l}):null,u?i.jsx("div",{className:"env-var-notice",children:u}):null,s?i.jsx("div",{className:"loading-state",children:"Loading…"}):Hbe.map(w=>{const j=r.filter(S=>S.group===w.id);return j.length===0?null:i.jsxs("section",{className:"process-env-group",children:[i.jsx("h3",{className:"process-env-group-title",children:w.title}),i.jsx("p",{className:"process-env-group-blurb",children:w.blurb}),i.jsx("div",{className:"env-var-list",children:j.map(S=>i.jsx(qbe,{row:S,draft:f[S.name]??"",busy:p===S.name,readOnly:!g,onDraft:x=>h(N=>({...N,[S.name]:x})),onSet:x=>void v(S.name,x),onUnset:()=>void k(S.name)},S.name))})]},w.id)})]})}function qbe({row:e,draft:t,busy:n,readOnly:r,onDraft:a,onSet:s,onUnset:o}){const l=e.state==="on",c=e.state!=="unset",u=f=>`admin-mini-btn${f?" process-env-active":""}`,d=e.kind==="flag"&&e.fileValue!==null&&e.fileValue!=="1"&&e.fileValue!=="0"?e.fileValue:null;return i.jsxs("div",{className:`env-var-row ${c?"env-var-set":"env-var-missing"}`,"data-testid":`process-env-row-${e.name}`,children:[i.jsxs("div",{className:"env-var-row-header",children:[i.jsxs("span",{className:"env-var-name",children:[e.name,e.shadowed?i.jsxs("span",{className:"env-var-blocked-badge",children:["⚠️ shell value wins: ",e.processValue]}):null]}),i.jsxs("span",{className:"env-var-status",children:[e.kind==="flag"?l?"✅ On":c?"⭕ Off":"➖ Unset":c?"✅ Set":"➖ Unset",d?` (${d})`:""]})]}),i.jsxs("div",{className:"env-var-description",children:[i.jsx("strong",{children:e.label})," — ",e.description]}),i.jsxs("div",{className:"env-var-description",children:["Unset: ",e.unsetMeans]}),e.cliEquivalent?i.jsxs("div",{className:"env-var-description",children:["Same switch: ",i.jsx("code",{children:e.cliEquivalent})]}):null,e.warning?i.jsxs("div",{className:"env-var-warning",children:["⚠️ ",e.warning]}):null,r?null:i.jsxs("div",{className:"env-var-actions",children:[e.kind==="flag"?i.jsxs(i.Fragment,{children:[i.jsx("button",{className:u(l),type:"button",disabled:n,onClick:()=>s("1"),children:"On"}),i.jsx("button",{className:u(c&&!l),type:"button",disabled:n,onClick:()=>s("0"),children:"Off"}),i.jsx("button",{className:u(!c),type:"button",disabled:n,onClick:o,children:"Unset"})]}):null,e.kind==="text"||e.acceptsValue?i.jsxs(i.Fragment,{children:[i.jsx("input",{className:"env-var-input",type:"text",value:t,placeholder:e.placeholder,disabled:n,onChange:f=>a(f.target.value),"aria-label":`${e.name} value`}),i.jsxs("button",{className:"admin-mini-btn",type:"button",disabled:n||t.trim()==="",onClick:()=>s(t),children:["💾 ",e.valueLabel??"Save"]})]}):null,e.kind==="text"?i.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",disabled:n,onClick:o,children:"🗑️ Unset"}):null]})]})}const lC={before_tool_call:"🛑",after_tool_call:"✅",failed_tool_call:"❌",on_session_end:"🏁"};function cC(e){const t={};for(const n of e.split(`
208
+ `)){const r=n.trim();if(!r)continue;const a=r.indexOf("=");if(a<=0)continue;const s=r.slice(0,a).trim(),o=r.slice(a+1).trim();s&&o&&(t[s]=o)}return Object.keys(t).length>0?t:void 0}function Kbe(e){const t=e.when??{},n=[];if(t.tool&&n.push(`tool ${t.tool}`),t.surface&&n.push(`surface ${t.surface}`),t.cwdPrefix&&n.push(`cwd ${t.cwdPrefix}*`),t.argsMatch)for(const[a,s]of Object.entries(t.argsMatch))n.push(`${a}=${s}`);const r=n.length>0?n.join(" · "):"every call";switch(e.action.kind){case"deny":return`${r} → deny${e.action.reason?`: ${e.action.reason}`:""}`;case"notify":return`${r} → notify: ${e.action.message}`;case"scan-args":return`${r} → scan args for secrets${e.action.denyOnHit?" (deny on hit)":""}`}}function Vbe(){const e=qr(),[t,n]=b.useState({configured:!1,authenticated:!1,role:null}),[r,a]=b.useState(null),[s,o]=b.useState(!0),[l,c]=b.useState(null),[u,d]=b.useState(null),[f,h]=b.useState(!1),[p,m]=b.useState([]),[g,y]=b.useState(""),[v,k]=b.useState(""),[w,j]=b.useState("before_tool_call"),[S,x]=b.useState("deny"),[N,E]=b.useState(""),[P,_]=b.useState(""),[R,T]=b.useState(""),[B,$]=b.useState(""),[I,D]=b.useState(""),[U,M]=b.useState("hook fired: {tool}"),[z,O]=b.useState(!1),J=t.authenticated&&(t.role==="admin"||t.role==="operator"),F=b.useCallback(async()=>{o(!0);const G=await K.fetchHooks();G?(a(G),m(G.hooks)):c("Could not load hooks — the dashboard server may be older than this bundle."),o(!1)},[]);b.useEffect(()=>{K.fetchAdminAuthStatus().then(G=>{n(G?{configured:G.configured,authenticated:G.authenticated,role:G.role??null}:{configured:!1,authenticated:!1,role:null})}),F()},[F,e]);const L=(r==null?void 0:r.events)??["before_tool_call","after_tool_call","failed_tool_call","on_session_end"],ie=(r==null?void 0:r.eventDescriptions)??{},fe=(r==null?void 0:r.actionKinds)??["deny","notify","scan-args"],ve=(r==null?void 0:r.actionDescriptions)??{},Ee=b.useMemo(()=>p.some(G=>G.id===g.trim()),[p,g]),ee=/^[a-z0-9][a-z0-9-]{0,63}$/.test(g.trim()),Q=ee&&!Ee&&v.trim().length>0,ae=b.useCallback(()=>{c(null),d(null);const G={...N.trim()?{tool:N.trim()}:{},...P.trim()?{surface:P.trim()}:{},...R.trim()?{cwdPrefix:R.trim()}:{},...cC(B)?{argsMatch:cC(B)}:{}},xe=S==="deny"?{kind:"deny",...I.trim()?{reason:I.trim()}:{}}:S==="notify"?{kind:"notify",message:U.trim()||"hook fired: {tool}"}:{kind:"scan-args",denyOnHit:z,...I.trim()?{reason:I.trim()}:{}},we={id:g.trim(),label:v.trim(),event:w,enabled:!0,...Object.keys(G).length>0?{when:G}:{},action:xe,source:"user",updatedAt:Date.now()};m(Pe=>[...Pe,we]),y(""),k(""),E(""),_(""),T(""),$(""),D(""),O(!1)},[g,v,w,S,N,P,R,B,I,U,z]),ce=b.useCallback(async()=>{h(!0),c(null),d(null);const G=await K.saveHooks(p);G.ok?(m(G.hooks??p),d(`Saved ${(G.hooks??p).length} hook(s). They are in force on the next tool call.`)):c(G.error||"Could not save hooks."),h(!1)},[p]);return i.jsxs("div",{children:[i.jsx(Oe,{icon:"🪝",title:"Hooks",description:"Declarative lifecycle rules bound to nuvira's own seams. A hook is DATA, not code: its only possible actions are deny, notify and secret-scan. There is no run-command action and no third-party script — nothing here executes."}),i.jsxs("div",{className:"env-var-header",children:[i.jsxs("span",{className:"env-var-title",children:[p.length," declared · ",p.filter(G=>G.enabled).length," enabled",r!=null&&r.file?i.jsxs(i.Fragment,{children:[" · stored at ",i.jsx("code",{children:r.file})]}):null]}),i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void F(),children:"↻ Refresh"}),J?i.jsxs("button",{className:"admin-refresh-btn",type:"button",disabled:f,onClick:()=>void ce(),children:["💾 ",f?"Saving…":"Save hooks"]}):null]}),t.authenticated?null:i.jsx("div",{className:"admin-hint",children:t.configured?"Log in to view or change hooks.":"Set up an admin account to change hooks."}),t.authenticated&&!J?i.jsx("div",{className:"admin-hint",children:"Read-only — admins and operators can change hooks."}):null,l?i.jsx("div",{className:"env-var-notice env-var-notice-error",children:l}):null,u?i.jsx("div",{className:"env-var-notice",children:u}):null,i.jsxs("section",{className:"panel",children:[i.jsx("h2",{className:"section-title",children:"How it works"}),i.jsxs("p",{className:"admin-hint",children:["When a seam fires, nuvira tests each enabled hook whose event matches, in order, and the FIRST ",i.jsx("code",{children:"deny"})," ","wins. Every action is implemented natively, so a bad hook can at worst block a call or print a line — it can never run code, reach the network, or read a credential."]}),i.jsxs("table",{className:"chat-plan-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Seam"}),i.jsx("th",{children:"When it fires"})]})}),i.jsx("tbody",{children:L.map(G=>i.jsxs("tr",{children:[i.jsxs("td",{children:[lC[G]," ",i.jsx("code",{children:G})]}),i.jsx("td",{children:ie[G]??""})]},G))})]}),i.jsxs("table",{className:"chat-plan-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Action"}),i.jsx("th",{children:"What it can do"})]})}),i.jsx("tbody",{children:fe.map(G=>i.jsxs("tr",{children:[i.jsx("td",{children:i.jsx("code",{children:G})}),i.jsx("td",{children:ve[G]??""})]},G))})]})]}),i.jsxs("section",{className:"panel",children:[i.jsx("h2",{className:"section-title",children:"Declared hooks"}),s?i.jsx("div",{className:"loading-state",children:"Loading…"}):p.length===0?i.jsx("div",{className:"admin-hint",children:"No hooks declared. Add one below — it stays a draft until you Save."}):i.jsx("div",{className:"env-var-list",children:p.map(G=>i.jsxs("div",{className:`env-var-row ${G.enabled?"env-var-set":"env-var-missing"}`,"data-testid":`hook-row-${G.id}`,children:[i.jsxs("div",{className:"env-var-row-header",children:[i.jsxs("span",{className:"env-var-name",children:[lC[G.event]," ",i.jsx("code",{children:G.id})," — ",G.label,G.source==="builtin"?i.jsx("span",{className:"hub-chip",children:"builtin"}):null]}),i.jsx("span",{className:"env-var-status",children:G.event})]}),i.jsx("div",{className:"env-var-description",children:Kbe(G)}),J?i.jsxs("div",{className:"env-var-actions",children:[i.jsx("button",{className:`admin-mini-btn${G.enabled?" process-env-active":""}`,type:"button",onClick:()=>m(xe=>xe.map(we=>we.id===G.id?{...we,enabled:!we.enabled}:we)),children:G.enabled?"✅ Enabled":"⭕ Disabled"}),G.source==="builtin"?i.jsx("span",{className:"admin-hint",children:"Built-in default — disable it to switch it off; it cannot be deleted."}):i.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",onClick:()=>m(xe=>xe.filter(we=>we.id!==G.id)),children:"🗑️ Remove"})]}):null]},G.id))})]}),J?i.jsxs("section",{className:"panel",children:[i.jsx("h2",{className:"section-title",children:"Add a hook"}),i.jsxs("div",{className:"env-var-row",children:[i.jsx("div",{className:"env-var-row-header",children:i.jsxs("span",{className:"env-var-name",children:[i.jsx("input",{className:"env-var-input",type:"text",value:g,placeholder:"id (e.g. block-rm-rf)","aria-label":"Hook id",onChange:G=>y(G.target.value)}),i.jsx("input",{className:"env-var-input",type:"text",value:v,placeholder:"label","aria-label":"Hook label",onChange:G=>k(G.target.value)})]})}),g.trim()&&!ee?i.jsx("div",{className:"env-var-warning",children:"⚠️ id must be lowercase letters, digits and hyphens."}):null,Ee?i.jsx("div",{className:"env-var-warning",children:"⚠️ that id is already declared."}):null,i.jsxs("div",{className:"env-var-description",children:[i.jsxs("label",{children:["Seam:"," ",i.jsx("select",{value:w,"aria-label":"Hook event",onChange:G=>j(G.target.value),children:L.map(G=>i.jsx("option",{value:G,children:G},G))})]})," ",i.jsxs("label",{children:["Action:"," ",i.jsx("select",{value:S,"aria-label":"Hook action",onChange:G=>x(G.target.value),children:fe.map(G=>i.jsx("option",{value:G,disabled:G==="deny"&&w!=="before_tool_call",children:G},G))})]})]}),i.jsxs("div",{className:"env-var-description",children:["Match (blank = every call):"," ",i.jsx("input",{className:"env-var-input",type:"text",value:N,placeholder:"tool glob (run_*)","aria-label":"Tool glob",onChange:G=>E(G.target.value)})," ",i.jsx("input",{className:"env-var-input",type:"text",value:P,placeholder:"surface glob","aria-label":"Surface glob",onChange:G=>_(G.target.value)})," ",i.jsx("input",{className:"env-var-input",type:"text",value:R,placeholder:"cwd prefix","aria-label":"Cwd prefix",onChange:G=>T(G.target.value)})]}),i.jsxs("div",{className:"env-var-description",children:["Arg match (one ",i.jsx("code",{children:"key=glob"})," per line, optional):"," ",i.jsx("textarea",{className:"env-var-input",value:B,placeholder:"command=rm -rf*","aria-label":"Arg match",onChange:G=>$(G.target.value)})]}),S==="notify"?i.jsxs("div",{className:"env-var-description",children:["Message:"," ",i.jsx("input",{className:"env-var-input",type:"text",value:U,"aria-label":"Notify message",onChange:G=>M(G.target.value)})," ",i.jsxs("span",{className:"admin-hint",children:["{tool} {surface} {event}"," are interpolated."]})]}):i.jsxs("div",{className:"env-var-description",children:[S==="deny"?"Reason":"Reason (when denied)",":"," ",i.jsx("input",{className:"env-var-input",type:"text",value:I,"aria-label":"Reason",onChange:G=>D(G.target.value)})]}),S==="scan-args"&&w==="before_tool_call"?i.jsxs("label",{className:"env-var-description",children:[i.jsx("input",{type:"checkbox",checked:z,onChange:G=>O(G.target.checked)})," Block the call when a secret shape is found"]}):null,i.jsxs("div",{className:"env-var-actions",children:[i.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:!Q,onClick:ae,children:"➕ Add to draft"}),i.jsx("span",{className:"admin-hint",children:"Nothing is in force until you press Save hooks."})]})]})]}):null]})}const Ybe={read:{label:"read",className:"cap-effect-read"},"local-write":{label:"local write",className:"cap-effect-local"},"local-state":{label:"machine state",className:"cap-effect-local"},external:{label:"off-machine",className:"cap-effect-external"},destructive:{label:"destructive",className:"cap-effect-destructive"}};function Xbe(e){return Ybe[e]??{label:e,className:"cap-effect-local"}}function Qbe(){const[e,t]=b.useState(null),[n,r]=b.useState([]),[a,s]=b.useState({authenticated:!1,role:null}),o=qr(),[l,c]=b.useState(!0),[u,d]=b.useState(null),[f,h]=b.useState(null),[p,m]=b.useState(null),[g,y]=b.useState(""),[v,k]=b.useState(""),[w,j]=b.useState(""),S=a.authenticated&&(a.role==="admin"||a.role==="operator"),x=b.useCallback(async()=>{c(!0);const[I,D]=await Promise.all([K.fetchCapabilities(),K.fetchSessionGrants()]);d(I?null:"Could not read capabilities from the server."),t(I),r(D??[]),c(!1)},[]);b.useEffect(()=>{K.fetchAdminAuthStatus().then(I=>{s(I?{authenticated:I.authenticated,role:I.role??null}:{authenticated:!1,role:null})}),x()},[x,o]);const N=b.useCallback(async I=>{m(I),d(null),await K.revokeSessionGrant(I)?r(U=>U.filter(M=>M.sessionId!==I)):d(`Could not end the grant for ${I}.`),m(null)},[]),E=b.useCallback(I=>{I&&t(D=>D&&{...D,learnedCommands:I})},[]),P=b.useCallback(async()=>{const I=g.trim(),D=v.trim();if(!I||!D)return;m("__save__"),d(null),h(null);const U=await K.saveLearnedCommand(I,D,w.trim()||void 0);U.ok?(E(U.commands),y(""),k(""),j(""),h(`Learned "${I}" for this machine.`)):d(U.error||"Could not save the command."),m(null)},[g,v,w,E]),_=b.useCallback(async I=>{m(I),d(null),h(null);const D=await K.forgetLearnedCommand(I);D.ok?(E(D.commands),h(`Forgot "${I}" on this machine.`)):d(D.error||`Could not forget "${I}".`),m(null)},[E]),R=(e==null?void 0:e.readyCount)??0,T=(e==null?void 0:e.blockedCount)??0,B=(e==null?void 0:e.missingExecutables)??[],$=(e==null?void 0:e.learnedCommands)??[];return i.jsxs("div",{children:[i.jsx(Oe,{icon:"🧰",title:"Capabilities"}),i.jsxs("div",{className:"env-var-header",children:[i.jsx("span",{className:"env-var-title",children:"What the agent can do on this machine, read from the same declarations the model discovers. A missing executable blocks a verb; a credential that is not an environment variable does not — it may live in the vault."}),i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void x(),children:"↻ Refresh"})]}),u?i.jsx("div",{className:"env-var-notice env-var-notice-error",children:u}):null,f?i.jsx("div",{className:"env-var-notice",children:f}):null,l?i.jsx("div",{className:"loading-state",children:"Loading…"}):e?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"cap-summary","data-testid":"cap-summary",children:[i.jsxs("span",{className:"cap-tile cap-tile-ok","data-testid":"cap-tile-ready",children:[i.jsx("strong",{children:R})," ready"]}),i.jsxs("span",{className:`cap-tile${T>0?" cap-tile-blocked":""}`,"data-testid":"cap-tile-blocked",children:[i.jsx("strong",{children:T})," blocked"]}),i.jsxs("span",{className:`cap-tile${B.length>0?" cap-tile-blocked":""}`,"data-testid":"cap-tile-missing",children:[i.jsx("strong",{children:B.length})," missing executable",B.length===1?"":"s"]}),i.jsxs("span",{className:"cap-tile","data-testid":"cap-tile-grants",children:[i.jsx("strong",{children:n.length})," live session grant",n.length===1?"":"s"]})]}),i.jsxs("section",{className:"cap-section","data-testid":"cap-missing",children:[i.jsx("h3",{className:"cap-section-title",children:"Missing executables"}),B.length===0?i.jsx("p",{className:"cap-empty",children:"Every executable the curated verbs need is on PATH."}):i.jsx("ul",{className:"cap-missing-list",children:B.map(I=>i.jsxs("li",{className:"cap-missing-row",children:[i.jsx("code",{className:"cap-missing-bins",children:I.anyOf.join(" or ")}),i.jsxs("span",{className:"cap-missing-for",children:["needed by ",I.forRefs.join(", ")]}),i.jsx("span",{className:"cap-missing-remedy",children:I.remedy})]},I.anyOf.join("|")))})]}),i.jsxs("section",{className:"cap-section","data-testid":"cap-verbs",children:[i.jsx("h3",{className:"cap-section-title",children:"Curated verbs"}),i.jsx("div",{className:"cap-verb-list",children:e.verbs.map(I=>i.jsx(Zbe,{verb:I},I.id))})]}),i.jsxs("section",{className:"cap-section","data-testid":"cap-learned",children:[i.jsxs("h3",{className:"cap-section-title",children:["Learned commands (",$.length,")"]}),i.jsx("p",{className:"cap-section-blurb",children:"Commands derived for this machine, keyed by what they do — recorded by the model or observed from a labelled run. They are HINTS: the agent still checks presence before running one. Add or replace one with the same verb below."}),$.length===0?i.jsx("p",{className:"cap-empty",children:"Nothing learned yet — the agent records a command when it derives one, or when a labelled run succeeds."}):i.jsx("ul",{className:"cap-learned-list",children:$.map(I=>i.jsxs("li",{className:"cap-learned-row","data-testid":`cap-learned-${I.verb}`,children:[i.jsx("span",{className:"cap-learned-verb",children:I.verb}),i.jsx("span",{className:"cap-badge cap-effect-local",children:I.os}),i.jsx("span",{className:"cap-badge cap-effect-read",children:I.source}),i.jsx("code",{className:"cap-learned-cmd",children:I.command}),I.note?i.jsx("span",{className:"cap-learned-note",children:I.note}):null,S?i.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",disabled:p===I.verb,onClick:()=>void _(I.verb),children:"Forget"}):null]},`${I.verb}|${I.os}`))}),S?i.jsxs("div",{className:"cap-learned-form",children:[i.jsx("input",{className:"env-var-input",type:"text","aria-label":"learned verb",placeholder:"verb (e.g. install java)",value:g,disabled:p==="__save__",onChange:I=>y(I.target.value)}),i.jsx("input",{className:"env-var-input",type:"text","aria-label":"learned command",placeholder:"command (e.g. brew install openjdk)",value:v,disabled:p==="__save__",onChange:I=>k(I.target.value)}),i.jsx("input",{className:"env-var-input",type:"text","aria-label":"learned note",placeholder:"note (optional)",value:w,disabled:p==="__save__",onChange:I=>j(I.target.value)}),i.jsx("button",{className:"admin-mini-btn",type:"button",disabled:!g.trim()||!v.trim()||p==="__save__",onClick:()=>void P(),children:"💾 Learn"})]}):i.jsx("div",{className:"admin-hint",children:"Read-only — admins and operators can add or remove learned commands."})]}),i.jsxs("section",{className:"cap-section","data-testid":"cap-grants",children:[i.jsx("h3",{className:"cap-section-title",children:"Live session grants"}),n.length===0?i.jsx("p",{className:"cap-empty",children:"No live session grants — off-machine actions will ask."}):i.jsx("ul",{className:"cap-grant-list",children:n.map(I=>i.jsxs("li",{className:"cap-grant-row","data-testid":`cap-grant-${I.sessionId}`,children:[i.jsx("code",{className:"cap-grant-id",children:I.sessionId}),i.jsx("span",{className:"cap-grant-cats",children:I.categories.join(", ")||"(no categories)"}),i.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",disabled:p===I.sessionId,onClick:()=>void N(I.sessionId),children:"End"})]},I.sessionId))})]})]}):i.jsx("div",{className:"admin-hint",children:"Capabilities are unavailable right now."})]})}function Zbe({verb:e}){const t=Xbe(e.effect);return i.jsxs("div",{className:`cap-verb${e.ready?" cap-verb-ready":" cap-verb-blocked"}`,"data-testid":`cap-verb-${e.ref}`,children:[i.jsxs("div",{className:"cap-verb-header",children:[i.jsx("span",{className:"cap-verb-name",children:e.name}),i.jsx("span",{className:`cap-badge ${t.className}`,children:t.label}),i.jsx("span",{className:`cap-badge ${e.ready?"cap-effect-read":"cap-effect-destructive"}`,children:e.ready?"✅ ready":"⛔ blocked"}),e.grantable?i.jsxs("span",{className:"cap-badge cap-effect-local",children:["grantable: ",e.grantable]}):null]}),i.jsx("div",{className:"cap-verb-does",children:e.does}),e.gaps.length>0?i.jsx("ul",{className:"cap-verb-gaps",children:e.gaps.map(n=>i.jsx("li",{children:n},n))}):null,e.ask.length>0?i.jsxs("div",{className:"cap-verb-ask",children:["Will ask for: ",e.ask.join(", ")]}):null,e.onThisMachine?i.jsxs("div",{className:"cap-verb-cmd",children:["On this machine: ",i.jsx("code",{children:e.onThisMachine.command}),e.onThisMachine.note?i.jsxs("span",{className:"cap-verb-note",children:[" — ",e.onThisMachine.note]}):null]}):null,e.undo?i.jsxs("div",{className:"cap-verb-undo",children:["Undo: ",e.undo]}):null]})}function Jbe(e){const t={};for(const n of e.split(`
209
+ `)){const r=n.trim();if(!r||r.startsWith("#"))continue;const a=r.indexOf("=");if(a<=0)continue;const s=r.slice(0,a).trim(),o=r.slice(a+1).trim();!s||!o||(t[s]=o)}return t}function exe(e){const t={};for(const n of e.split(`
210
+ `)){const r=n.trim();if(!r||r.startsWith("#"))continue;const a=r.indexOf(":");if(a<=0)continue;const s=r.slice(0,a).trim(),o=r.slice(a+1).trim();!s||!o||(t[s]=o)}return t}function txe(e){return e.split(",").map(t=>t.trim()).filter(Boolean)}const xv={name:"",transport:"stdio",command:"",args:"",url:"",env:"",headers:"",overwrite:!1};function nxe(e){return{name:e.name,transport:e.transport==="sse"?"sse":"stdio",command:e.command??"",args:e.args.join(", "),url:e.url??"",env:e.envKeys.map(t=>`${t}=`).join(`
211
+ `),headers:e.headerKeys.map(t=>`${t}: `).join(`
212
+ `),overwrite:!0}}function ho({label:e,hint:t,value:n,onSave:r,disabled:a}){const[s,o]=b.useState(n),[l,c]=b.useState(!1),[u,d]=b.useState(null);b.useEffect(()=>o(n),[n]);const f=async()=>{c(!0);const h=await r(s);c(!1),d(h)};return i.jsxs("div",{className:"mcp-setting-row",children:[i.jsxs("div",{className:"mcp-setting-main",children:[i.jsx("label",{className:"mcp-setting-label",children:e}),i.jsx("span",{className:"mcp-setting-hint",children:t})]}),i.jsx("input",{className:"mcp-input",value:s,disabled:a||l,onChange:h=>o(h.target.value),onKeyDown:h=>{h.key==="Enter"&&s!==n&&f()}}),i.jsx("button",{className:"mcp-btn",disabled:a||l||s===n,onClick:()=>void f(),children:l?"…":"Save"}),u&&i.jsx("div",{className:"mcp-error",children:u}),i.jsx("style",{children:`
213
+ .mcp-setting-row { display: grid; grid-template-columns: 1fr 180px 72px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-light); }
214
+ .mcp-setting-main { display: flex; flex-direction: column; }
215
+ .mcp-setting-label { font-weight: 600; font-size: 13px; }
216
+ .mcp-setting-hint { font-size: 11px; color: var(--text-muted); }
217
+ .mcp-input { background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border-light); border-radius: 6px; padding: 6px 8px; font-size: 13px; }
218
+ .mcp-btn { background: var(--accent-blue); color: var(--text-on-accent); border: 0; border-radius: 6px; padding: 6px 10px; font-size: 12px; cursor: pointer; }
219
+ .mcp-btn:disabled { opacity: .4; cursor: not-allowed; }
220
+ .mcp-btn.secondary { background: transparent; border: 1px solid var(--border-light); color: var(--text-primary); }
221
+ .mcp-error { grid-column: 1 / -1; color: var(--accent-red); font-size: 12px; white-space: pre-wrap; }
222
+ .mcp-card { border: 1px solid var(--border-light); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
223
+ .mcp-card h3 { margin: 0 0 4px; font-size: 14px; }
224
+ .mcp-muted { color: var(--text-muted); font-size: 12px; }
225
+ .mcp-variant { border-top: 1px dashed var(--border-light); padding: 8px 0; font-size: 12px; }
226
+ .mcp-badge { display: inline-block; border-radius: 999px; padding: 1px 8px; font-size: 11px; margin-left: 6px; border: 1px solid var(--border-light); }
227
+ .mcp-badge.ok { color: var(--accent-green); }
228
+ .mcp-badge.bad { color: var(--accent-red); }
229
+ .mcp-problem { color: var(--accent-yellow); }
230
+ .mcp-offers { margin: 4px 0 8px 16px; padding: 0; font-size: 12px; }
231
+ `})]})}function rxe(){var P;const[e,t]=b.useState(null),[n,r]=b.useState(!0),[a,s]=b.useState(null),[o,l]=b.useState(null),[c,u]=b.useState(null),[d,f]=b.useState({}),[h,p]=b.useState({}),[m,g]=b.useState({}),[y,v]=b.useState(xv),k=b.useCallback(async(_=!1)=>{const R=await pB(_);if(!R){l("Could not reach the dashboard server, or the MCP API is unavailable (an older server?)."),r(!1);return}t(R),l(null),r(!1)},[]);b.useEffect(()=>{k(!1)},[k]);const w=async(_,R)=>{const T=await mB([{key:_,value:R}]);return T.ok?(t(B=>B&&T.settings?{...B,settings:T.settings}:B),u(`Saved ${_}`),l(null),null):(l(T.error??"The server refused that value."),T.error??"refused")},j=async _=>{var D;const R=h[_.name],B=(_.variants.find(U=>U.id===(R??""))??_.variants.find(U=>!U.optIn)??_.variants[0]).requires.filter(U=>U.kind==="env"),$={};for(const U of B){const M=d[`${_.name}:${U.name}`];M&&M.trim()&&($[U.name]=M.trim())}s(_.name);const I=await gB({name:_.name,...R?{variant:R}:{},...Object.keys($).length>0?{env:$}:{},...(D=m[_.name])!=null&&D.trim()?{runtime:m[_.name].trim()}:{}});if(s(null),!I.ok){l(I.reason??I.error??"Install refused."),u(null);return}f(U=>{const M={...U};for(const z of Object.keys(M))z.startsWith(`${_.name}:`)&&delete M[z];return M}),u(`Installed ${_.name} (${I.variantId}) → ${I.path}`),l(null),await k((e==null?void 0:e.deep)===!0)},S=async()=>{var T;const _=y.name.trim();if(!_){l("A server name is required — it becomes the config filename.");return}s("__custom__");const R=await vB({name:_,transport:y.transport,...y.transport==="stdio"?{...y.command.trim()?{command:y.command.trim()}:{},args:txe(y.args),env:Jbe(y.env)}:{...y.url.trim()?{url:y.url.trim()}:{},headers:exe(y.headers)},...y.overwrite?{overwrite:!0}:{}});if(s(null),!R.ok){l(R.reason??R.error??"Could not save that server."),u(null);return}u(`${R.overwrote?"Updated":"Added"} ${_}${R.path?` → ${R.path}`:""}`+((T=R.warnings)!=null&&T.length?`
232
+ ${R.warnings.join(`
233
+ `)}`:"")),l(null),v(xv),await k((e==null?void 0:e.deep)===!0)},x=async _=>{s(_);const R=await yB(_);if(s(null),!R.ok){l(R.reason??"Could not remove that server.");return}u(`Removed ${_}`),await k((e==null?void 0:e.deep)===!0)},N=(e==null?void 0:e.canWrite)??!1,E=(e==null?void 0:e.servers)??[];return i.jsxs("div",{className:"page",children:[i.jsx(Oe,{icon:"🔌",title:"MCP",description:"External MCP servers — configured once here and used by the agent on every surface. These controls write the same mcp.* config the CLI does."}),i.jsxs("div",{className:"mcp-card",children:[i.jsxs("div",{className:"mcp-muted",children:["Config file: ",i.jsx("code",{children:(e==null?void 0:e.configDir)??"…"})," — these controls write the same"," ",i.jsx("code",{children:"mcp.*"})," keys as ",i.jsx("code",{children:"nuvira config set mcp.*"}),", so the terminal and this page can never disagree."]}),i.jsxs("div",{style:{marginTop:10},children:[i.jsx("button",{className:"mcp-btn secondary",onClick:()=>void k(!0),disabled:n,children:"Check dependencies"}),i.jsx("span",{className:"mcp-muted",style:{marginLeft:8},children:e!=null&&e.deep?"service checks ran (e.g. docker daemon)":"service checks skipped on page load — press to probe them"})]})]}),o&&i.jsx("div",{className:"mcp-card mcp-problem",style:{whiteSpace:"pre-wrap"},children:o}),c&&i.jsx("div",{className:"mcp-card mcp-muted",children:c}),n&&i.jsx("div",{className:"mcp-card mcp-muted",children:"Loading MCP configuration…"}),e&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"mcp-card",children:[i.jsx("h3",{children:"Settings"}),i.jsx("div",{className:"mcp-muted",children:"Applies to every MCP server on every surface."}),i.jsx(ho,{label:"Enabled",hint:"Master switch — false makes MCP inert everywhere (true/false)",value:String(e.settings.enabled),disabled:!N,onSave:_=>w("mcp.enabled",_)}),i.jsx(ho,{label:"Auto-connect",hint:"Connect configured servers at the start of a turn (bounded, never fatal)",value:String(e.settings.autoConnect),disabled:!N,onSave:_=>w("mcp.autoConnect",_)}),i.jsx(ho,{label:"Connect timeout (ms)",hint:"Wall-clock budget for the connect step; exceeding it proceeds without MCP",value:String(e.settings.connectTimeoutMs),disabled:!N,onSave:_=>w("mcp.connectTimeoutMs",_)}),i.jsx(ho,{label:"Tools per server",hint:"Per-server eager-schema cap — stored and reported; enforcement is not wired yet (nothing is truncated today)",value:String(e.settings.maxToolsPerServer),disabled:!N,onSave:_=>w("mcp.maxToolsPerServer",_)}),i.jsx(ho,{label:"Tools in total",hint:"Cross-server ceiling — stored and reported; enforcement is not wired yet (nothing is truncated today)",value:String(e.settings.maxToolsTotal),disabled:!N,onSave:_=>w("mcp.maxToolsTotal",_)}),i.jsx(ho,{label:"Subagents inherit",hint:"conservative = only when the parent had MCP AND the child's allowance covers it; full = pass the parent's whole MCP set down (reach, never approval)",value:e.settings.subagentInheritance,disabled:!N,onSave:_=>w("mcp.subagent.inherit",_)}),((P=e.settings.warnings)==null?void 0:P.length)>0&&i.jsx("div",{className:"mcp-error",children:e.settings.warnings.join(`
234
+ `)})]}),i.jsxs("div",{className:"mcp-card",children:[i.jsxs("h3",{children:["Configured servers (",E.length,")"]}),E.length===0&&i.jsx("div",{className:"mcp-muted",children:"None yet. Add one by hand below (any server), install one from the catalog, or drop a JSON file into the config directory."}),E.map(_=>{const R=e.settings.servers[_.name]??{};return i.jsxs("div",{className:"mcp-variant",children:[i.jsxs("div",{children:[i.jsx("strong",{children:_.name}),i.jsx("span",{className:"mcp-badge",children:_.transport}),_.variant&&i.jsxs("span",{className:"mcp-badge",children:["variant ",_.variant]}),i.jsx("span",{className:`mcp-badge ${_.enabled?"ok":"bad"}`,children:_.enabled?"enabled":"disabled"}),_.connected&&i.jsx("span",{className:"mcp-badge ok",children:"connected"})]}),i.jsxs("div",{className:"mcp-muted",children:[_.command?`${_.command} ${_.args.join(" ")}`:_.url,_.runtime?` (runtime: ${[_.runtime.command,..._.runtime.args??[]].join(" ")})`:"",_.envKeys.length>0?` · credentials: ${_.envKeys.join(", ")}`:"",_.headerKeys.length>0?` · headers: ${_.headerKeys.join(", ")}`:""]}),i.jsxs("div",{style:{marginTop:6,display:"flex",gap:8,flexWrap:"wrap"},children:[i.jsx("button",{className:"mcp-btn secondary",disabled:!N,onClick:()=>v(nxe(_)),children:"Edit"}),i.jsx("button",{className:"mcp-btn secondary",disabled:!N||a===_.name,onClick:()=>void w(`mcp.servers.${_.name}.enabled`,_.enabled?"false":"true"),children:_.enabled?"Disable":"Enable"}),i.jsx("input",{className:"mcp-input",style:{minWidth:260},placeholder:"runtime override, e.g. /opt/node20/bin/node /usr/local/bin/npx",defaultValue:R.runtime?[R.runtime.command,...R.runtime.args??[]].join(" "):"",disabled:!N,onKeyDown:T=>{T.key==="Enter"&&w(`mcp.servers.${_.name}.runtime.command`,T.target.value)}}),i.jsx("button",{className:"mcp-btn secondary",disabled:!N,onClick:()=>void w(`mcp.servers.${_.name}.runtime.command`,""),children:"Clear runtime"}),i.jsx("button",{className:"mcp-btn secondary",disabled:!N||a===_.name,onClick:()=>void x(_.name),children:"Uninstall"})]})]},_.name)})]}),i.jsxs("div",{className:"mcp-card",children:[i.jsx("h3",{children:"Add a server"}),i.jsxs("div",{className:"mcp-muted",children:["Any MCP server — a local command or a remote endpoint — not only the ones in the catalog below. This writes ",i.jsxs("code",{children:[e.configDir,"/<name>.json"]}),", the same file"," ",i.jsx("code",{children:"nuvira mcp add"})," writes, so the agent uses it on the next turn: no code, no release. Use ",i.jsx("strong",{children:"Edit"})," on a configured server to change it."]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"180px 1fr",gap:10,alignItems:"center",marginTop:10},children:[i.jsx("label",{className:"mcp-setting-label",children:"Name"}),i.jsx("input",{className:"mcp-input",placeholder:"my-server",value:y.name,disabled:!N||a==="__custom__",onChange:_=>v({...y,name:_.target.value})}),i.jsx("label",{className:"mcp-setting-label",children:"Transport"}),i.jsxs("div",{children:[i.jsxs("label",{className:"mcp-muted",style:{marginRight:12},children:[i.jsx("input",{type:"radio",name:"custom-transport",checked:y.transport==="stdio",disabled:!N,onChange:()=>v({...y,transport:"stdio"})})," ","stdio (a local process)"]}),i.jsxs("label",{className:"mcp-muted",children:[i.jsx("input",{type:"radio",name:"custom-transport",checked:y.transport==="sse",disabled:!N,onChange:()=>v({...y,transport:"sse"})})," ","remote (Streamable HTTP)"]})]}),y.transport==="stdio"?i.jsxs(i.Fragment,{children:[i.jsx("label",{className:"mcp-setting-label",children:"Command"}),i.jsx("input",{className:"mcp-input",placeholder:"npx",value:y.command,disabled:!N||a==="__custom__",onChange:_=>v({...y,command:_.target.value})}),i.jsx("label",{className:"mcp-setting-label",children:"Arguments"}),i.jsx("input",{className:"mcp-input",placeholder:"-y, @modelcontextprotocol/server-filesystem, /path/to/dir",value:y.args,disabled:!N||a==="__custom__",onChange:_=>v({...y,args:_.target.value})}),i.jsx("label",{className:"mcp-setting-label",children:"Environment"}),i.jsx("textarea",{className:"mcp-input",rows:3,placeholder:`TOKEN=…
235
+ ANOTHER=…`,value:y.env,disabled:!N||a==="__custom__",onChange:_=>v({...y,env:_.target.value})})]}):i.jsxs(i.Fragment,{children:[i.jsx("label",{className:"mcp-setting-label",children:"URL"}),i.jsx("input",{className:"mcp-input",placeholder:"https://example.com/mcp",value:y.url,disabled:!N||a==="__custom__",onChange:_=>v({...y,url:_.target.value})}),i.jsx("label",{className:"mcp-setting-label",children:"Headers"}),i.jsx("textarea",{className:"mcp-input",rows:3,placeholder:"Authorization: Bearer …",value:y.headers,disabled:!N||a==="__custom__",onChange:_=>v({...y,headers:_.target.value})})]})]}),i.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",marginTop:10,flexWrap:"wrap"},children:[i.jsxs("label",{className:"mcp-muted",children:[i.jsx("input",{type:"checkbox",checked:y.overwrite,disabled:!N||a==="__custom__",onChange:_=>v({...y,overwrite:_.target.checked})})," ","Replace the existing config for this name"]}),i.jsx("button",{className:"mcp-btn",disabled:!N||a==="__custom__",onClick:()=>void S(),children:a==="__custom__"?"Saving…":y.overwrite?"Save server":"Add server"}),i.jsx("button",{className:"mcp-btn secondary",disabled:a==="__custom__",onClick:()=>v(xv),children:"Clear"})]}),i.jsx("div",{className:"mcp-muted",style:{marginTop:8},children:"Credentials typed here go into the config file (mode 0600) and are never sent back to this page — editing an existing server keeps the secrets it already has unless you type a new value over them."})]}),i.jsxs("div",{className:"mcp-card",children:[i.jsxs("h3",{children:["Catalog (",e.catalog.length," capabilities)"]}),i.jsx("div",{className:"mcp-muted",children:"Each capability lists every way it can run on THIS machine, what that way needs, and what you get. A dependency that is missing (install it) is different from a service that is down (start it)."}),e.catalog.map(_=>i.jsxs("div",{className:"mcp-variant",children:[i.jsxs("div",{children:[i.jsx("strong",{children:_.name}),_.installed&&i.jsx("span",{className:"mcp-badge ok",children:"installed"}),i.jsxs("span",{className:"mcp-muted",children:[" — ",_.description]})]}),i.jsx("ul",{className:"mcp-offers",children:_.offers.map(R=>i.jsx("li",{children:R},R))}),_.supersedes&&i.jsxs("div",{className:"mcp-muted",children:["supersedes: ",_.supersedes]}),_.variants.map(R=>i.jsxs("div",{className:"mcp-muted",style:{marginLeft:12},children:[i.jsxs("label",{children:[i.jsx("input",{type:"radio",name:`variant-${_.name}`,checked:(h[_.name]??"")===R.id,disabled:R.optIn===!1&&h[_.name]!==R.id?!1:!N,onChange:()=>p(T=>({...T,[_.name]:R.id}))})," ",i.jsx("strong",{children:R.id})," — ",R.label," ",i.jsx("span",{className:`mcp-badge ${R.status.ok?"ok":"bad"}`,children:R.status.ok?"runnable":"cannot run yet"}),R.optIn&&i.jsx("span",{className:"mcp-badge",children:"opt-in"}),i.jsx("span",{className:"mcp-badge",children:R.trust})]}),i.jsx("div",{children:R.command?`${R.command} ${R.args.join(" ")}`:R.url}),R.status.problems.map(T=>i.jsxs("div",{className:"mcp-problem",children:["⚠ ",T]},T)),R.status.unverified.map(T=>i.jsxs("div",{children:["note: ",T]},T)),R.note&&i.jsxs("div",{children:["caveat: ",R.note]})]},R.id)),i.jsxs("div",{style:{marginTop:6,display:"flex",gap:8,flexWrap:"wrap"},children:[(_.variants.find(T=>T.id===h[_.name])??_.variants.find(T=>!T.optIn)??_.variants[0]).requires.filter(T=>T.kind==="env").map(T=>i.jsx("input",{className:"mcp-input",style:{minWidth:280},type:"password",placeholder:`${T.name} (${T.hint})`,disabled:!N,value:d[`${_.name}:${T.name}`]??"",onChange:B=>f($=>({...$,[`${_.name}:${T.name}`]:B.target.value}))},T.name)),i.jsx("input",{className:"mcp-input",placeholder:"runtime override (optional)",disabled:!N,value:m[_.name]??"",onChange:R=>g(T=>({...T,[_.name]:R.target.value}))}),i.jsx("button",{className:"mcp-btn",disabled:!N||a===_.name||_.installed,onClick:()=>void j(_),children:a===_.name?"Installing…":_.installed?"Installed":"Install"})]})]},_.name))]})]})]})}function axe(){const[e,t]=b.useState(null),[n,r]=b.useState(!1),[a,s]=b.useState("--"),[o,l]=b.useState(!1),u=Li().pathname==="/chat",[d,f]=b.useState(u);b.useEffect(()=>{u&&f(!0)},[u]);const h=b.useCallback(g=>{t(g),s(new Date().toLocaleTimeString())},[]),p=b.useCallback(g=>{r(g)},[]),m=b.useCallback(async()=>{l(!0);try{const g=await K.fetchAll();g&&h(g)}finally{l(!1)}},[h]);return b.useEffect(()=>{K.fetchAll().then(v=>{v&&h(v)});const g=K.subscribe(h),y=K.onConnectionChange(p);return K.connect(),()=>{g(),y(),K.disconnect()}},[h,p]),i.jsxs(TB,{connected:n,lastUpdated:a,onRefresh:m,refreshing:o,children:[d&&i.jsx("div",{style:{display:u?void 0:"none"},children:i.jsx(gbe,{})}),i.jsx("div",{style:{display:u?"none":void 0},children:i.jsxs(G2,{children:[i.jsx(Ge,{path:"/",element:i.jsx(iS,{to:"/overview",replace:!0})}),i.jsx(Ge,{path:"/overview",element:i.jsx(use,{data:e,onRefresh:m,refreshing:o})}),i.jsx(Ge,{path:"/chat",element:null}),i.jsx(Ge,{path:"/dag",element:i.jsx(wse,{data:e})}),i.jsx(Ge,{path:"/costs",element:i.jsx(kse,{data:e})}),i.jsx(Ge,{path:"/benchmarks",element:i.jsx(jse,{data:e})}),i.jsx(Ge,{path:"/models",element:i.jsx(moe,{})}),i.jsx(Ge,{path:"/models/timeline",element:i.jsx(Tbe,{})}),i.jsx(Ge,{path:"/routing",element:i.jsx(Xoe,{data:e})}),i.jsx(Ge,{path:"/requests",element:i.jsx(nle,{data:e})}),i.jsx(Ge,{path:"/traces",element:i.jsx(ple,{})}),i.jsx(Ge,{path:"/hub",element:i.jsx(Rle,{})}),i.jsx(Ge,{path:"/capabilities",element:i.jsx(Qbe,{})}),i.jsx(Ge,{path:"/tasks",element:i.jsx(Fle,{})}),i.jsx(Ge,{path:"/evals",element:i.jsx(wbe,{data:e})}),i.jsx(Ge,{path:"/platforms",element:i.jsx(jbe,{})}),i.jsx(Ge,{path:"/mcp",element:i.jsx(rxe,{})}),i.jsx(Ge,{path:"/bedrock",element:i.jsx(Ebe,{canWrite:!0,sessionExpired:g=>console.error(g)})}),i.jsx(Ge,{path:"/contacts",element:i.jsx(_be,{})}),i.jsx(Ge,{path:"/gateway",element:i.jsx(Sbe,{})}),i.jsx(Ge,{path:"/env",element:i.jsx(Ube,{})}),i.jsx(Ge,{path:"/process-env",element:i.jsx(Gbe,{})}),i.jsx(Ge,{path:"/hooks",element:i.jsx(Vbe,{})}),i.jsx(Ge,{path:"/memory",element:i.jsx(Rbe,{data:e})}),i.jsx(Ge,{path:"/knowledge",element:i.jsx(Mbe,{})}),i.jsx(Ge,{path:"/history",element:i.jsx(Lbe,{data:e})}),i.jsx(Ge,{path:"/decisions",element:i.jsx(Bbe,{})}),i.jsx(Ge,{path:"/executions",element:i.jsx(zbe,{onFetch:g=>K.fetchExecutionAudit(g)})}),i.jsx(Ge,{path:"/system",element:i.jsx(Ose,{data:e,connected:n,lastUpdated:a})}),i.jsx(Ge,{path:"/admin",element:i.jsx(xle,{})}),i.jsx(Ge,{path:"/help",element:i.jsx(dse,{})}),i.jsx(Ge,{path:"*",element:i.jsx(iS,{to:"/overview",replace:!0})})]})})]})}iw(LT());kT(document.getElementById("root")).render(i.jsx(b.StrictMode,{children:i.jsx(J2,{children:i.jsx(axe,{})})}));
236
+ //# sourceMappingURL=index-CGYIlLpO.js.map