agent-nuvira 3.3.0 → 3.3.3

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 (231) hide show
  1. package/.agents/skills/code-assessment/SKILL.md +10 -1
  2. package/.agents/skills/index.json +1 -1
  3. package/README.md +47 -9
  4. package/dist/agents/agents/runner.d.ts +9 -0
  5. package/dist/agents/agents/runner.d.ts.map +1 -1
  6. package/dist/agents/agents/runner.js +34 -12
  7. package/dist/agents/agents/runner.js.map +1 -1
  8. package/dist/agents/agents/writer-tool-calling.d.ts.map +1 -1
  9. package/dist/agents/agents/writer-tool-calling.js +7 -2
  10. package/dist/agents/agents/writer-tool-calling.js.map +1 -1
  11. package/dist/agents/agents/writer.d.ts.map +1 -1
  12. package/dist/agents/agents/writer.js +7 -1
  13. package/dist/agents/agents/writer.js.map +1 -1
  14. package/dist/agents/artifact-verification.d.ts +102 -0
  15. package/dist/agents/artifact-verification.d.ts.map +1 -0
  16. package/dist/agents/artifact-verification.js +216 -0
  17. package/dist/agents/artifact-verification.js.map +1 -0
  18. package/dist/agents/checkpoint-store.d.ts +73 -0
  19. package/dist/agents/checkpoint-store.d.ts.map +1 -1
  20. package/dist/agents/checkpoint-store.js +161 -0
  21. package/dist/agents/checkpoint-store.js.map +1 -1
  22. package/dist/agents/credential-store.d.ts +120 -0
  23. package/dist/agents/credential-store.d.ts.map +1 -1
  24. package/dist/agents/credential-store.js +358 -19
  25. package/dist/agents/credential-store.js.map +1 -1
  26. package/dist/agents/orchestrator.d.ts +10 -1
  27. package/dist/agents/orchestrator.d.ts.map +1 -1
  28. package/dist/agents/orchestrator.js +234 -75
  29. package/dist/agents/orchestrator.js.map +1 -1
  30. package/dist/agents/phase-engine.d.ts +61 -0
  31. package/dist/agents/phase-engine.d.ts.map +1 -1
  32. package/dist/agents/phase-engine.js +68 -2
  33. package/dist/agents/phase-engine.js.map +1 -1
  34. package/dist/agents/prompt-assembly.d.ts +11 -0
  35. package/dist/agents/prompt-assembly.d.ts.map +1 -1
  36. package/dist/agents/prompt-assembly.js +17 -0
  37. package/dist/agents/prompt-assembly.js.map +1 -1
  38. package/dist/agents/release-preflight.d.ts +121 -0
  39. package/dist/agents/release-preflight.d.ts.map +1 -0
  40. package/dist/agents/release-preflight.js +259 -0
  41. package/dist/agents/release-preflight.js.map +1 -0
  42. package/dist/agents/release-runner.d.ts +157 -0
  43. package/dist/agents/release-runner.d.ts.map +1 -0
  44. package/dist/agents/release-runner.js +719 -0
  45. package/dist/agents/release-runner.js.map +1 -0
  46. package/dist/agents/step-handoff.d.ts +190 -0
  47. package/dist/agents/step-handoff.d.ts.map +1 -0
  48. package/dist/agents/step-handoff.js +443 -0
  49. package/dist/agents/step-handoff.js.map +1 -0
  50. package/dist/cli/benchmark.d.ts.map +1 -1
  51. package/dist/cli/benchmark.js +11 -4
  52. package/dist/cli/benchmark.js.map +1 -1
  53. package/dist/cli/chat.d.ts.map +1 -1
  54. package/dist/cli/chat.js +25 -4
  55. package/dist/cli/chat.js.map +1 -1
  56. package/dist/cli/cli-program.d.ts.map +1 -1
  57. package/dist/cli/cli-program.js +9 -2
  58. package/dist/cli/cli-program.js.map +1 -1
  59. package/dist/cli/commands.d.ts +2 -1
  60. package/dist/cli/commands.d.ts.map +1 -1
  61. package/dist/cli/commands.js +3 -2
  62. package/dist/cli/commands.js.map +1 -1
  63. package/dist/cli/config.js +2 -2
  64. package/dist/cli/config.js.map +1 -1
  65. package/dist/cli/credentials.d.ts +28 -0
  66. package/dist/cli/credentials.d.ts.map +1 -0
  67. package/dist/cli/credentials.js +213 -0
  68. package/dist/cli/credentials.js.map +1 -0
  69. package/dist/cli/dashboard.d.ts +26 -0
  70. package/dist/cli/dashboard.d.ts.map +1 -1
  71. package/dist/cli/dashboard.js +123 -3
  72. package/dist/cli/dashboard.js.map +1 -1
  73. package/dist/cli/failover-runner.d.ts.map +1 -1
  74. package/dist/cli/failover-runner.js +9 -3
  75. package/dist/cli/failover-runner.js.map +1 -1
  76. package/dist/cli/intent.d.ts +1 -1
  77. package/dist/cli/intent.js +2 -2
  78. package/dist/cli/intent.js.map +1 -1
  79. package/dist/cli/loop-executor.d.ts +7 -0
  80. package/dist/cli/loop-executor.d.ts.map +1 -1
  81. package/dist/cli/loop-executor.js +75 -7
  82. package/dist/cli/loop-executor.js.map +1 -1
  83. package/dist/cli/nlu.d.ts.map +1 -1
  84. package/dist/cli/nlu.js +8 -2
  85. package/dist/cli/nlu.js.map +1 -1
  86. package/dist/cli/process-control.d.ts +15 -0
  87. package/dist/cli/process-control.d.ts.map +1 -1
  88. package/dist/cli/process-control.js +38 -14
  89. package/dist/cli/process-control.js.map +1 -1
  90. package/dist/cli/publish.d.ts +22 -0
  91. package/dist/cli/publish.d.ts.map +1 -1
  92. package/dist/cli/publish.js +109 -13
  93. package/dist/cli/publish.js.map +1 -1
  94. package/dist/config/live-credentials.d.ts +57 -0
  95. package/dist/config/live-credentials.d.ts.map +1 -0
  96. package/dist/config/live-credentials.js +126 -0
  97. package/dist/config/live-credentials.js.map +1 -0
  98. package/dist/config/paths.d.ts +18 -0
  99. package/dist/config/paths.d.ts.map +1 -1
  100. package/dist/config/paths.js +25 -0
  101. package/dist/config/paths.js.map +1 -1
  102. package/dist/federation/a2a-types.js +1 -1
  103. package/dist/federation/a2a-types.js.map +1 -1
  104. package/dist/forwarded.d.ts +2 -0
  105. package/dist/forwarded.d.ts.map +1 -0
  106. package/dist/forwarded.js +2 -0
  107. package/dist/forwarded.js.map +1 -0
  108. package/dist/inference/model-validator.d.ts +6 -1
  109. package/dist/inference/model-validator.d.ts.map +1 -1
  110. package/dist/inference/model-validator.js +7 -2
  111. package/dist/inference/model-validator.js.map +1 -1
  112. package/dist/inference/route-resolver.d.ts +116 -0
  113. package/dist/inference/route-resolver.d.ts.map +1 -0
  114. package/dist/inference/route-resolver.js +159 -0
  115. package/dist/inference/route-resolver.js.map +1 -0
  116. package/dist/inference/tool-call-utils.d.ts +44 -0
  117. package/dist/inference/tool-call-utils.d.ts.map +1 -1
  118. package/dist/inference/tool-call-utils.js +126 -4
  119. package/dist/inference/tool-call-utils.js.map +1 -1
  120. package/dist/learning/autonomy-policy.d.ts +24 -0
  121. package/dist/learning/autonomy-policy.d.ts.map +1 -1
  122. package/dist/learning/autonomy-policy.js +110 -23
  123. package/dist/learning/autonomy-policy.js.map +1 -1
  124. package/dist/learning/eval-framework.d.ts +24 -0
  125. package/dist/learning/eval-framework.d.ts.map +1 -1
  126. package/dist/learning/eval-framework.js +291 -0
  127. package/dist/learning/eval-framework.js.map +1 -1
  128. package/dist/learning/intent-envelope.d.ts +162 -0
  129. package/dist/learning/intent-envelope.d.ts.map +1 -0
  130. package/dist/learning/intent-envelope.js +235 -0
  131. package/dist/learning/intent-envelope.js.map +1 -0
  132. package/dist/learning/reasoning-trace.d.ts +2 -2
  133. package/dist/learning/reasoning-trace.d.ts.map +1 -1
  134. package/dist/learning/reasoning-trace.js +25 -1
  135. package/dist/learning/reasoning-trace.js.map +1 -1
  136. package/dist/learning/resilient-call.d.ts.map +1 -1
  137. package/dist/learning/resilient-call.js +29 -17
  138. package/dist/learning/resilient-call.js.map +1 -1
  139. package/dist/learning/run-trace.d.ts +164 -0
  140. package/dist/learning/run-trace.d.ts.map +1 -0
  141. package/dist/learning/run-trace.js +342 -0
  142. package/dist/learning/run-trace.js.map +1 -0
  143. package/dist/learning/skill-store.d.ts.map +1 -1
  144. package/dist/learning/skill-store.js +35 -10
  145. package/dist/learning/skill-store.js.map +1 -1
  146. package/dist/learning/skill-types.d.ts +14 -0
  147. package/dist/learning/skill-types.d.ts.map +1 -1
  148. package/dist/learning/skill-types.js +19 -0
  149. package/dist/learning/skill-types.js.map +1 -1
  150. package/dist/mcp/catalog.js +2 -3
  151. package/dist/mcp/catalog.js.map +1 -1
  152. package/dist/mcp/manager.d.ts.map +1 -1
  153. package/dist/mcp/manager.js +5 -3
  154. package/dist/mcp/manager.js.map +1 -1
  155. package/dist/resources/command-manifest.json +10 -10
  156. package/dist/skills/bundled-skills.d.ts.map +1 -1
  157. package/dist/skills/bundled-skills.js +13 -2
  158. package/dist/skills/bundled-skills.js.map +1 -1
  159. package/dist/skills/secret-capture.d.ts.map +1 -1
  160. package/dist/skills/secret-capture.js +9 -4
  161. package/dist/skills/secret-capture.js.map +1 -1
  162. package/dist/tools/coding-tools.d.ts.map +1 -1
  163. package/dist/tools/coding-tools.js +33 -8
  164. package/dist/tools/coding-tools.js.map +1 -1
  165. package/dist/tools/credentials-tool.d.ts +24 -0
  166. package/dist/tools/credentials-tool.d.ts.map +1 -0
  167. package/dist/tools/credentials-tool.js +125 -0
  168. package/dist/tools/credentials-tool.js.map +1 -0
  169. package/dist/tools/edit-verification.d.ts +78 -0
  170. package/dist/tools/edit-verification.d.ts.map +1 -1
  171. package/dist/tools/edit-verification.js +213 -16
  172. package/dist/tools/edit-verification.js.map +1 -1
  173. package/dist/tools/git-tool.d.ts +25 -7
  174. package/dist/tools/git-tool.d.ts.map +1 -1
  175. package/dist/tools/git-tool.js +155 -15
  176. package/dist/tools/git-tool.js.map +1 -1
  177. package/dist/tools/loop-project-context.d.ts.map +1 -1
  178. package/dist/tools/loop-project-context.js +16 -0
  179. package/dist/tools/loop-project-context.js.map +1 -1
  180. package/dist/tools/loop-route-feed.d.ts +57 -0
  181. package/dist/tools/loop-route-feed.d.ts.map +1 -0
  182. package/dist/tools/loop-route-feed.js +101 -0
  183. package/dist/tools/loop-route-feed.js.map +1 -0
  184. package/dist/tools/pipeline-tool.d.ts.map +1 -1
  185. package/dist/tools/pipeline-tool.js +8 -2
  186. package/dist/tools/pipeline-tool.js.map +1 -1
  187. package/dist/tools/publish-tool.d.ts.map +1 -1
  188. package/dist/tools/publish-tool.js +76 -10
  189. package/dist/tools/publish-tool.js.map +1 -1
  190. package/dist/tools/registry.d.ts +52 -3
  191. package/dist/tools/registry.d.ts.map +1 -1
  192. package/dist/tools/registry.js +88 -11
  193. package/dist/tools/registry.js.map +1 -1
  194. package/dist/tools/run-cli.d.ts.map +1 -1
  195. package/dist/tools/run-cli.js +15 -2
  196. package/dist/tools/run-cli.js.map +1 -1
  197. package/dist/tools/run-terminal.d.ts +9 -0
  198. package/dist/tools/run-terminal.d.ts.map +1 -1
  199. package/dist/tools/run-terminal.js +103 -6
  200. package/dist/tools/run-terminal.js.map +1 -1
  201. package/dist/tools/skill-tool.d.ts.map +1 -1
  202. package/dist/tools/skill-tool.js +5 -0
  203. package/dist/tools/skill-tool.js.map +1 -1
  204. package/dist/tools/tool-loop.d.ts +40 -6
  205. package/dist/tools/tool-loop.d.ts.map +1 -1
  206. package/dist/tools/tool-loop.js +409 -14
  207. package/dist/tools/tool-loop.js.map +1 -1
  208. package/dist/tools/toolsets.js +2 -2
  209. package/dist/tools/toolsets.js.map +1 -1
  210. package/dist/web-dashboard/chat-console.d.ts +5 -0
  211. package/dist/web-dashboard/chat-console.d.ts.map +1 -1
  212. package/dist/web-dashboard/chat-console.js +32 -3
  213. package/dist/web-dashboard/chat-console.js.map +1 -1
  214. package/dist/web-dashboard/server.d.ts +46 -0
  215. package/dist/web-dashboard/server.d.ts.map +1 -1
  216. package/dist/web-dashboard/server.js +115 -1
  217. package/dist/web-dashboard/server.js.map +1 -1
  218. package/dist/web-dashboard/src/admin-auth.d.ts +49 -2
  219. package/dist/web-dashboard/src/admin-auth.d.ts.map +1 -1
  220. package/dist/web-dashboard/src/admin-auth.js +64 -3
  221. package/dist/web-dashboard/src/admin-auth.js.map +1 -1
  222. package/dist/web-dashboard/src/types.d.ts +41 -0
  223. package/dist/web-dashboard/src/types.d.ts.map +1 -1
  224. package/dist/workflow/registry.js +1 -1
  225. package/dist/workflow/registry.js.map +1 -1
  226. package/package.json +9 -5
  227. package/src/web-dashboard/public/assets/index-CxDj7p6i.js +207 -0
  228. package/src/web-dashboard/public/assets/index-CxDj7p6i.js.map +1 -0
  229. package/src/web-dashboard/public/index.html +1 -1
  230. package/src/web-dashboard/public/assets/index-kCUkORm7.js +0 -207
  231. package/src/web-dashboard/public/assets/index-kCUkORm7.js.map +0 -1
@@ -1,207 +0,0 @@
1
- var a2=Object.defineProperty;var s2=(e,t,n)=>t in e?a2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Pr=(e,t,n)=>s2(e,typeof t!="symbol"?t+"":t,n);function o2(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var Hi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ej={exports:{}},Nh={},tj={exports:{}},De={};/**
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 hu=Symbol.for("react.element"),l2=Symbol.for("react.portal"),c2=Symbol.for("react.fragment"),u2=Symbol.for("react.strict_mode"),d2=Symbol.for("react.profiler"),f2=Symbol.for("react.provider"),h2=Symbol.for("react.context"),p2=Symbol.for("react.forward_ref"),m2=Symbol.for("react.suspense"),g2=Symbol.for("react.memo"),y2=Symbol.for("react.lazy"),X0=Symbol.iterator;function v2(e){return e===null||typeof e!="object"?null:(e=X0&&e[X0]||e["@@iterator"],typeof e=="function"?e:null)}var nj={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},rj=Object.assign,ij={};function Wo(e,t,n){this.props=e,this.context=t,this.refs=ij,this.updater=n||nj}Wo.prototype.isReactComponent={};Wo.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")};Wo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function aj(){}aj.prototype=Wo.prototype;function sb(e,t,n){this.props=e,this.context=t,this.refs=ij,this.updater=n||nj}var ob=sb.prototype=new aj;ob.constructor=sb;rj(ob,Wo.prototype);ob.isPureReactComponent=!0;var Z0=Array.isArray,sj=Object.prototype.hasOwnProperty,lb={current:null},oj={key:!0,ref:!0,__self:!0,__source:!0};function lj(e,t,n){var r,i={},a=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)sj.call(t,r)&&!oj.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)i[r]===void 0&&(i[r]=l[r]);return{$$typeof:hu,type:e,key:a,ref:o,props:i,_owner:lb.current}}function b2(e,t){return{$$typeof:hu,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function cb(e){return typeof e=="object"&&e!==null&&e.$$typeof===hu}function x2(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Q0=/\/+/g;function Vp(e,t){return typeof e=="object"&&e!==null&&e.key!=null?x2(""+e.key):t.toString(36)}function Td(e,t,n,r,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case hu:case l2:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+Vp(o,0):r,Z0(i)?(n="",e!=null&&(n=e.replace(Q0,"$&/")+"/"),Td(i,t,n,"",function(u){return u})):i!=null&&(cb(i)&&(i=b2(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Q0,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=r===""?".":r+":",Z0(e))for(var l=0;l<e.length;l++){a=e[l];var c=r+Vp(a,l);o+=Td(a,t,n,c,i)}else if(c=v2(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=r+Vp(a,l++),o+=Td(a,t,n,c,i);else if(a==="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 Lu(e,t,n){if(e==null)return e;var r=[],i=0;return Td(e,r,"","",function(a){return t.call(n,a,i++)}),r}function w2(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 _n={current:null},Cd={transition:null},S2={ReactCurrentDispatcher:_n,ReactCurrentBatchConfig:Cd,ReactCurrentOwner:lb};function cj(){throw Error("act(...) is not supported in production builds of React.")}De.Children={map:Lu,forEach:function(e,t,n){Lu(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Lu(e,function(){t++}),t},toArray:function(e){return Lu(e,function(t){return t})||[]},only:function(e){if(!cb(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};De.Component=Wo;De.Fragment=c2;De.Profiler=d2;De.PureComponent=sb;De.StrictMode=u2;De.Suspense=m2;De.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=S2;De.act=cj;De.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=rj({},e.props),i=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=lb.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)sj.call(t,c)&&!oj.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:hu,type:e.type,key:i,ref:a,props:r,_owner:o}};De.createContext=function(e){return e={$$typeof:h2,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:f2,_context:e},e.Consumer=e};De.createElement=lj;De.createFactory=function(e){var t=lj.bind(null,e);return t.type=e,t};De.createRef=function(){return{current:null}};De.forwardRef=function(e){return{$$typeof:p2,render:e}};De.isValidElement=cb;De.lazy=function(e){return{$$typeof:y2,_payload:{_status:-1,_result:e},_init:w2}};De.memo=function(e,t){return{$$typeof:g2,type:e,compare:t===void 0?null:t}};De.startTransition=function(e){var t=Cd.transition;Cd.transition={};try{e()}finally{Cd.transition=t}};De.unstable_act=cj;De.useCallback=function(e,t){return _n.current.useCallback(e,t)};De.useContext=function(e){return _n.current.useContext(e)};De.useDebugValue=function(){};De.useDeferredValue=function(e){return _n.current.useDeferredValue(e)};De.useEffect=function(e,t){return _n.current.useEffect(e,t)};De.useId=function(){return _n.current.useId()};De.useImperativeHandle=function(e,t,n){return _n.current.useImperativeHandle(e,t,n)};De.useInsertionEffect=function(e,t){return _n.current.useInsertionEffect(e,t)};De.useLayoutEffect=function(e,t){return _n.current.useLayoutEffect(e,t)};De.useMemo=function(e,t){return _n.current.useMemo(e,t)};De.useReducer=function(e,t,n){return _n.current.useReducer(e,t,n)};De.useRef=function(e){return _n.current.useRef(e)};De.useState=function(e){return _n.current.useState(e)};De.useSyncExternalStore=function(e,t,n){return _n.current.useSyncExternalStore(e,t,n)};De.useTransition=function(){return _n.current.useTransition()};De.version="18.3.1";tj.exports=De;var E=tj.exports;const W=Xe(E),k2=o2({__proto__:null,default:W},[E]);/**
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 E2=E,_2=Symbol.for("react.element"),N2=Symbol.for("react.fragment"),j2=Object.prototype.hasOwnProperty,A2=E2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,T2={key:!0,ref:!0,__self:!0,__source:!0};function uj(e,t,n){var r,i={},a=null,o=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)j2.call(t,r)&&!T2.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:_2,type:e,key:a,ref:o,props:i,_owner:A2.current}}Nh.Fragment=N2;Nh.jsx=uj;Nh.jsxs=uj;ej.exports=Nh;var s=ej.exports,dj={exports:{}},Xn={},fj={exports:{}},hj={};/**
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(O,P){var A=O.length;O.push(P);e:for(;0<A;){var Y=A-1>>>1,K=O[Y];if(0<i(K,P))O[Y]=P,O[A]=K,A=Y;else break e}}function n(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var P=O[0],A=O.pop();if(A!==P){O[0]=A;e:for(var Y=0,K=O.length,M=K>>>1;Y<M;){var le=2*(Y+1)-1,be=O[le],me=le+1,Pe=O[me];if(0>i(be,A))me<K&&0>i(Pe,be)?(O[Y]=Pe,O[me]=A,Y=me):(O[Y]=be,O[le]=A,Y=le);else if(me<K&&0>i(Pe,A))O[Y]=Pe,O[me]=A,Y=me;else break e}}return P}function i(O,P){var A=O.sortIndex-P.sortIndex;return A!==0?A:O.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.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,g=!1,m=!1,v=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(O){for(var P=n(u);P!==null;){if(P.callback===null)r(u);else if(P.startTime<=O)r(u),P.sortIndex=P.expirationTime,t(c,P);else break;P=n(u)}}function k(O){if(m=!1,x(O),!g)if(n(c)!==null)g=!0,D(S);else{var P=n(u);P!==null&&F(k,P.startTime-O)}}function S(O,P){g=!1,m&&(m=!1,y(N),N=-1),p=!0;var A=h;try{for(x(P),f=n(c);f!==null&&(!(f.expirationTime>P)||O&&!$());){var Y=f.callback;if(typeof Y=="function"){f.callback=null,h=f.priorityLevel;var K=Y(f.expirationTime<=P);P=e.unstable_now(),typeof K=="function"?f.callback=K:f===n(c)&&r(c),x(P)}else r(c);f=n(c)}if(f!==null)var M=!0;else{var le=n(u);le!==null&&F(k,le.startTime-P),M=!1}return M}finally{f=null,h=A,p=!1}}var w=!1,_=null,N=-1,C=5,T=-1;function $(){return!(e.unstable_now()-T<C)}function R(){if(_!==null){var O=e.unstable_now();T=O;var P=!0;try{P=_(!0,O)}finally{P?L():(w=!1,_=null)}}else w=!1}var L;if(typeof b=="function")L=function(){b(R)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,z=I.port2;I.port1.onmessage=R,L=function(){z.postMessage(null)}}else L=function(){v(R,0)};function D(O){_=O,w||(w=!0,L())}function F(O,P){N=v(function(){O(e.unstable_now())},P)}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(O){O.callback=null},e.unstable_continueExecution=function(){g||p||(g=!0,D(S))},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(O){switch(h){case 1:case 2:case 3:var P=3;break;default:P=h}var A=h;h=P;try{return O()}finally{h=A}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(O,P){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var A=h;h=O;try{return P()}finally{h=A}},e.unstable_scheduleCallback=function(O,P,A){var Y=e.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0<A?Y+A:Y):A=Y,O){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=A+K,O={id:d++,callback:P,priorityLevel:O,startTime:A,expirationTime:K,sortIndex:-1},A>Y?(O.sortIndex=A,t(u,O),n(c)===null&&O===n(u)&&(m?(y(N),N=-1):m=!0,F(k,A-Y))):(O.sortIndex=K,t(c,O),g||p||(g=!0,D(S))),O},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(O){var P=h;return function(){var A=h;h=P;try{return O.apply(this,arguments)}finally{h=A}}}})(hj);fj.exports=hj;var C2=fj.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 O2=E,Vn=C2;function ie(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 pj=new Set,lc={};function ls(e,t){fo(e,t),fo(e+"Capture",t)}function fo(e,t){for(lc[e]=t,e=0;e<t.length;e++)pj.add(t[e])}var hi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ng=Object.prototype.hasOwnProperty,P2=/^[: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]*$/,J0={},ew={};function M2(e){return Ng.call(ew,e)?!0:Ng.call(J0,e)?!1:P2.test(e)?ew[e]=!0:(J0[e]=!0,!1)}function R2(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 I2(e,t,n,r){if(t===null||typeof t>"u"||R2(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 Nn(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var sn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){sn[e]=new Nn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];sn[t]=new Nn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){sn[e]=new Nn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){sn[e]=new Nn(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){sn[e]=new Nn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){sn[e]=new Nn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){sn[e]=new Nn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){sn[e]=new Nn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){sn[e]=new Nn(e,5,!1,e.toLowerCase(),null,!1,!1)});var ub=/[\-:]([a-z])/g;function db(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(ub,db);sn[t]=new Nn(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(ub,db);sn[t]=new Nn(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(ub,db);sn[t]=new Nn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){sn[e]=new Nn(e,1,!1,e.toLowerCase(),null,!1,!1)});sn.xlinkHref=new Nn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){sn[e]=new Nn(e,1,!1,e.toLowerCase(),null,!0,!0)});function fb(e,t,n,r){var i=sn.hasOwnProperty(t)?sn[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(I2(t,n,i,r)&&(n=null),r||i===null?M2(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var xi=O2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Du=Symbol.for("react.element"),Ds=Symbol.for("react.portal"),Bs=Symbol.for("react.fragment"),hb=Symbol.for("react.strict_mode"),jg=Symbol.for("react.profiler"),mj=Symbol.for("react.provider"),gj=Symbol.for("react.context"),pb=Symbol.for("react.forward_ref"),Ag=Symbol.for("react.suspense"),Tg=Symbol.for("react.suspense_list"),mb=Symbol.for("react.memo"),Li=Symbol.for("react.lazy"),yj=Symbol.for("react.offscreen"),tw=Symbol.iterator;function vl(e){return e===null||typeof e!="object"?null:(e=tw&&e[tw]||e["@@iterator"],typeof e=="function"?e:null)}var _t=Object.assign,Yp;function zl(e){if(Yp===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Yp=t&&t[1]||""}return`
34
- `+Yp+e}var Xp=!1;function Zp(e,t){if(!e||Xp)return"";Xp=!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 i=u.stack.split(`
35
- `),a=r.stack.split(`
36
- `),o=i.length-1,l=a.length-1;1<=o&&0<=l&&i[o]!==a[l];)l--;for(;1<=o&&0<=l;o--,l--)if(i[o]!==a[l]){if(o!==1||l!==1)do if(o--,l--,0>l||i[o]!==a[l]){var c=`
37
- `+i[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{Xp=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?zl(e):""}function $2(e){switch(e.tag){case 5:return zl(e.type);case 16:return zl("Lazy");case 13:return zl("Suspense");case 19:return zl("SuspenseList");case 0:case 2:case 15:return e=Zp(e.type,!1),e;case 11:return e=Zp(e.type.render,!1),e;case 1:return e=Zp(e.type,!0),e;default:return""}}function Cg(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 Bs:return"Fragment";case Ds:return"Portal";case jg:return"Profiler";case hb:return"StrictMode";case Ag:return"Suspense";case Tg:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case gj:return(e.displayName||"Context")+".Consumer";case mj:return(e._context.displayName||"Context")+".Provider";case pb:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case mb:return t=e.displayName||null,t!==null?t:Cg(e.type)||"Memo";case Li:t=e._payload,e=e._init;try{return Cg(e(t))}catch{}}return null}function L2(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 Cg(t);case 8:return t===hb?"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 oa(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function vj(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function D2(e){var t=vj(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 i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,a.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 Bu(e){e._valueTracker||(e._valueTracker=D2(e))}function bj(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=vj(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Hd(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 Og(e,t){var n=t.checked;return _t({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function nw(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=oa(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 xj(e,t){t=t.checked,t!=null&&fb(e,"checked",t,!1)}function Pg(e,t){xj(e,t);var n=oa(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")?Mg(e,t.type,n):t.hasOwnProperty("defaultValue")&&Mg(e,t.type,oa(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function rw(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 Mg(e,t,n){(t!=="number"||Hd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Fl=Array.isArray;function to(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+oa(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Rg(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ie(91));return _t({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function iw(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(ie(92));if(Fl(n)){if(1<n.length)throw Error(ie(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:oa(n)}}function wj(e,t){var n=oa(t.value),r=oa(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 aw(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Sj(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 Ig(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Sj(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var zu,kj=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(zu=zu||document.createElement("div"),zu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=zu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function cc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Gl={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},B2=["Webkit","ms","Moz","O"];Object.keys(Gl).forEach(function(e){B2.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Gl[t]=Gl[e]})});function Ej(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Gl.hasOwnProperty(e)&&Gl[e]?(""+t).trim():t+"px"}function _j(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Ej(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var z2=_t({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 $g(e,t){if(t){if(z2[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ie(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ie(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ie(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ie(62))}}function Lg(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 Dg=null;function gb(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Bg=null,no=null,ro=null;function sw(e){if(e=gu(e)){if(typeof Bg!="function")throw Error(ie(280));var t=e.stateNode;t&&(t=Oh(t),Bg(e.stateNode,e.type,t))}}function Nj(e){no?ro?ro.push(e):ro=[e]:no=e}function jj(){if(no){var e=no,t=ro;if(ro=no=null,sw(e),t)for(e=0;e<t.length;e++)sw(t[e])}}function Aj(e,t){return e(t)}function Tj(){}var Qp=!1;function Cj(e,t,n){if(Qp)return e(t,n);Qp=!0;try{return Aj(e,t,n)}finally{Qp=!1,(no!==null||ro!==null)&&(Tj(),jj())}}function uc(e,t){var n=e.stateNode;if(n===null)return null;var r=Oh(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(ie(231,t,typeof n));return n}var zg=!1;if(hi)try{var bl={};Object.defineProperty(bl,"passive",{get:function(){zg=!0}}),window.addEventListener("test",bl,bl),window.removeEventListener("test",bl,bl)}catch{zg=!1}function F2(e,t,n,r,i,a,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var ql=!1,Gd=null,qd=!1,Fg=null,U2={onError:function(e){ql=!0,Gd=e}};function W2(e,t,n,r,i,a,o,l,c){ql=!1,Gd=null,F2.apply(U2,arguments)}function H2(e,t,n,r,i,a,o,l,c){if(W2.apply(this,arguments),ql){if(ql){var u=Gd;ql=!1,Gd=null}else throw Error(ie(198));qd||(qd=!0,Fg=u)}}function cs(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 Oj(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 ow(e){if(cs(e)!==e)throw Error(ie(188))}function G2(e){var t=e.alternate;if(!t){if(t=cs(e),t===null)throw Error(ie(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return ow(i),e;if(a===r)return ow(i),t;a=a.sibling}throw Error(ie(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,l=i.child;l;){if(l===n){o=!0,n=i,r=a;break}if(l===r){o=!0,r=i,n=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===n){o=!0,n=a,r=i;break}if(l===r){o=!0,r=a,n=i;break}l=l.sibling}if(!o)throw Error(ie(189))}}if(n.alternate!==r)throw Error(ie(190))}if(n.tag!==3)throw Error(ie(188));return n.stateNode.current===n?e:t}function Pj(e){return e=G2(e),e!==null?Mj(e):null}function Mj(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Mj(e);if(t!==null)return t;e=e.sibling}return null}var Rj=Vn.unstable_scheduleCallback,lw=Vn.unstable_cancelCallback,q2=Vn.unstable_shouldYield,K2=Vn.unstable_requestPaint,Tt=Vn.unstable_now,V2=Vn.unstable_getCurrentPriorityLevel,yb=Vn.unstable_ImmediatePriority,Ij=Vn.unstable_UserBlockingPriority,Kd=Vn.unstable_NormalPriority,Y2=Vn.unstable_LowPriority,$j=Vn.unstable_IdlePriority,jh=null,Ur=null;function X2(e){if(Ur&&typeof Ur.onCommitFiberRoot=="function")try{Ur.onCommitFiberRoot(jh,e,void 0,(e.current.flags&128)===128)}catch{}}var kr=Math.clz32?Math.clz32:J2,Z2=Math.log,Q2=Math.LN2;function J2(e){return e>>>=0,e===0?32:31-(Z2(e)/Q2|0)|0}var Fu=64,Uu=4194304;function Ul(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 Vd(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~i;l!==0?r=Ul(l):(a&=o,a!==0&&(r=Ul(a)))}else o=n&~i,o!==0?r=Ul(o):a!==0&&(r=Ul(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,a=t&-t,i>=a||i===16&&(a&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-kr(t),i=1<<n,r|=e[n],t&=~i;return r}function eI(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 tI(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-kr(a),l=1<<o,c=i[o];c===-1?(!(l&n)||l&r)&&(i[o]=eI(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function Ug(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Lj(){var e=Fu;return Fu<<=1,!(Fu&4194240)&&(Fu=64),e}function Jp(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function pu(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-kr(t),e[t]=n}function nI(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 i=31-kr(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function vb(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-kr(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var et=0;function Dj(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Bj,bb,zj,Fj,Uj,Wg=!1,Wu=[],Xi=null,Zi=null,Qi=null,dc=new Map,fc=new Map,zi=[],rI="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 cw(e,t){switch(e){case"focusin":case"focusout":Xi=null;break;case"dragenter":case"dragleave":Zi=null;break;case"mouseover":case"mouseout":Qi=null;break;case"pointerover":case"pointerout":dc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":fc.delete(t.pointerId)}}function xl(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=gu(t),t!==null&&bb(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function iI(e,t,n,r,i){switch(t){case"focusin":return Xi=xl(Xi,e,t,n,r,i),!0;case"dragenter":return Zi=xl(Zi,e,t,n,r,i),!0;case"mouseover":return Qi=xl(Qi,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return dc.set(a,xl(dc.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,fc.set(a,xl(fc.get(a)||null,e,t,n,r,i)),!0}return!1}function Wj(e){var t=Ia(e.target);if(t!==null){var n=cs(t);if(n!==null){if(t=n.tag,t===13){if(t=Oj(n),t!==null){e.blockedOn=t,Uj(e.priority,function(){zj(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 Od(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Hg(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Dg=r,n.target.dispatchEvent(r),Dg=null}else return t=gu(n),t!==null&&bb(t),e.blockedOn=n,!1;t.shift()}return!0}function uw(e,t,n){Od(e)&&n.delete(t)}function aI(){Wg=!1,Xi!==null&&Od(Xi)&&(Xi=null),Zi!==null&&Od(Zi)&&(Zi=null),Qi!==null&&Od(Qi)&&(Qi=null),dc.forEach(uw),fc.forEach(uw)}function wl(e,t){e.blockedOn===t&&(e.blockedOn=null,Wg||(Wg=!0,Vn.unstable_scheduleCallback(Vn.unstable_NormalPriority,aI)))}function hc(e){function t(i){return wl(i,e)}if(0<Wu.length){wl(Wu[0],e);for(var n=1;n<Wu.length;n++){var r=Wu[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Xi!==null&&wl(Xi,e),Zi!==null&&wl(Zi,e),Qi!==null&&wl(Qi,e),dc.forEach(t),fc.forEach(t),n=0;n<zi.length;n++)r=zi[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<zi.length&&(n=zi[0],n.blockedOn===null);)Wj(n),n.blockedOn===null&&zi.shift()}var io=xi.ReactCurrentBatchConfig,Yd=!0;function sI(e,t,n,r){var i=et,a=io.transition;io.transition=null;try{et=1,xb(e,t,n,r)}finally{et=i,io.transition=a}}function oI(e,t,n,r){var i=et,a=io.transition;io.transition=null;try{et=4,xb(e,t,n,r)}finally{et=i,io.transition=a}}function xb(e,t,n,r){if(Yd){var i=Hg(e,t,n,r);if(i===null)cm(e,t,r,Xd,n),cw(e,r);else if(iI(i,e,t,n,r))r.stopPropagation();else if(cw(e,r),t&4&&-1<rI.indexOf(e)){for(;i!==null;){var a=gu(i);if(a!==null&&Bj(a),a=Hg(e,t,n,r),a===null&&cm(e,t,r,Xd,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else cm(e,t,r,null,n)}}var Xd=null;function Hg(e,t,n,r){if(Xd=null,e=gb(r),e=Ia(e),e!==null)if(t=cs(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Oj(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 Xd=e,null}function Hj(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(V2()){case yb:return 1;case Ij:return 4;case Kd:case Y2:return 16;case $j:return 536870912;default:return 16}default:return 16}}var Gi=null,wb=null,Pd=null;function Gj(){if(Pd)return Pd;var e,t=wb,n=t.length,r,i="value"in Gi?Gi.value:Gi.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Pd=i.slice(e,1<r?1-r:void 0)}function Md(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 Hu(){return!0}function dw(){return!1}function Zn(e){function t(n,r,i,a,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Hu:dw,this.isPropagationStopped=dw,this}return _t(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=Hu)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Hu)},persist:function(){},isPersistent:Hu}),t}var Ho={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sb=Zn(Ho),mu=_t({},Ho,{view:0,detail:0}),lI=Zn(mu),em,tm,Sl,Ah=_t({},mu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kb,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!==Sl&&(Sl&&e.type==="mousemove"?(em=e.screenX-Sl.screenX,tm=e.screenY-Sl.screenY):tm=em=0,Sl=e),em)},movementY:function(e){return"movementY"in e?e.movementY:tm}}),fw=Zn(Ah),cI=_t({},Ah,{dataTransfer:0}),uI=Zn(cI),dI=_t({},mu,{relatedTarget:0}),nm=Zn(dI),fI=_t({},Ho,{animationName:0,elapsedTime:0,pseudoElement:0}),hI=Zn(fI),pI=_t({},Ho,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),mI=Zn(pI),gI=_t({},Ho,{data:0}),hw=Zn(gI),yI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},vI={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"},bI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xI(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=bI[e])?!!t[e]:!1}function kb(){return xI}var wI=_t({},mu,{key:function(e){if(e.key){var t=yI[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Md(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?vI[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kb,charCode:function(e){return e.type==="keypress"?Md(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Md(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),SI=Zn(wI),kI=_t({},Ah,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),pw=Zn(kI),EI=_t({},mu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kb}),_I=Zn(EI),NI=_t({},Ho,{propertyName:0,elapsedTime:0,pseudoElement:0}),jI=Zn(NI),AI=_t({},Ah,{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}),TI=Zn(AI),CI=[9,13,27,32],Eb=hi&&"CompositionEvent"in window,Kl=null;hi&&"documentMode"in document&&(Kl=document.documentMode);var OI=hi&&"TextEvent"in window&&!Kl,qj=hi&&(!Eb||Kl&&8<Kl&&11>=Kl),mw=" ",gw=!1;function Kj(e,t){switch(e){case"keyup":return CI.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vj(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zs=!1;function PI(e,t){switch(e){case"compositionend":return Vj(t);case"keypress":return t.which!==32?null:(gw=!0,mw);case"textInput":return e=t.data,e===mw&&gw?null:e;default:return null}}function MI(e,t){if(zs)return e==="compositionend"||!Eb&&Kj(e,t)?(e=Gj(),Pd=wb=Gi=null,zs=!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 qj&&t.locale!=="ko"?null:t.data;default:return null}}var RI={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 yw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!RI[e.type]:t==="textarea"}function Yj(e,t,n,r){Nj(r),t=Zd(t,"onChange"),0<t.length&&(n=new Sb("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Vl=null,pc=null;function II(e){sA(e,0)}function Th(e){var t=Ws(e);if(bj(t))return e}function $I(e,t){if(e==="change")return t}var Xj=!1;if(hi){var rm;if(hi){var im="oninput"in document;if(!im){var vw=document.createElement("div");vw.setAttribute("oninput","return;"),im=typeof vw.oninput=="function"}rm=im}else rm=!1;Xj=rm&&(!document.documentMode||9<document.documentMode)}function bw(){Vl&&(Vl.detachEvent("onpropertychange",Zj),pc=Vl=null)}function Zj(e){if(e.propertyName==="value"&&Th(pc)){var t=[];Yj(t,pc,e,gb(e)),Cj(II,t)}}function LI(e,t,n){e==="focusin"?(bw(),Vl=t,pc=n,Vl.attachEvent("onpropertychange",Zj)):e==="focusout"&&bw()}function DI(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Th(pc)}function BI(e,t){if(e==="click")return Th(t)}function zI(e,t){if(e==="input"||e==="change")return Th(t)}function FI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ar=typeof Object.is=="function"?Object.is:FI;function mc(e,t){if(Ar(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 i=n[r];if(!Ng.call(t,i)||!Ar(e[i],t[i]))return!1}return!0}function xw(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ww(e,t){var n=xw(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=xw(n)}}function Qj(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Qj(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jj(){for(var e=window,t=Hd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Hd(e.document)}return t}function _b(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 UI(e){var t=Jj(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Qj(n.ownerDocument.documentElement,n)){if(r!==null&&_b(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 i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=ww(n,a);var o=ww(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>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 WI=hi&&"documentMode"in document&&11>=document.documentMode,Fs=null,Gg=null,Yl=null,qg=!1;function Sw(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qg||Fs==null||Fs!==Hd(r)||(r=Fs,"selectionStart"in r&&_b(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}),Yl&&mc(Yl,r)||(Yl=r,r=Zd(Gg,"onSelect"),0<r.length&&(t=new Sb("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Fs)))}function Gu(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Us={animationend:Gu("Animation","AnimationEnd"),animationiteration:Gu("Animation","AnimationIteration"),animationstart:Gu("Animation","AnimationStart"),transitionend:Gu("Transition","TransitionEnd")},am={},eA={};hi&&(eA=document.createElement("div").style,"AnimationEvent"in window||(delete Us.animationend.animation,delete Us.animationiteration.animation,delete Us.animationstart.animation),"TransitionEvent"in window||delete Us.transitionend.transition);function Ch(e){if(am[e])return am[e];if(!Us[e])return e;var t=Us[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in eA)return am[e]=t[n];return e}var tA=Ch("animationend"),nA=Ch("animationiteration"),rA=Ch("animationstart"),iA=Ch("transitionend"),aA=new Map,kw="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 ua(e,t){aA.set(e,t),ls(t,[e])}for(var sm=0;sm<kw.length;sm++){var om=kw[sm],HI=om.toLowerCase(),GI=om[0].toUpperCase()+om.slice(1);ua(HI,"on"+GI)}ua(tA,"onAnimationEnd");ua(nA,"onAnimationIteration");ua(rA,"onAnimationStart");ua("dblclick","onDoubleClick");ua("focusin","onFocus");ua("focusout","onBlur");ua(iA,"onTransitionEnd");fo("onMouseEnter",["mouseout","mouseover"]);fo("onMouseLeave",["mouseout","mouseover"]);fo("onPointerEnter",["pointerout","pointerover"]);fo("onPointerLeave",["pointerout","pointerover"]);ls("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ls("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ls("onBeforeInput",["compositionend","keypress","textInput","paste"]);ls("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ls("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ls("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wl="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(" "),qI=new Set("cancel close invalid load scroll toggle".split(" ").concat(Wl));function Ew(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,H2(r,t,void 0,e),e.currentTarget=null}function sA(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=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!==a&&i.isPropagationStopped())break e;Ew(i,l,u),a=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==a&&i.isPropagationStopped())break e;Ew(i,l,u),a=c}}}if(qd)throw e=Fg,qd=!1,Fg=null,e}function pt(e,t){var n=t[Zg];n===void 0&&(n=t[Zg]=new Set);var r=e+"__bubble";n.has(r)||(oA(t,e,2,!1),n.add(r))}function lm(e,t,n){var r=0;t&&(r|=4),oA(n,e,r,t)}var qu="_reactListening"+Math.random().toString(36).slice(2);function gc(e){if(!e[qu]){e[qu]=!0,pj.forEach(function(n){n!=="selectionchange"&&(qI.has(n)||lm(n,!1,e),lm(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[qu]||(t[qu]=!0,lm("selectionchange",!1,t))}}function oA(e,t,n,r){switch(Hj(t)){case 1:var i=sI;break;case 4:i=oI;break;default:i=xb}n=i.bind(null,t,n,e),i=void 0,!zg||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function cm(e,t,n,r,i){var a=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===i||l.nodeType===8&&l.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;l!==null;){if(o=Ia(l),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue e}l=l.parentNode}}r=r.return}Cj(function(){var u=a,d=gb(n),f=[];e:{var h=aA.get(e);if(h!==void 0){var p=Sb,g=e;switch(e){case"keypress":if(Md(n)===0)break e;case"keydown":case"keyup":p=SI;break;case"focusin":g="focus",p=nm;break;case"focusout":g="blur",p=nm;break;case"beforeblur":case"afterblur":p=nm;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=fw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=uI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=_I;break;case tA:case nA:case rA:p=hI;break;case iA:p=jI;break;case"scroll":p=lI;break;case"wheel":p=TI;break;case"copy":case"cut":case"paste":p=mI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=pw}var m=(t&4)!==0,v=!m&&e==="scroll",y=m?h!==null?h+"Capture":null:h;m=[];for(var b=u,x;b!==null;){x=b;var k=x.stateNode;if(x.tag===5&&k!==null&&(x=k,y!==null&&(k=uc(b,y),k!=null&&m.push(yc(b,k,x)))),v)break;b=b.return}0<m.length&&(h=new p(h,g,null,n,d),f.push({event:h,listeners:m}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==Dg&&(g=n.relatedTarget||n.fromElement)&&(Ia(g)||g[pi]))break e;if((p||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,p?(g=n.relatedTarget||n.toElement,p=u,g=g?Ia(g):null,g!==null&&(v=cs(g),g!==v||g.tag!==5&&g.tag!==6)&&(g=null)):(p=null,g=u),p!==g)){if(m=fw,k="onMouseLeave",y="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(m=pw,k="onPointerLeave",y="onPointerEnter",b="pointer"),v=p==null?h:Ws(p),x=g==null?h:Ws(g),h=new m(k,b+"leave",p,n,d),h.target=v,h.relatedTarget=x,k=null,Ia(d)===u&&(m=new m(y,b+"enter",g,n,d),m.target=x,m.relatedTarget=v,k=m),v=k,p&&g)t:{for(m=p,y=g,b=0,x=m;x;x=js(x))b++;for(x=0,k=y;k;k=js(k))x++;for(;0<b-x;)m=js(m),b--;for(;0<x-b;)y=js(y),x--;for(;b--;){if(m===y||y!==null&&m===y.alternate)break t;m=js(m),y=js(y)}m=null}else m=null;p!==null&&_w(f,h,p,m,!1),g!==null&&v!==null&&_w(f,v,g,m,!0)}}e:{if(h=u?Ws(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var S=$I;else if(yw(h))if(Xj)S=zI;else{S=DI;var w=LI}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(S=BI);if(S&&(S=S(e,u))){Yj(f,S,n,d);break e}w&&w(e,h,u),e==="focusout"&&(w=h._wrapperState)&&w.controlled&&h.type==="number"&&Mg(h,"number",h.value)}switch(w=u?Ws(u):window,e){case"focusin":(yw(w)||w.contentEditable==="true")&&(Fs=w,Gg=u,Yl=null);break;case"focusout":Yl=Gg=Fs=null;break;case"mousedown":qg=!0;break;case"contextmenu":case"mouseup":case"dragend":qg=!1,Sw(f,n,d);break;case"selectionchange":if(WI)break;case"keydown":case"keyup":Sw(f,n,d)}var _;if(Eb)e:{switch(e){case"compositionstart":var N="onCompositionStart";break e;case"compositionend":N="onCompositionEnd";break e;case"compositionupdate":N="onCompositionUpdate";break e}N=void 0}else zs?Kj(e,n)&&(N="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(N="onCompositionStart");N&&(qj&&n.locale!=="ko"&&(zs||N!=="onCompositionStart"?N==="onCompositionEnd"&&zs&&(_=Gj()):(Gi=d,wb="value"in Gi?Gi.value:Gi.textContent,zs=!0)),w=Zd(u,N),0<w.length&&(N=new hw(N,e,null,n,d),f.push({event:N,listeners:w}),_?N.data=_:(_=Vj(n),_!==null&&(N.data=_)))),(_=OI?PI(e,n):MI(e,n))&&(u=Zd(u,"onBeforeInput"),0<u.length&&(d=new hw("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=_))}sA(f,t)})}function yc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Zd(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=uc(e,n),a!=null&&r.unshift(yc(e,a,i)),a=uc(e,t),a!=null&&r.push(yc(e,a,i))),e=e.return}return r}function js(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function _w(e,t,n,r,i){for(var a=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,i?(c=uc(n,a),c!=null&&o.unshift(yc(n,c,l))):i||(c=uc(n,a),c!=null&&o.push(yc(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var KI=/\r\n?/g,VI=/\u0000|\uFFFD/g;function Nw(e){return(typeof e=="string"?e:""+e).replace(KI,`
38
- `).replace(VI,"")}function Ku(e,t,n){if(t=Nw(t),Nw(e)!==t&&n)throw Error(ie(425))}function Qd(){}var Kg=null,Vg=null;function Yg(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 Xg=typeof setTimeout=="function"?setTimeout:void 0,YI=typeof clearTimeout=="function"?clearTimeout:void 0,jw=typeof Promise=="function"?Promise:void 0,XI=typeof queueMicrotask=="function"?queueMicrotask:typeof jw<"u"?function(e){return jw.resolve(null).then(e).catch(ZI)}:Xg;function ZI(e){setTimeout(function(){throw e})}function um(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),hc(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);hc(t)}function Ji(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 Aw(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 Go=Math.random().toString(36).slice(2),Dr="__reactFiber$"+Go,vc="__reactProps$"+Go,pi="__reactContainer$"+Go,Zg="__reactEvents$"+Go,QI="__reactListeners$"+Go,JI="__reactHandles$"+Go;function Ia(e){var t=e[Dr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[pi]||n[Dr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Aw(e);e!==null;){if(n=e[Dr])return n;e=Aw(e)}return t}e=n,n=e.parentNode}return null}function gu(e){return e=e[Dr]||e[pi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ws(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ie(33))}function Oh(e){return e[vc]||null}var Qg=[],Hs=-1;function da(e){return{current:e}}function yt(e){0>Hs||(e.current=Qg[Hs],Qg[Hs]=null,Hs--)}function ut(e,t){Hs++,Qg[Hs]=e.current,e.current=t}var la={},vn=da(la),In=da(!1),Za=la;function ho(e,t){var n=e.type.contextTypes;if(!n)return la;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function $n(e){return e=e.childContextTypes,e!=null}function Jd(){yt(In),yt(vn)}function Tw(e,t,n){if(vn.current!==la)throw Error(ie(168));ut(vn,t),ut(In,n)}function lA(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(ie(108,L2(e)||"Unknown",i));return _t({},n,r)}function ef(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||la,Za=vn.current,ut(vn,e),ut(In,In.current),!0}function Cw(e,t,n){var r=e.stateNode;if(!r)throw Error(ie(169));n?(e=lA(e,t,Za),r.__reactInternalMemoizedMergedChildContext=e,yt(In),yt(vn),ut(vn,e)):yt(In),ut(In,n)}var ri=null,Ph=!1,dm=!1;function cA(e){ri===null?ri=[e]:ri.push(e)}function e$(e){Ph=!0,cA(e)}function fa(){if(!dm&&ri!==null){dm=!0;var e=0,t=et;try{var n=ri;for(et=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ri=null,Ph=!1}catch(i){throw ri!==null&&(ri=ri.slice(e+1)),Rj(yb,fa),i}finally{et=t,dm=!1}}return null}var Gs=[],qs=0,tf=null,nf=0,tr=[],nr=0,Qa=null,ii=1,ai="";function Na(e,t){Gs[qs++]=nf,Gs[qs++]=tf,tf=e,nf=t}function uA(e,t,n){tr[nr++]=ii,tr[nr++]=ai,tr[nr++]=Qa,Qa=e;var r=ii;e=ai;var i=32-kr(r)-1;r&=~(1<<i),n+=1;var a=32-kr(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ii=1<<32-kr(t)+i|n<<i|r,ai=a+e}else ii=1<<a|n<<i|r,ai=e}function Nb(e){e.return!==null&&(Na(e,1),uA(e,1,0))}function jb(e){for(;e===tf;)tf=Gs[--qs],Gs[qs]=null,nf=Gs[--qs],Gs[qs]=null;for(;e===Qa;)Qa=tr[--nr],tr[nr]=null,ai=tr[--nr],tr[nr]=null,ii=tr[--nr],tr[nr]=null}var qn=null,Gn=null,vt=!1,xr=null;function dA(e,t){var n=ir(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 Ow(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,qn=e,Gn=Ji(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,qn=e,Gn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Qa!==null?{id:ii,overflow:ai}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=ir(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,qn=e,Gn=null,!0):!1;default:return!1}}function Jg(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ey(e){if(vt){var t=Gn;if(t){var n=t;if(!Ow(e,t)){if(Jg(e))throw Error(ie(418));t=Ji(n.nextSibling);var r=qn;t&&Ow(e,t)?dA(r,n):(e.flags=e.flags&-4097|2,vt=!1,qn=e)}}else{if(Jg(e))throw Error(ie(418));e.flags=e.flags&-4097|2,vt=!1,qn=e}}}function Pw(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;qn=e}function Vu(e){if(e!==qn)return!1;if(!vt)return Pw(e),vt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Yg(e.type,e.memoizedProps)),t&&(t=Gn)){if(Jg(e))throw fA(),Error(ie(418));for(;t;)dA(e,t),t=Ji(t.nextSibling)}if(Pw(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ie(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Gn=Ji(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Gn=null}}else Gn=qn?Ji(e.stateNode.nextSibling):null;return!0}function fA(){for(var e=Gn;e;)e=Ji(e.nextSibling)}function po(){Gn=qn=null,vt=!1}function Ab(e){xr===null?xr=[e]:xr.push(e)}var t$=xi.ReactCurrentBatchConfig;function kl(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(ie(309));var r=n.stateNode}if(!r)throw Error(ie(147,e));var i=r,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(o){var l=i.refs;o===null?delete l[a]:l[a]=o},t._stringRef=a,t)}if(typeof e!="string")throw Error(ie(284));if(!n._owner)throw Error(ie(290,e))}return e}function Yu(e,t){throw e=Object.prototype.toString.call(t),Error(ie(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Mw(e){var t=e._init;return t(e._payload)}function hA(e){function t(y,b){if(e){var x=y.deletions;x===null?(y.deletions=[b],y.flags|=16):x.push(b)}}function n(y,b){if(!e)return null;for(;b!==null;)t(y,b),b=b.sibling;return null}function r(y,b){for(y=new Map;b!==null;)b.key!==null?y.set(b.key,b):y.set(b.index,b),b=b.sibling;return y}function i(y,b){return y=ra(y,b),y.index=0,y.sibling=null,y}function a(y,b,x){return y.index=x,e?(x=y.alternate,x!==null?(x=x.index,x<b?(y.flags|=2,b):x):(y.flags|=2,b)):(y.flags|=1048576,b)}function o(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,b,x,k){return b===null||b.tag!==6?(b=vm(x,y.mode,k),b.return=y,b):(b=i(b,x),b.return=y,b)}function c(y,b,x,k){var S=x.type;return S===Bs?d(y,b,x.props.children,k,x.key):b!==null&&(b.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Li&&Mw(S)===b.type)?(k=i(b,x.props),k.ref=kl(y,b,x),k.return=y,k):(k=zd(x.type,x.key,x.props,null,y.mode,k),k.ref=kl(y,b,x),k.return=y,k)}function u(y,b,x,k){return b===null||b.tag!==4||b.stateNode.containerInfo!==x.containerInfo||b.stateNode.implementation!==x.implementation?(b=bm(x,y.mode,k),b.return=y,b):(b=i(b,x.children||[]),b.return=y,b)}function d(y,b,x,k,S){return b===null||b.tag!==7?(b=Ha(x,y.mode,k,S),b.return=y,b):(b=i(b,x),b.return=y,b)}function f(y,b,x){if(typeof b=="string"&&b!==""||typeof b=="number")return b=vm(""+b,y.mode,x),b.return=y,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Du:return x=zd(b.type,b.key,b.props,null,y.mode,x),x.ref=kl(y,null,b),x.return=y,x;case Ds:return b=bm(b,y.mode,x),b.return=y,b;case Li:var k=b._init;return f(y,k(b._payload),x)}if(Fl(b)||vl(b))return b=Ha(b,y.mode,x,null),b.return=y,b;Yu(y,b)}return null}function h(y,b,x,k){var S=b!==null?b.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return S!==null?null:l(y,b,""+x,k);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Du:return x.key===S?c(y,b,x,k):null;case Ds:return x.key===S?u(y,b,x,k):null;case Li:return S=x._init,h(y,b,S(x._payload),k)}if(Fl(x)||vl(x))return S!==null?null:d(y,b,x,k,null);Yu(y,x)}return null}function p(y,b,x,k,S){if(typeof k=="string"&&k!==""||typeof k=="number")return y=y.get(x)||null,l(b,y,""+k,S);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case Du:return y=y.get(k.key===null?x:k.key)||null,c(b,y,k,S);case Ds:return y=y.get(k.key===null?x:k.key)||null,u(b,y,k,S);case Li:var w=k._init;return p(y,b,x,w(k._payload),S)}if(Fl(k)||vl(k))return y=y.get(x)||null,d(b,y,k,S,null);Yu(b,k)}return null}function g(y,b,x,k){for(var S=null,w=null,_=b,N=b=0,C=null;_!==null&&N<x.length;N++){_.index>N?(C=_,_=null):C=_.sibling;var T=h(y,_,x[N],k);if(T===null){_===null&&(_=C);break}e&&_&&T.alternate===null&&t(y,_),b=a(T,b,N),w===null?S=T:w.sibling=T,w=T,_=C}if(N===x.length)return n(y,_),vt&&Na(y,N),S;if(_===null){for(;N<x.length;N++)_=f(y,x[N],k),_!==null&&(b=a(_,b,N),w===null?S=_:w.sibling=_,w=_);return vt&&Na(y,N),S}for(_=r(y,_);N<x.length;N++)C=p(_,y,N,x[N],k),C!==null&&(e&&C.alternate!==null&&_.delete(C.key===null?N:C.key),b=a(C,b,N),w===null?S=C:w.sibling=C,w=C);return e&&_.forEach(function($){return t(y,$)}),vt&&Na(y,N),S}function m(y,b,x,k){var S=vl(x);if(typeof S!="function")throw Error(ie(150));if(x=S.call(x),x==null)throw Error(ie(151));for(var w=S=null,_=b,N=b=0,C=null,T=x.next();_!==null&&!T.done;N++,T=x.next()){_.index>N?(C=_,_=null):C=_.sibling;var $=h(y,_,T.value,k);if($===null){_===null&&(_=C);break}e&&_&&$.alternate===null&&t(y,_),b=a($,b,N),w===null?S=$:w.sibling=$,w=$,_=C}if(T.done)return n(y,_),vt&&Na(y,N),S;if(_===null){for(;!T.done;N++,T=x.next())T=f(y,T.value,k),T!==null&&(b=a(T,b,N),w===null?S=T:w.sibling=T,w=T);return vt&&Na(y,N),S}for(_=r(y,_);!T.done;N++,T=x.next())T=p(_,y,N,T.value,k),T!==null&&(e&&T.alternate!==null&&_.delete(T.key===null?N:T.key),b=a(T,b,N),w===null?S=T:w.sibling=T,w=T);return e&&_.forEach(function(R){return t(y,R)}),vt&&Na(y,N),S}function v(y,b,x,k){if(typeof x=="object"&&x!==null&&x.type===Bs&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Du:e:{for(var S=x.key,w=b;w!==null;){if(w.key===S){if(S=x.type,S===Bs){if(w.tag===7){n(y,w.sibling),b=i(w,x.props.children),b.return=y,y=b;break e}}else if(w.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Li&&Mw(S)===w.type){n(y,w.sibling),b=i(w,x.props),b.ref=kl(y,w,x),b.return=y,y=b;break e}n(y,w);break}else t(y,w);w=w.sibling}x.type===Bs?(b=Ha(x.props.children,y.mode,k,x.key),b.return=y,y=b):(k=zd(x.type,x.key,x.props,null,y.mode,k),k.ref=kl(y,b,x),k.return=y,y=k)}return o(y);case Ds:e:{for(w=x.key;b!==null;){if(b.key===w)if(b.tag===4&&b.stateNode.containerInfo===x.containerInfo&&b.stateNode.implementation===x.implementation){n(y,b.sibling),b=i(b,x.children||[]),b.return=y,y=b;break e}else{n(y,b);break}else t(y,b);b=b.sibling}b=bm(x,y.mode,k),b.return=y,y=b}return o(y);case Li:return w=x._init,v(y,b,w(x._payload),k)}if(Fl(x))return g(y,b,x,k);if(vl(x))return m(y,b,x,k);Yu(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,b!==null&&b.tag===6?(n(y,b.sibling),b=i(b,x),b.return=y,y=b):(n(y,b),b=vm(x,y.mode,k),b.return=y,y=b),o(y)):n(y,b)}return v}var mo=hA(!0),pA=hA(!1),rf=da(null),af=null,Ks=null,Tb=null;function Cb(){Tb=Ks=af=null}function Ob(e){var t=rf.current;yt(rf),e._currentValue=t}function ty(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 ao(e,t){af=e,Tb=Ks=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Mn=!0),e.firstContext=null)}function lr(e){var t=e._currentValue;if(Tb!==e)if(e={context:e,memoizedValue:t,next:null},Ks===null){if(af===null)throw Error(ie(308));Ks=e,af.dependencies={lanes:0,firstContext:e}}else Ks=Ks.next=e;return t}var $a=null;function Pb(e){$a===null?$a=[e]:$a.push(e)}function mA(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Pb(t)):(n.next=i.next,i.next=n),t.interleaved=n,mi(e,r)}function mi(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 Di=!1;function Mb(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function gA(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 ci(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ea(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,He&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,mi(e,n)}return i=r.interleaved,i===null?(t.next=t,Pb(r)):(t.next=i.next,i.next=t),r.interleaved=t,mi(e,n)}function Rd(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,vb(e,n)}}function Rw(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function sf(e,t,n,r){var i=e.updateQueue;Di=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?a=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(a!==null){var f=i.baseState;o=0,d=u=c=null,l=a;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 g=e,m=l;switch(h=t,p=n,m.tag){case 1:if(g=m.payload,typeof g=="function"){f=g.call(p,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,h=typeof g=="function"?g.call(p,f,h):g,h==null)break e;f=_t({},f,h);break e;case 2:Di=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.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=i.shared.pending,l===null)break;h=l,l=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(d===null&&(c=f),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);es|=o,e.lanes=o,e.memoizedState=f}}function Iw(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(ie(191,i));i.call(r)}}}var yu={},Wr=da(yu),bc=da(yu),xc=da(yu);function La(e){if(e===yu)throw Error(ie(174));return e}function Rb(e,t){switch(ut(xc,t),ut(bc,e),ut(Wr,yu),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ig(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ig(t,e)}yt(Wr),ut(Wr,t)}function go(){yt(Wr),yt(bc),yt(xc)}function yA(e){La(xc.current);var t=La(Wr.current),n=Ig(t,e.type);t!==n&&(ut(bc,e),ut(Wr,n))}function Ib(e){bc.current===e&&(yt(Wr),yt(bc))}var St=da(0);function of(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 fm=[];function $b(){for(var e=0;e<fm.length;e++)fm[e]._workInProgressVersionPrimary=null;fm.length=0}var Id=xi.ReactCurrentDispatcher,hm=xi.ReactCurrentBatchConfig,Ja=0,kt=null,zt=null,Vt=null,lf=!1,Xl=!1,wc=0,n$=0;function ln(){throw Error(ie(321))}function Lb(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ar(e[n],t[n]))return!1;return!0}function Db(e,t,n,r,i,a){if(Ja=a,kt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Id.current=e===null||e.memoizedState===null?s$:o$,e=n(r,i),Xl){a=0;do{if(Xl=!1,wc=0,25<=a)throw Error(ie(301));a+=1,Vt=zt=null,t.updateQueue=null,Id.current=l$,e=n(r,i)}while(Xl)}if(Id.current=cf,t=zt!==null&&zt.next!==null,Ja=0,Vt=zt=kt=null,lf=!1,t)throw Error(ie(300));return e}function Bb(){var e=wc!==0;return wc=0,e}function $r(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vt===null?kt.memoizedState=Vt=e:Vt=Vt.next=e,Vt}function cr(){if(zt===null){var e=kt.alternate;e=e!==null?e.memoizedState:null}else e=zt.next;var t=Vt===null?kt.memoizedState:Vt.next;if(t!==null)Vt=t,zt=e;else{if(e===null)throw Error(ie(310));zt=e,e={memoizedState:zt.memoizedState,baseState:zt.baseState,baseQueue:zt.baseQueue,queue:zt.queue,next:null},Vt===null?kt.memoizedState=Vt=e:Vt=Vt.next=e}return Vt}function Sc(e,t){return typeof t=="function"?t(e):t}function pm(e){var t=cr(),n=t.queue;if(n===null)throw Error(ie(311));n.lastRenderedReducer=e;var r=zt,i=r.baseQueue,a=n.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}r.baseQueue=i=a,n.pending=null}if(i!==null){a=i.next,r=r.baseState;var l=o=null,c=null,u=a;do{var d=u.lane;if((Ja&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,kt.lanes|=d,es|=d}u=u.next}while(u!==null&&u!==a);c===null?o=r:c.next=l,Ar(r,t.memoizedState)||(Mn=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do a=i.lane,kt.lanes|=a,es|=a,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function mm(e){var t=cr(),n=t.queue;if(n===null)throw Error(ie(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);Ar(a,t.memoizedState)||(Mn=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function vA(){}function bA(e,t){var n=kt,r=cr(),i=t(),a=!Ar(r.memoizedState,i);if(a&&(r.memoizedState=i,Mn=!0),r=r.queue,zb(SA.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||Vt!==null&&Vt.memoizedState.tag&1){if(n.flags|=2048,kc(9,wA.bind(null,n,r,i,t),void 0,null),Xt===null)throw Error(ie(349));Ja&30||xA(n,t,i)}return i}function xA(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=kt.updateQueue,t===null?(t={lastEffect:null,stores:null},kt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function wA(e,t,n,r){t.value=n,t.getSnapshot=r,kA(t)&&EA(e)}function SA(e,t,n){return n(function(){kA(t)&&EA(e)})}function kA(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ar(e,n)}catch{return!0}}function EA(e){var t=mi(e,1);t!==null&&Er(t,e,1,-1)}function $w(e){var t=$r();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Sc,lastRenderedState:e},t.queue=e,e=e.dispatch=a$.bind(null,kt,e),[t.memoizedState,e]}function kc(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=kt.updateQueue,t===null?(t={lastEffect:null,stores:null},kt.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 _A(){return cr().memoizedState}function $d(e,t,n,r){var i=$r();kt.flags|=e,i.memoizedState=kc(1|t,n,void 0,r===void 0?null:r)}function Mh(e,t,n,r){var i=cr();r=r===void 0?null:r;var a=void 0;if(zt!==null){var o=zt.memoizedState;if(a=o.destroy,r!==null&&Lb(r,o.deps)){i.memoizedState=kc(t,n,a,r);return}}kt.flags|=e,i.memoizedState=kc(1|t,n,a,r)}function Lw(e,t){return $d(8390656,8,e,t)}function zb(e,t){return Mh(2048,8,e,t)}function NA(e,t){return Mh(4,2,e,t)}function jA(e,t){return Mh(4,4,e,t)}function AA(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 TA(e,t,n){return n=n!=null?n.concat([e]):null,Mh(4,4,AA.bind(null,t,e),n)}function Fb(){}function CA(e,t){var n=cr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Lb(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function OA(e,t){var n=cr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Lb(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function PA(e,t,n){return Ja&21?(Ar(n,t)||(n=Lj(),kt.lanes|=n,es|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Mn=!0),e.memoizedState=n)}function r$(e,t){var n=et;et=n!==0&&4>n?n:4,e(!0);var r=hm.transition;hm.transition={};try{e(!1),t()}finally{et=n,hm.transition=r}}function MA(){return cr().memoizedState}function i$(e,t,n){var r=na(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},RA(e))IA(t,n);else if(n=mA(e,t,n,r),n!==null){var i=En();Er(n,e,r,i),$A(n,t,r)}}function a$(e,t,n){var r=na(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(RA(e))IA(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,l=a(o,n);if(i.hasEagerState=!0,i.eagerState=l,Ar(l,o)){var c=t.interleaved;c===null?(i.next=i,Pb(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=mA(e,t,i,r),n!==null&&(i=En(),Er(n,e,r,i),$A(n,t,r))}}function RA(e){var t=e.alternate;return e===kt||t!==null&&t===kt}function IA(e,t){Xl=lf=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function $A(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,vb(e,n)}}var cf={readContext:lr,useCallback:ln,useContext:ln,useEffect:ln,useImperativeHandle:ln,useInsertionEffect:ln,useLayoutEffect:ln,useMemo:ln,useReducer:ln,useRef:ln,useState:ln,useDebugValue:ln,useDeferredValue:ln,useTransition:ln,useMutableSource:ln,useSyncExternalStore:ln,useId:ln,unstable_isNewReconciler:!1},s$={readContext:lr,useCallback:function(e,t){return $r().memoizedState=[e,t===void 0?null:t],e},useContext:lr,useEffect:Lw,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,$d(4194308,4,AA.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $d(4194308,4,e,t)},useInsertionEffect:function(e,t){return $d(4,2,e,t)},useMemo:function(e,t){var n=$r();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=$r();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=i$.bind(null,kt,e),[r.memoizedState,e]},useRef:function(e){var t=$r();return e={current:e},t.memoizedState=e},useState:$w,useDebugValue:Fb,useDeferredValue:function(e){return $r().memoizedState=e},useTransition:function(){var e=$w(!1),t=e[0];return e=r$.bind(null,e[1]),$r().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=kt,i=$r();if(vt){if(n===void 0)throw Error(ie(407));n=n()}else{if(n=t(),Xt===null)throw Error(ie(349));Ja&30||xA(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,Lw(SA.bind(null,r,a,e),[e]),r.flags|=2048,kc(9,wA.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=$r(),t=Xt.identifierPrefix;if(vt){var n=ai,r=ii;n=(r&~(1<<32-kr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=wc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=n$++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},o$={readContext:lr,useCallback:CA,useContext:lr,useEffect:zb,useImperativeHandle:TA,useInsertionEffect:NA,useLayoutEffect:jA,useMemo:OA,useReducer:pm,useRef:_A,useState:function(){return pm(Sc)},useDebugValue:Fb,useDeferredValue:function(e){var t=cr();return PA(t,zt.memoizedState,e)},useTransition:function(){var e=pm(Sc)[0],t=cr().memoizedState;return[e,t]},useMutableSource:vA,useSyncExternalStore:bA,useId:MA,unstable_isNewReconciler:!1},l$={readContext:lr,useCallback:CA,useContext:lr,useEffect:zb,useImperativeHandle:TA,useInsertionEffect:NA,useLayoutEffect:jA,useMemo:OA,useReducer:mm,useRef:_A,useState:function(){return mm(Sc)},useDebugValue:Fb,useDeferredValue:function(e){var t=cr();return zt===null?t.memoizedState=e:PA(t,zt.memoizedState,e)},useTransition:function(){var e=mm(Sc)[0],t=cr().memoizedState;return[e,t]},useMutableSource:vA,useSyncExternalStore:bA,useId:MA,unstable_isNewReconciler:!1};function yr(e,t){if(e&&e.defaultProps){t=_t({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function ny(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:_t({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Rh={isMounted:function(e){return(e=e._reactInternals)?cs(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=En(),i=na(e),a=ci(r,i);a.payload=t,n!=null&&(a.callback=n),t=ea(e,a,i),t!==null&&(Er(t,e,i,r),Rd(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=En(),i=na(e),a=ci(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=ea(e,a,i),t!==null&&(Er(t,e,i,r),Rd(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=En(),r=na(e),i=ci(n,r);i.tag=2,t!=null&&(i.callback=t),t=ea(e,i,r),t!==null&&(Er(t,e,r,n),Rd(t,e,r))}};function Dw(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!mc(n,r)||!mc(i,a):!0}function LA(e,t,n){var r=!1,i=la,a=t.contextType;return typeof a=="object"&&a!==null?a=lr(a):(i=$n(t)?Za:vn.current,r=t.contextTypes,a=(r=r!=null)?ho(e,i):la),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Rh,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Bw(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&&Rh.enqueueReplaceState(t,t.state,null)}function ry(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Mb(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=lr(a):(a=$n(t)?Za:vn.current,i.context=ho(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(ny(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Rh.enqueueReplaceState(i,i.state,null),sf(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function yo(e,t){try{var n="",r=t;do n+=$2(r),r=r.return;while(r);var i=n}catch(a){i=`
39
- Error generating stack: `+a.message+`
40
- `+a.stack}return{value:e,source:t,stack:i,digest:null}}function gm(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function iy(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var c$=typeof WeakMap=="function"?WeakMap:Map;function DA(e,t,n){n=ci(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){df||(df=!0,py=r),iy(e,t)},n}function BA(e,t,n){n=ci(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){iy(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){iy(e,t),typeof r!="function"&&(ta===null?ta=new Set([this]):ta.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function zw(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new c$;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=k$.bind(null,e,t,n),t.then(e,e))}function Fw(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 Uw(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,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=ci(-1,1),t.tag=2,ea(n,t,1))),n.lanes|=1),e)}var u$=xi.ReactCurrentOwner,Mn=!1;function wn(e,t,n,r){t.child=e===null?pA(t,null,n,r):mo(t,e.child,n,r)}function Ww(e,t,n,r,i){n=n.render;var a=t.ref;return ao(t,i),r=Db(e,t,n,r,a,i),n=Bb(),e!==null&&!Mn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,gi(e,t,i)):(vt&&n&&Nb(t),t.flags|=1,wn(e,t,r,i),t.child)}function Hw(e,t,n,r,i){if(e===null){var a=n.type;return typeof a=="function"&&!Yb(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,zA(e,t,a,r,i)):(e=zd(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var o=a.memoizedProps;if(n=n.compare,n=n!==null?n:mc,n(o,r)&&e.ref===t.ref)return gi(e,t,i)}return t.flags|=1,e=ra(a,r),e.ref=t.ref,e.return=t,t.child=e}function zA(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(mc(a,r)&&e.ref===t.ref)if(Mn=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Mn=!0);else return t.lanes=e.lanes,gi(e,t,i)}return ay(e,t,n,r,i)}function FA(e,t,n){var r=t.pendingProps,i=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ut(Ys,Un),Un|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ut(Ys,Un),Un|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,ut(Ys,Un),Un|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,ut(Ys,Un),Un|=r;return wn(e,t,i,n),t.child}function UA(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ay(e,t,n,r,i){var a=$n(n)?Za:vn.current;return a=ho(t,a),ao(t,i),n=Db(e,t,n,r,a,i),r=Bb(),e!==null&&!Mn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,gi(e,t,i)):(vt&&r&&Nb(t),t.flags|=1,wn(e,t,n,i),t.child)}function Gw(e,t,n,r,i){if($n(n)){var a=!0;ef(t)}else a=!1;if(ao(t,i),t.stateNode===null)Ld(e,t),LA(t,n,r),ry(t,n,r,i),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=lr(u):(u=$n(n)?Za:vn.current,u=ho(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)&&Bw(t,o,r,u),Di=!1;var h=t.memoizedState;o.state=h,sf(t,r,o,i),c=t.memoizedState,l!==r||h!==c||In.current||Di?(typeof d=="function"&&(ny(t,n,d,r),c=t.memoizedState),(l=Di||Dw(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,gA(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:yr(t.type,l),o.props=u,f=t.pendingProps,h=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=lr(c):(c=$n(n)?Za:vn.current,c=ho(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)&&Bw(t,o,r,c),Di=!1,h=t.memoizedState,o.state=h,sf(t,r,o,i);var g=t.memoizedState;l!==f||h!==g||In.current||Di?(typeof p=="function"&&(ny(t,n,p,r),g=t.memoizedState),(u=Di||Dw(t,n,u,r,h,g,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,g,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,g,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=g),o.props=r,o.state=g,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 sy(e,t,n,r,a,i)}function sy(e,t,n,r,i,a){UA(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&Cw(t,n,!1),gi(e,t,a);r=t.stateNode,u$.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=mo(t,e.child,null,a),t.child=mo(t,null,l,a)):wn(e,t,l,a),t.memoizedState=r.state,i&&Cw(t,n,!0),t.child}function WA(e){var t=e.stateNode;t.pendingContext?Tw(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Tw(e,t.context,!1),Rb(e,t.containerInfo)}function qw(e,t,n,r,i){return po(),Ab(i),t.flags|=256,wn(e,t,n,r),t.child}var oy={dehydrated:null,treeContext:null,retryLane:0};function ly(e){return{baseLanes:e,cachePool:null,transitions:null}}function HA(e,t,n){var r=t.pendingProps,i=St.current,a=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),ut(St,i&1),e===null)return ey(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,a?(r=t.mode,a=t.child,o={mode:"hidden",children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=Lh(o,r,0,null),e=Ha(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=ly(n),t.memoizedState=oy,e):Ub(t,o));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return d$(e,t,o,r,l,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,l=i.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=ra(i,c),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=ra(l,a):(a=Ha(a,o,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?ly(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=oy,r}return a=e.child,e=a.sibling,r=ra(a,{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 Ub(e,t){return t=Lh({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Xu(e,t,n,r){return r!==null&&Ab(r),mo(t,e.child,null,n),e=Ub(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function d$(e,t,n,r,i,a,o){if(n)return t.flags&256?(t.flags&=-257,r=gm(Error(ie(422))),Xu(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,i=t.mode,r=Lh({mode:"visible",children:r.children},i,0,null),a=Ha(a,i,o,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&mo(t,e.child,null,o),t.child.memoizedState=ly(o),t.memoizedState=oy,a);if(!(t.mode&1))return Xu(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,a=Error(ie(419)),r=gm(a,r,void 0),Xu(e,t,o,r)}if(l=(o&e.childLanes)!==0,Mn||l){if(r=Xt,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,mi(e,i),Er(r,e,i,-1))}return Vb(),r=gm(Error(ie(421))),Xu(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=E$.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,Gn=Ji(i.nextSibling),qn=t,vt=!0,xr=null,e!==null&&(tr[nr++]=ii,tr[nr++]=ai,tr[nr++]=Qa,ii=e.id,ai=e.overflow,Qa=t),t=Ub(t,r.children),t.flags|=4096,t)}function Kw(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ty(e.return,t,n)}function ym(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function GA(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(wn(e,t,r.children,n),r=St.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&&Kw(e,n,t);else if(e.tag===19)Kw(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(ut(St,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&of(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ym(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&of(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ym(t,!0,n,null,a);break;case"together":ym(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ld(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function gi(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),es|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ie(153));if(t.child!==null){for(e=t.child,n=ra(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ra(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function f$(e,t,n){switch(t.tag){case 3:WA(t),po();break;case 5:yA(t);break;case 1:$n(t.type)&&ef(t);break;case 4:Rb(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;ut(rf,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ut(St,St.current&1),t.flags|=128,null):n&t.child.childLanes?HA(e,t,n):(ut(St,St.current&1),e=gi(e,t,n),e!==null?e.sibling:null);ut(St,St.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return GA(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ut(St,St.current),r)break;return null;case 22:case 23:return t.lanes=0,FA(e,t,n)}return gi(e,t,n)}var qA,cy,KA,VA;qA=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}};cy=function(){};KA=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,La(Wr.current);var a=null;switch(n){case"input":i=Og(e,i),r=Og(e,r),a=[];break;case"select":i=_t({},i,{value:void 0}),r=_t({},r,{value:void 0}),a=[];break;case"textarea":i=Rg(e,i),r=Rg(e,r),a=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Qd)}$g(n,r);var o;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var l=i[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(lc.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in r){var c=r[u];if(l=i!=null?i[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||(a||(a=[]),a.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(a=a||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(lc.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&pt("scroll",e),a||l===c||(a=[])):(a=a||[]).push(u,c))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};VA=function(e,t,n,r){n!==r&&(t.flags|=4)};function El(e,t){if(!vt)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 cn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function h$(e,t,n){var r=t.pendingProps;switch(jb(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return cn(t),null;case 1:return $n(t.type)&&Jd(),cn(t),null;case 3:return r=t.stateNode,go(),yt(In),yt(vn),$b(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Vu(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,xr!==null&&(yy(xr),xr=null))),cy(e,t),cn(t),null;case 5:Ib(t);var i=La(xc.current);if(n=t.type,e!==null&&t.stateNode!=null)KA(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ie(166));return cn(t),null}if(e=La(Wr.current),Vu(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[Dr]=t,r[vc]=a,e=(t.mode&1)!==0,n){case"dialog":pt("cancel",r),pt("close",r);break;case"iframe":case"object":case"embed":pt("load",r);break;case"video":case"audio":for(i=0;i<Wl.length;i++)pt(Wl[i],r);break;case"source":pt("error",r);break;case"img":case"image":case"link":pt("error",r),pt("load",r);break;case"details":pt("toggle",r);break;case"input":nw(r,a),pt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},pt("invalid",r);break;case"textarea":iw(r,a),pt("invalid",r)}$g(n,a),i=null;for(var o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="children"?typeof l=="string"?r.textContent!==l&&(a.suppressHydrationWarning!==!0&&Ku(r.textContent,l,e),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&Ku(r.textContent,l,e),i=["children",""+l]):lc.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&pt("scroll",r)}switch(n){case"input":Bu(r),rw(r,a,!0);break;case"textarea":Bu(r),aw(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=Qd)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Sj(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[Dr]=t,e[vc]=r,qA(e,t,!1,!1),t.stateNode=e;e:{switch(o=Lg(n,r),n){case"dialog":pt("cancel",e),pt("close",e),i=r;break;case"iframe":case"object":case"embed":pt("load",e),i=r;break;case"video":case"audio":for(i=0;i<Wl.length;i++)pt(Wl[i],e);i=r;break;case"source":pt("error",e),i=r;break;case"img":case"image":case"link":pt("error",e),pt("load",e),i=r;break;case"details":pt("toggle",e),i=r;break;case"input":nw(e,r),i=Og(e,r),pt("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=_t({},r,{value:void 0}),pt("invalid",e);break;case"textarea":iw(e,r),i=Rg(e,r),pt("invalid",e);break;default:i=r}$g(n,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?_j(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&kj(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&cc(e,c):typeof c=="number"&&cc(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(lc.hasOwnProperty(a)?c!=null&&a==="onScroll"&&pt("scroll",e):c!=null&&fb(e,a,c,o))}switch(n){case"input":Bu(e),rw(e,r,!1);break;case"textarea":Bu(e),aw(e);break;case"option":r.value!=null&&e.setAttribute("value",""+oa(r.value));break;case"select":e.multiple=!!r.multiple,a=r.value,a!=null?to(e,!!r.multiple,a,!1):r.defaultValue!=null&&to(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Qd)}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 cn(t),null;case 6:if(e&&t.stateNode!=null)VA(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(ie(166));if(n=La(xc.current),La(Wr.current),Vu(t)){if(r=t.stateNode,n=t.memoizedProps,r[Dr]=t,(a=r.nodeValue!==n)&&(e=qn,e!==null))switch(e.tag){case 3:Ku(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ku(r.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Dr]=t,t.stateNode=r}return cn(t),null;case 13:if(yt(St),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(vt&&Gn!==null&&t.mode&1&&!(t.flags&128))fA(),po(),t.flags|=98560,a=!1;else if(a=Vu(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(ie(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(ie(317));a[Dr]=t}else po(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;cn(t),a=!1}else xr!==null&&(yy(xr),xr=null),a=!0;if(!a)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||St.current&1?Ft===0&&(Ft=3):Vb())),t.updateQueue!==null&&(t.flags|=4),cn(t),null);case 4:return go(),cy(e,t),e===null&&gc(t.stateNode.containerInfo),cn(t),null;case 10:return Ob(t.type._context),cn(t),null;case 17:return $n(t.type)&&Jd(),cn(t),null;case 19:if(yt(St),a=t.memoizedState,a===null)return cn(t),null;if(r=(t.flags&128)!==0,o=a.rendering,o===null)if(r)El(a,!1);else{if(Ft!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=of(e),o!==null){for(t.flags|=128,El(a,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)a=n,e=r,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ut(St,St.current&1|2),t.child}e=e.sibling}a.tail!==null&&Tt()>vo&&(t.flags|=128,r=!0,El(a,!1),t.lanes=4194304)}else{if(!r)if(e=of(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),El(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!vt)return cn(t),null}else 2*Tt()-a.renderingStartTime>vo&&n!==1073741824&&(t.flags|=128,r=!0,El(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(n=a.last,n!==null?n.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Tt(),t.sibling=null,n=St.current,ut(St,r?n&1|2:n&1),t):(cn(t),null);case 22:case 23:return Kb(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Un&1073741824&&(cn(t),t.subtreeFlags&6&&(t.flags|=8192)):cn(t),null;case 24:return null;case 25:return null}throw Error(ie(156,t.tag))}function p$(e,t){switch(jb(t),t.tag){case 1:return $n(t.type)&&Jd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return go(),yt(In),yt(vn),$b(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ib(t),null;case 13:if(yt(St),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ie(340));po()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return yt(St),null;case 4:return go(),null;case 10:return Ob(t.type._context),null;case 22:case 23:return Kb(),null;case 24:return null;default:return null}}var Zu=!1,pn=!1,m$=typeof WeakSet=="function"?WeakSet:Set,ye=null;function Vs(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){jt(e,t,r)}else n.current=null}function uy(e,t,n){try{n()}catch(r){jt(e,t,r)}}var Vw=!1;function g$(e,t){if(Kg=Yd,e=Jj(),_b(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 i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.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||i!==0&&f.nodeType!==3||(l=o+i),f!==a||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===i&&(l=o),h===a&&++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(Vg={focusedElem:e,selectionRange:n},Yd=!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 g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var m=g.memoizedProps,v=g.memoizedState,y=t.stateNode,b=y.getSnapshotBeforeUpdate(t.elementType===t.type?m:yr(t.type,m),v);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ie(163))}}catch(k){jt(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,ye=e;break}ye=t.return}return g=Vw,Vw=!1,g}function Zl(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&uy(t,n,a)}i=i.next}while(i!==r)}}function Ih(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 dy(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 YA(e){var t=e.alternate;t!==null&&(e.alternate=null,YA(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Dr],delete t[vc],delete t[Zg],delete t[QI],delete t[JI])),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 XA(e){return e.tag===5||e.tag===3||e.tag===4}function Yw(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||XA(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 fy(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=Qd));else if(r!==4&&(e=e.child,e!==null))for(fy(e,t,n),e=e.sibling;e!==null;)fy(e,t,n),e=e.sibling}function hy(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(hy(e,t,n),e=e.sibling;e!==null;)hy(e,t,n),e=e.sibling}var nn=null,vr=!1;function Mi(e,t,n){for(n=n.child;n!==null;)ZA(e,t,n),n=n.sibling}function ZA(e,t,n){if(Ur&&typeof Ur.onCommitFiberUnmount=="function")try{Ur.onCommitFiberUnmount(jh,n)}catch{}switch(n.tag){case 5:pn||Vs(n,t);case 6:var r=nn,i=vr;nn=null,Mi(e,t,n),nn=r,vr=i,nn!==null&&(vr?(e=nn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):nn.removeChild(n.stateNode));break;case 18:nn!==null&&(vr?(e=nn,n=n.stateNode,e.nodeType===8?um(e.parentNode,n):e.nodeType===1&&um(e,n),hc(e)):um(nn,n.stateNode));break;case 4:r=nn,i=vr,nn=n.stateNode.containerInfo,vr=!0,Mi(e,t,n),nn=r,vr=i;break;case 0:case 11:case 14:case 15:if(!pn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&uy(n,t,o),i=i.next}while(i!==r)}Mi(e,t,n);break;case 1:if(!pn&&(Vs(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){jt(n,t,l)}Mi(e,t,n);break;case 21:Mi(e,t,n);break;case 22:n.mode&1?(pn=(r=pn)||n.memoizedState!==null,Mi(e,t,n),pn=r):Mi(e,t,n);break;default:Mi(e,t,n)}}function Xw(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new m$),t.forEach(function(r){var i=_$.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function mr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var a=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:nn=l.stateNode,vr=!1;break e;case 3:nn=l.stateNode.containerInfo,vr=!0;break e;case 4:nn=l.stateNode.containerInfo,vr=!0;break e}l=l.return}if(nn===null)throw Error(ie(160));ZA(a,o,i),nn=null,vr=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){jt(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)QA(t,e),t=t.sibling}function QA(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(mr(t,e),Mr(e),r&4){try{Zl(3,e,e.return),Ih(3,e)}catch(m){jt(e,e.return,m)}try{Zl(5,e,e.return)}catch(m){jt(e,e.return,m)}}break;case 1:mr(t,e),Mr(e),r&512&&n!==null&&Vs(n,n.return);break;case 5:if(mr(t,e),Mr(e),r&512&&n!==null&&Vs(n,n.return),e.flags&32){var i=e.stateNode;try{cc(i,"")}catch(m){jt(e,e.return,m)}}if(r&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,o=n!==null?n.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&xj(i,a),Lg(l,o);var u=Lg(l,a);for(o=0;o<c.length;o+=2){var d=c[o],f=c[o+1];d==="style"?_j(i,f):d==="dangerouslySetInnerHTML"?kj(i,f):d==="children"?cc(i,f):fb(i,d,f,u)}switch(l){case"input":Pg(i,a);break;case"textarea":wj(i,a);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var p=a.value;p!=null?to(i,!!a.multiple,p,!1):h!==!!a.multiple&&(a.defaultValue!=null?to(i,!!a.multiple,a.defaultValue,!0):to(i,!!a.multiple,a.multiple?[]:"",!1))}i[vc]=a}catch(m){jt(e,e.return,m)}}break;case 6:if(mr(t,e),Mr(e),r&4){if(e.stateNode===null)throw Error(ie(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(m){jt(e,e.return,m)}}break;case 3:if(mr(t,e),Mr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{hc(t.containerInfo)}catch(m){jt(e,e.return,m)}break;case 4:mr(t,e),Mr(e);break;case 13:mr(t,e),Mr(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(Gb=Tt())),r&4&&Xw(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(pn=(u=pn)||d,mr(t,e),pn=u):mr(t,e),Mr(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:Zl(4,h,h.return);break;case 1:Vs(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(m){jt(r,n,m)}}break;case 5:Vs(h,h.return);break;case 22:if(h.memoizedState!==null){Qw(f);continue}}p!==null?(p.return=h,ye=p):Qw(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{i=f.stateNode,u?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=f.stateNode,c=f.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=Ej("display",o))}catch(m){jt(e,e.return,m)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(m){jt(e,e.return,m)}}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:mr(t,e),Mr(e),r&4&&Xw(e);break;case 21:break;default:mr(t,e),Mr(e)}}function Mr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(XA(n)){var r=n;break e}n=n.return}throw Error(ie(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(cc(i,""),r.flags&=-33);var a=Yw(e);hy(e,a,i);break;case 3:case 4:var o=r.stateNode.containerInfo,l=Yw(e);fy(e,l,o);break;default:throw Error(ie(161))}}catch(c){jt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function y$(e,t,n){ye=e,JA(e)}function JA(e,t,n){for(var r=(e.mode&1)!==0;ye!==null;){var i=ye,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||Zu;if(!o){var l=i.alternate,c=l!==null&&l.memoizedState!==null||pn;l=Zu;var u=pn;if(Zu=o,(pn=c)&&!u)for(ye=i;ye!==null;)o=ye,c=o.child,o.tag===22&&o.memoizedState!==null?Jw(i):c!==null?(c.return=o,ye=c):Jw(i);for(;a!==null;)ye=a,JA(a),a=a.sibling;ye=i,Zu=l,pn=u}Zw(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,ye=a):Zw(e)}}function Zw(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:pn||Ih(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!pn)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:yr(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&Iw(t,a,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}Iw(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&&hc(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ie(163))}pn||t.flags&512&&dy(t)}catch(h){jt(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 Qw(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 Jw(e){for(;ye!==null;){var t=ye;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ih(4,t)}catch(c){jt(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(c){jt(t,i,c)}}var a=t.return;try{dy(t)}catch(c){jt(t,a,c)}break;case 5:var o=t.return;try{dy(t)}catch(c){jt(t,o,c)}}}catch(c){jt(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 v$=Math.ceil,uf=xi.ReactCurrentDispatcher,Wb=xi.ReactCurrentOwner,sr=xi.ReactCurrentBatchConfig,He=0,Xt=null,Rt=null,an=0,Un=0,Ys=da(0),Ft=0,Ec=null,es=0,$h=0,Hb=0,Ql=null,Pn=null,Gb=0,vo=1/0,ti=null,df=!1,py=null,ta=null,Qu=!1,qi=null,ff=0,Jl=0,my=null,Dd=-1,Bd=0;function En(){return He&6?Tt():Dd!==-1?Dd:Dd=Tt()}function na(e){return e.mode&1?He&2&&an!==0?an&-an:t$.transition!==null?(Bd===0&&(Bd=Lj()),Bd):(e=et,e!==0||(e=window.event,e=e===void 0?16:Hj(e.type)),e):1}function Er(e,t,n,r){if(50<Jl)throw Jl=0,my=null,Error(ie(185));pu(e,n,r),(!(He&2)||e!==Xt)&&(e===Xt&&(!(He&2)&&($h|=n),Ft===4&&Fi(e,an)),Ln(e,r),n===1&&He===0&&!(t.mode&1)&&(vo=Tt()+500,Ph&&fa()))}function Ln(e,t){var n=e.callbackNode;tI(e,t);var r=Vd(e,e===Xt?an:0);if(r===0)n!==null&&lw(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&lw(n),t===1)e.tag===0?e$(e1.bind(null,e)):cA(e1.bind(null,e)),XI(function(){!(He&6)&&fa()}),n=null;else{switch(Dj(r)){case 1:n=yb;break;case 4:n=Ij;break;case 16:n=Kd;break;case 536870912:n=$j;break;default:n=Kd}n=oT(n,eT.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function eT(e,t){if(Dd=-1,Bd=0,He&6)throw Error(ie(327));var n=e.callbackNode;if(so()&&e.callbackNode!==n)return null;var r=Vd(e,e===Xt?an:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=hf(e,r);else{t=r;var i=He;He|=2;var a=nT();(Xt!==e||an!==t)&&(ti=null,vo=Tt()+500,Wa(e,t));do try{w$();break}catch(l){tT(e,l)}while(!0);Cb(),uf.current=a,He=i,Rt!==null?t=0:(Xt=null,an=0,t=Ft)}if(t!==0){if(t===2&&(i=Ug(e),i!==0&&(r=i,t=gy(e,i))),t===1)throw n=Ec,Wa(e,0),Fi(e,r),Ln(e,Tt()),n;if(t===6)Fi(e,r);else{if(i=e.current.alternate,!(r&30)&&!b$(i)&&(t=hf(e,r),t===2&&(a=Ug(e),a!==0&&(r=a,t=gy(e,a))),t===1))throw n=Ec,Wa(e,0),Fi(e,r),Ln(e,Tt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(ie(345));case 2:ja(e,Pn,ti);break;case 3:if(Fi(e,r),(r&130023424)===r&&(t=Gb+500-Tt(),10<t)){if(Vd(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){En(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Xg(ja.bind(null,e,Pn,ti),t);break}ja(e,Pn,ti);break;case 4:if(Fi(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-kr(r);a=1<<o,o=t[o],o>i&&(i=o),r&=~a}if(r=i,r=Tt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*v$(r/1960))-r,10<r){e.timeoutHandle=Xg(ja.bind(null,e,Pn,ti),r);break}ja(e,Pn,ti);break;case 5:ja(e,Pn,ti);break;default:throw Error(ie(329))}}}return Ln(e,Tt()),e.callbackNode===n?eT.bind(null,e):null}function gy(e,t){var n=Ql;return e.current.memoizedState.isDehydrated&&(Wa(e,t).flags|=256),e=hf(e,t),e!==2&&(t=Pn,Pn=n,t!==null&&yy(t)),e}function yy(e){Pn===null?Pn=e:Pn.push.apply(Pn,e)}function b$(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 i=n[r],a=i.getSnapshot;i=i.value;try{if(!Ar(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Fi(e,t){for(t&=~Hb,t&=~$h,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-kr(t),r=1<<n;e[n]=-1,t&=~r}}function e1(e){if(He&6)throw Error(ie(327));so();var t=Vd(e,0);if(!(t&1))return Ln(e,Tt()),null;var n=hf(e,t);if(e.tag!==0&&n===2){var r=Ug(e);r!==0&&(t=r,n=gy(e,r))}if(n===1)throw n=Ec,Wa(e,0),Fi(e,t),Ln(e,Tt()),n;if(n===6)throw Error(ie(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ja(e,Pn,ti),Ln(e,Tt()),null}function qb(e,t){var n=He;He|=1;try{return e(t)}finally{He=n,He===0&&(vo=Tt()+500,Ph&&fa())}}function ts(e){qi!==null&&qi.tag===0&&!(He&6)&&so();var t=He;He|=1;var n=sr.transition,r=et;try{if(sr.transition=null,et=1,e)return e()}finally{et=r,sr.transition=n,He=t,!(He&6)&&fa()}}function Kb(){Un=Ys.current,yt(Ys)}function Wa(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,YI(n)),Rt!==null)for(n=Rt.return;n!==null;){var r=n;switch(jb(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Jd();break;case 3:go(),yt(In),yt(vn),$b();break;case 5:Ib(r);break;case 4:go();break;case 13:yt(St);break;case 19:yt(St);break;case 10:Ob(r.type._context);break;case 22:case 23:Kb()}n=n.return}if(Xt=e,Rt=e=ra(e.current,null),an=Un=t,Ft=0,Ec=null,Hb=$h=es=0,Pn=Ql=null,$a!==null){for(t=0;t<$a.length;t++)if(n=$a[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}$a=null}return e}function tT(e,t){do{var n=Rt;try{if(Cb(),Id.current=cf,lf){for(var r=kt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}lf=!1}if(Ja=0,Vt=zt=kt=null,Xl=!1,wc=0,Wb.current=null,n===null||n.return===null){Ft=1,Ec=t,Rt=null;break}e:{var a=e,o=n.return,l=n,c=t;if(t=an,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=Fw(o);if(p!==null){p.flags&=-257,Uw(p,o,l,a,t),p.mode&1&&zw(a,u,t),t=p,c=u;var g=t.updateQueue;if(g===null){var m=new Set;m.add(c),t.updateQueue=m}else g.add(c);break e}else{if(!(t&1)){zw(a,u,t),Vb();break e}c=Error(ie(426))}}else if(vt&&l.mode&1){var v=Fw(o);if(v!==null){!(v.flags&65536)&&(v.flags|=256),Uw(v,o,l,a,t),Ab(yo(c,l));break e}}a=c=yo(c,l),Ft!==4&&(Ft=2),Ql===null?Ql=[a]:Ql.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var y=DA(a,c,t);Rw(a,y);break e;case 1:l=c;var b=a.type,x=a.stateNode;if(!(a.flags&128)&&(typeof b.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(ta===null||!ta.has(x)))){a.flags|=65536,t&=-t,a.lanes|=t;var k=BA(a,l,t);Rw(a,k);break e}}a=a.return}while(a!==null)}iT(n)}catch(S){t=S,Rt===n&&n!==null&&(Rt=n=n.return);continue}break}while(!0)}function nT(){var e=uf.current;return uf.current=cf,e===null?cf:e}function Vb(){(Ft===0||Ft===3||Ft===2)&&(Ft=4),Xt===null||!(es&268435455)&&!($h&268435455)||Fi(Xt,an)}function hf(e,t){var n=He;He|=2;var r=nT();(Xt!==e||an!==t)&&(ti=null,Wa(e,t));do try{x$();break}catch(i){tT(e,i)}while(!0);if(Cb(),He=n,uf.current=r,Rt!==null)throw Error(ie(261));return Xt=null,an=0,Ft}function x$(){for(;Rt!==null;)rT(Rt)}function w$(){for(;Rt!==null&&!q2();)rT(Rt)}function rT(e){var t=sT(e.alternate,e,Un);e.memoizedProps=e.pendingProps,t===null?iT(e):Rt=t,Wb.current=null}function iT(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=p$(n,t),n!==null){n.flags&=32767,Rt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ft=6,Rt=null;return}}else if(n=h$(n,t,Un),n!==null){Rt=n;return}if(t=t.sibling,t!==null){Rt=t;return}Rt=t=e}while(t!==null);Ft===0&&(Ft=5)}function ja(e,t,n){var r=et,i=sr.transition;try{sr.transition=null,et=1,S$(e,t,n,r)}finally{sr.transition=i,et=r}return null}function S$(e,t,n,r){do so();while(qi!==null);if(He&6)throw Error(ie(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(ie(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(nI(e,a),e===Xt&&(Rt=Xt=null,an=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Qu||(Qu=!0,oT(Kd,function(){return so(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=sr.transition,sr.transition=null;var o=et;et=1;var l=He;He|=4,Wb.current=null,g$(e,n),QA(n,e),UI(Vg),Yd=!!Kg,Vg=Kg=null,e.current=n,y$(n),K2(),He=l,et=o,sr.transition=a}else e.current=n;if(Qu&&(Qu=!1,qi=e,ff=i),a=e.pendingLanes,a===0&&(ta=null),X2(n.stateNode),Ln(e,Tt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(df)throw df=!1,e=py,py=null,e;return ff&1&&e.tag!==0&&so(),a=e.pendingLanes,a&1?e===my?Jl++:(Jl=0,my=e):Jl=0,fa(),null}function so(){if(qi!==null){var e=Dj(ff),t=sr.transition,n=et;try{if(sr.transition=null,et=16>e?16:e,qi===null)var r=!1;else{if(e=qi,qi=null,ff=0,He&6)throw Error(ie(331));var i=He;for(He|=4,ye=e.current;ye!==null;){var a=ye,o=a.child;if(ye.flags&16){var l=a.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:Zl(8,d,a)}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(YA(d),d===u){ye=null;break}if(h!==null){h.return=p,ye=h;break}ye=p}}}var g=a.alternate;if(g!==null){var m=g.child;if(m!==null){g.child=null;do{var v=m.sibling;m.sibling=null,m=v}while(m!==null)}}ye=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,ye=o;else e:for(;ye!==null;){if(a=ye,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Zl(9,a,a.return)}var y=a.sibling;if(y!==null){y.return=a.return,ye=y;break e}ye=a.return}}var b=e.current;for(ye=b;ye!==null;){o=ye;var x=o.child;if(o.subtreeFlags&2064&&x!==null)x.return=o,ye=x;else e:for(o=b;ye!==null;){if(l=ye,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Ih(9,l)}}catch(S){jt(l,l.return,S)}if(l===o){ye=null;break e}var k=l.sibling;if(k!==null){k.return=l.return,ye=k;break e}ye=l.return}}if(He=i,fa(),Ur&&typeof Ur.onPostCommitFiberRoot=="function")try{Ur.onPostCommitFiberRoot(jh,e)}catch{}r=!0}return r}finally{et=n,sr.transition=t}}return!1}function t1(e,t,n){t=yo(n,t),t=DA(e,t,1),e=ea(e,t,1),t=En(),e!==null&&(pu(e,1,t),Ln(e,t))}function jt(e,t,n){if(e.tag===3)t1(e,e,n);else for(;t!==null;){if(t.tag===3){t1(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ta===null||!ta.has(r))){e=yo(n,e),e=BA(t,e,1),t=ea(t,e,1),e=En(),t!==null&&(pu(t,1,e),Ln(t,e));break}}t=t.return}}function k$(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=En(),e.pingedLanes|=e.suspendedLanes&n,Xt===e&&(an&n)===n&&(Ft===4||Ft===3&&(an&130023424)===an&&500>Tt()-Gb?Wa(e,0):Hb|=n),Ln(e,t)}function aT(e,t){t===0&&(e.mode&1?(t=Uu,Uu<<=1,!(Uu&130023424)&&(Uu=4194304)):t=1);var n=En();e=mi(e,t),e!==null&&(pu(e,t,n),Ln(e,n))}function E$(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),aT(e,n)}function _$(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ie(314))}r!==null&&r.delete(t),aT(e,n)}var sT;sT=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||In.current)Mn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Mn=!1,f$(e,t,n);Mn=!!(e.flags&131072)}else Mn=!1,vt&&t.flags&1048576&&uA(t,nf,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ld(e,t),e=t.pendingProps;var i=ho(t,vn.current);ao(t,n),i=Db(null,t,r,e,i,n);var a=Bb();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,$n(r)?(a=!0,ef(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Mb(t),i.updater=Rh,t.stateNode=i,i._reactInternals=t,ry(t,r,e,n),t=sy(null,t,r,!0,a,n)):(t.tag=0,vt&&a&&Nb(t),wn(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ld(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=j$(r),e=yr(r,e),i){case 0:t=ay(null,t,r,e,n);break e;case 1:t=Gw(null,t,r,e,n);break e;case 11:t=Ww(null,t,r,e,n);break e;case 14:t=Hw(null,t,r,yr(r.type,e),n);break e}throw Error(ie(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yr(r,i),ay(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yr(r,i),Gw(e,t,r,i,n);case 3:e:{if(WA(t),e===null)throw Error(ie(387));r=t.pendingProps,a=t.memoizedState,i=a.element,gA(e,t),sf(t,r,null,n);var o=t.memoizedState;if(r=o.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=yo(Error(ie(423)),t),t=qw(e,t,r,n,i);break e}else if(r!==i){i=yo(Error(ie(424)),t),t=qw(e,t,r,n,i);break e}else for(Gn=Ji(t.stateNode.containerInfo.firstChild),qn=t,vt=!0,xr=null,n=pA(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(po(),r===i){t=gi(e,t,n);break e}wn(e,t,r,n)}t=t.child}return t;case 5:return yA(t),e===null&&ey(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,Yg(r,i)?o=null:a!==null&&Yg(r,a)&&(t.flags|=32),UA(e,t),wn(e,t,o,n),t.child;case 6:return e===null&&ey(t),null;case 13:return HA(e,t,n);case 4:return Rb(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=mo(t,null,r,n):wn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yr(r,i),Ww(e,t,r,i,n);case 7:return wn(e,t,t.pendingProps,n),t.child;case 8:return wn(e,t,t.pendingProps.children,n),t.child;case 12:return wn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,ut(rf,r._currentValue),r._currentValue=o,a!==null)if(Ar(a.value,o)){if(a.children===i.children&&!In.current){t=gi(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(a.tag===1){c=ci(-1,n&-n),c.tag=2;var u=a.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}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),ty(a.return,n,t),l.lanes|=n;break}c=c.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(ie(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),ty(o,n,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}wn(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ao(t,n),i=lr(i),r=r(i),t.flags|=1,wn(e,t,r,n),t.child;case 14:return r=t.type,i=yr(r,t.pendingProps),i=yr(r.type,i),Hw(e,t,r,i,n);case 15:return zA(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yr(r,i),Ld(e,t),t.tag=1,$n(r)?(e=!0,ef(t)):e=!1,ao(t,n),LA(t,r,i),ry(t,r,i,n),sy(null,t,r,!0,e,n);case 19:return GA(e,t,n);case 22:return FA(e,t,n)}throw Error(ie(156,t.tag))};function oT(e,t){return Rj(e,t)}function N$(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 ir(e,t,n,r){return new N$(e,t,n,r)}function Yb(e){return e=e.prototype,!(!e||!e.isReactComponent)}function j$(e){if(typeof e=="function")return Yb(e)?1:0;if(e!=null){if(e=e.$$typeof,e===pb)return 11;if(e===mb)return 14}return 2}function ra(e,t){var n=e.alternate;return n===null?(n=ir(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 zd(e,t,n,r,i,a){var o=2;if(r=e,typeof e=="function")Yb(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Bs:return Ha(n.children,i,a,t);case hb:o=8,i|=8;break;case jg:return e=ir(12,n,t,i|2),e.elementType=jg,e.lanes=a,e;case Ag:return e=ir(13,n,t,i),e.elementType=Ag,e.lanes=a,e;case Tg:return e=ir(19,n,t,i),e.elementType=Tg,e.lanes=a,e;case yj:return Lh(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case mj:o=10;break e;case gj:o=9;break e;case pb:o=11;break e;case mb:o=14;break e;case Li:o=16,r=null;break e}throw Error(ie(130,e==null?e:typeof e,""))}return t=ir(o,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Ha(e,t,n,r){return e=ir(7,e,r,t),e.lanes=n,e}function Lh(e,t,n,r){return e=ir(22,e,r,t),e.elementType=yj,e.lanes=n,e.stateNode={isHidden:!1},e}function vm(e,t,n){return e=ir(6,e,null,t),e.lanes=n,e}function bm(e,t,n){return t=ir(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function A$(e,t,n,r,i){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=Jp(0),this.expirationTimes=Jp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jp(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Xb(e,t,n,r,i,a,o,l,c){return e=new A$(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=ir(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Mb(a),e}function T$(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ds,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function lT(e){if(!e)return la;e=e._reactInternals;e:{if(cs(e)!==e||e.tag!==1)throw Error(ie(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if($n(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ie(171))}if(e.tag===1){var n=e.type;if($n(n))return lA(e,n,t)}return t}function cT(e,t,n,r,i,a,o,l,c){return e=Xb(n,r,!0,e,i,a,o,l,c),e.context=lT(null),n=e.current,r=En(),i=na(n),a=ci(r,i),a.callback=t??null,ea(n,a,i),e.current.lanes=i,pu(e,i,r),Ln(e,r),e}function Dh(e,t,n,r){var i=t.current,a=En(),o=na(i);return n=lT(n),t.context===null?t.context=n:t.pendingContext=n,t=ci(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ea(i,t,o),e!==null&&(Er(e,i,o,a),Rd(e,i,o)),o}function pf(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 n1(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Zb(e,t){n1(e,t),(e=e.alternate)&&n1(e,t)}function C$(){return null}var uT=typeof reportError=="function"?reportError:function(e){console.error(e)};function Qb(e){this._internalRoot=e}Bh.prototype.render=Qb.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ie(409));Dh(e,t,null,null)};Bh.prototype.unmount=Qb.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ts(function(){Dh(null,e,null,null)}),t[pi]=null}};function Bh(e){this._internalRoot=e}Bh.prototype.unstable_scheduleHydration=function(e){if(e){var t=Fj();e={blockedOn:null,target:e,priority:t};for(var n=0;n<zi.length&&t!==0&&t<zi[n].priority;n++);zi.splice(n,0,e),n===0&&Wj(e)}};function Jb(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function zh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function r1(){}function O$(e,t,n,r,i){if(i){if(typeof r=="function"){var a=r;r=function(){var u=pf(o);a.call(u)}}var o=cT(t,r,e,0,null,!1,!1,"",r1);return e._reactRootContainer=o,e[pi]=o.current,gc(e.nodeType===8?e.parentNode:e),ts(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var u=pf(c);l.call(u)}}var c=Xb(e,0,!1,null,null,!1,!1,"",r1);return e._reactRootContainer=c,e[pi]=c.current,gc(e.nodeType===8?e.parentNode:e),ts(function(){Dh(t,c,n,r)}),c}function Fh(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i=="function"){var l=i;i=function(){var c=pf(o);l.call(c)}}Dh(t,o,e,i)}else o=O$(n,t,e,i,r);return pf(o)}Bj=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ul(t.pendingLanes);n!==0&&(vb(t,n|1),Ln(t,Tt()),!(He&6)&&(vo=Tt()+500,fa()))}break;case 13:ts(function(){var r=mi(e,1);if(r!==null){var i=En();Er(r,e,1,i)}}),Zb(e,1)}};bb=function(e){if(e.tag===13){var t=mi(e,134217728);if(t!==null){var n=En();Er(t,e,134217728,n)}Zb(e,134217728)}};zj=function(e){if(e.tag===13){var t=na(e),n=mi(e,t);if(n!==null){var r=En();Er(n,e,t,r)}Zb(e,t)}};Fj=function(){return et};Uj=function(e,t){var n=et;try{return et=e,t()}finally{et=n}};Bg=function(e,t,n){switch(t){case"input":if(Pg(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 i=Oh(r);if(!i)throw Error(ie(90));bj(r),Pg(r,i)}}}break;case"textarea":wj(e,n);break;case"select":t=n.value,t!=null&&to(e,!!n.multiple,t,!1)}};Aj=qb;Tj=ts;var P$={usingClientEntryPoint:!1,Events:[gu,Ws,Oh,Nj,jj,qb]},_l={findFiberByHostInstance:Ia,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},M$={bundleType:_l.bundleType,version:_l.version,rendererPackageName:_l.rendererPackageName,rendererConfig:_l.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:xi.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Pj(e),e===null?null:e.stateNode},findFiberByHostInstance:_l.findFiberByHostInstance||C$,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 Ju=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ju.isDisabled&&Ju.supportsFiber)try{jh=Ju.inject(M$),Ur=Ju}catch{}}Xn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=P$;Xn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Jb(t))throw Error(ie(200));return T$(e,t,null,n)};Xn.createRoot=function(e,t){if(!Jb(e))throw Error(ie(299));var n=!1,r="",i=uT;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Xb(e,1,!1,null,null,n,!1,r,i),e[pi]=t.current,gc(e.nodeType===8?e.parentNode:e),new Qb(t)};Xn.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(ie(188)):(e=Object.keys(e).join(","),Error(ie(268,e)));return e=Pj(t),e=e===null?null:e.stateNode,e};Xn.flushSync=function(e){return ts(e)};Xn.hydrate=function(e,t,n){if(!zh(t))throw Error(ie(200));return Fh(null,e,t,!0,n)};Xn.hydrateRoot=function(e,t,n){if(!Jb(e))throw Error(ie(405));var r=n!=null&&n.hydratedSources||null,i=!1,a="",o=uT;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=cT(t,null,e,1,n??null,i,!1,a,o),e[pi]=t.current,gc(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Bh(t)};Xn.render=function(e,t,n){if(!zh(t))throw Error(ie(200));return Fh(null,e,t,!1,n)};Xn.unmountComponentAtNode=function(e){if(!zh(e))throw Error(ie(40));return e._reactRootContainer?(ts(function(){Fh(null,null,e,!1,function(){e._reactRootContainer=null,e[pi]=null})}),!0):!1};Xn.unstable_batchedUpdates=qb;Xn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!zh(n))throw Error(ie(200));if(e==null||e._reactInternals===void 0)throw Error(ie(38));return Fh(e,t,n,!1,r)};Xn.version="18.3.1-next-f1338f8080-20240426";function dT(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(dT)}catch(e){console.error(e)}}dT(),dj.exports=Xn;var R$=dj.exports,fT,i1=R$;fT=i1.createRoot,i1.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 _c(){return _c=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},_c.apply(null,arguments)}var Ki;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ki||(Ki={}));const a1="popstate";function I$(e){e===void 0&&(e={});function t(r,i){let{pathname:a,search:o,hash:l}=r.location;return vy("",{pathname:a,search:o,hash:l},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:mf(i)}return L$(t,n,null,e)}function Et(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ex(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function $$(){return Math.random().toString(36).substr(2,8)}function s1(e,t){return{usr:e.state,key:e.key,idx:t}}function vy(e,t,n,r){return n===void 0&&(n=null),_c({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?qo(t):t,{state:n,key:t&&t.key||r||$$()})}function mf(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 qo(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 L$(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,l=Ki.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(_c({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){l=Ki.Pop;let v=d(),y=v==null?null:v-u;u=v,c&&c({action:l,location:m.location,delta:y})}function h(v,y){l=Ki.Push;let b=vy(m.location,v,y);u=d()+1;let x=s1(b,u),k=m.createHref(b);try{o.pushState(x,"",k)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;i.location.assign(k)}a&&c&&c({action:l,location:m.location,delta:1})}function p(v,y){l=Ki.Replace;let b=vy(m.location,v,y);u=d();let x=s1(b,u),k=m.createHref(b);o.replaceState(x,"",k),a&&c&&c({action:l,location:m.location,delta:0})}function g(v){let y=i.location.origin!=="null"?i.location.origin:i.location.href,b=typeof v=="string"?v:mf(v);return b=b.replace(/ $/,"%20"),Et(y,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,y)}let m={get action(){return l},get location(){return e(i,o)},listen(v){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(a1,f),c=v,()=>{i.removeEventListener(a1,f),c=null}},createHref(v){return t(i,v)},createURL:g,encodeLocation(v){let y=g(v);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:h,replace:p,go(v){return o.go(v)}};return m}var o1;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(o1||(o1={}));function D$(e,t,n){return n===void 0&&(n="/"),B$(e,t,n)}function B$(e,t,n,r){let i=typeof t=="string"?qo(t):t,a=bo(i.pathname||"/",n);if(a==null)return null;let o=hT(e);z$(o);let l=null,c=Z$(a);for(let u=0;l==null&&u<o.length;++u)l=Y$(o[u],c);return l}function hT(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(a,o,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};c.relativePath.startsWith("/")&&(Et(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=ia([r,c.relativePath]),d=n.concat(c);a.children&&a.children.length>0&&(Et(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),hT(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:K$(u,a.index),routesMeta:d})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))i(a,o);else for(let c of pT(a.path))i(a,o,c)}),t}function pT(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let o=pT(r.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),i&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function z$(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:V$(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const F$=/^:[\w-]+$/,U$=3,W$=2,H$=1,G$=10,q$=-2,l1=e=>e==="*";function K$(e,t){let n=e.split("/"),r=n.length;return n.some(l1)&&(r+=q$),t&&(r+=W$),n.filter(i=>!l1(i)).reduce((i,a)=>i+(F$.test(a)?U$:a===""?H$:G$),r)}function V$(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function Y$(e,t,n){let{routesMeta:r}=e,i={},a="/",o=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,d=a==="/"?t:t.slice(a.length)||"/",f=by({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),h=c.route;if(!f)return null;Object.assign(i,f.params),o.push({params:i,pathname:ia([a,f.pathname]),pathnameBase:nL(ia([a,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(a=ia([a,f.pathnameBase]))}return o}function by(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=X$(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:h,isOptional:p}=d;if(h==="*"){let m=l[f]||"";o=a.slice(0,a.length-m.length).replace(/(.)\/+$/,"$1")}const g=l[f];return p&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function X$(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),ex(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Z$(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ex(!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 bo(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 Q$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,J$=e=>Q$.test(e);function eL(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?qo(e):e,a;if(n)if(J$(n))a=n;else{if(n.includes("//")){let o=n;n=mT(n),ex(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?a=c1(n.substring(1),"/"):a=c1(n,t)}else a=t;return{pathname:a,search:rL(r),hash:iL(i)}}function c1(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function xm(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 tL(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function tx(e,t){let n=tL(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function nx(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=qo(e):(i=_c({},e),Et(!i.pathname||!i.pathname.includes("?"),xm("?","pathname","search",i)),Et(!i.pathname||!i.pathname.includes("#"),xm("#","pathname","hash",i)),Et(!i.search||!i.search.includes("#"),xm("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.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;i.pathname=h.join("/")}l=f>=0?t[f]:"/"}let c=eL(i,l),u=o&&o!=="/"&&o.endsWith("/"),d=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const mT=e=>e.replace(/\/\/+/g,"/"),ia=e=>mT(e.join("/")),nL=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),rL=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,iL=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function aL(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const gT=["post","put","patch","delete"];new Set(gT);const sL=["get",...gT];new Set(sL);/**
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 Nc(){return Nc=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},Nc.apply(null,arguments)}const Uh=E.createContext(null),yT=E.createContext(null),wi=E.createContext(null),Wh=E.createContext(null),ha=E.createContext({outlet:null,matches:[],isDataRoute:!1}),vT=E.createContext(null);function oL(e,t){let{relative:n}=t===void 0?{}:t;Ko()||Et(!1);let{basename:r,navigator:i}=E.useContext(wi),{hash:a,pathname:o,search:l}=Hh(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:ia([r,o])),i.createHref({pathname:c,search:l,hash:a})}function Ko(){return E.useContext(Wh)!=null}function Vo(){return Ko()||Et(!1),E.useContext(Wh).location}function bT(e){E.useContext(wi).static||E.useLayoutEffect(e)}function xT(){let{isDataRoute:e}=E.useContext(ha);return e?xL():lL()}function lL(){Ko()||Et(!1);let e=E.useContext(Uh),{basename:t,future:n,navigator:r}=E.useContext(wi),{matches:i}=E.useContext(ha),{pathname:a}=Vo(),o=JSON.stringify(tx(i,n.v7_relativeSplatPath)),l=E.useRef(!1);return bT(()=>{l.current=!0}),E.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=nx(u,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:ia([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,a,e])}function Hh(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=E.useContext(wi),{matches:i}=E.useContext(ha),{pathname:a}=Vo(),o=JSON.stringify(tx(i,r.v7_relativeSplatPath));return E.useMemo(()=>nx(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function cL(e,t){return uL(e,t)}function uL(e,t,n,r){Ko()||Et(!1);let{navigator:i}=E.useContext(wi),{matches:a}=E.useContext(ha),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=Vo(),d;if(t){var f;let v=typeof t=="string"?qo(t):t;c==="/"||(f=v.pathname)!=null&&f.startsWith(c)||Et(!1),d=v}else d=u;let h=d.pathname||"/",p=h;if(c!=="/"){let v=c.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(v.length).join("/")}let g=D$(e,{pathname:p}),m=mL(g&&g.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:ia([c,i.encodeLocation?i.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:ia([c,i.encodeLocation?i.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),a,n,r);return t&&m?E.createElement(Wh.Provider,{value:{location:Nc({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Ki.Pop}},m):m}function dL(){let e=bL(),t=aL(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return E.createElement(E.Fragment,null,E.createElement("h2",null,"Unexpected Application Error!"),E.createElement("h3",{style:{fontStyle:"italic"}},t),n?E.createElement("pre",{style:i},n):null,null)}const fL=E.createElement(dL,null);class hL extends E.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?E.createElement(ha.Provider,{value:this.props.routeContext},E.createElement(vT.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function pL(e){let{routeContext:t,match:n,children:r}=e,i=E.useContext(Uh);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),E.createElement(ha.Provider,{value:t},r)}function mL(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=r)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(i=n)==null?void 0:i.errors;if(l!=null){let d=o.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||Et(!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,g=f.route.loader&&h[f.route.id]===void 0&&(!p||p[f.route.id]===void 0);if(f.route.lazy||g){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,f,h)=>{let p,g=!1,m=null,v=null;n&&(p=l&&f.route.id?l[f.route.id]:void 0,m=f.route.errorElement||fL,c&&(u<0&&h===0?(wL("route-fallback"),g=!0,v=null):u===h&&(g=!0,v=f.route.hydrateFallbackElement||null)));let y=t.concat(o.slice(0,h+1)),b=()=>{let x;return p?x=m:g?x=v:f.route.Component?x=E.createElement(f.route.Component,null):f.route.element?x=f.route.element:x=d,E.createElement(pL,{match:f,routeContext:{outlet:d,matches:y,isDataRoute:n!=null},children:x})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?E.createElement(hL,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:b(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):b()},null)}var wT=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(wT||{}),ST=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}(ST||{});function gL(e){let t=E.useContext(Uh);return t||Et(!1),t}function yL(e){let t=E.useContext(yT);return t||Et(!1),t}function vL(e){let t=E.useContext(ha);return t||Et(!1),t}function kT(e){let t=vL(),n=t.matches[t.matches.length-1];return n.route.id||Et(!1),n.route.id}function bL(){var e;let t=E.useContext(vT),n=yL(),r=kT();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function xL(){let{router:e}=gL(wT.UseNavigateStable),t=kT(ST.UseNavigateStable),n=E.useRef(!1);return bT(()=>{n.current=!0}),E.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Nc({fromRouteId:t},a)))},[e,t])}const u1={};function wL(e,t,n){u1[e]||(u1[e]=!0)}function SL(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function d1(e){let{to:t,replace:n,state:r,relative:i}=e;Ko()||Et(!1);let{future:a,static:o}=E.useContext(wi),{matches:l}=E.useContext(ha),{pathname:c}=Vo(),u=xT(),d=nx(t,tx(l,a.v7_relativeSplatPath),c,i==="path"),f=JSON.stringify(d);return E.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:i}),[u,f,i,n,r]),null}function at(e){Et(!1)}function kL(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Ki.Pop,navigator:a,static:o=!1,future:l}=e;Ko()&&Et(!1);let c=t.replace(/^\/*/,"/"),u=E.useMemo(()=>({basename:c,navigator:a,static:o,future:Nc({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof r=="string"&&(r=qo(r));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:g="default"}=r,m=E.useMemo(()=>{let v=bo(d,c);return v==null?null:{location:{pathname:v,search:f,hash:h,state:p,key:g},navigationType:i}},[c,d,f,h,p,g,i]);return m==null?null:E.createElement(wi.Provider,{value:u},E.createElement(Wh.Provider,{children:n,value:m}))}function EL(e){let{children:t,location:n}=e;return cL(xy(t),n)}new Promise(()=>{});function xy(e,t){t===void 0&&(t=[]);let n=[];return E.Children.forEach(e,(r,i)=>{if(!E.isValidElement(r))return;let a=[...t,i];if(r.type===E.Fragment){n.push.apply(n,xy(r.props.children,a));return}r.type!==at&&Et(!1),!r.props.index||!r.props.children||Et(!1);let o={id:r.props.id||a.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=xy(r.props.children,a)),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 gf(){return gf=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},gf.apply(null,arguments)}function ET(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 _L(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function NL(e,t){return e.button===0&&(!t||t==="_self")&&!_L(e)}const jL=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],AL=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],TL="6";try{window.__reactRouterVersion=TL}catch{}const CL=E.createContext({isTransitioning:!1}),OL="startTransition",f1=k2[OL];function PL(e){let{basename:t,children:n,future:r,window:i}=e,a=E.useRef();a.current==null&&(a.current=I$({window:i,v5Compat:!0}));let o=a.current,[l,c]=E.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=E.useCallback(f=>{u&&f1?f1(()=>c(f)):c(f)},[c,u]);return E.useLayoutEffect(()=>o.listen(d),[o,d]),E.useEffect(()=>SL(r),[r]),E.createElement(kL,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const ML=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",RL=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wy=E.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:a,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,h=ET(t,jL),{basename:p}=E.useContext(wi),g,m=!1;if(typeof u=="string"&&RL.test(u)&&(g=u,ML))try{let x=new URL(window.location.href),k=u.startsWith("//")?new URL(x.protocol+u):new URL(u),S=bo(k.pathname,p);k.origin===x.origin&&S!=null?u=S+k.search+k.hash:m=!0}catch{}let v=oL(u,{relative:i}),y=LL(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:i,viewTransition:f});function b(x){r&&r(x),x.defaultPrevented||y(x)}return E.createElement("a",gf({},h,{href:g||v,onClick:m||a?r:b,ref:n,target:c}))}),IL=E.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:a="",end:o=!1,style:l,to:c,viewTransition:u,children:d}=t,f=ET(t,AL),h=Hh(c,{relative:f.relative}),p=Vo(),g=E.useContext(yT),{navigator:m,basename:v}=E.useContext(wi),y=g!=null&&DL(h)&&u===!0,b=m.encodeLocation?m.encodeLocation(h).pathname:h.pathname,x=p.pathname,k=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;i||(x=x.toLowerCase(),k=k?k.toLowerCase():null,b=b.toLowerCase()),k&&v&&(k=bo(k,v)||k);const S=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let w=x===b||!o&&x.startsWith(b)&&x.charAt(S)==="/",_=k!=null&&(k===b||!o&&k.startsWith(b)&&k.charAt(b.length)==="/"),N={isActive:w,isPending:_,isTransitioning:y},C=w?r:void 0,T;typeof a=="function"?T=a(N):T=[a,w?"active":null,_?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let $=typeof l=="function"?l(N):l;return E.createElement(wy,gf({},f,{"aria-current":C,className:T,ref:n,style:$,to:c,viewTransition:u}),typeof d=="function"?d(N):d)});var Sy;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Sy||(Sy={}));var h1;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(h1||(h1={}));function $L(e){let t=E.useContext(Uh);return t||Et(!1),t}function LL(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=xT(),u=Vo(),d=Hh(e,{relative:o});return E.useCallback(f=>{if(NL(f,n)){f.preventDefault();let h=r!==void 0?r:mf(u)===mf(d);c(e,{replace:h,state:i,preventScrollReset:a,relative:o,viewTransition:l})}},[u,c,d,r,i,n,e,a,o,l])}function DL(e,t){t===void 0&&(t={});let n=E.useContext(CL);n==null&&Et(!1);let{basename:r}=$L(Sy.useViewTransitionState),i=Hh(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=bo(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=bo(n.nextLocation.pathname,r)||n.nextLocation.pathname;return by(i.pathname,o)!=null||by(i.pathname,a)!=null}async function ni(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 Xs="buff-dashboard-admin-token";function _T(){try{if(typeof window<"u"&&window.localStorage)return window.localStorage}catch{}return null}const ky=new Map;function BL(){const e=_T();if(e)try{const t=e.getItem(Xs);if(t)return t}catch{}return ky.get(Xs)??null}function zL(e){const t=_T();if(t)try{e?t.setItem(Xs,e):t.removeItem(Xs);return}catch{}e?ky.set(Xs,e):ky.delete(Xs)}function un(){return BL()}function wm(e){zL(e)}function Rr(){const e=un();return e?{Authorization:`Bearer ${e}`}:{}}class FL{constructor(t=""){Pr(this,"sse",null);Pr(this,"listeners",new Set);Pr(this,"connectionListeners",new Set);Pr(this,"dagListeners",new Set);Pr(this,"typingListeners",new Set);Pr(this,"chatRetryListeners",new Set);Pr(this,"reconnectTimer",null);Pr(this,"baseUrl");Pr(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 ni(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(),i=await fetch(`${this.baseUrl}/api/executions${r?`?${r}`:""}`,{signal:AbortSignal.timeout(8e3)}),a=await ni(i);return(a==null?void 0:a.entries)??[]}catch{return[]}}async fetchTraces(){try{const t=await fetch(`${this.baseUrl}/api/traces`,{signal:AbortSignal.timeout(8e3)}),n=await ni(t);return n!=null&&n.traces?n.traces:null}catch{return null}}async fetchAdminChecks(){try{const t=await fetch(`${this.baseUrl}/api/admin/checks`,{signal:AbortSignal.timeout(15e3)}),n=await ni(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 ni(n);return!r||!Array.isArray((t=r.toolsets)==null?void 0:t.toolsets)?null:r}catch{return null}}async fetchTraceDetail(t){try{const n=await fetch(`${this.baseUrl}/api/traces/${encodeURIComponent(t)}`,{signal:AbortSignal.timeout(8e3)}),r=await ni(n);return r&&Array.isArray(r.steps)?r:null}catch{return null}}async sendAdminRequest(t,n,r){try{const i=un(),a=await fetch(`${this.baseUrl}${t}`,{method:n,headers:{"Content-Type":"application/json",...i?{Authorization:`Bearer ${i}`}:{}},body:r!==void 0?JSON.stringify(r):void 0,signal:AbortSignal.timeout(15e3)}),o=a.headers.get("content-type")||"";let l=null;if(o.includes("application/json")||o.includes("text/json"))try{l=await a.json()}catch{l=null}return{status:a.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}}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 i=await this.sendAdminRequest("/api/admin/users","POST",{user:t,password:n,role:r});if(!i)return{ok:!1,error:"Could not reach the dashboard server."};const a=i.data??{};return i.status===200&&a.ok?a:{ok:!1,error:a.error||"Failed to add user.",forbidden:i.status===403,unauthorized:i.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 i=r.data??{};return r.status===200&&typeof i.token=="string"?(wm(i.token),{ok:!0,user:i.user,token:i.token}):{ok:!1,error:i.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 i=r.data??{};return r.status===200&&typeof i.token=="string"?(wm(i.token),{ok:!0,user:i.user,token:i.token}):{ok:!1,error:i.error||"Login failed.",unauthorized:r.status===401}}async adminLogout(){await this.sendAdminRequest("/api/admin/logout","POST"),wm(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 i=r.data??{};return r.status===200&&i.ok?i:{ok:!1,error:i.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 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 i=r.data??{};return r.status===200&&i.ok?i:{ok:!1,error:i.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 i=r.data??{};return r.status===200&&i.ok?i:{ok:!1,error:i.error||"Toggle failed.",unauthorized:r.status===401,forbidden:r.status===403}}async marketplaceSearch(t){try{const r=await(await fetch(`${this.baseUrl}/api/skills/marketplace?q=${encodeURIComponent(t)}`,{headers:Rr()})).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",...Rr()},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",...Rr()},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 i=r.data??{};return r.status===200&&i.ok?i:{ok:!1,error:i.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,i){const a={policies:t};Array.isArray(n)&&(a.statusRecipients=n),Array.isArray(r)&&(a.contacts=r),i&&(a.askUserWait=i.wait,typeof i.timeoutMs=="number"&&(a.askUserTimeoutMs=i.timeoutMs));const o=await this.sendAdminRequest("/api/admin/gateway/policies","PUT",a);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(),i=await this.sendAdminRequest(`/api/admin/gateway/conversations${r?`?${r}`:""}`,"GET");if(!i)return{ok:!1,error:"Could not reach the dashboard server."};const a=i.data??{};return i.status===200&&a.ok?{ok:!0,conversations:a.conversations,total:a.total,hasMore:a.hasMore}:{ok:!1,error:a.error||"Failed to load conversations.",unauthorized:i.status===401,forbidden:i.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 i=r.data??{};return r.status===200&&i.ok?{ok:!0}:{ok:!1,error:i.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 i=r.data??{};return r.status===200&&i.ok?{ok:!0}:{ok:!1,error:i.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,i;try{const a=un(),o=await fetch(`${this.baseUrl}/api/admin/gateway/conversations/export`,{method:"POST",headers:{"Content-Type":"application/json",...a?{Authorization:`Bearer ${a}`}:{}},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=((i=(r=o.headers.get("content-disposition"))==null?void 0:r.match(/filename="(.+)"/))==null?void 0:i[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(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}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 i=await this.sendAdminRequest("/api/admin/contacts","PUT",{action:"update",platform:t,id:n,...r});if(!i)return{ok:!1,error:"Could not reach the dashboard server."};const a=i.data??{};return i.status===200&&a.ok?a:{ok:!1,error:a.error||"Update failed."}}async contactAction(t,n,r){const i=await this.sendAdminRequest("/api/admin/contacts","PUT",{action:t,platform:n,nameOrId:r});if(!i)return{ok:!1,error:"Could not reach the dashboard server."};const a=i.data??{};return i.status===200&&a.ok?a:{ok:!1,error:a.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 i=r.data??{};return r.status===200&&i.ok?i:{ok:!1,error:i.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 i=r.data??{};return{ok:i.ok??!1,info:i.info,error:i.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 i=r.data??{};return r.status===200&&i.ok&&i.task?i:{ok:!1,error:i.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=un(),i=new EventSource(`${this.baseUrl}/api/tasks/${encodeURIComponent(t)}/events?token=${encodeURIComponent(r??"")}`);return i.addEventListener("log",a=>{var o;try{(o=n.onLog)==null||o.call(n,JSON.parse(a.data))}catch{}}),i.addEventListener("status",a=>{var o;try{const l=JSON.parse(a.data);l.status&&((o=n.onStatus)==null||o.call(n,l.status))}catch{}}),()=>i.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=un(),r=new EventSource(`${this.baseUrl}/api/whatsapp/events?token=${encodeURIComponent(n??"")}`);return r.addEventListener("qr",i=>{var a;try{const o=JSON.parse(i.data);o.qr&&((a=t.onQr)==null||a.call(t,o.qr))}catch{}}),r.addEventListener("code",i=>{var a;try{const o=JSON.parse(i.data);o.code&&((a=t.onCode)==null||a.call(t,o.code))}catch{}}),r.addEventListener("status",i=>{var a;try{(a=t.onStatus)==null||a.call(t,JSON.parse(i.data))}catch{}}),()=>r.close()}async chatResolve(t){const n=un();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)}),i=await r.json();return r.status===200&&i.ok&&Array.isArray(i.matches)?{ok:!0,matches:i.matches}:{ok:!1,matches:[],error:typeof i.error=="string"?i.error:"Resolve failed."}}catch{return{ok:!1,matches:[],error:"Could not reach the dashboard server."}}}async listProjects(){const t=un();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=un();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)}),i=await r.json();return r.status===200&&i.ok&&i.project?{ok:!0,project:i.project}:{ok:!1,error:typeof i.error=="string"?i.error:"Attach failed."}}catch{return{ok:!1,error:"Could not reach the dashboard server."}}}async browseDirectories(t,n){const r=un();try{const i=new URLSearchParams;t&&i.set("path",t),n!=null&&n.showDrives&&i.set("showDrives","1");const a=i.toString()?`?${i.toString()}`:"",o=await fetch(`${this.baseUrl}/api/browse${a}`,{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=un();try{const i=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)}),a=await i.json();return i.status===200&&a.ok&&a.path?{ok:!0,path:a.path}:{ok:!1,path:"",error:typeof a.error=="string"?a.error:"Could not resolve folder."}}catch{return{ok:!1,path:"",error:"Could not reach the dashboard server."}}}async listChatSessions(){const t=un();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=un();try{const r=await fetch(`${this.baseUrl}/api/sessions/${encodeURIComponent(t)}`,{method:"DELETE",headers:n?{Authorization:`Bearer ${n}`}:{},signal:AbortSignal.timeout(1e4)}),i=await r.json();return r.status===200&&i.ok?{ok:!0}:{ok:!1,error:i.error||"Could not delete the session."}}catch{return{ok:!1,error:"Network error — could not delete the session."}}}async renameChatSession(t,n){const r=un();try{const i=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)}),a=await i.json();return i.status===200&&a.ok?{ok:!0}:{ok:!1,error:a.error||"Could not rename the session."}}catch{return{ok:!1,error:"Network error — could not rename the session."}}}async getChatSession(t){const n=un();try{const r=await fetch(`${this.baseUrl}/api/sessions/${encodeURIComponent(t)}`,{headers:n?{Authorization:`Bearer ${n}`}:{},signal:AbortSignal.timeout(1e4)}),i=await r.json();return r.status===200&&i.ok&&i.session?i.session:null}catch{return null}}async chatSend(t,n,r,i){const a=un();try{const o=await fetch(`${this.baseUrl}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json",...a?{Authorization:`Bearer ${a}`}:{}},body:JSON.stringify({sessionId:t,message:n,provider:r==null?void 0:r.provider,model:r==null?void 0:r.model,projectPath:r==null?void 0:r.projectPath,attachments:r==null?void 0:r.attachments}),signal:i?AbortSignal.any([AbortSignal.timeout(3e5),i]):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,generationFailed:l.generationFailed===!0,retryQueued:l.retryQueued===!0}:{ok:!1,error:typeof l.error=="string"?l.error:"The agent could not answer.",unauthorized:o.status===401,forbidden:o.status===403}}catch{return{ok:!1,error:"Could not reach the dashboard server, or the turn timed out."}}}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."}}subscribeChat(t,n){const r=un(),i=new EventSource(`${this.baseUrl}/api/chat/${encodeURIComponent(t)}/events?token=${encodeURIComponent(r??"")}`);return i.addEventListener("progress",a=>{var o;try{const l=JSON.parse(a.data);l.line&&((o=n.onProgress)==null||o.call(n,l.line))}catch{}}),i.addEventListener("status",a=>{var o;try{const l=JSON.parse(a.data);l.status&&((o=n.onStatus)==null||o.call(n,l.status))}catch{}}),i.addEventListener("token",a=>{var o;try{const l=JSON.parse(a.data);typeof l.text=="string"&&l.text.length>0&&((o=n.onToken)==null||o.call(n,l.text))}catch{}}),i.addEventListener("tool",a=>{var o;try{const l=JSON.parse(a.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{}}),i.addEventListener("plan",a=>{var o;try{const l=JSON.parse(a.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{}}),i.addEventListener("diff",a=>{var o;try{const l=JSON.parse(a.data);Array.isArray(l.files)&&((o=n.onDiff)==null||o.call(n,{files:l.files,summary:l.summary??""}))}catch{}}),i.addEventListener("skill_draft",a=>{var o;try{const l=JSON.parse(a.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{}}),i.addEventListener("secret_request",a=>{var o;try{const l=JSON.parse(a.data);l.skillName&&Array.isArray(l.missing)&&((o=n.onSecretRequest)==null||o.call(n,{skillName:l.skillName,missing:l.missing,persisted:l.persisted??{}}))}catch{}}),i.addEventListener("execution_result",a=>{var o;try{const l=JSON.parse(a.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{}}),i.addEventListener("question",a=>{var o;try{const l=JSON.parse(a.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{}}),()=>i.close()}async chatRespond(t,n,r={}){try{const a=await(await fetch(`${this.baseUrl}/api/chat/${encodeURIComponent(t)}/respond`,{method:"POST",headers:{"Content-Type":"application/json",...Rr()},body:JSON.stringify({questionId:n,...r})})).json();return{ok:a.ok===!0,error:a.error}}catch(i){return{ok:!1,error:i instanceof Error?i.message:String(i)}}}async skillDraftAccept(t){try{const r=await(await fetch(`${this.baseUrl}/api/skills/drafts/${encodeURIComponent(t)}/accept`,{method:"POST",headers:{...Rr()}})).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:{...Rr()}})).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",...Rr()},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:{...Rr()}}),n=await ni(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",...Rr()},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",...Rr()},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)}}}}const ee=new FL,UL=[{path:"/",label:"Chat",icon:"💬"},{path:"/overview",label:"Overview",icon:"📊"},{path:"/dag",label:"Execution",icon:"🔀"},{path:"/tasks",label:"Tasks",icon:"🚀"},{path:"/evals",label:"Evals",icon:"🏆"},{path:"/platforms",label:"Platforms",icon:"🌐"},{path:"/contacts",label:"Contacts",icon:"📇"},{path:"/gateway",label:"Gateway",icon:"📡"},{path:"/models",label:"Models",icon:"🧠"},{path:"/models/timeline",label:"Timeline",icon:"📅"},{path:"/routing",label:"Routing",icon:"🤖"},{path:"/requests",label:"Requests",icon:"📨"},{path:"/hub",label:"Agent Hub",icon:"🧰"},{path:"/traces",label:"Traces",icon:"🔍"},{path:"/env",label:"Environment",icon:"🔐"},{path:"/memory",label:"Memory",icon:"💾"},{path:"/executions",label:"Executions",icon:"📜"},{path:"/history",label:"History",icon:"📝"},{path:"/costs",label:"Costs",icon:"💰"},{path:"/benchmarks",label:"Benchmarks",icon:"📈"},{path:"/system",label:"System",icon:"⚙️"},{path:"/admin",label:"Admin",icon:"🛠️"}];function WL({children:e,connected:t,lastUpdated:n}){const r=t?"connected":"reconnecting",i=t?"Connected":"Reconnecting...";return s.jsxs("div",{className:"layout",children:[s.jsxs("nav",{className:"nav",children:[s.jsxs("div",{className:"nav-header",children:[s.jsx("span",{className:"nav-logo",children:"🤖"}),s.jsx("span",{className:"nav-title",children:"Agent-Nuvira"})]}),s.jsx("div",{className:"nav-links",children:UL.map(a=>s.jsxs(IL,{to:a.path,end:a.path==="/",className:({isActive:o})=>`nav-link${o?" active":""}`,children:[a.icon," ",a.label]},a.path))}),s.jsxs("div",{className:"nav-footer",children:[s.jsx("span",{className:`status-dot ${r}`}),s.jsx("span",{className:"status-text",children:i}),s.jsx("span",{className:"last-updated",children:n})]})]}),s.jsx("main",{className:"main",children:e})]})}function NT(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=NT(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ke(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=NT(e))&&(r&&(r+=" "),r+=t);return r}var HL=Array.isArray,Dn=HL,GL=typeof Hi=="object"&&Hi&&Hi.Object===Object&&Hi,jT=GL,qL=jT,KL=typeof self=="object"&&self&&self.Object===Object&&self,VL=qL||KL||Function("return this")(),Vr=VL,YL=Vr,XL=YL.Symbol,vu=XL,p1=vu,AT=Object.prototype,ZL=AT.hasOwnProperty,QL=AT.toString,Nl=p1?p1.toStringTag:void 0;function JL(e){var t=ZL.call(e,Nl),n=e[Nl];try{e[Nl]=void 0;var r=!0}catch{}var i=QL.call(e);return r&&(t?e[Nl]=n:delete e[Nl]),i}var eD=JL,tD=Object.prototype,nD=tD.toString;function rD(e){return nD.call(e)}var iD=rD,m1=vu,aD=eD,sD=iD,oD="[object Null]",lD="[object Undefined]",g1=m1?m1.toStringTag:void 0;function cD(e){return e==null?e===void 0?lD:oD:g1&&g1 in Object(e)?aD(e):sD(e)}var Si=cD;function uD(e){return e!=null&&typeof e=="object"}var ki=uD,dD=Si,fD=ki,hD="[object Symbol]";function pD(e){return typeof e=="symbol"||fD(e)&&dD(e)==hD}var Yo=pD,mD=Dn,gD=Yo,yD=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,vD=/^\w*$/;function bD(e,t){if(mD(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||gD(e)?!0:vD.test(e)||!yD.test(e)||t!=null&&e in Object(t)}var rx=bD;function xD(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var pa=xD;const Xo=Xe(pa);var wD=Si,SD=pa,kD="[object AsyncFunction]",ED="[object Function]",_D="[object GeneratorFunction]",ND="[object Proxy]";function jD(e){if(!SD(e))return!1;var t=wD(e);return t==ED||t==_D||t==kD||t==ND}var ix=jD;const $e=Xe(ix);var AD=Vr,TD=AD["__core-js_shared__"],CD=TD,Sm=CD,y1=function(){var e=/[^.]+$/.exec(Sm&&Sm.keys&&Sm.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function OD(e){return!!y1&&y1 in e}var PD=OD,MD=Function.prototype,RD=MD.toString;function ID(e){if(e!=null){try{return RD.call(e)}catch{}try{return e+""}catch{}}return""}var TT=ID,$D=ix,LD=PD,DD=pa,BD=TT,zD=/[\\^$.*+?()[\]{}|]/g,FD=/^\[object .+?Constructor\]$/,UD=Function.prototype,WD=Object.prototype,HD=UD.toString,GD=WD.hasOwnProperty,qD=RegExp("^"+HD.call(GD).replace(zD,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function KD(e){if(!DD(e)||LD(e))return!1;var t=$D(e)?qD:FD;return t.test(BD(e))}var VD=KD;function YD(e,t){return e==null?void 0:e[t]}var XD=YD,ZD=VD,QD=XD;function JD(e,t){var n=QD(e,t);return ZD(n)?n:void 0}var us=JD,eB=us,tB=eB(Object,"create"),Gh=tB,v1=Gh;function nB(){this.__data__=v1?v1(null):{},this.size=0}var rB=nB;function iB(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var aB=iB,sB=Gh,oB="__lodash_hash_undefined__",lB=Object.prototype,cB=lB.hasOwnProperty;function uB(e){var t=this.__data__;if(sB){var n=t[e];return n===oB?void 0:n}return cB.call(t,e)?t[e]:void 0}var dB=uB,fB=Gh,hB=Object.prototype,pB=hB.hasOwnProperty;function mB(e){var t=this.__data__;return fB?t[e]!==void 0:pB.call(t,e)}var gB=mB,yB=Gh,vB="__lodash_hash_undefined__";function bB(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=yB&&t===void 0?vB:t,this}var xB=bB,wB=rB,SB=aB,kB=dB,EB=gB,_B=xB;function Zo(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])}}Zo.prototype.clear=wB;Zo.prototype.delete=SB;Zo.prototype.get=kB;Zo.prototype.has=EB;Zo.prototype.set=_B;var NB=Zo;function jB(){this.__data__=[],this.size=0}var AB=jB;function TB(e,t){return e===t||e!==e&&t!==t}var ax=TB,CB=ax;function OB(e,t){for(var n=e.length;n--;)if(CB(e[n][0],t))return n;return-1}var qh=OB,PB=qh,MB=Array.prototype,RB=MB.splice;function IB(e){var t=this.__data__,n=PB(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():RB.call(t,n,1),--this.size,!0}var $B=IB,LB=qh;function DB(e){var t=this.__data__,n=LB(t,e);return n<0?void 0:t[n][1]}var BB=DB,zB=qh;function FB(e){return zB(this.__data__,e)>-1}var UB=FB,WB=qh;function HB(e,t){var n=this.__data__,r=WB(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var GB=HB,qB=AB,KB=$B,VB=BB,YB=UB,XB=GB;function Qo(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])}}Qo.prototype.clear=qB;Qo.prototype.delete=KB;Qo.prototype.get=VB;Qo.prototype.has=YB;Qo.prototype.set=XB;var Kh=Qo,ZB=us,QB=Vr,JB=ZB(QB,"Map"),sx=JB,b1=NB,ez=Kh,tz=sx;function nz(){this.size=0,this.__data__={hash:new b1,map:new(tz||ez),string:new b1}}var rz=nz;function iz(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var az=iz,sz=az;function oz(e,t){var n=e.__data__;return sz(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Vh=oz,lz=Vh;function cz(e){var t=lz(this,e).delete(e);return this.size-=t?1:0,t}var uz=cz,dz=Vh;function fz(e){return dz(this,e).get(e)}var hz=fz,pz=Vh;function mz(e){return pz(this,e).has(e)}var gz=mz,yz=Vh;function vz(e,t){var n=yz(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var bz=vz,xz=rz,wz=uz,Sz=hz,kz=gz,Ez=bz;function Jo(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])}}Jo.prototype.clear=xz;Jo.prototype.delete=wz;Jo.prototype.get=Sz;Jo.prototype.has=kz;Jo.prototype.set=Ez;var ox=Jo,CT=ox,_z="Expected a function";function lx(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(_z);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(lx.Cache||CT),n}lx.Cache=CT;var OT=lx;const Nz=Xe(OT);var jz=OT,Az=500;function Tz(e){var t=jz(e,function(r){return n.size===Az&&n.clear(),r}),n=t.cache;return t}var Cz=Tz,Oz=Cz,Pz=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Mz=/\\(\\)?/g,Rz=Oz(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Pz,function(n,r,i,a){t.push(i?a.replace(Mz,"$1"):r||n)}),t}),Iz=Rz;function $z(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var cx=$z,x1=vu,Lz=cx,Dz=Dn,Bz=Yo,w1=x1?x1.prototype:void 0,S1=w1?w1.toString:void 0;function PT(e){if(typeof e=="string")return e;if(Dz(e))return Lz(e,PT)+"";if(Bz(e))return S1?S1.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var zz=PT,Fz=zz;function Uz(e){return e==null?"":Fz(e)}var MT=Uz,Wz=Dn,Hz=rx,Gz=Iz,qz=MT;function Kz(e,t){return Wz(e)?e:Hz(e,t)?[e]:Gz(qz(e))}var RT=Kz,Vz=Yo;function Yz(e){if(typeof e=="string"||Vz(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var Yh=Yz,Xz=RT,Zz=Yh;function Qz(e,t){t=Xz(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Zz(t[n++])];return n&&n==r?e:void 0}var ux=Qz,Jz=ux;function e3(e,t,n){var r=e==null?void 0:Jz(e,t);return r===void 0?n:r}var IT=e3;const or=Xe(IT);function t3(e){return e==null}var n3=t3;const Ve=Xe(n3);var r3=Si,i3=Dn,a3=ki,s3="[object String]";function o3(e){return typeof e=="string"||!i3(e)&&a3(e)&&r3(e)==s3}var l3=o3;const ns=Xe(l3);var $T={exports:{}},tt={};/**
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 dx=Symbol.for("react.element"),fx=Symbol.for("react.portal"),Xh=Symbol.for("react.fragment"),Zh=Symbol.for("react.strict_mode"),Qh=Symbol.for("react.profiler"),Jh=Symbol.for("react.provider"),ep=Symbol.for("react.context"),c3=Symbol.for("react.server_context"),tp=Symbol.for("react.forward_ref"),np=Symbol.for("react.suspense"),rp=Symbol.for("react.suspense_list"),ip=Symbol.for("react.memo"),ap=Symbol.for("react.lazy"),u3=Symbol.for("react.offscreen"),LT;LT=Symbol.for("react.module.reference");function dr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case dx:switch(e=e.type,e){case Xh:case Qh:case Zh:case np:case rp:return e;default:switch(e=e&&e.$$typeof,e){case c3:case ep:case tp:case ap:case ip:case Jh:return e;default:return t}}case fx:return t}}}tt.ContextConsumer=ep;tt.ContextProvider=Jh;tt.Element=dx;tt.ForwardRef=tp;tt.Fragment=Xh;tt.Lazy=ap;tt.Memo=ip;tt.Portal=fx;tt.Profiler=Qh;tt.StrictMode=Zh;tt.Suspense=np;tt.SuspenseList=rp;tt.isAsyncMode=function(){return!1};tt.isConcurrentMode=function(){return!1};tt.isContextConsumer=function(e){return dr(e)===ep};tt.isContextProvider=function(e){return dr(e)===Jh};tt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===dx};tt.isForwardRef=function(e){return dr(e)===tp};tt.isFragment=function(e){return dr(e)===Xh};tt.isLazy=function(e){return dr(e)===ap};tt.isMemo=function(e){return dr(e)===ip};tt.isPortal=function(e){return dr(e)===fx};tt.isProfiler=function(e){return dr(e)===Qh};tt.isStrictMode=function(e){return dr(e)===Zh};tt.isSuspense=function(e){return dr(e)===np};tt.isSuspenseList=function(e){return dr(e)===rp};tt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Xh||e===Qh||e===Zh||e===np||e===rp||e===u3||typeof e=="object"&&e!==null&&(e.$$typeof===ap||e.$$typeof===ip||e.$$typeof===Jh||e.$$typeof===ep||e.$$typeof===tp||e.$$typeof===LT||e.getModuleId!==void 0)};tt.typeOf=dr;$T.exports=tt;var d3=$T.exports,f3=Si,h3=ki,p3="[object Number]";function m3(e){return typeof e=="number"||h3(e)&&f3(e)==p3}var DT=m3;const g3=Xe(DT);var y3=DT;function v3(e){return y3(e)&&e!=+e}var b3=v3;const bu=Xe(b3);var Sr=function(t){return t===0?0:t>0?1:-1},Da=function(t){return ns(t)&&t.indexOf("%")===t.length-1},ue=function(t){return g3(t)&&!bu(t)},x3=function(t){return Ve(t)},Ut=function(t){return ue(t)||ns(t)},w3=0,sp=function(t){var n=++w3;return"".concat(t||"").concat(n)},rs=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ue(t)&&!ns(t))return r;var a;if(Da(t)){var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return bu(a)&&(a=r),i&&a>n&&(a=n),a},Ui=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},S3=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},i=0;i<n;i++)if(!r[t[i]])r[t[i]]=!0;else return!0;return!1},As=function(t,n){return ue(t)&&ue(n)?function(r){return t+r*(n-t)}:function(){return n}};function Ey(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):or(r,t))===n})}var k3=function(t,n){return ue(t)&&ue(n)?t-n:ns(t)&&ns(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function oo(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 _y(e){"@babel/helpers - typeof";return _y=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},_y(e)}var E3=["viewBox","children"],_3=["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"],k1=["points","pathLength"],km={svg:E3,polygon:k1,polyline:k1},hx=["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"],yf=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(E.isValidElement(t)&&(r=t.props),!Xo(r))return null;var i={};return Object.keys(r).forEach(function(a){hx.includes(a)&&(i[a]=n||function(o){return r[a](r,o)})}),i},N3=function(t,n,r){return function(i){return t(n,r,i),null}},vf=function(t,n,r){if(!Xo(t)||_y(t)!=="object")return null;var i=null;return Object.keys(t).forEach(function(a){var o=t[a];hx.includes(a)&&typeof o=="function"&&(i||(i={}),i[a]=N3(o,n,r))}),i},j3=["children"],A3=["children"];function E1(e,t){if(e==null)return{};var n=T3(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function T3(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 _1={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"},ui=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},N1=null,Em=null,px=function e(t){if(t===N1&&Array.isArray(Em))return Em;var n=[];return E.Children.forEach(t,function(r){Ve(r)||(d3.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),Em=n,N1=t,n};function _r(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return ui(i)}):r=[ui(t)],px(e).forEach(function(i){var a=or(i,"type.displayName")||or(i,"type.name");r.indexOf(a)!==-1&&n.push(i)}),n}function Wn(e,t){var n=_r(e,t);return n&&n[0]}var j1=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!ue(r)||r<=0||!ue(i)||i<=0)},C3=["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"],O3=function(t){return t&&t.type&&ns(t.type)&&C3.indexOf(t.type)>=0},P3=function(t,n,r,i){var a,o=(a=km==null?void 0:km[i])!==null&&a!==void 0?a:[];return n.startsWith("data-")||!$e(t)&&(i&&o.includes(n)||_3.includes(n))||r&&hx.includes(n)},qe=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(E.isValidElement(t)&&(i=t.props),!Xo(i))return null;var a={};return Object.keys(i).forEach(function(o){var l;P3((l=i)===null||l===void 0?void 0:l[o],o,n,r)&&(a[o]=i[o])}),a},Ny=function e(t,n){if(t===n)return!0;var r=E.Children.count(t);if(r!==E.Children.count(n))return!1;if(r===0)return!0;if(r===1)return A1(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i<r;i++){var a=t[i],o=n[i];if(Array.isArray(a)||Array.isArray(o)){if(!e(a,o))return!1}else if(!A1(a,o))return!1}return!0},A1=function(t,n){if(Ve(t)&&Ve(n))return!0;if(!Ve(t)&&!Ve(n)){var r=t.props||{},i=r.children,a=E1(r,j3),o=n.props||{},l=o.children,c=E1(o,A3);return i&&l?oo(a,c)&&Ny(i,l):!i&&!l?oo(a,c):!1}return!1},T1=function(t,n){var r=[],i={};return px(t).forEach(function(a,o){if(O3(a))r.push(a);else if(a){var l=ui(a.type),c=n[l]||{},u=c.handler,d=c.once;if(u&&(!d||!i[l])){var f=u(a,l,o);r.push(f),i[l]=!0}}}),r},M3=function(t){var n=t&&t.type;return n&&_1[n]?_1[n]:null},R3=function(t,n){return px(n).indexOf(t)},I3=["children","width","height","viewBox","className","style","title","desc"];function jy(){return jy=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},jy.apply(this,arguments)}function $3(e,t){if(e==null)return{};var n=L3(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function L3(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 Ay(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,a=e.className,o=e.style,l=e.title,c=e.desc,u=$3(e,I3),d=i||{width:n,height:r,x:0,y:0},f=Ke("recharts-surface",a);return W.createElement("svg",jy({},qe(u,!0,"svg"),{className:f,width:n,height:r,style:o,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),W.createElement("title",null,l),W.createElement("desc",null,c),t)}var D3=["children","className"];function Ty(){return Ty=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},Ty.apply(this,arguments)}function B3(e,t){if(e==null)return{};var n=z3(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function z3(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 Yt=W.forwardRef(function(e,t){var n=e.children,r=e.className,i=B3(e,D3),a=Ke("recharts-layer",r);return W.createElement("g",Ty({className:a},qe(i,!0),{ref:t}),n)}),di=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a]};function F3(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}var U3=F3,W3=U3;function H3(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:W3(e,t,n)}var G3=H3,q3="\\ud800-\\udfff",K3="\\u0300-\\u036f",V3="\\ufe20-\\ufe2f",Y3="\\u20d0-\\u20ff",X3=K3+V3+Y3,Z3="\\ufe0e\\ufe0f",Q3="\\u200d",J3=RegExp("["+Q3+q3+X3+Z3+"]");function eF(e){return J3.test(e)}var BT=eF;function tF(e){return e.split("")}var nF=tF,zT="\\ud800-\\udfff",rF="\\u0300-\\u036f",iF="\\ufe20-\\ufe2f",aF="\\u20d0-\\u20ff",sF=rF+iF+aF,oF="\\ufe0e\\ufe0f",lF="["+zT+"]",Cy="["+sF+"]",Oy="\\ud83c[\\udffb-\\udfff]",cF="(?:"+Cy+"|"+Oy+")",FT="[^"+zT+"]",UT="(?:\\ud83c[\\udde6-\\uddff]){2}",WT="[\\ud800-\\udbff][\\udc00-\\udfff]",uF="\\u200d",HT=cF+"?",GT="["+oF+"]?",dF="(?:"+uF+"(?:"+[FT,UT,WT].join("|")+")"+GT+HT+")*",fF=GT+HT+dF,hF="(?:"+[FT+Cy+"?",Cy,UT,WT,lF].join("|")+")",pF=RegExp(Oy+"(?="+Oy+")|"+hF+fF,"g");function mF(e){return e.match(pF)||[]}var gF=mF,yF=nF,vF=BT,bF=gF;function xF(e){return vF(e)?bF(e):yF(e)}var wF=xF,SF=G3,kF=BT,EF=wF,_F=MT;function NF(e){return function(t){t=_F(t);var n=kF(t)?EF(t):void 0,r=n?n[0]:t.charAt(0),i=n?SF(n,1).join(""):t.slice(1);return r[e]()+i}}var jF=NF,AF=jF,TF=AF("toUpperCase"),CF=TF;const op=Xe(CF);function ct(e){return function(){return e}}const qT=Math.cos,bf=Math.sin,Tr=Math.sqrt,xf=Math.PI,lp=2*xf,Py=Math.PI,My=2*Py,Aa=1e-6,OF=My-Aa;function KT(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function PF(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return KT;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class MF{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?KT:PF(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,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,o){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,l=this._y1,c=r-t,u=i-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>Aa)if(!(Math.abs(f*c-u*d)>Aa)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-o,g=i-l,m=c*c+u*u,v=p*p+g*g,y=Math.sqrt(m),b=Math.sqrt(h),x=a*Math.tan((Py-Math.acos((m+h-v)/(2*y*b)))/2),k=x/b,S=x/y;Math.abs(k-1)>Aa&&this._append`L${t+k*d},${n+k*f}`,this._append`A${a},${a},0,0,${+(f*p>d*g)},${this._x1=t+S*c},${this._y1=n+S*u}`}}arc(t,n,r,i,a,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(i),c=r*Math.sin(i),u=t+l,d=n+c,f=1^o,h=o?i-a:a-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>Aa||Math.abs(this._y1-d)>Aa)&&this._append`L${u},${d}`,r&&(h<0&&(h=h%My+My),h>OF?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>Aa&&this._append`A${r},${r},0,${+(h>=Py)},${f},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function mx(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 MF(t)}function gx(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function VT(e){this._context=e}VT.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 cp(e){return new VT(e)}function YT(e){return e[0]}function XT(e){return e[1]}function ZT(e,t){var n=ct(!0),r=null,i=cp,a=null,o=mx(l);e=typeof e=="function"?e:e===void 0?YT:ct(e),t=typeof t=="function"?t:t===void 0?XT:ct(t);function l(c){var u,d=(c=gx(c)).length,f,h=!1,p;for(r==null&&(a=i(p=o())),u=0;u<=d;++u)!(u<d&&n(f=c[u],u,c))===h&&((h=!h)?a.lineStart():a.lineEnd()),h&&a.point(+e(f,u,c),+t(f,u,c));if(p)return a=null,p+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:ct(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:ct(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:ct(!!c),l):n},l.curve=function(c){return arguments.length?(i=c,r!=null&&(a=i(r)),l):i},l.context=function(c){return arguments.length?(c==null?r=a=null:a=i(r=c),l):r},l}function ed(e,t,n){var r=null,i=ct(!0),a=null,o=cp,l=null,c=mx(u);e=typeof e=="function"?e:e===void 0?YT:ct(+e),t=typeof t=="function"?t:ct(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?XT:ct(+n);function u(f){var h,p,g,m=(f=gx(f)).length,v,y=!1,b,x=new Array(m),k=new Array(m);for(a==null&&(l=o(b=c())),h=0;h<=m;++h){if(!(h<m&&i(v=f[h],h,f))===y)if(y=!y)p=h,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),g=h-1;g>=p;--g)l.point(x[g],k[g]);l.lineEnd(),l.areaEnd()}y&&(x[h]=+e(v,h,f),k[h]=+t(v,h,f),l.point(r?+r(v,h,f):x[h],n?+n(v,h,f):k[h]))}if(b)return l=null,b+""||null}function d(){return ZT().defined(i).curve(o).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:ct(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ct(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:ct(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:ct(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ct(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ct(+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?(i=typeof f=="function"?f:ct(!!f),u):i},u.curve=function(f){return arguments.length?(o=f,a!=null&&(l=o(a)),u):o},u.context=function(f){return arguments.length?(f==null?a=l=null:l=o(a=f),u):a},u}class QT{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 RF(e){return new QT(e,!0)}function IF(e){return new QT(e,!1)}const yx={draw(e,t){const n=Tr(t/xf);e.moveTo(n,0),e.arc(0,0,n,0,lp)}},$F={draw(e,t){const n=Tr(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()}},JT=Tr(1/3),LF=JT*2,DF={draw(e,t){const n=Tr(t/LF),r=n*JT;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},BF={draw(e,t){const n=Tr(t),r=-n/2;e.rect(r,r,n,n)}},zF=.8908130915292852,eC=bf(xf/10)/bf(7*xf/10),FF=bf(lp/10)*eC,UF=-qT(lp/10)*eC,WF={draw(e,t){const n=Tr(t*zF),r=FF*n,i=UF*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=lp*a/5,l=qT(o),c=bf(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*i,c*r+l*i)}e.closePath()}},_m=Tr(3),HF={draw(e,t){const n=-Tr(t/(_m*3));e.moveTo(0,n*2),e.lineTo(-_m*n,-n),e.lineTo(_m*n,-n),e.closePath()}},Qn=-.5,Jn=Tr(3)/2,Ry=1/Tr(12),GF=(Ry/2+1)*3,qF={draw(e,t){const n=Tr(t/GF),r=n/2,i=n*Ry,a=r,o=n*Ry+n,l=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(l,c),e.lineTo(Qn*r-Jn*i,Jn*r+Qn*i),e.lineTo(Qn*a-Jn*o,Jn*a+Qn*o),e.lineTo(Qn*l-Jn*c,Jn*l+Qn*c),e.lineTo(Qn*r+Jn*i,Qn*i-Jn*r),e.lineTo(Qn*a+Jn*o,Qn*o-Jn*a),e.lineTo(Qn*l+Jn*c,Qn*c-Jn*l),e.closePath()}};function KF(e,t){let n=null,r=mx(i);e=typeof e=="function"?e:ct(e||yx),t=typeof t=="function"?t:ct(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:ct(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:ct(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function wf(){}function Sf(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 tC(e){this._context=e}tC.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:Sf(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:Sf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function VF(e){return new tC(e)}function nC(e){this._context=e}nC.prototype={areaStart:wf,areaEnd:wf,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:Sf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function YF(e){return new nC(e)}function rC(e){this._context=e}rC.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:Sf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function XF(e){return new rC(e)}function iC(e){this._context=e}iC.prototype={areaStart:wf,areaEnd:wf,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 ZF(e){return new iC(e)}function C1(e){return e<0?-1:1}function O1(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),l=(a*i+o*r)/(r+i);return(C1(a)+C1(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function P1(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Nm(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,l=(a-r)/3;e._context.bezierCurveTo(r+l,i+l*t,a-l,o-l*n,a,o)}function kf(e){this._context=e}kf.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:Nm(this,this._t0,P1(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,Nm(this,P1(this,n=O1(this,e,t)),n);break;default:Nm(this,this._t0,n=O1(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function aC(e){this._context=new sC(e)}(aC.prototype=Object.create(kf.prototype)).point=function(e,t){kf.prototype.point.call(this,t,e)};function sC(e){this._context=e}sC.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function QF(e){return new kf(e)}function JF(e){return new aC(e)}function oC(e){this._context=e}oC.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=M1(e),i=M1(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function M1(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function e6(e){return new oC(e)}function up(e,t){this._context=e,this._t=t}up.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 t6(e){return new up(e,.5)}function n6(e){return new up(e,0)}function r6(e){return new up(e,1)}function xo(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,l=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<l;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Iy(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function i6(e,t){return e[t]}function a6(e){const t=[];return t.key=e,t}function s6(){var e=ct([]),t=Iy,n=xo,r=i6;function i(a){var o=Array.from(e.apply(this,arguments),a6),l,c=o.length,u=-1,d;for(const f of a)for(l=0,++u;l<c;++l)(o[l][u]=[0,+r(f,o[l].key,u,a)]).data=f;for(l=0,d=gx(t(o));l<c;++l)o[d[l]].index=l;return n(o,d),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:ct(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:ct(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?Iy:typeof a=="function"?a:ct(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??xo,i):n},i}function o6(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}xo(e,t)}}function l6(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,l=0;o<i;++o)l+=e[o][n][1]||0;r[n][1]+=r[n][0]=-l/2}xo(e,t)}}function c6(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var 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,g=0;g<l;++g){var m=e[t[g]],v=m[r][1]||0,y=m[r-1][1]||0;p+=v-y}c+=f,u+=p*f}i[r-1][1]+=i[r-1][0]=n,c&&(n-=u/c)}i[r-1][1]+=i[r-1][0]=n,xo(e,t)}}function jc(e){"@babel/helpers - typeof";return jc=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},jc(e)}var u6=["type","size","sizeType"];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 R1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function I1(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){d6(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 d6(e,t,n){return t=f6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f6(e){var t=h6(e,"string");return jc(t)=="symbol"?t:t+""}function h6(e,t){if(jc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(jc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function p6(e,t){if(e==null)return{};var n=m6(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function m6(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 lC={symbolCircle:yx,symbolCross:$F,symbolDiamond:DF,symbolSquare:BF,symbolStar:WF,symbolTriangle:HF,symbolWye:qF},g6=Math.PI/180,y6=function(t){var n="symbol".concat(op(t));return lC[n]||yx},v6=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 i=18*g6;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),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}},b6=function(t,n){lC["symbol".concat(op(t))]=n},vx=function(t){var n=t.type,r=n===void 0?"circle":n,i=t.size,a=i===void 0?64:i,o=t.sizeType,l=o===void 0?"area":o,c=p6(t,u6),u=I1(I1({},c),{},{type:r,size:a,sizeType:l}),d=function(){var v=y6(r),y=KF().type(v).size(v6(a,l,r));return y()},f=u.className,h=u.cx,p=u.cy,g=qe(u,!0);return h===+h&&p===+p&&a===+a?W.createElement("path",$y({},g,{className:Ke("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(p,")"),d:d()})):null};vx.registerSymbol=b6;function wo(e){"@babel/helpers - typeof";return wo=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},wo(e)}function Ly(){return Ly=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},Ly.apply(this,arguments)}function $1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function x6(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){Ac(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 w6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S6(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,uC(r.key),r)}}function k6(e,t,n){return t&&S6(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function E6(e,t,n){return t=Ef(t),_6(e,cC()?Reflect.construct(t,n||[],Ef(e).constructor):t.apply(e,n))}function _6(e,t){if(t&&(wo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return N6(e)}function N6(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(cC=function(){return!!e})()}function Ef(e){return Ef=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ef(e)}function j6(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&&Dy(e,t)}function Dy(e,t){return Dy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Dy(e,t)}function Ac(e,t,n){return t=uC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uC(e){var t=A6(e,"string");return wo(t)=="symbol"?t:t+""}function A6(e,t){if(wo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(wo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var er=32,bx=function(e){function t(){return w6(this,t),E6(this,t,arguments)}return j6(t,e),k6(t,[{key:"renderIcon",value:function(r){var i=this.props.inactiveColor,a=er/2,o=er/6,l=er/3,c=r.inactive?i:r.color;if(r.type==="plainline")return W.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:a,x2:er,y2:a,className:"recharts-legend-icon"});if(r.type==="line")return W.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(a,"h").concat(l,`
76
- A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(a,`
77
- H`).concat(er,"M").concat(2*l,",").concat(a,`
78
- A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(a),className:"recharts-legend-icon"});if(r.type==="rect")return W.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(er/8,"h").concat(er,"v").concat(er*3/4,"h").concat(-er,"z"),className:"recharts-legend-icon"});if(W.isValidElement(r.legendIcon)){var u=x6({},r);return delete u.legendIcon,W.cloneElement(r.legendIcon,u)}return W.createElement(vx,{fill:c,cx:a,cy:a,size:er,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,i=this.props,a=i.payload,o=i.iconSize,l=i.layout,c=i.formatter,u=i.inactiveColor,d={x:0,y:0,width:er,height:er},f={display:l==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(p,g){var m=p.formatter||c,v=Ke(Ac(Ac({"recharts-legend-item":!0},"legend-item-".concat(g),!0),"inactive",p.inactive));if(p.type==="none")return null;var y=$e(p.value)?null:p.value;di(!$e(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 b=p.inactive?u:p.color;return W.createElement("li",Ly({className:v,style:f,key:"legend-item-".concat(g)},vf(r.props,p,g)),W.createElement(Ay,{width:o,height:o,viewBox:d,style:h},r.renderIcon(p)),W.createElement("span",{className:"recharts-legend-item-text",style:{color:b}},m?m(y,p,g):y))})}},{key:"render",value:function(){var r=this.props,i=r.payload,a=r.layout,o=r.align;if(!i||!i.length)return null;var l={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return W.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(E.PureComponent);Ac(bx,"displayName","Legend");Ac(bx,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var T6=Kh;function C6(){this.__data__=new T6,this.size=0}var O6=C6;function P6(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var M6=P6;function R6(e){return this.__data__.get(e)}var I6=R6;function $6(e){return this.__data__.has(e)}var L6=$6,D6=Kh,B6=sx,z6=ox,F6=200;function U6(e,t){var n=this.__data__;if(n instanceof D6){var r=n.__data__;if(!B6||r.length<F6-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new z6(r)}return n.set(e,t),this.size=n.size,this}var W6=U6,H6=Kh,G6=O6,q6=M6,K6=I6,V6=L6,Y6=W6;function el(e){var t=this.__data__=new H6(e);this.size=t.size}el.prototype.clear=G6;el.prototype.delete=q6;el.prototype.get=K6;el.prototype.has=V6;el.prototype.set=Y6;var dC=el,X6="__lodash_hash_undefined__";function Z6(e){return this.__data__.set(e,X6),this}var Q6=Z6;function J6(e){return this.__data__.has(e)}var e4=J6,t4=ox,n4=Q6,r4=e4;function _f(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new t4;++t<n;)this.add(e[t])}_f.prototype.add=_f.prototype.push=n4;_f.prototype.has=r4;var fC=_f;function i4(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 hC=i4;function a4(e,t){return e.has(t)}var pC=a4,s4=fC,o4=hC,l4=pC,c4=1,u4=2;function d4(e,t,n,r,i,a){var o=n&c4,l=e.length,c=t.length;if(l!=c&&!(o&&c>l))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var f=-1,h=!0,p=n&u4?new s4:void 0;for(a.set(e,t),a.set(t,e);++f<l;){var g=e[f],m=t[f];if(r)var v=o?r(m,g,f,t,e,a):r(g,m,f,e,t,a);if(v!==void 0){if(v)continue;h=!1;break}if(p){if(!o4(t,function(y,b){if(!l4(p,b)&&(g===y||i(g,y,n,r,a)))return p.push(b)})){h=!1;break}}else if(!(g===m||i(g,m,n,r,a))){h=!1;break}}return a.delete(e),a.delete(t),h}var mC=d4,f4=Vr,h4=f4.Uint8Array,p4=h4;function m4(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var g4=m4;function y4(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var xx=y4,L1=vu,D1=p4,v4=ax,b4=mC,x4=g4,w4=xx,S4=1,k4=2,E4="[object Boolean]",_4="[object Date]",N4="[object Error]",j4="[object Map]",A4="[object Number]",T4="[object RegExp]",C4="[object Set]",O4="[object String]",P4="[object Symbol]",M4="[object ArrayBuffer]",R4="[object DataView]",B1=L1?L1.prototype:void 0,jm=B1?B1.valueOf:void 0;function I4(e,t,n,r,i,a,o){switch(n){case R4:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case M4:return!(e.byteLength!=t.byteLength||!a(new D1(e),new D1(t)));case E4:case _4:case A4:return v4(+e,+t);case N4:return e.name==t.name&&e.message==t.message;case T4:case O4:return e==t+"";case j4:var l=x4;case C4:var c=r&S4;if(l||(l=w4),e.size!=t.size&&!c)return!1;var u=o.get(e);if(u)return u==t;r|=k4,o.set(e,t);var d=b4(l(e),l(t),r,i,a,o);return o.delete(e),d;case P4:if(jm)return jm.call(e)==jm.call(t)}return!1}var $4=I4;function L4(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var gC=L4,D4=gC,B4=Dn;function z4(e,t,n){var r=t(e);return B4(e)?r:D4(r,n(e))}var F4=z4;function U4(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}var W4=U4;function H4(){return[]}var G4=H4,q4=W4,K4=G4,V4=Object.prototype,Y4=V4.propertyIsEnumerable,z1=Object.getOwnPropertySymbols,X4=z1?function(e){return e==null?[]:(e=Object(e),q4(z1(e),function(t){return Y4.call(e,t)}))}:K4,Z4=X4;function Q4(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var J4=Q4,eU=Si,tU=ki,nU="[object Arguments]";function rU(e){return tU(e)&&eU(e)==nU}var iU=rU,F1=iU,aU=ki,yC=Object.prototype,sU=yC.hasOwnProperty,oU=yC.propertyIsEnumerable,lU=F1(function(){return arguments}())?F1:function(e){return aU(e)&&sU.call(e,"callee")&&!oU.call(e,"callee")},wx=lU,Nf={exports:{}};function cU(){return!1}var uU=cU;Nf.exports;(function(e,t){var n=Vr,r=uU,i=t&&!t.nodeType&&t,a=i&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===i,l=o?n.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||r;e.exports=u})(Nf,Nf.exports);var vC=Nf.exports,dU=9007199254740991,fU=/^(?:0|[1-9]\d*)$/;function hU(e,t){var n=typeof e;return t=t??dU,!!t&&(n=="number"||n!="symbol"&&fU.test(e))&&e>-1&&e%1==0&&e<t}var Sx=hU,pU=9007199254740991;function mU(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=pU}var kx=mU,gU=Si,yU=kx,vU=ki,bU="[object Arguments]",xU="[object Array]",wU="[object Boolean]",SU="[object Date]",kU="[object Error]",EU="[object Function]",_U="[object Map]",NU="[object Number]",jU="[object Object]",AU="[object RegExp]",TU="[object Set]",CU="[object String]",OU="[object WeakMap]",PU="[object ArrayBuffer]",MU="[object DataView]",RU="[object Float32Array]",IU="[object Float64Array]",$U="[object Int8Array]",LU="[object Int16Array]",DU="[object Int32Array]",BU="[object Uint8Array]",zU="[object Uint8ClampedArray]",FU="[object Uint16Array]",UU="[object Uint32Array]",mt={};mt[RU]=mt[IU]=mt[$U]=mt[LU]=mt[DU]=mt[BU]=mt[zU]=mt[FU]=mt[UU]=!0;mt[bU]=mt[xU]=mt[PU]=mt[wU]=mt[MU]=mt[SU]=mt[kU]=mt[EU]=mt[_U]=mt[NU]=mt[jU]=mt[AU]=mt[TU]=mt[CU]=mt[OU]=!1;function WU(e){return vU(e)&&yU(e.length)&&!!mt[gU(e)]}var HU=WU;function GU(e){return function(t){return e(t)}}var bC=GU,jf={exports:{}};jf.exports;(function(e,t){var n=jT,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===r,o=a&&n.process,l=function(){try{var c=i&&i.require&&i.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l})(jf,jf.exports);var qU=jf.exports,KU=HU,VU=bC,U1=qU,W1=U1&&U1.isTypedArray,YU=W1?VU(W1):KU,xC=YU,XU=J4,ZU=wx,QU=Dn,JU=vC,e9=Sx,t9=xC,n9=Object.prototype,r9=n9.hasOwnProperty;function i9(e,t){var n=QU(e),r=!n&&ZU(e),i=!n&&!r&&JU(e),a=!n&&!r&&!i&&t9(e),o=n||r||i||a,l=o?XU(e.length,String):[],c=l.length;for(var u in e)(t||r9.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||e9(u,c)))&&l.push(u);return l}var a9=i9,s9=Object.prototype;function o9(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||s9;return e===n}var l9=o9;function c9(e,t){return function(n){return e(t(n))}}var wC=c9,u9=wC,d9=u9(Object.keys,Object),f9=d9,h9=l9,p9=f9,m9=Object.prototype,g9=m9.hasOwnProperty;function y9(e){if(!h9(e))return p9(e);var t=[];for(var n in Object(e))g9.call(e,n)&&n!="constructor"&&t.push(n);return t}var v9=y9,b9=ix,x9=kx;function w9(e){return e!=null&&x9(e.length)&&!b9(e)}var xu=w9,S9=a9,k9=v9,E9=xu;function _9(e){return E9(e)?S9(e):k9(e)}var dp=_9,N9=F4,j9=Z4,A9=dp;function T9(e){return N9(e,A9,j9)}var C9=T9,H1=C9,O9=1,P9=Object.prototype,M9=P9.hasOwnProperty;function R9(e,t,n,r,i,a){var o=n&O9,l=H1(e),c=l.length,u=H1(t),d=u.length;if(c!=d&&!o)return!1;for(var f=c;f--;){var h=l[f];if(!(o?h in t:M9.call(t,h)))return!1}var p=a.get(e),g=a.get(t);if(p&&g)return p==t&&g==e;var m=!0;a.set(e,t),a.set(t,e);for(var v=o;++f<c;){h=l[f];var y=e[h],b=t[h];if(r)var x=o?r(b,y,h,t,e,a):r(y,b,h,e,t,a);if(!(x===void 0?y===b||i(y,b,n,r,a):x)){m=!1;break}v||(v=h=="constructor")}if(m&&!v){var k=e.constructor,S=t.constructor;k!=S&&"constructor"in e&&"constructor"in t&&!(typeof k=="function"&&k instanceof k&&typeof S=="function"&&S instanceof S)&&(m=!1)}return a.delete(e),a.delete(t),m}var I9=R9,$9=us,L9=Vr,D9=$9(L9,"DataView"),B9=D9,z9=us,F9=Vr,U9=z9(F9,"Promise"),W9=U9,H9=us,G9=Vr,q9=H9(G9,"Set"),SC=q9,K9=us,V9=Vr,Y9=K9(V9,"WeakMap"),X9=Y9,By=B9,zy=sx,Fy=W9,Uy=SC,Wy=X9,kC=Si,tl=TT,G1="[object Map]",Z9="[object Object]",q1="[object Promise]",K1="[object Set]",V1="[object WeakMap]",Y1="[object DataView]",Q9=tl(By),J9=tl(zy),e8=tl(Fy),t8=tl(Uy),n8=tl(Wy),Ta=kC;(By&&Ta(new By(new ArrayBuffer(1)))!=Y1||zy&&Ta(new zy)!=G1||Fy&&Ta(Fy.resolve())!=q1||Uy&&Ta(new Uy)!=K1||Wy&&Ta(new Wy)!=V1)&&(Ta=function(e){var t=kC(e),n=t==Z9?e.constructor:void 0,r=n?tl(n):"";if(r)switch(r){case Q9:return Y1;case J9:return G1;case e8:return q1;case t8:return K1;case n8:return V1}return t});var r8=Ta,Am=dC,i8=mC,a8=$4,s8=I9,X1=r8,Z1=Dn,Q1=vC,o8=xC,l8=1,J1="[object Arguments]",eS="[object Array]",td="[object Object]",c8=Object.prototype,tS=c8.hasOwnProperty;function u8(e,t,n,r,i,a){var o=Z1(e),l=Z1(t),c=o?eS:X1(e),u=l?eS:X1(t);c=c==J1?td:c,u=u==J1?td:u;var d=c==td,f=u==td,h=c==u;if(h&&Q1(e)){if(!Q1(t))return!1;o=!0,d=!1}if(h&&!d)return a||(a=new Am),o||o8(e)?i8(e,t,n,r,i,a):a8(e,t,c,n,r,i,a);if(!(n&l8)){var p=d&&tS.call(e,"__wrapped__"),g=f&&tS.call(t,"__wrapped__");if(p||g){var m=p?e.value():e,v=g?t.value():t;return a||(a=new Am),i(m,v,n,r,a)}}return h?(a||(a=new Am),s8(e,t,n,r,i,a)):!1}var d8=u8,f8=d8,nS=ki;function EC(e,t,n,r,i){return e===t?!0:e==null||t==null||!nS(e)&&!nS(t)?e!==e&&t!==t:f8(e,t,n,r,EC,i)}var Ex=EC,h8=dC,p8=Ex,m8=1,g8=2;function y8(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var l=n[i];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<a;){l=n[i];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 h8;if(r)var h=r(u,d,c,e,t,f);if(!(h===void 0?p8(d,u,m8|g8,r,f):h))return!1}}return!0}var v8=y8,b8=pa;function x8(e){return e===e&&!b8(e)}var _C=x8,w8=_C,S8=dp;function k8(e){for(var t=S8(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,w8(i)]}return t}var E8=k8;function _8(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var NC=_8,N8=v8,j8=E8,A8=NC;function T8(e){var t=j8(e);return t.length==1&&t[0][2]?A8(t[0][0],t[0][1]):function(n){return n===e||N8(n,e,t)}}var C8=T8;function O8(e,t){return e!=null&&t in Object(e)}var P8=O8,M8=RT,R8=wx,I8=Dn,$8=Sx,L8=kx,D8=Yh;function B8(e,t,n){t=M8(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=D8(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&L8(i)&&$8(o,i)&&(I8(e)||R8(e)))}var z8=B8,F8=P8,U8=z8;function W8(e,t){return e!=null&&U8(e,t,F8)}var H8=W8,G8=Ex,q8=IT,K8=H8,V8=rx,Y8=_C,X8=NC,Z8=Yh,Q8=1,J8=2;function e5(e,t){return V8(e)&&Y8(t)?X8(Z8(e),t):function(n){var r=q8(n,e);return r===void 0&&r===t?K8(n,e):G8(t,r,Q8|J8)}}var t5=e5;function n5(e){return e}var nl=n5;function r5(e){return function(t){return t==null?void 0:t[e]}}var i5=r5,a5=ux;function s5(e){return function(t){return a5(t,e)}}var o5=s5,l5=i5,c5=o5,u5=rx,d5=Yh;function f5(e){return u5(e)?l5(d5(e)):c5(e)}var h5=f5,p5=C8,m5=t5,g5=nl,y5=Dn,v5=h5;function b5(e){return typeof e=="function"?e:e==null?g5:typeof e=="object"?y5(e)?m5(e[0],e[1]):p5(e):v5(e)}var ma=b5;function x5(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}var jC=x5;function w5(e){return e!==e}var S5=w5;function k5(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var E5=k5,_5=jC,N5=S5,j5=E5;function A5(e,t,n){return t===t?j5(e,t,n):_5(e,N5,n)}var T5=A5,C5=T5;function O5(e,t){var n=e==null?0:e.length;return!!n&&C5(e,t,0)>-1}var P5=O5;function M5(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var R5=M5;function I5(){}var $5=I5,Tm=SC,L5=$5,D5=xx,B5=1/0,z5=Tm&&1/D5(new Tm([,-0]))[1]==B5?function(e){return new Tm(e)}:L5,F5=z5,U5=fC,W5=P5,H5=R5,G5=pC,q5=F5,K5=xx,V5=200;function Y5(e,t,n){var r=-1,i=W5,a=e.length,o=!0,l=[],c=l;if(n)o=!1,i=H5;else if(a>=V5){var u=t?null:q5(e);if(u)return K5(u);o=!1,i=G5,c=new U5}else c=t?[]:l;e:for(;++r<a;){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 i(c,f,n)||(c!==l&&c.push(f),l.push(d))}return l}var X5=Y5,Z5=ma,Q5=X5;function J5(e,t){return e&&e.length?Q5(e,Z5(t)):[]}var eW=J5;const rS=Xe(eW);function AC(e,t,n){return t===!0?rS(e,n):$e(t)?rS(e,t):e}function So(e){"@babel/helpers - typeof";return So=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},So(e)}var tW=["ref"];function iS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ei(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){fp(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 nW(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aS(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,CC(r.key),r)}}function rW(e,t,n){return t&&aS(e.prototype,t),n&&aS(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function iW(e,t,n){return t=Af(t),aW(e,TC()?Reflect.construct(t,n||[],Af(e).constructor):t.apply(e,n))}function aW(e,t){if(t&&(So(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sW(e)}function sW(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function TC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(TC=function(){return!!e})()}function Af(e){return Af=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Af(e)}function oW(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,i){return r.__proto__=i,r},Hy(e,t)}function fp(e,t,n){return t=CC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CC(e){var t=lW(e,"string");return So(t)=="symbol"?t:t+""}function lW(e,t){if(So(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(So(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function cW(e,t){if(e==null)return{};var n=uW(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function uW(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 dW(e){return e.value}function fW(e,t){if(W.isValidElement(e))return W.cloneElement(e,t);if(typeof e=="function")return W.createElement(e,t);t.ref;var n=cW(t,tW);return W.createElement(bx,n)}var sS=1,Ga=function(e){function t(){var n;nW(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=iW(this,t,[].concat(i)),fp(n,"lastBoundingBox",{width:-1,height:-1}),n}return oW(t,e),rW(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,i=this.getBBox();i?(Math.abs(i.width-this.lastBoundingBox.width)>sS||Math.abs(i.height-this.lastBoundingBox.height)>sS)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(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?ei({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,a=i.layout,o=i.align,l=i.verticalAlign,c=i.margin,u=i.chartWidth,d=i.chartHeight,f,h;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&a==="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 g=this.getBBoxSnapshot();h={top:((d||0)-g.height)/2}}else h=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return ei(ei({},f),h)}},{key:"render",value:function(){var r=this,i=this.props,a=i.content,o=i.width,l=i.height,c=i.wrapperStyle,u=i.payloadUniqBy,d=i.payload,f=ei(ei({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return W.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(p){r.wrapperNode=p}},fW(a,ei(ei({},this.props),{},{payload:AC(d,u,dW)})))}}],[{key:"getWithHeight",value:function(r,i){var a=ei(ei({},this.defaultProps),r.props),o=a.layout;return o==="vertical"&&ue(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||i}:null}}])}(E.PureComponent);fp(Ga,"displayName","Legend");fp(Ga,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var oS=vu,hW=wx,pW=Dn,lS=oS?oS.isConcatSpreadable:void 0;function mW(e){return pW(e)||hW(e)||!!(lS&&e&&e[lS])}var gW=mW,yW=gC,vW=gW;function OC(e,t,n,r,i){var a=-1,o=e.length;for(n||(n=vW),i||(i=[]);++a<o;){var l=e[a];t>0&&n(l)?t>1?OC(l,t-1,n,r,i):yW(i,l):r||(i[i.length]=l)}return i}var PC=OC;function bW(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),l=o.length;l--;){var c=o[e?l:++i];if(n(a[c],c,a)===!1)break}return t}}var xW=bW,wW=xW,SW=wW(),kW=SW,EW=kW,_W=dp;function NW(e,t){return e&&EW(e,t,_W)}var MC=NW,jW=xu;function AW(e,t){return function(n,r){if(n==null)return n;if(!jW(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}var TW=AW,CW=MC,OW=TW,PW=OW(CW),_x=PW,MW=_x,RW=xu;function IW(e,t){var n=-1,r=RW(e)?Array(e.length):[];return MW(e,function(i,a,o){r[++n]=t(i,a,o)}),r}var RC=IW;function $W(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var LW=$W,cS=Yo;function DW(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=cS(e),o=t!==void 0,l=t===null,c=t===t,u=cS(t);if(!l&&!u&&!a&&e>t||a&&o&&c&&!l&&!u||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!u&&e<t||u&&n&&i&&!r&&!a||l&&n&&i||!o&&i||!c)return-1}return 0}var BW=DW,zW=BW;function FW(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,l=n.length;++r<o;){var c=zW(i[r],a[r]);if(c){if(r>=l)return c;var u=n[r];return c*(u=="desc"?-1:1)}}return e.index-t.index}var UW=FW,Cm=cx,WW=ux,HW=ma,GW=RC,qW=LW,KW=bC,VW=UW,YW=nl,XW=Dn;function ZW(e,t,n){t.length?t=Cm(t,function(a){return XW(a)?function(o){return WW(o,a.length===1?a[0]:a)}:a}):t=[YW];var r=-1;t=Cm(t,KW(HW));var i=GW(e,function(a,o,l){var c=Cm(t,function(u){return u(a)});return{criteria:c,index:++r,value:a}});return qW(i,function(a,o){return VW(a,o,n)})}var QW=ZW;function JW(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 eH=JW,tH=eH,uS=Math.max;function nH(e,t,n){return t=uS(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=uS(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var l=Array(t+1);++i<t;)l[i]=r[i];return l[t]=n(o),tH(e,this,l)}}var rH=nH;function iH(e){return function(){return e}}var aH=iH,sH=us,oH=function(){try{var e=sH(Object,"defineProperty");return e({},"",{}),e}catch{}}(),IC=oH,lH=aH,dS=IC,cH=nl,uH=dS?function(e,t){return dS(e,"toString",{configurable:!0,enumerable:!1,value:lH(t),writable:!0})}:cH,dH=uH,fH=800,hH=16,pH=Date.now;function mH(e){var t=0,n=0;return function(){var r=pH(),i=hH-(r-n);if(n=r,i>0){if(++t>=fH)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var gH=mH,yH=dH,vH=gH,bH=vH(yH),xH=bH,wH=nl,SH=rH,kH=xH;function EH(e,t){return kH(SH(e,t,wH),e+"")}var _H=EH,NH=ax,jH=xu,AH=Sx,TH=pa;function CH(e,t,n){if(!TH(n))return!1;var r=typeof t;return(r=="number"?jH(n)&&AH(t,n.length):r=="string"&&t in n)?NH(n[t],e):!1}var hp=CH,OH=PC,PH=QW,MH=_H,fS=hp,RH=MH(function(e,t){if(e==null)return[];var n=t.length;return n>1&&fS(e,t[0],t[1])?t=[]:n>2&&fS(t[0],t[1],t[2])&&(t=[t[0]]),PH(e,OH(t,1),[])}),IH=RH;const Nx=Xe(IH);function Tc(e){"@babel/helpers - typeof";return Tc=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},Tc(e)}function Gy(){return Gy=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},Gy.apply(this,arguments)}function $H(e,t){return zH(e)||BH(e,t)||DH(e,t)||LH()}function LH(){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 DH(e,t){if(e){if(typeof e=="string")return hS(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 hS(e,t)}}function hS(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 BH(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function zH(e){if(Array.isArray(e))return e}function pS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Om(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pS(Object(n),!0).forEach(function(r){FH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function FH(e,t,n){return t=UH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UH(e){var t=WH(e,"string");return Tc(t)=="symbol"?t:t+""}function WH(e,t){if(Tc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Tc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function HH(e){return Array.isArray(e)&&Ut(e[0])&&Ut(e[1])?e.join(" ~ "):e}var GH=function(t){var n=t.separator,r=n===void 0?" : ":n,i=t.contentStyle,a=i===void 0?{}:i,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,g=t.labelClassName,m=t.label,v=t.labelFormatter,y=t.accessibilityLayer,b=y===void 0?!1:y,x=function(){if(d&&d.length){var R={padding:0,margin:0},L=(h?Nx(d,h):d).map(function(I,z){if(I.type==="none")return null;var D=Om({display:"block",paddingTop:4,paddingBottom:4,color:I.color||"#000"},l),F=I.formatter||f||HH,O=I.value,P=I.name,A=O,Y=P;if(F&&A!=null&&Y!=null){var K=F(O,P,I,z,d);if(Array.isArray(K)){var M=$H(K,2);A=M[0],Y=M[1]}else A=K}return W.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(z),style:D},Ut(Y)?W.createElement("span",{className:"recharts-tooltip-item-name"},Y):null,Ut(Y)?W.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,W.createElement("span",{className:"recharts-tooltip-item-value"},A),W.createElement("span",{className:"recharts-tooltip-item-unit"},I.unit||""))});return W.createElement("ul",{className:"recharts-tooltip-item-list",style:R},L)}return null},k=Om({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),S=Om({margin:0},u),w=!Ve(m),_=w?m:"",N=Ke("recharts-default-tooltip",p),C=Ke("recharts-tooltip-label",g);w&&v&&d!==void 0&&d!==null&&(_=v(m,d));var T=b?{role:"status","aria-live":"assertive"}:{};return W.createElement("div",Gy({className:N,style:k},T),W.createElement("p",{className:C,style:S},W.isValidElement(_)?_:"".concat(_)),x())};function Cc(e){"@babel/helpers - typeof";return Cc=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},Cc(e)}function nd(e,t,n){return t=qH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qH(e){var t=KH(e,"string");return Cc(t)=="symbol"?t:t+""}function KH(e,t){if(Cc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Cc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jl="recharts-tooltip-wrapper",VH={visibility:"hidden"};function YH(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Ke(jl,nd(nd(nd(nd({},"".concat(jl,"-right"),ue(n)&&t&&ue(t.x)&&n>=t.x),"".concat(jl,"-left"),ue(n)&&t&&ue(t.x)&&n<t.x),"".concat(jl,"-bottom"),ue(r)&&t&&ue(t.y)&&r>=t.y),"".concat(jl,"-top"),ue(r)&&t&&ue(t.y)&&r<t.y))}function mS(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offsetTopLeft,a=e.position,o=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(a&&ue(a[r]))return a[r];var d=n[r]-l-i,f=n[r]+i;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 g=f+l,m=c[r]+u;return g>m?Math.max(d,c[r]):Math.max(f,c[r])}function XH(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 ZH(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,d,f;return o.height>0&&o.width>0&&n?(d=mS({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),f=mS({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=XH({translateX:d,translateY:f,useTranslate3d:l})):u=VH,{cssProperties:u,cssClasses:YH({translateX:d,translateY:f,coordinate:n})}}function ko(e){"@babel/helpers - typeof";return ko=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},ko(e)}function gS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gS(Object(n),!0).forEach(function(r){Ky(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function QH(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JH(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,LC(r.key),r)}}function eG(e,t,n){return t&&JH(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function tG(e,t,n){return t=Tf(t),nG(e,$C()?Reflect.construct(t,n||[],Tf(e).constructor):t.apply(e,n))}function nG(e,t){if(t&&(ko(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rG(e)}function rG(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $C(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($C=function(){return!!e})()}function Tf(e){return Tf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Tf(e)}function iG(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,i){return r.__proto__=i,r},qy(e,t)}function Ky(e,t,n){return t=LC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LC(e){var t=aG(e,"string");return ko(t)=="symbol"?t:t+""}function aG(e,t){if(ko(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ko(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var vS=1,sG=function(e){function t(){var n;QH(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=tG(this,t,[].concat(i)),Ky(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),Ky(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 iG(t,e),eG(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>vS||Math.abs(r.height-this.state.lastBoundingBox.height)>vS)&&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,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,l=i.animationDuration,c=i.animationEasing,u=i.children,d=i.coordinate,f=i.hasPayload,h=i.isAnimationActive,p=i.offset,g=i.position,m=i.reverseDirection,v=i.useTranslate3d,y=i.viewBox,b=i.wrapperStyle,x=ZH({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:p,position:g,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:v,viewBox:y}),k=x.cssClasses,S=x.cssProperties,w=yS(yS({transition:h&&a?"transform ".concat(l,"ms ").concat(c):void 0},S),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},b);return W.createElement("div",{tabIndex:-1,className:k,style:w,ref:function(N){r.wrapperNode=N}},u)}}])}(E.PureComponent),oG=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},wu={isSsr:oG()};function Eo(e){"@babel/helpers - typeof";return Eo=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},Eo(e)}function bS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bS(Object(n),!0).forEach(function(r){jx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lG(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cG(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,BC(r.key),r)}}function uG(e,t,n){return t&&cG(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function dG(e,t,n){return t=Cf(t),fG(e,DC()?Reflect.construct(t,n||[],Cf(e).constructor):t.apply(e,n))}function fG(e,t){if(t&&(Eo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hG(e)}function hG(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function DC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(DC=function(){return!!e})()}function Cf(e){return Cf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Cf(e)}function pG(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&&Vy(e,t)}function Vy(e,t){return Vy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Vy(e,t)}function jx(e,t,n){return t=BC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BC(e){var t=mG(e,"string");return Eo(t)=="symbol"?t:t+""}function mG(e,t){if(Eo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Eo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function gG(e){return e.dataKey}function yG(e,t){return W.isValidElement(e)?W.cloneElement(e,t):typeof e=="function"?W.createElement(e,t):W.createElement(GH,t)}var hn=function(e){function t(){return lG(this,t),dG(this,t,arguments)}return pG(t,e),uG(t,[{key:"render",value:function(){var r=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,l=i.animationDuration,c=i.animationEasing,u=i.content,d=i.coordinate,f=i.filterNull,h=i.isAnimationActive,p=i.offset,g=i.payload,m=i.payloadUniqBy,v=i.position,y=i.reverseDirection,b=i.useTranslate3d,x=i.viewBox,k=i.wrapperStyle,S=g??[];f&&S.length&&(S=AC(g.filter(function(_){return _.value!=null&&(_.hide!==!0||r.props.includeHidden)}),m,gG));var w=S.length>0;return W.createElement(sG,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:h,active:a,coordinate:d,hasPayload:w,offset:p,position:v,reverseDirection:y,useTranslate3d:b,viewBox:x,wrapperStyle:k},yG(u,xS(xS({},this.props),{},{payload:S})))}}])}(E.PureComponent);jx(hn,"displayName","Tooltip");jx(hn,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!wu.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 vG=Vr,bG=function(){return vG.Date.now()},xG=bG,wG=/\s/;function SG(e){for(var t=e.length;t--&&wG.test(e.charAt(t)););return t}var kG=SG,EG=kG,_G=/^\s+/;function NG(e){return e&&e.slice(0,EG(e)+1).replace(_G,"")}var jG=NG,AG=jG,wS=pa,TG=Yo,SS=NaN,CG=/^[-+]0x[0-9a-f]+$/i,OG=/^0b[01]+$/i,PG=/^0o[0-7]+$/i,MG=parseInt;function RG(e){if(typeof e=="number")return e;if(TG(e))return SS;if(wS(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=wS(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=AG(e);var n=OG.test(e);return n||PG.test(e)?MG(e.slice(2),n?2:8):CG.test(e)?SS:+e}var zC=RG,IG=pa,Pm=xG,kS=zC,$G="Expected a function",LG=Math.max,DG=Math.min;function BG(e,t,n){var r,i,a,o,l,c,u=0,d=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError($G);t=kS(t)||0,IG(n)&&(d=!!n.leading,f="maxWait"in n,a=f?LG(kS(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h);function p(w){var _=r,N=i;return r=i=void 0,u=w,o=e.apply(N,_),o}function g(w){return u=w,l=setTimeout(y,t),d?p(w):o}function m(w){var _=w-c,N=w-u,C=t-_;return f?DG(C,a-N):C}function v(w){var _=w-c,N=w-u;return c===void 0||_>=t||_<0||f&&N>=a}function y(){var w=Pm();if(v(w))return b(w);l=setTimeout(y,m(w))}function b(w){return l=void 0,h&&r?p(w):(r=i=void 0,o)}function x(){l!==void 0&&clearTimeout(l),u=0,r=c=i=l=void 0}function k(){return l===void 0?o:b(Pm())}function S(){var w=Pm(),_=v(w);if(r=arguments,i=this,c=w,_){if(l===void 0)return g(c);if(f)return clearTimeout(l),l=setTimeout(y,t),p(c)}return l===void 0&&(l=setTimeout(y,t)),o}return S.cancel=x,S.flush=k,S}var zG=BG,FG=zG,UG=pa,WG="Expected a function";function HG(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(WG);return UG(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),FG(e,t,{leading:r,maxWait:t,trailing:i})}var GG=HG;const FC=Xe(GG);function Oc(e){"@babel/helpers - typeof";return Oc=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},Oc(e)}function ES(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ES(Object(n),!0).forEach(function(r){qG(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ES(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qG(e,t,n){return t=KG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KG(e){var t=VG(e,"string");return Oc(t)=="symbol"?t:t+""}function VG(e,t){if(Oc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Oc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function YG(e,t){return JG(e)||QG(e,t)||ZG(e,t)||XG()}function XG(){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 ZG(e,t){if(e){if(typeof e=="string")return _S(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 _S(e,t)}}function _S(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 QG(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function JG(e){if(Array.isArray(e))return e}var Pa=E.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,i=r===void 0?{width:-1,height:-1}:r,a=e.width,o=a===void 0?"100%":a,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,g=e.debounce,m=g===void 0?0:g,v=e.id,y=e.className,b=e.onResize,x=e.style,k=x===void 0?{}:x,S=E.useRef(null),w=E.useRef();w.current=b,E.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 _=E.useState({containerWidth:i.width,containerHeight:i.height}),N=YG(_,2),C=N[0],T=N[1],$=E.useCallback(function(L,I){T(function(z){var D=Math.round(L),F=Math.round(I);return z.containerWidth===D&&z.containerHeight===F?z:{containerWidth:D,containerHeight:F}})},[]);E.useEffect(function(){var L=function(P){var A,Y=P[0].contentRect,K=Y.width,M=Y.height;$(K,M),(A=w.current)===null||A===void 0||A.call(w,K,M)};m>0&&(L=FC(L,m,{trailing:!0,leading:!1}));var I=new ResizeObserver(L),z=S.current.getBoundingClientRect(),D=z.width,F=z.height;return $(D,F),I.observe(S.current),function(){I.disconnect()}},[$,m]);var R=E.useMemo(function(){var L=C.containerWidth,I=C.containerHeight;if(L<0||I<0)return null;di(Da(o)||Da(c),`The width(%s) and height(%s) are both fixed numbers,
81
- maybe you don't need to use a ResponsiveContainer.`,o,c),di(!n||n>0,"The aspect(%s) must be greater than zero.",n);var z=Da(o)?L:o,D=Da(c)?I:c;n&&n>0&&(z?D=z/n:D&&(z=D*n),h&&D>h&&(D=h)),di(z>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.`,z,D,o,c,d,f,n);var F=!Array.isArray(p)&&ui(p.type).endsWith("Chart");return W.Children.map(p,function(O){return W.isValidElement(O)?E.cloneElement(O,rd({width:z,height:D},F?{style:rd({height:"100%",width:"100%",maxHeight:D,maxWidth:z},O.props.style)}:{})):O})},[n,p,c,h,f,d,C,o]);return W.createElement("div",{id:v?"".concat(v):void 0,className:Ke("recharts-responsive-container",y),style:rd(rd({},k),{},{width:o,height:c,minWidth:d,minHeight:f,maxHeight:h}),ref:S},R)}),Pc=function(t){return null};Pc.displayName="Cell";function Mc(e){"@babel/helpers - typeof";return Mc=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},Mc(e)}function NS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Yy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NS(Object(n),!0).forEach(function(r){eq(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eq(e,t,n){return t=tq(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tq(e){var t=nq(e,"string");return Mc(t)=="symbol"?t:t+""}function nq(e,t){if(Mc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Mc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ts={widthCache:{},cacheCount:0},rq=2e3,iq={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},jS="recharts_measurement_span";function aq(e){var t=Yy({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var ec=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||wu.isSsr)return{width:0,height:0};var r=aq(n),i=JSON.stringify({text:t,copyStyle:r});if(Ts.widthCache[i])return Ts.widthCache[i];try{var a=document.getElementById(jS);a||(a=document.createElement("span"),a.setAttribute("id",jS),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=Yy(Yy({},iq),r);Object.assign(a.style,o),a.textContent="".concat(t);var l=a.getBoundingClientRect(),c={width:l.width,height:l.height};return Ts.widthCache[i]=c,++Ts.cacheCount>rq&&(Ts.cacheCount=0,Ts.widthCache={}),c}catch{return{width:0,height:0}}},sq=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Rc(e){"@babel/helpers - typeof";return Rc=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},Rc(e)}function Of(e,t){return uq(e)||cq(e,t)||lq(e,t)||oq()}function oq(){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 lq(e,t){if(e){if(typeof e=="string")return AS(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 AS(e,t)}}function AS(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 cq(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function uq(e){if(Array.isArray(e))return e}function dq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TS(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,hq(r.key),r)}}function fq(e,t,n){return t&&TS(e.prototype,t),n&&TS(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function hq(e){var t=pq(e,"string");return Rc(t)=="symbol"?t:t+""}function pq(e,t){if(Rc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Rc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var CS=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,OS=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,mq=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,gq=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,UC={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},yq=Object.keys(UC),Zs="NaN";function vq(e,t){return e*UC[t]}var id=function(){function e(t,n){dq(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!mq.test(n)&&(this.num=NaN,this.unit=""),yq.includes(n)&&(this.num=vq(t,n),this.unit="px")}return fq(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,i=(r=gq.exec(n))!==null&&r!==void 0?r:[],a=Of(i,3),o=a[1],l=a[2];return new e(parseFloat(o),l??"")}}])}();function WC(e){if(e.includes(Zs))return Zs;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=CS.exec(t))!==null&&n!==void 0?n:[],i=Of(r,4),a=i[1],o=i[2],l=i[3],c=id.parse(a??""),u=id.parse(l??""),d=o==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return Zs;t=t.replace(CS,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,h=(f=OS.exec(t))!==null&&f!==void 0?f:[],p=Of(h,4),g=p[1],m=p[2],v=p[3],y=id.parse(g??""),b=id.parse(v??""),x=m==="+"?y.add(b):y.subtract(b);if(x.isNaN())return Zs;t=t.replace(OS,x.toString())}return t}var PS=/\(([^()]*)\)/;function bq(e){for(var t=e;t.includes("(");){var n=PS.exec(t),r=Of(n,2),i=r[1];t=t.replace(PS,WC(i))}return t}function xq(e){var t=e.replace(/\s+/g,"");return t=bq(t),t=WC(t),t}function wq(e){try{return xq(e)}catch{return Zs}}function Mm(e){var t=wq(e.slice(5,-1));return t===Zs?"":t}var Sq=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],kq=["dx","dy","angle","className","breakAll"];function Xy(){return Xy=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},Xy.apply(this,arguments)}function MS(e,t){if(e==null)return{};var n=Eq(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Eq(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 RS(e,t){return Aq(e)||jq(e,t)||Nq(e,t)||_q()}function _q(){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 Nq(e,t){if(e){if(typeof e=="string")return IS(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 IS(e,t)}}function IS(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 jq(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function Aq(e){if(Array.isArray(e))return e}var HC=/[ \f\n\r\t\v\u2028\u2029]+/,GC=function(t){var n=t.children,r=t.breakAll,i=t.style;try{var a=[];Ve(n)||(r?a=n.toString().split(""):a=n.toString().split(HC));var o=a.map(function(c){return{word:c,width:ec(c,i).width}}),l=r?0:ec(" ",i).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},Tq=function(t,n,r,i,a){var o=t.maxLines,l=t.children,c=t.style,u=t.breakAll,d=ue(o),f=l,h=function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return z.reduce(function(D,F){var O=F.word,P=F.width,A=D[D.length-1];if(A&&(i==null||a||A.width+P+r<Number(i)))A.words.push(O),A.width+=P+r;else{var Y={words:[O],width:P};D.push(Y)}return D},[])},p=h(n),g=function(z){return z.reduce(function(D,F){return D.width>F.width?D:F})};if(!d)return p;for(var m="…",v=function(z){var D=f.slice(0,z),F=GC({breakAll:u,style:c,children:D+m}).wordsWithComputedWidth,O=h(F),P=O.length>o||g(O).width>Number(i);return[P,O]},y=0,b=f.length-1,x=0,k;y<=b&&x<=f.length-1;){var S=Math.floor((y+b)/2),w=S-1,_=v(w),N=RS(_,2),C=N[0],T=N[1],$=v(S),R=RS($,1),L=R[0];if(!C&&!L&&(y=S+1),C&&L&&(b=S-1),!C&&L){k=T;break}x++}return k||p},$S=function(t){var n=Ve(t)?[]:t.toString().split(HC);return[{words:n}]},Cq=function(t){var n=t.width,r=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,l=t.maxLines;if((n||r)&&!wu.isSsr){var c,u,d=GC({breakAll:o,children:i,style:a});if(d){var f=d.wordsWithComputedWidth,h=d.spaceWidth;c=f,u=h}else return $S(i);return Tq({breakAll:o,children:i,maxLines:l,style:a},c,u,n,r)}return $S(i)},LS="#808080",Pf=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,a=i===void 0?0:i,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,g=t.verticalAnchor,m=g===void 0?"end":g,v=t.fill,y=v===void 0?LS:v,b=MS(t,Sq),x=E.useMemo(function(){return Cq({breakAll:b.breakAll,children:b.children,maxLines:b.maxLines,scaleToFit:f,style:b.style,width:b.width})},[b.breakAll,b.children,b.maxLines,f,b.style,b.width]),k=b.dx,S=b.dy,w=b.angle,_=b.className,N=b.breakAll,C=MS(b,kq);if(!Ut(r)||!Ut(a))return null;var T=r+(ue(k)?k:0),$=a+(ue(S)?S:0),R;switch(m){case"start":R=Mm("calc(".concat(u,")"));break;case"middle":R=Mm("calc(".concat((x.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:R=Mm("calc(".concat(x.length-1," * -").concat(l,")"));break}var L=[];if(f){var I=x[0].width,z=b.width;L.push("scale(".concat((ue(z)?z/I:1)/I,")"))}return w&&L.push("rotate(".concat(w,", ").concat(T,", ").concat($,")")),L.length&&(C.transform=L.join(" ")),W.createElement("text",Xy({},qe(C,!0),{x:T,y:$,className:Ke("recharts-text",_),textAnchor:p,fill:y.includes("url")?LS:y}),x.map(function(D,F){var O=D.words.join(N?"":" ");return W.createElement("tspan",{x:T,dy:F===0?R:l,key:"".concat(O,"-").concat(F)},O)}))};function aa(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Oq(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ax(e){let t,n,r;e.length!==2?(t=aa,n=(l,c)=>aa(e(l),c),r=(l,c)=>e(l)-c):(t=e===aa||e===Oq?e:Pq,n=e,r=e);function i(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 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 o(l,c,u=0,d=l.length){const f=i(l,c,u,d-1);return f>u&&r(l[f-1],c)>-r(l[f],c)?f-1:f}return{left:i,center:o,right:a}}function Pq(){return 0}function qC(e){return e===null?NaN:+e}function*Mq(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Rq=Ax(aa),Su=Rq.right;Ax(qC).center;class DS extends Map{constructor(t,n=Lq){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(BS(this,t))}has(t){return super.has(BS(this,t))}set(t,n){return super.set(Iq(this,t),n)}delete(t){return super.delete($q(this,t))}}function BS({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Iq({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function $q({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Lq(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Dq(e=aa){if(e===aa)return KC;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 KC(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Bq=Math.sqrt(50),zq=Math.sqrt(10),Fq=Math.sqrt(2);function Mf(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=Bq?10:a>=zq?5:a>=Fq?2:1;let l,c,u;return i<0?(u=Math.pow(10,-i)/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,i)*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?Mf(e,t,n*2):[l,c,u]}function Zy(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,o]=r?Mf(t,e,n):Mf(e,t,n);if(!(a>=i))return[];const l=a-i+1,c=new Array(l);if(r)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;else if(o<0)for(let u=0;u<l;++u)c[u]=(i+u)/-o;else for(let u=0;u<l;++u)c[u]=(i+u)*o;return c}function Qy(e,t,n){return t=+t,e=+e,n=+n,Mf(e,t,n)[2]}function Jy(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Qy(t,e,n):Qy(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function zS(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function FS(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function VC(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?KC:Dq(i);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)),g=Math.min(r,Math.floor(t+(c-u)*f/c+h));VC(e,t,p,g,i)}const a=e[t];let o=n,l=r;for(Al(e,n,t),i(e[r],a)>0&&Al(e,n,r);o<l;){for(Al(e,o,l),++o,--l;i(e[o],a)<0;)++o;for(;i(e[l],a)>0;)--l}i(e[n],a)===0?Al(e,n,l):(++l,Al(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function Al(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Uq(e,t,n){if(e=Float64Array.from(Mq(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return FS(e);if(t>=1)return zS(e);var r,i=(r-1)*t,a=Math.floor(i),o=zS(VC(e,a).subarray(0,a+1)),l=FS(e.subarray(a+1));return o+(l-o)*(i-a)}}function Wq(e,t,n=qC){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e),l=+n(e[a+1],a+1,e);return o+(l-o)*(i-a)}}function Hq(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function fr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ei(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 ev=Symbol("implicit");function Tx(){var e=new DS,t=[],n=[],r=ev;function i(a){let o=e.get(a);if(o===void 0){if(r!==ev)return r;e.set(a,o=t.push(a)-1)}return n[o%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new DS;for(const o of a)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Tx(t,n).unknown(r)},fr.apply(i,arguments),i}function Ic(){var e=Tx().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,l=!1,c=0,u=0,d=.5;delete e.unknown;function f(){var h=t().length,p=i<r,g=p?i:r,m=p?r:i;a=(m-g)/Math.max(1,h-c+u*2),l&&(a=Math.floor(a)),g+=(m-g-a*(h-c))*d,o=a*(1-c),l&&(g=Math.round(g),o=Math.round(o));var v=Hq(h).map(function(y){return g+a*y});return n(p?v.reverse():v)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,l=!0,f()},e.bandwidth=function(){return o},e.step=function(){return a},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 Ic(t(),[r,i]).round(l).paddingInner(c).paddingOuter(u).align(d)},fr.apply(f(),arguments)}function YC(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return YC(t())},e}function tc(){return YC(Ic.apply(null,arguments).paddingInner(1))}function Cx(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function XC(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ku(){}var $c=.7,Rf=1/$c,lo="\\s*([+-]?\\d+)\\s*",Lc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Hr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Gq=/^#([0-9a-f]{3,8})$/,qq=new RegExp(`^rgb\\(${lo},${lo},${lo}\\)$`),Kq=new RegExp(`^rgb\\(${Hr},${Hr},${Hr}\\)$`),Vq=new RegExp(`^rgba\\(${lo},${lo},${lo},${Lc}\\)$`),Yq=new RegExp(`^rgba\\(${Hr},${Hr},${Hr},${Lc}\\)$`),Xq=new RegExp(`^hsl\\(${Lc},${Hr},${Hr}\\)$`),Zq=new RegExp(`^hsla\\(${Lc},${Hr},${Hr},${Lc}\\)$`),US={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};Cx(ku,Dc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:WS,formatHex:WS,formatHex8:Qq,formatHsl:Jq,formatRgb:HS,toString:HS});function WS(){return this.rgb().formatHex()}function Qq(){return this.rgb().formatHex8()}function Jq(){return ZC(this).formatHsl()}function HS(){return this.rgb().formatRgb()}function Dc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Gq.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?GS(t):n===3?new Rn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ad(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ad(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=qq.exec(e))?new Rn(t[1],t[2],t[3],1):(t=Kq.exec(e))?new Rn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Vq.exec(e))?ad(t[1],t[2],t[3],t[4]):(t=Yq.exec(e))?ad(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Xq.exec(e))?VS(t[1],t[2]/100,t[3]/100,1):(t=Zq.exec(e))?VS(t[1],t[2]/100,t[3]/100,t[4]):US.hasOwnProperty(e)?GS(US[e]):e==="transparent"?new Rn(NaN,NaN,NaN,0):null}function GS(e){return new Rn(e>>16&255,e>>8&255,e&255,1)}function ad(e,t,n,r){return r<=0&&(e=t=n=NaN),new Rn(e,t,n,r)}function eK(e){return e instanceof ku||(e=Dc(e)),e?(e=e.rgb(),new Rn(e.r,e.g,e.b,e.opacity)):new Rn}function tv(e,t,n,r){return arguments.length===1?eK(e):new Rn(e,t,n,r??1)}function Rn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Cx(Rn,tv,XC(ku,{brighter(e){return e=e==null?Rf:Math.pow(Rf,e),new Rn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?$c:Math.pow($c,e),new Rn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Rn(qa(this.r),qa(this.g),qa(this.b),If(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:qS,formatHex:qS,formatHex8:tK,formatRgb:KS,toString:KS}));function qS(){return`#${Ba(this.r)}${Ba(this.g)}${Ba(this.b)}`}function tK(){return`#${Ba(this.r)}${Ba(this.g)}${Ba(this.b)}${Ba((isNaN(this.opacity)?1:this.opacity)*255)}`}function KS(){const e=If(this.opacity);return`${e===1?"rgb(":"rgba("}${qa(this.r)}, ${qa(this.g)}, ${qa(this.b)}${e===1?")":`, ${e})`}`}function If(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function qa(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ba(e){return e=qa(e),(e<16?"0":"")+e.toString(16)}function VS(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new wr(e,t,n,r)}function ZC(e){if(e instanceof wr)return new wr(e.h,e.s,e.l,e.opacity);if(e instanceof ku||(e=Dc(e)),!e)return new wr;if(e instanceof wr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,l=a-i,c=(a+i)/2;return l?(t===a?o=(n-r)/l+(n<r)*6:n===a?o=(r-t)/l+2:o=(t-n)/l+4,l/=c<.5?a+i:2-a-i,o*=60):l=c>0&&c<1?0:o,new wr(o,l,c,e.opacity)}function nK(e,t,n,r){return arguments.length===1?ZC(e):new wr(e,t,n,r??1)}function wr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Cx(wr,nK,XC(ku,{brighter(e){return e=e==null?Rf:Math.pow(Rf,e),new wr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?$c:Math.pow($c,e),new wr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Rn(Rm(e>=240?e-240:e+120,i,r),Rm(e,i,r),Rm(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new wr(YS(this.h),sd(this.s),sd(this.l),If(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=If(this.opacity);return`${e===1?"hsl(":"hsla("}${YS(this.h)}, ${sd(this.s)*100}%, ${sd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function YS(e){return e=(e||0)%360,e<0?e+360:e}function sd(e){return Math.max(0,Math.min(1,e||0))}function Rm(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 Ox=e=>()=>e;function rK(e,t){return function(n){return e+n*t}}function iK(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 aK(e){return(e=+e)==1?QC:function(t,n){return n-t?iK(t,n,e):Ox(isNaN(t)?n:t)}}function QC(e,t){var n=t-e;return n?rK(e,n):Ox(isNaN(e)?t:e)}const XS=function e(t){var n=aK(t);function r(i,a){var o=n((i=tv(i)).r,(a=tv(a)).r),l=n(i.g,a.g),c=n(i.b,a.b),u=QC(i.opacity,a.opacity);return function(d){return i.r=o(d),i.g=l(d),i.b=c(d),i.opacity=u(d),i+""}}return r.gamma=e,r}(1);function sK(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function oK(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function lK(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)i[o]=rl(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(l){for(o=0;o<r;++o)a[o]=i[o](l);return a}}function cK(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function $f(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function uK(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=rl(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var nv=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Im=new RegExp(nv.source,"g");function dK(e){return function(){return e}}function fK(e){return function(t){return e(t)+""}}function hK(e,t){var n=nv.lastIndex=Im.lastIndex=0,r,i,a,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=nv.exec(e))&&(i=Im.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(i=i[0])?l[o]?l[o]+=i:l[++o]=i:(l[++o]=null,c.push({i:o,x:$f(r,i)})),n=Im.lastIndex;return n<t.length&&(a=t.slice(n),l[o]?l[o]+=a:l[++o]=a),l.length<2?c[0]?fK(c[0].x):dK(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 rl(e,t){var n=typeof t,r;return t==null||n==="boolean"?Ox(t):(n==="number"?$f:n==="string"?(r=Dc(t))?(t=r,XS):hK:t instanceof Dc?XS:t instanceof Date?cK:oK(t)?sK:Array.isArray(t)?lK:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?uK:$f)(e,t)}function Px(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function pK(e,t){t===void 0&&(t=e,e=rl);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(o){var l=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return a[l](o-l)}}function mK(e){return function(){return e}}function Lf(e){return+e}var ZS=[0,1];function kn(e){return e}function rv(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:mK(isNaN(t)?NaN:.5)}function gK(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function yK(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=rv(i,r),a=n(o,a)):(r=rv(r,i),a=n(a,o)),function(l){return a(r(l))}}function vK(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=rv(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(l){var c=Su(e,l,1,r)-1;return a[c](i[c](l))}}function Eu(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function pp(){var e=ZS,t=ZS,n=rl,r,i,a,o=kn,l,c,u;function d(){var h=Math.min(e.length,t.length);return o!==kn&&(o=gK(e[0],e[h-1])),l=h>2?vK:yK,c=u=null,f}function f(h){return h==null||isNaN(h=+h)?a:(c||(c=l(e.map(r),t,n)))(r(o(h)))}return f.invert=function(h){return o(i((u||(u=l(t,e.map(r),$f)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Lf),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=Px,d()},f.clamp=function(h){return arguments.length?(o=h?!0:kn,d()):o!==kn},f.interpolate=function(h){return arguments.length?(n=h,d()):n},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,p){return r=h,i=p,d()}}function Mx(){return pp()(kn,kn)}function bK(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Df(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 _o(e){return e=Df(Math.abs(e)),e?e[1]:NaN}function xK(e,t){return function(n,r){for(var i=n.length,a=[],o=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),a.push(n.substring(i-=l,i+l)),!((c+=l+1)>r));)l=e[o=(o+1)%e.length];return a.reverse().join(t)}}function wK(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var SK=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Bc(e){if(!(t=SK.exec(e)))throw new Error("invalid format: "+e);var t;return new Rx({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]})}Bc.prototype=Rx.prototype;function Rx(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+""}Rx.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 kK(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Bf;function EK(e,t){var n=Df(e,t);if(!n)return Bf=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Bf=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Df(e,Math.max(0,t+a-1))[0]}function QS(e,t){var n=Df(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const JS={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:bK,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)=>QS(e*100,t),r:QS,s:EK,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function ek(e){return e}var tk=Array.prototype.map,nk=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function _K(e){var t=e.grouping===void 0||e.thousands===void 0?ek:xK(tk.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?ek:wK(tk.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=Bc(f);var p=f.fill,g=f.align,m=f.sign,v=f.symbol,y=f.zero,b=f.width,x=f.comma,k=f.precision,S=f.trim,w=f.type;w==="n"?(x=!0,w="g"):JS[w]||(k===void 0&&(k=12),S=!0,w="g"),(y||p==="0"&&g==="=")&&(y=!0,p="0",g="=");var _=(h&&h.prefix!==void 0?h.prefix:"")+(v==="$"?n:v==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():""),N=(v==="$"?r:/[%p]/.test(w)?o:"")+(h&&h.suffix!==void 0?h.suffix:""),C=JS[w],T=/[defgprs%]/.test(w);k=k===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,k)):Math.max(0,Math.min(20,k));function $(R){var L=_,I=N,z,D,F;if(w==="c")I=C(R)+I,R="";else{R=+R;var O=R<0||1/R<0;if(R=isNaN(R)?c:C(Math.abs(R),k),S&&(R=kK(R)),O&&+R==0&&m!=="+"&&(O=!1),L=(O?m==="("?m:l:m==="-"||m==="("?"":m)+L,I=(w==="s"&&!isNaN(R)&&Bf!==void 0?nk[8+Bf/3]:"")+I+(O&&m==="("?")":""),T){for(z=-1,D=R.length;++z<D;)if(F=R.charCodeAt(z),48>F||F>57){I=(F===46?i+R.slice(z+1):R.slice(z))+I,R=R.slice(0,z);break}}}x&&!y&&(R=t(R,1/0));var P=L.length+R.length+I.length,A=P<b?new Array(b-P+1).join(p):"";switch(x&&y&&(R=t(A+R,A.length?b-I.length:1/0),A=""),g){case"<":R=L+R+I+A;break;case"=":R=L+A+R+I;break;case"^":R=A.slice(0,P=A.length>>1)+L+R+I+A.slice(P);break;default:R=A+L+R+I;break}return a(R)}return $.toString=function(){return f+""},$}function d(f,h){var p=Math.max(-8,Math.min(8,Math.floor(_o(h)/3)))*3,g=Math.pow(10,-p),m=u((f=Bc(f),f.type="f",f),{suffix:nk[8+p/3]});return function(v){return m(g*v)}}return{format:u,formatPrefix:d}}var od,Ix,JC;NK({thousands:",",grouping:[3],currency:["$",""]});function NK(e){return od=_K(e),Ix=od.format,JC=od.formatPrefix,od}function jK(e){return Math.max(0,-_o(Math.abs(e)))}function AK(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(_o(t)/3)))*3-_o(Math.abs(e)))}function TK(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,_o(t)-_o(e))+1}function eO(e,t,n,r){var i=Jy(e,t,n),a;switch(r=Bc(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=AK(i,o))&&(r.precision=a),JC(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=TK(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=jK(i))&&(r.precision=a-(r.type==="%")*2);break}}return Ix(r)}function ga(e){var t=e.domain;return e.ticks=function(n){var r=t();return Zy(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return eO(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,o=r[i],l=r[a],c,u,d=10;for(l<o&&(u=o,o=l,l=u,u=i,i=a,a=u);d-- >0;){if(u=Qy(o,l,n),u===c)return r[i]=o,r[a]=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 zf(){var e=Mx();return e.copy=function(){return Eu(e,zf())},fr.apply(e,arguments),ga(e)}function tO(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,Lf),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return tO(e).unknown(t)},e=arguments.length?Array.from(e,Lf):[0,1],ga(n)}function nO(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function rk(e){return Math.log(e)}function ik(e){return Math.exp(e)}function CK(e){return-Math.log(-e)}function OK(e){return-Math.exp(-e)}function PK(e){return isFinite(e)?+("1e"+e):e<0?0:e}function MK(e){return e===10?PK:e===Math.E?Math.exp:t=>Math.pow(e,t)}function RK(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 ak(e){return(t,n)=>-e(-t,n)}function $x(e){const t=e(rk,ik),n=t.domain;let r=10,i,a;function o(){return i=RK(r),a=MK(r),n()[0]<0?(i=ak(i),a=ak(a),e(CK,OK)):e(rk,ik),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=i(u),p=i(d),g,m;const v=l==null?10:+l;let y=[];if(!(r%1)&&p-h<v){if(h=Math.floor(h),p=Math.ceil(p),u>0){for(;h<=p;++h)for(g=1;g<r;++g)if(m=h<0?g/a(-h):g*a(h),!(m<u)){if(m>d)break;y.push(m)}}else for(;h<=p;++h)for(g=r-1;g>=1;--g)if(m=h>0?g/a(-h):g*a(h),!(m<u)){if(m>d)break;y.push(m)}y.length*2<v&&(y=Zy(u,d,v))}else y=Zy(h,p,Math.min(p-h,v)).map(a);return f?y.reverse():y},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Bc(c)).precision==null&&(c.trim=!0),c=Ix(c)),l===1/0)return c;const u=Math.max(1,r*l/t.ticks().length);return d=>{let f=d/a(Math.round(i(d)));return f*r<r-.5&&(f*=r),f<=u?c(d):""}},t.nice=()=>n(nO(n(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),t}function rO(){const e=$x(pp()).domain([1,10]);return e.copy=()=>Eu(e,rO()).base(e.base()),fr.apply(e,arguments),e}function sk(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function ok(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Lx(e){var t=1,n=e(sk(t),ok(t));return n.constant=function(r){return arguments.length?e(sk(t=+r),ok(t)):t},ga(n)}function iO(){var e=Lx(pp());return e.copy=function(){return Eu(e,iO()).constant(e.constant())},fr.apply(e,arguments)}function lk(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function IK(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function $K(e){return e<0?-e*e:e*e}function Dx(e){var t=e(kn,kn),n=1;function r(){return n===1?e(kn,kn):n===.5?e(IK,$K):e(lk(n),lk(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},ga(t)}function Bx(){var e=Dx(pp());return e.copy=function(){return Eu(e,Bx()).exponent(e.exponent())},fr.apply(e,arguments),e}function LK(){return Bx.apply(null,arguments).exponent(.5)}function ck(e){return Math.sign(e)*e*e}function DK(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function aO(){var e=Mx(),t=[0,1],n=!1,r;function i(a){var o=DK(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(ck(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,Lf)).map(ck)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return aO(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},fr.apply(i,arguments),ga(i)}function sO(){var e=[],t=[],n=[],r;function i(){var o=0,l=Math.max(1,t.length);for(n=new Array(l-1);++o<l;)n[o-1]=Wq(e,o/l);return a}function a(o){return o==null||isNaN(o=+o)?r:t[Su(n,o)]}return a.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]]},a.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(aa),i()},a.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return sO().domain(e).range(t).unknown(r)},fr.apply(a,arguments)}function oO(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(c){return c!=null&&c<=c?i[Su(r,c,0,n)]:a}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=(i=Array.from(c)).length-1,l()):i.slice()},o.invertExtent=function(c){var u=i.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&&(a=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return oO().domain([e,t]).range(i).unknown(a)},fr.apply(ga(o),arguments)}function lO(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[Su(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return lO().domain(e).range(t).unknown(n)},fr.apply(i,arguments)}const $m=new Date,Lm=new Date;function Wt(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),l=i.ceil(a);return a-o<l-a?o:l},i.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,l)=>{const c=[];if(a=i.ceil(a),l=l==null?1:Math.floor(l),!(a<o)||!(l>0))return c;let u;do c.push(u=new Date(+a)),t(a,l),e(a);while(u<a&&a<o);return c},i.filter=a=>Wt(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!a(o););else for(;--l>=0;)for(;t(o,1),!a(o););}),n&&(i.count=(a,o)=>($m.setTime(+a),Lm.setTime(+o),e($m),e(Lm),Math.floor(n($m,Lm))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?o=>r(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const Ff=Wt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Ff.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Wt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Ff);Ff.range;const si=1e3,ar=si*60,oi=ar*60,yi=oi*24,zx=yi*7,uk=yi*30,Dm=yi*365,za=Wt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*si)},(e,t)=>(t-e)/si,e=>e.getUTCSeconds());za.range;const Fx=Wt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*si)},(e,t)=>{e.setTime(+e+t*ar)},(e,t)=>(t-e)/ar,e=>e.getMinutes());Fx.range;const Ux=Wt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ar)},(e,t)=>(t-e)/ar,e=>e.getUTCMinutes());Ux.range;const Wx=Wt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*si-e.getMinutes()*ar)},(e,t)=>{e.setTime(+e+t*oi)},(e,t)=>(t-e)/oi,e=>e.getHours());Wx.range;const Hx=Wt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*oi)},(e,t)=>(t-e)/oi,e=>e.getUTCHours());Hx.range;const _u=Wt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ar)/yi,e=>e.getDate()-1);_u.range;const mp=Wt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/yi,e=>e.getUTCDate()-1);mp.range;const cO=Wt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/yi,e=>Math.floor(e/yi));cO.range;function ds(e){return Wt(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())*ar)/zx)}const gp=ds(0),Uf=ds(1),BK=ds(2),zK=ds(3),No=ds(4),FK=ds(5),UK=ds(6);gp.range;Uf.range;BK.range;zK.range;No.range;FK.range;UK.range;function fs(e){return Wt(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)/zx)}const yp=fs(0),Wf=fs(1),WK=fs(2),HK=fs(3),jo=fs(4),GK=fs(5),qK=fs(6);yp.range;Wf.range;WK.range;HK.range;jo.range;GK.range;qK.range;const Gx=Wt(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());Gx.range;const qx=Wt(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());qx.range;const vi=Wt(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());vi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Wt(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)});vi.range;const bi=Wt(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());bi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Wt(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)});bi.range;function uO(e,t,n,r,i,a){const o=[[za,1,si],[za,5,5*si],[za,15,15*si],[za,30,30*si],[a,1,ar],[a,5,5*ar],[a,15,15*ar],[a,30,30*ar],[i,1,oi],[i,3,3*oi],[i,6,6*oi],[i,12,12*oi],[r,1,yi],[r,2,2*yi],[n,1,zx],[t,1,uk],[t,3,3*uk],[e,1,Dm]];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),g=p?p.range(u,+d+1):[];return h?g.reverse():g}function c(u,d,f){const h=Math.abs(d-u)/f,p=Ax(([,,v])=>v).right(o,h);if(p===o.length)return e.every(Jy(u/Dm,d/Dm,f));if(p===0)return Ff.every(Math.max(Jy(u,d,f),1));const[g,m]=o[h/o[p-1][2]<o[p][2]/h?p-1:p];return g.every(m)}return[l,c]}const[KK,VK]=uO(bi,qx,yp,cO,Hx,Ux),[YK,XK]=uO(vi,Gx,gp,_u,Wx,Fx);function Bm(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 zm(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 Tl(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function ZK(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,u=Cl(i),d=Ol(i),f=Cl(a),h=Ol(a),p=Cl(o),g=Ol(o),m=Cl(l),v=Ol(l),y=Cl(c),b=Ol(c),x={a:F,A:O,b:P,B:A,c:null,d:gk,e:gk,f:x7,g:C7,G:P7,H:y7,I:v7,j:b7,L:dO,m:w7,M:S7,p:Y,q:K,Q:bk,s:xk,S:k7,u:E7,U:_7,V:N7,w:j7,W:A7,x:null,X:null,y:T7,Y:O7,Z:M7,"%":vk},k={a:M,A:le,b:be,B:me,c:null,d:yk,e:yk,f:L7,g:K7,G:Y7,H:R7,I:I7,j:$7,L:hO,m:D7,M:B7,p:Pe,q:H,Q:bk,s:xk,S:z7,u:F7,U:U7,V:W7,w:H7,W:G7,x:null,X:null,y:q7,Y:V7,Z:X7,"%":vk},S={a:T,A:$,b:R,B:L,c:I,d:pk,e:pk,f:h7,g:hk,G:fk,H:mk,I:mk,j:c7,L:f7,m:l7,M:u7,p:C,q:o7,Q:m7,s:g7,S:d7,u:n7,U:r7,V:i7,w:t7,W:a7,x:z,X:D,y:hk,Y:fk,Z:s7,"%":p7};x.x=w(n,x),x.X=w(r,x),x.c=w(t,x),k.x=w(n,k),k.X=w(r,k),k.c=w(t,k);function w(X,oe){return function(ce){var Z=[],_e=-1,we=0,Ne=X.length,ge,Be,pe;for(ce instanceof Date||(ce=new Date(+ce));++_e<Ne;)X.charCodeAt(_e)===37&&(Z.push(X.slice(we,_e)),(Be=dk[ge=X.charAt(++_e)])!=null?ge=X.charAt(++_e):Be=ge==="e"?" ":"0",(pe=oe[ge])&&(ge=pe(ce,Be)),Z.push(ge),we=_e+1);return Z.push(X.slice(we,_e)),Z.join("")}}function _(X,oe){return function(ce){var Z=Tl(1900,void 0,1),_e=N(Z,X,ce+="",0),we,Ne;if(_e!=ce.length)return null;if("Q"in Z)return new Date(Z.Q);if("s"in Z)return new Date(Z.s*1e3+("L"in Z?Z.L:0));if(oe&&!("Z"in Z)&&(Z.Z=0),"p"in Z&&(Z.H=Z.H%12+Z.p*12),Z.m===void 0&&(Z.m="q"in Z?Z.q:0),"V"in Z){if(Z.V<1||Z.V>53)return null;"w"in Z||(Z.w=1),"Z"in Z?(we=zm(Tl(Z.y,0,1)),Ne=we.getUTCDay(),we=Ne>4||Ne===0?Wf.ceil(we):Wf(we),we=mp.offset(we,(Z.V-1)*7),Z.y=we.getUTCFullYear(),Z.m=we.getUTCMonth(),Z.d=we.getUTCDate()+(Z.w+6)%7):(we=Bm(Tl(Z.y,0,1)),Ne=we.getDay(),we=Ne>4||Ne===0?Uf.ceil(we):Uf(we),we=_u.offset(we,(Z.V-1)*7),Z.y=we.getFullYear(),Z.m=we.getMonth(),Z.d=we.getDate()+(Z.w+6)%7)}else("W"in Z||"U"in Z)&&("w"in Z||(Z.w="u"in Z?Z.u%7:"W"in Z?1:0),Ne="Z"in Z?zm(Tl(Z.y,0,1)).getUTCDay():Bm(Tl(Z.y,0,1)).getDay(),Z.m=0,Z.d="W"in Z?(Z.w+6)%7+Z.W*7-(Ne+5)%7:Z.w+Z.U*7-(Ne+6)%7);return"Z"in Z?(Z.H+=Z.Z/100|0,Z.M+=Z.Z%100,zm(Z)):Bm(Z)}}function N(X,oe,ce,Z){for(var _e=0,we=oe.length,Ne=ce.length,ge,Be;_e<we;){if(Z>=Ne)return-1;if(ge=oe.charCodeAt(_e++),ge===37){if(ge=oe.charAt(_e++),Be=S[ge in dk?oe.charAt(_e++):ge],!Be||(Z=Be(X,ce,Z))<0)return-1}else if(ge!=ce.charCodeAt(Z++))return-1}return Z}function C(X,oe,ce){var Z=u.exec(oe.slice(ce));return Z?(X.p=d.get(Z[0].toLowerCase()),ce+Z[0].length):-1}function T(X,oe,ce){var Z=p.exec(oe.slice(ce));return Z?(X.w=g.get(Z[0].toLowerCase()),ce+Z[0].length):-1}function $(X,oe,ce){var Z=f.exec(oe.slice(ce));return Z?(X.w=h.get(Z[0].toLowerCase()),ce+Z[0].length):-1}function R(X,oe,ce){var Z=y.exec(oe.slice(ce));return Z?(X.m=b.get(Z[0].toLowerCase()),ce+Z[0].length):-1}function L(X,oe,ce){var Z=m.exec(oe.slice(ce));return Z?(X.m=v.get(Z[0].toLowerCase()),ce+Z[0].length):-1}function I(X,oe,ce){return N(X,t,oe,ce)}function z(X,oe,ce){return N(X,n,oe,ce)}function D(X,oe,ce){return N(X,r,oe,ce)}function F(X){return o[X.getDay()]}function O(X){return a[X.getDay()]}function P(X){return c[X.getMonth()]}function A(X){return l[X.getMonth()]}function Y(X){return i[+(X.getHours()>=12)]}function K(X){return 1+~~(X.getMonth()/3)}function M(X){return o[X.getUTCDay()]}function le(X){return a[X.getUTCDay()]}function be(X){return c[X.getUTCMonth()]}function me(X){return l[X.getUTCMonth()]}function Pe(X){return i[+(X.getUTCHours()>=12)]}function H(X){return 1+~~(X.getUTCMonth()/3)}return{format:function(X){var oe=w(X+="",x);return oe.toString=function(){return X},oe},parse:function(X){var oe=_(X+="",!1);return oe.toString=function(){return X},oe},utcFormat:function(X){var oe=w(X+="",k);return oe.toString=function(){return X},oe},utcParse:function(X){var oe=_(X+="",!0);return oe.toString=function(){return X},oe}}}var dk={"-":"",_:" ",0:"0"},Zt=/^\s*\d+/,QK=/^%/,JK=/[\\^$*+?|[\]().{}]/g;function Ge(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function e7(e){return e.replace(JK,"\\$&")}function Cl(e){return new RegExp("^(?:"+e.map(e7).join("|")+")","i")}function Ol(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function t7(e,t,n){var r=Zt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function n7(e,t,n){var r=Zt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function r7(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function i7(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function a7(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function fk(e,t,n){var r=Zt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function hk(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function s7(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 o7(e,t,n){var r=Zt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function l7(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function pk(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function c7(e,t,n){var r=Zt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function mk(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function u7(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function d7(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function f7(e,t,n){var r=Zt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function h7(e,t,n){var r=Zt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function p7(e,t,n){var r=QK.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function m7(e,t,n){var r=Zt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function g7(e,t,n){var r=Zt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function gk(e,t){return Ge(e.getDate(),t,2)}function y7(e,t){return Ge(e.getHours(),t,2)}function v7(e,t){return Ge(e.getHours()%12||12,t,2)}function b7(e,t){return Ge(1+_u.count(vi(e),e),t,3)}function dO(e,t){return Ge(e.getMilliseconds(),t,3)}function x7(e,t){return dO(e,t)+"000"}function w7(e,t){return Ge(e.getMonth()+1,t,2)}function S7(e,t){return Ge(e.getMinutes(),t,2)}function k7(e,t){return Ge(e.getSeconds(),t,2)}function E7(e){var t=e.getDay();return t===0?7:t}function _7(e,t){return Ge(gp.count(vi(e)-1,e),t,2)}function fO(e){var t=e.getDay();return t>=4||t===0?No(e):No.ceil(e)}function N7(e,t){return e=fO(e),Ge(No.count(vi(e),e)+(vi(e).getDay()===4),t,2)}function j7(e){return e.getDay()}function A7(e,t){return Ge(Uf.count(vi(e)-1,e),t,2)}function T7(e,t){return Ge(e.getFullYear()%100,t,2)}function C7(e,t){return e=fO(e),Ge(e.getFullYear()%100,t,2)}function O7(e,t){return Ge(e.getFullYear()%1e4,t,4)}function P7(e,t){var n=e.getDay();return e=n>=4||n===0?No(e):No.ceil(e),Ge(e.getFullYear()%1e4,t,4)}function M7(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ge(t/60|0,"0",2)+Ge(t%60,"0",2)}function yk(e,t){return Ge(e.getUTCDate(),t,2)}function R7(e,t){return Ge(e.getUTCHours(),t,2)}function I7(e,t){return Ge(e.getUTCHours()%12||12,t,2)}function $7(e,t){return Ge(1+mp.count(bi(e),e),t,3)}function hO(e,t){return Ge(e.getUTCMilliseconds(),t,3)}function L7(e,t){return hO(e,t)+"000"}function D7(e,t){return Ge(e.getUTCMonth()+1,t,2)}function B7(e,t){return Ge(e.getUTCMinutes(),t,2)}function z7(e,t){return Ge(e.getUTCSeconds(),t,2)}function F7(e){var t=e.getUTCDay();return t===0?7:t}function U7(e,t){return Ge(yp.count(bi(e)-1,e),t,2)}function pO(e){var t=e.getUTCDay();return t>=4||t===0?jo(e):jo.ceil(e)}function W7(e,t){return e=pO(e),Ge(jo.count(bi(e),e)+(bi(e).getUTCDay()===4),t,2)}function H7(e){return e.getUTCDay()}function G7(e,t){return Ge(Wf.count(bi(e)-1,e),t,2)}function q7(e,t){return Ge(e.getUTCFullYear()%100,t,2)}function K7(e,t){return e=pO(e),Ge(e.getUTCFullYear()%100,t,2)}function V7(e,t){return Ge(e.getUTCFullYear()%1e4,t,4)}function Y7(e,t){var n=e.getUTCDay();return e=n>=4||n===0?jo(e):jo.ceil(e),Ge(e.getUTCFullYear()%1e4,t,4)}function X7(){return"+0000"}function vk(){return"%"}function bk(e){return+e}function xk(e){return Math.floor(+e/1e3)}var Cs,mO,gO;Z7({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 Z7(e){return Cs=ZK(e),mO=Cs.format,Cs.parse,gO=Cs.utcFormat,Cs.utcParse,Cs}function Q7(e){return new Date(e)}function J7(e){return e instanceof Date?+e:+new Date(+e)}function Kx(e,t,n,r,i,a,o,l,c,u){var d=Mx(),f=d.invert,h=d.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),v=u("%I %p"),y=u("%a %d"),b=u("%b %d"),x=u("%B"),k=u("%Y");function S(w){return(c(w)<w?p:l(w)<w?g:o(w)<w?m:a(w)<w?v:r(w)<w?i(w)<w?y:b:n(w)<w?x:k)(w)}return d.invert=function(w){return new Date(f(w))},d.domain=function(w){return arguments.length?h(Array.from(w,J7)):h().map(Q7)},d.ticks=function(w){var _=h();return e(_[0],_[_.length-1],w??10)},d.tickFormat=function(w,_){return _==null?S:u(_)},d.nice=function(w){var _=h();return(!w||typeof w.range!="function")&&(w=t(_[0],_[_.length-1],w??10)),w?h(nO(_,w)):d},d.copy=function(){return Eu(d,Kx(e,t,n,r,i,a,o,l,c,u))},d}function eV(){return fr.apply(Kx(YK,XK,vi,Gx,gp,_u,Wx,Fx,za,mO).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function tV(){return fr.apply(Kx(KK,VK,bi,qx,yp,mp,Hx,Ux,za,gO).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function vp(){var e=0,t=1,n,r,i,a,o=kn,l=!1,c;function u(f){return f==null||isNaN(f=+f)?c:o(i===0?.5:(f=(a(f)-n)*i,l?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,n=a(e=+e),r=a(t=+t),i=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,g;return arguments.length?([p,g]=h,o=f(p,g),u):[o(0),o(1)]}}return u.range=d(rl),u.rangeRound=d(Px),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return a=f,n=f(e),r=f(t),i=n===r?0:1/(r-n),u}}function ya(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function yO(){var e=ga(vp()(kn));return e.copy=function(){return ya(e,yO())},Ei.apply(e,arguments)}function vO(){var e=$x(vp()).domain([1,10]);return e.copy=function(){return ya(e,vO()).base(e.base())},Ei.apply(e,arguments)}function bO(){var e=Lx(vp());return e.copy=function(){return ya(e,bO()).constant(e.constant())},Ei.apply(e,arguments)}function Vx(){var e=Dx(vp());return e.copy=function(){return ya(e,Vx()).exponent(e.exponent())},Ei.apply(e,arguments)}function nV(){return Vx.apply(null,arguments).exponent(.5)}function xO(){var e=[],t=kn;function n(r){if(r!=null&&!isNaN(r=+r))return t((Su(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(aa),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>Uq(e,a/r))},n.copy=function(){return xO(t).domain(e)},Ei.apply(n,arguments)}function bp(){var e=0,t=.5,n=1,r=1,i,a,o,l,c,u=kn,d,f=!1,h;function p(m){return isNaN(m=+m)?h:(m=.5+((m=+d(m))-a)*(r*m<r*a?l:c),u(f?Math.max(0,Math.min(1,m)):m))}p.domain=function(m){return arguments.length?([e,t,n]=m,i=d(e=+e),a=d(t=+t),o=d(n=+n),l=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p):[e,t,n]},p.clamp=function(m){return arguments.length?(f=!!m,p):f},p.interpolator=function(m){return arguments.length?(u=m,p):u};function g(m){return function(v){var y,b,x;return arguments.length?([y,b,x]=v,u=pK(m,[y,b,x]),p):[u(0),u(.5),u(1)]}}return p.range=g(rl),p.rangeRound=g(Px),p.unknown=function(m){return arguments.length?(h=m,p):h},function(m){return d=m,i=m(e),a=m(t),o=m(n),l=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p}}function wO(){var e=ga(bp()(kn));return e.copy=function(){return ya(e,wO())},Ei.apply(e,arguments)}function SO(){var e=$x(bp()).domain([.1,1,10]);return e.copy=function(){return ya(e,SO()).base(e.base())},Ei.apply(e,arguments)}function kO(){var e=Lx(bp());return e.copy=function(){return ya(e,kO()).constant(e.constant())},Ei.apply(e,arguments)}function Yx(){var e=Dx(bp());return e.copy=function(){return ya(e,Yx()).exponent(e.exponent())},Ei.apply(e,arguments)}function rV(){return Yx.apply(null,arguments).exponent(.5)}const wk=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Ic,scaleDiverging:wO,scaleDivergingLog:SO,scaleDivergingPow:Yx,scaleDivergingSqrt:rV,scaleDivergingSymlog:kO,scaleIdentity:tO,scaleImplicit:ev,scaleLinear:zf,scaleLog:rO,scaleOrdinal:Tx,scalePoint:tc,scalePow:Bx,scaleQuantile:sO,scaleQuantize:oO,scaleRadial:aO,scaleSequential:yO,scaleSequentialLog:vO,scaleSequentialPow:Vx,scaleSequentialQuantile:xO,scaleSequentialSqrt:nV,scaleSequentialSymlog:bO,scaleSqrt:LK,scaleSymlog:iO,scaleThreshold:lO,scaleTime:eV,scaleUtc:tV,tickFormat:eO},Symbol.toStringTag,{value:"Module"}));var iV=Yo;function aV(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],o=t(a);if(o!=null&&(l===void 0?o===o&&!iV(o):n(o,l)))var l=o,c=a}return c}var EO=aV;function sV(e,t){return e>t}var oV=sV,lV=EO,cV=oV,uV=nl;function dV(e){return e&&e.length?lV(e,uV,cV):void 0}var fV=dV;const xp=Xe(fV);function hV(e,t){return e<t}var pV=hV,mV=EO,gV=pV,yV=nl;function vV(e){return e&&e.length?mV(e,yV,gV):void 0}var bV=vV;const wp=Xe(bV);var xV=cx,wV=ma,SV=RC,kV=Dn;function EV(e,t){var n=kV(e)?xV:SV;return n(e,wV(t))}var _V=EV,NV=PC,jV=_V;function AV(e,t){return NV(jV(e,t),1)}var TV=AV;const CV=Xe(TV);var OV=Ex;function PV(e,t){return OV(e,t)}var MV=PV;const Xx=Xe(MV);var il=1e9,RV={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Qx,bt=!0,ur="[DecimalError] ",Ka=ur+"Invalid argument: ",Zx=ur+"Exponent out of range: ",al=Math.floor,Ca=Math.pow,IV=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Hn,Kt=1e7,gt=7,_O=9007199254740991,Hf=al(_O/gt),ve={};ve.absoluteValue=ve.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};ve.comparedTo=ve.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};ve.decimalPlaces=ve.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*gt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};ve.dividedBy=ve.div=function(e){return fi(this,new this.constructor(e))};ve.dividedToIntegerBy=ve.idiv=function(e){var t=this,n=t.constructor;return ot(fi(t,new n(e),0,1),n.precision)};ve.equals=ve.eq=function(e){return!this.cmp(e)};ve.exponent=function(){return It(this)};ve.greaterThan=ve.gt=function(e){return this.cmp(e)>0};ve.greaterThanOrEqualTo=ve.gte=function(e){return this.cmp(e)>=0};ve.isInteger=ve.isint=function(){return this.e>this.d.length-2};ve.isNegative=ve.isneg=function(){return this.s<0};ve.isPositive=ve.ispos=function(){return this.s>0};ve.isZero=function(){return this.s===0};ve.lessThan=ve.lt=function(e){return this.cmp(e)<0};ve.lessThanOrEqualTo=ve.lte=function(e){return this.cmp(e)<1};ve.logarithm=ve.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Hn))throw Error(ur+"NaN");if(n.s<1)throw Error(ur+(n.s?"NaN":"-Infinity"));return n.eq(Hn)?new r(0):(bt=!1,t=fi(zc(n,a),zc(e,a),a),bt=!0,ot(t,i))};ve.minus=ve.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?AO(t,e):NO(t,(e.s=-e.s,e))};ve.modulo=ve.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(ur+"NaN");return n.s?(bt=!1,t=fi(n,e,0,1).times(e),bt=!0,n.minus(t)):ot(new r(n),i)};ve.naturalExponential=ve.exp=function(){return jO(this)};ve.naturalLogarithm=ve.ln=function(){return zc(this)};ve.negated=ve.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ve.plus=ve.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?NO(t,e):AO(t,(e.s=-e.s,e))};ve.precision=ve.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ka+e);if(t=It(i)+1,r=i.d.length-1,n=r*gt+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};ve.squareRoot=ve.sqrt=function(){var e,t,n,r,i,a,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(ur+"NaN")}for(e=It(l),bt=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=Fr(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=al((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(i.toString()),n=c.precision,i=o=n+3;;)if(a=r,r=a.plus(fi(l,a,o+2)).times(.5),Fr(a.d).slice(0,o)===(t=Fr(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(ot(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;o+=4}return bt=!0,ot(r,n)};ve.times=ve.mul=function(e){var t,n,r,i,a,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&&(a=h,h=p,p=a,o=c,c=u,u=o),a=[],o=c+u,r=o;r--;)a.push(0);for(r=u;--r>=0;){for(t=0,i=c+r;i>r;)l=a[i]+p[r]*h[i-r-1]+t,a[i--]=l%Kt|0,t=l/Kt|0;a[i]=(a[i]+t)%Kt|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,bt?ot(e,f.precision):e};ve.toDecimalPlaces=ve.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(qr(e,0,il),t===void 0?t=r.rounding:qr(t,0,8),ot(n,e+It(n)+1,t))};ve.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=is(r,!0):(qr(e,0,il),t===void 0?t=i.rounding:qr(t,0,8),r=ot(new i(r),e+1,t),n=is(r,!0,e+1)),n};ve.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?is(i):(qr(e,0,il),t===void 0?t=a.rounding:qr(t,0,8),r=ot(new a(i),e+It(i)+1,t),n=is(r.abs(),!1,e+It(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};ve.toInteger=ve.toint=function(){var e=this,t=e.constructor;return ot(new t(e),It(e)+1,t.rounding)};ve.toNumber=function(){return+this};ve.toPower=ve.pow=function(e){var t,n,r,i,a,o,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(Hn);if(l=new c(l),!l.s){if(e.s<1)throw Error(ur+"Infinity");return l}if(l.eq(Hn))return l;if(r=c.precision,e.eq(Hn))return ot(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=l.s,o){if((n=d<0?-d:d)<=_O){for(i=new c(Hn),t=Math.ceil(r/gt+4),bt=!1;n%2&&(i=i.times(l),kk(i.d,t)),n=al(n/2),n!==0;)l=l.times(l),kk(l.d,t);return bt=!0,e.s<0?new c(Hn).div(i):ot(i,r)}}else if(a<0)throw Error(ur+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,bt=!1,i=e.times(zc(l,r+u)),bt=!0,i=jO(i),i.s=a,i};ve.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=It(i),r=is(i,n<=a.toExpNeg||n>=a.toExpPos)):(qr(e,1,il),t===void 0?t=a.rounding:qr(t,0,8),i=ot(new a(i),e,t),n=It(i),r=is(i,e<=n||n<=a.toExpNeg,e)),r};ve.toSignificantDigits=ve.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(qr(e,1,il),t===void 0?t=r.rounding:qr(t,0,8)),ot(new r(n),e,t)};ve.toString=ve.valueOf=ve.val=ve.toJSON=ve[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=It(e),n=e.constructor;return is(e,t<=n.toExpNeg||t>=n.toExpPos)};function NO(e,t){var n,r,i,a,o,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),bt?ot(t,f):t;if(c=e.d,u=t.d,o=e.e,i=t.e,c=c.slice(),a=o-i,a){for(a<0?(r=c,a=-a,l=u.length):(r=u,i=o,l=c.length),o=Math.ceil(f/gt),l=o>l?o+1:l+1,a>l&&(a=l,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(l=c.length,a=u.length,l-a<0&&(a=l,r=u,u=c,c=r),n=0;a;)n=(c[--a]=c[a]+u[a]+n)/Kt|0,c[a]%=Kt;for(n&&(c.unshift(n),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,bt?ot(t,f):t}function qr(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Ka+e)}function Fr(e){var t,n,r,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+"",n=gt-r.length,n&&(a+=Bi(n)),a+=r;o=e[t],r=o+"",n=gt-r.length,n&&(a+=Bi(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var fi=function(){function e(r,i){var a,o=0,l=r.length;for(r=r.slice();l--;)a=r[l]*i+o,r[l]=a%Kt|0,o=a/Kt|0;return o&&r.unshift(o),r}function t(r,i,a,o){var l,c;if(a!=o)c=a>o?1:-1;else for(l=c=0;l<a;l++)if(r[l]!=i[l]){c=r[l]>i[l]?1:-1;break}return c}function n(r,i,a){for(var o=0;a--;)r[a]-=o,o=r[a]<i[a]?1:0,r[a]=o*Kt+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,o){var l,c,u,d,f,h,p,g,m,v,y,b,x,k,S,w,_,N,C=r.constructor,T=r.s==i.s?1:-1,$=r.d,R=i.d;if(!r.s)return new C(r);if(!i.s)throw Error(ur+"Division by zero");for(c=r.e-i.e,_=R.length,S=$.length,p=new C(T),g=p.d=[],u=0;R[u]==($[u]||0);)++u;if(R[u]>($[u]||0)&&--c,a==null?b=a=C.precision:o?b=a+(It(r)-It(i))+1:b=a,b<0)return new C(0);if(b=b/gt+2|0,u=0,_==1)for(d=0,R=R[0],b++;(u<S||d)&&b--;u++)x=d*Kt+($[u]||0),g[u]=x/R|0,d=x%R|0;else{for(d=Kt/(R[0]+1)|0,d>1&&(R=e(R,d),$=e($,d),_=R.length,S=$.length),k=_,m=$.slice(0,_),v=m.length;v<_;)m[v++]=0;N=R.slice(),N.unshift(0),w=R[0],R[1]>=Kt/2&&++w;do d=0,l=t(R,m,_,v),l<0?(y=m[0],_!=v&&(y=y*Kt+(m[1]||0)),d=y/w|0,d>1?(d>=Kt&&(d=Kt-1),f=e(R,d),h=f.length,v=m.length,l=t(f,m,h,v),l==1&&(d--,n(f,_<h?N:R,h))):(d==0&&(l=d=1),f=R.slice()),h=f.length,h<v&&f.unshift(0),n(m,f,v),l==-1&&(v=m.length,l=t(R,m,_,v),l<1&&(d++,n(m,_<v?N:R,v))),v=m.length):l===0&&(d++,m=[0]),g[u++]=d,l&&m[0]?m[v++]=$[k]||0:(m=[$[k]],v=1);while((k++<S||m[0]!==void 0)&&b--)}return g[0]||g.shift(),p.e=c,ot(p,o?a+It(p)+1:a)}}();function jO(e,t){var n,r,i,a,o,l,c=0,u=0,d=e.constructor,f=d.precision;if(It(e)>16)throw Error(Zx+It(e));if(!e.s)return new d(Hn);for(bt=!1,l=f,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(r=Math.log(Ca(2,u))/Math.LN10*2+5|0,l+=r,n=i=a=new d(Hn),d.precision=l;;){if(i=ot(i.times(e),l),n=n.times(++c),o=a.plus(fi(i,n,l)),Fr(o.d).slice(0,l)===Fr(a.d).slice(0,l)){for(;u--;)a=ot(a.times(a),l);return d.precision=f,t==null?(bt=!0,ot(a,f)):a}a=o}}function It(e){for(var t=e.e*gt,n=e.d[0];n>=10;n/=10)t++;return t}function Fm(e,t,n){if(t>e.LN10.sd())throw bt=!0,n&&(e.precision=n),Error(ur+"LN10 precision limit exceeded");return ot(new e(e.LN10),t)}function Bi(e){for(var t="";e--;)t+="0";return t}function zc(e,t){var n,r,i,a,o,l,c,u,d,f=1,h=10,p=e,g=p.d,m=p.constructor,v=m.precision;if(p.s<1)throw Error(ur+(p.s?"NaN":"-Infinity"));if(p.eq(Hn))return new m(0);if(t==null?(bt=!1,u=v):u=t,p.eq(10))return t==null&&(bt=!0),Fm(m,u);if(u+=h,m.precision=u,n=Fr(g),r=n.charAt(0),a=It(p),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)p=p.times(e),n=Fr(p.d),r=n.charAt(0),f++;a=It(p),r>1?(p=new m("0."+n),a++):p=new m(r+"."+n.slice(1))}else return c=Fm(m,u+2,v).times(a+""),p=zc(new m(r+"."+n.slice(1)),u-h).plus(c),m.precision=v,t==null?(bt=!0,ot(p,v)):p;for(l=o=p=fi(p.minus(Hn),p.plus(Hn),u),d=ot(p.times(p),u),i=3;;){if(o=ot(o.times(d),u),c=l.plus(fi(o,new m(i),u)),Fr(c.d).slice(0,u)===Fr(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(Fm(m,u+2,v).times(a+""))),l=fi(l,new m(f),u),m.precision=v,t==null?(bt=!0,ot(l,v)):l;l=c,i+=2}}function Sk(e,t){var n,r,i;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(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=al(n/gt),e.d=[],r=(n+1)%gt,n<0&&(r+=gt),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=gt;r<i;)e.d.push(+t.slice(r,r+=gt));t=t.slice(r),r=gt-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),bt&&(e.e>Hf||e.e<-Hf))throw Error(Zx+n)}else e.s=0,e.e=0,e.d=[0];return e}function ot(e,t,n){var r,i,a,o,l,c,u,d,f=e.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=gt,i=t,u=f[d=0];else{if(d=Math.ceil((r+1)/gt),a=f.length,d>=a)return e;for(u=a=f[d],o=1;a>=10;a/=10)o++;r%=gt,i=r-gt+o}if(n!==void 0&&(a=Ca(10,o-i-1),l=u/a%10|0,c=t<0||f[d+1]!==void 0||u%a,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?i>0?u/Ca(10,o-i):0:f[d-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(a=It(e),f.length=1,t=t-a-1,f[0]=Ca(10,(gt-t%gt)%gt),e.e=al(-t/gt)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=d,a=1,d--):(f.length=d+1,a=Ca(10,gt-r),f[d]=i>0?(u/Ca(10,o-i)%Ca(10,i)|0)*a:0),c)for(;;)if(d==0){(f[0]+=a)==Kt&&(f[0]=1,++e.e);break}else{if(f[d]+=a,f[d]!=Kt)break;f[d--]=0,a=1}for(r=f.length;f[--r]===0;)f.pop();if(bt&&(e.e>Hf||e.e<-Hf))throw Error(Zx+It(e));return e}function AO(e,t){var n,r,i,a,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),bt?ot(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),i=Math.max(Math.ceil(p/gt),l)+2,o>i&&(o=i,n.length=1),n.reverse(),i=o;i--;)n.push(0);n.reverse()}else{for(i=c.length,l=f.length,d=i<l,d&&(l=i),i=0;i<l;i++)if(c[i]!=f[i]){d=c[i]<f[i];break}o=0}for(d&&(n=c,c=f,f=n,t.s=-t.s),l=c.length,i=f.length-l;i>0;--i)c[l++]=0;for(i=f.length;i>o;){if(c[--i]<f[i]){for(a=i;a&&c[--a]===0;)c[a]=Kt-1;--c[a],c[i]+=Kt}c[i]-=f[i]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,bt?ot(t,p):t):new h(0)}function is(e,t,n){var r,i=It(e),a=Fr(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+Bi(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Bi(-i-1)+a,n&&(r=n-o)>0&&(a+=Bi(r))):i>=o?(a+=Bi(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+Bi(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=Bi(r))),e.s<0?"-"+a:a}function kk(e,t){if(e.length>t)return e.length=t,!0}function TO(e){var t,n,r;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Ka+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return Sk(o,a.toString())}else if(typeof a!="string")throw Error(Ka+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,IV.test(a))Sk(o,a);else throw Error(Ka+a)}if(i.prototype=ve,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=TO,i.config=i.set=$V,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function $V(e){if(!e||typeof e!="object")throw Error(ur+"Object expected");var t,n,r,i=["precision",1,il,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(al(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Ka+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Ka+n+": "+r);return this}var Qx=TO(RV);Hn=new Qx(1);const rt=Qx;function LV(e){return FV(e)||zV(e)||BV(e)||DV()}function DV(){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 BV(e,t){if(e){if(typeof e=="string")return iv(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 iv(e,t)}}function zV(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function FV(e){if(Array.isArray(e))return iv(e)}function iv(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 UV=function(t){return t},CO={},OO=function(t){return t===CO},Ek=function(t){return function n(){return arguments.length===0||arguments.length===1&&OO(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},WV=function e(t,n){return t===1?n:Ek(function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var o=i.filter(function(l){return l!==CO}).length;return o>=t?n.apply(void 0,i):e(t-o,Ek(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=i.map(function(f){return OO(f)?c.shift():f});return n.apply(void 0,LV(d).concat(c))}))})},Sp=function(t){return WV(t.length,t)},av=function(t,n){for(var r=[],i=t;i<n;++i)r[i-t]=i;return r},HV=Sp(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),GV=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return UV;var i=n.reverse(),a=i[0],o=i.slice(1);return function(){return o.reduce(function(l,c){return c(l)},a.apply(void 0,arguments))}},sv=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},PO=function(t){var n=null,r=null;return function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n&&a.every(function(l,c){return l===n[c]})||(n=a,r=t.apply(void 0,a)),r}};function qV(e){var t;return e===0?t=1:t=Math.floor(new rt(e).abs().log(10).toNumber())+1,t}function KV(e,t,n){for(var r=new rt(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var VV=Sp(function(e,t,n){var r=+e,i=+t;return r+n*(i-r)}),YV=Sp(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),XV=Sp(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const kp={rangeStep:KV,getDigitCount:qV,interpolateNumber:VV,uninterpolateNumber:YV,uninterpolateTruncation:XV};function ov(e){return JV(e)||QV(e)||MO(e)||ZV()}function ZV(){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 QV(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function JV(e){if(Array.isArray(e))return lv(e)}function Fc(e,t){return nY(e)||tY(e,t)||MO(e,t)||eY()}function eY(){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 MO(e,t){if(e){if(typeof e=="string")return lv(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 lv(e,t)}}function lv(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 tY(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,a=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){i=!0,a=c}finally{try{!r&&o.return!=null&&o.return()}finally{if(i)throw a}}return n}}function nY(e){if(Array.isArray(e))return e}function RO(e){var t=Fc(e,2),n=t[0],r=t[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]}function IO(e,t,n){if(e.lte(0))return new rt(0);var r=kp.getDigitCount(e.toNumber()),i=new rt(10).pow(r),a=e.div(i),o=r!==1?.05:.1,l=new rt(Math.ceil(a.div(o).toNumber())).add(n).mul(o),c=l.mul(i);return t?c:new rt(Math.ceil(c))}function rY(e,t,n){var r=1,i=new rt(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new rt(10).pow(kp.getDigitCount(e)-1),i=new rt(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new rt(Math.floor(e)))}else e===0?i=new rt(Math.floor((t-1)/2)):n||(i=new rt(Math.floor(e)));var o=Math.floor((t-1)/2),l=GV(HV(function(c){return i.add(new rt(c-o).mul(r)).toNumber()}),av);return l(0,t)}function $O(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new rt(0),tickMin:new rt(0),tickMax:new rt(0)};var a=IO(new rt(t).sub(e).div(n-1),r,i),o;e<=0&&t>=0?o=new rt(0):(o=new rt(e).add(t).div(2),o=o.sub(new rt(o).mod(a)));var l=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new rt(t).sub(o).div(a).toNumber()),u=l+c+1;return u>n?$O(e,t,n,r,i+1):(u<n&&(c=t>0?c+(n-u):c,l=t>0?l:l+(n-u)),{step:a,tickMin:o.sub(new rt(l).mul(a)),tickMax:o.add(new rt(c).mul(a))})}function iY(e){var t=Fc(e,2),n=t[0],r=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),l=RO([n,r]),c=Fc(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(ov(av(0,i-1).map(function(){return 1/0}))):[].concat(ov(av(0,i-1).map(function(){return-1/0})),[d]);return n>r?sv(f):f}if(u===d)return rY(u,i,a);var h=$O(u,d,o,a),p=h.step,g=h.tickMin,m=h.tickMax,v=kp.rangeStep(g,m.add(new rt(.1).mul(p)),p);return n>r?sv(v):v}function aY(e,t){var n=Fc(e,2),r=n[0],i=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=RO([r,i]),l=Fc(o,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[r,i];if(c===u)return[c];var d=Math.max(t,2),f=IO(new rt(u).sub(c).div(d-1),a,0),h=[].concat(ov(kp.rangeStep(new rt(c),new rt(u).sub(new rt(.99).mul(f)),f)),[u]);return r>i?sv(h):h}var sY=PO(iY),oY=PO(aY),lY="Invariant failed";function as(e,t){throw new Error(lY)}var cY=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Ao(e){"@babel/helpers - typeof";return Ao=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},Ao(e)}function Gf(){return Gf=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},Gf.apply(this,arguments)}function uY(e,t){return pY(e)||hY(e,t)||fY(e,t)||dY()}function dY(){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 fY(e,t){if(e){if(typeof e=="string")return _k(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 _k(e,t)}}function _k(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 hY(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function pY(e){if(Array.isArray(e))return e}function mY(e,t){if(e==null)return{};var n=gY(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function gY(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 yY(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vY(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,BO(r.key),r)}}function bY(e,t,n){return t&&vY(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function xY(e,t,n){return t=qf(t),wY(e,LO()?Reflect.construct(t,n||[],qf(e).constructor):t.apply(e,n))}function wY(e,t){if(t&&(Ao(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return SY(e)}function SY(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function LO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(LO=function(){return!!e})()}function qf(e){return qf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},qf(e)}function kY(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&&cv(e,t)}function cv(e,t){return cv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},cv(e,t)}function DO(e,t,n){return t=BO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BO(e){var t=EY(e,"string");return Ao(t)=="symbol"?t:t+""}function EY(e,t){if(Ao(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ao(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ep=function(e){function t(){return yY(this,t),xY(this,t,arguments)}return kY(t,e),bY(t,[{key:"render",value:function(){var r=this.props,i=r.offset,a=r.layout,o=r.width,l=r.dataKey,c=r.data,u=r.dataPointFormatter,d=r.xAxis,f=r.yAxis,h=mY(r,cY),p=qe(h,!1);this.props.direction==="x"&&d.type!=="number"&&as();var g=c.map(function(m){var v=u(m,l),y=v.x,b=v.y,x=v.value,k=v.errorVal;if(!k)return null;var S=[],w,_;if(Array.isArray(k)){var N=uY(k,2);w=N[0],_=N[1]}else w=_=k;if(a==="vertical"){var C=d.scale,T=b+i,$=T+o,R=T-o,L=C(x-w),I=C(x+_);S.push({x1:I,y1:$,x2:I,y2:R}),S.push({x1:L,y1:T,x2:I,y2:T}),S.push({x1:L,y1:$,x2:L,y2:R})}else if(a==="horizontal"){var z=f.scale,D=y+i,F=D-o,O=D+o,P=z(x-w),A=z(x+_);S.push({x1:F,y1:A,x2:O,y2:A}),S.push({x1:D,y1:P,x2:D,y2:A}),S.push({x1:F,y1:P,x2:O,y2:P})}return W.createElement(Yt,Gf({className:"recharts-errorBar",key:"bar-".concat(S.map(function(Y){return"".concat(Y.x1,"-").concat(Y.x2,"-").concat(Y.y1,"-").concat(Y.y2)}))},p),S.map(function(Y){return W.createElement("line",Gf({},Y,{key:"line-".concat(Y.x1,"-").concat(Y.x2,"-").concat(Y.y1,"-").concat(Y.y2)}))}))});return W.createElement(Yt,{className:"recharts-errorBars"},g)}}])}(W.Component);DO(Ep,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});DO(Ep,"displayName","ErrorBar");function Uc(e){"@babel/helpers - typeof";return Uc=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},Uc(e)}function Nk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Nk(Object(n),!0).forEach(function(r){_Y(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _Y(e,t,n){return t=NY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NY(e){var t=jY(e,"string");return Uc(t)=="symbol"?t:t+""}function jY(e,t){if(Uc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Uc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zO=function(t){var n=t.children,r=t.formattedGraphicalItems,i=t.legendWidth,a=t.legendContent,o=Wn(n,Ga);if(!o)return null;var l=Ga.defaultProps,c=l!==void 0?Sa(Sa({},l),o.props):{},u;return o.props&&o.props.payload?u=o.props&&o.props.payload:a==="children"?u=(r||[]).reduce(function(d,f){var h=f.item,p=f.props,g=p.sectors||p.data||[];return d.concat(g.map(function(m){return{type:o.props.iconType||h.props.legendType,value:m.name,color:m.fill,payload:m}}))},[]):u=(r||[]).map(function(d){var f=d.item,h=f.type.defaultProps,p=h!==void 0?Sa(Sa({},h),f.props):{},g=p.dataKey,m=p.name,v=p.legendType,y=p.hide;return{inactive:y,dataKey:g,type:c.iconType||v||"square",color:Jx(f),value:m||g,payload:p}}),Sa(Sa(Sa({},c),Ga.getWithHeight(o,i)),{},{payload:u,item:o})};function Wc(e){"@babel/helpers - typeof";return Wc=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},Wc(e)}function jk(e){return OY(e)||CY(e)||TY(e)||AY()}function AY(){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 TY(e,t){if(e){if(typeof e=="string")return uv(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 uv(e,t)}}function CY(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function OY(e){if(Array.isArray(e))return uv(e)}function uv(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 Ak(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function At(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ak(Object(n),!0).forEach(function(r){co(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ak(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function co(e,t,n){return t=PY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PY(e){var t=MY(e,"string");return Wc(t)=="symbol"?t:t+""}function MY(e,t){if(Wc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Wc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kr(e,t,n){return Ve(e)||Ve(t)?n:Ut(t)?or(e,t,n):$e(t)?t(e):n}function nc(e,t,n,r){var i=CV(e,function(l){return Kr(l,t)});if(n==="number"){var a=i.filter(function(l){return ue(l)||parseFloat(l)});return a.length?[wp(a),xp(a)]:[1/0,-1/0]}var o=r?i.filter(function(l){return!Ve(l)}):i;return o.map(function(l){return Ut(l)||l instanceof Date?l:""})}var RY=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=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(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var c=a.range,u=0;u<l;u++){var d=u>0?i[u-1].coordinate:i[l-1].coordinate,f=i[u].coordinate,h=u>=l-1?i[0].coordinate:i[u+1].coordinate,p=void 0;if(Sr(f-d)!==Sr(h-f)){var g=[];if(Sr(h-f)===Sr(c[1]-c[0])){p=h;var m=f+c[1]-c[0];g[0]=Math.min(m,(m+d)/2),g[1]=Math.max(m,(m+d)/2)}else{p=d;var v=h+c[1]-c[0];g[0]=Math.min(f,(v+f)/2),g[1]=Math.max(f,(v+f)/2)}var y=[Math.min(f,(p+f)/2),Math.max(f,(p+f)/2)];if(t>y[0]&&t<=y[1]||t>=g[0]&&t<=g[1]){o=i[u].index;break}}else{var b=Math.min(d,h),x=Math.max(d,h);if(t>(b+f)/2&&t<=(x+f)/2){o=i[u].index;break}}}else for(var k=0;k<l;k++)if(k===0&&t<=(r[k].coordinate+r[k+1].coordinate)/2||k>0&&k<l-1&&t>(r[k].coordinate+r[k-1].coordinate)/2&&t<=(r[k].coordinate+r[k+1].coordinate)/2||k===l-1&&t>(r[k].coordinate+r[k-1].coordinate)/2){o=r[k].index;break}return o},Jx=function(t){var n,r=t,i=r.type.displayName,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?At(At({},t.type.defaultProps),t.props):t.props,o=a.stroke,l=a.fill,c;switch(i){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},IY=function(t){var n=t.barSize,r=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},l=Object.keys(a),c=0,u=l.length;c<u;c++)for(var d=a[l[c]].stackGroups,f=Object.keys(d),h=0,p=f.length;h<p;h++){var g=d[f[h]],m=g.items,v=g.cateAxisId,y=m.filter(function(_){return ui(_.type).indexOf("Bar")>=0});if(y&&y.length){var b=y[0].type.defaultProps,x=b!==void 0?At(At({},b),y[0].props):y[0].props,k=x.barSize,S=x[v];o[S]||(o[S]=[]);var w=Ve(k)?n:k;o[S].push({item:y[0],stackList:y.slice(1),barSize:Ve(w)?void 0:rs(w,r,0)})}}return o},$Y=function(t){var n=t.barGap,r=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,l=t.maxBarSize,c=o.length;if(c<1)return null;var u=rs(n,i,0,!0),d,f=[];if(o[0].barSize===+o[0].barSize){var h=!1,p=i/c,g=o.reduce(function(k,S){return k+S.barSize||0},0);g+=(c-1)*u,g>=i&&(g-=(c-1)*u,u=0),g>=i&&p>0&&(h=!0,p*=.9,g=c*p);var m=(i-g)/2>>0,v={offset:m-u,size:0};d=o.reduce(function(k,S){var w={item:S.item,position:{offset:v.offset+v.size+u,size:h?p:S.barSize}},_=[].concat(jk(k),[w]);return v=_[_.length-1].position,S.stackList&&S.stackList.length&&S.stackList.forEach(function(N){_.push({item:N,position:v})}),_},f)}else{var y=rs(r,i,0,!0);i-2*y-(c-1)*u<=0&&(u=0);var b=(i-2*y-(c-1)*u)/c;b>1&&(b>>=0);var x=l===+l?Math.min(b,l):b;d=o.reduce(function(k,S,w){var _=[].concat(jk(k),[{item:S.item,position:{offset:y+(b+u)*w+(b-x)/2,size:x}}]);return S.stackList&&S.stackList.length&&S.stackList.forEach(function(N){_.push({item:N,position:_[_.length-1].position})}),_},f)}return d},LY=function(t,n,r,i){var a=r.children,o=r.width,l=r.margin,c=o-(l.left||0)-(l.right||0),u=zO({children:a,legendWidth:c});if(u){var d=i||{},f=d.width,h=d.height,p=u.align,g=u.verticalAlign,m=u.layout;if((m==="vertical"||m==="horizontal"&&g==="middle")&&p!=="center"&&ue(t[p]))return At(At({},t),{},co({},p,t[p]+(f||0)));if((m==="horizontal"||m==="vertical"&&p==="center")&&g!=="middle"&&ue(t[g]))return At(At({},t),{},co({},g,t[g]+(h||0)))}return t},DY=function(t,n,r){return Ve(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},FO=function(t,n,r,i,a){var o=n.props.children,l=_r(o,Ep).filter(function(u){return DY(i,a,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=Kr(d,r);if(Ve(f))return u;var h=Array.isArray(f)?[wp(f),xp(f)]:[f,f],p=c.reduce(function(g,m){var v=Kr(d,m,0),y=h[0]-Math.abs(Array.isArray(v)?v[0]:v),b=h[1]+Math.abs(Array.isArray(v)?v[1]:v);return[Math.min(y,g[0]),Math.max(b,g[1])]},[1/0,-1/0]);return[Math.min(p[0],u[0]),Math.max(p[1],u[1])]},[1/0,-1/0])}return null},BY=function(t,n,r,i,a){var o=n.map(function(l){return FO(t,l,r,a,i)}).filter(function(l){return!Ve(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},UO=function(t,n,r,i,a){var o=n.map(function(c){var u=c.props.dataKey;return r==="number"&&u&&FO(t,c,u,i)||nc(t,u,r,a)});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},[])},WO=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},HO=function(t,n,r,i){if(i)return t.map(function(c){return c.coordinate});var a,o,l=t.map(function(c){return c.coordinate===n&&(a=!0),c.coordinate===r&&(o=!0),c.coordinate});return a||l.push(n),o||l.push(r),l},li=function(t,n,r){if(!t)return null;var i=t.scale,a=t.duplicateDomain,o=t.type,l=t.range,c=t.realScaleType==="scaleBand"?i.bandwidth()/2:2,u=(n||r)&&o==="category"&&i.bandwidth?i.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?Sr(l[0]-l[1])*2*u:u,n&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(f){var h=a?a.indexOf(f):f;return{coordinate:i(h)+u,value:f,offset:u}});return d.filter(function(f){return!bu(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,h){return{coordinate:i(f)+u,value:f,index:h,offset:u}}):i.ticks&&!r?i.ticks(t.tickCount).map(function(f){return{coordinate:i(f)+u,value:f,offset:u}}):i.domain().map(function(f,h){return{coordinate:i(f)+u,value:a?a[f]:f,index:h,offset:u}})},Um=new WeakMap,ld=function(t,n){if(typeof n!="function")return t;Um.has(t)||Um.set(t,new WeakMap);var r=Um.get(t);if(r.has(n))return r.get(n);var i=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},zY=function(t,n,r){var i=t.scale,a=t.type,o=t.layout,l=t.axisType;if(i==="auto")return o==="radial"&&l==="radiusAxis"?{scale:Ic(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:zf(),realScaleType:"linear"}:a==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:tc(),realScaleType:"point"}:a==="category"?{scale:Ic(),realScaleType:"band"}:{scale:zf(),realScaleType:"linear"};if(ns(i)){var c="scale".concat(op(i));return{scale:(wk[c]||tc)(),realScaleType:wk[c]?c:"point"}}return $e(i)?{scale:i}:{scale:tc(),realScaleType:"point"}},Tk=1e-4,FY=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,i=t.range(),a=Math.min(i[0],i[1])-Tk,o=Math.max(i[0],i[1])+Tk,l=t(n[0]),c=t(n[r-1]);(l<a||l>o||c<a||c>o)&&t.domain([n[0],n[r-1]])}},UY=function(t,n){if(!t)return null;for(var r=0,i=t.length;r<i;r++)if(t[r].item===n)return t[r].position;return null},WY=function(t,n){if(!n||n.length!==2||!ue(n[0])||!ue(n[1]))return t;var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]),a=[t[0],t[1]];return(!ue(t[0])||t[0]<r)&&(a[0]=r),(!ue(t[1])||t[1]>i)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]<r&&(a[1]=r),a},HY=function(t){var n=t.length;if(!(n<=0))for(var r=0,i=t[0].length;r<i;++r)for(var a=0,o=0,l=0;l<n;++l){var c=bu(t[l][r][1])?t[l][r][0]:t[l][r][1];c>=0?(t[l][r][0]=a,t[l][r][1]=a+c,a=t[l][r][1]):(t[l][r][0]=o,t[l][r][1]=o+c,o=t[l][r][1])}},GY=function(t){var n=t.length;if(!(n<=0))for(var r=0,i=t[0].length;r<i;++r)for(var a=0,o=0;o<n;++o){var l=bu(t[o][r][1])?t[o][r][0]:t[o][r][1];l>=0?(t[o][r][0]=a,t[o][r][1]=a+l,a=t[o][r][1]):(t[o][r][0]=0,t[o][r][1]=0)}},qY={sign:HY,expand:o6,none:xo,silhouette:l6,wiggle:c6,positive:GY},KY=function(t,n,r){var i=n.map(function(l){return l.props.dataKey}),a=qY[r],o=s6().keys(i).value(function(l,c){return+Kr(l,c,0)}).order(Iy).offset(a);return o(t)},VY=function(t,n,r,i,a,o){if(!t)return null;var l=o?n.reverse():n,c={},u=l.reduce(function(f,h){var p,g=(p=h.type)!==null&&p!==void 0&&p.defaultProps?At(At({},h.type.defaultProps),h.props):h.props,m=g.stackId,v=g.hide;if(v)return f;var y=g[r],b=f[y]||{hasStack:!1,stackGroups:{}};if(Ut(m)){var x=b.stackGroups[m]||{numericAxisId:r,cateAxisId:i,items:[]};x.items.push(h),b.hasStack=!0,b.stackGroups[m]=x}else b.stackGroups[sp("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[h]};return At(At({},f),{},co({},y,b))},c),d={};return Object.keys(u).reduce(function(f,h){var p=u[h];if(p.hasStack){var g={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(m,v){var y=p.stackGroups[v];return At(At({},m),{},co({},v,{numericAxisId:r,cateAxisId:i,items:y.items,stackedData:KY(t,y.items,a)}))},g)}return At(At({},f),{},co({},h,p))},d)},YY=function(t,n){var r=n.realScaleType,i=n.type,a=n.tickCount,o=n.originalDomain,l=n.allowDecimals,c=r||n.scale;if(c!=="auto"&&c!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=sY(u,a,l);return t.domain([wp(d),xp(d)]),{niceTicks:d}}if(a&&i==="number"){var f=t.domain(),h=oY(f,a,l);return{niceTicks:h}}return null},Ck=function(t){var n=t.axis,r=t.ticks,i=t.offset,a=t.bandSize,o=t.entry,l=t.index;if(n.type==="category")return r[l]?r[l].coordinate+i:null;var c=Kr(o,n.dataKey,n.domain[l]);return Ve(c)?null:n.scale(c)-a/2+i},XY=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return i<=0&&a>=0?0:a<0?a:i}return r[0]},ZY=function(t,n){var r,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?At(At({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(Ut(a)){var o=n[a];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},QY=function(t){return t.reduce(function(n,r){return[wp(r.concat([n[0]]).filter(ue)),xp(r.concat([n[1]]).filter(ue))]},[1/0,-1/0])},GO=function(t,n,r){return Object.keys(t).reduce(function(i,a){var o=t[a],l=o.stackedData,c=l.reduce(function(u,d){var f=QY(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],i[0]),Math.max(c[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},Ok=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Pk=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,dv=function(t,n,r){if($e(t))return t(n,r);if(!Array.isArray(t))return n;var i=[];if(ue(t[0]))i[0]=r?t[0]:Math.min(t[0],n[0]);else if(Ok.test(t[0])){var a=+Ok.exec(t[0])[1];i[0]=n[0]-a}else $e(t[0])?i[0]=t[0](n[0]):i[0]=n[0];if(ue(t[1]))i[1]=r?t[1]:Math.max(t[1],n[1]);else if(Pk.test(t[1])){var o=+Pk.exec(t[1])[1];i[1]=n[1]+o}else $e(t[1])?i[1]=t[1](n[1]):i[1]=n[1];return i},Kf=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!r||i>0)return i}if(t&&n&&n.length>=2){for(var a=Nx(n,function(f){return f.coordinate}),o=1/0,l=1,c=a.length;l<c;l++){var u=a[l],d=a[l-1];o=Math.min((u.coordinate||0)-(d.coordinate||0),o)}return o===1/0?0:o}return r?void 0:0},Mk=function(t,n,r){return!t||!t.length||Xx(t,or(r,"type.defaultProps.domain"))?n:t},qO=function(t,n){var r=t.type.defaultProps?At(At({},t.type.defaultProps),t.props):t.props,i=r.dataKey,a=r.name,o=r.unit,l=r.formatter,c=r.tooltipType,u=r.chartType,d=r.hide;return At(At({},qe(t,!1)),{},{dataKey:i,unit:o,formatter:l,name:a||i,color:Jx(t),value:Kr(n,i),type:c,payload:n,chartType:u,hide:d})};function Hc(e){"@babel/helpers - typeof";return Hc=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},Hc(e)}function Rk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ik(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Rk(Object(n),!0).forEach(function(r){JY(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function JY(e,t,n){return t=eX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eX(e){var t=tX(e,"string");return Hc(t)=="symbol"?t:t+""}function tX(e,t){if(Hc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Hc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Vf=Math.PI/180,nX=function(t){return t*180/Math.PI},rn=function(t,n,r,i){return{x:t+Math.cos(-Vf*i)*r,y:n+Math.sin(-Vf*i)*r}},rX=function(t,n){var r=t.x,i=t.y,a=n.x,o=n.y;return Math.sqrt(Math.pow(r-a,2)+Math.pow(i-o,2))},iX=function(t,n){var r=t.x,i=t.y,a=n.cx,o=n.cy,l=rX({x:r,y:i},{x:a,y:o});if(l<=0)return{radius:l};var c=(r-a)/l,u=Math.acos(c);return i>o&&(u=2*Math.PI-u),{radius:l,angle:nX(u),angleInRadian:u}},aX=function(t){var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),a=Math.floor(r/360),o=Math.min(i,a);return{startAngle:n-o*360,endAngle:r-o*360}},sX=function(t,n){var r=n.startAngle,i=n.endAngle,a=Math.floor(r/360),o=Math.floor(i/360),l=Math.min(a,o);return t+l*360},$k=function(t,n){var r=t.x,i=t.y,a=iX({x:r,y:i},n),o=a.radius,l=a.angle,c=n.innerRadius,u=n.outerRadius;if(o<c||o>u)return!1;if(o===0)return!0;var d=aX(n),f=d.startAngle,h=d.endAngle,p=l,g;if(f<=h){for(;p>h;)p-=360;for(;p<f;)p+=360;g=p>=f&&p<=h}else{for(;p>f;)p-=360;for(;p<h;)p+=360;g=p>=h&&p<=f}return g?Ik(Ik({},n),{},{radius:o,angle:sX(p,n)}):null};function Gc(e){"@babel/helpers - typeof";return Gc=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},Gc(e)}var oX=["offset"];function lX(e){return fX(e)||dX(e)||uX(e)||cX()}function cX(){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 uX(e,t){if(e){if(typeof e=="string")return fv(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 fv(e,t)}}function dX(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fX(e){if(Array.isArray(e))return fv(e)}function fv(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 hX(e,t){if(e==null)return{};var n=pX(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function pX(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 Lk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Lk(Object(n),!0).forEach(function(r){mX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mX(e,t,n){return t=gX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gX(e){var t=yX(e,"string");return Gc(t)=="symbol"?t:t+""}function yX(e,t){if(Gc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Gc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qc(){return qc=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},qc.apply(this,arguments)}var vX=function(t){var n=t.value,r=t.formatter,i=Ve(t.children)?n:t.children;return $e(r)?r(i):i},bX=function(t,n){var r=Sr(n-t),i=Math.min(Math.abs(n-t),360);return r*i},xX=function(t,n,r){var i=t.position,a=t.viewBox,o=t.offset,l=t.className,c=a,u=c.cx,d=c.cy,f=c.innerRadius,h=c.outerRadius,p=c.startAngle,g=c.endAngle,m=c.clockWise,v=(f+h)/2,y=bX(p,g),b=y>=0?1:-1,x,k;i==="insideStart"?(x=p+b*o,k=m):i==="insideEnd"?(x=g-b*o,k=!m):i==="end"&&(x=g+b*o,k=m),k=y<=0?k:!k;var S=rn(u,d,v,x),w=rn(u,d,v,x+(k?1:-1)*359),_="M".concat(S.x,",").concat(S.y,`
93
- A`).concat(v,",").concat(v,",0,1,").concat(k?0:1,`,
94
- `).concat(w.x,",").concat(w.y),N=Ve(t.id)?sp("recharts-radial-line-"):t.id;return W.createElement("text",qc({},r,{dominantBaseline:"central",className:Ke("recharts-radial-bar-label",l)}),W.createElement("defs",null,W.createElement("path",{id:N,d:_})),W.createElement("textPath",{xlinkHref:"#".concat(N)},n))},wX=function(t){var n=t.viewBox,r=t.offset,i=t.position,a=n,o=a.cx,l=a.cy,c=a.innerRadius,u=a.outerRadius,d=a.startAngle,f=a.endAngle,h=(d+f)/2;if(i==="outside"){var p=rn(o,l,u+r,h),g=p.x,m=p.y;return{x:g,y:m,textAnchor:g>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var v=(c+u)/2,y=rn(o,l,v,h),b=y.x,x=y.y;return{x:b,y:x,textAnchor:"middle",verticalAnchor:"middle"}},SX=function(t){var n=t.viewBox,r=t.parentViewBox,i=t.offset,a=t.position,o=n,l=o.x,c=o.y,u=o.width,d=o.height,f=d>=0?1:-1,h=f*i,p=f>0?"end":"start",g=f>0?"start":"end",m=u>=0?1:-1,v=m*i,y=m>0?"end":"start",b=m>0?"start":"end";if(a==="top"){var x={x:l+u/2,y:c-f*i,textAnchor:"middle",verticalAnchor:p};return Bt(Bt({},x),r?{height:Math.max(c-r.y,0),width:u}:{})}if(a==="bottom"){var k={x:l+u/2,y:c+d+h,textAnchor:"middle",verticalAnchor:g};return Bt(Bt({},k),r?{height:Math.max(r.y+r.height-(c+d),0),width:u}:{})}if(a==="left"){var S={x:l-v,y:c+d/2,textAnchor:y,verticalAnchor:"middle"};return Bt(Bt({},S),r?{width:Math.max(S.x-r.x,0),height:d}:{})}if(a==="right"){var w={x:l+u+v,y:c+d/2,textAnchor:b,verticalAnchor:"middle"};return Bt(Bt({},w),r?{width:Math.max(r.x+r.width-w.x,0),height:d}:{})}var _=r?{width:u,height:d}:{};return a==="insideLeft"?Bt({x:l+v,y:c+d/2,textAnchor:b,verticalAnchor:"middle"},_):a==="insideRight"?Bt({x:l+u-v,y:c+d/2,textAnchor:y,verticalAnchor:"middle"},_):a==="insideTop"?Bt({x:l+u/2,y:c+h,textAnchor:"middle",verticalAnchor:g},_):a==="insideBottom"?Bt({x:l+u/2,y:c+d-h,textAnchor:"middle",verticalAnchor:p},_):a==="insideTopLeft"?Bt({x:l+v,y:c+h,textAnchor:b,verticalAnchor:g},_):a==="insideTopRight"?Bt({x:l+u-v,y:c+h,textAnchor:y,verticalAnchor:g},_):a==="insideBottomLeft"?Bt({x:l+v,y:c+d-h,textAnchor:b,verticalAnchor:p},_):a==="insideBottomRight"?Bt({x:l+u-v,y:c+d-h,textAnchor:y,verticalAnchor:p},_):Xo(a)&&(ue(a.x)||Da(a.x))&&(ue(a.y)||Da(a.y))?Bt({x:l+rs(a.x,u),y:c+rs(a.y,d),textAnchor:"end",verticalAnchor:"end"},_):Bt({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},_)},kX=function(t){return"cx"in t&&ue(t.cx)};function mn(e){var t=e.offset,n=t===void 0?5:t,r=hX(e,oX),i=Bt({offset:n},r),a=i.viewBox,o=i.position,l=i.value,c=i.children,u=i.content,d=i.className,f=d===void 0?"":d,h=i.textBreakAll;if(!a||Ve(l)&&Ve(c)&&!E.isValidElement(u)&&!$e(u))return null;if(E.isValidElement(u))return E.cloneElement(u,i);var p;if($e(u)){if(p=E.createElement(u,i),E.isValidElement(p))return p}else p=vX(i);var g=kX(a),m=qe(i,!0);if(g&&(o==="insideStart"||o==="insideEnd"||o==="end"))return xX(i,p,m);var v=g?wX(i):SX(i);return W.createElement(Pf,qc({className:Ke("recharts-label",f)},m,v,{breakAll:h}),p)}mn.displayName="Label";var KO=function(t){var n=t.cx,r=t.cy,i=t.angle,a=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,g=t.left,m=t.width,v=t.height,y=t.clockWise,b=t.labelViewBox;if(b)return b;if(ue(m)&&ue(v)){if(ue(f)&&ue(h))return{x:f,y:h,width:m,height:v};if(ue(p)&&ue(g))return{x:p,y:g,width:m,height:v}}return ue(f)&&ue(h)?{x:f,y:h,width:0,height:0}:ue(n)&&ue(r)?{cx:n,cy:r,startAngle:a||i||0,endAngle:o||i||0,innerRadius:u||0,outerRadius:d||c||l||0,clockWise:y}:t.viewBox?t.viewBox:{}},EX=function(t,n){return t?t===!0?W.createElement(mn,{key:"label-implicit",viewBox:n}):Ut(t)?W.createElement(mn,{key:"label-implicit",viewBox:n,value:t}):E.isValidElement(t)?t.type===mn?E.cloneElement(t,{key:"label-implicit",viewBox:n}):W.createElement(mn,{key:"label-implicit",content:t,viewBox:n}):$e(t)?W.createElement(mn,{key:"label-implicit",content:t,viewBox:n}):Xo(t)?W.createElement(mn,qc({viewBox:n},t,{key:"label-implicit"})):null:null},_X=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 i=t.children,a=KO(t),o=_r(i,mn).map(function(c,u){return E.cloneElement(c,{viewBox:n||a,key:"label-".concat(u)})});if(!r)return o;var l=EX(t.label,n||a);return[l].concat(lX(o))};mn.parseViewBox=KO;mn.renderCallByParent=_X;function NX(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var jX=NX;const AX=Xe(jX);function Kc(e){"@babel/helpers - typeof";return Kc=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},Kc(e)}var TX=["valueAccessor"],CX=["data","dataKey","clockWise","id","textBreakAll"];function OX(e){return IX(e)||RX(e)||MX(e)||PX()}function PX(){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 MX(e,t){if(e){if(typeof e=="string")return hv(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 hv(e,t)}}function RX(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function IX(e){if(Array.isArray(e))return hv(e)}function hv(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 Yf(){return Yf=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},Yf.apply(this,arguments)}function Dk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Dk(Object(n),!0).forEach(function(r){$X(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $X(e,t,n){return t=LX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LX(e){var t=DX(e,"string");return Kc(t)=="symbol"?t:t+""}function DX(e,t){if(Kc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Kc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zk(e,t){if(e==null)return{};var n=BX(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function BX(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 zX=function(t){return Array.isArray(t.value)?AX(t.value):t.value};function Va(e){var t=e.valueAccessor,n=t===void 0?zX:t,r=zk(e,TX),i=r.data,a=r.dataKey,o=r.clockWise,l=r.id,c=r.textBreakAll,u=zk(r,CX);return!i||!i.length?null:W.createElement(Yt,{className:"recharts-label-list"},i.map(function(d,f){var h=Ve(a)?n(d,f):Kr(d&&d.payload,a),p=Ve(l)?{}:{id:"".concat(l,"-").concat(f)};return W.createElement(mn,Yf({},qe(d,!0),u,p,{parentViewBox:d.parentViewBox,value:h,textBreakAll:c,viewBox:mn.parseViewBox(Ve(o)?d:Bk(Bk({},d),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}Va.displayName="LabelList";function FX(e,t){return e?e===!0?W.createElement(Va,{key:"labelList-implicit",data:t}):W.isValidElement(e)||$e(e)?W.createElement(Va,{key:"labelList-implicit",data:t,content:e}):Xo(e)?W.createElement(Va,Yf({data:t},e,{key:"labelList-implicit"})):null:null}function UX(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,i=_r(r,Va).map(function(o,l){return E.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!n)return i;var a=FX(e.label,t);return[a].concat(OX(i))}Va.renderCallByParent=UX;function Vc(e){"@babel/helpers - typeof";return Vc=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},Vc(e)}function pv(){return pv=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},pv.apply(this,arguments)}function Fk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Uk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fk(Object(n),!0).forEach(function(r){WX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WX(e,t,n){return t=HX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HX(e){var t=GX(e,"string");return Vc(t)=="symbol"?t:t+""}function GX(e,t){if(Vc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var qX=function(t,n){var r=Sr(n-t),i=Math.min(Math.abs(n-t),359.999);return r*i},cd=function(t){var n=t.cx,r=t.cy,i=t.radius,a=t.angle,o=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,d=c*(l?1:-1)+i,f=Math.asin(c/d)/Vf,h=u?a:a+o*f,p=rn(n,r,d,h),g=rn(n,r,i,h),m=u?a-o*f:a,v=rn(n,r,d*Math.cos(f*Vf),m);return{center:p,circleTangency:g,lineTangency:v,theta:f}},VO=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.startAngle,l=t.endAngle,c=qX(o,l),u=o+c,d=rn(n,r,a,o),f=rn(n,r,a,u),h="M ".concat(d.x,",").concat(d.y,`
96
- A `).concat(a,",").concat(a,`,0,
97
- `).concat(+(Math.abs(c)>180),",").concat(+(o>u),`,
98
- `).concat(f.x,",").concat(f.y,`
99
- `);if(i>0){var p=rn(n,r,i,o),g=rn(n,r,i,u);h+="L ".concat(g.x,",").concat(g.y,`
100
- A `).concat(i,",").concat(i,`,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},KX=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,f=Sr(d-u),h=cd({cx:n,cy:r,radius:a,angle:u,sign:f,cornerRadius:o,cornerIsExternal:c}),p=h.circleTangency,g=h.lineTangency,m=h.theta,v=cd({cx:n,cy:r,radius:a,angle:d,sign:-f,cornerRadius:o,cornerIsExternal:c}),y=v.circleTangency,b=v.lineTangency,x=v.theta,k=c?Math.abs(u-d):Math.abs(u-d)-m-x;if(k<0)return l?"M ".concat(g.x,",").concat(g.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
- `):VO({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:u,endAngle:d});var S="M ".concat(g.x,",").concat(g.y,`
106
- A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(p.x,",").concat(p.y,`
107
- A`).concat(a,",").concat(a,",0,").concat(+(k>180),",").concat(+(f<0),",").concat(y.x,",").concat(y.y,`
108
- A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(b.x,",").concat(b.y,`
109
- `);if(i>0){var w=cd({cx:n,cy:r,radius:i,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),_=w.circleTangency,N=w.lineTangency,C=w.theta,T=cd({cx:n,cy:r,radius:i,angle:d,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),$=T.circleTangency,R=T.lineTangency,L=T.theta,I=c?Math.abs(u-d):Math.abs(u-d)-C-L;if(I<0&&o===0)return"".concat(S,"L").concat(n,",").concat(r,"Z");S+="L".concat(R.x,",").concat(R.y,`
110
- A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat($.x,",").concat($.y,`
111
- A`).concat(i,",").concat(i,",0,").concat(+(I>180),",").concat(+(f>0),",").concat(_.x,",").concat(_.y,`
112
- A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(N.x,",").concat(N.y,"Z")}else S+="L".concat(n,",").concat(r,"Z");return S},VX={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},YO=function(t){var n=Uk(Uk({},VX),t),r=n.cx,i=n.cy,a=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<a||d===f)return null;var p=Ke("recharts-sector",h),g=o-a,m=rs(l,g,0,!0),v;return m>0&&Math.abs(d-f)<360?v=KX({cx:r,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(m,g/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):v=VO({cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:d,endAngle:f}),W.createElement("path",pv({},qe(n,!0),{className:p,d:v,role:"img"}))};function Yc(e){"@babel/helpers - typeof";return Yc=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},Yc(e)}function mv(){return mv=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},mv.apply(this,arguments)}function Wk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Hk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wk(Object(n),!0).forEach(function(r){YX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YX(e,t,n){return t=XX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XX(e){var t=ZX(e,"string");return Yc(t)=="symbol"?t:t+""}function ZX(e,t){if(Yc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Yc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Gk={curveBasisClosed:YF,curveBasisOpen:XF,curveBasis:VF,curveBumpX:RF,curveBumpY:IF,curveLinearClosed:ZF,curveLinear:cp,curveMonotoneX:QF,curveMonotoneY:JF,curveNatural:e6,curveStep:t6,curveStepAfter:r6,curveStepBefore:n6},ud=function(t){return t.x===+t.x&&t.y===+t.y},Pl=function(t){return t.x},Ml=function(t){return t.y},QX=function(t,n){if($e(t))return t;var r="curve".concat(op(t));return(r==="curveMonotone"||r==="curveBump")&&n?Gk["".concat(r).concat(n==="vertical"?"Y":"X")]:Gk[r]||cp},JX=function(t){var n=t.type,r=n===void 0?"linear":n,i=t.points,a=i===void 0?[]:i,o=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,d=QX(r,l),f=u?a.filter(function(m){return ud(m)}):a,h;if(Array.isArray(o)){var p=u?o.filter(function(m){return ud(m)}):o,g=f.map(function(m,v){return Hk(Hk({},m),{},{base:p[v]})});return l==="vertical"?h=ed().y(Ml).x1(Pl).x0(function(m){return m.base.x}):h=ed().x(Pl).y1(Ml).y0(function(m){return m.base.y}),h.defined(ud).curve(d),h(g)}return l==="vertical"&&ue(o)?h=ed().y(Ml).x1(Pl).x0(o):ue(o)?h=ed().x(Pl).y1(Ml).y0(o):h=ZT().x(Pl).y(Ml),h.defined(ud).curve(d),h(f)},qk=function(t){var n=t.className,r=t.points,i=t.path,a=t.pathRef;if((!r||!r.length)&&!i)return null;var o=r&&r.length?JX(t):i;return E.createElement("path",mv({},qe(t,!1),yf(t),{className:Ke("recharts-curve",n),d:o,ref:a}))},XO={exports:{}},eZ="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",tZ=eZ,nZ=tZ;function ZO(){}function QO(){}QO.resetWarningCache=ZO;var rZ=function(){function e(r,i,a,o,l,c){if(c!==nZ){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:QO,resetWarningCache:ZO};return n.PropTypes=n,n};XO.exports=rZ();var iZ=XO.exports;const Ye=Xe(iZ),{getOwnPropertyNames:aZ,getOwnPropertySymbols:sZ}=Object,{hasOwnProperty:oZ}=Object.prototype;function Wm(e,t){return function(r,i,a){return e(r,i,a)&&t(r,i,a)}}function dd(e){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i);const{cache:a}=i,o=a.get(n),l=a.get(r);if(o&&l)return o===r&&l===n;a.set(n,r),a.set(r,n);const c=e(n,r,i);return a.delete(n),a.delete(r),c}}function lZ(e){return e!=null?e[Symbol.toStringTag]:void 0}function Kk(e){return aZ(e).concat(sZ(e))}const cZ=Object.hasOwn||((e,t)=>oZ.call(e,t));function hs(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const uZ="__v",dZ="__o",fZ="_owner",{getOwnPropertyDescriptor:Vk,keys:Yk}=Object;function hZ(e,t){return e.byteLength===t.byteLength&&Xf(new Uint8Array(e),new Uint8Array(t))}function pZ(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 mZ(e,t){return e.byteLength===t.byteLength&&Xf(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function gZ(e,t){return hs(e.getTime(),t.getTime())}function yZ(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function vZ(e,t){return e===t}function Xk(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),a=e.entries();let o,l,c=0;for(;(o=a.next())&&!o.done;){const u=t.entries();let d=!1,f=0;for(;(l=u.next())&&!l.done;){if(i[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=i[f]=!0;break}f++}if(!d)return!1;c++}return!0}const bZ=hs;function xZ(e,t,n){const r=Yk(e);let i=r.length;if(Yk(t).length!==i)return!1;for(;i-- >0;)if(!JO(e,t,n,r[i]))return!1;return!0}function Rl(e,t,n){const r=Kk(e);let i=r.length;if(Kk(t).length!==i)return!1;let a,o,l;for(;i-- >0;)if(a=r[i],!JO(e,t,n,a)||(o=Vk(e,a),l=Vk(t,a),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function wZ(e,t){return hs(e.valueOf(),t.valueOf())}function SZ(e,t){return e.source===t.source&&e.flags===t.flags}function Zk(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),a=e.values();let o,l;for(;(o=a.next())&&!o.done;){const c=t.values();let u=!1,d=0;for(;(l=c.next())&&!l.done;){if(!i[d]&&n.equals(o.value,l.value,o.value,l.value,e,t,n)){u=i[d]=!0;break}d++}if(!u)return!1}return!0}function Xf(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 kZ(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 JO(e,t,n,r){return(r===fZ||r===dZ||r===uZ)&&(e.$$typeof||t.$$typeof)?!0:cZ(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const EZ="[object ArrayBuffer]",_Z="[object Arguments]",NZ="[object Boolean]",jZ="[object DataView]",AZ="[object Date]",TZ="[object Error]",CZ="[object Map]",OZ="[object Number]",PZ="[object Object]",MZ="[object RegExp]",RZ="[object Set]",IZ="[object String]",$Z={"[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},LZ="[object URL]",DZ=Object.prototype.toString;function BZ({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:l,areObjectsEqual:c,arePrimitiveWrappersEqual:u,areRegExpsEqual:d,areSetsEqual:f,areTypedArraysEqual:h,areUrlsEqual:p,unknownTagComparators:g}){return function(v,y,b){if(v===y)return!0;if(v==null||y==null)return!1;const x=typeof v;if(x!==typeof y)return!1;if(x!=="object")return x==="number"?l(v,y,b):x==="function"?a(v,y,b):!1;const k=v.constructor;if(k!==y.constructor)return!1;if(k===Object)return c(v,y,b);if(Array.isArray(v))return t(v,y,b);if(k===Date)return r(v,y,b);if(k===RegExp)return d(v,y,b);if(k===Map)return o(v,y,b);if(k===Set)return f(v,y,b);const S=DZ.call(v);if(S===AZ)return r(v,y,b);if(S===MZ)return d(v,y,b);if(S===CZ)return o(v,y,b);if(S===RZ)return f(v,y,b);if(S===PZ)return typeof v.then!="function"&&typeof y.then!="function"&&c(v,y,b);if(S===LZ)return p(v,y,b);if(S===TZ)return i(v,y,b);if(S===_Z)return c(v,y,b);if($Z[S])return h(v,y,b);if(S===EZ)return e(v,y,b);if(S===jZ)return n(v,y,b);if(S===NZ||S===OZ||S===IZ)return u(v,y,b);if(g){let w=g[S];if(!w){const _=lZ(v);_&&(w=g[_])}if(w)return w(v,y,b)}return!1}}function zZ({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:hZ,areArraysEqual:n?Rl:pZ,areDataViewsEqual:mZ,areDatesEqual:gZ,areErrorsEqual:yZ,areFunctionsEqual:vZ,areMapsEqual:n?Wm(Xk,Rl):Xk,areNumbersEqual:bZ,areObjectsEqual:n?Rl:xZ,arePrimitiveWrappersEqual:wZ,areRegExpsEqual:SZ,areSetsEqual:n?Wm(Zk,Rl):Zk,areTypedArraysEqual:n?Wm(Xf,Rl):Xf,areUrlsEqual:kZ,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const i=dd(r.areArraysEqual),a=dd(r.areMapsEqual),o=dd(r.areObjectsEqual),l=dd(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:l})}return r}function FZ(e){return function(t,n,r,i,a,o,l){return e(t,n,l)}}function UZ({circular:e,comparator:t,createState:n,equals:r,strict:i}){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:i})};if(e)return function(l,c){return t(l,c,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const a={cache:void 0,equals:r,meta:void 0,strict:i};return function(l,c){return t(l,c,a)}}const WZ=va();va({strict:!0});va({circular:!0});va({circular:!0,strict:!0});va({createInternalComparator:()=>hs});va({strict:!0,createInternalComparator:()=>hs});va({circular:!0,createInternalComparator:()=>hs});va({circular:!0,createInternalComparator:()=>hs,strict:!0});function va(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=zZ(e),o=BZ(a),l=n?n(o):FZ(o);return UZ({circular:t,comparator:o,createState:r,equals:l,strict:i})}function HZ(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function Qk(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(a){n<0&&(n=a),a-n>t?(e(a),n=-1):HZ(i)};requestAnimationFrame(r)}function gv(e){"@babel/helpers - typeof";return gv=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},gv(e)}function GZ(e){return YZ(e)||VZ(e)||KZ(e)||qZ()}function qZ(){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 KZ(e,t){if(e){if(typeof e=="string")return Jk(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 Jk(e,t)}}function Jk(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 VZ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function YZ(e){if(Array.isArray(e))return e}function XZ(){var e={},t=function(){return null},n=!1,r=function i(a){if(!n){if(Array.isArray(a)){if(!a.length)return;var o=a,l=GZ(o),c=l[0],u=l.slice(1);if(typeof c=="number"){Qk(i.bind(null,u),c);return}i(c),Qk(i.bind(null,u));return}gv(a)==="object"&&(e=a,t(e)),typeof a=="function"&&a()}};return{stop:function(){n=!0},start:function(a){n=!1,r(a)},subscribe:function(a){return t=a,function(){t=function(){return null}}}}}function Xc(e){"@babel/helpers - typeof";return Xc=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},Xc(e)}function eE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).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?eE(Object(n),!0).forEach(function(r){eP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eP(e,t,n){return t=ZZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZZ(e){var t=QZ(e,"string");return Xc(t)==="symbol"?t:String(t)}function QZ(e,t){if(Xc(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Xc(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var JZ=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,i){return r.filter(function(a){return i.includes(a)})})},eQ=function(t){return t},tQ=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},rc=function(t,n){return Object.keys(n).reduce(function(r,i){return tE(tE({},r),{},eP({},i,t(i,n[i])))},{})},nE=function(t,n,r){return t.map(function(i){return"".concat(tQ(i)," ").concat(n,"ms ").concat(r)}).join(",")};function nQ(e,t){return aQ(e)||iQ(e,t)||tP(e,t)||rQ()}function rQ(){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 iQ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function aQ(e){if(Array.isArray(e))return e}function sQ(e){return cQ(e)||lQ(e)||tP(e)||oQ()}function oQ(){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 tP(e,t){if(e){if(typeof e=="string")return yv(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 yv(e,t)}}function lQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function cQ(e){if(Array.isArray(e))return yv(e)}function yv(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 Zf=1e-4,nP=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},rP=function(t,n){return t.map(function(r,i){return r*Math.pow(n,i)}).reduce(function(r,i){return r+i})},rE=function(t,n){return function(r){var i=nP(t,n);return rP(i,r)}},uQ=function(t,n){return function(r){var i=nP(t,n),a=[].concat(sQ(i.map(function(o,l){return o*l}).slice(1)),[0]);return rP(a,r)}},iE=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0],a=n[1],o=n[2],l=n[3];if(n.length===1)switch(n[0]){case"linear":i=0,a=0,o=1,l=1;break;case"ease":i=.25,a=.1,o=.25,l=1;break;case"ease-in":i=.42,a=0,o=1,l=1;break;case"ease-out":i=.42,a=0,o=.58,l=1;break;case"ease-in-out":i=0,a=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(v){return parseFloat(v)}),d=nQ(u,4);i=d[0],a=d[1],o=d[2],l=d[3]}}}var f=rE(i,o),h=rE(a,l),p=uQ(i,o),g=function(y){return y>1?1:y<0?0:y},m=function(y){for(var b=y>1?1:y,x=b,k=0;k<8;++k){var S=f(x)-b,w=p(x);if(Math.abs(S-b)<Zf||w<Zf)return h(x);x=g(x-S/w)}return h(x)};return m.isStepper=!1,m},dQ=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,i=t.damping,a=i===void 0?8:i,o=t.dt,l=o===void 0?17:o,c=function(d,f,h){var p=-(d-f)*r,g=h*a,m=h+(p-g)*l/1e3,v=h*l/1e3+d;return Math.abs(v-f)<Zf&&Math.abs(m)<Zf?[f,0]:[v,m]};return c.isStepper=!0,c.dt=l,c},fQ=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(typeof i=="string")switch(i){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return iE(i);case"spring":return dQ();default:if(i.split("(")[0]==="cubic-bezier")return iE(i)}return typeof i=="function"?i:null};function Zc(e){"@babel/helpers - typeof";return Zc=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},Zc(e)}function aE(e){return mQ(e)||pQ(e)||iP(e)||hQ()}function hQ(){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 pQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function mQ(e){if(Array.isArray(e))return bv(e)}function sE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function tn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sE(Object(n),!0).forEach(function(r){vv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vv(e,t,n){return t=gQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gQ(e){var t=yQ(e,"string");return Zc(t)==="symbol"?t:String(t)}function yQ(e,t){if(Zc(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Zc(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vQ(e,t){return wQ(e)||xQ(e,t)||iP(e,t)||bQ()}function bQ(){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 iP(e,t){if(e){if(typeof e=="string")return bv(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 bv(e,t)}}function bv(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 xQ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function wQ(e){if(Array.isArray(e))return e}var Qf=function(t,n,r){return t+(n-t)*r},xv=function(t){var n=t.from,r=t.to;return n!==r},SQ=function e(t,n,r){var i=rc(function(a,o){if(xv(o)){var l=t(o.from,o.to,o.velocity),c=vQ(l,2),u=c[0],d=c[1];return tn(tn({},o),{},{from:u,velocity:d})}return o},n);return r<1?rc(function(a,o){return xv(o)?tn(tn({},o),{},{velocity:Qf(o.velocity,i[a].velocity,r),from:Qf(o.from,i[a].from,r)}):o},n):e(t,i,r-1)};const kQ=function(e,t,n,r,i){var a=JZ(e,t),o=a.reduce(function(v,y){return tn(tn({},v),{},vv({},y,[e[y],t[y]]))},{}),l=a.reduce(function(v,y){return tn(tn({},v),{},vv({},y,{from:e[y],velocity:0,to:t[y]}))},{}),c=-1,u,d,f=function(){return null},h=function(){return rc(function(y,b){return b.from},l)},p=function(){return!Object.values(l).filter(xv).length},g=function(y){u||(u=y);var b=y-u,x=b/n.dt;l=SQ(n,l,x),i(tn(tn(tn({},e),t),h())),u=y,p()||(c=requestAnimationFrame(f))},m=function(y){d||(d=y);var b=(y-d)/r,x=rc(function(S,w){return Qf.apply(void 0,aE(w).concat([n(b)]))},o);if(i(tn(tn(tn({},e),t),x)),b<1)c=requestAnimationFrame(f);else{var k=rc(function(S,w){return Qf.apply(void 0,aE(w).concat([n(1)]))},o);i(tn(tn(tn({},e),t),k))}};return f=n.isStepper?g:m,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(c)}}};function To(e){"@babel/helpers - typeof";return To=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},To(e)}var EQ=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function _Q(e,t){if(e==null)return{};var n=NQ(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function NQ(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function Hm(e){return CQ(e)||TQ(e)||AQ(e)||jQ()}function jQ(){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 AQ(e,t){if(e){if(typeof e=="string")return wv(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 wv(e,t)}}function TQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function CQ(e){if(Array.isArray(e))return wv(e)}function wv(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 oE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oE(Object(n),!0).forEach(function(r){Hl(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hl(e,t,n){return t=aP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PQ(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,aP(r.key),r)}}function MQ(e,t,n){return t&&PQ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function aP(e){var t=RQ(e,"string");return To(t)==="symbol"?t:String(t)}function RQ(e,t){if(To(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(To(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function IQ(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&&Sv(e,t)}function Sv(e,t){return Sv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Sv(e,t)}function $Q(e){var t=LQ();return function(){var r=Jf(e),i;if(t){var a=Jf(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return kv(this,i)}}function kv(e,t){if(t&&(To(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ev(e)}function Ev(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function LQ(){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 Jf(e){return Jf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Jf(e)}var ca=function(e){IQ(n,e);var t=$Q(n);function n(r,i){var a;OQ(this,n),a=t.call(this,r,i);var o=a.props,l=o.isActive,c=o.attributeName,u=o.from,d=o.to,f=o.steps,h=o.children,p=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(Ev(a)),a.changeStyle=a.changeStyle.bind(Ev(a)),!l||p<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:d}),kv(a);if(f&&f.length)a.state={style:f[0].style};else if(u){if(typeof h=="function")return a.state={style:u},kv(a);a.state={style:c?Hl({},c,u):u}}else a.state={style:{}};return a}return MQ(n,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,l=a.canBegin,c=a.attributeName,u=a.shouldReAnimate,d=a.to,f=a.from,h=this.state.style;if(l){if(!o){var p={style:c?Hl({},c,d):d};this.state&&h&&(c&&h[c]!==d||!c&&h!==d)&&this.setState(p);return}if(!(WZ(i.to,d)&&i.canBegin&&i.isActive)){var g=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=g||u?f:i.to;if(this.state&&h){var v={style:c?Hl({},c,m):m};(c&&h[c]!==m||!c&&h!==m)&&this.setState(v)}this.runAnimation(gr(gr({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,l=i.to,c=i.duration,u=i.easing,d=i.begin,f=i.onAnimationEnd,h=i.onAnimationStart,p=kQ(o,l,fQ(u),c,this.changeStyle),g=function(){a.stopJSAnimation=p()};this.manager.start([h,d,g,c,f])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,l=i.begin,c=i.onAnimationStart,u=o[0],d=u.style,f=u.duration,h=f===void 0?0:f,p=function(m,v,y){if(y===0)return m;var b=v.duration,x=v.easing,k=x===void 0?"ease":x,S=v.style,w=v.properties,_=v.onAnimationEnd,N=y>0?o[y-1]:v,C=w||Object.keys(S);if(typeof k=="function"||k==="spring")return[].concat(Hm(m),[a.runJSAnimation.bind(a,{from:N.style,to:S,duration:b,easing:k}),b]);var T=nE(C,b,k),$=gr(gr(gr({},N.style),S),{},{transition:T});return[].concat(Hm(m),[$,b,_]).filter(eQ)};return this.manager.start([c].concat(Hm(o.reduce(p,[d,Math.max(h,l)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=XZ());var a=i.begin,o=i.duration,l=i.attributeName,c=i.to,u=i.easing,d=i.onAnimationStart,f=i.onAnimationEnd,h=i.steps,p=i.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof u=="function"||typeof p=="function"||u==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var m=l?Hl({},l,c):c,v=nE(Object.keys(m),o,u);g.start([d,a,gr(gr({},m),{},{transition:v}),o,f])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var l=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var c=_Q(i,EQ),u=E.Children.count(a),d=this.state.style;if(typeof a=="function")return a(d);if(!l||u===0||o<=0)return a;var f=function(p){var g=p.props,m=g.style,v=m===void 0?{}:m,y=g.className,b=E.cloneElement(p,gr(gr({},c),{},{style:gr(gr({},v),d),className:y}));return b};return u===1?f(E.Children.only(a)):W.createElement("div",null,E.Children.map(a,function(h){return f(h)}))}}]),n}(E.PureComponent);ca.displayName="Animate";ca.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};ca.propTypes={from:Ye.oneOfType([Ye.object,Ye.string]),to:Ye.oneOfType([Ye.object,Ye.string]),attributeName:Ye.string,duration:Ye.number,begin:Ye.number,easing:Ye.oneOfType([Ye.string,Ye.func]),steps:Ye.arrayOf(Ye.shape({duration:Ye.number.isRequired,style:Ye.object.isRequired,easing:Ye.oneOfType([Ye.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Ye.func]),properties:Ye.arrayOf("string"),onAnimationEnd:Ye.func})),children:Ye.oneOfType([Ye.node,Ye.func]),isActive:Ye.bool,canBegin:Ye.bool,onAnimationEnd:Ye.func,shouldReAnimate:Ye.bool,onAnimationStart:Ye.func,onAnimationReStart:Ye.func};function Qc(e){"@babel/helpers - typeof";return Qc=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},Qc(e)}function eh(){return eh=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},eh.apply(this,arguments)}function DQ(e,t){return UQ(e)||FQ(e,t)||zQ(e,t)||BQ()}function BQ(){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 zQ(e,t){if(e){if(typeof e=="string")return lE(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 lE(e,t)}}function lE(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 FQ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function UQ(e){if(Array.isArray(e))return e}function cE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function uE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cE(Object(n),!0).forEach(function(r){WQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WQ(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=GQ(e,"string");return Qc(t)=="symbol"?t:t+""}function GQ(e,t){if(Qc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Qc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var dE=function(t,n,r,i,a){var o=Math.min(Math.abs(r)/2,Math.abs(i)/2),l=i>=0?1:-1,c=r>=0?1:-1,u=i>=0&&r>=0||i<0&&r<0?1:0,d;if(o>0&&a instanceof Array){for(var f=[0,0,0,0],h=0,p=4;h<p;h++)f[h]=a[h]>o?o:a[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+i-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+i)),d+="L ".concat(t+c*f[3],",").concat(n+i),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`,
122
- `).concat(t,",").concat(n+i-l*f[3])),d+="Z"}else if(o>0&&a===+a&&a>0){var g=Math.min(o,a);d="M ".concat(t,",").concat(n+l*g,`
123
- A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+c*g,",").concat(n,`
124
- L `).concat(t+r-c*g,",").concat(n,`
125
- A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+r,",").concat(n+l*g,`
126
- L `).concat(t+r,",").concat(n+i-l*g,`
127
- A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+r-c*g,",").concat(n+i,`
128
- L `).concat(t+c*g,",").concat(n+i,`
129
- A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t,",").concat(n+i-l*g," Z")}else d="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return d},qQ=function(t,n){if(!t||!n)return!1;var r=t.x,i=t.y,a=n.x,o=n.y,l=n.width,c=n.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(a,a+l),d=Math.max(a,a+l),f=Math.min(o,o+c),h=Math.max(o,o+c);return r>=u&&r<=d&&i>=f&&i<=h}return!1},KQ={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},e0=function(t){var n=uE(uE({},KQ),t),r=E.useRef(),i=E.useState(-1),a=DQ(i,2),o=a[0],l=a[1];E.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var k=r.current.getTotalLength();k&&l(k)}catch{}},[]);var c=n.x,u=n.y,d=n.width,f=n.height,h=n.radius,p=n.className,g=n.animationEasing,m=n.animationDuration,v=n.animationBegin,y=n.isAnimationActive,b=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var x=Ke("recharts-rectangle",p);return b?W.createElement(ca,{canBegin:o>0,from:{width:d,height:f,x:c,y:u},to:{width:d,height:f,x:c,y:u},duration:m,animationEasing:g,isActive:b},function(k){var S=k.width,w=k.height,_=k.x,N=k.y;return W.createElement(ca,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:m,isActive:y,easing:g},W.createElement("path",eh({},qe(n,!0),{className:x,d:dE(_,N,S,w,h),ref:r})))}):W.createElement("path",eh({},qe(n,!0),{className:x,d:dE(c,u,d,f,h)}))};function _v(){return _v=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},_v.apply(this,arguments)}var sP=function(t){var n=t.cx,r=t.cy,i=t.r,a=t.className,o=Ke("recharts-dot",a);return n===+n&&r===+r&&i===+i?E.createElement("circle",_v({},qe(t,!1),yf(t),{className:o,cx:n,cy:r,r:i})):null};function Jc(e){"@babel/helpers - typeof";return Jc=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},Jc(e)}var VQ=["x","y","top","left","width","height","className"];function Nv(){return Nv=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},Nv.apply(this,arguments)}function fE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function YQ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fE(Object(n),!0).forEach(function(r){XQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function XQ(e,t,n){return t=ZQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZQ(e){var t=QQ(e,"string");return Jc(t)=="symbol"?t:t+""}function QQ(e,t){if(Jc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Jc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function JQ(e,t){if(e==null)return{};var n=eJ(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function eJ(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 tJ=function(t,n,r,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(n,"h").concat(r)},nJ=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,a=i===void 0?0:i,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,g=t.className,m=JQ(t,VQ),v=YQ({x:r,y:a,top:l,left:u,width:f,height:p},m);return!ue(r)||!ue(a)||!ue(f)||!ue(p)||!ue(l)||!ue(u)?null:W.createElement("path",Nv({},qe(v,!0),{className:Ke("recharts-cross",g),d:tJ(r,a,f,p,l,u)}))},rJ=wC,iJ=rJ(Object.getPrototypeOf,Object),aJ=iJ,sJ=Si,oJ=aJ,lJ=ki,cJ="[object Object]",uJ=Function.prototype,dJ=Object.prototype,oP=uJ.toString,fJ=dJ.hasOwnProperty,hJ=oP.call(Object);function pJ(e){if(!lJ(e)||sJ(e)!=cJ)return!1;var t=oJ(e);if(t===null)return!0;var n=fJ.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&oP.call(n)==hJ}var mJ=pJ;const gJ=Xe(mJ);var yJ=Si,vJ=ki,bJ="[object Boolean]";function xJ(e){return e===!0||e===!1||vJ(e)&&yJ(e)==bJ}var wJ=xJ;const SJ=Xe(wJ);function eu(e){"@babel/helpers - typeof";return eu=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},eu(e)}function th(){return th=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},th.apply(this,arguments)}function kJ(e,t){return jJ(e)||NJ(e,t)||_J(e,t)||EJ()}function EJ(){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 _J(e,t){if(e){if(typeof e=="string")return hE(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 hE(e,t)}}function hE(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 NJ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function jJ(e){if(Array.isArray(e))return e}function pE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function mE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pE(Object(n),!0).forEach(function(r){AJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function AJ(e,t,n){return t=TJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TJ(e){var t=CJ(e,"string");return eu(t)=="symbol"?t:t+""}function CJ(e,t){if(eu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(eu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gE=function(t,n,r,i,a){var o=r-i,l;return l="M ".concat(t,",").concat(n),l+="L ".concat(t+r,",").concat(n),l+="L ".concat(t+r-o/2,",").concat(n+a),l+="L ".concat(t+r-o/2-i,",").concat(n+a),l+="L ".concat(t,",").concat(n," Z"),l},OJ={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},PJ=function(t){var n=mE(mE({},OJ),t),r=E.useRef(),i=E.useState(-1),a=kJ(i,2),o=a[0],l=a[1];E.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var x=r.current.getTotalLength();x&&l(x)}catch{}},[]);var c=n.x,u=n.y,d=n.upperWidth,f=n.lowerWidth,h=n.height,p=n.className,g=n.animationEasing,m=n.animationDuration,v=n.animationBegin,y=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||h!==+h||d===0&&f===0||h===0)return null;var b=Ke("recharts-trapezoid",p);return y?W.createElement(ca,{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:m,animationEasing:g,isActive:y},function(x){var k=x.upperWidth,S=x.lowerWidth,w=x.height,_=x.x,N=x.y;return W.createElement(ca,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:m,easing:g},W.createElement("path",th({},qe(n,!0),{className:b,d:gE(_,N,k,S,w),ref:r})))}):W.createElement("g",null,W.createElement("path",th({},qe(n,!0),{className:b,d:gE(c,u,d,f,h)})))},MJ=["option","shapeType","propTransformer","activeClassName","isActive"];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)}function RJ(e,t){if(e==null)return{};var n=IJ(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function IJ(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 yE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function nh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yE(Object(n),!0).forEach(function(r){$J(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $J(e,t,n){return t=LJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LJ(e){var t=DJ(e,"string");return tu(t)=="symbol"?t:t+""}function DJ(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 BJ(e,t){return nh(nh({},t),e)}function zJ(e,t){return e==="symbols"}function vE(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return W.createElement(e0,n);case"trapezoid":return W.createElement(PJ,n);case"sector":return W.createElement(YO,n);case"symbols":if(zJ(t))return W.createElement(vx,n);break;default:return null}}function FJ(e){return E.isValidElement(e)?e.props:e}function UJ(e){var t=e.option,n=e.shapeType,r=e.propTransformer,i=r===void 0?BJ:r,a=e.activeClassName,o=a===void 0?"recharts-active-shape":a,l=e.isActive,c=RJ(e,MJ),u;if(E.isValidElement(t))u=E.cloneElement(t,nh(nh({},c),FJ(t)));else if($e(t))u=t(c);else if(gJ(t)&&!SJ(t)){var d=i(t,c);u=W.createElement(vE,{shapeType:n,elementProps:d})}else{var f=c;u=W.createElement(vE,{shapeType:n,elementProps:f})}return l?W.createElement(Yt,{className:o},u):u}function _p(e,t){return t!=null&&"trapezoids"in e.props}function Np(e,t){return t!=null&&"sectors"in e.props}function nu(e,t){return t!=null&&"points"in e.props}function WJ(e,t){var n,r,i=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,a=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return i&&a}function HJ(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function GJ(e,t){var n=e.x===t.x,r=e.y===t.y,i=e.z===t.z;return n&&r&&i}function qJ(e,t){var n;return _p(e,t)?n=WJ:Np(e,t)?n=HJ:nu(e,t)&&(n=GJ),n}function KJ(e,t){var n;return _p(e,t)?n="trapezoids":Np(e,t)?n="sectors":nu(e,t)&&(n="points"),n}function VJ(e,t){if(_p(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(Np(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 nu(e,t)?t.payload:{}}function YJ(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,i=KJ(n,t),a=VJ(n,t),o=r.filter(function(c,u){var d=Xx(a,c),f=n.props[i].filter(function(g){var m=qJ(n,t);return m(g,t)}),h=n.props[i].indexOf(f[f.length-1]),p=u===h;return d&&p}),l=r.indexOf(o[o.length-1]);return l}var XJ=Math.ceil,ZJ=Math.max;function QJ(e,t,n,r){for(var i=-1,a=ZJ(XJ((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}var JJ=QJ,eee=zC,bE=1/0,tee=17976931348623157e292;function nee(e){if(!e)return e===0?e:0;if(e=eee(e),e===bE||e===-bE){var t=e<0?-1:1;return t*tee}return e===e?e:0}var lP=nee,ree=JJ,iee=hp,Gm=lP;function aee(e){return function(t,n,r){return r&&typeof r!="number"&&iee(t,n,r)&&(n=r=void 0),t=Gm(t),n===void 0?(n=t,t=0):n=Gm(n),r=r===void 0?t<n?1:-1:Gm(r),ree(t,n,r,e)}}var see=aee,oee=see,lee=oee(),cee=lee;const rh=Xe(cee);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 xE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xE(Object(n),!0).forEach(function(r){cP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cP(e,t,n){return t=uee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uee(e){var t=dee(e,"string");return ru(t)=="symbol"?t:t+""}function dee(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 fee=["Webkit","Moz","O","ms"],hee=function(t,n){var r=t.replace(/(\w)/,function(a){return a.toUpperCase()}),i=fee.reduce(function(a,o){return wE(wE({},a),{},cP({},o+r,n))},{});return i[t]=n,i};function Co(e){"@babel/helpers - typeof";return Co=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},Co(e)}function ih(){return ih=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},ih.apply(this,arguments)}function SE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function qm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SE(Object(n),!0).forEach(function(r){Fn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kE(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,dP(r.key),r)}}function mee(e,t,n){return t&&kE(e.prototype,t),n&&kE(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function gee(e,t,n){return t=ah(t),yee(e,uP()?Reflect.construct(t,n||[],ah(e).constructor):t.apply(e,n))}function yee(e,t){if(t&&(Co(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vee(e)}function vee(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function uP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(uP=function(){return!!e})()}function ah(e){return ah=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ah(e)}function bee(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&&jv(e,t)}function jv(e,t){return jv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},jv(e,t)}function Fn(e,t,n){return t=dP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dP(e){var t=xee(e,"string");return Co(t)=="symbol"?t:t+""}function xee(e,t){if(Co(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Co(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var wee=function(t){var n=t.data,r=t.startIndex,i=t.endIndex,a=t.x,o=t.width,l=t.travellerWidth;if(!n||!n.length)return{};var c=n.length,u=tc().domain(rh(0,c)).range([a,a+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(i),scale:u,scaleValues:d}},EE=function(t){return t.changedTouches&&!!t.changedTouches.length},Oo=function(e){function t(n){var r;return pee(this,t),r=gee(this,t,[n]),Fn(r,"handleDrag",function(i){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(i):r.state.isSlideMoving&&r.handleSlideDrag(i)}),Fn(r,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&r.handleDrag(i.changedTouches[0])}),Fn(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,a=i.endIndex,o=i.onDragEnd,l=i.startIndex;o==null||o({endIndex:a,startIndex:l})}),r.detachDragEndListener()}),Fn(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Fn(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Fn(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Fn(r,"handleSlideDragStart",function(i){var a=EE(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return bee(t,e),mee(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,a=r.endX,o=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,d=u.length-1,f=Math.min(i,a),h=Math.max(i,a),p=t.getIndexInRange(o,f),g=t.getIndexInRange(o,h);return{startIndex:p-p%c,endIndex:g===d?d:g-g%c}}},{key:"getTextOfTick",value:function(r){var i=this.props,a=i.data,o=i.tickFormatter,l=i.dataKey,c=Kr(a[r],l,r);return $e(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 i=this.state,a=i.slideMoveStartX,o=i.startX,l=i.endX,c=this.props,u=c.x,d=c.width,f=c.travellerWidth,h=c.startIndex,p=c.endIndex,g=c.onChange,m=r.pageX-a;m>0?m=Math.min(m,u+d-f-l,u+d-f-o):m<0&&(m=Math.max(m,u-o,u-l));var v=this.getIndex({startX:o+m,endX:l+m});(v.startIndex!==h||v.endIndex!==p)&&g&&g(v),this.setState({startX:o+m,endX:l+m,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var a=EE(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,l=i.endX,c=i.startX,u=this.state[o],d=this.props,f=d.x,h=d.width,p=d.travellerWidth,g=d.onChange,m=d.gap,v=d.data,y={startX:this.state.startX,endX:this.state.endX},b=r.pageX-a;b>0?b=Math.min(b,f+h-p-u):b<0&&(b=Math.max(b,f-u)),y[o]=u+b;var x=this.getIndex(y),k=x.startIndex,S=x.endIndex,w=function(){var N=v.length-1;return o==="startX"&&(l>c?k%m===0:S%m===0)||l<c&&S===N||o==="endX"&&(l>c?S%m===0:k%m===0)||l>c&&S===N};this.setState(Fn(Fn({},o,u+b),"brushMoveStartX",r.pageX),function(){g&&w()&&g(x)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var a=this,o=this.state,l=o.scaleValues,c=o.startX,u=o.endX,d=this.state[i],f=l.indexOf(d);if(f!==-1){var h=f+r;if(!(h===-1||h>=l.length)){var p=l[h];i==="startX"&&p>=u||i==="endX"&&p<=c||this.setState(Fn({},i,p),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,a=r.y,o=r.width,l=r.height,c=r.fill,u=r.stroke;return W.createElement("rect",{stroke:u,fill:c,x:i,y:a,width:o,height:l})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,a=r.y,o=r.width,l=r.height,c=r.data,u=r.children,d=r.padding,f=E.Children.only(u);return f?W.cloneElement(f,{x:i,y:a,width:o,height:l,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,i){var a,o,l=this,c=this.props,u=c.y,d=c.travellerWidth,f=c.height,h=c.traveller,p=c.ariaLabel,g=c.data,m=c.startIndex,v=c.endIndex,y=Math.max(r,this.props.x),b=qm(qm({},qe(this.props,!1)),{},{x:y,y:u,width:d,height:f}),x=p||"Min value: ".concat((a=g[m])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=g[v])===null||o===void 0?void 0:o.name);return W.createElement(Yt,{tabIndex:0,role:"slider","aria-label":x,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(S){["ArrowLeft","ArrowRight"].includes(S.key)&&(S.preventDefault(),S.stopPropagation(),l.handleTravellerMoveKeyboard(S.key==="ArrowRight"?1:-1,i))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,b))}},{key:"renderSlide",value:function(r,i){var a=this.props,o=a.y,l=a.height,c=a.stroke,u=a.travellerWidth,d=Math.min(r,i)+u,f=Math.max(Math.abs(i-r)-u,0);return W.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,i=r.startIndex,a=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,g={pointerEvents:"none",fill:u};return W.createElement(Yt,{className:"recharts-brush-texts"},W.createElement(Pf,ih({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-p,y:o+l/2},g),this.getTextOfTick(i)),W.createElement(Pf,ih({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+c+p,y:o+l/2},g),this.getTextOfTick(a)))}},{key:"render",value:function(){var r=this.props,i=r.data,a=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,g=h.endX,m=h.isTextActive,v=h.isSlideMoving,y=h.isTravellerMoving,b=h.isTravellerFocused;if(!i||!i.length||!ue(l)||!ue(c)||!ue(u)||!ue(d)||u<=0||d<=0)return null;var x=Ke("recharts-brush",a),k=W.Children.count(o)===1,S=hee("userSelect","none");return W.createElement(Yt,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:S},this.renderBackground(),k&&this.renderPanorama(),this.renderSlide(p,g),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(g,"endX"),(m||v||y||b||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,a=r.y,o=r.width,l=r.height,c=r.stroke,u=Math.floor(a+l/2)-1;return W.createElement(W.Fragment,null,W.createElement("rect",{x:i,y:a,width:o,height:l,fill:c,stroke:"none"}),W.createElement("line",{x1:i+1,y1:u,x2:i+o-1,y2:u,fill:"none",stroke:"#fff"}),W.createElement("line",{x1:i+1,y1:u+2,x2:i+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var a;return W.isValidElement(r)?a=W.cloneElement(r,i):$e(r)?a=r(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(r,i){var a=r.data,o=r.width,l=r.x,c=r.travellerWidth,u=r.updateId,d=r.startIndex,f=r.endIndex;if(a!==i.prevData||u!==i.prevUpdateId)return qm({prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},a&&a.length?wee({data:a,width:o,x:l,travellerWidth:c,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||l!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([l,l+o-c]);var h=i.scale.domain().map(function(p){return i.scale(p)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(r,i){for(var a=r.length,o=0,l=a-1;l-o>1;){var c=Math.floor((o+l)/2);r[c]>i?l=c:o=c}return i>=r[l]?l:o}}])}(E.PureComponent);Fn(Oo,"displayName","Brush");Fn(Oo,"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 See=_x;function kee(e,t){var n;return See(e,function(r,i,a){return n=t(r,i,a),!n}),!!n}var Eee=kee,_ee=hC,Nee=ma,jee=Eee,Aee=Dn,Tee=hp;function Cee(e,t,n){var r=Aee(e)?_ee:jee;return n&&Tee(e,t,n)&&(t=void 0),r(e,Nee(t))}var Oee=Cee;const Pee=Xe(Oee);var Gr=function(t,n){var r=t.alwaysShow,i=t.ifOverflow;return r&&(i="extendDomain"),i===n},_E=IC;function Mee(e,t,n){t=="__proto__"&&_E?_E(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Ree=Mee,Iee=Ree,$ee=MC,Lee=ma;function Dee(e,t){var n={};return t=Lee(t),$ee(e,function(r,i,a){Iee(n,i,t(r,i,a))}),n}var Bee=Dee;const zee=Xe(Bee);function Fee(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 Uee=Fee,Wee=_x;function Hee(e,t){var n=!0;return Wee(e,function(r,i,a){return n=!!t(r,i,a),n}),n}var Gee=Hee,qee=Uee,Kee=Gee,Vee=ma,Yee=Dn,Xee=hp;function Zee(e,t,n){var r=Yee(e)?qee:Kee;return n&&Xee(e,t,n)&&(t=void 0),r(e,Vee(t))}var Qee=Zee;const fP=Xe(Qee);var Jee=["x","y"];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 Av(){return Av=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},Av.apply(this,arguments)}function NE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Il(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NE(Object(n),!0).forEach(function(r){ete(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ete(e,t,n){return t=tte(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tte(e){var t=nte(e,"string");return iu(t)=="symbol"?t:t+""}function nte(e,t){if(iu(e)!="object"||!e)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)}function rte(e,t){if(e==null)return{};var n=ite(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ite(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 ate(e,t){var n=e.x,r=e.y,i=rte(e,Jee),a="".concat(n),o=parseInt(a,10),l="".concat(r),c=parseInt(l,10),u="".concat(t.height||i.height),d=parseInt(u,10),f="".concat(t.width||i.width),h=parseInt(f,10);return Il(Il(Il(Il(Il({},t),i),o?{x:o}:{}),c?{y:c}:{}),{},{height:d,width:h,name:t.name,radius:t.radius})}function jE(e){return W.createElement(UJ,Av({shapeType:"rectangle",propTransformer:ate,activeClassName:"recharts-active-bar"},e))}var ste=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof t=="number")return t;var a=ue(r)||x3(r);return a?t(r,i):(a||as(),n)}},ote=["value","background"],hP;function Po(e){"@babel/helpers - typeof";return Po=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},Po(e)}function lte(e,t){if(e==null)return{};var n=cte(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function cte(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 sh(){return sh=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},sh.apply(this,arguments)}function AE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).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?AE(Object(n),!0).forEach(function(r){Vi(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ute(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TE(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,mP(r.key),r)}}function dte(e,t,n){return t&&TE(e.prototype,t),n&&TE(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fte(e,t,n){return t=oh(t),hte(e,pP()?Reflect.construct(t,n||[],oh(e).constructor):t.apply(e,n))}function hte(e,t){if(t&&(Po(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pte(e)}function pte(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(pP=function(){return!!e})()}function oh(e){return oh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},oh(e)}function mte(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&&Tv(e,t)}function Tv(e,t){return Tv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Tv(e,t)}function Vi(e,t,n){return t=mP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mP(e){var t=gte(e,"string");return Po(t)=="symbol"?t:t+""}function gte(e,t){if(Po(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Po(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var fn=function(e){function t(){var n;ute(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=fte(this,t,[].concat(i)),Vi(n,"state",{isAnimationFinished:!1}),Vi(n,"id",sp("recharts-bar-")),Vi(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),Vi(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return mte(t,e),dte(t,[{key:"renderRectanglesStatically",value:function(r){var i=this,a=this.props,o=a.shape,l=a.dataKey,c=a.activeIndex,u=a.activeBar,d=qe(this.props,!1);return r&&r.map(function(f,h){var p=h===c,g=p?u:o,m=Pt(Pt(Pt({},d),f),{},{isActive:p,option:g,index:h,dataKey:l,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return W.createElement(Yt,sh({className:"recharts-bar-rectangle"},vf(i.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)}),W.createElement(jE,m))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,i=this.props,a=i.data,o=i.layout,l=i.isAnimationActive,c=i.animationBegin,u=i.animationDuration,d=i.animationEasing,f=i.animationId,h=this.state.prevData;return W.createElement(ca,{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 g=p.t,m=a.map(function(v,y){var b=h&&h[y];if(b){var x=As(b.x,v.x),k=As(b.y,v.y),S=As(b.width,v.width),w=As(b.height,v.height);return Pt(Pt({},v),{},{x:x(g),y:k(g),width:S(g),height:w(g)})}if(o==="horizontal"){var _=As(0,v.height),N=_(g);return Pt(Pt({},v),{},{y:v.y+v.height-N,height:N})}var C=As(0,v.width),T=C(g);return Pt(Pt({},v),{},{width:T})});return W.createElement(Yt,null,r.renderRectanglesStatically(m))})}},{key:"renderRectangles",value:function(){var r=this.props,i=r.data,a=r.isAnimationActive,o=this.state.prevData;return a&&i&&i.length&&(!o||!Xx(o,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var r=this,i=this.props,a=i.data,o=i.dataKey,l=i.activeIndex,c=qe(this.props.background,!1);return a.map(function(u,d){u.value;var f=u.background,h=lte(u,ote);if(!f)return null;var p=Pt(Pt(Pt(Pt(Pt({},h),{},{fill:"#eee"},f),c),vf(r.props,u,d)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:d,className:"recharts-bar-background-rectangle"});return W.createElement(jE,sh({key:"background-bar-".concat(d),option:r.props.background,isActive:d===l},p))})}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.data,l=a.xAxis,c=a.yAxis,u=a.layout,d=a.children,f=_r(d,Ep);if(!f)return null;var h=u==="vertical"?o[0].height/2:o[0].width/2,p=function(v,y){var b=Array.isArray(v.value)?v.value[1]:v.value;return{x:v.x,y:v.y,value:b,errorVal:Kr(v,y)}},g={clipPath:r?"url(#clipPath-".concat(i,")"):null};return W.createElement(Yt,g,f.map(function(m){return W.cloneElement(m,{key:"error-bar-".concat(i,"-").concat(m.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,offset:h,dataPointFormatter:p})}))}},{key:"render",value:function(){var r=this.props,i=r.hide,a=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,g=r.background,m=r.id;if(i||!a||!a.length)return null;var v=this.state.isAnimationFinished,y=Ke("recharts-bar",o),b=l&&l.allowDataOverflow,x=c&&c.allowDataOverflow,k=b||x,S=Ve(m)?this.id:m;return W.createElement(Yt,{className:y},b||x?W.createElement("defs",null,W.createElement("clipPath",{id:"clipPath-".concat(S)},W.createElement("rect",{x:b?u:u-f/2,y:x?d:d-h/2,width:b?f:f*2,height:x?h:h*2}))):null,W.createElement(Yt,{className:"recharts-bar-rectangles",clipPath:k?"url(#clipPath-".concat(S,")"):null},g?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(k,S),(!p||v)&&Va.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:i.curData}:r.data!==i.curData?{curData:r.data}:null}}])}(E.PureComponent);hP=fn;Vi(fn,"displayName","Bar");Vi(fn,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!wu.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Vi(fn,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,i=e.bandSize,a=e.xAxis,o=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,h=e.offset,p=UY(r,n);if(!p)return null;var g=t.layout,m=n.type.defaultProps,v=m!==void 0?Pt(Pt({},m),n.props):n.props,y=v.dataKey,b=v.children,x=v.minPointSize,k=g==="horizontal"?o:a,S=u?k.scale.domain():null,w=XY({numericAxis:k}),_=_r(b,Pc),N=f.map(function(C,T){var $,R,L,I,z,D;u?$=WY(u[d+T],S):($=Kr(C,y),Array.isArray($)||($=[w,$]));var F=ste(x,hP.defaultProps.minPointSize)($[1],T);if(g==="horizontal"){var O,P=[o.scale($[0]),o.scale($[1])],A=P[0],Y=P[1];R=Ck({axis:a,ticks:l,bandSize:i,offset:p.offset,entry:C,index:T}),L=(O=Y??A)!==null&&O!==void 0?O:void 0,I=p.size;var K=A-Y;if(z=Number.isNaN(K)?0:K,D={x:R,y:o.y,width:I,height:o.height},Math.abs(F)>0&&Math.abs(z)<Math.abs(F)){var M=Sr(z||F)*(Math.abs(F)-Math.abs(z));L-=M,z+=M}}else{var le=[a.scale($[0]),a.scale($[1])],be=le[0],me=le[1];if(R=be,L=Ck({axis:o,ticks:c,bandSize:i,offset:p.offset,entry:C,index:T}),I=me-be,z=p.size,D={x:a.x,y:L,width:a.width,height:z},Math.abs(F)>0&&Math.abs(I)<Math.abs(F)){var Pe=Sr(I||F)*(Math.abs(F)-Math.abs(I));I+=Pe}}return Pt(Pt(Pt({},C),{},{x:R,y:L,width:I,height:z,value:u?$:$[1],payload:C,background:D},_&&_[T]&&_[T].props),{},{tooltipPayload:[qO(n,C)],tooltipPosition:{x:R+I/2,y:L+z/2}})});return Pt({data:N,layout:g},h)});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 yte(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CE(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,gP(r.key),r)}}function vte(e,t,n){return t&&CE(e.prototype,t),n&&CE(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function OE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function br(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OE(Object(n),!0).forEach(function(r){jp(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jp(e,t,n){return t=gP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gP(e){var t=bte(e,"string");return au(t)=="symbol"?t:t+""}function bte(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 xte=function(t,n,r,i,a){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=!!Wn(u,fn);return d.reduce(function(p,g){var m=n[g],v=m.orientation,y=m.domain,b=m.padding,x=b===void 0?{}:b,k=m.mirror,S=m.reversed,w="".concat(v).concat(k?"Mirror":""),_,N,C,T,$;if(m.type==="number"&&(m.padding==="gap"||m.padding==="no-gap")){var R=y[1]-y[0],L=1/0,I=m.categoricalDomain.sort(k3);if(I.forEach(function(le,be){be>0&&(L=Math.min((le||0)-(I[be-1]||0),L))}),Number.isFinite(L)){var z=L/R,D=m.layout==="vertical"?r.height:r.width;if(m.padding==="gap"&&(_=z*D/2),m.padding==="no-gap"){var F=rs(t.barCategoryGap,z*D),O=z*D/2;_=O-F-(O-F)/D*F}}}i==="xAxis"?N=[r.left+(x.left||0)+(_||0),r.left+r.width-(x.right||0)-(_||0)]:i==="yAxis"?N=c==="horizontal"?[r.top+r.height-(x.bottom||0),r.top+(x.top||0)]:[r.top+(x.top||0)+(_||0),r.top+r.height-(x.bottom||0)-(_||0)]:N=m.range,S&&(N=[N[1],N[0]]);var P=zY(m,a,h),A=P.scale,Y=P.realScaleType;A.domain(y).range(N),FY(A);var K=YY(A,br(br({},m),{},{realScaleType:Y}));i==="xAxis"?($=v==="top"&&!k||v==="bottom"&&k,C=r.left,T=f[w]-$*m.height):i==="yAxis"&&($=v==="left"&&!k||v==="right"&&k,C=f[w]-$*m.width,T=r.top);var M=br(br(br({},m),K),{},{realScaleType:Y,x:C,y:T,scale:A,width:i==="xAxis"?r.width:m.width,height:i==="yAxis"?r.height:m.height});return M.bandSize=Kf(M,K),!m.hide&&i==="xAxis"?f[w]+=($?-1:1)*M.height:m.hide||(f[w]+=($?-1:1)*M.width),br(br({},p),{},jp({},g,M))},{})},yP=function(t,n){var r=t.x,i=t.y,a=n.x,o=n.y;return{x:Math.min(r,a),y:Math.min(i,o),width:Math.abs(a-r),height:Math.abs(o-i)}},wte=function(t){var n=t.x1,r=t.y1,i=t.x2,a=t.y2;return yP({x:n,y:r},{x:i,y:a})},vP=function(){function e(t){yte(this,e),this.scale=t}return vte(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]:{},i=r.bandAware,a=r.position;if(n!==void 0){if(a)switch(a){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(i){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(),i=r[0],a=r[r.length-1];return i<=a?n>=i&&n<=a:n>=a&&n<=i}}],[{key:"create",value:function(n){return new e(n)}}])}();jp(vP,"EPS",1e-4);var t0=function(t){var n=Object.keys(t).reduce(function(r,i){return br(br({},r),{},jp({},i,vP.create(t[i])))},{});return br(br({},n),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,l=a.position;return zee(i,function(c,u){return n[u].apply(c,{bandAware:o,position:l})})},isInRange:function(i){return fP(i,function(a,o){return n[o].isInRange(a)})}})};function Ste(e){return(e%180+180)%180}var kte=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Ste(i),o=a*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)},Ete=ma,_te=xu,Nte=dp;function jte(e){return function(t,n,r){var i=Object(t);if(!_te(t)){var a=Ete(n);t=Nte(t),n=function(l){return a(i[l],l,i)}}var o=e(t,n,r);return o>-1?i[a?t[o]:o]:void 0}}var Ate=jte,Tte=lP;function Cte(e){var t=Tte(e),n=t%1;return t===t?n?t-n:t:0}var Ote=Cte,Pte=jC,Mte=ma,Rte=Ote,Ite=Math.max;function $te(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:Rte(n);return i<0&&(i=Ite(r+i,0)),Pte(e,Mte(t),i)}var Lte=$te,Dte=Ate,Bte=Lte,zte=Dte(Bte),Fte=zte;const Ute=Xe(Fte);var Wte=Nz(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("")}),n0=E.createContext(void 0),r0=E.createContext(void 0),bP=E.createContext(void 0),xP=E.createContext({}),wP=E.createContext(void 0),SP=E.createContext(0),kP=E.createContext(0),PE=function(t){var n=t.state,r=n.xAxisMap,i=n.yAxisMap,a=n.offset,o=t.clipPathId,l=t.children,c=t.width,u=t.height,d=Wte(a);return W.createElement(n0.Provider,{value:r},W.createElement(r0.Provider,{value:i},W.createElement(xP.Provider,{value:a},W.createElement(bP.Provider,{value:d},W.createElement(wP.Provider,{value:o},W.createElement(SP.Provider,{value:u},W.createElement(kP.Provider,{value:c},l)))))))},Hte=function(){return E.useContext(wP)},EP=function(t){var n=E.useContext(n0);n==null&&as();var r=n[t];return r==null&&as(),r},Gte=function(){var t=E.useContext(n0);return Ui(t)},qte=function(){var t=E.useContext(r0),n=Ute(t,function(r){return fP(r.domain,Number.isFinite)});return n||Ui(t)},_P=function(t){var n=E.useContext(r0);n==null&&as();var r=n[t];return r==null&&as(),r},Kte=function(){var t=E.useContext(bP);return t},Vte=function(){return E.useContext(xP)},i0=function(){return E.useContext(kP)},a0=function(){return E.useContext(SP)};function Mo(e){"@babel/helpers - typeof";return Mo=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},Mo(e)}function Yte(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xte(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,jP(r.key),r)}}function Zte(e,t,n){return t&&Xte(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qte(e,t,n){return t=lh(t),Jte(e,NP()?Reflect.construct(t,n||[],lh(e).constructor):t.apply(e,n))}function Jte(e,t){if(t&&(Mo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ene(e)}function ene(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function NP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(NP=function(){return!!e})()}function lh(e){return lh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},lh(e)}function tne(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&&Cv(e,t)}function Cv(e,t){return Cv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Cv(e,t)}function ME(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function RE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ME(Object(n),!0).forEach(function(r){s0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ME(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function s0(e,t,n){return t=jP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jP(e){var t=nne(e,"string");return Mo(t)=="symbol"?t:t+""}function nne(e,t){if(Mo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Mo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function rne(e,t){return one(e)||sne(e,t)||ane(e,t)||ine()}function ine(){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 ane(e,t){if(e){if(typeof e=="string")return IE(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 IE(e,t)}}function IE(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 sne(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function one(e){if(Array.isArray(e))return e}function Ov(){return Ov=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},Ov.apply(this,arguments)}var lne=function(t,n){var r;return W.isValidElement(t)?r=W.cloneElement(t,n):$e(t)?r=t(n):r=W.createElement("line",Ov({},n,{className:"recharts-reference-line-line"})),r},cne=function(t,n,r,i,a,o,l,c,u){var d=a.x,f=a.y,h=a.width,p=a.height;if(r){var g=u.y,m=t.y.apply(g,{position:o});if(Gr(u,"discard")&&!t.y.isInRange(m))return null;var v=[{x:d+h,y:m},{x:d,y:m}];return c==="left"?v.reverse():v}if(n){var y=u.x,b=t.x.apply(y,{position:o});if(Gr(u,"discard")&&!t.x.isInRange(b))return null;var x=[{x:b,y:f+p},{x:b,y:f}];return l==="top"?x.reverse():x}if(i){var k=u.segment,S=k.map(function(w){return t.apply(w,{position:o})});return Gr(u,"discard")&&Pee(S,function(w){return!t.isInRange(w)})?null:S}return null};function une(e){var t=e.x,n=e.y,r=e.segment,i=e.xAxisId,a=e.yAxisId,o=e.shape,l=e.className,c=e.alwaysShow,u=Hte(),d=EP(i),f=_P(a),h=Kte();if(!u||!h)return null;di(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=t0({x:d.scale,y:f.scale}),g=Ut(t),m=Ut(n),v=r&&r.length===2,y=cne(p,g,m,v,h,e.position,d.orientation,f.orientation,e);if(!y)return null;var b=rne(y,2),x=b[0],k=x.x,S=x.y,w=b[1],_=w.x,N=w.y,C=Gr(e,"hidden")?"url(#".concat(u,")"):void 0,T=RE(RE({clipPath:C},qe(e,!0)),{},{x1:k,y1:S,x2:_,y2:N});return W.createElement(Yt,{className:Ke("recharts-reference-line",l)},lne(o,T),mn.renderCallByParent(e,wte({x1:k,y1:S,x2:_,y2:N})))}var o0=function(e){function t(){return Yte(this,t),Qte(this,t,arguments)}return tne(t,e),Zte(t,[{key:"render",value:function(){return W.createElement(une,this.props)}}])}(W.Component);s0(o0,"displayName","ReferenceLine");s0(o0,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function Pv(){return Pv=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},Pv.apply(this,arguments)}function Ro(e){"@babel/helpers - typeof";return Ro=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},Ro(e)}function $E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function LE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$E(Object(n),!0).forEach(function(r){Ap(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$E(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fne(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 hne(e,t,n){return t&&fne(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pne(e,t,n){return t=ch(t),mne(e,AP()?Reflect.construct(t,n||[],ch(e).constructor):t.apply(e,n))}function mne(e,t){if(t&&(Ro(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gne(e)}function gne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function AP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(AP=function(){return!!e})()}function ch(e){return ch=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ch(e)}function yne(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&&Mv(e,t)}function Mv(e,t){return Mv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Mv(e,t)}function Ap(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=vne(e,"string");return Ro(t)=="symbol"?t:t+""}function vne(e,t){if(Ro(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ro(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var bne=function(t){var n=t.x,r=t.y,i=t.xAxis,a=t.yAxis,o=t0({x:i.scale,y:a.scale}),l=o.apply({x:n,y:r},{bandAware:!0});return Gr(t,"discard")&&!o.isInRange(l)?null:l},Tp=function(e){function t(){return dne(this,t),pne(this,t,arguments)}return yne(t,e),hne(t,[{key:"render",value:function(){var r=this.props,i=r.x,a=r.y,o=r.r,l=r.alwaysShow,c=r.clipPathId,u=Ut(i),d=Ut(a);if(di(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var f=bne(this.props);if(!f)return null;var h=f.x,p=f.y,g=this.props,m=g.shape,v=g.className,y=Gr(this.props,"hidden")?"url(#".concat(c,")"):void 0,b=LE(LE({clipPath:y},qe(this.props,!0)),{},{cx:h,cy:p});return W.createElement(Yt,{className:Ke("recharts-reference-dot",v)},t.renderDot(m,b),mn.renderCallByParent(this.props,{x:h-o,y:p-o,width:2*o,height:2*o}))}}])}(W.Component);Ap(Tp,"displayName","ReferenceDot");Ap(Tp,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Ap(Tp,"renderDot",function(e,t){var n;return W.isValidElement(e)?n=W.cloneElement(e,t):$e(e)?n=e(t):n=W.createElement(sP,Pv({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function Rv(){return Rv=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},Rv.apply(this,arguments)}function Io(e){"@babel/helpers - typeof";return Io=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},Io(e)}function DE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function BE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DE(Object(n),!0).forEach(function(r){Cp(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wne(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,OP(r.key),r)}}function Sne(e,t,n){return t&&wne(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function kne(e,t,n){return t=uh(t),Ene(e,CP()?Reflect.construct(t,n||[],uh(e).constructor):t.apply(e,n))}function Ene(e,t){if(t&&(Io(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _ne(e)}function _ne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function CP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(CP=function(){return!!e})()}function uh(e){return uh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},uh(e)}function Nne(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&&Iv(e,t)}function Iv(e,t){return Iv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Iv(e,t)}function Cp(e,t,n){return t=OP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OP(e){var t=jne(e,"string");return Io(t)=="symbol"?t:t+""}function jne(e,t){if(Io(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Io(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ane=function(t,n,r,i,a){var o=a.x1,l=a.x2,c=a.y1,u=a.y2,d=a.xAxis,f=a.yAxis;if(!d||!f)return null;var h=t0({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},g={x:n?h.x.apply(l,{position:"end"}):h.x.rangeMax,y:i?h.y.apply(u,{position:"end"}):h.y.rangeMax};return Gr(a,"discard")&&(!h.isInRange(p)||!h.isInRange(g))?null:yP(p,g)},Op=function(e){function t(){return xne(this,t),kne(this,t,arguments)}return Nne(t,e),Sne(t,[{key:"render",value:function(){var r=this.props,i=r.x1,a=r.x2,o=r.y1,l=r.y2,c=r.className,u=r.alwaysShow,d=r.clipPathId;di(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=Ut(i),h=Ut(a),p=Ut(o),g=Ut(l),m=this.props.shape;if(!f&&!h&&!p&&!g&&!m)return null;var v=Ane(f,h,p,g,this.props);if(!v&&!m)return null;var y=Gr(this.props,"hidden")?"url(#".concat(d,")"):void 0;return W.createElement(Yt,{className:Ke("recharts-reference-area",c)},t.renderRect(m,BE(BE({clipPath:y},qe(this.props,!0)),v)),mn.renderCallByParent(this.props,v))}}])}(W.Component);Cp(Op,"displayName","ReferenceArea");Cp(Op,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});Cp(Op,"renderRect",function(e,t){var n;return W.isValidElement(e)?n=W.cloneElement(e,t):$e(e)?n=e(t):n=W.createElement(e0,Rv({},t,{className:"recharts-reference-area-rect"})),n});function PP(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],i=0;i<e.length;i+=t)r.push(e[i]);return r}function Tne(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return kte(r,n)}function Cne(e,t,n){var r=n==="width",i=e.x,a=e.y,o=e.width,l=e.height;return t===1?{start:r?i:a,end:r?i+o:a+l}:{start:r?i+o:a+l,end:r?i:a}}function dh(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function One(e,t){return PP(e,t+1)}function Pne(e,t,n,r,i){for(var a=(r||[]).slice(),o=t.start,l=t.end,c=0,u=1,d=o,f=function(){var g=r==null?void 0:r[c];if(g===void 0)return{v:PP(r,u)};var m=c,v,y=function(){return v===void 0&&(v=n(g,m)),v},b=g.coordinate,x=c===0||dh(e,b,y,d,l);x||(c=0,d=o,u+=1),x&&(d=b+e*(y()/2+i),c+=u)},h;u<=a.length;)if(h=f(),h)return h.v;return[]}function su(e){"@babel/helpers - typeof";return su=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},su(e)}function zE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).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?zE(Object(n),!0).forEach(function(r){Mne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mne(e,t,n){return t=Rne(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rne(e){var t=Ine(e,"string");return su(t)=="symbol"?t:t+""}function Ine(e,t){if(su(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(su(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $ne(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,l=t.start,c=t.end,u=function(h){var p=a[h],g,m=function(){return g===void 0&&(g=n(p,h)),g};if(h===o-1){var v=e*(p.coordinate+e*m()/2-c);a[h]=p=dn(dn({},p),{},{tickCoord:v>0?p.coordinate-v*e:p.coordinate})}else a[h]=p=dn(dn({},p),{},{tickCoord:p.coordinate});var y=dh(e,p.tickCoord,m,l,c);y&&(c=p.tickCoord-e*(m()/2+i),a[h]=dn(dn({},p),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return a}function Lne(e,t,n,r,i,a){var o=(r||[]).slice(),l=o.length,c=t.start,u=t.end;if(a){var d=r[l-1],f=n(d,l-1),h=e*(d.coordinate+e*f/2-u);o[l-1]=d=dn(dn({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate});var p=dh(e,d.tickCoord,function(){return f},c,u);p&&(u=d.tickCoord-e*(f/2+i),o[l-1]=dn(dn({},d),{},{isShow:!0}))}for(var g=a?l-1:l,m=function(b){var x=o[b],k,S=function(){return k===void 0&&(k=n(x,b)),k};if(b===0){var w=e*(x.coordinate-e*S()/2-c);o[b]=x=dn(dn({},x),{},{tickCoord:w<0?x.coordinate-w*e:x.coordinate})}else o[b]=x=dn(dn({},x),{},{tickCoord:x.coordinate});var _=dh(e,x.tickCoord,S,c,u);_&&(c=x.tickCoord+e*(S()/2+i),o[b]=dn(dn({},x),{},{isShow:!0}))},v=0;v<g;v++)m(v);return o}function l0(e,t,n){var r=e.tick,i=e.ticks,a=e.viewBox,o=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,d=e.unit,f=e.angle;if(!i||!i.length||!r)return[];if(ue(c)||wu.isSsr)return One(i,typeof c=="number"&&ue(c)?c:0);var h=[],p=l==="top"||l==="bottom"?"width":"height",g=d&&p==="width"?ec(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},m=function(x,k){var S=$e(u)?u(x.value,k):x.value;return p==="width"?Tne(ec(S,{fontSize:t,letterSpacing:n}),g,f):ec(S,{fontSize:t,letterSpacing:n})[p]},v=i.length>=2?Sr(i[1].coordinate-i[0].coordinate):1,y=Cne(a,v,p);return c==="equidistantPreserveStart"?Pne(v,y,m,i,o):(c==="preserveStart"||c==="preserveStartEnd"?h=Lne(v,y,m,i,o,c==="preserveStartEnd"):h=$ne(v,y,m,i,o),h.filter(function(b){return b.isShow}))}var Dne=["viewBox"],Bne=["viewBox"],zne=["ticks"];function $o(e){"@babel/helpers - typeof";return $o=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},$o(e)}function Qs(){return Qs=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},Qs.apply(this,arguments)}function FE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Dt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FE(Object(n),!0).forEach(function(r){c0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Km(e,t){if(e==null)return{};var n=Fne(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Fne(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 Une(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UE(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,RP(r.key),r)}}function Wne(e,t,n){return t&&UE(e.prototype,t),n&&UE(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Hne(e,t,n){return t=fh(t),Gne(e,MP()?Reflect.construct(t,n||[],fh(e).constructor):t.apply(e,n))}function Gne(e,t){if(t&&($o(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qne(e)}function qne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function MP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(MP=function(){return!!e})()}function fh(e){return fh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},fh(e)}function Kne(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&&$v(e,t)}function $v(e,t){return $v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},$v(e,t)}function c0(e,t,n){return t=RP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RP(e){var t=Vne(e,"string");return $o(t)=="symbol"?t:t+""}function Vne(e,t){if($o(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($o(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var sl=function(e){function t(n){var r;return Une(this,t),r=Hne(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return Kne(t,e),Wne(t,[{key:"shouldComponentUpdate",value:function(r,i){var a=r.viewBox,o=Km(r,Dne),l=this.props,c=l.viewBox,u=Km(l,Bne);return!oo(a,c)||!oo(o,u)||!oo(i,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var i=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var i=this.props,a=i.x,o=i.y,l=i.width,c=i.height,u=i.orientation,d=i.tickSize,f=i.mirror,h=i.tickMargin,p,g,m,v,y,b,x=f?-1:1,k=r.tickSize||d,S=ue(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":p=g=r.coordinate,v=o+ +!f*c,m=v-x*k,b=m-x*h,y=S;break;case"left":m=v=r.coordinate,g=a+ +!f*l,p=g-x*k,y=p-x*h,b=S;break;case"right":m=v=r.coordinate,g=a+ +f*l,p=g+x*k,y=p+x*h,b=S;break;default:p=g=r.coordinate,v=o+ +f*c,m=v+x*k,b=m+x*h,y=S;break}return{line:{x1:p,y1:m,x2:g,y2:v},tick:{x:y,y:b}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,i=r.orientation,a=r.mirror,o;switch(i){case"left":o=a?"start":"end";break;case"right":o=a?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,i=r.orientation,a=r.mirror,o="end";switch(i){case"left":case"right":o="middle";break;case"top":o=a?"start":"end";break;default:o=a?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.x,a=r.y,o=r.width,l=r.height,c=r.orientation,u=r.mirror,d=r.axisLine,f=Dt(Dt(Dt({},qe(this.props,!1)),qe(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var h=+(c==="top"&&!u||c==="bottom"&&u);f=Dt(Dt({},f),{},{x1:i,y1:a+h*l,x2:i+o,y2:a+h*l})}else{var p=+(c==="left"&&!u||c==="right"&&u);f=Dt(Dt({},f),{},{x1:i+p*o,y1:a,x2:i+p*o,y2:a+l})}return W.createElement("line",Qs({},f,{className:Ke("recharts-cartesian-axis-line",or(d,"className"))}))}},{key:"renderTicks",value:function(r,i,a){var o=this,l=this.props,c=l.tickLine,u=l.stroke,d=l.tick,f=l.tickFormatter,h=l.unit,p=l0(Dt(Dt({},this.props),{},{ticks:r}),i,a),g=this.getTickTextAnchor(),m=this.getTickVerticalAnchor(),v=qe(this.props,!1),y=qe(d,!1),b=Dt(Dt({},v),{},{fill:"none"},qe(c,!1)),x=p.map(function(k,S){var w=o.getTickLineCoord(k),_=w.line,N=w.tick,C=Dt(Dt(Dt(Dt({textAnchor:g,verticalAnchor:m},v),{},{stroke:"none",fill:u},y),N),{},{index:S,payload:k,visibleTicksCount:p.length,tickFormatter:f});return W.createElement(Yt,Qs({className:"recharts-cartesian-axis-tick",key:"tick-".concat(k.value,"-").concat(k.coordinate,"-").concat(k.tickCoord)},vf(o.props,k,S)),c&&W.createElement("line",Qs({},b,_,{className:Ke("recharts-cartesian-axis-tick-line",or(c,"className"))})),d&&t.renderTickItem(d,C,"".concat($e(f)?f(k.value,S):k.value).concat(h||"")))});return W.createElement("g",{className:"recharts-cartesian-axis-ticks"},x)}},{key:"render",value:function(){var r=this,i=this.props,a=i.axisLine,o=i.width,l=i.height,c=i.ticksGenerator,u=i.className,d=i.hide;if(d)return null;var f=this.props,h=f.ticks,p=Km(f,zne),g=h;return $e(c)&&(g=h&&h.length>0?c(this.props):c(p)),o<=0||l<=0||!g||!g.length?null:W.createElement(Yt,{className:Ke("recharts-cartesian-axis",u),ref:function(v){r.layerReference=v}},a&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),mn.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,a){var o,l=Ke(i.className,"recharts-cartesian-axis-tick-value");return W.isValidElement(r)?o=W.cloneElement(r,Dt(Dt({},i),{},{className:l})):$e(r)?o=r(Dt(Dt({},i),{},{className:l})):o=W.createElement(Pf,Qs({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(E.Component);c0(sl,"displayName","CartesianAxis");c0(sl,"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 Yne=["x1","y1","x2","y2","key"],Xne=["offset"];function ss(e){"@babel/helpers - typeof";return ss=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},ss(e)}function WE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WE(Object(n),!0).forEach(function(r){Zne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zne(e,t,n){return t=Qne(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qne(e){var t=Jne(e,"string");return ss(t)=="symbol"?t:t+""}function Jne(e,t){if(ss(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ss(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fa(){return Fa=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},Fa.apply(this,arguments)}function HE(e,t){if(e==null)return{};var n=ere(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ere(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 tre=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,i=t.x,a=t.y,o=t.width,l=t.height,c=t.ry;return W.createElement("rect",{x:i,y:a,ry:c,width:o,height:l,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function IP(e,t){var n;if(W.isValidElement(e))n=W.cloneElement(e,t);else if($e(e))n=e(t);else{var r=t.x1,i=t.y1,a=t.x2,o=t.y2,l=t.key,c=HE(t,Yne),u=qe(c,!1);u.offset;var d=HE(u,Xne);n=W.createElement("line",Fa({},d,{x1:r,y1:i,x2:a,y2:o,fill:"none",key:l}))}return n}function nre(e){var t=e.x,n=e.width,r=e.horizontal,i=r===void 0?!0:r,a=e.horizontalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(l,c){var u=gn(gn({},e),{},{x1:t,y1:l,x2:t+n,y2:l,key:"line-".concat(c),index:c});return IP(i,u)});return W.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function rre(e){var t=e.y,n=e.height,r=e.vertical,i=r===void 0?!0:r,a=e.verticalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(l,c){var u=gn(gn({},e),{},{x1:l,y1:t,x2:l,y2:t+n,key:"line-".concat(c),index:c});return IP(i,u)});return W.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function ire(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,a=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+i-i)}).sort(function(h,p){return h-p});i!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var g=!d[p+1],m=g?i+o-h:d[p+1]-h;if(m<=0)return null;var v=p%t.length;return W.createElement("rect",{key:"react-".concat(p),y:h,x:r,height:m,width:a,stroke:"none",fill:t[v],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return W.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function are(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,i=e.fillOpacity,a=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+a-a)}).sort(function(h,p){return h-p});a!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var g=!d[p+1],m=g?a+l-h:d[p+1]-h;if(m<=0)return null;var v=p%r.length;return W.createElement("rect",{key:"react-".concat(p),x:h,y:o,width:m,height:c,stroke:"none",fill:r[v],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return W.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var sre=function(t,n){var r=t.xAxis,i=t.width,a=t.height,o=t.offset;return HO(l0(gn(gn(gn({},sl.defaultProps),r),{},{ticks:li(r,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,n)},ore=function(t,n){var r=t.yAxis,i=t.width,a=t.height,o=t.offset;return HO(l0(gn(gn(gn({},sl.defaultProps),r),{},{ticks:li(r,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,n)},Os={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Wi(e){var t,n,r,i,a,o,l=i0(),c=a0(),u=Vte(),d=gn(gn({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Os.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:Os.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:Os.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:Os.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:Os.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Os.verticalFill,x:ue(e.x)?e.x:u.left,y:ue(e.y)?e.y:u.top,width:ue(e.width)?e.width:u.width,height:ue(e.height)?e.height:u.height}),f=d.x,h=d.y,p=d.width,g=d.height,m=d.syncWithTicks,v=d.horizontalValues,y=d.verticalValues,b=Gte(),x=qte();if(!ue(p)||p<=0||!ue(g)||g<=0||!ue(f)||f!==+f||!ue(h)||h!==+h)return null;var k=d.verticalCoordinatesGenerator||sre,S=d.horizontalCoordinatesGenerator||ore,w=d.horizontalPoints,_=d.verticalPoints;if((!w||!w.length)&&$e(S)){var N=v&&v.length,C=S({yAxis:x?gn(gn({},x),{},{ticks:N?v:x.ticks}):void 0,width:l,height:c,offset:u},N?!0:m);di(Array.isArray(C),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(ss(C),"]")),Array.isArray(C)&&(w=C)}if((!_||!_.length)&&$e(k)){var T=y&&y.length,$=k({xAxis:b?gn(gn({},b),{},{ticks:T?y:b.ticks}):void 0,width:l,height:c,offset:u},T?!0:m);di(Array.isArray($),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(ss($),"]")),Array.isArray($)&&(_=$)}return W.createElement("g",{className:"recharts-cartesian-grid"},W.createElement(tre,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),W.createElement(nre,Fa({},d,{offset:u,horizontalPoints:w,xAxis:b,yAxis:x})),W.createElement(rre,Fa({},d,{offset:u,verticalPoints:_,xAxis:b,yAxis:x})),W.createElement(ire,Fa({},d,{horizontalPoints:w})),W.createElement(are,Fa({},d,{verticalPoints:_})))}Wi.displayName="CartesianGrid";function Lo(e){"@babel/helpers - typeof";return Lo=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},Lo(e)}function lre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cre(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,DP(r.key),r)}}function ure(e,t,n){return t&&cre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function dre(e,t,n){return t=hh(t),fre(e,$P()?Reflect.construct(t,n||[],hh(e).constructor):t.apply(e,n))}function fre(e,t){if(t&&(Lo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hre(e)}function hre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $P(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($P=function(){return!!e})()}function hh(e){return hh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},hh(e)}function pre(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&&Lv(e,t)}function Lv(e,t){return Lv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Lv(e,t)}function LP(e,t,n){return t=DP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DP(e){var t=mre(e,"string");return Lo(t)=="symbol"?t:t+""}function mre(e,t){if(Lo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Lo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Dv(){return Dv=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},Dv.apply(this,arguments)}function gre(e){var t=e.xAxisId,n=i0(),r=a0(),i=EP(t);return i==null?null:E.createElement(sl,Dv({},i,{className:Ke("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return li(o,!0)}}))}var Br=function(e){function t(){return lre(this,t),dre(this,t,arguments)}return pre(t,e),ure(t,[{key:"render",value:function(){return E.createElement(gre,this.props)}}])}(E.Component);LP(Br,"displayName","XAxis");LP(Br,"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 Do(e){"@babel/helpers - typeof";return Do=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},Do(e)}function yre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vre(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,FP(r.key),r)}}function bre(e,t,n){return t&&vre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function xre(e,t,n){return t=ph(t),wre(e,BP()?Reflect.construct(t,n||[],ph(e).constructor):t.apply(e,n))}function wre(e,t){if(t&&(Do(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Sre(e)}function Sre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function BP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(BP=function(){return!!e})()}function ph(e){return ph=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ph(e)}function kre(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&&Bv(e,t)}function Bv(e,t){return Bv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Bv(e,t)}function zP(e,t,n){return t=FP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FP(e){var t=Ere(e,"string");return Do(t)=="symbol"?t:t+""}function Ere(e,t){if(Do(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Do(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function zv(){return zv=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},zv.apply(this,arguments)}var _re=function(t){var n=t.yAxisId,r=i0(),i=a0(),a=_P(n);return a==null?null:E.createElement(sl,zv({},a,{className:Ke("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:r,height:i},ticksGenerator:function(l){return li(l,!0)}}))},zr=function(e){function t(){return yre(this,t),xre(this,t,arguments)}return kre(t,e),bre(t,[{key:"render",value:function(){return E.createElement(_re,this.props)}}])}(E.Component);zP(zr,"displayName","YAxis");zP(zr,"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 GE(e){return Tre(e)||Are(e)||jre(e)||Nre()}function Nre(){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 jre(e,t){if(e){if(typeof e=="string")return Fv(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 Fv(e,t)}}function Are(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Tre(e){if(Array.isArray(e))return Fv(e)}function Fv(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 Uv=function(t,n,r,i,a){var o=_r(t,o0),l=_r(t,Tp),c=[].concat(GE(o),GE(l)),u=_r(t,Op),d="".concat(i,"Id"),f=i[0],h=n;if(c.length&&(h=c.reduce(function(m,v){if(v.props[d]===r&&Gr(v.props,"extendDomain")&&ue(v.props[f])){var y=v.props[f];return[Math.min(m[0],y),Math.max(m[1],y)]}return m},h)),u.length){var p="".concat(f,"1"),g="".concat(f,"2");h=u.reduce(function(m,v){if(v.props[d]===r&&Gr(v.props,"extendDomain")&&ue(v.props[p])&&ue(v.props[g])){var y=v.props[p],b=v.props[g];return[Math.min(m[0],y,b),Math.max(m[1],y,b)]}return m},h)}return a&&a.length&&(h=a.reduce(function(m,v){return ue(v)?[Math.min(m[0],v),Math.max(m[1],v)]:m},h)),h},UP={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function a(c,u,d,f,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new i(d,f||c,h),g=n?n+u:u;return c._events[g]?c._events[g].fn?c._events[g]=[c._events[g],p]:c._events[g].push(p):(c._events[g]=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,g=new Array(p);h<p;h++)g[h]=f[h].fn;return g},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,g){var m=n?n+u:u;if(!this._events[m])return!1;var v=this._events[m],y=arguments.length,b,x;if(v.fn){switch(v.once&&this.removeListener(u,v.fn,void 0,!0),y){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,d),!0;case 3:return v.fn.call(v.context,d,f),!0;case 4:return v.fn.call(v.context,d,f,h),!0;case 5:return v.fn.call(v.context,d,f,h,p),!0;case 6:return v.fn.call(v.context,d,f,h,p,g),!0}for(x=1,b=new Array(y-1);x<y;x++)b[x-1]=arguments[x];v.fn.apply(v.context,b)}else{var k=v.length,S;for(x=0;x<k;x++)switch(v[x].once&&this.removeListener(u,v[x].fn,void 0,!0),y){case 1:v[x].fn.call(v[x].context);break;case 2:v[x].fn.call(v[x].context,d);break;case 3:v[x].fn.call(v[x].context,d,f);break;case 4:v[x].fn.call(v[x].context,d,f,h);break;default:if(!b)for(S=1,b=new Array(y-1);S<y;S++)b[S-1]=arguments[S];v[x].fn.apply(v[x].context,b)}}return!0},l.prototype.on=function(u,d,f){return a(this,u,d,f,!1)},l.prototype.once=function(u,d,f){return a(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 g=this._events[p];if(g.fn)g.fn===d&&(!h||g.once)&&(!f||g.context===f)&&o(this,p);else{for(var m=0,v=[],y=g.length;m<y;m++)(g[m].fn!==d||h&&!g[m].once||f&&g[m].context!==f)&&v.push(g[m]);v.length?this._events[p]=v.length===1?v[0]:v: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})(UP);var Cre=UP.exports;const Ore=Xe(Cre);var Vm=new Ore,Ym="recharts.syncMouseEvents";function ou(e){"@babel/helpers - typeof";return ou=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},ou(e)}function Pre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mre(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,WP(r.key),r)}}function Rre(e,t,n){return t&&Mre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xm(e,t,n){return t=WP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WP(e){var t=Ire(e,"string");return ou(t)=="symbol"?t:t+""}function Ire(e,t){if(ou(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ou(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var $re=function(){function e(){Pre(this,e),Xm(this,"activeIndex",0),Xm(this,"coordinateList",[]),Xm(this,"layout","horizontal")}return Rre(e,[{key:"setDetails",value:function(n){var r,i=n.coordinateList,a=i===void 0?null:i,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=a??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 i=this.container.getBoundingClientRect(),a=i.x,o=i.y,l=i.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=a+c+u,h=o+this.offset.top+l/2+d;this.mouseHandlerCallback({pageX:f,pageY:h})}}}])}();function Lre(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e==null?void 0:e[0],i=e==null?void 0:e[1];if(r&&i&&ue(r)&&ue(i))return!0}return!1}function Dre(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function HP(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,a=e.endAngle,o=rn(t,n,r,i),l=rn(t,n,r,a);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}function Bre(e,t,n){var r,i,a,o;if(e==="horizontal")r=t.x,a=r,i=n.top,o=n.top+n.height;else if(e==="vertical")i=t.y,o=i,r=n.left,a=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=rn(l,c,u,f),p=rn(l,c,d,f);r=h.x,i=h.y,a=p.x,o=p.y}else return HP(t);return[{x:r,y:i},{x:a,y:o}]}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 qE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qE(Object(n),!0).forEach(function(r){zre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zre(e,t,n){return t=Fre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fre(e){var t=Ure(e,"string");return lu(t)=="symbol"?t:t+""}function Ure(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)}function Wre(e){var t,n,r=e.element,i=e.tooltipEventType,a=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||!a||!o||h!=="ScatterChart"&&i!=="axis")return null;var g,m=qk;if(h==="ScatterChart")g=o,m=nJ;else if(h==="BarChart")g=Dre(f,o,c,d),m=e0;else if(f==="radial"){var v=HP(o),y=v.cx,b=v.cy,x=v.radius,k=v.startAngle,S=v.endAngle;g={cx:y,cy:b,startAngle:k,endAngle:S,innerRadius:x,outerRadius:x},m=YO}else g={points:Bre(f,o,c)},m=qk;var w=fd(fd(fd(fd({stroke:"#ccc",pointerEvents:"none"},c),g),qe(p,!1)),{},{payload:l,payloadIndex:u,className:Ke("recharts-tooltip-cursor",p.className)});return E.isValidElement(p)?E.cloneElement(p,w):E.createElement(m,w)}var Hre=["item"],Gre=["children","className","width","height","style","compact","title","desc"];function Bo(e){"@babel/helpers - typeof";return Bo=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},Bo(e)}function Js(){return Js=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Js.apply(this,arguments)}function KE(e,t){return Vre(e)||Kre(e,t)||qP(e,t)||qre()}function qre(){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 Kre(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function Vre(e){if(Array.isArray(e))return e}function VE(e,t){if(e==null)return{};var n=Yre(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Yre(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 Xre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zre(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,KP(r.key),r)}}function Qre(e,t,n){return t&&Zre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Jre(e,t,n){return t=mh(t),eie(e,GP()?Reflect.construct(t,n||[],mh(e).constructor):t.apply(e,n))}function eie(e,t){if(t&&(Bo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tie(e)}function tie(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function GP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(GP=function(){return!!e})()}function mh(e){return mh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},mh(e)}function nie(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&&Wv(e,t)}function Wv(e,t){return Wv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Wv(e,t)}function zo(e){return aie(e)||iie(e)||qP(e)||rie()}function rie(){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 qP(e,t){if(e){if(typeof e=="string")return Hv(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 Hv(e,t)}}function iie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function aie(e){if(Array.isArray(e))return Hv(e)}function Hv(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 YE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Q(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YE(Object(n),!0).forEach(function(r){Ae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ae(e,t,n){return t=KP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KP(e){var t=sie(e,"string");return Bo(t)=="symbol"?t:t+""}function sie(e,t){if(Bo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var oie={xAxis:["bottom","top"],yAxis:["left","right"]},lie={width:"100%",height:"100%"},VP={x:0,y:0};function hd(e){return e}var cie=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},uie=function(t,n,r,i){var a=n.find(function(d){return d&&d.index===r});if(a){if(t==="horizontal")return{x:a.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:a.coordinate};if(t==="centric"){var o=a.coordinate,l=i.radius;return Q(Q(Q({},i),rn(i.cx,i.cy,l,o)),{},{angle:o,radius:l})}var c=a.coordinate,u=i.angle;return Q(Q(Q({},i),rn(i.cx,i.cy,c,u)),{},{angle:u,radius:c})}return VP},Pp=function(t,n){var r=n.graphicalItems,i=n.dataStartIndex,a=n.dataEndIndex,o=(r??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(zo(l),zo(u)):l},[]);return o.length>0?o:t&&t.length&&ue(i)&&ue(a)?t.slice(i,a+1):[]};function YP(e){return e==="number"?[0,"auto"]:void 0}var Gv=function(t,n,r,i){var a=t.graphicalItems,o=t.tooltipAxis,l=Pp(n,t);return r<0||!a||!a.length||r>=l.length?null:a.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=Ey(p,o.dataKey,i)}else h=f&&f[r]||l[r];return h?[].concat(zo(c),[qO(u,h)]):c},[])},XE=function(t,n,r,i){var a=i||{x:t.chartX,y:t.chartY},o=cie(a,r),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=RY(o,l,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,h=Gv(t,n,d,f),p=uie(r,l,d,a);return{activeTooltipIndex:d,activeLabel:f,activePayload:h,activeCoordinate:p}}return null},die=function(t,n){var r=n.axes,i=n.graphicalItems,a=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,h=t.stackOffset,p=WO(d,a);return r.reduce(function(g,m){var v,y=m.type.defaultProps!==void 0?Q(Q({},m.type.defaultProps),m.props):m.props,b=y.type,x=y.dataKey,k=y.allowDataOverflow,S=y.allowDuplicatedCategory,w=y.scale,_=y.ticks,N=y.includeHidden,C=y[o];if(g[C])return g;var T=Pp(t.data,{graphicalItems:i.filter(function(K){var M,le=o in K.props?K.props[o]:(M=K.type.defaultProps)===null||M===void 0?void 0:M[o];return le===C}),dataStartIndex:c,dataEndIndex:u}),$=T.length,R,L,I;Lre(y.domain,k,b)&&(R=dv(y.domain,null,k),p&&(b==="number"||w!=="auto")&&(I=nc(T,x,"category")));var z=YP(b);if(!R||R.length===0){var D,F=(D=y.domain)!==null&&D!==void 0?D:z;if(x){if(R=nc(T,x,b),b==="category"&&p){var O=S3(R);S&&O?(L=R,R=rh(0,$)):S||(R=Mk(F,R,m).reduce(function(K,M){return K.indexOf(M)>=0?K:[].concat(zo(K),[M])},[]))}else if(b==="category")S?R=R.filter(function(K){return K!==""&&!Ve(K)}):R=Mk(F,R,m).reduce(function(K,M){return K.indexOf(M)>=0||M===""||Ve(M)?K:[].concat(zo(K),[M])},[]);else if(b==="number"){var P=BY(T,i.filter(function(K){var M,le,be=o in K.props?K.props[o]:(M=K.type.defaultProps)===null||M===void 0?void 0:M[o],me="hide"in K.props?K.props.hide:(le=K.type.defaultProps)===null||le===void 0?void 0:le.hide;return be===C&&(N||!me)}),x,a,d);P&&(R=P)}p&&(b==="number"||w!=="auto")&&(I=nc(T,x,"category"))}else p?R=rh(0,$):l&&l[C]&&l[C].hasStack&&b==="number"?R=h==="expand"?[0,1]:GO(l[C].stackGroups,c,u):R=UO(T,i.filter(function(K){var M=o in K.props?K.props[o]:K.type.defaultProps[o],le="hide"in K.props?K.props.hide:K.type.defaultProps.hide;return M===C&&(N||!le)}),b,d,!0);if(b==="number")R=Uv(f,R,C,a,_),F&&(R=dv(F,R,k));else if(b==="category"&&F){var A=F,Y=R.every(function(K){return A.indexOf(K)>=0});Y&&(R=A)}}return Q(Q({},g),{},Ae({},C,Q(Q({},y),{},{axisType:a,domain:R,categoricalDomain:I,duplicateDomain:L,originalDomain:(v=y.domain)!==null&&v!==void 0?v:z,isCategorical:p,layout:d})))},{})},fie=function(t,n){var r=n.graphicalItems,i=n.Axis,a=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,h=Pp(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:u}),p=h.length,g=WO(d,a),m=-1;return r.reduce(function(v,y){var b=y.type.defaultProps!==void 0?Q(Q({},y.type.defaultProps),y.props):y.props,x=b[o],k=YP("number");if(!v[x]){m++;var S;return g?S=rh(0,p):l&&l[x]&&l[x].hasStack?(S=GO(l[x].stackGroups,c,u),S=Uv(f,S,x,a)):(S=dv(k,UO(h,r.filter(function(w){var _,N,C=o in w.props?w.props[o]:(_=w.type.defaultProps)===null||_===void 0?void 0:_[o],T="hide"in w.props?w.props.hide:(N=w.type.defaultProps)===null||N===void 0?void 0:N.hide;return C===x&&!T}),"number",d),i.defaultProps.allowDataOverflow),S=Uv(f,S,x,a)),Q(Q({},v),{},Ae({},x,Q(Q({axisType:a},i.defaultProps),{},{hide:!0,orientation:or(oie,"".concat(a,".").concat(m%2),null),domain:S,originalDomain:k,isCategorical:g,layout:d})))}return v},{})},hie=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,a=n.AxisComp,o=n.graphicalItems,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.children,f="".concat(i,"Id"),h=_r(d,a),p={};return h&&h.length?p=die(t,{axes:h,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(p=fie(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),p},pie=function(t){var n=Ui(t),r=li(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:Nx(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Kf(n,r)}},ZE=function(t){var n=t.children,r=t.defaultShowTooltip,i=Wn(n,Oo),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},mie=function(t){return!t||!t.length?!1:t.some(function(n){var r=ui(n&&n.type);return r&&r.indexOf("Bar")>=0})},QE=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"}},gie=function(t,n){var r=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,l=t.yAxisMap,c=l===void 0?{}:l,u=r.width,d=r.height,f=r.children,h=r.margin||{},p=Wn(f,Oo),g=Wn(f,Ga),m=Object.keys(c).reduce(function(S,w){var _=c[w],N=_.orientation;return!_.mirror&&!_.hide?Q(Q({},S),{},Ae({},N,S[N]+_.width)):S},{left:h.left||0,right:h.right||0}),v=Object.keys(o).reduce(function(S,w){var _=o[w],N=_.orientation;return!_.mirror&&!_.hide?Q(Q({},S),{},Ae({},N,or(S,"".concat(N))+_.height)):S},{top:h.top||0,bottom:h.bottom||0}),y=Q(Q({},v),m),b=y.bottom;p&&(y.bottom+=p.props.height||Oo.defaultProps.height),g&&n&&(y=LY(y,i,r,n));var x=u-y.left-y.right,k=d-y.top-y.bottom;return Q(Q({brushBottom:b},y),{},{width:Math.max(x,0),height:Math.max(k,0)})},yie=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},vie=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,f=t.defaultProps,h=function(y,b){var x=b.graphicalItems,k=b.stackGroups,S=b.offset,w=b.updateId,_=b.dataStartIndex,N=b.dataEndIndex,C=y.barSize,T=y.layout,$=y.barGap,R=y.barCategoryGap,L=y.maxBarSize,I=QE(T),z=I.numericAxisName,D=I.cateAxisName,F=mie(x),O=[];return x.forEach(function(P,A){var Y=Pp(y.data,{graphicalItems:[P],dataStartIndex:_,dataEndIndex:N}),K=P.type.defaultProps!==void 0?Q(Q({},P.type.defaultProps),P.props):P.props,M=K.dataKey,le=K.maxBarSize,be=K["".concat(z,"Id")],me=K["".concat(D,"Id")],Pe={},H=c.reduce(function(Oe,Ze){var Me=b["".concat(Ze.axisType,"Map")],Qt=K["".concat(Ze.axisType,"Id")];Me&&Me[Qt]||Ze.axisType==="zAxis"||as();var $t=Me[Qt];return Q(Q({},Oe),{},Ae(Ae({},Ze.axisType,$t),"".concat(Ze.axisType,"Ticks"),li($t)))},Pe),X=H[D],oe=H["".concat(D,"Ticks")],ce=k&&k[be]&&k[be].hasStack&&ZY(P,k[be].stackGroups),Z=ui(P.type).indexOf("Bar")>=0,_e=Kf(X,oe),we=[],Ne=F&&IY({barSize:C,stackGroups:k,totalSize:yie(H,D)});if(Z){var ge,Be,pe=Ve(le)?L:le,Ct=(ge=(Be=Kf(X,oe,!0))!==null&&Be!==void 0?Be:pe)!==null&&ge!==void 0?ge:0;we=$Y({barGap:$,barCategoryGap:R,bandSize:Ct!==_e?Ct:_e,sizeList:Ne[me],maxBarSize:pe}),Ct!==_e&&(we=we.map(function(Oe){return Q(Q({},Oe),{},{position:Q(Q({},Oe.position),{},{offset:Oe.position.offset-Ct/2})})}))}var We=P&&P.type&&P.type.getComposedData;We&&O.push({props:Q(Q({},We(Q(Q({},H),{},{displayedData:Y,props:y,dataKey:M,item:P,bandSize:_e,barPosition:we,offset:S,stackedData:ce,layout:T,dataStartIndex:_,dataEndIndex:N}))),{},Ae(Ae(Ae({key:P.key||"item-".concat(A)},z,H[z]),D,H[D]),"animationId",w)),childIndex:R3(P,y.children),item:P})}),O},p=function(y,b){var x=y.props,k=y.dataStartIndex,S=y.dataEndIndex,w=y.updateId;if(!j1({props:x}))return null;var _=x.children,N=x.layout,C=x.stackOffset,T=x.data,$=x.reverseStackOrder,R=QE(N),L=R.numericAxisName,I=R.cateAxisName,z=_r(_,r),D=VY(T,z,"".concat(L,"Id"),"".concat(I,"Id"),C,$),F=c.reduce(function(K,M){var le="".concat(M.axisType,"Map");return Q(Q({},K),{},Ae({},le,hie(x,Q(Q({},M),{},{graphicalItems:z,stackGroups:M.axisType===L&&D,dataStartIndex:k,dataEndIndex:S}))))},{}),O=gie(Q(Q({},F),{},{props:x,graphicalItems:z}),b==null?void 0:b.legendBBox);Object.keys(F).forEach(function(K){F[K]=d(x,F[K],O,K.replace("Map",""),n)});var P=F["".concat(I,"Map")],A=pie(P),Y=h(x,Q(Q({},F),{},{dataStartIndex:k,dataEndIndex:S,updateId:w,graphicalItems:z,stackGroups:D,offset:O}));return Q(Q({formattedGraphicalItems:Y,graphicalItems:z,offset:O,stackGroups:D},A),F)},g=function(v){function y(b){var x,k,S;return Xre(this,y),S=Jre(this,y,[b]),Ae(S,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Ae(S,"accessibilityManager",new $re),Ae(S,"handleLegendBBoxUpdate",function(w){if(w){var _=S.state,N=_.dataStartIndex,C=_.dataEndIndex,T=_.updateId;S.setState(Q({legendBBox:w},p({props:S.props,dataStartIndex:N,dataEndIndex:C,updateId:T},Q(Q({},S.state),{},{legendBBox:w}))))}}),Ae(S,"handleReceiveSyncEvent",function(w,_,N){if(S.props.syncId===w){if(N===S.eventEmitterSymbol&&typeof S.props.syncMethod!="function")return;S.applySyncEvent(_)}}),Ae(S,"handleBrushChange",function(w){var _=w.startIndex,N=w.endIndex;if(_!==S.state.dataStartIndex||N!==S.state.dataEndIndex){var C=S.state.updateId;S.setState(function(){return Q({dataStartIndex:_,dataEndIndex:N},p({props:S.props,dataStartIndex:_,dataEndIndex:N,updateId:C},S.state))}),S.triggerSyncEvent({dataStartIndex:_,dataEndIndex:N})}}),Ae(S,"handleMouseEnter",function(w){var _=S.getMouseInfo(w);if(_){var N=Q(Q({},_),{},{isTooltipActive:!0});S.setState(N),S.triggerSyncEvent(N);var C=S.props.onMouseEnter;$e(C)&&C(N,w)}}),Ae(S,"triggeredAfterMouseMove",function(w){var _=S.getMouseInfo(w),N=_?Q(Q({},_),{},{isTooltipActive:!0}):{isTooltipActive:!1};S.setState(N),S.triggerSyncEvent(N);var C=S.props.onMouseMove;$e(C)&&C(N,w)}),Ae(S,"handleItemMouseEnter",function(w){S.setState(function(){return{isTooltipActive:!0,activeItem:w,activePayload:w.tooltipPayload,activeCoordinate:w.tooltipPosition||{x:w.cx,y:w.cy}}})}),Ae(S,"handleItemMouseLeave",function(){S.setState(function(){return{isTooltipActive:!1}})}),Ae(S,"handleMouseMove",function(w){w.persist(),S.throttleTriggeredAfterMouseMove(w)}),Ae(S,"handleMouseLeave",function(w){S.throttleTriggeredAfterMouseMove.cancel();var _={isTooltipActive:!1};S.setState(_),S.triggerSyncEvent(_);var N=S.props.onMouseLeave;$e(N)&&N(_,w)}),Ae(S,"handleOuterEvent",function(w){var _=M3(w),N=or(S.props,"".concat(_));if(_&&$e(N)){var C,T;/.*touch.*/i.test(_)?T=S.getMouseInfo(w.changedTouches[0]):T=S.getMouseInfo(w),N((C=T)!==null&&C!==void 0?C:{},w)}}),Ae(S,"handleClick",function(w){var _=S.getMouseInfo(w);if(_){var N=Q(Q({},_),{},{isTooltipActive:!0});S.setState(N),S.triggerSyncEvent(N);var C=S.props.onClick;$e(C)&&C(N,w)}}),Ae(S,"handleMouseDown",function(w){var _=S.props.onMouseDown;if($e(_)){var N=S.getMouseInfo(w);_(N,w)}}),Ae(S,"handleMouseUp",function(w){var _=S.props.onMouseUp;if($e(_)){var N=S.getMouseInfo(w);_(N,w)}}),Ae(S,"handleTouchMove",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&S.throttleTriggeredAfterMouseMove(w.changedTouches[0])}),Ae(S,"handleTouchStart",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&S.handleMouseDown(w.changedTouches[0])}),Ae(S,"handleTouchEnd",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&S.handleMouseUp(w.changedTouches[0])}),Ae(S,"handleDoubleClick",function(w){var _=S.props.onDoubleClick;if($e(_)){var N=S.getMouseInfo(w);_(N,w)}}),Ae(S,"handleContextMenu",function(w){var _=S.props.onContextMenu;if($e(_)){var N=S.getMouseInfo(w);_(N,w)}}),Ae(S,"triggerSyncEvent",function(w){S.props.syncId!==void 0&&Vm.emit(Ym,S.props.syncId,w,S.eventEmitterSymbol)}),Ae(S,"applySyncEvent",function(w){var _=S.props,N=_.layout,C=_.syncMethod,T=S.state.updateId,$=w.dataStartIndex,R=w.dataEndIndex;if(w.dataStartIndex!==void 0||w.dataEndIndex!==void 0)S.setState(Q({dataStartIndex:$,dataEndIndex:R},p({props:S.props,dataStartIndex:$,dataEndIndex:R,updateId:T},S.state)));else if(w.activeTooltipIndex!==void 0){var L=w.chartX,I=w.chartY,z=w.activeTooltipIndex,D=S.state,F=D.offset,O=D.tooltipTicks;if(!F)return;if(typeof C=="function")z=C(O,w);else if(C==="value"){z=-1;for(var P=0;P<O.length;P++)if(O[P].value===w.activeLabel){z=P;break}}var A=Q(Q({},F),{},{x:F.left,y:F.top}),Y=Math.min(L,A.x+A.width),K=Math.min(I,A.y+A.height),M=O[z]&&O[z].value,le=Gv(S.state,S.props.data,z),be=O[z]?{x:N==="horizontal"?O[z].coordinate:Y,y:N==="horizontal"?K:O[z].coordinate}:VP;S.setState(Q(Q({},w),{},{activeLabel:M,activeCoordinate:be,activePayload:le,activeTooltipIndex:z}))}else S.setState(w)}),Ae(S,"renderCursor",function(w){var _,N=S.state,C=N.isTooltipActive,T=N.activeCoordinate,$=N.activePayload,R=N.offset,L=N.activeTooltipIndex,I=N.tooltipAxisBandSize,z=S.getTooltipEventType(),D=(_=w.props.active)!==null&&_!==void 0?_:C,F=S.props.layout,O=w.key||"_recharts-cursor";return W.createElement(Wre,{key:O,activeCoordinate:T,activePayload:$,activeTooltipIndex:L,chartName:n,element:w,isActive:D,layout:F,offset:R,tooltipAxisBandSize:I,tooltipEventType:z})}),Ae(S,"renderPolarAxis",function(w,_,N){var C=or(w,"type.axisType"),T=or(S.state,"".concat(C,"Map")),$=w.type.defaultProps,R=$!==void 0?Q(Q({},$),w.props):w.props,L=T&&T[R["".concat(C,"Id")]];return E.cloneElement(w,Q(Q({},L),{},{className:Ke(C,L.className),key:w.key||"".concat(_,"-").concat(N),ticks:li(L,!0)}))}),Ae(S,"renderPolarGrid",function(w){var _=w.props,N=_.radialLines,C=_.polarAngles,T=_.polarRadius,$=S.state,R=$.radiusAxisMap,L=$.angleAxisMap,I=Ui(R),z=Ui(L),D=z.cx,F=z.cy,O=z.innerRadius,P=z.outerRadius;return E.cloneElement(w,{polarAngles:Array.isArray(C)?C:li(z,!0).map(function(A){return A.coordinate}),polarRadius:Array.isArray(T)?T:li(I,!0).map(function(A){return A.coordinate}),cx:D,cy:F,innerRadius:O,outerRadius:P,key:w.key||"polar-grid",radialLines:N})}),Ae(S,"renderLegend",function(){var w=S.state.formattedGraphicalItems,_=S.props,N=_.children,C=_.width,T=_.height,$=S.props.margin||{},R=C-($.left||0)-($.right||0),L=zO({children:N,formattedGraphicalItems:w,legendWidth:R,legendContent:u});if(!L)return null;var I=L.item,z=VE(L,Hre);return E.cloneElement(I,Q(Q({},z),{},{chartWidth:C,chartHeight:T,margin:$,onBBoxUpdate:S.handleLegendBBoxUpdate}))}),Ae(S,"renderTooltip",function(){var w,_=S.props,N=_.children,C=_.accessibilityLayer,T=Wn(N,hn);if(!T)return null;var $=S.state,R=$.isTooltipActive,L=$.activeCoordinate,I=$.activePayload,z=$.activeLabel,D=$.offset,F=(w=T.props.active)!==null&&w!==void 0?w:R;return E.cloneElement(T,{viewBox:Q(Q({},D),{},{x:D.left,y:D.top}),active:F,label:z,payload:F?I:[],coordinate:L,accessibilityLayer:C})}),Ae(S,"renderBrush",function(w){var _=S.props,N=_.margin,C=_.data,T=S.state,$=T.offset,R=T.dataStartIndex,L=T.dataEndIndex,I=T.updateId;return E.cloneElement(w,{key:w.key||"_recharts-brush",onChange:ld(S.handleBrushChange,w.props.onChange),data:C,x:ue(w.props.x)?w.props.x:$.left,y:ue(w.props.y)?w.props.y:$.top+$.height+$.brushBottom-(N.bottom||0),width:ue(w.props.width)?w.props.width:$.width,startIndex:R,endIndex:L,updateId:"brush-".concat(I)})}),Ae(S,"renderReferenceElement",function(w,_,N){if(!w)return null;var C=S,T=C.clipPathId,$=S.state,R=$.xAxisMap,L=$.yAxisMap,I=$.offset,z=w.type.defaultProps||{},D=w.props,F=D.xAxisId,O=F===void 0?z.xAxisId:F,P=D.yAxisId,A=P===void 0?z.yAxisId:P;return E.cloneElement(w,{key:w.key||"".concat(_,"-").concat(N),xAxis:R[O],yAxis:L[A],viewBox:{x:I.left,y:I.top,width:I.width,height:I.height},clipPathId:T})}),Ae(S,"renderActivePoints",function(w){var _=w.item,N=w.activePoint,C=w.basePoint,T=w.childIndex,$=w.isRange,R=[],L=_.props.key,I=_.item.type.defaultProps!==void 0?Q(Q({},_.item.type.defaultProps),_.item.props):_.item.props,z=I.activeDot,D=I.dataKey,F=Q(Q({index:T,dataKey:D,cx:N.x,cy:N.y,r:4,fill:Jx(_.item),strokeWidth:2,stroke:"#fff",payload:N.payload,value:N.value},qe(z,!1)),yf(z));return R.push(y.renderActiveDot(z,F,"".concat(L,"-activePoint-").concat(T))),C?R.push(y.renderActiveDot(z,Q(Q({},F),{},{cx:C.x,cy:C.y}),"".concat(L,"-basePoint-").concat(T))):$&&R.push(null),R}),Ae(S,"renderGraphicChild",function(w,_,N){var C=S.filterFormatItem(w,_,N);if(!C)return null;var T=S.getTooltipEventType(),$=S.state,R=$.isTooltipActive,L=$.tooltipAxis,I=$.activeTooltipIndex,z=$.activeLabel,D=S.props.children,F=Wn(D,hn),O=C.props,P=O.points,A=O.isRange,Y=O.baseLine,K=C.item.type.defaultProps!==void 0?Q(Q({},C.item.type.defaultProps),C.item.props):C.item.props,M=K.activeDot,le=K.hide,be=K.activeBar,me=K.activeShape,Pe=!!(!le&&R&&F&&(M||be||me)),H={};T!=="axis"&&F&&F.props.trigger==="click"?H={onClick:ld(S.handleItemMouseEnter,w.props.onClick)}:T!=="axis"&&(H={onMouseLeave:ld(S.handleItemMouseLeave,w.props.onMouseLeave),onMouseEnter:ld(S.handleItemMouseEnter,w.props.onMouseEnter)});var X=E.cloneElement(w,Q(Q({},C.props),H));function oe(Ze){return typeof L.dataKey=="function"?L.dataKey(Ze.payload):null}if(Pe)if(I>=0){var ce,Z;if(L.dataKey&&!L.allowDuplicatedCategory){var _e=typeof L.dataKey=="function"?oe:"payload.".concat(L.dataKey.toString());ce=Ey(P,_e,z),Z=A&&Y&&Ey(Y,_e,z)}else ce=P==null?void 0:P[I],Z=A&&Y&&Y[I];if(me||be){var we=w.props.activeIndex!==void 0?w.props.activeIndex:I;return[E.cloneElement(w,Q(Q(Q({},C.props),H),{},{activeIndex:we})),null,null]}if(!Ve(ce))return[X].concat(zo(S.renderActivePoints({item:C,activePoint:ce,basePoint:Z,childIndex:I,isRange:A})))}else{var Ne,ge=(Ne=S.getItemByXY(S.state.activeCoordinate))!==null&&Ne!==void 0?Ne:{graphicalItem:X},Be=ge.graphicalItem,pe=Be.item,Ct=pe===void 0?w:pe,We=Be.childIndex,Oe=Q(Q(Q({},C.props),H),{},{activeIndex:We});return[E.cloneElement(Ct,Oe),null,null]}return A?[X,null,null]:[X,null]}),Ae(S,"renderCustomized",function(w,_,N){return E.cloneElement(w,Q(Q({key:"recharts-customized-".concat(N)},S.props),S.state))}),Ae(S,"renderMap",{CartesianGrid:{handler:hd,once:!0},ReferenceArea:{handler:S.renderReferenceElement},ReferenceLine:{handler:hd},ReferenceDot:{handler:S.renderReferenceElement},XAxis:{handler:hd},YAxis:{handler:hd},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((x=b.id)!==null&&x!==void 0?x:sp("recharts"),"-clip"),S.throttleTriggeredAfterMouseMove=FC(S.triggeredAfterMouseMove,(k=b.throttleDelay)!==null&&k!==void 0?k:1e3/60),S.state={},S}return nie(y,v),Qre(y,[{key:"componentDidMount",value:function(){var x,k;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(k=this.props.margin.top)!==null&&k!==void 0?k:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,k=x.children,S=x.data,w=x.height,_=x.layout,N=Wn(k,hn);if(N){var C=N.props.defaultIndex;if(!(typeof C!="number"||C<0||C>this.state.tooltipTicks.length-1)){var T=this.state.tooltipTicks[C]&&this.state.tooltipTicks[C].value,$=Gv(this.state,S,C,T),R=this.state.tooltipTicks[C].coordinate,L=(this.state.offset.top+w)/2,I=_==="horizontal",z=I?{x:R,y:L}:{y:R,x:L},D=this.state.formattedGraphicalItems.find(function(O){var P=O.item;return P.type.name==="Scatter"});D&&(z=Q(Q({},z),D.props.points[C].tooltipPosition),$=D.props.points[C].tooltipPayload);var F={activeTooltipIndex:C,isTooltipActive:!0,activeLabel:T,activePayload:$,activeCoordinate:z};this.setState(F),this.renderCursor(N),this.accessibilityManager.setIndex(C)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,k){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==k.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var S,w;this.accessibilityManager.setDetails({offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(w=this.props.margin.top)!==null&&w!==void 0?w:0}})}return null}},{key:"componentDidUpdate",value:function(x){Ny([Wn(x.children,hn)],[Wn(this.props.children,hn)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=Wn(this.props.children,hn);if(x&&typeof x.props.shared=="boolean"){var k=x.props.shared?"axis":"item";return l.indexOf(k)>=0?k:a}return a}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var k=this.container,S=k.getBoundingClientRect(),w=sq(S),_={chartX:Math.round(x.pageX-w.left),chartY:Math.round(x.pageY-w.top)},N=S.width/k.offsetWidth||1,C=this.inRange(_.chartX,_.chartY,N);if(!C)return null;var T=this.state,$=T.xAxisMap,R=T.yAxisMap,L=this.getTooltipEventType(),I=XE(this.state,this.props.data,this.props.layout,C);if(L!=="axis"&&$&&R){var z=Ui($).scale,D=Ui(R).scale,F=z&&z.invert?z.invert(_.chartX):null,O=D&&D.invert?D.invert(_.chartY):null;return Q(Q({},_),{},{xValue:F,yValue:O},I)}return I?Q(Q({},_),I):null}},{key:"inRange",value:function(x,k){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,w=this.props.layout,_=x/S,N=k/S;if(w==="horizontal"||w==="vertical"){var C=this.state.offset,T=_>=C.left&&_<=C.left+C.width&&N>=C.top&&N<=C.top+C.height;return T?{x:_,y:N}:null}var $=this.state,R=$.angleAxisMap,L=$.radiusAxisMap;if(R&&L){var I=Ui(R);return $k({x:_,y:N},I)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,k=this.getTooltipEventType(),S=Wn(x,hn),w={};S&&k==="axis"&&(S.props.trigger==="click"?w={onClick:this.handleClick}:w={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 _=yf(this.props,this.handleOuterEvent);return Q(Q({},_),w)}},{key:"addListener",value:function(){Vm.on(Ym,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Vm.removeListener(Ym,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,k,S){for(var w=this.state.formattedGraphicalItems,_=0,N=w.length;_<N;_++){var C=w[_];if(C.item===x||C.props.key===x.key||k===ui(C.item.type)&&S===C.childIndex)return C}return null}},{key:"renderClipPath",value:function(){var x=this.clipPathId,k=this.state.offset,S=k.left,w=k.top,_=k.height,N=k.width;return W.createElement("defs",null,W.createElement("clipPath",{id:x},W.createElement("rect",{x:S,y:w,height:_,width:N})))}},{key:"getXScales",value:function(){var x=this.state.xAxisMap;return x?Object.entries(x).reduce(function(k,S){var w=KE(S,2),_=w[0],N=w[1];return Q(Q({},k),{},Ae({},_,N.scale))},{}):null}},{key:"getYScales",value:function(){var x=this.state.yAxisMap;return x?Object.entries(x).reduce(function(k,S){var w=KE(S,2),_=w[0],N=w[1];return Q(Q({},k),{},Ae({},_,N.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(x){var k;return(k=this.state.xAxisMap)===null||k===void 0||(k=k[x])===null||k===void 0?void 0:k.scale}},{key:"getYScaleByAxisId",value:function(x){var k;return(k=this.state.yAxisMap)===null||k===void 0||(k=k[x])===null||k===void 0?void 0:k.scale}},{key:"getItemByXY",value:function(x){var k=this.state,S=k.formattedGraphicalItems,w=k.activeItem;if(S&&S.length)for(var _=0,N=S.length;_<N;_++){var C=S[_],T=C.props,$=C.item,R=$.type.defaultProps!==void 0?Q(Q({},$.type.defaultProps),$.props):$.props,L=ui($.type);if(L==="Bar"){var I=(T.data||[]).find(function(O){return qQ(x,O)});if(I)return{graphicalItem:C,payload:I}}else if(L==="RadialBar"){var z=(T.data||[]).find(function(O){return $k(x,O)});if(z)return{graphicalItem:C,payload:z}}else if(_p(C,w)||Np(C,w)||nu(C,w)){var D=YJ({graphicalItem:C,activeTooltipItem:w,itemData:R.data}),F=R.activeIndex===void 0?D:R.activeIndex;return{graphicalItem:Q(Q({},C),{},{childIndex:F}),payload:nu(C,w)?R.data[D]:C.props.data[D]}}}return null}},{key:"render",value:function(){var x=this;if(!j1(this))return null;var k=this.props,S=k.children,w=k.className,_=k.width,N=k.height,C=k.style,T=k.compact,$=k.title,R=k.desc,L=VE(k,Gre),I=qe(L,!1);if(T)return W.createElement(PE,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},W.createElement(Ay,Js({},I,{width:_,height:N,title:$,desc:R}),this.renderClipPath(),T1(S,this.renderMap)));if(this.props.accessibilityLayer){var z,D;I.tabIndex=(z=this.props.tabIndex)!==null&&z!==void 0?z:0,I.role=(D=this.props.role)!==null&&D!==void 0?D:"application",I.onKeyDown=function(O){x.accessibilityManager.keyboardEvent(O)},I.onFocus=function(){x.accessibilityManager.focus()}}var F=this.parseEventsOfWrapper();return W.createElement(PE,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},W.createElement("div",Js({className:Ke("recharts-wrapper",w),style:Q({position:"relative",cursor:"default",width:_,height:N},C)},F,{ref:function(P){x.container=P}}),W.createElement(Ay,Js({},I,{width:_,height:N,title:$,desc:R,style:lie}),this.renderClipPath(),T1(S,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(E.Component);Ae(g,"displayName",n),Ae(g,"defaultProps",Q({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),Ae(g,"getDerivedStateFromProps",function(v,y){var b=v.dataKey,x=v.data,k=v.children,S=v.width,w=v.height,_=v.layout,N=v.stackOffset,C=v.margin,T=y.dataStartIndex,$=y.dataEndIndex;if(y.updateId===void 0){var R=ZE(v);return Q(Q(Q({},R),{},{updateId:0},p(Q(Q({props:v},R),{},{updateId:0}),y)),{},{prevDataKey:b,prevData:x,prevWidth:S,prevHeight:w,prevLayout:_,prevStackOffset:N,prevMargin:C,prevChildren:k})}if(b!==y.prevDataKey||x!==y.prevData||S!==y.prevWidth||w!==y.prevHeight||_!==y.prevLayout||N!==y.prevStackOffset||!oo(C,y.prevMargin)){var L=ZE(v),I={chartX:y.chartX,chartY:y.chartY,isTooltipActive:y.isTooltipActive},z=Q(Q({},XE(y,x,_)),{},{updateId:y.updateId+1}),D=Q(Q(Q({},L),I),z);return Q(Q(Q({},D),p(Q({props:v},D),y)),{},{prevDataKey:b,prevData:x,prevWidth:S,prevHeight:w,prevLayout:_,prevStackOffset:N,prevMargin:C,prevChildren:k})}if(!Ny(k,y.prevChildren)){var F,O,P,A,Y=Wn(k,Oo),K=Y&&(F=(O=Y.props)===null||O===void 0?void 0:O.startIndex)!==null&&F!==void 0?F:T,M=Y&&(P=(A=Y.props)===null||A===void 0?void 0:A.endIndex)!==null&&P!==void 0?P:$,le=K!==T||M!==$,be=!Ve(x),me=be&&!le?y.updateId:y.updateId+1;return Q(Q({updateId:me},p(Q(Q({props:v},y),{},{updateId:me,dataStartIndex:K,dataEndIndex:M}),y)),{},{prevChildren:k,dataStartIndex:K,dataEndIndex:M})}return null}),Ae(g,"renderActiveDot",function(v,y,b){var x;return E.isValidElement(v)?x=E.cloneElement(v,y):$e(v)?x=v(y):x=W.createElement(sP,y),W.createElement(Yt,{className:"recharts-active-dot",key:b},x)});var m=E.forwardRef(function(y,b){return W.createElement(g,Js({},y,{ref:b}))});return m.displayName=g.displayName,m},Ma=vie({chartName:"BarChart",GraphicalChild:fn,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Br},{axisType:"yAxis",AxisComp:zr}],formatAxisMap:xte});function JE(e){return e==null||e<1e-5?"$0.00":e<.01?"$"+e.toFixed(6):"$"+e.toFixed(4)}function Ri(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":e.toLocaleString()}const bie={local:"#3fb950",groq:"#58a6ff",gemini:"#bc8cff",nim:"#39d2c0",openrouter:"#d29922"};function xie({data:e}){var u,d,f;if(!e)return s.jsxs("div",{className:"loading-state",children:[s.jsx("div",{className:"loading-spinner"}),s.jsx("p",{children:"Connecting to dashboard..."})]});const{cost:t,history:n,benchmarks:r,memory:i,health:a}=e,o=[{icon:"💰",value:JE(t.totalCost),label:"Total Cost"},{icon:"📞",value:Ri(t.totalRequests),label:"API Requests"},{icon:"🧠",value:Ri(i.total),label:"Trajectories"},{icon:"📝",value:Ri(n.total),label:"Chat Sessions"},{icon:"🏆",value:Ri(r.totalRuns),label:"Benchmark Runs"},{icon:"📦",value:Ri(a.vectors),label:"Vector Entries"}],l=Object.entries(t.byProvider||{}).map(([h,p])=>({name:h,value:p})).sort((h,p)=>p.value-h.value),c=Object.entries(i.byFingerprint||{}).map(([h,p])=>({name:h.length>15?h.slice(0,13)+"..":h,value:p})).sort((h,p)=>p.value-h.value).slice(0,8);return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"📊 System Overview"}),s.jsx("div",{className:"stats-grid",children:o.map(h=>s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-icon",children:h.icon}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",children:h.value}),s.jsx("div",{className:"stat-label",children:h.label})]})]},h.label))}),s.jsxs("div",{className:"memory-health-card",children:[s.jsx("h3",{className:"section-subtitle",children:"🧠 Memory Health"}),s.jsxs("div",{className:"memory-health-stats",children:[s.jsxs("div",{className:"memory-health-stat",children:[s.jsx("span",{className:"memory-health-value",children:Ri(i.total)}),s.jsx("span",{className:"memory-health-label",children:"Trajectories"})]}),s.jsxs("div",{className:"memory-health-stat",children:[s.jsx("span",{className:"memory-health-value",children:Ri(((u=i.facts)==null?void 0:u.total)||0)}),s.jsx("span",{className:"memory-health-label",children:"Facts Learned"})]}),s.jsxs("div",{className:"memory-health-stat",children:[s.jsx("span",{className:"memory-health-value",children:Ri(((d=i.recall)==null?void 0:d.last7d)||0)}),s.jsx("span",{className:"memory-health-label",children:"Recalls This Week"})]}),s.jsxs("div",{className:"memory-health-stat",children:[s.jsx("span",{className:"memory-health-value",children:a.patterns||0}),s.jsx("span",{className:"memory-health-label",children:"Coding Patterns"})]})]}),s.jsxs("p",{className:"memory-health-status",children:["Backend: ",s.jsx("code",{children:i.backend||"local"}),(f=i.recall)!=null&&f.last7d?` · ${i.recall.last7d} recall(s) this week`:" · no recalls yet"]})]}),s.jsx("h3",{className:"section-subtitle",children:"💰 Cost by Provider"}),s.jsx("div",{className:"chart-container",children:l.length>0?s.jsx(Pa,{width:"100%",height:260,children:s.jsxs(Ma,{data:l,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Wi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Br,{dataKey:"name",tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(zr,{tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"},tickFormatter:h=>"$"+h.toFixed(4)}),s.jsx(hn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"},formatter:h=>[JE(h),"Cost"]}),s.jsx(fn,{dataKey:"value",radius:[4,4,0,0],children:l.map(h=>s.jsx(Pc,{fill:bie[h.name]||"#58a6ff",fillOpacity:.8},h.name))})]})}):s.jsx("div",{className:"empty-state",children:"No cost data yet."})}),s.jsx("h3",{className:"section-subtitle",children:"📊 Trajectories by Project Type"}),s.jsx("div",{className:"chart-container",children:c.length>0?s.jsx(Pa,{width:"100%",height:260,children:s.jsxs(Ma,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Wi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Br,{dataKey:"name",tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(zr,{tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(hn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"}}),s.jsx(fn,{dataKey:"value",fill:"#bc8cff",radius:[4,4,0,0],fillOpacity:.8})]})}):s.jsx("div",{className:"empty-state",children:"No trajectory data yet."})})]})}const e_={planner:"📋","context-gatherer":"📂",writer:"✏️",reviewer:"👁️",tester:"🧪",debugger:"🐛",runner:"▶️",git:"🔀",package:"📦","github-release":"🏷️",security:"🔒",orchestrator:"🎯"},t_={planner:"#58a6ff","context-gatherer":"#39d2c0",writer:"#d29922",reviewer:"#bc8cff",tester:"#3fb950",debugger:"#f85149",runner:"#58a6ff",git:"#f0883e",package:"#db6d28","github-release":"#3fb950",security:"#f85149",orchestrator:"#f0883e"},Zm={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"},n_={pending:{icon:"⏳",label:"Pending"},running:{icon:"▶️",label:"Running"},completed:{icon:"✅",label:"Done"},failed:{icon:"❌",label:"Failed"}},wie={pending:"#6e7681",running:"#58a6ff",completed:"#3fb950",failed:"#f85149"};function Sie(e){if(!e||e.nodes.length===0)return null;const t=e.nodes.map(a=>a.startedAt||0).filter(Boolean),n=e.nodes.map(a=>a.completedAt||0).filter(Boolean),r=t.length>0?Math.min(...t):Date.now(),i=n.length>0?Math.max(...n):Date.now();return{id:`live-${r}`,goal:e.pipeline||"Active execution",startedAt:r,endedAt:n.length>0?i:void 0,success:e.nodes.length>0&&e.nodes.every(a=>a.status==="completed"),totalDurationMs:Math.max(0,i-r),phases:e.nodes.map(a=>({id:a.id,agentType:a.agentType,status:a.status,description:a.description,complexity:a.complexity,summary:a.summary,startedAt:a.startedAt,completedAt:a.completedAt,durationMs:a.startedAt&&a.completedAt?a.completedAt-a.startedAt:void 0}))}}function kie(e,t){const n=[],r=new Set,i=Sie(e);i&&(n.push(i),r.add(i.id));for(const a of(t==null?void 0:t.runs)||[])r.has(a.id)||(n.push(a),r.add(a.id));return n}function Ii(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 r_(e){return e?new Date(e).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}function Eie(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),i=r.reduce((d,f)=>d+f,0),a=i>0?e.map((d,f)=>r[f]>0?r[f]:i/n):e.map(()=>1),o=a.reduce((d,f)=>d+f,0)||1;let l=0;const c=e.map((d,f)=>{const h=a[f]/o,p=l;return l+=h,{...d,start:p,width:h,dur:a[f]}}),u=t>0?t:o;return{laid:c,total:u}}function _ie({runs:e,selectedRunId:t,onSelectRun:n,onScrub:r}){const[i,a]=E.useState(null),o=e.find(_=>_.id===(t??i))??e[0]??null,[l,c]=E.useState(0),[u,d]=E.useState(!1),f=E.useRef(null),h=E.useRef(!1),p=E.useRef(r);E.useEffect(()=>{p.current=r},[r]),E.useEffect(()=>{var _;!o&&e.length>0?a(e[0].id):o&&!e.some(N=>N.id===o.id)&&a(((_=e[0])==null?void 0:_.id)??null)},[e,o]);const{laid:g,total:m}=E.useMemo(()=>Eie((o==null?void 0:o.phases)||[],(o==null?void 0:o.totalDurationMs)||0),[o]),v=m>0?Math.min(1,Math.max(0,l/m)):0,y=E.useMemo(()=>{if(m<=0)return null;const _=v*m;return g.find(N=>_>=N.start*m&&_<(N.start+N.width)*m)||null},[g,v,m]);E.useEffect(()=>{var _;(_=p.current)==null||_.call(p,(y==null?void 0:y.id)??null)},[y==null?void 0:y.id]),E.useEffect(()=>{if(!u)return;const _=setInterval(()=>{c(N=>N+m/2e3*50)},50);return()=>clearInterval(_)},[u,m]),E.useEffect(()=>{u&&m>0&&l>=m&&(d(!1),c(0))},[u,m,l]);const b=E.useCallback(_=>{const N=f.current;if(!N||m<=0)return;const C=N.getBoundingClientRect(),T=C.width||1,$=Math.min(1,Math.max(0,(_-C.left)/T));c($*m)},[m]),x=_=>{h.current=!0,d(!1),b(_.clientX)};if(E.useEffect(()=>{const _=C=>{h.current&&b(C.clientX)},N=()=>{h.current=!1};return window.addEventListener("pointermove",_),window.addEventListener("pointerup",N),()=>{window.removeEventListener("pointermove",_),window.removeEventListener("pointerup",N)}},[b]),!o)return s.jsx("div",{className:"phase-timeline phase-timeline-empty",children:s.jsx("p",{children:"No pipeline runs yet. Run an agent task to see its phase timeline here."})});const k=o.id.startsWith("live-"),S=o.phases.filter(_=>_.status==="completed").length,w=o.phases.filter(_=>_.status==="failed").length;return s.jsxs("div",{className:"phase-timeline",children:[s.jsxs("div",{className:"phase-timeline-header",children:[s.jsx("div",{className:"phase-timeline-runs",children:e.map(_=>s.jsxs("button",{className:`phase-run-chip ${_.id===o.id?"active":""} ${_.id.startsWith("live-")?"live":""}`,onClick:()=>{a(_.id),c(0),d(!1),n==null||n(_.id)},title:_.goal,children:[_.id.startsWith("live-")&&s.jsx("span",{className:"dag-live-dot"}),_.engine&&s.jsx("span",{className:`phase-run-chip-engine phase-run-chip-engine-${_.engine}`,children:_.engine==="loop"?"🔁":"⬡"}),_.goal.length>32?_.goal.slice(0,30)+"…":_.goal,s.jsx("span",{className:"phase-run-chip-time",children:r_(_.startedAt)})]},_.id))}),s.jsxs("div",{className:"phase-timeline-meta",children:[k&&s.jsx("span",{className:"dag-live-badge",children:"LIVE"}),o.engine&&s.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"}),s.jsxs("span",{className:"phase-meta-item",children:[o.phases.length," steps"]}),s.jsxs("span",{className:"phase-meta-item phase-meta-ok",children:["✅ ",S]}),w>0&&s.jsxs("span",{className:"phase-meta-item phase-meta-bad",children:["❌ ",w]}),o.turnTelemetry&&s.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&&s.jsxs("span",{className:"phase-meta-bad",children:[" (",o.turnTelemetry.erroredToolCount," err)"]})]}),s.jsxs("span",{className:"phase-meta-item",children:["⏱ ",Ii(m)]})]})]}),s.jsxs("div",{className:"phase-timeline-controls",children:[s.jsx("button",{className:`phase-play-btn ${u?"paused":""}`,onClick:()=>{u?d(!1):(l>=m&&c(0),d(!0))},"aria-label":u?"Pause scrub":"Play scrub",children:u?"⏸ Pause":"▶ Play"}),s.jsxs("span",{className:"phase-time-label",children:[Ii(l)," / ",Ii(m)]}),s.jsx("input",{className:"phase-range",type:"range",min:0,max:m||1,step:1,value:Math.min(l,m||1),onChange:_=>{d(!1),c(Number(_.target.value))},"aria-label":"Scrub pipeline timeline"})]}),s.jsxs("div",{className:"phase-track-wrap",children:[s.jsxs("div",{ref:f,className:"phase-track",onPointerDown:x,style:{cursor:"grab"},children:[g.map(_=>{const N=t_[_.agentType]||"#58a6ff",C=wie[_.status],T=(y==null?void 0:y.id)===_.id;return s.jsxs("button",{className:`phase-block phase-block-${_.status} ${T?"active":""}`,style:{left:`${_.start*100}%`,width:`${Math.max(_.width*100,2)}%`,background:`linear-gradient(180deg, ${N}cc, ${N}66)`,boxShadow:T?`0 0 0 2px ${C}`:void 0},onClick:$=>{$.stopPropagation(),d(!1),c((_.start+_.width/2)*m)},title:`${Zm[_.agentType]||_.agentType}: ${_.description}`,children:[s.jsx("span",{className:"phase-block-icon",children:e_[_.agentType]||"⚙️"}),s.jsx("span",{className:"phase-block-label",children:Zm[_.agentType]||_.agentType})]},_.id)}),s.jsx("div",{className:"phase-caret",style:{left:`${v*100}%`},onPointerDown:_=>{_.stopPropagation(),x(_)},title:`${Ii(l)} elapsed`})]}),s.jsxs("div",{className:"phase-ticks",children:[s.jsx("span",{children:"0"}),s.jsx("span",{children:Ii(Math.round(m/2))}),s.jsx("span",{children:Ii(m)})]})]}),s.jsx("div",{className:"phase-detail",children:y?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"phase-detail-title",children:[s.jsx("span",{className:"phase-detail-icon",children:e_[y.agentType]||"⚙️"}),s.jsx("span",{className:"phase-detail-agent",style:{color:t_[y.agentType]||"#58a6ff"},children:Zm[y.agentType]||y.agentType}),s.jsxs("span",{className:`phase-status-badge phase-status-${y.status}`,children:[n_[y.status].icon," ",n_[y.status].label]})]}),s.jsx("p",{className:"phase-detail-desc",children:y.description}),s.jsxs("div",{className:"phase-detail-meta",children:[s.jsxs("span",{children:["⏱ ",y.durationMs?Ii(y.dur):`~${Ii(y.dur)}`]}),y.startedAt?s.jsxs("span",{children:["🕐 ",r_(y.startedAt)]}):null,y.complexity?s.jsxs("span",{children:["🎯 ",y.complexity]}):null]}),y.summary&&s.jsx("p",{className:"phase-detail-summary",children:y.summary})]}):s.jsxs("div",{className:"phase-detail-gap",children:[s.jsx("span",{className:"phase-detail-icon",children:"⏳"}),s.jsx("span",{children:"Between steps — waiting for the next agent."})]})})]})}const i_={planner:"📋","context-gatherer":"📂",writer:"✏️",reviewer:"👁️",tester:"🧪",debugger:"🐛",runner:"▶️",git:"🔀",package:"📦","github-release":"🏷️",security:"🔒",orchestrator:"🎯"},Qm={planner:"#58a6ff","context-gatherer":"#39d2c0",writer:"#d29922",reviewer:"#bc8cff",tester:"#3fb950",debugger:"#f85149",runner:"#58a6ff",git:"#f0883e",package:"#db6d28","github-release":"#3fb950",security:"#f85149",orchestrator:"#f0883e"},Nie={pending:{bg:"#1a1f2e",stroke:"#30363d",text:"#6e7681"},running:{bg:"rgba(88, 166, 255, 0.12)",stroke:"#58a6ff",text:"#58a6ff"},completed:{bg:"rgba(63, 185, 80, 0.12)",stroke:"#3fb950",text:"#3fb950"},failed:{bg:"rgba(248, 81, 73, 0.12)",stroke:"#f85149",text:"#f85149"}},a_={pending:"⏳ Pending",running:"▶️ Running",completed:"✅ Done",failed:"❌ Failed"},Ps={trivial:{icon:"🟢",color:"#3fb950"},simple:{icon:"🔵",color:"#58a6ff"},moderate:{icon:"🟡",color:"#d29922"},complex:{icon:"🟠",color:"#f0883e"},critical:{icon:"🔴",color:"#f85149"}},Jm={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 jie(e,t,n=160,r=68,i=40,a=24,o=40){if(e.length===0)return{layoutNodes:[],svgW:400,svgH:200};const l=new Map,c=new Set;function u(v){if(l.has(v))return l.get(v);if(c.has(v))return 0;c.add(v);const y=t.filter(k=>k.to===v);if(y.length===0)return l.set(v,0),0;const x=Math.max(...y.map(k=>u(k.from)))+1;return l.set(v,x),x}for(const v of e)u(v.id);const d=new Map;for(const v of e){const y=l.get(v.id)??0;d.has(y)||d.set(y,[]),d.get(y).push(v)}const f=Math.max(...d.keys()),h=Math.max(...Array.from(d.values()).map(v=>v.length)),p=(f+1)*(n+i)+o*2-i,g=Math.max(h,1)*(r+a)+o*2-a,m=[];for(const v of e){const y=l.get(v.id)??0,b=d.get(y),x=b.indexOf(v),k=b.length,S=k*(r+a)-a,w=g/2-S/2;m.push({...v,x:o+y*(n+i),y:w+x*(r+a),w:n,h:r,step:y,totalInStep:k,indexInStep:x})}return{layoutNodes:m,svgW:p,svgH:g}}function eg(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 s_(e){return e?new Date(e).toLocaleTimeString("en-US",{minute:"2-digit",second:"2-digit"}):""}function Aie({memoryTotal:e}){return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"🔀 Agent Execution DAG"}),s.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."}),s.jsxs("div",{className:"dag-empty",children:[s.jsx("div",{className:"dag-empty-icon",children:"🔀"}),s.jsx("h3",{children:"No Active Pipeline"}),s.jsx("p",{children:"Run an agent task to see the execution pipeline appear here in real time."}),e!==void 0&&e>0&&s.jsxs("p",{className:"dag-empty-hint",children:[s.jsx("code",{children:e})," past executions are stored in memory."]})]})]})}function Tie({data:e}){var O;const t=e==null?void 0:e.dag,n=(O=e==null?void 0:e.memory)==null?void 0:O.total,[r,i]=E.useState(null),[a,o]=E.useState(null),[l,c]=E.useState(void 0),[u,d]=E.useState(void 0),[f,h]=E.useState(void 0);E.useEffect(()=>ee.onDAGEvent(A=>{i(A),c(A.engine),d(A.engineExplanation),h(A.loopTurn)}),[]);const p=t||r,g=r?l:(t==null?void 0:t.engine)??l,m=r?u:(t==null?void 0:t.engineExplanation)??u,v=r?f:(t==null?void 0:t.loopTurn)??f,y=E.useMemo(()=>kie(p,e==null?void 0:e.pipelineRuns),[p,e==null?void 0:e.pipelineRuns]),b=P=>{o(P)},x=!!(p&&(p.nodes.length>0||p.active)),k=y.length>0;if(!x&&!k&&!!!v)return s.jsx(Aie,{memoryTotal:n});const{nodes:w,edges:_,pipeline:N,active:C}=p??{nodes:[],edges:[],pipeline:null,active:!1},{layoutNodes:T,svgW:$,svgH:R}=jie(w,_),L=w.filter(P=>P.status==="running").length,I=w.filter(P=>P.status==="completed").length,z=w.filter(P=>P.status==="failed").length,D=w.filter(P=>P.status==="pending").length,F=w.length;return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"🔀 Agent Execution DAG"}),k&&s.jsxs("div",{className:"dag-timeline-section",children:[s.jsxs("h3",{className:"section-subtitle",children:["⏱ Run Timeline ",s.jsx("span",{className:"timeline-subtitle",children:"— scrub to replay · click a run to switch"})]}),s.jsx(_ie,{runs:y,onScrub:b})]}),v&&s.jsxs("div",{className:"dag-loop-turn-card","data-testid":"dag-loop-turn-card",children:[s.jsxs("div",{className:"dag-loop-turn-header",children:[s.jsx("span",{className:"dag-loop-turn-icon",children:"🔁"}),s.jsxs("span",{className:"dag-loop-turn-title",children:["Loop turn — ",v.title||"chat turn"]}),v.active&&s.jsx("span",{className:"dag-loop-turn-live",children:"● recording"})]}),s.jsxs("div",{className:"dag-loop-turn-meta",children:[s.jsxs("span",{className:"dag-loop-turn-chip",children:["🔧 ",v.toolCallCount," tool call",v.toolCallCount===1?"":"s"]}),v.erroredToolCount>0&&s.jsxs("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-error",children:["❌ ",v.erroredToolCount," errored"]}),v.provider&&s.jsxs("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-dim",children:[v.provider,v.model?` · ${v.model}`:""]}),typeof v.startedAt=="number"&&s.jsxs("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-dim",children:["⏱ ",eg(v.startedAt,v.endedAt)]}),v.bounded&&s.jsx("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-error",children:"⛔ bounded"}),v.generationFailed&&s.jsx("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-error",children:"💀 generation failed"}),v.cancelled&&s.jsx("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-dim",children:"✖ cancelled"})]}),v.toolCalls.length>0&&s.jsx("div",{className:"dag-loop-turn-tools",children:v.toolCalls.slice(-12).map((P,A)=>s.jsxs("span",{className:`dag-loop-tool ${P.ok===!1?"dag-loop-tool-error":""}`,title:P.error||`${P.tool}${P.durationMs!==void 0?` · ${P.durationMs}ms`:""}`,children:[P.ok===!1?"❌":"✓"," ",P.tool]},`${P.tool}-${A}`))})]}),x&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`dag-status-bar ${C?"active":""}`,children:[s.jsxs("div",{className:"dag-pipeline-name",children:[C&&s.jsx("span",{className:"dag-live-dot"}),N||"Execution Pipeline"]}),s.jsxs("div",{className:"dag-pipeline-meta",children:[C&&s.jsx("span",{className:"dag-live-badge",children:"LIVE"}),g&&s.jsx("span",{className:`dag-engine-badge dag-engine-${g}`,title:m||(g==="loop"?"Single agentic loop":"Orchestrator pipeline"),"data-testid":"dag-engine-badge",children:g==="loop"?"🔁 loop engine":"⬡ pipeline engine"}),s.jsxs("span",{className:"dag-step-count",children:[F," steps"]}),L>0&&s.jsxs("span",{className:"dag-running-badge",children:["▶ ",L," running"]}),D>0&&s.jsxs("span",{className:"dag-pending-badge",children:["⏳ ",D," pending"]}),s.jsxs("span",{className:"dag-completed-badge",children:["✅ ",I," done"]}),z>0&&s.jsxs("span",{className:"dag-failed-badge",children:["❌ ",z," failed"]})]})]}),s.jsx("div",{className:"dag-container",children:s.jsxs("svg",{width:$,height:R,viewBox:`0 0 ${$} ${R}`,children:[s.jsxs("defs",{children:[_.map(P=>s.jsx("marker",{id:`arrow-${P.from}-${P.to}`,markerWidth:"8",markerHeight:"6",refX:"8",refY:"3",orient:"auto",children:s.jsx("polygon",{points:"0 0, 8 3, 0 6",fill:"#58a6ff"})},`arrow-${P.from}-${P.to}`)),s.jsxs("filter",{id:"glow",children:[s.jsx("feGaussianBlur",{stdDeviation:"3",result:"coloredBlur"}),s.jsxs("feMerge",{children:[s.jsx("feMergeNode",{in:"coloredBlur"}),s.jsx("feMergeNode",{in:"SourceGraphic"})]})]})]}),_.map(P=>{const A=T.find(X=>X.id===P.from),Y=T.find(X=>X.id===P.to);if(!A||!Y)return null;const K=A.x+A.w,M=A.y+A.h/2,le=Y.x,be=Y.y+Y.h/2,me=(K+le)/2,Pe=Y.status,H=Pe==="failed"?"#f85149":Pe==="running"?"#58a6ff":Pe==="completed"?"#3fb950":"#30363d";return s.jsx("g",{children:s.jsx("path",{d:`M ${K} ${M} C ${me} ${M}, ${me} ${be}, ${le} ${be}`,fill:"none",stroke:H,strokeWidth:Pe==="pending"?1.5:2.5,strokeOpacity:Pe==="pending"?.3:.8,markerEnd:`url(#arrow-${P.from}-${P.to})`,className:"dag-edge"})},`edge-${P.from}-${P.to}`)}),T.map(P=>{const A=Nie[P.status];Qm[P.agentType];const Y=i_[P.agentType]||"⚙️",K=Jm[P.agentType]||P.agentType,M=a===P.id,le=P.status==="running";return s.jsxs("g",{onClick:()=>o(M?null:P.id),style:{cursor:"pointer"},className:"dag-node-group",children:[M&&s.jsx("rect",{x:P.x-4,y:P.y-4,width:P.w+8,height:P.h+8,rx:10,ry:10,fill:"none",stroke:"#58a6ff",strokeWidth:2,strokeOpacity:.5}),s.jsx("rect",{x:P.x,y:P.y,width:P.w,height:P.h,rx:8,ry:8,fill:A.bg,stroke:A.stroke,strokeWidth:le?2.5:1.5,strokeOpacity:.9,className:le?"dag-node-running":"",filter:le?"url(#glow)":void 0}),s.jsxs("text",{x:P.x+10,y:P.y+22,fill:"#e6edf3",fontSize:10,fontWeight:600,children:[Y," ",K]}),s.jsx("text",{x:P.x+P.w-10,y:P.y+22,textAnchor:"end",fill:A.text,fontSize:9,fontWeight:500,children:a_[P.status]}),s.jsx("text",{x:P.x+10,y:P.y+40,fill:"#8b949e",fontSize:9,children:P.description.length>28?P.description.slice(0,26)+"..":P.description}),P.complexity&&Ps[P.complexity]&&s.jsxs("text",{x:P.x+10,y:P.y+54,fill:Ps[P.complexity].color,fontSize:8,fontWeight:600,children:[Ps[P.complexity].icon," ",P.complexity]}),s.jsx("text",{x:P.x+10,y:P.y+56,fill:"#6e7681",fontSize:8,children:eg(P.startedAt,P.completedAt)}),s.jsx("text",{x:P.x+P.w-10,y:P.y+56,textAnchor:"end",fill:"#6e7681",fontSize:8,children:s_(P.startedAt||P.completedAt)}),(P.status==="failed"||M)&&P.summary&&s.jsx("foreignObject",{x:Math.max(10,P.x-80),y:P.y+P.h+6,width:P.w+160,height:36,children:s.jsx("div",{className:"dag-node-summary",style:{color:P.status==="failed"?"#f85149":"#8b949e",fontSize:"10px",lineHeight:1.4,background:"rgba(13,17,23,0.9)",padding:"4px 8px",borderRadius:"4px",border:`1px solid ${P.status==="failed"?"rgba(248,81,73,0.3)":"rgba(48,54,61,0.5)"}`,maxHeight:"32px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:P.summary})})]},`node-${P.id}`)})]})}),s.jsx("h3",{className:"section-subtitle",children:"Step Details"}),s.jsx("div",{className:"dag-table-wrapper",children:s.jsxs("table",{className:"dag-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Step"}),s.jsx("th",{children:"Agent"}),s.jsx("th",{children:"Complexity"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Duration"}),s.jsx("th",{children:"Time"}),s.jsx("th",{children:"Summary"})]})}),s.jsx("tbody",{children:T.map(P=>s.jsxs("tr",{className:`dag-row dag-row-${P.status}`,children:[s.jsx("td",{className:"dag-cell-step",children:P.step}),s.jsxs("td",{className:"dag-cell-agent",children:[s.jsx("span",{className:"dag-agent-dot",style:{background:Qm[P.agentType]||"#58a6ff"}}),Jm[P.agentType]||P.agentType]}),s.jsx("td",{className:"dag-cell-complexity",children:P.complexity&&Ps[P.complexity]?s.jsxs("span",{style:{color:Ps[P.complexity].color,fontSize:12},children:[Ps[P.complexity].icon," ",P.complexity]}):s.jsx("span",{style:{color:"#6e7681",fontSize:12},children:"—"})}),s.jsx("td",{className:`dag-cell-status dag-status-${P.status}`,children:a_[P.status]}),s.jsx("td",{className:"dag-cell-duration",children:eg(P.startedAt,P.completedAt)}),s.jsx("td",{className:"dag-cell-time",children:s_(P.startedAt||P.completedAt)}),s.jsx("td",{className:"dag-cell-summary",children:P.summary||P.description||"--"})]},P.id))})]})}),s.jsx("h3",{className:"section-subtitle",children:"Agent Types"}),s.jsxs("div",{className:"dag-legend",children:[Object.entries(i_).map(([P,A])=>s.jsxs("div",{className:"legend-item",children:[s.jsx("span",{className:"legend-dot",style:{background:Qm[P]||"#58a6ff"}}),s.jsx("span",{className:"legend-icon",children:A}),s.jsx("span",{className:"legend-label",children:Jm[P]||P})]},P)),s.jsxs("div",{className:"legend-item",children:[s.jsx("span",{className:"legend-dot",style:{background:"transparent",border:"2px dashed #58a6ff"}}),s.jsx("span",{className:"legend-icon",children:"⚡"}),s.jsx("span",{className:"legend-label",children:"Live node"})]})]})]})]})}function Ms(e){return e==null||e<1e-5?"$0.00":e<.01?"$"+e.toFixed(6):"$"+e.toFixed(4)}function $l(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":e.toLocaleString()}function Cie(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Oie({data:e}){if(!e)return s.jsx("div",{className:"loading-state",children:s.jsx("p",{children:"Loading cost data..."})});const{cost:t}=e,n=Object.entries(t.byProvider||{}).sort(([,a],[,o])=>o-a),r=Object.entries(t.byModel||{}).sort(([,a],[,o])=>o-a).slice(0,10),i=n.reduce((a,[,o])=>a+o,0);return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"💰 Cost Tracking"}),s.jsxs("div",{className:"cost-summary",children:[s.jsxs("div",{className:"cost-total",children:[s.jsx("span",{className:"cost-label",children:"Total Spent"}),s.jsx("span",{className:"cost-amount",children:Ms(t.totalCost)})]}),s.jsxs("div",{className:"cost-total",children:[s.jsx("span",{className:"cost-label",children:"Total Tokens"}),s.jsx("span",{className:"cost-amount",children:$l(t.totalTokens)})]}),s.jsxs("div",{className:"cost-total",children:[s.jsx("span",{className:"cost-label",children:"Total Requests"}),s.jsx("span",{className:"cost-amount",children:$l(t.totalRequests)})]})]}),s.jsxs("div",{className:"cost-summary cost-summary-sub",children:[s.jsxs("div",{className:"cost-total",children:[s.jsx("span",{className:"cost-label",children:"📏 Measured (exact wire tokens)"}),s.jsx("span",{className:"cost-amount",children:Ms(t.measuredCost)}),s.jsxs("span",{className:"cost-label",children:[$l(t.measuredCalls)," calls"]})]}),s.jsxs("div",{className:"cost-total",children:[s.jsx("span",{className:"cost-label",children:"📐 Estimated (length-based)"}),s.jsx("span",{className:"cost-amount",children:Ms(t.estimatedCost)}),s.jsxs("span",{className:"cost-label",children:[$l(t.estimatedCalls)," calls"]})]})]}),s.jsx("h3",{className:"section-subtitle",children:"By Provider"}),s.jsx("div",{className:"cost-list",children:n.length===0?s.jsx("div",{className:"empty-state",children:"No costs recorded yet."}):n.map(([a,o])=>{const l=i>0?(o/i*100).toFixed(1):"0";return s.jsxs("div",{className:"cost-row",children:[s.jsx("span",{className:"cost-row-name",children:a}),s.jsx("div",{className:"cost-row-bar",children:s.jsx("div",{className:"cost-row-fill",style:{width:`${l}%`}})}),s.jsx("span",{className:"cost-row-value",children:Ms(o)})]},a)})}),s.jsx("h3",{className:"section-subtitle",children:"By Model"}),s.jsx("div",{className:"cost-list",children:r.length===0?s.jsx("div",{className:"empty-state",children:"No model costs recorded yet."}):r.map(([a,o])=>{const l=i>0?(o/i*100).toFixed(1):"0",c=a.length>30?a.slice(0,28)+"..":a;return s.jsxs("div",{className:"cost-row",children:[s.jsx("span",{className:"cost-row-name",children:c}),s.jsx("div",{className:"cost-row-bar",children:s.jsx("div",{className:"cost-row-fill",style:{width:`${l}%`}})}),s.jsx("span",{className:"cost-row-value",children:Ms(o)})]},a)})}),s.jsx("h3",{className:"section-subtitle",children:"Recent Requests"}),s.jsx("div",{className:"request-list",children:!t.recent||t.recent.length===0?s.jsx("div",{className:"empty-state",children:"No requests recorded yet."}):t.recent.slice(0,30).map((a,o)=>s.jsxs("div",{className:"request-row",children:[s.jsx("span",{className:"request-time",children:Cie(a.timestamp)}),s.jsx("span",{className:"request-provider",children:a.provider||"--"}),s.jsx("span",{className:"request-model",children:a.model||"--"}),s.jsx("span",{className:"request-cost",children:Ms(a.costUsd)}),s.jsxs("span",{className:"request-tokens",children:[$l(a.totalTokens)," tok"]})]},o))})]})}function Pie(e){return e==null?"$0.00":"$"+e.toFixed(6)}function pd(e){return e==null?"0%":(e*100).toFixed(1)+"%"}function Mie({data:e}){if(!e)return s.jsx("div",{className:"loading-state",children:s.jsx("p",{children:"Loading benchmark data..."})});const{benchmarks:t,evals:n}=e,r=t.latest,i=t.runs||[],a=(n==null?void 0:n.runs)||[],o=(n==null?void 0:n.latest)||null,l=a.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=i.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 s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"📈 Benchmark Results"}),s.jsx("div",{className:"benchmark-latest",children:r?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"benchmark-header",children:[s.jsx("strong",{children:"Latest Run:"})," ",r.provider,"/",r.model]}),s.jsxs("div",{className:"benchmark-stats",children:[s.jsxs("div",{className:"benchmark-stat pass",children:[s.jsxs("div",{className:"benchmark-stat-value",children:[r.summary.tasksPassed,"/",r.summary.totalTasks]}),s.jsx("div",{className:"benchmark-stat-label",children:"Passed"})]}),s.jsxs("div",{className:"benchmark-stat quality",children:[s.jsx("div",{className:"benchmark-stat-value",children:pd(r.summary.avgQualityScore)}),s.jsx("div",{className:"benchmark-stat-label",children:"Quality"})]}),s.jsxs("div",{className:"benchmark-stat latency",children:[s.jsxs("div",{className:"benchmark-stat-value",children:[r.summary.medianLatencyMs,"ms"]}),s.jsx("div",{className:"benchmark-stat-label",children:"Latency"})]}),s.jsxs("div",{className:"benchmark-stat fail",children:[s.jsx("div",{className:"benchmark-stat-value",children:Pie(r.summary.totalCostUsd)}),s.jsx("div",{className:"benchmark-stat-label",children:"Cost"})]})]})]}):s.jsxs("div",{className:"empty-state",children:["No benchmark runs yet. Run ",s.jsx("code",{children:"buff benchmark"})," to start."]})}),c.length>1&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"section-subtitle",children:"Pass Rate by Model"}),s.jsx("div",{className:"chart-container",children:s.jsx(Pa,{width:"100%",height:260,children:s.jsxs(Ma,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Wi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Br,{dataKey:"name",tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(zr,{domain:[0,100],tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"},tickFormatter:u=>u+"%"}),s.jsx(hn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"},formatter:u=>[u+"%","Pass Rate"]}),s.jsx(fn,{dataKey:"passRate",radius:[4,4,0,0],children:c.map((u,d)=>s.jsx(Pc,{fill:u.passRate>=80?"#3fb950":u.passRate>=50?"#d29922":"#f85149",fillOpacity:.8},d))})]})})}),s.jsx("h3",{className:"section-subtitle",children:"Latency by Model"}),s.jsx("div",{className:"chart-container",children:s.jsx(Pa,{width:"100%",height:260,children:s.jsxs(Ma,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Wi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Br,{dataKey:"name",tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(zr,{tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"},tickFormatter:u=>u+"ms"}),s.jsx(hn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"},formatter:u=>[u+"ms","Latency"]}),s.jsx(fn,{dataKey:"latency",fill:"#d29922",radius:[4,4,0,0],fillOpacity:.8})]})})}),s.jsx("h3",{className:"section-subtitle",children:"Cost by Model"}),s.jsx("div",{className:"chart-container",children:s.jsx(Pa,{width:"100%",height:260,children:s.jsxs(Ma,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Wi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Br,{dataKey:"name",tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(zr,{tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"},tickFormatter:u=>"$"+u.toFixed(6)}),s.jsx(hn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"},formatter:u=>["$"+u.toFixed(6),"Cost"]}),s.jsx(fn,{dataKey:"cost",fill:"#bc8cff",radius:[4,4,0,0],fillOpacity:.8})]})})})]}),s.jsx("h2",{className:"section-title",style:{marginTop:32},children:"🎯 Agent Evaluation"}),s.jsx("p",{className:"section-hint",style:{color:"#8b949e",fontSize:12,marginBottom:16},children:"End-to-end coding tasks run through the full agent pipeline — measures if the agent is actually improving."}),s.jsx("div",{className:"benchmark-latest",children:o?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"benchmark-header",children:[s.jsx("strong",{children:"Latest Eval Run:"})," ",o.provider,"/",o.model]}),s.jsxs("div",{className:"benchmark-stats",children:[s.jsxs("div",{className:"benchmark-stat pass",children:[s.jsxs("div",{className:"benchmark-stat-value",children:[o.summary.tasksPassed,"/",o.summary.totalTasks]}),s.jsx("div",{className:"benchmark-stat-label",children:"Tests Passed"})]}),s.jsxs("div",{className:"benchmark-stat quality",children:[s.jsx("div",{className:"benchmark-stat-value",children:pd(o.summary.avgCompositeScore)}),s.jsx("div",{className:"benchmark-stat-label",children:"Composite Score"})]}),s.jsxs("div",{className:"benchmark-stat latency",children:[s.jsx("div",{className:"benchmark-stat-value",children:pd(o.summary.recoveryRate)}),s.jsx("div",{className:"benchmark-stat-label",children:"Recovery Rate"})]}),s.jsxs("div",{className:"benchmark-stat fail",children:[s.jsx("div",{className:"benchmark-stat-value",children:o.summary.totalRollbacks}),s.jsx("div",{className:"benchmark-stat-label",children:"Rollbacks"})]}),s.jsxs("div",{className:"benchmark-stat deps",children:[s.jsx("div",{className:"benchmark-stat-value",children:pd(o.summary.dependencyInstallRate)}),s.jsx("div",{className:"benchmark-stat-label",children:"Deps Installed"})]})]})]}):s.jsxs("div",{className:"empty-state",children:["No eval runs yet. Run ",s.jsx("code",{children:"buff eval run"})," to measure the agent end-to-end."]})}),l.length>1&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"section-subtitle",children:"Composite Score by Model"}),s.jsx("div",{className:"chart-container",children:s.jsx(Pa,{width:"100%",height:260,children:s.jsxs(Ma,{data:l,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Wi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Br,{dataKey:"name",tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(zr,{domain:[0,100],tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"},tickFormatter:u=>u+"%"}),s.jsx(hn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"},formatter:u=>[u+"%","Composite Score"]}),s.jsx(fn,{dataKey:"score",radius:[4,4,0,0],children:l.map((u,d)=>s.jsx(Pc,{fill:u.score>=80?"#3fb950":u.score>=50?"#d29922":"#f85149",fillOpacity:.8},d))})]})})}),s.jsx("h3",{className:"section-subtitle",children:"Metric Breakdown (completion / tests / recovery / token efficiency)"}),s.jsx("div",{className:"chart-container",children:s.jsx(Pa,{width:"100%",height:260,children:s.jsxs(Ma,{data:l,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Wi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Br,{dataKey:"name",tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(zr,{domain:[0,100],tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"},tickFormatter:u=>u+"%"}),s.jsx(hn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"}}),s.jsx(Ga,{wrapperStyle:{color:"#8b949e"}}),s.jsx(fn,{dataKey:"completion",name:"Completion",fill:"#3fb950",radius:[4,4,0,0],fillOpacity:.8}),s.jsx(fn,{dataKey:"tests",name:"Tests",fill:"#58a6ff",radius:[4,4,0,0],fillOpacity:.8}),s.jsx(fn,{dataKey:"recovery",name:"Recovery",fill:"#d29922",radius:[4,4,0,0],fillOpacity:.8}),s.jsx(fn,{dataKey:"efficiency",name:"Token Eff.",fill:"#bc8cff",radius:[4,4,0,0],fillOpacity:.8})]})})})]}),s.jsx("h3",{className:"section-subtitle",children:"Eval Run History"}),s.jsx("div",{className:"benchmark-list",children:a.length===0?s.jsxs("div",{className:"empty-state",children:["No eval runs yet. Run ",s.jsx("code",{children:"buff eval run"})," to start."]}):a.map(u=>{const d=Math.round(u.summary.avgCompositeScore*100),f=d>=80?"high":d>=50?"medium":"low";return s.jsxs("div",{className:"benchmark-item",children:[s.jsx("span",{className:"benchmark-date",children:new Date(u.startedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})}),s.jsxs("span",{className:"benchmark-model",children:[u.provider,"/",u.model]}),s.jsxs("span",{className:`benchmark-score ${f}`,children:[d,"%"]})]},u.id)})}),s.jsx("h3",{className:"section-subtitle",children:"Run History"}),s.jsx("div",{className:"benchmark-list",children:i.length===0?s.jsxs("div",{className:"empty-state",children:["No benchmark runs yet. Run ",s.jsx("code",{children:"buff benchmark"})," to start."]}):i.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 s.jsxs("div",{className:"benchmark-item",children:[s.jsx("span",{className:"benchmark-date",children:new Date(u.startedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})}),s.jsxs("span",{className:"benchmark-model",children:[u.provider,"/",u.model]}),s.jsxs("span",{className:`benchmark-score ${f}`,children:[d,"%"]})]},u.id)})})]})}function tg(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":e.toLocaleString()}function Rie({data:e}){if(!e)return s.jsx("div",{className:"loading-state",children:s.jsx("p",{children:"Loading system data..."})});const{health:t,serverTime:n}=e;return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"⚙️ System Health"}),s.jsxs("div",{className:"health-grid",children:[s.jsxs("div",{className:"health-card",children:[s.jsx("span",{className:"health-icon",children:"💾"}),s.jsxs("div",{className:"health-body",children:[s.jsx("div",{className:"health-title",children:"Memory Directory"}),s.jsx("div",{className:"health-path",children:t.memoryDir||"~/.buff/memory/"})]})]}),s.jsxs("div",{className:"health-card",children:[s.jsx("span",{className:"health-icon",children:"📝"}),s.jsxs("div",{className:"health-body",children:[s.jsx("div",{className:"health-title",children:"Coding Patterns"}),s.jsx("div",{className:"health-value",children:tg(t.patterns)})]})]}),s.jsxs("div",{className:"health-card",children:[s.jsx("span",{className:"health-icon",children:"👍"}),s.jsxs("div",{className:"health-body",children:[s.jsx("div",{className:"health-title",children:"User Feedback"}),s.jsxs("div",{className:"health-value",children:[tg(t.feedback)," ratings"]})]})]}),s.jsxs("div",{className:"health-card",children:[s.jsx("span",{className:"health-icon",children:"🧠"}),s.jsxs("div",{className:"health-body",children:[s.jsx("div",{className:"health-title",children:"Vector Index"}),s.jsxs("div",{className:"health-value",children:[tg(t.vectors)," entries"]})]})]})]}),s.jsx("h3",{className:"section-subtitle",children:"Server Info"}),s.jsxs("div",{className:"server-info",children:[s.jsxs("div",{className:"info-row",children:[s.jsx("span",{className:"info-label",children:"Status"}),s.jsx("span",{className:"info-value",children:"● Connected"})]}),s.jsxs("div",{className:"info-row",children:[s.jsx("span",{className:"info-label",children:"Last Updated"}),s.jsx("span",{className:"info-value",children:n?new Date(n).toLocaleString():"--"})]}),s.jsxs("div",{className:"info-row",children:[s.jsx("span",{className:"info-label",children:"Data Directory"}),s.jsx("span",{className:"info-value",children:t.memoryDir||"~/.buff/memory/"})]})]})]})}const Iie=new Set(["local","lmstudio","vllm"]),$ie=new Set([]),gh={available:{bg:"#0a2e1a",text:"#3fb950",dot:"#3fb950",cardBorder:"#3fb950",cardBg:"#0d2818"},limited:{bg:"#2d1f00",text:"#d29922",dot:"#d29922",cardBorder:"#d29922",cardBg:"#1f1700"},unavailable:{bg:"#2d0f0f",text:"#f85149",dot:"#f85149",cardBorder:"#f85149",cardBg:"#1f0a0a"}},Lie=[3,4,5],XP=12e3,o_=[300,700],Die=6e4,Bie=5e3;function zie(e){return new Promise(t=>setTimeout(t,e))}async function ZP(e,t){const n=new AbortController,r=setTimeout(()=>n.abort(),t);try{return await fetch(e,{signal:n.signal})}finally{clearTimeout(r)}}function QP(e){return e instanceof TypeError||e instanceof Error&&e.name==="AbortError"}async function Fie(e){let t=null,n=!1;for(let r=0;;r++){try{const i=await ZP("/api/models",XP);if(!i.ok)t=i.status;else{const a=await ni(i);if(a&&Array.isArray(a.providers))return a;throw new Error("Model health endpoint returned an unexpected response — is the dashboard server up to date?")}}catch(i){if(!QP(i))throw i;n=!0,e==null||e()}if(r>=o_.length)throw new Error(n?"Dashboard server unreachable — is it still running? Retrying automatically…":`Model health endpoint failed (HTTP ${t})`);await zie(o_[r])}}async function Uie(e){for(let t=0;;t++)try{const n=await ZP("/api/model-registry",XP);return n.ok?await ni(n):null}catch(n){if(!QP(n)||t>=1)return null;e==null||e()}}function Wie(e){return e==="available"?"Available":e==="limited"?"Limited":"Unavailable"}function Hie(e){return e==="available"?"Ready":e==="limited"?"Limited":"Down"}function JP(e){return{local:"💻",groq:"🟢",nim:"🔶",gemini:"🔷",openrouter:"🟣",openai:"🤖",anthropic:"🔮",mistral:"🌀",cohere:"🧠",together:"🟢",deepinfra:"🌐",fireworks:"🎆",perplexity:"❓",azure:"🔵",anyscale:"🔷",lmstudio:"🎨",vllm:"⚡"}[e]||"🔌"}function u0(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 l_({status:e,label:t}){const n=gh[e];return s.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:[s.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:n.dot}}),t]})}function Gie({onRefresh:e,loading:t}){return s.jsxs("div",{className:"stats-grid mini",style:{marginBottom:16},children:[s.jsx("button",{onClick:e,disabled:t,className:"stat-card",style:{cursor:t?"not-allowed":"pointer",opacity:t?.6:1,border:"1px solid #30363d",justifyContent:"center",fontSize:13},children:t?"⏳ Testing...":"🔄 Refresh Status"}),s.jsx("div",{className:"stat-card",style:{border:"1px solid #30363d"},children:s.jsx("div",{style:{fontSize:13,color:"#8b949e",textAlign:"center",width:"100%"},children:"Tests all configured providers and their API keys in real time"})})]})}function qie({data:e}){const t=e.totalModels;if(t===0)return null;const n=e.available||0,r=e.limited||0,i=e.unavailable||0;return s.jsxs("div",{style:{marginBottom:16},children:[s.jsxs("div",{style:{background:"#0d1117",borderRadius:8,overflow:"hidden",height:10,display:"flex",border:"1px solid #21262d"},children:[n>0&&s.jsx("div",{style:{width:`${n/t*100}%`,background:"#3fb950",transition:"width 0.5s"},title:`${n} available`}),r>0&&s.jsx("div",{style:{width:`${r/t*100}%`,background:"#d29922",transition:"width 0.5s"},title:`${r} limited`}),i>0&&s.jsx("div",{style:{width:`${i/t*100}%`,background:"#f85149",transition:"width 0.5s"},title:`${i} unavailable`})]}),s.jsxs("div",{style:{display:"flex",gap:16,marginTop:6,fontSize:12,color:"#8b949e"},children:[s.jsxs("span",{children:[s.jsx("span",{style:{color:"#3fb950"},children:"●"})," Ready"]}),s.jsxs("span",{children:[s.jsx("span",{style:{color:"#d29922"},children:"●"})," Limited"]}),s.jsxs("span",{children:[s.jsx("span",{style:{color:"#f85149"},children:"●"})," Unavailable"]})]}),typeof e.routable=="number"&&s.jsxs("div",{style:{marginTop:6,fontSize:12,color:"#8b949e",lineHeight:1.5},children:[s.jsx("strong",{style:{color:"#e6edf3"},children:t})," listed by providers ·"," ",s.jsx("strong",{style:{color:e.routable>0?"#3fb950":"#d29922"},children:e.routable})," ","routable right now (verified, un-parked, not stale)",typeof e.registryTotal=="number"&&e.registryTotal>0&&s.jsxs(s.Fragment,{children:[" ","· registry tracks"," ",s.jsx("strong",{style:{color:"#e6edf3"},children:e.registryVerified??0})," of"," ",s.jsx("strong",{style:{color:"#e6edf3"},children:e.registryTotal})," verified"]})]})]})}function md({provider:e}){const[t,n]=E.useState(!1),r=gh[e.overallStatus].text,i={available:e.models.filter(a=>a.status==="available").length,limited:e.models.filter(a=>a.status==="limited").length,unavailable:e.models.filter(a=>a.status==="unavailable").length};return s.jsxs("div",{style:{background:"#161b22",borderRadius:12,border:`1px solid ${r}44`,borderLeft:`4px solid ${r}`,marginBottom:12,overflow:"hidden"},children:[s.jsxs("div",{onClick:()=>n(!t),style:{padding:"14px 18px",cursor:"pointer",display:"flex",alignItems:"center",gap:14,userSelect:"none"},children:[s.jsx("span",{style:{fontSize:24},children:e.icon}),s.jsxs("div",{style:{flex:1},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:2},children:[s.jsx("span",{style:{fontSize:16,fontWeight:600,color:"#e6edf3"},children:e.providerLabel}),s.jsx(l_,{status:e.overallStatus,label:Wie(e.overallStatus)})]}),s.jsxs("div",{style:{fontSize:13,color:"#8b949e"},children:[e.models.length," model",e.models.length!==1?"s":"",i.available>0&&s.jsxs("span",{style:{color:"#3fb950"},children:[" · ",i.available," ready"]}),i.limited>0&&s.jsxs("span",{style:{color:"#d29922"},children:[" · ",i.limited," limited"]}),i.unavailable>0&&s.jsxs("span",{style:{color:"#f85149"},children:[" · ",i.unavailable," unavailable"]})]})]}),s.jsxs("div",{style:{fontSize:12,color:"#8b949e",textAlign:"right"},children:[s.jsx("div",{style:{marginBottom:2,color:e.apiConfigured?"#3fb950":"#f85149"},children:e.apiConfigured?"✅ Key set":"❌ No key"}),s.jsx("div",{style:{color:e.apiAccessible?"#3fb950":"#f85149"},children:e.apiAccessible?"✅ Connected":"❌ Offline"})]}),s.jsx("span",{style:{color:"#8b949e",fontSize:18,transition:"transform 0.2s",transform:t?"rotate(90deg)":"rotate(0deg)"},children:"▶"})]}),t&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{padding:"10px 18px",background:"#0d1117",fontSize:13,color:"#8b949e",display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:8,borderTop:"1px solid #21262d"},children:[s.jsx("span",{children:e.notes}),e.freeTierInfo&&s.jsxs("span",{style:{color:"#d29922"},children:["🎁 ",e.freeTierInfo]})]}),s.jsx("div",{style:{overflowX:"auto",borderTop:"1px solid #21262d"},children:s.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[s.jsx("thead",{children:s.jsxs("tr",{style:{borderBottom:"1px solid #21262d",color:"#8b949e"},children:[s.jsx("th",{style:{padding:"8px 18px",textAlign:"left",fontWeight:500},children:"Model"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Status"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Quota"}),s.jsx("th",{style:{padding:"8px 18px",textAlign:"left",fontWeight:500},children:"Details"})]})}),s.jsx("tbody",{children:e.models.map((a,o)=>s.jsxs("tr",{style:{borderBottom:o<e.models.length-1?"1px solid #21262d":"none",background:a.status==="unavailable"?"#0d1117":"transparent"},children:[s.jsxs("td",{style:{padding:"8px 18px",color:"#e6edf3",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:[s.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:gh[a.status].dot,marginRight:8}}),a.name]}),s.jsx("td",{style:{padding:"8px 12px"},children:s.jsx(l_,{status:a.status,label:Hie(a.status)})}),s.jsx("td",{style:{padding:"8px 12px",color:"#8b949e",fontSize:12,fontFamily:"'SFMono-Regular', Consolas, monospace"},children:a.rateLimitRemaining!==void 0?a.rateLimitTotal?`${a.rateLimitRemaining}/${a.rateLimitTotal}`:`${a.rateLimitRemaining} left`:"—"}),s.jsx("td",{style:{padding:"8px 18px",color:"#8b949e",fontSize:12},children:a.statusReason})]},a.id))})]})})]})]})}function eM(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 Kie(e){return e==="verified"?{text:"#3fb950",bg:"#0a2e1a",dot:"#3fb950"}:e==="unavailable"?{text:"#f85149",bg:"#2d0f0f",dot:"#f85149"}:{text:"#8b949e",bg:"#21262d",dot:"#8b949e"}}function Vie({rate:e}){const t=Math.round(e*100);return s.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:"#21122e",border:"1px solid #bc8cff",color:"#bc8cff"},children:["⏸ flaky ",t,"%"]})}function Yie({tokens:e}){const t=e>=1048576?`${(e/1048576).toFixed(1).replace(/\.0$/,"")}M`:e>=1024?`${(e/1024).toFixed(0)}K`:`${e}`;return s.jsxs("span",{title:`⏳ context window ${e.toLocaleString()} 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:"#0a1e2e",border:"1px solid #58a6ff",color:"#58a6ff"},children:["⏳ ",t]})}function Xie({history:e}){if(!e||e.length<2)return null;const t=46,n=14,r=1.5,i=Math.max(.01,...e.map(d=>d.rate)),a=e.map((d,f)=>{const h=r+f/(e.length-1)*(t-r*2),p=n-r-d.rate/i*(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 s.jsxs("svg",{width:t,height:n,viewBox:`0 0 ${t} ${n}`,style:{marginLeft:8,verticalAlign:"middle",cursor:"default"},"aria-label":"Flakiness trend",children:[s.jsx("title",{children:c?`Flakiness healing — ${u}% now, trending down (clean successes decay the signal)`:`Flakiness climbing — ${u}% now (recent mid-stream interruptions)`}),s.jsx("polyline",{points:a,fill:"none",stroke:"#bc8cff",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",opacity:.9}),s.jsx("circle",{cx:t-r,cy:n-r-l/i*(n-r*2),r:2,fill:c?"#3fb950":"#bc8cff"})]})}function Zie({entry:e}){const t=Kie(e.status),n=e.remainingTokens>=0?`${e.remainingTokens.toLocaleString()} left`:"unlimited";return s.jsxs("tr",{style:{borderBottom:"1px solid #21262d"},children:[s.jsxs("td",{style:{padding:"8px 12px",color:"#e6edf3",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:[s.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&&s.jsx(Vie,{rate:e.partialRate??0}),e.partialHistory&&e.partialHistory.length>=2&&s.jsx(Xie,{history:e.partialHistory}),e.parked&&s.jsx("span",{style:{marginLeft:8,fontSize:10,padding:"1px 6px",borderRadius:8,background:"#2d1616",border:"1px solid #f85149",color:"#f85149"},children:"⏸ parked"}),e.measuredSamples?s.jsxs("span",{style:{marginLeft:8,fontSize:10,padding:"1px 6px",borderRadius:8,whiteSpace:"nowrap",background:"#0a2e1a",border:"1px solid #3fb950",color:"#3fb950"},children:["📏 ",e.measuredInputTokens,"→",e.measuredOutputTokens," tok"]}):s.jsx("span",{style:{marginLeft:8,fontSize:10,padding:"1px 6px",borderRadius:8,whiteSpace:"nowrap",background:"#21262d",border:"1px solid #8b949e",color:"#8b949e"},children:"📐 est"}),e.contextWindowTokens&&s.jsx(Yie,{tokens:e.contextWindowTokens})]}),s.jsx("td",{style:{padding:"8px 12px"},children:s.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"})}),s.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:e.remainingTokens>=0&&e.remainingTokens<=100?"#d29922":"#8b949e"},children:n}),s.jsx("td",{style:{padding:"8px 12px",textAlign:"right",color:"#8b949e",fontSize:12,whiteSpace:"nowrap"},children:e.resetsInMs>0?eM(e.resetsInMs):"—"}),s.jsx("td",{style:{padding:"8px 12px",textAlign:"right",color:"#8b949e",fontSize:12,fontFamily:"'SFMono-Regular', Consolas, monospace"},children:e.latencyMs!==void 0?`${e.latencyMs}ms`:"—"}),s.jsx("td",{style:{padding:"8px 12px",color:"#6e7681",fontSize:11,maxWidth:180,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.lastError||(e.source?`learned via ${e.source}`:"")})]})}function Qie({provider:e}){const[t,n]=E.useState(!1),r=e.verified>0?"#3fb950":e.unavailable>0?"#f85149":"#8b949e";return s.jsxs("div",{style:{background:"#161b22",borderRadius:12,border:`1px solid ${r}44`,borderLeft:`4px solid ${r}`,marginBottom:12,overflow:"hidden"},children:[s.jsxs("div",{onClick:()=>n(!t),style:{padding:"14px 18px",cursor:"pointer",display:"flex",alignItems:"center",gap:14,userSelect:"none"},children:[s.jsx("span",{style:{fontSize:24},children:JP(e.provider)}),s.jsxs("div",{style:{flex:1},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:2},children:[s.jsx("span",{style:{fontSize:16,fontWeight:600,color:"#e6edf3"},children:u0(e.provider)}),s.jsx("span",{style:{fontSize:11,padding:"2px 8px",borderRadius:10,background:e.parked>0?"#2d1616":"#12291a",border:`1px solid ${e.parked>0?"#f85149":"#238636"}`,color:e.parked>0?"#f85149":"#3fb950"},children:e.parked>0?`${e.parked} parked`:"routable"}),(e.flaky??0)>0&&s.jsxs("span",{style:{fontSize:11,padding:"2px 8px",borderRadius:10,background:"#21122e",border:"1px solid #bc8cff",color:"#bc8cff"},children:["⏸ ",e.flaky," flaky"]})]}),s.jsxs("div",{style:{fontSize:13,color:"#8b949e"},children:[e.verified," verified · ",e.unverified," unverified · ",e.unavailable," unavailable"]})]}),s.jsx("span",{style:{color:"#8b949e",fontSize:18,transition:"transform 0.2s",transform:t?"rotate(90deg)":"rotate(0deg)"},children:"▶"})]}),t&&s.jsx("div",{style:{overflowX:"auto",borderTop:"1px solid #21262d"},children:s.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[s.jsx("thead",{children:s.jsxs("tr",{style:{borderBottom:"1px solid #21262d",color:"#8b949e"},children:[s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Model"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Availability"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"right",fontWeight:500},children:"Tokens left"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"right",fontWeight:500},children:"Resets in"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"right",fontWeight:500},children:"Latency"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Reason / Source"})]})}),s.jsx("tbody",{children:e.models.map(i=>s.jsx(Zie,{entry:i},i.model))})]})})]})}function Jie(e){if(!e)return null;const t=Object.entries(e.consecutive).filter(([,n])=>n>0);return t.length===0?null:s.jsxs("div",{style:{background:"rgba(210, 153, 34, 0.08)",border:"1px solid #9e6a03",borderRadius:10,padding:"10px 14px",marginBottom:14,fontSize:12,color:"#d29922",display:"flex",gap:10,alignItems:"flex-start"},children:[s.jsx("span",{style:{fontSize:15,lineHeight:"18px"},children:"🧹"}),s.jsxs("div",{children:[s.jsx("div",{style:{fontWeight:600,color:"#e3b341",marginBottom:2},children:"Key hygiene in progress"}),s.jsx("div",{children:t.map(([n,r])=>s.jsxs("span",{style:{display:"inline-block",marginRight:12},children:[s.jsx("code",{style:{color:"#e6edf3"},children:n})," ",r,"/",e.threshold," consecutive auth failures",r>=e.threshold?" — key auto-cleared 🚫":" — key will be auto-cleared at the threshold"]},n))}),s.jsxs("div",{style:{marginTop:4,color:"#9e6a03"},children:["After ",e.threshold," consecutive 401/403s the invalid key is removed from config; run"," ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff config set providers.<provider>.apiKey <real-key>"})," to re-enable."]})]})]})}function eae({data:e}){return e.enabled?s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",style:{marginTop:36},children:"📦 Model Availability Registry — the store routing reads"}),s.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 ",s.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."]}),s.jsxs("div",{className:"stats-grid",style:{marginBottom:16},children:[s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"📦"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",children:e.total}),s.jsx("div",{className:"stat-label",children:"Tracked models"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"✅"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:"#3fb950"},children:e.verified}),s.jsx("div",{className:"stat-label",children:"Verified"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"◌"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:"#8b949e"},children:e.unverified}),s.jsx("div",{className:"stat-label",children:"Unverified"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"⛔"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:"#f85149"},children:e.unavailable}),s.jsx("div",{className:"stat-label",children:"Unavailable"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"⏸"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:"#d29922"},children:e.parked}),s.jsx("div",{className:"stat-label",children:"Quota-parked"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"⏸"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:"#bc8cff"},children:e.flaky??0}),s.jsx("div",{className:"stat-label",children:"Flaky mid-stream"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"🗑️"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:"#8b949e"},children:e.deletedLocal??0}),s.jsx("div",{className:"stat-label",children:"Deleted locally"})]})]})]}),Jie(e.keyHygiene),e.providers.map(t=>s.jsx(Qie,{provider:t},t.provider)),s.jsx("div",{style:{textAlign:"center",fontSize:12,color:"#484f58",marginTop:12},children:"Backend snapshot · auto-refreshes every 60s"})]}):s.jsxs("div",{style:{background:"#161b22",borderRadius:12,border:"1px dashed #30363d",padding:"20px 24px",marginTop:24,textAlign:"center"},children:[s.jsx("div",{style:{fontSize:24,marginBottom:8},children:"📦"}),s.jsx("div",{style:{fontSize:14,fontWeight:600,color:"#e6edf3",marginBottom:4},children:"Model Availability Registry"}),s.jsxs("div",{style:{fontSize:12,color:"#6e7681"},children:["No registry data yet — run ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff models refresh"})," or use Auto routing; the registry learns from real usage and probes."]})]})}const tae={chat:"💬",execute:"⚙️",plan:"🗺️",edit:"✏️",skill:"🧩",learn:"📚",ci:"🔁",doctor:"🩺",probe:"🔭","spot-check":"🧪",telemetry:"📡",usage:"🧮"};function nae(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 rae(e){return tae[e]||"🎯"}function iae(e){return e?new Date(e).toLocaleDateString()+" "+new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"—"}function Ua({provider:e,model:t,reason:n,killed:r,transient:i,partial:a,streamedChunks:o}){const l=r===!0,c=i===!0,u=a===!0,d=u?"#bc8cff":c?"#d29922":l?"#f85149":"#3fb950",f=u?"#21122e":c?"#2d1f00":l?"#2d0f0f":"#0a2e1a";return s.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:[s.jsx("span",{style:{opacity:.85},children:u?"⏸":c?"~":l?"✗":"✓"}),e,"/",t.length>30?t.slice(0,27)+"…":t,(l||u)&&n&&s.jsxs("span",{style:{color:`${d}99`,fontSize:10,fontWeight:400},children:["· ",n]})]})}function aae(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,i)=>n[r.outcome]-n[i.outcome]||i.at-r.at)}function sae(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 oae({timeline:e}){const[t,n]=E.useState(()=>sae(e||[])),[r,i]=E.useState(!1),a=E.useRef(null),o=E.useRef(!1),l=(e==null?void 0:e.length)??0,c=Math.max(0,Math.min(t,l-1));E.useEffect(()=>{n(m=>Math.min(m,Math.max(0,l-1)))},[l]);const u=E.useCallback(m=>{const v=a.current;if(!v||l<=0)return;const y=v.getBoundingClientRect(),b=y.width||1,x=Math.min(1,Math.max(0,(m-y.left)/b));n(Math.min(l-1,Math.floor(x*l)))},[l]),d=m=>{o.current=!0,i(!1),u(m.clientX)};if(E.useEffect(()=>{const m=y=>{o.current&&u(y.clientX)},v=()=>{o.current=!1};return window.addEventListener("pointermove",m),window.addEventListener("pointerup",v),()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",v)}},[u]),E.useEffect(()=>{if(!r||l<=1)return;const m=setInterval(()=>{n(v=>Math.min(l-1,v+1))},300);return()=>clearInterval(m)},[r,l]),E.useEffect(()=>{r&&l>1&&t>=l-1&&(i(!1),n(0))},[r,l,t]),!e||l===0)return null;const f=Math.max(1,...e.map(m=>m.verified+m.killed+m.transient+(m.partial||0))),h=m=>new Date(m).toLocaleDateString([],{month:"short",day:"numeric"}),p=e[c],g=p?aae(p.events||[]):[];return s.jsxs("div",{style:{marginTop:12,paddingTop:10,borderTop:"1px solid #21262d"},children:[s.jsxs("div",{style:{fontSize:11,fontWeight:600,color:"#8b949e",marginBottom:8,textTransform:"uppercase",letterSpacing:.4,display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[s.jsxs("span",{children:["📈 Learned from real usage — last ",l," days"]}),s.jsx("span",{style:{fontWeight:400,color:"#6e7681",letterSpacing:0},children:"— drag across days · click a day · play to sweep"})]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8},children:[s.jsx("button",{onClick:()=>{r?i(!1):(t>=l-1&&n(0),i(!0))},disabled:l<=1,"aria-label":r?"Pause scrub":"Play scrub",style:{background:"#21262d",border:`1px solid ${r?"#f85149":"#30363d"}`,color:"#e6edf3",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"}),s.jsxs("span",{style:{fontSize:11,color:"#8b949e",whiteSpace:"nowrap"},children:[h(p.day)," · ✓ ",p.verified," · ✗ ",p.killed,p.transient>0?` · ~ ${p.transient}`:"",p.partial>0?` · ⏸ ${p.partial}`:""]}),s.jsx("input",{type:"range",min:0,max:Math.max(0,l-1),step:1,value:c,onChange:m=>{i(!1),n(Number(m.target.value))},"aria-label":"Scrub action timeline",style:{flex:1,accentColor:"#58a6ff",cursor:"pointer",minWidth:80}})]}),s.jsx("div",{ref:a,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((m,v)=>{const y=m.verified+m.killed+m.transient+(m.partial||0),b=m.verified/f*56,x=m.killed/f*56,k=m.transient/f*56,S=(m.partial||0)/f*56,w=v===c;return s.jsxs("div",{onClick:()=>{i(!1),n(v)},title:`${h(m.day)} — ✓ ${m.verified} verified · ✗ ${m.killed} killed · ~ ${m.transient} transient${(m.partial||0)>0?` · ⏸ ${m.partial} partial`:""}`,style:{flex:1,display:"flex",flexDirection:"column-reverse",alignItems:"center",gap:0,cursor:"pointer"},children:[s.jsxs("div",{style:{position:"relative",width:"100%",borderRadius:3,overflow:w?"visible":"hidden",background:y===0?"#21262d":"transparent",height:y===0?4:56,display:"flex",flexDirection:"column-reverse",boxShadow:w?"0 0 0 1.5px #58a6ff":void 0,opacity:y===0?.5:1,transition:"box-shadow 0.15s"},children:[w&&s.jsx("div",{style:{position:"absolute",top:-3,bottom:-3,width:2,left:"50%",transform:"translateX(-50%)",background:"#58a6ff",borderRadius:2,pointerEvents:"none",boxShadow:"0 0 8px #58a6ff88",zIndex:1}}),m.verified>0&&s.jsx("div",{style:{height:b,background:"#3fb950",minHeight:3}}),m.killed>0&&s.jsx("div",{style:{height:x,background:"#f85149",minHeight:3}}),m.transient>0&&s.jsx("div",{style:{height:k,background:"#d29922",minHeight:3}}),m.partial>0&&s.jsx("div",{style:{height:S,background:"#bc8cff",minHeight:3}})]}),s.jsx("div",{style:{fontSize:9,color:w?"#58a6ff":"#6e7681",marginTop:4,whiteSpace:"nowrap",fontWeight:w?700:400},children:h(m.day)})]},m.day)})}),s.jsxs("div",{style:{display:"flex",gap:14,marginTop:6,fontSize:11,color:"#8b949e"},children:[s.jsxs("span",{children:[s.jsx("span",{style:{color:"#3fb950"},children:"■"})," verified"]}),s.jsxs("span",{children:[s.jsx("span",{style:{color:"#f85149"},children:"■"})," killed"]}),s.jsxs("span",{children:[s.jsx("span",{style:{color:"#d29922"},children:"■"})," transient"]}),s.jsxs("span",{children:[s.jsx("span",{style:{color:"#bc8cff"},children:"■"})," partial"]})]}),s.jsxs("div",{style:{marginTop:10,background:"#161b22",border:"1px solid #21262d",borderRadius:8,padding:"10px 12px"},children:[s.jsxs("div",{style:{fontSize:12,fontWeight:600,color:"#e6edf3",marginBottom:6},children:[h(p.day)," ",s.jsx("span",{style:{color:"#8b949e",fontWeight:400},children:"— what this action learned that day"})]}),g.length===0?s.jsx("div",{style:{fontSize:12,color:"#6e7681"},children:"No learning recorded that day — nothing verified, killed, or partial."}):s.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:g.map(m=>m.outcome==="unavailable"?s.jsx(Ua,{provider:m.provider,model:m.model,reason:m.errorType,killed:!0},`${m.provider}|${m.model}|${m.outcome}`):m.outcome==="verified"?s.jsx(Ua,{provider:m.provider,model:m.model},`${m.provider}|${m.model}|${m.outcome}`):m.outcome==="partial"?s.jsx(Ua,{provider:m.provider,model:m.model,reason:m.errorType,partial:!0,streamedChunks:m.streamedChunks},`${m.provider}|${m.model}|${m.outcome}`):s.jsx(Ua,{provider:m.provider,model:m.model,reason:m.errorType,transient:!0},`${m.provider}|${m.model}|${m.outcome}`))})]})]})}function lae({entry:e}){var i,a;const[t,n]=E.useState(!0),r=(e.partial||0)>0?"#bc8cff":e.killed>0?"#f85149":e.verified>0?"#3fb950":"#d29922";return s.jsxs("div",{style:{background:"#161b22",borderRadius:12,border:`1px solid ${r}33`,borderLeft:`4px solid ${r}`,marginBottom:12,overflow:"hidden"},children:[s.jsxs("div",{onClick:()=>n(!t),style:{padding:"12px 16px",cursor:"pointer",display:"flex",alignItems:"center",gap:12,userSelect:"none"},children:[s.jsx("span",{style:{fontSize:20},children:rae(e.action)}),s.jsxs("div",{style:{flex:1},children:[s.jsx("div",{style:{fontSize:14,fontWeight:600,color:"#e6edf3",marginBottom:2},children:nae(e.action)}),s.jsxs("div",{style:{fontSize:12,color:"#8b949e",display:"flex",gap:14,flexWrap:"wrap"},children:[s.jsxs("span",{children:[s.jsxs("span",{style:{color:"#3fb950"},children:["✓ ",e.verified]})," verified"]}),s.jsxs("span",{children:[s.jsxs("span",{style:{color:"#f85149"},children:["✗ ",e.killed]})," killed"]}),e.transient>0&&s.jsxs("span",{children:[s.jsxs("span",{style:{color:"#d29922"},children:["~ ",e.transient]})," transient"]}),(e.partial||0)>0&&s.jsxs("span",{children:[s.jsxs("span",{style:{color:"#bc8cff"},children:["⏸ ",e.partial]})," partial"]})]})]}),s.jsx("span",{style:{color:"#8b949e",fontSize:16,transition:"transform 0.2s",transform:t?"rotate(90deg)":"rotate(0deg)"},children:"▶"})]}),t&&s.jsxs("div",{style:{padding:"12px 16px",borderTop:"1px solid #21262d",background:"#0d1117"},children:[e.killedModels.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{fontSize:11,fontWeight:600,color:"#f85149",marginBottom:6,textTransform:"uppercase",letterSpacing:.4},children:"⛔ Killed — skipped predictively by routing"}),s.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:14},children:e.killedModels.map(o=>s.jsx(Ua,{provider:o.provider,model:o.model,reason:o.reason,killed:!0},`${o.provider}|${o.model}`))})]}),e.verifiedModels.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{fontSize:11,fontWeight:600,color:"#3fb950",marginBottom:6,textTransform:"uppercase",letterSpacing:.4},children:"✅ Verified — trusted by routing"}),s.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:e.verifiedModels.map(o=>s.jsx(Ua,{provider:o.provider,model:o.model},`${o.provider}|${o.model}`))})]}),(((i=e.partialModels)==null?void 0:i.length)||0)>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{fontSize:11,fontWeight:600,color:"#bc8cff",marginBottom:6,textTransform:"uppercase",letterSpacing:.4},children:"⏸ Partial — mid-stream interruption (flaky provider, deprioritized)"}),s.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:14},children:e.partialModels.map(o=>s.jsx(Ua,{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&&(((a=e.partialModels)==null?void 0:a.length)||0)===0&&s.jsx("div",{style:{fontSize:12,color:"#6e7681"},children:"Only transient failures — health decayed, no model flipped."}),s.jsx(oae,{timeline:e.timeline})]})]})}function cae({registry:e}){const t=e.actionTelemetry;return t?t.enabled?s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",style:{marginTop:36},children:"🎓 Learned from real usage — per action"}),s.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 ",s.jsx("span",{style:{color:"#3fb950"},children:"verified"})," (routable) or"," ",s.jsx("span",{style:{color:"#f85149"},children:"killed"})," (predictively skipped) — the exact feed that turns “fail gemini → fail nim → local” into “straight to local”."]}),s.jsxs("div",{className:"stats-grid mini",style:{marginBottom:16},children:[s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"📊"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",children:t.total}),s.jsx("div",{className:"stat-label",children:"Telemetry events"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"🎯"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",children:t.actions.length}),s.jsx("div",{className:"stat-label",children:"Actions learning"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"⏱️"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{fontSize:15},children:iae(t.updatedAt)}),s.jsx("div",{className:"stat-label",children:"Last update"})]})]}),t.synthetic>0&&s.jsxs("div",{className:"stat-card",title:"Written by a test process — excluded from every number on this panel. The records remain in the hash-chained log.",children:[s.jsx("span",{className:"stat-icon",children:"🧪"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:"#d29922"},children:t.synthetic}),s.jsx("div",{className:"stat-label",children:"Test-origin, excluded"})]})]})]}),t.actions.map(n=>s.jsx(lae,{entry:n},n.action)),s.jsx("div",{style:{textAlign:"center",fontSize:12,color:"#484f58",marginTop:12},children:"All actions share one health store — a provider killed by any action is skipped by all others"})]}):s.jsxs("div",{style:{background:"#161b22",borderRadius:12,border:"1px dashed #30363d",padding:"18px 24px",marginTop:24,textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,marginBottom:6},children:"🎓"}),s.jsx("div",{style:{fontSize:13,fontWeight:600,color:"#e6edf3",marginBottom:4},children:"Learned from real usage — per action"}),s.jsxs("div",{style:{fontSize:12,color:"#6e7681",lineHeight:1.5},children:["No per-action telemetry yet. As you use ",s.jsx("strong",{style:{color:"#8b949e"},children:"chat"}),","," ",s.jsx("strong",{style:{color:"#8b949e"},children:"execute"}),", ",s.jsx("strong",{style:{color:"#8b949e"},children:"plan"}),", and ",s.jsx("strong",{style:{color:"#8b949e"},children:"edit"}),", each action's verified / killed provider × model combos appear here — showing exactly what routing learned from real usage."]})]}):null}function gd({icon:e,title:t,count:n}){return n===0?null:s.jsxs("h3",{style:{fontSize:15,fontWeight:600,color:"#e6edf3",margin:"24px 0 12px 0",display:"flex",alignItems:"center",gap:8},children:[s.jsx("span",{children:e})," ",t,s.jsx("span",{style:{fontSize:12,color:"#8b949e",fontWeight:400,background:"#161b22",padding:"1px 8px",borderRadius:8},children:n})]})}function uae({value:e,onChange:t,totalCount:n}){return s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:14},children:[s.jsxs("div",{style:{flex:1,position:"relative",display:"flex",alignItems:"center",background:"#161b22",borderRadius:8,border:"1px solid #30363d",transition:"border-color 0.2s"},children:[s.jsx("span",{style:{position:"absolute",left:12,fontSize:14,color:"#6e7681",pointerEvents:"none"},children:"🔍"}),s.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:"#e6edf3",fontSize:13,outline:"none",fontFamily:"inherit"},onFocus:r=>{r.currentTarget.parentElement.style.borderColor="#58a6ff"},onBlur:r=>{r.currentTarget.parentElement.style.borderColor="#30363d"}}),e&&s.jsx("button",{onClick:()=>t(""),style:{background:"none",border:"none",color:"#6e7681",cursor:"pointer",padding:"8px 12px",fontSize:14,lineHeight:1},children:"✕"})]}),s.jsxs("div",{style:{fontSize:12,color:"#8b949e",whiteSpace:"nowrap"},children:[n," model",n!==1?"s":""]})]})}function dae({value:e,onChange:t}){return s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:12,color:"#8b949e",marginBottom:14},children:[s.jsx("span",{children:"Columns:"}),Lie.map(n=>s.jsx("button",{onClick:()=>t(n),style:{padding:"4px 12px",borderRadius:6,background:e===n?"#1f6feb":"#21262d",color:e===n?"#fff":"#8b949e",border:`1px solid ${e===n?"#1f6feb":"#30363d"}`,cursor:"pointer",fontSize:12,fontWeight:e===n?600:400,transition:"all 0.15s"},children:n},n))]})}function fae({model:e,provider:t}){const n=gh[e.status],r=e.rateLimitRemaining!==void 0?e.rateLimitTotal?`${e.rateLimitRemaining} / ${e.rateLimitTotal}`:`${e.rateLimitRemaining} left`:"—";return s.jsx("td",{style:{padding:10,verticalAlign:"top"},children:s.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:i=>{i.currentTarget.style.borderColor=n.cardBorder,i.currentTarget.style.boxShadow=`0 2px 10px ${n.cardBorder}22`},onMouseLeave:i=>{i.currentTarget.style.borderColor=`${n.cardBorder}44`,i.currentTarget.style.boxShadow="none"},children:[s.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:3,background:n.cardBorder,opacity:.6}}),s.jsx("div",{style:{fontSize:13,fontWeight:600,color:"#e6edf3",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}),s.jsxs("div",{style:{fontSize:12,color:"#8b949e"},children:[JP(t)," ",u0(t)]}),s.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:[s.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:n.dot}}),e.status==="available"?"Available":e.status==="limited"?"Limited":"Unavailable"]}),s.jsxs("div",{style:{fontSize:11,color:"#6e7681"},children:[s.jsx("span",{style:{color:"#8b949e"},children:"Tokens:"})," ",s.jsx("span",{style:{color:e.rateLimitRemaining!==void 0&&e.rateLimitRemaining<=10?"#d29922":"#8b949e",fontFamily:"'SFMono-Regular', Consolas, monospace",fontWeight:500},children:r})]}),e.routable===!1&&s.jsx("div",{style:{fontSize:10,color:"#d29922",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&&s.jsx("div",{style:{fontSize:10,color:"#6e7681",lineHeight:1.3,marginTop:1},children:e.registryError.length>60?e.registryError.slice(0,57)+"…":e.registryError}),e.entitlement&&e.entitlement.tier!=="unknown"&&s.jsx("div",{title:e.entitlement.basis,style:{fontSize:10,lineHeight:1.3,marginTop:2,color:e.entitlement.tier==="free"?"#3fb950":"#8b949e"},children:e.entitlement.tier==="free"?"🎁 free":"💸 metered"}),e.status!=="available"&&e.statusReason&&s.jsx("div",{style:{fontSize:10,color:"#6e7681",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&&s.jsxs("div",{style:{fontSize:10,color:"#d29922",lineHeight:1.3,marginTop:4,padding:"3px 6px",borderRadius:4,background:"#2d2200",border:"1px solid #d2992244"},children:["⏳ Resets in ",eM(e.resetsInMs)]})]})})}function hae({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 i=r;if(n.trim()){const l=n.toLowerCase().trim();i=r.filter(({model:c,provider:u})=>c.name.toLowerCase().includes(l)||u0(u).toLowerCase().includes(l)||u.toLowerCase().includes(l))}const a={available:0,limited:1,unavailable:2};i.sort((l,c)=>a[l.model.status]-a[c.model.status]);const o=[];for(let l=0;l<i.length;l+=t)o.push(i.slice(l,l+t));return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",style:{marginTop:36},children:"📋 Model Health Overview"}),s.jsx("p",{className:"section-description",children:"All models across all providers, color-coded by health status. Each cell shows: Model · Provider · Health · Token Remaining."}),s.jsx("div",{style:{overflowX:"auto"},children:s.jsx("table",{style:{width:"100%",borderCollapse:"separate",borderSpacing:10,tableLayout:"fixed"},children:s.jsx("tbody",{children:o.length>0?o.map((l,c)=>s.jsxs("tr",{children:[l.map(({model:u,provider:d})=>s.jsx(fae,{model:u,provider:d},`${d}-${u.id}`)),l.length<t&&Array.from({length:t-l.length}).map((u,d)=>s.jsx("td",{style:{padding:10}},`empty-${d}`))]},c)):s.jsx("tr",{children:s.jsxs("td",{colSpan:t,style:{textAlign:"center",padding:40,color:"#6e7681",fontSize:13},children:['No models match your search "',n,'"']})})})})}),n.trim()&&i.length>0&&s.jsxs("div",{style:{textAlign:"right",fontSize:11,color:"#6e7681",marginTop:4},children:["Showing ",i.length," of ",r.length," models"]})]})}function pae(){return s.jsxs("div",{style:{background:"#161b22",borderRadius:12,border:"1px dashed #30363d",padding:"20px 24px",marginTop:24,textAlign:"center"},children:[s.jsx("div",{style:{fontSize:24,marginBottom:8},children:"🎙️"}),s.jsx("div",{style:{fontSize:14,fontWeight:600,color:"#e6edf3",marginBottom:4},children:"Speech / TTS Provider"}),s.jsxs("div",{style:{fontSize:12,color:"#6e7681"},children:["Speech/TTS provider support coming soon."," ",s.jsx("a",{href:"https://github.com/imdheerajKube/agent-nuvira/issues/new",target:"_blank",rel:"noopener noreferrer",style:{color:"#58a6ff",textDecoration:"none",cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.textDecoration="underline"},onMouseLeave:e=>{e.currentTarget.style.textDecoration="none"},children:"Request a provider"})]})]})}function mae(){return s.jsxs("div",{style:{background:"#0d1117",borderRadius:10,padding:14,marginBottom:20,border:"1px solid #21262d",fontSize:13,color:"#8b949e",display:"flex",flexWrap:"wrap",gap:20},children:[s.jsxs("div",{children:[s.jsx("div",{style:{fontWeight:600,color:"#e6edf3",marginBottom:6},children:"Color Coding"}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[s.jsxs("span",{children:[s.jsx("span",{style:{color:"#3fb950"},children:"●"})," ",s.jsx("strong",{style:{color:"#e6edf3"},children:"Green"})," — Working with rate limit available"]}),s.jsxs("span",{children:[s.jsx("span",{style:{color:"#d29922"},children:"●"})," ",s.jsx("strong",{style:{color:"#e6edf3"},children:"Amber"})," — Slow / low rate limit / needs action"]}),s.jsxs("span",{children:[s.jsx("span",{style:{color:"#f85149"},children:"●"})," ",s.jsx("strong",{style:{color:"#e6edf3"},children:"Red"})," — API key missing / payment needed / unreachable"]})]})]}),s.jsxs("div",{children:[s.jsx("div",{style:{fontWeight:600,color:"#e6edf3",marginBottom:6},children:"Provider Sections"}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:3,fontSize:12},children:[s.jsxs("span",{children:["✅ ",s.jsx("strong",{children:"Cloud"})," — Online providers with active API keys"]}),s.jsxs("span",{children:["🏠 ",s.jsx("strong",{children:"Local"})," — Locally running inference servers"]}),s.jsxs("span",{children:["⛔ ",s.jsx("strong",{children:"Unavailable"})," — Missing keys or unreachable endpoints"]}),s.jsxs("span",{children:["🎙️ ",s.jsx("strong",{children:"Speech"})," — Text-to-speech / speech-to-text providers (coming)"]})]})]})]})}function gae(){const[e,t]=E.useState(null),[n,r]=E.useState(null),[i,a]=E.useState(!0),[o,l]=E.useState(null),[c,u]=E.useState(4),[d,f]=E.useState(""),h=E.useRef(!0),p=E.useRef(null),g=E.useRef(!1);function m(){p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{h.current&&v()},Bie)}async function v(){a(!0),l(null),g.current=!1;try{const[b,x]=await Promise.all([Fie(()=>{g.current=!0}),Uie(()=>{g.current=!0})]);if(!h.current)return;t(b),r(x),g.current&&m()}catch(b){if(!h.current)return;l(b instanceof Error&&b.message?b.message:"Failed to fetch model status"),g.current&&m()}finally{h.current&&a(!1)}}E.useEffect(()=>{h.current=!0,v();const b=setInterval(v,Die);return()=>{h.current=!1,clearInterval(b),p.current&&clearTimeout(p.current)}},[]);function y(b){const x=[],k=[],S=[],w=[],_={available:0,limited:1,unavailable:2};for(const N of b.providers)$ie.has(N.provider)?S.push(N):Iie.has(N.provider)?k.push(N):N.overallStatus==="available"?x.push(N):w.push(N);return x.sort((N,C)=>_[N.overallStatus]-_[C.overallStatus]),k.sort((N,C)=>_[N.overallStatus]-_[C.overallStatus]),S.sort((N,C)=>_[N.overallStatus]-_[C.overallStatus]),w.sort((N,C)=>_[N.overallStatus]-_[C.overallStatus]),{available:x,local:k,speech:S,unavailable:w}}return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"🧠 Model Provider Status"}),s.jsx("p",{className:"section-description",children:"Real-time health check of all AI providers and their available models. Providers are grouped into sections: Available cloud → Local → Unavailable."}),s.jsx(Gie,{onRefresh:v,loading:i}),s.jsx(mae,{}),i&&!e&&s.jsxs("div",{className:"loading-state",children:[s.jsx("div",{className:"loading-spinner"}),s.jsx("p",{children:"Testing all 17 provider connections..."})]}),o&&s.jsxs("div",{className:"empty-state",style:{color:"#f85149",border:"1px solid #f8514944",borderRadius:10,padding:16,marginBottom:16},children:["⚠️ ",o]}),e&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"stats-grid",style:{marginBottom:16},children:[s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"🧠"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",children:e.totalModels}),s.jsx("div",{className:"stat-label",children:"Total Models"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"✅"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:"#3fb950"},children:e.available}),s.jsx("div",{className:"stat-label",children:"Available"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"🟡"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:"#d29922"},children:e.limited}),s.jsx("div",{className:"stat-label",children:"Limited"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"🔴"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:"#f85149"},children:e.unavailable}),s.jsx("div",{className:"stat-label",children:"Unavailable"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"🔌"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",children:e.providers.length}),s.jsx("div",{className:"stat-label",children:"Providers"})]})]})]}),s.jsx(qie,{data:e}),(()=>{const{available:b,local:x,speech:k,unavailable:S}=y(e);return s.jsxs(s.Fragment,{children:[s.jsx(gd,{icon:"✅",title:"Available Cloud Providers",count:b.length}),b.map(w=>s.jsx(md,{provider:w},w.provider)),s.jsx(gd,{icon:"🏠",title:"Local Providers",count:x.length}),x.map(w=>s.jsx(md,{provider:w},w.provider)),s.jsx(gd,{icon:"⛔",title:"Unavailable Providers",count:S.length}),S.map(w=>s.jsx(md,{provider:w},w.provider)),s.jsx(gd,{icon:"🎙️",title:"Speech / TTS Providers",count:k.length}),k.map(w=>s.jsx(md,{provider:w},w.provider))]})})(),s.jsx(uae,{value:d,onChange:f,totalCount:e.providers.reduce((b,x)=>b+x.models.length,0)}),s.jsx(dae,{value:c,onChange:u}),s.jsx(hae,{providers:e.providers,colsPerRow:c,searchQuery:d}),n&&s.jsx(eae,{data:n}),n&&s.jsx(cae,{registry:n}),e&&!n&&s.jsxs("div",{style:{background:"#161b22",borderRadius:12,border:"1px dashed #30363d",padding:"14px 20px",marginTop:24,fontSize:12,color:"#8b949e",lineHeight:1.6},children:["📦 Registry & telemetry sections are hidden — this dashboard server did not return model-registry data (it may be an"," ",s.jsx("strong",{style:{color:"#e6edf3"},children:"older version"}),"). Restart the dashboard from the latest install to see them."]}),s.jsx(pae,{}),s.jsxs("div",{style:{textAlign:"center",fontSize:12,color:"#484f58",marginTop:16},children:["Last checked: ",new Date(e.lastChecked).toLocaleTimeString()," · ","Auto-refreshes every 60s"]})]})]})}const yae={local:"💻",groq:"🟢",nim:"🔶",gemini:"🔷",openrouter:"🟣"},vae={local:"Ollama (Local)",groq:"Groq",nim:"NVIDIA NIM",gemini:"Gemini",openrouter:"OpenRouter"},bae={trivial:"🟢",simple:"🔵",moderate:"🟡",complex:"🟠",critical:"🔴"},tM={trivial:"🟢 trivial",simple:"🔵 simple",moderate:"🟡 moderate",complex:"🟠 complex",critical:"🔴 critical"},xae={chat:"💬 chat",orchestrator:"🔀 orchestrator",explain:"🔍 explain",benchmark:"📈 benchmark",eval:"🎯 eval"},ka=[{key:"request",icon:"🎯",title:"Request"},{key:"candidates",icon:"⚖️",title:"Candidates"},{key:"exclusions",icon:"🚫",title:"Exclusions"},{key:"pick",icon:"✅",title:"Pick"}],wae=2400;function ng(e){return yae[e]||"🔌"}function c_(e){return vae[e]||e}function d0(e){return e&&xae[e]||e||"unknown"}function Sae(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 u_(e){const t=Math.ceil(e/6e4);return t>=60?`${Math.floor(t/60)}h ${t%60}m`:`${t}m`}const kae=8;function d_(e,t){const n=t.quota,r=n==null?void 0:n.entries.find(a=>a.provider===e);return r!=null&&r.parked?r.resetsInMs>0?`quota exhausted — auto re-enables in ${u_(r.resetsInMs)}`:"quota exhausted — parked":r&&r.cooldownRemaining>0?`circuit-breaker cooldown — ${u_(r.cooldownRemaining)} remaining`:t.providers.some(a=>a.provider===e)?"ranked below the candidate cutoff for this complexity":"not scored for this complexity (no benchmark quality data)"}function Eae(e){var a,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=[],i=[...e.history??[]].sort((c,u)=>(u.timestamp??0)-(c.timestamp??0));for(const c of i.slice(0,kae)){const u=n.get(c.complexity),d=(a=u==null?void 0:u.providers)!=null&&a.length?u.providers.map(g=>({provider:g.provider,score:g.score,reason:g.reason})):[{provider:c.provider,score:c.score,reason:"actual pick recorded"}];d.some(g=>g.provider===c.provider)||d.push({provider:c.provider,score:c.score,reason:"actual pick recorded"});const f=new Set(d.map(g=>g.provider)),h=[...t].filter(g=>!f.has(g)).map(g=>({provider:g,reason:d_(g,e)})),p=(o=d.find(g=>g.provider===c.provider))==null?void 0:o.reason;r.push({id:c.id,label:`${d0(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(g=>({provider:g.provider,score:g.score,reason:g.reason})),f=new Set(d.map(g=>g.provider)),h=[...t].filter(g=>!f.has(g)).map(g=>({provider:g,reason:d_(g,e)})),p=u[0];r.push({id:`profile-${c.complexity}`,label:`${tM[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(g=>g.provider===p))==null?void 0:l.reason,candidates:d,exclusions:h})}return r}function _ae(e,t){switch(e){case"request":return`A ${t.complexity} task arrives${t.source?` from ${d0(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 Nae({value:e,color:t}){const n=Math.min(100,Math.max(0,e*100));return s.jsx("div",{style:{flex:1,background:"#0d1117",borderRadius:4,height:6,overflow:"hidden",border:"1px solid #21262d"},children:s.jsx("div",{style:{width:`${n}%`,background:t,height:"100%",transition:"width 0.4s ease"}})})}function jae({icon:e,title:t,narration:n}){return s.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:10,marginBottom:14},children:[s.jsx("span",{style:{fontSize:20,lineHeight:"24px"},children:e}),s.jsxs("div",{children:[s.jsx("div",{style:{fontSize:14,fontWeight:600,color:"#e6edf3"},children:t}),s.jsx("div",{style:{fontSize:12,color:"#8b949e",marginTop:2},children:n})]})]})}function Aae({routing:e}){const t=E.useMemo(()=>Eae(e),[e]),[n,r]=E.useState(""),[i,a]=E.useState(0),[o,l]=E.useState(!1);if(E.useEffect(()=>{t.length!==0&&(t.some(p=>p.id===n)||(r(t[0].id),a(0)))},[t,n]),E.useEffect(()=>{if(!o||t.length===0)return;const p=setInterval(()=>{a(g=>(g+1)%ka.length)},wae);return()=>clearInterval(p)},[o,t.length]),t.length===0)return null;const c=t.find(p=>p.id===n)??t[0],u=ka[i],d=()=>{a(p=>(p+ka.length-1)%ka.length),l(!1)},f=()=>{a(p=>(p+1)%ka.length),l(!1)},h=()=>l(p=>!p);return s.jsxs("div",{style:{background:"#161b22",borderRadius:12,border:"1px solid #21262d",padding:"18px 20px",marginBottom:16},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:4},children:[s.jsx("span",{style:{fontSize:20},children:"🎬"}),s.jsx("h3",{style:{fontSize:15,fontWeight:600,color:"#e6edf3",margin:0},children:"Why did the router pick this?"}),c.real&&s.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:"#12291a",border:"1px solid #238636",color:"#3fb950"},children:"✓ real decision"})]}),s.jsx("p",{style:{fontSize:12,color:"#8b949e",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."}),s.jsx("select",{"aria-label":"Routing decision to replay",value:n,onChange:p=>{r(p.target.value),a(0),l(!1)},style:{width:"100%",marginBottom:16,padding:"8px 10px",background:"#0d1117",color:"#e6edf3",fontSize:12,border:"1px solid #30363d",borderRadius:8,outline:"none"},children:t.map(p=>s.jsxs("option",{value:p.id,style:{background:"#0d1117",color:"#e6edf3"},children:[p.real?"● ":"○ ",p.label]},p.id))}),s.jsx(jae,{icon:u.icon,title:`${i+1}. ${u.title}${i>0?` — ${c.complexity}`:""}`,narration:_ae(u.key,c)}),u.key==="request"&&s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"14px 16px"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",marginBottom:8},children:[s.jsxs("span",{style:{fontSize:12,padding:"2px 10px",borderRadius:12,background:"#161b22",border:"1px solid #30363d",color:"#e6edf3"},children:[bae[c.complexity]||"•"," ",tM[c.complexity]||c.complexity]}),s.jsxs("span",{style:{fontSize:12,padding:"2px 10px",borderRadius:12,background:"#161b22",border:"1px solid #30363d",color:"#8b949e"},children:["🤖 ",c.agentType]}),c.source&&s.jsx("span",{style:{fontSize:12,padding:"2px 10px",borderRadius:12,background:"#161b22",border:"1px solid #30363d",color:"#8b949e"},children:d0(c.source)}),c.timestamp&&s.jsx("span",{style:{fontSize:11,color:"#6e7681",marginLeft:"auto"},children:Sae(c.timestamp)})]}),s.jsx("div",{style:{fontSize:13,color:"#e6edf3"},children:c.task})]}),u.key==="candidates"&&s.jsxs("div",{children:[c.candidates.map((p,g)=>{const m=p.provider===c.winner.split("/")[0];return s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",background:m?"#12291a":"#0d1117",border:`1px solid ${m?"#238636":"#21262d"}`,borderRadius:8,marginBottom:6},children:[s.jsxs("span",{style:{width:18,fontSize:11,color:"#6e7681",textAlign:"right"},children:[g+1,"."]}),s.jsxs("span",{style:{width:104,color:m?"#3fb950":"#e6edf3",fontWeight:m?600:400,whiteSpace:"nowrap",fontSize:12},children:[ng(p.provider)," ",c_(p.provider).split(" ")[0],m&&" 👑"]}),s.jsx(Nae,{value:p.score,color:m?"#3fb950":"#58a6ff"}),s.jsx("span",{style:{width:44,textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11,color:"#8b949e"},children:p.score.toFixed(3)})]},p.provider)}),c.candidates.length>0&&s.jsxs("div",{style:{marginTop:10},children:[s.jsx("div",{style:{fontSize:11,color:"#6e7681",marginBottom:4},children:"Why each ranked where it did"}),c.candidates.map(p=>s.jsxs("div",{style:{fontSize:12,color:"#8b949e",marginBottom:3},children:[s.jsx("span",{style:{color:"#e6edf3"},children:p.provider}),": ",p.reason||"scored"]},p.provider))]})]}),u.key==="exclusions"&&(c.exclusions.length>0?s.jsx("div",{children:c.exclusions.map(p=>s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",background:"#0d1117",border:"1px solid #21262d",borderRadius:8,marginBottom:6},children:[s.jsx("span",{style:{fontSize:13},children:"🚫"}),s.jsxs("span",{style:{width:110,color:"#e6edf3",whiteSpace:"nowrap",fontSize:12},children:[ng(p.provider)," ",c_(p.provider).split(" ")[0]]}),s.jsx("span",{style:{flex:1,fontSize:12,color:"#8b949e"},children:p.reason})]},p.provider))}):s.jsx("div",{style:{background:"#0d1117",border:"1px dashed #30363d",borderRadius:10,padding:"14px 16px",color:"#8b949e",fontSize:13},children:"✅ No exclusions — every provider known to the system was scored for this decision."})),u.key==="pick"&&s.jsxs("div",{style:{background:"#12291a",border:"1px solid #238636",borderRadius:10,padding:"16px 18px"},children:[s.jsx("div",{style:{fontSize:12,color:"#3fb950",fontWeight:600,marginBottom:6},children:"🏆 ROUTER PICK"}),s.jsxs("div",{style:{fontSize:16,fontWeight:700,color:"#e6edf3",fontFamily:"'SFMono-Regular', Consolas, monospace",marginBottom:4},children:[ng(c.winner.split("/")[0])," ",c.winner]}),s.jsxs("div",{style:{fontSize:12,color:"#8b949e",marginBottom:10},children:["composite score ",s.jsx("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace",color:"#3fb950"},children:c.winnerScore.toFixed(3)}),!c.real&&" · profile preview"]}),c.winnerReason&&s.jsxs("div",{style:{fontSize:12,color:"#8b949e",borderTop:"1px solid #23863655",paddingTop:8},children:[s.jsx("span",{style:{color:"#e6edf3"},children:"Why:"})," ",c.winnerReason]})]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginTop:16},children:[s.jsx("button",{onClick:d,"aria-label":"Previous step",style:rg,children:"◀"}),s.jsx("button",{onClick:h,"aria-label":o?"Pause playback":"Play playback",style:{...rg,minWidth:84,color:o?"#d29922":"#3fb950"},children:o?"⏸ Pause":"▶ Play"}),s.jsx("button",{onClick:f,"aria-label":"Next step",style:rg,children:"▶"}),s.jsx("div",{style:{display:"flex",gap:6,marginLeft:8},children:ka.map((p,g)=>s.jsx("button",{"aria-label":`Go to step ${g+1}: ${p.title}`,onClick:()=>{a(g),l(!1)},style:{width:22,height:22,borderRadius:11,border:"none",cursor:"pointer",fontSize:10,lineHeight:"22px",padding:0,background:g===i?"#58a6ff":"#21262d",color:g===i?"#0d1117":"#8b949e"},title:p.title,children:p.icon},p.key))}),s.jsxs("span",{style:{marginLeft:"auto",fontSize:11,color:"#6e7681"},children:["step ",i+1,"/",ka.length]})]})]})}const rg={background:"#21262d",color:"#e6edf3",border:"1px solid #30363d",borderRadius:8,padding:"6px 12px",fontSize:13,cursor:"pointer",transition:"background 0.15s"},Tae={local:"💻",groq:"🟢",nim:"🔶",gemini:"🔷",openrouter:"🟣"},Cae={local:"Ollama (Local)",groq:"Groq",nim:"NVIDIA NIM",gemini:"Gemini",openrouter:"OpenRouter"},nM={trivial:"🟢",simple:"🔵",moderate:"🟡",complex:"🟠",critical:"🔴"};function Nr(e){return Tae[e]||"🔌"}function sa(e){return Cae[e]||e}function yh(e,t=1){return`${(e*100).toFixed(t)}%`}function Oae(e){return`$${e.toFixed(6)}`}function Yn({icon:e,title:t,subtitle:n,children:r}){return s.jsxs("div",{style:{background:"#161b22",borderRadius:12,border:"1px solid #21262d",padding:"18px 20px",marginBottom:16},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:4},children:[s.jsx("span",{style:{fontSize:20},children:e}),s.jsx("h3",{style:{fontSize:15,fontWeight:600,color:"#e6edf3",margin:0},children:t})]}),n&&s.jsx("p",{style:{fontSize:12,color:"#8b949e",margin:"2px 0 12px 0"},children:n}),!n&&s.jsx("div",{style:{height:6}}),r]})}function f0({value:e,color:t}){const n=Math.min(100,Math.max(0,e*100));return s.jsx("div",{style:{flex:1,background:"#0d1117",borderRadius:4,height:6,overflow:"hidden",border:"1px solid #21262d"},children:s.jsx("div",{style:{width:`${n}%`,background:t,height:"100%",transition:"width 0.4s ease"}})})}function eo(e,t,n="#8b949e"){return{fontSize:10,padding:"1px 7px",borderRadius:9,background:e,border:`1px solid ${t}`,color:n,fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap"}}function Pae(){return s.jsxs("div",{style:{background:"#0d1117",border:"1px dashed #30363d",borderRadius:10,padding:"18px 20px",color:"#8b949e",fontSize:13,textAlign:"center"},children:["📊 No routing data yet — run ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff benchmark"})," to populate provider quality scores, or use Auto routing (",s.jsx("code",{style:{color:"#58a6ff"},children:"buff model switch auto"}),") to build per-agent best-model stats over time."]})}const Mae={chat:"💬 chat",orchestrator:"🔀 orchestrator",explain:"🔍 explain",benchmark:"📈 benchmark",eval:"🎯 eval"},Rae={trivial:"🟢 trivial",simple:"🔵 simple",moderate:"🟡 moderate",complex:"🟠 complex",critical:"🔴 critical"};function rM(e){return Mae[e]||e}function iM(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 f_(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 Iae({label:e,value:t,total:n,color:r}){const i=n>0?t/n*100:0;return s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:5},children:[s.jsx("span",{style:{width:110,color:"#e6edf3",whiteSpace:"nowrap",fontSize:12},children:e}),s.jsx("div",{style:{flex:1,background:"#0d1117",borderRadius:4,height:6,overflow:"hidden",border:"1px solid #21262d"},children:s.jsx("div",{style:{width:`${Math.min(100,i)}%`,background:r,height:"100%",transition:"width 0.4s ease"}})}),s.jsx("span",{style:{width:34,textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11,color:"#8b949e"},children:t})]})}function $ae({usage:e}){if(!e.total)return null;const t=e.total,n=Object.entries(e.byProvider).sort((i,a)=>a[1]-i[1]).slice(0,6),r=Object.entries(e.byModel).sort((i,a)=>a[1]-i[1]).slice(0,5);return s.jsxs(Yn,{icon:"🧮",title:"Routing Usage — actual picks over time",subtitle:"Recorded from live chat, orchestrator runs, explain snapshots, benchmark --routing, and eval --routing",children:[s.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:14},children:[s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:"#e6edf3",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:e.total}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"total decisions"})]}),s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:e.last24h>0?"#3fb950":"#8b949e",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:e.last24h}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"last 24h"})]})]}),s.jsx("div",{style:{fontSize:12,color:"#8b949e",marginBottom:6},children:"By provider"}),n.map(([i,a])=>s.jsx(Iae,{label:`${Nr(i)} ${sa(i).split(" ")[0]}`,value:a,total:t,color:"#58a6ff"},i)),Object.keys(e.bySource).length>0&&s.jsx("div",{style:{marginTop:12,display:"flex",gap:6,flexWrap:"wrap"},children:Object.entries(e.bySource).sort((i,a)=>a[1]-i[1]).map(([i,a])=>s.jsxs("span",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:20,padding:"3px 10px",fontSize:11,color:"#e6edf3"},children:[rM(i)," · ",a]},i))}),r.length>0&&s.jsxs("div",{style:{marginTop:14},children:[s.jsx("div",{style:{fontSize:12,color:"#8b949e",marginBottom:6},children:"Most-picked models"}),r.map(([i,a])=>s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:5},children:[s.jsx("span",{style:{flex:1,color:"#e6edf3",fontSize:12,fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:i,children:i.length>42?i.slice(0,39)+"…":i}),s.jsx("span",{style:{width:34,textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11,color:"#8b949e"},children:a})]},i))]})]})}function Lae({history:e}){return e.length?s.jsx(Yn,{icon:"🕓",title:"Audit Trail — routing decision timeline",subtitle:"Every explain snapshot (and routing-mode pick) persisted for transparency",children:s.jsx("div",{style:{maxHeight:320,overflowY:"auto",paddingRight:4},children:e.map(t=>s.jsxs("div",{style:{display:"flex",gap:10,padding:"8px 4px",borderBottom:"1px solid #21262d"},children:[s.jsx("div",{style:{width:52,flexShrink:0,fontSize:11,color:"#6e7681",paddingTop:2},children:iM(t.timestamp)}),s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[s.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:"#0d1117",border:"1px solid #30363d",color:"#8b949e"},children:rM(t.source)}),s.jsxs("span",{style:{fontSize:12,fontWeight:600,color:"#3fb950",fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:`${t.provider}/${t.model}`,children:[Nr(t.provider)," ",t.provider,"/",t.model.length>26?t.model.slice(0,23)+"…":t.model]}),t.complexity&&s.jsx("span",{style:{fontSize:11,color:"#6e7681"},children:Rae[t.complexity]||t.complexity})]}),s.jsx("div",{style:{fontSize:12,color:"#8b949e",marginTop:3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:t.task,children:t.task||t.agentType})]})]},t.id))})}):null}function Dae({routing:e}){return e.preference.length?s.jsx(Yn,{icon:"🤖",title:"Auto Router — What the agent would pick",subtitle:"Complexity-weighted scoring across reasoning, speed, cost, privacy, and reliability (real provider pricing)",children:s.jsx("div",{style:{overflowX:"auto"},children:s.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[s.jsx("thead",{children:s.jsxs("tr",{style:{borderBottom:"1px solid #21262d",color:"#8b949e"},children:[s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Complexity"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Winner"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Score"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"All providers"})]})}),s.jsx("tbody",{children:e.preference.map(t=>s.jsxs("tr",{style:{borderBottom:"1px solid #21262d"},children:[s.jsxs("td",{style:{padding:"10px 12px",color:"#e6edf3",whiteSpace:"nowrap"},children:[nM[t.complexity]||"•"," ",t.complexity]}),s.jsx("td",{style:{padding:"10px 12px",whiteSpace:"nowrap"},children:s.jsxs("span",{style:{color:"#3fb950",fontWeight:600},children:[Nr(t.winner.split("/")[0])," ",t.winner]})}),s.jsx("td",{style:{padding:"10px 12px",fontFamily:"'SFMono-Regular', Consolas, monospace",color:"#8b949e"},children:t.score.toFixed(3)}),s.jsx("td",{style:{padding:"10px 12px",minWidth:300},children:t.providers.map((n,r)=>s.jsxs("div",{style:{marginBottom:5},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[s.jsxs("span",{style:{width:16,fontSize:11,color:"#6e7681",textAlign:"right"},children:[r+1,"."]}),s.jsxs("span",{style:{width:90,color:"#e6edf3",whiteSpace:"nowrap",fontSize:12},children:[Nr(n.provider)," ",sa(n.provider).split(" ")[0]]}),s.jsx(f0,{value:n.score,color:r===0?"#3fb950":"#58a6ff"}),s.jsx("span",{style:{width:40,textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11,color:"#8b949e"},children:n.score.toFixed(2)})]}),(n.capabilityFit!==void 0||n.costSource||n.contextUtilization!==void 0)&&s.jsxs("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingLeft:16,marginTop:2},children:[n.capabilityFit!==void 0&&s.jsxs("span",{style:eo("#1c2128","#6e7681"),children:["🎯 fit ",n.capabilityFit,"%"]}),n.costSource==="measured"&&n.costBasis?s.jsxs("span",{style:eo("#12291a","#3fb950","#3fb950"),children:["📏 measured ",n.costBasis.inputTokens.toLocaleString(),"→",n.costBasis.outputTokens.toLocaleString()," tok"]}):s.jsx("span",{style:eo("#1c2128","#8b949e"),children:"📐 estimated"}),n.contextUtilization!==void 0&&n.contextWindowTokens!==void 0&&s.jsxs("span",{style:eo("#1c2128","#58a6ff","#58a6ff"),children:["⏳ ctx ",n.contextUtilization,"% (",n.contextWindowTokens.toLocaleString()," tok)"]})]})]},n.provider))})]},t.complexity))})]})})}):null}function Bae({routing:e}){return e.providers.length?s.jsx(Yn,{icon:"📈",title:"Provider Benchmark Quality",subtitle:"Measured from your own `buff benchmark` runs — blended into Auto routing decisions",children:s.jsx("div",{style:{overflowX:"auto"},children:s.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[s.jsx("thead",{children:s.jsxs("tr",{style:{borderBottom:"1px solid #21262d",color:"#8b949e"},children:[s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Provider"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Runs"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Avg Quality"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Pass Rate"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Total Cost"})]})}),s.jsx("tbody",{children:e.providers.map(t=>s.jsxs("tr",{style:{borderBottom:"1px solid #21262d"},children:[s.jsxs("td",{style:{padding:"10px 12px",color:"#e6edf3",whiteSpace:"nowrap"},children:[Nr(t.provider)," ",sa(t.provider)]}),s.jsx("td",{style:{padding:"10px 12px",color:"#8b949e"},children:t.runs}),s.jsx("td",{style:{padding:"10px 12px"},children:s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[s.jsx(f0,{value:t.avgQuality,color:"#58a6ff"}),s.jsx("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:"#8b949e",width:44,textAlign:"right"},children:yh(t.avgQuality)})]})}),s.jsx("td",{style:{padding:"10px 12px",color:t.passRate>=.8?"#3fb950":"#d29922"},children:yh(t.passRate)}),s.jsx("td",{style:{padding:"10px 12px",fontFamily:"'SFMono-Regular', Consolas, monospace",color:"#8b949e"},children:Oae(t.totalCostUsd)})]},t.provider))})]})})}):null}const h_=["trivial","simple","moderate","complex","critical"];function zae(e){return e>=.7?"#3fb950":e>=.45?"#d29922":"#f85149"}function Fae({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 s.jsxs(Yn,{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:[s.jsx("div",{style:{overflowX:"auto"},children:s.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[s.jsx("thead",{children:s.jsxs("tr",{style:{borderBottom:"1px solid #21262d",color:"#8b949e"},children:[s.jsx("th",{style:{padding:"8px 10px",textAlign:"left",fontWeight:500},children:"Provider"}),h_.map(r=>s.jsxs("th",{style:{padding:"8px 10px",textAlign:"center",fontWeight:500},children:[nM[r]||"•"," ",r]},r))]})}),s.jsx("tbody",{children:t.map(r=>s.jsxs("tr",{style:{borderBottom:"1px solid #21262d"},children:[s.jsxs("td",{style:{padding:"8px 10px",color:"#e6edf3",whiteSpace:"nowrap"},children:[Nr(r)," ",sa(r).split(" ")[0]]}),h_.map(i=>{var o;const a=(o=e.priors[r])==null?void 0:o[i];return!a||a.alpha===0&&a.beta===0?s.jsx("td",{style:{padding:"8px 10px",textAlign:"center",color:"#6e7681"},children:"·"},i):s.jsxs("td",{style:{padding:"8px 10px",textAlign:"center"},children:[s.jsxs("div",{style:{fontSize:13,fontWeight:600,color:zae(a.expectedWinRate),fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[(a.expectedWinRate*100).toFixed(0),"%"]}),s.jsxs("div",{style:{fontSize:10,color:"#8b949e",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["α",a.alpha," β",a.beta]})]},i)})]},r))})]})}),n.length>0&&s.jsxs("div",{style:{marginTop:16},children:[s.jsx("div",{style:{fontSize:12,color:"#8b949e",marginBottom:8},children:"Recent learning history"}),s.jsx("div",{style:{maxHeight:180,overflowY:"auto",paddingRight:4},children:n.map((r,i)=>{const a=r.outcome==="success"?"✅":r.outcome==="escalated"?"🔄":"❌",o=new Date(r.timestamp).toLocaleTimeString();return s.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",padding:"5px 4px",borderBottom:"1px solid #21262d"},children:[s.jsx("span",{children:a}),s.jsx("span",{style:{color:"#e6edf3",fontSize:12,width:110,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:r.provider,children:r.provider}),s.jsx("span",{style:{fontSize:11,color:"#6e7681",width:80},children:r.complexity}),s.jsxs("span",{style:{fontSize:11,color:"#8b949e",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["reward ",r.reward.toFixed(2)]}),s.jsx("span",{style:{fontSize:11,color:"#6e7681",marginLeft:"auto"},children:o})]},i)})})]}),s.jsxs("div",{style:{fontSize:11,color:"#6e7681",marginTop:12},children:["Cold-start Beta(1,1) behaves like the heuristic router until outcomes accumulate. Enable learning with ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff config set routing.bandit true"}),"."]})]})}function Uae(e,t=1){return`${e>0?"+":""}${(e*100).toFixed(t)}%`}function Wae({state:e}){const t={pass:{bg:"#12291a",border:"#238636",color:"#3fb950",label:"✓ pass"},fail:{bg:"#2d1616",border:"#f85149",color:"#f85149",label:"✗ fail"},neutral:{bg:"#1c2128",border:"#6e7681",color:"#8b949e",label:"○ neutral"}}[e];return s.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 Hae({promotion:e}){if(!e.decisionCount)return null;const t=e.promoted?{icon:"🎖️",label:"Promoted — the bandit beats the heuristic",color:"#3fb950"}:e.sufficient?{icon:"⚠️",label:"Not promoted — the bandit is not (yet) better",color:"#d29922"}:{icon:"⏳",label:"Collecting data — need more diverged decisions",color:"#58a6ff"},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 s.jsxs(Yn,{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:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:14},children:[s.jsx("span",{style:{fontSize:22},children:t.icon}),s.jsx("span",{style:{fontSize:14,fontWeight:600,color:t.color},children:t.label})]}),s.jsxs("div",{style:{marginBottom:14},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:11,color:"#8b949e",marginBottom:5},children:[s.jsxs("span",{children:[e.divergedCount," diverged decisions"]}),s.jsxs("span",{children:["need ",e.minDecisions," for a verdict"]})]}),s.jsx("div",{style:{background:"#0d1117",borderRadius:4,height:8,overflow:"hidden",border:"1px solid #21262d"},children:s.jsx("div",{style:{width:`${n}%`,background:e.sufficient?"#3fb950":"#58a6ff",height:"100%",transition:"width 0.4s ease"}})}),s.jsxs("div",{style:{fontSize:11,color:"#6e7681",marginTop:4},children:[e.decisionCount," total decisions logged"]})]}),r.map(i=>s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"7px 0",borderBottom:"1px solid #21262d"},children:[s.jsx("span",{style:{width:70,fontSize:12,color:"#e6edf3"},children:i.label}),s.jsx("span",{style:{width:92,fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:"#8b949e"},children:Uae(i.delta)}),s.jsx("span",{style:{fontSize:11,color:"#6e7681",flex:1},children:i.note}),s.jsx(Wae,{state:i.state})]},i.key)),s.jsxs("div",{style:{fontSize:11,color:"#6e7681",marginTop:12},children:["Run auto-routed tasks with ",s.jsx("code",{style:{color:"#58a6ff"},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 Gae({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 s.jsxs(Yn,{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:[s.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:14},children:[s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:"#e6edf3",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:e.recordCount.toLocaleString()}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"learned tasks"})]}),s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #238636",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:"#3fb950",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:t.length}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"trusted providers"})]}),s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #d29922",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:"#d29922",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:n.length}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"still learning"})]})]}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:e.providers.map(r=>s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"10px 14px"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[s.jsx("span",{children:Nr(r.provider)}),s.jsx("span",{style:{fontSize:13,fontWeight:600,color:"#e6edf3"},children:sa(r.provider)}),r.trusted?s.jsxs("span",{style:eo("#3fb95026","#238636","#3fb950"),children:["trusted · ",r.samples," samples"]}):s.jsxs("span",{style:eo("#d2992226","#9e6a03","#d29922"),children:[r.samples,"/5 samples"]}),r.model&&s.jsx("span",{style:{fontSize:11,color:"#6e7681",fontFamily:"'SFMono-Regular', Consolas, monospace",marginLeft:"auto"},children:r.model.length>30?r.model.slice(0,27)+"…":r.model})]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[s.jsxs("div",{style:{width:70,fontSize:11,color:"#8b949e"},children:["win ",yh(r.winRate,0)]}),s.jsx(f0,{value:r.winRate,color:r.winRate>=.5?"#3fb950":"#f85149"}),s.jsxs("div",{style:{width:74,fontSize:11,color:"#8b949e",textAlign:"right"},children:["factor ",s.jsxs("span",{style:{color:r.trusted&&r.factor!==1?"#58a6ff":"#6e7681",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[r.factor.toFixed(2),"×"]})]})]})]},r.provider))}),s.jsxs("div",{style:{fontSize:11,color:"#6e7681",marginTop:12},children:["Enabled with ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff config set routing.mlRouter true"})," — the factor only adjusts scores when the provider has ≥ 5 similar-task wins (cold start is neutral)."]})]})}function qae({routing:e}){return e.bestModels.length?s.jsx(Yn,{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:s.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:10},children:e.bestModels.map(t=>s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",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="#3fb950",n.currentTarget.style.boxShadow="0 2px 10px #3fb95022"},onMouseLeave:n=>{n.currentTarget.style.borderColor="#21262d",n.currentTarget.style.boxShadow="none"},children:[s.jsxs("div",{style:{fontSize:12,color:"#8b949e",marginBottom:4},children:[Nr(t.model.split("/")[0])," ",t.agentType]}),s.jsx("div",{style:{fontSize:13,fontWeight:600,color:"#e6edf3",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}),s.jsxs("div",{style:{fontSize:11,color:"#6e7681",marginTop:6},children:[s.jsxs("span",{style:{color:t.successRate>=.8?"#3fb950":"#d29922"},children:[yh(t.successRate,0)," success"]})," · ",t.runs," run",t.runs!==1?"s":""]})]},`${t.agentType}-${t.model}`))})}):null}function Kae({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,i=e.totalCalls??0,a=e.totalRetrievals??0,o=e.totalFailovers??0;return s.jsxs(Yn,{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:[s.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:14},children:[s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #238636",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:"#3fb950",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:t.toLocaleString()}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"tokens saved"})]}),s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsxs("div",{style:{fontSize:22,fontWeight:700,color:"#e6edf3",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[n.toFixed(1),"%"]}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"avg context reduction"})]}),s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #d29922",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:"#d29922",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:e.repoChunks.toLocaleString()}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"repo chunks indexed"})]})]}),s.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",fontSize:12,color:"#8b949e",marginBottom:14},children:[s.jsxs("span",{children:["📞 ",i," context calls · 🧠 ",a," retrievals used · ⚠️ ",o," failovers (full-context fallback)"]}),e.dimensions>0&&s.jsxs("span",{children:["· ",e.dimensions,"-dim embeddings"]})]}),r&&r.used!==!1&&((l=r.hits)==null?void 0:l.length)>0&&s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"12px 16px",marginBottom:12},children:[s.jsxs("div",{style:{fontSize:12,fontWeight:600,color:"#e6edf3",marginBottom:8},children:["Latest retrieval — ",r.originalTokens.toLocaleString()," → ",r.reducedTokens.toLocaleString()," tokens",s.jsxs("span",{style:{color:"#3fb950",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[" (−",(c=r.pctReduced)==null?void 0:c.toFixed(0),"%)"]})]}),s.jsx("div",{style:{fontSize:11,color:"#8b949e"},children:r.hits.slice(0,5).map(u=>s.jsxs("div",{style:{marginTop:3},children:[s.jsx("span",{style:{color:"#58a6ff"},children:"▸"})," ",u.filePath," ",s.jsxs("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["(sim ",u.similarity.toFixed(3),")"]})]},u.filePath))})]}),s.jsxs("div",{style:{fontSize:11,color:"#6e7681"},children:["Pre-index your repo with ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff retrieval index <dir>"}),", query it with"," ",s.jsx("code",{style:{color:"#58a6ff"},children:'buff retrieval query "<question>"'}),", and see the same stats with"," ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff retrieval stats"}),"."]})]})}function Vae({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,i=e.freeTokens??t-(e.paidTokens??0),a=e.paidTokens??0,o=e.estimatedSavedUsd??0,l=t>0?i/t*100:0;return s.jsxs(Yn,{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:[s.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:14},children:[s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:"#e6edf3",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:t.toLocaleString()}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"tokens tracked"})]}),s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:"#e6edf3",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:n}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"requests"})]}),s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:r>0?"#d29922":"#3fb950",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:r}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"parked"})]})]}),s.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:16},children:[s.jsxs("div",{style:{flex:"1 1 200px",background:"#0d1117",borderRadius:10,padding:"12px 16px",border:"1px solid #238636"},children:[s.jsx("div",{style:{fontSize:20,fontWeight:700,color:"#3fb950",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:i.toLocaleString()}),s.jsxs("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:["tokens on free/local · ",l.toFixed(0),"% of usage"]}),s.jsxs("div",{style:{fontSize:12,color:"#3fb950",marginTop:4,fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["💰 est. $",o.toFixed(4)," saved"]})]}),s.jsxs("div",{style:{flex:"1 1 200px",background:"#0d1117",borderRadius:10,padding:"12px 16px",border:"1px solid #d29922"},children:[s.jsx("div",{style:{fontSize:20,fontWeight:700,color:a>0?"#d29922":"#8b949e",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:a.toLocaleString()}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"tokens on paid providers (spend triggered)"}),s.jsxs("div",{style:{fontSize:12,color:a>0?"#d29922":"#8b949e",marginTop:4},children:[e.paidRequests??0," paid request",e.paidRequests===1?"":"s"]})]})]}),s.jsx("div",{style:{overflowX:"auto"},children:s.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[s.jsx("thead",{children:s.jsxs("tr",{style:{borderBottom:"1px solid #21262d",color:"#8b949e"},children:[s.jsx("th",{style:{padding:"8px 10px",textAlign:"left",fontWeight:500},children:"Provider / Model"}),s.jsx("th",{style:{padding:"8px 10px",textAlign:"right",fontWeight:500},children:"Tokens"}),s.jsx("th",{style:{padding:"8px 10px",textAlign:"right",fontWeight:500},children:"Requests"}),s.jsx("th",{style:{padding:"8px 10px",textAlign:"right",fontWeight:500},children:"Resets in"}),s.jsx("th",{style:{padding:"8px 10px",textAlign:"center",fontWeight:500},children:"State"})]})}),s.jsx("tbody",{children:e.entries.map(u=>s.jsxs("tr",{style:{borderBottom:"1px solid #21262d"},children:[s.jsxs("td",{style:{padding:"8px 10px",whiteSpace:"nowrap"},children:[s.jsxs("span",{style:{color:"#e6edf3"},children:[Nr(u.provider)," ",sa(u.provider).split(" ")[0]]}),s.jsxs("span",{style:{color:"#8b949e",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[" / ",u.model.length>24?u.model.slice(0,21)+"…":u.model]})]}),s.jsx("td",{style:{padding:"8px 10px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",color:"#8b949e"},children:u.tokensConsumed.toLocaleString()}),s.jsx("td",{style:{padding:"8px 10px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",color:"#8b949e"},children:u.requests}),s.jsx("td",{style:{padding:"8px 10px",textAlign:"right",color:"#8b949e",whiteSpace:"nowrap"},children:f_(u.resetsInMs)}),s.jsx("td",{style:{padding:"8px 10px",textAlign:"center"},children:u.parked?s.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:"#2d1616",border:"1px solid #f85149",color:"#f85149"},children:"⏸ parked"}):s.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:"#12291a",border:"1px solid #238636",color:"#3fb950"},children:"✓ available"})})]},`${u.provider}|${u.model}`))})]})}),s.jsxs("div",{style:{fontSize:11,color:"#6e7681",marginTop:12},children:["Configure limits with ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff 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&&s.jsxs("div",{style:{marginTop:18},children:[s.jsx("div",{style:{fontSize:13,fontWeight:600,color:"#e6edf3",marginBottom:10},children:"🔑 Parked Accounts — multi-account key rotation"}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginBottom:8},children:"Accounts skipped predictively by the failover walk (rate-limit / auth). Fingerprints only — raw keys are never stored."}),s.jsx("div",{style:{maxHeight:180,overflowY:"auto",background:"#0d1117",border:"1px solid #21262d",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"?"#d29922":"#f85149";return s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"6px 14px",borderBottom:d<e.parkedAccounts.length-1?"1px solid #161b22":"none"},children:[s.jsx("span",{style:{fontSize:13},children:"🔒"}),s.jsxs("span",{style:{width:90,flexShrink:0,fontSize:12,color:"#e6edf3"},children:[Nr(u.provider)," ",sa(u.provider).split(" ")[0]]}),s.jsxs("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11,color:"#8b949e"},title:u.accountId,children:["#",u.accountId.slice(0,8)]}),s.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:"#161b22",border:`1px solid ${h}`,color:h,textAlign:"center"},children:f}),s.jsx("span",{style:{flex:1}}),s.jsxs("span",{style:{fontSize:11,color:"#6e7681",whiteSpace:"nowrap"},children:["re-admits in ",f_(u.remainingMs)]})]},`${u.provider}-${u.accountId}-${d}`)})})]}),e.events&&e.events.length>0&&s.jsxs("div",{style:{marginTop:18},children:[s.jsx("div",{style:{fontSize:13,fontWeight:600,color:"#e6edf3",marginBottom:10},children:"🛟 Failover Timeline — quota management & mid-session swaps"}),s.jsx("div",{style:{maxHeight:220,overflowY:"auto",background:"#0d1117",border:"1px solid #21262d",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"?"#f85149":u.type==="re-enabled"||u.type==="released"?"#3fb950":"#d29922",p=u.type==="parked"?"parked":u.type==="re-enabled"?"re-enabled":u.type==="released"?"released":"failover";return s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"6px 14px",borderBottom:d<e.events.length-1?"1px solid #161b22":"none"},children:[s.jsx("span",{style:{fontSize:13},children:f}),s.jsx("span",{style:{width:80,flexShrink:0,fontSize:11,padding:"1px 8px",borderRadius:10,background:"#161b22",border:`1px solid ${h}`,color:h,textAlign:"center"},children:p}),s.jsxs("span",{style:{flex:1,fontSize:12,color:"#e6edf3",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[Nr(u.provider)," ",sa(u.provider)]}),u.reason&&s.jsx("span",{style:{fontSize:11,color:"#8b949e"},children:u.reason}),s.jsx("span",{style:{fontSize:11,color:"#6e7681",whiteSpace:"nowrap"},children:iM(u.timestamp)})]},`${u.timestamp}-${d}`)})})]})]})}function Fd({ok:e,children:t}){return s.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:11,padding:"3px 9px",borderRadius:8,background:e===!1?"#2d1616":"#12291a",border:`1px solid ${e===!1?"#f85149":"#238636"}`,color:e===!1?"#f85149":"#3fb950",whiteSpace:"nowrap"},children:t})}function Yae({governance:e}){var r,i,a,o,l;if(!e.enabled)return s.jsx(Yn,{icon:"⚖️",title:"Admin Governance Policy",subtitle:"Hard-constraint rules the Auto router enforces on every pick",children:s.jsxs("div",{style:{fontSize:13,color:"#8b949e"},children:[s.jsx("span",{style:{color:"#3fb950"},children:"Fully permissive"})," — no governance rules active; any provider × model is eligible.",s.jsxs("div",{style:{marginTop:6,fontSize:12,color:"#6e7681"},children:["Add rules with ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff admin allow <provider>"})," ·"," ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff admin deny <provider>"})," ·"," ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff admin max-cost <usd>"})]})]})});const t=[];(r=e.allowProviders)!=null&&r.length&&t.push({label:"allow providers",items:e.allowProviders}),(i=e.denyProviders)!=null&&i.length&&t.push({label:"deny providers",items:e.denyProviders,deny:!0}),(a=e.allowModels)!=null&&a.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"),s.jsxs(Yn,{icon:"⚖️",title:"Admin Governance Policy",subtitle:"Hard-constraint rules — violating providers are eliminated, never just scored lower",children:[s.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:10},children:[t.map(c=>s.jsxs(Fd,{ok:!c.deny,children:[c.deny?"⛔":"✅"," ",c.label,": ",c.items.join(", ")]},c.label)),n.map(c=>s.jsx(Fd,{children:c},c)),t.length===0&&n.length===0&&s.jsx(Fd,{ok:!1,children:"policy configured but no rules active"})]}),s.jsxs("div",{style:{fontSize:12,color:"#6e7681"},children:["Managed via ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff admin"})," — the same policy the CLI’s"," ",s.jsx("code",{children:"model explain"})," surfaces as governance-blocked."]})]})}function Xae({rbac:e}){const t=n=>n==="admin"?"#d29922":n==="operator"?"#3fb950":"#8b949e";return s.jsxs(Yn,{icon:"🔐",title:"RBAC Identity",subtitle:"Who may write policy — role file ~/.buff/rbac.json",children:[s.jsxs("div",{style:{fontSize:13,marginBottom:10},children:[s.jsx("span",{style:{color:"#c9d1d9"},children:"You are "}),s.jsx("code",{style:{color:"#58a6ff"},children:e.identity}),s.jsx("span",{style:{color:"#8b949e"},children:" as "}),e.role?s.jsx("span",{style:{color:t(e.role),fontWeight:600},children:e.role}):s.jsx("span",{style:{color:"#8b949e"},children:"unassigned"})]}),e.legacy?s.jsxs("div",{style:{fontSize:12,color:"#6e7681"},children:[s.jsx("span",{style:{color:"#3fb950"},children:"Legacy single-user mode"})," — no roles assigned; policy writes are open to every user. Assign roles with"," ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff admin role add <you> admin"}),"."]}):s.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:[e.users.map(n=>s.jsxs(Fd,{ok:n.role!=="viewer",children:[n.user," · ",n.role,n.via==="oidc"?" (oidc)":""]},n.user)),s.jsxs("div",{style:{width:"100%",fontSize:12,color:"#6e7681",marginTop:4},children:["Policy ",s.jsx("em",{children:"writes"})," require ",s.jsx("code",{style:{color:"#58a6ff"},children:"admin"}),"; reads are open to every role."]})]})]})}function Zae({data:e}){var p,g,m,v,y,b,x,k,S,w;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),i=!!((g=t==null?void 0:t.history)!=null&&g.length),a=!!t&&(((m=t.history)==null?void 0:m.length)??0)>0||!!((v=t==null?void 0:t.preference)!=null&&v.length),o=!!((y=t==null?void 0:t.bandit)!=null&&y.enabled),l=!!((b=t==null?void 0:t.promotion)!=null&&b.decisionCount),c=!!((x=t==null?void 0:t.ml)!=null&&x.enabled)&&(t.ml.recordCount??0)>0,u=!!((k=t==null?void 0:t.quota)!=null&&k.enabled),d=!!((S=t==null?void 0:t.retrieval)!=null&&S.enabled)||!!((w=t==null?void 0:t.retrieval)!=null&&w.repoChunks),f=!!(t!=null&&t.governance),h=!!(t!=null&&t.rbac);return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"🤖 Auto Routing Insights"}),s.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"," ",s.jsx("code",{children:"buff benchmark"})," and use Auto routing to build this up over time."]}),!n&&!r&&!i&&!o&&!l&&!c&&!u&&!d&&!f&&!h?s.jsx(Pae,{}):s.jsxs(s.Fragment,{children:[a&&t&&s.jsx(Aae,{routing:t}),f&&t.governance&&s.jsx(Yae,{governance:t.governance}),(t==null?void 0:t.rbac)&&s.jsx(Xae,{rbac:t.rbac}),r&&s.jsx($ae,{usage:t.usage}),i&&s.jsx(Lae,{history:t.history}),o&&s.jsx(Fae,{bandit:t.bandit}),l&&s.jsx(Hae,{promotion:t.promotion}),c&&t.ml&&s.jsx(Gae,{ml:t.ml}),u&&s.jsx(Vae,{quota:t.quota}),d&&s.jsx(Kae,{retrieval:t.retrieval}),s.jsx(Dae,{routing:t}),s.jsx(Bae,{routing:t}),s.jsx(qae,{routing:t})]}),t&&t.providers.length===0&&t.bestModels.length===0&&t.preference.length>0&&s.jsx("div",{style:{fontSize:12,color:"#6e7681",marginTop:4},children:"Auto-router preference is always available (static profiles + real pricing); quality metrics appear once you run benchmarks and agent tasks."})]})}const p_={chat:"💬",execute:"⚙️",plan:"🗺️",edit:"✏️",skill:"🧩",learn:"📚",ci:"🔁",doctor:"🩺",probe:"🔭","spot-check":"🧪",telemetry:"📡",usage:"🧮","ide-chat":"💬","ide-inline":"✍️","ide-execute":"⚙️"};function Qae(e){return new Date(e).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function yd(e){return e!==void 0?`${e}ms`:"—"}function aM(e){return e===0?"#3fb950":e<.2?"#d29922":"#f85149"}function Jae({data:e}){const t=e.rows,n=t.reduce((c,u)=>c+u.requests,0),r=t.reduce((c,u)=>c+Math.round(u.errorRate*u.requests),0),i=t.reduce((c,u)=>c+(u.costUsd??0),0),a=t.flatMap(c=>c.latency?[c.latency.avg]:[]),o=a.length>0?Math.round(a.reduce((c,u)=>c+u,0)/a.length):void 0,l=new Set(t.map(c=>c.action)).size;return s.jsxs("div",{className:"stats-grid",style:{marginBottom:16},children:[s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"📨"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",children:n.toLocaleString()}),s.jsx("div",{className:"stat-label",children:"Requests"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"🎯"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",children:t.length}),s.jsx("div",{className:"stat-label",children:"provider × model × action groups"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"⚡"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:o!==void 0?"#3fb950":"#8b949e"},children:o!==void 0?`${o}ms`:"—"}),s.jsxs("div",{className:"stat-label",children:["Avg latency",o!==void 0?` (${a.length} groups)`:" (no samples)"]})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"📛"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:aM(n>0?r/n:0)},children:n>0?`${(r/n*100).toFixed(1)}%`:"—"}),s.jsxs("div",{className:"stat-label",children:["Overall error rate (",r.toLocaleString()," failures)"]})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"💰"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:i>0?"#d29922":"#8b949e"},children:i>0?`$${i.toFixed(4)}`:"—"}),s.jsxs("div",{className:"stat-label",children:["Measured cost",l>0?` · ${l} actions`:""]})]})]})]})}function ese({data:e}){const[t,n]=E.useState(""),[r,i]=E.useState("all"),a=e==null?void 0:e.requests,o=E.useMemo(()=>{if(!a)return[];const c=t.trim().toLowerCase();return a.rows.filter(u=>r!=="all"&&u.action!==r?!1:c?`${u.provider} ${u.model} ${u.action}`.toLowerCase().includes(c):!0)},[a,t,r]);if(!e)return s.jsx("div",{className:"loading-state",children:s.jsx("p",{children:"Loading requests..."})});if(!a||!a.enabled||a.rows.length===0)return s.jsxs("div",{className:"empty-state",style:{padding:"40px 24px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:28,marginBottom:10},children:"📨"}),s.jsx("h2",{className:"section-title",style:{marginTop:0},children:"Requests — per provider × model × action"}),s.jsxs("p",{className:"section-description",style:{maxWidth:560,margin:"0 auto"},children:["No request telemetry yet. As you use ",s.jsx("strong",{children:"chat"}),", ",s.jsx("strong",{children:"execute"}),","," ",s.jsx("strong",{children:"plan"})," and ",s.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 l=[...new Set(a.rows.map(c=>c.action))].sort();return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"📨 Requests — per provider × model × action"}),s.jsx("p",{className:"section-description",children:"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."}),s.jsx(Jae,{data:a}),s.jsxs("div",{style:{display:"flex",gap:12,marginBottom:14,flexWrap:"wrap",alignItems:"center"},children:[s.jsxs("select",{value:r,onChange:c=>i(c.target.value),"aria-label":"Filter by action",style:{background:"#161b22",color:"#e6edf3",border:"1px solid #30363d",borderRadius:8,padding:"8px 10px",fontSize:13,cursor:"pointer"},children:[s.jsx("option",{value:"all",children:"All actions"}),l.map(c=>s.jsxs("option",{value:c,children:[p_[c]||"🎯"," ",c]},c))]}),s.jsxs("div",{style:{flex:1,minWidth:220,position:"relative"},children:[s.jsx("span",{style:{position:"absolute",left:10,top:8,color:"#6e7681",fontSize:13},children:"🔍"}),s.jsx("input",{type:"text",value:t,onChange:c=>n(c.target.value),placeholder:"Search provider, model or action...",style:{width:"100%",padding:"8px 12px 8px 32px",background:"#161b22",border:"1px solid #30363d",borderRadius:8,color:"#e6edf3",fontSize:13,outline:"none"}})]}),s.jsxs("span",{style:{fontSize:12,color:"#8b949e",whiteSpace:"nowrap"},children:[o.length," of ",a.rows.length," groups"]})]}),s.jsx("div",{style:{overflowX:"auto"},children:s.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[s.jsx("thead",{children:s.jsxs("tr",{style:{borderBottom:"1px solid #21262d",color:"#8b949e",textAlign:"left"},children:[s.jsx("th",{style:{padding:"8px 12px",fontWeight:500},children:"Action"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:500},children:"Provider"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:500},children:"Model"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"Requests"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"Error rate"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"Latency avg"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"p50"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"p95"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"p99"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"Measured cost"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"Last seen"})]})}),s.jsx("tbody",{children:o.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:11,style:{padding:28,textAlign:"center",color:"#6e7681"},children:"No request groups match your filter."})}):o.map(c=>{var u;return s.jsxs("tr",{style:{borderBottom:"1px solid #21262d"},children:[s.jsx("td",{style:{padding:"8px 12px",whiteSpace:"nowrap"},children:s.jsxs("span",{style:{fontSize:11,padding:"2px 8px",borderRadius:8,background:"#21262d",color:"#c9d1d9",border:"1px solid #30363d"},children:[p_[c.action]||"🎯"," ",c.action]})}),s.jsx("td",{style:{padding:"8px 12px",color:"#e6edf3",whiteSpace:"nowrap"},children:c.provider}),s.jsxs("td",{style:{padding:"8px 12px",color:"#8b949e",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,maxWidth:260,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:c.callIds.length>0?`Correlation ids: ${c.callIds.join(", ")}`:void 0,children:[c.model.length>42?c.model.slice(0,39)+"…":c.model,c.callIds.length>0&&s.jsxs("span",{style:{color:"#6e7681",marginLeft:6},title:c.callIds.join(", "),children:["🔗",c.callIds.length]})]}),s.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:c.requests}),s.jsxs("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:aM(c.errorRate)},children:[(c.errorRate*100).toFixed(1),"%",(c.partials??0)>0&&s.jsxs("span",{title:`⏸ ${c.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:"#21122e",border:"1px solid #bc8cff",color:"#bc8cff"},children:["⏸ ",c.partials]})]}),s.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:yd((u=c.latency)==null?void 0:u.avg)}),s.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:c.latency&&c.latency.samples>=3?yd(c.latency.p50):"—"}),s.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:c.latency&&c.latency.samples>=3?yd(c.latency.p95):"—"}),s.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:c.latency&&c.latency.samples>=3?yd(c.latency.p99):"—"}),s.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:c.costUsd?"#d29922":"#6e7681"},children:c.costUsd!==void 0?`$${c.costUsd.toFixed(4)}`:"—"}),s.jsx("td",{style:{padding:"8px 12px",textAlign:"right",color:"#6e7681",fontSize:11,whiteSpace:"nowrap"},children:Qae(c.lastAt)})]},`${c.action}|${c.provider}|${c.model}`)})})]})}),s.jsx("div",{style:{textAlign:"center",fontSize:12,color:"#484f58",marginTop:12},children:"Auto-refreshes with the dashboard feed · percentile columns need ≥3 latency samples per group"})]})}const tse={local:"💻",groq:"🟢",nim:"🔶",gemini:"🔷",openrouter:"🟣"},nse={planner:"🗺️",writer:"✍️",reviewer:"🔎",tester:"🧪",debugger:"🐛",runner:"🏃","context-gatherer":"📂",memory:"🧠","self-improver":"📈"};function rse(e){return tse[e]||"🔌"}function ise(e){return nse[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 h0(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 ic(e){return e==null?"0":e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function ase(e){var n,r;if(!e)return null;const t={bg:"#0d1117",border:"#30363d"};return e.unverifiedClaim?{text:"⚠️ unverified claim — said it acted, but no tool ran",color:"#d29922",bg:"#3d2c00",border:"#d29922"}:e.unfulfilledPromise?{text:"⚠️ unfulfilled promise — announced an action it never performed",color:"#d29922",bg:"#3d2c00",border:"#d29922"}:e.unverifiedEditClaim?{text:"⚠️ unverified edit claim — asserted a fix, but nothing verified it",color:"#d29922",bg:"#3d2c00",border:"#d29922"}:e.unverifiedEdit?{text:`⚠️ unverified edit — ${((n=e.tools)==null?void 0:n.length)??0} tool(s), no test/typecheck/browser run`,color:"#d29922",bg:"#3d2c00",border:"#d29922"}:e.kind==="acted"?{text:e.delivered?"✅ action performed — message sent":`🔧 acted — ${((r=e.tools)==null?void 0:r.length)??0} tool(s)`,color:"#3fb950",bg:"#0d2818",border:"#238636"}:e.kind==="answered"?{text:"💬 answered — no action taken",color:"#8b949e",...t}:e.kind==="cancelled"?{text:"⏹ cancelled",color:"#8b949e",...t}:{text:"❌ generation failed",color:"#f85149",bg:"#2d0f0f",border:"#f85149"}}function qv({icon:e,title:t,subtitle:n,children:r}){return s.jsxs("div",{style:{background:"#161b22",borderRadius:12,border:"1px solid #21262d",padding:"18px 20px",marginBottom:16},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:4},children:[s.jsx("span",{style:{fontSize:20},children:e}),s.jsx("h3",{style:{fontSize:15,fontWeight:600,color:"#e6edf3",margin:0},children:t})]}),n&&s.jsx("p",{style:{fontSize:12,color:"#8b949e",margin:"2px 0 12px 0"},children:n}),!n&&s.jsx("div",{style:{height:6}}),r]})}function sse(){return s.jsxs("div",{style:{background:"#0d1117",border:"1px dashed #30363d",borderRadius:10,padding:"18px 20px",color:"#8b949e",fontSize:13,textAlign:"center"},children:["🔍 No reasoning traces yet — every LLM call in a ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff execute"})," pipeline is recorded to ",s.jsx("code",{style:{color:"#58a6ff"},children:"reasoning-traces.json"}),". Run a pipeline, then replay it here or with ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff trace replay <id>"}),"."]})}function ose({step:e}){const[t,n]=E.useState(!1),r=e.success?"#3fb950":"#f85149",i=e.success?"ok":"failed";return s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:8,marginBottom:8,overflow:"hidden"},children:[s.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:[s.jsx("span",{style:{width:26,fontSize:16},children:ise(e.agentType)}),s.jsx("span",{style:{width:130,fontSize:12,fontWeight:600,color:"#e6edf3",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:e.agentType,children:e.agentType}),s.jsxs("span",{style:{flex:1,fontSize:12,color:"#8b949e",fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:`${e.provider}/${e.model}`,children:[rse(e.provider)," ",e.provider,"/",e.model]}),s.jsx("span",{style:{width:70,fontSize:11,color:"#6e7681",textAlign:"right"},children:h0(e.latencyMs)}),s.jsxs("span",{style:{width:86,fontSize:11,color:"#6e7681",fontFamily:"'SFMono-Regular', Consolas, monospace",textAlign:"right"},children:[ic(e.inputTokens),"→",ic(e.outputTokens)," tok"]}),s.jsx("span",{style:{width:46,fontSize:11,color:r,textAlign:"right"},children:i}),s.jsx("span",{style:{width:22,fontSize:11,textAlign:"right"},children:e.escalated?s.jsx("span",{title:"Repair escalated to a stronger routed model (v1.60.4)",children:"🚀"}):""}),s.jsx("span",{style:{fontSize:11,color:"#6e7681"},children:t?"▾":"▸"})]}),t&&s.jsxs("div",{style:{padding:"0 14px 12px 50px",fontSize:12},children:[e.taskId&&s.jsxs("div",{style:{color:"#6e7681",marginBottom:4},children:["Task: ",s.jsx("span",{style:{color:"#8b949e",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:e.taskId})]}),e.description&&s.jsx("div",{style:{color:"#8b949e",marginBottom:6},children:e.description}),e.routing&&s.jsxs("div",{style:{marginBottom:6},children:[s.jsxs("span",{style:{fontSize:10,padding:"1px 8px",borderRadius:10,background:e.escalated?"#3d2c00":"#1c2128",border:e.escalated?"1px solid #d29922":"1px solid #58a6ff",color:e.escalated?"#d29922":"#58a6ff"},children:[e.escalated?"🚀 escalated auto → ":"🤖 auto → ",e.routing.provider,"/",e.routing.model," · score ",e.routing.score.toFixed(3)," · ",e.routing.complexity]}),e.escalated&&s.jsx("div",{style:{color:"#d29922",marginTop:4,fontSize:11},children:"Repair escalated to a stronger routed model (next complexity level)."}),e.routing.explanation&&s.jsx("div",{style:{color:"#6e7681",marginTop:4,fontSize:11},children:e.routing.explanation})]}),e.layers&&s.jsxs("div",{style:{marginBottom:6,fontSize:11,color:"#6e7681",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[s.jsx("span",{style:{color:"#58a6ff"},children:"sys"})," ",e.layers.systemChars,"c/#",e.layers.systemDigest," ·"," ",s.jsx("span",{style:{color:"#7ee787"},children:"ctx"})," ",e.layers.contextChars,"c/#",e.layers.contextDigest," ·"," ",s.jsx("span",{style:{color:"#d29922"},children:"vol"})," ",e.layers.volatileChars,"c/#",e.layers.volatileDigest,s.jsxs("div",{style:{color:"#484f58",marginTop:2},children:["a constant ",s.jsx("span",{style:{color:"#58a6ff"},children:"sys"})," digest across steps ⇒ the stable layer is prompt-cacheable"]})]}),e.error&&s.jsxs("div",{style:{color:"#f85149",marginBottom:6},children:["⚠️ ",e.error.slice(0,300)]}),s.jsxs("div",{style:{color:"#6e7681",margin:"6px 0 3px 0"},children:["Prompt ",s.jsxs("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["#",e.promptDigest]})," · ",e.promptPreview.length,"+ chars:"]}),s.jsx("pre",{style:{background:"#161b22",border:"1px solid #21262d",borderRadius:6,padding:8,margin:0,color:"#8b949e",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:180,overflowY:"auto",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11},children:e.promptPreview.slice(0,900)}),s.jsxs("div",{style:{color:"#6e7681",margin:"8px 0 3px 0"},children:["Response (",ic(e.responseLength)," chars):"]}),s.jsx("pre",{style:{background:"#161b22",border:"1px solid #21262d",borderRadius:6,padding:8,margin:0,color:"#c9d1d9",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:240,overflowY:"auto",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11},children:e.responsePreview.slice(0,1200)})]})]})}function lse({trace:e}){const[t,n]=E.useState(e.steps??null),[r,i]=E.useState(!1);E.useEffect(()=>{if(e.steps){n(e.steps);return}let l=!1;return ee.fetchTraceDetail(e.id).then(c=>{l||(c!=null&&c.steps?n(c.steps):i(!0))}),()=>{l=!0}},[e.id,e.steps]);const a=e.success===!0?"✅":e.success===!1?"❌":"⏳",o=e.success===!0?"success":e.success===!1?"failed":"in progress";return s.jsxs(qv,{icon:a,title:`${e.id} — ${o}`,subtitle:e.goal,children:[s.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginBottom:12},children:[s.jsxs("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"#0d1117",border:"1px solid #30363d",color:"#8b949e"},children:["🕓 ",sM(e.startedAt)]}),(()=>{const l=ase(e.outcome);return l?s.jsx("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:l.bg,border:`1px solid ${l.border}`,color:l.color},children:l.text}):null})(),s.jsxs("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"#0d1117",border:"1px solid #30363d",color:"#8b949e"},children:["⏱ ",h0(e.durationMs)]}),s.jsxs("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"#0d1117",border:"1px solid #30363d",color:"#8b949e"},children:["🔢 ",(t==null?void 0:t.length)??"?"," call(s)"]}),t&&t.some(l=>l.escalated)&&s.jsxs("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"#3d2c00",border:"1px solid #d29922",color:"#d29922"},children:["🚀 ",t.filter(l=>l.escalated).length," escalated repair(s)"]}),e.totalTokens!==void 0&&s.jsxs("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"#0d1117",border:"1px solid #30363d",color:"#8b949e"},children:["🧮 ",ic(e.totalTokens)," tok"]})]}),e.systemPrompt&&s.jsxs("details",{style:{marginBottom:12},children:[s.jsxs("summary",{style:{cursor:"pointer",fontSize:12,color:"#58a6ff"},children:["🧬 System prompt — stable layer (",e.systemPromptChars??e.systemPrompt.length," chars)"]}),s.jsx("pre",{style:{background:"#161b22",border:"1px solid #21262d",borderRadius:6,padding:10,margin:"8px 0 0 0",color:"#8b949e",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:320,overflowY:"auto",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11},children:e.systemPrompt})]}),r&&s.jsx("div",{style:{color:"#f85149",fontSize:12,marginBottom:10},children:"Could not load trace steps (trace may have been deleted)."}),t===null&&!r&&s.jsx("div",{style:{color:"#8b949e",fontSize:12},children:"Loading steps…"}),t&&t.length===0&&s.jsx("div",{style:{color:"#8b949e",fontSize:12},children:"No LLM calls recorded in this trace."}),t&&t.map(l=>s.jsx(ose,{step:l},l.seq))]})}function cse({traces:e}){const[t,n]=E.useState(null);return t?s.jsxs(s.Fragment,{children:[s.jsx("button",{onClick:()=>n(null),style:{background:"#21262d",border:"1px solid #30363d",color:"#e6edf3",borderRadius:8,padding:"6px 14px",fontSize:12,cursor:"pointer",marginBottom:12},children:"← Back to traces"}),s.jsx(lse,{trace:t})]}):s.jsx("div",{children:e.map(r=>{const i=r.success===!0?"✅":r.success===!1?"❌":"⏳",a=r.steps?[...new Set(r.steps.map(o=>o.agentType))].join(", "):"";return s.jsxs("button",{onClick:()=>n(r),style:{width:"100%",background:"#0d1117",border:"1px solid #21262d",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="#58a6ff",o.currentTarget.style.boxShadow="0 2px 10px #58a6ff22"},onMouseLeave:o=>{o.currentTarget.style.borderColor="#21262d",o.currentTarget.style.boxShadow="none"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[s.jsx("span",{children:i}),s.jsx("span",{style:{fontSize:11,color:"#58a6ff",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:r.id}),s.jsx("span",{style:{fontSize:11,color:"#6e7681",marginLeft:"auto"},children:sM(r.startedAt)})]}),s.jsx("div",{style:{fontSize:13,color:"#e6edf3",marginBottom:6},children:r.goal}),s.jsxs("div",{style:{display:"flex",gap:10,flexWrap:"wrap",fontSize:11,color:"#8b949e"},children:[s.jsxs("span",{children:["🔢 ",r.stepCount??0," call(s)"]}),s.jsxs("span",{children:["⏱ ",h0(r.durationMs)]}),r.failedSteps?s.jsxs("span",{style:{color:"#f85149"},children:["❌ ",r.failedSteps," failed"]}):s.jsx("span",{style:{color:"#3fb950"},children:"✓ all ok"}),r.totalTokens!==void 0&&s.jsxs("span",{children:["🧮 ",ic(r.totalTokens)," tok"]}),a&&s.jsxs("span",{children:["🤖 ",a.slice(0,60)]})]})]},r.id)})})}function use(){const[e,t]=E.useState(null),[n,r]=E.useState(!1),i=E.useCallback(()=>{ee.fetchTraces().then(a=>{a?(t(a),r(!1)):r(!0)})},[]);return E.useEffect(()=>{i();const a=setInterval(i,15e3);return()=>clearInterval(a)},[i]),s.jsxs("div",{className:"panel",children:[s.jsxs("div",{style:{marginBottom:16},children:[s.jsx("h2",{style:{margin:0,fontSize:18,color:"#e6edf3"},children:"🔍 Reasoning Traces"}),s.jsx("p",{style:{margin:"4px 0 0 0",fontSize:12,color:"#8b949e"},children:"Every LLM call in each pipeline — agent × model × prompt digest × response × tokens × latency × routing snapshot (assessment P0)."})]}),e===null&&!n&&s.jsx(qv,{icon:"⏳",title:"Loading…",children:s.jsx("div",{style:{color:"#8b949e",fontSize:13},children:"Fetching reasoning traces…"})}),n&&e===null&&s.jsx(qv,{icon:"⚠️",title:"Could not reach the dashboard server",children:s.jsxs("div",{style:{color:"#8b949e",fontSize:13},children:["The traces endpoint is unavailable right now — retrying automatically. Run"," ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff trace list"})," in the terminal to inspect traces directly."]})}),e!==null&&e.length===0&&s.jsx(sse,{}),e!==null&&e.length>0&&s.jsx(cse,{traces:e})]})}function ig(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)&&t>=0?t:null}function dse({authed:e,role:t}){const[n,r]=E.useState(null),[i,a]=E.useState({}),[o,l]=E.useState(""),[c,u]=E.useState(!1),[d,f]=E.useState(null),[h,p]=E.useState(null),g=e&&(t==="admin"||t==="operator"),m=e&&t==="admin",v=E.useCallback(async()=>{var _,N,C;const S=await ee.fetchAdminQuota();if(!S){p("Could not load budget config.");return}p(null),r(S);const w={};for(const T of S.providers){const $=S.quota[T]||{};w[T]={provider:T,tokens:((_=$.tokensPerWindow)==null?void 0:_.toString())??"",requests:((N=$.requestsPerWindow)==null?void 0:N.toString())??"",windowMs:((C=$.windowMs)==null?void 0:C.toString())??""}}a(w),l(S.costUsd===null?"":String(S.costUsd))},[]);E.useEffect(()=>{v()},[v]);const y=(S,w,_)=>{a(N=>({...N,[S]:{...N[S]||{provider:S},[w]:_}}))},b=async()=>{u(!0),f(null);const S={};for(const N of Object.values(i)){const C={},T=ig(N.tokens),$=ig(N.requests),R=ig(N.windowMs);T!==null&&(C.tokensPerWindow=T),$!==null&&(C.requestsPerWindow=$),R!==null&&(C.windowMs=R),S[N.provider]=Object.keys(C).length>0?C:null}const w={quota:S};if(m)if(o.trim()!==""){const N=Number(o);if(!Number.isFinite(N)||N<0){f({ok:!1,text:"Cost cap must be a non-negative number."}),u(!1);return}w.costUsd=N}else w.costUsd=null;const _=await ee.saveAdminQuota(w);u(!1),_.ok?(f({ok:!0,text:"Budget saved — the quota ledger + auto-router will enforce it."}),v()):f({ok:!1,text:_.error||"Save failed."})},x=S=>{const w=n==null?void 0:n.quota[S];return!!w&&(w.tokensPerWindow!==void 0||w.requestsPerWindow!==void 0||w.windowMs!==void 0)},k=S=>"admin-input";return s.jsxs("div",{className:"admin-quota-panel",children:[s.jsx("h3",{className:"section-subtitle",children:"💰 Daily Budget (routing.quota — your plan, your say)"}),s.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 ",s.jsx("code",{children:"buff model quota set"}),"."]}),h?s.jsx("div",{className:"admin-error",children:h}):null,n?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"admin-quota-table",children:[s.jsxs("div",{className:"admin-quota-row admin-quota-head",children:[s.jsx("span",{children:"Provider"}),s.jsx("span",{children:"Tokens / window"}),s.jsx("span",{children:"Requests / window"}),s.jsx("span",{children:"Window (ms)"}),s.jsx("span",{children:"Status"})]}),n.providers.map(S=>{var w,_,N;return s.jsxs("div",{className:"admin-quota-row",children:[s.jsx("span",{className:"admin-provider-type",children:S}),s.jsx("input",{className:k(!g),type:"number",min:0,placeholder:"unset",disabled:!g,value:((w=i[S])==null?void 0:w.tokens)??"",onChange:C=>y(S,"tokens",C.target.value)}),s.jsx("input",{className:k(!g),type:"number",min:0,placeholder:"unset",disabled:!g,value:((_=i[S])==null?void 0:_.requests)??"",onChange:C=>y(S,"requests",C.target.value)}),s.jsx("input",{className:k(!g),type:"number",min:0,placeholder:"86400000 (24h)",disabled:!g,value:((N=i[S])==null?void 0:N.windowMs)??"",onChange:C=>y(S,"windowMs",C.target.value)}),s.jsx("span",{className:`admin-role-badge ${x(S)?"admin-role-admin":"admin-role-viewer"}`,children:x(S)?"declared":"unset"})]},S)})]}),s.jsxs("div",{className:"admin-quota-row admin-quota-cost",children:[s.jsx("span",{className:"admin-provider-type",children:"Max cost / call (USD, admin)"}),s.jsx("input",{className:k(!m),type:"number",min:0,step:.01,placeholder:"unset",disabled:!m,value:o,onChange:S=>l(S.target.value)}),s.jsx("span",{className:"admin-quota-cost-hint",children:"governance.maxCostUsd — hard admin cap"})]}),g||m?s.jsxs("div",{className:"admin-quota-actions",children:[s.jsx("button",{className:"admin-mini-btn",onClick:()=>void b(),disabled:c,children:c?"⏳ Saving…":"💾 Save budget"}),d?s.jsx("span",{className:d.ok?"admin-quota-ok":"admin-quota-err",children:d.text}):null]}):s.jsxs("div",{className:"admin-readonly-note",children:["🔒 Read-only for ",s.jsx("code",{children:t})," — budget limits need ",s.jsx("code",{children:"admin"})," or"," ",s.jsx("code",{children:"operator"}),"; the cost cap needs ",s.jsx("code",{children:"admin"}),"."]})]}):s.jsx("div",{className:"empty-state",children:"Loading budget…"})]})}const fse={pass:"✅",warn:"⚠️",fail:"❌"},hse={pass:"PASS",warn:"WARN",fail:"FAIL"},pse={env:"Environment",config:"Config",vault:"Vault",local:"Local (no key)",none:"Not configured"};function m_({check:e}){return s.jsxs("div",{className:"admin-check-row","data-status":e.status,children:[s.jsxs("span",{className:`admin-check-badge admin-check-${e.status}`,children:[fse[e.status]," ",hse[e.status]]}),s.jsxs("div",{className:"admin-check-body",children:[s.jsx("div",{className:"admin-check-name",children:e.name}),s.jsx("div",{className:"admin-check-message",children:e.message}),e.detail?s.jsx("div",{className:"admin-check-detail",children:e.detail}):null,e.fix?s.jsxs("div",{className:"admin-check-fix",children:["💡 ",e.fix]}):null]})]})}function mse(){const[e,t]=E.useState(null),[n,r]=E.useState(!0),[i,a]=E.useState(null),[o,l]=E.useState(null),[c,u]=E.useState(!1),[d,f]=E.useState(null),[h,p]=E.useState(null),[g,m]=E.useState(""),[v,y]=E.useState(""),[b,x]=E.useState(""),[k,S]=E.useState(null),[w,_]=E.useState(!1),[N,C]=E.useState([]),[T,$]=E.useState(null),[R,L]=E.useState(""),[I,z]=E.useState(""),[D,F]=E.useState("viewer"),[O,P]=E.useState([]),[A,Y]=E.useState({}),[K,M]=E.useState(null),[le,be]=E.useState({}),[me,Pe]=E.useState(""),[H,X]=E.useState(null),[oe,ce]=E.useState(null),Z=E.useCallback(async()=>{r(!0),a(null);const G=await ee.fetchAdminChecks();t(G),G||a("Could not reach the dashboard server, or the server is older than this panel. Run `buff dashboard` to start it."),r(!1)},[]),_e=E.useCallback(async()=>{const G=await ee.fetchAdminCatalog();G&&G.length>0&&P(G)},[]),we=E.useCallback(async()=>{const G=await ee.fetchAdminUsers();G.ok&&G.users&&C(G.users)},[]);E.useEffect(()=>{let G=!0;return ee.fetchAdminAuthStatus().then(he=>{if(G){if(!he){a("Could not reach the dashboard server, or the server is older than this panel. Run `buff dashboard` to start it."),r(!1);return}l({configured:he.configured,authenticated:he.authenticated}),u(he.authenticated),f(he.role??null),p(he.user??null),he.authenticated?(Z(),_e(),we()):r(!1)}}),()=>{G=!1}},[Z,_e,we]);const Ne=d==="admin",ge=()=>{u(!1),l(G=>G&&{...G,authenticated:!1}),S("Session expired — log in again.")},Be=async G=>{G.preventDefault(),_(!0),S(null);const he=await ee.adminLogin(g,v);he.ok?(u(!0),l({configured:!0,authenticated:!0}),f(he.role??"admin"),p(he.user??null),m(""),y(""),Z(),_e(),we()):S(he.error||"Login failed."),_(!1)},pe=async G=>{if(G.preventDefault(),_(!0),S(null),v.length<8){S("Password must be at least 8 characters."),_(!1);return}if(v!==b){S("Passwords do not match."),_(!1);return}const he=await ee.adminSetup(g,v);he.ok?(u(!0),l({configured:!0,authenticated:!0}),f(he.role??"admin"),p(he.user??null),m(""),y(""),x(""),Z(),_e(),we()):S(he.error||"Setup failed."),_(!1)},Ct=async()=>{await ee.adminLogout(),u(!1),l(G=>G&&{...G,authenticated:!1}),f(null),p(null),t(null),Y({}),be({}),C([])},We=async()=>{if(!window.confirm("Stop the running gateway? Channels will stop responding until you restart it with `buff gateway start`."))return;ce("gateway"),X(null);const G=await ee.shutdown("gateway");ce(null),G.ok?X(G.stopped?"✅ Gateway stopped.":`ℹ️ ${G.reason||"No running gateway found — nothing to stop."}`):(X(`❌ ${G.error||"Stop failed."}`),G.unauthorized&&ge())},Oe=async()=>{window.confirm("Shut down the dashboard? This page will disconnect and the server will exit. Restart with `buff dashboard`.")&&(ce("dashboard"),X("🛑 Shutting down the dashboard — this page will disconnect…"),await ee.shutdown("dashboard"),ce(null),X("ℹ️ The dashboard server did not stop (see the server terminal). You can also stop it with `buff dashboard stop`."))},Ze=async G=>{if(G.preventDefault(),$(null),I.length<8){$("Password must be at least 8 characters.");return}const he=await ee.addAdminUser(R,I,D);he.ok?(L(""),z(""),$("✅ User added"),we()):($(`❌ ${he.error||"Failed to add user"}`),he.unauthorized&&ge())},Me=async G=>{if(!window.confirm(`Remove dashboard user '${G}'?`))return;$(null);const he=await ee.removeAdminUser(G);he.ok?($(`✅ Removed ${G}`),we()):($(`❌ ${he.error||"Failed to remove user"}`),he.unauthorized&&ge())},Qt=(G,he,Ie)=>{Y(Re=>({...Re,[G]:{...Re[G]||{},[he]:Ie}}))},$t=async G=>{M(G),be({});const he=A[G]||{},Ie=await ee.saveProvider(G,he);Ie.ok?(t(Re=>{if(!Re)return Re;const Jt=Re.providers.some(An=>An.type===G)?Re.providers.map(An=>An.type===G&&Ie.provider?Ie.provider:An):Ie.provider?[...Re.providers,Ie.provider]:Re.providers;return{...Re,providers:Jt}}),Y(Re=>{const Cr={...Re};return delete Cr[G],Cr}),be(Re=>({...Re,[G]:"✅ Saved"}))):(be(Re=>({...Re,[G]:`❌ ${Ie.error||"Save failed"}`})),Ie.unauthorized&&ge()),M(null)},U=async G=>{if(!window.confirm(`Remove ${G}'s API key and configuration? This cannot be undone.`))return;M(G),be({});const he=await ee.deleteProvider(G);he.ok?he.envSourced?(t(Ie=>Ie&&{...Ie,providers:Ie.providers.map(Re=>Re.type===G&&he.provider||Re)}),be(Ie=>({...Ie,[G]:`⚠️ Key comes from ${he.envVar?`$${he.envVar}`:"an env var"} — unset it there to remove it (config can't override the env).`}))):(t(Ie=>Ie&&{...Ie,providers:Ie.providers.filter(Re=>Re.type!==G)}),Y(Ie=>{const Re={...Ie};return delete Re[G],Re})):(be(Ie=>({...Ie,[G]:`❌ ${he.error||"Remove failed"}`})),he.unauthorized&&ge()),M(null)},V=async G=>{M(G);const he=await ee.testProvider(G);be(Ie=>{var Re;return{...Ie,[G]:he.ok?`✅ Connected — ${((Re=he.models)==null?void 0:Re.length)??0} model(s) reachable`:`❌ ${he.error||"Connection failed"}`}}),M(null)},se=()=>{me&&(Y(G=>({...G,[me]:{}})),Pe(""))};if(i&&!o)return s.jsxs("div",{className:"admin-header",children:[s.jsx("h2",{className:"section-title",children:"🛠️ Admin"}),s.jsx("div",{className:"admin-error",children:i})]});if(!o||!c&&n)return s.jsxs("div",{className:"admin-header",children:[s.jsx("h2",{className:"section-title",children:"🛠️ Admin"}),s.jsxs("div",{className:"loading-state",children:[s.jsx("div",{className:"loading-spinner"}),s.jsx("p",{children:"Loading…"})]})]});if(!c){const G=!o.configured;return s.jsxs("div",{className:"admin-header",children:[s.jsxs("h2",{className:"section-title",children:["🛠️ Admin — ",G?"Set up access":"Log in"]}),s.jsx("p",{className:"admin-subtitle",children:G?"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."}),s.jsxs("form",{className:"admin-gate-form",onSubmit:G?pe:Be,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{type:"text",value:g,onChange:he=>m(he.target.value),autoComplete:"username",placeholder:"admin"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Password"}),s.jsx("input",{type:"password",value:v,onChange:he=>y(he.target.value),autoComplete:G?"new-password":"current-password",placeholder:"••••••••"})]}),G?s.jsxs("label",{children:[s.jsx("span",{children:"Confirm password"}),s.jsx("input",{type:"password",value:b,onChange:he=>x(he.target.value),autoComplete:"new-password",placeholder:"••••••••"})]}):null,k?s.jsx("div",{className:"admin-error",children:k}):null,s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:w||!g||!v,children:w?"⏳ …":G?"🔐 Create admin":"🔐 Log in"}),G?s.jsxs("p",{className:"admin-hint",children:["Automation alternative: set ",s.jsx("code",{children:"BUFF_DASHBOARD_ADMIN_USER"})," and"," ",s.jsx("code",{children:"BUFF_DASHBOARD_ADMIN_PASSWORD"})," in the dashboard's environment."]}):null]})]})}const fe=(e==null?void 0:e.system.filter(G=>G.status==="pass").length)??0,Se=(e==null?void 0:e.system.filter(G=>G.status==="warn").length)??0,Qe=(e==null?void 0:e.system.filter(G=>G.status==="fail").length)??0,Lt=(e==null?void 0:e.enterprise.filter(G=>G.status==="pass").length)??0,Ot=(e==null?void 0:e.enterprise.filter(G=>G.status==="warn").length)??0,jn=(e==null?void 0:e.enterprise.filter(G=>G.status==="fail").length)??0,xt=(e==null?void 0:e.providers)??[],dt=G=>{const he=O.find(Ie=>Ie.id===G);return he||{label:G}};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"admin-header",children:[s.jsxs("h2",{className:"section-title",children:["🛠️ Admin — Command Runner & Configuration",h?s.jsxs("span",{className:`admin-role-badge admin-role-${d||"viewer"}`,children:[h," · ",d||"viewer"]}):null]}),s.jsxs("div",{className:"admin-header-actions",children:[s.jsx("button",{className:"admin-refresh-btn",onClick:()=>void Z(),disabled:n,children:n?"⏳ Running checks…":"🔄 Refresh (run all commands)"}),Ne||d==="operator"?s.jsx("button",{className:"admin-logout-btn",onClick:()=>void We(),disabled:oe!==null,title:"Stop the running gateway (buff gateway stop)",children:oe==="gateway"?"⏳ Stopping…":"⏻ Stop gateway"}):null,Ne?s.jsx("button",{className:"admin-logout-btn",onClick:()=>void Oe(),disabled:oe!==null,title:"Shut down this dashboard server (buff dashboard stop)",children:oe==="dashboard"?"⏳ Stopping…":"🛑 Stop dashboard"}):null,s.jsx("button",{className:"admin-logout-btn",onClick:()=>void Ct(),children:"🚪 Log out"})]})]}),H?s.jsx("div",{className:"admin-error",children:H}):null,Ne?null:s.jsxs("div",{className:"admin-readonly-note",children:["🔒 Your role (",s.jsx("code",{children:d||"viewer"}),") is read-only here — provider configuration and user management require the ",s.jsx("code",{children:"admin"})," role. The CLI enforces the same governance policy (rbac.json)."]}),s.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."}),i?s.jsx("div",{className:"admin-error",children:i}):null,e?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"admin-summary-grid",children:[s.jsxs("div",{className:"admin-summary-card admin-summary-pass",children:[s.jsx("div",{className:"admin-summary-value",children:fe+Lt}),s.jsx("div",{className:"admin-summary-label",children:"✅ Passing"})]}),s.jsxs("div",{className:"admin-summary-card admin-summary-warn",children:[s.jsx("div",{className:"admin-summary-value",children:Se+Ot}),s.jsx("div",{className:"admin-summary-label",children:"⚠️ Warnings"})]}),s.jsxs("div",{className:"admin-summary-card admin-summary-fail",children:[s.jsx("div",{className:"admin-summary-value",children:Qe+jn}),s.jsx("div",{className:"admin-summary-label",children:"❌ Failing"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:xt.length}),s.jsx("div",{className:"admin-summary-label",children:"Providers"})]})]}),s.jsx("h3",{className:"section-subtitle",children:"⚙️ System Checks (buff doctor)"}),s.jsx("div",{className:"admin-check-list",children:e.system.map(G=>s.jsx(m_,{check:G},G.name))}),s.jsx("h3",{className:"section-subtitle",children:"🏥 Enterprise Self-Check (doctor --enterprise)"}),s.jsx("div",{className:"admin-check-list",children:e.enterprise.length>0?e.enterprise.map(G=>s.jsx(m_,{check:G},G.name)):s.jsx("div",{className:"empty-state",children:"No enterprise checks returned."})}),s.jsx("h3",{className:"section-subtitle",children:"🔑 Provider Configuration (keys masked)"}),s.jsx("div",{className:"admin-table-wrapper",children:s.jsxs("table",{className:"admin-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Provider"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Key"}),s.jsx("th",{children:"Base URL"}),s.jsx("th",{children:"Model"}),s.jsx("th",{children:"Actions"})]})}),s.jsxs("tbody",{children:[xt.map(G=>{const he=dt(G.type),Ie=A[G.type]||{};return s.jsxs("tr",{children:[s.jsxs("td",{className:"admin-provider-type",children:[he.icon?`${he.icon} `:"",he.label,s.jsxs("div",{className:"admin-provider-sub",children:[G.type," · ",pse[G.keySource]||G.keySource]}),G.keySource==="env"?s.jsxs("div",{className:"admin-hint",children:["comes from ",he.envVar||"env var"," — change it there, config can't override it"]}):G.keySource==="vault"?s.jsx("div",{className:"admin-hint",children:"stored in the OS keyring (vault)"}):null]}),s.jsx("td",{children:s.jsx("span",{className:`admin-check-badge ${G.configured?"admin-check-pass":"admin-check-warn"}`,children:G.configured?"✅ Configured":"⚠️ Not configured"})}),s.jsx("td",{children:he.keyless?s.jsx("div",{className:"admin-hint",children:"No key needed (probed)"}):Ne?s.jsx("input",{className:"admin-input admin-key-input",type:"password","aria-label":`${G.type} API key`,placeholder:G.keyMasked||"set a new key…",value:Ie.apiKey??"",onChange:Re=>Qt(G.type,"apiKey",Re.target.value),autoComplete:"new-password"}):s.jsx("div",{className:"admin-hint",children:G.keyMasked||"—"})}),s.jsx("td",{children:Ne?s.jsx("input",{className:"admin-input",type:"text","aria-label":`${G.type} base URL`,placeholder:G.baseUrl||"default endpoint",value:Ie.baseUrl??"",onChange:Re=>Qt(G.type,"baseUrl",Re.target.value)}):s.jsx("div",{className:"admin-hint",children:G.baseUrl?G.baseUrl.replace(/^https?:\/\/(?:[^@/]*@)?/,""):"default endpoint"})}),s.jsx("td",{children:Ne?s.jsx("input",{className:"admin-input",type:"text","aria-label":`${G.type} model`,placeholder:G.model||"default model",value:Ie.model??"",onChange:Re=>Qt(G.type,"model",Re.target.value)}):s.jsx("div",{className:"admin-hint",children:G.model||"default model"})}),s.jsx("td",{children:Ne?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"admin-row-actions",children:[s.jsx("button",{className:"admin-mini-btn",disabled:K===G.type,onClick:()=>void $t(G.type),children:"💾 Save"}),s.jsx("button",{className:"admin-mini-btn",disabled:K===G.type,title:"Tests the SAVED configuration — save first to test a new key",onClick:()=>void V(G.type),children:"🔌 Test"}),s.jsx("button",{className:"admin-mini-btn admin-mini-danger",disabled:K===G.type,onClick:()=>void U(G.type),children:"🗑 Remove"})]}),le[G.type]?s.jsx("div",{className:"admin-row-msg",children:le[G.type]}):null]}):s.jsx("div",{className:"admin-hint",children:"read-only"})})]},G.type)}),xt.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"admin-empty-cell",children:"No providers configured yet."})}):null]})]})}),Ne&&O.length>0?s.jsxs("div",{className:"admin-add-provider",children:[s.jsxs("select",{className:"admin-input",value:me,onChange:G=>Pe(G.target.value),children:[s.jsx("option",{value:"",children:"Add a provider…"}),O.filter(G=>!xt.some(he=>he.type===G.id)).map(G=>s.jsxs("option",{value:G.id,children:[G.icon?`${G.icon} `:"",G.label," (",G.id,")"]},G.id))]}),s.jsx("button",{className:"admin-mini-btn",disabled:!me,onClick:se,children:"➕ Add"})]}):null,s.jsx(dse,{authed:c,role:d||"viewer"}),Ne?s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"section-subtitle",children:"👥 Dashboard Users (role.manage)"}),s.jsxs("div",{className:"admin-users-list",children:[N.map(G=>s.jsxs("div",{className:"admin-user-row",children:[s.jsx("span",{className:"admin-user-name",children:G.user}),s.jsx("span",{className:`admin-role-badge admin-role-${G.role}`,children:G.role}),s.jsxs("span",{className:"admin-user-since",children:["since ",new Date(G.createdAt).toLocaleDateString()]}),G.user!==h?s.jsx("button",{className:"admin-mini-btn admin-mini-danger",onClick:()=>void Me(G.user),children:"🗑 Remove user"}):s.jsx("span",{className:"admin-hint",children:"you"})]},G.user)),N.length===0?s.jsx("div",{className:"empty-state",children:"No dashboard users yet."}):null]}),s.jsxs("form",{className:"admin-gate-form admin-user-form",onSubmit:Ze,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{type:"text",value:R,onChange:G=>L(G.target.value),autoComplete:"off"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Password (min 8 chars)"}),s.jsx("input",{type:"password",value:I,onChange:G=>z(G.target.value),autoComplete:"new-password"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Role"}),s.jsxs("select",{value:D,onChange:G=>F(G.target.value),children:[s.jsx("option",{value:"viewer",children:"viewer — read-only"}),s.jsx("option",{value:"operator",children:"operator — read-only in the dashboard today"}),s.jsx("option",{value:"admin",children:"admin — full control"})]})]}),T?s.jsx("div",{className:"admin-row-msg",children:T}):null,s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:!R||!I,children:"➕ Add user"})]})]}):null]}):n?s.jsxs("div",{className:"loading-state",children:[s.jsx("div",{className:"loading-spinner"}),s.jsx("p",{children:"Running all state checks…"})]}):null]})}function oM(e){return String(e??"").replace(/\d{3,}/g,t=>t.slice(0,2)+"***")}const gse={idle:"Not paired",pairing:"⏳ Pairing…",paired:"✅ Paired",failed:"❌ Pairing failed",cancelled:"⏹ Cancelled",error:"💥 Pairing error"};function yse({authed:e,canWrite:t,sessionExpired:n,reveal:r=!1}){const[i,a]=E.useState(null),[o,l]=E.useState({}),[c,u]=E.useState(""),[d,f]=E.useState(!1),[h,p]=E.useState(null),g=E.useRef(null),m=E.useCallback(async()=>{const w=await ee.getWhatsAppStatus();w&&(a(w.status),l(w.contacts??{}))},[]);E.useEffect(()=>{if(m(),!e||typeof EventSource>"u")return;const w=ee.subscribeWhatsApp({onQr:_=>a(N=>N&&{...N,qr:_,state:"pairing"}),onCode:_=>a(N=>N&&{...N,pairingCode:_}),onStatus:_=>{a(_),(_.state==="paired"||_.state==="failed"||_.state==="error"||_.state==="cancelled")&&f(!1)}});return g.current=w,()=>{w(),g.current=null}},[e,m]);const v=async w=>{f(!0),p(null);const _=await w();if(!_.ok&&_.error&&/Not authenticated|Session expired/i.test(_.error)){n(),f(!1);return}_.ok?(p({kind:"ok",text:"Done."}),await m()):p({kind:"err",text:_.error||"Action failed."}),f(!1)},y=w=>{p(null),v(()=>ee.startWhatsAppPair(w?c.trim():void 0)).then(()=>u(""))},b=()=>{p(null),v(()=>ee.cancelWhatsAppPair())},x=()=>{window.confirm("Remove the paired WhatsApp session from this machine? You will need to scan a QR to pair again.")&&(p(null),v(()=>ee.unpairWhatsApp()))},k=(i==null?void 0:i.state)??"idle",S=k==="pairing";return s.jsxs("div",{className:"wa-panel",children:[s.jsxs("div",{className:"wa-panel-head",children:[s.jsx("span",{className:"wa-panel-title",children:"🟢 WhatsApp bridge"}),i?s.jsx("span",{className:`wa-badge ${i.paired?"wa-badge-paired":S?"wa-badge-pairing":""}`,children:gse[k]}):s.jsx("span",{className:"admin-hint",children:"loading…"})]}),s.jsxs("p",{className:"admin-hint",children:["The personal Baileys bridge (no Meta Business account) — pair once, and the gateway can send & receive WhatsApp. Session: ",s.jsx("code",{children:(i==null?void 0:i.sessionDir)??"~/.buff/whatsapp/session"}),". Same engine as"," ",s.jsx("code",{children:"buff whatsapp pair"}),"."]}),S?s.jsxs("div",{className:"wa-pairing",children:[i!=null&&i.qr?s.jsxs("div",{className:"wa-qr-box",children:[s.jsx("img",{className:"wa-qr-img",src:i.qr,alt:"WhatsApp pairing QR code"}),s.jsxs("p",{className:"admin-hint",children:["Open WhatsApp on the phone → ",s.jsx("strong",{children:"Linked devices → Link a device → scan"}),". The QR refreshes automatically while this window is open."]})]}):i!=null&&i.phone?s.jsxs("div",{className:"wa-code-box",children:[s.jsxs("p",{className:"admin-hint",children:["On the phone with ",s.jsx("strong",{children:i.phone}),": WhatsApp → Linked devices → Link a device →"," ",s.jsx("strong",{children:"“Link with phone number instead”"})," → enter:"]}),s.jsx("div",{className:"wa-code",children:i.pairingCode??"… waiting for code"})]}):s.jsx("div",{className:"wa-code-box",children:s.jsx("p",{className:"admin-hint",children:"Waiting for WhatsApp to hand over a QR… (it usually appears within a few seconds)"})}),i!=null&&i.phone?null:s.jsxs("div",{className:"admin-hint",children:["Tip: on a phone, “Link with phone number instead” needs the number format"," ",s.jsx("code",{children:"918844433322"})," (country code included) — enter it below instead of scanning."]}),i!=null&&i.error?s.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:i.error}):null,t&&e?s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:b,disabled:d,children:d?"⏳…":"⏹ Cancel pairing"}):null]}):s.jsxs("div",{className:"wa-actions",children:[t&&e?i!=null&&i.paired?s.jsxs("div",{className:"wa-action-row",children:[s.jsx("button",{className:"admin-refresh-btn wa-unpair-btn",type:"button",onClick:x,disabled:d,children:d?"⏳…":"🗑 Unpair (remove session)"}),s.jsx("span",{className:"admin-hint",children:"Removes creds.json — you will need to scan a QR again."})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"wa-action-row",children:[s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>y(!1),disabled:d,children:d?"⏳…":"🔳 Pair with a QR"}),s.jsx("span",{className:"admin-hint",children:"Scans from the phone you want to link."})]}),s.jsxs("div",{className:"wa-action-row wa-phone-row",children:[s.jsx("input",{type:"text",className:"wa-phone-input",value:c,onChange:w=>u(w.target.value),placeholder:"or pair with a number — e.g. 918844433322",disabled:d,maxLength:16}),s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>y(!0),disabled:d||!c.trim(),children:"Pair by number"})]})]}):null,k==="failed"||k==="error"||k==="cancelled"?s.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:(i==null?void 0:i.error)||(k==="cancelled"?"Pairing cancelled.":"Pairing failed — try again.")}):null,e?t?null:s.jsx("div",{className:"admin-row-msg",children:"Your role can view pairing status but not change it (requires admin or operator)."}):s.jsx("div",{className:"admin-row-msg",children:"Log in (admin or operator) to pair, cancel, or unpair."}),h?s.jsx("div",{className:`admin-row-msg${h.kind==="ok"?"":" admin-row-msg-err"}`,children:h.text}):null]}),s.jsxs("div",{className:"wa-contacts",children:[s.jsxs("div",{className:"wa-contacts-head",children:[s.jsx("span",{className:"wa-panel-title",children:"📇 Send-by-name contacts"}),s.jsxs("span",{className:"admin-hint",children:[Object.keys(o).length," mapped"]})]}),s.jsxs("p",{className:"admin-hint",children:["These names are for ",s.jsx("strong",{children:"sending messages by name"})," (e.g."," ",s.jsx("code",{children:'buff gateway send whatsapp:Name "…"'}),") — they do"," ",s.jsx("strong",{children:"NOT"})," let these numbers trigger the agent."]}),s.jsx("div",{className:"hub-alias-list",children:Object.keys(o).length===0?s.jsxs("span",{className:"admin-hint",children:["(none — add one with ",s.jsx("code",{children:"buff whatsapp contact add <Name> <number>"}),")"]}):Object.entries(o).map(([w,_])=>s.jsxs("div",{className:"hub-alias-row",children:[s.jsx("span",{className:"hub-chip",children:w}),s.jsxs("span",{className:"admin-hint",children:["→ ",r?_:oM(_)]})]},w))}),s.jsxs("p",{className:"admin-hint",style:{marginTop:8},children:["To let a number ",s.jsx("strong",{children:"trigger the agent"})," (respond to its messages), add it to the"," ",s.jsx("strong",{children:"verified list"})," in the ",s.jsx("strong",{children:"Permissions tab above"}),", or run"," ",s.jsx("code",{children:"buff config gateway allow whatsapp user <number>"}),"."]})]})]})}function vse({canWrite:e,sessionExpired:t,mode:n="grid"}){const[r,i]=E.useState(null),[a,o]=E.useState(null),[l,c]=E.useState(null),[u,d]=E.useState(null),[f,h]=E.useState(null),[p,g]=E.useState(0),[m,v]=E.useState({}),[y,b]=E.useState(!1),[x,k]=E.useState(null),S=E.useRef(!0),w=E.useCallback(async()=>{const L=await ee.getPlatformConfigs();S.current&&i(L)},[t]);E.useEffect(()=>(w(),()=>{S.current=!1}),[w]);const _=async(L,I)=>{c(L),d(null);const z=await ee.setPlatformConfig(L,I);if(S.current){if(c(null),z.unauthorized||z.forbidden){t(z.error);return}d({kind:z.ok?"ok":"err",text:z.ok?"Saved — transport active.":z.error||"Save failed."}),z.ok&&(o(null),w())}},N=async L=>{if(!window.confirm(`Remove ${L} transport config? Tokens will be deleted from ~/.buff/.env.`))return;c(L),d(null);const I=await ee.removePlatformConfig(L);if(S.current){if(c(null),I.unauthorized||I.forbidden){t(I.error);return}d({kind:I.ok?"ok":"err",text:I.ok?"Removed.":I.error||"Remove failed."}),I.ok&&w()}},C={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: buff 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: buff 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: buff 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: buff gateway start","Send an email to the configured address","The agent will reply via email!"]}},T=L=>{e&&(h(L),g(0),v(Object.fromEntries(L.envVars.map(I=>[I.varName,I.value]))),k(null))},$=async()=>{if(!f||!e)return;b(!0),k(null);const L=await ee.setPlatformConfig(f.platform,m);if(b(!1),L.unauthorized||L.forbidden){t(L.error);return}L.ok?(k({kind:"ok",text:"✅ Token saved! The transport is now active."}),w()):k({kind:"err",text:L.error||"Save failed."})};if(r===null)return s.jsx("div",{className:"empty-state",children:"Loading platform transports…"});const R=f?C[f.platform]:null;return n==="table"?s.jsxs(s.Fragment,{children:[f&&R?s.jsx("div",{className:"wizard-overlay",onClick:()=>h(null),children:s.jsxs("div",{className:"wizard-modal",onClick:L=>L.stopPropagation(),children:[s.jsxs("div",{className:"wizard-header",children:[s.jsx("span",{className:"wizard-icon",children:"🚀"}),s.jsxs("span",{className:"wizard-title",children:["Getting Started: ",f.label]}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>h(null),children:"✕"})]}),s.jsx("div",{className:"wizard-body",children:p===0?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"wizard-section-title",children:"📋 Steps to create your bot:"}),s.jsx("ol",{className:"wizard-steps",children:R.steps.map((L,I)=>s.jsx("li",{children:L},I))}),s.jsxs("div",{className:"wizard-nav",children:[s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>g(1),children:"I have my token →"}),f.setupUrl?s.jsx("a",{href:f.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"📖 Docs"}):null]})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"wizard-section-title",children:"🔑 Paste your token:"}),f.envVars.map(L=>s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:L.prompt}),s.jsx("input",{type:L.secret?"password":"text",value:m[L.varName]??"",onChange:I=>v(z=>({...z,[L.varName]:I.target.value})),placeholder:L.secret?"••••••••":"value",autoComplete:"off",spellCheck:!1,autoFocus:!0})]},L.varName)),x?s.jsx("div",{className:`admin-row-msg${x.kind==="ok"?"":" admin-row-msg-err"}`,children:x.text}):null,s.jsxs("div",{className:"wizard-nav",children:[s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>g(0),children:"← Back"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void $(),disabled:y||!e,children:y?"⏳ Saving…":"💾 Save token"})]}),(x==null?void 0:x.kind)==="ok"?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"wizard-section-title",children:"📋 Next steps:"}),s.jsx("ol",{className:"wizard-steps",children:R.postSetup.map((L,I)=>s.jsx("li",{children:L},I))})]}):null]})})]})}):null,u?s.jsx("div",{className:`admin-row-msg${u.kind==="ok"?"":" admin-row-msg-err"}`,children:u.text}):null,s.jsx("div",{className:"platform-config-table-wrapper",children:s.jsxs("table",{className:"platform-config-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Platform"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Configuration"}),s.jsx("th",{children:"CLI Command"})]})}),s.jsx("tbody",{children:r.map(L=>s.jsxs(W.Fragment,{children:[s.jsxs("tr",{className:`platform-config-row ${L.configured?"configured":""}`,children:[s.jsxs("td",{className:"platform-config-name",children:[s.jsx("span",{className:"hub-platform-label",children:L.label}),s.jsx("span",{className:"hub-card-id",children:L.platform})]}),s.jsxs("td",{children:[s.jsx("span",{className:`status-dot ${L.configured?"connected":"reconnecting"}`}),s.jsx("span",{className:"platform-config-status-text",children:L.configured?"Active":"Not configured"})]}),s.jsxs("td",{className:"platform-config-actions",children:[L.configured?null:s.jsx("button",{type:"button",className:"wizard-start-btn",onClick:()=>T(L),disabled:!e,children:"🚀 Getting Started"}),L.setupUrl?s.jsx("a",{href:L.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"📖 Docs"}):null,s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>o(a===L.platform?null:L.platform),disabled:!e,children:a===L.platform?"▴ Close":L.configured?"✎ Edit":"⚙ Configure"}),L.configured?s.jsx("button",{type:"button",className:"admin-mini-btn contact-delete-btn",onClick:()=>void N(L.platform),disabled:!e,children:"🗑️"}):null]}),s.jsx("td",{className:"platform-config-cli",children:s.jsxs("code",{children:["buff gateway setup ",L.platform]})})]}),a===L.platform?s.jsx("tr",{className:"platform-config-expanded",children:s.jsx("td",{colSpan:4,children:s.jsxs("div",{className:"platform-config-form",children:[L.envVars.map(I=>s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:I.prompt}),s.jsx("input",{type:I.secret?"password":"text",value:I.value,readOnly:!0,className:"platform-config-readonly",placeholder:I.secret?"••••••••":"value"})]},I.varName)),s.jsxs("p",{className:"admin-hint",children:["Tokens are in ",s.jsx("code",{children:"~/.buff/.env"})," — edit there or use the wizard above."]})]})})}):null]},L.platform))})]})})]}):s.jsxs(s.Fragment,{children:[f&&R?s.jsx("div",{className:"wizard-overlay",onClick:()=>h(null),children:s.jsxs("div",{className:"wizard-modal",onClick:L=>L.stopPropagation(),children:[s.jsxs("div",{className:"wizard-header",children:[s.jsx("span",{className:"wizard-icon",children:"🚀"}),s.jsxs("span",{className:"wizard-title",children:["Getting Started: ",f.label]}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>h(null),children:"✕"})]}),s.jsx("div",{className:"wizard-body",children:p===0?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"wizard-section-title",children:"📋 Steps to create your bot:"}),s.jsx("ol",{className:"wizard-steps",children:R.steps.map((L,I)=>s.jsx("li",{children:L},I))}),s.jsxs("div",{className:"wizard-nav",children:[s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>g(1),children:"I have my token →"}),f.setupUrl?s.jsx("a",{href:f.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"📖 Open docs in new tab"}):null]})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"wizard-section-title",children:"🔑 Paste your token:"}),f.envVars.map(L=>s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:L.prompt}),s.jsx("input",{type:L.secret?"password":"text",value:m[L.varName]??"",onChange:I=>v(z=>({...z,[L.varName]:I.target.value})),placeholder:L.secret?"••••••••":"value",autoComplete:"off",spellCheck:!1,autoFocus:!0})]},L.varName)),x?s.jsx("div",{className:`admin-row-msg${x.kind==="ok"?"":" admin-row-msg-err"}`,children:x.text}):null,s.jsxs("div",{className:"wizard-nav",children:[s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>g(0),children:"← Back"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void $(),disabled:y||!e,children:y?"⏳ Saving…":"💾 Save token"})]}),(x==null?void 0:x.kind)==="ok"?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"wizard-section-title",children:"📋 Next steps:"}),s.jsx("ol",{className:"wizard-steps",children:R.postSetup.map((L,I)=>s.jsx("li",{children:L},I))})]}):null]})})]})}):null,s.jsxs("div",{className:"platform-config",children:[s.jsx("h3",{className:"section-subtitle",children:"⚙️ Platform transports (buff config gateway)"}),u?s.jsx("div",{className:`admin-row-msg${u.kind==="ok"?"":" admin-row-msg-err"}`,children:u.text}):null,s.jsx("div",{className:"hub-platform-grid",children:r.map(L=>s.jsx(bse,{entry:L,canWrite:e,busy:l===L.platform,expanded:a===L.platform,onToggle:()=>o(a===L.platform?null:L.platform),onSave:I=>void _(L.platform,I),onRemove:()=>void N(L.platform),onStartWizard:()=>T(L)},L.platform))}),s.jsxs("p",{className:"admin-hint",children:["Tokens are written to ",s.jsx("code",{children:"~/.buff/.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 bse(e){const{entry:t,canWrite:n,busy:r,expanded:i,onToggle:a,onSave:o,onRemove:l,onStartWizard:c}=e,[u,d]=E.useState(()=>Object.fromEntries(t.envVars.map(h=>[h.varName,h.value]))),f=(h,p)=>{d(g=>({...g,[h]:p}))};return s.jsxs("div",{className:`hub-platform${t.configured?" configured":""}`,children:[s.jsxs("div",{className:"hub-platform-head",children:[s.jsx("span",{className:`status-dot ${t.configured?"connected":"reconnecting"}`}),s.jsx("span",{className:"hub-platform-label",children:t.label}),s.jsx("span",{className:"hub-card-id",children:t.platform}),t.configured?null:s.jsx("button",{type:"button",className:"wizard-start-btn",onClick:c,disabled:!n,title:"Step-by-step setup wizard",children:"🚀 Getting Started"}),t.setupUrl?s.jsx("a",{href:t.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",title:"Setup documentation",children:"📖 Docs"}):null,s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:a,disabled:!n,children:i?"▴ Collapse":t.configured?"✎ Edit":"⚙ Configure"})]}),!i&&t.setupHint&&!t.configured?s.jsx("div",{className:"platform-setup-hint",children:t.setupHint}):null,i?s.jsxs("div",{className:"platform-config-form",children:[t.setupHint?s.jsx("div",{className:"platform-setup-hint",children:t.setupHint}):null,t.envVars.map(h=>s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:h.prompt}),s.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)),s.jsxs("div",{className:"platform-config-actions",children:[s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>o(u),disabled:r||!n,children:r?"⏳ Saving…":"💾 Save"}),t.configured?s.jsx("button",{type:"button",className:"hub-remove-btn",onClick:l,disabled:r||!n,children:"🗑 Remove"}):null]})]}):s.jsx("div",{className:"hub-platform-env",children:t.envVars.map(h=>s.jsxs("div",{children:[s.jsx("code",{children:h.varName})," ",h.set?"✓ set":"— unset"]},h.varName))})]})}const xse=[{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:"🧠"}],wse={pending:"⏳ pending",sent:"✅ sent",failed:"❌ failed"};function Sse(){var F0,U0,W0,H0,G0,q0,K0,V0,Y0;const[e,t]=E.useState("tools"),[n,r]=E.useState(null),[i,a]=E.useState(!0),[o,l]=E.useState(null),[c,u]=E.useState(!1),[d,f]=E.useState(null),[h,p]=E.useState(!1),[g,m]=E.useState(null),[v,y]=E.useState(null),[b,x]=E.useState(""),[k,S]=E.useState(""),[w,_]=E.useState(null),[N,C]=E.useState(!1),[T,$]=E.useState(null),[R,L]=E.useState(null),[I,z]=E.useState({}),[D,F]=E.useState(""),[O,P]=E.useState(""),[A,Y]=E.useState(!1),[K,M]=E.useState(null),[le,be]=E.useState(!1),[me,Pe]=E.useState({}),[H,X]=E.useState(!1),[oe,ce]=E.useState(null),[Z,_e]=E.useState({}),[we,Ne]=E.useState({}),[ge,Be]=E.useState({}),[pe,Ct]=E.useState(!1),[We,Oe]=E.useState(null),[Ze,Me]=E.useState(""),[Qt,$t]=E.useState(null),[U,V]=E.useState(!1),[se,fe]=E.useState(new Map),[Se,Qe]=E.useState(new Set),[Lt,Ot]=E.useState(!1),[jn,xt]=E.useState([]),[dt,G]=E.useState(""),[he,Ie]=E.useState(null),[Re,Cr]=E.useState(""),[Jt,An]=E.useState([]),[ys,zp]=E.useState(0),[vs,bs]=E.useState(0),[Ni,xs]=E.useState(!0),[ze,ws]=E.useState(!1),[Xr,Ht]=E.useState(!1),ji=20,Ai=E.useRef(null),Ti=E.useCallback(async(j=!1)=>{if(ze)return;const q=j?0:vs;ws(!0);try{const ne=await ee.fetchGatewayConversations({offset:q,limit:ji,q:Ze||void 0});ne.ok&&ne.conversations&&(An(re=>j?ne.conversations:[...re,...ne.conversations]),zp(ne.total??0),bs(q+ne.conversations.length),xs(ne.hasMore??!1))}catch{}ws(!1)},[ze,vs,Ze]);E.useEffect(()=>{e==="conversations"&&!Xr&&!ze&&(Ht(!0),Ti(!0))},[e,Xr,ze,Ti]),E.useEffect(()=>{const j=Ai.current;if(!j)return;const q=new IntersectionObserver(ne=>{var re;(re=ne[0])!=null&&re.isIntersecting&&Ni&&!ze&&Ti(!1)},{threshold:.1});return q.observe(j),()=>q.disconnect()},[Ni,ze,Ti]),E.useEffect(()=>{const j=setTimeout(()=>{e==="conversations"&&Xr&&(An([]),bs(0),xs(!0),Ti(!0))},300);return()=>clearTimeout(j)},[Ze]),E.useEffect(()=>ee.onTypingEvent(q=>{fe(ne=>{const re=new Map(ne),de=`${q.platform}:${q.channelId}`;return q.typing?re.set(de,{platform:q.platform,channelId:q.channelId,startedAt:Date.now()}):re.delete(de),re})}),[]);const Fp=E.useCallback((j,q)=>{q.stopPropagation(),Qe(ne=>{const re=new Set(ne);return re.has(j)?re.delete(j):re.add(j),re})},[]),cl=E.useCallback(()=>{Qe(j=>j.size===Jt.length?new Set:new Set(Jt.map(q=>q.key)))},[Jt]),Ss=E.useCallback(async()=>{if(Se.size!==0){Ot(!0);try{await ee.exportGatewayConversations([...Se])}catch{}Ot(!1)}},[Se]);E.useEffect(()=>{e==="conversations"&&ee.getAllConversationTags().then(j=>{j.ok&&j.tags&&xt(j.tags)})},[e]);const Up=E.useCallback(async(j,q)=>{if(!q.trim())return;(await ee.addConversationTag(j,q.trim())).ok&&(An(re=>re.map(de=>de.key===j?{...de,tags:[...de.tags??[],q.trim().toLowerCase()]}:de)),xt(re=>re.includes(q.trim().toLowerCase())?re:[...re,q.trim().toLowerCase()].sort())),Ie(null),Cr("")},[]),Cu=E.useCallback(async(j,q)=>{(await ee.removeConversationTag(j,q)).ok&&An(re=>re.map(de=>de.key===j?{...de,tags:(de.tags??[]).filter(Te=>Te!==q)}:de))},[]),Wp=E.useCallback((j,q)=>{q.stopPropagation();const ne=j.contactName||j.channelId,re=[`Conversation with ${ne} (${j.platform})`,`Exported: ${new Date().toLocaleString()}`,`Messages: ${j.messageCount}`,"─".repeat(50),""];if(j.messages)for(const ht of j.messages){const xe=ht.role==="user"?ne:"Agent",Nt=new Date(ht.ts).toLocaleString();re.push(`[${Nt}] ${xe}:`),re.push(ht.content),re.push("")}const de=new Blob([re.join(`
135
- `)],{type:"text/plain;charset=utf-8"}),Te=URL.createObjectURL(de),it=document.createElement("a");it.href=Te,it.download=`conversation-${j.platform}-${j.channelId.replace(/[^\w]/g,"_")}-${new Date().toISOString().slice(0,10)}.txt`,document.body.appendChild(it),it.click(),document.body.removeChild(it),URL.revokeObjectURL(Te)},[]),Hp=E.useCallback((j,q)=>{q.stopPropagation();const ne=j.contactName||j.channelId,re=j.messages??[],de=`<!DOCTYPE html>
136
- <html>
137
- <head>
138
- <meta charset="utf-8">
139
- <title>Conversation with ${ne}</title>
140
- <style>
141
- body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; max-width: 700px; margin: 40px auto; padding: 0 20px; color: #1a1a1a; line-height: 1.6; }
142
- h1 { font-size: 20px; margin-bottom: 4px; }
143
- .meta { color: #666; font-size: 13px; margin-bottom: 20px; }
144
- .msg { margin-bottom: 16px; }
145
- .msg-user { text-align: right; }
146
- .msg-assistant { text-align: left; }
147
- .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; }
148
- .bubble-user { background: #007bff; color: #fff; border-bottom-right-radius: 4px; }
149
- .bubble-assistant { background: #f0f0f0; color: #1a1a1a; border-bottom-left-radius: 4px; }
150
- .timestamp { font-size: 11px; color: #999; margin-top: 2px; }
151
- @media print { body { margin: 0; } }
152
- </style>
153
- </head>
154
- <body>
155
- <h1>Conversation with ${ne}</h1>
156
- <div class="meta">Platform: ${j.platform} · ${j.messageCount} messages · Exported: ${new Date().toLocaleString()}</div>
157
- ${re.map(it=>{const ht=it.role==="user"?"user":"assistant",xe=it.role==="user"?ne:"Agent";return`<div class="msg msg-${ht}">
158
- <div class="bubble bubble-${ht}">${it.content.replace(/</g,"&lt;").replace(/>/g,"&gt;")}</div>
159
- <div class="timestamp">${xe} · ${new Date(it.ts).toLocaleString()}</div>
160
- </div>`}).join(`
161
- `)}
162
- </body>
163
- </html>`,Te=window.open("","_blank");Te&&(Te.document.write(de),Te.document.close(),setTimeout(()=>Te.print(),300))},[]);E.useEffect(()=>{var q;const j=(q=n==null?void 0:n.conversations)==null?void 0:q.recent;!j||j.length===0||Xr&&(vs>ji||Ze||An(ne=>{const re=new Set(ne.map(xe=>xe.key)),de=j.map(xe=>({...xe})),Te=new Map(ne.map(xe=>[xe.key,xe]));for(const xe of de)Te.has(xe.key)&&Te.set(xe.key,xe);const ht=[...de.filter(xe=>!re.has(xe.key)),...Te.values()];return ht.sort((xe,Nt)=>Nt.lastActiveAt-xe.lastActiveAt),ht}))},[(F0=n==null?void 0:n.conversations)==null?void 0:F0.recent]);const[ul,Ou]=E.useState(""),[Pu,dl]=E.useState([]),[hr,ks]=E.useState(!1),[xa,Es]=E.useState(!1),[fl,Je]=E.useState(null),[hl,wa]=E.useState(null),[pl,ml]=E.useState({}),[Ci,gl]=E.useState([]),[Oi,_s]=E.useState([]),[Ns,Zr]=E.useState(""),Qr=j=>pe?String(j??""):oM(j),Gp=j=>{const q=j.match(/^(\d+)@/);if(!q)return"";const ne=q[1];return ne.length===12&&ne.startsWith("91")?`+${ne.slice(0,2)} ${ne.slice(2,7)} ${ne.slice(7)}`:ne.length===10?`+91 ${ne.slice(0,5)} ${ne.slice(5)}`:`+${ne}`},qp=j=>{const q=Gp(j.channelId);return j.contactName?{name:j.contactName,phone:q}:{name:q||Qr(j.channelId),phone:""}},Or=E.useCallback(async()=>{var q,ne;u(!0),l(null);const j=await ee.fetchHub();r(j),(q=j==null?void 0:j.channels)!=null&&q.statusRecipients&&_s(j.channels.statusRecipients),(ne=j==null?void 0:j.channels)!=null&&ne.contacts&&gl(j.channels.contacts),j||l("Could not reach the dashboard server, or the server is older than this panel. Run `buff dashboard` to start it."),a(!1),u(!1)},[]);E.useEffect(()=>{Or(),ee.fetchAdminAuthStatus().then(j=>{j&&(f({configured:j.configured,authenticated:j.authenticated}),p(j.authenticated),m(j.role??null),y(j.user??null))})},[Or]);const Gt=h&&(g==="admin"||g==="operator"),Mu=async j=>{j==null||j.preventDefault();const q=ul.trim();if(!q)return;Es(!0),Je(null);const ne=await ee.marketplaceSearch(q);dl(ne),ks(!0),Es(!1)},Ru=async j=>{if(!h){Je({kind:"err",text:"🔐 Log in (or set up admin access) to install skills."});return}if(!Gt){Je({kind:"err",text:"Your role cannot install skills — admin or operator only."});return}wa(j),Je(null);const q=await ee.marketplaceInstall(j);q.ok?(Je({kind:"ok",text:`✅ Installed ${j} (quarantine checked) — it appears in the Skills list and loads via the skill tool next turn.`}),Or()):Je({kind:"err",text:q.quarantined?`⛔ ${q.error||"checksum mismatch — quarantined"}`:`❌ ${q.error||"Install failed."}`}),wa(null)},Iu=async j=>{if(!h){Je({kind:"err",text:"🔐 Log in (or set up admin access) to uninstall skills."});return}if(!Gt){Je({kind:"err",text:"Your role cannot uninstall skills — admin or operator only."});return}wa(j),Je(null);const q=await ee.marketplaceUninstall(j);q.ok?(Je({kind:"ok",text:`🗑️ Uninstalled ${j} — removed from .agents/skills/ and provenance.`}),Or()):Je({kind:"err",text:`❌ ${q.error||"Uninstall failed."}`}),wa(null)},Pi=()=>{p(!1),f(j=>j&&{...j,authenticated:!1}),_("Session expired — log in again to toggle capabilities.")},$u=async j=>{j.preventDefault(),C(!0),_(null);const q=await ee.adminLogin(b,k);if(q.ok){p(!0),f({configured:!0,authenticated:!0}),m(q.role??"admin"),y(q.user??null),x(""),S("");const ne=T;$(null),ne&&await J(ne.kind,ne.name,ne.enabled)}else _(q.error||"Login failed.");C(!1)},B=async j=>{if(j.preventDefault(),C(!0),_(null),k.length<8){_("Password must be at least 8 characters."),C(!1);return}const q=await ee.adminSetup(b,k);if(q.ok){p(!0),f({configured:!0,authenticated:!0}),m(q.role??"admin"),y(q.user??null),x(""),S("");const ne=T;$(null),ne&&await J(ne.kind,ne.name,ne.enabled)}else _(q.error||"Setup failed.");C(!1)},te=async()=>{await ee.adminLogout(),p(!1),f(j=>j&&{...j,authenticated:!1}),m(null),y(null)},J=async(j,q,ne)=>{L(q);const re=j==="skill"?await ee.setSkillEnabled(q,ne):await ee.setToolsetEnabled(q,ne);re.ok?(z(de=>({...de,[q]:`✅ ${ne?"Enabled":"Disabled"} — live for new agent runs`})),Or()):re.unauthorized?Pi():(z(de=>({...de,[q]:`❌ ${re.error||"Toggle failed"}`})),re.forbidden&&_(re.error||"Your role cannot change capabilities.")),L(null)},Ee=(j,q)=>{if(!h){$({kind:"toolset",name:j,enabled:q});return}J("toolset",j,q)},Jr=(j,q)=>{if(!h){$({kind:"skill",name:j,enabled:q});return}J("skill",j,q)},qt=async j=>{if(j.preventDefault(),!h){M({kind:"err",text:"🔐 Log in (or set up admin access) to send test messages."});return}if(!Gt){M({kind:"err",text:"🔒 Your role cannot send channel messages — requires the admin or operator role."});return}Y(!0),M(null);const q=await ee.sendChannelMessage(D.trim(),O);q.ok?(M({kind:"ok",text:`✅ Sent to ${D.trim()} (${q.platform}:${Qr(q.channelId)})`}),P("")):q.unauthorized?(Pi(),M({kind:"err",text:q.error||"Session expired — log in again."})):M({kind:"err",text:q.error||"Send failed."}),Y(!1)},Tn=(j,q)=>{var re,de;return(((de=(re=n==null?void 0:n.channels)==null?void 0:re.policies)==null?void 0:de[j])??{})[q]??[]},en=j=>j==="user"?"allowedUsers":j==="group"?"allowedGroups":"outboundSenders",pr=(j,q,ne)=>{const re=ne.trim();re&&Pe(de=>{var Nt;const Te={...de[j]??{}},it=en(q),xe=[...((Nt=de[j])==null?void 0:Nt[it])??Tn(j,it)];return xe.includes(re)||xe.push(re),Te[it]=xe,{...de,[j]:Te}})},Cn=(j,q,ne)=>{Pe(re=>{var Nt;const de=en(q),Te=Tn(j,de),ht=(((Nt=re[j])==null?void 0:Nt[de])??Te).filter(yl=>yl!==ne);if(ht.length===0&&Te.length===0){const yl={...re[j]??{}};delete yl[de];const Kp={...re};return Object.keys(yl).length===0?delete Kp[j]:Kp[j]=yl,Kp}const xe={...re[j]??{}};return xe[de]=ht,{...re,[j]:xe}})},ke=(j,q)=>{const ne=j.trim().toLowerCase(),re=q.trim().toLowerCase();if(ne==="*"||re==="*"||ne===re)return!0;const de=ne.replace(/\D+/g,""),Te=re.replace(/\D+/g,"");return de.length>0&&de===Te},Fe=j=>{const q=(pl[j]??"").trim(),ne=(Z[j]??"").trim();ne&&(pr(j,"user",ne),q&&gl(re=>[...re.filter(Te=>!(Te.platform===j&&(ke(Te.id,ne)||Te.name.toLowerCase()===q.toLowerCase()))),{name:q,platform:j,id:ne,addedAt:Date.now()}]),_e(re=>({...re,[j]:""})),ml(re=>({...re,[j]:""})))},ft=(j,q)=>{Cn(j,"user",q),gl(ne=>ne.filter(re=>!(re.platform===j&&ke(re.id,q))))},wt=(j,q)=>{Pe(ne=>{const re={...ne[j]??{}};return q==="silentDrop"?re.silentDrop=re.silentDrop===!1:re[q]?delete re[q]:re[q]=!0,{...ne,[j]:re}})},on=Object.keys(me).length>0||Ci.length!==(((W0=(U0=n==null?void 0:n.channels)==null?void 0:U0.contacts)==null?void 0:W0.length)??0)||Ci.some((j,q)=>{var ne,re;return!((re=(ne=n==null?void 0:n.channels)==null?void 0:ne.contacts)!=null&&re[q])||j.platform!==n.channels.contacts[q].platform||j.id!==n.channels.contacts[q].id||j.name!==n.channels.contacts[q].name})||Oi.length!==(((G0=(H0=n==null?void 0:n.channels)==null?void 0:H0.statusRecipients)==null?void 0:G0.length)??0)||Oi.some((j,q)=>{var ne,re;return j!==((re=(ne=n==null?void 0:n.channels)==null?void 0:ne.statusRecipients)==null?void 0:re[q])}),B0=async()=>{var q;if(!h){ce({kind:"err",text:"🔐 Log in (or set up admin access) to change permissions."});return}if(!Gt){ce({kind:"err",text:"🔒 Your role cannot change permissions — requires the admin or operator role."});return}X(!0),ce(null);const j=await ee.saveGatewayPolicies(me,Oi,Ci);if(j.ok){const ne=(q=j.contactErrors)!=null&&q.length?`
164
- ⚠️ Some contacts were rejected: ${j.contactErrors.join("; ")}`:"";ce({kind:ne?"warn":"ok",text:`✅ Permissions + saved contacts + status recipients saved — the running gateway applies them immediately.${ne}`}),Pe({}),Or()}else j.unauthorized?(Pi(),ce({kind:"err",text:j.error||"Session expired — log in again."})):ce({kind:"err",text:j.error||"Failed to save permissions."});X(!1)};if(i)return s.jsxs("div",{className:"admin-header",children:[s.jsx("h2",{className:"section-title",children:"🧰 Agent Hub"}),s.jsxs("div",{className:"loading-state",children:[s.jsx("div",{className:"loading-spinner"}),s.jsx("p",{children:"Loading hub…"})]})]});const z0=!h&&T!==null;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"admin-header",children:[s.jsxs("h2",{className:"section-title",children:["🧰 Agent Hub",v?s.jsxs("span",{className:`admin-role-badge admin-role-${g||"viewer"}`,children:[v," · ",g||"viewer"]}):null]}),s.jsxs("div",{className:"admin-header-actions",children:[s.jsx("button",{className:"admin-refresh-btn",onClick:()=>void Or(),disabled:c,children:c?"⏳ Refreshing…":"🔄 Refresh"}),h?s.jsx("button",{className:"admin-logout-btn",onClick:()=>void te(),children:"🚪 Log out"}):null]})]}),s.jsxs("p",{className:"admin-subtitle",children:["Capabilities, messaging, artifacts and skills in one place — a single 4-view management page. Toggles persist to ",s.jsx("code",{children:"buffconfig"})," and are honored by the runtime immediately (never cosmetic)."]}),o?s.jsx("div",{className:"admin-error",children:o}):null,z0?s.jsxs("div",{className:"admin-header",children:[s.jsx("h3",{className:"section-subtitle",children:d!=null&&d.configured?`🔐 Log in to ${T.enabled?"enable":"disable"} '${T.name}'`:`🔐 Set up admin access to ${T.enabled?"enable":"disable"} '${T.name}'`}),s.jsxs("form",{className:"admin-gate-form",onSubmit:d!=null&&d.configured?$u:B,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{type:"text",value:b,onChange:j=>x(j.target.value),autoComplete:"username",placeholder:"admin"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Password"}),s.jsx("input",{type:"password",value:k,onChange:j=>S(j.target.value),autoComplete:d!=null&&d.configured?"current-password":"new-password",placeholder:"••••••••"})]}),w?s.jsx("div",{className:"admin-error",children:w}):null,s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:N||!b||!k,children:N?"⏳ …":d!=null&&d.configured?"🔐 Log in & apply":"🔐 Create admin & apply"}),d!=null&&d.configured?null:s.jsxs("p",{className:"admin-hint",children:["The first user is always an admin. Automation alternative: set"," ",s.jsx("code",{children:"BUFF_DASHBOARD_ADMIN_USER"})," / ",s.jsx("code",{children:"BUFF_DASHBOARD_ADMIN_PASSWORD"}),"."]})]})]}):null,!z0&&!Gt&&h?s.jsxs("div",{className:"admin-readonly-note",children:["🔒 Your role (",s.jsx("code",{children:g||"viewer"}),") can view but not change capabilities — toggles require the ",s.jsx("code",{children:"admin"})," or ",s.jsx("code",{children:"operator"})," role."]}):null,s.jsx("div",{className:"hub-tabs",role:"tablist",children:xse.map(j=>{var ne;const q=j.id==="tools"?n?`${n.toolsets.enabled}/${n.toolsets.toolsets.length}`:"":j.id==="channels"?n?String(n.channels.delivery.total):"":j.id==="conversations"?n?String(((ne=n.conversations)==null?void 0:ne.total)??0):"":j.id==="artifacts"?n?String(n.artifacts.totalSessions):"":n?`${n.skills.enabled}/${n.skills.total}`:"";return s.jsxs("button",{role:"tab","aria-selected":e===j.id,className:`hub-tab${e===j.id?" active":""}`,onClick:()=>t(j.id),children:[j.icon," ",j.label,q?s.jsx("span",{className:"hub-tab-count",children:q}):null]},j.id)})}),e==="tools"&&n?s.jsxs("div",{role:"tabpanel",children:[s.jsxs("div",{className:"admin-summary-grid",children:[s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.toolsets.enabled}),s.jsx("div",{className:"admin-summary-label",children:"Enabled toolsets"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.toolsets.disabled}),s.jsx("div",{className:"admin-summary-label",children:"Disabled toolsets"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.toolsets.totalTools}),s.jsx("div",{className:"admin-summary-label",children:"Registered tools"})]})]}),s.jsx("div",{className:"hub-toolset-grid",children:n.toolsets.toolsets.map(j=>s.jsxs("div",{className:`hub-card${j.enabled?"":" hub-card-disabled"}`,children:[s.jsxs("div",{className:"hub-card-top",children:[s.jsxs("div",{className:"hub-card-title",children:[s.jsx("span",{className:"hub-card-name",children:j.label}),s.jsx("span",{className:"hub-card-id",children:j.name})]}),s.jsx("button",{role:"switch","aria-checked":j.enabled,"aria-label":`${j.enabled?"Disable":"Enable"} ${j.label}`,className:`hub-switch${j.enabled?" on":""}`,disabled:R===j.name||T!==null||h&&!Gt,onClick:()=>Ee(j.name,!j.enabled),children:s.jsx("span",{className:"hub-switch-knob"})})]}),s.jsx("p",{className:"hub-card-desc",children:j.description}),s.jsx("div",{className:"hub-card-tools",children:j.tools.length>0?j.tools.map(q=>s.jsx("span",{className:"hub-chip",children:q},q)):s.jsx("span",{className:"admin-hint",children:"gates dynamic MCP tools (no static names)"})}),I[j.name]?s.jsx("div",{className:"admin-row-msg",children:I[j.name]}):null,j.enabled?null:s.jsx("div",{className:"hub-card-note",children:"⛔ Removed from the model schema — calls return an explicit error"})]},j.name))})]}):null,e==="channels"&&n?s.jsxs("div",{role:"tabpanel",children:[s.jsxs("div",{className:"hub-reveal-row",children:[s.jsxs("label",{className:"hub-reveal-toggle",children:[s.jsx("input",{type:"checkbox",checked:pe,onChange:j=>Ct(j.target.checked),disabled:!Gt}),"Show full sender ids ",s.jsx("span",{className:"admin-hint",children:"(masks phone numbers by default)"})]}),Gt?null:s.jsx("span",{className:"admin-hint",children:"— admins and operators only"})]}),s.jsxs("div",{className:"admin-summary-grid",children:[s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.channels.delivery.pending}),s.jsx("div",{className:"admin-summary-label",children:"⏳ Queued for retry"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.channels.delivery.sent}),s.jsx("div",{className:"admin-summary-label",children:"✅ Delivered"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.channels.delivery.failed}),s.jsx("div",{className:"admin-summary-label",children:"❌ Failed (max retries)"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.channels.aliases.length}),s.jsx("div",{className:"admin-summary-label",children:"Channel aliases"})]})]}),s.jsx("h3",{className:"section-subtitle",children:"📮 Delivery ledger (guaranteed delivery)"}),n.channels.delivery.recent.length>0?s.jsx("div",{className:"admin-table-wrapper",children:s.jsxs("table",{className:"admin-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Target"}),s.jsx("th",{children:"Platform"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Attempts"}),s.jsx("th",{children:"Next retry"}),s.jsx("th",{children:"Message"})]})}),s.jsx("tbody",{children:n.channels.delivery.recent.map(j=>s.jsxs("tr",{children:[s.jsx("td",{className:"admin-provider-type",children:Qr(j.target)}),s.jsx("td",{children:j.platform}),s.jsx("td",{children:s.jsx("span",{className:`admin-check-badge admin-check-${j.status==="sent"?"pass":j.status==="failed"?"fail":"warn"}`,children:wse[j.status]||j.status})}),s.jsxs("td",{children:[j.attempts,"/5"]}),s.jsx("td",{children:j.status==="pending"?`${Math.max(0,Math.round((j.nextAttemptAt-Date.now())/1e3))}s`:"—"}),s.jsx("td",{className:"admin-hint",children:j.lastError?`⚠️ ${j.lastError}`:(j.text||"").slice(0,60)})]},j.id))})]})}):s.jsx("div",{className:"empty-state",children:"Delivery ledger is empty — every gateway send has gone through."}),s.jsx("h3",{className:"section-subtitle",children:"📥 Inbox (received messages)"}),n.channels.inbox.recent.length>0?s.jsx("div",{className:"admin-table-wrapper",children:s.jsxs("table",{className:"admin-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Platform"}),s.jsx("th",{children:"From"}),s.jsx("th",{children:"Message"}),s.jsx("th",{children:"Handled"}),s.jsx("th",{children:"When"})]})}),s.jsx("tbody",{children:n.channels.inbox.recent.map(j=>s.jsxs("tr",{children:[s.jsxs("td",{className:"admin-provider-type",children:[j.platform,j.isGroup?s.jsx("span",{className:"hub-chip",children:"group"}):null]}),s.jsx("td",{children:Qr(j.from||j.senderId||j.channelId)}),s.jsx("td",{className:"admin-hint",children:(j.text||"").slice(0,60)}),s.jsxs("td",{children:[s.jsx("span",{className:`admin-check-badge admin-check-${j.handled==="pipeline"?"pass":j.handled==="refused"?"fail":"warn"}`,children:j.handled}),j.reply?s.jsx("div",{className:"admin-hint",children:j.reply.slice(0,40)}):null]}),s.jsx("td",{className:"admin-hint",children:new Date(j.at).toLocaleString()})]},j.id))})]})}):s.jsx("div",{className:"empty-state",children:"Inbox is empty — messages the gateway receives will appear here."}),s.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."]}),s.jsx("h3",{className:"section-subtitle",children:"🔌 Platform transports"}),s.jsx(vse,{canWrite:Gt,sessionExpired:Pi,mode:"table"}),s.jsx("h3",{className:"section-subtitle",children:"🔗 Channel aliases (buff gateway status)"}),n.channels.aliases.length>0?s.jsx("div",{className:"hub-alias-list",children:n.channels.aliases.map(j=>s.jsxs("div",{className:"hub-alias-row",children:[s.jsx("span",{className:"hub-chip",children:j.alias}),s.jsxs("span",{className:"admin-hint",children:["→ ",j.platform,":",Qr(j.channelId)]})]},j.alias))}):s.jsxs("div",{className:"empty-state",children:["No aliases yet — register one with ",s.jsx("code",{children:"buff gateway alias <name> <platform> <channelId>"}),"."]}),on?s.jsxs("div",{className:"hub-unsaved-banner",role:"status",children:[s.jsxs("span",{children:["⚠️ ",s.jsx("strong",{children:"Unsaved changes"})," — what you see below is a ",s.jsx("em",{children:"draft"}),". Press"," ",s.jsx("strong",{children:"💾 Save permissions"})," to apply it to the gateway; leaving the page discards it."]}),s.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:H,onClick:()=>void B0(),children:H?"⏳ Saving…":"💾 Save permissions"})]}):null,s.jsx("div",{style:{cursor:"pointer",userSelect:"none",display:"flex",alignItems:"center",gap:8,marginBottom:8},onClick:()=>be(!le),children:s.jsxs("h3",{className:"section-subtitle",style:{margin:0},children:[le?"▼":"▶"," 🔐 Permissions — who can TRIGGER the agent"]})}),s.jsxs("p",{className:"admin-hint",style:{marginBottom:le?10:0},children:["This list controls ",s.jsx("strong",{children:"who may trigger the agent"})," when they message you on each platform (WhatsApp, Telegram, email, …). Click to ",le?"collapse":"expand"," and manage permissions."]}),le?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"admin-hint",style:{marginBottom:10},children:["⚠ ",s.jsx("strong",{children:"Not the same as send-by-name contacts:"})," a WhatsApp contact name (from"," ",s.jsx("code",{children:"buff whatsapp contact add"}),", shown in the WhatsApp bridge panel below) only lets"," ",s.jsx("em",{children:"you"})," send ",s.jsx("em",{children:"to"})," it by name — it does ",s.jsx("strong",{children:"not"})," let that number trigger the agent. Add the number here (or ",s.jsx("code",{children:"buff config gateway allow <platform> user <id>"}),") to grant inbound access."]}),s.jsx("div",{className:"hub-permissions",children:n.channels.platforms.map(j=>{const q={...n.channels.policies[j.platform]??{},...me[j.platform]??{}},ne=q.allowedUsers??[],re=q.allowedGroups??[];return s.jsxs("div",{className:"hub-card",children:[s.jsxs("div",{className:"hub-card-top",children:[s.jsx("span",{className:"hub-chip",children:j.label}),s.jsx("span",{className:"hub-card-id",children:j.platform}),q.disabled?s.jsx("span",{className:"hub-chip",children:"disabled"}):null]}),s.jsx("div",{className:"admin-hint",style:{margin:"4px 0 8px"},children:"Allowed users — who may trigger the agent"}),s.jsxs("div",{className:"hub-alias-list",children:[ne.length===0?s.jsxs("span",{className:"admin-hint",children:["(blank — no one may trigger; add ",s.jsx("code",{children:"Allow-All"})," to allow everyone)"]}):null,ne.map(de=>{var it,ht,xe,Nt;const Te=(((it=me[j.platform])==null?void 0:it.allowedUsers)??[]).includes(de)&&!(((Nt=(xe=(ht=n==null?void 0:n.channels)==null?void 0:ht.policies)==null?void 0:xe[j.platform])==null?void 0:Nt.allowedUsers)??[]).includes(de);return s.jsxs("div",{className:"hub-alias-row",children:[s.jsxs("span",{className:`hub-chip${Te?" hub-chip-pending":""}`,title:Te?"Not saved yet — press 💾 Save permissions":void 0,children:[Qr(de),Te?" · unsaved":""]}),s.jsx("button",{className:"admin-refresh-btn",disabled:H,onClick:()=>ft(j.platform,de),children:"✕"})]},`u-${de}`)})]}),s.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 10px"},children:[s.jsx("input",{type:"text",value:pl[j.platform]??"",onChange:de=>ml(Te=>({...Te,[j.platform]:de.target.value})),placeholder:"Name (optional)",disabled:H}),s.jsx("input",{type:"text",value:Z[j.platform]??"",onChange:de=>_e(Te=>({...Te,[j.platform]:de.target.value})),placeholder:"Contact no / sender id, or Allow-All",disabled:H}),s.jsx("button",{className:"admin-refresh-btn",disabled:H||!(Z[j.platform]??"").trim(),onClick:()=>Fe(j.platform),children:"+ User"})]}),s.jsx("div",{className:"admin-hint",style:{margin:"4px 0 8px"},children:"Allowed groups"}),s.jsxs("div",{className:"hub-alias-list",children:[re.length===0?s.jsx("span",{className:"admin-hint",children:"(none — any group may trigger)"}):null,re.map(de=>{var it,ht,xe,Nt;const Te=(((it=me[j.platform])==null?void 0:it.allowedGroups)??[]).includes(de)&&!(((Nt=(xe=(ht=n==null?void 0:n.channels)==null?void 0:ht.policies)==null?void 0:xe[j.platform])==null?void 0:Nt.allowedGroups)??[]).includes(de);return s.jsxs("div",{className:"hub-alias-row",children:[s.jsxs("span",{className:`hub-chip${Te?" hub-chip-pending":""}`,title:Te?"Not saved yet — press 💾 Save permissions":void 0,children:[de,Te?" · unsaved":""]}),s.jsx("button",{className:"admin-refresh-btn",disabled:H,onClick:()=>Cn(j.platform,"group",de),children:"✕"})]},`g-${de}`)})]}),s.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 10px"},children:[s.jsx("input",{type:"text",value:we[j.platform]??"",onChange:de=>Ne(Te=>({...Te,[j.platform]:de.target.value})),placeholder:"group id, e.g. 1203630283471234@g.us",disabled:H}),s.jsx("button",{className:"admin-refresh-btn",disabled:H||!(we[j.platform]??"").trim(),onClick:()=>{pr(j.platform,"group",we[j.platform]??""),Ne(de=>({...de,[j.platform]:""}))},children:"+ Group"})]}),s.jsx("div",{className:"admin-hint",style:{margin:"12px 0 4px"},children:"Send authority — who may tell the agent to send to OTHER people"}),s.jsx("div",{className:"admin-hint",style:{margin:"0 0 6px",opacity:.8},children:(q.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)."}),s.jsx("div",{className:"hub-alias-list",children:(q.outboundSenders??[]).map(de=>{var it,ht,xe,Nt;const Te=(((it=me[j.platform])==null?void 0:it.outboundSenders)??[]).includes(de)&&!(((Nt=(xe=(ht=n==null?void 0:n.channels)==null?void 0:ht.policies)==null?void 0:xe[j.platform])==null?void 0:Nt.outboundSenders)??[]).includes(de);return s.jsxs("div",{className:"hub-alias-row",children:[s.jsxs("span",{className:`hub-chip${Te?" hub-chip-pending":""}`,title:Te?"Not saved yet — press 💾 Save permissions":void 0,children:[Qr(de),Te?" · unsaved":""]}),s.jsx("button",{className:"admin-refresh-btn",disabled:H,onClick:()=>Cn(j.platform,"send",de),children:"✕"})]},`s-${de}`)})}),s.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 10px"},children:[s.jsx("input",{type:"text",value:ge[j.platform]??"",onChange:de=>Be(Te=>({...Te,[j.platform]:de.target.value})),placeholder:"sender id, or Allow-All",disabled:H}),s.jsx("button",{className:"admin-refresh-btn",disabled:H||!(ge[j.platform]??"").trim(),onClick:()=>{pr(j.platform,"send",ge[j.platform]??""),Be(de=>({...de,[j.platform]:""}))},children:"+ Sender"})]}),s.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 0"},children:[s.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginRight:12},children:[s.jsx("input",{type:"checkbox",checked:q.silentDrop!==!1,disabled:H,onChange:()=>wt(j.platform,"silentDrop")}),s.jsx("span",{className:"admin-hint",children:"Silent (no reply to unapproved) — default"})]}),s.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginRight:12},children:[s.jsx("input",{type:"checkbox",checked:!!q.requireMention,disabled:H,onChange:()=>wt(j.platform,"requireMention")}),s.jsx("span",{className:"admin-hint",children:"Groups: mention only"})]}),s.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginRight:12},children:[s.jsx("input",{type:"checkbox",checked:!!q.disabled,disabled:H,onChange:()=>wt(j.platform,"disabled")}),s.jsx("span",{className:"admin-hint",children:"Disabled (off)"})]}),s.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[s.jsx("input",{type:"checkbox",checked:!!q.requireApprovedTarget,disabled:H,onChange:()=>wt(j.platform,"requireApprovedTarget")}),s.jsx("span",{className:"admin-hint",children:"Require approved recipients for sends"})]})]})]},j.platform)})})]}):null,s.jsx("h3",{className:"section-subtitle",style:{marginTop:22},children:"📇 Telegram User Onboarding"}),s.jsxs("div",{className:"onboarding-summary",children:[s.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 j=Ci.filter(re=>re.status==="pending").length,q=Ci.filter(re=>re.status==="approved").length,ne=Ci.filter(re=>re.status==="rejected").length;return s.jsxs("div",{className:"onboarding-stats",children:[s.jsxs("span",{className:"onboarding-stat pending",children:["⏳ ",j," pending"]}),s.jsxs("span",{className:"onboarding-stat approved",children:["✅ ",q," approved"]}),s.jsxs("span",{className:"onboarding-stat rejected",children:["🚫 ",ne," rejected"]})]})})(),s.jsxs("div",{className:"onboarding-steps",children:[s.jsxs("div",{className:"onboarding-step",children:[s.jsx("span",{className:"onboarding-step-num",children:"1"}),s.jsxs("span",{children:["User sends any message to ",s.jsx("code",{children:"@agent_nuvira_bot"})]})]}),s.jsxs("div",{className:"onboarding-step",children:[s.jsx("span",{className:"onboarding-step-num",children:"2"}),s.jsxs("span",{children:["Bot auto-registers them as ",s.jsx("strong",{children:"⏳ pending"})]})]}),s.jsxs("div",{className:"onboarding-step",children:[s.jsx("span",{className:"onboarding-step-num",children:"3"}),s.jsx("span",{children:"Admin approves → they can receive outbound messages"})]})]}),s.jsx("a",{href:"/contacts",className:"admin-refresh-btn",style:{marginTop:12,display:"inline-block",textDecoration:"none"},children:"📋 Go to Contacts tab to manage →"})]}),s.jsx("h3",{className:"section-subtitle",style:{marginTop:22},children:"📊 Status recipients"}),s.jsxs("p",{className:"admin-hint",children:["Contacts/groups that ALWAYS receive the pipeline completion summary, whoever triggered it. Use a contact name, number, or ",s.jsx("code",{children:"platform:channelId"})," — e.g."," ",s.jsx("code",{children:"whatsapp:Name"}),", ",s.jsx("code",{children:"whatsapp:+91***"}),", ",s.jsx("code",{children:"telegram:123456"}),","," ",s.jsx("code",{children:"slack:ops"}),"."]}),Oi.length>0?s.jsx("div",{className:"hub-alias-list",children:Oi.map(j=>{var q,ne;return s.jsxs("div",{className:"hub-alias-row",children:[s.jsx("span",{className:"hub-chip",children:"📊"}),s.jsx("span",{className:"admin-hint",children:((ne=(q=n==null?void 0:n.channels)==null?void 0:q.statusRecipientDisplay)==null?void 0:ne[j])??j}),s.jsx("button",{className:"admin-refresh-btn",disabled:H,onClick:()=>_s(re=>re.filter(de=>de!==j)),children:"✕"})]},j)})}):s.jsx("div",{className:"empty-state",style:{padding:"14px"},children:"No status recipients — add one below."}),s.jsxs("div",{className:"hub-send-form",children:[s.jsx("input",{type:"text",value:Ns,onChange:j=>Zr(j.target.value),placeholder:"whatsapp:Name or whatsapp:+91***",disabled:H,maxLength:128}),s.jsx("button",{className:"admin-refresh-btn",disabled:H||!Ns.trim()||Oi.includes(Ns.trim()),onClick:()=>{_s(j=>[...j,Ns.trim()]),Zr("")},children:"+ Add"})]}),s.jsxs("div",{className:"hub-send-form",style:{marginTop:10},children:[s.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:H,onClick:()=>void B0(),children:H?"⏳ Saving…":"💾 Save permissions"}),Object.keys(me).length>0?s.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:H,onClick:()=>Pe({}),children:"Discard draft"}):null]}),oe?s.jsx("div",{className:`admin-row-msg${oe.kind==="ok"?"":" admin-row-msg-err"}`,children:oe.text}):null,s.jsx("h3",{className:"section-subtitle",children:"📤 Test a channel (buff gateway send)"}),s.jsxs("form",{className:"hub-send-form",onSubmit:j=>void qt(j),children:[s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:"Target — an alias or platform:channelId"}),s.jsx("input",{type:"text",value:D,onChange:j=>F(j.target.value),placeholder:"ops or slack:C0123 or email:team@example.com",disabled:A,maxLength:128})]}),s.jsxs("label",{className:"hub-send-message",children:[s.jsx("span",{className:"admin-hint",children:"Message"}),s.jsx("input",{type:"text",value:O,onChange:j=>P(j.target.value),placeholder:"nightly build done 🎉",disabled:A,maxLength:4e3})]}),s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:A||!D.trim()||!O,children:A?"⏳ Sending…":"📤 Send test message"})]}),K?s.jsx("div",{className:`admin-row-msg${K.kind==="ok"?"":" admin-row-msg-err"}`,children:K.text}):null,s.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. ",s.jsx("code",{children:"BUFF_SMTP_HOST"}),"). Requires admin or operator."]}),s.jsx("h3",{className:"section-subtitle",children:"🟢 WhatsApp bridge (buff whatsapp pair)"}),s.jsx(yse,{authed:h,canWrite:Gt,sessionExpired:Pi,reveal:pe})]}):null,e==="conversations"&&n?s.jsxs("div",{role:"tabpanel",children:[s.jsxs("div",{className:"admin-summary-grid",children:[s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:((q0=n.conversations)==null?void 0:q0.total)??0}),s.jsx("div",{className:"admin-summary-label",children:"Stored conversations"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:Jt.filter(j=>Date.now()-j.lastActiveAt<864e5).length}),s.jsx("div",{className:"admin-summary-label",children:"Active today"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:Jt.filter(j=>j.platform==="whatsapp").length}),s.jsx("div",{className:"admin-summary-label",children:"WhatsApp"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:Jt.filter(j=>j.platform==="telegram").length}),s.jsx("div",{className:"admin-summary-label",children:"Telegram"})]})]}),((K0=n.conversations)==null?void 0:K0.analytics)&&n.conversations.analytics.totalConversations>0&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>V(!U),style:{marginBottom:12},children:U?"📊 Hide Analytics":"📊 Show Analytics"}),U?s.jsxs("div",{className:"hub-session-list",style:{marginBottom:16},children:[s.jsxs("div",{className:"admin-summary-grid",children:[s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.conversations.analytics.totalMessages}),s.jsx("div",{className:"admin-summary-label",children:"Total messages"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.conversations.analytics.avgMessagesPerConversation}),s.jsx("div",{className:"admin-summary-label",children:"Avg msgs/conversation"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.conversations.analytics.avgUserMessageLength}),s.jsx("div",{className:"admin-summary-label",children:"Avg user msg length"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.conversations.analytics.avgAssistantMessageLength}),s.jsx("div",{className:"admin-summary-label",children:"Avg assistant msg length"})]})]}),s.jsxs("div",{className:"hub-card",style:{marginTop:12},children:[s.jsx("div",{className:"hub-card-top",children:s.jsx("div",{className:"hub-card-title",children:s.jsx("span",{className:"hub-card-name",children:"🏆 Most Active Contacts"})})}),s.jsx("div",{style:{marginTop:8},children:n.conversations.analytics.topContacts.map((j,q)=>{var de;const ne=((de=n.conversations.analytics.topContacts[0])==null?void 0:de.messageCount)||1,re=Math.round(j.messageCount/ne*100);return s.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:6,fontSize:13},children:[s.jsx("span",{style:{width:24,textAlign:"center",fontWeight:600,color:q<3?"#f59e0b":"var(--muted)"},children:q===0?"🥇":q===1?"🥈":q===2?"🥉":`${q+1}.`}),s.jsxs("span",{style:{flex:1,marginLeft:8},children:[j.platform==="whatsapp"?"📱":"✈️"," ",j.name]}),s.jsx("span",{style:{width:60,textAlign:"right",fontWeight:600},children:j.messageCount}),s.jsx("div",{style:{width:100,height:8,background:"var(--border)",borderRadius:4,marginLeft:8},children:s.jsx("div",{style:{width:`${re}%`,height:"100%",background:"#3b82f6",borderRadius:4}})})]},q)})})]}),s.jsxs("div",{className:"hub-card",style:{marginTop:12},children:[s.jsx("div",{className:"hub-card-top",children:s.jsx("div",{className:"hub-card-title",children:s.jsx("span",{className:"hub-card-name",children:"🕐 Peak Hours"})})}),s.jsx("div",{style:{display:"flex",alignItems:"flex-end",height:80,marginTop:8,gap:2},children:n.conversations.analytics.hourlyDistribution.map(({hour:j,count:q})=>{const ne=Math.max(...n.conversations.analytics.hourlyDistribution.map(de=>de.count),1),re=Math.round(q/ne*70);return s.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center"},children:s.jsx("div",{style:{width:"100%",height:re,background:j>=9&&j<=21?"#3b82f6":"#6b7280",borderRadius:2},title:`${j}:00 — ${q} messages`})},j)})}),s.jsx("div",{style:{display:"flex",fontSize:10,color:"var(--muted)",marginTop:4},children:[0,6,12,18,23].map(j=>s.jsxs("span",{style:{flex:1,textAlign:j===0?"left":j===23?"right":"center"},children:[j,":00"]},j))})]}),s.jsxs("div",{className:"hub-card",style:{marginTop:12},children:[s.jsx("div",{className:"hub-card-top",children:s.jsx("div",{className:"hub-card-title",children:s.jsx("span",{className:"hub-card-name",children:"📱 Platform Breakdown"})})}),s.jsx("div",{style:{marginTop:8},children:n.conversations.analytics.platformBreakdown.map(j=>s.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:6,fontSize:13},children:[s.jsx("span",{className:"hub-chip",style:{width:80,textAlign:"center"},children:j.platform}),s.jsxs("span",{style:{marginLeft:8,flex:1},children:[j.conversations," conversations"]}),s.jsxs("span",{style:{fontWeight:600},children:[j.messages," msgs"]})]},j.platform))})]}),s.jsxs("div",{className:"hub-card",style:{marginTop:12},children:[s.jsx("div",{className:"hub-card-top",children:s.jsx("div",{className:"hub-card-title",children:s.jsx("span",{className:"hub-card-name",children:"📈 Daily Volume (14 days)"})})}),s.jsx("div",{style:{display:"flex",alignItems:"flex-end",height:60,marginTop:8,gap:2},children:n.conversations.analytics.dailyVolume.map(({date:j,count:q})=>{const ne=Math.max(...n.conversations.analytics.dailyVolume.map(de=>de.count),1),re=Math.round(q/ne*50);return s.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center"},children:s.jsx("div",{style:{width:"100%",height:re,background:"#10b981",borderRadius:2},title:`${j}: ${q} messages`})},j)})}),s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:10,color:"var(--muted)",marginTop:4},children:[s.jsx("span",{children:(V0=n.conversations.analytics.dailyVolume[0])==null?void 0:V0.date}),s.jsx("span",{children:(Y0=n.conversations.analytics.dailyVolume[n.conversations.analytics.dailyVolume.length-1])==null?void 0:Y0.date})]})]})]}):null]}),s.jsx("h3",{className:"section-subtitle",children:"💬 Per-contact chat history"}),s.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."}),Jt.length>0||ze?s.jsxs(s.Fragment,{children:[jn.length>0&&s.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginBottom:8},children:[s.jsx("span",{className:"admin-hint",style:{marginRight:4},children:"Filter by tag:"}),jn.map(j=>s.jsxs("button",{type:"button",onClick:()=>G(dt===j?"":j),style:{padding:"2px 10px",borderRadius:12,fontSize:11,cursor:"pointer",border:`1px solid ${dt===j?"#3b82f6":"var(--border)"}`,background:dt===j?"#3b82f620":"transparent",color:dt===j?"#3b82f6":"var(--muted)"},children:["🏷️ ",j]},j))]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12,flexWrap:"wrap"},children:[s.jsx("input",{type:"text",value:Ze,onChange:j=>Me(j.target.value),placeholder:"🔍 Search by contact name, phone number, or message content…",style:{flex:1,minWidth:200}}),s.jsxs("span",{className:"admin-hint",children:[ys," conversation",ys===1?"":"s",Ze?` matching "${Ze}"`:""]}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:cl,style:{fontSize:12,padding:"4px 10px"},children:Se.size===Jt.length?"☑ Deselect All":"☐ Select All"}),Se.size>0&&s.jsx("button",{type:"button",className:"admin-refresh-btn",disabled:Lt,onClick:()=>void Ss(),style:{fontSize:12,padding:"4px 10px",background:"#3b82f6",color:"#fff",border:"none"},children:Lt?"⏳ Exporting…":`📦 Export ${Se.size} as ZIP`})]}),s.jsxs("div",{className:"hub-session-list",children:[Jt.filter(j=>!dt||(j.tags??[]).includes(dt)).map(j=>{const q=Date.now()-j.lastActiveAt,ne=q<6e4?"just now":q<36e5?`${Math.round(q/6e4)}m ago`:q<864e5?`${Math.round(q/36e5)}h ago`:`${Math.round(q/864e5)}d ago`,re=We===j.key,{name:de,phone:Te}=qp(j),it=async xe=>{if(xe.stopPropagation(),!h||!Gt){ce({kind:"err",text:"🔐 Log in (admin/operator) to clear conversations."});return}$t(j.key);try{await ee.clearGatewayConversation(j.key),Or()}catch{}$t(null)},ht=Se.has(j.key);return s.jsxs("div",{className:"hub-card",style:{cursor:"pointer",borderLeft:`3px solid ${j.platform==="whatsapp"?"#25d366":j.platform==="telegram"?"#0088cc":"#6c757d"}`,opacity:Se.size>0&&!ht?.5:1,transition:"opacity 0.2s"},onClick:()=>Oe(re?null:j.key),children:[s.jsxs("div",{className:"hub-card-top",children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[s.jsx("input",{type:"checkbox",checked:ht,onClick:xe=>Fp(j.key,xe),onChange:()=>{},style:{cursor:"pointer",width:16,height:16}}),s.jsxs("div",{className:"hub-card-title",children:[s.jsxs("span",{className:"hub-card-name",children:[j.platform==="whatsapp"?"📱":j.platform==="telegram"?"✈️":"💬"," ",de]}),s.jsxs("span",{className:"hub-card-id",children:[Te&&s.jsx("span",{style:{color:"var(--text-secondary, #8b949e)",marginRight:6},children:Te}),j.platform," · ",ne]})]})]}),s.jsxs("div",{className:"hub-card-actions",style:{gap:6},children:[s.jsxs("span",{className:"hub-chip",children:[j.messageCount," msgs"]}),re&&j.messages&&j.messages.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:"hub-mini-btn",onClick:xe=>Wp(j,xe),title:"Export as text file",children:"📄"}),s.jsx("button",{type:"button",className:"hub-mini-btn",onClick:xe=>Hp(j,xe),title:"Export as PDF (opens print dialog)",children:"📑"})]}),s.jsx("button",{type:"button",className:"hub-mini-btn",disabled:Qt===j.key,onClick:it,title:"Clear conversation history",style:{color:"#ef4444"},children:"🗑️"}),s.jsx("span",{style:{fontSize:18,transition:"transform 0.2s",transform:re?"rotate(180deg)":"none"},children:"▼"})]})]}),s.jsxs("p",{className:"hub-card-desc",style:{fontStyle:"italic",color:"var(--text-muted, #6e7681)"},children:[s.jsx("span",{style:{color:"var(--text-primary, #e6edf3)",fontWeight:500},children:"Last message:"})," ",j.lastUserMessage.slice(0,120),j.lastUserMessage.length>120?"…":""]}),s.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginTop:4},children:[(j.tags??[]).map(xe=>s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:2,padding:"2px 8px",borderRadius:12,fontSize:11,background:"#3b82f620",color:"#3b82f6",border:"1px solid #3b82f640"},children:["🏷️ ",xe,s.jsx("button",{type:"button",onClick:Nt=>{Nt.stopPropagation(),Cu(j.key,xe)},style:{background:"none",border:"none",color:"#3b82f6",cursor:"pointer",padding:0,fontSize:12,lineHeight:1},children:"×"})]},xe)),he===j.key?s.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:2},children:s.jsx("input",{type:"text",value:Re,onChange:xe=>Cr(xe.target.value),onKeyDown:xe=>{xe.key==="Enter"&&Up(j.key,Re),xe.key==="Escape"&&(Ie(null),Cr(""))},placeholder:"tag name",autoFocus:!0,onClick:xe=>xe.stopPropagation(),style:{width:80,padding:"1px 6px",fontSize:11,borderRadius:8,border:"1px solid var(--border)"}})}):s.jsx("button",{type:"button",onClick:xe=>{xe.stopPropagation(),Ie(j.key),Cr("")},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"})]}),re&&j.messages&&j.messages.length>0?s.jsxs("div",{className:"conversation-thread",style:{marginTop:10,borderTop:"1px solid var(--border)",paddingTop:10,maxHeight:400,overflowY:"auto"},children:[j.messages.map((xe,Nt)=>s.jsxs("div",{style:{marginBottom:8,display:"flex",flexDirection:"column",alignItems:xe.role==="user"?"flex-end":"flex-start"},children:[s.jsxs("div",{style:{maxWidth:"80%",padding:"8px 12px",borderRadius:12,backgroundColor:xe.role==="user"?"#007bff":"var(--bg-card, #1a1f2e)",color:xe.role==="user"?"#fff":"var(--text-primary, #e6edf3)",fontSize:13,lineHeight:1.5,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:[xe.content.slice(0,500),xe.content.length>500?"…":""]}),s.jsxs("span",{style:{fontSize:10,color:"var(--muted)",marginTop:2,padding:"0 4px"},children:[xe.role==="user"?"👤":"🤖"," ",new Date(xe.ts).toLocaleString()]})]},Nt)),se.has(j.key)&&s.jsxs("div",{style:{marginBottom:8,display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[s.jsxs("div",{style:{padding:"8px 16px",borderRadius:12,backgroundColor:"var(--bg-card, #1a1f2e)",fontSize:13,display:"flex",alignItems:"center",gap:4},children:[s.jsx("span",{style:{animation:"typingBlink 1.4s infinite ease-in-out"},children:"●"}),s.jsx("span",{style:{animation:"typingBlink 1.4s infinite ease-in-out 0.2s"},children:"●"}),s.jsx("span",{style:{animation:"typingBlink 1.4s infinite ease-in-out 0.4s"},children:"●"})]}),s.jsx("span",{style:{fontSize:10,color:"var(--muted)",marginTop:2,padding:"0 4px"},children:"🤖 typing…"})]})]}):re?s.jsx("p",{className:"admin-hint",style:{marginTop:8},children:"No message details available."}):null]},j.key)}),Ni&&!ze&&s.jsx("div",{ref:Ai,style:{height:1}}),ze&&s.jsxs("div",{className:"loading-state",style:{padding:12},children:[s.jsx("div",{className:"loading-spinner"}),s.jsx("span",{className:"admin-hint",style:{marginLeft:8},children:"Loading more conversations…"})]}),!ze&&!Ni&&Jt.length>0&&s.jsxs("p",{className:"admin-hint",style:{textAlign:"center",padding:12},children:["All ",ys," conversation",ys===1?"":"s"," loaded."]})]})]}):ze?s.jsxs("div",{className:"loading-state",children:[s.jsx("div",{className:"loading-spinner"}),s.jsx("p",{className:"admin-hint",children:"Loading conversations…"})]}):s.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?s.jsxs("div",{role:"tabpanel",children:[s.jsxs("div",{className:"admin-summary-grid",children:[s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.artifacts.totalSessions}),s.jsx("div",{className:"admin-summary-label",children:"Sessions"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.artifacts.totalArtifacts}),s.jsx("div",{className:"admin-summary-label",children:"Artifacts"})]})]}),n.artifacts.sessions.length>0?s.jsx("div",{className:"hub-session-list",children:n.artifacts.sessions.map(j=>s.jsxs("div",{className:"hub-card",children:[s.jsx("div",{className:"hub-card-top",children:s.jsxs("div",{className:"hub-card-title",children:[s.jsx("span",{className:"hub-card-name",children:j.sessionId}),s.jsxs("span",{className:"hub-card-id",children:[j.count," artifact",j.count===1?"":"s"," · ",new Date(j.latestAt).toLocaleString()]})]})}),j.recent.length>0?s.jsx("ul",{className:"hub-artifact-list",children:j.recent.map((q,ne)=>s.jsxs("li",{children:[s.jsx("span",{className:"hub-chip",children:q.kind}),s.jsx("span",{className:"hub-artifact-title",children:q.title||"(untitled)"}),q.preview?s.jsx("div",{className:"hub-artifact-preview",children:q.preview}):null]},ne))}):s.jsx("div",{className:"admin-hint",children:"No artifact details."})]},j.sessionId))}):s.jsx("div",{className:"empty-state",children:"No artifacts yet — tools that return a deliverable payload land here per session."})]}):null,e==="skills"&&n?s.jsxs("div",{role:"tabpanel",children:[s.jsxs("div",{className:"admin-summary-grid",children:[s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.skills.enabled}),s.jsx("div",{className:"admin-summary-label",children:"Enabled skills"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.skills.disabled}),s.jsx("div",{className:"admin-summary-label",children:"Disabled skills"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.skills.hub.length}),s.jsx("div",{className:"admin-summary-label",children:"Hub skills (SKILL.md)"})]})]}),s.jsx("h3",{className:"section-subtitle",children:"📚 Compiled skills (SkillStore — matched at plan time)"}),n.skills.compiled.length>0?s.jsx("div",{className:"hub-session-list",children:n.skills.compiled.map(j=>s.jsxs("div",{className:`hub-card${j.enabled?"":" hub-card-disabled"}`,children:[s.jsxs("div",{className:"hub-card-top",children:[s.jsxs("div",{className:"hub-card-title",children:[s.jsx("span",{className:"hub-card-name",children:j.name}),s.jsxs("span",{className:"hub-card-id",children:[j.id,j.version?` · v${j.version}`:""]})]}),s.jsxs("div",{className:"hub-card-actions",children:[j.bundled===!0?s.jsx("span",{className:"hub-chip hub-chip-bundled",children:"🧠 bundled"}):s.jsx("span",{className:"hub-chip",children:"community"}),s.jsx("button",{role:"switch","aria-checked":j.enabled,"aria-label":`${j.enabled?"Disable":"Enable"} ${j.name}`,className:`hub-switch${j.enabled?" on":""}`,disabled:R===j.id||T!==null||h&&!Gt,onClick:()=>Jr(j.id,!j.enabled),children:s.jsx("span",{className:"hub-switch-knob"})})]})]}),s.jsx("p",{className:"hub-card-desc",children:j.description}),s.jsxs("div",{className:"hub-card-tools",children:[typeof j.usageCount=="number"?s.jsxs("span",{className:"hub-chip",children:[j.usageCount," uses"]}):null,j.enabled?null:s.jsx("span",{className:"hub-chip",children:"disabled"})]}),I[j.id]?s.jsx("div",{className:"admin-row-msg",children:I[j.id]}):null,j.enabled?null:s.jsx("div",{className:"hub-card-note",children:"⛔ Excluded from skill matching — not injected into the planner"})]},`c-${j.id}`))}):s.jsx("div",{className:"empty-state",children:"No compiled skills."}),s.jsx("h3",{className:"section-subtitle",children:"🌍 Hub skills (installed SKILL.md)"}),n.skills.hub.length>0?s.jsx("div",{className:"hub-session-list",children:n.skills.hub.map(j=>s.jsxs("div",{className:`hub-card${j.enabled?"":" hub-card-disabled"}`,children:[s.jsxs("div",{className:"hub-card-top",children:[s.jsxs("div",{className:"hub-card-title",children:[s.jsx("span",{className:"hub-card-name",children:j.name}),s.jsx("span",{className:"hub-card-id",children:j.id})]}),s.jsxs("div",{className:"hub-card-actions",children:[s.jsx("button",{type:"button",className:"hub-mini-btn",disabled:hl===j.id||h&&!Gt,onClick:()=>void Iu(j.id),children:"🗑 Uninstall"}),s.jsx("button",{role:"switch","aria-checked":j.enabled,"aria-label":`${j.enabled?"Disable":"Enable"} ${j.name}`,className:`hub-switch${j.enabled?" on":""}`,disabled:R===j.id||T!==null||h&&!Gt,onClick:()=>Jr(j.id,!j.enabled),children:s.jsx("span",{className:"hub-switch-knob"})})]})]}),s.jsx("p",{className:"hub-card-desc",children:j.description}),s.jsxs("div",{className:"hub-card-tools",children:[s.jsx("span",{className:"hub-chip",children:"SKILL.md"}),j.enabled?null:s.jsx("span",{className:"hub-chip",children:"disabled"})]}),I[j.id]?s.jsx("div",{className:"admin-row-msg",children:I[j.id]}):null,j.enabled?null:s.jsx("div",{className:"hub-card-note",children:"⛔ Excluded from skill matching — not injected into the planner"})]},`h-${j.id}`))}):s.jsxs("div",{className:"empty-state",children:["No hub skills installed — search the marketplace below or run ",s.jsx("code",{children:"buff skills install <name>"}),"."]}),s.jsx("h3",{className:"section-subtitle",children:"🛒 Marketplace (community skills)"}),s.jsxs("form",{className:"hub-market-search",onSubmit:Mu,children:[s.jsx("input",{type:"text",value:ul,onChange:j=>Ou(j.target.value),placeholder:"Search community skills (e.g. code-assist, deploy, testing)…"}),s.jsx("button",{type:"submit",className:"admin-refresh-btn",disabled:xa,children:xa?"Searching…":"🔎 Search"})]}),fl?s.jsx("div",{className:`admin-row-msg${fl.kind==="err"?" admin-row-msg-err":""}`,children:fl.text}):null,hr&&!xa?Pu.length>0?s.jsx("div",{className:"hub-session-list",children:Pu.map(j=>s.jsxs("div",{className:"hub-card",children:[s.jsxs("div",{className:"hub-card-top",children:[s.jsxs("div",{className:"hub-card-title",children:[s.jsx("span",{className:"hub-card-name",children:j.name}),s.jsxs("span",{className:"hub-card-id",children:["v",j.version," · ",j.sourceKind]})]}),s.jsx("button",{type:"button",className:"admin-refresh-btn",disabled:hl===j.name||h&&!Gt,onClick:()=>void Ru(j.name),children:hl===j.name?"Installing…":"⬇ Install"})]}),s.jsx("p",{className:"hub-card-desc",children:j.description}),s.jsxs("div",{className:"hub-card-tools",children:[s.jsx("span",{className:"hub-chip",children:j.author}),j.tags.slice(0,3).map(q=>s.jsx("span",{className:"hub-chip",children:q},q))]})]},`m-${j.name}`))}):s.jsxs("div",{className:"empty-state",children:['No skills match "',ul,'" — try a broader term, or add a registry to ',s.jsx("code",{children:"skills.registries"})," in config."]}):null]}):null]})}const g_={running:"⏳ running",done:"✅ done",failed:"❌ failed",cancelled:"⏹ cancelled",timeout:"⏰ timed out",error:"💥 error"};function y_(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";default:return"task-status-error"}}function kse(e){const t=[];let n="",r=null;for(const i of e.trim())r?i===r?r=null:n+=i:i==='"'||i==="'"?r=i:/\s/.test(i)?n&&(t.push(n),n=""):n+=i;return n&&t.push(n),t}function v_(e){return e===null?"—":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function Ese(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 _se(){const[e,t]=E.useState(null),[n,r]=E.useState(""),[i,a]=E.useState(300),[o,l]=E.useState(!1),[c,u]=E.useState(""),[d,f]=E.useState(null),[h,p]=E.useState([]),[g,m]=E.useState(!0),v=E.useRef(null),y=E.useRef(null),b=E.useCallback(async()=>{const N=await ee.listTasks();N&&p(N.tasks)},[]);E.useEffect(()=>{ee.fetchAdminAuthStatus().then(N=>{t(N?{configured:N.configured,authenticated:N.authenticated,role:N.role}:{configured:!1,authenticated:!1,role:null}),N!=null&&N.authenticated&&b()})},[b]),E.useEffect(()=>{var N,C;if(g&&(d==null?void 0:d.status)==="running")try{(C=(N=v.current)==null?void 0:N.scrollIntoView)==null||C.call(N,{block:"end"})}catch{}},[d==null?void 0:d.logs.length,d==null?void 0:d.status,g]),E.useEffect(()=>()=>{var N;return(N=y.current)==null?void 0:N.call(y)},[]);const x=E.useCallback((N,C)=>{var $;if(($=y.current)==null||$.call(y),f(N),u(""),!C)return;const T=ee.subscribeTask(N.id,{onLog:R=>f(L=>L&&L.id===N.id?{...L,logs:[...L.logs,R]}:L),onStatus:R=>f(L=>L&&L.id===N.id?{...L,status:R}:L)});y.current=T},[]),k=E.useCallback(async()=>{const N=kse(n);if(N.length===0){u("Type a command first — e.g. `eval run --task smoke-test` or `gateway status`.");return}l(!0),u("");const C=await ee.startTask(N,i*1e3);if(l(!1),!C.ok||!C.task){u(C.error||"Failed to start task.");return}r(""),b(),x(C.task,!0)},[n,i,x,b]),S=E.useCallback(async N=>{await ee.cancelTask(N)},[]),w=E.useCallback(async N=>{const C=await ee.getTask(N);C!=null&&C.task&&x(C.task,!1)},[x]),_=E.useCallback(()=>{var N;(N=y.current)==null||N.call(y),f(null)},[]);return e?e.authenticated?s.jsxs("div",{className:"panel",children:[s.jsx("h2",{className:"panel-title",children:"🚀 Command Console"}),s.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."}),s.jsxs("form",{className:"task-run-form",onSubmit:N=>{N.preventDefault(),k()},children:[s.jsx("input",{className:"admin-input task-cmd-input",placeholder:"eval run --task smoke-test · gateway status · skill list · memory stats",value:n,onChange:N=>r(N.target.value),autoComplete:"off",spellCheck:!1}),s.jsxs("select",{className:"admin-input task-timeout-select",title:"Task timeout",value:i,onChange:N=>a(Number(N.target.value)),children:[s.jsx("option",{value:60,children:"1 min"}),s.jsx("option",{value:300,children:"5 min"}),s.jsx("option",{value:600,children:"10 min"}),s.jsx("option",{value:1800,children:"30 min"})]}),s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:o||n.trim()==="",children:o?"⏳ Starting…":"▶ Run"})]}),c&&s.jsx("div",{className:"admin-error",children:c}),s.jsx("p",{className:"task-hint",children:"Long-running commands stream their output live. Runs are capped at the chosen timeout and can be cancelled."}),d&&s.jsxs("div",{className:"task-console-wrap",children:[s.jsxs("div",{className:"task-console-header",children:[s.jsx("code",{className:"task-console-cmd",children:d.command}),s.jsx("span",{className:`task-status ${y_(d.status)}`,children:g_[d.status]}),s.jsxs("span",{className:"task-meta",children:["exit ",d.exitCode??"—"," · ",v_(d.durationMs)]}),d.status==="running"&&s.jsx("button",{className:"admin-mini-btn task-cancel-btn",onClick:()=>void S(d.id),children:"⏹ Cancel"}),s.jsx("button",{className:"admin-mini-btn",onClick:_,children:"✕ Close"})]}),s.jsxs("div",{className:"task-console",children:[d.logs.map((N,C)=>s.jsx("div",{className:`task-line task-line-${N.stream}`,children:N.text},C)),d.logs.length===0&&d.status==="running"&&s.jsx("div",{className:"task-line task-line-system",children:"⏳ waiting for output…"}),s.jsx("div",{ref:v})]}),s.jsxs("label",{className:"task-autoscroll",children:[s.jsx("input",{type:"checkbox",checked:g,onChange:N=>m(N.target.checked)})," auto-scroll"]})]}),s.jsx("h3",{className:"task-history-title",children:"History"}),h.length===0?s.jsx("div",{className:"empty-state",children:"No tasks yet — run your first command above."}):s.jsx("div",{className:"admin-table-wrapper",children:s.jsxs("table",{className:"admin-table task-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Command"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Exit"}),s.jsx("th",{children:"Duration"}),s.jsx("th",{children:"When"})]})}),s.jsx("tbody",{children:h.map(N=>s.jsxs("tr",{className:(d==null?void 0:d.id)===N.id?"task-row-active":"",onClick:()=>void w(N.id),children:[s.jsx("td",{children:s.jsx("code",{children:N.command})}),s.jsx("td",{children:s.jsx("span",{className:`task-status ${y_(N.status)}`,children:g_[N.status]})}),s.jsx("td",{children:N.exitCode??"—"}),s.jsx("td",{children:v_(N.durationMs)}),s.jsx("td",{children:Ese(N.startedAt)})]},N.id))})]})})]}):s.jsxs("div",{className:"panel",children:[s.jsx("h2",{className:"panel-title",children:"🚀 Command Console"}),s.jsxs("div",{className:"empty-state",children:[s.jsxs("p",{children:[s.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)."]}),s.jsx("p",{children:e.configured?s.jsx(wy,{className:"admin-refresh-btn",to:"/admin",children:"🔐 Log in"}):s.jsx(wy,{className:"admin-refresh-btn",to:"/admin",children:"🔐 Create admin account"})})]})]}):s.jsxs("div",{className:"panel",children:[s.jsx("h2",{className:"panel-title",children:"🚀 Command Console"}),s.jsx("div",{className:"loading-state",children:"Loading…"})]})}function Nse(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const jse=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ase=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Tse={};function b_(e,t){return(Tse.jsx?Ase:jse).test(e)}const Cse=/[ \t\n\f\r]/g;function Ose(e){return typeof e=="object"?e.type==="text"?x_(e.value):!1:x_(e)}function x_(e){return e.replace(Cse,"")===""}class Nu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Nu.prototype.normal={};Nu.prototype.property={};Nu.prototype.space=void 0;function lM(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Nu(n,r,t)}function Kv(e){return e.toLowerCase()}class Bn{constructor(t,n){this.attribute=n,this.property=t}}Bn.prototype.attribute="";Bn.prototype.booleanish=!1;Bn.prototype.boolean=!1;Bn.prototype.commaOrSpaceSeparated=!1;Bn.prototype.commaSeparated=!1;Bn.prototype.defined=!1;Bn.prototype.mustUseProperty=!1;Bn.prototype.number=!1;Bn.prototype.overloadedBoolean=!1;Bn.prototype.property="";Bn.prototype.spaceSeparated=!1;Bn.prototype.space=void 0;let Pse=0;const Ce=ps(),Mt=ps(),Vv=ps(),ae=ps(),st=ps(),Ya=ps(),zn=ps();function ps(){return 2**++Pse}const Yv=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ce,booleanish:Mt,commaOrSpaceSeparated:zn,commaSeparated:Ya,number:ae,overloadedBoolean:Vv,spaceSeparated:st},Symbol.toStringTag,{value:"Module"})),ag=Object.keys(Yv);class p0 extends Bn{constructor(t,n,r,i){let a=-1;if(super(t,n),w_(this,"space",i),typeof r=="number")for(;++a<ag.length;){const o=ag[a];w_(this,ag[a],(r&Yv[o])===Yv[o])}}}p0.prototype.defined=!0;function w_(e,t,n){n&&(e[t]=n)}function ol(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new p0(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Kv(r)]=r,n[Kv(a.attribute)]=r}return new Nu(t,n,e.space)}const cM=ol({properties:{ariaActiveDescendant:null,ariaAtomic:Mt,ariaAutoComplete:null,ariaBusy:Mt,ariaChecked:Mt,ariaColCount:ae,ariaColIndex:ae,ariaColSpan:ae,ariaControls:st,ariaCurrent:null,ariaDescribedBy:st,ariaDetails:null,ariaDisabled:Mt,ariaDropEffect:st,ariaErrorMessage:null,ariaExpanded:Mt,ariaFlowTo:st,ariaGrabbed:Mt,ariaHasPopup:null,ariaHidden:Mt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:st,ariaLevel:ae,ariaLive:null,ariaModal:Mt,ariaMultiLine:Mt,ariaMultiSelectable:Mt,ariaOrientation:null,ariaOwns:st,ariaPlaceholder:null,ariaPosInSet:ae,ariaPressed:Mt,ariaReadOnly:Mt,ariaRelevant:null,ariaRequired:Mt,ariaRoleDescription:st,ariaRowCount:ae,ariaRowIndex:ae,ariaRowSpan:ae,ariaSelected:Mt,ariaSetSize:ae,ariaSort:null,ariaValueMax:ae,ariaValueMin:ae,ariaValueNow:ae,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function uM(e,t){return t in e?e[t]:t}function dM(e,t){return uM(e,t.toLowerCase())}const Mse=ol({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ya,acceptCharset:st,accessKey:st,action:null,allow:null,allowFullScreen:Ce,allowPaymentRequest:Ce,allowUserMedia:Ce,alpha:Ce,alt:null,as:null,async:Ce,autoCapitalize:null,autoComplete:st,autoFocus:Ce,autoPlay:Ce,blocking:st,capture:null,charSet:null,checked:Ce,cite:null,className:st,closedBy:null,colorSpace:null,cols:ae,colSpan:ae,command:null,commandFor:null,content:null,contentEditable:Mt,controls:Ce,controlsList:st,coords:ae|Ya,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ce,defer:Ce,dir:null,dirName:null,disabled:Ce,download:Vv,draggable:Mt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ce,formTarget:null,headers:st,height:ae,hidden:Vv,high:ae,href:null,hrefLang:null,htmlFor:st,httpEquiv:st,id:null,imageSizes:null,imageSrcSet:null,inert:Ce,inputMode:null,integrity:null,is:null,isMap:Ce,itemId:null,itemProp:st,itemRef:st,itemScope:Ce,itemType:st,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ce,low:ae,manifest:null,max:null,maxLength:ae,media:null,method:null,min:null,minLength:ae,multiple:Ce,muted:Ce,name:null,nonce:null,noModule:Ce,noValidate:Ce,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:Ce,optimum:ae,pattern:null,ping:st,placeholder:null,playsInline:Ce,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ce,referrerPolicy:null,rel:st,required:Ce,reversed:Ce,rows:ae,rowSpan:ae,sandbox:st,scope:null,scoped:Ce,seamless:Ce,selected:Ce,shadowRootClonable:Ce,shadowRootCustomElementRegistry:Ce,shadowRootDelegatesFocus:Ce,shadowRootMode:null,shadowRootSerializable:Ce,shape:null,size:ae,sizes:null,slot:null,span:ae,spellCheck:Mt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ae,step:null,style:null,tabIndex:ae,target:null,title:null,translate:null,type:null,typeMustMatch:Ce,useMap:null,value:Mt,width:ae,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:st,axis:null,background:null,bgColor:null,border:ae,borderColor:null,bottomMargin:ae,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ce,declare:Ce,event:null,face:null,frame:null,frameBorder:null,hSpace:ae,leftMargin:ae,link:null,longDesc:null,lowSrc:null,marginHeight:ae,marginWidth:ae,noResize:Ce,noHref:Ce,noShade:Ce,noWrap:Ce,object:null,profile:null,prompt:null,rev:null,rightMargin:ae,rules:null,scheme:null,scrolling:Mt,standby:null,summary:null,text:null,topMargin:ae,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ae,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ce,disablePictureInPicture:Ce,disableRemotePlayback:Ce,exportParts:Ya,part:st,prefix:null,property:null,results:ae,security:null,unselectable:null},space:"html",transform:dM}),Rse=ol({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:zn,accentHeight:ae,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ae,amplitude:ae,arabicForm:null,ascent:ae,attributeName:null,attributeType:null,azimuth:ae,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ae,by:null,calcMode:null,capHeight:ae,className:st,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:ae,diffuseConstant:ae,direction:null,display:null,dur:null,divisor:ae,dominantBaseline:null,download:Ce,dx:null,dy:null,edgeMode:null,editable:null,elevation:ae,enableBackground:null,end:null,event:null,exponent:ae,externalResourcesRequired:null,fill:null,fillOpacity:ae,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:Ya,g2:Ya,glyphName:Ya,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ae,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ae,horizOriginX:ae,horizOriginY:ae,id:null,ideographic:ae,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ae,k:ae,k1:ae,k2:ae,k3:ae,k4:ae,kernelMatrix:zn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ae,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:ae,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:ae,overlineThickness:ae,paintOrder:null,panose1:null,path:null,pathLength:ae,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:st,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ae,pointsAtY:ae,pointsAtZ:ae,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:zn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:zn,rev:zn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:zn,requiredFeatures:zn,requiredFonts:zn,requiredFormats:zn,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:ae,specularExponent:ae,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ae,strikethroughThickness:ae,string:null,stroke:null,strokeDashArray:zn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ae,strokeOpacity:ae,strokeWidth:null,style:null,surfaceScale:ae,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:zn,tabIndex:ae,tableValues:null,target:null,targetX:ae,targetY:ae,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:zn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ae,underlineThickness:ae,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ae,values:null,vAlphabetic:ae,vMathematical:ae,vectorEffect:null,vHanging:ae,vIdeographic:ae,version:null,vertAdvY:ae,vertOriginX:ae,vertOriginY:ae,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ae,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:uM}),fM=ol({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()}}),hM=ol({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:dM}),pM=ol({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Ise={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"},$se=/[A-Z]/g,S_=/-[a-z]/g,Lse=/^data[-\w.:]+$/i;function Dse(e,t){const n=Kv(t);let r=t,i=Bn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Lse.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(S_,zse);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!S_.test(a)){let o=a.replace($se,Bse);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=p0}return new i(r,t)}function Bse(e){return"-"+e.toLowerCase()}function zse(e){return e.charAt(1).toUpperCase()}const Fse=lM([cM,Mse,fM,hM,pM],"html"),m0=lM([cM,Rse,fM,hM,pM],"svg");function Use(e){return e.join(" ").trim()}var g0={},k_=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Wse=/\n/g,Hse=/^\s*/,Gse=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,qse=/^:\s*/,Kse=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Vse=/^[;\s]*/,Yse=/^\s+|\s+$/g,Xse=`
165
- `,E_="/",__="*",Ra="",Zse="comment",Qse="declaration";function Jse(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 i(g){var m=g.match(Wse);m&&(n+=m.length);var v=g.lastIndexOf(Xse);r=~v?g.length-v:r+g.length}function a(){var g={line:n,column:r};return function(m){return m.position=new o(g),u(),m}}function o(g){this.start=g,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function l(g){var m=new Error(t.source+":"+n+":"+r+": "+g);if(m.reason=g,m.filename=t.source,m.line=n,m.column=r,m.source=e,!t.silent)throw m}function c(g){var m=g.exec(e);if(m){var v=m[0];return i(v),e=e.slice(v.length),m}}function u(){c(Hse)}function d(g){var m;for(g=g||[];m=f();)m!==!1&&g.push(m);return g}function f(){var g=a();if(!(E_!=e.charAt(0)||__!=e.charAt(1))){for(var m=2;Ra!=e.charAt(m)&&(__!=e.charAt(m)||E_!=e.charAt(m+1));)++m;if(m+=2,Ra===e.charAt(m-1))return l("End of comment missing");var v=e.slice(2,m-2);return r+=2,i(v),e=e.slice(m),r+=2,g({type:Zse,comment:v})}}function h(){var g=a(),m=c(Gse);if(m){if(f(),!c(qse))return l("property missing ':'");var v=c(Kse),y=g({type:Qse,property:N_(m[0].replace(k_,Ra)),value:v?N_(v[0].replace(k_,Ra)):Ra});return c(Vse),y}}function p(){var g=[];d(g);for(var m;m=h();)m!==!1&&(g.push(m),d(g));return g}return u(),p()}function N_(e){return e?e.replace(Yse,Ra):Ra}var eoe=Jse,toe=Hi&&Hi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(g0,"__esModule",{value:!0});g0.default=roe;const noe=toe(eoe);function roe(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,noe.default)(e),i=typeof t=="function";return r.forEach(a=>{if(a.type!=="declaration")return;const{property:o,value:l}=a;i?t(o,l,a):l&&(n=n||{},n[o]=l)}),n}var Mp={};Object.defineProperty(Mp,"__esModule",{value:!0});Mp.camelCase=void 0;var ioe=/^--[a-zA-Z0-9_-]+$/,aoe=/-([a-z])/g,soe=/^[^-]+$/,ooe=/^-(webkit|moz|ms|o|khtml)-/,loe=/^-(ms)-/,coe=function(e){return!e||soe.test(e)||ioe.test(e)},uoe=function(e,t){return t.toUpperCase()},j_=function(e,t){return"".concat(t,"-")},doe=function(e,t){return t===void 0&&(t={}),coe(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(loe,j_):e=e.replace(ooe,j_),e.replace(aoe,uoe))};Mp.camelCase=doe;var foe=Hi&&Hi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},hoe=foe(g0),poe=Mp;function Xv(e,t){var n={};return!e||typeof e!="string"||(0,hoe.default)(e,function(r,i){r&&i&&(n[(0,poe.camelCase)(r,t)]=i)}),n}Xv.default=Xv;var moe=Xv;const goe=Xe(moe),mM=gM("end"),y0=gM("start");function gM(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 yoe(e){const t=y0(e),n=mM(e);if(t&&n)return{start:t,end:n}}function ac(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?A_(e.position):"start"in e||"end"in e?A_(e):"line"in e||"column"in e?Zv(e):""}function Zv(e){return T_(e&&e.line)+":"+T_(e&&e.column)}function A_(e){return Zv(e&&e.start)+"-"+Zv(e&&e.end)}function T_(e){return e&&typeof e=="number"?e:1}class bn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(o=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?a.ruleId=r:(a.source=r.slice(0,c),a.ruleId=r.slice(c+1))}if(!a.place&&a.ancestors&&a.ancestors){const c=a.ancestors[a.ancestors.length-1];c&&(a.place=c.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=ac(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}bn.prototype.file="";bn.prototype.name="";bn.prototype.reason="";bn.prototype.message="";bn.prototype.stack="";bn.prototype.column=void 0;bn.prototype.line=void 0;bn.prototype.ancestors=void 0;bn.prototype.cause=void 0;bn.prototype.fatal=void 0;bn.prototype.place=void 0;bn.prototype.ruleId=void 0;bn.prototype.source=void 0;const v0={}.hasOwnProperty,voe=new Map,boe=/[A-Z]/g,xoe=new Set(["table","tbody","thead","tfoot","tr"]),woe=new Set(["td","th"]),yM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Soe(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=Coe(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=Toe(n,t.jsx,t.jsxs)}const i={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"?m0:Fse,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=vM(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function vM(e,t,n){if(t.type==="element")return koe(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Eoe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Noe(e,t,n);if(t.type==="mdxjsEsm")return _oe(e,t);if(t.type==="root")return joe(e,t,n);if(t.type==="text")return Aoe(e,t)}function koe(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=m0,e.schema=i),e.ancestors.push(t);const a=xM(e,t.tagName,!1),o=Ooe(e,t);let l=x0(e,t);return xoe.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!Ose(c):!0})),bM(e,o,a,t),b0(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Eoe(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)}cu(e,t.position)}function _oe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);cu(e,t.position)}function Noe(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=m0,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:xM(e,t.name,!0),o=Poe(e,t),l=x0(e,t);return bM(e,o,a,t),b0(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function joe(e,t,n){const r={};return b0(r,x0(e,t)),e.create(t,e.Fragment,r,n)}function Aoe(e,t){return t.value}function bM(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function b0(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Toe(e,t,n){return r;function r(i,a,o,l){const u=Array.isArray(o.children)?n:t;return l?u(a,o,l):u(a,o)}}function Coe(e,t){return n;function n(r,i,a,o){const l=Array.isArray(a.children),c=y0(r);return t(i,a,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function Ooe(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&v0.call(t.properties,i)){const a=Moe(e,i,t.properties[i]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&woe.has(t.tagName)?r=l:n[o]=l}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Poe(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else cu(e,t.position);else{const i=r.name;let a;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,a=e.evaluater.evaluateExpression(l.expression)}else cu(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function x0(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:voe;for(;++r<t.children.length;){const a=t.children[r];let o;if(e.passKeys){const c=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(c){const u=i.get(c)||0;o=c+"-"+u,i.set(c,u+1)}}const l=vM(e,a,o);l!==void 0&&n.push(l)}return n}function Moe(e,t,n){const r=Dse(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Nse(n):Use(n)),r.property==="style"){let i=typeof n=="object"?n:Roe(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Ioe(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Ise[r.property]||r.property:r.attribute,n]}}function Roe(e,t){try{return goe(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new bn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=yM+"#cannot-parse-style-attribute",i}}function xM(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,o;for(;++a<i.length;){const l=b_(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};o=o?{type:"MemberExpression",object:o,property:l,computed:!!(a&&l.type==="Literal"),optional:!1}:l}r=o}else r=b_(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return v0.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);cu(e)}function cu(e,t){const n=new bn("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=yM+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Ioe(e){const t={};let n;for(n in e)v0.call(e,n)&&(t[$oe(n)]=e[n]);return t}function $oe(e){let t=e.replace(boe,Loe);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Loe(e){return"-"+e.toLowerCase()}const sg={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"]},Doe={};function w0(e,t){const n=Doe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return wM(e,r,i)}function wM(e,t,n){if(Boe(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 C_(e.children,t,n)}return Array.isArray(e)?C_(e,t,n):""}function C_(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=wM(e[i],t,n);return r.join("")}function Boe(e){return!!(e&&typeof e=="object")}const O_=document.createElement("i");function S0(e){const t="&"+e+";";O_.innerHTML=t;const n=O_.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Kn(e,t,n,r){const i=e.length;let a=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i: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);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function rr(e,t){return e.length>0?(Kn(e,e.length,0,t),e):t}const P_={}.hasOwnProperty;function SM(e){const t={};let n=-1;for(;++n<e.length;)zoe(t,e[n]);return t}function zoe(e,t){let n;for(n in t){const i=(P_.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){P_.call(i,o)||(i[o]=[]);const l=a[o];Foe(i[o],Array.isArray(l)?l:l?[l]:[])}}}function Foe(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Kn(e,0,0,r)}function kM(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 jr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Sn=ba(/[A-Za-z]/),yn=ba(/[\dA-Za-z]/),Uoe=ba(/[#-'*+\--9=?A-Z^-~]/);function vh(e){return e!==null&&(e<32||e===127)}const Qv=ba(/\d/),Woe=ba(/[\dA-Fa-f]/),Hoe=ba(/[!-/:-@[-`{-~]/);function je(e){return e!==null&&e<-2}function lt(e){return e!==null&&(e<0||e===32)}function Le(e){return e===-2||e===-1||e===32}const Rp=ba(new RegExp("\\p{P}|\\p{S}","u")),os=ba(/\s/);function ba(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ll(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&yn(e.charCodeAt(n+1))&&yn(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(o=String.fromCharCode(a,l),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Ue(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(c){return Le(c)?(e.enter(n),l(c)):t(c)}function l(c){return Le(c)&&a++<i?(e.consume(c),l):(e.exit(n),t(c))}}const Goe={tokenize:qoe};function qoe(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);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 i(l){return e.enter("paragraph"),a(l)}function a(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 je(l)?(e.consume(l),e.exit("chunkText"),a):(e.consume(l),o)}}const Koe={tokenize:Voe},M_={tokenize:Yoe};function Voe(e){const t=this,n=[];let r=0,i,a,o;return l;function l(x){if(r<n.length){const k=n[r];return t.containerState=k[1],e.attempt(k[0].continuation,c,u)(x)}return u(x)}function c(x){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&b();const k=t.events.length;let S=k,w;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){w=t.events[S][1].end;break}y(r);let _=k;for(;_<t.events.length;)t.events[_][1].end={...w},_++;return Kn(t.events,S+1,0,t.events.slice(k)),t.events.length=_,u(x)}return l(x)}function u(x){if(r===n.length){if(!i)return h(x);if(i.currentConstruct&&i.currentConstruct.concrete)return g(x);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(M_,d,f)(x)}function d(x){return i&&b(),y(r),h(x)}function f(x){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,g(x)}function h(x){return t.containerState={},e.attempt(M_,p,g)(x)}function p(x){return r++,n.push([t.currentConstruct,t.containerState]),h(x)}function g(x){if(x===null){i&&b(),y(0),e.consume(x);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),m(x)}function m(x){if(x===null){v(e.exit("chunkFlow"),!0),y(0),e.consume(x);return}return je(x)?(e.consume(x),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(x),m)}function v(x,k){const S=t.sliceStream(x);if(k&&S.push(null),x.previous=a,a&&(a.next=x),a=x,i.defineSkip(x.start),i.write(S),t.parser.lazy[x.start.line]){let w=i.events.length;for(;w--;)if(i.events[w][1].start.offset<o&&(!i.events[w][1].end||i.events[w][1].end.offset>o))return;const _=t.events.length;let N=_,C,T;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(C){T=t.events[N][1].end;break}C=!0}for(y(r),w=_;w<t.events.length;)t.events[w][1].end={...T},w++;Kn(t.events,N+1,0,t.events.slice(_)),t.events.length=w}}function y(x){let k=n.length;for(;k-- >x;){const S=n[k];t.containerState=S[1],S[0].exit.call(t,e)}n.length=x}function b(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Yoe(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 Fo(e){if(e===null||lt(e)||os(e))return 1;if(Rp(e))return 2}function Ip(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Jv={name:"attention",resolveAll:Xoe,tokenize:Zoe};function Xoe(e,t){let n=-1,r,i,a,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};R_(f,-c),R_(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},a={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={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=rr(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=rr(u,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),u=rr(u,Ip(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=rr(u,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=rr(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Kn(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 Zoe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Fo(r);let a;return o;function o(c){return a=c,e.enter("attentionSequence"),l(c)}function l(c){if(c===a)return e.consume(c),l;const u=e.exit("attentionSequence"),d=Fo(c),f=!d||d===2&&i||n.includes(c),h=!i||i===2&&d||n.includes(r);return u._open=!!(a===42?f:f&&(i||!h)),u._close=!!(a===42?h:h&&(d||!f)),t(c)}}function R_(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Qoe={name:"autolink",tokenize:Joe};function Joe(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(p){return Sn(p)?(e.consume(p),o):p===64?n(p):u(p)}function o(p){return p===43||p===45||p===46||yn(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||yn(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||vh(p)?n(p):(e.consume(p),c)}function u(p){return p===64?(e.consume(p),d):Uoe(p)?(e.consume(p),u):n(p)}function d(p){return yn(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||yn(p))&&r++<63){const g=p===45?h:f;return e.consume(p),g}return n(p)}}const ju={partial:!0,tokenize:ele};function ele(e,t,n){return r;function r(a){return Le(a)?Ue(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||je(a)?t(a):n(a)}}const EM={continuation:{tokenize:nle},exit:rle,name:"blockQuote",tokenize:tle};function tle(e,t,n){const r=this;return i;function i(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"),a}return n(o)}function a(o){return Le(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function nle(e,t,n){const r=this;return i;function i(o){return Le(o)?Ue(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(EM,t,n)(o)}}function rle(e){e.exit("blockQuote")}const _M={name:"characterEscape",tokenize:ile};function ile(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return Hoe(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const NM={name:"characterReference",tokenize:ale};function ale(e,t,n){const r=this;let i=0,a,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"),a=31,o=yn,d(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=Woe,d):(e.enter("characterReferenceValue"),a=7,o=Qv,d(f))}function d(f){if(f===59&&i){const h=e.exit("characterReferenceValue");return o===yn&&!S0(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(f)&&i++<a?(e.consume(f),d):n(f)}}const I_={partial:!0,tokenize:ole},$_={concrete:!0,name:"codeFenced",tokenize:sle};function sle(e,t,n){const r=this,i={partial:!0,tokenize:S};let a=0,o=0,l;return c;function c(w){return u(w)}function u(w){const _=r.events[r.events.length-1];return a=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,l=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(w)}function d(w){return w===l?(o++,e.consume(w),d):o<3?n(w):(e.exit("codeFencedFenceSequence"),Le(w)?Ue(e,f,"whitespace")(w):f(w))}function f(w){return w===null||je(w)?(e.exit("codeFencedFence"),r.interrupt?t(w):e.check(I_,m,k)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(w))}function h(w){return w===null||je(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(w)):Le(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ue(e,p,"whitespace")(w)):w===96&&w===l?n(w):(e.consume(w),h)}function p(w){return w===null||je(w)?f(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===null||je(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(w)):w===96&&w===l?n(w):(e.consume(w),g)}function m(w){return e.attempt(i,k,v)(w)}function v(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),y}function y(w){return a>0&&Le(w)?Ue(e,b,"linePrefix",a+1)(w):b(w)}function b(w){return w===null||je(w)?e.check(I_,m,k)(w):(e.enter("codeFlowValue"),x(w))}function x(w){return w===null||je(w)?(e.exit("codeFlowValue"),b(w)):(e.consume(w),x)}function k(w){return e.exit("codeFenced"),t(w)}function S(w,_,N){let C=0;return T;function T(z){return w.enter("lineEnding"),w.consume(z),w.exit("lineEnding"),$}function $(z){return w.enter("codeFencedFence"),Le(z)?Ue(w,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):R(z)}function R(z){return z===l?(w.enter("codeFencedFenceSequence"),L(z)):N(z)}function L(z){return z===l?(C++,w.consume(z),L):C>=o?(w.exit("codeFencedFenceSequence"),Le(z)?Ue(w,I,"whitespace")(z):I(z)):N(z)}function I(z){return z===null||je(z)?(w.exit("codeFencedFence"),_(z)):N(z)}}}function ole(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const og={name:"codeIndented",tokenize:cle},lle={partial:!0,tokenize:ule};function cle(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),Ue(e,a,"linePrefix",5)(u)}function a(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):je(u)?e.attempt(lle,o,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||je(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function ule(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):je(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Ue(e,a,"linePrefix",5)(o)}function a(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):je(o)?i(o):n(o)}}const dle={name:"codeText",previous:hle,resolve:fle,tokenize:ple};function fle(e){let t=e.length-4,n=3,r,i;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;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function hle(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ple(e,t,n){let r=0,i,a;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?(a=e.enter("codeTextSequence"),i=0,d(f)):je(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||je(f)?(e.exit("codeTextData"),c(f)):(e.consume(f),u)}function d(f){return f===96?(e.consume(f),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(a.type="codeTextData",u(f))}}class mle{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 i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ll(this.left,r),a.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),Ll(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ll(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);Ll(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ll(this.left,n.reverse())}}}function Ll(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 jM(e){const t={};let n=-1,r,i,a,o,l,c,u;const d=new mle(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,a=0,a<c.length&&c[a][1].type==="lineEndingBlank"&&(a+=2),a<c.length&&c[a][1].type==="content"))for(;++a<c.length&&c[a][1].type!=="content";)c[a][1].type==="chunkText"&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,gle(d,n)),n=t[n],u=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=d.get(a),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=a);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},l=d.slice(i,n),l.unshift(r),d.splice(i,n-i+1,l))}}return Kn(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function gle(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];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,g=0,m=0;const v=[m];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),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&&(m=h+1,v.push(m),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):v.pop(),h=v.length;h--;){const y=l.slice(v[h],v[h+1]),b=a.pop();c.push([b,b+y.length-1]),e.splice(b,2,y)}for(c.reverse(),h=-1;++h<c.length;)u[g+c[h][0]]=g+c[h][1],g+=c[h][1]-c[h][0]-1;return u}const yle={resolve:ble,tokenize:xle},vle={partial:!0,tokenize:wle};function ble(e){return jM(e),e}function xle(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?a(l):je(l)?e.check(vle,o,a)(l):(e.consume(l),i)}function a(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,i}}function wle(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Ue(e,a,"linePrefix")}function a(o){if(o===null||je(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 AM(e,t,n,r,i,a,o,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(y){return y===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(y),e.exit(a),h):y===null||y===32||y===41||vh(y)?n(y):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),m(y))}function h(y){return y===62?(e.enter(a),e.consume(y),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(l),h(y)):y===null||y===60||je(y)?n(y):(e.consume(y),y===92?g:p)}function g(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function m(y){return!d&&(y===null||y===41||lt(y))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(y)):d<u&&y===40?(e.consume(y),d++,m):y===41?(e.consume(y),d--,m):y===null||y===32||y===40||vh(y)?n(y):(e.consume(y),y===92?v:m)}function v(y){return y===40||y===41||y===92?(e.consume(y),m):m(y)}}function TM(e,t,n,r,i,a){const o=this;let l=0,c;return u;function u(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(a),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(a),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):je(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||je(p)||l++>999?(e.exit("chunkString"),d(p)):(e.consume(p),c||(c=!Le(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),l++,f):f(p)}}function CM(e,t,n,r,i,a){let o;return l;function l(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),o=h===40?41:h,c):n(h)}function c(h){return h===o?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(a),u(h))}function u(h){return h===o?(e.exit(a),c(o)):h===null?n(h):je(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||je(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 sc(e,t){let n;return r;function r(i){return je(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Le(i)?Ue(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Sle={name:"definition",tokenize:Ele},kle={partial:!0,tokenize:_le};function Ele(e,t,n){const r=this;let i;return a;function a(p){return e.enter("definition"),o(p)}function o(p){return TM.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return i=jr(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 lt(p)?sc(e,u)(p):u(p)}function u(p){return AM(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(kle,f,f)(p)}function f(p){return Le(p)?Ue(e,h,"whitespace")(p):h(p)}function h(p){return p===null||je(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function _le(e,t,n){return r;function r(l){return lt(l)?sc(e,i)(l):n(l)}function i(l){return CM(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return Le(l)?Ue(e,o,"whitespace")(l):o(l)}function o(l){return l===null||je(l)?t(l):n(l)}}const Nle={name:"hardBreakEscape",tokenize:jle};function jle(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return je(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const Ale={name:"headingAtx",resolve:Tle,tokenize:Cle};function Tle(e,t){let n=e.length-2,r=3,i,a;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&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Kn(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function Cle(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),a(d)}function a(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&r++<6?(e.consume(d),o):d===null||lt(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||je(d)?(e.exit("atxHeading"),t(d)):Le(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||lt(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const Ole=["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"],L_=["pre","script","style","textarea"],Ple={concrete:!0,name:"htmlFlow",resolveTo:Ile,tokenize:$le},Mle={partial:!0,tokenize:Dle},Rle={partial:!0,tokenize:Lle};function Ile(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 $le(e,t,n){const r=this;let i,a,o,l,c;return u;function u(M){return d(M)}function d(M){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(M),f}function f(M){return M===33?(e.consume(M),h):M===47?(e.consume(M),a=!0,m):M===63?(e.consume(M),i=3,r.interrupt?t:A):Sn(M)?(e.consume(M),o=String.fromCharCode(M),v):n(M)}function h(M){return M===45?(e.consume(M),i=2,p):M===91?(e.consume(M),i=5,l=0,g):Sn(M)?(e.consume(M),i=4,r.interrupt?t:A):n(M)}function p(M){return M===45?(e.consume(M),r.interrupt?t:A):n(M)}function g(M){const le="CDATA[";return M===le.charCodeAt(l++)?(e.consume(M),l===le.length?r.interrupt?t:R:g):n(M)}function m(M){return Sn(M)?(e.consume(M),o=String.fromCharCode(M),v):n(M)}function v(M){if(M===null||M===47||M===62||lt(M)){const le=M===47,be=o.toLowerCase();return!le&&!a&&L_.includes(be)?(i=1,r.interrupt?t(M):R(M)):Ole.includes(o.toLowerCase())?(i=6,le?(e.consume(M),y):r.interrupt?t(M):R(M)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(M):a?b(M):x(M))}return M===45||yn(M)?(e.consume(M),o+=String.fromCharCode(M),v):n(M)}function y(M){return M===62?(e.consume(M),r.interrupt?t:R):n(M)}function b(M){return Le(M)?(e.consume(M),b):T(M)}function x(M){return M===47?(e.consume(M),T):M===58||M===95||Sn(M)?(e.consume(M),k):Le(M)?(e.consume(M),x):T(M)}function k(M){return M===45||M===46||M===58||M===95||yn(M)?(e.consume(M),k):S(M)}function S(M){return M===61?(e.consume(M),w):Le(M)?(e.consume(M),S):x(M)}function w(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),c=M,_):Le(M)?(e.consume(M),w):N(M)}function _(M){return M===c?(e.consume(M),c=null,C):M===null||je(M)?n(M):(e.consume(M),_)}function N(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||lt(M)?S(M):(e.consume(M),N)}function C(M){return M===47||M===62||Le(M)?x(M):n(M)}function T(M){return M===62?(e.consume(M),$):n(M)}function $(M){return M===null||je(M)?R(M):Le(M)?(e.consume(M),$):n(M)}function R(M){return M===45&&i===2?(e.consume(M),D):M===60&&i===1?(e.consume(M),F):M===62&&i===4?(e.consume(M),Y):M===63&&i===3?(e.consume(M),A):M===93&&i===5?(e.consume(M),P):je(M)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Mle,K,L)(M)):M===null||je(M)?(e.exit("htmlFlowData"),L(M)):(e.consume(M),R)}function L(M){return e.check(Rle,I,K)(M)}function I(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),z}function z(M){return M===null||je(M)?L(M):(e.enter("htmlFlowData"),R(M))}function D(M){return M===45?(e.consume(M),A):R(M)}function F(M){return M===47?(e.consume(M),o="",O):R(M)}function O(M){if(M===62){const le=o.toLowerCase();return L_.includes(le)?(e.consume(M),Y):R(M)}return Sn(M)&&o.length<8?(e.consume(M),o+=String.fromCharCode(M),O):R(M)}function P(M){return M===93?(e.consume(M),A):R(M)}function A(M){return M===62?(e.consume(M),Y):M===45&&i===2?(e.consume(M),A):R(M)}function Y(M){return M===null||je(M)?(e.exit("htmlFlowData"),K(M)):(e.consume(M),Y)}function K(M){return e.exit("htmlFlow"),t(M)}}function Lle(e,t,n){const r=this;return i;function i(o){return je(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function Dle(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(ju,t,n)}}const Ble={name:"htmlText",tokenize:zle};function zle(e,t,n){const r=this;let i,a,o;return l;function l(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),c}function c(A){return A===33?(e.consume(A),u):A===47?(e.consume(A),S):A===63?(e.consume(A),x):Sn(A)?(e.consume(A),N):n(A)}function u(A){return A===45?(e.consume(A),d):A===91?(e.consume(A),a=0,g):Sn(A)?(e.consume(A),b):n(A)}function d(A){return A===45?(e.consume(A),p):n(A)}function f(A){return A===null?n(A):A===45?(e.consume(A),h):je(A)?(o=f,F(A)):(e.consume(A),f)}function h(A){return A===45?(e.consume(A),p):f(A)}function p(A){return A===62?D(A):A===45?h(A):f(A)}function g(A){const Y="CDATA[";return A===Y.charCodeAt(a++)?(e.consume(A),a===Y.length?m:g):n(A)}function m(A){return A===null?n(A):A===93?(e.consume(A),v):je(A)?(o=m,F(A)):(e.consume(A),m)}function v(A){return A===93?(e.consume(A),y):m(A)}function y(A){return A===62?D(A):A===93?(e.consume(A),y):m(A)}function b(A){return A===null||A===62?D(A):je(A)?(o=b,F(A)):(e.consume(A),b)}function x(A){return A===null?n(A):A===63?(e.consume(A),k):je(A)?(o=x,F(A)):(e.consume(A),x)}function k(A){return A===62?D(A):x(A)}function S(A){return Sn(A)?(e.consume(A),w):n(A)}function w(A){return A===45||yn(A)?(e.consume(A),w):_(A)}function _(A){return je(A)?(o=_,F(A)):Le(A)?(e.consume(A),_):D(A)}function N(A){return A===45||yn(A)?(e.consume(A),N):A===47||A===62||lt(A)?C(A):n(A)}function C(A){return A===47?(e.consume(A),D):A===58||A===95||Sn(A)?(e.consume(A),T):je(A)?(o=C,F(A)):Le(A)?(e.consume(A),C):D(A)}function T(A){return A===45||A===46||A===58||A===95||yn(A)?(e.consume(A),T):$(A)}function $(A){return A===61?(e.consume(A),R):je(A)?(o=$,F(A)):Le(A)?(e.consume(A),$):C(A)}function R(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),i=A,L):je(A)?(o=R,F(A)):Le(A)?(e.consume(A),R):(e.consume(A),I)}function L(A){return A===i?(e.consume(A),i=void 0,z):A===null?n(A):je(A)?(o=L,F(A)):(e.consume(A),L)}function I(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||lt(A)?C(A):(e.consume(A),I)}function z(A){return A===47||A===62||lt(A)?C(A):n(A)}function D(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function F(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),O}function O(A){return Le(A)?Ue(e,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):P(A)}function P(A){return e.enter("htmlTextData"),o(A)}}const k0={name:"labelEnd",resolveAll:Hle,resolveTo:Gle,tokenize:qle},Fle={tokenize:Kle},Ule={tokenize:Vle},Wle={tokenize:Yle};function Hle(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 i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Kn(e,0,e.length,n),e}function Gle(e,t){let n=e.length,r=0,i,a,o,l;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const c={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[a][1].start},end:{...e[o][1].end}},d={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return l=[["enter",c,t],["enter",u,t]],l=rr(l,e.slice(a+1,a+r+3)),l=rr(l,[["enter",d,t]]),l=rr(l,Ip(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),l=rr(l,[["exit",d,t],e[o-2],e[o-1],["exit",u,t]]),l=rr(l,e.slice(o+1)),l=rr(l,[["exit",c,t]]),Kn(e,a,e.length,l),e}function qle(e,t,n){const r=this;let i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return l;function l(h){return a?a._inactive?f(h):(o=r.parser.defined.includes(jr(r.sliceSerialize({start:a.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(Fle,d,o?d:f)(h):h===91?e.attempt(Ule,d,o?u:f)(h):o?d(h):f(h)}function u(h){return e.attempt(Wle,d,f)(h)}function d(h){return t(h)}function f(h){return a._balanced=!0,n(h)}}function Kle(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return lt(f)?sc(e,a)(f):a(f)}function a(f){return f===41?d(f):AM(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return lt(f)?sc(e,c)(f):d(f)}function l(f){return n(f)}function c(f){return f===34||f===39||f===40?CM(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function u(f){return lt(f)?sc(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 Vle(e,t,n){const r=this;return i;function i(l){return TM.call(r,e,a,o,"reference","referenceMarker","referenceString")(l)}function a(l){return r.parser.defined.includes(jr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function o(l){return n(l)}}function Yle(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const Xle={name:"labelStartImage",resolveAll:k0.resolveAll,tokenize:Zle};function Zle(e,t,n){const r=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),a}function a(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 Qle={name:"labelStartLink",resolveAll:k0.resolveAll,tokenize:Jle};function Jle(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const lg={name:"lineEnding",tokenize:ece};function ece(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ue(e,t,"linePrefix")}}const Ud={name:"thematicBreak",tokenize:tce};function tce(e,t,n){let r=0,i;return a;function a(u){return e.enter("thematicBreak"),o(u)}function o(u){return i=u,l(u)}function l(u){return u===i?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||je(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===i?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),Le(u)?Ue(e,l,"whitespace")(u):l(u))}}const On={continuation:{tokenize:ace},exit:oce,name:"list",tokenize:ice},nce={partial:!0,tokenize:lce},rce={partial:!0,tokenize:sce};function ice(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return l;function l(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Qv(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Ud,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 Qv(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(ju,r.interrupt?n:d,e.attempt(nce,h,f))}function d(p){return r.containerState.initialBlankLine=!0,a++,h(p)}function f(p){return Le(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function ace(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ju,i,a);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ue(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!Le(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(rce,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ue(e,e.attempt(On,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function sce(e,t,n){const r=this;return Ue(e,i,"listItemIndent",r.containerState.size+1);function i(a){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(a):n(a)}}function oce(e){e.exit(this.containerState.type)}function lce(e,t,n){const r=this;return Ue(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const o=r.events[r.events.length-1];return!Le(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const D_={name:"setextUnderline",resolveTo:cce,tokenize:uce};function cce(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function uce(e,t,n){const r=this;let i;return a;function a(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"),i=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===i?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Le(u)?Ue(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||je(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const dce={tokenize:fce};function fce(e){const t=this,n=e.attempt(ju,r,e.attempt(this.parser.constructs.flowInitial,i,Ue(e,e.attempt(this.parser.constructs.flow,i,e.attempt(yle,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const hce={resolveAll:PM()},pce=OM("string"),mce=OM("text");function OM(e){return{resolveAll:PM(e==="text"?gce:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,o,l);return o;function o(d){return u(d)?a(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"),a(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const f=i[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 PM(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function gce(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],i=t.sliceStream(r);let a=i.length,o=-1,l=0,c;for(;a--;){const u=i[a];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){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const u={type:n===e.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,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 yce={42:On,43:On,45:On,48:On,49:On,50:On,51:On,52:On,53:On,54:On,55:On,56:On,57:On,62:EM},vce={91:Sle},bce={[-2]:og,[-1]:og,32:og},xce={35:Ale,42:Ud,45:[D_,Ud],60:Ple,61:D_,95:Ud,96:$_,126:$_},wce={38:NM,92:_M},Sce={[-5]:lg,[-4]:lg,[-3]:lg,33:Xle,38:NM,42:Jv,60:[Qoe,Ble],91:Qle,92:[Nle,_M],93:k0,95:Jv,96:dle},kce={null:[Jv,hce]},Ece={null:[42,95]},_ce={null:[]},Nce=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Ece,contentInitial:vce,disable:_ce,document:yce,flow:xce,flowInitial:bce,insideSpan:kce,string:wce,text:Sce},Symbol.toStringTag,{value:"Module"}));function jce(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 i={},a=[];let o=[],l=[];const c={attempt:_(S),check:_(w),consume:b,enter:x,exit:k,interrupt:_(w,{interrupt:!0})},u={code:null,containerState:{},defineSkip:m,events:[],now:g,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:f};let d=t.tokenize.call(u,c);return t.resolveAll&&a.push(t),u;function f($){return o=rr(o,$),v(),o[o.length-1]!==null?[]:(N(t,0),u.events=Ip(a,u.events,u),u.events)}function h($,R){return Tce(p($),R)}function p($){return Ace(o,$)}function g(){const{_bufferIndex:$,_index:R,line:L,column:I,offset:z}=r;return{_bufferIndex:$,_index:R,line:L,column:I,offset:z}}function m($){i[$.line]=$.column,T()}function v(){let $;for(;r._index<o.length;){const R=o[r._index];if(typeof R=="string")for($=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===$&&r._bufferIndex<R.length;)y(R.charCodeAt(r._bufferIndex));else y(R)}}function y($){d=d($)}function b($){je($)?(r.line++,r.column=1,r.offset+=$===-3?2:1,T()):$!==-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=$}function x($,R){const L=R||{};return L.type=$,L.start=g(),u.events.push(["enter",L,u]),l.push(L),L}function k($){const R=l.pop();return R.end=g(),u.events.push(["exit",R,u]),R}function S($,R){N($,R.from)}function w($,R){R.restore()}function _($,R){return L;function L(I,z,D){let F,O,P,A;return Array.isArray(I)?K(I):"tokenize"in I?K([I]):Y(I);function Y(me){return Pe;function Pe(H){const X=H!==null&&me[H],oe=H!==null&&me.null,ce=[...Array.isArray(X)?X:X?[X]:[],...Array.isArray(oe)?oe:oe?[oe]:[]];return K(ce)(H)}}function K(me){return F=me,O=0,me.length===0?D:M(me[O])}function M(me){return Pe;function Pe(H){return A=C(),P=me,me.partial||(u.currentConstruct=me),me.name&&u.parser.constructs.disable.null.includes(me.name)?be():me.tokenize.call(R?Object.assign(Object.create(u),R):u,c,le,be)(H)}}function le(me){return $(P,A),z}function be(me){return A.restore(),++O<F.length?M(F[O]):D}}}function N($,R){$.resolveAll&&!a.includes($)&&a.push($),$.resolve&&Kn(u.events,R,u.events.length-R,$.resolve(u.events.slice(R),u)),$.resolveTo&&(u.events=$.resolveTo(u.events,u))}function C(){const $=g(),R=u.previous,L=u.currentConstruct,I=u.events.length,z=Array.from(l);return{from:I,restore:D};function D(){r=$,u.previous=R,u.currentConstruct=L,u.events.length=I,l=z,T()}}function T(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ace(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Tce(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let o;if(typeof a=="string")o=a;else switch(a){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&&i)continue;o=" ";break}default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join("")}function Cce(e){const r={constructs:SM([Nce,...(e||{}).extensions||[]]),content:i(Goe),defined:[],document:i(Koe),flow:i(dce),lazy:{},string:i(pce),text:i(mce)};return r;function i(a){return o;function o(l){return jce(r,a,l)}}}function Oce(e){for(;!jM(e););return e}const B_=/[\0\t\n\r]/g;function Pce(){let e=1,t="",n=!0,r;return i;function i(a,o,l){const c=[];let u,d,f,h,p;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),f=0,t="",n&&(a.charCodeAt(0)===65279&&f++,n=void 0);f<a.length;){if(B_.lastIndex=f,u=B_.exec(a),h=u&&u.index!==void 0?u.index:a.length,p=a.charCodeAt(h),!u){t=a.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(a.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 Mce=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Rce(e){return e.replace(Mce,Ice)}function Ice(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return kM(n.slice(a?2:1),a?16:10)}return S0(n)||e}const MM={}.hasOwnProperty;function $ce(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Lce(n)(Oce(Cce(n).document().write(Pce()(e,t,!0))))}function Lce(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Ct),autolinkProtocol:C,autolinkEmail:C,atxHeading:a(Ne),blockQuote:a(oe),characterEscape:C,characterReference:C,codeFenced:a(ce),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ce,o),codeText:a(Z,o),codeTextData:C,data:C,codeFlowValue:C,definition:a(_e),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(we),hardBreakEscape:a(ge),hardBreakTrailing:a(ge),htmlFlow:a(Be,o),htmlFlowData:C,htmlText:a(Be,o),htmlTextData:C,image:a(pe),label:o,link:a(Ct),listItem:a(Oe),listItemValue:h,listOrdered:a(We,f),listUnordered:a(We),paragraph:a(Ze),reference:M,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(Ne),strong:a(Me),thematicBreak:a($t)},exit:{atxHeading:c(),atxHeadingSequence:S,autolink:c(),autolinkEmail:X,autolinkProtocol:H,blockQuote:c(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:be,characterReferenceMarkerNumeric:be,characterReferenceValue:me,characterReference:Pe,codeFenced:c(v),codeFencedFence:m,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:T,codeIndented:c(y),codeText:c(z),codeTextData:T,data:T,definition:c(),definitionDestinationString:k,definitionLabelString:b,definitionTitleString:x,emphasis:c(),hardBreakEscape:c(R),hardBreakTrailing:c(R),htmlFlow:c(L),htmlFlowData:T,htmlText:c(I),htmlTextData:T,image:c(F),label:P,labelText:O,lineEnding:$,link:c(D),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:le,resourceDestinationString:A,resourceTitleString:Y,resource:K,setextHeading:c(N),setextHeadingLineSequence:_,setextHeadingText:w,strong:c(),thematicBreak:c()}};RM(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(U){let V={type:"root",children:[]};const se={stack:[V],tokenStack:[],config:t,enter:l,exit:u,buffer:o,resume:d,data:n},fe=[];let Se=-1;for(;++Se<U.length;)if(U[Se][1].type==="listOrdered"||U[Se][1].type==="listUnordered")if(U[Se][0]==="enter")fe.push(Se);else{const Qe=fe.pop();Se=i(U,Qe,Se)}for(Se=-1;++Se<U.length;){const Qe=t[U[Se][0]];MM.call(Qe,U[Se][1].type)&&Qe[U[Se][1].type].call(Object.assign({sliceSerialize:U[Se][2].sliceSerialize},se),U[Se][1])}if(se.tokenStack.length>0){const Qe=se.tokenStack[se.tokenStack.length-1];(Qe[1]||z_).call(se,void 0,Qe[0])}for(V.position={start:$i(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:$i(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},Se=-1;++Se<t.transforms.length;)V=t.transforms[Se](V)||V;return V}function i(U,V,se){let fe=V-1,Se=-1,Qe=!1,Lt,Ot,jn,xt;for(;++fe<=se;){const dt=U[fe];switch(dt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{dt[0]==="enter"?Se++:Se--,xt=void 0;break}case"lineEndingBlank":{dt[0]==="enter"&&(Lt&&!xt&&!Se&&!jn&&(jn=fe),xt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:xt=void 0}if(!Se&&dt[0]==="enter"&&dt[1].type==="listItemPrefix"||Se===-1&&dt[0]==="exit"&&(dt[1].type==="listUnordered"||dt[1].type==="listOrdered")){if(Lt){let G=fe;for(Ot=void 0;G--;){const he=U[G];if(he[1].type==="lineEnding"||he[1].type==="lineEndingBlank"){if(he[0]==="exit")continue;Ot&&(U[Ot][1].type="lineEndingBlank",Qe=!0),he[1].type="lineEnding",Ot=G}else if(!(he[1].type==="linePrefix"||he[1].type==="blockQuotePrefix"||he[1].type==="blockQuotePrefixWhitespace"||he[1].type==="blockQuoteMarker"||he[1].type==="listItemIndent"))break}jn&&(!Ot||jn<Ot)&&(Lt._spread=!0),Lt.end=Object.assign({},Ot?U[Ot][1].start:dt[1].end),U.splice(Ot||fe,0,["exit",Lt,dt[2]]),fe++,se++}if(dt[1].type==="listItemPrefix"){const G={type:"listItem",_spread:!1,start:Object.assign({},dt[1].start),end:void 0};Lt=G,U.splice(fe,0,["enter",G,dt[2]]),fe++,se++,jn=void 0,xt=!0}}}return U[V][1]._spread=Qe,se}function a(U,V){return se;function se(fe){l.call(this,U(fe),fe),V&&V.call(this,fe)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(U,V,se){this.stack[this.stack.length-1].children.push(U),this.stack.push(U),this.tokenStack.push([V,se||void 0]),U.position={start:$i(V.start),end:void 0}}function c(U){return V;function V(se){U&&U.call(this,se),u.call(this,se)}}function u(U,V){const se=this.stack.pop(),fe=this.tokenStack.pop();if(fe)fe[0].type!==U.type&&(V?V.call(this,U,fe[0]):(fe[1]||z_).call(this,U,fe[0]));else throw new Error("Cannot close `"+U.type+"` ("+ac({start:U.start,end:U.end})+"): it’s not open");se.position.end=$i(U.end)}function d(){return w0(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(U){if(this.data.expectingFirstListItemValue){const V=this.stack[this.stack.length-2];V.start=Number.parseInt(this.sliceSerialize(U),10),this.data.expectingFirstListItemValue=void 0}}function p(){const U=this.resume(),V=this.stack[this.stack.length-1];V.lang=U}function g(){const U=this.resume(),V=this.stack[this.stack.length-1];V.meta=U}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const U=this.resume(),V=this.stack[this.stack.length-1];V.value=U.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const U=this.resume(),V=this.stack[this.stack.length-1];V.value=U.replace(/(\r?\n|\r)$/g,"")}function b(U){const V=this.resume(),se=this.stack[this.stack.length-1];se.label=V,se.identifier=jr(this.sliceSerialize(U)).toLowerCase()}function x(){const U=this.resume(),V=this.stack[this.stack.length-1];V.title=U}function k(){const U=this.resume(),V=this.stack[this.stack.length-1];V.url=U}function S(U){const V=this.stack[this.stack.length-1];if(!V.depth){const se=this.sliceSerialize(U).length;V.depth=se}}function w(){this.data.setextHeadingSlurpLineEnding=!0}function _(U){const V=this.stack[this.stack.length-1];V.depth=this.sliceSerialize(U).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function C(U){const se=this.stack[this.stack.length-1].children;let fe=se[se.length-1];(!fe||fe.type!=="text")&&(fe=Qt(),fe.position={start:$i(U.start),end:void 0},se.push(fe)),this.stack.push(fe)}function T(U){const V=this.stack.pop();V.value+=this.sliceSerialize(U),V.position.end=$i(U.end)}function $(U){const V=this.stack[this.stack.length-1];if(this.data.atHardBreak){const se=V.children[V.children.length-1];se.position.end=$i(U.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(V.type)&&(C.call(this,U),T.call(this,U))}function R(){this.data.atHardBreak=!0}function L(){const U=this.resume(),V=this.stack[this.stack.length-1];V.value=U}function I(){const U=this.resume(),V=this.stack[this.stack.length-1];V.value=U}function z(){const U=this.resume(),V=this.stack[this.stack.length-1];V.value=U}function D(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=V,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function F(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=V,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function O(U){const V=this.sliceSerialize(U),se=this.stack[this.stack.length-2];se.label=Rce(V),se.identifier=jr(V).toLowerCase()}function P(){const U=this.stack[this.stack.length-1],V=this.resume(),se=this.stack[this.stack.length-1];if(this.data.inReference=!0,se.type==="link"){const fe=U.children;se.children=fe}else se.alt=V}function A(){const U=this.resume(),V=this.stack[this.stack.length-1];V.url=U}function Y(){const U=this.resume(),V=this.stack[this.stack.length-1];V.title=U}function K(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function le(U){const V=this.resume(),se=this.stack[this.stack.length-1];se.label=V,se.identifier=jr(this.sliceSerialize(U)).toLowerCase(),this.data.referenceType="full"}function be(U){this.data.characterReferenceType=U.type}function me(U){const V=this.sliceSerialize(U),se=this.data.characterReferenceType;let fe;se?(fe=kM(V,se==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):fe=S0(V);const Se=this.stack[this.stack.length-1];Se.value+=fe}function Pe(U){const V=this.stack.pop();V.position.end=$i(U.end)}function H(U){T.call(this,U);const V=this.stack[this.stack.length-1];V.url=this.sliceSerialize(U)}function X(U){T.call(this,U);const V=this.stack[this.stack.length-1];V.url="mailto:"+this.sliceSerialize(U)}function oe(){return{type:"blockquote",children:[]}}function ce(){return{type:"code",lang:null,meta:null,value:""}}function Z(){return{type:"inlineCode",value:""}}function _e(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function we(){return{type:"emphasis",children:[]}}function Ne(){return{type:"heading",depth:0,children:[]}}function ge(){return{type:"break"}}function Be(){return{type:"html",value:""}}function pe(){return{type:"image",title:null,url:"",alt:null}}function Ct(){return{type:"link",title:null,url:"",children:[]}}function We(U){return{type:"list",ordered:U.type==="listOrdered",start:null,spread:U._spread,children:[]}}function Oe(U){return{type:"listItem",spread:U._spread,checked:null,children:[]}}function Ze(){return{type:"paragraph",children:[]}}function Me(){return{type:"strong",children:[]}}function Qt(){return{type:"text",value:""}}function $t(){return{type:"thematicBreak"}}}function $i(e){return{line:e.line,column:e.column,offset:e.offset}}function RM(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?RM(e,r):Dce(e,r)}}function Dce(e,t){let n;for(n in t)if(MM.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 z_(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ac({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ac({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ac({start:t.start,end:t.end})+") is still open")}function Bce(e){const t=this;t.parser=n;function n(r){return $ce(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function zce(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 Fce(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
168
- `}]}function Uce(e,t){const n=t.value?t.value+`
169
- `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function Wce(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Hce(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Gce(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=ll(r.toLowerCase()),a=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=a+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(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 qce(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 Kce(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function IM(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 i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function Vce(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return IM(e,t);const i={src:ll(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Yce(e,t){const n={src:ll(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 Xce(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 Zce(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return IM(e,t);const i={href:ll(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Qce(e,t){const n={href:ll(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 Jce(e,t,n){const r=e.all(t),i=n?eue(n):$M(t),a={},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:[]}),a.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const d=r[l];(i||l!==0||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
170
- `}),d.type==="element"&&d.tagName==="p"&&!i?o.push(...d.children):o.push(d)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
171
- `});const u={type:"element",tagName:"li",properties:a,children:o};return e.patch(t,u),e.applyData(t,u)}function eue(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=$M(n[r])}return t}function $M(e){const t=e.spread;return t??e.children.length>1}function tue(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];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 a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function nue(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rue(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function iue(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function aue(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=y0(t.children[1]),c=mM(t.children[t.children.length-1]);l&&c&&(o.position={start:l,end:c}),i.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function sue(e,t,n){const r=n?n.children:void 0,a=(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 g={type:"element",tagName:a,properties:h,children:[]};f&&(g.children=e.all(f),e.patch(f,g),g=e.applyData(f,g)),u.push(g)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,d),e.applyData(t,d)}function oue(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const F_=9,U_=32;function lue(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(W_(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(W_(t.slice(i),i>0,!1)),a.join("")}function W_(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===F_||a===U_;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===F_||a===U_;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function cue(e,t){const n={type:"text",value:lue(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function uue(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const due={blockquote:zce,break:Fce,code:Uce,delete:Wce,emphasis:Hce,footnoteReference:Gce,heading:qce,html:Kce,imageReference:Vce,image:Yce,inlineCode:Xce,linkReference:Zce,link:Qce,listItem:Jce,list:tue,paragraph:nue,root:rue,strong:iue,table:aue,tableCell:oue,tableRow:sue,text:cue,thematicBreak:uue,toml:vd,yaml:vd,definition:vd,footnoteDefinition:vd};function vd(){}const LM=-1,$p=0,oc=1,bh=2,E0=3,_0=4,N0=5,j0=6,DM=7,BM=8,zM=typeof self=="object"?self:globalThis,H_=(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 zM[e](t)},fue=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,o]=t[i];switch(a){case $p:case LM:return n(o,i);case oc:{const l=n([],i);for(const c of o)l.push(r(c));return l}case bh:{const l=n({},i);for(const[c,u]of o)l[r(c)]=r(u);return l}case E0:return n(new Date(o),i);case _0:{const{source:l,flags:c}=o;return n(new RegExp(l,c),i)}case N0:{const l=n(new Map,i);for(const[c,u]of o)l.set(r(c),r(u));return l}case j0:{const l=n(new Set,i);for(const c of o)l.add(r(c));return l}case DM:{const{name:l,message:c}=o;return n(typeof zM[l]=="function"?H_(l,c):new Error(c),i)}case BM:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);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(H_(a,o),i)};return r},G_=e=>fue(new Map,e)(0),Oa="",{toString:hue}={},{keys:pue}=Object,Dl=e=>{const t=typeof e;if(t!=="object"||!e)return[$p,t];const n=hue.call(e).slice(8,-1);switch(n){case"Array":return[oc,Oa];case"Object":return[bh,Oa];case"Date":return[E0,Oa];case"RegExp":return[_0,Oa];case"Map":return[N0,Oa];case"Set":return[j0,Oa];case"DataView":return[oc,n]}return n.includes("Array")?[oc,n]:e instanceof Error?[DM,e.name||"Error"]:[bh,n]},bd=([e,t])=>e===$p&&(t==="function"||t==="symbol"),mue=(e,t,n,r)=>{const i=(o,l)=>{const c=r.push(o)-1;return n.set(l,c),c},a=o=>{if(n.has(o))return n.get(o);let[l,c]=Dl(o);switch(l){case $p:{let d=o;switch(c){case"bigint":l=BM,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return i([LM],o)}return i([l,d],o)}case oc:{if(c){let h=o;return c==="DataView"?h=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(o)),i([c,[...h]],o)}const d=[],f=i([l,d],o);for(const h of o)d.push(a(h));return f}case bh:{if(c)switch(c){case"BigInt":return i([c,o.toString()],o);case"Boolean":case"Number":case"String":return i([c,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const d=[],f=i([l,d],o);for(const h of pue(o))(e||!bd(Dl(o[h])))&&d.push([a(h),a(o[h])]);return f}case E0:return i([l,isNaN(o.getTime())?Oa:o.toISOString()],o);case _0:{const{source:d,flags:f}=o;return i([l,{source:d,flags:f}],o)}case N0:{const d=[],f=i([l,d],o);for(const[h,p]of o)(e||!(bd(Dl(h))||bd(Dl(p))))&&d.push([a(h),a(p)]);return f}case j0:{const d=[],f=i([l,d],o);for(const h of o)(e||!bd(Dl(h)))&&d.push(a(h));return f}}const{message:u}=o;return i([l,{name:c,message:u}],o)};return a},q_=(e,{json:t,lossy:n}={})=>{const r=[];return mue(!(t||n),!!t,new Map,r)(e),r},xh=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?G_(q_(e,t)):structuredClone(e):(e,t)=>G_(q_(e,t));function gue(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 yue(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function vue(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||gue,r=e.options.footnoteBackLabel||yue,i=e.options.footnoteLabel||"Footnotes",a=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=ll(f.toLowerCase());let p=0;const g=[],m=e.footnoteCounts.get(f);for(;m!==void 0&&++p<=m;){g.length>0&&g.push({type:"text",value:" "});let b=typeof n=="string"?n:n(c,p);typeof b=="string"&&(b={type:"text",value:b}),g.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(b)?b:[b]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const b=v.children[v.children.length-1];b&&b.type==="text"?b.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...g)}else d.push(...g);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...xh(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
172
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
173
- `}]}}const Au=function(e){if(e==null)return Sue;if(typeof e=="function")return Lp(e);if(typeof e=="object")return Array.isArray(e)?bue(e):xue(e);if(typeof e=="string")return wue(e);throw new Error("Expected function, string, or object as test")};function bue(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Au(e[n]);return Lp(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function xue(e){const t=e;return Lp(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function wue(e){return Lp(t);function t(n){return n&&n.type===e}}function Lp(e){return t;function t(n,r,i){return!!(kue(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Sue(){return!0}function kue(e){return e!==null&&typeof e=="object"&&"type"in e}const FM=[],Eue=!0,eb=!1,_ue="skip";function UM(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=Au(i),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=FM,g,m,v;if((!t||a(c,u,d[d.length-1]||void 0))&&(p=Nue(n(c,d)),p[0]===eb))return p;if("children"in c&&c.children){const y=c;if(y.children&&p[0]!==_ue)for(m=(r?y.children.length:-1)+o,v=d.concat(y);m>-1&&m<y.children.length;){const b=y.children[m];if(g=l(b,m,v)(),g[0]===eb)return g;m=typeof g[1]=="number"?g[1]:m+o}}return p}}}function Nue(e){return Array.isArray(e)?e:typeof e=="number"?[Eue,e]:e==null?FM:[e]}function Dp(e,t,n,r){let i,a,o;typeof t=="function"&&typeof n!="function"?(a=void 0,o=t,i=n):(a=t,o=n,i=r),UM(e,a,l,i);function l(c,u){const d=u[u.length-1],f=d?d.children.indexOf(c):void 0;return o(c,f,d)}}const tb={}.hasOwnProperty,jue={};function Aue(e,t){const n=t||jue,r=new Map,i=new Map,a=new Map,o={...due,...n.handlers},l={all:u,applyData:Cue,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:c,options:n,patch:Tue,wrap:Pue};return Dp(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const f=d.type==="definition"?r:i,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(tb.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:m,...v}=d,y=xh(v);return y.children=l.all(d),y}return xh(d)}return(l.options.unknownHandler||Oue)(l,d,f)}function u(d){const f=[];if("children"in d){const h=d.children;let p=-1;for(;++p<h.length;){const g=l.one(h[p],d);if(g){if(p&&h[p-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=K_(g.value)),!Array.isArray(g)&&g.type==="element")){const m=g.children[0];m&&m.type==="text"&&(m.value=K_(m.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function Tue(e,t){e.position&&(t.position=yoe(e))}function Cue(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=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"&&a&&Object.assign(n.properties,xh(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Oue(e,t){const n=t.data||{},r="value"in t&&!(tb.call(n,"hProperties")||tb.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 Pue(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 K_(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function V_(e,t){const n=Aue(e,t),r=n.one(e,void 0),i=vue(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
177
- `},i),a}function Mue(e,t){return e&&"run"in e?async function(n,r){const i=V_(n,{file:r,...t});await e.run(i,r)}:function(n,r){return V_(n,{file:r,...e||t})}}function Y_(e){if(e)throw e}var Wd=Object.prototype.hasOwnProperty,WM=Object.prototype.toString,X_=Object.defineProperty,Z_=Object.getOwnPropertyDescriptor,Q_=function(t){return typeof Array.isArray=="function"?Array.isArray(t):WM.call(t)==="[object Array]"},J_=function(t){if(!t||WM.call(t)!=="[object Object]")return!1;var n=Wd.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Wd.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Wd.call(t,i)},eN=function(t,n){X_&&n.name==="__proto__"?X_(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},tN=function(t,n){if(n==="__proto__")if(Wd.call(t,n)){if(Z_)return Z_(t,n).value}else return;return t[n]},Rue=function e(){var t,n,r,i,a,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=tN(l,n),i=tN(t,n),l!==i&&(d&&i&&(J_(i)||(a=Q_(i)))?(a?(a=!1,o=r&&Q_(r)?r:[]):o=r&&J_(r)?r:{},eN(l,{name:n,newValue:e(d,o,i)})):typeof i<"u"&&eN(l,{name:n,newValue:i}));return l};const cg=Xe(Rue);function nb(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 Iue(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...i);function l(c,...u){const d=e[++a];let f=-1;if(c){o(c);return}for(;++f<i.length;)(u[f]===null||u[f]===void 0)&&(u[f]=i[f]);i=u,d?$ue(d,l)(...u):o(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function $ue(e,t){let n;return r;function r(...o){const l=e.length>o.length;let c;l&&o.push(i);try{c=e.apply(this,o)}catch(u){const d=u;if(l&&n)throw d;return i(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(a,i):c instanceof Error?i(c):a(c))}function i(o,...l){n||(n=!0,t(o,...l))}function a(o){i(null,o)}}const Lr={basename:Lue,dirname:Due,extname:Bue,join:zue,sep:"/"};function Lue(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Tu(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Due(e){if(Tu(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 Bue(e){Tu(e);let t=e.length,n=-1,r=0,i=-1,a=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?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function zue(...e){let t=-1,n;for(;++t<e.length;)Tu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Fue(n)}function Fue(e){Tu(e);const t=e.codePointAt(0)===47;let n=Uue(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Uue(e,t){let n="",r=0,i=-1,a=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(!(i===o-1||a===1))if(i!==o-1&&a===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("/")),i=o,a=0;continue}}else if(n.length>0){n="",r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else l===46&&a>-1?a++:a=-1}return n}function Tu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Wue={cwd:Hue};function Hue(){return"/"}function rb(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Gue(e){if(typeof e=="string")e=new URL(e);else if(!rb(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 que(e)}function que(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 i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const ug=["history","path","basename","stem","extname","dirname"];class HM{constructor(t){let n;t?rb(t)?n={path:t}:typeof t=="string"||Kue(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Wue.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ug.length;){const a=ug[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)ug.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Lr.basename(this.path):void 0}set basename(t){fg(t,"basename"),dg(t,"basename"),this.path=Lr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Lr.dirname(this.path):void 0}set dirname(t){nN(this.basename,"dirname"),this.path=Lr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Lr.extname(this.path):void 0}set extname(t){if(dg(t,"extname"),nN(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=Lr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){rb(t)&&(t=Gue(t)),fg(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Lr.basename(this.path,this.extname):void 0}set stem(t){fg(t,"stem"),dg(t,"stem"),this.path=Lr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new bn(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function dg(e,t){if(e&&e.includes(Lr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Lr.sep+"`")}function fg(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function nN(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Kue(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Vue=function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a},Yue={}.hasOwnProperty;class A0 extends Vue{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=Iue()}copy(){const t=new A0;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(cg(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(mg("data",this.frozen),this.namespace[t]=n,this):Yue.call(this.namespace,t)&&this.namespace[t]||void 0:t?(mg("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 i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=xd(t),r=this.parser||this.Parser;return hg("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),hg("process",this.parser||this.Parser),pg("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,o){const l=xd(t),c=r.parse(l);r.run(c,l,function(d,f,h){if(d||!f||!h)return u(d);const p=f,g=r.stringify(p,h);Que(g)?h.value=g:h.result=g,u(d,h)});function u(d,f){d||!f?o(d):a?a(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),hg("processSync",this.parser||this.Parser),pg("processSync",this.compiler||this.Compiler),this.process(t,i),iN("processSync","process",n),r;function i(a,o){n=!0,Y_(a),r=o}}run(t,n,r){rN(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(o,l){const c=xd(n);i.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,i;return this.run(t,n,a),iN("runSync","run",r),i;function a(o,l){Y_(o),i=l,r=!0}}stringify(t,n){this.freeze();const r=xd(n),i=this.compiler||this.Compiler;return pg("stringify",i),rN(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(mg("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 a(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&&(i.settings=cg(!0,i.settings,u.settings))}function l(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const f=u[d];a(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,...g]=d;const m=r[h][1];nb(m)&&nb(p)&&(p=cg(!0,m,p)),r[h]=[u,p,...g]}}}}const Xue=new A0().freeze();function hg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function pg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function mg(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 rN(e){if(!nb(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function iN(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function xd(e){return Zue(e)?e:new HM(e)}function Zue(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Que(e){return typeof e=="string"||Jue(e)}function Jue(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ede="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",aN=[],sN={allowDangerousHtml:!0},tde=/^(https?|ircs?|mailto|xmpp)$/i,nde=[{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 rde(e){const t=ide(e),n=ade(e);return sde(t.runSync(t.parse(n),n),e)}function ide(e){const t=e.rehypePlugins||aN,n=e.remarkPlugins||aN,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...sN}:sN;return Xue().use(Bce).use(n).use(Mue,r).use(t)}function ade(e){const t=e.children||"",n=new HM;return typeof t=="string"&&(n.value=t),n}function sde(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||ode;for(const d of nde)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+ede+d.id,void 0);return Dp(e,u),Soe(e,{Fragment:s.Fragment,components:i,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.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 sg)if(Object.hasOwn(sg,p)&&Object.hasOwn(d.properties,p)){const g=d.properties[p],m=sg[p];(m===null||m.includes(d.tagName))&&(d.properties[p]=c(String(g||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):a?a.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 ode(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||tde.test(e.slice(0,t))?e:""}function oN(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function lde(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function cde(e,t,n){const i=Au((n||{}).ignore||[]),a=ude(t);let o=-1;for(;++o<a.length;)UM(e,"text",l);function l(u,d){let f=-1,h;for(;++f<d.length;){const p=d[f],g=h?h.children:void 0;if(i(p,g?g.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=a[o][0],p=a[o][1];let g=0;const v=f.children.indexOf(u);let y=!1,b=[];h.lastIndex=0;let x=h.exec(u.value);for(;x;){const k=x.index,S={index:x.index,input:x.input,stack:[...d,u]};let w=p(...x,S);if(typeof w=="string"&&(w=w.length>0?{type:"text",value:w}:void 0),w===!1?h.lastIndex=k+1:(g!==k&&b.push({type:"text",value:u.value.slice(g,k)}),Array.isArray(w)?b.push(...w):w&&b.push(w),g=k+x[0].length,y=!0),!h.global)break;x=h.exec(u.value)}return y?(g<u.value.length&&b.push({type:"text",value:u.value.slice(g)}),f.children.splice(v,1,...b)):b=[u],v+b.length}}function ude(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 i=n[r];t.push([dde(i[0]),fde(i[1])])}return t}function dde(e){return typeof e=="string"?new RegExp(lde(e),"g"):e}function fde(e){return typeof e=="function"?e:function(){return e}}const gg="phrasing",yg=["autolink","link","image","label"];function hde(){return{transforms:[xde],enter:{literalAutolink:mde,literalAutolinkEmail:vg,literalAutolinkHttp:vg,literalAutolinkWww:vg},exit:{literalAutolink:bde,literalAutolinkEmail:vde,literalAutolinkHttp:gde,literalAutolinkWww:yde}}}function pde(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:gg,notInConstruct:yg},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:gg,notInConstruct:yg},{character:":",before:"[ps]",after:"\\/",inConstruct:gg,notInConstruct:yg}]}}function mde(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function vg(e){this.config.enter.autolinkProtocol.call(this,e)}function gde(e){this.config.exit.autolinkProtocol.call(this,e)}function yde(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 vde(e){this.config.exit.autolinkEmail.call(this,e)}function bde(e){this.exit(e)}function xde(e){cde(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,wde],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Sde]],{ignore:["link","linkReference"]})}function wde(e,t,n,r,i){let a="";if(!GM(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!kde(n)))return!1;const o=Ede(n+r);if(!o[0])return!1;const l={type:"link",title:null,url:a+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[l,{type:"text",value:o[1]}]:l}function Sde(e,t,n,r){return!GM(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function kde(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 Ede(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 i=oN(e,"(");let a=oN(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function GM(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||os(n)||Rp(n))&&(!t||n!==47)}qM.peek=Mde;function _de(){this.buffer()}function Nde(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function jde(){this.buffer()}function Ade(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Tde(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=jr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Cde(e){this.exit(e)}function Ode(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=jr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Pde(e){this.exit(e)}function Mde(){return"["}function qM(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),l(),o(),a+=i.move("]"),a}function Rde(){return{enter:{gfmFootnoteCallString:_de,gfmFootnoteCall:Nde,gfmFootnoteDefinitionLabelString:jde,gfmFootnoteDefinition:Ade},exit:{gfmFootnoteCallString:Tde,gfmFootnoteCall:Cde,gfmFootnoteDefinitionLabelString:Ode,gfmFootnoteDefinition:Pde}}}function Ide(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:qM},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,o){const l=a.createTracker(o);let c=l.move("[^");const u=a.enter("footnoteDefinition"),d=a.enter("label");return c+=l.move(a.safe(a.associationId(r),{before:c,after:"]"})),d(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((t?`
178
- `:" ")+a.indentLines(a.containerFlow(r,l.current()),t?KM:$de))),u(),c}}function $de(e,t,n){return t===0?e:KM(e,t,n)}function KM(e,t,n){return(n?"":" ")+e}const Lde=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];VM.peek=Ude;function Dde(){return{canContainEols:["delete"],enter:{strikethrough:zde},exit:{strikethrough:Fde}}}function Bde(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Lde}],handlers:{delete:VM}}}function zde(e){this.enter({type:"delete",children:[]},e)}function Fde(e){this.exit(e)}function VM(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),a(),o}function Ude(){return"~"}function Wde(e){return e.length}function Hde(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Wde,a=[],o=[],l=[],c=[];let u=0,d=-1;for(;++d<e.length;){const m=[],v=[];let y=-1;for(e[d].length>u&&(u=e[d].length);++y<e[d].length;){const b=Gde(e[d][y]);if(n.alignDelimiters!==!1){const x=i(b);v[y]=x,(c[y]===void 0||x>c[y])&&(c[y]=x)}m.push(b)}o[d]=m,l[d]=v}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)a[f]=lN(r[f]);else{const m=lN(r);for(;++f<u;)a[f]=m}f=-1;const h=[],p=[];for(;++f<u;){const m=a[f];let v="",y="";m===99?(v=":",y=":"):m===108?v=":":m===114&&(y=":");let b=n.alignDelimiters===!1?1:Math.max(1,c[f]-v.length-y.length);const x=v+"-".repeat(b)+y;n.alignDelimiters!==!1&&(b=v.length+b+y.length,b>c[f]&&(c[f]=b),p[f]=b),h[f]=x}o.splice(1,0,h),l.splice(1,0,p),d=-1;const g=[];for(;++d<o.length;){const m=o[d],v=l[d];f=-1;const y=[];for(;++f<u;){const b=m[f]||"";let x="",k="";if(n.alignDelimiters!==!1){const S=c[f]-(v[f]||0),w=a[f];w===114?x=" ".repeat(S):w===99?S%2?(x=" ".repeat(S/2+.5),k=" ".repeat(S/2-.5)):(x=" ".repeat(S/2),k=x):k=" ".repeat(S)}n.delimiterStart!==!1&&!f&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&b==="")&&(n.delimiterStart!==!1||f)&&y.push(" "),n.alignDelimiters!==!1&&y.push(x),y.push(b),n.alignDelimiters!==!1&&y.push(k),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||f!==u-1)&&y.push("|")}g.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return g.join(`
179
- `)}function Gde(e){return e==null?"":String(e)}function lN(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 qde(e,t,n,r){const i=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const o=n.indentLines(n.containerFlow(e,a.current()),Kde);return i(),o}function Kde(e,t,n){return">"+(n?"":" ")+e}function Vde(e,t){return cN(e,t.inConstruct,!0)&&!cN(e,t.notInConstruct,!1)}function cN(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 uN(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
180
- `&&Vde(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
181
- `}function Yde(e,t){const n=String(e);let r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Xde(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 Zde(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 Qde(e,t,n,r){const i=Zde(n),a=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(Xde(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(a,Jde);return f(),h}const l=n.createTracker(r),c=i.repeat(Math.max(Yde(a,i)+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
- `),a&&(d+=l.move(a+`
184
- `)),d+=l.move(c),u(),d}function Jde(e,t,n){return(n?"":" ")+e}function T0(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 efe(e,t,n,r){const i=T0(n),a=i==='"'?"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${a}`),u+=c.move(" "+i),u+=c.move(n.safe(e.title,{before:u,after:i,...c.current()})),u+=c.move(i),l()),o(),u}function tfe(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 uu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function wh(e,t,n){const r=Fo(e),i=Fo(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}YM.peek=nfe;function YM(e,t,n,r){const i=tfe(n),a=n.enter("emphasis"),o=n.createTracker(r),l=o.move(i);let c=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const u=c.charCodeAt(0),d=wh(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(c=uu(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=wh(r.after.charCodeAt(0),f,i);h.inside&&(c=c.slice(0,-1)+uu(f));const p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function nfe(e,t,n){return n.options.emphasis||"*"}function rfe(e,t){let n=!1;return Dp(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,eb}),!!((!e.depth||e.depth<3)&&w0(e)&&(t.options.setext||n))}function ife(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(rfe(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...a.current(),before:`
186
- `,after:`
187
- `});return f(),d(),h+`
188
- `+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
189
- `))+1))}const o="#".repeat(i),l=n.enter("headingAtx"),c=n.enter("phrasing");a.move(o+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
190
- `,...a.current()});return/^[\t ]/.test(u)&&(u=uu(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),c(),l(),u}XM.peek=afe;function XM(e){return e.value||""}function afe(){return"<"}ZM.peek=sfe;function ZM(e,t,n,r){const i=T0(n),a=i==='"'?"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${a}`),u+=c.move(" "+i),u+=c.move(n.safe(e.title,{before:u,after:i,...c.current()})),u+=c.move(i),l()),u+=c.move(")"),o(),u}function sfe(){return"!"}QM.peek=ofe;function QM(e,t,n,r){const i=e.referenceType,a=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,a(),i==="full"||!u||u!==f?c+=l.move(f+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function ofe(){return"!"}JM.peek=lfe;function JM(e,t,n){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const o=n.unsafe[a],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 i+r+i}function lfe(){return"`"}function eR(e,t){const n=w0(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))}tR.peek=cfe;function tR(e,t,n,r){const i=T0(n),a=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,c;if(eR(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${a}`),u+=o.move(" "+i),u+=o.move(n.safe(e.title,{before:u,after:i,...o.current()})),u+=o.move(i),c()),u+=o.move(")"),l(),u}function cfe(e,t,n){return eR(e,n)?"<":"["}nR.peek=ufe;function nR(e,t,n,r){const i=e.referenceType,a=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,a(),i==="full"||!u||u!==f?c+=l.move(f+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function ufe(){return"["}function C0(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 dfe(e){const t=C0(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 ffe(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 rR(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 hfe(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?ffe(n):C0(n);const l=e.ordered?o==="."?")":".":dfe(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),rR(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=a,i(),u}function pfe(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 mfe(e,t,n,r){const i=pfe(n);let a=n.bulletCurrent||C0(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(r);l.move(a+" ".repeat(o-a.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?a:a+" ".repeat(o-a.length))+f}}function gfe(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),i(),o}const yfe=Au(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function vfe(e,t,n,r){return(e.children.some(function(o){return yfe(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function bfe(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}iR.peek=xfe;function iR(e,t,n,r){const i=bfe(n),a=n.enter("strong"),o=n.createTracker(r),l=o.move(i+i);let c=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const u=c.charCodeAt(0),d=wh(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(c=uu(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=wh(r.after.charCodeAt(0),f,i);h.inside&&(c=c.slice(0,-1)+uu(f));const p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function xfe(e,t,n){return n.options.strong||"*"}function wfe(e,t,n,r){return n.safe(e.value,r)}function Sfe(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 kfe(e,t,n){const r=(rR(n)+(n.options.ruleSpaces?" ":"")).repeat(Sfe(n));return n.options.ruleSpaces?r.slice(0,-1):r}const aR={blockquote:qde,break:uN,code:Qde,definition:efe,emphasis:YM,hardBreak:uN,heading:ife,html:XM,image:ZM,imageReference:QM,inlineCode:JM,link:tR,linkReference:nR,list:hfe,listItem:mfe,paragraph:gfe,root:vfe,strong:iR,text:wfe,thematicBreak:kfe};function Efe(){return{enter:{table:_fe,tableData:dN,tableHeader:dN,tableRow:jfe},exit:{codeText:Afe,table:Nfe,tableData:bg,tableHeader:bg,tableRow:bg}}}function _fe(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 Nfe(e){this.exit(e),this.data.inTable=void 0}function jfe(e){this.enter({type:"tableRow",children:[]},e)}function bg(e){this.exit(e)}function dN(e){this.enter({type:"tableCell",children:[]},e)}function Afe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Tfe));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Tfe(e,t){return t==="|"?t:e}function Cfe(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=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,g,m,v){return u(d(p,m,v),p.align)}function l(p,g,m,v){const y=f(p,m,v),b=u([y]);return b.slice(0,b.indexOf(`
192
- `))}function c(p,g,m,v){const y=m.enter("tableCell"),b=m.enter("phrasing"),x=m.containerPhrasing(p,{...v,before:a,after:a});return b(),y(),x}function u(p,g){return Hde(p,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function d(p,g,m){const v=p.children;let y=-1;const b=[],x=g.enter("table");for(;++y<v.length;)b[y]=f(v[y],g,m);return x(),b}function f(p,g,m){const v=p.children;let y=-1;const b=[],x=g.enter("tableRow");for(;++y<v.length;)b[y]=c(v[y],p,g,m);return x(),b}function h(p,g,m){let v=aR.inlineCode(p,g,m);return m.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function Ofe(){return{exit:{taskListCheckValueChecked:fN,taskListCheckValueUnchecked:fN,paragraph:Mfe}}}function Pfe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Rfe}}}function fN(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Mfe(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 i=t.children;let a=-1,o;for(;++a<i.length;){const l=i[a];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 Rfe(e,t,n,r){const i=e.children[0],a=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",l=n.createTracker(r);a&&l.move(o);let c=aR.listItem(e,t,n,{...r,...l.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(d){return d+o}}function Ife(){return[hde(),Rde(),Dde(),Efe(),Ofe()]}function $fe(e){return{extensions:[pde(),Ide(e),Bde(),Cfe(e),Pfe()]}}const Lfe={tokenize:Wfe,partial:!0},sR={tokenize:Hfe,partial:!0},oR={tokenize:Gfe,partial:!0},lR={tokenize:qfe,partial:!0},Dfe={tokenize:Kfe,partial:!0},cR={name:"wwwAutolink",tokenize:Ffe,previous:dR},uR={name:"protocolAutolink",tokenize:Ufe,previous:fR},_i={name:"emailAutolink",tokenize:zfe,previous:hR},Yr={};function Bfe(){return{text:Yr}}let Ea=48;for(;Ea<123;)Yr[Ea]=_i,Ea++,Ea===58?Ea=65:Ea===91&&(Ea=97);Yr[43]=_i;Yr[45]=_i;Yr[46]=_i;Yr[95]=_i;Yr[72]=[_i,uR];Yr[104]=[_i,uR];Yr[87]=[_i,cR];Yr[119]=[_i,cR];function zfe(e,t,n){const r=this;let i,a;return o;function o(f){return!ib(f)||!hR.call(r,r.previous)||O0(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(f))}function l(f){return ib(f)?(e.consume(f),l):f===64?(e.consume(f),c):n(f)}function c(f){return f===46?e.check(Dfe,d,u)(f):f===45||f===95||yn(f)?(a=!0,e.consume(f),c):d(f)}function u(f){return e.consume(f),i=!0,c}function d(f){return a&&i&&Sn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function Ffe(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!dR.call(r,r.previous)||O0(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Lfe,e.attempt(sR,e.attempt(oR,a),n),n)(o))}function a(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function Ufe(e,t,n){const r=this;let i="",a=!1;return o;function o(f){return(f===72||f===104)&&fR.call(r,r.previous)&&!O0(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),l):n(f)}function l(f){if(Sn(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),l;if(f===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(f),c}return n(f)}function c(f){return f===47?(e.consume(f),a?u:(a=!0,c)):n(f)}function u(f){return f===null||vh(f)||lt(f)||os(f)||Rp(f)?n(f):e.attempt(sR,e.attempt(oR,d),n)(f)}function d(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function Wfe(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),a):n(o)}function a(o){return o===null?n(o):t(o)}}function Hfe(e,t,n){let r,i,a;return o;function o(u){return u===46||u===95?e.check(lR,c,l)(u):u===null||lt(u)||os(u)||u!==45&&Rp(u)?c(u):(a=!0,e.consume(u),o)}function l(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),o}function c(u){return i||r||!a?n(u):t(u)}}function Gfe(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(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(lR,t,a)(o):o===null||lt(o)||os(o)?t(o):(e.consume(o),i)}function a(o){return o===41&&r++,e.consume(o),i}}function qfe(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),a):l===93?(e.consume(l),i):l===60||l===null||lt(l)||os(l)?t(l):n(l)}function i(l){return l===null||l===40||l===91||lt(l)||os(l)?t(l):r(l)}function a(l){return Sn(l)?o(l):n(l)}function o(l){return l===59?(e.consume(l),r):Sn(l)?(e.consume(l),o):n(l)}}function Kfe(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return yn(a)?n(a):t(a)}}function dR(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||lt(e)}function fR(e){return!Sn(e)}function hR(e){return!(e===47||ib(e))}function ib(e){return e===43||e===45||e===46||e===95||yn(e)}function O0(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 Vfe={tokenize:nhe,partial:!0};function Yfe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Jfe,continuation:{tokenize:ehe},exit:the}},text:{91:{name:"gfmFootnoteCall",tokenize:Qfe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Xfe,resolveTo:Zfe}}}}function Xfe(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const c=r.events[i][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=jr(r.sliceSerialize({start:o.end,end:r.now()}));return u.codePointAt(0)!==94||!a.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function Zfe(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)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function Qfe(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=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(a>999||f===93&&!o||f===null||f===91||lt(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(jr(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return lt(f)||(o=!0),a++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),a++,u):u(f)}}function Jfe(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o=0,l;return c;function c(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(g)}function d(g){if(o>999||g===93&&!l||g===null||g===91||lt(g))return n(g);if(g===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return a=jr(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return lt(g)||(l=!0),o++,e.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(e.consume(g),o++,d):d(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(a)||i.push(a),Ue(e,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return t(g)}}function ehe(e,t,n){return e.check(ju,t,e.attempt(Vfe,t,n))}function the(e){e.exit("gfmFootnoteDefinition")}function nhe(e,t,n){const r=this;return Ue(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(a):n(a)}}function rhe(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(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&&Kn(h,h.length,0,Ip(p,o.slice(u+1,c),l)),Kn(h,h.length,0,[["exit",f,l],["enter",o[c][1],l],["exit",o[c][1],l],["exit",d,l]]),Kn(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 a(o,l,c){const u=this.previous,d=this.events;let f=0;return h;function h(g){return u===126&&d[d.length-1][1].type!=="characterEscape"?c(g):(o.enter("strikethroughSequenceTemporary"),p(g))}function p(g){const m=Fo(u);if(g===126)return f>1?c(g):(o.consume(g),f++,p);if(f<2&&!n)return c(g);const v=o.exit("strikethroughSequenceTemporary"),y=Fo(g);return v._open=!y||y===2&&!!m,v._close=!m||m===2&&!!y,l(g)}}}class ihe{constructor(){this.map=[]}add(t,n,r){ahe(this,t,n,r)}consume(t){if(this.map.sort(function(a,o){return a[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 i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0}}function ahe(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function she(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function ohe(){return{flow:{null:{name:"table",tokenize:lhe,resolveAll:che}}}}function lhe(e,t,n){const r=this;let i=0,a=0,o;return l;function l(T){let $=r.events.length-1;for(;$>-1;){const I=r.events[$][1].type;if(I==="lineEnding"||I==="linePrefix")$--;else break}const R=$>-1?r.events[$][1].type:null,L=R==="tableHead"||R==="tableRow"?w:c;return L===w&&r.parser.lazy[r.now().line]?n(T):L(T)}function c(T){return e.enter("tableHead"),e.enter("tableRow"),u(T)}function u(T){return T===124||(o=!0,a+=1),d(T)}function d(T){return T===null?n(T):je(T)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),p):n(T):Le(T)?Ue(e,d,"whitespace")(T):(a+=1,o&&(o=!1,i+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),f(T)))}function f(T){return T===null||T===124||lt(T)?(e.exit("data"),d(T)):(e.consume(T),T===92?h:f)}function h(T){return T===92||T===124?(e.consume(T),f):f(T)}function p(T){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(T):(e.enter("tableDelimiterRow"),o=!1,Le(T)?Ue(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):g(T))}function g(T){return T===45||T===58?v(T):T===124?(o=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),m):S(T)}function m(T){return Le(T)?Ue(e,v,"whitespace")(T):v(T)}function v(T){return T===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),y):T===45?(a+=1,y(T)):T===null||je(T)?k(T):S(T)}function y(T){return T===45?(e.enter("tableDelimiterFiller"),b(T)):S(T)}function b(T){return T===45?(e.consume(T),b):T===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(T))}function x(T){return Le(T)?Ue(e,k,"whitespace")(T):k(T)}function k(T){return T===124?g(T):T===null||je(T)?!o||i!==a?S(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):S(T)}function S(T){return n(T)}function w(T){return e.enter("tableRow"),_(T)}function _(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),_):T===null||je(T)?(e.exit("tableRow"),t(T)):Le(T)?Ue(e,_,"whitespace")(T):(e.enter("data"),N(T))}function N(T){return T===null||T===124||lt(T)?(e.exit("data"),_(T)):(e.consume(T),T===92?C:N)}function C(T){return T===92||T===124?(e.consume(T),N):N(T)}}function che(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,u,d,f;const h=new ihe;for(;++n<e.length;){const p=e[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(l=!1,c!==0&&(hN(h,t,c,u,d),d=void 0,c=0),u={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",u,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,a=[0,0,0,0],o=[0,n+1,0,0],l&&(l=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",d,t]])),i=g.type==="tableDelimiterRow"?2:d?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],f=wd(h,t,a,i,void 0,f),a=[0,0,0,0]),o[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],f=wd(h,t,a,i,void 0,f)),a=o,o=[a[1],n,0,0])):g.type==="tableHead"?(l=!0,c=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(c=n,a[1]!==0?(o[0]=o[1],f=wd(h,t,a,i,n,f)):o[1]!==0&&(f=wd(h,t,o,i,n,f)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(o[3]=n)}for(c!==0&&hN(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=she(t.events,n))}return e}function wd(e,t,n,r,i,a){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(a.end=Object.assign({},Is(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const c=Is(t.events,n[1]);if(a={type:o,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const u=Is(t.events,n[2]),d=Is(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 g=n[2]+1,m=n[3]-n[2]-1;e.add(g,m,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(a.end=Object.assign({},Is(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function hN(e,t,n,r,i){const a=[],o=Is(t.events,n);i&&(i.end=Object.assign({},o),a.push(["exit",i,t])),r.end=Object.assign({},o),a.push(["exit",r,t]),e.add(n+1,0,a)}function Is(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const uhe={name:"tasklistCheck",tokenize:fhe};function dhe(){return{text:{91:uhe}}}function fhe(e,t,n){const r=this;return i;function i(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),a)}function a(c){return lt(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 je(c)?t(c):Le(c)?e.check({tokenize:hhe},t,n)(c):n(c)}}function hhe(e,t,n){return Ue(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function phe(e){return SM([Bfe(),Yfe(),rhe(e),ohe(),dhe()])}const mhe={};function ghe(e){const t=this,n=e||mhe,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(phe(n)),a.push(Ife()),o.push($fe(n))}const pN=function(e,t,n){const r=Au(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]},ms=function(e){if(e==null)return bhe;if(typeof e=="string")return vhe(e);if(typeof e=="object")return yhe(e);if(typeof e=="function")return P0(e);throw new Error("Expected function, string, or array as `test`")};function yhe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ms(e[n]);return P0(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function vhe(e){return P0(t);function t(n){return n.tagName===e}}function P0(e){return t;function t(n,r,i){return!!(xhe(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function bhe(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function xhe(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const mN=/\n/g,gN=/[\t ]+/g,ab=ms("br"),yN=ms(Ahe),whe=ms("p"),vN=ms("tr"),She=ms(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",jhe,The]),pR=ms(["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 khe(e,t){const n=t||{},r="children"in e?e.children:[],i=pR(e),a=yR(e,{whitespace:n.whitespace||"normal"}),o=[];(e.type==="text"||e.type==="comment")&&o.push(...gR(e,{breakBefore:!0,breakAfter:!0}));let l=-1;for(;++l<r.length;)o.push(...mR(r[l],e,{whitespace:a,breakBefore:l?void 0:i,breakAfter:l<r.length-1?ab(r[l+1]):i}));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 mR(e,t,n){return e.type==="element"?Ehe(e,t,n):e.type==="text"?n.whitespace==="normal"?gR(e,n):_he(e):[]}function Ehe(e,t,n){const r=yR(e,n),i=e.children||[];let a=-1,o=[];if(She(e))return o;let l,c;for(ab(e)||vN(e)&&pN(t,e,vN)?c=`
194
- `:whe(e)?(l=2,c=2):pR(e)&&(l=1,c=1);++a<i.length;)o=o.concat(mR(i[a],e,{whitespace:r,breakBefore:a?void 0:l,breakAfter:a<i.length-1?ab(i[a+1]):c}));return yN(e)&&pN(t,e,yN)&&o.push(" "),l&&o.unshift(l),c&&o.push(c),o}function gR(e,t){const n=String(e.value),r=[],i=[];let a=0;for(;a<=n.length;){mN.lastIndex=a;const c=mN.exec(n),u=c&&"index"in c?c.index:n.length;r.push(Nhe(n.slice(a,u).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),a===0?t.breakBefore:!0,u===n.length?t.breakAfter:!0)),a=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?(i.push(r[o]),l=void 0):r[o]?(typeof l=="number"&&i.push(l),i.push(r[o]),l=0):(o===0||o===r.length-1)&&i.push(0);return i}function _he(e){return[String(e.value)]}function Nhe(e,t,n){const r=[];let i=0,a;for(;i<e.length;){gN.lastIndex=i;const o=gN.exec(e);a=o?o.index:e.length,!i&&!a&&o&&!t&&r.push(""),i!==a&&r.push(e.slice(i,a)),i=o?a+o[0].length:a}return i!==a&&!n&&r.push(""),r.join(" ")}function yR(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 jhe(e){return!!(e.properties||{}).hidden}function Ahe(e){return e.tagName==="td"||e.tagName==="th"}function The(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function Che(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+t.optional(i)+"[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(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",g=["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"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["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"],y=["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"],k={type:m,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},S={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,`(?!${g.join("|")})`,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},w=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],_={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:k,contains:w.concat([{begin:/\(/,end:/\)/,keywords:k,contains:w.concat(["self"]),relevance:0}]),relevance:0},N={className:"function",begin:"("+o+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:k,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:k,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:k,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:k,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:k,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(_,N,S,w,[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:k,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:k},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Ohe(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=Che(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 Phe(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 i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.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}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],y={match:/(\/[a-z._-]+)+/},b=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],x=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],k=["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:m,literal:v,built_in:[...b,...x,"set","shopt",...k,...S]},contains:[p,e.SHEBANG(),g,f,a,o,y,l,c,u,d,n]}}function Mhe(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="("+r+"|"+t.optional(i)+"[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(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",v={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"},y=[f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],b={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:y.concat([{begin:/\(/,end:/\)/,keywords:v,contains:y.concat(["self"]),relevance:0}]),relevance:0},x={begin:"("+o+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:v,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:v,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:v,disableAutodetect:!0,illegal:"</",contains:[].concat(b,x,y,[f,{begin:e.IDENT_RE+"::",keywords:v},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:v}}}function Rhe(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+t.optional(i)+"[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(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",g=["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"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["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"],y=["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"],k={type:m,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},S={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,`(?!${g.join("|")})`,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},w=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],_={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:k,contains:w.concat([{begin:/\(/,end:/\)/,keywords:k,contains:w.concat(["self"]),relevance:0}]),relevance:0},N={className:"function",begin:"("+o+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:k,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:k,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:k,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:k,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:k,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(_,N,S,w,[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:k,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:k},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Ihe(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"],i=["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"],a=["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:i.concat(a),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/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,p]},m={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},v=e.inherit(m,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});h.contains=[m,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],p.contains=[v,g,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[u,m,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},b={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},x=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",k={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"}},y,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,b,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,b,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:"("+x+"\\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,b],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[y,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},k]}}const $he=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_-]*/}}),Lhe=["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"],Dhe=["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"],Bhe=[...Lhe,...Dhe],zhe=["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(),Fhe=["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(),Uhe=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Whe=["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 Hhe(e){const t=e.regex,n=$he(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",a=/@-?\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:":("+Fhe.join("|")+")"},{begin:":(:)?("+Uhe.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Whe.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:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:zhe.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Bhe.join("|")+")\\b"}]}}function Ghe(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 qhe(e){const a={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:a,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:a,illegal:/["']/}]}]}}function Khe(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 Vhe(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 i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},a={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,a,i,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,a,i,o,n]}}]}}var $s="[0-9](_*[0-9])*",Sd=`\\.(${$s})`,kd="[0-9a-fA-F](_*[0-9a-fA-F])*",bN={className:"number",variants:[{begin:`(\\b(${$s})((${Sd})|\\.)?|(${Sd}))[eE][+-]?(${$s})[fFdD]?\\b`},{begin:`\\b(${$s})((${Sd})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Sd})[fFdD]?\\b`},{begin:`\\b(${$s})[fFdD]\\b`},{begin:`\\b0[xX]((${kd})\\.?|(${kd})?\\.(${kd}))[pP][+-]?(${$s})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${kd})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function vR(e,t,n){return n===-1?"":e.replace(t,r=>vR(e,t,n-1))}function Yhe(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+vR("(?:<"+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,bN,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},bN,u]}}const xN="[A-Za-z$_][0-9A-Za-z$_]*",Xhe=["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"],Zhe=["true","false","null","undefined","NaN","Infinity"],bR=["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"],xR=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],wR=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Qhe=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Jhe=[].concat(wR,bR,xR);function epe(e){const t=e.regex,n=(O,{after:P})=>{const A="</"+O[0].slice(1);return O.input.indexOf(A,P)!==-1},r=xN,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,P)=>{const A=O[0].length+O.index,Y=O.input[A];if(Y==="<"||Y===","){P.ignoreMatch();return}Y===">"&&(n(O,{after:A})||P.ignoreMatch());let K;const M=O.input.substring(A);if(K=M.match(/^\s*=/)){P.ignoreMatch();return}if((K=M.match(/^\s+extends\s+/))&&K.index===0){P.ignoreMatch();return}}},l={$pattern:xN,keyword:Xhe,literal:Zhe,built_in:Jhe,"variable.language":Qhe},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"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},b={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]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,v,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const k=[].concat(b,h.contains),S=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(k)}]),w={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},_={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},N={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:{_:[...bR,...xR]}},C={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},$={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function R(O){return t.concat("(?!",O.join("|"),")")}const L={match:t.concat(/\b/,R([...wR,"super","import","await"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},I={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",F={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:N},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),C,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,v,b,{match:/\$\d+/},f,N,{scope:"attr",match:r+t.lookahead(":"),relevance:0},F,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,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:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},I,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},L,$,_,z,{match:/\$[(.]/}]}}const tpe="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",npe={scope:"number",match:tpe,relevance:0};function rpe(e){const t={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:r},contains:[t,n,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,i,npe,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Ls="[0-9](_*[0-9])*",Ed=`\\.(${Ls})`,_d="[0-9a-fA-F](_*[0-9a-fA-F])*",ipe={className:"number",variants:[{begin:`(\\b(${Ls})((${Ed})|\\.)?|(${Ed}))[eE][+-]?(${Ls})[fFdD]?\\b`},{begin:`\\b(${Ls})((${Ed})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Ed})[fFdD]?\\b`},{begin:`\\b(${Ls})[fFdD]\\b`},{begin:`\\b0[xX]((${_d})\\.?|(${_d})?\\.(${_d}))[pP][+-]?(${Ls})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${_d})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function ape(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+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},a={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[a,i]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,a,i]}]};i.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=ipe,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 spe=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_-]*/}}),ope=["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"],lpe=["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"],cpe=[...ope,...lpe],upe=["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(),SR=["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(),kR=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),dpe=["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(),fpe=SR.concat(kR).sort().reverse();function hpe(e){const t=spe(e),n=fpe,r="and or not only",i="[\\w-]+",a="("+i+"|@\\{"+i+"\\})",o=[],l=[],c=function(x){return{className:"string",begin:"~?"+x+".*?"+x}},u=function(x,k,S){return{className:x,begin:k,relevance:S}},d={$pattern:/[a-z-]+/,keyword:r,attribute:upe.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","@@?"+i,10),u("variable","@\\{"+i+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\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)},g={begin:a+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+dpe.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},m={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}},v={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:h}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:a,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","@\\{"+i+"\\}"),{begin:"\\b("+cpe.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,u("selector-tag",a,0),u("selector-id","#"+a),u("selector-class","\\."+a,0),u("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+SR.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+kR.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},b={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,v,b,g,y,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function ppe(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},i=[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:i.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:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function mpe(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]},i={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},a={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,i,a,o]}}function gpe(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={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}]},a={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(y=>{y.contains=y.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,a,u,d,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},i,r,c,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function ype(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 vpe(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}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},a={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},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,a,c],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(m,v,y="\\1")=>{const b=y==="\\1"?y:t.concat(y,v);return t.concat(t.concat("(?:",m,")"),v,/(?:\\.|[^\\\/])*?/,b,/(?:\\.|[^\\\/])*?/,y,r)},p=(m,v,y)=>t.concat(t.concat("(?:",m,")"),v,/(?:\\.|[^\\\/])*?/,y,r),g=[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 a.contains=g,o.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:g}}function bpe(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),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),a=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,z)=>{z.data._beginMatch=I[1]||I[2]},"on:end":(I,z)=>{z.data._beginMatch!==I[1]&&z.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[
196
- ]`,g={scope:"string",variants:[d,u,f,h]},m={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},v=["false","null","true"],y=["__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"],b=["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"],k={keyword:y,literal:(I=>{const z=[];return I.forEach(D=>{z.push(D),D.toLowerCase()===D?z.push(D.toUpperCase()):z.push(D.toLowerCase())}),z})(v),built_in:b},S=I=>I.map(z=>z.replace(/\|\d+$/,"")),w={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",S(b).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},_=t.concat(r,"\\b(?!\\()"),N={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),_],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),_],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},C={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:k,contains:[C,o,N,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,g,m,w]},$={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",S(y).join("\\b|"),"|",S(b).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[T]};T.contains.push($);const R=[C,N,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,g,m,w],L={begin:t.concat(/#\[\s*\\?/,t.either(i,a)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...R]},...R,{scope:"meta",variants:[{match:i},{match:a}]}]};return{case_insensitive:!1,keywords:k,contains:[L,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,$,N,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},w,{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:k,contains:["self",L,o,N,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,g,m]}]},{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]},g,m]}}function xpe(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 wpe(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Spe(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})\\.`,g=`\\b|${r.join("|")}`,m={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${p}))[eE][+-]?(${h})[jJ]?(?=${g})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${h})[jJ](?=${g})`}]},v={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,m,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,m,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,m,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,v,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{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:[m,y,f]}]}}function kpe(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function Epe(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]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,a=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:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[a,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:a},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function _pe(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]+/),i=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])*",g={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"}]},m={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},w=[f,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:o},{relevance:0,match:[i,/\.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:[m]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},g,{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=w,m.contains=w;const T=[{begin:/^\s*=>/,starts:{end:"$",contains:w}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:w}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(T).concat(u).concat(w)}}function Npe(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),a={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,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:"->"},a]}}const jpe=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_-]*/}}),Ape=["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"],Tpe=["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"],Cpe=[...Ape,...Tpe],Ope=["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(),Ppe=["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(),Mpe=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Rpe=["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 Ipe(e){const t=jpe(e),n=Mpe,r=Ppe,i="@[a-z-]+",a="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("+Cpe.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("+Rpe.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:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:Ope.join(" ")},contains:[{begin:i,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 $pe(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function Lpe(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],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,g=[...u,...c].filter(S=>!d.includes(S)),m={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function b(S){return t.concat(/\b/,t.either(...S.map(w=>w.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:b(h),relevance:0};function k(S,{exceptions:w,when:_}={}){const N=_;return w=w||[],S.map(C=>C.match(/\|\d+$/)||w.includes(C)?C:N(C)?`${C}|0`:C)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:k(g,{when:S=>S.length<3}),literal:a,type:l,built_in:f},contains:[{scope:"type",match:b(o)},x,y,m,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function ER(e){return e?typeof e=="string"?e:e.source:null}function Bl(e){return nt("(?=",e,")")}function nt(...e){return e.map(n=>ER(n)).join("")}function Dpe(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function xn(...e){return"("+(Dpe(e).capture?"":"?:")+e.map(r=>ER(r)).join("|")+")"}const M0=e=>nt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Bpe=["Protocol","Type"].map(M0),wN=["init","self"].map(M0),zpe=["Any","Self"],xg=["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"],SN=["false","nil","true"],Fpe=["assignment","associativity","higherThan","left","lowerThan","none","right"],Upe=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],kN=["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"],_R=xn(/[/=\-+!*%<>&|^~?]/,/[\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]/),NR=xn(_R,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),wg=nt(_R,NR,"*"),jR=xn(/[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]/),Sh=xn(jR,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Ir=nt(jR,Sh,"*"),Nd=nt(/[A-Z]/,Sh,"*"),Wpe=["attached","autoclosure",nt(/convention\(/,xn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",nt(/objc\(/,Ir,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Hpe=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Gpe(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,xn(...Bpe,...wN)],className:{2:"keyword"}},a={match:nt(/\./,xn(...xg)),relevance:0},o=xg.filter(ge=>typeof ge=="string").concat(["_|0"]),l=xg.filter(ge=>typeof ge!="string").concat(zpe).map(M0),c={variants:[{className:"keyword",match:xn(...l,...wN)}]},u={$pattern:xn(/\b\w+/,/#\w+/),keyword:o.concat(Upe),literal:SN},d=[i,a,c],f={match:nt(/\./,xn(...kN)),relevance:0},h={className:"built_in",match:nt(/\b/,xn(...kN),/(?=\()/)},p=[f,h],g={match:/->/,relevance:0},m={className:"operator",relevance:0,variants:[{match:wg},{match:`\\.(\\.|${NR})+`}]},v=[g,m],y="([0-9]_*)+",b="([0-9a-fA-F]_*)+",x={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${b})(\\.(${b}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},k=(ge="")=>({className:"subst",variants:[{match:nt(/\\/,ge,/[0\\tnr"']/)},{match:nt(/\\/,ge,/u\{[0-9a-fA-F]{1,8}\}/)}]}),S=(ge="")=>({className:"subst",match:nt(/\\/,ge,/[\t ]*(?:[\r\n]|\r\n)/)}),w=(ge="")=>({className:"subst",label:"interpol",begin:nt(/\\/,ge,/\(/),end:/\)/}),_=(ge="")=>({begin:nt(ge,/"""/),end:nt(/"""/,ge),contains:[k(ge),S(ge),w(ge)]}),N=(ge="")=>({begin:nt(ge,/"/),end:nt(/"/,ge),contains:[k(ge),w(ge)]}),C={className:"string",variants:[_(),_("#"),_("##"),_("###"),N(),N("#"),N("##"),N("###")]},T=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],$={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:T},R=ge=>{const Be=nt(ge,/\//),pe=nt(/\//,ge);return{begin:Be,end:pe,contains:[...T,{scope:"comment",begin:`#(?!.*${pe})`,end:/$/}]}},L={scope:"regexp",variants:[R("###"),R("##"),R("#"),$]},I={match:nt(/`/,Ir,/`/)},z={className:"variable",match:/\$\d+/},D={className:"variable",match:`\\$${Sh}+`},F=[I,z,D],O={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Hpe,contains:[...v,x,C]}]}},P={scope:"keyword",match:nt(/@/,xn(...Wpe),Bl(xn(/\(/,/\s+/)))},A={scope:"meta",match:nt(/@/,Ir)},Y=[O,P,A],K={match:Bl(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:nt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Sh,"+")},{className:"type",match:Nd,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:nt(/\s+&\s+/,Bl(Nd)),relevance:0}]},M={begin:/</,end:/>/,keywords:u,contains:[...r,...d,...Y,g,K]};K.contains.push(M);const le={match:nt(Ir,/\s*:/),keywords:"_|0",relevance:0},be={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",le,...r,L,...d,...p,...v,x,C,...F,...Y,K]},me={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,K]},Pe={begin:xn(Bl(nt(Ir,/\s*:/)),Bl(nt(Ir,/\s+/,Ir,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Ir}]},H={begin:/\(/,end:/\)/,keywords:u,contains:[Pe,...r,...d,...v,x,C,...Y,K,be],endsParent:!0,illegal:/["']/},X={match:[/(func|macro)/,/\s+/,xn(I.match,Ir,wg)],className:{1:"keyword",3:"title.function"},contains:[me,H,t],illegal:[/\[/,/%/]},oe={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[me,H,t],illegal:/\[|%/},ce={match:[/operator/,/\s+/,wg],className:{1:"keyword",3:"title"}},Z={begin:[/precedencegroup/,/\s+/,Nd],className:{1:"keyword",3:"title"},contains:[K],keywords:[...Fpe,...SN],end:/}/},_e={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"}},Ne={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Ir,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[me,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:Nd},...d],relevance:0}]};for(const ge of C.variants){const Be=ge.contains.find(Ct=>Ct.label==="interpol");Be.keywords=u;const pe=[...d,...p,...v,x,C,...F];Be.contains=[...pe,{begin:/\(/,end:/\)/,contains:["self",...pe]}]}return{name:"Swift",keywords:u,contains:[...r,X,oe,_e,we,Ne,ce,Z,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},L,...d,...p,...v,x,C,...F,...Y,K,be]}}const kh="[A-Za-z$_][0-9A-Za-z$_]*",AR=["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"],TR=["true","false","null","undefined","NaN","Infinity"],CR=["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"],OR=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],PR=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],MR=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],RR=[].concat(PR,CR,OR);function qpe(e){const t=e.regex,n=(O,{after:P})=>{const A="</"+O[0].slice(1);return O.input.indexOf(A,P)!==-1},r=kh,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,P)=>{const A=O[0].length+O.index,Y=O.input[A];if(Y==="<"||Y===","){P.ignoreMatch();return}Y===">"&&(n(O,{after:A})||P.ignoreMatch());let K;const M=O.input.substring(A);if(K=M.match(/^\s*=/)){P.ignoreMatch();return}if((K=M.match(/^\s+extends\s+/))&&K.index===0){P.ignoreMatch();return}}},l={$pattern:kh,keyword:AR,literal:TR,built_in:RR,"variable.language":MR},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"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},b={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]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,v,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const k=[].concat(b,h.contains),S=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(k)}]),w={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},_={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},N={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:{_:[...CR,...OR]}},C={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},$={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function R(O){return t.concat("(?!",O.join("|"),")")}const L={match:t.concat(/\b/,R([...PR,"super","import","await"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},I={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",F={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:N},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),C,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,v,b,{match:/\$\d+/},f,N,{scope:"attr",match:r+t.lookahead(":"),relevance:0},F,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,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:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},I,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},L,$,_,z,{match:/\$[(.]/}]}}function Kpe(e){const t=e.regex,n=qpe(e),r=kh,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:kh,keyword:AR.concat(c),literal:TR,built_in:RR.concat(i),"variable.language":MR},d={className:"meta",begin:"@"+r},f=(m,v,y)=>{const b=m.contains.findIndex(x=>x.label===v);if(b===-1)throw new Error("can not find mode to replace");m.contains.splice(b,1,y)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(m=>m.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,a,o,p]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",l);const g=n.contains.find(m=>m.label==="func.def");return g.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Vpe(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\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(a,i),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(a,i),/ +/,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 Ype(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"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},a={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"}},a,o,i,e.QUOTE_STRING_MODE,c,u,l]}}function Xpe(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,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),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:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,l,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,o,c,l]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[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 Zpe(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]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={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,i]},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},g={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},m={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},v=[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},g,m,a,o],y=[...v];return y.pop(),y.push(l),p.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const Qpe={arduino:Ohe,bash:Phe,c:Mhe,cpp:Rhe,csharp:Ihe,css:Hhe,diff:Ghe,go:qhe,graphql:Khe,ini:Vhe,java:Yhe,javascript:epe,json:rpe,kotlin:ape,less:hpe,lua:ppe,makefile:mpe,markdown:gpe,objectivec:ype,perl:vpe,php:bpe,"php-template":xpe,plaintext:wpe,python:Spe,"python-repl":kpe,r:Epe,ruby:_pe,rust:Npe,scss:Ipe,shell:$pe,sql:Lpe,swift:Gpe,typescript:Kpe,vbnet:Vpe,wasm:Ype,xml:Xpe,yaml:Zpe};function IR(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)&&IR(n)}),e}class EN{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function $R(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 i in r)n[i]=r[i]}),n}const Jpe="</span>",_N=e=>!!e.scope,eme=(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,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${t}${e}`};class tme{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=$R(t)}openNode(t){if(!_N(t))return;const n=eme(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){_N(t)&&(this.buffer+=Jpe)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const NN=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class R0{constructor(){this.rootNode=NN(),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=NN({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=>{R0._collapse(n)}))}}class nme extends R0{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 tme(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function du(e){return e?typeof e=="string"?e:e.source:null}function LR(e){return gs("(?=",e,")")}function rme(e){return gs("(?:",e,")*")}function ime(e){return gs("(?:",e,")?")}function gs(...e){return e.map(n=>du(n)).join("")}function ame(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function I0(...e){return"("+(ame(e).capture?"":"?:")+e.map(r=>du(r)).join("|")+")"}function DR(e){return new RegExp(e.toString()+"|").exec("").length-1}function sme(e,t){const n=e&&e.exec(t);return n&&n.index===0}const ome=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function $0(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const i=n;let a=du(r),o="";for(;a.length>0;){const l=ome.exec(a);if(!l){o+=a;break}o+=a.substring(0,l.index),a=a.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?o+="\\"+String(Number(l[1])+i):(o+=l[0],l[0]==="("&&n++)}return o}).map(r=>`(${r})`).join(t)}const lme=/\b\B/,BR="[a-zA-Z]\\w*",L0="[a-zA-Z_]\\w*",zR="\\b\\d+(\\.\\d+)?",FR="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",UR="\\b(0b[01]+)",cme="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",ume=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=gs(t,/.*\b/,e.binary,/\b.*/)),Yi({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},fu={begin:"\\\\[\\s\\S]",relevance:0},dme={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[fu]},fme={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[fu]},hme={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/},Bp=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 i=I0("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:gs(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},pme=Bp("//","$"),mme=Bp("/\\*","\\*/"),gme=Bp("#","$"),yme={scope:"number",begin:zR,relevance:0},vme={scope:"number",begin:FR,relevance:0},bme={scope:"number",begin:UR,relevance:0},xme={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[fu,{begin:/\[/,end:/\]/,relevance:0,contains:[fu]}]},wme={scope:"title",begin:BR,relevance:0},Sme={scope:"title",begin:L0,relevance:0},kme={begin:"\\.\\s*"+L0,relevance:0},Eme=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 jd=Object.freeze({__proto__:null,APOS_STRING_MODE:dme,BACKSLASH_ESCAPE:fu,BINARY_NUMBER_MODE:bme,BINARY_NUMBER_RE:UR,COMMENT:Bp,C_BLOCK_COMMENT_MODE:mme,C_LINE_COMMENT_MODE:pme,C_NUMBER_MODE:vme,C_NUMBER_RE:FR,END_SAME_AS_BEGIN:Eme,HASH_COMMENT_MODE:gme,IDENT_RE:BR,MATCH_NOTHING_RE:lme,METHOD_GUARD:kme,NUMBER_MODE:yme,NUMBER_RE:zR,PHRASAL_WORDS_MODE:hme,QUOTE_STRING_MODE:fme,REGEXP_MODE:xme,RE_STARTERS_RE:cme,SHEBANG:ume,TITLE_MODE:wme,UNDERSCORE_IDENT_RE:L0,UNDERSCORE_TITLE_MODE:Sme});function _me(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function Nme(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function jme(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=_me,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Ame(e,t){Array.isArray(e.illegal)&&(e.illegal=I0(...e.illegal))}function Tme(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 Cme(e,t){e.relevance===void 0&&(e.relevance=1)}const Ome=(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=gs(n.beforeMatch,LR(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},Pme=["of","and","for","in","not","or","if","then","parent","list","value"],Mme="keyword";function WR(e,t,n=Mme){const r=Object.create(null);return typeof e=="string"?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(a){Object.assign(r,WR(e[a],t,a))}),r;function i(a,o){t&&(o=o.map(l=>l.toLowerCase())),o.forEach(function(l){const c=l.split("|");r[c[0]]=[a,Rme(c[0],c[1])]})}}function Rme(e,t){return t?Number(t):Ime(e)?0:1}function Ime(e){return Pme.includes(e.toLowerCase())}const jN={},Xa=e=>{console.error(e)},AN=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Rs=(e,t)=>{jN[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),jN[`${e}/${t}`]=!0)},Eh=new Error;function HR(e,t,{key:n}){let r=0;const i=e[n],a={},o={};for(let l=1;l<=t.length;l++)o[l+r]=i[l],a[l+r]=!0,r+=DR(t[l-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function $me(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Xa("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Eh;if(typeof e.beginScope!="object"||e.beginScope===null)throw Xa("beginScope must be object"),Eh;HR(e,e.begin,{key:"beginScope"}),e.begin=$0(e.begin,{joinWith:""})}}function Lme(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Xa("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Eh;if(typeof e.endScope!="object"||e.endScope===null)throw Xa("endScope must be object"),Eh;HR(e,e.end,{key:"endScope"}),e.end=$0(e.end,{joinWith:""})}}function Dme(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Bme(e){Dme(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),$me(e),Lme(e)}function zme(e){function t(o,l){return new RegExp(du(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+=DR(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t($0(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 i(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 a(o,l){const c=o;if(o.isCompiled)return c;[Nme,Tme,Bme,Ome].forEach(d=>d(o,l)),e.compilerExtensions.forEach(d=>d(o,l)),o.__beforeBegin=null,[jme,Ame,Cme].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=WR(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=du(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 Fme(d==="self"?o:d)})),o.contains.forEach(function(d){a(d,c)}),o.starts&&a(o.starts,l),c.matcher=i(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||{}),a(e)}function GR(e){return e?e.endsWithParent||GR(e.starts):!1}function Fme(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Yi(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:GR(e)?Yi(e,{starts:e.starts?Yi(e.starts):null}):Object.isFrozen(e)?Yi(e):e}var Ume="11.11.2";class Wme extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const Sg=$R,TN=Yi,CN=Symbol("nomatch"),Hme=7,qR=function(e){const t=Object.create(null),n=Object.create(null),r=[];let i=!0;const a="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:nme};function c(D){return l.noHighlightRe.test(D)}function u(D){let F=D.className+" ";F+=D.parentNode?D.parentNode.className:"";const O=l.languageDetectRe.exec(F);if(O){const P=N(O[1]);return P||(AN(a.replace("{}",O[1])),AN("Falling back to no-highlight mode for this block.",D)),P?O[1]:"no-highlight"}return F.split(/\s+/).find(P=>c(P)||N(P))}function d(D,F,O){let P="",A="";typeof F=="object"?(P=D,O=F.ignoreIllegals,A=F.language):(Rs("10.7.0","highlight(lang, code, ...args) has been deprecated."),Rs("10.7.0",`Please use highlight(code, options) instead.
197
- https://github.com/highlightjs/highlight.js/issues/2277`),A=D,P=F),O===void 0&&(O=!0);const Y={code:P,language:A};I("before:highlight",Y);const K=Y.result?Y.result:f(Y.language,Y.code,O);return K.code=Y.code,I("after:highlight",K),K}function f(D,F,O,P){const A=Object.create(null);function Y(U,V){return U.keywords[V]}function K(){if(!pe.keywords){We.addText(Oe);return}let U=0;pe.keywordPatternRe.lastIndex=0;let V=pe.keywordPatternRe.exec(Oe),se="";for(;V;){se+=Oe.substring(U,V.index);const fe=Ne.case_insensitive?V[0].toLowerCase():V[0],Se=Y(pe,fe);if(Se){const[Qe,Lt]=Se;if(We.addText(se),se="",A[fe]=(A[fe]||0)+1,A[fe]<=Hme&&(Ze+=Lt),Qe.startsWith("_"))se+=V[0];else{const Ot=Ne.classNameAliases[Qe]||Qe;be(V[0],Ot)}}else se+=V[0];U=pe.keywordPatternRe.lastIndex,V=pe.keywordPatternRe.exec(Oe)}se+=Oe.substring(U),We.addText(se)}function M(){if(Oe==="")return;let U=null;if(typeof pe.subLanguage=="string"){if(!t[pe.subLanguage]){We.addText(Oe);return}U=f(pe.subLanguage,Oe,!0,Ct[pe.subLanguage]),Ct[pe.subLanguage]=U._top}else U=p(Oe,pe.subLanguage.length?pe.subLanguage:null);pe.relevance>0&&(Ze+=U.relevance),We.__addSublanguage(U._emitter,U.language)}function le(){pe.subLanguage!=null?M():K(),Oe=""}function be(U,V){U!==""&&(We.startScope(V),We.addText(U),We.endScope())}function me(U,V){let se=1;const fe=V.length-1;for(;se<=fe;){if(!U._emit[se]){se++;continue}const Se=Ne.classNameAliases[U[se]]||U[se],Qe=V[se];Se?be(Qe,Se):(Oe=Qe,K(),Oe=""),se++}}function Pe(U,V){return U.scope&&typeof U.scope=="string"&&We.openNode(Ne.classNameAliases[U.scope]||U.scope),U.beginScope&&(U.beginScope._wrap?(be(Oe,Ne.classNameAliases[U.beginScope._wrap]||U.beginScope._wrap),Oe=""):U.beginScope._multi&&(me(U.beginScope,V),Oe="")),pe=Object.create(U,{parent:{value:pe}}),pe}function H(U,V,se){let fe=sme(U.endRe,se);if(fe){if(U["on:end"]){const Se=new EN(U);U["on:end"](V,Se),Se.isMatchIgnored&&(fe=!1)}if(fe){for(;U.endsParent&&U.parent;)U=U.parent;return U}}if(U.endsWithParent)return H(U.parent,V,se)}function X(U){return pe.matcher.regexIndex===0?(Oe+=U[0],1):($t=!0,0)}function oe(U){const V=U[0],se=U.rule,fe=new EN(se),Se=[se.__beforeBegin,se["on:begin"]];for(const Qe of Se)if(Qe&&(Qe(U,fe),fe.isMatchIgnored))return X(V);return se.skip?Oe+=V:(se.excludeBegin&&(Oe+=V),le(),!se.returnBegin&&!se.excludeBegin&&(Oe=V)),Pe(se,U),se.returnBegin?0:V.length}function ce(U){const V=U[0],se=F.substring(U.index),fe=H(pe,U,se);if(!fe)return CN;const Se=pe;pe.endScope&&pe.endScope._wrap?(le(),be(V,pe.endScope._wrap)):pe.endScope&&pe.endScope._multi?(le(),me(pe.endScope,U)):Se.skip?Oe+=V:(Se.returnEnd||Se.excludeEnd||(Oe+=V),le(),Se.excludeEnd&&(Oe=V));do pe.scope&&We.closeNode(),!pe.skip&&!pe.subLanguage&&(Ze+=pe.relevance),pe=pe.parent;while(pe!==fe.parent);return fe.starts&&Pe(fe.starts,U),Se.returnEnd?0:V.length}function Z(){const U=[];for(let V=pe;V!==Ne;V=V.parent)V.scope&&U.unshift(V.scope);U.forEach(V=>We.openNode(V))}let _e={};function we(U,V){const se=V&&V[0];if(Oe+=U,se==null)return le(),0;if(_e.type==="begin"&&V.type==="end"&&_e.index===V.index&&se===""){if(Oe+=F.slice(V.index,V.index+1),!i){const fe=new Error(`0 width match regex (${D})`);throw fe.languageName=D,fe.badRule=_e.rule,fe}return 1}if(_e=V,V.type==="begin")return oe(V);if(V.type==="illegal"&&!O){const fe=new Error('Illegal lexeme "'+se+'" for mode "'+(pe.scope||"<unnamed>")+'"');throw fe.mode=pe,fe}else if(V.type==="end"){const fe=ce(V);if(fe!==CN)return fe}if(V.type==="illegal"&&se==="")return V.index===F.length||(Oe+=`
198
- `),1;if(Qt>1e5&&Qt>V.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Oe+=se,se.length}const Ne=N(D);if(!Ne)throw Xa(a.replace("{}",D)),new Error('Unknown language: "'+D+'"');const ge=zme(Ne);let Be="",pe=P||ge;const Ct={},We=new l.__emitter(l);Z();let Oe="",Ze=0,Me=0,Qt=0,$t=!1;try{if(Ne.__emitTokens)Ne.__emitTokens(F,We);else{for(pe.matcher.considerAll();;){Qt++,$t?$t=!1:pe.matcher.considerAll(),pe.matcher.lastIndex=Me;const U=pe.matcher.exec(F);if(!U)break;const V=F.substring(Me,U.index),se=we(V,U);Me=U.index+se}we(F.substring(Me))}return We.finalize(),Be=We.toHTML(),{language:D,value:Be,relevance:Ze,illegal:!1,_emitter:We,_top:pe}}catch(U){if(U.message&&U.message.includes("Illegal"))return{language:D,value:Sg(F),illegal:!0,relevance:0,_illegalBy:{message:U.message,index:Me,context:F.slice(Me-100,Me+100),mode:U.mode,resultSoFar:Be},_emitter:We};if(i)return{language:D,value:Sg(F),illegal:!1,relevance:0,errorRaised:U,_emitter:We,_top:pe};throw U}}function h(D){const F={value:Sg(D),illegal:!1,relevance:0,_top:o,_emitter:new l.__emitter(l)};return F._emitter.addText(D),F}function p(D,F){F=F||l.languages||Object.keys(t);const O=h(D),P=F.filter(N).filter(T).map(le=>f(le,D,!1));P.unshift(O);const A=P.sort((le,be)=>{if(le.relevance!==be.relevance)return be.relevance-le.relevance;if(le.language&&be.language){if(N(le.language).supersetOf===be.language)return 1;if(N(be.language).supersetOf===le.language)return-1}return 0}),[Y,K]=A,M=Y;return M.secondBest=K,M}function g(D,F,O){const P=F&&n[F]||O;D.classList.add("hljs"),D.classList.add(`language-${P}`)}function m(D){let F=null;const O=u(D);if(c(O))return;if(I("before:highlightElement",{el:D,language:O}),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 Wme("One of your code blocks includes unescaped HTML.",D.innerHTML);F=D;const P=F.textContent,A=O?d(P,{language:O,ignoreIllegals:!0}):p(P);D.innerHTML=A.value,D.dataset.highlighted="yes",g(D,O,A.language),D.result={language:A.language,re:A.relevance,relevance:A.relevance},A.secondBest&&(D.secondBest={language:A.secondBest.language,relevance:A.secondBest.relevance}),I("after:highlightElement",{el:D,result:A,text:P})}function v(D){l=TN(l,D)}const y=()=>{k(),Rs("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function b(){k(),Rs("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function k(){function D(){k()}if(document.readyState==="loading"){x||window.addEventListener("DOMContentLoaded",D,!1),x=!0;return}document.querySelectorAll(l.cssSelector).forEach(m)}function S(D,F){let O=null;try{O=F(e)}catch(P){if(Xa("Language definition for '{}' could not be registered.".replace("{}",D)),i)Xa(P);else throw P;O=o}O.name||(O.name=D),t[D]=O,O.rawDefinition=F.bind(null,e),O.aliases&&C(O.aliases,{languageName:D})}function w(D){delete t[D];for(const F of Object.keys(n))n[F]===D&&delete n[F]}function _(){return Object.keys(t)}function N(D){return D=(D||"").toLowerCase(),t[D]||t[n[D]]}function C(D,{languageName:F}){typeof D=="string"&&(D=[D]),D.forEach(O=>{n[O.toLowerCase()]=F})}function T(D){const F=N(D);return F&&!F.disableAutodetect}function $(D){D["before:highlightBlock"]&&!D["before:highlightElement"]&&(D["before:highlightElement"]=F=>{D["before:highlightBlock"](Object.assign({block:F.el},F))}),D["after:highlightBlock"]&&!D["after:highlightElement"]&&(D["after:highlightElement"]=F=>{D["after:highlightBlock"](Object.assign({block:F.el},F))})}function R(D){$(D),r.push(D)}function L(D){const F=r.indexOf(D);F!==-1&&r.splice(F,1)}function I(D,F){const O=D;r.forEach(function(P){P[O]&&P[O](F)})}function z(D){return Rs("10.7.0","highlightBlock will be removed entirely in v12.0"),Rs("10.7.0","Please use highlightElement now."),m(D)}Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:k,highlightElement:m,highlightBlock:z,configure:v,initHighlighting:y,initHighlightingOnLoad:b,registerLanguage:S,unregisterLanguage:w,listLanguages:_,getLanguage:N,registerAliases:C,autoDetection:T,inherit:TN,addPlugin:R,removePlugin:L}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=Ume,e.regex={concat:gs,lookahead:LR,either:I0,optional:ime,anyNumberOfTimes:rme};for(const D in jd)typeof jd[D]=="object"&&IR(jd[D]);return Object.assign(e,jd),e},Uo=qR({});Uo.newInstance=()=>qR({});var Gme=Uo;Uo.HighlightJS=Uo;Uo.default=Uo;const qme=Xe(Gme),ON={},Kme="hljs-";function Vme(e){const t=qme.newInstance();return e&&a(e),{highlight:n,highlightAuto:r,listLanguages:i,register:a,registerAlias:o,registered:l};function n(c,u,d){const f=d||ON,h=typeof f.prefix=="string"?f.prefix:Kme;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:Yme,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 g=p._emitter.root,m=g.data;return m.language=p.language,m.relevance=p.relevance,g}function r(c,u){const f=(u||ON).subset||i();let h=-1,p=0,g;for(;++h<f.length;){const m=f[h];if(!t.getLanguage(m))continue;const v=n(m,c,u);v.data&&v.data.relevance!==void 0&&v.data.relevance>p&&(p=v.data.relevance,g=v)}return g||{type:"root",children:[],data:{language:void 0,relevance:p}}}function i(){return t.listLanguages()}function a(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 Yme{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],i=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(t){const n=this,r=t.split(".").map(function(o,l){return l?o+"_".repeat(l):n.options.classPrefix+o}),i=this.stack[this.stack.length-1],a={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(a),this.stack.push(a)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const Xme={};function Zme(e){const t=e||Xme,n=t.aliases,r=t.detect||!1,i=t.languages||Qpe,a=t.plainText,o=t.prefix,l=t.subset;let c="hljs";const u=Vme(i);if(n&&u.registerAlias(n),o){const d=o.indexOf("-");c=d===-1?o:o.slice(0,d)}return function(d,f){Dp(d,"element",function(h,p,g){if(h.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const m=Qme(h);if(m===!1||!m&&!r||m&&a&&a.includes(m))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(c)||h.properties.className.unshift(c);const v=khe(h,{whitespace:"pre"});let y;try{y=m?u.highlight(m,v,{prefix:o}):u.highlightAuto(v,{prefix:o,subset:l})}catch(b){const x=b;if(m&&/Unknown language/.test(x.message)){f.message("Cannot highlight as `"+m+"`, it’s not registered",{ancestors:[g,h],cause:x,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw x}!m&&y.data&&y.data.language&&h.properties.className.push("language-"+y.data.language),y.children.length>0&&(h.children=y.children)})}}function Qme(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let r;for(;++n<t.length;){const i=String(t[n]);if(i==="no-highlight"||i==="nohighlight")return!1;!r&&i.slice(0,5)==="lang-"&&(r=i.slice(5)),!r&&i.slice(0,9)==="language-"&&(r=i.slice(9))}return r}const _h="[A-Za-z$_][0-9A-Za-z$_]*",KR=["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"],VR=["true","false","null","undefined","NaN","Infinity"],YR=["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"],XR=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ZR=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],QR=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],JR=[].concat(ZR,YR,XR);function Jme(e){const t=e.regex,n=(O,{after:P})=>{const A="</"+O[0].slice(1);return O.input.indexOf(A,P)!==-1},r=_h,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,P)=>{const A=O[0].length+O.index,Y=O.input[A];if(Y==="<"||Y===","){P.ignoreMatch();return}Y===">"&&(n(O,{after:A})||P.ignoreMatch());let K;const M=O.input.substring(A);if(K=M.match(/^\s*=/)){P.ignoreMatch();return}if((K=M.match(/^\s+extends\s+/))&&K.index===0){P.ignoreMatch();return}}},l={$pattern:_h,keyword:KR,literal:VR,built_in:JR,"variable.language":QR},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"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},b={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]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,v,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const k=[].concat(b,h.contains),S=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(k)}]),w={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},_={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},N={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:{_:[...YR,...XR]}},C={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},$={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function R(O){return t.concat("(?!",O.join("|"),")")}const L={match:t.concat(/\b/,R([...ZR,"super","import","await"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},I={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",F={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:N},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),C,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,v,b,{match:/\$\d+/},f,N,{scope:"attr",match:r+t.lookahead(":"),relevance:0},F,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,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:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},I,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},L,$,_,z,{match:/\$[(.]/}]}}function PN(e){const t=e.regex,n=Jme(e),r=_h,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:_h,keyword:KR.concat(c),literal:VR,built_in:JR.concat(i),"variable.language":QR},d={className:"meta",begin:"@"+r},f=(m,v,y)=>{const b=m.contains.findIndex(x=>x.label===v);if(b===-1)throw new Error("can not find mode to replace");m.contains.splice(b,1,y)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(m=>m.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,a,o,p]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",l);const g=n.contains.find(m=>m.label==="func.def");return g.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}const MN="[A-Za-z$_][0-9A-Za-z$_]*",ege=["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"],tge=["true","false","null","undefined","NaN","Infinity"],e2=["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"],t2=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],n2=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],nge=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],rge=[].concat(n2,e2,t2);function RN(e){const t=e.regex,n=(O,{after:P})=>{const A="</"+O[0].slice(1);return O.input.indexOf(A,P)!==-1},r=MN,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,P)=>{const A=O[0].length+O.index,Y=O.input[A];if(Y==="<"||Y===","){P.ignoreMatch();return}Y===">"&&(n(O,{after:A})||P.ignoreMatch());let K;const M=O.input.substring(A);if(K=M.match(/^\s*=/)){P.ignoreMatch();return}if((K=M.match(/^\s+extends\s+/))&&K.index===0){P.ignoreMatch();return}}},l={$pattern:MN,keyword:ege,literal:tge,built_in:rge,"variable.language":nge},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"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},b={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]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,v,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const k=[].concat(b,h.contains),S=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(k)}]),w={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},_={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},N={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:{_:[...e2,...t2]}},C={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},$={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function R(O){return t.concat("(?!",O.join("|"),")")}const L={match:t.concat(/\b/,R([...n2,"super","import","await"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},I={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",F={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:N},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),C,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,v,b,{match:/\$\d+/},f,N,{scope:"attr",match:r+t.lookahead(":"),relevance:0},F,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,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:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},I,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},L,$,_,z,{match:/\$[(.]/}]}}const ige="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",age={scope:"number",match:ige,relevance:0};function sge(e){const t={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:r},contains:[t,n,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,i,age,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function oge(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 i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.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}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],y={match:/(\/[a-z._-]+)+/},b=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],x=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],k=["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:m,literal:v,built_in:[...b,...x,"set","shopt",...k,...S]},contains:[p,e.SHEBANG(),g,f,a,o,y,l,c,u,d,n]}}function IN(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[./~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function $N(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})\\.`,g=`\\b|${r.join("|")}`,m={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${p}))[eE][+-]?(${h})[jJ]?(?=${g})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${h})[jJ](?=${g})`}]},v={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,m,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,m,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,m,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,v,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{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:[m,y,f]}]}}function LN(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={match:/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/},i={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}]},a={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(y=>{y.contains=y.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,a,r,u,d,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},i,c,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function DN(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]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={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,i]},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},g={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},m={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},v=[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},g,m,a,o],y=[...v];return y.pop(),y.push(l),p.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}function lge(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 cge(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],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,g=[...u,...c].filter(S=>!d.includes(S)),m={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function b(S){return t.concat(/\b/,t.either(...S.map(w=>w.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:b(h),relevance:0};function k(S,{exceptions:w,when:_}={}){const N=_;return w=w||[],S.map(C=>C.match(/\|\d+$/)||w.includes(C)?C:N(C)?`${C}|0`:C)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:k(g,{when:S=>S.length<3}),literal:a,type:l,built_in:f},contains:[{scope:"type",match:b(o)},x,y,m,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function BN(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,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),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:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,l,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,o,c,l]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[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 uge=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_-]*/}}),dge=["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"],fge=["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"],hge=[...dge,...fge],pge=["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(),mge=["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(),gge=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),yge=["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 vge(e){const t=e.regex,n=uge(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",a=/@-?\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:":("+mge.join("|")+")"},{begin:":(:)?("+gge.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+yge.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:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:pge.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+hge.join("|")+")\\b"}]}}function zN(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}const bge={ts:PN,typescript:PN,js:RN,javascript:RN,json:sge,bash:oge,shell:IN,sh:IN,python:$N,py:$N,markdown:LN,md:LN,yaml:DN,yml:DN,diff:lge,sql:cge,html:BN,xml:BN,css:vge,text:zN,plaintext:zN};function r2(e){if(e==null)return"";const t=e;return typeof t.value=="string"?t.value:Array.isArray(t.children)?t.children.map(r2).join(""):""}function xge({lang:e,code:t,children:n}){const[r,i]=E.useState(!1),a=async()=>{var o;try{await((o=navigator.clipboard)==null?void 0:o.writeText(t)),i(!0),setTimeout(()=>i(!1),1500)}catch{}};return s.jsxs("div",{className:"md-code-block",children:[s.jsxs("div",{className:"md-code-head",children:[s.jsx("span",{className:"md-code-lang",children:e}),s.jsx("button",{type:"button",className:"md-code-copy",onClick:()=>void a(),children:r?"✓ Copied":"⧉ Copy"})]}),s.jsx("pre",{className:"md-code-pre",children:s.jsx("code",{children:n})})]})}function wge({node:e,children:t}){var o,l,c,u;const n=(o=e==null?void 0:e.children)==null?void 0:o[0],i=((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",a=E.useMemo(()=>r2(n),[n]);return s.jsx(xge,{lang:i,code:a,children:t})}function FN({text:e}){const t=E.useMemo(()=>({h1:({node:n,...r})=>s.jsx("h1",{className:"md-heading md-h1",...r}),h2:({node:n,...r})=>s.jsx("h2",{className:"md-heading md-h2",...r}),h3:({node:n,...r})=>s.jsx("h3",{className:"md-heading md-h3",...r}),h4:({node:n,...r})=>s.jsx("h4",{className:"md-heading md-h4",...r}),h5:({node:n,...r})=>s.jsx("h5",{className:"md-heading md-h5",...r}),h6:({node:n,...r})=>s.jsx("h6",{className:"md-heading md-h6",...r}),p:({node:n,...r})=>s.jsx("p",{className:"md-para",...r}),ul:({node:n,...r})=>s.jsx("ul",{className:"md-list md-ul",...r}),ol:({node:n,...r})=>s.jsx("ol",{className:"md-list md-ol",...r}),blockquote:({node:n,...r})=>s.jsx("blockquote",{className:"md-quote",...r}),hr:({node:n,...r})=>s.jsx("hr",{className:"md-hr",...r}),table:({node:n,...r})=>s.jsx("table",{className:"md-table",...r}),a:({node:n,...r})=>s.jsx("a",{target:"_blank",rel:"noreferrer",...r}),pre:wge}),[]);return s.jsx("div",{className:"md-root",children:s.jsx(rde,{remarkPlugins:[ghe],rehypePlugins:[[Zme,{languages:bge}]],components:t,children:e??""})})}const UN=/```([\w+-]*)\n([\s\S]*?)```/g;function Sge(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 kge(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 Ege(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 _ge(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 WN=/https?:\/\/[^\s)\]}"'<>]+/i,HN=/(🚀|deploy(?:ed|ment|ing)?|live at|published|available at|open the)/i;function Nge(e){return e.replace(/[.,;:!?]+$/,"")}function jge(e){const t=e.split(`
202
- `),n=[],r=new Set;for(let i=0;i<t.length;i+=1){const a=t[i];let o=a.match(HN);!o&&i+1<t.length&&/deploy(?:ed|ment|ing)?:\s*$/i.test(a.trim())&&(o=t[i+1].match(HN));const l=a.match(WN)||(i+1<t.length?t[i+1].match(WN):null);if(!o||!l)continue;const c=Nge(l[0]);r.has(c)||(r.add(c),n.push({url:c,title:a.trim().slice(0,80)||"Deployment"}))}return n}function GN(e){const t=[],n=[],r=[];UN.lastIndex=0;let i;for(;(i=UN.exec(e))!==null;){const a=(i[1]||"").toLowerCase(),o=i[2];if(a==="diff"||o.includes("diff --git ")){const l=Sge(o);l.length>0&&t.push({files:l,summary:`${l.length} file${l.length===1?"":"s"} changed`})}else kge(o)&&n.push({verdict:Ege(o),title:_ge(o),body:o})}for(const a of jge(e))r.push(a);return{diffs:t,results:n,deploys:r}}const Age=/\x1b(?:\[[0-9;?]*[ -/]*[@-~]|\][^\x07\x1b]*(?:\x07|\x1b\\)|[@-Z\\-_])/g;function qN(e){return e?e.replace(Age,""):""}const KN=3e5,Tge=2e3;function Cge(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"?"🤔":"🔧"}const Oge={running:"⏳ running",done:"✅ done",failed:"❌ failed",cancelled:"⏹ cancelled",timeout:"⏰ timed out",error:"💥 error"};function Ad({diff:e,selectable:t=!1,onCommitAccepted:n,lockedHint:r}){const[i,a]=E.useState(null),o=new Set(i??e.files.map(d=>d.path)),l=d=>{a(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 s.jsxs("div",{className:"chat-diff-card",children:[s.jsxs("div",{className:"chat-diff-head",children:[s.jsx("span",{className:"chat-diff-icon",children:"🔧"}),s.jsx("span",{className:"chat-diff-title",children:"git diff"}),s.jsxs("span",{className:"chat-diff-meta",children:[e.files.length," file",e.files.length===1?"":"s"," · +",c," −",u]})]}),s.jsx("div",{className:"chat-diff-files",children:e.files.map(d=>{const f=o.has(d.path);return s.jsxs("details",{className:`chat-diff-file${f?"":" chat-diff-file-rejected"}`,open:e.files.length===1,children:[s.jsxs("summary",{className:"chat-diff-file-path",children:[t?s.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]}),s.jsx("pre",{className:"chat-diff-body",children:d.body.split(`
203
- `).map((h,p)=>{const g=h.startsWith("+")?"diff-add":h.startsWith("-")?"diff-del":h.startsWith("@@")?"diff-hunk":"";return s.jsx("div",{className:`chat-diff-line ${g}`,children:h||" "},p)})})]},d.path)})}),t&&n?s.jsxs("div",{className:"chat-diff-actions",children:[s.jsxs("button",{className:"admin-refresh-btn",type:"button",disabled:o.size===0,onClick:()=>n([...o]),children:["Commit accepted (",o.size,")"]}),s.jsx("span",{className:"admin-hint",children:"Only accepted files are committed — the agent re-confirms with a question card."})]}):r?s.jsx("div",{className:"chat-diff-actions",children:s.jsxs("span",{className:"admin-hint chat-diff-locked",children:["🔒 ",r]})}):null]})}function D0({text:e,label:t}){const[n,r]=E.useState(!1),i=async()=>{var a;try{await((a=navigator.clipboard)==null?void 0:a.writeText(e)),r(!0),setTimeout(()=>r(!1),1500)}catch{}};return s.jsx("button",{type:"button",className:"chat-card-copy",title:`Copy ${t}`,onClick:()=>void i(),children:n?"✓ Copied":"⧉ Copy"})}function Pge({result:e}){const t=e.verdict==="pass"?"✅":e.verdict==="fail"?"❌":"📋";return s.jsxs("div",{className:`chat-result-card chat-result-${e.verdict}`,children:[s.jsxs("div",{className:"chat-result-head",children:[s.jsx("span",{className:"chat-result-icon",children:t}),s.jsx("span",{className:"chat-result-title",children:e.title}),s.jsx("span",{className:"chat-result-meta",children:e.verdict}),s.jsx(D0,{text:e.body,label:"result output"})]}),s.jsx("pre",{className:"chat-result-body",children:e.body})]})}function Mge({deploy:e}){return s.jsxs("div",{className:"chat-deploy-card",children:[s.jsxs("div",{className:"chat-deploy-head",children:[s.jsx("span",{className:"chat-deploy-icon",children:"🚀"}),s.jsx("span",{className:"chat-deploy-title",children:e.title||"Deployment"}),s.jsx(D0,{text:e.url,label:"deployment URL"})]}),s.jsx("a",{className:"chat-deploy-url",href:e.url,target:"_blank",rel:"noopener noreferrer",children:e.url})]})}function Rge({children:e}){const t=E.useRef(null),n=r=>{if(!t.current)return;const i=Array.from(t.current.querySelectorAll("[data-artifact-card]"));if(i.length===0)return;const a=i.indexOf(document.activeElement);let o=-1;r.key==="ArrowDown"?o=a+1>=i.length?0:a+1:r.key==="ArrowUp"?o=a-1<0?i.length-1:a-1:r.key==="Home"?o=0:r.key==="End"&&(o=i.length-1),o>=0&&o!==a&&(r.preventDefault(),i[o].focus())};return s.jsx("div",{className:"chat-artifacts",ref:t,role:"group","aria-label":"Artifacts",onKeyDown:n,children:e})}function Ige({task:e,onCancel:t}){const n=e.status==="running",r=e.logs.map(i=>qN(i.text)).join(`
204
- `);return s.jsxs("div",{className:`chat-task-card${n?" chat-task-running":e.status==="done"?" chat-task-ok":" chat-task-err"}`,children:[s.jsxs("div",{className:"chat-task-head",children:[s.jsx("span",{className:"chat-task-icon",children:"⚙️"}),s.jsx("code",{className:"chat-task-cmd",children:e.command}),s.jsx("span",{className:"chat-task-status",title:e.status,children:Oge[e.status]}),!n&&e.exitCode!==null?s.jsxs("span",{className:"chat-task-exit",children:["exit ",e.exitCode]}):null,!n&&e.durationMs!==null?s.jsxs("span",{className:"chat-task-dur",children:[e.durationMs,"ms"]}):null,r?s.jsx(D0,{text:r,label:"task output"}):null,n&&t?s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:t,children:"⏹ Cancel"}):null]}),s.jsx("pre",{className:"chat-task-logs",role:"log",children:e.logs.length>0?e.logs.map((i,a)=>{const o=e.logs[a-1],l=o&&o.stream!==i.stream,c=qN(i.text)||" ";return s.jsxs("div",{children:[l?s.jsx("div",{className:`chat-task-log-sep chat-task-log-sep-${i.stream}`,"aria-hidden":"true",children:i.stream}):null,s.jsx("div",{className:`chat-task-log chat-task-log-${i.stream}`,children:c})]},a)}):s.jsx("div",{className:"admin-hint",children:n?"Waiting for output…":"(no output)"})})]})}function VN({draft:e,onAccept:t,onReject:n,onEdit:r}){const i=e.status??"pending",a=e.markdown.split(`
205
- `),o=a.findIndex(c=>c.startsWith("# "))>=0?a.findIndex(c=>c.startsWith("# ")):0,l=a.slice(o,o+14).join(`
206
- `);return s.jsxs("div",{className:`chat-draft-card${i==="saved"?" chat-draft-saved":""}${i==="rejected"?" chat-draft-rejected":""}`,children:[s.jsxs("div",{className:"chat-draft-head",children:[s.jsx("span",{className:"chat-draft-icon",children:"🧠"}),s.jsxs("span",{className:"chat-draft-title",children:["New skill draft: ",e.name]}),s.jsx("span",{className:"chat-draft-meta",children:"pending your review"})]}),s.jsx("p",{className:"chat-draft-desc",children:e.description}),s.jsx("pre",{className:"chat-draft-body",children:l}),i==="saving"?s.jsx("div",{className:"admin-hint",children:"Saving…"}):i==="saved"?s.jsx("div",{className:"admin-hint",children:"✅ Saved — the skill is live: load it in chat or see it in the Agent Hub Skills tab."}):i==="rejected"?s.jsx("div",{className:"admin-hint",children:"🗑️ Rejected — the draft was discarded, nothing was saved."}):s.jsxs("div",{className:"chat-draft-actions",children:[s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>t(e.name),children:"✅ Accept"}),s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>r(e.name),children:"✏️ Edit"}),s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>n(e.name),children:"↩ Reject"})]})]})}function $ge({request:e,onSave:t}){const[n,r]=E.useState({}),[i,a]=E.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 s.jsxs("div",{className:"chat-secret-card",children:[s.jsxs("div",{className:"chat-secret-head",children:[s.jsx("span",{className:"chat-secret-icon",children:"🔐"}),s.jsxs("span",{className:"chat-secret-title",children:[e.skillName," needs environment variables"]})]}),l.length>0?s.jsxs("div",{className:"chat-secret-persisted",children:["Already configured: ",l.map(u=>s.jsx("code",{children:u},u)).join(", ")]}):null,c.length>0&&!i?s.jsxs("div",{className:"chat-secret-fields",children:[c.map(u=>s.jsxs("div",{className:"chat-secret-row",children:[s.jsxs("label",{className:"chat-secret-label",htmlFor:`secret-${u}`,children:[u,":"]}),s.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)),s.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:!o,onClick:()=>{t(n),a(!0)},children:"💾 Save to ~/.buff/.env"})]}):i?s.jsx("div",{className:"admin-hint",children:"✅ Saved — the skill will pick up these values on next load."}):s.jsx("div",{className:"admin-hint",children:"All required env vars are already configured."})]})}function Lge({result:e}){const[t,n]=E.useState(!1),r=e.success?"✅":"❌",i=e.success?"Success":`Failed (exit ${e.exitCode})`,a=e.success?"chat-exec-success":"chat-exec-failure",o=new Date(e.timestamp).toLocaleTimeString();return s.jsxs("div",{className:`chat-exec-card ${a}`,children:[s.jsxs("div",{className:"chat-exec-head",onClick:()=>n(!t),style:{cursor:"pointer"},children:[s.jsx("span",{className:"chat-exec-icon",children:"📜"}),s.jsx("span",{className:"chat-exec-title",children:e.skillName}),s.jsxs("span",{className:"chat-exec-status",children:[r," ",i]}),s.jsxs("span",{className:"chat-exec-meta",children:[e.runtime," · ",e.durationMs,"ms · ",o]}),s.jsx("span",{className:"chat-exec-expand",children:t?"▼":"▶"})]}),t&&s.jsxs("div",{className:"chat-exec-body",children:[e.stdout&&s.jsxs("div",{className:"chat-exec-section",children:[s.jsx("div",{className:"chat-exec-section-title",children:"stdout"}),s.jsx("pre",{className:"chat-exec-output",children:e.stdout})]}),e.stderr&&s.jsxs("div",{className:"chat-exec-section chat-exec-stderr",children:[s.jsx("div",{className:"chat-exec-section-title",children:"stderr"}),s.jsx("pre",{className:"chat-exec-output",children:e.stderr})]}),s.jsxs("div",{className:"chat-exec-details",children:[s.jsxs("span",{children:["Runtime: ",e.runtime]}),s.jsxs("span",{children:["Exit code: ",e.exitCode]}),s.jsxs("span",{children:["Duration: ",e.durationMs,"ms"]})]})]})]})}function Dge(e){return e==="done"?"✅":e==="running"?"🔄":e==="blocked"?"⛔":"⬜"}function YN({plan:e}){const t=e.steps.filter(n=>n.status==="done").length;return s.jsxs("div",{className:"chat-plan-card",children:[s.jsxs("div",{className:"chat-plan-head",children:[s.jsx("span",{className:"chat-plan-icon",children:"🗂️"}),s.jsx("span",{className:"chat-plan-goal",children:e.goal}),s.jsxs("span",{className:"chat-plan-count",children:[t,"/",e.steps.length," done"]})]}),s.jsx("div",{className:"chat-plan-steps",children:e.steps.map(n=>s.jsxs("div",{className:`chat-plan-step chat-plan-step-${n.status}`,children:[s.jsx("span",{className:"chat-plan-step-icon",children:Dge(n.status)}),s.jsx("span",{className:"chat-plan-step-text",children:n.description}),s.jsx("span",{className:"chat-plan-step-status",children:n.status})]},n.id))})]})}function XN({tools:e,live:t}){return!e||e.length===0?null:s.jsx("div",{className:`chat-tool-cards${t?" chat-tool-cards-live":""}`,children:e.map(n=>{const r=n.phase==="started"||n.ok===void 0,i=n.ok===!1;return s.jsxs("div",{className:`chat-tool-card${r?" chat-tool-running":i?" chat-tool-err":" chat-tool-ok"}`,children:[s.jsxs("div",{className:"chat-tool-head",children:[s.jsx("span",{className:"chat-tool-icon",children:Cge(n.tool)}),s.jsx("span",{className:"chat-tool-name",children:n.tool}),n.args?s.jsx("code",{className:"chat-tool-args",children:n.args}):null,s.jsx("span",{className:"chat-tool-status",title:r?"running":i?"failed":"done",children:r?"⏳":i?"✗":"✓"}),n.durationMs!==void 0&&!r?s.jsxs("span",{className:"chat-tool-dur",children:[n.durationMs,"ms"]}):null]}),n.error||n.result?s.jsxs("details",{className:"chat-tool-detail",children:[s.jsx("summary",{children:i?"Error":"Result"}),s.jsx("pre",{className:"chat-tool-body",children:n.error||n.result})]}):null]},n.id)})})}function kg(){try{if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID()}catch{}return`chat-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function Bge(e,t){const n=t.trim().toLowerCase(),r=n?e.filter(u=>`${u.title} ${u.preview} ${u.firstUser}`.toLowerCase().includes(n)):e,i=[],a=new Date,o=new Date(a.getFullYear(),a.getMonth(),a.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&&i.push({label:u.label,items:d})}return i}function ZN(){var Mu,Ru,Iu,Pi,$u;const[e,t]=E.useState(null),[n,r]=E.useState([]),[i,a]=E.useState(""),[o,l]=E.useState(!1),[c,u]=E.useState(""),[d,f]=E.useState(null),[h,p]=E.useState([]),[g,m]=E.useState([]),[v,y]=E.useState(null),[b,x]=E.useState(null),[k,S]=E.useState(null),[w,_]=E.useState([]),[N,C]=E.useState([]),[T,$]=E.useState(null),R=E.useRef([]),L=E.useRef([]),I=E.useRef(null),z=E.useRef(null),D=E.useRef(null),[F,O]=E.useState(""),P=E.useRef(""),A=E.useRef(null),[Y,K]=E.useState(null),M=E.useRef(kg()),le=E.useRef(""),[be,me]=E.useState([]),[Pe,H]=E.useState(!0),[X,oe]=E.useState(""),[ce,Z]=E.useState(null),[_e,we]=E.useState(""),[Ne,ge]=E.useState([]),[Be,pe]=E.useState(null),[Ct,We]=E.useState(!1),Oe=E.useRef(null),Ze=E.useRef(null),[Me,Qt]=E.useState(null),[$t,U]=E.useState(null),[V,se]=E.useState([]),[fe,Se]=E.useState(""),[Qe,Lt]=E.useState(""),[Ot,jn]=E.useState(!1),[xt,dt]=E.useState(""),[G,he]=E.useState([]),[Ie,Re]=E.useState(null),[Cr,Jt]=E.useState(!1),[An,ys]=E.useState([]),[zp,vs]=E.useState([]),[bs,Ni]=E.useState(""),xs=E.useRef(null),ze=E.useRef(null),ws=E.useRef(null),Xr=E.useRef(null),[Ht,ji]=E.useState(null),[Ai,Ti]=E.useState(new Set);E.useEffect(()=>{ee.fetchAdminAuthStatus().then(B=>{t(B?{configured:B.configured,authenticated:B.authenticated,role:B.role}:{configured:!1,authenticated:!1,role:null})})},[]),E.useEffect(()=>{var B,te;try{(te=(B=ws.current)==null?void 0:B.scrollTo)==null||te.call(B,{top:ws.current.scrollHeight})}catch{}},[n,o,h]),E.useEffect(()=>()=>{var B;(B=ze.current)==null||B.call(ze),ze.current=null},[]);const Fp=E.useCallback(async B=>{var Ee,Jr;(Ee=ze.current)==null||Ee.call(ze),ze.current=null;const te=await ee.getChatSession(B);if(!te)return;M.current=B,r(te.turns.map(qt=>({role:qt.role,content:qt.content,...qt.role==="assistant"?{followups:[],artifacts:GN(qt.content)}:{}}))),p([]),R.current=[],m([]),L.current=[],y(null),I.current=null,x(null),z.current=null,S(null),D.current=null,P.current="",O(""),K(null),u(""),f(null),$(null),ji(null),H(!0);const J=te.projectPath;if(J){if(U(J),(Me==null?void 0:Me.path)===J)return;(Jr=Xr.current)==null||Jr.call(Xr,J)}else U(null)},[Me]),cl=E.useCallback(()=>{var B;(B=ze.current)==null||B.call(ze),ze.current=null,M.current=kg(),U(null),r([]),p([]),R.current=[],m([]),L.current=[],y(null),I.current=null,x(null),z.current=null,S(null),D.current=null,P.current="",O(""),K(null),u(""),f(null),$(null),ji(null),ge([]),pe(null),a(""),H(!0)},[]),Ss=E.useCallback(B=>{ge(te=>[...te,B].slice(-10))},[]),Up=E.useCallback(B=>{ge(te=>te.filter((J,Ee)=>Ee!==B))},[]),Cu=E.useCallback(async B=>{if(!B)return;if(B.size>KN){u(`Attachment "${B.name}" is too large (max ${Math.round(KN/1024)} KB).`);return}const te=await B.text();Ss({name:B.name,content:te,kind:"file"})},[Ss]),Wp=E.useCallback(B=>{const te=B.currentTarget,J=B.clipboardData.getData("text")||"";J.length>=Tge&&(Ze.current={start:te.selectionStart,end:te.selectionEnd},pe({text:J}))},[]),Hp=E.useCallback(()=>{const B=Be;if(!B)return;const te=Ze.current;a(J=>te?J.slice(0,te.start)+J.slice(te.end):J),Ss({name:"pasted-text.txt",content:B.text,kind:"paste"}),pe(null),Ze.current=null},[Be,Ss]),ul=E.useCallback(B=>{Z(B.id),we(B.title==="(untitled conversation)"?"":B.title)},[]),Ou=E.useCallback(async B=>{const te=await ee.renameChatSession(B,_e);te.ok?me(J=>J.map(Ee=>Ee.id===B?{...Ee,title:_e.trim()||Ee.title}:Ee)):u(te.error||"Could not rename the session."),Z(null),we("")},[_e]),Pu=E.useCallback(async B=>{const te=await ee.deleteChatSession(B);te.ok?(me(J=>J.filter(Ee=>Ee.id!==B)),M.current===B&&cl()):u(te.error||"Could not delete the session.")},[cl]),dl=(e==null?void 0:e.authenticated)===!0&&(e.role==="admin"||e.role==="operator");E.useEffect(()=>{dl&&(ee.listChatSessions().then(B=>{Array.isArray(B)&&me(B)}),ee.listProjects().then(B=>{Array.isArray(B)&&se(B)}))},[dl]);const hr=E.useCallback(async B=>{const te=B.trim();if(!te)return;Lt("");const J=await ee.attachProject(te);if(J.ok&&J.project){Qt(J.project),Se("");const Ee=await ee.listProjects();Array.isArray(Ee)&&se(Ee)}else Lt(J.error||"Could not attach that directory.")},[]);Xr.current=hr;const ks=E.useCallback(async B=>{jn(!0),Jt(!0),Ni("");const te=await ee.browseDirectories(B,{showDrives:!B});te.ok&&(dt(te.path),he(te.entries),Re(te.parent),te.drives&&ys(te.drives),te.breadcrumbs&&vs(te.breadcrumbs)),Jt(!1)},[]),xa=E.useCallback(async B=>{Jt(!0),Ni("");const te=await ee.browseDirectories(B);te.ok&&(dt(te.path),he(te.entries),Re(te.parent),te.breadcrumbs&&vs(te.breadcrumbs)),Jt(!1)},[]),Es=E.useCallback(async()=>{if(!xt)return;const B=await ee.browseDirectories(xt);B.ok&&he(B.entries)},[xt]);E.useEffect(()=>ee.onChatRetryEvent(te=>{if(te.sessionId!==M.current){ee.listChatSessions().then(J=>{Array.isArray(J)&&me(J)});return}r(J=>[...J,{role:"assistant",content:te.content}]),te.kind==="answer"&&K(null)}),[]),E.useEffect(()=>(Ot&&xt&&(xs.current=setInterval(()=>{Es()},5e3)),()=>{xs.current&&clearInterval(xs.current)}),[Ot,xt,Es]);const fl=E.useCallback(async()=>{if(typeof window<"u"&&"showDirectoryPicker"in window)try{const J=(await window.showDirectoryPicker({mode:"read"})).name;if(!J){ks();return}Lt(""),l(!0);const Ee=await ee.resolveFolder(J);l(!1),Ee.ok&&Ee.path?(Se(Ee.path),hr(Ee.path)):Lt('Folder "'+J+'" found — selecting it now. If this is wrong, type the full path below.');return}catch(te){if((te==null?void 0:te.name)==="AbortError")return}ks()},[ks,hr]),Je=E.useCallback(async(B,te)=>{var pr,Cn;const J=B.trim(),Ee=Array.isArray(te)?te:Ne,Jr=!Array.isArray(te)&&(te==null?void 0:te.skipResolve)===!0;if(!J&&Ee.length===0||o)return;if(u(""),f(null),p([]),R.current=[],m([]),L.current=[],y(null),I.current=null,x(null),z.current=null,S(null),D.current=null,r(ke=>[...ke,{role:"user",content:J,attachments:Ee.length>0?Ee:void 0}]),a(""),ge([]),pe(null),le.current=J||`[${Ee.length} attachment(s)]`,l(!0),H(!1),!Jr){const ft=((await ee.chatResolve(J)).matches??[])[0]??null;if(ft&&ft.command&&!ft.ambiguous&&ft.score>=.6){$({ask:J,top:ft}),l(!1);return}if(ft&&ft.ambiguous&&!T){$({ask:J,top:ft}),l(!1);return}}const qt=M.current,Tn=new AbortController;A.current=Tn,K(null),(pr=ze.current)==null||pr.call(ze),ze.current=ee.subscribeChat(qt,{onToken:ke=>{P.current+=ke,O(P.current)},onProgress:ke=>{R.current=[...R.current,ke],p(R.current)},onQuestion:ke=>{ji(ke),Ti(new Set)},onTool:ke=>{const Fe=[...L.current],ft=Fe.findIndex(on=>on.id===ke.id),wt={id:ke.id,tool:ke.tool,phase:ke.phase,args:ke.args,ok:ke.ok,result:ke.result,error:ke.error,durationMs:ke.durationMs};ft>=0?Fe[ft]=wt:Fe.push(wt),L.current=Fe,m(Fe)},onPlan:ke=>{const Fe={goal:ke.goal,steps:ke.steps,revision:ke.revision};I.current=Fe,y(Fe)},onDiff:ke=>{const Fe={files:ke.files,summary:ke.summary};z.current=Fe,x(Fe)},onSkillDraft:ke=>{const Fe={name:ke.name,description:ke.description,markdown:ke.markdown,updatedAt:ke.updatedAt,status:"pending"};D.current=Fe,S(Fe)},onSecretRequest:ke=>{_(Fe=>{const ft=Fe.findIndex(wt=>wt.skillName===ke.skillName);if(ft>=0){const wt=[...Fe];return wt[ft]=ke,wt}return[...Fe,ke]})},onExecutionResult:ke=>{C(Fe=>[...Fe,ke])}});const en=await ee.chatSend(qt,J||`(see ${Ee.length} attachment${Ee.length===1?"":"s"})`,{projectPath:Me==null?void 0:Me.path,attachments:Ee.map(ke=>({name:ke.name,content:ke.content,kind:ke.kind}))},Tn.signal);if(A.current=null,(Cn=ze.current)==null||Cn.call(ze),ze.current=null,P.current="",O(""),en.ok){f(en.generationFailed?null:`${en.provider??"provider"}${en.model?` / ${en.model}`:" (auto-routed)"}`),K(en.generationFailed&&!en.retryQueued?J:null);const ke=en.content||"(the agent produced no text — try rephrasing)";r(Fe=>[...Fe,{role:"assistant",content:ke,error:en.generationFailed,followups:en.followups,steps:R.current,tools:L.current,plan:I.current,diff:z.current,draft:D.current,artifacts:GN(ke)}])}else Tn.signal.aborted?(u(""),K(null)):en.unauthorized?(t(ke=>ke&&{...ke,authenticated:!1}),u("Session expired — log in again to chat.")):(u(en.error||"The agent could not answer — check that a provider API key is set for the dashboard process."),K(J));l(!1),H(!0)},[o,Me,Ne]),hl=E.useCallback(()=>{var B;(B=A.current)==null||B.abort()},[]),wa=E.useCallback(async B=>{S(J=>J&&{...J,status:"saving"});const te=await ee.skillDraftAccept(B);S(J=>J&&{...J,status:te.ok?"saved":"error"}),te.ok||u(te.error||"Could not accept the draft.")},[]),pl=E.useCallback(async B=>{const te=await ee.skillDraftReject(B);te.ok?S(J=>J&&{...J,status:"rejected"}):u(te.error||"Could not reject the draft.")},[]),ml=E.useCallback(B=>{Je(`Revise the skill draft "${B}" — improve it per your best judgment and present it again.`)},[Je]),Ci=E.useCallback(async B=>{const te=await ee.saveSecrets(B);if(!te.ok){u(te.error||"Could not save secrets.");return}const J=te.refused??[];J.length>0&&u(J.map(Ee=>Ee.reason==="provider-credential"?`${Ee.name} is a provider credential — set it up as a provider, skills never receive it.`:`${Ee.name} was not saved (${Ee.reason}).`).join(" "))},[]),gl=E.useCallback(async B=>{const Ee=((await ee.chatResolve(B)).matches??[])[0]??null;if(!(Ee!=null&&Ee.command)){$(null);return}$(null),l(!0);const Jr=Ee.command.split(/\s+/),qt=await ee.startTask(Jr,6e4);if(!qt.ok||!qt.task){u(qt.error||"The command could not be started."),l(!1);return}const Tn=qt.task.id,en={id:Tn,command:Ee.command,status:qt.task.status,exitCode:qt.task.exitCode,durationMs:qt.task.durationMs,logs:qt.task.logs??[]};r(ft=>[...ft,{role:"assistant",content:"",task:en}]);const pr=ft=>r(wt=>wt.map(on=>on.task&&on.task.id===Tn?{...on,task:{...on.task,...ft}}:on));let Cn=null;Cn=ee.subscribeTask(Tn,{onLog:ft=>r(wt=>wt.map(on=>on.task&&on.task.id===Tn?{...on,task:{...on.task,logs:[...on.task.logs,ft]}}:on)),onStatus:ft=>{pr({status:ft}),ft!=="running"&&(ee.getTask(Tn).then(wt=>{wt!=null&&wt.task&&pr({exitCode:wt.task.exitCode,durationMs:wt.task.durationMs,logs:wt.task.logs??[]})}),Cn==null||Cn(),l(!1))}});const ke=await ee.getTask(Tn);ke!=null&&ke.task&&pr({status:ke.task.status,exitCode:ke.task.exitCode,durationMs:ke.task.durationMs,logs:ke.task.logs??[]});const Fe=await ee.getTask(Tn);Fe!=null&&Fe.task&&Fe.task.status!=="running"&&(Cn==null||Cn(),pr({status:Fe.task.status,exitCode:Fe.task.exitCode,durationMs:Fe.task.durationMs,logs:Fe.task.logs??[]}),l(!1))},[]),Oi=E.useCallback(B=>{$(null),Je(B,{skipResolve:!0})},[Je]),_s=E.useCallback(B=>{if(B.length===0)return;const te=Me?` in the attached project ${Me.path}`:"";Je(`Commit exactly these files that I accepted on the diff card (and nothing else)${te}: ${B.join(", ")}. Show me a short confirmation before finishing.`)},[Je,Me]),Ns=E.useCallback(async B=>{await ee.cancelTask(B)},[]),Zr=E.useCallback(async B=>{const te=Ht;if(!te)return;ji(null);const J=await ee.chatRespond(M.current,te.questionId,B);J.ok||u(J.error||"The question could not be answered — try sending your message again.")},[Ht]),Qr=E.useCallback(()=>{if(!Ht)return;const B=Ht.multiSelect?[...Ai]:[...Ai][0];Ht.multiSelect?Zr({index:[...Ai]}):Zr(B!==void 0?{index:B}:{index:-1})},[Ht,Ai,Zr]),Gp=E.useCallback(()=>{Ht&&Zr({index:-1})},[Ht,Zr]),qp=E.useCallback(B=>{Ti(te=>{const J=new Set(te);return Ht!=null&&Ht.multiSelect?J.has(B)?J.delete(B):J.add(B):(J.clear(),J.add(B)),J})},[Ht]),Or=E.useCallback(async()=>{var te;(te=ze.current)==null||te.call(ze),ze.current=null,M.current=kg(),r([]),p([]),R.current=[],m([]),L.current=[],y(null),I.current=null,x(null),z.current=null,S(null),D.current=null,P.current="",O(""),K(null),u(""),f(null),$(null),ji(null);const B=await ee.listChatSessions();Array.isArray(B)&&me(B)},[]),Gt=((Mu=[...n].reverse().find(B=>{var te;return B.role==="assistant"&&!B.error&&(((te=B.followups)==null?void 0:te.length)??0)>0}))==null?void 0:Mu.followups)??[];return s.jsxs("div",{className:"panel",children:[s.jsxs("div",{className:"panel-header",children:[s.jsx("h2",{children:"💬 Chat with the agent"}),s.jsxs("div",{className:"chat-head-actions",children:[d?s.jsx("span",{className:"admin-hint",children:d}):null,s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void Or(),disabled:o||n.length===0,children:"🗑 New conversation"})]})]}),e!=null&&e.authenticated?dl?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"chat-project-bar",children:Me?s.jsxs("div",{className:"chat-project-attached",children:[s.jsx("span",{className:"chat-project-icon",children:"📁"}),s.jsx("span",{className:"chat-project-name",children:Me.name}),s.jsxs("span",{className:"chat-project-meta",children:[Me.fileCount," files · ",Me.symbolCount," symbols",Me.truncated?" · truncated map":""]}),s.jsx("span",{className:"chat-project-path",title:Me.path,children:Me.path}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>Qt(null),children:"✕ detach"})]}):s.jsxs("div",{className:"chat-project-pick",children:[s.jsx("span",{className:"chat-project-icon",children:"📁"}),s.jsx("span",{className:"chat-project-hint",children:"Select Project Folder"}),V.length>0?s.jsx("span",{className:"chat-project-chips",children:V.filter(B=>B.kind!=="cwd").slice(0,3).map(B=>s.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void hr(B.path),children:B.name},B.path))}):null,s.jsx("input",{className:"chat-project-input",value:fe,onChange:B=>Se(B.target.value),onKeyDown:B=>{B.key==="Enter"&&(B.preventDefault(),hr(fe))},placeholder:"or type a path, e.g. ~/code/my-app",disabled:o}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void hr(fe),disabled:o||!fe.trim(),children:"Attach"}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>void fl(),title:"Pick a project folder using your system's folder picker (Finder / Explorer)",children:"🗂️ Browse"}),Qe?s.jsx("span",{className:"chat-project-error",children:Qe}):null,Ot?s.jsxs("div",{className:"chat-browse-popover",children:[s.jsxs("div",{className:"chat-browse-head",children:[s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>jn(!1),title:"Close",children:"✕"}),s.jsx("div",{className:"chat-browse-breadcrumbs",children:An.length>0&&!xt?s.jsx("span",{className:"admin-hint",children:"Select a drive or home folder:"}):s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:"chat-breadcrumb",onClick:()=>void ks(),children:"🏠"}),zp.map((B,te)=>s.jsxs("span",{children:[s.jsx("span",{className:"chat-breadcrumb-sep",children:"/"}),s.jsx("button",{type:"button",className:"chat-breadcrumb",onClick:()=>void xa(B.path),children:B.name})]},B.path))]})})]}),An.length>0&&!xt?s.jsx("div",{className:"chat-browse-drives",children:An.map(B=>s.jsx("button",{type:"button",className:"chat-browse-drive",onClick:()=>void xa(B.path),children:B.name},B.path))}):null,G.length>5?s.jsx("div",{className:"chat-browse-search",children:s.jsx("input",{type:"text",className:"chat-browse-filter",placeholder:"🔍 Filter folders…",value:bs,onChange:B=>Ni(B.target.value),autoFocus:!0})}):null,s.jsx("div",{className:"chat-browse-list",children:Cr?s.jsx("span",{className:"admin-hint",children:"Loading…"}):G.length===0?s.jsx("span",{className:"admin-hint",children:"No subdirectories found"}):G.filter(B=>!bs||B.name.toLowerCase().includes(bs.toLowerCase())).map(B=>s.jsxs("button",{type:"button",className:"chat-browse-entry",onClick:()=>void xa(B.path),children:[s.jsx("span",{className:"chat-browse-entry-icon",children:"📁"}),s.jsx("span",{className:"chat-browse-entry-name",children:B.name}),B.modified?s.jsx("span",{className:"chat-browse-entry-date",children:new Date(B.modified).toLocaleDateString()}):null]},B.path))}),s.jsxs("div",{className:"chat-browse-foot",children:[s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>void Es(),title:"Refresh folder list",children:"🔄"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>{jn(!1),hr(xt)},disabled:!xt,children:"📁 Select this folder"})]})]}):null]})}),$t&&(!Me||Me.path!==$t)?s.jsxs("div",{className:"chat-session-project-banner",children:[s.jsxs("span",{children:["⚠️ This conversation was working in ",s.jsx("code",{children:$t})]}),Me?s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void hr($t),children:"📁 Switch to it"}):s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void hr($t),children:"📁 Attach it"})]}):null,s.jsxs("div",{className:"chat-layout",children:[Pe?s.jsxs("div",{className:"chat-sidebar",children:[s.jsxs("div",{className:"chat-sidebar-head",children:[s.jsx("span",{children:"📁 Sessions"}),s.jsxs("div",{className:"chat-sidebar-head-actions",children:[s.jsx("button",{type:"button",className:"chat-mini-action",title:"New chat",onClick:cl,children:"+ New"}),s.jsx("button",{type:"button",className:"chat-mini-action",title:"Collapse history",onClick:()=>H(!1),children:"▸"})]})]}),s.jsx("input",{className:"chat-session-search",placeholder:"Search conversations…",value:X,onChange:B=>oe(B.target.value)}),be.length===0?s.jsx("div",{className:"chat-sidebar-empty",children:"No past conversations yet."}):s.jsx("div",{className:"chat-sidebar-list",children:Bge(be,X).map(({label:B,items:te})=>s.jsxs("div",{className:"chat-session-group",children:[s.jsx("div",{className:"chat-session-group-label",children:B}),te.map(J=>s.jsx("div",{className:`chat-session-item${J.id===M.current?" chat-session-active":""}`,children:ce===J.id?s.jsxs("div",{className:"chat-session-rename",children:[s.jsx("input",{autoFocus:!0,value:_e,onChange:Ee=>we(Ee.target.value),onKeyDown:Ee=>{Ee.key==="Enter"&&Ou(J.id),Ee.key==="Escape"&&Z(null)},placeholder:"Session title"}),s.jsx("button",{type:"button",className:"chat-mini-action",onClick:()=>void Ou(J.id),children:"✓"})]}):s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",className:"chat-session-main",onClick:()=>void Fp(J.id),title:J.preview||J.title,children:[s.jsx("span",{className:"chat-session-title",children:J.title}),s.jsx("span",{className:"chat-session-preview",children:J.firstUser||J.preview}),s.jsxs("span",{className:"chat-session-meta",children:[J.projectPath?`📁 ${J.projectPath.split("/").pop()} · `:"",J.turnCount," msg",J.turnCount===1?"":"s"," · ",new Date(J.updatedAt).toLocaleString()]})]}),s.jsxs("span",{className:"chat-session-actions",children:[s.jsx("button",{type:"button",className:"chat-mini-action",title:"Rename",onClick:()=>ul(J),children:"✏️"}),s.jsx("button",{type:"button",className:"chat-mini-action",title:"Delete",onClick:()=>void Pu(J.id),children:"🗑"})]})]})},J.id))]},B))})]}):s.jsx("div",{className:"chat-rail",children:s.jsx("button",{type:"button",className:"chat-rail-btn",onClick:()=>H(!0),title:"Show history",children:"📁"})}),s.jsxs("div",{className:"chat-main",children:[s.jsxs("div",{className:"chat-thread",ref:ws,role:"log","aria-live":"polite",children:[n.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsx("p",{className:"empty-state-title",children:"Say anything — the agent decides what to do (answer, fix code, plan, run the pipeline)."}),s.jsxs("div",{className:"empty-state-chips",children:[s.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Je("what's the state of this project?"),children:"📋 assess this project"}),s.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Je("run the test suite"),children:"🧪 run the tests"}),s.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Je("stop the gateway"),children:"⏹ stop the gateway"}),s.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Je("load the code-assessment skill and assess this project"),children:"🧠 load the code-assessment skill"}),s.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Je("learn the workflow I just did as a skill"),children:"📚 learn a workflow as a skill"}),s.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Je("publish the current version"),children:"🚀 publish the release"})]})]}):n.map((B,te)=>s.jsxs("div",{className:`chat-bubble chat-${B.role}${B.error?" chat-error":""}`,children:[s.jsx("div",{className:"chat-bubble-role",children:B.role==="user"?"You":"🤖 Agent"}),B.role==="assistant"?s.jsx("div",{className:"chat-bubble-text",children:s.jsx(FN,{text:B.content})}):s.jsx("div",{className:"chat-bubble-text",children:B.content}),B.role==="user"&&B.attachments&&B.attachments.length>0?s.jsxs("details",{className:"chat-steps",open:B.attachments.length===1,children:[s.jsxs("summary",{children:["📎 ",B.attachments.length," attachment",B.attachments.length===1?"":"s",":"," ",B.attachments.map(J=>J.name).join(", ")]}),B.attachments.map((J,Ee)=>s.jsxs("div",{className:"chat-attach-content",children:[s.jsxs("div",{className:"admin-hint",children:[J.name," — ",J.content.length.toLocaleString()," chars"]}),s.jsx("pre",{children:J.content})]},Ee))]}):null,B.role==="assistant"&&B.diff?s.jsxs("details",{className:"chat-steps",open:!0,children:[s.jsxs("summary",{children:["Changes: ",B.diff.summary]}),s.jsx(Ad,{diff:B.diff,selectable:!0,onCommitAccepted:_s})]}):null,B.role==="assistant"&&B.artifacts&&(B.artifacts.diffs.length>0||B.artifacts.results.length>0||B.artifacts.deploys.length>0)?s.jsxs(Rge,{children:[B.artifacts.diffs.map((J,Ee)=>s.jsx("div",{"data-artifact-card":!0,tabIndex:0,role:"group","aria-label":`Diff: ${J.summary}`,className:"chat-artifact-item",children:Me?s.jsx(Ad,{diff:J,selectable:!0,onCommitAccepted:_s}):s.jsx(Ad,{diff:J,lockedHint:"Attach a project to review and commit these changes."})},`diff-${Ee}`)),B.artifacts.results.map((J,Ee)=>s.jsx("div",{"data-artifact-card":!0,tabIndex:0,role:"group","aria-label":`Result: ${J.title}`,className:"chat-artifact-item",children:s.jsx(Pge,{result:J})},`result-${Ee}`)),B.artifacts.deploys.map((J,Ee)=>s.jsx("div",{"data-artifact-card":!0,tabIndex:0,role:"group","aria-label":`Deployment: ${J.url}`,className:"chat-artifact-item",children:s.jsx(Mge,{deploy:J})},`deploy-${Ee}`))]}):null,B.role==="assistant"&&B.task?s.jsx(Ige,{task:B.task,onCancel:B.task.status==="running"?()=>void Ns(B.task.id):void 0}):null,B.role==="assistant"&&B.draft?s.jsxs("details",{className:"chat-steps",open:!0,children:[s.jsxs("summary",{children:["Skill draft: ",B.draft.name]}),s.jsx(VN,{draft:B.draft,onAccept:wa,onReject:pl,onEdit:ml})]}):null,B.role==="assistant"&&B.plan?s.jsxs("details",{className:"chat-steps",open:!0,children:[s.jsxs("summary",{children:["Plan: ",B.plan.goal]}),s.jsx(YN,{plan:B.plan})]}):null,B.role==="assistant"&&B.tools&&B.tools.length>0?s.jsxs("details",{className:"chat-steps",open:!0,children:[s.jsxs("summary",{children:[B.tools.length," tool call",B.tools.length===1?"":"s"]}),s.jsx(XN,{tools:B.tools})]}):null,B.role==="assistant"&&B.steps&&B.steps.length>0?s.jsxs("details",{className:"chat-steps",children:[s.jsxs("summary",{children:[B.steps.length," step",B.steps.length===1?"":"s"]}),s.jsx("div",{className:"chat-step-line",children:B.steps.map((J,Ee)=>s.jsx("div",{children:J.trim()},Ee))})]}):null]},te)),o?s.jsxs("div",{className:"chat-bubble chat-assistant",children:[s.jsx("div",{className:"chat-bubble-role",children:"🤖 Agent"}),v?s.jsx(YN,{plan:v}):null,b?s.jsx(Ad,{diff:b}):null,k?s.jsx(VN,{draft:k,onAccept:wa,onReject:pl,onEdit:ml}):null,w.map(B=>s.jsx($ge,{request:B,onSave:Ci},B.skillName)),N.map((B,te)=>s.jsx(Lge,{result:B},`${B.skillName}-${te}`)),s.jsx(XN,{tools:g,live:!0}),F?s.jsx("div",{className:"chat-bubble-text chat-streaming",children:s.jsx(FN,{text:F})}):null,s.jsx("div",{className:"chat-working",children:h.length>0?s.jsx("span",{className:"chat-working-lines",children:h.map((B,te)=>s.jsx("div",{className:"chat-step-line",children:B.trim()},te))}):s.jsxs(s.Fragment,{children:["💭 thinking… ",s.jsx("span",{className:"chat-dots"})]})})]}):null]}),c?s.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:c}):null,Y&&!o?s.jsxs("div",{className:"chat-retry-row",children:[s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void Je(Y),children:"↻ Retry"}),s.jsx("span",{className:"admin-hint",children:"Re-send the last message — the turn failed."})]}):null,T&&!o?s.jsx("div",{className:"chat-resolve-card",children:(Ru=T.top)!=null&&Ru.ambiguous&&((Iu=T.top.options)!=null&&Iu.length)?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"chat-resolve-head",children:[s.jsx("strong",{children:"🤔 Which do you mean?"}),' — "',T.ask,'" maps to more than one action.']}),s.jsx("div",{className:"chat-resolve-options",children:T.top.options.map(B=>s.jsxs("button",{className:"chat-chip",type:"button",onClick:()=>void Je(B.command),children:[B.summary," — ",s.jsx("code",{children:B.command})]},B.command))}),s.jsx("div",{className:"chat-resolve-foot",children:s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>{$(null)},children:"✕ Not that — ask the agent"})})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"chat-resolve-head",children:[s.jsx("strong",{children:"⚡ Run this command?"}),' — "',T.ask,'"']}),s.jsx("div",{className:"chat-resolve-cmd",children:s.jsx("code",{children:(Pi=T.top)==null?void 0:Pi.command})}),($u=T.top)!=null&&$u.confirmation?s.jsx("div",{className:"admin-hint",children:"⚠ This changes running services/state."}):null,s.jsxs("div",{className:"chat-resolve-foot",children:[s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void gl(T.ask),children:"▶ Run"}),s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>Oi(T.ask),children:"✕ No — ask the agent"})]})]})}):null,Ht?s.jsxs("div",{className:"chat-resolve-card chat-question-card",children:[s.jsx("div",{className:"chat-resolve-head",children:s.jsxs("strong",{children:["🤔 ",Ht.question]})}),s.jsx("div",{className:"chat-resolve-options",children:Ht.choices.map((B,te)=>s.jsxs("button",{type:"button",className:`chat-chip${Ai.has(te)?" chat-chip-selected":""}`,onClick:()=>qp(te),children:[B.label,B.description?s.jsxs("span",{className:"admin-hint",children:[" — ",B.description]}):null]},`${B.label}-${te}`))}),s.jsxs("div",{className:"chat-resolve-foot",children:[s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:Qr,children:Ht.multiSelect?"Submit":"Choose"}),s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:Gp,children:"Skip — best judgment"})]})]}):null,Gt.length>0&&!o?s.jsxs("div",{className:"chat-followups",children:[s.jsx("span",{className:"admin-hint",children:"Next steps:"}),Gt.map((B,te)=>s.jsx("button",{className:"chat-chip",type:"button",onClick:()=>void Je(B.prompt),children:B.label||B.prompt},te))]}):null,s.jsxs("form",{className:`chat-composer${Ct?" chat-composer-drag":""}`,onSubmit:B=>{B.preventDefault(),Je(i)},onDragOver:B=>{B.preventDefault(),We(!0)},onDragLeave:()=>We(!1),onDrop:B=>{var J;B.preventDefault(),We(!1);const te=Array.from(((J=B.dataTransfer)==null?void 0:J.files)??[]);for(const Ee of te.slice(0,10))Cu(Ee)},children:[Be?s.jsxs("div",{className:"chat-paste-offer",children:[s.jsxs("span",{className:"admin-hint",children:["📄 You pasted ",Be.text.length.toLocaleString()," characters. Attach it as a file instead?"]}),s.jsx("button",{type:"button",className:"chat-chip",onClick:Hp,children:"Attach as text"}),s.jsx("button",{type:"button",className:"chat-mini-action",onClick:()=>{pe(null),Ze.current=null},children:"Keep inline"})]}):null,Ne.length>0?s.jsx("div",{className:"chat-attach-row",children:Ne.map((B,te)=>s.jsxs("span",{className:"chat-attach-chip",title:`${B.name} (${B.content.length.toLocaleString()} chars)`,children:["📎 ",B.name,s.jsxs("span",{className:"admin-hint",children:[" ",B.content.length.toLocaleString(),"c"]}),s.jsx("button",{type:"button",className:"chat-mini-action",onClick:()=>Up(te),children:"✕"})]},`${B.name}-${te}`))}):null,s.jsxs("div",{className:"chat-input-row",children:[s.jsx("input",{ref:Oe,type:"file",style:{display:"none"},onChange:B=>{var J;const te=(J=B.target.files)==null?void 0:J[0];te&&Cu(te),B.target.value=""}}),s.jsx("button",{type:"button",className:"chat-attach-btn",title:"Attach a file (up to 300 KB, text only)",disabled:o||Ne.length>=10,onClick:()=>{var B;return(B=Oe.current)==null?void 0:B.click()},children:"📎"}),s.jsx("textarea",{className:"chat-input-box",value:i,onChange:B=>a(B.target.value),onPaste:Wp,onKeyDown:B=>{B.key==="Enter"&&!B.shiftKey?(B.preventDefault(),Je(i)):B.key==="ArrowUp"&&i===""&&le.current&&(B.preventDefault(),a(le.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:o,maxLength:8e3,rows:1,autoFocus:!0}),o?s.jsx("button",{className:"admin-mini-btn chat-cancel-btn",type:"button",onClick:hl,children:"⏹ Cancel"}):null,s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:o||!i.trim()&&Ne.length===0,children:o?"⏳ Working…":"➤ Send"})]})]}),s.jsxs("p",{className:"admin-hint",children:["Each message runs the full agent loop in the dashboard process (same engine as"," ",s.jsx("code",{children:'buff chat "<prompt>"'}),") — the provider API keys must be configured in the dashboard process. Clarifications (",s.jsx("code",{children:"ask_user"}),") appear as a question card here — choose an answer or skip (best judgment)."]})]})]})]}):s.jsx("div",{className:"admin-login-hint",children:s.jsx("p",{children:"Your role can view the dashboard but not chat (requires admin or operator)."})}):s.jsxs("div",{className:"admin-login-hint",children:[s.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."}),(e==null?void 0:e.configured)===!1?s.jsxs("p",{className:"admin-hint",children:["Run ",s.jsx("code",{children:"buff dashboard"})," once, or set ",s.jsx("code",{children:"BUFF_DASHBOARD_ADMIN_USER"})," / ",s.jsx("code",{children:"BUFF_DASHBOARD_ADMIN_PASSWORD"}),"."]}):null]})]})}const zge={running:"⏳ running",done:"✅ done",failed:"❌ failed",cancelled:"⏹ cancelled",timeout:"⏰ timed out",error:"💥 error"};function i2({presets:e,customPlaceholder:t,timeoutMs:n=3e5,hint:r}){const[i,a]=E.useState(null),[o,l]=E.useState(!1),[c,u]=E.useState(""),[d,f]=E.useState(""),[h,p]=E.useState(null),[g,m]=E.useState([]),v=E.useRef(null),y=E.useRef(null);E.useEffect(()=>{ee.fetchAdminAuthStatus().then(S=>{a(S?{authenticated:S.authenticated,role:S.role}:{authenticated:!1,role:null})})},[]),E.useEffect(()=>{var S,w;try{(w=(S=v.current)==null?void 0:S.scrollIntoView)==null||w.call(S,{block:"end"})}catch{}},[g]),E.useEffect(()=>()=>{var S;(S=y.current)==null||S.call(y)},[]);const b=(i==null?void 0:i.authenticated)===!0&&(i.role==="admin"||i.role==="operator"),x=E.useCallback(async(S,w)=>{var T;if(o)return;l(!0),u(""),m([]);const _=await ee.startTask(S,w??n);if(!_.ok||!_.task){u(_.error||"Could not start the command."),l(!1);return}const N=_.task;p(N);const C=await ee.getTask(N.id);C!=null&&C.task&&m(C.task.logs.map($=>({stream:$.stream,text:$.text}))),(T=y.current)==null||T.call(y),y.current=ee.subscribeTask(N.id,{onLog:$=>m(R=>[...R,{stream:$.stream,text:$.text}]),onStatus:$=>{p(R=>R&&{...R,status:$}),$!=="running"&&l(!1)}})},[o,n]),k=E.useCallback(async()=>{h&&await ee.cancelTask(h.id)},[h]);return s.jsxs("div",{className:"ops-console",children:[i!=null&&i.authenticated?b?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"ops-presets",children:e.map(S=>s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void x(S.args,S.timeoutMs),disabled:o,children:S.label},S.label))}),s.jsxs("div",{className:"ops-custom-row",children:[s.jsx("input",{type:"text",value:d,onChange:S=>f(S.target.value),placeholder:t,disabled:o,maxLength:160}),s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void x(d.trim().split(/\s+/)),disabled:o||!d.trim(),children:"Run"})]}),r?s.jsx("p",{className:"admin-hint",children:r}):null]}):s.jsx("div",{className:"admin-login-hint",children:"Your role can view but not run commands (requires admin or operator)."}):s.jsx("div",{className:"admin-login-hint",children:"Log in (admin or operator) to run commands."}),c?s.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:c}):null,h?s.jsxs("div",{className:"ops-console-box",children:[s.jsxs("div",{className:"ops-console-head",children:[s.jsxs("span",{children:[h.command," · ",s.jsx("span",{className:h.status==="running"?"task-status-running":"",children:zge[h.status]})]}),h.status==="running"?s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void k(),children:"⏹ Cancel"}):null]}),s.jsxs("pre",{className:"ops-console",role:"log",children:[g.length>0?g.map((S,w)=>s.jsx("div",{children:S.text},w)):s.jsx("div",{className:"admin-hint",children:"Waiting for output…"}),s.jsx("div",{ref:v})]})]}):null]})}const Fge=[{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 QN(e){return typeof e!="number"?"—":`${Math.round(e*100)}%`}function Uge(e){return new Date(e).toLocaleString()}function Wge({data:e}){var n;const t=((n=e==null?void 0:e.evals)==null?void 0:n.runs)??[];return s.jsxs("div",{className:"panel",children:[s.jsx("div",{className:"panel-header",children:s.jsx("h2",{children:"🏆 Evals — run buff eval from the GUI"})}),s.jsx(i2,{presets:Fge,customPlaceholder:"e.g. eval run --tasks my-task --provider groq --model llama",timeoutMs:9e5,hint:s.jsxs(s.Fragment,{children:["Runs the real ",s.jsx("code",{children:"buff 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."]})}),s.jsx("h3",{className:"section-subtitle",children:"📜 Past runs (auto-refreshes)"}),t.length>0?s.jsx("div",{className:"admin-table-wrapper",children:s.jsxs("table",{className:"admin-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Started"}),s.jsx("th",{children:"Provider"}),s.jsx("th",{children:"Model"}),s.jsx("th",{children:"Tasks"}),s.jsx("th",{children:"Pass"}),s.jsx("th",{children:"Completion"}),s.jsx("th",{children:"Composite"}),s.jsx("th",{children:"Cost"})]})}),s.jsx("tbody",{children:t.map(r=>s.jsxs("tr",{children:[s.jsx("td",{children:Uge(r.startedAt)}),s.jsx("td",{className:"admin-provider-type",children:r.provider}),s.jsx("td",{children:r.model}),s.jsx("td",{children:r.summary.totalTasks}),s.jsxs("td",{children:[r.summary.tasksPassed,"/",r.summary.totalTasks]}),s.jsx("td",{children:QN(r.summary.completionRate)}),s.jsx("td",{children:QN(r.summary.avgCompositeScore)}),s.jsxs("td",{children:["$",(r.summary.totalCostUsd??0).toFixed(4)]})]},r.id))})]})}):s.jsx("div",{className:"empty-state",children:"No eval runs yet — start one above (or `buff eval run` from the CLI)."})]})}const Hge=[{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 Gge(){return s.jsxs("div",{className:"panel",children:[s.jsx("div",{className:"panel-header",children:s.jsx("h2",{children:"🌐 Gateway ops — run buff gateway from the GUI"})}),s.jsx(i2,{presets:Hge,customPlaceholder:"e.g. admin cron run nightly or gateway alias add ops email:team@example.com",timeoutMs:3e5,hint:s.jsxs(s.Fragment,{children:["Each command runs as the real CLI in an isolated process (the P1 task runner) — the same engine as your terminal. ",s.jsx("code",{children:"gateway start"})," runs in the foreground ",s.jsx("strong",{children:"with no timeout"}),": it keeps running even after you switch tabs (the process lives on the dashboard server, not the page) and streams platform events until you press ",s.jsx("strong",{children:"Cancel"}),". The delivery ledger also has its own view in"," ",s.jsx("strong",{children:"Agent Hub → Channels"}),"."]})})]})}const Eg={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: buff 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 qge(){const[e,t]=E.useState(null),[n,r]=E.useState("all"),[i,a]=E.useState(null),[o,l]=E.useState(0),[c,u]=E.useState({}),[d,f]=E.useState(!1),[h,p]=E.useState(null),[g,m]=E.useState({status:"idle"}),[v,y]=E.useState(""),[b,x]=E.useState("Hello from agent-nuvira!"),[k,S]=E.useState(!1),[w,_]=E.useState(null),N=E.useRef(!0),C=E.useCallback(async()=>{const O=await ee.getPlatformConfigs();N.current&&t(O)},[]);E.useEffect(()=>(C(),()=>{N.current=!1}),[C]);const T=O=>{a(O),l(0),u(Object.fromEntries(O.envVars.map(A=>[A.varName,A.value]))),p(null),m({status:"idle"});const P=Eg[O.platform];y((P==null?void 0:P.testTarget)??""),x("Hello from agent-nuvira!"),_(null)},$=async()=>{if(!i)return;m({status:"checking"});const O=await ee.verifyPlatformConfig(i.platform,c);O.ok?(m({status:"ok",info:O.info}),p({kind:"ok",text:"Verified! "+(O.info?"Connected as "+O.info+".":"Token is valid.")})):(m({status:"err",error:O.error}),p({kind:"err",text:O.error||"Verification failed."}))},R=async()=>{if(!i)return;f(!0),p(null);const O=await ee.setPlatformConfig(i.platform,c);f(!1),O.ok?(p({kind:"ok",text:"Token saved! Verifying..."}),C(),l(2),$()):p({kind:"err",text:O.error||"Save failed."})},L=async()=>{if(!i||!v)return;S(!0),_(null);const O=await ee.sendChannelMessage(v,b);S(!1),O.ok?_({kind:"ok",text:"Message sent via "+O.platform+"! Check your "+i.label+" app."}):_({kind:"err",text:O.error||"Send failed. Make sure the gateway is running (Gateway tab)."})};if(e===null)return s.jsx("div",{className:"empty-state",children:"Loading platforms..."});const I=e.filter(O=>O.configured).length,z=e.filter(O=>n==="configured"?O.configured:n==="unconfigured"?!O.configured:!0),D=i?Eg[i.platform]:null;function F(O){return o===O?"wizard-step-dot active":"wizard-step-dot"}return s.jsxs("div",{className:"panel",children:[s.jsx("div",{className:"panel-header",children:s.jsx("h2",{children:"Platforms — Messaging Gateway Onboarding"})}),s.jsxs("div",{className:"platforms-summary",children:[s.jsxs("div",{className:"platforms-summary-stat",children:[s.jsx("span",{className:"platforms-summary-number",children:I}),s.jsx("span",{className:"platforms-summary-label",children:"configured"})]}),s.jsxs("div",{className:"platforms-summary-stat",children:[s.jsx("span",{className:"platforms-summary-number",children:e.length-I}),s.jsx("span",{className:"platforms-summary-label",children:"available"})]}),s.jsx("div",{className:"platforms-summary-filters",children:["all","configured","unconfigured"].map(O=>s.jsx("button",{type:"button",className:n===O?"platforms-filter-btn active":"platforms-filter-btn",onClick:()=>r(O),children:O==="all"?"All":O==="configured"?"Configured":"Not set up"},O))})]}),s.jsx("div",{className:"platforms-grid",children:z.map(O=>{const P=Eg[O.platform];return s.jsxs("div",{className:O.configured?"platform-card configured":"platform-card",children:[s.jsxs("div",{className:"platform-card-head",children:[s.jsx("span",{className:"platform-card-icon",children:(P==null?void 0:P.icon)??"🔌"}),s.jsxs("div",{className:"platform-card-info",children:[s.jsx("span",{className:"platform-card-name",children:O.label}),s.jsx("span",{className:"platform-card-category",children:(P==null?void 0:P.category)??"Platform"})]}),s.jsx("span",{className:O.configured?"status-dot connected":"status-dot reconnecting"})]}),s.jsx("div",{className:"platform-card-vars",children:O.envVars.map(A=>s.jsxs("span",{className:A.set?"platform-var-chip set":"platform-var-chip",children:[A.varName," ",A.set?"done":"--"]},A.varName))}),s.jsxs("div",{className:"platform-card-actions",children:[O.configured?s.jsx("span",{className:"platform-card-badge",children:"Active"}):s.jsx("button",{type:"button",className:"wizard-start-btn",onClick:()=>T(O),children:"Setup"}),O.setupUrl?s.jsx("a",{href:O.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"Docs"}):null]}),!O.configured&&O.setupHint?s.jsx("div",{className:"platform-card-hint",children:O.setupHint}):null]},O.platform)})}),s.jsxs("div",{className:"platforms-cli-hint",children:[s.jsx("span",{className:"admin-hint",children:"Prefer the terminal? "}),s.jsx("code",{children:"buff gateway setup telegram"}),s.jsx("span",{className:"admin-hint",children:" — same wizard from your CLI"})]}),i&&D?s.jsx("div",{className:"wizard-overlay",onClick:()=>a(null),children:s.jsxs("div",{className:"wizard-modal",onClick:O=>O.stopPropagation(),children:[s.jsxs("div",{className:"wizard-header",children:[s.jsx("span",{className:"wizard-icon",children:D.icon}),s.jsxs("span",{className:"wizard-title",children:["Getting Started: ",i.label]}),s.jsxs("div",{className:"wizard-steps-indicator",children:[s.jsx("span",{className:F(0),children:"1"}),s.jsx("span",{className:F(1),children:"2"}),s.jsx("span",{className:F(2),children:"3"})]}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>a(null),children:"X"})]}),s.jsxs("div",{className:"wizard-body",children:[o===0&&s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"wizard-section-title",children:["Step 1: Create your bot on ",i.label]}),s.jsx("ol",{className:"wizard-steps",children:D.steps.map((O,P)=>s.jsx("li",{children:O},P))}),s.jsxs("div",{className:"wizard-nav",children:[s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>l(1),children:"I have my token — Step 2"}),i.setupUrl?s.jsx("a",{href:i.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"Open docs"}):null]})]}),o===1&&s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"wizard-section-title",children:"Step 2: Paste your token"}),i.envVars.map(O=>s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:O.prompt}),s.jsx("input",{type:O.secret?"password":"text",value:c[O.varName]??"",onChange:P=>u(A=>({...A,[O.varName]:P.target.value})),placeholder:O.secret?"paste your token here":"value",autoComplete:"off",spellCheck:!1,autoFocus:!0})]},O.varName)),h?s.jsx("div",{className:h.kind==="ok"?"admin-row-msg":"admin-row-msg admin-row-msg-err",children:h.text}):null,s.jsxs("div",{className:"wizard-nav",children:[s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>l(0),children:"Back"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void R(),disabled:d,children:d?"Saving...":"Save & Verify"})]})]}),o===2&&s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"wizard-section-title",children:"Step 3: Verify and test"}),g.status==="checking"&&s.jsx("div",{className:"wizard-verify-status",children:"Verifying token..."}),g.status==="ok"&&s.jsxs("div",{className:"wizard-verify-status ok",children:["Connected as ",g.info]}),g.status==="err"&&s.jsx("div",{className:"wizard-verify-status err",children:g.error}),g.status==="idle"&&(h==null?void 0:h.kind)==="ok"&&s.jsx("div",{className:"wizard-verify-status ok",children:h.text}),v&&s.jsxs("div",{className:"wizard-test-section",children:[s.jsx("p",{className:"wizard-section-title",children:"Send a test message:"}),s.jsx("div",{className:"wizard-test-row",children:s.jsx("input",{className:"wizard-test-input",value:v,onChange:O=>y(O.target.value),placeholder:"telegram:YOUR_CHAT_ID"})}),s.jsxs("div",{className:"wizard-test-row",children:[s.jsx("input",{className:"wizard-test-input",value:b,onChange:O=>x(O.target.value),placeholder:"Hello from agent-nuvira!"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void L(),disabled:k||!v,children:k?"Sending...":"Send test"})]}),w?s.jsx("div",{className:w.kind==="ok"?"admin-row-msg":"admin-row-msg admin-row-msg-err",children:w.text}):null]}),s.jsxs("div",{className:"wizard-nav",children:[s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>l(1),children:"Edit token"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>a(null),children:"Done"})]}),!v&&s.jsxs("p",{className:"wizard-hint",children:["Token saved! Start the gateway from the Gateway tab, then send a message from your ",i.label," app."]})]})]})]})}):null]})}const Kge=[{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)"}],JN=[{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 Vge({canWrite:e,sessionExpired:t}){const[n,r]=E.useState(null),[i,a]=E.useState(null),[o,l]=E.useState(!1),[c,u]=E.useState("overview"),d=E.useRef(!0),[f,h]=E.useState("bearer"),[p,g]=E.useState(""),[m,v]=E.useState(""),[y,b]=E.useState(""),[x,k]=E.useState("us-east-1"),[S,w]=E.useState(JN.filter(I=>I.checked).map(I=>I.name)),[_,N]=E.useState(!1),[C,T]=E.useState(null),$=E.useCallback(async()=>{const I=await ee.getBedrockStatus();d.current&&r(I)},[]);E.useEffect(()=>($(),()=>{d.current=!1}),[$]);const R=async()=>{l(!0),a(null);try{const I=await ee.probeBedrock((n==null?void 0:n.region)||"us-east-1");if(!d.current)return;I.ok&&I.models&&(a(I.models),u("test"))}catch{}finally{d.current&&l(!1)}},L=async()=>{N(!0),T(null);try{const I={BEDROCK_REGION:x};f==="bearer"&&p?I.AWS_BEARER_TOKEN=p:f==="iam"&&(m&&(I.AWS_ACCESS_KEY_ID=m),y&&(I.AWS_SECRET_ACCESS_KEY=y));const z=await ee.setupBedrock(I);if(!d.current)return;z.ok?(T({kind:"ok",text:"✅ Configuration saved! Running connectivity test…"}),u("overview"),await $(),setTimeout(()=>void R(),500)):T({kind:"err",text:z.error||"Save failed"})}catch{d.current&&T({kind:"err",text:"Could not reach the dashboard server."})}finally{d.current&&N(!1)}};return n===null?s.jsx("div",{className:"empty-state",children:"Loading Bedrock status…"}):s.jsxs("div",{className:"bedrock-onboarding",children:[s.jsx("h2",{className:"section-title",children:"🟠 AWS Bedrock"}),s.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 ",s.jsx("strong",{children:"region"}),", ",s.jsx("strong",{children:"AWS credentials"}),", and explicit ",s.jsx("strong",{children:"model access approval"}),"."]}),C?s.jsx("div",{className:`admin-row-msg${C.kind==="ok"?"":" admin-row-msg-err"}`,children:C.text}):null,s.jsxs("div",{className:"bedrock-status-bar",children:[s.jsxs("div",{className:"bedrock-status-item",children:[s.jsx("span",{className:`status-dot ${n.configured?"connected":"reconnecting"}`}),s.jsx("span",{children:n.configured?"Configured":"Not configured"})]}),s.jsxs("div",{className:"bedrock-status-item",children:[s.jsx("span",{className:"bedrock-status-label",children:"Region:"}),s.jsx("code",{children:n.region})]}),s.jsxs("div",{className:"bedrock-status-item",children:[s.jsx("span",{className:"bedrock-status-label",children:"Auth:"}),s.jsx("code",{children:n.authMethod==="bearer"?"API Key":n.authMethod==="iam"?"IAM":"None"})]}),s.jsxs("div",{className:"bedrock-status-actions",children:[e?s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>u(c==="setup"?"overview":"setup"),children:c==="setup"?"✕ Cancel":"⚙ Setup Wizard"}):null,n.configured?s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void R(),disabled:o,children:o?"⏳ Probing…":"🔍 Test Models"}):null]})]}),c==="setup"&&s.jsxs("div",{className:"bedrock-setup-wizard",children:[s.jsx("h3",{className:"section-subtitle",children:"🚀 Bedrock Setup Wizard"}),s.jsxs("div",{className:"bedrock-wizard-step",children:[s.jsx("h4",{children:"Step 1: Authentication"}),s.jsxs("div",{className:"bedrock-auth-options",children:[s.jsxs("label",{className:`bedrock-auth-option ${f==="bearer"?"selected":""}`,children:[s.jsx("input",{type:"radio",name:"authMethod",checked:f==="bearer",onChange:()=>h("bearer")}),s.jsxs("div",{children:[s.jsx("strong",{children:"Bedrock API Key"}),s.jsx("span",{children:"Simpler — get from Bedrock → Settings → API keys"})]})]}),s.jsxs("label",{className:`bedrock-auth-option ${f==="iam"?"selected":""}`,children:[s.jsx("input",{type:"radio",name:"authMethod",checked:f==="iam",onChange:()=>h("iam")}),s.jsxs("div",{children:[s.jsx("strong",{children:"IAM Credentials"}),s.jsx("span",{children:"Full AWS SDK auth — AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY"})]})]})]}),f==="bearer"?s.jsxs("div",{className:"bedrock-wizard-fields",children:[s.jsxs("div",{className:"bedrock-setup-hint",children:[s.jsx("strong",{children:"How to get a Bedrock API key:"}),s.jsxs("ol",{children:[s.jsxs("li",{children:["Open ",s.jsx("a",{href:"https://console.aws.amazon.com/bedrock/",target:"_blank",rel:"noopener noreferrer",children:"AWS Bedrock Console"})]}),s.jsxs("li",{children:["Go to ",s.jsx("strong",{children:"Settings"})," → ",s.jsx("strong",{children:"API keys"})]}),s.jsx("li",{children:"Create a new key and paste it below"})]})]}),s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:"Bedrock API Key (Bearer token)"}),s.jsx("input",{type:"password",value:p,onChange:I=>g(I.target.value),placeholder:"••••••••••••",autoComplete:"off",spellCheck:!1})]})]}):s.jsxs("div",{className:"bedrock-wizard-fields",children:[s.jsxs("div",{className:"bedrock-setup-hint",children:[s.jsx("strong",{children:"IAM credentials"})," give full AWS SDK access. Create an IAM user with Bedrock permissions."]}),s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:"AWS_ACCESS_KEY_ID"}),s.jsx("input",{type:"text",value:m,onChange:I=>v(I.target.value),placeholder:"AKIA...",autoComplete:"off",spellCheck:!1})]}),s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:"AWS_SECRET_ACCESS_KEY"}),s.jsx("input",{type:"password",value:y,onChange:I=>b(I.target.value),placeholder:"••••••••••••",autoComplete:"off",spellCheck:!1})]})]})]}),s.jsxs("div",{className:"bedrock-wizard-step",children:[s.jsx("h4",{children:"Step 2: AWS Region"}),s.jsxs("p",{className:"admin-hint",children:["Models vary by region. ",s.jsx("strong",{children:"us-east-1"})," and ",s.jsx("strong",{children:"us-west-2"})," have the most models. ⚠️ Do NOT use eu-north-1 unless models are explicitly enabled there."]}),s.jsx("select",{className:"bedrock-region-select",value:x,onChange:I=>k(I.target.value),children:Kge.map(I=>s.jsx("option",{value:I.value,children:I.label},I.value))})]}),s.jsxs("div",{className:"bedrock-wizard-step",children:[s.jsx("h4",{children:"Step 3: Model Access"}),s.jsx("p",{className:"admin-hint",children:"Bedrock requires you to request access for each model family."}),s.jsx("div",{className:"bedrock-model-access-hint",children:s.jsx("a",{href:`https://console.aws.amazon.com/bedrock/home?region=${x}#/modelaccess`,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn",children:"📖 Open Model Access in AWS Console"})}),s.jsx("div",{className:"bedrock-family-grid",children:JN.map(I=>s.jsxs("label",{className:`bedrock-family-card ${S.includes(I.name)?"selected":""}`,children:[s.jsx("input",{type:"checkbox",checked:S.includes(I.name),onChange:z=>{z.target.checked?w(D=>[...D,I.name]):w(D=>D.filter(F=>F!==I.name))}}),s.jsxs("div",{children:[s.jsx("strong",{children:I.name}),s.jsxs("span",{children:[I.models.length," model(s)"]})]})]},I.name))}),s.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."})]}),s.jsxs("div",{className:"bedrock-wizard-actions",children:[s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void L(),disabled:_||f==="bearer"&&!p||f==="iam"&&(!m||!y),children:_?"⏳ Saving…":"💾 Save & Test"}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>u("overview"),children:"Cancel"})]})]}),c==="test"&&i&&s.jsxs("div",{className:"bedrock-probe-results",children:[s.jsxs("h3",{className:"section-subtitle",children:["🔍 Model Probe Results (",n.region,")"]}),s.jsx("div",{className:"bedrock-probe-grid",children:i.map(I=>s.jsxs("div",{className:`bedrock-probe-card bedrock-probe-${I.status}`,children:[s.jsx("span",{className:"bedrock-probe-icon",children:I.status==="accessible"?"✅":I.status==="permission-denied"?"🔒":I.status==="not-found"?"⚫":"❌"}),s.jsx("span",{className:"bedrock-probe-id",children:I.modelId}),s.jsx("span",{className:"bedrock-probe-status",children:I.status==="accessible"?"Ready":I.status==="permission-denied"?`Need access (HTTP ${I.httpStatus})`:I.status==="not-found"?"Not in this region":"Error"})]},I.modelId))}),i.some(I=>I.status==="permission-denied")&&s.jsxs("div",{className:"bedrock-probe-action",children:[s.jsxs("p",{children:["Some models exist in ",n.region," but access is not approved."]}),s.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 →"})]}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>u("overview"),style:{marginTop:12},children:"← Back"})]}),!n.configured&&c==="overview"&&s.jsxs("div",{className:"bedrock-getting-started",children:[s.jsx("h3",{className:"section-subtitle",children:"📋 Getting Started with Bedrock"}),s.jsxs("div",{className:"bedrock-steps",children:[s.jsxs("div",{className:"bedrock-step",children:[s.jsx("span",{className:"bedrock-step-num",children:"1"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Create an AWS account"})," (or use existing)",s.jsxs("span",{children:["New to AWS? Sign up at ",s.jsx("a",{href:"https://aws.amazon.com/",target:"_blank",rel:"noopener noreferrer",children:"aws.amazon.com"})]})]})]}),s.jsxs("div",{className:"bedrock-step",children:[s.jsx("span",{className:"bedrock-step-num",children:"2"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Get Bedrock API key"}),s.jsx("span",{children:"Bedrock → Settings → API keys → Create key"})]})]}),s.jsxs("div",{className:"bedrock-step",children:[s.jsx("span",{className:"bedrock-step-num",children:"3"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Request model access"}),s.jsx("span",{children:"Bedrock → Model access → Select Claude, Llama, etc. → Submit"})]})]}),s.jsxs("div",{className:"bedrock-step",children:[s.jsx("span",{className:"bedrock-step-num",children:"4"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Configure in this wizard"}),s.jsx("span",{children:'Click "Setup Wizard" above to enter your credentials'})]})]})]})]}),n.configured&&c==="overview"&&!i&&s.jsx("div",{className:"bedrock-quick-status",children:s.jsxs("p",{className:"admin-hint",children:["Bedrock is configured. Click ",s.jsx("strong",{children:"🔍 Test Models"})," to verify connectivity and discover which models are accessible in ",n.region,"."]})})]})}const _g=["whatsapp","whatsapp_cloud","telegram","signal","slack","discord","email"];function Yge(){const[e,t]=E.useState([]),[n,r]=E.useState(!0),[i,a]=E.useState("all"),[o,l]=E.useState(null),[c,u]=E.useState(""),[d,f]=E.useState(""),[h,p]=E.useState(null),[g,m]=E.useState({}),[v,y]=E.useState({}),[b,x]=E.useState({}),[k,S]=E.useState(null),[w,_]=E.useState(!1),[N,C]=E.useState(!1),[T,$]=E.useState(!1),[R,L]=E.useState(12e4),I=E.useCallback(async()=>{r(!0);const H=await ee.getContacts();H.ok&&H.contacts&&t(H.contacts);const X=await ee.gatewayPolicies();if(X.ok&&X.policies){const oe={};for(const ce of _g){const Z=X.policies[ce];Z&&(oe[ce]={...Z.outboundSenders!==void 0?{outboundSenders:Z.outboundSenders}:{},...Z.requireApprovedTarget!==void 0?{requireApprovedTarget:Z.requireApprovedTarget}:{}})}m(oe),y(oe)}C(X.askUserWait===!0),$(X.askUserWait===!0),typeof X.askUserTimeoutMs=="number"&&L(X.askUserTimeoutMs),r(!1)},[]);E.useEffect(()=>{I()},[I]);const z=e.filter(H=>i==="all"||H.status===i),D=async H=>{p(null);const X=await ee.approveContact(H.platform,H.name);p(X.ok?{kind:"ok",text:`✅ ${H.name} approved.`}:{kind:"err",text:X.error||"Failed."}),I()},F=async H=>{p(null);const X=await ee.rejectContact(H.platform,H.name);p(X.ok?{kind:"ok",text:`🚫 ${H.name} rejected.`}:{kind:"err",text:X.error||"Failed."}),I()},O=async H=>{p(null);const X=await ee.deleteContact(H.platform,H.name);p(X.ok?{kind:"ok",text:`🗑️ ${H.name} deleted.`}:{kind:"err",text:X.error||"Failed."}),I()},P=async()=>{if(!o)return;p(null);const H=await ee.updateContact(o.platform,o.id,{name:c,phone:d});p(H.ok?{kind:"ok",text:`✅ ${c} updated.`}:{kind:"err",text:H.error||"Failed."}),l(null),I()},A=H=>H==="approved"?s.jsx("span",{className:"contact-status-badge approved",children:"✅ Approved"}):H==="pending"?s.jsx("span",{className:"contact-status-badge pending",children:"⏳ Pending"}):s.jsx("span",{className:"contact-status-badge rejected",children:"🚫 Rejected"}),Y=H=>({telegram:"✈️",whatsapp:"📱",whatsapp_cloud:"📱",email:"📧",slack:"💬",discord:"🎮"})[H]||"🔌",K=H=>H?new Date(H).toLocaleString():"—",M=H=>{const X=(b[H]??"").trim();X&&(m(oe=>{var _e;const ce={...oe[H]??{}},Z=ce.outboundSenders??((_e=v[H])==null?void 0:_e.outboundSenders)??[];return Z.some(we=>we.toLowerCase()===X.toLowerCase())||(ce.outboundSenders=[...Z,X]),{...oe,[H]:ce}}),x(oe=>({...oe,[H]:""})))},le=(H,X)=>{m(oe=>{var _e;const ce={...oe[H]??{}},Z=ce.outboundSenders??((_e=v[H])==null?void 0:_e.outboundSenders)??[];return ce.outboundSenders=Z.filter(we=>we.toLowerCase()!==X.toLowerCase()),{...oe,[H]:ce}})},be=H=>{m(X=>{const oe={...X[H]??{}};return oe.requireApprovedTarget=oe.requireApprovedTarget!==!0,{...X,[H]:oe}})},me=H=>{m(X=>{const oe={...X[H]??{}};return delete oe.outboundSenders,{...X,[H]:oe}})},Pe=async()=>{_(!0),S(null);const H={};for(const ce of _g){const Z=g[ce]??{},_e=v[ce]??{};(JSON.stringify(Z.outboundSenders??null)!==JSON.stringify(_e.outboundSenders??null)||!!Z.requireApprovedTarget!=!!_e.requireApprovedTarget)&&(H[ce]={...Z.outboundSenders!==void 0?{outboundSenders:Z.outboundSenders}:{outboundSenders:null},requireApprovedTarget:!!Z.requireApprovedTarget})}const X=N!==T;if(Object.keys(H).length===0&&!X){_(!1),S({kind:"ok",text:"No changes to save."});return}const oe=await ee.saveGatewayPolicies(H,void 0,void 0,{wait:N,timeoutMs:R});oe.ok?(S({kind:"ok",text:"✅ Send authority saved."}),I()):S({kind:"err",text:oe.error||"Failed to save send authority."}),_(!1)};return s.jsxs("div",{className:"panel contacts-page",children:[s.jsxs("div",{className:"panel-header",children:[s.jsx("h2",{children:"📇 Contacts — Outbound Messaging Directory"}),s.jsx("p",{className:"admin-hint",children:"Manage who the bot can send messages to. Users auto-register on first Telegram message."})]}),h&&s.jsxs("div",{className:`admin-row-msg ${h.kind==="err"?"admin-row-msg-err":""}`,children:[h.text,s.jsx("button",{className:"admin-mini-btn",onClick:()=>p(null),children:"✕"})]}),s.jsxs("div",{className:"contacts-filters",children:[["all","approved","pending","rejected"].map(H=>s.jsx("button",{type:"button",className:i===H?"platforms-filter-btn active":"platforms-filter-btn",onClick:()=>a(H),children:H==="all"?`All (${e.length})`:H==="approved"?`✅ Approved (${e.filter(X=>X.status==="approved").length})`:H==="pending"?`⏳ Pending (${e.filter(X=>X.status==="pending").length})`:`🚫 Rejected (${e.filter(X=>X.status==="rejected").length})`},H)),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void I(),children:"🔄 Refresh"})]}),n?s.jsx("div",{className:"empty-state",children:"Loading contacts..."}):z.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsxs("p",{children:["No contacts",i!=="all"?` with status "${i}"`:"","."]}),s.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.'})]}):s.jsx("div",{className:"contacts-table-wrapper",children:s.jsxs("table",{className:"contacts-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Platform"}),s.jsx("th",{children:"Name"}),s.jsx("th",{children:"ID"}),s.jsx("th",{children:"Phone"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Registered"}),s.jsx("th",{children:"Actions"})]})}),s.jsx("tbody",{children:z.map(H=>s.jsxs("tr",{className:`contact-row status-${H.status}`,children:[s.jsxs("td",{children:[Y(H.platform)," ",H.platform]}),s.jsx("td",{className:"contact-name",children:H.name}),s.jsx("td",{className:"contact-id",children:s.jsx("code",{children:H.id})}),s.jsx("td",{className:"contact-phone",children:H.phone||"—"}),s.jsx("td",{children:A(H.status)}),s.jsx("td",{className:"contact-date",children:K(H.registeredAt||H.addedAt)}),s.jsxs("td",{className:"contact-actions",children:[H.status!=="approved"&&s.jsx("button",{className:"admin-mini-btn contact-approve-btn",onClick:()=>void D(H),children:"✅ Approve"}),H.status!=="rejected"&&s.jsx("button",{className:"admin-mini-btn contact-reject-btn",onClick:()=>void F(H),children:"🚫 Reject"}),s.jsx("button",{className:"admin-mini-btn",onClick:()=>{l(H),u(H.name),f(H.phone||"")},children:"✏️ Edit"}),s.jsx("button",{className:"admin-mini-btn contact-delete-btn",onClick:()=>void O(H),children:"🗑️"})]})]},`${H.platform}:${H.id}`))})]})}),s.jsxs("div",{className:"panel-header",style:{marginTop:28},children:[s.jsx("h2",{children:"🔐 Send authority — who may message others"}),s.jsxs("p",{className:"admin-hint",children:["Controls who can ask the agent to send a message to ",s.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 ",s.jsx("em",{children:"to"})," that person. Left empty, a platform ",s.jsx("strong",{children:"inherits"})," its allowed-users list (open). Add ",s.jsx("code",{children:"Allow-All"})," to allow everyone, or list specific senders to restrict it."]})]}),k&&s.jsxs("div",{className:`admin-row-msg ${k.kind==="err"?"admin-row-msg-err":""}`,children:[k.text,s.jsx("button",{className:"admin-mini-btn",onClick:()=>S(null),children:"✕"})]}),s.jsx("div",{className:"hub-permissions",children:_g.map(H=>{const X=g[H]??{},oe=X.outboundSenders??[],ce=X.outboundSenders===void 0;return s.jsxs("div",{className:"hub-card",children:[s.jsxs("div",{className:"hub-card-top",children:[s.jsxs("span",{className:"hub-chip",children:[Y(H)," ",H]}),ce?s.jsx("span",{className:"hub-chip",children:"open"}):s.jsx("span",{className:"hub-chip",children:"restricted"})]}),s.jsx("div",{className:"hub-alias-list",children:ce?s.jsx("span",{className:"admin-hint",children:"Open — anyone who can trigger the agent may send to others."}):oe.length===0?s.jsx("span",{className:"admin-hint",children:"(empty — nobody may send to others)"}):oe.map(Z=>s.jsxs("div",{className:"hub-alias-row",children:[s.jsx("span",{className:"hub-chip",children:Z}),s.jsx("button",{className:"admin-refresh-btn",disabled:w,onClick:()=>le(H,Z),children:"✕"})]},`sa-${H}-${Z}`))}),s.jsxs("div",{className:"hub-send-form",children:[s.jsx("input",{type:"text",value:b[H]??"",onChange:Z=>x(_e=>({..._e,[H]:Z.target.value})),placeholder:"sender id, or Allow-All",disabled:w}),s.jsx("button",{className:"admin-refresh-btn",disabled:w||!(b[H]??"").trim(),onClick:()=>M(H),children:"+ Sender"}),ce?null:s.jsx("button",{className:"admin-refresh-btn",disabled:w,onClick:()=>me(H),children:"↺ Reset to open"})]}),s.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginTop:6},children:[s.jsx("input",{type:"checkbox",checked:!!X.requireApprovedTarget,disabled:w,onChange:()=>be(H)}),s.jsx("span",{className:"admin-hint",children:"Require approved recipients"})]})]},`sa-${H}`)})}),s.jsxs("div",{className:"hub-card",style:{marginTop:16},children:[s.jsxs("div",{className:"hub-card-top",children:[s.jsx("span",{className:"hub-chip",children:"🧠 Clarifying questions"}),N?s.jsx("span",{className:"hub-chip",children:"wait for reply"}):s.jsx("span",{className:"hub-chip",children:"assume option 1"}),N!==T?s.jsx("span",{className:"hub-chip",children:"· unsaved"}):null]}),s.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginTop:6},children:[s.jsx("input",{type:"checkbox",checked:N,disabled:w,onChange:()=>C(H=>!H)}),s.jsxs("span",{className:"admin-hint",children:["When the agent asks a question on a channel, ",s.jsx("strong",{children:"wait for the sender's reply"})," before acting. Off (default): the question is sent and the ",s.jsx("em",{children:"first"})," option is assumed immediately — so a reply typed afterwards arrives too late to change anything."]})]}),N?s.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginTop:6},children:[s.jsx("span",{className:"admin-hint",children:"Reply window (seconds)"}),s.jsx("input",{type:"number",min:5,max:600,value:Math.round(R/1e3),disabled:w,onChange:H=>L(Math.max(5,Math.min(600,Number(H.target.value)||120))*1e3),style:{width:90}}),s.jsx("span",{className:"admin-hint",children:"then the first option is used, and the timeout is logged."})]}):null]}),s.jsx("div",{style:{marginTop:12},children:s.jsx("button",{className:"admin-refresh-btn",disabled:w,onClick:()=>void Pe(),children:"💾 Save send authority"})}),o&&s.jsx("div",{className:"wizard-overlay",onClick:()=>l(null),children:s.jsxs("div",{className:"wizard-modal",onClick:H=>H.stopPropagation(),children:[s.jsxs("div",{className:"wizard-header",children:[s.jsx("span",{className:"wizard-icon",children:"✏️"}),s.jsxs("span",{className:"wizard-title",children:["Edit Contact: ",o.name]}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>l(null),children:"✕"})]}),s.jsxs("div",{className:"wizard-body",children:[s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:"Name"}),s.jsx("input",{type:"text",value:c,onChange:H=>u(H.target.value)})]}),s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:"Phone (optional, for flexible lookup)"}),s.jsx("input",{type:"text",value:d,onChange:H=>f(H.target.value),placeholder:"+918800123456"})]}),s.jsxs("p",{className:"admin-hint",children:["Platform: ",s.jsx("strong",{children:o.platform})," | ID: ",s.jsx("code",{children:o.id})]}),s.jsxs("div",{className:"wizard-nav",children:[s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>l(null),children:"Cancel"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void P(),children:"Save"})]})]})]})})]})}function uo(e){if(e<=0)return"never";const t=Math.floor(e/1e3),n=Math.floor(t/60),r=Math.floor(n/60),i=Math.floor(r/24);return i>30?`${i}d ago`:i>0?`${i}d ${r%24}h ago`:r>0?`${r}h ${n%60}m ago`:n>0?`${n}m ago`:`${t}s ago`}function Xge(e,t,n){if(e==="unavailable")return"#f85149";if(e==="unverified")return"#d29922";const i=(Date.now()-t)/(24*60*60*1e3);return i>30&&n>.5?"#f85149":i>7?"#d29922":"#3fb950"}function Zge(e,t,n){if(e==="unavailable")return"Unavailable";if(e==="unverified")return"Unverified";const i=(Date.now()-t)/(24*60*60*1e3);return i>30&&n>.5?"Likely Removed":i>7?"Stale":"Fresh"}function Qge({entry:e}){const t=Date.now(),n=t-e.lastProbedAt,r=t-e.lastVerifiedAt,i=t-e.lastUsedAt,a=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,i/(30*24*60*60*1e3)*100):-1;return s.jsxs("div",{className:"timeline-bar-container",children:[s.jsx("div",{className:"timeline-bar",title:`Last probed: ${uo(n)}`,children:s.jsx("div",{className:"timeline-bar-fill probe",style:{width:`${a}%`}})}),o>=0&&s.jsx("div",{className:"timeline-bar small",title:`Last verified: ${uo(r)}`,children:s.jsx("div",{className:"timeline-bar-fill verify",style:{width:`${o}%`}})}),l>=0&&s.jsx("div",{className:"timeline-bar small",title:`Last used: ${uo(i)}`,children:s.jsx("div",{className:"timeline-bar-fill use",style:{width:`${l}%`}})})]})}function Jge(){const[e,t]=E.useState(null),[n,r]=E.useState(!0),[i,a]=E.useState(null),[o,l]=E.useState("all"),[c,u]=E.useState("provider"),d=E.useRef(!0),f=E.useCallback(async()=>{try{const v=await fetch("/api/model-timeline");if(!v.ok)throw new Error("Failed to fetch timeline data");const y=await v.json();d.current&&(t(y),a(null))}catch(v){d.current&&a(v instanceof Error?v.message:"Failed to load timeline")}finally{d.current&&r(!1)}},[]);if(E.useEffect(()=>{d.current=!0,f();const v=setInterval(f,3e4);return()=>{d.current=!1,clearInterval(v)}},[f]),n)return s.jsxs("div",{className:"admin-header",children:[s.jsx("h2",{className:"section-title",children:"📅 Model Discovery Timeline"}),s.jsxs("div",{className:"loading-state",children:[s.jsx("div",{className:"loading-spinner"}),s.jsx("p",{children:"Loading timeline..."})]})]});if(i)return s.jsxs("div",{className:"admin-header",children:[s.jsx("h2",{className:"section-title",children:"📅 Model Discovery Timeline"}),s.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:i})]});const p=((e==null?void 0:e.entries)??[]).filter(v=>{const b=(Date.now()-v.lastProbedAt)/(24*60*60*1e3),x=b>7,k=b>30&&v.errorRate>.5,S=!x&&!k;return o==="fresh"?S:o==="stale"?x&&!k:o==="removed"?k:!0}),g=[...p].sort((v,y)=>{if(c==="provider")return v.provider.localeCompare(y.provider)||v.model.localeCompare(y.model);if(c==="lastProbed")return y.lastProbedAt-v.lastProbedAt;if(c==="status"){const b={unavailable:0,unverified:1,verified:2};return(b[y.status]??0)-(b[v.status]??0)}return 0}),m=new Map;for(const v of g)m.has(v.provider)||m.set(v.provider,[]),m.get(v.provider).push(v);return s.jsxs("div",{className:"admin-header",children:[s.jsx("h2",{className:"section-title",children:"📅 Model Discovery Timeline"}),s.jsxs("div",{className:"stats-grid",style:{marginBottom:16},children:[s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-value",children:(e==null?void 0:e.totalModels)??0}),s.jsx("div",{className:"stat-label",children:"Total Models"})]}),s.jsxs("div",{className:"stat-card",style:{borderColor:"#3fb950"},children:[s.jsx("div",{className:"stat-value",style:{color:"#3fb950"},children:(e==null?void 0:e.freshCount)??0}),s.jsx("div",{className:"stat-label",children:"Fresh (<7d)"})]}),s.jsxs("div",{className:"stat-card",style:{borderColor:"#d29922"},children:[s.jsx("div",{className:"stat-value",style:{color:"#d29922"},children:(e==null?void 0:e.staleCount)??0}),s.jsx("div",{className:"stat-label",children:"Stale (7-30d)"})]}),s.jsxs("div",{className:"stat-card",style:{borderColor:"#f85149"},children:[s.jsx("div",{className:"stat-value",style:{color:"#f85149"},children:(e==null?void 0:e.removedCount)??0}),s.jsx("div",{className:"stat-label",children:"Likely Removed (>30d)"})]})]}),s.jsxs("div",{style:{display:"flex",gap:8,marginBottom:16,flexWrap:"wrap"},children:[s.jsx("div",{style:{display:"flex",gap:4},children:["all","fresh","stale","removed"].map(v=>s.jsx("button",{className:`admin-refresh-btn ${o===v?"active":""}`,onClick:()=>l(v),style:{background:o===v?"#238636":"#21262d",border:`1px solid ${o===v?"#3fb950":"#30363d"}`,padding:"4px 12px",fontSize:12,cursor:"pointer"},children:v.charAt(0).toUpperCase()+v.slice(1)},v))}),s.jsx("div",{style:{display:"flex",gap:4},children:["provider","lastProbed","status"].map(v=>s.jsxs("button",{className:`admin-refresh-btn ${c===v?"active":""}`,onClick:()=>u(v),style:{background:c===v?"#238636":"#21262d",border:`1px solid ${c===v?"#3fb950":"#30363d"}`,padding:"4px 12px",fontSize:12,cursor:"pointer"},children:["Sort: ",v==="lastProbed"?"Last Seen":v.charAt(0).toUpperCase()+v.slice(1)]},v))}),s.jsx("button",{className:"admin-refresh-btn",onClick:f,style:{background:"#21262d",border:"1px solid #30363d",padding:"4px 12px",fontSize:12,cursor:"pointer"},children:"🔄 Refresh"})]}),s.jsxs("div",{style:{display:"flex",gap:16,marginBottom:12,fontSize:11,color:"#8b949e"},children:[s.jsxs("span",{children:[s.jsx("span",{style:{color:"#58a6ff"},children:"■"})," Probe (last seen)"]}),s.jsxs("span",{children:[s.jsx("span",{style:{color:"#3fb950"},children:"■"})," Verified (last success)"]}),s.jsxs("span",{children:[s.jsx("span",{style:{color:"#d29922"},children:"■"})," Used (last invocation)"]})]}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from(m.entries()).map(([v,y])=>s.jsxs("div",{style:{background:"#161b22",borderRadius:8,border:"1px solid #30363d",overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"10px 14px",borderBottom:"1px solid #30363d",display:"flex",alignItems:"center",gap:8},children:[s.jsx("span",{style:{fontSize:16},children:v==="groq"?"⚡":v==="gemini"?"🌀":v==="local"?"💻":"🤖"}),s.jsx("span",{style:{fontWeight:600,color:"#e6edf3"},children:v}),s.jsxs("span",{style:{fontSize:12,color:"#8b949e"},children:["(",y.length," models)"]})]}),s.jsx("div",{style:{padding:"8px 14px"},children:y.map(b=>{const x=Date.now();(x-b.lastProbedAt)/(24*60*60*1e3);const k=Xge(b.status,b.lastProbedAt,b.errorRate),S=Zge(b.status,b.lastProbedAt,b.errorRate);return s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"6px 0",borderBottom:"1px solid #21262d"},children:[s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsx("div",{style:{fontSize:13,color:"#e6edf3",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:b.model}),s.jsxs("div",{style:{fontSize:11,color:"#8b949e",display:"flex",gap:12},children:[s.jsxs("span",{children:["Probed: ",uo(x-b.lastProbedAt)]}),b.lastVerifiedAt>0&&s.jsxs("span",{children:["Verified: ",uo(x-b.lastVerifiedAt)]}),b.lastUsedAt>0&&s.jsxs("span",{children:["Used: ",uo(x-b.lastUsedAt)]}),b.latencyMs!==void 0&&s.jsxs("span",{children:[b.latencyMs,"ms"]})]})]}),s.jsx(Qge,{entry:b}),s.jsx("div",{style:{fontSize:11,padding:"2px 8px",borderRadius:4,background:`${k}20`,color:k,border:`1px solid ${k}40`,whiteSpace:"nowrap"},children:S})]},b.model)})})]},v))}),p.length===0&&s.jsx("div",{style:{textAlign:"center",padding:"40px 20px",color:"#8b949e"},children:"No models match the current filter"})]})}function _a(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":e.toLocaleString()}function eye(e){return e==null?"0%":(e*100).toFixed(1)+"%"}function tye({data:e}){var o,l;if(!e)return s.jsx("div",{className:"loading-state",children:s.jsx("p",{children:"Loading memory data..."})});const{memory:t,health:n}=e,r=Object.entries(t.byFingerprint||{}).sort(([,c],[,u])=>u-c),i=Object.entries(((o=t.facts)==null?void 0:o.byProject)||{}).sort(([,c],[,u])=>u-c),a=t.recall||{total:0,today:0,last7d:0};return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"💾 Memory Store"}),s.jsxs("div",{className:"stats-grid mini",children:[s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-value",children:_a(t.total)}),s.jsx("div",{className:"stat-label",children:"Trajectories"})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-value",children:eye(t.avgScore)}),s.jsx("div",{className:"stat-label",children:"Avg Score"})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-value",children:_a((l=t.facts)==null?void 0:l.total)}),s.jsx("div",{className:"stat-label",children:"Facts"})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-value",children:_a(a.total)}),s.jsx("div",{className:"stat-label",children:"Recall Hits"})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-value",children:_a(n==null?void 0:n.patterns)}),s.jsx("div",{className:"stat-label",children:"Coding Patterns"})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-value",children:_a(n==null?void 0:n.feedback)}),s.jsx("div",{className:"stat-label",children:"Feedback Ratings"})]})]}),s.jsxs("p",{className:"memory-backend",children:["Backend: ",s.jsx("code",{children:t.backend||"local"}),a.last7d>0?` · ${_a(a.last7d)} recall(s) this week, ${_a(a.today)} today`:" · no recalls yet"]}),r.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"section-subtitle",children:"By Project Type"}),s.jsx("div",{className:"memory-list",children:r.map(([c,u])=>s.jsxs("div",{className:"memory-item",children:[s.jsx("span",{className:"memory-project",children:c}),s.jsxs("span",{className:"memory-count",children:[u," trajectory(ies)"]})]},c))})]}),i.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"section-subtitle",children:"Facts by Project"}),s.jsx("div",{className:"memory-list",children:i.map(([c,u])=>s.jsxs("div",{className:"memory-item",children:[s.jsx("span",{className:"memory-project",children:c}),s.jsxs("span",{className:"memory-count",children:[u," fact(s)"]})]},c))})]})]})}function nye(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function rye({data:e}){if(!e)return s.jsx("div",{className:"loading-state",children:s.jsx("p",{children:"Loading history..."})});const{history:t}=e,n=t.recent||[];return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"📝 Conversation History"}),s.jsx("div",{className:"history-stats",children:s.jsxs("span",{className:"history-count",children:["Total: ",s.jsx("strong",{children:t.total})," sessions"]})}),s.jsx("div",{className:"history-list",children:n.length===0?s.jsx("div",{className:"empty-state",children:"No conversations recorded yet."}):n.map(r=>s.jsxs("div",{className:"history-item",children:[s.jsx("div",{className:"history-summary",children:r.summary||"Untitled"}),s.jsxs("div",{className:"history-meta",children:[s.jsxs("span",{children:["📅 ",nye(r.startedAt)]}),s.jsxs("span",{children:["🤖 ",r.provider||"--"]}),s.jsxs("span",{children:["💬 ",r.messageCount||0," msgs"]}),r.tags&&r.tags.length>0&&s.jsxs("span",{children:["🏷️ ",r.tags.map(i=>s.jsx("span",{className:"history-tag",children:i},i))]})]})]},r.id))})]})}function iye({onFetch:e,onClear:t,onExport:n}){const[r,i]=E.useState([]),[a,o]=E.useState(!1),[l,c]=E.useState(""),[u,d]=E.useState(""),[f,h]=E.useState(null),[p,g]=E.useState(null);E.useEffect(()=>{m()},[l,u]);const m=async()=>{o(!0);try{const k=await e({skillName:l||void 0,status:u||void 0,limit:100});i(k);const S=k.length,w=k.filter(C=>C.status==="success").length,_=k.filter(C=>C.status==="failure").length,N=S>0?Math.round(k.reduce((C,T)=>C+T.durationMs,0)/S):0;g({total:S,success:w,failure:_,avgDuration:N})}catch(k){console.error("Failed to fetch execution history:",k)}finally{o(!1)}},v=async k=>{if(n)try{const S=await n(k),w=new Blob([S],{type:k==="json"?"application/json":"text/csv"}),_=URL.createObjectURL(w),N=document.createElement("a");N.href=_,N.download=`execution-history.${k}`,N.click(),URL.revokeObjectURL(_)}catch(S){console.error("Failed to export history:",S)}},y=async()=>{if(t&&confirm("Are you sure you want to clear all execution history?"))try{await t(),i([]),g(null)}catch(k){console.error("Failed to clear history:",k)}},b=k=>{switch(k){case"success":return"✅";case"failure":return"❌";case"timeout":return"⏰";case"rejected":return"🚫";case"error":return"💥";default:return"❓"}},x=k=>{switch(k){case"python":return"🐍";case"node":return"🟢";case"shell":return"🖥️";case"ruby":return"💎";case"go":return"🔵";case"rust":return"🦀";default:return"📜"}};return s.jsxs("div",{className:"execution-history",children:[s.jsxs("div",{className:"execution-history-header",children:[s.jsx("h3",{className:"execution-history-title",children:"📜 Execution History"}),s.jsxs("div",{className:"execution-history-actions",children:[s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>v("json"),children:"📥 Export JSON"}),s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>v("csv"),children:"📥 Export CSV"}),t&&s.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",onClick:y,children:"🗑️ Clear"})]})]}),p&&s.jsxs("div",{className:"execution-history-stats",children:[s.jsxs("div",{className:"stat-item",children:[s.jsx("span",{className:"stat-value",children:p.total}),s.jsx("span",{className:"stat-label",children:"Total"})]}),s.jsxs("div",{className:"stat-item stat-success",children:[s.jsx("span",{className:"stat-value",children:p.success}),s.jsx("span",{className:"stat-label",children:"Success"})]}),s.jsxs("div",{className:"stat-item stat-failure",children:[s.jsx("span",{className:"stat-value",children:p.failure}),s.jsx("span",{className:"stat-label",children:"Failed"})]}),s.jsxs("div",{className:"stat-item",children:[s.jsxs("span",{className:"stat-value",children:[p.avgDuration,"ms"]}),s.jsx("span",{className:"stat-label",children:"Avg Duration"})]})]}),s.jsxs("div",{className:"execution-history-filters",children:[s.jsx("input",{className:"env-var-input",type:"text",placeholder:"Filter by skill name...",value:l,onChange:k=>c(k.target.value)}),s.jsxs("select",{className:"env-var-input",value:u,onChange:k=>d(k.target.value),children:[s.jsx("option",{value:"",children:"All statuses"}),s.jsx("option",{value:"success",children:"Success"}),s.jsx("option",{value:"failure",children:"Failure"}),s.jsx("option",{value:"timeout",children:"Timeout"}),s.jsx("option",{value:"rejected",children:"Rejected"}),s.jsx("option",{value:"error",children:"Error"})]})]}),s.jsx("div",{className:"execution-history-list",children:a?s.jsx("div",{className:"execution-history-empty",children:"Loading..."}):r.length===0?s.jsx("div",{className:"execution-history-empty",children:"No execution history found. Execute a skill to see results here."}):r.map(k=>s.jsxs("div",{className:`execution-history-entry ${k.status}`,onClick:()=>h((f==null?void 0:f.id)===k.id?null:k),children:[s.jsxs("div",{className:"entry-header",children:[s.jsx("span",{className:"entry-icon",children:b(k.status)}),s.jsx("span",{className:"entry-skill",children:k.skillName}),s.jsxs("span",{className:"entry-runtime",children:[x(k.runtime)," ",k.runtime]}),s.jsxs("span",{className:"entry-duration",children:[k.durationMs,"ms"]}),s.jsx("span",{className:"entry-time",children:new Date(k.timestamp).toLocaleString()}),s.jsx("span",{className:"entry-expand",children:(f==null?void 0:f.id)===k.id?"▼":"▶"})]}),(f==null?void 0:f.id)===k.id&&s.jsxs("div",{className:"entry-details",children:[s.jsxs("div",{className:"entry-detail-row",children:[s.jsx("span",{className:"detail-label",children:"Status:"}),s.jsx("span",{className:"detail-value",children:k.status})]}),s.jsxs("div",{className:"entry-detail-row",children:[s.jsx("span",{className:"detail-label",children:"Runtime:"}),s.jsx("span",{className:"detail-value",children:k.runtime})]}),s.jsxs("div",{className:"entry-detail-row",children:[s.jsx("span",{className:"detail-label",children:"Duration:"}),s.jsxs("span",{className:"detail-value",children:[k.durationMs,"ms"]})]}),k.exitCode!==void 0&&s.jsxs("div",{className:"entry-detail-row",children:[s.jsx("span",{className:"detail-label",children:"Exit Code:"}),s.jsx("span",{className:"detail-value",children:k.exitCode})]}),k.error&&s.jsxs("div",{className:"entry-detail-row",children:[s.jsx("span",{className:"detail-label",children:"Error:"}),s.jsx("span",{className:"detail-value entry-error",children:k.error})]}),k.command&&s.jsxs("div",{className:"entry-detail-row",children:[s.jsx("span",{className:"detail-label",children:"Command:"}),s.jsx("code",{className:"detail-value",children:k.command})]})]})]},k.id))})]})}function aye({envVars:e,onSave:t,onDelete:n,onTest:r,readOnly:i=!1}){const[a,o]=E.useState(null),[l,c]=E.useState(""),[u,d]=E.useState(!1),[f,h]=E.useState(""),[p,g]=E.useState(""),[m,v]=E.useState(null),[y,b]=E.useState({}),x=[...e].sort((_,N)=>_.requiredBy&&!N.requiredBy?-1:!_.requiredBy&&N.requiredBy?1:_.name.localeCompare(N.name)),k=_=>{t(_,l),o(null),c("")},S=()=>{f&&p&&(t(f,p),h(""),g(""),d(!1))},w=async _=>{if(r){v(_);try{const N=await r(_);b(C=>({...C,[_]:N}))}catch{b(N=>({...N,[_]:!1}))}finally{v(null)}}};return s.jsxs("div",{className:"env-var-editor",children:[s.jsxs("div",{className:"env-var-header",children:[s.jsx("h3",{className:"env-var-title",children:"🔐 Environment Variables"}),!i&&s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>d(!u),children:u?"✕ Cancel":"+ Add Variable"})]}),u&&!i&&s.jsxs("div",{className:"env-var-add-form",children:[s.jsx("input",{className:"env-var-input",type:"text",placeholder:"Variable name (e.g., MY_API_KEY)",value:f,onChange:_=>h(_.target.value)}),s.jsx("input",{className:"env-var-input",type:"password",placeholder:"Value",value:p,onChange:_=>g(_.target.value)}),s.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:!f||!p,onClick:S,children:"💾 Save"})]}),s.jsx("div",{className:"env-var-list",children:x.length===0?s.jsx("div",{className:"env-var-empty",children:"No environment variables configured. Add one to get started."}):x.map(_=>s.jsxs("div",{className:`env-var-row ${_.isSet?"env-var-set":"env-var-missing"} ${_.isProviderCredential?"env-var-blocked":""}`,children:[s.jsxs("div",{className:"env-var-row-header",children:[s.jsxs("span",{className:"env-var-name",children:[_.name,_.requiredBy&&s.jsxs("span",{className:"env-var-required-badge",children:["required by ",_.requiredBy]}),_.isProviderCredential&&s.jsx("span",{className:"env-var-blocked-badge",children:"🔒 provider credential (blocked)"})]}),s.jsx("span",{className:"env-var-status",children:_.isSet?"✅ Set":"❌ Not set"})]}),_.description&&s.jsx("div",{className:"env-var-description",children:_.description}),a===_.name?s.jsxs("div",{className:"env-var-edit",children:[s.jsx("input",{className:"env-var-input",type:"password",value:l,onChange:N=>c(N.target.value),placeholder:"Enter new value..."}),s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>k(_.name),children:"💾 Save"}),s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>o(null),children:"Cancel"})]}):s.jsxs("div",{className:"env-var-actions",children:[!i&&!_.isProviderCredential&&s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>{o(_.name),c("")},children:"✏️ Edit"}),r&&s.jsx("button",{className:"admin-mini-btn",type:"button",disabled:m===_.name,onClick:()=>w(_.name),children:m===_.name?"⏳ Testing...":"🧪 Test"}),!i&&s.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",onClick:()=>n(_.name),children:"🗑️ Delete"}),y[_.name]!==void 0&&s.jsx("span",{className:`env-var-test-result ${y[_.name]?"env-var-test-pass":"env-var-test-fail"}`,children:y[_.name]?"✅ Valid":"❌ Invalid"})]})]},_.name))}),s.jsx("div",{className:"env-var-help",children:s.jsxs("p",{children:[s.jsx("strong",{children:"Tip:"})," Environment variables are stored in ",s.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 sye(){const[e,t]=E.useState({configured:!1,authenticated:!1,role:null}),[n,r]=E.useState([]),[i,a]=E.useState(!0),[o,l]=E.useState(null),[c,u]=E.useState(null),d=e.authenticated&&(e.role==="admin"||e.role==="operator"),f=E.useCallback(async()=>{a(!0);const m=await ee.fetchSkillEnv();r(m),a(!1)},[]);E.useEffect(()=>{ee.fetchAdminAuthStatus().then(m=>{t(m?{configured:m.configured,authenticated:m.authenticated,role:m.role??null}:{configured:!1,authenticated:!1,role:null})}),f()},[f]);const h=E.useCallback(async(m,v)=>{var x;l(null),u(null);const y=await ee.saveSecrets({[m]:v}),b=(x=y.refused)==null?void 0:x.find(k=>k.name===m);!y.ok||b?l(b?oye(m,b.reason):y.error||`Could not save ${m}.`):u(`Saved ${m}.`),await f()},[f]),p=E.useCallback(async m=>{l(null),u(null);const v=await ee.deleteSkillEnvVar(m);v.ok?u(v.removed?`Deleted ${m}.`:`${m} was not stored in the env file.`):l(v.error||`Could not delete ${m}.`),await f()},[f]),g=E.useCallback(async m=>{const v=await ee.testSkillEnvVar(m);return v.ok?(l(null),u(v.detail||`${m}: ${v.usable?"usable by skills":"not usable by skills"}`),v.usable===!0):(l(v.error||`Could not test ${m}.`),!1)},[]);return s.jsxs("div",{children:[s.jsx("h2",{className:"section-title",children:"🔐 Skill Environment Variables"}),s.jsxs("div",{className:"env-var-header",children:[s.jsx("span",{className:"env-var-title",children:"Values are masked; only names and set/unset state are shown."}),s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void f(),children:"↻ Refresh"})]}),s.jsxs("div",{className:"admin-hint",children:["Secrets here are injected into skill executions that declare them (",s.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:s.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&&!d?s.jsx("div",{className:"admin-hint",children:"Read-only — admins and operators can change these values."}):null,o?s.jsx("div",{className:"env-var-notice env-var-notice-error",children:o}):null,c?s.jsx("div",{className:"env-var-notice",children:c}):null,i?s.jsx("div",{className:"loading-state",children:"Loading…"}):s.jsx(aye,{envVars:n,onSave:(m,v)=>void h(m,v),onDelete:m=>void p(m),onTest:g,readOnly:!d})]})}function oye(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}).`}}function lye(){const[e,t]=E.useState(null),[n,r]=E.useState(!1),[i,a]=E.useState("--"),o=E.useCallback(c=>{t(c),a(new Date().toLocaleTimeString())},[]),l=E.useCallback(c=>{r(c)},[]);return E.useEffect(()=>{ee.fetchAll().then(d=>{d&&o(d)});const c=ee.subscribe(o),u=ee.onConnectionChange(l);return ee.connect(),()=>{c(),u(),ee.disconnect()}},[o,l]),s.jsx(WL,{connected:n,lastUpdated:i,children:s.jsxs(EL,{children:[s.jsx(at,{path:"/",element:s.jsx(ZN,{})}),s.jsx(at,{path:"/overview",element:s.jsx(xie,{data:e})}),s.jsx(at,{path:"/chat",element:s.jsx(d1,{to:"/",replace:!0})}),s.jsx(at,{path:"/dag",element:s.jsx(Tie,{data:e})}),s.jsx(at,{path:"/costs",element:s.jsx(Oie,{data:e})}),s.jsx(at,{path:"/benchmarks",element:s.jsx(Mie,{data:e})}),s.jsx(at,{path:"/models",element:s.jsx(gae,{})}),s.jsx(at,{path:"/models/timeline",element:s.jsx(Jge,{})}),s.jsx(at,{path:"/routing",element:s.jsx(Zae,{data:e})}),s.jsx(at,{path:"/requests",element:s.jsx(ese,{data:e})}),s.jsx(at,{path:"/traces",element:s.jsx(use,{})}),s.jsx(at,{path:"/hub",element:s.jsx(Sse,{})}),s.jsx(at,{path:"/tasks",element:s.jsx(_se,{})}),s.jsx(at,{path:"/chat",element:s.jsx(ZN,{})}),s.jsx(at,{path:"/evals",element:s.jsx(Wge,{data:e})}),s.jsx(at,{path:"/platforms",element:s.jsx(qge,{})}),s.jsx(at,{path:"/bedrock",element:s.jsx(Vge,{canWrite:!0,sessionExpired:c=>console.error(c)})}),s.jsx(at,{path:"/contacts",element:s.jsx(Yge,{})}),s.jsx(at,{path:"/gateway",element:s.jsx(Gge,{})}),s.jsx(at,{path:"/env",element:s.jsx(sye,{})}),s.jsx(at,{path:"/memory",element:s.jsx(tye,{data:e})}),s.jsx(at,{path:"/history",element:s.jsx(rye,{data:e})}),s.jsx(at,{path:"/executions",element:s.jsx(iye,{onFetch:c=>ee.fetchExecutionAudit(c)})}),s.jsx(at,{path:"/system",element:s.jsx(Rie,{data:e})}),s.jsx(at,{path:"/admin",element:s.jsx(mse,{})}),s.jsx(at,{path:"*",element:s.jsx(d1,{to:"/",replace:!0})})]})})}fT(document.getElementById("root")).render(s.jsx(E.StrictMode,{children:s.jsx(PL,{children:s.jsx(lye,{})})}));
207
- //# sourceMappingURL=index-kCUkORm7.js.map