agent-nuvira 3.3.3 โ†’ 3.3.5

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 (366) hide show
  1. package/README.md +13 -5
  2. package/dist/agent-sdk/src/agent.d.ts +2 -0
  3. package/dist/agent-sdk/src/agent.d.ts.map +1 -1
  4. package/dist/agent-sdk/src/define.d.ts +64 -0
  5. package/dist/agent-sdk/src/define.d.ts.map +1 -0
  6. package/dist/agent-sdk/src/define.js +76 -0
  7. package/dist/agent-sdk/src/define.js.map +1 -0
  8. package/dist/agent-sdk/src/index.d.ts +9 -0
  9. package/dist/agent-sdk/src/index.d.ts.map +1 -1
  10. package/dist/agent-sdk/src/index.js +9 -0
  11. package/dist/agent-sdk/src/index.js.map +1 -1
  12. package/dist/agent-sdk/src/scaffold.d.ts +11 -0
  13. package/dist/agent-sdk/src/scaffold.d.ts.map +1 -1
  14. package/dist/agent-sdk/src/scaffold.js +16 -6
  15. package/dist/agent-sdk/src/scaffold.js.map +1 -1
  16. package/dist/agents/long-form-plan.d.ts.map +1 -1
  17. package/dist/agents/long-form-plan.js +2 -1
  18. package/dist/agents/long-form-plan.js.map +1 -1
  19. package/dist/agents/orchestrator.d.ts.map +1 -1
  20. package/dist/agents/orchestrator.js +5 -4
  21. package/dist/agents/orchestrator.js.map +1 -1
  22. package/dist/cli/agent.d.ts +2 -2
  23. package/dist/cli/agent.js +10 -10
  24. package/dist/cli/chat.d.ts +94 -0
  25. package/dist/cli/chat.d.ts.map +1 -1
  26. package/dist/cli/chat.js +354 -20
  27. package/dist/cli/chat.js.map +1 -1
  28. package/dist/cli/cli-program.d.ts.map +1 -1
  29. package/dist/cli/cli-program.js +5 -0
  30. package/dist/cli/cli-program.js.map +1 -1
  31. package/dist/cli/config.d.ts.map +1 -1
  32. package/dist/cli/config.js +9 -1
  33. package/dist/cli/config.js.map +1 -1
  34. package/dist/cli/doctor.d.ts.map +1 -1
  35. package/dist/cli/doctor.js +3 -2
  36. package/dist/cli/doctor.js.map +1 -1
  37. package/dist/cli/edit.js +2 -2
  38. package/dist/cli/eval.d.ts +17 -0
  39. package/dist/cli/eval.d.ts.map +1 -1
  40. package/dist/cli/eval.js +105 -2
  41. package/dist/cli/eval.js.map +1 -1
  42. package/dist/cli/execute.d.ts +16 -1
  43. package/dist/cli/execute.d.ts.map +1 -1
  44. package/dist/cli/execute.js +192 -22
  45. package/dist/cli/execute.js.map +1 -1
  46. package/dist/cli/loop-executor.d.ts +55 -0
  47. package/dist/cli/loop-executor.d.ts.map +1 -1
  48. package/dist/cli/loop-executor.js +212 -13
  49. package/dist/cli/loop-executor.js.map +1 -1
  50. package/dist/cli/model.d.ts.map +1 -1
  51. package/dist/cli/model.js +9 -8
  52. package/dist/cli/model.js.map +1 -1
  53. package/dist/cli/models.d.ts +1 -1
  54. package/dist/cli/models.js +4 -4
  55. package/dist/cli/parity.d.ts +85 -0
  56. package/dist/cli/parity.d.ts.map +1 -0
  57. package/dist/cli/parity.js +506 -0
  58. package/dist/cli/parity.js.map +1 -0
  59. package/dist/cli/plan.d.ts.map +1 -1
  60. package/dist/cli/plan.js +2 -1
  61. package/dist/cli/plan.js.map +1 -1
  62. package/dist/cli/retrieval.d.ts.map +1 -1
  63. package/dist/cli/retrieval.js +5 -4
  64. package/dist/cli/retrieval.js.map +1 -1
  65. package/dist/cli/sdk.js +4 -4
  66. package/dist/cli/sdk.js.map +1 -1
  67. package/dist/cli/trace.d.ts.map +1 -1
  68. package/dist/cli/trace.js +2 -1
  69. package/dist/cli/trace.js.map +1 -1
  70. package/dist/cli/workflow.js +2 -2
  71. package/dist/cli/workflow.js.map +1 -1
  72. package/dist/config/process-env.d.ts +136 -0
  73. package/dist/config/process-env.d.ts.map +1 -0
  74. package/dist/config/process-env.js +217 -0
  75. package/dist/config/process-env.js.map +1 -0
  76. package/dist/config/types.d.ts +44 -0
  77. package/dist/config/types.d.ts.map +1 -1
  78. package/dist/findings/verdicts.d.ts +241 -0
  79. package/dist/findings/verdicts.d.ts.map +1 -0
  80. package/dist/findings/verdicts.js +284 -0
  81. package/dist/findings/verdicts.js.map +1 -0
  82. package/dist/gateway/adapters.d.ts +65 -0
  83. package/dist/gateway/adapters.d.ts.map +1 -1
  84. package/dist/gateway/adapters.js +216 -10
  85. package/dist/gateway/adapters.js.map +1 -1
  86. package/dist/gateway/channel-directory.d.ts +31 -0
  87. package/dist/gateway/channel-directory.d.ts.map +1 -1
  88. package/dist/gateway/channel-directory.js +40 -0
  89. package/dist/gateway/channel-directory.js.map +1 -1
  90. package/dist/gateway/gateway-log.d.ts +1 -1
  91. package/dist/gateway/gateway-log.d.ts.map +1 -1
  92. package/dist/gateway/gateway-log.js.map +1 -1
  93. package/dist/gateway/hooks.d.ts +87 -19
  94. package/dist/gateway/hooks.d.ts.map +1 -1
  95. package/dist/gateway/hooks.js +62 -23
  96. package/dist/gateway/hooks.js.map +1 -1
  97. package/dist/gateway/inbound-media.d.ts +147 -0
  98. package/dist/gateway/inbound-media.d.ts.map +1 -0
  99. package/dist/gateway/inbound-media.js +317 -0
  100. package/dist/gateway/inbound-media.js.map +1 -0
  101. package/dist/gateway/inbox.d.ts +8 -1
  102. package/dist/gateway/inbox.d.ts.map +1 -1
  103. package/dist/gateway/inbox.js.map +1 -1
  104. package/dist/gateway/platform-config.d.ts +14 -0
  105. package/dist/gateway/platform-config.d.ts.map +1 -1
  106. package/dist/gateway/platform-config.js +26 -8
  107. package/dist/gateway/platform-config.js.map +1 -1
  108. package/dist/gateway/realtime.d.ts +114 -0
  109. package/dist/gateway/realtime.d.ts.map +1 -0
  110. package/dist/gateway/realtime.js +402 -0
  111. package/dist/gateway/realtime.js.map +1 -0
  112. package/dist/gateway/registry.d.ts +31 -0
  113. package/dist/gateway/registry.d.ts.map +1 -1
  114. package/dist/gateway/registry.js +224 -4
  115. package/dist/gateway/registry.js.map +1 -1
  116. package/dist/gateway/whatsapp/baileys-bridge.d.ts +11 -1
  117. package/dist/gateway/whatsapp/baileys-bridge.d.ts.map +1 -1
  118. package/dist/gateway/whatsapp/baileys-bridge.js +123 -4
  119. package/dist/gateway/whatsapp/baileys-bridge.js.map +1 -1
  120. package/dist/gateway/whatsapp/bridge.d.ts +6 -2
  121. package/dist/gateway/whatsapp/bridge.d.ts.map +1 -1
  122. package/dist/gateway/whatsapp/bridge.js.map +1 -1
  123. package/dist/index.js +8 -0
  124. package/dist/index.js.map +1 -1
  125. package/dist/inference/factory.d.ts +14 -0
  126. package/dist/inference/factory.d.ts.map +1 -1
  127. package/dist/inference/factory.js +17 -0
  128. package/dist/inference/factory.js.map +1 -1
  129. package/dist/inference/groq-adapter.d.ts +2 -0
  130. package/dist/inference/groq-adapter.d.ts.map +1 -1
  131. package/dist/inference/groq-adapter.js +16 -6
  132. package/dist/inference/groq-adapter.js.map +1 -1
  133. package/dist/inference/tools.d.ts.map +1 -1
  134. package/dist/inference/tools.js +29 -0
  135. package/dist/inference/tools.js.map +1 -1
  136. package/dist/learning/benchmark.d.ts.map +1 -1
  137. package/dist/learning/benchmark.js +3 -2
  138. package/dist/learning/benchmark.js.map +1 -1
  139. package/dist/learning/continuation.d.ts.map +1 -1
  140. package/dist/learning/continuation.js +2 -1
  141. package/dist/learning/continuation.js.map +1 -1
  142. package/dist/learning/cost-tracker.d.ts.map +1 -1
  143. package/dist/learning/cost-tracker.js +2 -1
  144. package/dist/learning/cost-tracker.js.map +1 -1
  145. package/dist/learning/deferred-task.d.ts.map +1 -1
  146. package/dist/learning/deferred-task.js +13 -4
  147. package/dist/learning/deferred-task.js.map +1 -1
  148. package/dist/learning/eval-framework.d.ts.map +1 -1
  149. package/dist/learning/eval-framework.js +2 -1
  150. package/dist/learning/eval-framework.js.map +1 -1
  151. package/dist/learning/long-form.d.ts.map +1 -1
  152. package/dist/learning/long-form.js +2 -1
  153. package/dist/learning/long-form.js.map +1 -1
  154. package/dist/learning/model-reachability.d.ts +95 -0
  155. package/dist/learning/model-reachability.d.ts.map +1 -0
  156. package/dist/learning/model-reachability.js +111 -0
  157. package/dist/learning/model-reachability.js.map +1 -0
  158. package/dist/learning/model-registry.d.ts +22 -0
  159. package/dist/learning/model-registry.d.ts.map +1 -1
  160. package/dist/learning/model-registry.js +26 -1
  161. package/dist/learning/model-registry.js.map +1 -1
  162. package/dist/learning/model-verify-job.d.ts +131 -0
  163. package/dist/learning/model-verify-job.d.ts.map +1 -0
  164. package/dist/learning/model-verify-job.js +221 -0
  165. package/dist/learning/model-verify-job.js.map +1 -0
  166. package/dist/learning/reasoning-cache.d.ts.map +1 -1
  167. package/dist/learning/reasoning-cache.js +2 -1
  168. package/dist/learning/reasoning-cache.js.map +1 -1
  169. package/dist/learning/reasoning-trace.d.ts +37 -1
  170. package/dist/learning/reasoning-trace.d.ts.map +1 -1
  171. package/dist/learning/reasoning-trace.js +66 -0
  172. package/dist/learning/reasoning-trace.js.map +1 -1
  173. package/dist/learning/resilient-call.d.ts.map +1 -1
  174. package/dist/learning/resilient-call.js +2 -1
  175. package/dist/learning/resilient-call.js.map +1 -1
  176. package/dist/learning/retrieval.d.ts.map +1 -1
  177. package/dist/learning/retrieval.js +2 -1
  178. package/dist/learning/retrieval.js.map +1 -1
  179. package/dist/learning/seeded-benchmark.d.ts +160 -0
  180. package/dist/learning/seeded-benchmark.d.ts.map +1 -0
  181. package/dist/learning/seeded-benchmark.js +321 -0
  182. package/dist/learning/seeded-benchmark.js.map +1 -0
  183. package/dist/learning/seeded-bugs.d.ts +142 -0
  184. package/dist/learning/seeded-bugs.d.ts.map +1 -0
  185. package/dist/learning/seeded-bugs.js +535 -0
  186. package/dist/learning/seeded-bugs.js.map +1 -0
  187. package/dist/learning/step-checkpoint.d.ts +127 -0
  188. package/dist/learning/step-checkpoint.d.ts.map +1 -0
  189. package/dist/learning/step-checkpoint.js +244 -0
  190. package/dist/learning/step-checkpoint.js.map +1 -0
  191. package/dist/nlu/intent-confirm.d.ts +23 -1
  192. package/dist/nlu/intent-confirm.d.ts.map +1 -1
  193. package/dist/nlu/intent-confirm.js +85 -2
  194. package/dist/nlu/intent-confirm.js.map +1 -1
  195. package/dist/nlu/learnings.d.ts +7 -0
  196. package/dist/nlu/learnings.d.ts.map +1 -1
  197. package/dist/nlu/learnings.js +7 -0
  198. package/dist/nlu/learnings.js.map +1 -1
  199. package/dist/observability/debug-log.d.ts +250 -0
  200. package/dist/observability/debug-log.d.ts.map +1 -0
  201. package/dist/observability/debug-log.js +500 -0
  202. package/dist/observability/debug-log.js.map +1 -0
  203. package/dist/observability/event-bus.d.ts.map +1 -1
  204. package/dist/observability/event-bus.js +4 -1
  205. package/dist/observability/event-bus.js.map +1 -1
  206. package/dist/observability/otel.d.ts +278 -0
  207. package/dist/observability/otel.d.ts.map +1 -0
  208. package/dist/observability/otel.js +590 -0
  209. package/dist/observability/otel.js.map +1 -0
  210. package/dist/parity/drivers.d.ts +99 -0
  211. package/dist/parity/drivers.d.ts.map +1 -0
  212. package/dist/parity/drivers.js +1362 -0
  213. package/dist/parity/drivers.js.map +1 -0
  214. package/dist/parity/graph.d.ts +73 -0
  215. package/dist/parity/graph.d.ts.map +1 -0
  216. package/dist/parity/graph.js +162 -0
  217. package/dist/parity/graph.js.map +1 -0
  218. package/dist/parity/matrix.d.ts +105 -0
  219. package/dist/parity/matrix.d.ts.map +1 -0
  220. package/dist/parity/matrix.js +352 -0
  221. package/dist/parity/matrix.js.map +1 -0
  222. package/dist/parity/observation.d.ts +444 -0
  223. package/dist/parity/observation.d.ts.map +1 -0
  224. package/dist/parity/observation.js +333 -0
  225. package/dist/parity/observation.js.map +1 -0
  226. package/dist/parity/scenarios.d.ts +229 -0
  227. package/dist/parity/scenarios.d.ts.map +1 -0
  228. package/dist/parity/scenarios.js +175 -0
  229. package/dist/parity/scenarios.js.map +1 -0
  230. package/dist/parity/surfaces.d.ts +122 -0
  231. package/dist/parity/surfaces.d.ts.map +1 -0
  232. package/dist/parity/surfaces.js +190 -0
  233. package/dist/parity/surfaces.js.map +1 -0
  234. package/dist/runtime/fault-injection.d.ts +173 -0
  235. package/dist/runtime/fault-injection.d.ts.map +1 -0
  236. package/dist/runtime/fault-injection.js +281 -0
  237. package/dist/runtime/fault-injection.js.map +1 -0
  238. package/dist/tools/child-agent-entry.d.ts +23 -0
  239. package/dist/tools/child-agent-entry.d.ts.map +1 -0
  240. package/dist/tools/child-agent-entry.js +129 -0
  241. package/dist/tools/child-agent-entry.js.map +1 -0
  242. package/dist/tools/child-agent-runtime.d.ts +124 -0
  243. package/dist/tools/child-agent-runtime.d.ts.map +1 -0
  244. package/dist/tools/child-agent-runtime.js +704 -0
  245. package/dist/tools/child-agent-runtime.js.map +1 -0
  246. package/dist/tools/coding-tools.d.ts.map +1 -1
  247. package/dist/tools/coding-tools.js +82 -10
  248. package/dist/tools/coding-tools.js.map +1 -1
  249. package/dist/tools/delegation-system.d.ts +31 -0
  250. package/dist/tools/delegation-system.d.ts.map +1 -1
  251. package/dist/tools/delegation-system.js +70 -9
  252. package/dist/tools/delegation-system.js.map +1 -1
  253. package/dist/tools/extract/docx.d.ts +27 -0
  254. package/dist/tools/extract/docx.d.ts.map +1 -0
  255. package/dist/tools/extract/docx.js +48 -0
  256. package/dist/tools/extract/docx.js.map +1 -0
  257. package/dist/tools/extract/html-text.d.ts +27 -0
  258. package/dist/tools/extract/html-text.d.ts.map +1 -0
  259. package/dist/tools/extract/html-text.js +86 -0
  260. package/dist/tools/extract/html-text.js.map +1 -0
  261. package/dist/tools/extract/pdf-ocr.d.ts +58 -0
  262. package/dist/tools/extract/pdf-ocr.d.ts.map +1 -0
  263. package/dist/tools/extract/pdf-ocr.js +116 -0
  264. package/dist/tools/extract/pdf-ocr.js.map +1 -0
  265. package/dist/tools/extract/pdf.d.ts +65 -0
  266. package/dist/tools/extract/pdf.d.ts.map +1 -0
  267. package/dist/tools/extract/pdf.js +197 -0
  268. package/dist/tools/extract/pdf.js.map +1 -0
  269. package/dist/tools/extract/pptx.d.ts +32 -0
  270. package/dist/tools/extract/pptx.d.ts.map +1 -0
  271. package/dist/tools/extract/pptx.js +77 -0
  272. package/dist/tools/extract/pptx.js.map +1 -0
  273. package/dist/tools/extract/xlsx.d.ts +47 -0
  274. package/dist/tools/extract/xlsx.d.ts.map +1 -0
  275. package/dist/tools/extract/xlsx.js +111 -0
  276. package/dist/tools/extract/xlsx.js.map +1 -0
  277. package/dist/tools/finding-tool.d.ts +76 -0
  278. package/dist/tools/finding-tool.d.ts.map +1 -0
  279. package/dist/tools/finding-tool.js +125 -0
  280. package/dist/tools/finding-tool.js.map +1 -0
  281. package/dist/tools/messaging-tools.d.ts +41 -11
  282. package/dist/tools/messaging-tools.d.ts.map +1 -1
  283. package/dist/tools/messaging-tools.js +104 -55
  284. package/dist/tools/messaging-tools.js.map +1 -1
  285. package/dist/tools/neutts-synth.d.ts +27 -3
  286. package/dist/tools/neutts-synth.d.ts.map +1 -1
  287. package/dist/tools/neutts-synth.js +57 -13
  288. package/dist/tools/neutts-synth.js.map +1 -1
  289. package/dist/tools/pipeline-tool.d.ts +43 -1
  290. package/dist/tools/pipeline-tool.d.ts.map +1 -1
  291. package/dist/tools/pipeline-tool.js +13 -2
  292. package/dist/tools/pipeline-tool.js.map +1 -1
  293. package/dist/tools/read-extract.d.ts +116 -45
  294. package/dist/tools/read-extract.d.ts.map +1 -1
  295. package/dist/tools/read-extract.js +494 -158
  296. package/dist/tools/read-extract.js.map +1 -1
  297. package/dist/tools/registry.d.ts +2 -2
  298. package/dist/tools/registry.d.ts.map +1 -1
  299. package/dist/tools/registry.js +152 -23
  300. package/dist/tools/registry.js.map +1 -1
  301. package/dist/tools/subagent-refusal.d.ts +15 -0
  302. package/dist/tools/subagent-refusal.d.ts.map +1 -0
  303. package/dist/tools/subagent-refusal.js +18 -0
  304. package/dist/tools/subagent-refusal.js.map +1 -0
  305. package/dist/tools/subagent-spawner.d.ts +122 -0
  306. package/dist/tools/subagent-spawner.d.ts.map +1 -1
  307. package/dist/tools/subagent-spawner.js +249 -28
  308. package/dist/tools/subagent-spawner.js.map +1 -1
  309. package/dist/tools/tool-hooks.d.ts +177 -0
  310. package/dist/tools/tool-hooks.d.ts.map +1 -0
  311. package/dist/tools/tool-hooks.js +427 -0
  312. package/dist/tools/tool-hooks.js.map +1 -0
  313. package/dist/tools/tool-loop.d.ts +82 -0
  314. package/dist/tools/tool-loop.d.ts.map +1 -1
  315. package/dist/tools/tool-loop.js +167 -9
  316. package/dist/tools/tool-loop.js.map +1 -1
  317. package/dist/tools/tool-refusal.d.ts +68 -0
  318. package/dist/tools/tool-refusal.d.ts.map +1 -0
  319. package/dist/tools/tool-refusal.js +78 -0
  320. package/dist/tools/tool-refusal.js.map +1 -0
  321. package/dist/tools/toolsets.d.ts +8 -0
  322. package/dist/tools/toolsets.d.ts.map +1 -1
  323. package/dist/tools/toolsets.js +12 -2
  324. package/dist/tools/toolsets.js.map +1 -1
  325. package/dist/tools/vision-tools.d.ts +88 -83
  326. package/dist/tools/vision-tools.d.ts.map +1 -1
  327. package/dist/tools/vision-tools.js +134 -103
  328. package/dist/tools/vision-tools.js.map +1 -1
  329. package/dist/tools/worktree.d.ts +210 -0
  330. package/dist/tools/worktree.d.ts.map +1 -0
  331. package/dist/tools/worktree.js +374 -0
  332. package/dist/tools/worktree.js.map +1 -0
  333. package/dist/utils/format.d.ts +3 -0
  334. package/dist/utils/format.d.ts.map +1 -0
  335. package/dist/utils/format.js +32 -0
  336. package/dist/utils/format.js.map +1 -0
  337. package/dist/web-dashboard/attachment-extract.d.ts +64 -0
  338. package/dist/web-dashboard/attachment-extract.d.ts.map +1 -0
  339. package/dist/web-dashboard/attachment-extract.js +154 -0
  340. package/dist/web-dashboard/attachment-extract.js.map +1 -0
  341. package/dist/web-dashboard/chat-console.d.ts +108 -1
  342. package/dist/web-dashboard/chat-console.d.ts.map +1 -1
  343. package/dist/web-dashboard/chat-console.js +36 -0
  344. package/dist/web-dashboard/chat-console.js.map +1 -1
  345. package/dist/web-dashboard/hub-data.d.ts +37 -0
  346. package/dist/web-dashboard/hub-data.d.ts.map +1 -1
  347. package/dist/web-dashboard/hub-data.js +61 -1
  348. package/dist/web-dashboard/hub-data.js.map +1 -1
  349. package/dist/web-dashboard/process-env-inventory.d.ts +57 -0
  350. package/dist/web-dashboard/process-env-inventory.d.ts.map +1 -0
  351. package/dist/web-dashboard/process-env-inventory.js +96 -0
  352. package/dist/web-dashboard/process-env-inventory.js.map +1 -0
  353. package/dist/web-dashboard/server.d.ts +14 -0
  354. package/dist/web-dashboard/server.d.ts.map +1 -1
  355. package/dist/web-dashboard/server.js +493 -30
  356. package/dist/web-dashboard/server.js.map +1 -1
  357. package/dist/web-dashboard/src/types.d.ts +261 -48
  358. package/dist/web-dashboard/src/types.d.ts.map +1 -1
  359. package/package.json +18 -3
  360. package/src/web-dashboard/public/assets/{index-Cyd6tIew.css โ†’ index-CIJ6FHHZ.css} +1 -1
  361. package/src/web-dashboard/public/assets/index-CsySzR41.js +207 -0
  362. package/src/web-dashboard/public/assets/index-CsySzR41.js.map +1 -0
  363. package/src/web-dashboard/public/index.html +2 -2
  364. package/dist/tools/child-agent-worker.js +0 -212
  365. package/src/web-dashboard/public/assets/index-CxDj7p6i.js +0 -207
  366. package/src/web-dashboard/public/assets/index-CxDj7p6i.js.map +0 -1
@@ -0,0 +1,207 @@
1
+ var S2=Object.defineProperty;var k2=(e,t,n)=>t in e?S2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Hr=(e,t,n)=>k2(e,typeof t!="symbol"?t+"":t,n);function N2(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 Yi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ze(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yj={exports:{}},zh={},vj={exports:{}},ze={};/**
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 Eu=Symbol.for("react.element"),E2=Symbol.for("react.portal"),_2=Symbol.for("react.fragment"),j2=Symbol.for("react.strict_mode"),A2=Symbol.for("react.profiler"),C2=Symbol.for("react.provider"),T2=Symbol.for("react.context"),O2=Symbol.for("react.forward_ref"),P2=Symbol.for("react.suspense"),R2=Symbol.for("react.memo"),M2=Symbol.for("react.lazy"),lw=Symbol.iterator;function I2(e){return e===null||typeof e!="object"?null:(e=lw&&e[lw]||e["@@iterator"],typeof e=="function"?e:null)}var bj={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},xj=Object.assign,wj={};function Qo(e,t,n){this.props=e,this.context=t,this.refs=wj,this.updater=n||bj}Qo.prototype.isReactComponent={};Qo.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")};Qo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Sj(){}Sj.prototype=Qo.prototype;function kb(e,t,n){this.props=e,this.context=t,this.refs=wj,this.updater=n||bj}var Nb=kb.prototype=new Sj;Nb.constructor=kb;xj(Nb,Qo.prototype);Nb.isPureReactComponent=!0;var cw=Array.isArray,kj=Object.prototype.hasOwnProperty,Eb={current:null},Nj={key:!0,ref:!0,__self:!0,__source:!0};function Ej(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)kj.call(t,r)&&!Nj.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:Eu,type:e,key:a,ref:o,props:i,_owner:Eb.current}}function $2(e,t){return{$$typeof:Eu,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function _b(e){return typeof e=="object"&&e!==null&&e.$$typeof===Eu}function L2(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var uw=/\/+/g;function cm(e,t){return typeof e=="object"&&e!==null&&e.key!=null?L2(""+e.key):t.toString(36)}function Wd(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 Eu:case E2:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+cm(o,0):r,cw(i)?(n="",e!=null&&(n=e.replace(uw,"$&/")+"/"),Wd(i,t,n,"",function(u){return u})):i!=null&&(_b(i)&&(i=$2(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(uw,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=r===""?".":r+":",cw(e))for(var l=0;l<e.length;l++){a=e[l];var c=r+cm(a,l);o+=Wd(a,t,n,c,i)}else if(c=I2(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=r+cm(a,l++),o+=Wd(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 Qu(e,t,n){if(e==null)return e;var r=[],i=0;return Wd(e,r,"","",function(a){return t.call(n,a,i++)}),r}function D2(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 Cn={current:null},Hd={transition:null},B2={ReactCurrentDispatcher:Cn,ReactCurrentBatchConfig:Hd,ReactCurrentOwner:Eb};function _j(){throw Error("act(...) is not supported in production builds of React.")}ze.Children={map:Qu,forEach:function(e,t,n){Qu(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Qu(e,function(){t++}),t},toArray:function(e){return Qu(e,function(t){return t})||[]},only:function(e){if(!_b(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ze.Component=Qo;ze.Fragment=_2;ze.Profiler=A2;ze.PureComponent=kb;ze.StrictMode=j2;ze.Suspense=P2;ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=B2;ze.act=_j;ze.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=xj({},e.props),i=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=Eb.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)kj.call(t,c)&&!Nj.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:Eu,type:e.type,key:i,ref:a,props:r,_owner:o}};ze.createContext=function(e){return e={$$typeof:T2,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:C2,_context:e},e.Consumer=e};ze.createElement=Ej;ze.createFactory=function(e){var t=Ej.bind(null,e);return t.type=e,t};ze.createRef=function(){return{current:null}};ze.forwardRef=function(e){return{$$typeof:O2,render:e}};ze.isValidElement=_b;ze.lazy=function(e){return{$$typeof:M2,_payload:{_status:-1,_result:e},_init:D2}};ze.memo=function(e,t){return{$$typeof:R2,type:e,compare:t===void 0?null:t}};ze.startTransition=function(e){var t=Hd.transition;Hd.transition={};try{e()}finally{Hd.transition=t}};ze.unstable_act=_j;ze.useCallback=function(e,t){return Cn.current.useCallback(e,t)};ze.useContext=function(e){return Cn.current.useContext(e)};ze.useDebugValue=function(){};ze.useDeferredValue=function(e){return Cn.current.useDeferredValue(e)};ze.useEffect=function(e,t){return Cn.current.useEffect(e,t)};ze.useId=function(){return Cn.current.useId()};ze.useImperativeHandle=function(e,t,n){return Cn.current.useImperativeHandle(e,t,n)};ze.useInsertionEffect=function(e,t){return Cn.current.useInsertionEffect(e,t)};ze.useLayoutEffect=function(e,t){return Cn.current.useLayoutEffect(e,t)};ze.useMemo=function(e,t){return Cn.current.useMemo(e,t)};ze.useReducer=function(e,t,n){return Cn.current.useReducer(e,t,n)};ze.useRef=function(e){return Cn.current.useRef(e)};ze.useState=function(e){return Cn.current.useState(e)};ze.useSyncExternalStore=function(e,t,n){return Cn.current.useSyncExternalStore(e,t,n)};ze.useTransition=function(){return Cn.current.useTransition()};ze.version="18.3.1";vj.exports=ze;var N=vj.exports;const H=Ze(N),z2=N2({__proto__:null,default:H},[N]);/**
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 F2=N,U2=Symbol.for("react.element"),W2=Symbol.for("react.fragment"),H2=Object.prototype.hasOwnProperty,G2=F2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,q2={key:!0,ref:!0,__self:!0,__source:!0};function jj(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)H2.call(t,r)&&!q2.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:U2,type:e,key:a,ref:o,props:i,_owner:G2.current}}zh.Fragment=W2;zh.jsx=jj;zh.jsxs=jj;yj.exports=zh;var s=yj.exports,Aj={exports:{}},ir={},Cj={exports:{}},Tj={};/**
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,U){var A=O.length;O.push(U);e:for(;0<A;){var Z=A-1>>>1,$=O[Z];if(0<i($,U))O[Z]=U,O[A]=$,A=Z;else break e}}function n(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var U=O[0],A=O.pop();if(A!==U){O[0]=A;e:for(var Z=0,$=O.length,P=$>>>1;Z<P;){var oe=2*(Z+1)-1,be=O[oe],pe=oe+1,Ce=O[pe];if(0>i(be,A))pe<$&&0>i(Ce,be)?(O[Z]=Ce,O[pe]=A,Z=pe):(O[Z]=be,O[oe]=A,Z=oe);else if(pe<$&&0>i(Ce,A))O[Z]=Ce,O[pe]=A,Z=pe;else break e}}return U}function i(O,U){var A=O.sortIndex-U.sortIndex;return A!==0?A:O.id-U.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 w(O){for(var U=n(u);U!==null;){if(U.callback===null)r(u);else if(U.startTime<=O)r(u),U.sortIndex=U.expirationTime,t(c,U);else break;U=n(u)}}function k(O){if(m=!1,w(O),!g)if(n(c)!==null)g=!0,z(S);else{var U=n(u);U!==null&&R(k,U.startTime-O)}}function S(O,U){g=!1,m&&(m=!1,y(_),_=-1),p=!0;var A=h;try{for(w(U),f=n(c);f!==null&&(!(f.expirationTime>U)||O&&!L());){var Z=f.callback;if(typeof Z=="function"){f.callback=null,h=f.priorityLevel;var $=Z(f.expirationTime<=U);U=e.unstable_now(),typeof $=="function"?f.callback=$:f===n(c)&&r(c),w(U)}else r(c);f=n(c)}if(f!==null)var P=!0;else{var oe=n(u);oe!==null&&R(k,oe.startTime-U),P=!1}return P}finally{f=null,h=A,p=!1}}var x=!1,E=null,_=-1,C=5,T=-1;function L(){return!(e.unstable_now()-T<C)}function M(){if(E!==null){var O=e.unstable_now();T=O;var U=!0;try{U=E(!0,O)}finally{U?B():(x=!1,E=null)}}else x=!1}var B;if(typeof b=="function")B=function(){b(M)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,F=I.port2;I.port1.onmessage=M,B=function(){F.postMessage(null)}}else B=function(){v(M,0)};function z(O){E=O,x||(x=!0,B())}function R(O,U){_=v(function(){O(e.unstable_now())},U)}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,z(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 U=3;break;default:U=h}var A=h;h=U;try{return O()}finally{h=A}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(O,U){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var A=h;h=O;try{return U()}finally{h=A}},e.unstable_scheduleCallback=function(O,U,A){var Z=e.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0<A?Z+A:Z):A=Z,O){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=A+$,O={id:d++,callback:U,priorityLevel:O,startTime:A,expirationTime:$,sortIndex:-1},A>Z?(O.sortIndex=A,t(u,O),n(c)===null&&O===n(u)&&(m?(y(_),_=-1):m=!0,R(k,A-Z))):(O.sortIndex=$,t(c,O),g||p||(g=!0,z(S))),O},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(O){var U=h;return function(){var A=h;h=U;try{return O.apply(this,arguments)}finally{h=A}}}})(Tj);Cj.exports=Tj;var K2=Cj.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 V2=N,nr=K2;function se(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 Oj=new Set,xc={};function ys(e,t){wo(e,t),wo(e+"Capture",t)}function wo(e,t){for(xc[e]=t,e=0;e<t.length;e++)Oj.add(t[e])}var Ni=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wg=Object.prototype.hasOwnProperty,Y2=/^[: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]*$/,dw={},fw={};function X2(e){return Wg.call(fw,e)?!0:Wg.call(dw,e)?!1:Y2.test(e)?fw[e]=!0:(dw[e]=!0,!1)}function Z2(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 Q2(e,t,n,r){if(t===null||typeof t>"u"||Z2(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 Tn(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 on={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){on[e]=new Tn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];on[t]=new Tn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){on[e]=new Tn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){on[e]=new Tn(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){on[e]=new Tn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){on[e]=new Tn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){on[e]=new Tn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){on[e]=new Tn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){on[e]=new Tn(e,5,!1,e.toLowerCase(),null,!1,!1)});var jb=/[\-:]([a-z])/g;function Ab(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(jb,Ab);on[t]=new Tn(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(jb,Ab);on[t]=new Tn(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(jb,Ab);on[t]=new Tn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){on[e]=new Tn(e,1,!1,e.toLowerCase(),null,!1,!1)});on.xlinkHref=new Tn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){on[e]=new Tn(e,1,!1,e.toLowerCase(),null,!0,!0)});function Cb(e,t,n,r){var i=on.hasOwnProperty(t)?on[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Q2(t,n,i,r)&&(n=null),r||i===null?X2(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 Oi=V2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ju=Symbol.for("react.element"),Ks=Symbol.for("react.portal"),Vs=Symbol.for("react.fragment"),Tb=Symbol.for("react.strict_mode"),Hg=Symbol.for("react.profiler"),Pj=Symbol.for("react.provider"),Rj=Symbol.for("react.context"),Ob=Symbol.for("react.forward_ref"),Gg=Symbol.for("react.suspense"),qg=Symbol.for("react.suspense_list"),Pb=Symbol.for("react.memo"),Ui=Symbol.for("react.lazy"),Mj=Symbol.for("react.offscreen"),hw=Symbol.iterator;function Cl(e){return e===null||typeof e!="object"?null:(e=hw&&e[hw]||e["@@iterator"],typeof e=="function"?e:null)}var kt=Object.assign,um;function Zl(e){if(um===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);um=t&&t[1]||""}return`
34
+ `+um+e}var dm=!1;function fm(e,t){if(!e||dm)return"";dm=!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{dm=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Zl(e):""}function J2(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=fm(e.type,!1),e;case 11:return e=fm(e.type.render,!1),e;case 1:return e=fm(e.type,!0),e;default:return""}}function Kg(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 Vs:return"Fragment";case Ks:return"Portal";case Hg:return"Profiler";case Tb:return"StrictMode";case Gg:return"Suspense";case qg:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Rj:return(e.displayName||"Context")+".Consumer";case Pj:return(e._context.displayName||"Context")+".Provider";case Ob:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Pb:return t=e.displayName||null,t!==null?t:Kg(e.type)||"Memo";case Ui:t=e._payload,e=e._init;try{return Kg(e(t))}catch{}}return null}function eI(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 Kg(t);case 8:return t===Tb?"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 fa(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ij(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function tI(e){var t=Ij(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 ed(e){e._valueTracker||(e._valueTracker=tI(e))}function $j(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ij(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function af(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 Vg(e,t){var n=t.checked;return kt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function pw(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=fa(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 Lj(e,t){t=t.checked,t!=null&&Cb(e,"checked",t,!1)}function Yg(e,t){Lj(e,t);var n=fa(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")?Xg(e,t.type,n):t.hasOwnProperty("defaultValue")&&Xg(e,t.type,fa(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function mw(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 Xg(e,t,n){(t!=="number"||af(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ql=Array.isArray;function uo(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=""+fa(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 Zg(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(se(91));return kt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function gw(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(se(92));if(Ql(n)){if(1<n.length)throw Error(se(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:fa(n)}}function Dj(e,t){var n=fa(t.value),r=fa(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 yw(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Bj(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 Qg(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Bj(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var td,zj=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(td=td||document.createElement("div"),td.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=td.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function wc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var rc={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},nI=["Webkit","ms","Moz","O"];Object.keys(rc).forEach(function(e){nI.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),rc[t]=rc[e]})});function Fj(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||rc.hasOwnProperty(e)&&rc[e]?(""+t).trim():t+"px"}function Uj(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Fj(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var rI=kt({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 Jg(e,t){if(t){if(rI[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(se(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(se(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(se(61))}if(t.style!=null&&typeof t.style!="object")throw Error(se(62))}}function ey(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 ty=null;function Rb(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ny=null,fo=null,ho=null;function vw(e){if(e=Au(e)){if(typeof ny!="function")throw Error(se(280));var t=e.stateNode;t&&(t=Gh(t),ny(e.stateNode,e.type,t))}}function Wj(e){fo?ho?ho.push(e):ho=[e]:fo=e}function Hj(){if(fo){var e=fo,t=ho;if(ho=fo=null,vw(e),t)for(e=0;e<t.length;e++)vw(t[e])}}function Gj(e,t){return e(t)}function qj(){}var hm=!1;function Kj(e,t,n){if(hm)return e(t,n);hm=!0;try{return Gj(e,t,n)}finally{hm=!1,(fo!==null||ho!==null)&&(qj(),Hj())}}function Sc(e,t){var n=e.stateNode;if(n===null)return null;var r=Gh(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(se(231,t,typeof n));return n}var ry=!1;if(Ni)try{var Tl={};Object.defineProperty(Tl,"passive",{get:function(){ry=!0}}),window.addEventListener("test",Tl,Tl),window.removeEventListener("test",Tl,Tl)}catch{ry=!1}function iI(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 ic=!1,sf=null,of=!1,iy=null,aI={onError:function(e){ic=!0,sf=e}};function sI(e,t,n,r,i,a,o,l,c){ic=!1,sf=null,iI.apply(aI,arguments)}function oI(e,t,n,r,i,a,o,l,c){if(sI.apply(this,arguments),ic){if(ic){var u=sf;ic=!1,sf=null}else throw Error(se(198));of||(of=!0,iy=u)}}function vs(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 Vj(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 bw(e){if(vs(e)!==e)throw Error(se(188))}function lI(e){var t=e.alternate;if(!t){if(t=vs(e),t===null)throw Error(se(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 bw(i),e;if(a===r)return bw(i),t;a=a.sibling}throw Error(se(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(se(189))}}if(n.alternate!==r)throw Error(se(190))}if(n.tag!==3)throw Error(se(188));return n.stateNode.current===n?e:t}function Yj(e){return e=lI(e),e!==null?Xj(e):null}function Xj(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Xj(e);if(t!==null)return t;e=e.sibling}return null}var Zj=nr.unstable_scheduleCallback,xw=nr.unstable_cancelCallback,cI=nr.unstable_shouldYield,uI=nr.unstable_requestPaint,Ct=nr.unstable_now,dI=nr.unstable_getCurrentPriorityLevel,Mb=nr.unstable_ImmediatePriority,Qj=nr.unstable_UserBlockingPriority,lf=nr.unstable_NormalPriority,fI=nr.unstable_LowPriority,Jj=nr.unstable_IdlePriority,Fh=null,Jr=null;function hI(e){if(Jr&&typeof Jr.onCommitFiberRoot=="function")try{Jr.onCommitFiberRoot(Fh,e,void 0,(e.current.flags&128)===128)}catch{}}var Rr=Math.clz32?Math.clz32:gI,pI=Math.log,mI=Math.LN2;function gI(e){return e>>>=0,e===0?32:31-(pI(e)/mI|0)|0}var nd=64,rd=4194304;function Jl(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 cf(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=Jl(l):(a&=o,a!==0&&(r=Jl(a)))}else o=n&~i,o!==0?r=Jl(o):a!==0&&(r=Jl(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-Rr(t),i=1<<n,r|=e[n],t&=~i;return r}function yI(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 vI(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-Rr(a),l=1<<o,c=i[o];c===-1?(!(l&n)||l&r)&&(i[o]=yI(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function ay(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function eA(){var e=nd;return nd<<=1,!(nd&4194240)&&(nd=64),e}function pm(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function _u(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Rr(t),e[t]=n}function bI(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-Rr(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function Ib(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Rr(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Qe=0;function tA(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var nA,$b,rA,iA,aA,sy=!1,id=[],ta=null,na=null,ra=null,kc=new Map,Nc=new Map,Gi=[],xI="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 ww(e,t){switch(e){case"focusin":case"focusout":ta=null;break;case"dragenter":case"dragleave":na=null;break;case"mouseover":case"mouseout":ra=null;break;case"pointerover":case"pointerout":kc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Nc.delete(t.pointerId)}}function Ol(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=Au(t),t!==null&&$b(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function wI(e,t,n,r,i){switch(t){case"focusin":return ta=Ol(ta,e,t,n,r,i),!0;case"dragenter":return na=Ol(na,e,t,n,r,i),!0;case"mouseover":return ra=Ol(ra,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return kc.set(a,Ol(kc.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,Nc.set(a,Ol(Nc.get(a)||null,e,t,n,r,i)),!0}return!1}function sA(e){var t=Ha(e.target);if(t!==null){var n=vs(t);if(n!==null){if(t=n.tag,t===13){if(t=Vj(n),t!==null){e.blockedOn=t,aA(e.priority,function(){rA(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 Gd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=oy(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);ty=r,n.target.dispatchEvent(r),ty=null}else return t=Au(n),t!==null&&$b(t),e.blockedOn=n,!1;t.shift()}return!0}function Sw(e,t,n){Gd(e)&&n.delete(t)}function SI(){sy=!1,ta!==null&&Gd(ta)&&(ta=null),na!==null&&Gd(na)&&(na=null),ra!==null&&Gd(ra)&&(ra=null),kc.forEach(Sw),Nc.forEach(Sw)}function Pl(e,t){e.blockedOn===t&&(e.blockedOn=null,sy||(sy=!0,nr.unstable_scheduleCallback(nr.unstable_NormalPriority,SI)))}function Ec(e){function t(i){return Pl(i,e)}if(0<id.length){Pl(id[0],e);for(var n=1;n<id.length;n++){var r=id[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ta!==null&&Pl(ta,e),na!==null&&Pl(na,e),ra!==null&&Pl(ra,e),kc.forEach(t),Nc.forEach(t),n=0;n<Gi.length;n++)r=Gi[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Gi.length&&(n=Gi[0],n.blockedOn===null);)sA(n),n.blockedOn===null&&Gi.shift()}var po=Oi.ReactCurrentBatchConfig,uf=!0;function kI(e,t,n,r){var i=Qe,a=po.transition;po.transition=null;try{Qe=1,Lb(e,t,n,r)}finally{Qe=i,po.transition=a}}function NI(e,t,n,r){var i=Qe,a=po.transition;po.transition=null;try{Qe=4,Lb(e,t,n,r)}finally{Qe=i,po.transition=a}}function Lb(e,t,n,r){if(uf){var i=oy(e,t,n,r);if(i===null)Nm(e,t,r,df,n),ww(e,r);else if(wI(i,e,t,n,r))r.stopPropagation();else if(ww(e,r),t&4&&-1<xI.indexOf(e)){for(;i!==null;){var a=Au(i);if(a!==null&&nA(a),a=oy(e,t,n,r),a===null&&Nm(e,t,r,df,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Nm(e,t,r,null,n)}}var df=null;function oy(e,t,n,r){if(df=null,e=Rb(r),e=Ha(e),e!==null)if(t=vs(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Vj(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 df=e,null}function oA(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(dI()){case Mb:return 1;case Qj:return 4;case lf:case fI:return 16;case Jj:return 536870912;default:return 16}default:return 16}}var Xi=null,Db=null,qd=null;function lA(){if(qd)return qd;var e,t=Db,n=t.length,r,i="value"in Xi?Xi.value:Xi.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 qd=i.slice(e,1<r?1-r:void 0)}function Kd(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 ad(){return!0}function kw(){return!1}function ar(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)?ad:kw,this.isPropagationStopped=kw,this}return kt(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=ad)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ad)},persist:function(){},isPersistent:ad}),t}var Jo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bb=ar(Jo),ju=kt({},Jo,{view:0,detail:0}),EI=ar(ju),mm,gm,Rl,Uh=kt({},ju,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zb,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!==Rl&&(Rl&&e.type==="mousemove"?(mm=e.screenX-Rl.screenX,gm=e.screenY-Rl.screenY):gm=mm=0,Rl=e),mm)},movementY:function(e){return"movementY"in e?e.movementY:gm}}),Nw=ar(Uh),_I=kt({},Uh,{dataTransfer:0}),jI=ar(_I),AI=kt({},ju,{relatedTarget:0}),ym=ar(AI),CI=kt({},Jo,{animationName:0,elapsedTime:0,pseudoElement:0}),TI=ar(CI),OI=kt({},Jo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),PI=ar(OI),RI=kt({},Jo,{data:0}),Ew=ar(RI),MI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},II={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"},$I={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function LI(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$I[e])?!!t[e]:!1}function zb(){return LI}var DI=kt({},ju,{key:function(e){if(e.key){var t=MI[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Kd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?II[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zb,charCode:function(e){return e.type==="keypress"?Kd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Kd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),BI=ar(DI),zI=kt({},Uh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_w=ar(zI),FI=kt({},ju,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zb}),UI=ar(FI),WI=kt({},Jo,{propertyName:0,elapsedTime:0,pseudoElement:0}),HI=ar(WI),GI=kt({},Uh,{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}),qI=ar(GI),KI=[9,13,27,32],Fb=Ni&&"CompositionEvent"in window,ac=null;Ni&&"documentMode"in document&&(ac=document.documentMode);var VI=Ni&&"TextEvent"in window&&!ac,cA=Ni&&(!Fb||ac&&8<ac&&11>=ac),jw=" ",Aw=!1;function uA(e,t){switch(e){case"keyup":return KI.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dA(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ys=!1;function YI(e,t){switch(e){case"compositionend":return dA(t);case"keypress":return t.which!==32?null:(Aw=!0,jw);case"textInput":return e=t.data,e===jw&&Aw?null:e;default:return null}}function XI(e,t){if(Ys)return e==="compositionend"||!Fb&&uA(e,t)?(e=lA(),qd=Db=Xi=null,Ys=!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 cA&&t.locale!=="ko"?null:t.data;default:return null}}var ZI={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 Cw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ZI[e.type]:t==="textarea"}function fA(e,t,n,r){Wj(r),t=ff(t,"onChange"),0<t.length&&(n=new Bb("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var sc=null,_c=null;function QI(e){kA(e,0)}function Wh(e){var t=Qs(e);if($j(t))return e}function JI(e,t){if(e==="change")return t}var hA=!1;if(Ni){var vm;if(Ni){var bm="oninput"in document;if(!bm){var Tw=document.createElement("div");Tw.setAttribute("oninput","return;"),bm=typeof Tw.oninput=="function"}vm=bm}else vm=!1;hA=vm&&(!document.documentMode||9<document.documentMode)}function Ow(){sc&&(sc.detachEvent("onpropertychange",pA),_c=sc=null)}function pA(e){if(e.propertyName==="value"&&Wh(_c)){var t=[];fA(t,_c,e,Rb(e)),Kj(QI,t)}}function e$(e,t,n){e==="focusin"?(Ow(),sc=t,_c=n,sc.attachEvent("onpropertychange",pA)):e==="focusout"&&Ow()}function t$(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Wh(_c)}function n$(e,t){if(e==="click")return Wh(t)}function r$(e,t){if(e==="input"||e==="change")return Wh(t)}function i$(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Dr=typeof Object.is=="function"?Object.is:i$;function jc(e,t){if(Dr(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(!Wg.call(t,i)||!Dr(e[i],t[i]))return!1}return!0}function Pw(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Rw(e,t){var n=Pw(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=Pw(n)}}function mA(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?mA(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function gA(){for(var e=window,t=af();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=af(e.document)}return t}function Ub(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 a$(e){var t=gA(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&mA(n.ownerDocument.documentElement,n)){if(r!==null&&Ub(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=Rw(n,a);var o=Rw(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 s$=Ni&&"documentMode"in document&&11>=document.documentMode,Xs=null,ly=null,oc=null,cy=!1;function Mw(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;cy||Xs==null||Xs!==af(r)||(r=Xs,"selectionStart"in r&&Ub(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}),oc&&jc(oc,r)||(oc=r,r=ff(ly,"onSelect"),0<r.length&&(t=new Bb("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Xs)))}function sd(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Zs={animationend:sd("Animation","AnimationEnd"),animationiteration:sd("Animation","AnimationIteration"),animationstart:sd("Animation","AnimationStart"),transitionend:sd("Transition","TransitionEnd")},xm={},yA={};Ni&&(yA=document.createElement("div").style,"AnimationEvent"in window||(delete Zs.animationend.animation,delete Zs.animationiteration.animation,delete Zs.animationstart.animation),"TransitionEvent"in window||delete Zs.transitionend.transition);function Hh(e){if(xm[e])return xm[e];if(!Zs[e])return e;var t=Zs[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in yA)return xm[e]=t[n];return e}var vA=Hh("animationend"),bA=Hh("animationiteration"),xA=Hh("animationstart"),wA=Hh("transitionend"),SA=new Map,Iw="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 ma(e,t){SA.set(e,t),ys(t,[e])}for(var wm=0;wm<Iw.length;wm++){var Sm=Iw[wm],o$=Sm.toLowerCase(),l$=Sm[0].toUpperCase()+Sm.slice(1);ma(o$,"on"+l$)}ma(vA,"onAnimationEnd");ma(bA,"onAnimationIteration");ma(xA,"onAnimationStart");ma("dblclick","onDoubleClick");ma("focusin","onFocus");ma("focusout","onBlur");ma(wA,"onTransitionEnd");wo("onMouseEnter",["mouseout","mouseover"]);wo("onMouseLeave",["mouseout","mouseover"]);wo("onPointerEnter",["pointerout","pointerover"]);wo("onPointerLeave",["pointerout","pointerover"]);ys("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ys("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ys("onBeforeInput",["compositionend","keypress","textInput","paste"]);ys("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ys("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ys("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ec="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(" "),c$=new Set("cancel close invalid load scroll toggle".split(" ").concat(ec));function $w(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,oI(r,t,void 0,e),e.currentTarget=null}function kA(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;$w(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;$w(i,l,u),a=c}}}if(of)throw e=iy,of=!1,iy=null,e}function ht(e,t){var n=t[py];n===void 0&&(n=t[py]=new Set);var r=e+"__bubble";n.has(r)||(NA(t,e,2,!1),n.add(r))}function km(e,t,n){var r=0;t&&(r|=4),NA(n,e,r,t)}var od="_reactListening"+Math.random().toString(36).slice(2);function Ac(e){if(!e[od]){e[od]=!0,Oj.forEach(function(n){n!=="selectionchange"&&(c$.has(n)||km(n,!1,e),km(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[od]||(t[od]=!0,km("selectionchange",!1,t))}}function NA(e,t,n,r){switch(oA(t)){case 1:var i=kI;break;case 4:i=NI;break;default:i=Lb}n=i.bind(null,t,n,e),i=void 0,!ry||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 Nm(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=Ha(l),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue e}l=l.parentNode}}r=r.return}Kj(function(){var u=a,d=Rb(n),f=[];e:{var h=SA.get(e);if(h!==void 0){var p=Bb,g=e;switch(e){case"keypress":if(Kd(n)===0)break e;case"keydown":case"keyup":p=BI;break;case"focusin":g="focus",p=ym;break;case"focusout":g="blur",p=ym;break;case"beforeblur":case"afterblur":p=ym;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=Nw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=jI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=UI;break;case vA:case bA:case xA:p=TI;break;case wA:p=HI;break;case"scroll":p=EI;break;case"wheel":p=qI;break;case"copy":case"cut":case"paste":p=PI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=_w}var m=(t&4)!==0,v=!m&&e==="scroll",y=m?h!==null?h+"Capture":null:h;m=[];for(var b=u,w;b!==null;){w=b;var k=w.stateNode;if(w.tag===5&&k!==null&&(w=k,y!==null&&(k=Sc(b,y),k!=null&&m.push(Cc(b,k,w)))),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!==ty&&(g=n.relatedTarget||n.fromElement)&&(Ha(g)||g[Ei]))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?Ha(g):null,g!==null&&(v=vs(g),g!==v||g.tag!==5&&g.tag!==6)&&(g=null)):(p=null,g=u),p!==g)){if(m=Nw,k="onMouseLeave",y="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(m=_w,k="onPointerLeave",y="onPointerEnter",b="pointer"),v=p==null?h:Qs(p),w=g==null?h:Qs(g),h=new m(k,b+"leave",p,n,d),h.target=v,h.relatedTarget=w,k=null,Ha(d)===u&&(m=new m(y,b+"enter",g,n,d),m.target=w,m.relatedTarget=v,k=m),v=k,p&&g)t:{for(m=p,y=g,b=0,w=m;w;w=$s(w))b++;for(w=0,k=y;k;k=$s(k))w++;for(;0<b-w;)m=$s(m),b--;for(;0<w-b;)y=$s(y),w--;for(;b--;){if(m===y||y!==null&&m===y.alternate)break t;m=$s(m),y=$s(y)}m=null}else m=null;p!==null&&Lw(f,h,p,m,!1),g!==null&&v!==null&&Lw(f,v,g,m,!0)}}e:{if(h=u?Qs(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var S=JI;else if(Cw(h))if(hA)S=r$;else{S=t$;var x=e$}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(S=n$);if(S&&(S=S(e,u))){fA(f,S,n,d);break e}x&&x(e,h,u),e==="focusout"&&(x=h._wrapperState)&&x.controlled&&h.type==="number"&&Xg(h,"number",h.value)}switch(x=u?Qs(u):window,e){case"focusin":(Cw(x)||x.contentEditable==="true")&&(Xs=x,ly=u,oc=null);break;case"focusout":oc=ly=Xs=null;break;case"mousedown":cy=!0;break;case"contextmenu":case"mouseup":case"dragend":cy=!1,Mw(f,n,d);break;case"selectionchange":if(s$)break;case"keydown":case"keyup":Mw(f,n,d)}var E;if(Fb)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else Ys?uA(e,n)&&(_="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(_="onCompositionStart");_&&(cA&&n.locale!=="ko"&&(Ys||_!=="onCompositionStart"?_==="onCompositionEnd"&&Ys&&(E=lA()):(Xi=d,Db="value"in Xi?Xi.value:Xi.textContent,Ys=!0)),x=ff(u,_),0<x.length&&(_=new Ew(_,e,null,n,d),f.push({event:_,listeners:x}),E?_.data=E:(E=dA(n),E!==null&&(_.data=E)))),(E=VI?YI(e,n):XI(e,n))&&(u=ff(u,"onBeforeInput"),0<u.length&&(d=new Ew("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=E))}kA(f,t)})}function Cc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ff(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=Sc(e,n),a!=null&&r.unshift(Cc(e,a,i)),a=Sc(e,t),a!=null&&r.push(Cc(e,a,i))),e=e.return}return r}function $s(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Lw(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=Sc(n,a),c!=null&&o.unshift(Cc(n,c,l))):i||(c=Sc(n,a),c!=null&&o.push(Cc(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var u$=/\r\n?/g,d$=/\u0000|\uFFFD/g;function Dw(e){return(typeof e=="string"?e:""+e).replace(u$,`
38
+ `).replace(d$,"")}function ld(e,t,n){if(t=Dw(t),Dw(e)!==t&&n)throw Error(se(425))}function hf(){}var uy=null,dy=null;function fy(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 hy=typeof setTimeout=="function"?setTimeout:void 0,f$=typeof clearTimeout=="function"?clearTimeout:void 0,Bw=typeof Promise=="function"?Promise:void 0,h$=typeof queueMicrotask=="function"?queueMicrotask:typeof Bw<"u"?function(e){return Bw.resolve(null).then(e).catch(p$)}:hy;function p$(e){setTimeout(function(){throw e})}function Em(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),Ec(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Ec(t)}function ia(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 zw(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 el=Math.random().toString(36).slice(2),Yr="__reactFiber$"+el,Tc="__reactProps$"+el,Ei="__reactContainer$"+el,py="__reactEvents$"+el,m$="__reactListeners$"+el,g$="__reactHandles$"+el;function Ha(e){var t=e[Yr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ei]||n[Yr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=zw(e);e!==null;){if(n=e[Yr])return n;e=zw(e)}return t}e=n,n=e.parentNode}return null}function Au(e){return e=e[Yr]||e[Ei],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Qs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(se(33))}function Gh(e){return e[Tc]||null}var my=[],Js=-1;function ga(e){return{current:e}}function yt(e){0>Js||(e.current=my[Js],my[Js]=null,Js--)}function dt(e,t){Js++,my[Js]=e.current,e.current=t}var ha={},bn=ga(ha),Ln=ga(!1),ss=ha;function So(e,t){var n=e.type.contextTypes;if(!n)return ha;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 Dn(e){return e=e.childContextTypes,e!=null}function pf(){yt(Ln),yt(bn)}function Fw(e,t,n){if(bn.current!==ha)throw Error(se(168));dt(bn,t),dt(Ln,n)}function EA(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(se(108,eI(e)||"Unknown",i));return kt({},n,r)}function mf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ha,ss=bn.current,dt(bn,e),dt(Ln,Ln.current),!0}function Uw(e,t,n){var r=e.stateNode;if(!r)throw Error(se(169));n?(e=EA(e,t,ss),r.__reactInternalMemoizedMergedChildContext=e,yt(Ln),yt(bn),dt(bn,e)):yt(Ln),dt(Ln,n)}var pi=null,qh=!1,_m=!1;function _A(e){pi===null?pi=[e]:pi.push(e)}function y$(e){qh=!0,_A(e)}function ya(){if(!_m&&pi!==null){_m=!0;var e=0,t=Qe;try{var n=pi;for(Qe=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}pi=null,qh=!1}catch(i){throw pi!==null&&(pi=pi.slice(e+1)),Zj(Mb,ya),i}finally{Qe=t,_m=!1}}return null}var eo=[],to=0,gf=null,yf=0,dr=[],fr=0,os=null,mi=1,gi="";function Ia(e,t){eo[to++]=yf,eo[to++]=gf,gf=e,yf=t}function jA(e,t,n){dr[fr++]=mi,dr[fr++]=gi,dr[fr++]=os,os=e;var r=mi;e=gi;var i=32-Rr(r)-1;r&=~(1<<i),n+=1;var a=32-Rr(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,mi=1<<32-Rr(t)+i|n<<i|r,gi=a+e}else mi=1<<a|n<<i|r,gi=e}function Wb(e){e.return!==null&&(Ia(e,1),jA(e,1,0))}function Hb(e){for(;e===gf;)gf=eo[--to],eo[to]=null,yf=eo[--to],eo[to]=null;for(;e===os;)os=dr[--fr],dr[fr]=null,gi=dr[--fr],dr[fr]=null,mi=dr[--fr],dr[fr]=null}var er=null,Jn=null,vt=!1,Tr=null;function AA(e,t){var n=pr(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 Ww(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,er=e,Jn=ia(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,er=e,Jn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=os!==null?{id:mi,overflow:gi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=pr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,er=e,Jn=null,!0):!1;default:return!1}}function gy(e){return(e.mode&1)!==0&&(e.flags&128)===0}function yy(e){if(vt){var t=Jn;if(t){var n=t;if(!Ww(e,t)){if(gy(e))throw Error(se(418));t=ia(n.nextSibling);var r=er;t&&Ww(e,t)?AA(r,n):(e.flags=e.flags&-4097|2,vt=!1,er=e)}}else{if(gy(e))throw Error(se(418));e.flags=e.flags&-4097|2,vt=!1,er=e}}}function Hw(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;er=e}function cd(e){if(e!==er)return!1;if(!vt)return Hw(e),vt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!fy(e.type,e.memoizedProps)),t&&(t=Jn)){if(gy(e))throw CA(),Error(se(418));for(;t;)AA(e,t),t=ia(t.nextSibling)}if(Hw(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(se(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Jn=ia(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Jn=null}}else Jn=er?ia(e.stateNode.nextSibling):null;return!0}function CA(){for(var e=Jn;e;)e=ia(e.nextSibling)}function ko(){Jn=er=null,vt=!1}function Gb(e){Tr===null?Tr=[e]:Tr.push(e)}var v$=Oi.ReactCurrentBatchConfig;function Ml(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(se(309));var r=n.stateNode}if(!r)throw Error(se(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(se(284));if(!n._owner)throw Error(se(290,e))}return e}function ud(e,t){throw e=Object.prototype.toString.call(t),Error(se(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Gw(e){var t=e._init;return t(e._payload)}function TA(e){function t(y,b){if(e){var w=y.deletions;w===null?(y.deletions=[b],y.flags|=16):w.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=la(y,b),y.index=0,y.sibling=null,y}function a(y,b,w){return y.index=w,e?(w=y.alternate,w!==null?(w=w.index,w<b?(y.flags|=2,b):w):(y.flags|=2,b)):(y.flags|=1048576,b)}function o(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,b,w,k){return b===null||b.tag!==6?(b=Rm(w,y.mode,k),b.return=y,b):(b=i(b,w),b.return=y,b)}function c(y,b,w,k){var S=w.type;return S===Vs?d(y,b,w.props.children,k,w.key):b!==null&&(b.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Ui&&Gw(S)===b.type)?(k=i(b,w.props),k.ref=Ml(y,b,w),k.return=y,k):(k=ef(w.type,w.key,w.props,null,y.mode,k),k.ref=Ml(y,b,w),k.return=y,k)}function u(y,b,w,k){return b===null||b.tag!==4||b.stateNode.containerInfo!==w.containerInfo||b.stateNode.implementation!==w.implementation?(b=Mm(w,y.mode,k),b.return=y,b):(b=i(b,w.children||[]),b.return=y,b)}function d(y,b,w,k,S){return b===null||b.tag!==7?(b=Ja(w,y.mode,k,S),b.return=y,b):(b=i(b,w),b.return=y,b)}function f(y,b,w){if(typeof b=="string"&&b!==""||typeof b=="number")return b=Rm(""+b,y.mode,w),b.return=y,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Ju:return w=ef(b.type,b.key,b.props,null,y.mode,w),w.ref=Ml(y,null,b),w.return=y,w;case Ks:return b=Mm(b,y.mode,w),b.return=y,b;case Ui:var k=b._init;return f(y,k(b._payload),w)}if(Ql(b)||Cl(b))return b=Ja(b,y.mode,w,null),b.return=y,b;ud(y,b)}return null}function h(y,b,w,k){var S=b!==null?b.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return S!==null?null:l(y,b,""+w,k);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ju:return w.key===S?c(y,b,w,k):null;case Ks:return w.key===S?u(y,b,w,k):null;case Ui:return S=w._init,h(y,b,S(w._payload),k)}if(Ql(w)||Cl(w))return S!==null?null:d(y,b,w,k,null);ud(y,w)}return null}function p(y,b,w,k,S){if(typeof k=="string"&&k!==""||typeof k=="number")return y=y.get(w)||null,l(b,y,""+k,S);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case Ju:return y=y.get(k.key===null?w:k.key)||null,c(b,y,k,S);case Ks:return y=y.get(k.key===null?w:k.key)||null,u(b,y,k,S);case Ui:var x=k._init;return p(y,b,w,x(k._payload),S)}if(Ql(k)||Cl(k))return y=y.get(w)||null,d(b,y,k,S,null);ud(b,k)}return null}function g(y,b,w,k){for(var S=null,x=null,E=b,_=b=0,C=null;E!==null&&_<w.length;_++){E.index>_?(C=E,E=null):C=E.sibling;var T=h(y,E,w[_],k);if(T===null){E===null&&(E=C);break}e&&E&&T.alternate===null&&t(y,E),b=a(T,b,_),x===null?S=T:x.sibling=T,x=T,E=C}if(_===w.length)return n(y,E),vt&&Ia(y,_),S;if(E===null){for(;_<w.length;_++)E=f(y,w[_],k),E!==null&&(b=a(E,b,_),x===null?S=E:x.sibling=E,x=E);return vt&&Ia(y,_),S}for(E=r(y,E);_<w.length;_++)C=p(E,y,_,w[_],k),C!==null&&(e&&C.alternate!==null&&E.delete(C.key===null?_:C.key),b=a(C,b,_),x===null?S=C:x.sibling=C,x=C);return e&&E.forEach(function(L){return t(y,L)}),vt&&Ia(y,_),S}function m(y,b,w,k){var S=Cl(w);if(typeof S!="function")throw Error(se(150));if(w=S.call(w),w==null)throw Error(se(151));for(var x=S=null,E=b,_=b=0,C=null,T=w.next();E!==null&&!T.done;_++,T=w.next()){E.index>_?(C=E,E=null):C=E.sibling;var L=h(y,E,T.value,k);if(L===null){E===null&&(E=C);break}e&&E&&L.alternate===null&&t(y,E),b=a(L,b,_),x===null?S=L:x.sibling=L,x=L,E=C}if(T.done)return n(y,E),vt&&Ia(y,_),S;if(E===null){for(;!T.done;_++,T=w.next())T=f(y,T.value,k),T!==null&&(b=a(T,b,_),x===null?S=T:x.sibling=T,x=T);return vt&&Ia(y,_),S}for(E=r(y,E);!T.done;_++,T=w.next())T=p(E,y,_,T.value,k),T!==null&&(e&&T.alternate!==null&&E.delete(T.key===null?_:T.key),b=a(T,b,_),x===null?S=T:x.sibling=T,x=T);return e&&E.forEach(function(M){return t(y,M)}),vt&&Ia(y,_),S}function v(y,b,w,k){if(typeof w=="object"&&w!==null&&w.type===Vs&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Ju:e:{for(var S=w.key,x=b;x!==null;){if(x.key===S){if(S=w.type,S===Vs){if(x.tag===7){n(y,x.sibling),b=i(x,w.props.children),b.return=y,y=b;break e}}else if(x.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Ui&&Gw(S)===x.type){n(y,x.sibling),b=i(x,w.props),b.ref=Ml(y,x,w),b.return=y,y=b;break e}n(y,x);break}else t(y,x);x=x.sibling}w.type===Vs?(b=Ja(w.props.children,y.mode,k,w.key),b.return=y,y=b):(k=ef(w.type,w.key,w.props,null,y.mode,k),k.ref=Ml(y,b,w),k.return=y,y=k)}return o(y);case Ks:e:{for(x=w.key;b!==null;){if(b.key===x)if(b.tag===4&&b.stateNode.containerInfo===w.containerInfo&&b.stateNode.implementation===w.implementation){n(y,b.sibling),b=i(b,w.children||[]),b.return=y,y=b;break e}else{n(y,b);break}else t(y,b);b=b.sibling}b=Mm(w,y.mode,k),b.return=y,y=b}return o(y);case Ui:return x=w._init,v(y,b,x(w._payload),k)}if(Ql(w))return g(y,b,w,k);if(Cl(w))return m(y,b,w,k);ud(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,b!==null&&b.tag===6?(n(y,b.sibling),b=i(b,w),b.return=y,y=b):(n(y,b),b=Rm(w,y.mode,k),b.return=y,y=b),o(y)):n(y,b)}return v}var No=TA(!0),OA=TA(!1),vf=ga(null),bf=null,no=null,qb=null;function Kb(){qb=no=bf=null}function Vb(e){var t=vf.current;yt(vf),e._currentValue=t}function vy(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 mo(e,t){bf=e,qb=no=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(In=!0),e.firstContext=null)}function vr(e){var t=e._currentValue;if(qb!==e)if(e={context:e,memoizedValue:t,next:null},no===null){if(bf===null)throw Error(se(308));no=e,bf.dependencies={lanes:0,firstContext:e}}else no=no.next=e;return t}var Ga=null;function Yb(e){Ga===null?Ga=[e]:Ga.push(e)}function PA(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Yb(t)):(n.next=i.next,i.next=n),t.interleaved=n,_i(e,r)}function _i(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 Wi=!1;function Xb(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function RA(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 xi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function aa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,We&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,_i(e,n)}return i=r.interleaved,i===null?(t.next=t,Yb(r)):(t.next=i.next,i.next=t),r.interleaved=t,_i(e,n)}function Vd(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,Ib(e,n)}}function qw(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 xf(e,t,n,r){var i=e.updateQueue;Wi=!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=kt({},f,h);break e;case 2:Wi=!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);cs|=o,e.lanes=o,e.memoizedState=f}}function Kw(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(se(191,i));i.call(r)}}}var Cu={},ei=ga(Cu),Oc=ga(Cu),Pc=ga(Cu);function qa(e){if(e===Cu)throw Error(se(174));return e}function Zb(e,t){switch(dt(Pc,t),dt(Oc,e),dt(ei,Cu),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Qg(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Qg(t,e)}yt(ei),dt(ei,t)}function Eo(){yt(ei),yt(Oc),yt(Pc)}function MA(e){qa(Pc.current);var t=qa(ei.current),n=Qg(t,e.type);t!==n&&(dt(Oc,e),dt(ei,n))}function Qb(e){Oc.current===e&&(yt(ei),yt(Oc))}var xt=ga(0);function wf(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 jm=[];function Jb(){for(var e=0;e<jm.length;e++)jm[e]._workInProgressVersionPrimary=null;jm.length=0}var Yd=Oi.ReactCurrentDispatcher,Am=Oi.ReactCurrentBatchConfig,ls=0,wt=null,Ut=null,Vt=null,Sf=!1,lc=!1,Rc=0,b$=0;function un(){throw Error(se(321))}function ex(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Dr(e[n],t[n]))return!1;return!0}function tx(e,t,n,r,i,a){if(ls=a,wt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Yd.current=e===null||e.memoizedState===null?k$:N$,e=n(r,i),lc){a=0;do{if(lc=!1,Rc=0,25<=a)throw Error(se(301));a+=1,Vt=Ut=null,t.updateQueue=null,Yd.current=E$,e=n(r,i)}while(lc)}if(Yd.current=kf,t=Ut!==null&&Ut.next!==null,ls=0,Vt=Ut=wt=null,Sf=!1,t)throw Error(se(300));return e}function nx(){var e=Rc!==0;return Rc=0,e}function Kr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vt===null?wt.memoizedState=Vt=e:Vt=Vt.next=e,Vt}function br(){if(Ut===null){var e=wt.alternate;e=e!==null?e.memoizedState:null}else e=Ut.next;var t=Vt===null?wt.memoizedState:Vt.next;if(t!==null)Vt=t,Ut=e;else{if(e===null)throw Error(se(310));Ut=e,e={memoizedState:Ut.memoizedState,baseState:Ut.baseState,baseQueue:Ut.baseQueue,queue:Ut.queue,next:null},Vt===null?wt.memoizedState=Vt=e:Vt=Vt.next=e}return Vt}function Mc(e,t){return typeof t=="function"?t(e):t}function Cm(e){var t=br(),n=t.queue;if(n===null)throw Error(se(311));n.lastRenderedReducer=e;var r=Ut,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((ls&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,wt.lanes|=d,cs|=d}u=u.next}while(u!==null&&u!==a);c===null?o=r:c.next=l,Dr(r,t.memoizedState)||(In=!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,wt.lanes|=a,cs|=a,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Tm(e){var t=br(),n=t.queue;if(n===null)throw Error(se(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);Dr(a,t.memoizedState)||(In=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function IA(){}function $A(e,t){var n=wt,r=br(),i=t(),a=!Dr(r.memoizedState,i);if(a&&(r.memoizedState=i,In=!0),r=r.queue,rx(BA.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||Vt!==null&&Vt.memoizedState.tag&1){if(n.flags|=2048,Ic(9,DA.bind(null,n,r,i,t),void 0,null),Xt===null)throw Error(se(349));ls&30||LA(n,t,i)}return i}function LA(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=wt.updateQueue,t===null?(t={lastEffect:null,stores:null},wt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function DA(e,t,n,r){t.value=n,t.getSnapshot=r,zA(t)&&FA(e)}function BA(e,t,n){return n(function(){zA(t)&&FA(e)})}function zA(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Dr(e,n)}catch{return!0}}function FA(e){var t=_i(e,1);t!==null&&Mr(t,e,1,-1)}function Vw(e){var t=Kr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Mc,lastRenderedState:e},t.queue=e,e=e.dispatch=S$.bind(null,wt,e),[t.memoizedState,e]}function Ic(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=wt.updateQueue,t===null?(t={lastEffect:null,stores:null},wt.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 UA(){return br().memoizedState}function Xd(e,t,n,r){var i=Kr();wt.flags|=e,i.memoizedState=Ic(1|t,n,void 0,r===void 0?null:r)}function Kh(e,t,n,r){var i=br();r=r===void 0?null:r;var a=void 0;if(Ut!==null){var o=Ut.memoizedState;if(a=o.destroy,r!==null&&ex(r,o.deps)){i.memoizedState=Ic(t,n,a,r);return}}wt.flags|=e,i.memoizedState=Ic(1|t,n,a,r)}function Yw(e,t){return Xd(8390656,8,e,t)}function rx(e,t){return Kh(2048,8,e,t)}function WA(e,t){return Kh(4,2,e,t)}function HA(e,t){return Kh(4,4,e,t)}function GA(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 qA(e,t,n){return n=n!=null?n.concat([e]):null,Kh(4,4,GA.bind(null,t,e),n)}function ix(){}function KA(e,t){var n=br();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ex(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function VA(e,t){var n=br();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ex(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function YA(e,t,n){return ls&21?(Dr(n,t)||(n=eA(),wt.lanes|=n,cs|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,In=!0),e.memoizedState=n)}function x$(e,t){var n=Qe;Qe=n!==0&&4>n?n:4,e(!0);var r=Am.transition;Am.transition={};try{e(!1),t()}finally{Qe=n,Am.transition=r}}function XA(){return br().memoizedState}function w$(e,t,n){var r=oa(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ZA(e))QA(t,n);else if(n=PA(e,t,n,r),n!==null){var i=An();Mr(n,e,r,i),JA(n,t,r)}}function S$(e,t,n){var r=oa(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ZA(e))QA(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,Dr(l,o)){var c=t.interleaved;c===null?(i.next=i,Yb(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=PA(e,t,i,r),n!==null&&(i=An(),Mr(n,e,r,i),JA(n,t,r))}}function ZA(e){var t=e.alternate;return e===wt||t!==null&&t===wt}function QA(e,t){lc=Sf=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function JA(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ib(e,n)}}var kf={readContext:vr,useCallback:un,useContext:un,useEffect:un,useImperativeHandle:un,useInsertionEffect:un,useLayoutEffect:un,useMemo:un,useReducer:un,useRef:un,useState:un,useDebugValue:un,useDeferredValue:un,useTransition:un,useMutableSource:un,useSyncExternalStore:un,useId:un,unstable_isNewReconciler:!1},k$={readContext:vr,useCallback:function(e,t){return Kr().memoizedState=[e,t===void 0?null:t],e},useContext:vr,useEffect:Yw,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Xd(4194308,4,GA.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Xd(4194308,4,e,t)},useInsertionEffect:function(e,t){return Xd(4,2,e,t)},useMemo:function(e,t){var n=Kr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Kr();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=w$.bind(null,wt,e),[r.memoizedState,e]},useRef:function(e){var t=Kr();return e={current:e},t.memoizedState=e},useState:Vw,useDebugValue:ix,useDeferredValue:function(e){return Kr().memoizedState=e},useTransition:function(){var e=Vw(!1),t=e[0];return e=x$.bind(null,e[1]),Kr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=wt,i=Kr();if(vt){if(n===void 0)throw Error(se(407));n=n()}else{if(n=t(),Xt===null)throw Error(se(349));ls&30||LA(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,Yw(BA.bind(null,r,a,e),[e]),r.flags|=2048,Ic(9,DA.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Kr(),t=Xt.identifierPrefix;if(vt){var n=gi,r=mi;n=(r&~(1<<32-Rr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Rc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=b$++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},N$={readContext:vr,useCallback:KA,useContext:vr,useEffect:rx,useImperativeHandle:qA,useInsertionEffect:WA,useLayoutEffect:HA,useMemo:VA,useReducer:Cm,useRef:UA,useState:function(){return Cm(Mc)},useDebugValue:ix,useDeferredValue:function(e){var t=br();return YA(t,Ut.memoizedState,e)},useTransition:function(){var e=Cm(Mc)[0],t=br().memoizedState;return[e,t]},useMutableSource:IA,useSyncExternalStore:$A,useId:XA,unstable_isNewReconciler:!1},E$={readContext:vr,useCallback:KA,useContext:vr,useEffect:rx,useImperativeHandle:qA,useInsertionEffect:WA,useLayoutEffect:HA,useMemo:VA,useReducer:Tm,useRef:UA,useState:function(){return Tm(Mc)},useDebugValue:ix,useDeferredValue:function(e){var t=br();return Ut===null?t.memoizedState=e:YA(t,Ut.memoizedState,e)},useTransition:function(){var e=Tm(Mc)[0],t=br().memoizedState;return[e,t]},useMutableSource:IA,useSyncExternalStore:$A,useId:XA,unstable_isNewReconciler:!1};function jr(e,t){if(e&&e.defaultProps){t=kt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function by(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:kt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Vh={isMounted:function(e){return(e=e._reactInternals)?vs(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=An(),i=oa(e),a=xi(r,i);a.payload=t,n!=null&&(a.callback=n),t=aa(e,a,i),t!==null&&(Mr(t,e,i,r),Vd(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=An(),i=oa(e),a=xi(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=aa(e,a,i),t!==null&&(Mr(t,e,i,r),Vd(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=An(),r=oa(e),i=xi(n,r);i.tag=2,t!=null&&(i.callback=t),t=aa(e,i,r),t!==null&&(Mr(t,e,r,n),Vd(t,e,r))}};function Xw(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?!jc(n,r)||!jc(i,a):!0}function eC(e,t,n){var r=!1,i=ha,a=t.contextType;return typeof a=="object"&&a!==null?a=vr(a):(i=Dn(t)?ss:bn.current,r=t.contextTypes,a=(r=r!=null)?So(e,i):ha),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Vh,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Zw(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&&Vh.enqueueReplaceState(t,t.state,null)}function xy(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Xb(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=vr(a):(a=Dn(t)?ss:bn.current,i.context=So(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(by(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&&Vh.enqueueReplaceState(i,i.state,null),xf(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function _o(e,t){try{var n="",r=t;do n+=J2(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 Om(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function wy(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var _$=typeof WeakMap=="function"?WeakMap:Map;function tC(e,t,n){n=xi(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ef||(Ef=!0,Oy=r),wy(e,t)},n}function nC(e,t,n){n=xi(-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(){wy(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){wy(e,t),typeof r!="function"&&(sa===null?sa=new Set([this]):sa.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Qw(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new _$;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=z$.bind(null,e,t,n),t.then(e,e))}function Jw(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 e1(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=xi(-1,1),t.tag=2,aa(n,t,1))),n.lanes|=1),e)}var j$=Oi.ReactCurrentOwner,In=!1;function En(e,t,n,r){t.child=e===null?OA(t,null,n,r):No(t,e.child,n,r)}function t1(e,t,n,r,i){n=n.render;var a=t.ref;return mo(t,i),r=tx(e,t,n,r,a,i),n=nx(),e!==null&&!In?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ji(e,t,i)):(vt&&n&&Wb(t),t.flags|=1,En(e,t,r,i),t.child)}function n1(e,t,n,r,i){if(e===null){var a=n.type;return typeof a=="function"&&!fx(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,rC(e,t,a,r,i)):(e=ef(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:jc,n(o,r)&&e.ref===t.ref)return ji(e,t,i)}return t.flags|=1,e=la(a,r),e.ref=t.ref,e.return=t,t.child=e}function rC(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(jc(a,r)&&e.ref===t.ref)if(In=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(In=!0);else return t.lanes=e.lanes,ji(e,t,i)}return Sy(e,t,n,r,i)}function iC(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},dt(io,Xn),Xn|=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,dt(io,Xn),Xn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,dt(io,Xn),Xn|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,dt(io,Xn),Xn|=r;return En(e,t,i,n),t.child}function aC(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Sy(e,t,n,r,i){var a=Dn(n)?ss:bn.current;return a=So(t,a),mo(t,i),n=tx(e,t,n,r,a,i),r=nx(),e!==null&&!In?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ji(e,t,i)):(vt&&r&&Wb(t),t.flags|=1,En(e,t,n,i),t.child)}function r1(e,t,n,r,i){if(Dn(n)){var a=!0;mf(t)}else a=!1;if(mo(t,i),t.stateNode===null)Zd(e,t),eC(t,n,r),xy(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=vr(u):(u=Dn(n)?ss:bn.current,u=So(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)&&Zw(t,o,r,u),Wi=!1;var h=t.memoizedState;o.state=h,xf(t,r,o,i),c=t.memoizedState,l!==r||h!==c||Ln.current||Wi?(typeof d=="function"&&(by(t,n,d,r),c=t.memoizedState),(l=Wi||Xw(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,RA(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:jr(t.type,l),o.props=u,f=t.pendingProps,h=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=vr(c):(c=Dn(n)?ss:bn.current,c=So(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)&&Zw(t,o,r,c),Wi=!1,h=t.memoizedState,o.state=h,xf(t,r,o,i);var g=t.memoizedState;l!==f||h!==g||Ln.current||Wi?(typeof p=="function"&&(by(t,n,p,r),g=t.memoizedState),(u=Wi||Xw(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 ky(e,t,n,r,a,i)}function ky(e,t,n,r,i,a){aC(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&Uw(t,n,!1),ji(e,t,a);r=t.stateNode,j$.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=No(t,e.child,null,a),t.child=No(t,null,l,a)):En(e,t,l,a),t.memoizedState=r.state,i&&Uw(t,n,!0),t.child}function sC(e){var t=e.stateNode;t.pendingContext?Fw(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Fw(e,t.context,!1),Zb(e,t.containerInfo)}function i1(e,t,n,r,i){return ko(),Gb(i),t.flags|=256,En(e,t,n,r),t.child}var Ny={dehydrated:null,treeContext:null,retryLane:0};function Ey(e){return{baseLanes:e,cachePool:null,transitions:null}}function oC(e,t,n){var r=t.pendingProps,i=xt.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),dt(xt,i&1),e===null)return yy(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=Zh(o,r,0,null),e=Ja(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Ey(n),t.memoizedState=Ny,e):ax(t,o));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return A$(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=la(i,c),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=la(l,a):(a=Ja(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?Ey(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Ny,r}return a=e.child,e=a.sibling,r=la(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 ax(e,t){return t=Zh({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function dd(e,t,n,r){return r!==null&&Gb(r),No(t,e.child,null,n),e=ax(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function A$(e,t,n,r,i,a,o){if(n)return t.flags&256?(t.flags&=-257,r=Om(Error(se(422))),dd(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,i=t.mode,r=Zh({mode:"visible",children:r.children},i,0,null),a=Ja(a,i,o,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&No(t,e.child,null,o),t.child.memoizedState=Ey(o),t.memoizedState=Ny,a);if(!(t.mode&1))return dd(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,a=Error(se(419)),r=Om(a,r,void 0),dd(e,t,o,r)}if(l=(o&e.childLanes)!==0,In||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,_i(e,i),Mr(r,e,i,-1))}return dx(),r=Om(Error(se(421))),dd(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=F$.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,Jn=ia(i.nextSibling),er=t,vt=!0,Tr=null,e!==null&&(dr[fr++]=mi,dr[fr++]=gi,dr[fr++]=os,mi=e.id,gi=e.overflow,os=t),t=ax(t,r.children),t.flags|=4096,t)}function a1(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),vy(e.return,t,n)}function Pm(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 lC(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(En(e,t,r.children,n),r=xt.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&&a1(e,n,t);else if(e.tag===19)a1(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(dt(xt,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&&wf(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Pm(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&&wf(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Pm(t,!0,n,null,a);break;case"together":Pm(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Zd(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ji(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),cs|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(se(153));if(t.child!==null){for(e=t.child,n=la(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=la(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function C$(e,t,n){switch(t.tag){case 3:sC(t),ko();break;case 5:MA(t);break;case 1:Dn(t.type)&&mf(t);break;case 4:Zb(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;dt(vf,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(dt(xt,xt.current&1),t.flags|=128,null):n&t.child.childLanes?oC(e,t,n):(dt(xt,xt.current&1),e=ji(e,t,n),e!==null?e.sibling:null);dt(xt,xt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return lC(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),dt(xt,xt.current),r)break;return null;case 22:case 23:return t.lanes=0,iC(e,t,n)}return ji(e,t,n)}var cC,_y,uC,dC;cC=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}};_y=function(){};uC=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,qa(ei.current);var a=null;switch(n){case"input":i=Vg(e,i),r=Vg(e,r),a=[];break;case"select":i=kt({},i,{value:void 0}),r=kt({},r,{value:void 0}),a=[];break;case"textarea":i=Zg(e,i),r=Zg(e,r),a=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=hf)}Jg(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"&&(xc.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"&&(xc.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&ht("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)}};dC=function(e,t,n,r){n!==r&&(t.flags|=4)};function Il(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 dn(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 T$(e,t,n){var r=t.pendingProps;switch(Hb(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dn(t),null;case 1:return Dn(t.type)&&pf(),dn(t),null;case 3:return r=t.stateNode,Eo(),yt(Ln),yt(bn),Jb(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(cd(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Tr!==null&&(My(Tr),Tr=null))),_y(e,t),dn(t),null;case 5:Qb(t);var i=qa(Pc.current);if(n=t.type,e!==null&&t.stateNode!=null)uC(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(se(166));return dn(t),null}if(e=qa(ei.current),cd(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[Yr]=t,r[Tc]=a,e=(t.mode&1)!==0,n){case"dialog":ht("cancel",r),ht("close",r);break;case"iframe":case"object":case"embed":ht("load",r);break;case"video":case"audio":for(i=0;i<ec.length;i++)ht(ec[i],r);break;case"source":ht("error",r);break;case"img":case"image":case"link":ht("error",r),ht("load",r);break;case"details":ht("toggle",r);break;case"input":pw(r,a),ht("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},ht("invalid",r);break;case"textarea":gw(r,a),ht("invalid",r)}Jg(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&&ld(r.textContent,l,e),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&ld(r.textContent,l,e),i=["children",""+l]):xc.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&ht("scroll",r)}switch(n){case"input":ed(r),mw(r,a,!0);break;case"textarea":ed(r),yw(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=hf)}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=Bj(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[Yr]=t,e[Tc]=r,cC(e,t,!1,!1),t.stateNode=e;e:{switch(o=ey(n,r),n){case"dialog":ht("cancel",e),ht("close",e),i=r;break;case"iframe":case"object":case"embed":ht("load",e),i=r;break;case"video":case"audio":for(i=0;i<ec.length;i++)ht(ec[i],e);i=r;break;case"source":ht("error",e),i=r;break;case"img":case"image":case"link":ht("error",e),ht("load",e),i=r;break;case"details":ht("toggle",e),i=r;break;case"input":pw(e,r),i=Vg(e,r),ht("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=kt({},r,{value:void 0}),ht("invalid",e);break;case"textarea":gw(e,r),i=Zg(e,r),ht("invalid",e);break;default:i=r}Jg(n,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?Uj(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&zj(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&wc(e,c):typeof c=="number"&&wc(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(xc.hasOwnProperty(a)?c!=null&&a==="onScroll"&&ht("scroll",e):c!=null&&Cb(e,a,c,o))}switch(n){case"input":ed(e),mw(e,r,!1);break;case"textarea":ed(e),yw(e);break;case"option":r.value!=null&&e.setAttribute("value",""+fa(r.value));break;case"select":e.multiple=!!r.multiple,a=r.value,a!=null?uo(e,!!r.multiple,a,!1):r.defaultValue!=null&&uo(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=hf)}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 dn(t),null;case 6:if(e&&t.stateNode!=null)dC(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(se(166));if(n=qa(Pc.current),qa(ei.current),cd(t)){if(r=t.stateNode,n=t.memoizedProps,r[Yr]=t,(a=r.nodeValue!==n)&&(e=er,e!==null))switch(e.tag){case 3:ld(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ld(r.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Yr]=t,t.stateNode=r}return dn(t),null;case 13:if(yt(xt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(vt&&Jn!==null&&t.mode&1&&!(t.flags&128))CA(),ko(),t.flags|=98560,a=!1;else if(a=cd(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(se(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(se(317));a[Yr]=t}else ko(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;dn(t),a=!1}else Tr!==null&&(My(Tr),Tr=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||xt.current&1?Wt===0&&(Wt=3):dx())),t.updateQueue!==null&&(t.flags|=4),dn(t),null);case 4:return Eo(),_y(e,t),e===null&&Ac(t.stateNode.containerInfo),dn(t),null;case 10:return Vb(t.type._context),dn(t),null;case 17:return Dn(t.type)&&pf(),dn(t),null;case 19:if(yt(xt),a=t.memoizedState,a===null)return dn(t),null;if(r=(t.flags&128)!==0,o=a.rendering,o===null)if(r)Il(a,!1);else{if(Wt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=wf(e),o!==null){for(t.flags|=128,Il(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 dt(xt,xt.current&1|2),t.child}e=e.sibling}a.tail!==null&&Ct()>jo&&(t.flags|=128,r=!0,Il(a,!1),t.lanes=4194304)}else{if(!r)if(e=wf(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Il(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!vt)return dn(t),null}else 2*Ct()-a.renderingStartTime>jo&&n!==1073741824&&(t.flags|=128,r=!0,Il(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=Ct(),t.sibling=null,n=xt.current,dt(xt,r?n&1|2:n&1),t):(dn(t),null);case 22:case 23:return ux(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Xn&1073741824&&(dn(t),t.subtreeFlags&6&&(t.flags|=8192)):dn(t),null;case 24:return null;case 25:return null}throw Error(se(156,t.tag))}function O$(e,t){switch(Hb(t),t.tag){case 1:return Dn(t.type)&&pf(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Eo(),yt(Ln),yt(bn),Jb(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Qb(t),null;case 13:if(yt(xt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(se(340));ko()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return yt(xt),null;case 4:return Eo(),null;case 10:return Vb(t.type._context),null;case 22:case 23:return ux(),null;case 24:return null;default:return null}}var fd=!1,mn=!1,P$=typeof WeakSet=="function"?WeakSet:Set,ye=null;function ro(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){_t(e,t,r)}else n.current=null}function jy(e,t,n){try{n()}catch(r){_t(e,t,r)}}var s1=!1;function R$(e,t){if(uy=uf,e=gA(),Ub(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(dy={focusedElem:e,selectionRange:n},uf=!1,ye=t;ye!==null;)if(t=ye,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ye=e;else for(;ye!==null;){t=ye;try{var 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:jr(t.type,m),v);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(se(163))}}catch(k){_t(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,ye=e;break}ye=t.return}return g=s1,s1=!1,g}function cc(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&&jy(t,n,a)}i=i.next}while(i!==r)}}function Yh(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 Ay(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 fC(e){var t=e.alternate;t!==null&&(e.alternate=null,fC(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Yr],delete t[Tc],delete t[py],delete t[m$],delete t[g$])),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 hC(e){return e.tag===5||e.tag===3||e.tag===4}function o1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hC(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 Cy(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=hf));else if(r!==4&&(e=e.child,e!==null))for(Cy(e,t,n),e=e.sibling;e!==null;)Cy(e,t,n),e=e.sibling}function Ty(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(Ty(e,t,n),e=e.sibling;e!==null;)Ty(e,t,n),e=e.sibling}var rn=null,Ar=!1;function Di(e,t,n){for(n=n.child;n!==null;)pC(e,t,n),n=n.sibling}function pC(e,t,n){if(Jr&&typeof Jr.onCommitFiberUnmount=="function")try{Jr.onCommitFiberUnmount(Fh,n)}catch{}switch(n.tag){case 5:mn||ro(n,t);case 6:var r=rn,i=Ar;rn=null,Di(e,t,n),rn=r,Ar=i,rn!==null&&(Ar?(e=rn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):rn.removeChild(n.stateNode));break;case 18:rn!==null&&(Ar?(e=rn,n=n.stateNode,e.nodeType===8?Em(e.parentNode,n):e.nodeType===1&&Em(e,n),Ec(e)):Em(rn,n.stateNode));break;case 4:r=rn,i=Ar,rn=n.stateNode.containerInfo,Ar=!0,Di(e,t,n),rn=r,Ar=i;break;case 0:case 11:case 14:case 15:if(!mn&&(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)&&jy(n,t,o),i=i.next}while(i!==r)}Di(e,t,n);break;case 1:if(!mn&&(ro(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){_t(n,t,l)}Di(e,t,n);break;case 21:Di(e,t,n);break;case 22:n.mode&1?(mn=(r=mn)||n.memoizedState!==null,Di(e,t,n),mn=r):Di(e,t,n);break;default:Di(e,t,n)}}function l1(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new P$),t.forEach(function(r){var i=U$.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Er(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:rn=l.stateNode,Ar=!1;break e;case 3:rn=l.stateNode.containerInfo,Ar=!0;break e;case 4:rn=l.stateNode.containerInfo,Ar=!0;break e}l=l.return}if(rn===null)throw Error(se(160));pC(a,o,i),rn=null,Ar=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){_t(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)mC(t,e),t=t.sibling}function mC(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Er(t,e),Gr(e),r&4){try{cc(3,e,e.return),Yh(3,e)}catch(m){_t(e,e.return,m)}try{cc(5,e,e.return)}catch(m){_t(e,e.return,m)}}break;case 1:Er(t,e),Gr(e),r&512&&n!==null&&ro(n,n.return);break;case 5:if(Er(t,e),Gr(e),r&512&&n!==null&&ro(n,n.return),e.flags&32){var i=e.stateNode;try{wc(i,"")}catch(m){_t(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&&Lj(i,a),ey(l,o);var u=ey(l,a);for(o=0;o<c.length;o+=2){var d=c[o],f=c[o+1];d==="style"?Uj(i,f):d==="dangerouslySetInnerHTML"?zj(i,f):d==="children"?wc(i,f):Cb(i,d,f,u)}switch(l){case"input":Yg(i,a);break;case"textarea":Dj(i,a);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var p=a.value;p!=null?uo(i,!!a.multiple,p,!1):h!==!!a.multiple&&(a.defaultValue!=null?uo(i,!!a.multiple,a.defaultValue,!0):uo(i,!!a.multiple,a.multiple?[]:"",!1))}i[Tc]=a}catch(m){_t(e,e.return,m)}}break;case 6:if(Er(t,e),Gr(e),r&4){if(e.stateNode===null)throw Error(se(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(m){_t(e,e.return,m)}}break;case 3:if(Er(t,e),Gr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ec(t.containerInfo)}catch(m){_t(e,e.return,m)}break;case 4:Er(t,e),Gr(e);break;case 13:Er(t,e),Gr(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(lx=Ct())),r&4&&l1(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(mn=(u=mn)||d,Er(t,e),mn=u):Er(t,e),Gr(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:cc(4,h,h.return);break;case 1:ro(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){_t(r,n,m)}}break;case 5:ro(h,h.return);break;case 22:if(h.memoizedState!==null){u1(f);continue}}p!==null?(p.return=h,ye=p):u1(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=Fj("display",o))}catch(m){_t(e,e.return,m)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(m){_t(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:Er(t,e),Gr(e),r&4&&l1(e);break;case 21:break;default:Er(t,e),Gr(e)}}function Gr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(hC(n)){var r=n;break e}n=n.return}throw Error(se(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(wc(i,""),r.flags&=-33);var a=o1(e);Ty(e,a,i);break;case 3:case 4:var o=r.stateNode.containerInfo,l=o1(e);Cy(e,l,o);break;default:throw Error(se(161))}}catch(c){_t(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function M$(e,t,n){ye=e,gC(e)}function gC(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||fd;if(!o){var l=i.alternate,c=l!==null&&l.memoizedState!==null||mn;l=fd;var u=mn;if(fd=o,(mn=c)&&!u)for(ye=i;ye!==null;)o=ye,c=o.child,o.tag===22&&o.memoizedState!==null?d1(i):c!==null?(c.return=o,ye=c):d1(i);for(;a!==null;)ye=a,gC(a),a=a.sibling;ye=i,fd=l,mn=u}c1(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,ye=a):c1(e)}}function c1(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:mn||Yh(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!mn)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:jr(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&Kw(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}Kw(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&&Ec(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(se(163))}mn||t.flags&512&&Ay(t)}catch(h){_t(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 u1(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 d1(e){for(;ye!==null;){var t=ye;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Yh(4,t)}catch(c){_t(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(c){_t(t,i,c)}}var a=t.return;try{Ay(t)}catch(c){_t(t,a,c)}break;case 5:var o=t.return;try{Ay(t)}catch(c){_t(t,o,c)}}}catch(c){_t(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 I$=Math.ceil,Nf=Oi.ReactCurrentDispatcher,sx=Oi.ReactCurrentOwner,gr=Oi.ReactCurrentBatchConfig,We=0,Xt=null,Rt=null,sn=0,Xn=0,io=ga(0),Wt=0,$c=null,cs=0,Xh=0,ox=0,uc=null,Mn=null,lx=0,jo=1/0,hi=null,Ef=!1,Oy=null,sa=null,hd=!1,Zi=null,_f=0,dc=0,Py=null,Qd=-1,Jd=0;function An(){return We&6?Ct():Qd!==-1?Qd:Qd=Ct()}function oa(e){return e.mode&1?We&2&&sn!==0?sn&-sn:v$.transition!==null?(Jd===0&&(Jd=eA()),Jd):(e=Qe,e!==0||(e=window.event,e=e===void 0?16:oA(e.type)),e):1}function Mr(e,t,n,r){if(50<dc)throw dc=0,Py=null,Error(se(185));_u(e,n,r),(!(We&2)||e!==Xt)&&(e===Xt&&(!(We&2)&&(Xh|=n),Wt===4&&qi(e,sn)),Bn(e,r),n===1&&We===0&&!(t.mode&1)&&(jo=Ct()+500,qh&&ya()))}function Bn(e,t){var n=e.callbackNode;vI(e,t);var r=cf(e,e===Xt?sn:0);if(r===0)n!==null&&xw(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&xw(n),t===1)e.tag===0?y$(f1.bind(null,e)):_A(f1.bind(null,e)),h$(function(){!(We&6)&&ya()}),n=null;else{switch(tA(r)){case 1:n=Mb;break;case 4:n=Qj;break;case 16:n=lf;break;case 536870912:n=Jj;break;default:n=lf}n=NC(n,yC.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function yC(e,t){if(Qd=-1,Jd=0,We&6)throw Error(se(327));var n=e.callbackNode;if(go()&&e.callbackNode!==n)return null;var r=cf(e,e===Xt?sn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=jf(e,r);else{t=r;var i=We;We|=2;var a=bC();(Xt!==e||sn!==t)&&(hi=null,jo=Ct()+500,Qa(e,t));do try{D$();break}catch(l){vC(e,l)}while(!0);Kb(),Nf.current=a,We=i,Rt!==null?t=0:(Xt=null,sn=0,t=Wt)}if(t!==0){if(t===2&&(i=ay(e),i!==0&&(r=i,t=Ry(e,i))),t===1)throw n=$c,Qa(e,0),qi(e,r),Bn(e,Ct()),n;if(t===6)qi(e,r);else{if(i=e.current.alternate,!(r&30)&&!$$(i)&&(t=jf(e,r),t===2&&(a=ay(e),a!==0&&(r=a,t=Ry(e,a))),t===1))throw n=$c,Qa(e,0),qi(e,r),Bn(e,Ct()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(se(345));case 2:$a(e,Mn,hi);break;case 3:if(qi(e,r),(r&130023424)===r&&(t=lx+500-Ct(),10<t)){if(cf(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){An(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=hy($a.bind(null,e,Mn,hi),t);break}$a(e,Mn,hi);break;case 4:if(qi(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-Rr(r);a=1<<o,o=t[o],o>i&&(i=o),r&=~a}if(r=i,r=Ct()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*I$(r/1960))-r,10<r){e.timeoutHandle=hy($a.bind(null,e,Mn,hi),r);break}$a(e,Mn,hi);break;case 5:$a(e,Mn,hi);break;default:throw Error(se(329))}}}return Bn(e,Ct()),e.callbackNode===n?yC.bind(null,e):null}function Ry(e,t){var n=uc;return e.current.memoizedState.isDehydrated&&(Qa(e,t).flags|=256),e=jf(e,t),e!==2&&(t=Mn,Mn=n,t!==null&&My(t)),e}function My(e){Mn===null?Mn=e:Mn.push.apply(Mn,e)}function $$(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(!Dr(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 qi(e,t){for(t&=~ox,t&=~Xh,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Rr(t),r=1<<n;e[n]=-1,t&=~r}}function f1(e){if(We&6)throw Error(se(327));go();var t=cf(e,0);if(!(t&1))return Bn(e,Ct()),null;var n=jf(e,t);if(e.tag!==0&&n===2){var r=ay(e);r!==0&&(t=r,n=Ry(e,r))}if(n===1)throw n=$c,Qa(e,0),qi(e,t),Bn(e,Ct()),n;if(n===6)throw Error(se(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,$a(e,Mn,hi),Bn(e,Ct()),null}function cx(e,t){var n=We;We|=1;try{return e(t)}finally{We=n,We===0&&(jo=Ct()+500,qh&&ya())}}function us(e){Zi!==null&&Zi.tag===0&&!(We&6)&&go();var t=We;We|=1;var n=gr.transition,r=Qe;try{if(gr.transition=null,Qe=1,e)return e()}finally{Qe=r,gr.transition=n,We=t,!(We&6)&&ya()}}function ux(){Xn=io.current,yt(io)}function Qa(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,f$(n)),Rt!==null)for(n=Rt.return;n!==null;){var r=n;switch(Hb(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&pf();break;case 3:Eo(),yt(Ln),yt(bn),Jb();break;case 5:Qb(r);break;case 4:Eo();break;case 13:yt(xt);break;case 19:yt(xt);break;case 10:Vb(r.type._context);break;case 22:case 23:ux()}n=n.return}if(Xt=e,Rt=e=la(e.current,null),sn=Xn=t,Wt=0,$c=null,ox=Xh=cs=0,Mn=uc=null,Ga!==null){for(t=0;t<Ga.length;t++)if(n=Ga[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}Ga=null}return e}function vC(e,t){do{var n=Rt;try{if(Kb(),Yd.current=kf,Sf){for(var r=wt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Sf=!1}if(ls=0,Vt=Ut=wt=null,lc=!1,Rc=0,sx.current=null,n===null||n.return===null){Wt=1,$c=t,Rt=null;break}e:{var a=e,o=n.return,l=n,c=t;if(t=sn,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=Jw(o);if(p!==null){p.flags&=-257,e1(p,o,l,a,t),p.mode&1&&Qw(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)){Qw(a,u,t),dx();break e}c=Error(se(426))}}else if(vt&&l.mode&1){var v=Jw(o);if(v!==null){!(v.flags&65536)&&(v.flags|=256),e1(v,o,l,a,t),Gb(_o(c,l));break e}}a=c=_o(c,l),Wt!==4&&(Wt=2),uc===null?uc=[a]:uc.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var y=tC(a,c,t);qw(a,y);break e;case 1:l=c;var b=a.type,w=a.stateNode;if(!(a.flags&128)&&(typeof b.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(sa===null||!sa.has(w)))){a.flags|=65536,t&=-t,a.lanes|=t;var k=nC(a,l,t);qw(a,k);break e}}a=a.return}while(a!==null)}wC(n)}catch(S){t=S,Rt===n&&n!==null&&(Rt=n=n.return);continue}break}while(!0)}function bC(){var e=Nf.current;return Nf.current=kf,e===null?kf:e}function dx(){(Wt===0||Wt===3||Wt===2)&&(Wt=4),Xt===null||!(cs&268435455)&&!(Xh&268435455)||qi(Xt,sn)}function jf(e,t){var n=We;We|=2;var r=bC();(Xt!==e||sn!==t)&&(hi=null,Qa(e,t));do try{L$();break}catch(i){vC(e,i)}while(!0);if(Kb(),We=n,Nf.current=r,Rt!==null)throw Error(se(261));return Xt=null,sn=0,Wt}function L$(){for(;Rt!==null;)xC(Rt)}function D$(){for(;Rt!==null&&!cI();)xC(Rt)}function xC(e){var t=kC(e.alternate,e,Xn);e.memoizedProps=e.pendingProps,t===null?wC(e):Rt=t,sx.current=null}function wC(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=O$(n,t),n!==null){n.flags&=32767,Rt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Wt=6,Rt=null;return}}else if(n=T$(n,t,Xn),n!==null){Rt=n;return}if(t=t.sibling,t!==null){Rt=t;return}Rt=t=e}while(t!==null);Wt===0&&(Wt=5)}function $a(e,t,n){var r=Qe,i=gr.transition;try{gr.transition=null,Qe=1,B$(e,t,n,r)}finally{gr.transition=i,Qe=r}return null}function B$(e,t,n,r){do go();while(Zi!==null);if(We&6)throw Error(se(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(se(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(bI(e,a),e===Xt&&(Rt=Xt=null,sn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||hd||(hd=!0,NC(lf,function(){return go(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=gr.transition,gr.transition=null;var o=Qe;Qe=1;var l=We;We|=4,sx.current=null,R$(e,n),mC(n,e),a$(dy),uf=!!uy,dy=uy=null,e.current=n,M$(n),uI(),We=l,Qe=o,gr.transition=a}else e.current=n;if(hd&&(hd=!1,Zi=e,_f=i),a=e.pendingLanes,a===0&&(sa=null),hI(n.stateNode),Bn(e,Ct()),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(Ef)throw Ef=!1,e=Oy,Oy=null,e;return _f&1&&e.tag!==0&&go(),a=e.pendingLanes,a&1?e===Py?dc++:(dc=0,Py=e):dc=0,ya(),null}function go(){if(Zi!==null){var e=tA(_f),t=gr.transition,n=Qe;try{if(gr.transition=null,Qe=16>e?16:e,Zi===null)var r=!1;else{if(e=Zi,Zi=null,_f=0,We&6)throw Error(se(331));var i=We;for(We|=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:cc(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(fC(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:cc(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 w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,ye=w;else e:for(o=b;ye!==null;){if(l=ye,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Yh(9,l)}}catch(S){_t(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(We=i,ya(),Jr&&typeof Jr.onPostCommitFiberRoot=="function")try{Jr.onPostCommitFiberRoot(Fh,e)}catch{}r=!0}return r}finally{Qe=n,gr.transition=t}}return!1}function h1(e,t,n){t=_o(n,t),t=tC(e,t,1),e=aa(e,t,1),t=An(),e!==null&&(_u(e,1,t),Bn(e,t))}function _t(e,t,n){if(e.tag===3)h1(e,e,n);else for(;t!==null;){if(t.tag===3){h1(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(sa===null||!sa.has(r))){e=_o(n,e),e=nC(t,e,1),t=aa(t,e,1),e=An(),t!==null&&(_u(t,1,e),Bn(t,e));break}}t=t.return}}function z$(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=An(),e.pingedLanes|=e.suspendedLanes&n,Xt===e&&(sn&n)===n&&(Wt===4||Wt===3&&(sn&130023424)===sn&&500>Ct()-lx?Qa(e,0):ox|=n),Bn(e,t)}function SC(e,t){t===0&&(e.mode&1?(t=rd,rd<<=1,!(rd&130023424)&&(rd=4194304)):t=1);var n=An();e=_i(e,t),e!==null&&(_u(e,t,n),Bn(e,n))}function F$(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),SC(e,n)}function U$(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(se(314))}r!==null&&r.delete(t),SC(e,n)}var kC;kC=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ln.current)In=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return In=!1,C$(e,t,n);In=!!(e.flags&131072)}else In=!1,vt&&t.flags&1048576&&jA(t,yf,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Zd(e,t),e=t.pendingProps;var i=So(t,bn.current);mo(t,n),i=tx(null,t,r,e,i,n);var a=nx();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,Dn(r)?(a=!0,mf(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Xb(t),i.updater=Vh,t.stateNode=i,i._reactInternals=t,xy(t,r,e,n),t=ky(null,t,r,!0,a,n)):(t.tag=0,vt&&a&&Wb(t),En(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Zd(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=H$(r),e=jr(r,e),i){case 0:t=Sy(null,t,r,e,n);break e;case 1:t=r1(null,t,r,e,n);break e;case 11:t=t1(null,t,r,e,n);break e;case 14:t=n1(null,t,r,jr(r.type,e),n);break e}throw Error(se(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:jr(r,i),Sy(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:jr(r,i),r1(e,t,r,i,n);case 3:e:{if(sC(t),e===null)throw Error(se(387));r=t.pendingProps,a=t.memoizedState,i=a.element,RA(e,t),xf(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=_o(Error(se(423)),t),t=i1(e,t,r,n,i);break e}else if(r!==i){i=_o(Error(se(424)),t),t=i1(e,t,r,n,i);break e}else for(Jn=ia(t.stateNode.containerInfo.firstChild),er=t,vt=!0,Tr=null,n=OA(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ko(),r===i){t=ji(e,t,n);break e}En(e,t,r,n)}t=t.child}return t;case 5:return MA(t),e===null&&yy(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,fy(r,i)?o=null:a!==null&&fy(r,a)&&(t.flags|=32),aC(e,t),En(e,t,o,n),t.child;case 6:return e===null&&yy(t),null;case 13:return oC(e,t,n);case 4:return Zb(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=No(t,null,r,n):En(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:jr(r,i),t1(e,t,r,i,n);case 7:return En(e,t,t.pendingProps,n),t.child;case 8:return En(e,t,t.pendingProps.children,n),t.child;case 12:return En(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,dt(vf,r._currentValue),r._currentValue=o,a!==null)if(Dr(a.value,o)){if(a.children===i.children&&!Ln.current){t=ji(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=xi(-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),vy(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(se(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),vy(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}En(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,mo(t,n),i=vr(i),r=r(i),t.flags|=1,En(e,t,r,n),t.child;case 14:return r=t.type,i=jr(r,t.pendingProps),i=jr(r.type,i),n1(e,t,r,i,n);case 15:return rC(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:jr(r,i),Zd(e,t),t.tag=1,Dn(r)?(e=!0,mf(t)):e=!1,mo(t,n),eC(t,r,i),xy(t,r,i,n),ky(null,t,r,!0,e,n);case 19:return lC(e,t,n);case 22:return iC(e,t,n)}throw Error(se(156,t.tag))};function NC(e,t){return Zj(e,t)}function W$(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 pr(e,t,n,r){return new W$(e,t,n,r)}function fx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function H$(e){if(typeof e=="function")return fx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ob)return 11;if(e===Pb)return 14}return 2}function la(e,t){var n=e.alternate;return n===null?(n=pr(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 ef(e,t,n,r,i,a){var o=2;if(r=e,typeof e=="function")fx(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Vs:return Ja(n.children,i,a,t);case Tb:o=8,i|=8;break;case Hg:return e=pr(12,n,t,i|2),e.elementType=Hg,e.lanes=a,e;case Gg:return e=pr(13,n,t,i),e.elementType=Gg,e.lanes=a,e;case qg:return e=pr(19,n,t,i),e.elementType=qg,e.lanes=a,e;case Mj:return Zh(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Pj:o=10;break e;case Rj:o=9;break e;case Ob:o=11;break e;case Pb:o=14;break e;case Ui:o=16,r=null;break e}throw Error(se(130,e==null?e:typeof e,""))}return t=pr(o,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Ja(e,t,n,r){return e=pr(7,e,r,t),e.lanes=n,e}function Zh(e,t,n,r){return e=pr(22,e,r,t),e.elementType=Mj,e.lanes=n,e.stateNode={isHidden:!1},e}function Rm(e,t,n){return e=pr(6,e,null,t),e.lanes=n,e}function Mm(e,t,n){return t=pr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function G$(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=pm(0),this.expirationTimes=pm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pm(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function hx(e,t,n,r,i,a,o,l,c){return e=new G$(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=pr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Xb(a),e}function q$(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ks,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function EC(e){if(!e)return ha;e=e._reactInternals;e:{if(vs(e)!==e||e.tag!==1)throw Error(se(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Dn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(se(171))}if(e.tag===1){var n=e.type;if(Dn(n))return EA(e,n,t)}return t}function _C(e,t,n,r,i,a,o,l,c){return e=hx(n,r,!0,e,i,a,o,l,c),e.context=EC(null),n=e.current,r=An(),i=oa(n),a=xi(r,i),a.callback=t??null,aa(n,a,i),e.current.lanes=i,_u(e,i,r),Bn(e,r),e}function Qh(e,t,n,r){var i=t.current,a=An(),o=oa(i);return n=EC(n),t.context===null?t.context=n:t.pendingContext=n,t=xi(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=aa(i,t,o),e!==null&&(Mr(e,i,o,a),Vd(e,i,o)),o}function Af(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 p1(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function px(e,t){p1(e,t),(e=e.alternate)&&p1(e,t)}function K$(){return null}var jC=typeof reportError=="function"?reportError:function(e){console.error(e)};function mx(e){this._internalRoot=e}Jh.prototype.render=mx.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(se(409));Qh(e,t,null,null)};Jh.prototype.unmount=mx.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;us(function(){Qh(null,e,null,null)}),t[Ei]=null}};function Jh(e){this._internalRoot=e}Jh.prototype.unstable_scheduleHydration=function(e){if(e){var t=iA();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Gi.length&&t!==0&&t<Gi[n].priority;n++);Gi.splice(n,0,e),n===0&&sA(e)}};function gx(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ep(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function m1(){}function V$(e,t,n,r,i){if(i){if(typeof r=="function"){var a=r;r=function(){var u=Af(o);a.call(u)}}var o=_C(t,r,e,0,null,!1,!1,"",m1);return e._reactRootContainer=o,e[Ei]=o.current,Ac(e.nodeType===8?e.parentNode:e),us(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var u=Af(c);l.call(u)}}var c=hx(e,0,!1,null,null,!1,!1,"",m1);return e._reactRootContainer=c,e[Ei]=c.current,Ac(e.nodeType===8?e.parentNode:e),us(function(){Qh(t,c,n,r)}),c}function tp(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=Af(o);l.call(c)}}Qh(t,o,e,i)}else o=V$(n,t,e,i,r);return Af(o)}nA=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Jl(t.pendingLanes);n!==0&&(Ib(t,n|1),Bn(t,Ct()),!(We&6)&&(jo=Ct()+500,ya()))}break;case 13:us(function(){var r=_i(e,1);if(r!==null){var i=An();Mr(r,e,1,i)}}),px(e,1)}};$b=function(e){if(e.tag===13){var t=_i(e,134217728);if(t!==null){var n=An();Mr(t,e,134217728,n)}px(e,134217728)}};rA=function(e){if(e.tag===13){var t=oa(e),n=_i(e,t);if(n!==null){var r=An();Mr(n,e,t,r)}px(e,t)}};iA=function(){return Qe};aA=function(e,t){var n=Qe;try{return Qe=e,t()}finally{Qe=n}};ny=function(e,t,n){switch(t){case"input":if(Yg(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=Gh(r);if(!i)throw Error(se(90));$j(r),Yg(r,i)}}}break;case"textarea":Dj(e,n);break;case"select":t=n.value,t!=null&&uo(e,!!n.multiple,t,!1)}};Gj=cx;qj=us;var Y$={usingClientEntryPoint:!1,Events:[Au,Qs,Gh,Wj,Hj,cx]},$l={findFiberByHostInstance:Ha,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},X$={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:Oi.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Yj(e),e===null?null:e.stateNode},findFiberByHostInstance:$l.findFiberByHostInstance||K$,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 pd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pd.isDisabled&&pd.supportsFiber)try{Fh=pd.inject(X$),Jr=pd}catch{}}ir.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y$;ir.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!gx(t))throw Error(se(200));return q$(e,t,null,n)};ir.createRoot=function(e,t){if(!gx(e))throw Error(se(299));var n=!1,r="",i=jC;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=hx(e,1,!1,null,null,n,!1,r,i),e[Ei]=t.current,Ac(e.nodeType===8?e.parentNode:e),new mx(t)};ir.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(se(188)):(e=Object.keys(e).join(","),Error(se(268,e)));return e=Yj(t),e=e===null?null:e.stateNode,e};ir.flushSync=function(e){return us(e)};ir.hydrate=function(e,t,n){if(!ep(t))throw Error(se(200));return tp(null,e,t,!0,n)};ir.hydrateRoot=function(e,t,n){if(!gx(e))throw Error(se(405));var r=n!=null&&n.hydratedSources||null,i=!1,a="",o=jC;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=_C(t,null,e,1,n??null,i,!1,a,o),e[Ei]=t.current,Ac(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 Jh(t)};ir.render=function(e,t,n){if(!ep(t))throw Error(se(200));return tp(null,e,t,!1,n)};ir.unmountComponentAtNode=function(e){if(!ep(e))throw Error(se(40));return e._reactRootContainer?(us(function(){tp(null,null,e,!1,function(){e._reactRootContainer=null,e[Ei]=null})}),!0):!1};ir.unstable_batchedUpdates=cx;ir.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!ep(n))throw Error(se(200));if(e==null||e._reactInternals===void 0)throw Error(se(38));return tp(e,t,n,!1,r)};ir.version="18.3.1-next-f1338f8080-20240426";function AC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(AC)}catch(e){console.error(e)}}AC(),Aj.exports=ir;var Z$=Aj.exports,CC,g1=Z$;CC=g1.createRoot,g1.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 Lc(){return Lc=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},Lc.apply(null,arguments)}var Qi;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Qi||(Qi={}));const y1="popstate";function Q$(e){e===void 0&&(e={});function t(r,i){let{pathname:a,search:o,hash:l}=r.location;return Iy("",{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:Cf(i)}return eL(t,n,null,e)}function St(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function yx(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function J$(){return Math.random().toString(36).substr(2,8)}function v1(e,t){return{usr:e.state,key:e.key,idx:t}}function Iy(e,t,n,r){return n===void 0&&(n=null),Lc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?tl(t):t,{state:n,key:t&&t.key||r||J$()})}function Cf(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 tl(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 eL(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,l=Qi.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(Lc({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){l=Qi.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=Qi.Push;let b=Iy(m.location,v,y);u=d()+1;let w=v1(b,u),k=m.createHref(b);try{o.pushState(w,"",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=Qi.Replace;let b=Iy(m.location,v,y);u=d();let w=v1(b,u),k=m.createHref(b);o.replaceState(w,"",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:Cf(v);return b=b.replace(/ $/,"%20"),St(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(y1,f),c=v,()=>{i.removeEventListener(y1,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 b1;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(b1||(b1={}));function tL(e,t,n){return n===void 0&&(n="/"),nL(e,t,n)}function nL(e,t,n,r){let i=typeof t=="string"?tl(t):t,a=Ao(i.pathname||"/",n);if(a==null)return null;let o=TC(e);rL(o);let l=null,c=pL(a);for(let u=0;l==null&&u<o.length;++u)l=fL(o[u],c);return l}function TC(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("/")&&(St(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=ca([r,c.relativePath]),d=n.concat(c);a.children&&a.children.length>0&&(St(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),TC(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:uL(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 OC(a.path))i(a,o,c)}),t}function OC(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=OC(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 rL(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:dL(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const iL=/^:[\w-]+$/,aL=3,sL=2,oL=1,lL=10,cL=-2,x1=e=>e==="*";function uL(e,t){let n=e.split("/"),r=n.length;return n.some(x1)&&(r+=cL),t&&(r+=sL),n.filter(i=>!x1(i)).reduce((i,a)=>i+(iL.test(a)?aL:a===""?oL:lL),r)}function dL(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 fL(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=$y({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:ca([a,f.pathname]),pathnameBase:bL(ca([a,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(a=ca([a,f.pathnameBase]))}return o}function $y(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=hL(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 hL(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),yx(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 pL(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return yx(!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 Ao(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 mL=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gL=e=>mL.test(e);function yL(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?tl(e):e,a;if(n)if(gL(n))a=n;else{if(n.includes("//")){let o=n;n=PC(n),yx(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?a=w1(n.substring(1),"/"):a=w1(n,t)}else a=t;return{pathname:a,search:xL(r),hash:wL(i)}}function w1(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 Im(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 vL(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function vx(e,t){let n=vL(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function bx(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=tl(e):(i=Lc({},e),St(!i.pathname||!i.pathname.includes("?"),Im("?","pathname","search",i)),St(!i.pathname||!i.pathname.includes("#"),Im("#","pathname","hash",i)),St(!i.search||!i.search.includes("#"),Im("#","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=yL(i,l),u=o&&o!=="/"&&o.endsWith("/"),d=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const PC=e=>e.replace(/\/\/+/g,"/"),ca=e=>PC(e.join("/")),bL=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),xL=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,wL=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function SL(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const RC=["post","put","patch","delete"];new Set(RC);const kL=["get",...RC];new Set(kL);/**
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 Dc(){return Dc=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},Dc.apply(null,arguments)}const np=N.createContext(null),MC=N.createContext(null),Pi=N.createContext(null),rp=N.createContext(null),va=N.createContext({outlet:null,matches:[],isDataRoute:!1}),IC=N.createContext(null);function NL(e,t){let{relative:n}=t===void 0?{}:t;nl()||St(!1);let{basename:r,navigator:i}=N.useContext(Pi),{hash:a,pathname:o,search:l}=ip(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:ca([r,o])),i.createHref({pathname:c,search:l,hash:a})}function nl(){return N.useContext(rp)!=null}function rl(){return nl()||St(!1),N.useContext(rp).location}function $C(e){N.useContext(Pi).static||N.useLayoutEffect(e)}function LC(){let{isDataRoute:e}=N.useContext(va);return e?LL():EL()}function EL(){nl()||St(!1);let e=N.useContext(np),{basename:t,future:n,navigator:r}=N.useContext(Pi),{matches:i}=N.useContext(va),{pathname:a}=rl(),o=JSON.stringify(vx(i,n.v7_relativeSplatPath)),l=N.useRef(!1);return $C(()=>{l.current=!0}),N.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=bx(u,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:ca([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,a,e])}function ip(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=N.useContext(Pi),{matches:i}=N.useContext(va),{pathname:a}=rl(),o=JSON.stringify(vx(i,r.v7_relativeSplatPath));return N.useMemo(()=>bx(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function _L(e,t){return jL(e,t)}function jL(e,t,n,r){nl()||St(!1);let{navigator:i}=N.useContext(Pi),{matches:a}=N.useContext(va),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=rl(),d;if(t){var f;let v=typeof t=="string"?tl(t):t;c==="/"||(f=v.pathname)!=null&&f.startsWith(c)||St(!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=tL(e,{pathname:p}),m=PL(g&&g.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:ca([c,i.encodeLocation?i.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:ca([c,i.encodeLocation?i.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),a,n,r);return t&&m?N.createElement(rp.Provider,{value:{location:Dc({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Qi.Pop}},m):m}function AL(){let e=$L(),t=SL(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 N.createElement(N.Fragment,null,N.createElement("h2",null,"Unexpected Application Error!"),N.createElement("h3",{style:{fontStyle:"italic"}},t),n?N.createElement("pre",{style:i},n):null,null)}const CL=N.createElement(AL,null);class TL extends N.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?N.createElement(va.Provider,{value:this.props.routeContext},N.createElement(IC.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function OL(e){let{routeContext:t,match:n,children:r}=e,i=N.useContext(np);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),N.createElement(va.Provider,{value:t},r)}function PL(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||St(!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||CL,c&&(u<0&&h===0?(DL("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 w;return p?w=m:g?w=v:f.route.Component?w=N.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,N.createElement(OL,{match:f,routeContext:{outlet:d,matches:y,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?N.createElement(TL,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:b(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):b()},null)}var DC=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(DC||{}),BC=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}(BC||{});function RL(e){let t=N.useContext(np);return t||St(!1),t}function ML(e){let t=N.useContext(MC);return t||St(!1),t}function IL(e){let t=N.useContext(va);return t||St(!1),t}function zC(e){let t=IL(),n=t.matches[t.matches.length-1];return n.route.id||St(!1),n.route.id}function $L(){var e;let t=N.useContext(IC),n=ML(),r=zC();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function LL(){let{router:e}=RL(DC.UseNavigateStable),t=zC(BC.UseNavigateStable),n=N.useRef(!1);return $C(()=>{n.current=!0}),N.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Dc({fromRouteId:t},a)))},[e,t])}const S1={};function DL(e,t,n){S1[e]||(S1[e]=!0)}function BL(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function k1(e){let{to:t,replace:n,state:r,relative:i}=e;nl()||St(!1);let{future:a,static:o}=N.useContext(Pi),{matches:l}=N.useContext(va),{pathname:c}=rl(),u=LC(),d=bx(t,vx(l,a.v7_relativeSplatPath),c,i==="path"),f=JSON.stringify(d);return N.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:i}),[u,f,i,n,r]),null}function tt(e){St(!1)}function zL(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Qi.Pop,navigator:a,static:o=!1,future:l}=e;nl()&&St(!1);let c=t.replace(/^\/*/,"/"),u=N.useMemo(()=>({basename:c,navigator:a,static:o,future:Dc({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof r=="string"&&(r=tl(r));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:g="default"}=r,m=N.useMemo(()=>{let v=Ao(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:N.createElement(Pi.Provider,{value:u},N.createElement(rp.Provider,{children:n,value:m}))}function FL(e){let{children:t,location:n}=e;return _L(Ly(t),n)}new Promise(()=>{});function Ly(e,t){t===void 0&&(t=[]);let n=[];return N.Children.forEach(e,(r,i)=>{if(!N.isValidElement(r))return;let a=[...t,i];if(r.type===N.Fragment){n.push.apply(n,Ly(r.props.children,a));return}r.type!==tt&&St(!1),!r.props.index||!r.props.children||St(!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=Ly(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 Tf(){return Tf=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},Tf.apply(null,arguments)}function FC(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 UL(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function WL(e,t){return e.button===0&&(!t||t==="_self")&&!UL(e)}const HL=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],GL=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],qL="6";try{window.__reactRouterVersion=qL}catch{}const KL=N.createContext({isTransitioning:!1}),VL="startTransition",N1=z2[VL];function YL(e){let{basename:t,children:n,future:r,window:i}=e,a=N.useRef();a.current==null&&(a.current=Q$({window:i,v5Compat:!0}));let o=a.current,[l,c]=N.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=N.useCallback(f=>{u&&N1?N1(()=>c(f)):c(f)},[c,u]);return N.useLayoutEffect(()=>o.listen(d),[o,d]),N.useEffect(()=>BL(r),[r]),N.createElement(zL,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const XL=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ZL=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Dy=N.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=FC(t,HL),{basename:p}=N.useContext(Pi),g,m=!1;if(typeof u=="string"&&ZL.test(u)&&(g=u,XL))try{let w=new URL(window.location.href),k=u.startsWith("//")?new URL(w.protocol+u):new URL(u),S=Ao(k.pathname,p);k.origin===w.origin&&S!=null?u=S+k.search+k.hash:m=!0}catch{}let v=NL(u,{relative:i}),y=eD(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:i,viewTransition:f});function b(w){r&&r(w),w.defaultPrevented||y(w)}return N.createElement("a",Tf({},h,{href:g||v,onClick:m||a?r:b,ref:n,target:c}))}),QL=N.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=FC(t,GL),h=ip(c,{relative:f.relative}),p=rl(),g=N.useContext(MC),{navigator:m,basename:v}=N.useContext(Pi),y=g!=null&&tD(h)&&u===!0,b=m.encodeLocation?m.encodeLocation(h).pathname:h.pathname,w=p.pathname,k=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;i||(w=w.toLowerCase(),k=k?k.toLowerCase():null,b=b.toLowerCase()),k&&v&&(k=Ao(k,v)||k);const S=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let x=w===b||!o&&w.startsWith(b)&&w.charAt(S)==="/",E=k!=null&&(k===b||!o&&k.startsWith(b)&&k.charAt(b.length)==="/"),_={isActive:x,isPending:E,isTransitioning:y},C=x?r:void 0,T;typeof a=="function"?T=a(_):T=[a,x?"active":null,E?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let L=typeof l=="function"?l(_):l;return N.createElement(Dy,Tf({},f,{"aria-current":C,className:T,ref:n,style:L,to:c,viewTransition:u}),typeof d=="function"?d(_):d)});var By;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(By||(By={}));var E1;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(E1||(E1={}));function JL(e){let t=N.useContext(np);return t||St(!1),t}function eD(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=LC(),u=rl(),d=ip(e,{relative:o});return N.useCallback(f=>{if(WL(f,n)){f.preventDefault();let h=r!==void 0?r:Cf(u)===Cf(d);c(e,{replace:h,state:i,preventScrollReset:a,relative:o,viewTransition:l})}},[u,c,d,r,i,n,e,a,o,l])}function tD(e,t){t===void 0&&(t={});let n=N.useContext(KL);n==null&&St(!1);let{basename:r}=JL(By.useViewTransitionState),i=ip(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=Ao(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Ao(n.nextLocation.pathname,r)||n.nextLocation.pathname;return $y(i.pathname,o)!=null||$y(i.pathname,a)!=null}async function ur(e){if(!e.ok)return null;const t=e.headers.get("content-type")||"";if(!t.includes("application/json")&&!t.includes("text/json"))return t.includes("text/html")&&console.warn(`[dashboard] GET ${e.url||"/api/*"} returned HTML (${e.status}) instead of JSON โ€” the dashboard server may be an older version. Stop it and start it again (agent-nuvira dashboard stop, or Ctrl+C in its terminal).`),null;try{return await e.json()}catch{return null}}const ao="buff-dashboard-admin-token";function UC(){try{if(typeof window<"u"&&window.localStorage)return window.localStorage}catch{}return null}function nD(e){if(!e||typeof e!="object")return!1;const t=e,n=t.diff;return typeof t.dir=="string"&&typeof t.base=="string"&&typeof t.removed=="boolean"&&!!n&&typeof n=="object"&&Array.isArray(n.files)&&n.files.every(r=>typeof r=="string")&&typeof n.summary=="string"&&!!n.payload&&typeof n.payload=="object"&&typeof n.payload.summary=="string"&&Array.isArray(n.payload.files)&&n.payload.files.every(r=>!!r&&typeof r.path=="string"&&typeof r.body=="string")}function rD(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.id=="string"&&typeof t.replayed=="number"&&typeof t.modelCalls=="number"&&typeof t.saved=="boolean"&&typeof t.notice=="string"}const zy=new Map;function iD(){const e=UC();if(e)try{const t=e.getItem(ao);if(t)return t}catch{}return zy.get(ao)??null}function aD(e){const t=UC();if(t)try{e?t.setItem(ao,e):t.removeItem(ao);return}catch{}e?zy.set(ao,e):zy.delete(ao)}function tn(){return iD()}function $m(e){aD(e)}function kn(){const e=tn();return e?{Authorization:`Bearer ${e}`}:{}}class sD{constructor(t=""){Hr(this,"sse",null);Hr(this,"listeners",new Set);Hr(this,"connectionListeners",new Set);Hr(this,"dagListeners",new Set);Hr(this,"typingListeners",new Set);Hr(this,"chatRetryListeners",new Set);Hr(this,"reconnectTimer",null);Hr(this,"baseUrl");Hr(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 ur(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 ur(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 ur(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 ur(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 ur(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 ur(n);return r&&Array.isArray(r.steps)?r:null}catch{return null}}async sendAdminRequest(t,n,r){try{const i=tn(),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,mustChangePassword:n.mustChangePassword===!0}}async changeAdminPassword(t,n){const r=await this.sendAdminRequest("/api/admin/change-password","POST",{currentPassword:t,newPassword:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const i=r.data??{};return r.status===200&&i.ok?{ok:!0}:{ok:!1,error:i.error||"Could not change the password."}}async fetchAdminUsers(){const t=await this.sendAdminRequest("/api/admin/users","GET");if(!t)return{ok:!1,error:"Could not reach the dashboard server."};const n=t.data??{};return t.status===200&&n.ok&&Array.isArray(n.users)?n:{ok:!1,error:n.error||"Failed to load users.",forbidden:t.status===403,unauthorized:t.status===401}}async addAdminUser(t,n,r){const 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"?($m(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"?($m(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"),$m(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:kn()})).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",...kn()},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",...kn()},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=tn(),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=tn(),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=tn(),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=tn();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=tn();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=tn();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=tn();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=tn();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=tn();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=tn();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=tn();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=tn();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=tn();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,...(r==null?void 0:r.worktree)===void 0?{}:{worktree:r.worktree},...(r==null?void 0:r.keepWorktree)===void 0?{}:{keepWorktree:r.keepWorktree},...(r==null?void 0:r.resume)===void 0?{}:{resume:r.resume}}),signal: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,...l.refused===!0?{refused:!0}:{},...nD(l.worktree)?{worktree:l.worktree}:{},...rD(l.resume)?{resume:l.resume}:{},...Array.isArray(l.findings)?{findings:l.findings}:{}}:{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."}}async chatSupportBundle(t){var r,i,a;const n=tn();try{const o=await fetch(`${this.baseUrl}/api/chat/${encodeURIComponent(t)}/support-bundle`,{method:"GET",headers:{...n?{Authorization:`Bearer ${n}`}:{}},signal:AbortSignal.timeout(3e4)});if(o.status===200&&((r=o.headers.get("content-type"))!=null&&r.includes("application/zip"))){const c=await o.blob(),u=URL.createObjectURL(c),d=document.createElement("a");return d.href=u,d.download=((a=(i=o.headers.get("content-disposition"))==null?void 0:i.match(/filename="(.+)"/))==null?void 0:a[1])||"nuvira-support.zip",document.body.appendChild(d),d.click(),document.body.removeChild(d),URL.revokeObjectURL(u),{ok:!0}}return{ok:!1,error:(await o.json().catch(()=>({}))).error||"Could not build the support bundle."}}catch(o){return{ok:!1,error:o instanceof Error?o.message:"Could not reach the dashboard server."}}}subscribeChat(t,n){const r=tn(),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("finding",a=>{var o;try{const c=JSON.parse(a.data).finding;c&&typeof c.claim=="string"&&(c.verdict==="CONFIRMED"||c.verdict==="PLAUSIBLE")&&((o=n.onFinding)==null||o.call(n,{claim:c.claim,verdict:c.verdict,outcome:typeof c.outcome=="string"?c.outcome:"",evidence:Array.isArray(c.evidence)?c.evidence:[],source:typeof c.source=="string"?c.source:""}))}catch{}}),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",...kn()},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:{...kn()}})).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:{...kn()}})).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",...kn()},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:{...kn()}}),n=await ur(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",...kn()},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",...kn()},body:JSON.stringify({name:t})})).json();return{ok:r.ok===!0,usable:r.usable,detail:r.detail,error:r.error}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async fetchProcessEnv(){try{const t=await fetch(`${this.baseUrl}/api/process-env`,{headers:{...kn()}}),n=await ur(t);return(n==null?void 0:n.vars)??[]}catch{return[]}}async fetchVerifyBacklog(){try{const t=await fetch(`${this.baseUrl}/api/models/verify-next`,{headers:{...kn()}});return await ur(t)}catch{return null}}async startVerifyBacklog(t){try{const n=await fetch(`${this.baseUrl}/api/models/verify-next`,{method:"POST",headers:{"Content-Type":"application/json",...kn()},body:JSON.stringify({count:t})}),r=await ur(n);return r?{ok:r.ok===!0,error:r.error,refusal:r.refusal,state:r.state}:{ok:!1,error:"The dashboard server did not respond."}}catch(n){return{ok:!1,error:n instanceof Error?n.message:"Could not start the run."}}}async saveProcessEnvVar(t,n){try{const i=await(await fetch(`${this.baseUrl}/api/process-env`,{method:"POST",headers:{"Content-Type":"application/json",...kn()},body:JSON.stringify({name:t,value:n})})).json();return{ok:i.ok===!0,row:i.row,error:i.error,reason:i.reason}}catch(r){return{ok:!1,error:r instanceof Error?r.message:String(r)}}}async deleteProcessEnvVar(t){try{const r=await(await fetch(`${this.baseUrl}/api/process-env/delete`,{method:"POST",headers:{"Content-Type":"application/json",...kn()},body:JSON.stringify({name:t})})).json();return{ok:r.ok===!0,removed:r.removed,row:r.row,error:r.error}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}}const J=new sD,oD=[{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:"/process-env",label:"Process Env",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 lD({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:oD.map(a=>s.jsxs(QL,{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 WC(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=WC(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ve(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=WC(e))&&(r&&(r+=" "),r+=t);return r}var cD=Array.isArray,zn=cD,uD=typeof Yi=="object"&&Yi&&Yi.Object===Object&&Yi,HC=uD,dD=HC,fD=typeof self=="object"&&self&&self.Object===Object&&self,hD=dD||fD||Function("return this")(),ai=hD,pD=ai,mD=pD.Symbol,Tu=mD,_1=Tu,GC=Object.prototype,gD=GC.hasOwnProperty,yD=GC.toString,Ll=_1?_1.toStringTag:void 0;function vD(e){var t=gD.call(e,Ll),n=e[Ll];try{e[Ll]=void 0;var r=!0}catch{}var i=yD.call(e);return r&&(t?e[Ll]=n:delete e[Ll]),i}var bD=vD,xD=Object.prototype,wD=xD.toString;function SD(e){return wD.call(e)}var kD=SD,j1=Tu,ND=bD,ED=kD,_D="[object Null]",jD="[object Undefined]",A1=j1?j1.toStringTag:void 0;function AD(e){return e==null?e===void 0?jD:_D:A1&&A1 in Object(e)?ND(e):ED(e)}var Ri=AD;function CD(e){return e!=null&&typeof e=="object"}var Mi=CD,TD=Ri,OD=Mi,PD="[object Symbol]";function RD(e){return typeof e=="symbol"||OD(e)&&TD(e)==PD}var il=RD,MD=zn,ID=il,$D=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,LD=/^\w*$/;function DD(e,t){if(MD(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||ID(e)?!0:LD.test(e)||!$D.test(e)||t!=null&&e in Object(t)}var xx=DD;function BD(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ba=BD;const al=Ze(ba);var zD=Ri,FD=ba,UD="[object AsyncFunction]",WD="[object Function]",HD="[object GeneratorFunction]",GD="[object Proxy]";function qD(e){if(!FD(e))return!1;var t=zD(e);return t==WD||t==HD||t==UD||t==GD}var wx=qD;const Le=Ze(wx);var KD=ai,VD=KD["__core-js_shared__"],YD=VD,Lm=YD,C1=function(){var e=/[^.]+$/.exec(Lm&&Lm.keys&&Lm.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function XD(e){return!!C1&&C1 in e}var ZD=XD,QD=Function.prototype,JD=QD.toString;function eB(e){if(e!=null){try{return JD.call(e)}catch{}try{return e+""}catch{}}return""}var qC=eB,tB=wx,nB=ZD,rB=ba,iB=qC,aB=/[\\^$.*+?()[\]{}|]/g,sB=/^\[object .+?Constructor\]$/,oB=Function.prototype,lB=Object.prototype,cB=oB.toString,uB=lB.hasOwnProperty,dB=RegExp("^"+cB.call(uB).replace(aB,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function fB(e){if(!rB(e)||nB(e))return!1;var t=tB(e)?dB:sB;return t.test(iB(e))}var hB=fB;function pB(e,t){return e==null?void 0:e[t]}var mB=pB,gB=hB,yB=mB;function vB(e,t){var n=yB(e,t);return gB(n)?n:void 0}var bs=vB,bB=bs,xB=bB(Object,"create"),ap=xB,T1=ap;function wB(){this.__data__=T1?T1(null):{},this.size=0}var SB=wB;function kB(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var NB=kB,EB=ap,_B="__lodash_hash_undefined__",jB=Object.prototype,AB=jB.hasOwnProperty;function CB(e){var t=this.__data__;if(EB){var n=t[e];return n===_B?void 0:n}return AB.call(t,e)?t[e]:void 0}var TB=CB,OB=ap,PB=Object.prototype,RB=PB.hasOwnProperty;function MB(e){var t=this.__data__;return OB?t[e]!==void 0:RB.call(t,e)}var IB=MB,$B=ap,LB="__lodash_hash_undefined__";function DB(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=$B&&t===void 0?LB:t,this}var BB=DB,zB=SB,FB=NB,UB=TB,WB=IB,HB=BB;function sl(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])}}sl.prototype.clear=zB;sl.prototype.delete=FB;sl.prototype.get=UB;sl.prototype.has=WB;sl.prototype.set=HB;var GB=sl;function qB(){this.__data__=[],this.size=0}var KB=qB;function VB(e,t){return e===t||e!==e&&t!==t}var Sx=VB,YB=Sx;function XB(e,t){for(var n=e.length;n--;)if(YB(e[n][0],t))return n;return-1}var sp=XB,ZB=sp,QB=Array.prototype,JB=QB.splice;function ez(e){var t=this.__data__,n=ZB(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():JB.call(t,n,1),--this.size,!0}var tz=ez,nz=sp;function rz(e){var t=this.__data__,n=nz(t,e);return n<0?void 0:t[n][1]}var iz=rz,az=sp;function sz(e){return az(this.__data__,e)>-1}var oz=sz,lz=sp;function cz(e,t){var n=this.__data__,r=lz(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var uz=cz,dz=KB,fz=tz,hz=iz,pz=oz,mz=uz;function ol(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])}}ol.prototype.clear=dz;ol.prototype.delete=fz;ol.prototype.get=hz;ol.prototype.has=pz;ol.prototype.set=mz;var op=ol,gz=bs,yz=ai,vz=gz(yz,"Map"),kx=vz,O1=GB,bz=op,xz=kx;function wz(){this.size=0,this.__data__={hash:new O1,map:new(xz||bz),string:new O1}}var Sz=wz;function kz(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var Nz=kz,Ez=Nz;function _z(e,t){var n=e.__data__;return Ez(t)?n[typeof t=="string"?"string":"hash"]:n.map}var lp=_z,jz=lp;function Az(e){var t=jz(this,e).delete(e);return this.size-=t?1:0,t}var Cz=Az,Tz=lp;function Oz(e){return Tz(this,e).get(e)}var Pz=Oz,Rz=lp;function Mz(e){return Rz(this,e).has(e)}var Iz=Mz,$z=lp;function Lz(e,t){var n=$z(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var Dz=Lz,Bz=Sz,zz=Cz,Fz=Pz,Uz=Iz,Wz=Dz;function ll(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])}}ll.prototype.clear=Bz;ll.prototype.delete=zz;ll.prototype.get=Fz;ll.prototype.has=Uz;ll.prototype.set=Wz;var Nx=ll,KC=Nx,Hz="Expected a function";function Ex(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Hz);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(Ex.Cache||KC),n}Ex.Cache=KC;var VC=Ex;const Gz=Ze(VC);var qz=VC,Kz=500;function Vz(e){var t=qz(e,function(r){return n.size===Kz&&n.clear(),r}),n=t.cache;return t}var Yz=Vz,Xz=Yz,Zz=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qz=/\\(\\)?/g,Jz=Xz(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Zz,function(n,r,i,a){t.push(i?a.replace(Qz,"$1"):r||n)}),t}),e3=Jz;function t3(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 _x=t3,P1=Tu,n3=_x,r3=zn,i3=il,R1=P1?P1.prototype:void 0,M1=R1?R1.toString:void 0;function YC(e){if(typeof e=="string")return e;if(r3(e))return n3(e,YC)+"";if(i3(e))return M1?M1.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var a3=YC,s3=a3;function o3(e){return e==null?"":s3(e)}var XC=o3,l3=zn,c3=xx,u3=e3,d3=XC;function f3(e,t){return l3(e)?e:c3(e,t)?[e]:u3(d3(e))}var ZC=f3,h3=il;function p3(e){if(typeof e=="string"||h3(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var cp=p3,m3=ZC,g3=cp;function y3(e,t){t=m3(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[g3(t[n++])];return n&&n==r?e:void 0}var jx=y3,v3=jx;function b3(e,t,n){var r=e==null?void 0:v3(e,t);return r===void 0?n:r}var QC=b3;const yr=Ze(QC);function x3(e){return e==null}var w3=x3;const Ye=Ze(w3);var S3=Ri,k3=zn,N3=Mi,E3="[object String]";function _3(e){return typeof e=="string"||!k3(e)&&N3(e)&&S3(e)==E3}var j3=_3;const ds=Ze(j3);var JC={exports:{}},Je={};/**
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 Ax=Symbol.for("react.element"),Cx=Symbol.for("react.portal"),up=Symbol.for("react.fragment"),dp=Symbol.for("react.strict_mode"),fp=Symbol.for("react.profiler"),hp=Symbol.for("react.provider"),pp=Symbol.for("react.context"),A3=Symbol.for("react.server_context"),mp=Symbol.for("react.forward_ref"),gp=Symbol.for("react.suspense"),yp=Symbol.for("react.suspense_list"),vp=Symbol.for("react.memo"),bp=Symbol.for("react.lazy"),C3=Symbol.for("react.offscreen"),eT;eT=Symbol.for("react.module.reference");function wr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Ax:switch(e=e.type,e){case up:case fp:case dp:case gp:case yp:return e;default:switch(e=e&&e.$$typeof,e){case A3:case pp:case mp:case bp:case vp:case hp:return e;default:return t}}case Cx:return t}}}Je.ContextConsumer=pp;Je.ContextProvider=hp;Je.Element=Ax;Je.ForwardRef=mp;Je.Fragment=up;Je.Lazy=bp;Je.Memo=vp;Je.Portal=Cx;Je.Profiler=fp;Je.StrictMode=dp;Je.Suspense=gp;Je.SuspenseList=yp;Je.isAsyncMode=function(){return!1};Je.isConcurrentMode=function(){return!1};Je.isContextConsumer=function(e){return wr(e)===pp};Je.isContextProvider=function(e){return wr(e)===hp};Je.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ax};Je.isForwardRef=function(e){return wr(e)===mp};Je.isFragment=function(e){return wr(e)===up};Je.isLazy=function(e){return wr(e)===bp};Je.isMemo=function(e){return wr(e)===vp};Je.isPortal=function(e){return wr(e)===Cx};Je.isProfiler=function(e){return wr(e)===fp};Je.isStrictMode=function(e){return wr(e)===dp};Je.isSuspense=function(e){return wr(e)===gp};Je.isSuspenseList=function(e){return wr(e)===yp};Je.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===up||e===fp||e===dp||e===gp||e===yp||e===C3||typeof e=="object"&&e!==null&&(e.$$typeof===bp||e.$$typeof===vp||e.$$typeof===hp||e.$$typeof===pp||e.$$typeof===mp||e.$$typeof===eT||e.getModuleId!==void 0)};Je.typeOf=wr;JC.exports=Je;var T3=JC.exports,O3=Ri,P3=Mi,R3="[object Number]";function M3(e){return typeof e=="number"||P3(e)&&O3(e)==R3}var tT=M3;const I3=Ze(tT);var $3=tT;function L3(e){return $3(e)&&e!=+e}var D3=L3;const Ou=Ze(D3);var Pr=function(t){return t===0?0:t>0?1:-1},Ka=function(t){return ds(t)&&t.indexOf("%")===t.length-1},de=function(t){return I3(t)&&!Ou(t)},B3=function(t){return Ye(t)},Ht=function(t){return de(t)||ds(t)},z3=0,xp=function(t){var n=++z3;return"".concat(t||"").concat(n)},fs=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(!de(t)&&!ds(t))return r;var a;if(Ka(t)){var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return Ou(a)&&(a=r),i&&a>n&&(a=n),a},Ki=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},F3=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},Ls=function(t,n){return de(t)&&de(n)?function(r){return t+r*(n-t)}:function(){return n}};function Fy(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):yr(r,t))===n})}var U3=function(t,n){return de(t)&&de(n)?t-n:ds(t)&&ds(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function yo(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 Uy(e){"@babel/helpers - typeof";return Uy=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},Uy(e)}var W3=["viewBox","children"],H3=["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"],I1=["points","pathLength"],Dm={svg:W3,polygon:I1,polyline:I1},Tx=["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"],Of=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(N.isValidElement(t)&&(r=t.props),!al(r))return null;var i={};return Object.keys(r).forEach(function(a){Tx.includes(a)&&(i[a]=n||function(o){return r[a](r,o)})}),i},G3=function(t,n,r){return function(i){return t(n,r,i),null}},Pf=function(t,n,r){if(!al(t)||Uy(t)!=="object")return null;var i=null;return Object.keys(t).forEach(function(a){var o=t[a];Tx.includes(a)&&typeof o=="function"&&(i||(i={}),i[a]=G3(o,n,r))}),i},q3=["children"],K3=["children"];function $1(e,t){if(e==null)return{};var n=V3(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 V3(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 L1={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"},wi=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},D1=null,Bm=null,Ox=function e(t){if(t===D1&&Array.isArray(Bm))return Bm;var n=[];return N.Children.forEach(t,function(r){Ye(r)||(T3.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),Bm=n,D1=t,n};function Ir(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return wi(i)}):r=[wi(t)],Ox(e).forEach(function(i){var a=yr(i,"type.displayName")||yr(i,"type.name");r.indexOf(a)!==-1&&n.push(i)}),n}function Zn(e,t){var n=Ir(e,t);return n&&n[0]}var B1=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!de(r)||r<=0||!de(i)||i<=0)},Y3=["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"],X3=function(t){return t&&t.type&&ds(t.type)&&Y3.indexOf(t.type)>=0},Z3=function(t,n,r,i){var a,o=(a=Dm==null?void 0:Dm[i])!==null&&a!==void 0?a:[];return n.startsWith("data-")||!Le(t)&&(i&&o.includes(n)||H3.includes(n))||r&&Tx.includes(n)},Ke=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(N.isValidElement(t)&&(i=t.props),!al(i))return null;var a={};return Object.keys(i).forEach(function(o){var l;Z3((l=i)===null||l===void 0?void 0:l[o],o,n,r)&&(a[o]=i[o])}),a},Wy=function e(t,n){if(t===n)return!0;var r=N.Children.count(t);if(r!==N.Children.count(n))return!1;if(r===0)return!0;if(r===1)return z1(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(!z1(a,o))return!1}return!0},z1=function(t,n){if(Ye(t)&&Ye(n))return!0;if(!Ye(t)&&!Ye(n)){var r=t.props||{},i=r.children,a=$1(r,q3),o=n.props||{},l=o.children,c=$1(o,K3);return i&&l?yo(a,c)&&Wy(i,l):!i&&!l?yo(a,c):!1}return!1},F1=function(t,n){var r=[],i={};return Ox(t).forEach(function(a,o){if(X3(a))r.push(a);else if(a){var l=wi(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},Q3=function(t){var n=t&&t.type;return n&&L1[n]?L1[n]:null},J3=function(t,n){return Ox(n).indexOf(t)},eF=["children","width","height","viewBox","className","style","title","desc"];function Hy(){return Hy=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},Hy.apply(this,arguments)}function tF(e,t){if(e==null)return{};var n=nF(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 nF(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 Gy(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=tF(e,eF),d=i||{width:n,height:r,x:0,y:0},f=Ve("recharts-surface",a);return H.createElement("svg",Hy({},Ke(u,!0,"svg"),{className:f,width:n,height:r,style:o,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),H.createElement("title",null,l),H.createElement("desc",null,c),t)}var rF=["children","className"];function qy(){return qy=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},qy.apply(this,arguments)}function iF(e,t){if(e==null)return{};var n=aF(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 aF(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=H.forwardRef(function(e,t){var n=e.children,r=e.className,i=iF(e,rF),a=Ve("recharts-layer",r);return H.createElement("g",qy({className:a},Ke(i,!0),{ref:t}),n)}),Si=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 sF(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 oF=sF,lF=oF;function cF(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:lF(e,t,n)}var uF=cF,dF="\\ud800-\\udfff",fF="\\u0300-\\u036f",hF="\\ufe20-\\ufe2f",pF="\\u20d0-\\u20ff",mF=fF+hF+pF,gF="\\ufe0e\\ufe0f",yF="\\u200d",vF=RegExp("["+yF+dF+mF+gF+"]");function bF(e){return vF.test(e)}var nT=bF;function xF(e){return e.split("")}var wF=xF,rT="\\ud800-\\udfff",SF="\\u0300-\\u036f",kF="\\ufe20-\\ufe2f",NF="\\u20d0-\\u20ff",EF=SF+kF+NF,_F="\\ufe0e\\ufe0f",jF="["+rT+"]",Ky="["+EF+"]",Vy="\\ud83c[\\udffb-\\udfff]",AF="(?:"+Ky+"|"+Vy+")",iT="[^"+rT+"]",aT="(?:\\ud83c[\\udde6-\\uddff]){2}",sT="[\\ud800-\\udbff][\\udc00-\\udfff]",CF="\\u200d",oT=AF+"?",lT="["+_F+"]?",TF="(?:"+CF+"(?:"+[iT,aT,sT].join("|")+")"+lT+oT+")*",OF=lT+oT+TF,PF="(?:"+[iT+Ky+"?",Ky,aT,sT,jF].join("|")+")",RF=RegExp(Vy+"(?="+Vy+")|"+PF+OF,"g");function MF(e){return e.match(RF)||[]}var IF=MF,$F=wF,LF=nT,DF=IF;function BF(e){return LF(e)?DF(e):$F(e)}var zF=BF,FF=uF,UF=nT,WF=zF,HF=XC;function GF(e){return function(t){t=HF(t);var n=UF(t)?WF(t):void 0,r=n?n[0]:t.charAt(0),i=n?FF(n,1).join(""):t.slice(1);return r[e]()+i}}var qF=GF,KF=qF,VF=KF("toUpperCase"),YF=VF;const wp=Ze(YF);function ut(e){return function(){return e}}const cT=Math.cos,Rf=Math.sin,Br=Math.sqrt,Mf=Math.PI,Sp=2*Mf,Yy=Math.PI,Xy=2*Yy,La=1e-6,XF=Xy-La;function uT(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function ZF(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return uT;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 QF{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?uT:ZF(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>La)if(!(Math.abs(f*c-u*d)>La)||!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),w=a*Math.tan((Yy-Math.acos((m+h-v)/(2*y*b)))/2),k=w/b,S=w/y;Math.abs(k-1)>La&&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)>La||Math.abs(this._y1-d)>La)&&this._append`L${u},${d}`,r&&(h<0&&(h=h%Xy+Xy),h>XF?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>La&&this._append`A${r},${r},0,${+(h>=Yy)},${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 Px(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 QF(t)}function Rx(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function dT(e){this._context=e}dT.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 kp(e){return new dT(e)}function fT(e){return e[0]}function hT(e){return e[1]}function pT(e,t){var n=ut(!0),r=null,i=kp,a=null,o=Px(l);e=typeof e=="function"?e:e===void 0?fT:ut(e),t=typeof t=="function"?t:t===void 0?hT:ut(t);function l(c){var u,d=(c=Rx(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:ut(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:ut(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:ut(!!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 md(e,t,n){var r=null,i=ut(!0),a=null,o=kp,l=null,c=Px(u);e=typeof e=="function"?e:e===void 0?fT:ut(+e),t=typeof t=="function"?t:ut(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?hT:ut(+n);function u(f){var h,p,g,m=(f=Rx(f)).length,v,y=!1,b,w=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(w[g],k[g]);l.lineEnd(),l.areaEnd()}y&&(w[h]=+e(v,h,f),k[h]=+t(v,h,f),l.point(r?+r(v,h,f):w[h],n?+n(v,h,f):k[h]))}if(b)return l=null,b+""||null}function d(){return pT().defined(i).curve(o).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:ut(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ut(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:ut(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:ut(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ut(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ut(+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:ut(!!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 mT{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 JF(e){return new mT(e,!0)}function e6(e){return new mT(e,!1)}const Mx={draw(e,t){const n=Br(t/Mf);e.moveTo(n,0),e.arc(0,0,n,0,Sp)}},t6={draw(e,t){const n=Br(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()}},gT=Br(1/3),n6=gT*2,r6={draw(e,t){const n=Br(t/n6),r=n*gT;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},i6={draw(e,t){const n=Br(t),r=-n/2;e.rect(r,r,n,n)}},a6=.8908130915292852,yT=Rf(Mf/10)/Rf(7*Mf/10),s6=Rf(Sp/10)*yT,o6=-cT(Sp/10)*yT,l6={draw(e,t){const n=Br(t*a6),r=s6*n,i=o6*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=Sp*a/5,l=cT(o),c=Rf(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*i,c*r+l*i)}e.closePath()}},zm=Br(3),c6={draw(e,t){const n=-Br(t/(zm*3));e.moveTo(0,n*2),e.lineTo(-zm*n,-n),e.lineTo(zm*n,-n),e.closePath()}},or=-.5,lr=Br(3)/2,Zy=1/Br(12),u6=(Zy/2+1)*3,d6={draw(e,t){const n=Br(t/u6),r=n/2,i=n*Zy,a=r,o=n*Zy+n,l=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(l,c),e.lineTo(or*r-lr*i,lr*r+or*i),e.lineTo(or*a-lr*o,lr*a+or*o),e.lineTo(or*l-lr*c,lr*l+or*c),e.lineTo(or*r+lr*i,or*i-lr*r),e.lineTo(or*a+lr*o,or*o-lr*a),e.lineTo(or*l+lr*c,or*c-lr*l),e.closePath()}};function f6(e,t){let n=null,r=Px(i);e=typeof e=="function"?e:ut(e||Mx),t=typeof t=="function"?t:ut(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:ut(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:ut(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function If(){}function $f(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 vT(e){this._context=e}vT.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:$f(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:$f(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function h6(e){return new vT(e)}function bT(e){this._context=e}bT.prototype={areaStart:If,areaEnd:If,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:$f(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function p6(e){return new bT(e)}function xT(e){this._context=e}xT.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:$f(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function m6(e){return new xT(e)}function wT(e){this._context=e}wT.prototype={areaStart:If,areaEnd:If,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 g6(e){return new wT(e)}function U1(e){return e<0?-1:1}function W1(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(U1(a)+U1(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function H1(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Fm(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 Lf(e){this._context=e}Lf.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:Fm(this,this._t0,H1(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,Fm(this,H1(this,n=W1(this,e,t)),n);break;default:Fm(this,this._t0,n=W1(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function ST(e){this._context=new kT(e)}(ST.prototype=Object.create(Lf.prototype)).point=function(e,t){Lf.prototype.point.call(this,t,e)};function kT(e){this._context=e}kT.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 y6(e){return new Lf(e)}function v6(e){return new ST(e)}function NT(e){this._context=e}NT.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=G1(e),i=G1(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 G1(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 b6(e){return new NT(e)}function Np(e,t){this._context=e,this._t=t}Np.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 x6(e){return new Np(e,.5)}function w6(e){return new Np(e,0)}function S6(e){return new Np(e,1)}function Co(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 Qy(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function k6(e,t){return e[t]}function N6(e){const t=[];return t.key=e,t}function E6(){var e=ut([]),t=Qy,n=Co,r=k6;function i(a){var o=Array.from(e.apply(this,arguments),N6),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=Rx(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:ut(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:ut(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?Qy:typeof a=="function"?a:ut(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??Co,i):n},i}function _6(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}Co(e,t)}}function j6(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}Co(e,t)}}function A6(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,Co(e,t)}}function Bc(e){"@babel/helpers - typeof";return Bc=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},Bc(e)}var C6=["type","size","sizeType"];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 q1(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 K1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?q1(Object(n),!0).forEach(function(r){T6(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function T6(e,t,n){return t=O6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O6(e){var t=P6(e,"string");return Bc(t)=="symbol"?t:t+""}function P6(e,t){if(Bc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function R6(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 ET={symbolCircle:Mx,symbolCross:t6,symbolDiamond:r6,symbolSquare:i6,symbolStar:l6,symbolTriangle:c6,symbolWye:d6},I6=Math.PI/180,$6=function(t){var n="symbol".concat(wp(t));return ET[n]||Mx},L6=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*I6;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}},D6=function(t,n){ET["symbol".concat(wp(t))]=n},Ix=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=R6(t,C6),u=K1(K1({},c),{},{type:r,size:a,sizeType:l}),d=function(){var v=$6(r),y=f6().type(v).size(L6(a,l,r));return y()},f=u.className,h=u.cx,p=u.cy,g=Ke(u,!0);return h===+h&&p===+p&&a===+a?H.createElement("path",Jy({},g,{className:Ve("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(p,")"),d:d()})):null};Ix.registerSymbol=D6;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)}function ev(){return ev=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},ev.apply(this,arguments)}function V1(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 B6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?V1(Object(n),!0).forEach(function(r){zc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function z6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F6(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,jT(r.key),r)}}function U6(e,t,n){return t&&F6(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function W6(e,t,n){return t=Df(t),H6(e,_T()?Reflect.construct(t,n||[],Df(e).constructor):t.apply(e,n))}function H6(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 G6(e)}function G6(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _T(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_T=function(){return!!e})()}function Df(e){return Df=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Df(e)}function q6(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 zc(e,t,n){return t=jT(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jT(e){var t=K6(e,"string");return To(t)=="symbol"?t:t+""}function K6(e,t){if(To(e)!="object"||!e)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 String(e)}var cr=32,$x=function(e){function t(){return z6(this,t),W6(this,t,arguments)}return q6(t,e),U6(t,[{key:"renderIcon",value:function(r){var i=this.props.inactiveColor,a=cr/2,o=cr/6,l=cr/3,c=r.inactive?i:r.color;if(r.type==="plainline")return H.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:a,x2:cr,y2:a,className:"recharts-legend-icon"});if(r.type==="line")return H.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(cr,"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 H.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(cr/8,"h").concat(cr,"v").concat(cr*3/4,"h").concat(-cr,"z"),className:"recharts-legend-icon"});if(H.isValidElement(r.legendIcon)){var u=B6({},r);return delete u.legendIcon,H.cloneElement(r.legendIcon,u)}return H.createElement(Ix,{fill:c,cx:a,cy:a,size:cr,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:cr,height:cr},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=Ve(zc(zc({"recharts-legend-item":!0},"legend-item-".concat(g),!0),"inactive",p.inactive));if(p.type==="none")return null;var y=Le(p.value)?null:p.value;Si(!Le(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 H.createElement("li",ev({className:v,style:f,key:"legend-item-".concat(g)},Pf(r.props,p,g)),H.createElement(Gy,{width:o,height:o,viewBox:d,style:h},r.renderIcon(p)),H.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 H.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(N.PureComponent);zc($x,"displayName","Legend");zc($x,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var V6=op;function Y6(){this.__data__=new V6,this.size=0}var X6=Y6;function Z6(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var Q6=Z6;function J6(e){return this.__data__.get(e)}var e4=J6;function t4(e){return this.__data__.has(e)}var n4=t4,r4=op,i4=kx,a4=Nx,s4=200;function o4(e,t){var n=this.__data__;if(n instanceof r4){var r=n.__data__;if(!i4||r.length<s4-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new a4(r)}return n.set(e,t),this.size=n.size,this}var l4=o4,c4=op,u4=X6,d4=Q6,f4=e4,h4=n4,p4=l4;function cl(e){var t=this.__data__=new c4(e);this.size=t.size}cl.prototype.clear=u4;cl.prototype.delete=d4;cl.prototype.get=f4;cl.prototype.has=h4;cl.prototype.set=p4;var AT=cl,m4="__lodash_hash_undefined__";function g4(e){return this.__data__.set(e,m4),this}var y4=g4;function v4(e){return this.__data__.has(e)}var b4=v4,x4=Nx,w4=y4,S4=b4;function Bf(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new x4;++t<n;)this.add(e[t])}Bf.prototype.add=Bf.prototype.push=w4;Bf.prototype.has=S4;var CT=Bf;function k4(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 TT=k4;function N4(e,t){return e.has(t)}var OT=N4,E4=CT,_4=TT,j4=OT,A4=1,C4=2;function T4(e,t,n,r,i,a){var o=n&A4,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&C4?new E4: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(!_4(t,function(y,b){if(!j4(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 PT=T4,O4=ai,P4=O4.Uint8Array,R4=P4;function M4(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var I4=M4;function $4(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Lx=$4,Y1=Tu,X1=R4,L4=Sx,D4=PT,B4=I4,z4=Lx,F4=1,U4=2,W4="[object Boolean]",H4="[object Date]",G4="[object Error]",q4="[object Map]",K4="[object Number]",V4="[object RegExp]",Y4="[object Set]",X4="[object String]",Z4="[object Symbol]",Q4="[object ArrayBuffer]",J4="[object DataView]",Z1=Y1?Y1.prototype:void 0,Um=Z1?Z1.valueOf:void 0;function eU(e,t,n,r,i,a,o){switch(n){case J4:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Q4:return!(e.byteLength!=t.byteLength||!a(new X1(e),new X1(t)));case W4:case H4:case K4:return L4(+e,+t);case G4:return e.name==t.name&&e.message==t.message;case V4:case X4:return e==t+"";case q4:var l=B4;case Y4:var c=r&F4;if(l||(l=z4),e.size!=t.size&&!c)return!1;var u=o.get(e);if(u)return u==t;r|=U4,o.set(e,t);var d=D4(l(e),l(t),r,i,a,o);return o.delete(e),d;case Z4:if(Um)return Um.call(e)==Um.call(t)}return!1}var tU=eU;function nU(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var RT=nU,rU=RT,iU=zn;function aU(e,t,n){var r=t(e);return iU(e)?r:rU(r,n(e))}var sU=aU;function oU(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 lU=oU;function cU(){return[]}var uU=cU,dU=lU,fU=uU,hU=Object.prototype,pU=hU.propertyIsEnumerable,Q1=Object.getOwnPropertySymbols,mU=Q1?function(e){return e==null?[]:(e=Object(e),dU(Q1(e),function(t){return pU.call(e,t)}))}:fU,gU=mU;function yU(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var vU=yU,bU=Ri,xU=Mi,wU="[object Arguments]";function SU(e){return xU(e)&&bU(e)==wU}var kU=SU,J1=kU,NU=Mi,MT=Object.prototype,EU=MT.hasOwnProperty,_U=MT.propertyIsEnumerable,jU=J1(function(){return arguments}())?J1:function(e){return NU(e)&&EU.call(e,"callee")&&!_U.call(e,"callee")},Dx=jU,zf={exports:{}};function AU(){return!1}var CU=AU;zf.exports;(function(e,t){var n=ai,r=CU,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})(zf,zf.exports);var IT=zf.exports,TU=9007199254740991,OU=/^(?:0|[1-9]\d*)$/;function PU(e,t){var n=typeof e;return t=t??TU,!!t&&(n=="number"||n!="symbol"&&OU.test(e))&&e>-1&&e%1==0&&e<t}var Bx=PU,RU=9007199254740991;function MU(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=RU}var zx=MU,IU=Ri,$U=zx,LU=Mi,DU="[object Arguments]",BU="[object Array]",zU="[object Boolean]",FU="[object Date]",UU="[object Error]",WU="[object Function]",HU="[object Map]",GU="[object Number]",qU="[object Object]",KU="[object RegExp]",VU="[object Set]",YU="[object String]",XU="[object WeakMap]",ZU="[object ArrayBuffer]",QU="[object DataView]",JU="[object Float32Array]",e9="[object Float64Array]",t9="[object Int8Array]",n9="[object Int16Array]",r9="[object Int32Array]",i9="[object Uint8Array]",a9="[object Uint8ClampedArray]",s9="[object Uint16Array]",o9="[object Uint32Array]",pt={};pt[JU]=pt[e9]=pt[t9]=pt[n9]=pt[r9]=pt[i9]=pt[a9]=pt[s9]=pt[o9]=!0;pt[DU]=pt[BU]=pt[ZU]=pt[zU]=pt[QU]=pt[FU]=pt[UU]=pt[WU]=pt[HU]=pt[GU]=pt[qU]=pt[KU]=pt[VU]=pt[YU]=pt[XU]=!1;function l9(e){return LU(e)&&$U(e.length)&&!!pt[IU(e)]}var c9=l9;function u9(e){return function(t){return e(t)}}var $T=u9,Ff={exports:{}};Ff.exports;(function(e,t){var n=HC,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})(Ff,Ff.exports);var d9=Ff.exports,f9=c9,h9=$T,eS=d9,tS=eS&&eS.isTypedArray,p9=tS?h9(tS):f9,LT=p9,m9=vU,g9=Dx,y9=zn,v9=IT,b9=Bx,x9=LT,w9=Object.prototype,S9=w9.hasOwnProperty;function k9(e,t){var n=y9(e),r=!n&&g9(e),i=!n&&!r&&v9(e),a=!n&&!r&&!i&&x9(e),o=n||r||i||a,l=o?m9(e.length,String):[],c=l.length;for(var u in e)(t||S9.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||b9(u,c)))&&l.push(u);return l}var N9=k9,E9=Object.prototype;function _9(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||E9;return e===n}var j9=_9;function A9(e,t){return function(n){return e(t(n))}}var DT=A9,C9=DT,T9=C9(Object.keys,Object),O9=T9,P9=j9,R9=O9,M9=Object.prototype,I9=M9.hasOwnProperty;function $9(e){if(!P9(e))return R9(e);var t=[];for(var n in Object(e))I9.call(e,n)&&n!="constructor"&&t.push(n);return t}var L9=$9,D9=wx,B9=zx;function z9(e){return e!=null&&B9(e.length)&&!D9(e)}var Pu=z9,F9=N9,U9=L9,W9=Pu;function H9(e){return W9(e)?F9(e):U9(e)}var Ep=H9,G9=sU,q9=gU,K9=Ep;function V9(e){return G9(e,K9,q9)}var Y9=V9,nS=Y9,X9=1,Z9=Object.prototype,Q9=Z9.hasOwnProperty;function J9(e,t,n,r,i,a){var o=n&X9,l=nS(e),c=l.length,u=nS(t),d=u.length;if(c!=d&&!o)return!1;for(var f=c;f--;){var h=l[f];if(!(o?h in t:Q9.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 w=o?r(b,y,h,t,e,a):r(y,b,h,e,t,a);if(!(w===void 0?y===b||i(y,b,n,r,a):w)){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 e8=J9,t8=bs,n8=ai,r8=t8(n8,"DataView"),i8=r8,a8=bs,s8=ai,o8=a8(s8,"Promise"),l8=o8,c8=bs,u8=ai,d8=c8(u8,"Set"),BT=d8,f8=bs,h8=ai,p8=f8(h8,"WeakMap"),m8=p8,nv=i8,rv=kx,iv=l8,av=BT,sv=m8,zT=Ri,ul=qC,rS="[object Map]",g8="[object Object]",iS="[object Promise]",aS="[object Set]",sS="[object WeakMap]",oS="[object DataView]",y8=ul(nv),v8=ul(rv),b8=ul(iv),x8=ul(av),w8=ul(sv),Da=zT;(nv&&Da(new nv(new ArrayBuffer(1)))!=oS||rv&&Da(new rv)!=rS||iv&&Da(iv.resolve())!=iS||av&&Da(new av)!=aS||sv&&Da(new sv)!=sS)&&(Da=function(e){var t=zT(e),n=t==g8?e.constructor:void 0,r=n?ul(n):"";if(r)switch(r){case y8:return oS;case v8:return rS;case b8:return iS;case x8:return aS;case w8:return sS}return t});var S8=Da,Wm=AT,k8=PT,N8=tU,E8=e8,lS=S8,cS=zn,uS=IT,_8=LT,j8=1,dS="[object Arguments]",fS="[object Array]",gd="[object Object]",A8=Object.prototype,hS=A8.hasOwnProperty;function C8(e,t,n,r,i,a){var o=cS(e),l=cS(t),c=o?fS:lS(e),u=l?fS:lS(t);c=c==dS?gd:c,u=u==dS?gd:u;var d=c==gd,f=u==gd,h=c==u;if(h&&uS(e)){if(!uS(t))return!1;o=!0,d=!1}if(h&&!d)return a||(a=new Wm),o||_8(e)?k8(e,t,n,r,i,a):N8(e,t,c,n,r,i,a);if(!(n&j8)){var p=d&&hS.call(e,"__wrapped__"),g=f&&hS.call(t,"__wrapped__");if(p||g){var m=p?e.value():e,v=g?t.value():t;return a||(a=new Wm),i(m,v,n,r,a)}}return h?(a||(a=new Wm),E8(e,t,n,r,i,a)):!1}var T8=C8,O8=T8,pS=Mi;function FT(e,t,n,r,i){return e===t?!0:e==null||t==null||!pS(e)&&!pS(t)?e!==e&&t!==t:O8(e,t,n,r,FT,i)}var Fx=FT,P8=AT,R8=Fx,M8=1,I8=2;function $8(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 P8;if(r)var h=r(u,d,c,e,t,f);if(!(h===void 0?R8(d,u,M8|I8,r,f):h))return!1}}return!0}var L8=$8,D8=ba;function B8(e){return e===e&&!D8(e)}var UT=B8,z8=UT,F8=Ep;function U8(e){for(var t=F8(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,z8(i)]}return t}var W8=U8;function H8(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var WT=H8,G8=L8,q8=W8,K8=WT;function V8(e){var t=q8(e);return t.length==1&&t[0][2]?K8(t[0][0],t[0][1]):function(n){return n===e||G8(n,e,t)}}var Y8=V8;function X8(e,t){return e!=null&&t in Object(e)}var Z8=X8,Q8=ZC,J8=Dx,e5=zn,t5=Bx,n5=zx,r5=cp;function i5(e,t,n){t=Q8(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=r5(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&&n5(i)&&t5(o,i)&&(e5(e)||J8(e)))}var a5=i5,s5=Z8,o5=a5;function l5(e,t){return e!=null&&o5(e,t,s5)}var c5=l5,u5=Fx,d5=QC,f5=c5,h5=xx,p5=UT,m5=WT,g5=cp,y5=1,v5=2;function b5(e,t){return h5(e)&&p5(t)?m5(g5(e),t):function(n){var r=d5(n,e);return r===void 0&&r===t?f5(n,e):u5(t,r,y5|v5)}}var x5=b5;function w5(e){return e}var dl=w5;function S5(e){return function(t){return t==null?void 0:t[e]}}var k5=S5,N5=jx;function E5(e){return function(t){return N5(t,e)}}var _5=E5,j5=k5,A5=_5,C5=xx,T5=cp;function O5(e){return C5(e)?j5(T5(e)):A5(e)}var P5=O5,R5=Y8,M5=x5,I5=dl,$5=zn,L5=P5;function D5(e){return typeof e=="function"?e:e==null?I5:typeof e=="object"?$5(e)?M5(e[0],e[1]):R5(e):L5(e)}var xa=D5;function B5(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 HT=B5;function z5(e){return e!==e}var F5=z5;function U5(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var W5=U5,H5=HT,G5=F5,q5=W5;function K5(e,t,n){return t===t?q5(e,t,n):H5(e,G5,n)}var V5=K5,Y5=V5;function X5(e,t){var n=e==null?0:e.length;return!!n&&Y5(e,t,0)>-1}var Z5=X5;function Q5(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 J5=Q5;function eW(){}var tW=eW,Hm=BT,nW=tW,rW=Lx,iW=1/0,aW=Hm&&1/rW(new Hm([,-0]))[1]==iW?function(e){return new Hm(e)}:nW,sW=aW,oW=CT,lW=Z5,cW=J5,uW=OT,dW=sW,fW=Lx,hW=200;function pW(e,t,n){var r=-1,i=lW,a=e.length,o=!0,l=[],c=l;if(n)o=!1,i=cW;else if(a>=hW){var u=t?null:dW(e);if(u)return fW(u);o=!1,i=uW,c=new oW}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 mW=pW,gW=xa,yW=mW;function vW(e,t){return e&&e.length?yW(e,gW(t)):[]}var bW=vW;const mS=Ze(bW);function GT(e,t,n){return t===!0?mS(e,n):Le(t)?mS(e,t):e}function Oo(e){"@babel/helpers - typeof";return Oo=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},Oo(e)}var xW=["ref"];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 fi(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){_p(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 wW(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yS(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,KT(r.key),r)}}function SW(e,t,n){return t&&yS(e.prototype,t),n&&yS(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function kW(e,t,n){return t=Uf(t),NW(e,qT()?Reflect.construct(t,n||[],Uf(e).constructor):t.apply(e,n))}function NW(e,t){if(t&&(Oo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return EW(e)}function EW(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qT=function(){return!!e})()}function Uf(e){return Uf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Uf(e)}function _W(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&&ov(e,t)}function ov(e,t){return ov=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},ov(e,t)}function _p(e,t,n){return t=KT(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KT(e){var t=jW(e,"string");return Oo(t)=="symbol"?t:t+""}function jW(e,t){if(Oo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Oo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function AW(e,t){if(e==null)return{};var n=CW(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 CW(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 TW(e){return e.value}function OW(e,t){if(H.isValidElement(e))return H.cloneElement(e,t);if(typeof e=="function")return H.createElement(e,t);t.ref;var n=AW(t,xW);return H.createElement($x,n)}var vS=1,es=function(e){function t(){var n;wW(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=kW(this,t,[].concat(i)),_p(n,"lastBoundingBox",{width:-1,height:-1}),n}return _W(t,e),SW(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)>vS||Math.abs(i.height-this.lastBoundingBox.height)>vS)&&(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?fi({},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 fi(fi({},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=fi(fi({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return H.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(p){r.wrapperNode=p}},OW(a,fi(fi({},this.props),{},{payload:GT(d,u,TW)})))}}],[{key:"getWithHeight",value:function(r,i){var a=fi(fi({},this.defaultProps),r.props),o=a.layout;return o==="vertical"&&de(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||i}:null}}])}(N.PureComponent);_p(es,"displayName","Legend");_p(es,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var bS=Tu,PW=Dx,RW=zn,xS=bS?bS.isConcatSpreadable:void 0;function MW(e){return RW(e)||PW(e)||!!(xS&&e&&e[xS])}var IW=MW,$W=RT,LW=IW;function VT(e,t,n,r,i){var a=-1,o=e.length;for(n||(n=LW),i||(i=[]);++a<o;){var l=e[a];t>0&&n(l)?t>1?VT(l,t-1,n,r,i):$W(i,l):r||(i[i.length]=l)}return i}var YT=VT;function DW(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 BW=DW,zW=BW,FW=zW(),UW=FW,WW=UW,HW=Ep;function GW(e,t){return e&&WW(e,t,HW)}var XT=GW,qW=Pu;function KW(e,t){return function(n,r){if(n==null)return n;if(!qW(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 VW=KW,YW=XT,XW=VW,ZW=XW(YW),Ux=ZW,QW=Ux,JW=Pu;function eH(e,t){var n=-1,r=JW(e)?Array(e.length):[];return QW(e,function(i,a,o){r[++n]=t(i,a,o)}),r}var ZT=eH;function tH(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var nH=tH,wS=il;function rH(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=wS(e),o=t!==void 0,l=t===null,c=t===t,u=wS(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 iH=rH,aH=iH;function sH(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,l=n.length;++r<o;){var c=aH(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 oH=sH,Gm=_x,lH=jx,cH=xa,uH=ZT,dH=nH,fH=$T,hH=oH,pH=dl,mH=zn;function gH(e,t,n){t.length?t=Gm(t,function(a){return mH(a)?function(o){return lH(o,a.length===1?a[0]:a)}:a}):t=[pH];var r=-1;t=Gm(t,fH(cH));var i=uH(e,function(a,o,l){var c=Gm(t,function(u){return u(a)});return{criteria:c,index:++r,value:a}});return dH(i,function(a,o){return hH(a,o,n)})}var yH=gH;function vH(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 bH=vH,xH=bH,SS=Math.max;function wH(e,t,n){return t=SS(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=SS(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),xH(e,this,l)}}var SH=wH;function kH(e){return function(){return e}}var NH=kH,EH=bs,_H=function(){try{var e=EH(Object,"defineProperty");return e({},"",{}),e}catch{}}(),QT=_H,jH=NH,kS=QT,AH=dl,CH=kS?function(e,t){return kS(e,"toString",{configurable:!0,enumerable:!1,value:jH(t),writable:!0})}:AH,TH=CH,OH=800,PH=16,RH=Date.now;function MH(e){var t=0,n=0;return function(){var r=RH(),i=PH-(r-n);if(n=r,i>0){if(++t>=OH)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var IH=MH,$H=TH,LH=IH,DH=LH($H),BH=DH,zH=dl,FH=SH,UH=BH;function WH(e,t){return UH(FH(e,t,zH),e+"")}var HH=WH,GH=Sx,qH=Pu,KH=Bx,VH=ba;function YH(e,t,n){if(!VH(n))return!1;var r=typeof t;return(r=="number"?qH(n)&&KH(t,n.length):r=="string"&&t in n)?GH(n[t],e):!1}var jp=YH,XH=YT,ZH=yH,QH=HH,NS=jp,JH=QH(function(e,t){if(e==null)return[];var n=t.length;return n>1&&NS(e,t[0],t[1])?t=[]:n>2&&NS(t[0],t[1],t[2])&&(t=[t[0]]),ZH(e,XH(t,1),[])}),eG=JH;const Wx=Ze(eG);function Fc(e){"@babel/helpers - typeof";return Fc=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},Fc(e)}function lv(){return lv=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},lv.apply(this,arguments)}function tG(e,t){return aG(e)||iG(e,t)||rG(e,t)||nG()}function nG(){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 rG(e,t){if(e){if(typeof e=="string")return ES(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 ES(e,t)}}function ES(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 iG(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 aG(e){if(Array.isArray(e))return e}function _S(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?_S(Object(n),!0).forEach(function(r){sG(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_S(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sG(e,t,n){return t=oG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oG(e){var t=lG(e,"string");return Fc(t)=="symbol"?t:t+""}function lG(e,t){if(Fc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Fc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cG(e){return Array.isArray(e)&&Ht(e[0])&&Ht(e[1])?e.join(" ~ "):e}var uG=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,w=function(){if(d&&d.length){var M={padding:0,margin:0},B=(h?Wx(d,h):d).map(function(I,F){if(I.type==="none")return null;var z=qm({display:"block",paddingTop:4,paddingBottom:4,color:I.color||"#000"},l),R=I.formatter||f||cG,O=I.value,U=I.name,A=O,Z=U;if(R&&A!=null&&Z!=null){var $=R(O,U,I,F,d);if(Array.isArray($)){var P=tG($,2);A=P[0],Z=P[1]}else A=$}return H.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(F),style:z},Ht(Z)?H.createElement("span",{className:"recharts-tooltip-item-name"},Z):null,Ht(Z)?H.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,H.createElement("span",{className:"recharts-tooltip-item-value"},A),H.createElement("span",{className:"recharts-tooltip-item-unit"},I.unit||""))});return H.createElement("ul",{className:"recharts-tooltip-item-list",style:M},B)}return null},k=qm({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),S=qm({margin:0},u),x=!Ye(m),E=x?m:"",_=Ve("recharts-default-tooltip",p),C=Ve("recharts-tooltip-label",g);x&&v&&d!==void 0&&d!==null&&(E=v(m,d));var T=b?{role:"status","aria-live":"assertive"}:{};return H.createElement("div",lv({className:_,style:k},T),H.createElement("p",{className:C,style:S},H.isValidElement(E)?E:"".concat(E)),w())};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 yd(e,t,n){return t=dG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dG(e){var t=fG(e,"string");return Uc(t)=="symbol"?t:t+""}function fG(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 Dl="recharts-tooltip-wrapper",hG={visibility:"hidden"};function pG(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Ve(Dl,yd(yd(yd(yd({},"".concat(Dl,"-right"),de(n)&&t&&de(t.x)&&n>=t.x),"".concat(Dl,"-left"),de(n)&&t&&de(t.x)&&n<t.x),"".concat(Dl,"-bottom"),de(r)&&t&&de(t.y)&&r>=t.y),"".concat(Dl,"-top"),de(r)&&t&&de(t.y)&&r<t.y))}function jS(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&&de(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 mG(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 gG(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=jS({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),f=jS({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=mG({translateX:d,translateY:f,useTranslate3d:l})):u=hG,{cssProperties:u,cssClasses:pG({translateX:d,translateY:f,coordinate:n})}}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 AS(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 CS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AS(Object(n),!0).forEach(function(r){uv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yG(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vG(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eO(r.key),r)}}function bG(e,t,n){return t&&vG(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function xG(e,t,n){return t=Wf(t),wG(e,JT()?Reflect.construct(t,n||[],Wf(e).constructor):t.apply(e,n))}function wG(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 SG(e)}function SG(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function JT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(JT=function(){return!!e})()}function Wf(e){return Wf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Wf(e)}function kG(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 uv(e,t,n){return t=eO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eO(e){var t=NG(e,"string");return Po(t)=="symbol"?t:t+""}function NG(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 TS=1,EG=function(e){function t(){var n;yG(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=xG(this,t,[].concat(i)),uv(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),uv(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 kG(t,e),bG(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>TS||Math.abs(r.height-this.state.lastBoundingBox.height)>TS)&&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,w=gG({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:p,position:g,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:v,viewBox:y}),k=w.cssClasses,S=w.cssProperties,x=CS(CS({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 H.createElement("div",{tabIndex:-1,className:k,style:x,ref:function(_){r.wrapperNode=_}},u)}}])}(N.PureComponent),_G=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Ru={isSsr:_G()};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 OS(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 PS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OS(Object(n),!0).forEach(function(r){Hx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jG(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AG(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,nO(r.key),r)}}function CG(e,t,n){return t&&AG(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function TG(e,t,n){return t=Hf(t),OG(e,tO()?Reflect.construct(t,n||[],Hf(e).constructor):t.apply(e,n))}function OG(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 PG(e)}function PG(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tO=function(){return!!e})()}function Hf(e){return Hf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Hf(e)}function RG(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&&dv(e,t)}function dv(e,t){return dv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},dv(e,t)}function Hx(e,t,n){return t=nO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nO(e){var t=MG(e,"string");return Ro(t)=="symbol"?t:t+""}function MG(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)}function IG(e){return e.dataKey}function $G(e,t){return H.isValidElement(e)?H.cloneElement(e,t):typeof e=="function"?H.createElement(e,t):H.createElement(uG,t)}var pn=function(e){function t(){return jG(this,t),TG(this,t,arguments)}return RG(t,e),CG(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,w=i.viewBox,k=i.wrapperStyle,S=g??[];f&&S.length&&(S=GT(g.filter(function(E){return E.value!=null&&(E.hide!==!0||r.props.includeHidden)}),m,IG));var x=S.length>0;return H.createElement(EG,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:h,active:a,coordinate:d,hasPayload:x,offset:p,position:v,reverseDirection:y,useTranslate3d:b,viewBox:w,wrapperStyle:k},$G(u,PS(PS({},this.props),{},{payload:S})))}}])}(N.PureComponent);Hx(pn,"displayName","Tooltip");Hx(pn,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Ru.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 LG=ai,DG=function(){return LG.Date.now()},BG=DG,zG=/\s/;function FG(e){for(var t=e.length;t--&&zG.test(e.charAt(t)););return t}var UG=FG,WG=UG,HG=/^\s+/;function GG(e){return e&&e.slice(0,WG(e)+1).replace(HG,"")}var qG=GG,KG=qG,RS=ba,VG=il,MS=NaN,YG=/^[-+]0x[0-9a-f]+$/i,XG=/^0b[01]+$/i,ZG=/^0o[0-7]+$/i,QG=parseInt;function JG(e){if(typeof e=="number")return e;if(VG(e))return MS;if(RS(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=RS(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=KG(e);var n=XG.test(e);return n||ZG.test(e)?QG(e.slice(2),n?2:8):YG.test(e)?MS:+e}var rO=JG,eq=ba,Km=BG,IS=rO,tq="Expected a function",nq=Math.max,rq=Math.min;function iq(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(tq);t=IS(t)||0,eq(n)&&(d=!!n.leading,f="maxWait"in n,a=f?nq(IS(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h);function p(x){var E=r,_=i;return r=i=void 0,u=x,o=e.apply(_,E),o}function g(x){return u=x,l=setTimeout(y,t),d?p(x):o}function m(x){var E=x-c,_=x-u,C=t-E;return f?rq(C,a-_):C}function v(x){var E=x-c,_=x-u;return c===void 0||E>=t||E<0||f&&_>=a}function y(){var x=Km();if(v(x))return b(x);l=setTimeout(y,m(x))}function b(x){return l=void 0,h&&r?p(x):(r=i=void 0,o)}function w(){l!==void 0&&clearTimeout(l),u=0,r=c=i=l=void 0}function k(){return l===void 0?o:b(Km())}function S(){var x=Km(),E=v(x);if(r=arguments,i=this,c=x,E){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=w,S.flush=k,S}var aq=iq,sq=aq,oq=ba,lq="Expected a function";function cq(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(lq);return oq(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),sq(e,t,{leading:r,maxWait:t,trailing:i})}var uq=cq;const iO=Ze(uq);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 $S(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 vd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$S(Object(n),!0).forEach(function(r){dq(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$S(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dq(e,t,n){return t=fq(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fq(e){var t=hq(e,"string");return Wc(t)=="symbol"?t:t+""}function hq(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 pq(e,t){return vq(e)||yq(e,t)||gq(e,t)||mq()}function mq(){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 gq(e,t){if(e){if(typeof e=="string")return LS(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 LS(e,t)}}function LS(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 yq(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 vq(e){if(Array.isArray(e))return e}var Fa=N.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,w=e.style,k=w===void 0?{}:w,S=N.useRef(null),x=N.useRef();x.current=b,N.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=N.useState({containerWidth:i.width,containerHeight:i.height}),_=pq(E,2),C=_[0],T=_[1],L=N.useCallback(function(B,I){T(function(F){var z=Math.round(B),R=Math.round(I);return F.containerWidth===z&&F.containerHeight===R?F:{containerWidth:z,containerHeight:R}})},[]);N.useEffect(function(){var B=function(U){var A,Z=U[0].contentRect,$=Z.width,P=Z.height;L($,P),(A=x.current)===null||A===void 0||A.call(x,$,P)};m>0&&(B=iO(B,m,{trailing:!0,leading:!1}));var I=new ResizeObserver(B),F=S.current.getBoundingClientRect(),z=F.width,R=F.height;return L(z,R),I.observe(S.current),function(){I.disconnect()}},[L,m]);var M=N.useMemo(function(){var B=C.containerWidth,I=C.containerHeight;if(B<0||I<0)return null;Si(Ka(o)||Ka(c),`The width(%s) and height(%s) are both fixed numbers,
81
+ maybe you don't need to use a ResponsiveContainer.`,o,c),Si(!n||n>0,"The aspect(%s) must be greater than zero.",n);var F=Ka(o)?B:o,z=Ka(c)?I:c;n&&n>0&&(F?z=F/n:z&&(F=z*n),h&&z>h&&(z=h)),Si(F>0||z>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.`,F,z,o,c,d,f,n);var R=!Array.isArray(p)&&wi(p.type).endsWith("Chart");return H.Children.map(p,function(O){return H.isValidElement(O)?N.cloneElement(O,vd({width:F,height:z},R?{style:vd({height:"100%",width:"100%",maxHeight:z,maxWidth:F},O.props.style)}:{})):O})},[n,p,c,h,f,d,C,o]);return H.createElement("div",{id:v?"".concat(v):void 0,className:Ve("recharts-responsive-container",y),style:vd(vd({},k),{},{width:o,height:c,minWidth:d,minHeight:f,maxHeight:h}),ref:S},M)}),Hc=function(t){return null};Hc.displayName="Cell";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)}function DS(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 fv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DS(Object(n),!0).forEach(function(r){bq(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bq(e,t,n){return t=xq(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xq(e){var t=wq(e,"string");return Gc(t)=="symbol"?t:t+""}function wq(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)}var Ds={widthCache:{},cacheCount:0},Sq=2e3,kq={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},BS="recharts_measurement_span";function Nq(e){var t=fv({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var fc=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Ru.isSsr)return{width:0,height:0};var r=Nq(n),i=JSON.stringify({text:t,copyStyle:r});if(Ds.widthCache[i])return Ds.widthCache[i];try{var a=document.getElementById(BS);a||(a=document.createElement("span"),a.setAttribute("id",BS),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=fv(fv({},kq),r);Object.assign(a.style,o),a.textContent="".concat(t);var l=a.getBoundingClientRect(),c={width:l.width,height:l.height};return Ds.widthCache[i]=c,++Ds.cacheCount>Sq&&(Ds.cacheCount=0,Ds.widthCache={}),c}catch{return{width:0,height:0}}},Eq=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};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 Gf(e,t){return Cq(e)||Aq(e,t)||jq(e,t)||_q()}function _q(){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 jq(e,t){if(e){if(typeof e=="string")return zS(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 zS(e,t)}}function zS(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 Aq(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 Cq(e){if(Array.isArray(e))return e}function Tq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FS(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,Pq(r.key),r)}}function Oq(e,t,n){return t&&FS(e.prototype,t),n&&FS(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pq(e){var t=Rq(e,"string");return qc(t)=="symbol"?t:t+""}function Rq(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 String(e)}var US=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,WS=/(-?\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$/,Iq=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,aO={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},$q=Object.keys(aO),so="NaN";function Lq(e,t){return e*aO[t]}var bd=function(){function e(t,n){Tq(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=""),$q.includes(n)&&(this.num=Lq(t,n),this.unit="px")}return Oq(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=Iq.exec(n))!==null&&r!==void 0?r:[],a=Gf(i,3),o=a[1],l=a[2];return new e(parseFloat(o),l??"")}}])}();function sO(e){if(e.includes(so))return so;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=US.exec(t))!==null&&n!==void 0?n:[],i=Gf(r,4),a=i[1],o=i[2],l=i[3],c=bd.parse(a??""),u=bd.parse(l??""),d=o==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return so;t=t.replace(US,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,h=(f=WS.exec(t))!==null&&f!==void 0?f:[],p=Gf(h,4),g=p[1],m=p[2],v=p[3],y=bd.parse(g??""),b=bd.parse(v??""),w=m==="+"?y.add(b):y.subtract(b);if(w.isNaN())return so;t=t.replace(WS,w.toString())}return t}var HS=/\(([^()]*)\)/;function Dq(e){for(var t=e;t.includes("(");){var n=HS.exec(t),r=Gf(n,2),i=r[1];t=t.replace(HS,sO(i))}return t}function Bq(e){var t=e.replace(/\s+/g,"");return t=Dq(t),t=sO(t),t}function zq(e){try{return Bq(e)}catch{return so}}function Vm(e){var t=zq(e.slice(5,-1));return t===so?"":t}var Fq=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],Uq=["dx","dy","angle","className","breakAll"];function hv(){return hv=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},hv.apply(this,arguments)}function GS(e,t){if(e==null)return{};var n=Wq(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 Wq(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 qS(e,t){return Kq(e)||qq(e,t)||Gq(e,t)||Hq()}function Hq(){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 Gq(e,t){if(e){if(typeof e=="string")return KS(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 KS(e,t)}}function KS(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 qq(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 Kq(e){if(Array.isArray(e))return e}var oO=/[ \f\n\r\t\v\u2028\u2029]+/,lO=function(t){var n=t.children,r=t.breakAll,i=t.style;try{var a=[];Ye(n)||(r?a=n.toString().split(""):a=n.toString().split(oO));var o=a.map(function(c){return{word:c,width:fc(c,i).width}}),l=r?0:fc("ย ",i).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},Vq=function(t,n,r,i,a){var o=t.maxLines,l=t.children,c=t.style,u=t.breakAll,d=de(o),f=l,h=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return F.reduce(function(z,R){var O=R.word,U=R.width,A=z[z.length-1];if(A&&(i==null||a||A.width+U+r<Number(i)))A.words.push(O),A.width+=U+r;else{var Z={words:[O],width:U};z.push(Z)}return z},[])},p=h(n),g=function(F){return F.reduce(function(z,R){return z.width>R.width?z:R})};if(!d)return p;for(var m="โ€ฆ",v=function(F){var z=f.slice(0,F),R=lO({breakAll:u,style:c,children:z+m}).wordsWithComputedWidth,O=h(R),U=O.length>o||g(O).width>Number(i);return[U,O]},y=0,b=f.length-1,w=0,k;y<=b&&w<=f.length-1;){var S=Math.floor((y+b)/2),x=S-1,E=v(x),_=qS(E,2),C=_[0],T=_[1],L=v(S),M=qS(L,1),B=M[0];if(!C&&!B&&(y=S+1),C&&B&&(b=S-1),!C&&B){k=T;break}w++}return k||p},VS=function(t){var n=Ye(t)?[]:t.toString().split(oO);return[{words:n}]},Yq=function(t){var n=t.width,r=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,l=t.maxLines;if((n||r)&&!Ru.isSsr){var c,u,d=lO({breakAll:o,children:i,style:a});if(d){var f=d.wordsWithComputedWidth,h=d.spaceWidth;c=f,u=h}else return VS(i);return Vq({breakAll:o,children:i,maxLines:l,style:a},c,u,n,r)}return VS(i)},YS="#808080",qf=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?YS:v,b=GS(t,Fq),w=N.useMemo(function(){return Yq({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,x=b.angle,E=b.className,_=b.breakAll,C=GS(b,Uq);if(!Ht(r)||!Ht(a))return null;var T=r+(de(k)?k:0),L=a+(de(S)?S:0),M;switch(m){case"start":M=Vm("calc(".concat(u,")"));break;case"middle":M=Vm("calc(".concat((w.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:M=Vm("calc(".concat(w.length-1," * -").concat(l,")"));break}var B=[];if(f){var I=w[0].width,F=b.width;B.push("scale(".concat((de(F)?F/I:1)/I,")"))}return x&&B.push("rotate(".concat(x,", ").concat(T,", ").concat(L,")")),B.length&&(C.transform=B.join(" ")),H.createElement("text",hv({},Ke(C,!0),{x:T,y:L,className:Ve("recharts-text",E),textAnchor:p,fill:y.includes("url")?YS:y}),w.map(function(z,R){var O=z.words.join(_?"":" ");return H.createElement("tspan",{x:T,dy:R===0?M:l,key:"".concat(O,"-").concat(R)},O)}))};function ua(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Xq(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Gx(e){let t,n,r;e.length!==2?(t=ua,n=(l,c)=>ua(e(l),c),r=(l,c)=>e(l)-c):(t=e===ua||e===Xq?e:Zq,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 Zq(){return 0}function cO(e){return e===null?NaN:+e}function*Qq(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Jq=Gx(ua),Mu=Jq.right;Gx(cO).center;class XS extends Map{constructor(t,n=nK){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(ZS(this,t))}has(t){return super.has(ZS(this,t))}set(t,n){return super.set(eK(this,t),n)}delete(t){return super.delete(tK(this,t))}}function ZS({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function eK({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function tK({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function nK(e){return e!==null&&typeof e=="object"?e.valueOf():e}function rK(e=ua){if(e===ua)return uO;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 uO(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const iK=Math.sqrt(50),aK=Math.sqrt(10),sK=Math.sqrt(2);function Kf(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>=iK?10:a>=aK?5:a>=sK?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?Kf(e,t,n*2):[l,c,u]}function pv(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?Kf(t,e,n):Kf(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 mv(e,t,n){return t=+t,e=+e,n=+n,Kf(e,t,n)[2]}function gv(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?mv(t,e,n):mv(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function QS(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function JS(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function dO(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?uO:rK(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));dO(e,t,p,g,i)}const a=e[t];let o=n,l=r;for(Bl(e,n,t),i(e[r],a)>0&&Bl(e,n,r);o<l;){for(Bl(e,o,l),++o,--l;i(e[o],a)<0;)++o;for(;i(e[l],a)>0;)--l}i(e[n],a)===0?Bl(e,n,l):(++l,Bl(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function Bl(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function oK(e,t,n){if(e=Float64Array.from(Qq(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return JS(e);if(t>=1)return QS(e);var r,i=(r-1)*t,a=Math.floor(i),o=QS(dO(e,a).subarray(0,a+1)),l=JS(e.subarray(a+1));return o+(l-o)*(i-a)}}function lK(e,t,n=cO){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 cK(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 Sr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ii(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 yv=Symbol("implicit");function qx(){var e=new XS,t=[],n=[],r=yv;function i(a){let o=e.get(a);if(o===void 0){if(r!==yv)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 XS;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 qx(t,n).unknown(r)},Sr.apply(i,arguments),i}function Kc(){var e=qx().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=cK(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 Kc(t(),[r,i]).round(l).paddingInner(c).paddingOuter(u).align(d)},Sr.apply(f(),arguments)}function fO(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return fO(t())},e}function hc(){return fO(Kc.apply(null,arguments).paddingInner(1))}function Kx(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function hO(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Iu(){}var Vc=.7,Vf=1/Vc,vo="\\s*([+-]?\\d+)\\s*",Yc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ti="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",uK=/^#([0-9a-f]{3,8})$/,dK=new RegExp(`^rgb\\(${vo},${vo},${vo}\\)$`),fK=new RegExp(`^rgb\\(${ti},${ti},${ti}\\)$`),hK=new RegExp(`^rgba\\(${vo},${vo},${vo},${Yc}\\)$`),pK=new RegExp(`^rgba\\(${ti},${ti},${ti},${Yc}\\)$`),mK=new RegExp(`^hsl\\(${Yc},${ti},${ti}\\)$`),gK=new RegExp(`^hsla\\(${Yc},${ti},${ti},${Yc}\\)$`),ek={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};Kx(Iu,Xc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:tk,formatHex:tk,formatHex8:yK,formatHsl:vK,formatRgb:nk,toString:nk});function tk(){return this.rgb().formatHex()}function yK(){return this.rgb().formatHex8()}function vK(){return pO(this).formatHsl()}function nk(){return this.rgb().formatRgb()}function Xc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=uK.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?rk(t):n===3?new $n(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?xd(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?xd(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=dK.exec(e))?new $n(t[1],t[2],t[3],1):(t=fK.exec(e))?new $n(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=hK.exec(e))?xd(t[1],t[2],t[3],t[4]):(t=pK.exec(e))?xd(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=mK.exec(e))?sk(t[1],t[2]/100,t[3]/100,1):(t=gK.exec(e))?sk(t[1],t[2]/100,t[3]/100,t[4]):ek.hasOwnProperty(e)?rk(ek[e]):e==="transparent"?new $n(NaN,NaN,NaN,0):null}function rk(e){return new $n(e>>16&255,e>>8&255,e&255,1)}function xd(e,t,n,r){return r<=0&&(e=t=n=NaN),new $n(e,t,n,r)}function bK(e){return e instanceof Iu||(e=Xc(e)),e?(e=e.rgb(),new $n(e.r,e.g,e.b,e.opacity)):new $n}function vv(e,t,n,r){return arguments.length===1?bK(e):new $n(e,t,n,r??1)}function $n(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Kx($n,vv,hO(Iu,{brighter(e){return e=e==null?Vf:Math.pow(Vf,e),new $n(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Vc:Math.pow(Vc,e),new $n(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new $n(ts(this.r),ts(this.g),ts(this.b),Yf(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:ik,formatHex:ik,formatHex8:xK,formatRgb:ak,toString:ak}));function ik(){return`#${Va(this.r)}${Va(this.g)}${Va(this.b)}`}function xK(){return`#${Va(this.r)}${Va(this.g)}${Va(this.b)}${Va((isNaN(this.opacity)?1:this.opacity)*255)}`}function ak(){const e=Yf(this.opacity);return`${e===1?"rgb(":"rgba("}${ts(this.r)}, ${ts(this.g)}, ${ts(this.b)}${e===1?")":`, ${e})`}`}function Yf(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ts(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Va(e){return e=ts(e),(e<16?"0":"")+e.toString(16)}function sk(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Or(e,t,n,r)}function pO(e){if(e instanceof Or)return new Or(e.h,e.s,e.l,e.opacity);if(e instanceof Iu||(e=Xc(e)),!e)return new Or;if(e instanceof Or)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 Or(o,l,c,e.opacity)}function wK(e,t,n,r){return arguments.length===1?pO(e):new Or(e,t,n,r??1)}function Or(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Kx(Or,wK,hO(Iu,{brighter(e){return e=e==null?Vf:Math.pow(Vf,e),new Or(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Vc:Math.pow(Vc,e),new Or(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 $n(Ym(e>=240?e-240:e+120,i,r),Ym(e,i,r),Ym(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Or(ok(this.h),wd(this.s),wd(this.l),Yf(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=Yf(this.opacity);return`${e===1?"hsl(":"hsla("}${ok(this.h)}, ${wd(this.s)*100}%, ${wd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ok(e){return e=(e||0)%360,e<0?e+360:e}function wd(e){return Math.max(0,Math.min(1,e||0))}function Ym(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 Vx=e=>()=>e;function SK(e,t){return function(n){return e+n*t}}function kK(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 NK(e){return(e=+e)==1?mO:function(t,n){return n-t?kK(t,n,e):Vx(isNaN(t)?n:t)}}function mO(e,t){var n=t-e;return n?SK(e,n):Vx(isNaN(e)?t:e)}const lk=function e(t){var n=NK(t);function r(i,a){var o=n((i=vv(i)).r,(a=vv(a)).r),l=n(i.g,a.g),c=n(i.b,a.b),u=mO(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 EK(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 _K(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function jK(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]=fl(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 AK(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Xf(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function CK(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]=fl(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var bv=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xm=new RegExp(bv.source,"g");function TK(e){return function(){return e}}function OK(e){return function(t){return e(t)+""}}function PK(e,t){var n=bv.lastIndex=Xm.lastIndex=0,r,i,a,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=bv.exec(e))&&(i=Xm.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:Xf(r,i)})),n=Xm.lastIndex;return n<t.length&&(a=t.slice(n),l[o]?l[o]+=a:l[++o]=a),l.length<2?c[0]?OK(c[0].x):TK(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 fl(e,t){var n=typeof t,r;return t==null||n==="boolean"?Vx(t):(n==="number"?Xf:n==="string"?(r=Xc(t))?(t=r,lk):PK:t instanceof Xc?lk:t instanceof Date?AK:_K(t)?EK:Array.isArray(t)?jK:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?CK:Xf)(e,t)}function Yx(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function RK(e,t){t===void 0&&(t=e,e=fl);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 Zf(e){return+e}var ck=[0,1];function jn(e){return e}function xv(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:MK(isNaN(t)?NaN:.5)}function IK(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function $K(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=xv(i,r),a=n(o,a)):(r=xv(r,i),a=n(a,o)),function(l){return a(r(l))}}function LK(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]=xv(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(l){var c=Mu(e,l,1,r)-1;return a[c](i[c](l))}}function $u(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Ap(){var e=ck,t=ck,n=fl,r,i,a,o=jn,l,c,u;function d(){var h=Math.min(e.length,t.length);return o!==jn&&(o=IK(e[0],e[h-1])),l=h>2?LK:$K,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),Xf)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Zf),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=Yx,d()},f.clamp=function(h){return arguments.length?(o=h?!0:jn,d()):o!==jn},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 Xx(){return Ap()(jn,jn)}function DK(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Qf(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 Mo(e){return e=Qf(Math.abs(e)),e?e[1]:NaN}function BK(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 zK(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var FK=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Zc(e){if(!(t=FK.exec(e)))throw new Error("invalid format: "+e);var t;return new Zx({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]})}Zc.prototype=Zx.prototype;function Zx(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+""}Zx.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 UK(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 Jf;function WK(e,t){var n=Qf(e,t);if(!n)return Jf=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Jf=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")+Qf(e,Math.max(0,t+a-1))[0]}function uk(e,t){var n=Qf(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 dk={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:DK,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)=>uk(e*100,t),r:uk,s:WK,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function fk(e){return e}var hk=Array.prototype.map,pk=["y","z","a","f","p","n","ยต","m","","k","M","G","T","P","E","Z","Y"];function HK(e){var t=e.grouping===void 0||e.thousands===void 0?fk:BK(hk.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?fk:zK(hk.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=Zc(f);var p=f.fill,g=f.align,m=f.sign,v=f.symbol,y=f.zero,b=f.width,w=f.comma,k=f.precision,S=f.trim,x=f.type;x==="n"?(w=!0,x="g"):dk[x]||(k===void 0&&(k=12),S=!0,x="g"),(y||p==="0"&&g==="=")&&(y=!0,p="0",g="=");var E=(h&&h.prefix!==void 0?h.prefix:"")+(v==="$"?n:v==="#"&&/[boxX]/.test(x)?"0"+x.toLowerCase():""),_=(v==="$"?r:/[%p]/.test(x)?o:"")+(h&&h.suffix!==void 0?h.suffix:""),C=dk[x],T=/[defgprs%]/.test(x);k=k===void 0?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,k)):Math.max(0,Math.min(20,k));function L(M){var B=E,I=_,F,z,R;if(x==="c")I=C(M)+I,M="";else{M=+M;var O=M<0||1/M<0;if(M=isNaN(M)?c:C(Math.abs(M),k),S&&(M=UK(M)),O&&+M==0&&m!=="+"&&(O=!1),B=(O?m==="("?m:l:m==="-"||m==="("?"":m)+B,I=(x==="s"&&!isNaN(M)&&Jf!==void 0?pk[8+Jf/3]:"")+I+(O&&m==="("?")":""),T){for(F=-1,z=M.length;++F<z;)if(R=M.charCodeAt(F),48>R||R>57){I=(R===46?i+M.slice(F+1):M.slice(F))+I,M=M.slice(0,F);break}}}w&&!y&&(M=t(M,1/0));var U=B.length+M.length+I.length,A=U<b?new Array(b-U+1).join(p):"";switch(w&&y&&(M=t(A+M,A.length?b-I.length:1/0),A=""),g){case"<":M=B+M+I+A;break;case"=":M=B+A+M+I;break;case"^":M=A.slice(0,U=A.length>>1)+B+M+I+A.slice(U);break;default:M=A+B+M+I;break}return a(M)}return L.toString=function(){return f+""},L}function d(f,h){var p=Math.max(-8,Math.min(8,Math.floor(Mo(h)/3)))*3,g=Math.pow(10,-p),m=u((f=Zc(f),f.type="f",f),{suffix:pk[8+p/3]});return function(v){return m(g*v)}}return{format:u,formatPrefix:d}}var Sd,Qx,gO;GK({thousands:",",grouping:[3],currency:["$",""]});function GK(e){return Sd=HK(e),Qx=Sd.format,gO=Sd.formatPrefix,Sd}function qK(e){return Math.max(0,-Mo(Math.abs(e)))}function KK(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Mo(t)/3)))*3-Mo(Math.abs(e)))}function VK(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Mo(t)-Mo(e))+1}function yO(e,t,n,r){var i=gv(e,t,n),a;switch(r=Zc(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=KK(i,o))&&(r.precision=a),gO(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=VK(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=qK(i))&&(r.precision=a-(r.type==="%")*2);break}}return Qx(r)}function wa(e){var t=e.domain;return e.ticks=function(n){var r=t();return pv(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return yO(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=mv(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 eh(){var e=Xx();return e.copy=function(){return $u(e,eh())},Sr.apply(e,arguments),wa(e)}function vO(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,Zf),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return vO(e).unknown(t)},e=arguments.length?Array.from(e,Zf):[0,1],wa(n)}function bO(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 mk(e){return Math.log(e)}function gk(e){return Math.exp(e)}function YK(e){return-Math.log(-e)}function XK(e){return-Math.exp(-e)}function ZK(e){return isFinite(e)?+("1e"+e):e<0?0:e}function QK(e){return e===10?ZK:e===Math.E?Math.exp:t=>Math.pow(e,t)}function JK(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 yk(e){return(t,n)=>-e(-t,n)}function Jx(e){const t=e(mk,gk),n=t.domain;let r=10,i,a;function o(){return i=JK(r),a=QK(r),n()[0]<0?(i=yk(i),a=yk(a),e(YK,XK)):e(mk,gk),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=pv(u,d,v))}else y=pv(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=Zc(c)).precision==null&&(c.trim=!0),c=Qx(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(bO(n(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),t}function xO(){const e=Jx(Ap()).domain([1,10]);return e.copy=()=>$u(e,xO()).base(e.base()),Sr.apply(e,arguments),e}function vk(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function bk(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function e0(e){var t=1,n=e(vk(t),bk(t));return n.constant=function(r){return arguments.length?e(vk(t=+r),bk(t)):t},wa(n)}function wO(){var e=e0(Ap());return e.copy=function(){return $u(e,wO()).constant(e.constant())},Sr.apply(e,arguments)}function xk(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function e7(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function t7(e){return e<0?-e*e:e*e}function t0(e){var t=e(jn,jn),n=1;function r(){return n===1?e(jn,jn):n===.5?e(e7,t7):e(xk(n),xk(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},wa(t)}function n0(){var e=t0(Ap());return e.copy=function(){return $u(e,n0()).exponent(e.exponent())},Sr.apply(e,arguments),e}function n7(){return n0.apply(null,arguments).exponent(.5)}function wk(e){return Math.sign(e)*e*e}function r7(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function SO(){var e=Xx(),t=[0,1],n=!1,r;function i(a){var o=r7(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(wk(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,Zf)).map(wk)),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 SO(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Sr.apply(i,arguments),wa(i)}function kO(){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]=lK(e,o/l);return a}function a(o){return o==null||isNaN(o=+o)?r:t[Mu(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(ua),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 kO().domain(e).range(t).unknown(r)},Sr.apply(a,arguments)}function NO(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(c){return c!=null&&c<=c?i[Mu(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 NO().domain([e,t]).range(i).unknown(a)},Sr.apply(wa(o),arguments)}function EO(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[Mu(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 EO().domain(e).range(t).unknown(n)},Sr.apply(i,arguments)}const Zm=new Date,Qm=new Date;function Gt(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=>Gt(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)=>(Zm.setTime(+a),Qm.setTime(+o),e(Zm),e(Qm),Math.floor(n(Zm,Qm))),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 th=Gt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);th.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Gt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):th);th.range;const yi=1e3,mr=yi*60,vi=mr*60,Ai=vi*24,r0=Ai*7,Sk=Ai*30,Jm=Ai*365,Ya=Gt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*yi)},(e,t)=>(t-e)/yi,e=>e.getUTCSeconds());Ya.range;const i0=Gt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*yi)},(e,t)=>{e.setTime(+e+t*mr)},(e,t)=>(t-e)/mr,e=>e.getMinutes());i0.range;const a0=Gt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*mr)},(e,t)=>(t-e)/mr,e=>e.getUTCMinutes());a0.range;const s0=Gt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*yi-e.getMinutes()*mr)},(e,t)=>{e.setTime(+e+t*vi)},(e,t)=>(t-e)/vi,e=>e.getHours());s0.range;const o0=Gt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*vi)},(e,t)=>(t-e)/vi,e=>e.getUTCHours());o0.range;const Lu=Gt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*mr)/Ai,e=>e.getDate()-1);Lu.range;const Cp=Gt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ai,e=>e.getUTCDate()-1);Cp.range;const _O=Gt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ai,e=>Math.floor(e/Ai));_O.range;function xs(e){return Gt(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())*mr)/r0)}const Tp=xs(0),nh=xs(1),i7=xs(2),a7=xs(3),Io=xs(4),s7=xs(5),o7=xs(6);Tp.range;nh.range;i7.range;a7.range;Io.range;s7.range;o7.range;function ws(e){return Gt(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)/r0)}const Op=ws(0),rh=ws(1),l7=ws(2),c7=ws(3),$o=ws(4),u7=ws(5),d7=ws(6);Op.range;rh.range;l7.range;c7.range;$o.range;u7.range;d7.range;const l0=Gt(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());l0.range;const c0=Gt(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());c0.range;const Ci=Gt(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());Ci.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Gt(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)});Ci.range;const Ti=Gt(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());Ti.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Gt(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)});Ti.range;function jO(e,t,n,r,i,a){const o=[[Ya,1,yi],[Ya,5,5*yi],[Ya,15,15*yi],[Ya,30,30*yi],[a,1,mr],[a,5,5*mr],[a,15,15*mr],[a,30,30*mr],[i,1,vi],[i,3,3*vi],[i,6,6*vi],[i,12,12*vi],[r,1,Ai],[r,2,2*Ai],[n,1,r0],[t,1,Sk],[t,3,3*Sk],[e,1,Jm]];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=Gx(([,,v])=>v).right(o,h);if(p===o.length)return e.every(gv(u/Jm,d/Jm,f));if(p===0)return th.every(Math.max(gv(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[f7,h7]=jO(Ti,c0,Op,_O,o0,a0),[p7,m7]=jO(Ci,l0,Tp,Lu,s0,i0);function eg(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function tg(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function zl(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function g7(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=Fl(i),d=Ul(i),f=Fl(a),h=Ul(a),p=Fl(o),g=Ul(o),m=Fl(l),v=Ul(l),y=Fl(c),b=Ul(c),w={a:R,A:O,b:U,B:A,c:null,d:Ak,e:Ak,f:B7,g:Y7,G:Z7,H:$7,I:L7,j:D7,L:AO,m:z7,M:F7,p:Z,q:$,Q:Ok,s:Pk,S:U7,u:W7,U:H7,V:G7,w:q7,W:K7,x:null,X:null,y:V7,Y:X7,Z:Q7,"%":Tk},k={a:P,A:oe,b:be,B:pe,c:null,d:Ck,e:Ck,f:nV,g:fV,G:pV,H:J7,I:eV,j:tV,L:TO,m:rV,M:iV,p:Ce,q:G,Q:Ok,s:Pk,S:aV,u:sV,U:oV,V:lV,w:cV,W:uV,x:null,X:null,y:dV,Y:hV,Z:mV,"%":Tk},S={a:T,A:L,b:M,B,c:I,d:_k,e:_k,f:P7,g:Ek,G:Nk,H:jk,I:jk,j:A7,L:O7,m:j7,M:C7,p:C,q:_7,Q:M7,s:I7,S:T7,u:w7,U:S7,V:k7,w:x7,W:N7,x:F,X:z,y:Ek,Y:Nk,Z:E7,"%":R7};w.x=x(n,w),w.X=x(r,w),w.c=x(t,w),k.x=x(n,k),k.X=x(r,k),k.c=x(t,k);function x(Y,ae){return function(le){var X=[],je=-1,Ne=0,_e=Y.length,ge,$e,fe;for(le instanceof Date||(le=new Date(+le));++je<_e;)Y.charCodeAt(je)===37&&(X.push(Y.slice(Ne,je)),($e=kk[ge=Y.charAt(++je)])!=null?ge=Y.charAt(++je):$e=ge==="e"?" ":"0",(fe=ae[ge])&&(ge=fe(le,$e)),X.push(ge),Ne=je+1);return X.push(Y.slice(Ne,je)),X.join("")}}function E(Y,ae){return function(le){var X=zl(1900,void 0,1),je=_(X,Y,le+="",0),Ne,_e;if(je!=le.length)return null;if("Q"in X)return new Date(X.Q);if("s"in X)return new Date(X.s*1e3+("L"in X?X.L:0));if(ae&&!("Z"in X)&&(X.Z=0),"p"in X&&(X.H=X.H%12+X.p*12),X.m===void 0&&(X.m="q"in X?X.q:0),"V"in X){if(X.V<1||X.V>53)return null;"w"in X||(X.w=1),"Z"in X?(Ne=tg(zl(X.y,0,1)),_e=Ne.getUTCDay(),Ne=_e>4||_e===0?rh.ceil(Ne):rh(Ne),Ne=Cp.offset(Ne,(X.V-1)*7),X.y=Ne.getUTCFullYear(),X.m=Ne.getUTCMonth(),X.d=Ne.getUTCDate()+(X.w+6)%7):(Ne=eg(zl(X.y,0,1)),_e=Ne.getDay(),Ne=_e>4||_e===0?nh.ceil(Ne):nh(Ne),Ne=Lu.offset(Ne,(X.V-1)*7),X.y=Ne.getFullYear(),X.m=Ne.getMonth(),X.d=Ne.getDate()+(X.w+6)%7)}else("W"in X||"U"in X)&&("w"in X||(X.w="u"in X?X.u%7:"W"in X?1:0),_e="Z"in X?tg(zl(X.y,0,1)).getUTCDay():eg(zl(X.y,0,1)).getDay(),X.m=0,X.d="W"in X?(X.w+6)%7+X.W*7-(_e+5)%7:X.w+X.U*7-(_e+6)%7);return"Z"in X?(X.H+=X.Z/100|0,X.M+=X.Z%100,tg(X)):eg(X)}}function _(Y,ae,le,X){for(var je=0,Ne=ae.length,_e=le.length,ge,$e;je<Ne;){if(X>=_e)return-1;if(ge=ae.charCodeAt(je++),ge===37){if(ge=ae.charAt(je++),$e=S[ge in kk?ae.charAt(je++):ge],!$e||(X=$e(Y,le,X))<0)return-1}else if(ge!=le.charCodeAt(X++))return-1}return X}function C(Y,ae,le){var X=u.exec(ae.slice(le));return X?(Y.p=d.get(X[0].toLowerCase()),le+X[0].length):-1}function T(Y,ae,le){var X=p.exec(ae.slice(le));return X?(Y.w=g.get(X[0].toLowerCase()),le+X[0].length):-1}function L(Y,ae,le){var X=f.exec(ae.slice(le));return X?(Y.w=h.get(X[0].toLowerCase()),le+X[0].length):-1}function M(Y,ae,le){var X=y.exec(ae.slice(le));return X?(Y.m=b.get(X[0].toLowerCase()),le+X[0].length):-1}function B(Y,ae,le){var X=m.exec(ae.slice(le));return X?(Y.m=v.get(X[0].toLowerCase()),le+X[0].length):-1}function I(Y,ae,le){return _(Y,t,ae,le)}function F(Y,ae,le){return _(Y,n,ae,le)}function z(Y,ae,le){return _(Y,r,ae,le)}function R(Y){return o[Y.getDay()]}function O(Y){return a[Y.getDay()]}function U(Y){return c[Y.getMonth()]}function A(Y){return l[Y.getMonth()]}function Z(Y){return i[+(Y.getHours()>=12)]}function $(Y){return 1+~~(Y.getMonth()/3)}function P(Y){return o[Y.getUTCDay()]}function oe(Y){return a[Y.getUTCDay()]}function be(Y){return c[Y.getUTCMonth()]}function pe(Y){return l[Y.getUTCMonth()]}function Ce(Y){return i[+(Y.getUTCHours()>=12)]}function G(Y){return 1+~~(Y.getUTCMonth()/3)}return{format:function(Y){var ae=x(Y+="",w);return ae.toString=function(){return Y},ae},parse:function(Y){var ae=E(Y+="",!1);return ae.toString=function(){return Y},ae},utcFormat:function(Y){var ae=x(Y+="",k);return ae.toString=function(){return Y},ae},utcParse:function(Y){var ae=E(Y+="",!0);return ae.toString=function(){return Y},ae}}}var kk={"-":"",_:" ",0:"0"},Zt=/^\s*\d+/,y7=/^%/,v7=/[\\^$*+?|[\]().{}]/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 b7(e){return e.replace(v7,"\\$&")}function Fl(e){return new RegExp("^(?:"+e.map(b7).join("|")+")","i")}function Ul(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function x7(e,t,n){var r=Zt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function w7(e,t,n){var r=Zt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function S7(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function k7(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function N7(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Nk(e,t,n){var r=Zt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Ek(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 E7(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 _7(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 j7(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 _k(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function A7(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 jk(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function C7(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function T7(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function O7(e,t,n){var r=Zt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function P7(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 R7(e,t,n){var r=y7.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 I7(e,t,n){var r=Zt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Ak(e,t){return Ge(e.getDate(),t,2)}function $7(e,t){return Ge(e.getHours(),t,2)}function L7(e,t){return Ge(e.getHours()%12||12,t,2)}function D7(e,t){return Ge(1+Lu.count(Ci(e),e),t,3)}function AO(e,t){return Ge(e.getMilliseconds(),t,3)}function B7(e,t){return AO(e,t)+"000"}function z7(e,t){return Ge(e.getMonth()+1,t,2)}function F7(e,t){return Ge(e.getMinutes(),t,2)}function U7(e,t){return Ge(e.getSeconds(),t,2)}function W7(e){var t=e.getDay();return t===0?7:t}function H7(e,t){return Ge(Tp.count(Ci(e)-1,e),t,2)}function CO(e){var t=e.getDay();return t>=4||t===0?Io(e):Io.ceil(e)}function G7(e,t){return e=CO(e),Ge(Io.count(Ci(e),e)+(Ci(e).getDay()===4),t,2)}function q7(e){return e.getDay()}function K7(e,t){return Ge(nh.count(Ci(e)-1,e),t,2)}function V7(e,t){return Ge(e.getFullYear()%100,t,2)}function Y7(e,t){return e=CO(e),Ge(e.getFullYear()%100,t,2)}function X7(e,t){return Ge(e.getFullYear()%1e4,t,4)}function Z7(e,t){var n=e.getDay();return e=n>=4||n===0?Io(e):Io.ceil(e),Ge(e.getFullYear()%1e4,t,4)}function Q7(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ge(t/60|0,"0",2)+Ge(t%60,"0",2)}function Ck(e,t){return Ge(e.getUTCDate(),t,2)}function J7(e,t){return Ge(e.getUTCHours(),t,2)}function eV(e,t){return Ge(e.getUTCHours()%12||12,t,2)}function tV(e,t){return Ge(1+Cp.count(Ti(e),e),t,3)}function TO(e,t){return Ge(e.getUTCMilliseconds(),t,3)}function nV(e,t){return TO(e,t)+"000"}function rV(e,t){return Ge(e.getUTCMonth()+1,t,2)}function iV(e,t){return Ge(e.getUTCMinutes(),t,2)}function aV(e,t){return Ge(e.getUTCSeconds(),t,2)}function sV(e){var t=e.getUTCDay();return t===0?7:t}function oV(e,t){return Ge(Op.count(Ti(e)-1,e),t,2)}function OO(e){var t=e.getUTCDay();return t>=4||t===0?$o(e):$o.ceil(e)}function lV(e,t){return e=OO(e),Ge($o.count(Ti(e),e)+(Ti(e).getUTCDay()===4),t,2)}function cV(e){return e.getUTCDay()}function uV(e,t){return Ge(rh.count(Ti(e)-1,e),t,2)}function dV(e,t){return Ge(e.getUTCFullYear()%100,t,2)}function fV(e,t){return e=OO(e),Ge(e.getUTCFullYear()%100,t,2)}function hV(e,t){return Ge(e.getUTCFullYear()%1e4,t,4)}function pV(e,t){var n=e.getUTCDay();return e=n>=4||n===0?$o(e):$o.ceil(e),Ge(e.getUTCFullYear()%1e4,t,4)}function mV(){return"+0000"}function Tk(){return"%"}function Ok(e){return+e}function Pk(e){return Math.floor(+e/1e3)}var Bs,PO,RO;gV({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 gV(e){return Bs=g7(e),PO=Bs.format,Bs.parse,RO=Bs.utcFormat,Bs.utcParse,Bs}function yV(e){return new Date(e)}function vV(e){return e instanceof Date?+e:+new Date(+e)}function u0(e,t,n,r,i,a,o,l,c,u){var d=Xx(),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"),w=u("%B"),k=u("%Y");function S(x){return(c(x)<x?p:l(x)<x?g:o(x)<x?m:a(x)<x?v:r(x)<x?i(x)<x?y:b:n(x)<x?w:k)(x)}return d.invert=function(x){return new Date(f(x))},d.domain=function(x){return arguments.length?h(Array.from(x,vV)):h().map(yV)},d.ticks=function(x){var E=h();return e(E[0],E[E.length-1],x??10)},d.tickFormat=function(x,E){return E==null?S:u(E)},d.nice=function(x){var E=h();return(!x||typeof x.range!="function")&&(x=t(E[0],E[E.length-1],x??10)),x?h(bO(E,x)):d},d.copy=function(){return $u(d,u0(e,t,n,r,i,a,o,l,c,u))},d}function bV(){return Sr.apply(u0(p7,m7,Ci,l0,Tp,Lu,s0,i0,Ya,PO).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function xV(){return Sr.apply(u0(f7,h7,Ti,c0,Op,Cp,o0,a0,Ya,RO).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Pp(){var e=0,t=1,n,r,i,a,o=jn,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(fl),u.rangeRound=d(Yx),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 Sa(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function MO(){var e=wa(Pp()(jn));return e.copy=function(){return Sa(e,MO())},Ii.apply(e,arguments)}function IO(){var e=Jx(Pp()).domain([1,10]);return e.copy=function(){return Sa(e,IO()).base(e.base())},Ii.apply(e,arguments)}function $O(){var e=e0(Pp());return e.copy=function(){return Sa(e,$O()).constant(e.constant())},Ii.apply(e,arguments)}function d0(){var e=t0(Pp());return e.copy=function(){return Sa(e,d0()).exponent(e.exponent())},Ii.apply(e,arguments)}function wV(){return d0.apply(null,arguments).exponent(.5)}function LO(){var e=[],t=jn;function n(r){if(r!=null&&!isNaN(r=+r))return t((Mu(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(ua),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)=>oK(e,a/r))},n.copy=function(){return LO(t).domain(e)},Ii.apply(n,arguments)}function Rp(){var e=0,t=.5,n=1,r=1,i,a,o,l,c,u=jn,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,w;return arguments.length?([y,b,w]=v,u=RK(m,[y,b,w]),p):[u(0),u(.5),u(1)]}}return p.range=g(fl),p.rangeRound=g(Yx),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 DO(){var e=wa(Rp()(jn));return e.copy=function(){return Sa(e,DO())},Ii.apply(e,arguments)}function BO(){var e=Jx(Rp()).domain([.1,1,10]);return e.copy=function(){return Sa(e,BO()).base(e.base())},Ii.apply(e,arguments)}function zO(){var e=e0(Rp());return e.copy=function(){return Sa(e,zO()).constant(e.constant())},Ii.apply(e,arguments)}function f0(){var e=t0(Rp());return e.copy=function(){return Sa(e,f0()).exponent(e.exponent())},Ii.apply(e,arguments)}function SV(){return f0.apply(null,arguments).exponent(.5)}const Rk=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Kc,scaleDiverging:DO,scaleDivergingLog:BO,scaleDivergingPow:f0,scaleDivergingSqrt:SV,scaleDivergingSymlog:zO,scaleIdentity:vO,scaleImplicit:yv,scaleLinear:eh,scaleLog:xO,scaleOrdinal:qx,scalePoint:hc,scalePow:n0,scaleQuantile:kO,scaleQuantize:NO,scaleRadial:SO,scaleSequential:MO,scaleSequentialLog:IO,scaleSequentialPow:d0,scaleSequentialQuantile:LO,scaleSequentialSqrt:wV,scaleSequentialSymlog:$O,scaleSqrt:n7,scaleSymlog:wO,scaleThreshold:EO,scaleTime:bV,scaleUtc:xV,tickFormat:yO},Symbol.toStringTag,{value:"Module"}));var kV=il;function NV(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&&!kV(o):n(o,l)))var l=o,c=a}return c}var FO=NV;function EV(e,t){return e>t}var _V=EV,jV=FO,AV=_V,CV=dl;function TV(e){return e&&e.length?jV(e,CV,AV):void 0}var OV=TV;const Mp=Ze(OV);function PV(e,t){return e<t}var RV=PV,MV=FO,IV=RV,$V=dl;function LV(e){return e&&e.length?MV(e,$V,IV):void 0}var DV=LV;const Ip=Ze(DV);var BV=_x,zV=xa,FV=ZT,UV=zn;function WV(e,t){var n=UV(e)?BV:FV;return n(e,zV(t))}var HV=WV,GV=YT,qV=HV;function KV(e,t){return GV(qV(e,t),1)}var VV=KV;const YV=Ze(VV);var XV=Fx;function ZV(e,t){return XV(e,t)}var QV=ZV;const h0=Ze(QV);var hl=1e9,JV={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},m0,bt=!0,xr="[DecimalError] ",ns=xr+"Invalid argument: ",p0=xr+"Exponent out of range: ",pl=Math.floor,Ba=Math.pow,eY=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Qn,Kt=1e7,mt=7,UO=9007199254740991,ih=pl(UO/mt),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)*mt;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 ki(this,new this.constructor(e))};ve.dividedToIntegerBy=ve.idiv=function(e){var t=this,n=t.constructor;return st(ki(t,new n(e),0,1),n.precision)};ve.equals=ve.eq=function(e){return!this.cmp(e)};ve.exponent=function(){return Mt(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(Qn))throw Error(xr+"NaN");if(n.s<1)throw Error(xr+(n.s?"NaN":"-Infinity"));return n.eq(Qn)?new r(0):(bt=!1,t=ki(Qc(n,a),Qc(e,a),a),bt=!0,st(t,i))};ve.minus=ve.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?GO(t,e):WO(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(xr+"NaN");return n.s?(bt=!1,t=ki(n,e,0,1).times(e),bt=!0,n.minus(t)):st(new r(n),i)};ve.naturalExponential=ve.exp=function(){return HO(this)};ve.naturalLogarithm=ve.ln=function(){return Qc(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?WO(t,e):GO(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(ns+e);if(t=Mt(i)+1,r=i.d.length-1,n=r*mt+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(xr+"NaN")}for(e=Mt(l),bt=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=Qr(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=pl((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(ki(l,a,o+2)).times(.5),Qr(a.d).slice(0,o)===(t=Qr(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(st(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;o+=4}return bt=!0,st(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?st(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:(ri(e,0,hl),t===void 0?t=r.rounding:ri(t,0,8),st(n,e+Mt(n)+1,t))};ve.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=hs(r,!0):(ri(e,0,hl),t===void 0?t=i.rounding:ri(t,0,8),r=st(new i(r),e+1,t),n=hs(r,!0,e+1)),n};ve.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?hs(i):(ri(e,0,hl),t===void 0?t=a.rounding:ri(t,0,8),r=st(new a(i),e+Mt(i)+1,t),n=hs(r.abs(),!1,e+Mt(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};ve.toInteger=ve.toint=function(){var e=this,t=e.constructor;return st(new t(e),Mt(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(Qn);if(l=new c(l),!l.s){if(e.s<1)throw Error(xr+"Infinity");return l}if(l.eq(Qn))return l;if(r=c.precision,e.eq(Qn))return st(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=l.s,o){if((n=d<0?-d:d)<=UO){for(i=new c(Qn),t=Math.ceil(r/mt+4),bt=!1;n%2&&(i=i.times(l),Ik(i.d,t)),n=pl(n/2),n!==0;)l=l.times(l),Ik(l.d,t);return bt=!0,e.s<0?new c(Qn).div(i):st(i,r)}}else if(a<0)throw Error(xr+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,bt=!1,i=e.times(Qc(l,r+u)),bt=!0,i=HO(i),i.s=a,i};ve.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=Mt(i),r=hs(i,n<=a.toExpNeg||n>=a.toExpPos)):(ri(e,1,hl),t===void 0?t=a.rounding:ri(t,0,8),i=st(new a(i),e,t),n=Mt(i),r=hs(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):(ri(e,1,hl),t===void 0?t=r.rounding:ri(t,0,8)),st(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=Mt(e),n=e.constructor;return hs(e,t<=n.toExpNeg||t>=n.toExpPos)};function WO(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?st(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/mt),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?st(t,f):t}function ri(e,t,n){if(e!==~~e||e<t||e>n)throw Error(ns+e)}function Qr(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=mt-r.length,n&&(a+=Hi(n)),a+=r;o=e[t],r=o+"",n=mt-r.length,n&&(a+=Hi(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var ki=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,w,k,S,x,E,_,C=r.constructor,T=r.s==i.s?1:-1,L=r.d,M=i.d;if(!r.s)return new C(r);if(!i.s)throw Error(xr+"Division by zero");for(c=r.e-i.e,E=M.length,S=L.length,p=new C(T),g=p.d=[],u=0;M[u]==(L[u]||0);)++u;if(M[u]>(L[u]||0)&&--c,a==null?b=a=C.precision:o?b=a+(Mt(r)-Mt(i))+1:b=a,b<0)return new C(0);if(b=b/mt+2|0,u=0,E==1)for(d=0,M=M[0],b++;(u<S||d)&&b--;u++)w=d*Kt+(L[u]||0),g[u]=w/M|0,d=w%M|0;else{for(d=Kt/(M[0]+1)|0,d>1&&(M=e(M,d),L=e(L,d),E=M.length,S=L.length),k=E,m=L.slice(0,E),v=m.length;v<E;)m[v++]=0;_=M.slice(),_.unshift(0),x=M[0],M[1]>=Kt/2&&++x;do d=0,l=t(M,m,E,v),l<0?(y=m[0],E!=v&&(y=y*Kt+(m[1]||0)),d=y/x|0,d>1?(d>=Kt&&(d=Kt-1),f=e(M,d),h=f.length,v=m.length,l=t(f,m,h,v),l==1&&(d--,n(f,E<h?_:M,h))):(d==0&&(l=d=1),f=M.slice()),h=f.length,h<v&&f.unshift(0),n(m,f,v),l==-1&&(v=m.length,l=t(M,m,E,v),l<1&&(d++,n(m,E<v?_:M,v))),v=m.length):l===0&&(d++,m=[0]),g[u++]=d,l&&m[0]?m[v++]=L[k]||0:(m=[L[k]],v=1);while((k++<S||m[0]!==void 0)&&b--)}return g[0]||g.shift(),p.e=c,st(p,o?a+Mt(p)+1:a)}}();function HO(e,t){var n,r,i,a,o,l,c=0,u=0,d=e.constructor,f=d.precision;if(Mt(e)>16)throw Error(p0+Mt(e));if(!e.s)return new d(Qn);for(bt=!1,l=f,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(r=Math.log(Ba(2,u))/Math.LN10*2+5|0,l+=r,n=i=a=new d(Qn),d.precision=l;;){if(i=st(i.times(e),l),n=n.times(++c),o=a.plus(ki(i,n,l)),Qr(o.d).slice(0,l)===Qr(a.d).slice(0,l)){for(;u--;)a=st(a.times(a),l);return d.precision=f,t==null?(bt=!0,st(a,f)):a}a=o}}function Mt(e){for(var t=e.e*mt,n=e.d[0];n>=10;n/=10)t++;return t}function ng(e,t,n){if(t>e.LN10.sd())throw bt=!0,n&&(e.precision=n),Error(xr+"LN10 precision limit exceeded");return st(new e(e.LN10),t)}function Hi(e){for(var t="";e--;)t+="0";return t}function Qc(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(xr+(p.s?"NaN":"-Infinity"));if(p.eq(Qn))return new m(0);if(t==null?(bt=!1,u=v):u=t,p.eq(10))return t==null&&(bt=!0),ng(m,u);if(u+=h,m.precision=u,n=Qr(g),r=n.charAt(0),a=Mt(p),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)p=p.times(e),n=Qr(p.d),r=n.charAt(0),f++;a=Mt(p),r>1?(p=new m("0."+n),a++):p=new m(r+"."+n.slice(1))}else return c=ng(m,u+2,v).times(a+""),p=Qc(new m(r+"."+n.slice(1)),u-h).plus(c),m.precision=v,t==null?(bt=!0,st(p,v)):p;for(l=o=p=ki(p.minus(Qn),p.plus(Qn),u),d=st(p.times(p),u),i=3;;){if(o=st(o.times(d),u),c=l.plus(ki(o,new m(i),u)),Qr(c.d).slice(0,u)===Qr(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(ng(m,u+2,v).times(a+""))),l=ki(l,new m(f),u),m.precision=v,t==null?(bt=!0,st(l,v)):l;l=c,i+=2}}function Mk(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=pl(n/mt),e.d=[],r=(n+1)%mt,n<0&&(r+=mt),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=mt;r<i;)e.d.push(+t.slice(r,r+=mt));t=t.slice(r),r=mt-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),bt&&(e.e>ih||e.e<-ih))throw Error(p0+n)}else e.s=0,e.e=0,e.d=[0];return e}function st(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+=mt,i=t,u=f[d=0];else{if(d=Math.ceil((r+1)/mt),a=f.length,d>=a)return e;for(u=a=f[d],o=1;a>=10;a/=10)o++;r%=mt,i=r-mt+o}if(n!==void 0&&(a=Ba(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/Ba(10,o-i):0:f[d-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(a=Mt(e),f.length=1,t=t-a-1,f[0]=Ba(10,(mt-t%mt)%mt),e.e=pl(-t/mt)||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=Ba(10,mt-r),f[d]=i>0?(u/Ba(10,o-i)%Ba(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>ih||e.e<-ih))throw Error(p0+Mt(e));return e}function GO(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?st(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/mt),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?st(t,p):t):new h(0)}function hs(e,t,n){var r,i=Mt(e),a=Qr(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+Hi(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Hi(-i-1)+a,n&&(r=n-o)>0&&(a+=Hi(r))):i>=o?(a+=Hi(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+Hi(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=Hi(r))),e.s<0?"-"+a:a}function Ik(e,t){if(e.length>t)return e.length=t,!0}function qO(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(ns+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 Mk(o,a.toString())}else if(typeof a!="string")throw Error(ns+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,eY.test(a))Mk(o,a);else throw Error(ns+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=qO,i.config=i.set=tY,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 tY(e){if(!e||typeof e!="object")throw Error(xr+"Object expected");var t,n,r,i=["precision",1,hl,"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(pl(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(ns+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(ns+n+": "+r);return this}var m0=qO(JV);Qn=new m0(1);const rt=m0;function nY(e){return sY(e)||aY(e)||iY(e)||rY()}function rY(){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 iY(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 aY(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function sY(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}var oY=function(t){return t},KO={},VO=function(t){return t===KO},$k=function(t){return function n(){return arguments.length===0||arguments.length===1&&VO(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},lY=function e(t,n){return t===1?n:$k(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!==KO}).length;return o>=t?n.apply(void 0,i):e(t-o,$k(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 VO(f)?c.shift():f});return n.apply(void 0,nY(d).concat(c))}))})},$p=function(t){return lY(t.length,t)},Sv=function(t,n){for(var r=[],i=t;i<n;++i)r[i-t]=i;return r},cY=$p(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),uY=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return oY;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))}},kv=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},YO=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 dY(e){var t;return e===0?t=1:t=Math.floor(new rt(e).abs().log(10).toNumber())+1,t}function fY(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 hY=$p(function(e,t,n){var r=+e,i=+t;return r+n*(i-r)}),pY=$p(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),mY=$p(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const Lp={rangeStep:fY,getDigitCount:dY,interpolateNumber:hY,uninterpolateNumber:pY,uninterpolateTruncation:mY};function Nv(e){return vY(e)||yY(e)||XO(e)||gY()}function gY(){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 yY(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function vY(e){if(Array.isArray(e))return Ev(e)}function Jc(e,t){return wY(e)||xY(e,t)||XO(e,t)||bY()}function bY(){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 XO(e,t){if(e){if(typeof e=="string")return Ev(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 Ev(e,t)}}function Ev(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 xY(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 wY(e){if(Array.isArray(e))return e}function ZO(e){var t=Jc(e,2),n=t[0],r=t[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]}function QO(e,t,n){if(e.lte(0))return new rt(0);var r=Lp.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 SY(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(Lp.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=uY(cY(function(c){return i.add(new rt(c-o).mul(r)).toNumber()}),Sv);return l(0,t)}function JO(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=QO(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?JO(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 kY(e){var t=Jc(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=ZO([n,r]),c=Jc(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(Nv(Sv(0,i-1).map(function(){return 1/0}))):[].concat(Nv(Sv(0,i-1).map(function(){return-1/0})),[d]);return n>r?kv(f):f}if(u===d)return SY(u,i,a);var h=JO(u,d,o,a),p=h.step,g=h.tickMin,m=h.tickMax,v=Lp.rangeStep(g,m.add(new rt(.1).mul(p)),p);return n>r?kv(v):v}function NY(e,t){var n=Jc(e,2),r=n[0],i=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=ZO([r,i]),l=Jc(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=QO(new rt(u).sub(c).div(d-1),a,0),h=[].concat(Nv(Lp.rangeStep(new rt(c),new rt(u).sub(new rt(.99).mul(f)),f)),[u]);return r>i?kv(h):h}var EY=YO(kY),_Y=YO(NY),jY="Invariant failed";function ps(e,t){throw new Error(jY)}var AY=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];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 ah(){return ah=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},ah.apply(this,arguments)}function CY(e,t){return RY(e)||PY(e,t)||OY(e,t)||TY()}function TY(){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 OY(e,t){if(e){if(typeof e=="string")return Lk(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 Lk(e,t)}}function Lk(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 PY(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 RY(e){if(Array.isArray(e))return e}function MY(e,t){if(e==null)return{};var n=IY(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 IY(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 $Y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LY(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,nP(r.key),r)}}function DY(e,t,n){return t&&LY(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function BY(e,t,n){return t=sh(t),zY(e,eP()?Reflect.construct(t,n||[],sh(e).constructor):t.apply(e,n))}function zY(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 FY(e)}function FY(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(eP=function(){return!!e})()}function sh(e){return sh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},sh(e)}function UY(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 tP(e,t,n){return t=nP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nP(e){var t=WY(e,"string");return Lo(t)=="symbol"?t:t+""}function WY(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)}var Dp=function(e){function t(){return $Y(this,t),BY(this,t,arguments)}return UY(t,e),DY(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,AY),p=Ke(h,!1);this.props.direction==="x"&&d.type!=="number"&&ps();var g=c.map(function(m){var v=u(m,l),y=v.x,b=v.y,w=v.value,k=v.errorVal;if(!k)return null;var S=[],x,E;if(Array.isArray(k)){var _=CY(k,2);x=_[0],E=_[1]}else x=E=k;if(a==="vertical"){var C=d.scale,T=b+i,L=T+o,M=T-o,B=C(w-x),I=C(w+E);S.push({x1:I,y1:L,x2:I,y2:M}),S.push({x1:B,y1:T,x2:I,y2:T}),S.push({x1:B,y1:L,x2:B,y2:M})}else if(a==="horizontal"){var F=f.scale,z=y+i,R=z-o,O=z+o,U=F(w-x),A=F(w+E);S.push({x1:R,y1:A,x2:O,y2:A}),S.push({x1:z,y1:U,x2:z,y2:A}),S.push({x1:R,y1:U,x2:O,y2:U})}return H.createElement(Yt,ah({className:"recharts-errorBar",key:"bar-".concat(S.map(function(Z){return"".concat(Z.x1,"-").concat(Z.x2,"-").concat(Z.y1,"-").concat(Z.y2)}))},p),S.map(function(Z){return H.createElement("line",ah({},Z,{key:"line-".concat(Z.x1,"-").concat(Z.x2,"-").concat(Z.y1,"-").concat(Z.y2)}))}))});return H.createElement(Yt,{className:"recharts-errorBars"},g)}}])}(H.Component);tP(Dp,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});tP(Dp,"displayName","ErrorBar");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 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 Oa(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){HY(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 HY(e,t,n){return t=GY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GY(e){var t=qY(e,"string");return eu(t)=="symbol"?t:t+""}function qY(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 rP=function(t){var n=t.children,r=t.formattedGraphicalItems,i=t.legendWidth,a=t.legendContent,o=Zn(n,es);if(!o)return null;var l=es.defaultProps,c=l!==void 0?Oa(Oa({},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?Oa(Oa({},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:g0(f),value:m||g,payload:p}}),Oa(Oa(Oa({},c),es.getWithHeight(o,i)),{},{payload:u,item:o})};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 Bk(e){return XY(e)||YY(e)||VY(e)||KY()}function KY(){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 VY(e,t){if(e){if(typeof e=="string")return jv(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 jv(e,t)}}function YY(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function XY(e){if(Array.isArray(e))return jv(e)}function jv(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 zk(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 jt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zk(Object(n),!0).forEach(function(r){bo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bo(e,t,n){return t=ZY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZY(e){var t=QY(e,"string");return tu(t)=="symbol"?t:t+""}function QY(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 ii(e,t,n){return Ye(e)||Ye(t)?n:Ht(t)?yr(e,t,n):Le(t)?t(e):n}function pc(e,t,n,r){var i=YV(e,function(l){return ii(l,t)});if(n==="number"){var a=i.filter(function(l){return de(l)||parseFloat(l)});return a.length?[Ip(a),Mp(a)]:[1/0,-1/0]}var o=r?i.filter(function(l){return!Ye(l)}):i;return o.map(function(l){return Ht(l)||l instanceof Date?l:""})}var JY=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(Pr(f-d)!==Pr(h-f)){var g=[];if(Pr(h-f)===Pr(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),w=Math.max(d,h);if(t>(b+f)/2&&t<=(w+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},g0=function(t){var n,r=t,i=r.type.displayName,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?jt(jt({},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},eX=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(E){return wi(E.type).indexOf("Bar")>=0});if(y&&y.length){var b=y[0].type.defaultProps,w=b!==void 0?jt(jt({},b),y[0].props):y[0].props,k=w.barSize,S=w[v];o[S]||(o[S]=[]);var x=Ye(k)?n:k;o[S].push({item:y[0],stackList:y.slice(1),barSize:Ye(x)?void 0:fs(x,r,0)})}}return o},tX=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=fs(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 x={item:S.item,position:{offset:v.offset+v.size+u,size:h?p:S.barSize}},E=[].concat(Bk(k),[x]);return v=E[E.length-1].position,S.stackList&&S.stackList.length&&S.stackList.forEach(function(_){E.push({item:_,position:v})}),E},f)}else{var y=fs(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 w=l===+l?Math.min(b,l):b;d=o.reduce(function(k,S,x){var E=[].concat(Bk(k),[{item:S.item,position:{offset:y+(b+u)*x+(b-w)/2,size:w}}]);return S.stackList&&S.stackList.length&&S.stackList.forEach(function(_){E.push({item:_,position:E[E.length-1].position})}),E},f)}return d},nX=function(t,n,r,i){var a=r.children,o=r.width,l=r.margin,c=o-(l.left||0)-(l.right||0),u=rP({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"&&de(t[p]))return jt(jt({},t),{},bo({},p,t[p]+(f||0)));if((m==="horizontal"||m==="vertical"&&p==="center")&&g!=="middle"&&de(t[g]))return jt(jt({},t),{},bo({},g,t[g]+(h||0)))}return t},rX=function(t,n,r){return Ye(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},iP=function(t,n,r,i,a){var o=n.props.children,l=Ir(o,Dp).filter(function(u){return rX(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=ii(d,r);if(Ye(f))return u;var h=Array.isArray(f)?[Ip(f),Mp(f)]:[f,f],p=c.reduce(function(g,m){var v=ii(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},iX=function(t,n,r,i,a){var o=n.map(function(l){return iP(t,l,r,a,i)}).filter(function(l){return!Ye(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},aP=function(t,n,r,i,a){var o=n.map(function(c){var u=c.props.dataKey;return r==="number"&&u&&iP(t,c,u,i)||pc(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},[])},sP=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},oP=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},bi=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?Pr(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!Ou(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}})},rg=new WeakMap,kd=function(t,n){if(typeof n!="function")return t;rg.has(t)||rg.set(t,new WeakMap);var r=rg.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},aX=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:Kc(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:eh(),realScaleType:"linear"}:a==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:hc(),realScaleType:"point"}:a==="category"?{scale:Kc(),realScaleType:"band"}:{scale:eh(),realScaleType:"linear"};if(ds(i)){var c="scale".concat(wp(i));return{scale:(Rk[c]||hc)(),realScaleType:Rk[c]?c:"point"}}return Le(i)?{scale:i}:{scale:hc(),realScaleType:"point"}},Fk=1e-4,sX=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])-Fk,o=Math.max(i[0],i[1])+Fk,l=t(n[0]),c=t(n[r-1]);(l<a||l>o||c<a||c>o)&&t.domain([n[0],n[r-1]])}},oX=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},lX=function(t,n){if(!n||n.length!==2||!de(n[0])||!de(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(!de(t[0])||t[0]<r)&&(a[0]=r),(!de(t[1])||t[1]>i)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]<r&&(a[1]=r),a},cX=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=Ou(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])}},uX=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=Ou(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)}},dX={sign:cX,expand:_6,none:Co,silhouette:j6,wiggle:A6,positive:uX},fX=function(t,n,r){var i=n.map(function(l){return l.props.dataKey}),a=dX[r],o=E6().keys(i).value(function(l,c){return+ii(l,c,0)}).order(Qy).offset(a);return o(t)},hX=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?jt(jt({},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(Ht(m)){var w=b.stackGroups[m]||{numericAxisId:r,cateAxisId:i,items:[]};w.items.push(h),b.hasStack=!0,b.stackGroups[m]=w}else b.stackGroups[xp("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[h]};return jt(jt({},f),{},bo({},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 jt(jt({},m),{},bo({},v,{numericAxisId:r,cateAxisId:i,items:y.items,stackedData:fX(t,y.items,a)}))},g)}return jt(jt({},f),{},bo({},h,p))},d)},pX=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=EY(u,a,l);return t.domain([Ip(d),Mp(d)]),{niceTicks:d}}if(a&&i==="number"){var f=t.domain(),h=_Y(f,a,l);return{niceTicks:h}}return null},Uk=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=ii(o,n.dataKey,n.domain[l]);return Ye(c)?null:n.scale(c)-a/2+i},mX=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]},gX=function(t,n){var r,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?jt(jt({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(Ht(a)){var o=n[a];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},yX=function(t){return t.reduce(function(n,r){return[Ip(r.concat([n[0]]).filter(de)),Mp(r.concat([n[1]]).filter(de))]},[1/0,-1/0])},lP=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=yX(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})},Wk=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Hk=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Av=function(t,n,r){if(Le(t))return t(n,r);if(!Array.isArray(t))return n;var i=[];if(de(t[0]))i[0]=r?t[0]:Math.min(t[0],n[0]);else if(Wk.test(t[0])){var a=+Wk.exec(t[0])[1];i[0]=n[0]-a}else Le(t[0])?i[0]=t[0](n[0]):i[0]=n[0];if(de(t[1]))i[1]=r?t[1]:Math.max(t[1],n[1]);else if(Hk.test(t[1])){var o=+Hk.exec(t[1])[1];i[1]=n[1]+o}else Le(t[1])?i[1]=t[1](n[1]):i[1]=n[1];return i},oh=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=Wx(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},Gk=function(t,n,r){return!t||!t.length||h0(t,yr(r,"type.defaultProps.domain"))?n:t},cP=function(t,n){var r=t.type.defaultProps?jt(jt({},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 jt(jt({},Ke(t,!1)),{},{dataKey:i,unit:o,formatter:l,name:a||i,color:g0(t),value:ii(n,i),type:c,payload:n,chartType:u,hide:d})};function nu(e){"@babel/helpers - typeof";return nu=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},nu(e)}function qk(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 Kk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qk(Object(n),!0).forEach(function(r){vX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vX(e,t,n){return t=bX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bX(e){var t=xX(e,"string");return nu(t)=="symbol"?t:t+""}function xX(e,t){if(nu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lh=Math.PI/180,wX=function(t){return t*180/Math.PI},an=function(t,n,r,i){return{x:t+Math.cos(-lh*i)*r,y:n+Math.sin(-lh*i)*r}},SX=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))},kX=function(t,n){var r=t.x,i=t.y,a=n.cx,o=n.cy,l=SX({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:wX(u),angleInRadian:u}},NX=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}},EX=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},Vk=function(t,n){var r=t.x,i=t.y,a=kX({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=NX(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?Kk(Kk({},n),{},{radius:o,angle:EX(p,n)}):null};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)}var _X=["offset"];function jX(e){return OX(e)||TX(e)||CX(e)||AX()}function AX(){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 CX(e,t){if(e){if(typeof e=="string")return Cv(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 Cv(e,t)}}function TX(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function OX(e){if(Array.isArray(e))return Cv(e)}function Cv(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 PX(e,t){if(e==null)return{};var n=RX(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 RX(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 Yk(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 Ft(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Yk(Object(n),!0).forEach(function(r){MX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MX(e,t,n){return t=IX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IX(e){var t=$X(e,"string");return ru(t)=="symbol"?t:t+""}function $X(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)}function iu(){return iu=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},iu.apply(this,arguments)}var LX=function(t){var n=t.value,r=t.formatter,i=Ye(t.children)?n:t.children;return Le(r)?r(i):i},DX=function(t,n){var r=Pr(n-t),i=Math.min(Math.abs(n-t),360);return r*i},BX=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=DX(p,g),b=y>=0?1:-1,w,k;i==="insideStart"?(w=p+b*o,k=m):i==="insideEnd"?(w=g-b*o,k=!m):i==="end"&&(w=g+b*o,k=m),k=y<=0?k:!k;var S=an(u,d,v,w),x=an(u,d,v,w+(k?1:-1)*359),E="M".concat(S.x,",").concat(S.y,`
93
+ A`).concat(v,",").concat(v,",0,1,").concat(k?0:1,`,
94
+ `).concat(x.x,",").concat(x.y),_=Ye(t.id)?xp("recharts-radial-line-"):t.id;return H.createElement("text",iu({},r,{dominantBaseline:"central",className:Ve("recharts-radial-bar-label",l)}),H.createElement("defs",null,H.createElement("path",{id:_,d:E})),H.createElement("textPath",{xlinkHref:"#".concat(_)},n))},zX=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=an(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=an(o,l,v,h),b=y.x,w=y.y;return{x:b,y:w,textAnchor:"middle",verticalAnchor:"middle"}},FX=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 w={x:l+u/2,y:c-f*i,textAnchor:"middle",verticalAnchor:p};return Ft(Ft({},w),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 Ft(Ft({},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 Ft(Ft({},S),r?{width:Math.max(S.x-r.x,0),height:d}:{})}if(a==="right"){var x={x:l+u+v,y:c+d/2,textAnchor:b,verticalAnchor:"middle"};return Ft(Ft({},x),r?{width:Math.max(r.x+r.width-x.x,0),height:d}:{})}var E=r?{width:u,height:d}:{};return a==="insideLeft"?Ft({x:l+v,y:c+d/2,textAnchor:b,verticalAnchor:"middle"},E):a==="insideRight"?Ft({x:l+u-v,y:c+d/2,textAnchor:y,verticalAnchor:"middle"},E):a==="insideTop"?Ft({x:l+u/2,y:c+h,textAnchor:"middle",verticalAnchor:g},E):a==="insideBottom"?Ft({x:l+u/2,y:c+d-h,textAnchor:"middle",verticalAnchor:p},E):a==="insideTopLeft"?Ft({x:l+v,y:c+h,textAnchor:b,verticalAnchor:g},E):a==="insideTopRight"?Ft({x:l+u-v,y:c+h,textAnchor:y,verticalAnchor:g},E):a==="insideBottomLeft"?Ft({x:l+v,y:c+d-h,textAnchor:b,verticalAnchor:p},E):a==="insideBottomRight"?Ft({x:l+u-v,y:c+d-h,textAnchor:y,verticalAnchor:p},E):al(a)&&(de(a.x)||Ka(a.x))&&(de(a.y)||Ka(a.y))?Ft({x:l+fs(a.x,u),y:c+fs(a.y,d),textAnchor:"end",verticalAnchor:"end"},E):Ft({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},E)},UX=function(t){return"cx"in t&&de(t.cx)};function gn(e){var t=e.offset,n=t===void 0?5:t,r=PX(e,_X),i=Ft({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||Ye(l)&&Ye(c)&&!N.isValidElement(u)&&!Le(u))return null;if(N.isValidElement(u))return N.cloneElement(u,i);var p;if(Le(u)){if(p=N.createElement(u,i),N.isValidElement(p))return p}else p=LX(i);var g=UX(a),m=Ke(i,!0);if(g&&(o==="insideStart"||o==="insideEnd"||o==="end"))return BX(i,p,m);var v=g?zX(i):FX(i);return H.createElement(qf,iu({className:Ve("recharts-label",f)},m,v,{breakAll:h}),p)}gn.displayName="Label";var uP=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(de(m)&&de(v)){if(de(f)&&de(h))return{x:f,y:h,width:m,height:v};if(de(p)&&de(g))return{x:p,y:g,width:m,height:v}}return de(f)&&de(h)?{x:f,y:h,width:0,height:0}:de(n)&&de(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:{}},WX=function(t,n){return t?t===!0?H.createElement(gn,{key:"label-implicit",viewBox:n}):Ht(t)?H.createElement(gn,{key:"label-implicit",viewBox:n,value:t}):N.isValidElement(t)?t.type===gn?N.cloneElement(t,{key:"label-implicit",viewBox:n}):H.createElement(gn,{key:"label-implicit",content:t,viewBox:n}):Le(t)?H.createElement(gn,{key:"label-implicit",content:t,viewBox:n}):al(t)?H.createElement(gn,iu({viewBox:n},t,{key:"label-implicit"})):null:null},HX=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=uP(t),o=Ir(i,gn).map(function(c,u){return N.cloneElement(c,{viewBox:n||a,key:"label-".concat(u)})});if(!r)return o;var l=WX(t.label,n||a);return[l].concat(jX(o))};gn.parseViewBox=uP;gn.renderCallByParent=HX;function GX(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var qX=GX;const KX=Ze(qX);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)}var VX=["valueAccessor"],YX=["data","dataKey","clockWise","id","textBreakAll"];function XX(e){return eZ(e)||JX(e)||QX(e)||ZX()}function ZX(){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 QX(e,t){if(e){if(typeof e=="string")return Tv(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 Tv(e,t)}}function JX(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function eZ(e){if(Array.isArray(e))return Tv(e)}function Tv(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 ch(){return ch=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},ch.apply(this,arguments)}function Xk(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 Zk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Xk(Object(n),!0).forEach(function(r){tZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tZ(e,t,n){return t=nZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nZ(e){var t=rZ(e,"string");return au(t)=="symbol"?t:t+""}function rZ(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)}function Qk(e,t){if(e==null)return{};var n=iZ(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 iZ(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 aZ=function(t){return Array.isArray(t.value)?KX(t.value):t.value};function rs(e){var t=e.valueAccessor,n=t===void 0?aZ:t,r=Qk(e,VX),i=r.data,a=r.dataKey,o=r.clockWise,l=r.id,c=r.textBreakAll,u=Qk(r,YX);return!i||!i.length?null:H.createElement(Yt,{className:"recharts-label-list"},i.map(function(d,f){var h=Ye(a)?n(d,f):ii(d&&d.payload,a),p=Ye(l)?{}:{id:"".concat(l,"-").concat(f)};return H.createElement(gn,ch({},Ke(d,!0),u,p,{parentViewBox:d.parentViewBox,value:h,textBreakAll:c,viewBox:gn.parseViewBox(Ye(o)?d:Zk(Zk({},d),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}rs.displayName="LabelList";function sZ(e,t){return e?e===!0?H.createElement(rs,{key:"labelList-implicit",data:t}):H.isValidElement(e)||Le(e)?H.createElement(rs,{key:"labelList-implicit",data:t,content:e}):al(e)?H.createElement(rs,ch({data:t},e,{key:"labelList-implicit"})):null:null}function oZ(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=Ir(r,rs).map(function(o,l){return N.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!n)return i;var a=sZ(e.label,t);return[a].concat(XX(i))}rs.renderCallByParent=oZ;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 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)}function Jk(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 eN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Jk(Object(n),!0).forEach(function(r){lZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lZ(e,t,n){return t=cZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cZ(e){var t=uZ(e,"string");return su(t)=="symbol"?t:t+""}function uZ(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)}var dZ=function(t,n){var r=Pr(n-t),i=Math.min(Math.abs(n-t),359.999);return r*i},Nd=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)/lh,h=u?a:a+o*f,p=an(n,r,d,h),g=an(n,r,i,h),m=u?a-o*f:a,v=an(n,r,d*Math.cos(f*lh),m);return{center:p,circleTangency:g,lineTangency:v,theta:f}},dP=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.startAngle,l=t.endAngle,c=dZ(o,l),u=o+c,d=an(n,r,a,o),f=an(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=an(n,r,i,o),g=an(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},fZ=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=Pr(d-u),h=Nd({cx:n,cy:r,radius:a,angle:u,sign:f,cornerRadius:o,cornerIsExternal:c}),p=h.circleTangency,g=h.lineTangency,m=h.theta,v=Nd({cx:n,cy:r,radius:a,angle:d,sign:-f,cornerRadius:o,cornerIsExternal:c}),y=v.circleTangency,b=v.lineTangency,w=v.theta,k=c?Math.abs(u-d):Math.abs(u-d)-m-w;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
+ `):dP({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 x=Nd({cx:n,cy:r,radius:i,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),E=x.circleTangency,_=x.lineTangency,C=x.theta,T=Nd({cx:n,cy:r,radius:i,angle:d,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),L=T.circleTangency,M=T.lineTangency,B=T.theta,I=c?Math.abs(u-d):Math.abs(u-d)-C-B;if(I<0&&o===0)return"".concat(S,"L").concat(n,",").concat(r,"Z");S+="L".concat(M.x,",").concat(M.y,`
110
+ A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(L.x,",").concat(L.y,`
111
+ A`).concat(i,",").concat(i,",0,").concat(+(I>180),",").concat(+(f>0),",").concat(E.x,",").concat(E.y,`
112
+ A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(_.x,",").concat(_.y,"Z")}else S+="L".concat(n,",").concat(r,"Z");return S},hZ={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},fP=function(t){var n=eN(eN({},hZ),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=Ve("recharts-sector",h),g=o-a,m=fs(l,g,0,!0),v;return m>0&&Math.abs(d-f)<360?v=fZ({cx:r,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(m,g/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):v=dP({cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:d,endAngle:f}),H.createElement("path",Ov({},Ke(n,!0),{className:p,d:v,role:"img"}))};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 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 tN(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 nN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tN(Object(n),!0).forEach(function(r){pZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pZ(e,t,n){return t=mZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mZ(e){var t=gZ(e,"string");return ou(t)=="symbol"?t:t+""}function gZ(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(t==="string"?String:Number)(e)}var rN={curveBasisClosed:p6,curveBasisOpen:m6,curveBasis:h6,curveBumpX:JF,curveBumpY:e6,curveLinearClosed:g6,curveLinear:kp,curveMonotoneX:y6,curveMonotoneY:v6,curveNatural:b6,curveStep:x6,curveStepAfter:S6,curveStepBefore:w6},Ed=function(t){return t.x===+t.x&&t.y===+t.y},Wl=function(t){return t.x},Hl=function(t){return t.y},yZ=function(t,n){if(Le(t))return t;var r="curve".concat(wp(t));return(r==="curveMonotone"||r==="curveBump")&&n?rN["".concat(r).concat(n==="vertical"?"Y":"X")]:rN[r]||kp},vZ=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=yZ(r,l),f=u?a.filter(function(m){return Ed(m)}):a,h;if(Array.isArray(o)){var p=u?o.filter(function(m){return Ed(m)}):o,g=f.map(function(m,v){return nN(nN({},m),{},{base:p[v]})});return l==="vertical"?h=md().y(Hl).x1(Wl).x0(function(m){return m.base.x}):h=md().x(Wl).y1(Hl).y0(function(m){return m.base.y}),h.defined(Ed).curve(d),h(g)}return l==="vertical"&&de(o)?h=md().y(Hl).x1(Wl).x0(o):de(o)?h=md().x(Wl).y1(Hl).y0(o):h=pT().x(Wl).y(Hl),h.defined(Ed).curve(d),h(f)},iN=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?vZ(t):i;return N.createElement("path",Pv({},Ke(t,!1),Of(t),{className:Ve("recharts-curve",n),d:o,ref:a}))},hP={exports:{}},bZ="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",xZ=bZ,wZ=xZ;function pP(){}function mP(){}mP.resetWarningCache=pP;var SZ=function(){function e(r,i,a,o,l,c){if(c!==wZ){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:mP,resetWarningCache:pP};return n.PropTypes=n,n};hP.exports=SZ();var kZ=hP.exports;const Xe=Ze(kZ),{getOwnPropertyNames:NZ,getOwnPropertySymbols:EZ}=Object,{hasOwnProperty:_Z}=Object.prototype;function ig(e,t){return function(r,i,a){return e(r,i,a)&&t(r,i,a)}}function _d(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 jZ(e){return e!=null?e[Symbol.toStringTag]:void 0}function aN(e){return NZ(e).concat(EZ(e))}const AZ=Object.hasOwn||((e,t)=>_Z.call(e,t));function Ss(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const CZ="__v",TZ="__o",OZ="_owner",{getOwnPropertyDescriptor:sN,keys:oN}=Object;function PZ(e,t){return e.byteLength===t.byteLength&&uh(new Uint8Array(e),new Uint8Array(t))}function RZ(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&&uh(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function IZ(e,t){return Ss(e.getTime(),t.getTime())}function $Z(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function LZ(e,t){return e===t}function lN(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 DZ=Ss;function BZ(e,t,n){const r=oN(e);let i=r.length;if(oN(t).length!==i)return!1;for(;i-- >0;)if(!gP(e,t,n,r[i]))return!1;return!0}function Gl(e,t,n){const r=aN(e);let i=r.length;if(aN(t).length!==i)return!1;let a,o,l;for(;i-- >0;)if(a=r[i],!gP(e,t,n,a)||(o=sN(e,a),l=sN(t,a),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function zZ(e,t){return Ss(e.valueOf(),t.valueOf())}function FZ(e,t){return e.source===t.source&&e.flags===t.flags}function cN(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 uh(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 UZ(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 gP(e,t,n,r){return(r===OZ||r===TZ||r===CZ)&&(e.$$typeof||t.$$typeof)?!0:AZ(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const WZ="[object ArrayBuffer]",HZ="[object Arguments]",GZ="[object Boolean]",qZ="[object DataView]",KZ="[object Date]",VZ="[object Error]",YZ="[object Map]",XZ="[object Number]",ZZ="[object Object]",QZ="[object RegExp]",JZ="[object Set]",eQ="[object String]",tQ={"[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},nQ="[object URL]",rQ=Object.prototype.toString;function iQ({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 w=typeof v;if(w!==typeof y)return!1;if(w!=="object")return w==="number"?l(v,y,b):w==="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=rQ.call(v);if(S===KZ)return r(v,y,b);if(S===QZ)return d(v,y,b);if(S===YZ)return o(v,y,b);if(S===JZ)return f(v,y,b);if(S===ZZ)return typeof v.then!="function"&&typeof y.then!="function"&&c(v,y,b);if(S===nQ)return p(v,y,b);if(S===VZ)return i(v,y,b);if(S===HZ)return c(v,y,b);if(tQ[S])return h(v,y,b);if(S===WZ)return e(v,y,b);if(S===qZ)return n(v,y,b);if(S===GZ||S===XZ||S===eQ)return u(v,y,b);if(g){let x=g[S];if(!x){const E=jZ(v);E&&(x=g[E])}if(x)return x(v,y,b)}return!1}}function aQ({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:PZ,areArraysEqual:n?Gl:RZ,areDataViewsEqual:MZ,areDatesEqual:IZ,areErrorsEqual:$Z,areFunctionsEqual:LZ,areMapsEqual:n?ig(lN,Gl):lN,areNumbersEqual:DZ,areObjectsEqual:n?Gl:BZ,arePrimitiveWrappersEqual:zZ,areRegExpsEqual:FZ,areSetsEqual:n?ig(cN,Gl):cN,areTypedArraysEqual:n?ig(uh,Gl):uh,areUrlsEqual:UZ,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const i=_d(r.areArraysEqual),a=_d(r.areMapsEqual),o=_d(r.areObjectsEqual),l=_d(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:l})}return r}function sQ(e){return function(t,n,r,i,a,o,l){return e(t,n,l)}}function oQ({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 lQ=ka();ka({strict:!0});ka({circular:!0});ka({circular:!0,strict:!0});ka({createInternalComparator:()=>Ss});ka({strict:!0,createInternalComparator:()=>Ss});ka({circular:!0,createInternalComparator:()=>Ss});ka({circular:!0,createInternalComparator:()=>Ss,strict:!0});function ka(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=aQ(e),o=iQ(a),l=n?n(o):sQ(o);return oQ({circular:t,comparator:o,createState:r,equals:l,strict:i})}function cQ(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function uN(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):cQ(i)};requestAnimationFrame(r)}function Rv(e){"@babel/helpers - typeof";return Rv=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},Rv(e)}function uQ(e){return pQ(e)||hQ(e)||fQ(e)||dQ()}function dQ(){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 fQ(e,t){if(e){if(typeof e=="string")return dN(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 dN(e,t)}}function dN(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 hQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pQ(e){if(Array.isArray(e))return e}function mQ(){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=uQ(o),c=l[0],u=l.slice(1);if(typeof c=="number"){uN(i.bind(null,u),c);return}i(c),uN(i.bind(null,u));return}Rv(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 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 fN(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 hN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fN(Object(n),!0).forEach(function(r){yP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yP(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 lu(t)==="symbol"?t:String(t)}function yQ(e,t){if(lu(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(lu(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var vQ=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,i){return r.filter(function(a){return i.includes(a)})})},bQ=function(t){return t},xQ=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},mc=function(t,n){return Object.keys(n).reduce(function(r,i){return hN(hN({},r),{},yP({},i,t(i,n[i])))},{})},pN=function(t,n,r){return t.map(function(i){return"".concat(xQ(i)," ").concat(n,"ms ").concat(r)}).join(",")};function wQ(e,t){return NQ(e)||kQ(e,t)||vP(e,t)||SQ()}function SQ(){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 kQ(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 NQ(e){if(Array.isArray(e))return e}function EQ(e){return AQ(e)||jQ(e)||vP(e)||_Q()}function _Q(){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 vP(e,t){if(e){if(typeof e=="string")return Mv(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 Mv(e,t)}}function jQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function AQ(e){if(Array.isArray(e))return Mv(e)}function Mv(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 dh=1e-4,bP=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},xP=function(t,n){return t.map(function(r,i){return r*Math.pow(n,i)}).reduce(function(r,i){return r+i})},mN=function(t,n){return function(r){var i=bP(t,n);return xP(i,r)}},CQ=function(t,n){return function(r){var i=bP(t,n),a=[].concat(EQ(i.map(function(o,l){return o*l}).slice(1)),[0]);return xP(a,r)}},gN=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=wQ(u,4);i=d[0],a=d[1],o=d[2],l=d[3]}}}var f=mN(i,o),h=mN(a,l),p=CQ(i,o),g=function(y){return y>1?1:y<0?0:y},m=function(y){for(var b=y>1?1:y,w=b,k=0;k<8;++k){var S=f(w)-b,x=p(w);if(Math.abs(S-b)<dh||x<dh)return h(w);w=g(w-S/x)}return h(w)};return m.isStepper=!1,m},TQ=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)<dh&&Math.abs(m)<dh?[f,0]:[v,m]};return c.isStepper=!0,c.dt=l,c},OQ=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 gN(i);case"spring":return TQ();default:if(i.split("(")[0]==="cubic-bezier")return gN(i)}return typeof i=="function"?i:null};function cu(e){"@babel/helpers - typeof";return cu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cu(e)}function yN(e){return MQ(e)||RQ(e)||wP(e)||PQ()}function PQ(){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 RQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function MQ(e){if(Array.isArray(e))return $v(e)}function vN(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 nn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vN(Object(n),!0).forEach(function(r){Iv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Iv(e,t,n){return t=IQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IQ(e){var t=$Q(e,"string");return cu(t)==="symbol"?t:String(t)}function $Q(e,t){if(cu(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(cu(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function LQ(e,t){return zQ(e)||BQ(e,t)||wP(e,t)||DQ()}function DQ(){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 wP(e,t){if(e){if(typeof e=="string")return $v(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 $v(e,t)}}function $v(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 BQ(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 zQ(e){if(Array.isArray(e))return e}var fh=function(t,n,r){return t+(n-t)*r},Lv=function(t){var n=t.from,r=t.to;return n!==r},FQ=function e(t,n,r){var i=mc(function(a,o){if(Lv(o)){var l=t(o.from,o.to,o.velocity),c=LQ(l,2),u=c[0],d=c[1];return nn(nn({},o),{},{from:u,velocity:d})}return o},n);return r<1?mc(function(a,o){return Lv(o)?nn(nn({},o),{},{velocity:fh(o.velocity,i[a].velocity,r),from:fh(o.from,i[a].from,r)}):o},n):e(t,i,r-1)};const UQ=function(e,t,n,r,i){var a=vQ(e,t),o=a.reduce(function(v,y){return nn(nn({},v),{},Iv({},y,[e[y],t[y]]))},{}),l=a.reduce(function(v,y){return nn(nn({},v),{},Iv({},y,{from:e[y],velocity:0,to:t[y]}))},{}),c=-1,u,d,f=function(){return null},h=function(){return mc(function(y,b){return b.from},l)},p=function(){return!Object.values(l).filter(Lv).length},g=function(y){u||(u=y);var b=y-u,w=b/n.dt;l=FQ(n,l,w),i(nn(nn(nn({},e),t),h())),u=y,p()||(c=requestAnimationFrame(f))},m=function(y){d||(d=y);var b=(y-d)/r,w=mc(function(S,x){return fh.apply(void 0,yN(x).concat([n(b)]))},o);if(i(nn(nn(nn({},e),t),w)),b<1)c=requestAnimationFrame(f);else{var k=mc(function(S,x){return fh.apply(void 0,yN(x).concat([n(1)]))},o);i(nn(nn(nn({},e),t),k))}};return f=n.isStepper?g:m,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(c)}}};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)}var WQ=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function HQ(e,t){if(e==null)return{};var n=GQ(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 GQ(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 ag(e){return YQ(e)||VQ(e)||KQ(e)||qQ()}function qQ(){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 KQ(e,t){if(e){if(typeof e=="string")return Dv(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 Dv(e,t)}}function VQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function YQ(e){if(Array.isArray(e))return Dv(e)}function Dv(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 bN(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 _r(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bN(Object(n),!0).forEach(function(r){tc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tc(e,t,n){return t=SP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZQ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,SP(r.key),r)}}function QQ(e,t,n){return t&&ZQ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function SP(e){var t=JQ(e,"string");return Do(t)==="symbol"?t:String(t)}function JQ(e,t){if(Do(e)!=="object"||e===null)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(t==="string"?String:Number)(e)}function eJ(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 tJ(e){var t=nJ();return function(){var r=hh(e),i;if(t){var a=hh(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return zv(this,i)}}function zv(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 Fv(e)}function Fv(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nJ(){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 hh(e){return hh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},hh(e)}var pa=function(e){eJ(n,e);var t=tJ(n);function n(r,i){var a;XQ(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(Fv(a)),a.changeStyle=a.changeStyle.bind(Fv(a)),!l||p<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:d}),zv(a);if(f&&f.length)a.state={style:f[0].style};else if(u){if(typeof h=="function")return a.state={style:u},zv(a);a.state={style:c?tc({},c,u):u}}else a.state={style:{}};return a}return QQ(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?tc({},c,d):d};this.state&&h&&(c&&h[c]!==d||!c&&h!==d)&&this.setState(p);return}if(!(lQ(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?tc({},c,m):m};(c&&h[c]!==m||!c&&h!==m)&&this.setState(v)}this.runAnimation(_r(_r({},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=UQ(o,l,OQ(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,w=v.easing,k=w===void 0?"ease":w,S=v.style,x=v.properties,E=v.onAnimationEnd,_=y>0?o[y-1]:v,C=x||Object.keys(S);if(typeof k=="function"||k==="spring")return[].concat(ag(m),[a.runJSAnimation.bind(a,{from:_.style,to:S,duration:b,easing:k}),b]);var T=pN(C,b,k),L=_r(_r(_r({},_.style),S),{},{transition:T});return[].concat(ag(m),[L,b,E]).filter(bQ)};return this.manager.start([c].concat(ag(o.reduce(p,[d,Math.max(h,l)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=mQ());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?tc({},l,c):c,v=pN(Object.keys(m),o,u);g.start([d,a,_r(_r({},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=HQ(i,WQ),u=N.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=N.cloneElement(p,_r(_r({},c),{},{style:_r(_r({},v),d),className:y}));return b};return u===1?f(N.Children.only(a)):H.createElement("div",null,N.Children.map(a,function(h){return f(h)}))}}]),n}(N.PureComponent);pa.displayName="Animate";pa.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};pa.propTypes={from:Xe.oneOfType([Xe.object,Xe.string]),to:Xe.oneOfType([Xe.object,Xe.string]),attributeName:Xe.string,duration:Xe.number,begin:Xe.number,easing:Xe.oneOfType([Xe.string,Xe.func]),steps:Xe.arrayOf(Xe.shape({duration:Xe.number.isRequired,style:Xe.object.isRequired,easing:Xe.oneOfType([Xe.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Xe.func]),properties:Xe.arrayOf("string"),onAnimationEnd:Xe.func})),children:Xe.oneOfType([Xe.node,Xe.func]),isActive:Xe.bool,canBegin:Xe.bool,onAnimationEnd:Xe.func,shouldReAnimate:Xe.bool,onAnimationStart:Xe.func,onAnimationReStart:Xe.func};function uu(e){"@babel/helpers - typeof";return uu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uu(e)}function ph(){return ph=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},ph.apply(this,arguments)}function rJ(e,t){return oJ(e)||sJ(e,t)||aJ(e,t)||iJ()}function iJ(){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 aJ(e,t){if(e){if(typeof e=="string")return xN(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 xN(e,t)}}function xN(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 sJ(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 oJ(e){if(Array.isArray(e))return e}function wN(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 SN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wN(Object(n),!0).forEach(function(r){lJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lJ(e,t,n){return t=cJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cJ(e){var t=uJ(e,"string");return uu(t)=="symbol"?t:t+""}function uJ(e,t){if(uu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(uu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var kN=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},dJ=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},fJ={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},y0=function(t){var n=SN(SN({},fJ),t),r=N.useRef(),i=N.useState(-1),a=rJ(i,2),o=a[0],l=a[1];N.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 w=Ve("recharts-rectangle",p);return b?H.createElement(pa,{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,x=k.height,E=k.x,_=k.y;return H.createElement(pa,{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},H.createElement("path",ph({},Ke(n,!0),{className:w,d:kN(E,_,S,x,h),ref:r})))}):H.createElement("path",ph({},Ke(n,!0),{className:w,d:kN(c,u,d,f,h)}))};function Uv(){return Uv=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},Uv.apply(this,arguments)}var kP=function(t){var n=t.cx,r=t.cy,i=t.r,a=t.className,o=Ve("recharts-dot",a);return n===+n&&r===+r&&i===+i?N.createElement("circle",Uv({},Ke(t,!1),Of(t),{className:o,cx:n,cy:r,r:i})):null};function du(e){"@babel/helpers - typeof";return du=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},du(e)}var hJ=["x","y","top","left","width","height","className"];function Wv(){return Wv=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},Wv.apply(this,arguments)}function NN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pJ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NN(Object(n),!0).forEach(function(r){mJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mJ(e,t,n){return t=gJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gJ(e){var t=yJ(e,"string");return du(t)=="symbol"?t:t+""}function yJ(e,t){if(du(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(du(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vJ(e,t){if(e==null)return{};var n=bJ(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 bJ(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 xJ=function(t,n,r,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(n,"h").concat(r)},wJ=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=vJ(t,hJ),v=pJ({x:r,y:a,top:l,left:u,width:f,height:p},m);return!de(r)||!de(a)||!de(f)||!de(p)||!de(l)||!de(u)?null:H.createElement("path",Wv({},Ke(v,!0),{className:Ve("recharts-cross",g),d:xJ(r,a,f,p,l,u)}))},SJ=DT,kJ=SJ(Object.getPrototypeOf,Object),NJ=kJ,EJ=Ri,_J=NJ,jJ=Mi,AJ="[object Object]",CJ=Function.prototype,TJ=Object.prototype,NP=CJ.toString,OJ=TJ.hasOwnProperty,PJ=NP.call(Object);function RJ(e){if(!jJ(e)||EJ(e)!=AJ)return!1;var t=_J(e);if(t===null)return!0;var n=OJ.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&NP.call(n)==PJ}var MJ=RJ;const IJ=Ze(MJ);var $J=Ri,LJ=Mi,DJ="[object Boolean]";function BJ(e){return e===!0||e===!1||LJ(e)&&$J(e)==DJ}var zJ=BJ;const FJ=Ze(zJ);function fu(e){"@babel/helpers - typeof";return fu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fu(e)}function mh(){return mh=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},mh.apply(this,arguments)}function UJ(e,t){return qJ(e)||GJ(e,t)||HJ(e,t)||WJ()}function WJ(){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 HJ(e,t){if(e){if(typeof e=="string")return EN(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 EN(e,t)}}function EN(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 GJ(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 qJ(e){if(Array.isArray(e))return e}function _N(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 jN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_N(Object(n),!0).forEach(function(r){KJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_N(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function KJ(e,t,n){return t=VJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VJ(e){var t=YJ(e,"string");return fu(t)=="symbol"?t:t+""}function YJ(e,t){if(fu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(fu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var AN=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},XJ={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},ZJ=function(t){var n=jN(jN({},XJ),t),r=N.useRef(),i=N.useState(-1),a=UJ(i,2),o=a[0],l=a[1];N.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var w=r.current.getTotalLength();w&&l(w)}catch{}},[]);var c=n.x,u=n.y,d=n.upperWidth,f=n.lowerWidth,h=n.height,p=n.className,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=Ve("recharts-trapezoid",p);return y?H.createElement(pa,{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(w){var k=w.upperWidth,S=w.lowerWidth,x=w.height,E=w.x,_=w.y;return H.createElement(pa,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:m,easing:g},H.createElement("path",mh({},Ke(n,!0),{className:b,d:AN(E,_,k,S,x),ref:r})))}):H.createElement("g",null,H.createElement("path",mh({},Ke(n,!0),{className:b,d:AN(c,u,d,f,h)})))},QJ=["option","shapeType","propTransformer","activeClassName","isActive"];function hu(e){"@babel/helpers - typeof";return hu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hu(e)}function JJ(e,t){if(e==null)return{};var n=eee(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 eee(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 CN(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 gh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CN(Object(n),!0).forEach(function(r){tee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tee(e,t,n){return t=nee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nee(e){var t=ree(e,"string");return hu(t)=="symbol"?t:t+""}function ree(e,t){if(hu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(hu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function iee(e,t){return gh(gh({},t),e)}function aee(e,t){return e==="symbols"}function TN(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return H.createElement(y0,n);case"trapezoid":return H.createElement(ZJ,n);case"sector":return H.createElement(fP,n);case"symbols":if(aee(t))return H.createElement(Ix,n);break;default:return null}}function see(e){return N.isValidElement(e)?e.props:e}function oee(e){var t=e.option,n=e.shapeType,r=e.propTransformer,i=r===void 0?iee:r,a=e.activeClassName,o=a===void 0?"recharts-active-shape":a,l=e.isActive,c=JJ(e,QJ),u;if(N.isValidElement(t))u=N.cloneElement(t,gh(gh({},c),see(t)));else if(Le(t))u=t(c);else if(IJ(t)&&!FJ(t)){var d=i(t,c);u=H.createElement(TN,{shapeType:n,elementProps:d})}else{var f=c;u=H.createElement(TN,{shapeType:n,elementProps:f})}return l?H.createElement(Yt,{className:o},u):u}function Bp(e,t){return t!=null&&"trapezoids"in e.props}function zp(e,t){return t!=null&&"sectors"in e.props}function pu(e,t){return t!=null&&"points"in e.props}function lee(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 cee(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function uee(e,t){var n=e.x===t.x,r=e.y===t.y,i=e.z===t.z;return n&&r&&i}function dee(e,t){var n;return Bp(e,t)?n=lee:zp(e,t)?n=cee:pu(e,t)&&(n=uee),n}function fee(e,t){var n;return Bp(e,t)?n="trapezoids":zp(e,t)?n="sectors":pu(e,t)&&(n="points"),n}function hee(e,t){if(Bp(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(zp(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 pu(e,t)?t.payload:{}}function pee(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,i=fee(n,t),a=hee(n,t),o=r.filter(function(c,u){var d=h0(a,c),f=n.props[i].filter(function(g){var m=dee(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 mee=Math.ceil,gee=Math.max;function yee(e,t,n,r){for(var i=-1,a=gee(mee((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}var vee=yee,bee=rO,ON=1/0,xee=17976931348623157e292;function wee(e){if(!e)return e===0?e:0;if(e=bee(e),e===ON||e===-ON){var t=e<0?-1:1;return t*xee}return e===e?e:0}var EP=wee,See=vee,kee=jp,sg=EP;function Nee(e){return function(t,n,r){return r&&typeof r!="number"&&kee(t,n,r)&&(n=r=void 0),t=sg(t),n===void 0?(n=t,t=0):n=sg(n),r=r===void 0?t<n?1:-1:sg(r),See(t,n,r,e)}}var Eee=Nee,_ee=Eee,jee=_ee(),Aee=jee;const yh=Ze(Aee);function mu(e){"@babel/helpers - typeof";return mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mu(e)}function PN(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 RN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PN(Object(n),!0).forEach(function(r){_P(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _P(e,t,n){return t=Cee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cee(e){var t=Tee(e,"string");return mu(t)=="symbol"?t:t+""}function Tee(e,t){if(mu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(mu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Oee=["Webkit","Moz","O","ms"],Pee=function(t,n){var r=t.replace(/(\w)/,function(a){return a.toUpperCase()}),i=Oee.reduce(function(a,o){return RN(RN({},a),{},_P({},o+r,n))},{});return i[t]=n,i};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 vh(){return vh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vh.apply(this,arguments)}function MN(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 og(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MN(Object(n),!0).forEach(function(r){Yn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ree(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IN(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 Mee(e,t,n){return t&&IN(e.prototype,t),n&&IN(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Iee(e,t,n){return t=bh(t),$ee(e,jP()?Reflect.construct(t,n||[],bh(e).constructor):t.apply(e,n))}function $ee(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 Lee(e)}function Lee(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(jP=function(){return!!e})()}function bh(e){return bh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},bh(e)}function Dee(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&&Hv(e,t)}function Hv(e,t){return Hv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Hv(e,t)}function Yn(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 AP(e){var t=Bee(e,"string");return Bo(t)=="symbol"?t:t+""}function Bee(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 String(e)}var zee=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=hc().domain(yh(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}},$N=function(t){return t.changedTouches&&!!t.changedTouches.length},zo=function(e){function t(n){var r;return Ree(this,t),r=Iee(this,t,[n]),Yn(r,"handleDrag",function(i){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(i):r.state.isSlideMoving&&r.handleSlideDrag(i)}),Yn(r,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&r.handleDrag(i.changedTouches[0])}),Yn(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()}),Yn(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Yn(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Yn(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Yn(r,"handleSlideDragStart",function(i){var a=$N(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 Dee(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=ii(a[r],l,r);return Le(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=$N(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 w=this.getIndex(y),k=w.startIndex,S=w.endIndex,x=function(){var _=v.length-1;return o==="startX"&&(l>c?k%m===0:S%m===0)||l<c&&S===_||o==="endX"&&(l>c?S%m===0:k%m===0)||l>c&&S===_};this.setState(Yn(Yn({},o,u+b),"brushMoveStartX",r.pageX),function(){g&&x()&&g(w)})}},{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(Yn({},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 H.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=N.Children.only(u);return f?H.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=og(og({},Ke(this.props,!1)),{},{x:y,y:u,width:d,height:f}),w=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 H.createElement(Yt,{tabIndex:0,role:"slider","aria-label":w,"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 H.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 H.createElement(Yt,{className:"recharts-brush-texts"},H.createElement(qf,vh({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-p,y:o+l/2},g),this.getTextOfTick(i)),H.createElement(qf,vh({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||!de(l)||!de(c)||!de(u)||!de(d)||u<=0||d<=0)return null;var w=Ve("recharts-brush",a),k=H.Children.count(o)===1,S=Pee("userSelect","none");return H.createElement(Yt,{className:w,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 H.createElement(H.Fragment,null,H.createElement("rect",{x:i,y:a,width:o,height:l,fill:c,stroke:"none"}),H.createElement("line",{x1:i+1,y1:u,x2:i+o-1,y2:u,fill:"none",stroke:"#fff"}),H.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 H.isValidElement(r)?a=H.cloneElement(r,i):Le(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 og({prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},a&&a.length?zee({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}}])}(N.PureComponent);Yn(zo,"displayName","Brush");Yn(zo,"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 Fee=Ux;function Uee(e,t){var n;return Fee(e,function(r,i,a){return n=t(r,i,a),!n}),!!n}var Wee=Uee,Hee=TT,Gee=xa,qee=Wee,Kee=zn,Vee=jp;function Yee(e,t,n){var r=Kee(e)?Hee:qee;return n&&Vee(e,t,n)&&(t=void 0),r(e,Gee(t))}var Xee=Yee;const Zee=Ze(Xee);var ni=function(t,n){var r=t.alwaysShow,i=t.ifOverflow;return r&&(i="extendDomain"),i===n},LN=QT;function Qee(e,t,n){t=="__proto__"&&LN?LN(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Jee=Qee,ete=Jee,tte=XT,nte=xa;function rte(e,t){var n={};return t=nte(t),tte(e,function(r,i,a){ete(n,i,t(r,i,a))}),n}var ite=rte;const ate=Ze(ite);function ste(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 ote=ste,lte=Ux;function cte(e,t){var n=!0;return lte(e,function(r,i,a){return n=!!t(r,i,a),n}),n}var ute=cte,dte=ote,fte=ute,hte=xa,pte=zn,mte=jp;function gte(e,t,n){var r=pte(e)?dte:fte;return n&&mte(e,t,n)&&(t=void 0),r(e,hte(t))}var yte=gte;const CP=Ze(yte);var vte=["x","y"];function gu(e){"@babel/helpers - typeof";return gu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gu(e)}function Gv(){return Gv=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},Gv.apply(this,arguments)}function DN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ql(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DN(Object(n),!0).forEach(function(r){bte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bte(e,t,n){return t=xte(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xte(e){var t=wte(e,"string");return gu(t)=="symbol"?t:t+""}function wte(e,t){if(gu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(gu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ste(e,t){if(e==null)return{};var n=kte(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 kte(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Nte(e,t){var n=e.x,r=e.y,i=Ste(e,vte),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 ql(ql(ql(ql(ql({},t),i),o?{x:o}:{}),c?{y:c}:{}),{},{height:d,width:h,name:t.name,radius:t.radius})}function BN(e){return H.createElement(oee,Gv({shapeType:"rectangle",propTransformer:Nte,activeClassName:"recharts-active-bar"},e))}var Ete=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=de(r)||B3(r);return a?t(r,i):(a||ps(),n)}},_te=["value","background"],TP;function Fo(e){"@babel/helpers - typeof";return Fo=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},Fo(e)}function jte(e,t){if(e==null)return{};var n=Ate(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 Ate(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 xh(){return xh=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},xh.apply(this,arguments)}function zN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ot(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zN(Object(n),!0).forEach(function(r){Ji(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cte(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FN(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,PP(r.key),r)}}function Tte(e,t,n){return t&&FN(e.prototype,t),n&&FN(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ote(e,t,n){return t=wh(t),Pte(e,OP()?Reflect.construct(t,n||[],wh(e).constructor):t.apply(e,n))}function Pte(e,t){if(t&&(Fo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Rte(e)}function Rte(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function OP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(OP=function(){return!!e})()}function wh(e){return wh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},wh(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&&qv(e,t)}function qv(e,t){return qv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},qv(e,t)}function Ji(e,t,n){return t=PP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PP(e){var t=Ite(e,"string");return Fo(t)=="symbol"?t:t+""}function Ite(e,t){if(Fo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Fo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var hn=function(e){function t(){var n;Cte(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=Ote(this,t,[].concat(i)),Ji(n,"state",{isAnimationFinished:!1}),Ji(n,"id",xp("recharts-bar-")),Ji(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),Ji(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return Mte(t,e),Tte(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=Ke(this.props,!1);return r&&r.map(function(f,h){var p=h===c,g=p?u:o,m=Ot(Ot(Ot({},d),f),{},{isActive:p,option:g,index:h,dataKey:l,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return H.createElement(Yt,xh({className:"recharts-bar-rectangle"},Pf(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)}),H.createElement(BN,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 H.createElement(pa,{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 w=Ls(b.x,v.x),k=Ls(b.y,v.y),S=Ls(b.width,v.width),x=Ls(b.height,v.height);return Ot(Ot({},v),{},{x:w(g),y:k(g),width:S(g),height:x(g)})}if(o==="horizontal"){var E=Ls(0,v.height),_=E(g);return Ot(Ot({},v),{},{y:v.y+v.height-_,height:_})}var C=Ls(0,v.width),T=C(g);return Ot(Ot({},v),{},{width:T})});return H.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||!h0(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=Ke(this.props.background,!1);return a.map(function(u,d){u.value;var f=u.background,h=jte(u,_te);if(!f)return null;var p=Ot(Ot(Ot(Ot(Ot({},h),{},{fill:"#eee"},f),c),Pf(r.props,u,d)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:d,className:"recharts-bar-background-rectangle"});return H.createElement(BN,xh({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=Ir(d,Dp);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:ii(v,y)}},g={clipPath:r?"url(#clipPath-".concat(i,")"):null};return H.createElement(Yt,g,f.map(function(m){return H.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=Ve("recharts-bar",o),b=l&&l.allowDataOverflow,w=c&&c.allowDataOverflow,k=b||w,S=Ye(m)?this.id:m;return H.createElement(Yt,{className:y},b||w?H.createElement("defs",null,H.createElement("clipPath",{id:"clipPath-".concat(S)},H.createElement("rect",{x:b?u:u-f/2,y:w?d:d-h/2,width:b?f:f*2,height:w?h:h*2}))):null,H.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)&&rs.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}}])}(N.PureComponent);TP=hn;Ji(hn,"displayName","Bar");Ji(hn,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!Ru.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Ji(hn,"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=oX(r,n);if(!p)return null;var g=t.layout,m=n.type.defaultProps,v=m!==void 0?Ot(Ot({},m),n.props):n.props,y=v.dataKey,b=v.children,w=v.minPointSize,k=g==="horizontal"?o:a,S=u?k.scale.domain():null,x=mX({numericAxis:k}),E=Ir(b,Hc),_=f.map(function(C,T){var L,M,B,I,F,z;u?L=lX(u[d+T],S):(L=ii(C,y),Array.isArray(L)||(L=[x,L]));var R=Ete(w,TP.defaultProps.minPointSize)(L[1],T);if(g==="horizontal"){var O,U=[o.scale(L[0]),o.scale(L[1])],A=U[0],Z=U[1];M=Uk({axis:a,ticks:l,bandSize:i,offset:p.offset,entry:C,index:T}),B=(O=Z??A)!==null&&O!==void 0?O:void 0,I=p.size;var $=A-Z;if(F=Number.isNaN($)?0:$,z={x:M,y:o.y,width:I,height:o.height},Math.abs(R)>0&&Math.abs(F)<Math.abs(R)){var P=Pr(F||R)*(Math.abs(R)-Math.abs(F));B-=P,F+=P}}else{var oe=[a.scale(L[0]),a.scale(L[1])],be=oe[0],pe=oe[1];if(M=be,B=Uk({axis:o,ticks:c,bandSize:i,offset:p.offset,entry:C,index:T}),I=pe-be,F=p.size,z={x:a.x,y:B,width:a.width,height:F},Math.abs(R)>0&&Math.abs(I)<Math.abs(R)){var Ce=Pr(I||R)*(Math.abs(R)-Math.abs(I));I+=Ce}}return Ot(Ot(Ot({},C),{},{x:M,y:B,width:I,height:F,value:u?L:L[1],payload:C,background:z},E&&E[T]&&E[T].props),{},{tooltipPayload:[cP(n,C)],tooltipPosition:{x:M+I/2,y:B+F/2}})});return Ot({data:_,layout:g},h)});function yu(e){"@babel/helpers - typeof";return yu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yu(e)}function $te(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UN(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 Lte(e,t,n){return t&&UN(e.prototype,t),n&&UN(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function WN(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 Cr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WN(Object(n),!0).forEach(function(r){Fp(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fp(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=Dte(e,"string");return yu(t)=="symbol"?t:t+""}function Dte(e,t){if(yu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(yu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Bte=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=!!Zn(u,hn);return d.reduce(function(p,g){var m=n[g],v=m.orientation,y=m.domain,b=m.padding,w=b===void 0?{}:b,k=m.mirror,S=m.reversed,x="".concat(v).concat(k?"Mirror":""),E,_,C,T,L;if(m.type==="number"&&(m.padding==="gap"||m.padding==="no-gap")){var M=y[1]-y[0],B=1/0,I=m.categoricalDomain.sort(U3);if(I.forEach(function(oe,be){be>0&&(B=Math.min((oe||0)-(I[be-1]||0),B))}),Number.isFinite(B)){var F=B/M,z=m.layout==="vertical"?r.height:r.width;if(m.padding==="gap"&&(E=F*z/2),m.padding==="no-gap"){var R=fs(t.barCategoryGap,F*z),O=F*z/2;E=O-R-(O-R)/z*R}}}i==="xAxis"?_=[r.left+(w.left||0)+(E||0),r.left+r.width-(w.right||0)-(E||0)]:i==="yAxis"?_=c==="horizontal"?[r.top+r.height-(w.bottom||0),r.top+(w.top||0)]:[r.top+(w.top||0)+(E||0),r.top+r.height-(w.bottom||0)-(E||0)]:_=m.range,S&&(_=[_[1],_[0]]);var U=aX(m,a,h),A=U.scale,Z=U.realScaleType;A.domain(y).range(_),sX(A);var $=pX(A,Cr(Cr({},m),{},{realScaleType:Z}));i==="xAxis"?(L=v==="top"&&!k||v==="bottom"&&k,C=r.left,T=f[x]-L*m.height):i==="yAxis"&&(L=v==="left"&&!k||v==="right"&&k,C=f[x]-L*m.width,T=r.top);var P=Cr(Cr(Cr({},m),$),{},{realScaleType:Z,x:C,y:T,scale:A,width:i==="xAxis"?r.width:m.width,height:i==="yAxis"?r.height:m.height});return P.bandSize=oh(P,$),!m.hide&&i==="xAxis"?f[x]+=(L?-1:1)*P.height:m.hide||(f[x]+=(L?-1:1)*P.width),Cr(Cr({},p),{},Fp({},g,P))},{})},MP=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)}},zte=function(t){var n=t.x1,r=t.y1,i=t.x2,a=t.y2;return MP({x:n,y:r},{x:i,y:a})},IP=function(){function e(t){$te(this,e),this.scale=t}return Lte(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)}}])}();Fp(IP,"EPS",1e-4);var v0=function(t){var n=Object.keys(t).reduce(function(r,i){return Cr(Cr({},r),{},Fp({},i,IP.create(t[i])))},{});return Cr(Cr({},n),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,l=a.position;return ate(i,function(c,u){return n[u].apply(c,{bandAware:o,position:l})})},isInRange:function(i){return CP(i,function(a,o){return n[o].isInRange(a)})}})};function Fte(e){return(e%180+180)%180}var Ute=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Fte(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)},Wte=xa,Hte=Pu,Gte=Ep;function qte(e){return function(t,n,r){var i=Object(t);if(!Hte(t)){var a=Wte(n);t=Gte(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 Kte=qte,Vte=EP;function Yte(e){var t=Vte(e),n=t%1;return t===t?n?t-n:t:0}var Xte=Yte,Zte=HT,Qte=xa,Jte=Xte,ene=Math.max;function tne(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:Jte(n);return i<0&&(i=ene(r+i,0)),Zte(e,Qte(t),i)}var nne=tne,rne=Kte,ine=nne,ane=rne(ine),sne=ane;const one=Ze(sne);var lne=Gz(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("")}),b0=N.createContext(void 0),x0=N.createContext(void 0),$P=N.createContext(void 0),LP=N.createContext({}),DP=N.createContext(void 0),BP=N.createContext(0),zP=N.createContext(0),HN=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=lne(a);return H.createElement(b0.Provider,{value:r},H.createElement(x0.Provider,{value:i},H.createElement(LP.Provider,{value:a},H.createElement($P.Provider,{value:d},H.createElement(DP.Provider,{value:o},H.createElement(BP.Provider,{value:u},H.createElement(zP.Provider,{value:c},l)))))))},cne=function(){return N.useContext(DP)},FP=function(t){var n=N.useContext(b0);n==null&&ps();var r=n[t];return r==null&&ps(),r},une=function(){var t=N.useContext(b0);return Ki(t)},dne=function(){var t=N.useContext(x0),n=one(t,function(r){return CP(r.domain,Number.isFinite)});return n||Ki(t)},UP=function(t){var n=N.useContext(x0);n==null&&ps();var r=n[t];return r==null&&ps(),r},fne=function(){var t=N.useContext($P);return t},hne=function(){return N.useContext(LP)},w0=function(){return N.useContext(zP)},S0=function(){return N.useContext(BP)};function Uo(e){"@babel/helpers - typeof";return Uo=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},Uo(e)}function pne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mne(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,HP(r.key),r)}}function gne(e,t,n){return t&&mne(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function yne(e,t,n){return t=Sh(t),vne(e,WP()?Reflect.construct(t,n||[],Sh(e).constructor):t.apply(e,n))}function vne(e,t){if(t&&(Uo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bne(e)}function bne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function WP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(WP=function(){return!!e})()}function Sh(e){return Sh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Sh(e)}function xne(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&&Kv(e,t)}function Kv(e,t){return Kv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Kv(e,t)}function GN(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 qN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GN(Object(n),!0).forEach(function(r){k0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function k0(e,t,n){return t=HP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HP(e){var t=wne(e,"string");return Uo(t)=="symbol"?t:t+""}function wne(e,t){if(Uo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Uo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Sne(e,t){return _ne(e)||Ene(e,t)||Nne(e,t)||kne()}function kne(){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 Nne(e,t){if(e){if(typeof e=="string")return KN(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 KN(e,t)}}function KN(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 Ene(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 _ne(e){if(Array.isArray(e))return e}function Vv(){return Vv=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},Vv.apply(this,arguments)}var jne=function(t,n){var r;return H.isValidElement(t)?r=H.cloneElement(t,n):Le(t)?r=t(n):r=H.createElement("line",Vv({},n,{className:"recharts-reference-line-line"})),r},Ane=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(ni(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(ni(u,"discard")&&!t.x.isInRange(b))return null;var w=[{x:b,y:f+p},{x:b,y:f}];return l==="top"?w.reverse():w}if(i){var k=u.segment,S=k.map(function(x){return t.apply(x,{position:o})});return ni(u,"discard")&&Zee(S,function(x){return!t.isInRange(x)})?null:S}return null};function Cne(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=cne(),d=FP(i),f=UP(a),h=fne();if(!u||!h)return null;Si(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=v0({x:d.scale,y:f.scale}),g=Ht(t),m=Ht(n),v=r&&r.length===2,y=Ane(p,g,m,v,h,e.position,d.orientation,f.orientation,e);if(!y)return null;var b=Sne(y,2),w=b[0],k=w.x,S=w.y,x=b[1],E=x.x,_=x.y,C=ni(e,"hidden")?"url(#".concat(u,")"):void 0,T=qN(qN({clipPath:C},Ke(e,!0)),{},{x1:k,y1:S,x2:E,y2:_});return H.createElement(Yt,{className:Ve("recharts-reference-line",l)},jne(o,T),gn.renderCallByParent(e,zte({x1:k,y1:S,x2:E,y2:_})))}var N0=function(e){function t(){return pne(this,t),yne(this,t,arguments)}return xne(t,e),gne(t,[{key:"render",value:function(){return H.createElement(Cne,this.props)}}])}(H.Component);k0(N0,"displayName","ReferenceLine");k0(N0,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function Yv(){return Yv=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},Yv.apply(this,arguments)}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 VN(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 YN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VN(Object(n),!0).forEach(function(r){Up(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function One(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,qP(r.key),r)}}function Pne(e,t,n){return t&&One(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Rne(e,t,n){return t=kh(t),Mne(e,GP()?Reflect.construct(t,n||[],kh(e).constructor):t.apply(e,n))}function Mne(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 Ine(e)}function Ine(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function GP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(GP=function(){return!!e})()}function kh(e){return kh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},kh(e)}function $ne(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&&Xv(e,t)}function Xv(e,t){return Xv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Xv(e,t)}function Up(e,t,n){return t=qP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qP(e){var t=Lne(e,"string");return Wo(t)=="symbol"?t:t+""}function Lne(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 Dne=function(t){var n=t.x,r=t.y,i=t.xAxis,a=t.yAxis,o=v0({x:i.scale,y:a.scale}),l=o.apply({x:n,y:r},{bandAware:!0});return ni(t,"discard")&&!o.isInRange(l)?null:l},Wp=function(e){function t(){return Tne(this,t),Rne(this,t,arguments)}return $ne(t,e),Pne(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=Ht(i),d=Ht(a);if(Si(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var f=Dne(this.props);if(!f)return null;var h=f.x,p=f.y,g=this.props,m=g.shape,v=g.className,y=ni(this.props,"hidden")?"url(#".concat(c,")"):void 0,b=YN(YN({clipPath:y},Ke(this.props,!0)),{},{cx:h,cy:p});return H.createElement(Yt,{className:Ve("recharts-reference-dot",v)},t.renderDot(m,b),gn.renderCallByParent(this.props,{x:h-o,y:p-o,width:2*o,height:2*o}))}}])}(H.Component);Up(Wp,"displayName","ReferenceDot");Up(Wp,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Up(Wp,"renderDot",function(e,t){var n;return H.isValidElement(e)?n=H.cloneElement(e,t):Le(e)?n=e(t):n=H.createElement(kP,Yv({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});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)}function Ho(e){"@babel/helpers - typeof";return Ho=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},Ho(e)}function XN(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 ZN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XN(Object(n),!0).forEach(function(r){Hp(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zne(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,VP(r.key),r)}}function Fne(e,t,n){return t&&zne(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Une(e,t,n){return t=Nh(t),Wne(e,KP()?Reflect.construct(t,n||[],Nh(e).constructor):t.apply(e,n))}function Wne(e,t){if(t&&(Ho(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Hne(e)}function Hne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function KP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(KP=function(){return!!e})()}function Nh(e){return Nh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Nh(e)}function Gne(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&&Qv(e,t)}function Qv(e,t){return Qv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Qv(e,t)}function Hp(e,t,n){return t=VP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VP(e){var t=qne(e,"string");return Ho(t)=="symbol"?t:t+""}function qne(e,t){if(Ho(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ho(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Kne=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=v0({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 ni(a,"discard")&&(!h.isInRange(p)||!h.isInRange(g))?null:MP(p,g)},Gp=function(e){function t(){return Bne(this,t),Une(this,t,arguments)}return Gne(t,e),Fne(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;Si(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=Ht(i),h=Ht(a),p=Ht(o),g=Ht(l),m=this.props.shape;if(!f&&!h&&!p&&!g&&!m)return null;var v=Kne(f,h,p,g,this.props);if(!v&&!m)return null;var y=ni(this.props,"hidden")?"url(#".concat(d,")"):void 0;return H.createElement(Yt,{className:Ve("recharts-reference-area",c)},t.renderRect(m,ZN(ZN({clipPath:y},Ke(this.props,!0)),v)),gn.renderCallByParent(this.props,v))}}])}(H.Component);Hp(Gp,"displayName","ReferenceArea");Hp(Gp,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});Hp(Gp,"renderRect",function(e,t){var n;return H.isValidElement(e)?n=H.cloneElement(e,t):Le(e)?n=e(t):n=H.createElement(y0,Zv({},t,{className:"recharts-reference-area-rect"})),n});function YP(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 Vne(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Ute(r,n)}function Yne(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 Eh(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 Xne(e,t){return YP(e,t+1)}function Zne(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:YP(r,u)};var m=c,v,y=function(){return v===void 0&&(v=n(g,m)),v},b=g.coordinate,w=c===0||Eh(e,b,y,d,l);w||(c=0,d=o,u+=1),w&&(d=b+e*(y()/2+i),c+=u)},h;u<=a.length;)if(h=f(),h)return h.v;return[]}function vu(e){"@babel/helpers - typeof";return vu=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},vu(e)}function QN(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 fn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QN(Object(n),!0).forEach(function(r){Qne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qne(e,t,n){return t=Jne(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jne(e){var t=ere(e,"string");return vu(t)=="symbol"?t:t+""}function ere(e,t){if(vu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(vu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tre(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=fn(fn({},p),{},{tickCoord:v>0?p.coordinate-v*e:p.coordinate})}else a[h]=p=fn(fn({},p),{},{tickCoord:p.coordinate});var y=Eh(e,p.tickCoord,m,l,c);y&&(c=p.tickCoord-e*(m()/2+i),a[h]=fn(fn({},p),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return a}function nre(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=fn(fn({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate});var p=Eh(e,d.tickCoord,function(){return f},c,u);p&&(u=d.tickCoord-e*(f/2+i),o[l-1]=fn(fn({},d),{},{isShow:!0}))}for(var g=a?l-1:l,m=function(b){var w=o[b],k,S=function(){return k===void 0&&(k=n(w,b)),k};if(b===0){var x=e*(w.coordinate-e*S()/2-c);o[b]=w=fn(fn({},w),{},{tickCoord:x<0?w.coordinate-x*e:w.coordinate})}else o[b]=w=fn(fn({},w),{},{tickCoord:w.coordinate});var E=Eh(e,w.tickCoord,S,c,u);E&&(c=w.tickCoord+e*(S()/2+i),o[b]=fn(fn({},w),{},{isShow:!0}))},v=0;v<g;v++)m(v);return o}function E0(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(de(c)||Ru.isSsr)return Xne(i,typeof c=="number"&&de(c)?c:0);var h=[],p=l==="top"||l==="bottom"?"width":"height",g=d&&p==="width"?fc(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},m=function(w,k){var S=Le(u)?u(w.value,k):w.value;return p==="width"?Vne(fc(S,{fontSize:t,letterSpacing:n}),g,f):fc(S,{fontSize:t,letterSpacing:n})[p]},v=i.length>=2?Pr(i[1].coordinate-i[0].coordinate):1,y=Yne(a,v,p);return c==="equidistantPreserveStart"?Zne(v,y,m,i,o):(c==="preserveStart"||c==="preserveStartEnd"?h=nre(v,y,m,i,o,c==="preserveStartEnd"):h=tre(v,y,m,i,o),h.filter(function(b){return b.isShow}))}var rre=["viewBox"],ire=["viewBox"],are=["ticks"];function Go(e){"@babel/helpers - typeof";return Go=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},Go(e)}function oo(){return oo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oo.apply(this,arguments)}function JN(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 zt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JN(Object(n),!0).forEach(function(r){_0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lg(e,t){if(e==null)return{};var n=sre(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 sre(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 ore(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eE(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,ZP(r.key),r)}}function lre(e,t,n){return t&&eE(e.prototype,t),n&&eE(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function cre(e,t,n){return t=_h(t),ure(e,XP()?Reflect.construct(t,n||[],_h(e).constructor):t.apply(e,n))}function ure(e,t){if(t&&(Go(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dre(e)}function dre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function XP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(XP=function(){return!!e})()}function _h(e){return _h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_h(e)}function fre(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 _0(e,t,n){return t=ZP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZP(e){var t=hre(e,"string");return Go(t)=="symbol"?t:t+""}function hre(e,t){if(Go(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Go(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ml=function(e){function t(n){var r;return ore(this,t),r=cre(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return fre(t,e),lre(t,[{key:"shouldComponentUpdate",value:function(r,i){var a=r.viewBox,o=lg(r,rre),l=this.props,c=l.viewBox,u=lg(l,ire);return!yo(a,c)||!yo(o,u)||!yo(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,w=f?-1:1,k=r.tickSize||d,S=de(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":p=g=r.coordinate,v=o+ +!f*c,m=v-w*k,b=m-w*h,y=S;break;case"left":m=v=r.coordinate,g=a+ +!f*l,p=g-w*k,y=p-w*h,b=S;break;case"right":m=v=r.coordinate,g=a+ +f*l,p=g+w*k,y=p+w*h,b=S;break;default:p=g=r.coordinate,v=o+ +f*c,m=v+w*k,b=m+w*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=zt(zt(zt({},Ke(this.props,!1)),Ke(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var h=+(c==="top"&&!u||c==="bottom"&&u);f=zt(zt({},f),{},{x1:i,y1:a+h*l,x2:i+o,y2:a+h*l})}else{var p=+(c==="left"&&!u||c==="right"&&u);f=zt(zt({},f),{},{x1:i+p*o,y1:a,x2:i+p*o,y2:a+l})}return H.createElement("line",oo({},f,{className:Ve("recharts-cartesian-axis-line",yr(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=E0(zt(zt({},this.props),{},{ticks:r}),i,a),g=this.getTickTextAnchor(),m=this.getTickVerticalAnchor(),v=Ke(this.props,!1),y=Ke(d,!1),b=zt(zt({},v),{},{fill:"none"},Ke(c,!1)),w=p.map(function(k,S){var x=o.getTickLineCoord(k),E=x.line,_=x.tick,C=zt(zt(zt(zt({textAnchor:g,verticalAnchor:m},v),{},{stroke:"none",fill:u},y),_),{},{index:S,payload:k,visibleTicksCount:p.length,tickFormatter:f});return H.createElement(Yt,oo({className:"recharts-cartesian-axis-tick",key:"tick-".concat(k.value,"-").concat(k.coordinate,"-").concat(k.tickCoord)},Pf(o.props,k,S)),c&&H.createElement("line",oo({},b,E,{className:Ve("recharts-cartesian-axis-tick-line",yr(c,"className"))})),d&&t.renderTickItem(d,C,"".concat(Le(f)?f(k.value,S):k.value).concat(h||"")))});return H.createElement("g",{className:"recharts-cartesian-axis-ticks"},w)}},{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=lg(f,are),g=h;return Le(c)&&(g=h&&h.length>0?c(this.props):c(p)),o<=0||l<=0||!g||!g.length?null:H.createElement(Yt,{className:Ve("recharts-cartesian-axis",u),ref:function(v){r.layerReference=v}},a&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),gn.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,a){var o,l=Ve(i.className,"recharts-cartesian-axis-tick-value");return H.isValidElement(r)?o=H.cloneElement(r,zt(zt({},i),{},{className:l})):Le(r)?o=r(zt(zt({},i),{},{className:l})):o=H.createElement(qf,oo({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(N.Component);_0(ml,"displayName","CartesianAxis");_0(ml,"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 pre=["x1","y1","x2","y2","key"],mre=["offset"];function ms(e){"@babel/helpers - typeof";return ms=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},ms(e)}function tE(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 yn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tE(Object(n),!0).forEach(function(r){gre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gre(e,t,n){return t=yre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yre(e){var t=vre(e,"string");return ms(t)=="symbol"?t:t+""}function vre(e,t){if(ms(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ms(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xa(){return Xa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xa.apply(this,arguments)}function nE(e,t){if(e==null)return{};var n=bre(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 bre(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 xre=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 H.createElement("rect",{x:i,y:a,ry:c,width:o,height:l,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function QP(e,t){var n;if(H.isValidElement(e))n=H.cloneElement(e,t);else if(Le(e))n=e(t);else{var r=t.x1,i=t.y1,a=t.x2,o=t.y2,l=t.key,c=nE(t,pre),u=Ke(c,!1);u.offset;var d=nE(u,mre);n=H.createElement("line",Xa({},d,{x1:r,y1:i,x2:a,y2:o,fill:"none",key:l}))}return n}function wre(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=yn(yn({},e),{},{x1:t,y1:l,x2:t+n,y2:l,key:"line-".concat(c),index:c});return QP(i,u)});return H.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function Sre(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=yn(yn({},e),{},{x1:l,y1:t,x2:l,y2:t+n,key:"line-".concat(c),index:c});return QP(i,u)});return H.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function kre(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 H.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 H.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function Nre(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 H.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 H.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var Ere=function(t,n){var r=t.xAxis,i=t.width,a=t.height,o=t.offset;return oP(E0(yn(yn(yn({},ml.defaultProps),r),{},{ticks:bi(r,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,n)},_re=function(t,n){var r=t.yAxis,i=t.width,a=t.height,o=t.offset;return oP(E0(yn(yn(yn({},ml.defaultProps),r),{},{ticks:bi(r,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,n)},zs={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Vi(e){var t,n,r,i,a,o,l=w0(),c=S0(),u=hne(),d=yn(yn({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:zs.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:zs.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:zs.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:zs.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:zs.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:zs.verticalFill,x:de(e.x)?e.x:u.left,y:de(e.y)?e.y:u.top,width:de(e.width)?e.width:u.width,height:de(e.height)?e.height:u.height}),f=d.x,h=d.y,p=d.width,g=d.height,m=d.syncWithTicks,v=d.horizontalValues,y=d.verticalValues,b=une(),w=dne();if(!de(p)||p<=0||!de(g)||g<=0||!de(f)||f!==+f||!de(h)||h!==+h)return null;var k=d.verticalCoordinatesGenerator||Ere,S=d.horizontalCoordinatesGenerator||_re,x=d.horizontalPoints,E=d.verticalPoints;if((!x||!x.length)&&Le(S)){var _=v&&v.length,C=S({yAxis:w?yn(yn({},w),{},{ticks:_?v:w.ticks}):void 0,width:l,height:c,offset:u},_?!0:m);Si(Array.isArray(C),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(ms(C),"]")),Array.isArray(C)&&(x=C)}if((!E||!E.length)&&Le(k)){var T=y&&y.length,L=k({xAxis:b?yn(yn({},b),{},{ticks:T?y:b.ticks}):void 0,width:l,height:c,offset:u},T?!0:m);Si(Array.isArray(L),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(ms(L),"]")),Array.isArray(L)&&(E=L)}return H.createElement("g",{className:"recharts-cartesian-grid"},H.createElement(xre,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),H.createElement(wre,Xa({},d,{offset:u,horizontalPoints:x,xAxis:b,yAxis:w})),H.createElement(Sre,Xa({},d,{offset:u,verticalPoints:E,xAxis:b,yAxis:w})),H.createElement(kre,Xa({},d,{horizontalPoints:x})),H.createElement(Nre,Xa({},d,{verticalPoints:E})))}Vi.displayName="CartesianGrid";function qo(e){"@babel/helpers - typeof";return qo=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},qo(e)}function jre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Are(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,tR(r.key),r)}}function Cre(e,t,n){return t&&Are(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tre(e,t,n){return t=jh(t),Ore(e,JP()?Reflect.construct(t,n||[],jh(e).constructor):t.apply(e,n))}function Ore(e,t){if(t&&(qo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pre(e)}function Pre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function JP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(JP=function(){return!!e})()}function jh(e){return jh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},jh(e)}function Rre(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&&eb(e,t)}function eb(e,t){return eb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},eb(e,t)}function eR(e,t,n){return t=tR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tR(e){var t=Mre(e,"string");return qo(t)=="symbol"?t:t+""}function Mre(e,t){if(qo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function tb(){return tb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tb.apply(this,arguments)}function Ire(e){var t=e.xAxisId,n=w0(),r=S0(),i=FP(t);return i==null?null:N.createElement(ml,tb({},i,{className:Ve("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return bi(o,!0)}}))}var Xr=function(e){function t(){return jre(this,t),Tre(this,t,arguments)}return Rre(t,e),Cre(t,[{key:"render",value:function(){return N.createElement(Ire,this.props)}}])}(N.Component);eR(Xr,"displayName","XAxis");eR(Xr,"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 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 $re(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lre(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,iR(r.key),r)}}function Dre(e,t,n){return t&&Lre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bre(e,t,n){return t=Ah(t),zre(e,nR()?Reflect.construct(t,n||[],Ah(e).constructor):t.apply(e,n))}function zre(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 Fre(e)}function Fre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nR=function(){return!!e})()}function Ah(e){return Ah=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ah(e)}function Ure(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nb(e,t)}function nb(e,t){return nb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},nb(e,t)}function rR(e,t,n){return t=iR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iR(e){var t=Wre(e,"string");return Ko(t)=="symbol"?t:t+""}function Wre(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)}function rb(){return rb=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},rb.apply(this,arguments)}var Hre=function(t){var n=t.yAxisId,r=w0(),i=S0(),a=UP(n);return a==null?null:N.createElement(ml,rb({},a,{className:Ve("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:r,height:i},ticksGenerator:function(l){return bi(l,!0)}}))},Zr=function(e){function t(){return $re(this,t),Bre(this,t,arguments)}return Ure(t,e),Dre(t,[{key:"render",value:function(){return N.createElement(Hre,this.props)}}])}(N.Component);rR(Zr,"displayName","YAxis");rR(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 rE(e){return Vre(e)||Kre(e)||qre(e)||Gre()}function Gre(){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 qre(e,t){if(e){if(typeof e=="string")return ib(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 ib(e,t)}}function Kre(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Vre(e){if(Array.isArray(e))return ib(e)}function ib(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 ab=function(t,n,r,i,a){var o=Ir(t,N0),l=Ir(t,Wp),c=[].concat(rE(o),rE(l)),u=Ir(t,Gp),d="".concat(i,"Id"),f=i[0],h=n;if(c.length&&(h=c.reduce(function(m,v){if(v.props[d]===r&&ni(v.props,"extendDomain")&&de(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&&ni(v.props,"extendDomain")&&de(v.props[p])&&de(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 de(v)?[Math.min(m[0],v),Math.max(m[1],v)]:m},h)),h},aR={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,w;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(w=1,b=new Array(y-1);w<y;w++)b[w-1]=arguments[w];v.fn.apply(v.context,b)}else{var k=v.length,S;for(w=0;w<k;w++)switch(v[w].once&&this.removeListener(u,v[w].fn,void 0,!0),y){case 1:v[w].fn.call(v[w].context);break;case 2:v[w].fn.call(v[w].context,d);break;case 3:v[w].fn.call(v[w].context,d,f);break;case 4:v[w].fn.call(v[w].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[w].fn.apply(v[w].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})(aR);var Yre=aR.exports;const Xre=Ze(Yre);var cg=new Xre,ug="recharts.syncMouseEvents";function bu(e){"@babel/helpers - typeof";return bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bu(e)}function Zre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qre(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,sR(r.key),r)}}function Jre(e,t,n){return t&&Qre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function dg(e,t,n){return t=sR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sR(e){var t=eie(e,"string");return bu(t)=="symbol"?t:t+""}function eie(e,t){if(bu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(bu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var tie=function(){function e(){Zre(this,e),dg(this,"activeIndex",0),dg(this,"coordinateList",[]),dg(this,"layout","horizontal")}return Jre(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 nie(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&&de(r)&&de(i))return!0}return!1}function rie(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 oR(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,a=e.endAngle,o=an(t,n,r,i),l=an(t,n,r,a);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}function iie(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=an(l,c,u,f),p=an(l,c,d,f);r=h.x,i=h.y,a=p.x,o=p.y}else return oR(t);return[{x:r,y:i},{x:a,y:o}]}function xu(e){"@babel/helpers - typeof";return xu=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},xu(e)}function iE(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 jd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iE(Object(n),!0).forEach(function(r){aie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aie(e,t,n){return t=sie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sie(e){var t=oie(e,"string");return xu(t)=="symbol"?t:t+""}function oie(e,t){if(xu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lie(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=iN;if(h==="ScatterChart")g=o,m=wJ;else if(h==="BarChart")g=rie(f,o,c,d),m=y0;else if(f==="radial"){var v=oR(o),y=v.cx,b=v.cy,w=v.radius,k=v.startAngle,S=v.endAngle;g={cx:y,cy:b,startAngle:k,endAngle:S,innerRadius:w,outerRadius:w},m=fP}else g={points:iie(f,o,c)},m=iN;var x=jd(jd(jd(jd({stroke:"#ccc",pointerEvents:"none"},c),g),Ke(p,!1)),{},{payload:l,payloadIndex:u,className:Ve("recharts-tooltip-cursor",p.className)});return N.isValidElement(p)?N.cloneElement(p,x):N.createElement(m,x)}var cie=["item"],uie=["children","className","width","height","style","compact","title","desc"];function Vo(e){"@babel/helpers - typeof";return Vo=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},Vo(e)}function lo(){return lo=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},lo.apply(this,arguments)}function aE(e,t){return hie(e)||fie(e,t)||cR(e,t)||die()}function die(){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 fie(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 hie(e){if(Array.isArray(e))return e}function sE(e,t){if(e==null)return{};var n=pie(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 pie(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 mie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gie(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,uR(r.key),r)}}function yie(e,t,n){return t&&gie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function vie(e,t,n){return t=Ch(t),bie(e,lR()?Reflect.construct(t,n||[],Ch(e).constructor):t.apply(e,n))}function bie(e,t){if(t&&(Vo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xie(e)}function xie(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(lR=function(){return!!e})()}function Ch(e){return Ch=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ch(e)}function wie(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sb(e,t)}function sb(e,t){return sb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},sb(e,t)}function Yo(e){return Nie(e)||kie(e)||cR(e)||Sie()}function Sie(){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 cR(e,t){if(e){if(typeof e=="string")return ob(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 ob(e,t)}}function kie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Nie(e){if(Array.isArray(e))return ob(e)}function ob(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 Q(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){Oe(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 Oe(e,t,n){return t=uR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uR(e){var t=Eie(e,"string");return Vo(t)=="symbol"?t:t+""}function Eie(e,t){if(Vo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _ie={xAxis:["bottom","top"],yAxis:["left","right"]},jie={width:"100%",height:"100%"},dR={x:0,y:0};function Ad(e){return e}var Aie=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Cie=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),an(i.cx,i.cy,l,o)),{},{angle:o,radius:l})}var c=a.coordinate,u=i.angle;return Q(Q(Q({},i),an(i.cx,i.cy,c,u)),{},{angle:u,radius:c})}return dR},qp=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(Yo(l),Yo(u)):l},[]);return o.length>0?o:t&&t.length&&de(i)&&de(a)?t.slice(i,a+1):[]};function fR(e){return e==="number"?[0,"auto"]:void 0}var lb=function(t,n,r,i){var a=t.graphicalItems,o=t.tooltipAxis,l=qp(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=Fy(p,o.dataKey,i)}else h=f&&f[r]||l[r];return h?[].concat(Yo(c),[cP(u,h)]):c},[])},lE=function(t,n,r,i){var a=i||{x:t.chartX,y:t.chartY},o=Aie(a,r),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=JY(o,l,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,h=lb(t,n,d,f),p=Cie(r,l,d,a);return{activeTooltipIndex:d,activeLabel:f,activePayload:h,activeCoordinate:p}}return null},Tie=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=sP(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,w=y.dataKey,k=y.allowDataOverflow,S=y.allowDuplicatedCategory,x=y.scale,E=y.ticks,_=y.includeHidden,C=y[o];if(g[C])return g;var T=qp(t.data,{graphicalItems:i.filter(function($){var P,oe=o in $.props?$.props[o]:(P=$.type.defaultProps)===null||P===void 0?void 0:P[o];return oe===C}),dataStartIndex:c,dataEndIndex:u}),L=T.length,M,B,I;nie(y.domain,k,b)&&(M=Av(y.domain,null,k),p&&(b==="number"||x!=="auto")&&(I=pc(T,w,"category")));var F=fR(b);if(!M||M.length===0){var z,R=(z=y.domain)!==null&&z!==void 0?z:F;if(w){if(M=pc(T,w,b),b==="category"&&p){var O=F3(M);S&&O?(B=M,M=yh(0,L)):S||(M=Gk(R,M,m).reduce(function($,P){return $.indexOf(P)>=0?$:[].concat(Yo($),[P])},[]))}else if(b==="category")S?M=M.filter(function($){return $!==""&&!Ye($)}):M=Gk(R,M,m).reduce(function($,P){return $.indexOf(P)>=0||P===""||Ye(P)?$:[].concat(Yo($),[P])},[]);else if(b==="number"){var U=iX(T,i.filter(function($){var P,oe,be=o in $.props?$.props[o]:(P=$.type.defaultProps)===null||P===void 0?void 0:P[o],pe="hide"in $.props?$.props.hide:(oe=$.type.defaultProps)===null||oe===void 0?void 0:oe.hide;return be===C&&(_||!pe)}),w,a,d);U&&(M=U)}p&&(b==="number"||x!=="auto")&&(I=pc(T,w,"category"))}else p?M=yh(0,L):l&&l[C]&&l[C].hasStack&&b==="number"?M=h==="expand"?[0,1]:lP(l[C].stackGroups,c,u):M=aP(T,i.filter(function($){var P=o in $.props?$.props[o]:$.type.defaultProps[o],oe="hide"in $.props?$.props.hide:$.type.defaultProps.hide;return P===C&&(_||!oe)}),b,d,!0);if(b==="number")M=ab(f,M,C,a,E),R&&(M=Av(R,M,k));else if(b==="category"&&R){var A=R,Z=M.every(function($){return A.indexOf($)>=0});Z&&(M=A)}}return Q(Q({},g),{},Oe({},C,Q(Q({},y),{},{axisType:a,domain:M,categoricalDomain:I,duplicateDomain:B,originalDomain:(v=y.domain)!==null&&v!==void 0?v:F,isCategorical:p,layout:d})))},{})},Oie=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=qp(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:u}),p=h.length,g=sP(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,w=b[o],k=fR("number");if(!v[w]){m++;var S;return g?S=yh(0,p):l&&l[w]&&l[w].hasStack?(S=lP(l[w].stackGroups,c,u),S=ab(f,S,w,a)):(S=Av(k,aP(h,r.filter(function(x){var E,_,C=o in x.props?x.props[o]:(E=x.type.defaultProps)===null||E===void 0?void 0:E[o],T="hide"in x.props?x.props.hide:(_=x.type.defaultProps)===null||_===void 0?void 0:_.hide;return C===w&&!T}),"number",d),i.defaultProps.allowDataOverflow),S=ab(f,S,w,a)),Q(Q({},v),{},Oe({},w,Q(Q({axisType:a},i.defaultProps),{},{hide:!0,orientation:yr(_ie,"".concat(a,".").concat(m%2),null),domain:S,originalDomain:k,isCategorical:g,layout:d})))}return v},{})},Pie=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=Ir(d,a),p={};return h&&h.length?p=Tie(t,{axes:h,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(p=Oie(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),p},Rie=function(t){var n=Ki(t),r=bi(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:Wx(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:oh(n,r)}},cE=function(t){var n=t.children,r=t.defaultShowTooltip,i=Zn(n,zo),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=wi(n&&n.type);return r&&r.indexOf("Bar")>=0})},uE=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"}},Iie=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=Zn(f,zo),g=Zn(f,es),m=Object.keys(c).reduce(function(S,x){var E=c[x],_=E.orientation;return!E.mirror&&!E.hide?Q(Q({},S),{},Oe({},_,S[_]+E.width)):S},{left:h.left||0,right:h.right||0}),v=Object.keys(o).reduce(function(S,x){var E=o[x],_=E.orientation;return!E.mirror&&!E.hide?Q(Q({},S),{},Oe({},_,yr(S,"".concat(_))+E.height)):S},{top:h.top||0,bottom:h.bottom||0}),y=Q(Q({},v),m),b=y.bottom;p&&(y.bottom+=p.props.height||zo.defaultProps.height),g&&n&&(y=nX(y,i,r,n));var w=u-y.left-y.right,k=d-y.top-y.bottom;return Q(Q({brushBottom:b},y),{},{width:Math.max(w,0),height:Math.max(k,0)})},$ie=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},Lie=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 w=b.graphicalItems,k=b.stackGroups,S=b.offset,x=b.updateId,E=b.dataStartIndex,_=b.dataEndIndex,C=y.barSize,T=y.layout,L=y.barGap,M=y.barCategoryGap,B=y.maxBarSize,I=uE(T),F=I.numericAxisName,z=I.cateAxisName,R=Mie(w),O=[];return w.forEach(function(U,A){var Z=qp(y.data,{graphicalItems:[U],dataStartIndex:E,dataEndIndex:_}),$=U.type.defaultProps!==void 0?Q(Q({},U.type.defaultProps),U.props):U.props,P=$.dataKey,oe=$.maxBarSize,be=$["".concat(F,"Id")],pe=$["".concat(z,"Id")],Ce={},G=c.reduce(function(Ee,qe){var It=b["".concat(qe.axisType,"Map")],On=$["".concat(qe.axisType,"Id")];It&&It[On]||qe.axisType==="zAxis"||ps();var Qt=It[On];return Q(Q({},Ee),{},Oe(Oe({},qe.axisType,Qt),"".concat(qe.axisType,"Ticks"),bi(Qt)))},Ce),Y=G[z],ae=G["".concat(z,"Ticks")],le=k&&k[be]&&k[be].hasStack&&gX(U,k[be].stackGroups),X=wi(U.type).indexOf("Bar")>=0,je=oh(Y,ae),Ne=[],_e=R&&eX({barSize:C,stackGroups:k,totalSize:$ie(G,z)});if(X){var ge,$e,fe=Ye(oe)?B:oe,et=(ge=($e=oh(Y,ae,!0))!==null&&$e!==void 0?$e:fe)!==null&&ge!==void 0?ge:0;Ne=tX({barGap:L,barCategoryGap:M,bandSize:et!==je?et:je,sizeList:_e[pe],maxBarSize:fe}),et!==je&&(Ne=Ne.map(function(Ee){return Q(Q({},Ee),{},{position:Q(Q({},Ee.position),{},{offset:Ee.position.offset-et/2})})}))}var De=U&&U.type&&U.type.getComposedData;De&&O.push({props:Q(Q({},De(Q(Q({},G),{},{displayedData:Z,props:y,dataKey:P,item:U,bandSize:je,barPosition:Ne,offset:S,stackedData:le,layout:T,dataStartIndex:E,dataEndIndex:_}))),{},Oe(Oe(Oe({key:U.key||"item-".concat(A)},F,G[F]),z,G[z]),"animationId",x)),childIndex:J3(U,y.children),item:U})}),O},p=function(y,b){var w=y.props,k=y.dataStartIndex,S=y.dataEndIndex,x=y.updateId;if(!B1({props:w}))return null;var E=w.children,_=w.layout,C=w.stackOffset,T=w.data,L=w.reverseStackOrder,M=uE(_),B=M.numericAxisName,I=M.cateAxisName,F=Ir(E,r),z=hX(T,F,"".concat(B,"Id"),"".concat(I,"Id"),C,L),R=c.reduce(function($,P){var oe="".concat(P.axisType,"Map");return Q(Q({},$),{},Oe({},oe,Pie(w,Q(Q({},P),{},{graphicalItems:F,stackGroups:P.axisType===B&&z,dataStartIndex:k,dataEndIndex:S}))))},{}),O=Iie(Q(Q({},R),{},{props:w,graphicalItems:F}),b==null?void 0:b.legendBBox);Object.keys(R).forEach(function($){R[$]=d(w,R[$],O,$.replace("Map",""),n)});var U=R["".concat(I,"Map")],A=Rie(U),Z=h(w,Q(Q({},R),{},{dataStartIndex:k,dataEndIndex:S,updateId:x,graphicalItems:F,stackGroups:z,offset:O}));return Q(Q({formattedGraphicalItems:Z,graphicalItems:F,offset:O,stackGroups:z},A),R)},g=function(v){function y(b){var w,k,S;return mie(this,y),S=vie(this,y,[b]),Oe(S,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Oe(S,"accessibilityManager",new tie),Oe(S,"handleLegendBBoxUpdate",function(x){if(x){var E=S.state,_=E.dataStartIndex,C=E.dataEndIndex,T=E.updateId;S.setState(Q({legendBBox:x},p({props:S.props,dataStartIndex:_,dataEndIndex:C,updateId:T},Q(Q({},S.state),{},{legendBBox:x}))))}}),Oe(S,"handleReceiveSyncEvent",function(x,E,_){if(S.props.syncId===x){if(_===S.eventEmitterSymbol&&typeof S.props.syncMethod!="function")return;S.applySyncEvent(E)}}),Oe(S,"handleBrushChange",function(x){var E=x.startIndex,_=x.endIndex;if(E!==S.state.dataStartIndex||_!==S.state.dataEndIndex){var C=S.state.updateId;S.setState(function(){return Q({dataStartIndex:E,dataEndIndex:_},p({props:S.props,dataStartIndex:E,dataEndIndex:_,updateId:C},S.state))}),S.triggerSyncEvent({dataStartIndex:E,dataEndIndex:_})}}),Oe(S,"handleMouseEnter",function(x){var E=S.getMouseInfo(x);if(E){var _=Q(Q({},E),{},{isTooltipActive:!0});S.setState(_),S.triggerSyncEvent(_);var C=S.props.onMouseEnter;Le(C)&&C(_,x)}}),Oe(S,"triggeredAfterMouseMove",function(x){var E=S.getMouseInfo(x),_=E?Q(Q({},E),{},{isTooltipActive:!0}):{isTooltipActive:!1};S.setState(_),S.triggerSyncEvent(_);var C=S.props.onMouseMove;Le(C)&&C(_,x)}),Oe(S,"handleItemMouseEnter",function(x){S.setState(function(){return{isTooltipActive:!0,activeItem:x,activePayload:x.tooltipPayload,activeCoordinate:x.tooltipPosition||{x:x.cx,y:x.cy}}})}),Oe(S,"handleItemMouseLeave",function(){S.setState(function(){return{isTooltipActive:!1}})}),Oe(S,"handleMouseMove",function(x){x.persist(),S.throttleTriggeredAfterMouseMove(x)}),Oe(S,"handleMouseLeave",function(x){S.throttleTriggeredAfterMouseMove.cancel();var E={isTooltipActive:!1};S.setState(E),S.triggerSyncEvent(E);var _=S.props.onMouseLeave;Le(_)&&_(E,x)}),Oe(S,"handleOuterEvent",function(x){var E=Q3(x),_=yr(S.props,"".concat(E));if(E&&Le(_)){var C,T;/.*touch.*/i.test(E)?T=S.getMouseInfo(x.changedTouches[0]):T=S.getMouseInfo(x),_((C=T)!==null&&C!==void 0?C:{},x)}}),Oe(S,"handleClick",function(x){var E=S.getMouseInfo(x);if(E){var _=Q(Q({},E),{},{isTooltipActive:!0});S.setState(_),S.triggerSyncEvent(_);var C=S.props.onClick;Le(C)&&C(_,x)}}),Oe(S,"handleMouseDown",function(x){var E=S.props.onMouseDown;if(Le(E)){var _=S.getMouseInfo(x);E(_,x)}}),Oe(S,"handleMouseUp",function(x){var E=S.props.onMouseUp;if(Le(E)){var _=S.getMouseInfo(x);E(_,x)}}),Oe(S,"handleTouchMove",function(x){x.changedTouches!=null&&x.changedTouches.length>0&&S.throttleTriggeredAfterMouseMove(x.changedTouches[0])}),Oe(S,"handleTouchStart",function(x){x.changedTouches!=null&&x.changedTouches.length>0&&S.handleMouseDown(x.changedTouches[0])}),Oe(S,"handleTouchEnd",function(x){x.changedTouches!=null&&x.changedTouches.length>0&&S.handleMouseUp(x.changedTouches[0])}),Oe(S,"handleDoubleClick",function(x){var E=S.props.onDoubleClick;if(Le(E)){var _=S.getMouseInfo(x);E(_,x)}}),Oe(S,"handleContextMenu",function(x){var E=S.props.onContextMenu;if(Le(E)){var _=S.getMouseInfo(x);E(_,x)}}),Oe(S,"triggerSyncEvent",function(x){S.props.syncId!==void 0&&cg.emit(ug,S.props.syncId,x,S.eventEmitterSymbol)}),Oe(S,"applySyncEvent",function(x){var E=S.props,_=E.layout,C=E.syncMethod,T=S.state.updateId,L=x.dataStartIndex,M=x.dataEndIndex;if(x.dataStartIndex!==void 0||x.dataEndIndex!==void 0)S.setState(Q({dataStartIndex:L,dataEndIndex:M},p({props:S.props,dataStartIndex:L,dataEndIndex:M,updateId:T},S.state)));else if(x.activeTooltipIndex!==void 0){var B=x.chartX,I=x.chartY,F=x.activeTooltipIndex,z=S.state,R=z.offset,O=z.tooltipTicks;if(!R)return;if(typeof C=="function")F=C(O,x);else if(C==="value"){F=-1;for(var U=0;U<O.length;U++)if(O[U].value===x.activeLabel){F=U;break}}var A=Q(Q({},R),{},{x:R.left,y:R.top}),Z=Math.min(B,A.x+A.width),$=Math.min(I,A.y+A.height),P=O[F]&&O[F].value,oe=lb(S.state,S.props.data,F),be=O[F]?{x:_==="horizontal"?O[F].coordinate:Z,y:_==="horizontal"?$:O[F].coordinate}:dR;S.setState(Q(Q({},x),{},{activeLabel:P,activeCoordinate:be,activePayload:oe,activeTooltipIndex:F}))}else S.setState(x)}),Oe(S,"renderCursor",function(x){var E,_=S.state,C=_.isTooltipActive,T=_.activeCoordinate,L=_.activePayload,M=_.offset,B=_.activeTooltipIndex,I=_.tooltipAxisBandSize,F=S.getTooltipEventType(),z=(E=x.props.active)!==null&&E!==void 0?E:C,R=S.props.layout,O=x.key||"_recharts-cursor";return H.createElement(lie,{key:O,activeCoordinate:T,activePayload:L,activeTooltipIndex:B,chartName:n,element:x,isActive:z,layout:R,offset:M,tooltipAxisBandSize:I,tooltipEventType:F})}),Oe(S,"renderPolarAxis",function(x,E,_){var C=yr(x,"type.axisType"),T=yr(S.state,"".concat(C,"Map")),L=x.type.defaultProps,M=L!==void 0?Q(Q({},L),x.props):x.props,B=T&&T[M["".concat(C,"Id")]];return N.cloneElement(x,Q(Q({},B),{},{className:Ve(C,B.className),key:x.key||"".concat(E,"-").concat(_),ticks:bi(B,!0)}))}),Oe(S,"renderPolarGrid",function(x){var E=x.props,_=E.radialLines,C=E.polarAngles,T=E.polarRadius,L=S.state,M=L.radiusAxisMap,B=L.angleAxisMap,I=Ki(M),F=Ki(B),z=F.cx,R=F.cy,O=F.innerRadius,U=F.outerRadius;return N.cloneElement(x,{polarAngles:Array.isArray(C)?C:bi(F,!0).map(function(A){return A.coordinate}),polarRadius:Array.isArray(T)?T:bi(I,!0).map(function(A){return A.coordinate}),cx:z,cy:R,innerRadius:O,outerRadius:U,key:x.key||"polar-grid",radialLines:_})}),Oe(S,"renderLegend",function(){var x=S.state.formattedGraphicalItems,E=S.props,_=E.children,C=E.width,T=E.height,L=S.props.margin||{},M=C-(L.left||0)-(L.right||0),B=rP({children:_,formattedGraphicalItems:x,legendWidth:M,legendContent:u});if(!B)return null;var I=B.item,F=sE(B,cie);return N.cloneElement(I,Q(Q({},F),{},{chartWidth:C,chartHeight:T,margin:L,onBBoxUpdate:S.handleLegendBBoxUpdate}))}),Oe(S,"renderTooltip",function(){var x,E=S.props,_=E.children,C=E.accessibilityLayer,T=Zn(_,pn);if(!T)return null;var L=S.state,M=L.isTooltipActive,B=L.activeCoordinate,I=L.activePayload,F=L.activeLabel,z=L.offset,R=(x=T.props.active)!==null&&x!==void 0?x:M;return N.cloneElement(T,{viewBox:Q(Q({},z),{},{x:z.left,y:z.top}),active:R,label:F,payload:R?I:[],coordinate:B,accessibilityLayer:C})}),Oe(S,"renderBrush",function(x){var E=S.props,_=E.margin,C=E.data,T=S.state,L=T.offset,M=T.dataStartIndex,B=T.dataEndIndex,I=T.updateId;return N.cloneElement(x,{key:x.key||"_recharts-brush",onChange:kd(S.handleBrushChange,x.props.onChange),data:C,x:de(x.props.x)?x.props.x:L.left,y:de(x.props.y)?x.props.y:L.top+L.height+L.brushBottom-(_.bottom||0),width:de(x.props.width)?x.props.width:L.width,startIndex:M,endIndex:B,updateId:"brush-".concat(I)})}),Oe(S,"renderReferenceElement",function(x,E,_){if(!x)return null;var C=S,T=C.clipPathId,L=S.state,M=L.xAxisMap,B=L.yAxisMap,I=L.offset,F=x.type.defaultProps||{},z=x.props,R=z.xAxisId,O=R===void 0?F.xAxisId:R,U=z.yAxisId,A=U===void 0?F.yAxisId:U;return N.cloneElement(x,{key:x.key||"".concat(E,"-").concat(_),xAxis:M[O],yAxis:B[A],viewBox:{x:I.left,y:I.top,width:I.width,height:I.height},clipPathId:T})}),Oe(S,"renderActivePoints",function(x){var E=x.item,_=x.activePoint,C=x.basePoint,T=x.childIndex,L=x.isRange,M=[],B=E.props.key,I=E.item.type.defaultProps!==void 0?Q(Q({},E.item.type.defaultProps),E.item.props):E.item.props,F=I.activeDot,z=I.dataKey,R=Q(Q({index:T,dataKey:z,cx:_.x,cy:_.y,r:4,fill:g0(E.item),strokeWidth:2,stroke:"#fff",payload:_.payload,value:_.value},Ke(F,!1)),Of(F));return M.push(y.renderActiveDot(F,R,"".concat(B,"-activePoint-").concat(T))),C?M.push(y.renderActiveDot(F,Q(Q({},R),{},{cx:C.x,cy:C.y}),"".concat(B,"-basePoint-").concat(T))):L&&M.push(null),M}),Oe(S,"renderGraphicChild",function(x,E,_){var C=S.filterFormatItem(x,E,_);if(!C)return null;var T=S.getTooltipEventType(),L=S.state,M=L.isTooltipActive,B=L.tooltipAxis,I=L.activeTooltipIndex,F=L.activeLabel,z=S.props.children,R=Zn(z,pn),O=C.props,U=O.points,A=O.isRange,Z=O.baseLine,$=C.item.type.defaultProps!==void 0?Q(Q({},C.item.type.defaultProps),C.item.props):C.item.props,P=$.activeDot,oe=$.hide,be=$.activeBar,pe=$.activeShape,Ce=!!(!oe&&M&&R&&(P||be||pe)),G={};T!=="axis"&&R&&R.props.trigger==="click"?G={onClick:kd(S.handleItemMouseEnter,x.props.onClick)}:T!=="axis"&&(G={onMouseLeave:kd(S.handleItemMouseLeave,x.props.onMouseLeave),onMouseEnter:kd(S.handleItemMouseEnter,x.props.onMouseEnter)});var Y=N.cloneElement(x,Q(Q({},C.props),G));function ae(qe){return typeof B.dataKey=="function"?B.dataKey(qe.payload):null}if(Ce)if(I>=0){var le,X;if(B.dataKey&&!B.allowDuplicatedCategory){var je=typeof B.dataKey=="function"?ae:"payload.".concat(B.dataKey.toString());le=Fy(U,je,F),X=A&&Z&&Fy(Z,je,F)}else le=U==null?void 0:U[I],X=A&&Z&&Z[I];if(pe||be){var Ne=x.props.activeIndex!==void 0?x.props.activeIndex:I;return[N.cloneElement(x,Q(Q(Q({},C.props),G),{},{activeIndex:Ne})),null,null]}if(!Ye(le))return[Y].concat(Yo(S.renderActivePoints({item:C,activePoint:le,basePoint:X,childIndex:I,isRange:A})))}else{var _e,ge=(_e=S.getItemByXY(S.state.activeCoordinate))!==null&&_e!==void 0?_e:{graphicalItem:Y},$e=ge.graphicalItem,fe=$e.item,et=fe===void 0?x:fe,De=$e.childIndex,Ee=Q(Q(Q({},C.props),G),{},{activeIndex:De});return[N.cloneElement(et,Ee),null,null]}return A?[Y,null,null]:[Y,null]}),Oe(S,"renderCustomized",function(x,E,_){return N.cloneElement(x,Q(Q({key:"recharts-customized-".concat(_)},S.props),S.state))}),Oe(S,"renderMap",{CartesianGrid:{handler:Ad,once:!0},ReferenceArea:{handler:S.renderReferenceElement},ReferenceLine:{handler:Ad},ReferenceDot:{handler:S.renderReferenceElement},XAxis:{handler:Ad},YAxis:{handler:Ad},Brush:{handler:S.renderBrush,once:!0},Bar:{handler:S.renderGraphicChild},Line:{handler:S.renderGraphicChild},Area:{handler:S.renderGraphicChild},Radar:{handler:S.renderGraphicChild},RadialBar:{handler:S.renderGraphicChild},Scatter:{handler:S.renderGraphicChild},Pie:{handler:S.renderGraphicChild},Funnel:{handler:S.renderGraphicChild},Tooltip:{handler:S.renderCursor,once:!0},PolarGrid:{handler:S.renderPolarGrid,once:!0},PolarAngleAxis:{handler:S.renderPolarAxis},PolarRadiusAxis:{handler:S.renderPolarAxis},Customized:{handler:S.renderCustomized}}),S.clipPathId="".concat((w=b.id)!==null&&w!==void 0?w:xp("recharts"),"-clip"),S.throttleTriggeredAfterMouseMove=iO(S.triggeredAfterMouseMove,(k=b.throttleDelay)!==null&&k!==void 0?k:1e3/60),S.state={},S}return wie(y,v),yie(y,[{key:"componentDidMount",value:function(){var w,k;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w: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 w=this.props,k=w.children,S=w.data,x=w.height,E=w.layout,_=Zn(k,pn);if(_){var C=_.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,L=lb(this.state,S,C,T),M=this.state.tooltipTicks[C].coordinate,B=(this.state.offset.top+x)/2,I=E==="horizontal",F=I?{x:M,y:B}:{y:M,x:B},z=this.state.formattedGraphicalItems.find(function(O){var U=O.item;return U.type.name==="Scatter"});z&&(F=Q(Q({},F),z.props.points[C].tooltipPosition),L=z.props.points[C].tooltipPayload);var R={activeTooltipIndex:C,isTooltipActive:!0,activeLabel:T,activePayload:L,activeCoordinate:F};this.setState(R),this.renderCursor(_),this.accessibilityManager.setIndex(C)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,k){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==k.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var S,x;this.accessibilityManager.setDetails({offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(x=this.props.margin.top)!==null&&x!==void 0?x:0}})}return null}},{key:"componentDidUpdate",value:function(w){Wy([Zn(w.children,pn)],[Zn(this.props.children,pn)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=Zn(this.props.children,pn);if(w&&typeof w.props.shared=="boolean"){var k=w.props.shared?"axis":"item";return l.indexOf(k)>=0?k:a}return a}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var k=this.container,S=k.getBoundingClientRect(),x=Eq(S),E={chartX:Math.round(w.pageX-x.left),chartY:Math.round(w.pageY-x.top)},_=S.width/k.offsetWidth||1,C=this.inRange(E.chartX,E.chartY,_);if(!C)return null;var T=this.state,L=T.xAxisMap,M=T.yAxisMap,B=this.getTooltipEventType(),I=lE(this.state,this.props.data,this.props.layout,C);if(B!=="axis"&&L&&M){var F=Ki(L).scale,z=Ki(M).scale,R=F&&F.invert?F.invert(E.chartX):null,O=z&&z.invert?z.invert(E.chartY):null;return Q(Q({},E),{},{xValue:R,yValue:O},I)}return I?Q(Q({},E),I):null}},{key:"inRange",value:function(w,k){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,x=this.props.layout,E=w/S,_=k/S;if(x==="horizontal"||x==="vertical"){var C=this.state.offset,T=E>=C.left&&E<=C.left+C.width&&_>=C.top&&_<=C.top+C.height;return T?{x:E,y:_}:null}var L=this.state,M=L.angleAxisMap,B=L.radiusAxisMap;if(M&&B){var I=Ki(M);return Vk({x:E,y:_},I)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,k=this.getTooltipEventType(),S=Zn(w,pn),x={};S&&k==="axis"&&(S.props.trigger==="click"?x={onClick:this.handleClick}:x={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var E=Of(this.props,this.handleOuterEvent);return Q(Q({},E),x)}},{key:"addListener",value:function(){cg.on(ug,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){cg.removeListener(ug,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,k,S){for(var x=this.state.formattedGraphicalItems,E=0,_=x.length;E<_;E++){var C=x[E];if(C.item===w||C.props.key===w.key||k===wi(C.item.type)&&S===C.childIndex)return C}return null}},{key:"renderClipPath",value:function(){var w=this.clipPathId,k=this.state.offset,S=k.left,x=k.top,E=k.height,_=k.width;return H.createElement("defs",null,H.createElement("clipPath",{id:w},H.createElement("rect",{x:S,y:x,height:E,width:_})))}},{key:"getXScales",value:function(){var w=this.state.xAxisMap;return w?Object.entries(w).reduce(function(k,S){var x=aE(S,2),E=x[0],_=x[1];return Q(Q({},k),{},Oe({},E,_.scale))},{}):null}},{key:"getYScales",value:function(){var w=this.state.yAxisMap;return w?Object.entries(w).reduce(function(k,S){var x=aE(S,2),E=x[0],_=x[1];return Q(Q({},k),{},Oe({},E,_.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(w){var k;return(k=this.state.xAxisMap)===null||k===void 0||(k=k[w])===null||k===void 0?void 0:k.scale}},{key:"getYScaleByAxisId",value:function(w){var k;return(k=this.state.yAxisMap)===null||k===void 0||(k=k[w])===null||k===void 0?void 0:k.scale}},{key:"getItemByXY",value:function(w){var k=this.state,S=k.formattedGraphicalItems,x=k.activeItem;if(S&&S.length)for(var E=0,_=S.length;E<_;E++){var C=S[E],T=C.props,L=C.item,M=L.type.defaultProps!==void 0?Q(Q({},L.type.defaultProps),L.props):L.props,B=wi(L.type);if(B==="Bar"){var I=(T.data||[]).find(function(O){return dJ(w,O)});if(I)return{graphicalItem:C,payload:I}}else if(B==="RadialBar"){var F=(T.data||[]).find(function(O){return Vk(w,O)});if(F)return{graphicalItem:C,payload:F}}else if(Bp(C,x)||zp(C,x)||pu(C,x)){var z=pee({graphicalItem:C,activeTooltipItem:x,itemData:M.data}),R=M.activeIndex===void 0?z:M.activeIndex;return{graphicalItem:Q(Q({},C),{},{childIndex:R}),payload:pu(C,x)?M.data[z]:C.props.data[z]}}}return null}},{key:"render",value:function(){var w=this;if(!B1(this))return null;var k=this.props,S=k.children,x=k.className,E=k.width,_=k.height,C=k.style,T=k.compact,L=k.title,M=k.desc,B=sE(k,uie),I=Ke(B,!1);if(T)return H.createElement(HN,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},H.createElement(Gy,lo({},I,{width:E,height:_,title:L,desc:M}),this.renderClipPath(),F1(S,this.renderMap)));if(this.props.accessibilityLayer){var F,z;I.tabIndex=(F=this.props.tabIndex)!==null&&F!==void 0?F:0,I.role=(z=this.props.role)!==null&&z!==void 0?z:"application",I.onKeyDown=function(O){w.accessibilityManager.keyboardEvent(O)},I.onFocus=function(){w.accessibilityManager.focus()}}var R=this.parseEventsOfWrapper();return H.createElement(HN,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},H.createElement("div",lo({className:Ve("recharts-wrapper",x),style:Q({position:"relative",cursor:"default",width:E,height:_},C)},R,{ref:function(U){w.container=U}}),H.createElement(Gy,lo({},I,{width:E,height:_,title:L,desc:M,style:jie}),this.renderClipPath(),F1(S,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(N.Component);Oe(g,"displayName",n),Oe(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)),Oe(g,"getDerivedStateFromProps",function(v,y){var b=v.dataKey,w=v.data,k=v.children,S=v.width,x=v.height,E=v.layout,_=v.stackOffset,C=v.margin,T=y.dataStartIndex,L=y.dataEndIndex;if(y.updateId===void 0){var M=cE(v);return Q(Q(Q({},M),{},{updateId:0},p(Q(Q({props:v},M),{},{updateId:0}),y)),{},{prevDataKey:b,prevData:w,prevWidth:S,prevHeight:x,prevLayout:E,prevStackOffset:_,prevMargin:C,prevChildren:k})}if(b!==y.prevDataKey||w!==y.prevData||S!==y.prevWidth||x!==y.prevHeight||E!==y.prevLayout||_!==y.prevStackOffset||!yo(C,y.prevMargin)){var B=cE(v),I={chartX:y.chartX,chartY:y.chartY,isTooltipActive:y.isTooltipActive},F=Q(Q({},lE(y,w,E)),{},{updateId:y.updateId+1}),z=Q(Q(Q({},B),I),F);return Q(Q(Q({},z),p(Q({props:v},z),y)),{},{prevDataKey:b,prevData:w,prevWidth:S,prevHeight:x,prevLayout:E,prevStackOffset:_,prevMargin:C,prevChildren:k})}if(!Wy(k,y.prevChildren)){var R,O,U,A,Z=Zn(k,zo),$=Z&&(R=(O=Z.props)===null||O===void 0?void 0:O.startIndex)!==null&&R!==void 0?R:T,P=Z&&(U=(A=Z.props)===null||A===void 0?void 0:A.endIndex)!==null&&U!==void 0?U:L,oe=$!==T||P!==L,be=!Ye(w),pe=be&&!oe?y.updateId:y.updateId+1;return Q(Q({updateId:pe},p(Q(Q({props:v},y),{},{updateId:pe,dataStartIndex:$,dataEndIndex:P}),y)),{},{prevChildren:k,dataStartIndex:$,dataEndIndex:P})}return null}),Oe(g,"renderActiveDot",function(v,y,b){var w;return N.isValidElement(v)?w=N.cloneElement(v,y):Le(v)?w=v(y):w=H.createElement(kP,y),H.createElement(Yt,{className:"recharts-active-dot",key:b},w)});var m=N.forwardRef(function(y,b){return H.createElement(g,lo({},y,{ref:b}))});return m.displayName=g.displayName,m},Ua=Lie({chartName:"BarChart",GraphicalChild:hn,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Xr},{axisType:"yAxis",AxisComp:Zr}],formatAxisMap:Bte});const Die=new Intl.NumberFormat("en-US");function gt(e){return Die.format(e)}function dE(e){return e==null||e<1e-5?"$0.00":e<.01?"$"+e.toFixed(6):"$"+e.toFixed(4)}function Bi(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":gt(e)}const Bie={local:"#3fb950",groq:"#58a6ff",gemini:"#bc8cff",nim:"#39d2c0",openrouter:"#d29922"};function zie({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:dE(t.totalCost),label:"Total Cost"},{icon:"๐Ÿ“ž",value:Bi(t.totalRequests),label:"API Requests"},{icon:"๐Ÿง ",value:Bi(i.total),label:"Trajectories"},{icon:"๐Ÿ“",value:Bi(n.total),label:"Chat Sessions"},{icon:"๐Ÿ†",value:Bi(r.totalRuns),label:"Benchmark Runs"},{icon:"๐Ÿ“ฆ",value:Bi(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:Bi(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:Bi(((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:Bi(((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(Fa,{width:"100%",height:260,children:s.jsxs(Ua,{data:l,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Vi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Xr,{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(pn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"},formatter:h=>[dE(h),"Cost"]}),s.jsx(hn,{dataKey:"value",radius:[4,4,0,0],children:l.map(h=>s.jsx(Hc,{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(Fa,{width:"100%",height:260,children:s.jsxs(Ua,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Vi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Xr,{dataKey:"name",tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(Zr,{tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(pn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"}}),s.jsx(hn,{dataKey:"value",fill:"#bc8cff",radius:[4,4,0,0],fillOpacity:.8})]})}):s.jsx("div",{className:"empty-state",children:"No trajectory data yet."})})]})}const fE={planner:"๐Ÿ“‹","context-gatherer":"๐Ÿ“‚",writer:"โœ๏ธ",reviewer:"๐Ÿ‘๏ธ",tester:"๐Ÿงช",debugger:"๐Ÿ›",runner:"โ–ถ๏ธ",git:"๐Ÿ”€",package:"๐Ÿ“ฆ","github-release":"๐Ÿท๏ธ",security:"๐Ÿ”’",orchestrator:"๐ŸŽฏ"},hE={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"},fg={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"},pE={pending:{icon:"โณ",label:"Pending"},running:{icon:"โ–ถ๏ธ",label:"Running"},completed:{icon:"โœ…",label:"Done"},failed:{icon:"โŒ",label:"Failed"}},Fie={pending:"#6e7681",running:"#58a6ff",completed:"#3fb950",failed:"#f85149"};function Uie(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 Wie(e,t){const n=[],r=new Set,i=Uie(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 zi(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 mE(e){return e?new Date(e).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}function Hie(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 Gie({runs:e,selectedRunId:t,onSelectRun:n,onScrub:r}){const[i,a]=N.useState(null),o=e.find(E=>E.id===(t??i))??e[0]??null,[l,c]=N.useState(0),[u,d]=N.useState(!1),f=N.useRef(null),h=N.useRef(!1),p=N.useRef(r);N.useEffect(()=>{p.current=r},[r]),N.useEffect(()=>{var E;!o&&e.length>0?a(e[0].id):o&&!e.some(_=>_.id===o.id)&&a(((E=e[0])==null?void 0:E.id)??null)},[e,o]);const{laid:g,total:m}=N.useMemo(()=>Hie((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=N.useMemo(()=>{if(m<=0)return null;const E=v*m;return g.find(_=>E>=_.start*m&&E<(_.start+_.width)*m)||null},[g,v,m]);N.useEffect(()=>{var E;(E=p.current)==null||E.call(p,(y==null?void 0:y.id)??null)},[y==null?void 0:y.id]),N.useEffect(()=>{if(!u)return;const E=setInterval(()=>{c(_=>_+m/2e3*50)},50);return()=>clearInterval(E)},[u,m]),N.useEffect(()=>{u&&m>0&&l>=m&&(d(!1),c(0))},[u,m,l]);const b=N.useCallback(E=>{const _=f.current;if(!_||m<=0)return;const C=_.getBoundingClientRect(),T=C.width||1,L=Math.min(1,Math.max(0,(E-C.left)/T));c(L*m)},[m]),w=E=>{h.current=!0,d(!1),b(E.clientX)};if(N.useEffect(()=>{const E=C=>{h.current&&b(C.clientX)},_=()=>{h.current=!1};return window.addEventListener("pointermove",E),window.addEventListener("pointerup",_),()=>{window.removeEventListener("pointermove",E),window.removeEventListener("pointerup",_)}},[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(E=>E.status==="completed").length,x=o.phases.filter(E=>E.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(E=>s.jsxs("button",{className:`phase-run-chip ${E.id===o.id?"active":""} ${E.id.startsWith("live-")?"live":""}`,onClick:()=>{a(E.id),c(0),d(!1),n==null||n(E.id)},title:E.goal,children:[E.id.startsWith("live-")&&s.jsx("span",{className:"dag-live-dot"}),E.engine&&s.jsx("span",{className:`phase-run-chip-engine phase-run-chip-engine-${E.engine}`,children:E.engine==="loop"?"๐Ÿ”":"โฌก"}),E.goal.length>32?E.goal.slice(0,30)+"โ€ฆ":E.goal,s.jsx("span",{className:"phase-run-chip-time",children:mE(E.startedAt)})]},E.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]}),x>0&&s.jsxs("span",{className:"phase-meta-item phase-meta-bad",children:["โŒ ",x]}),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:["โฑ ",zi(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:[zi(l)," / ",zi(m)]}),s.jsx("input",{className:"phase-range",type:"range",min:0,max:m||1,step:1,value:Math.min(l,m||1),onChange:E=>{d(!1),c(Number(E.target.value))},"aria-label":"Scrub pipeline timeline"})]}),s.jsxs("div",{className:"phase-track-wrap",children:[s.jsxs("div",{ref:f,className:"phase-track",onPointerDown:w,style:{cursor:"grab"},children:[g.map(E=>{const _=hE[E.agentType]||"#58a6ff",C=Fie[E.status],T=(y==null?void 0:y.id)===E.id;return s.jsxs("button",{className:`phase-block phase-block-${E.status} ${T?"active":""}`,style:{left:`${E.start*100}%`,width:`${Math.max(E.width*100,2)}%`,background:`linear-gradient(180deg, ${_}cc, ${_}66)`,boxShadow:T?`0 0 0 2px ${C}`:void 0},onClick:L=>{L.stopPropagation(),d(!1),c((E.start+E.width/2)*m)},title:`${fg[E.agentType]||E.agentType}: ${E.description}`,children:[s.jsx("span",{className:"phase-block-icon",children:fE[E.agentType]||"โš™๏ธ"}),s.jsx("span",{className:"phase-block-label",children:fg[E.agentType]||E.agentType})]},E.id)}),s.jsx("div",{className:"phase-caret",style:{left:`${v*100}%`},onPointerDown:E=>{E.stopPropagation(),w(E)},title:`${zi(l)} elapsed`})]}),s.jsxs("div",{className:"phase-ticks",children:[s.jsx("span",{children:"0"}),s.jsx("span",{children:zi(Math.round(m/2))}),s.jsx("span",{children:zi(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:fE[y.agentType]||"โš™๏ธ"}),s.jsx("span",{className:"phase-detail-agent",style:{color:hE[y.agentType]||"#58a6ff"},children:fg[y.agentType]||y.agentType}),s.jsxs("span",{className:`phase-status-badge phase-status-${y.status}`,children:[pE[y.status].icon," ",pE[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?zi(y.dur):`~${zi(y.dur)}`]}),y.startedAt?s.jsxs("span",{children:["๐Ÿ• ",mE(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."})]})})]})}function hg(e){return e===void 0?"โ€”":`$${e.toFixed(5)}`}function gE(e){if(e===void 0||!Number.isFinite(e)||e<0)return"โ€”";if(e<1e3)return`${Math.round(e)}ms`;const t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;const n=Math.floor(t/60);return n<60?`${n}m ${String(Math.round(t%60)).padStart(2,"0")}s`:`${Math.floor(n/60)}h ${String(n%60).padStart(2,"0")}m`}function pg(e){return e===void 0?"โ€”":e.toLocaleString("en-US")}function qie({jobs:e}){const t=N.useMemo(()=>e.filter(u=>u.batchStats.length>0),[e]),[n,r]=N.useState(null);if(t.length===0)return null;const i=t.find(u=>u.id===n)??t[0],a=i.batchStats,o=a.filter(u=>u.durationMs!==void 0),l=o.reduce((u,d)=>u+(d.durationMs??0),0),c=o.length>0?l/o.length:void 0;return s.jsxs("div",{className:"dag-timeline-section","data-testid":"batch-economy",children:[s.jsxs("h3",{className:"section-subtitle",children:["๐Ÿ“Š Per-batch cost & latency"," ",s.jsx("span",{className:"timeline-subtitle",children:"โ€” measured, not estimated"})]}),t.length>1&&s.jsx("div",{className:"dag-loop-turn-meta",style:{marginBottom:8},children:t.slice(0,5).map(u=>s.jsx("button",{type:"button",className:"dag-loop-turn-chip",onClick:()=>r(u.id),style:{cursor:"pointer",opacity:u.id===i.id?1:.55,fontWeight:u.id===i.id?600:400},children:u.progressLine??u.goal.slice(0,40)},u.id))}),s.jsxs("div",{className:"dag-loop-turn-meta",style:{marginBottom:8},children:[s.jsxs("span",{className:"dag-loop-turn-chip",children:[i.kind==="long-form"?"๐Ÿ“–":"๐Ÿ› ๏ธ"," ",i.status]}),s.jsxs("span",{className:"dag-loop-turn-chip",children:[i.progress,"% done"]}),s.jsxs("span",{className:"dag-loop-turn-chip",children:[i.batches," batch",i.batches===1?"":"es"]}),s.jsxs("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-dim",children:[pg(i.tokens)," tokens ยท ",hg(i.costUsd)]}),i.stopReason&&s.jsxs("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-dim",children:["stopped: ",i.stopReason]})]}),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:"Batch"}),s.jsx("th",{children:"Done"}),s.jsx("th",{children:"Tokens"}),s.jsx("th",{children:"Cost"}),s.jsx("th",{children:"Time"})]})}),s.jsxs("tbody",{children:[a.map(u=>s.jsxs("tr",{children:[s.jsx("td",{children:u.index}),s.jsx("td",{children:`${Math.round(u.progress)}%`}),s.jsx("td",{children:pg(u.tokens)}),s.jsx("td",{children:hg(u.costUsd)}),s.jsx("td",{children:gE(u.durationMs)})]},u.index)),a.some(u=>u.error)&&s.jsx("tr",{children:s.jsxs("td",{colSpan:5,style:{opacity:.75},children:["โœ— failures:"," ",a.filter(u=>u.error).map(u=>`#${u.index} ${u.error}`).join(" ยท ")]})}),s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("strong",{children:"total"})}),s.jsx("td",{children:s.jsx("strong",{children:`${i.progress}%`})}),s.jsx("td",{children:s.jsx("strong",{children:pg(i.tokens)})}),s.jsx("td",{children:s.jsx("strong",{children:hg(i.costUsd)})}),s.jsx("td",{children:s.jsx("strong",{children:c===void 0?"โ€”":`~${gE(c)} avg`})})]})]})]})})]})}const yE={planner:"๐Ÿ“‹","context-gatherer":"๐Ÿ“‚",writer:"โœ๏ธ",reviewer:"๐Ÿ‘๏ธ",tester:"๐Ÿงช",debugger:"๐Ÿ›",runner:"โ–ถ๏ธ",git:"๐Ÿ”€",package:"๐Ÿ“ฆ","github-release":"๐Ÿท๏ธ",security:"๐Ÿ”’",orchestrator:"๐ŸŽฏ"},mg={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"},Kie={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"}},vE={pending:"โณ Pending",running:"โ–ถ๏ธ Running",completed:"โœ… Done",failed:"โŒ Failed"},Fs={trivial:{icon:"๐ŸŸข",color:"#3fb950"},simple:{icon:"๐Ÿ”ต",color:"#58a6ff"},moderate:{icon:"๐ŸŸก",color:"#d29922"},complex:{icon:"๐ŸŸ ",color:"#f0883e"},critical:{icon:"๐Ÿ”ด",color:"#f85149"}},gg={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 Vie(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 w=Math.max(...y.map(k=>u(k.from)))+1;return l.set(v,w),w}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),w=b.indexOf(v),k=b.length,S=k*(r+a)-a,x=g/2-S/2;m.push({...v,x:o+y*(n+i),y:x+w*(r+a),w:n,h:r,step:y,totalInStep:k,indexInStep:w})}return{layoutNodes:m,svgW:p,svgH:g}}function yg(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 bE(e){return e?new Date(e).toLocaleTimeString("en-US",{minute:"2-digit",second:"2-digit"}):""}function Yie({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 Xie({data:e}){var A,Z;const t=e==null?void 0:e.dag,n=(A=e==null?void 0:e.memory)==null?void 0:A.total,[r,i]=N.useState(null),[a,o]=N.useState(null),[l,c]=N.useState(void 0),[u,d]=N.useState(void 0),[f,h]=N.useState(void 0);N.useEffect(()=>J.onDAGEvent(P=>{i(P),c(P.engine),d(P.engineExplanation),h(P.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=N.useMemo(()=>Wie(p,e==null?void 0:e.pipelineRuns),[p,e==null?void 0:e.pipelineRuns]),b=$=>{o($)},w=!!(p&&(p.nodes.length>0||p.active)),k=y.length>0,S=!!v,x=((Z=e==null?void 0:e.unattendedJobs)==null?void 0:Z.jobs)??[],E=x.some($=>$.batchStats.length>0);if(!w&&!k&&!S&&!E)return s.jsx(Yie,{memoryTotal:n});const{nodes:_,edges:C,pipeline:T,active:L}=p??{nodes:[],edges:[],pipeline:null,active:!1},{layoutNodes:M,svgW:B,svgH:I}=Vie(_,C),F=_.filter($=>$.status==="running").length,z=_.filter($=>$.status==="completed").length,R=_.filter($=>$.status==="failed").length,O=_.filter($=>$.status==="pending").length,U=_.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(Gie,{runs:y,onScrub:b})]}),s.jsx(qie,{jobs:x}),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:["โฑ ",yg(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)=>s.jsxs("span",{className:`dag-loop-tool ${$.ok===!1?"dag-loop-tool-error":""}`,title:$.error||`${$.tool}${$.durationMs!==void 0?` ยท ${$.durationMs}ms`:""}`,children:[$.ok===!1?"โŒ":"โœ“"," ",$.tool]},`${$.tool}-${P}`))})]}),w&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`dag-status-bar ${L?"active":""}`,children:[s.jsxs("div",{className:"dag-pipeline-name",children:[L&&s.jsx("span",{className:"dag-live-dot"}),T||"Execution Pipeline"]}),s.jsxs("div",{className:"dag-pipeline-meta",children:[L&&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:[U," steps"]}),F>0&&s.jsxs("span",{className:"dag-running-badge",children:["โ–ถ ",F," running"]}),O>0&&s.jsxs("span",{className:"dag-pending-badge",children:["โณ ",O," pending"]}),s.jsxs("span",{className:"dag-completed-badge",children:["โœ… ",z," done"]}),R>0&&s.jsxs("span",{className:"dag-failed-badge",children:["โŒ ",R," failed"]})]})]}),s.jsx("div",{className:"dag-container",children:s.jsxs("svg",{width:B,height:I,viewBox:`0 0 ${B} ${I}`,children:[s.jsxs("defs",{children:[C.map($=>s.jsx("marker",{id:`arrow-${$.from}-${$.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-${$.from}-${$.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"})]})]})]}),C.map($=>{const P=M.find(X=>X.id===$.from),oe=M.find(X=>X.id===$.to);if(!P||!oe)return null;const be=P.x+P.w,pe=P.y+P.h/2,Ce=oe.x,G=oe.y+oe.h/2,Y=(be+Ce)/2,ae=oe.status,le=ae==="failed"?"#f85149":ae==="running"?"#58a6ff":ae==="completed"?"#3fb950":"#30363d";return s.jsx("g",{children:s.jsx("path",{d:`M ${be} ${pe} C ${Y} ${pe}, ${Y} ${G}, ${Ce} ${G}`,fill:"none",stroke:le,strokeWidth:ae==="pending"?1.5:2.5,strokeOpacity:ae==="pending"?.3:.8,markerEnd:`url(#arrow-${$.from}-${$.to})`,className:"dag-edge"})},`edge-${$.from}-${$.to}`)}),M.map($=>{const P=Kie[$.status];mg[$.agentType];const oe=yE[$.agentType]||"โš™๏ธ",be=gg[$.agentType]||$.agentType,pe=a===$.id,Ce=$.status==="running";return s.jsxs("g",{onClick:()=>o(pe?null:$.id),style:{cursor:"pointer"},className:"dag-node-group",children:[pe&&s.jsx("rect",{x:$.x-4,y:$.y-4,width:$.w+8,height:$.h+8,rx:10,ry:10,fill:"none",stroke:"#58a6ff",strokeWidth:2,strokeOpacity:.5}),s.jsx("rect",{x:$.x,y:$.y,width:$.w,height:$.h,rx:8,ry:8,fill:P.bg,stroke:P.stroke,strokeWidth:Ce?2.5:1.5,strokeOpacity:.9,className:Ce?"dag-node-running":"",filter:Ce?"url(#glow)":void 0}),s.jsxs("text",{x:$.x+10,y:$.y+22,fill:"#e6edf3",fontSize:10,fontWeight:600,children:[oe," ",be]}),s.jsx("text",{x:$.x+$.w-10,y:$.y+22,textAnchor:"end",fill:P.text,fontSize:9,fontWeight:500,children:vE[$.status]}),s.jsx("text",{x:$.x+10,y:$.y+40,fill:"#8b949e",fontSize:9,children:$.description.length>28?$.description.slice(0,26)+"..":$.description}),$.complexity&&Fs[$.complexity]&&s.jsxs("text",{x:$.x+10,y:$.y+54,fill:Fs[$.complexity].color,fontSize:8,fontWeight:600,children:[Fs[$.complexity].icon," ",$.complexity]}),s.jsx("text",{x:$.x+10,y:$.y+56,fill:"#6e7681",fontSize:8,children:yg($.startedAt,$.completedAt)}),s.jsx("text",{x:$.x+$.w-10,y:$.y+56,textAnchor:"end",fill:"#6e7681",fontSize:8,children:bE($.startedAt||$.completedAt)}),($.status==="failed"||pe)&&$.summary&&s.jsx("foreignObject",{x:Math.max(10,$.x-80),y:$.y+$.h+6,width:$.w+160,height:36,children:s.jsx("div",{className:"dag-node-summary",style:{color:$.status==="failed"?"#f85149":"#8b949e",fontSize:"10px",lineHeight:1.4,background:"rgba(13,17,23,0.9)",padding:"4px 8px",borderRadius:"4px",border:`1px solid ${$.status==="failed"?"rgba(248,81,73,0.3)":"rgba(48,54,61,0.5)"}`,maxHeight:"32px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:$.summary})})]},`node-${$.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:M.map($=>s.jsxs("tr",{className:`dag-row dag-row-${$.status}`,children:[s.jsx("td",{className:"dag-cell-step",children:$.step}),s.jsxs("td",{className:"dag-cell-agent",children:[s.jsx("span",{className:"dag-agent-dot",style:{background:mg[$.agentType]||"#58a6ff"}}),gg[$.agentType]||$.agentType]}),s.jsx("td",{className:"dag-cell-complexity",children:$.complexity&&Fs[$.complexity]?s.jsxs("span",{style:{color:Fs[$.complexity].color,fontSize:12},children:[Fs[$.complexity].icon," ",$.complexity]}):s.jsx("span",{style:{color:"#6e7681",fontSize:12},children:"โ€”"})}),s.jsx("td",{className:`dag-cell-status dag-status-${$.status}`,children:vE[$.status]}),s.jsx("td",{className:"dag-cell-duration",children:yg($.startedAt,$.completedAt)}),s.jsx("td",{className:"dag-cell-time",children:bE($.startedAt||$.completedAt)}),s.jsx("td",{className:"dag-cell-summary",children:$.summary||$.description||"--"})]},$.id))})]})}),s.jsx("h3",{className:"section-subtitle",children:"Agent Types"}),s.jsxs("div",{className:"dag-legend",children:[Object.entries(yE).map(([$,P])=>s.jsxs("div",{className:"legend-item",children:[s.jsx("span",{className:"legend-dot",style:{background:mg[$]||"#58a6ff"}}),s.jsx("span",{className:"legend-icon",children:P}),s.jsx("span",{className:"legend-label",children:gg[$]||$})]},$)),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 Us(e){return e==null||e<1e-5?"$0.00":e<.01?"$"+e.toFixed(6):"$"+e.toFixed(4)}function Kl(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":gt(e)}function Zie(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Qie({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:Us(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:Kl(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:Kl(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:Us(t.measuredCost)}),s.jsxs("span",{className:"cost-label",children:[Kl(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:Us(t.estimatedCost)}),s.jsxs("span",{className:"cost-label",children:[Kl(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:Us(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:Us(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:Zie(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:Us(a.costUsd)}),s.jsxs("span",{className:"request-tokens",children:[Kl(a.totalTokens)," tok"]})]},o))})]})}function Jie(e){return e==null?"$0.00":"$"+e.toFixed(6)}function Cd(e){return e==null?"0%":(e*100).toFixed(1)+"%"}function eae({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:Cd(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:Jie(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(Fa,{width:"100%",height:260,children:s.jsxs(Ua,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Vi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Xr,{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(pn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"},formatter:u=>[u+"%","Pass Rate"]}),s.jsx(hn,{dataKey:"passRate",radius:[4,4,0,0],children:c.map((u,d)=>s.jsx(Hc,{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(Fa,{width:"100%",height:260,children:s.jsxs(Ua,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Vi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Xr,{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(pn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"},formatter:u=>[u+"ms","Latency"]}),s.jsx(hn,{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(Fa,{width:"100%",height:260,children:s.jsxs(Ua,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Vi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Xr,{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(pn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"},formatter:u=>["$"+u.toFixed(6),"Cost"]}),s.jsx(hn,{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:Cd(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:Cd(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:Cd(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(Fa,{width:"100%",height:260,children:s.jsxs(Ua,{data:l,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Vi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Xr,{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(pn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"},formatter:u=>[u+"%","Composite Score"]}),s.jsx(hn,{dataKey:"score",radius:[4,4,0,0],children:l.map((u,d)=>s.jsx(Hc,{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(Fa,{width:"100%",height:260,children:s.jsxs(Ua,{data:l,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Vi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Xr,{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(pn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"}}),s.jsx(es,{wrapperStyle:{color:"#8b949e"}}),s.jsx(hn,{dataKey:"completion",name:"Completion",fill:"#3fb950",radius:[4,4,0,0],fillOpacity:.8}),s.jsx(hn,{dataKey:"tests",name:"Tests",fill:"#58a6ff",radius:[4,4,0,0],fillOpacity:.8}),s.jsx(hn,{dataKey:"recovery",name:"Recovery",fill:"#d29922",radius:[4,4,0,0],fillOpacity:.8}),s.jsx(hn,{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 vg(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":gt(e)}function tae({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:vg(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:[vg(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:[vg(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 nae=new Set(["local","lmstudio","vllm"]),rae=new Set([]),Th={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"}},iae=[3,4,5],hR=12e3,xE=[300,700],aae=6e4,sae=5e3;function oae(e){return new Promise(t=>setTimeout(t,e))}async function pR(e,t){const n=new AbortController,r=setTimeout(()=>n.abort(),t);try{return await fetch(e,{signal:n.signal})}finally{clearTimeout(r)}}function mR(e){return e instanceof TypeError||e instanceof Error&&e.name==="AbortError"}async function lae(e){let t=null,n=!1;for(let r=0;;r++){try{const i=await pR("/api/models",hR);if(!i.ok)t=i.status;else{const a=await ur(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(!mR(i))throw i;n=!0,e==null||e()}if(r>=xE.length)throw new Error(n?"Dashboard server unreachable โ€” is it still running? Retrying automaticallyโ€ฆ":`Model health endpoint failed (HTTP ${t})`);await oae(xE[r])}}async function cae(e){for(let t=0;;t++)try{const n=await pR("/api/model-registry",hR);return n.ok?await ur(n):null}catch(n){if(!mR(n)||t>=1)return null;e==null||e()}}function uae(e){return e==="available"?"Available":e==="limited"?"Limited":"Unavailable"}function dae(e){return e==="available"?"Ready":e==="limited"?"Limited":"Down"}function gR(e){return{local:"๐Ÿ’ป",groq:"๐ŸŸข",nim:"๐Ÿ”ถ",gemini:"๐Ÿ”ท",openrouter:"๐ŸŸฃ",openai:"๐Ÿค–",anthropic:"๐Ÿ”ฎ",mistral:"๐ŸŒ€",cohere:"๐Ÿง ",together:"๐ŸŸข",deepinfra:"๐ŸŒ",fireworks:"๐ŸŽ†",perplexity:"โ“",azure:"๐Ÿ”ต",anyscale:"๐Ÿ”ท",lmstudio:"๐ŸŽจ",vllm:"โšก"}[e]||"๐Ÿ”Œ"}function j0(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 wE({status:e,label:t}){const n=Th[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 fae({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 hae({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 Td({provider:e}){const[t,n]=N.useState(!1),r=Th[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(wE,{status:e.overallStatus,label:uae(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:Th[a.status].dot,marginRight:8}}),a.name]}),s.jsx("td",{style:{padding:"8px 12px"},children:s.jsx(wE,{status:a.status,label:dae(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 yR(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 pae(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 mae({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 gae({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 ${gt(e)} tokens โ€” live from the provider's model list (v1.60.x); feeds the router's context preflight`,style:{marginLeft:8,fontSize:10,padding:"1px 6px",borderRadius:8,whiteSpace:"nowrap",background:"#0a1e2e",border:"1px solid #58a6ff",color:"#58a6ff"},children:["โณ ",t]})}function yae({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 vae({entry:e}){const t=pae(e.status),n=e.remainingTokens>=0?`${gt(e.remainingTokens)} 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(mae,{rate:e.partialRate??0}),e.partialHistory&&e.partialHistory.length>=2&&s.jsx(yae,{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(gae,{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?yR(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 bae({provider:e}){const[t,n]=N.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:gR(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:j0(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(vae,{entry:i},i.model))})]})})]})}function xae(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 wae({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"})]})]})]}),xae(e.keyHygiene),e.providers.map(t=>s.jsx(bae,{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 Sae={chat:"๐Ÿ’ฌ",execute:"โš™๏ธ",plan:"๐Ÿ—บ๏ธ",edit:"โœ๏ธ",skill:"๐Ÿงฉ",learn:"๐Ÿ“š",ci:"๐Ÿ”",doctor:"๐Ÿฉบ",probe:"๐Ÿ”ญ","spot-check":"๐Ÿงช",telemetry:"๐Ÿ“ก",usage:"๐Ÿงฎ"};function kae(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 Nae(e){return Sae[e]||"๐ŸŽฏ"}function Eae(e){return e?new Date(e).toLocaleDateString()+" "+new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"โ€”"}function Za({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 _ae(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 jae(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 Aae({timeline:e}){const[t,n]=N.useState(()=>jae(e||[])),[r,i]=N.useState(!1),a=N.useRef(null),o=N.useRef(!1),l=(e==null?void 0:e.length)??0,c=Math.max(0,Math.min(t,l-1));N.useEffect(()=>{n(m=>Math.min(m,Math.max(0,l-1)))},[l]);const u=N.useCallback(m=>{const v=a.current;if(!v||l<=0)return;const y=v.getBoundingClientRect(),b=y.width||1,w=Math.min(1,Math.max(0,(m-y.left)/b));n(Math.min(l-1,Math.floor(w*l)))},[l]),d=m=>{o.current=!0,i(!1),u(m.clientX)};if(N.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]),N.useEffect(()=>{if(!r||l<=1)return;const m=setInterval(()=>{n(v=>Math.min(l-1,v+1))},300);return()=>clearInterval(m)},[r,l]),N.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?_ae(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,w=m.killed/f*56,k=m.transient/f*56,S=(m.partial||0)/f*56,x=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:x?"visible":"hidden",background:y===0?"#21262d":"transparent",height:y===0?4:56,display:"flex",flexDirection:"column-reverse",boxShadow:x?"0 0 0 1.5px #58a6ff":void 0,opacity:y===0?.5:1,transition:"box-shadow 0.15s"},children:[x&&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:w,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:x?"#58a6ff":"#6e7681",marginTop:4,whiteSpace:"nowrap",fontWeight:x?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(Za,{provider:m.provider,model:m.model,reason:m.errorType,killed:!0},`${m.provider}|${m.model}|${m.outcome}`):m.outcome==="verified"?s.jsx(Za,{provider:m.provider,model:m.model},`${m.provider}|${m.model}|${m.outcome}`):m.outcome==="partial"?s.jsx(Za,{provider:m.provider,model:m.model,reason:m.errorType,partial:!0,streamedChunks:m.streamedChunks},`${m.provider}|${m.model}|${m.outcome}`):s.jsx(Za,{provider:m.provider,model:m.model,reason:m.errorType,transient:!0},`${m.provider}|${m.model}|${m.outcome}`))})]})]})}function Cae({entry:e}){var i,a;const[t,n]=N.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:Nae(e.action)}),s.jsxs("div",{style:{flex:1},children:[s.jsx("div",{style:{fontSize:14,fontWeight:600,color:"#e6edf3",marginBottom:2},children:kae(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(Za,{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(Za,{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(Za,{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(Aae,{timeline:e.timeline})]})]})}function Tae({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:Eae(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(Cae,{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 Od({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 Oae({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 Pae({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:"}),iae.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 Rae({model:e,provider:t}){const n=Th[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:[gR(t)," ",j0(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 ",yR(e.resetsInMs)]})]})})}function Mae({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)||j0(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(Rae,{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 Iae(){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-documentation/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 $ae(){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 Lae(){const[e,t]=N.useState(null),[n,r]=N.useState(null),[i,a]=N.useState(!0),[o,l]=N.useState(null),[c,u]=N.useState(4),[d,f]=N.useState(""),h=N.useRef(!0),p=N.useRef(null),g=N.useRef(!1);function m(){p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{h.current&&v()},sae)}async function v(){a(!0),l(null),g.current=!1;try{const[b,w]=await Promise.all([lae(()=>{g.current=!0}),cae(()=>{g.current=!0})]);if(!h.current)return;t(b),r(w),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)}}N.useEffect(()=>{h.current=!0,v();const b=setInterval(v,aae);return()=>{h.current=!1,clearInterval(b),p.current&&clearTimeout(p.current)}},[]);function y(b){const w=[],k=[],S=[],x=[],E={available:0,limited:1,unavailable:2};for(const _ of b.providers)rae.has(_.provider)?S.push(_):nae.has(_.provider)?k.push(_):_.overallStatus==="available"?w.push(_):x.push(_);return w.sort((_,C)=>E[_.overallStatus]-E[C.overallStatus]),k.sort((_,C)=>E[_.overallStatus]-E[C.overallStatus]),S.sort((_,C)=>E[_.overallStatus]-E[C.overallStatus]),x.sort((_,C)=>E[_.overallStatus]-E[C.overallStatus]),{available:w,local:k,speech:S,unavailable:x}}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(fae,{onRefresh:v,loading:i}),s.jsx($ae,{}),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(hae,{data:e}),(()=>{const{available:b,local:w,speech:k,unavailable:S}=y(e);return s.jsxs(s.Fragment,{children:[s.jsx(Od,{icon:"โœ…",title:"Available Cloud Providers",count:b.length}),b.map(x=>s.jsx(Td,{provider:x},x.provider)),s.jsx(Od,{icon:"๐Ÿ ",title:"Local Providers",count:w.length}),w.map(x=>s.jsx(Td,{provider:x},x.provider)),s.jsx(Od,{icon:"โ›”",title:"Unavailable Providers",count:S.length}),S.map(x=>s.jsx(Td,{provider:x},x.provider)),s.jsx(Od,{icon:"๐ŸŽ™๏ธ",title:"Speech / TTS Providers",count:k.length}),k.map(x=>s.jsx(Td,{provider:x},x.provider))]})})(),s.jsx(Oae,{value:d,onChange:f,totalCount:e.providers.reduce((b,w)=>b+w.models.length,0)}),s.jsx(Pae,{value:c,onChange:u}),s.jsx(Mae,{providers:e.providers,colsPerRow:c,searchQuery:d}),n&&s.jsx(wae,{data:n}),n&&s.jsx(Tae,{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(Iae,{}),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 Dae={local:"๐Ÿ’ป",groq:"๐ŸŸข",nim:"๐Ÿ”ถ",gemini:"๐Ÿ”ท",openrouter:"๐ŸŸฃ"},Bae={local:"Ollama (Local)",groq:"Groq",nim:"NVIDIA NIM",gemini:"Gemini",openrouter:"OpenRouter"},zae={trivial:"๐ŸŸข",simple:"๐Ÿ”ต",moderate:"๐ŸŸก",complex:"๐ŸŸ ",critical:"๐Ÿ”ด"},vR={trivial:"๐ŸŸข trivial",simple:"๐Ÿ”ต simple",moderate:"๐ŸŸก moderate",complex:"๐ŸŸ  complex",critical:"๐Ÿ”ด critical"},Fae={chat:"๐Ÿ’ฌ chat",orchestrator:"๐Ÿ”€ orchestrator",explain:"๐Ÿ” explain",benchmark:"๐Ÿ“ˆ benchmark",eval:"๐ŸŽฏ eval"},Pa=[{key:"request",icon:"๐ŸŽฏ",title:"Request"},{key:"candidates",icon:"โš–๏ธ",title:"Candidates"},{key:"exclusions",icon:"๐Ÿšซ",title:"Exclusions"},{key:"pick",icon:"โœ…",title:"Pick"}],Uae=2400;function bg(e){return Dae[e]||"๐Ÿ”Œ"}function SE(e){return Bae[e]||e}function A0(e){return e&&Fae[e]||e||"unknown"}function Wae(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 kE(e){const t=Math.ceil(e/6e4);return t>=60?`${Math.floor(t/60)}h ${t%60}m`:`${t}m`}const Hae=8;function NE(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 ${kE(r.resetsInMs)}`:"quota exhausted โ€” parked":r&&r.cooldownRemaining>0?`circuit-breaker cooldown โ€” ${kE(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 Gae(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,Hae)){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:NE(g,e)})),p=(o=d.find(g=>g.provider===c.provider))==null?void 0:o.reason;r.push({id:c.id,label:`${A0(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:NE(g,e)})),p=u[0];r.push({id:`profile-${c.complexity}`,label:`${vR[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 qae(e,t){switch(e){case"request":return`A ${t.complexity} task arrives${t.source?` from ${A0(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 Kae({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 Vae({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 Yae({routing:e}){const t=N.useMemo(()=>Gae(e),[e]),[n,r]=N.useState(""),[i,a]=N.useState(0),[o,l]=N.useState(!1);if(N.useEffect(()=>{t.length!==0&&(t.some(p=>p.id===n)||(r(t[0].id),a(0)))},[t,n]),N.useEffect(()=>{if(!o||t.length===0)return;const p=setInterval(()=>{a(g=>(g+1)%Pa.length)},Uae);return()=>clearInterval(p)},[o,t.length]),t.length===0)return null;const c=t.find(p=>p.id===n)??t[0],u=Pa[i],d=()=>{a(p=>(p+Pa.length-1)%Pa.length),l(!1)},f=()=>{a(p=>(p+1)%Pa.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(Vae,{icon:u.icon,title:`${i+1}. ${u.title}${i>0?` โ€” ${c.complexity}`:""}`,narration:qae(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:[zae[c.complexity]||"โ€ข"," ",vR[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:A0(c.source)}),c.timestamp&&s.jsx("span",{style:{fontSize:11,color:"#6e7681",marginLeft:"auto"},children:Wae(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:[bg(p.provider)," ",SE(p.provider).split(" ")[0],m&&" ๐Ÿ‘‘"]}),s.jsx(Kae,{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:[bg(p.provider)," ",SE(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:[bg(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:xg,children:"โ—€"}),s.jsx("button",{onClick:h,"aria-label":o?"Pause playback":"Play playback",style:{...xg,minWidth:84,color:o?"#d29922":"#3fb950"},children:o?"โธ Pause":"โ–ถ Play"}),s.jsx("button",{onClick:f,"aria-label":"Next step",style:xg,children:"โ–ถ"}),s.jsx("div",{style:{display:"flex",gap:6,marginLeft:8},children:Pa.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,"/",Pa.length]})]})]})}const xg={background:"#21262d",color:"#e6edf3",border:"1px solid #30363d",borderRadius:8,padding:"6px 12px",fontSize:13,cursor:"pointer",transition:"background 0.15s"},Xae={local:"๐Ÿ’ป",groq:"๐ŸŸข",nim:"๐Ÿ”ถ",gemini:"๐Ÿ”ท",openrouter:"๐ŸŸฃ"},Zae={local:"Ollama (Local)",groq:"Groq",nim:"NVIDIA NIM",gemini:"Gemini",openrouter:"OpenRouter"},bR={trivial:"๐ŸŸข",simple:"๐Ÿ”ต",moderate:"๐ŸŸก",complex:"๐ŸŸ ",critical:"๐Ÿ”ด"};function $r(e){return Xae[e]||"๐Ÿ”Œ"}function da(e){return Zae[e]||e}function Oh(e,t=1){return`${(e*100).toFixed(t)}%`}function Qae(e){return`$${e.toFixed(6)}`}function rr({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 C0({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 co(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 Jae(){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 ese={chat:"๐Ÿ’ฌ chat",orchestrator:"๐Ÿ”€ orchestrator",explain:"๐Ÿ” explain",benchmark:"๐Ÿ“ˆ benchmark",eval:"๐ŸŽฏ eval"},tse={trivial:"๐ŸŸข trivial",simple:"๐Ÿ”ต simple",moderate:"๐ŸŸก moderate",complex:"๐ŸŸ  complex",critical:"๐Ÿ”ด critical"};function xR(e){return ese[e]||e}function wR(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 EE(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 nse({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 rse({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(rr,{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(nse,{label:`${$r(i)} ${da(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:[xR(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 ise({history:e}){return e.length?s.jsx(rr,{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:wR(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:xR(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:[$r(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:tse[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 ase({routing:e}){return e.preference.length?s.jsx(rr,{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:[bR[t.complexity]||"โ€ข"," ",t.complexity]}),s.jsx("td",{style:{padding:"10px 12px",whiteSpace:"nowrap"},children:s.jsxs("span",{style:{color:"#3fb950",fontWeight:600},children:[$r(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:[$r(n.provider)," ",da(n.provider).split(" ")[0]]}),s.jsx(C0,{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:co("#1c2128","#6e7681"),children:["๐ŸŽฏ fit ",n.capabilityFit,"%"]}),n.costSource==="measured"&&n.costBasis?s.jsxs("span",{style:co("#12291a","#3fb950","#3fb950"),children:["๐Ÿ“ measured ",gt(n.costBasis.inputTokens),"โ†’",gt(n.costBasis.outputTokens)," tok"]}):s.jsx("span",{style:co("#1c2128","#8b949e"),children:"๐Ÿ“ estimated"}),n.contextUtilization!==void 0&&n.contextWindowTokens!==void 0&&s.jsxs("span",{style:co("#1c2128","#58a6ff","#58a6ff"),children:["โณ ctx ",n.contextUtilization,"% (",gt(n.contextWindowTokens)," tok)"]})]})]},n.provider))})]},t.complexity))})]})})}):null}function sse({routing:e}){return e.providers.length?s.jsx(rr,{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:[$r(t.provider)," ",da(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(C0,{value:t.avgQuality,color:"#58a6ff"}),s.jsx("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:"#8b949e",width:44,textAlign:"right"},children:Oh(t.avgQuality)})]})}),s.jsx("td",{style:{padding:"10px 12px",color:t.passRate>=.8?"#3fb950":"#d29922"},children:Oh(t.passRate)}),s.jsx("td",{style:{padding:"10px 12px",fontFamily:"'SFMono-Regular', Consolas, monospace",color:"#8b949e"},children:Qae(t.totalCostUsd)})]},t.provider))})]})})}):null}const _E=["trivial","simple","moderate","complex","critical"];function ose(e){return e>=.7?"#3fb950":e>=.45?"#d29922":"#f85149"}function lse({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(rr,{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"}),_E.map(r=>s.jsxs("th",{style:{padding:"8px 10px",textAlign:"center",fontWeight:500},children:[bR[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:[$r(r)," ",da(r).split(" ")[0]]}),_E.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:ose(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 cse(e,t=1){return`${e>0?"+":""}${(e*100).toFixed(t)}%`}function use({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 dse({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(rr,{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:cse(i.delta)}),s.jsx("span",{style:{fontSize:11,color:"#6e7681",flex:1},children:i.note}),s.jsx(use,{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 fse({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(rr,{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:gt(e.recordCount)}),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:$r(r.provider)}),s.jsx("span",{style:{fontSize:13,fontWeight:600,color:"#e6edf3"},children:da(r.provider)}),r.trusted?s.jsxs("span",{style:co("#3fb95026","#238636","#3fb950"),children:["trusted ยท ",r.samples," samples"]}):s.jsxs("span",{style:co("#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 ",Oh(r.winRate,0)]}),s.jsx(C0,{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 hse({routing:e}){return e.bestModels.length?s.jsx(rr,{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:[$r(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:[Oh(t.successRate,0)," success"]})," ยท ",t.runs," run",t.runs!==1?"s":""]})]},`${t.agentType}-${t.model}`))})}):null}function pse({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(rr,{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:gt(t)}),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:gt(e.repoChunks)}),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 โ€” ",gt(r.originalTokens)," โ†’ ",gt(r.reducedTokens)," 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 mse({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(rr,{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:gt(t)}),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:gt(i)}),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:gt(a)}),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:[$r(u.provider)," ",da(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:gt(u.tokensConsumed)}),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:EE(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:[$r(u.provider)," ",da(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 ",EE(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:[$r(u.provider)," ",da(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:wR(u.timestamp)})]},`${u.timestamp}-${d}`)})})]})]})}function tf({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 gse({governance:e}){var r,i,a,o,l;if(!e.enabled)return s.jsx(rr,{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(rr,{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(tf,{ok:!c.deny,children:[c.deny?"โ›”":"โœ…"," ",c.label,": ",c.items.join(", ")]},c.label)),n.map(c=>s.jsx(tf,{children:c},c)),t.length===0&&n.length===0&&s.jsx(tf,{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 yse({rbac:e}){const t=n=>n==="admin"?"#d29922":n==="operator"?"#3fb950":"#8b949e";return s.jsxs(rr,{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(tf,{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 vse({data:e}){var p,g,m,v,y,b,w,k,S,x;const t=e==null?void 0:e.routing,n=t&&(t.preference.length>0||t.providers.length>0||t.bestModels.length>0),r=!!((p=t==null?void 0:t.usage)!=null&&p.total),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=!!((w=t==null?void 0:t.ml)!=null&&w.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)||!!((x=t==null?void 0:t.retrieval)!=null&&x.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(Jae,{}):s.jsxs(s.Fragment,{children:[a&&t&&s.jsx(Yae,{routing:t}),f&&t.governance&&s.jsx(gse,{governance:t.governance}),(t==null?void 0:t.rbac)&&s.jsx(yse,{rbac:t.rbac}),r&&s.jsx(rse,{usage:t.usage}),i&&s.jsx(ise,{history:t.history}),o&&s.jsx(lse,{bandit:t.bandit}),l&&s.jsx(dse,{promotion:t.promotion}),c&&t.ml&&s.jsx(fse,{ml:t.ml}),u&&s.jsx(mse,{quota:t.quota}),d&&s.jsx(pse,{retrieval:t.retrieval}),s.jsx(ase,{routing:t}),s.jsx(sse,{routing:t}),s.jsx(hse,{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 jE={chat:"๐Ÿ’ฌ",execute:"โš™๏ธ",plan:"๐Ÿ—บ๏ธ",edit:"โœ๏ธ",skill:"๐Ÿงฉ",learn:"๐Ÿ“š",ci:"๐Ÿ”",doctor:"๐Ÿฉบ",probe:"๐Ÿ”ญ","spot-check":"๐Ÿงช",telemetry:"๐Ÿ“ก",usage:"๐Ÿงฎ","ide-chat":"๐Ÿ’ฌ","ide-inline":"โœ๏ธ","ide-execute":"โš™๏ธ"};function bse(e){return new Date(e).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Pd(e){return e!==void 0?`${e}ms`:"โ€”"}function SR(e){return e===0?"#3fb950":e<.2?"#d29922":"#f85149"}function xse({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:gt(n)}),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:SR(n>0?r/n:0)},children:n>0?`${(r/n*100).toFixed(1)}%`:"โ€”"}),s.jsxs("div",{className:"stat-label",children:["Overall error rate (",gt(r)," 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 wse({data:e}){const[t,n]=N.useState(""),[r,i]=N.useState("all"),a=e==null?void 0:e.requests,o=N.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(xse,{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:[jE[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:[jE[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:SR(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:Pd((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?Pd(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?Pd(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?Pd(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:bse(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 Sse={local:"๐Ÿ’ป",groq:"๐ŸŸข",nim:"๐Ÿ”ถ",gemini:"๐Ÿ”ท",openrouter:"๐ŸŸฃ"},kse={planner:"๐Ÿ—บ๏ธ",writer:"โœ๏ธ",reviewer:"๐Ÿ”Ž",tester:"๐Ÿงช",debugger:"๐Ÿ›",runner:"๐Ÿƒ","context-gatherer":"๐Ÿ“‚",memory:"๐Ÿง ","self-improver":"๐Ÿ“ˆ"};function Nse(e){return Sse[e]||"๐Ÿ”Œ"}function Ese(e){return kse[e]||"๐Ÿค–"}function kR(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 T0(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 gc(e){return e==null?"0":e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function _se(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 AE(e){const t=e.filter(n=>n.verdict==="CONFIRMED"&&O0(n).length>0).length;return`${e.length} finding${e.length===1?"":"s"}: ${t} confirmed, ${e.length-t} plausible`}function O0(e){return(e.evidence??[]).filter(t=>typeof(t==null?void 0:t.ref)=="string"&&t.ref.trim().length>0)}function jse({finding:e}){const t=O0(e),n=e.verdict==="CONFIRMED"&&t.length>0;return s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderLeft:`3px solid ${n?"#238636":"#d29922"}`,borderRadius:8,padding:"8px 12px",marginBottom:8},children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[s.jsx("span",{style:{fontSize:13},children:n?"โœ…":"๐Ÿ”Ž"}),s.jsx("span",{style:{flex:1,fontSize:12.5,fontWeight:600,color:"#e6edf3"},children:e.claim}),s.jsx("span",{style:{fontSize:9.5,fontWeight:700,letterSpacing:"0.04em",padding:"1px 7px",borderRadius:10,border:"1px solid",color:n?"#3fb950":"#d29922",background:n?"#0d2818":"#3d2c00",borderColor:n?"#238636":"#d29922"},children:n?"CONFIRMED":"PLAUSIBLE"})]}),e.outcome?s.jsx("div",{style:{marginTop:3,fontSize:11.5,color:"#8b949e"},children:e.outcome}):null,t.length>0?s.jsx("ul",{style:{listStyle:"none",margin:"5px 0 0",padding:0},children:t.map((r,i)=>s.jsxs("li",{style:{fontSize:11,color:"#8b949e",marginBottom:3},children:[s.jsx("span",{style:{fontSize:9.5,textTransform:"uppercase",letterSpacing:"0.04em",color:"#58a6ff",marginRight:5},children:r.kind}),s.jsx("span",{style:{color:"#c9d1d9",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:r.ref}),r.detail?s.jsxs("span",{style:{marginLeft:5},children:["(",r.detail,")"]}):null]},i))}):s.jsx("div",{style:{marginTop:5,fontSize:11,color:"#d29922"},children:"no evidence โ€” reported as PLAUSIBLE, not verified"}),e.source?s.jsxs("div",{style:{marginTop:4,fontSize:10,color:"#6e7681"},children:["source: ",e.source]}):null]})}function cb({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 Ase(){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 Cse({step:e}){const[t,n]=N.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:Ese(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:[Nse(e.provider)," ",e.provider,"/",e.model]}),s.jsx("span",{style:{width:70,fontSize:11,color:"#6e7681",textAlign:"right"},children:T0(e.latencyMs)}),s.jsxs("span",{style:{width:86,fontSize:11,color:"#6e7681",fontFamily:"'SFMono-Regular', Consolas, monospace",textAlign:"right"},children:[gc(e.inputTokens),"โ†’",gc(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 (",gc(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 Tse({trace:e}){const[t,n]=N.useState(e.steps??null),[r,i]=N.useState(!1);N.useEffect(()=>{if(e.steps){n(e.steps);return}let l=!1;return J.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(cb,{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:["๐Ÿ•“ ",kR(e.startedAt)]}),(()=>{const l=_se(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:["โฑ ",T0(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:["๐Ÿงฎ ",gc(e.totalTokens)," tok"]}),e.findings&&e.findings.length>0&&s.jsx("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"#0d1117",border:"1px solid #30363d",color:"#8b949e"},children:`๐Ÿ”Ž ${AE(e.findings)}`})]}),e.findings&&e.findings.length>0?s.jsxs("div",{style:{marginBottom:12},children:[s.jsx("div",{style:{fontSize:12,color:"#8b949e",marginBottom:6},children:`๐Ÿ”Ž Findings โ€” ${AE(e.findings)}`}),e.findings.map((l,c)=>s.jsx(jse,{finding:l},`finding-${c}`))]}):null,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(Cse,{step:l},l.seq))]})}function Ose({traces:e}){const[t,n]=N.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(Tse,{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:kR(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:["โฑ ",T0(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:["๐Ÿงฎ ",gc(r.totalTokens)," tok"]}),r.findings&&r.findings.length>0&&s.jsx("span",{style:{color:"#d29922"},children:`๐Ÿ”Ž ${r.findings.filter(o=>o.verdict==="CONFIRMED"&&O0(o).length>0).length}/${r.findings.length} confirmed`}),a&&s.jsxs("span",{children:["๐Ÿค– ",a.slice(0,60)]})]})]},r.id)})})}function Pse(){const[e,t]=N.useState(null),[n,r]=N.useState(!1),i=N.useCallback(()=>{J.fetchTraces().then(a=>{a?(t(a),r(!1)):r(!0)})},[]);return N.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(cb,{icon:"โณ",title:"Loadingโ€ฆ",children:s.jsx("div",{style:{color:"#8b949e",fontSize:13},children:"Fetching reasoning tracesโ€ฆ"})}),n&&e===null&&s.jsx(cb,{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(Ase,{}),e!==null&&e.length>0&&s.jsx(Ose,{traces:e})]})}function wg(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)&&t>=0?t:null}function Rse({authed:e,role:t}){const[n,r]=N.useState(null),[i,a]=N.useState({}),[o,l]=N.useState(""),[c,u]=N.useState(!1),[d,f]=N.useState(null),[h,p]=N.useState(null),g=e&&(t==="admin"||t==="operator"),m=e&&t==="admin",v=N.useCallback(async()=>{var E,_,C;const S=await J.fetchAdminQuota();if(!S){p("Could not load budget config.");return}p(null),r(S);const x={};for(const T of S.providers){const L=S.quota[T]||{};x[T]={provider:T,tokens:((E=L.tokensPerWindow)==null?void 0:E.toString())??"",requests:((_=L.requestsPerWindow)==null?void 0:_.toString())??"",windowMs:((C=L.windowMs)==null?void 0:C.toString())??""}}a(x),l(S.costUsd===null?"":String(S.costUsd))},[]);N.useEffect(()=>{v()},[v]);const y=(S,x,E)=>{a(_=>({..._,[S]:{..._[S]||{provider:S},[x]:E}}))},b=async()=>{u(!0),f(null);const S={};for(const _ of Object.values(i)){const C={},T=wg(_.tokens),L=wg(_.requests),M=wg(_.windowMs);T!==null&&(C.tokensPerWindow=T),L!==null&&(C.requestsPerWindow=L),M!==null&&(C.windowMs=M),S[_.provider]=Object.keys(C).length>0?C:null}const x={quota:S};if(m)if(o.trim()!==""){const _=Number(o);if(!Number.isFinite(_)||_<0){f({ok:!1,text:"Cost cap must be a non-negative number."}),u(!1);return}x.costUsd=_}else x.costUsd=null;const E=await J.saveAdminQuota(x);u(!1),E.ok?(f({ok:!0,text:"Budget saved โ€” the quota ledger + auto-router will enforce it."}),v()):f({ok:!1,text:E.error||"Save failed."})},w=S=>{const x=n==null?void 0:n.quota[S];return!!x&&(x.tokensPerWindow!==void 0||x.requestsPerWindow!==void 0||x.windowMs!==void 0)},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 x,E,_;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:((x=i[S])==null?void 0:x.tokens)??"",onChange:C=>y(S,"tokens",C.target.value)}),s.jsx("input",{className:k(!g),type:"number",min:0,placeholder:"unset",disabled:!g,value:((E=i[S])==null?void 0:E.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:((_=i[S])==null?void 0:_.windowMs)??"",onChange:C=>y(S,"windowMs",C.target.value)}),s.jsx("span",{className:`admin-role-badge ${w(S)?"admin-role-admin":"admin-role-viewer"}`,children:w(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 Mse={pass:"โœ…",warn:"โš ๏ธ",fail:"โŒ"},Ise={pass:"PASS",warn:"WARN",fail:"FAIL"},$se={env:"Environment",config:"Config",vault:"Vault",local:"Local (no key)",none:"Not configured"};function CE({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:[Mse[e.status]," ",Ise[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 Lse(){const[e,t]=N.useState(null),[n,r]=N.useState(!0),[i,a]=N.useState(null),[o,l]=N.useState(null),[c,u]=N.useState(!1),[d,f]=N.useState(!1),[h,p]=N.useState(""),[g,m]=N.useState(""),[v,y]=N.useState(null),[b,w]=N.useState(null),[k,S]=N.useState(""),[x,E]=N.useState(""),[_,C]=N.useState(""),[T,L]=N.useState(null),[M,B]=N.useState(!1),[I,F]=N.useState([]),[z,R]=N.useState(null),[O,U]=N.useState(""),[A,Z]=N.useState(""),[$,P]=N.useState("viewer"),[oe,be]=N.useState([]),[pe,Ce]=N.useState({}),[G,Y]=N.useState(null),[ae,le]=N.useState({}),[X,je]=N.useState(""),[Ne,_e]=N.useState(null),[ge,$e]=N.useState(null),fe=N.useCallback(async()=>{r(!0),a(null);const q=await J.fetchAdminChecks();t(q),q||a("Could not reach the dashboard server, or the server is older than this panel. Run `buff dashboard` to start it."),r(!1)},[]),et=N.useCallback(async()=>{const q=await J.fetchAdminCatalog();q&&q.length>0&&be(q)},[]),De=N.useCallback(async()=>{const q=await J.fetchAdminUsers();q.ok&&q.users&&F(q.users)},[]);N.useEffect(()=>{let q=!0;return J.fetchAdminAuthStatus().then(me=>{if(q){if(!me){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:me.configured,authenticated:me.authenticated}),u(me.authenticated),y(me.role??null),w(me.user??null),f(me.mustChangePassword===!0),me.authenticated?(fe(),et(),De()):r(!1)}}),()=>{q=!1}},[fe,et,De]);const Ee=v==="admin",qe=()=>{u(!1),l(q=>q&&{...q,authenticated:!1}),L("Session expired โ€” log in again.")},It=async q=>{q.preventDefault(),B(!0),L(null);const me=await J.adminLogin(k,x);me.ok?(u(!0),l({configured:!0,authenticated:!0}),y(me.role??"admin"),w(me.user??null),S(""),E(""),J.fetchAdminAuthStatus().then(Me=>{Me&&f(Me.mustChangePassword===!0)}),fe(),et(),De()):L(me.error||"Login failed."),B(!1)},On=async q=>{if(q.preventDefault(),B(!0),L(null),x.length<8){L("Password must be at least 8 characters."),B(!1);return}if(x!==_){L("Passwords do not match."),B(!1);return}const me=await J.adminSetup(k,x);me.ok?(u(!0),l({configured:!0,authenticated:!0}),y(me.role??"admin"),w(me.user??null),S(""),E(""),C(""),fe(),et(),De()):L(me.error||"Setup failed."),B(!1)},Qt=async()=>{await J.adminLogout(),u(!1),l(q=>q&&{...q,authenticated:!1}),y(null),w(null),t(null),Ce({}),le({}),F([])},W=async()=>{if(!window.confirm("Stop the running gateway? Channels will stop responding until you restart it with `buff gateway start`."))return;$e("gateway"),_e(null);const q=await J.shutdown("gateway");$e(null),q.ok?_e(q.stopped?"โœ… Gateway stopped.":`โ„น๏ธ ${q.reason||"No running gateway found โ€” nothing to stop."}`):(_e(`โŒ ${q.error||"Stop failed."}`),q.unauthorized&&qe())},V=async()=>{window.confirm("Shut down the dashboard? This page will disconnect and the server will exit. Restart with `buff dashboard`.")&&($e("dashboard"),_e("๐Ÿ›‘ Shutting down the dashboard โ€” this page will disconnectโ€ฆ"),await J.shutdown("dashboard"),$e(null),_e("โ„น๏ธ The dashboard server did not stop (see the server terminal). You can also stop it with `buff dashboard stop`."))},ie=async q=>{if(q.preventDefault(),R(null),A.length<8){R("Password must be at least 8 characters.");return}const me=await J.addAdminUser(O,A,$);me.ok?(U(""),Z(""),R("โœ… User added"),De()):(R(`โŒ ${me.error||"Failed to add user"}`),me.unauthorized&&qe())},he=async q=>{if(!window.confirm(`Remove dashboard user '${q}'?`))return;R(null);const me=await J.removeAdminUser(q);me.ok?(R(`โœ… Removed ${q}`),De()):(R(`โŒ ${me.error||"Failed to remove user"}`),me.unauthorized&&qe())},we=(q,me,Me)=>{Ce(Te=>({...Te,[q]:{...Te[q]||{},[me]:Me}}))},He=async q=>{Y(q),le({});const me=pe[q]||{},Me=await J.saveProvider(q,me);Me.ok?(t(Te=>{if(!Te)return Te;const cn=Te.providers.some(zr=>zr.type===q)?Te.providers.map(zr=>zr.type===q&&Me.provider?Me.provider:zr):Me.provider?[...Te.providers,Me.provider]:Te.providers;return{...Te,providers:cn}}),Ce(Te=>{const Hn={...Te};return delete Hn[q],Hn}),le(Te=>({...Te,[q]:"โœ… Saved"}))):(le(Te=>({...Te,[q]:`โŒ ${Me.error||"Save failed"}`})),Me.unauthorized&&qe()),Y(null)},ln=async q=>{if(!window.confirm(`Remove ${q}'s API key and configuration? This cannot be undone.`))return;Y(q),le({});const me=await J.deleteProvider(q);me.ok?me.envSourced?(t(Me=>Me&&{...Me,providers:Me.providers.map(Te=>Te.type===q&&me.provider||Te)}),le(Me=>({...Me,[q]:`โš ๏ธ Key comes from ${me.envVar?`$${me.envVar}`:"an env var"} โ€” unset it there to remove it (config can't override the env).`}))):(t(Me=>Me&&{...Me,providers:Me.providers.filter(Te=>Te.type!==q)}),Ce(Me=>{const Te={...Me};return delete Te[q],Te})):(le(Me=>({...Me,[q]:`โŒ ${me.error||"Remove failed"}`})),me.unauthorized&&qe()),Y(null)},Tt=async q=>{Y(q);const me=await J.testProvider(q);le(Me=>{var Te;return{...Me,[q]:me.ok?`โœ… Connected โ€” ${((Te=me.models)==null?void 0:Te.length)??0} model(s) reachable`:`โŒ ${me.error||"Connection failed"}`}}),Y(null)},Un=()=>{X&&(Ce(q=>({...q,[X]:{}})),je(""))};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 q=!o.configured;return s.jsxs("div",{className:"admin-header",children:[s.jsxs("h2",{className:"section-title",children:["๐Ÿ› ๏ธ Admin โ€” ",q?"Set up access":"Log in"]}),s.jsx("p",{className:"admin-subtitle",children:q?"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:q?On:It,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{type:"text",value:k,onChange:me=>S(me.target.value),autoComplete:"username",placeholder:"admin"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Password"}),s.jsx("input",{type:"password",value:x,onChange:me=>E(me.target.value),autoComplete:q?"new-password":"current-password",placeholder:"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข"})]}),q?s.jsxs("label",{children:[s.jsx("span",{children:"Confirm password"}),s.jsx("input",{type:"password",value:_,onChange:me=>C(me.target.value),autoComplete:"new-password",placeholder:"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข"})]}):null,T?s.jsx("div",{className:"admin-error",children:T}):null,s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:M||!k||!x,children:M?"โณ โ€ฆ":q?"๐Ÿ” Create admin":"๐Ÿ” Log in"}),q?s.jsxs("p",{className:"admin-hint",children:["Automation alternative: set ",s.jsx("code",{children:"NUVIRA_DASHBOARD_ADMIN_USER"})," and"," ",s.jsx("code",{children:"NUVIRA_DASHBOARD_ADMIN_PASSWORD"})," in the dashboard's environment."]}):null]})]})}if(d){const q=h.length>0&&h.length<8,me=g.length>0&&g!==h,Me=async Te=>{if(Te.preventDefault(),q||me||!h)return;B(!0),L(null);const Hn=await J.changeAdminPassword(x,h);Hn.ok?(f(!1),E(""),p(""),m(""),fe(),et(),De()):L(Hn.error||"Could not change the password."),B(!1)};return s.jsxs("div",{className:"admin-header",children:[s.jsx("h2",{className:"section-title",children:"๐Ÿ” Set your own password"}),s.jsxs("p",{className:"admin-subtitle",children:["This dashboard is running on its ",s.jsx("strong",{children:"published default password"}),", so anyone who can reach this port can sign in. Until you replace it, the agent will refuse to save anything โ€” API keys, provider settings, users."]}),s.jsxs("form",{className:"admin-gate-form",onSubmit:Me,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Current password"}),s.jsx("input",{type:"password",value:x,onChange:Te=>E(Te.target.value),autoComplete:"current-password",placeholder:"admin"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"New password"}),s.jsx("input",{type:"password",value:h,onChange:Te=>p(Te.target.value),autoComplete:"new-password",placeholder:"at least 8 characters"})]}),q?s.jsx("div",{className:"admin-error",children:"Use at least 8 characters."}):null,s.jsxs("label",{children:[s.jsx("span",{children:"Confirm new password"}),s.jsx("input",{type:"password",value:g,onChange:Te=>m(Te.target.value),autoComplete:"new-password",placeholder:"repeat it"})]}),me?s.jsx("div",{className:"admin-error",children:"The two passwords do not match."}):null,T?s.jsx("div",{className:"admin-error",children:T}):null,s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:M||!x||!h||q||me,children:M?"โณ โ€ฆ":"๐Ÿ” Save new password"})]})]})}const wn=(e==null?void 0:e.system.filter(q=>q.status==="pass").length)??0,Re=(e==null?void 0:e.system.filter(q=>q.status==="warn").length)??0,Wn=(e==null?void 0:e.system.filter(q=>q.status==="fail").length)??0,$t=(e==null?void 0:e.enterprise.filter(q=>q.status==="pass").length)??0,oi=(e==null?void 0:e.enterprise.filter(q=>q.status==="warn").length)??0,Ea=(e==null?void 0:e.enterprise.filter(q=>q.status==="fail").length)??0,sr=(e==null?void 0:e.providers)??[],Jt=q=>{const me=oe.find(Me=>Me.id===q);return me||{label:q}};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"admin-header",children:[s.jsxs("h2",{className:"section-title",children:["๐Ÿ› ๏ธ Admin โ€” Command Runner & Configuration",b?s.jsxs("span",{className:`admin-role-badge admin-role-${v||"viewer"}`,children:[b," ยท ",v||"viewer"]}):null]}),s.jsxs("div",{className:"admin-header-actions",children:[s.jsx("button",{className:"admin-refresh-btn",onClick:()=>void fe(),disabled:n,children:n?"โณ Running checksโ€ฆ":"๐Ÿ”„ Refresh (run all commands)"}),Ee||v==="operator"?s.jsx("button",{className:"admin-logout-btn",onClick:()=>void W(),disabled:ge!==null,title:"Stop the running gateway (buff gateway stop)",children:ge==="gateway"?"โณ Stoppingโ€ฆ":"โป Stop gateway"}):null,Ee?s.jsx("button",{className:"admin-logout-btn",onClick:()=>void V(),disabled:ge!==null,title:"Shut down this dashboard server (buff dashboard stop)",children:ge==="dashboard"?"โณ Stoppingโ€ฆ":"๐Ÿ›‘ Stop dashboard"}):null,s.jsx("button",{className:"admin-logout-btn",onClick:()=>void Qt(),children:"๐Ÿšช Log out"})]})]}),Ne?s.jsx("div",{className:"admin-error",children:Ne}):null,Ee?null:s.jsxs("div",{className:"admin-readonly-note",children:["๐Ÿ”’ Your role (",s.jsx("code",{children:v||"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:wn+$t}),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:Re+oi}),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:Wn+Ea}),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:sr.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(q=>s.jsx(CE,{check:q},q.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(q=>s.jsx(CE,{check:q},q.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:[sr.map(q=>{const me=Jt(q.type),Me=pe[q.type]||{};return s.jsxs("tr",{children:[s.jsxs("td",{className:"admin-provider-type",children:[me.icon?`${me.icon} `:"",me.label,s.jsxs("div",{className:"admin-provider-sub",children:[q.type," ยท ",$se[q.keySource]||q.keySource]}),q.keySource==="env"?s.jsxs("div",{className:"admin-hint",children:["comes from ",me.envVar||"env var"," โ€” change it there, config can't override it"]}):q.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 ${q.configured?"admin-check-pass":"admin-check-warn"}`,children:q.configured?"โœ… Configured":"โš ๏ธ Not configured"})}),s.jsx("td",{children:me.keyless?s.jsx("div",{className:"admin-hint",children:"No key needed (probed)"}):Ee?s.jsx("input",{className:"admin-input admin-key-input",type:"password","aria-label":`${q.type} API key`,placeholder:q.keyMasked||"set a new keyโ€ฆ",value:Me.apiKey??"",onChange:Te=>we(q.type,"apiKey",Te.target.value),autoComplete:"new-password"}):s.jsx("div",{className:"admin-hint",children:q.keyMasked||"โ€”"})}),s.jsx("td",{children:Ee?s.jsx("input",{className:"admin-input",type:"text","aria-label":`${q.type} base URL`,placeholder:q.baseUrl||"default endpoint",value:Me.baseUrl??"",onChange:Te=>we(q.type,"baseUrl",Te.target.value)}):s.jsx("div",{className:"admin-hint",children:q.baseUrl?q.baseUrl.replace(/^https?:\/\/(?:[^@/]*@)?/,""):"default endpoint"})}),s.jsx("td",{children:Ee?s.jsx("input",{className:"admin-input",type:"text","aria-label":`${q.type} model`,placeholder:q.model||"default model",value:Me.model??"",onChange:Te=>we(q.type,"model",Te.target.value)}):s.jsx("div",{className:"admin-hint",children:q.model||"default model"})}),s.jsx("td",{children:Ee?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"admin-row-actions",children:[s.jsx("button",{className:"admin-mini-btn",disabled:G===q.type,onClick:()=>void He(q.type),children:"๐Ÿ’พ Save"}),s.jsx("button",{className:"admin-mini-btn",disabled:G===q.type,title:"Tests the SAVED configuration โ€” save first to test a new key",onClick:()=>void Tt(q.type),children:"๐Ÿ”Œ Test"}),s.jsx("button",{className:"admin-mini-btn admin-mini-danger",disabled:G===q.type,onClick:()=>void ln(q.type),children:"๐Ÿ—‘ Remove"})]}),ae[q.type]?s.jsx("div",{className:"admin-row-msg",children:ae[q.type]}):null]}):s.jsx("div",{className:"admin-hint",children:"read-only"})})]},q.type)}),sr.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"admin-empty-cell",children:"No providers configured yet."})}):null]})]})}),Ee&&oe.length>0?s.jsxs("div",{className:"admin-add-provider",children:[s.jsxs("select",{className:"admin-input",value:X,onChange:q=>je(q.target.value),children:[s.jsx("option",{value:"",children:"Add a providerโ€ฆ"}),oe.filter(q=>!sr.some(me=>me.type===q.id)).map(q=>s.jsxs("option",{value:q.id,children:[q.icon?`${q.icon} `:"",q.label," (",q.id,")"]},q.id))]}),s.jsx("button",{className:"admin-mini-btn",disabled:!X,onClick:Un,children:"โž• Add"})]}):null,s.jsx(Rse,{authed:c,role:v||"viewer"}),Ee?s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"section-subtitle",children:"๐Ÿ‘ฅ Dashboard Users (role.manage)"}),s.jsxs("div",{className:"admin-users-list",children:[I.map(q=>s.jsxs("div",{className:"admin-user-row",children:[s.jsx("span",{className:"admin-user-name",children:q.user}),s.jsx("span",{className:`admin-role-badge admin-role-${q.role}`,children:q.role}),s.jsxs("span",{className:"admin-user-since",children:["since ",new Date(q.createdAt).toLocaleDateString()]}),q.user!==b?s.jsx("button",{className:"admin-mini-btn admin-mini-danger",onClick:()=>void he(q.user),children:"๐Ÿ—‘ Remove user"}):s.jsx("span",{className:"admin-hint",children:"you"})]},q.user)),I.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:ie,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{type:"text",value:O,onChange:q=>U(q.target.value),autoComplete:"off"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Password (min 8 chars)"}),s.jsx("input",{type:"password",value:A,onChange:q=>Z(q.target.value),autoComplete:"new-password"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Role"}),s.jsxs("select",{value:$,onChange:q=>P(q.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"})]})]}),z?s.jsx("div",{className:"admin-row-msg",children:z}):null,s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:!O||!A,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 NR(e){return String(e??"").replace(/\d{3,}/g,t=>t.slice(0,2)+"***")}const Dse={idle:"Not paired",pairing:"โณ Pairingโ€ฆ",paired:"โœ… Paired",failed:"โŒ Pairing failed",cancelled:"โน Cancelled",error:"๐Ÿ’ฅ Pairing error"};function Bse({authed:e,canWrite:t,sessionExpired:n,reveal:r=!1}){const[i,a]=N.useState(null),[o,l]=N.useState({}),[c,u]=N.useState(""),[d,f]=N.useState(!1),[h,p]=N.useState(null),g=N.useRef(null),m=N.useCallback(async()=>{const x=await J.getWhatsAppStatus();x&&(a(x.status),l(x.contacts??{}))},[]);N.useEffect(()=>{if(m(),!e||typeof EventSource>"u")return;const x=J.subscribeWhatsApp({onQr:E=>a(_=>_&&{..._,qr:E,state:"pairing"}),onCode:E=>a(_=>_&&{..._,pairingCode:E}),onStatus:E=>{a(E),(E.state==="paired"||E.state==="failed"||E.state==="error"||E.state==="cancelled")&&f(!1)}});return g.current=x,()=>{x(),g.current=null}},[e,m]);const v=async x=>{f(!0),p(null);const E=await x();if(!E.ok&&E.error&&/Not authenticated|Session expired/i.test(E.error)){n(),f(!1);return}E.ok?(p({kind:"ok",text:"Done."}),await m()):p({kind:"err",text:E.error||"Action failed."}),f(!1)},y=x=>{p(null),v(()=>J.startWhatsAppPair(x?c.trim():void 0)).then(()=>u(""))},b=()=>{p(null),v(()=>J.cancelWhatsAppPair())},w=()=>{window.confirm("Remove the paired WhatsApp session from this machine? You will need to scan a QR to pair again.")&&(p(null),v(()=>J.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:Dse[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:w,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:x=>u(x.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(([x,E])=>s.jsxs("div",{className:"hub-alias-row",children:[s.jsx("span",{className:"hub-chip",children:x}),s.jsxs("span",{className:"admin-hint",children:["โ†’ ",r?E:NR(E)]})]},x))}),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 zse({canWrite:e,sessionExpired:t,mode:n="grid"}){const[r,i]=N.useState(null),[a,o]=N.useState(null),[l,c]=N.useState(null),[u,d]=N.useState(null),[f,h]=N.useState(null),[p,g]=N.useState(0),[m,v]=N.useState({}),[y,b]=N.useState(!1),[w,k]=N.useState(null),S=N.useRef(!0),x=N.useCallback(async()=>{const B=await J.getPlatformConfigs();S.current&&i(B)},[t]);N.useEffect(()=>(x(),()=>{S.current=!1}),[x]);const E=async(B,I)=>{c(B),d(null);const F=await J.setPlatformConfig(B,I);if(S.current){if(c(null),F.unauthorized||F.forbidden){t(F.error);return}d({kind:F.ok?"ok":"err",text:F.ok?"Saved โ€” transport active.":F.error||"Save failed."}),F.ok&&(o(null),x())}},_=async B=>{if(!window.confirm(`Remove ${B} transport config? Tokens will be deleted from ~/.buff/.env.`))return;c(B),d(null);const I=await J.removePlatformConfig(B);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&&x()}},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=B=>{e&&(h(B),g(0),v(Object.fromEntries(B.envVars.map(I=>[I.varName,I.value]))),k(null))},L=async()=>{if(!f||!e)return;b(!0),k(null);const B=await J.setPlatformConfig(f.platform,m);if(b(!1),B.unauthorized||B.forbidden){t(B.error);return}B.ok?(k({kind:"ok",text:"โœ… Token saved! The transport is now active."}),x()):k({kind:"err",text:B.error||"Save failed."})};if(r===null)return s.jsx("div",{className:"empty-state",children:"Loading platform transportsโ€ฆ"});const M=f?C[f.platform]:null;return n==="table"?s.jsxs(s.Fragment,{children:[f&&M?s.jsx("div",{className:"wizard-overlay",onClick:()=>h(null),children:s.jsxs("div",{className:"wizard-modal",onClick:B=>B.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:M.steps.map((B,I)=>s.jsx("li",{children:B},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(B=>s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:B.prompt}),s.jsx("input",{type:B.secret?"password":"text",value:m[B.varName]??"",onChange:I=>v(F=>({...F,[B.varName]:I.target.value})),placeholder:B.secret?"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข":"value",autoComplete:"off",spellCheck:!1,autoFocus:!0})]},B.varName)),w?s.jsx("div",{className:`admin-row-msg${w.kind==="ok"?"":" 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:()=>g(0),children:"โ† Back"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void L(),disabled:y||!e,children:y?"โณ Savingโ€ฆ":"๐Ÿ’พ Save token"})]}),(w==null?void 0:w.kind)==="ok"?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"wizard-section-title",children:"๐Ÿ“‹ Next steps:"}),s.jsx("ol",{className:"wizard-steps",children:M.postSetup.map((B,I)=>s.jsx("li",{children:B},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(B=>s.jsxs(H.Fragment,{children:[s.jsxs("tr",{className:`platform-config-row ${B.configured?"configured":""}`,children:[s.jsxs("td",{className:"platform-config-name",children:[s.jsx("span",{className:"hub-platform-label",children:B.label}),s.jsx("span",{className:"hub-card-id",children:B.platform})]}),s.jsxs("td",{children:[s.jsx("span",{className:`status-dot ${B.configured?"connected":"reconnecting"}`}),s.jsx("span",{className:"platform-config-status-text",children:B.configured?"Active":"Not configured"})]}),s.jsxs("td",{className:"platform-config-actions",children:[B.configured?null:s.jsx("button",{type:"button",className:"wizard-start-btn",onClick:()=>T(B),disabled:!e,children:"๐Ÿš€ Getting Started"}),B.setupUrl?s.jsx("a",{href:B.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===B.platform?null:B.platform),disabled:!e,children:a===B.platform?"โ–ด Close":B.configured?"โœŽ Edit":"โš™ Configure"}),B.configured?s.jsx("button",{type:"button",className:"admin-mini-btn contact-delete-btn",onClick:()=>void _(B.platform),disabled:!e,children:"๐Ÿ—‘๏ธ"}):null]}),s.jsx("td",{className:"platform-config-cli",children:s.jsxs("code",{children:["buff gateway setup ",B.platform]})})]}),a===B.platform?s.jsx("tr",{className:"platform-config-expanded",children:s.jsx("td",{colSpan:4,children:s.jsxs("div",{className:"platform-config-form",children:[B.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]},B.platform))})]})})]}):s.jsxs(s.Fragment,{children:[f&&M?s.jsx("div",{className:"wizard-overlay",onClick:()=>h(null),children:s.jsxs("div",{className:"wizard-modal",onClick:B=>B.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:M.steps.map((B,I)=>s.jsx("li",{children:B},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(B=>s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:B.prompt}),s.jsx("input",{type:B.secret?"password":"text",value:m[B.varName]??"",onChange:I=>v(F=>({...F,[B.varName]:I.target.value})),placeholder:B.secret?"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข":"value",autoComplete:"off",spellCheck:!1,autoFocus:!0})]},B.varName)),w?s.jsx("div",{className:`admin-row-msg${w.kind==="ok"?"":" 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:()=>g(0),children:"โ† Back"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void L(),disabled:y||!e,children:y?"โณ Savingโ€ฆ":"๐Ÿ’พ Save token"})]}),(w==null?void 0:w.kind)==="ok"?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"wizard-section-title",children:"๐Ÿ“‹ Next steps:"}),s.jsx("ol",{className:"wizard-steps",children:M.postSetup.map((B,I)=>s.jsx("li",{children:B},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(B=>s.jsx(Fse,{entry:B,canWrite:e,busy:l===B.platform,expanded:a===B.platform,onToggle:()=>o(a===B.platform?null:B.platform),onSave:I=>void E(B.platform,I),onRemove:()=>void _(B.platform),onStartWizard:()=>T(B)},B.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 Fse(e){const{entry:t,canWrite:n,busy:r,expanded:i,onToggle:a,onSave:o,onRemove:l,onStartWizard:c}=e,[u,d]=N.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 Use=[{id:"tools",label:"Tools",icon:"๐Ÿงฐ"},{id:"channels",label:"Channels",icon:"๐Ÿ“ก"},{id:"conversations",label:"Conversations",icon:"๐Ÿ’ฌ"},{id:"artifacts",label:"Artifacts",icon:"๐Ÿ“ฆ"},{id:"skills",label:"Skills",icon:"๐Ÿง "},{id:"subagents",label:"Subagents",icon:"๐Ÿค–"}],Wse={pending:"โณ pending",sent:"โœ… sent",failed:"โŒ failed"},Hse=5e3,Gse={spawning:"โณ spawning",running:"โ–ถ running",completed:"โœ… completed",failed:"โŒ failed",timeout:"โฐ timed out",killed:"โ›” killed"};function qse(){var Bt,Pn,Nt,Wr,Kn,Se,Fe,ct,At,en,rw,iw,aw,sw,ow;const[e,t]=N.useState("tools"),[n,r]=N.useState(null),[i,a]=N.useState(!0),[o,l]=N.useState(null),[c,u]=N.useState(!1),[d,f]=N.useState(null),[h,p]=N.useState(!1),[g,m]=N.useState(null),[v,y]=N.useState(null),[b,w]=N.useState(""),[k,S]=N.useState(""),[x,E]=N.useState(null),[_,C]=N.useState(!1),[T,L]=N.useState(null),[M,B]=N.useState(null),[I,F]=N.useState({}),[z,R]=N.useState(""),[O,U]=N.useState(""),[A,Z]=N.useState(!1),[$,P]=N.useState(null),[oe,be]=N.useState(!1),[pe,Ce]=N.useState({}),[G,Y]=N.useState(!1),[ae,le]=N.useState(null),[X,je]=N.useState({}),[Ne,_e]=N.useState({}),[ge,$e]=N.useState({}),[fe,et]=N.useState(!1),[De,Ee]=N.useState(null),[qe,It]=N.useState(""),[On,Qt]=N.useState(null),[W,V]=N.useState(!1),[ie,he]=N.useState(new Map),[we,He]=N.useState(new Set),[ln,Tt]=N.useState(!1),[Un,wn]=N.useState([]),[Re,Wn]=N.useState(""),[$t,oi]=N.useState(null),[Ea,sr]=N.useState(""),[Jt,q]=N.useState([]),[me,Me]=N.useState(0),[Te,Hn]=N.useState(0),[cn,zr]=N.useState(!0),[Sn,_s]=N.useState(!1),[vl,Uu]=N.useState(!1),Wu=20,_a=N.useRef(null),li=N.useCallback(async(j=!1)=>{if(Sn)return;const K=j?0:Te;_s(!0);try{const ne=await J.fetchGatewayConversations({offset:K,limit:Wu,q:qe||void 0});ne.ok&&ne.conversations&&(q(re=>j?ne.conversations:[...re,...ne.conversations]),Me(ne.total??0),Hn(K+ne.conversations.length),zr(ne.hasMore??!1))}catch{}_s(!1)},[Sn,Te,qe]);N.useEffect(()=>{e==="conversations"&&!vl&&!Sn&&(Uu(!0),li(!0))},[e,vl,Sn,li]),N.useEffect(()=>{const j=_a.current;if(!j)return;const K=new IntersectionObserver(ne=>{var re;(re=ne[0])!=null&&re.isIntersecting&&cn&&!Sn&&li(!1)},{threshold:.1});return K.observe(j),()=>K.disconnect()},[cn,Sn,li]),N.useEffect(()=>{const j=setTimeout(()=>{e==="conversations"&&vl&&(q([]),Hn(0),zr(!0),li(!0))},300);return()=>clearTimeout(j)},[qe]),N.useEffect(()=>J.onTypingEvent(K=>{he(ne=>{const re=new Map(ne),ue=`${K.platform}:${K.channelId}`;return K.typing?re.set(ue,{platform:K.platform,channelId:K.channelId,startedAt:Date.now()}):re.delete(ue),re})}),[]);const em=N.useCallback((j,K)=>{K.stopPropagation(),He(ne=>{const re=new Set(ne);return re.has(j)?re.delete(j):re.add(j),re})},[]),tm=N.useCallback(()=>{He(j=>j.size===Jt.length?new Set:new Set(Jt.map(K=>K.key)))},[Jt]),Hu=N.useCallback(async()=>{if(we.size!==0){Tt(!0);try{await J.exportGatewayConversations([...we])}catch{}Tt(!1)}},[we]);N.useEffect(()=>{e==="conversations"&&J.getAllConversationTags().then(j=>{j.ok&&j.tags&&wn(j.tags)})},[e]);const bl=N.useCallback(async(j,K)=>{if(!K.trim())return;(await J.addConversationTag(j,K.trim())).ok&&(q(re=>re.map(ue=>ue.key===j?{...ue,tags:[...ue.tags??[],K.trim().toLowerCase()]}:ue)),wn(re=>re.includes(K.trim().toLowerCase())?re:[...re,K.trim().toLowerCase()].sort())),oi(null),sr("")},[]),xl=N.useCallback(async(j,K)=>{(await J.removeConversationTag(j,K)).ok&&q(re=>re.map(ue=>ue.key===j?{...ue,tags:(ue.tags??[]).filter(Pe=>Pe!==K)}:ue))},[]),wl=N.useCallback((j,K)=>{K.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 ft of j.messages){const xe=ft.role==="user"?ne:"Agent",Et=new Date(ft.ts).toLocaleString();re.push(`[${Et}] ${xe}:`),re.push(ft.content),re.push("")}const ue=new Blob([re.join(`
135
+ `)],{type:"text/plain;charset=utf-8"}),Pe=URL.createObjectURL(ue),it=document.createElement("a");it.href=Pe,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(Pe)},[]),lt=N.useCallback((j,K)=>{K.stopPropagation();const ne=j.contactName||j.channelId,re=j.messages??[],ue=`<!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 ft=it.role==="user"?"user":"assistant",xe=it.role==="user"?ne:"Agent";return`<div class="msg msg-${ft}">
158
+ <div class="bubble bubble-${ft}">${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>`,Pe=window.open("","_blank");Pe&&(Pe.document.write(ue),Pe.document.close(),setTimeout(()=>Pe.print(),300))},[]);N.useEffect(()=>{var K;const j=(K=n==null?void 0:n.conversations)==null?void 0:K.recent;!j||j.length===0||vl&&(Te>Wu||qe||q(ne=>{const re=new Set(ne.map(xe=>xe.key)),ue=j.map(xe=>({...xe})),Pe=new Map(ne.map(xe=>[xe.key,xe]));for(const xe of ue)Pe.has(xe.key)&&Pe.set(xe.key,xe);const ft=[...ue.filter(xe=>!re.has(xe.key)),...Pe.values()];return ft.sort((xe,Et)=>Et.lastActiveAt-xe.lastActiveAt),ft}))},[(Bt=n==null?void 0:n.conversations)==null?void 0:Bt.recent]);const[ja,js]=N.useState(""),[Lt,Aa]=N.useState([]),[Ca,Gu]=N.useState(!1),[Sl,As]=N.useState(!1),[ci,Gn]=N.useState(null),[Cs,Ts]=N.useState(null),[qu,Ku]=N.useState({}),[ui,kl]=N.useState([]),[Fr,qn]=N.useState([]),[di,Os]=N.useState(""),kr=j=>fe?String(j??""):NR(j),nm=j=>{const K=j.match(/^(\d+)@/);if(!K)return"";const ne=K[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}`},Dt=j=>{const K=nm(j.channelId);return j.contactName?{name:j.contactName,phone:K}:{name:K||kr(j.channelId),phone:""}},Ps=N.useCallback(j=>{var K,ne;r(j),(K=j==null?void 0:j.channels)!=null&&K.statusRecipients&&qn(j.channels.statusRecipients),(ne=j==null?void 0:j.channels)!=null&&ne.contacts&&kl(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)},[]),Ur=N.useCallback(async()=>{u(!0),l(null),Ps(await J.fetchHub()),u(!1)},[Ps]);N.useEffect(()=>{Ur(),J.fetchAdminAuthStatus().then(j=>{j&&(f({configured:j.configured,authenticated:j.authenticated}),p(j.authenticated),m(j.role??null),y(j.user??null))})},[Ur]);const Nl=((Pn=n==null?void 0:n.subagents)==null?void 0:Pn.running)??0;N.useEffect(()=>{if(Nl===0)return;const j=setInterval(()=>{J.fetchHub().then(K=>{K&&Ps(K)})},Hse);return()=>clearInterval(j)},[Nl,Ps]);const qt=h&&(g==="admin"||g==="operator"),Vu=async j=>{j==null||j.preventDefault();const K=ja.trim();if(!K)return;As(!0),Gn(null);const ne=await J.marketplaceSearch(K);Aa(ne),Gu(!0),As(!1)},rm=async j=>{if(!h){Gn({kind:"err",text:"๐Ÿ” Log in (or set up admin access) to install skills."});return}if(!qt){Gn({kind:"err",text:"Your role cannot install skills โ€” admin or operator only."});return}Ts(j),Gn(null);const K=await J.marketplaceInstall(j);K.ok?(Gn({kind:"ok",text:`โœ… Installed ${j} (quarantine checked) โ€” it appears in the Skills list and loads via the skill tool next turn.`}),Ur()):Gn({kind:"err",text:K.quarantined?`โ›” ${K.error||"checksum mismatch โ€” quarantined"}`:`โŒ ${K.error||"Install failed."}`}),Ts(null)},im=async j=>{if(!h){Gn({kind:"err",text:"๐Ÿ” Log in (or set up admin access) to uninstall skills."});return}if(!qt){Gn({kind:"err",text:"Your role cannot uninstall skills โ€” admin or operator only."});return}Ts(j),Gn(null);const K=await J.marketplaceUninstall(j);K.ok?(Gn({kind:"ok",text:`๐Ÿ—‘๏ธ Uninstalled ${j} โ€” removed from .agents/skills/ and provenance.`}),Ur()):Gn({kind:"err",text:`โŒ ${K.error||"Uninstall failed."}`}),Ts(null)},Ta=()=>{p(!1),f(j=>j&&{...j,authenticated:!1}),E("Session expired โ€” log in again to toggle capabilities.")},Yu=async j=>{j.preventDefault(),C(!0),E(null);const K=await J.adminLogin(b,k);if(K.ok){p(!0),f({configured:!0,authenticated:!0}),m(K.role??"admin"),y(K.user??null),w(""),S("");const ne=T;L(null),ne&&await Rs(ne.kind,ne.name,ne.enabled)}else E(K.error||"Login failed.");C(!1)},am=async j=>{if(j.preventDefault(),C(!0),E(null),k.length<8){E("Password must be at least 8 characters."),C(!1);return}const K=await J.adminSetup(b,k);if(K.ok){p(!0),f({configured:!0,authenticated:!0}),m(K.role??"admin"),y(K.user??null),w(""),S("");const ne=T;L(null),ne&&await Rs(ne.kind,ne.name,ne.enabled)}else E(K.error||"Setup failed.");C(!1)},Li=async()=>{await J.adminLogout(),p(!1),f(j=>j&&{...j,authenticated:!1}),m(null),y(null)},Rs=async(j,K,ne)=>{B(K);const re=j==="skill"?await J.setSkillEnabled(K,ne):await J.setToolsetEnabled(K,ne);re.ok?(F(ue=>({...ue,[K]:`โœ… ${ne?"Enabled":"Disabled"} โ€” live for new agent runs`})),Ur()):re.unauthorized?Ta():(F(ue=>({...ue,[K]:`โŒ ${re.error||"Toggle failed"}`})),re.forbidden&&E(re.error||"Your role cannot change capabilities.")),B(null)},sm=(j,K)=>{if(!h){L({kind:"toolset",name:j,enabled:K});return}Rs("toolset",j,K)},Xu=(j,K)=>{if(!h){L({kind:"skill",name:j,enabled:K});return}Rs("skill",j,K)},om=async j=>{if(j.preventDefault(),!h){P({kind:"err",text:"๐Ÿ” Log in (or set up admin access) to send test messages."});return}if(!qt){P({kind:"err",text:"๐Ÿ”’ Your role cannot send channel messages โ€” requires the admin or operator role."});return}Z(!0),P(null);const K=await J.sendChannelMessage(z.trim(),O);K.ok?(P({kind:"ok",text:`โœ… Sent to ${z.trim()} (${K.platform}:${kr(K.channelId??"")})`}),U("")):K.unauthorized?(Ta(),P({kind:"err",text:K.error||"Session expired โ€” log in again."})):P({kind:"err",text:K.error||"Send failed."}),Z(!1)},El=(j,K)=>{var re,ue;return(((ue=(re=n==null?void 0:n.channels)==null?void 0:re.policies)==null?void 0:ue[j])??{})[K]??[]},_l=j=>j==="user"?"allowedUsers":j==="group"?"allowedGroups":"outboundSenders",Ms=(j,K,ne)=>{const re=ne.trim();re&&Ce(ue=>{var Et;const Pe={...ue[j]??{}},it=_l(K),xe=[...((Et=ue[j])==null?void 0:Et[it])??El(j,it)];return xe.includes(re)||xe.push(re),Pe[it]=xe,{...ue,[j]:Pe}})},Is=(j,K,ne)=>{Ce(re=>{var Et;const ue=_l(K),Pe=El(j,ue),ft=(((Et=re[j])==null?void 0:Et[ue])??Pe).filter(Al=>Al!==ne);if(ft.length===0&&Pe.length===0){const Al={...re[j]??{}};delete Al[ue];const lm={...re};return Object.keys(Al).length===0?delete lm[j]:lm[j]=Al,lm}const xe={...re[j]??{}};return xe[ue]=ft,{...re,[j]:xe}})},jl=(j,K)=>{const ne=j.trim().toLowerCase(),re=K.trim().toLowerCase();if(ne==="*"||re==="*"||ne===re)return!0;const ue=ne.replace(/\D+/g,""),Pe=re.replace(/\D+/g,"");return ue.length>0&&ue===Pe},Zu=j=>{const K=(qu[j]??"").trim(),ne=(X[j]??"").trim();ne&&(Ms(j,"user",ne),K&&kl(re=>[...re.filter(Pe=>!(Pe.platform===j&&(jl(Pe.id,ne)||Pe.name.toLowerCase()===K.toLowerCase()))),{name:K,platform:j,id:ne,addedAt:Date.now()}]),je(re=>({...re,[j]:""})),Ku(re=>({...re,[j]:""})))},D=(j,K)=>{Is(j,"user",K),kl(ne=>ne.filter(re=>!(re.platform===j&&jl(re.id,K))))},te=(j,K)=>{Ce(ne=>{const re={...ne[j]??{}};return K==="silentDrop"?re.silentDrop=re.silentDrop===!1:re[K]?delete re[K]:re[K]=!0,{...ne,[j]:re}})},ee=Object.keys(pe).length>0||ui.length!==(((Wr=(Nt=n==null?void 0:n.channels)==null?void 0:Nt.contacts)==null?void 0:Wr.length)??0)||ui.some((j,K)=>{var ne,re;return!((re=(ne=n==null?void 0:n.channels)==null?void 0:ne.contacts)!=null&&re[K])||j.platform!==n.channels.contacts[K].platform||j.id!==n.channels.contacts[K].id||j.name!==n.channels.contacts[K].name})||Fr.length!==(((Se=(Kn=n==null?void 0:n.channels)==null?void 0:Kn.statusRecipients)==null?void 0:Se.length)??0)||Fr.some((j,K)=>{var ne,re;return j!==((re=(ne=n==null?void 0:n.channels)==null?void 0:ne.statusRecipients)==null?void 0:re[K])}),ke=async()=>{var K;if(!h){le({kind:"err",text:"๐Ÿ” Log in (or set up admin access) to change permissions."});return}if(!qt){le({kind:"err",text:"๐Ÿ”’ Your role cannot change permissions โ€” requires the admin or operator role."});return}Y(!0),le(null);const j=await J.saveGatewayPolicies(pe,Fr,ui);if(j.ok){const ne=(K=j.contactErrors)!=null&&K.length?`
164
+ โš ๏ธ Some contacts were rejected: ${j.contactErrors.join("; ")}`:"";le({kind:ne?"warn":"ok",text:`โœ… Permissions + saved contacts + status recipients saved โ€” the running gateway applies them immediately.${ne}`}),Ce({}),Ur()}else j.unauthorized?(Ta(),le({kind:"err",text:j.error||"Session expired โ€” log in again."})):le({kind:"err",text:j.error||"Failed to save permissions."});Y(!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 Nr=!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 Ur(),disabled:c,children:c?"โณ Refreshingโ€ฆ":"๐Ÿ”„ Refresh"}),h?s.jsx("button",{className:"admin-logout-btn",onClick:()=>void Li(),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,Nr?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?Yu:am,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{type:"text",value:b,onChange:j=>w(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:"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข"})]}),x?s.jsx("div",{className:"admin-error",children:x}):null,s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:_||!b||!k,children:_?"โณ โ€ฆ":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,!Nr&&!qt&&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:Use.map(j=>{var ne,re,ue;const K=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):"":j.id==="subagents"?n?`${((re=n.subagents)==null?void 0:re.running)??0}/${((ue=n.subagents)==null?void 0:ue.total)??0}`:"":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,K?s.jsx("span",{className:"hub-tab-count",children:K}):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:M===j.name||T!==null||h&&!qt,onClick:()=>sm(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(K=>s.jsx("span",{className:"hub-chip",children:K},K)):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:fe,onChange:j=>et(j.target.checked),disabled:!qt}),"Show full sender ids ",s.jsx("span",{className:"admin-hint",children:"(masks phone numbers by default)"})]}),qt?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:kr(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:kr(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,j.handled==="attachment_failed"?160: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 ยท"," ",n.channels.inbox.attachmentFailed??0," attachment(s) could not be read."]}),s.jsx("h3",{className:"section-subtitle",children:"๐Ÿ”Œ Platform transports"}),s.jsx(zse,{canWrite:qt,sessionExpired:Ta,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,":",kr(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>"}),"."]}),ee?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:G,onClick:()=>void ke(),children:G?"โณ Savingโ€ฆ":"๐Ÿ’พ Save permissions"})]}):null,s.jsx("div",{style:{cursor:"pointer",userSelect:"none",display:"flex",alignItems:"center",gap:8,marginBottom:8},onClick:()=>be(!oe),children:s.jsxs("h3",{className:"section-subtitle",style:{margin:0},children:[oe?"โ–ผ":"โ–ถ"," ๐Ÿ” Permissions โ€” who can TRIGGER the agent"]})}),s.jsxs("p",{className:"admin-hint",style:{marginBottom:oe?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 ",oe?"collapse":"expand"," and manage permissions."]}),oe?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 K={...n.channels.policies[j.platform]??{},...pe[j.platform]??{}},ne=K.allowedUsers??[],re=K.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}),K.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(ue=>{var it,ft,xe,Et;const Pe=(((it=pe[j.platform])==null?void 0:it.allowedUsers)??[]).includes(ue)&&!(((Et=(xe=(ft=n==null?void 0:n.channels)==null?void 0:ft.policies)==null?void 0:xe[j.platform])==null?void 0:Et.allowedUsers)??[]).includes(ue);return s.jsxs("div",{className:"hub-alias-row",children:[s.jsxs("span",{className:`hub-chip${Pe?" hub-chip-pending":""}`,title:Pe?"Not saved yet โ€” press ๐Ÿ’พ Save permissions":void 0,children:[kr(ue),Pe?" ยท unsaved":""]}),s.jsx("button",{className:"admin-refresh-btn",disabled:G,onClick:()=>D(j.platform,ue),children:"โœ•"})]},`u-${ue}`)})]}),s.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 10px"},children:[s.jsx("input",{type:"text",value:qu[j.platform]??"",onChange:ue=>Ku(Pe=>({...Pe,[j.platform]:ue.target.value})),placeholder:"Name (optional)",disabled:G}),s.jsx("input",{type:"text",value:X[j.platform]??"",onChange:ue=>je(Pe=>({...Pe,[j.platform]:ue.target.value})),placeholder:"Contact no / sender id, or Allow-All",disabled:G}),s.jsx("button",{className:"admin-refresh-btn",disabled:G||!(X[j.platform]??"").trim(),onClick:()=>Zu(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(ue=>{var it,ft,xe,Et;const Pe=(((it=pe[j.platform])==null?void 0:it.allowedGroups)??[]).includes(ue)&&!(((Et=(xe=(ft=n==null?void 0:n.channels)==null?void 0:ft.policies)==null?void 0:xe[j.platform])==null?void 0:Et.allowedGroups)??[]).includes(ue);return s.jsxs("div",{className:"hub-alias-row",children:[s.jsxs("span",{className:`hub-chip${Pe?" hub-chip-pending":""}`,title:Pe?"Not saved yet โ€” press ๐Ÿ’พ Save permissions":void 0,children:[ue,Pe?" ยท unsaved":""]}),s.jsx("button",{className:"admin-refresh-btn",disabled:G,onClick:()=>Is(j.platform,"group",ue),children:"โœ•"})]},`g-${ue}`)})]}),s.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 10px"},children:[s.jsx("input",{type:"text",value:Ne[j.platform]??"",onChange:ue=>_e(Pe=>({...Pe,[j.platform]:ue.target.value})),placeholder:"group id, e.g. 1203630283471234@g.us",disabled:G}),s.jsx("button",{className:"admin-refresh-btn",disabled:G||!(Ne[j.platform]??"").trim(),onClick:()=>{Ms(j.platform,"group",Ne[j.platform]??""),_e(ue=>({...ue,[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:(K.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:(K.outboundSenders??[]).map(ue=>{var it,ft,xe,Et;const Pe=(((it=pe[j.platform])==null?void 0:it.outboundSenders)??[]).includes(ue)&&!(((Et=(xe=(ft=n==null?void 0:n.channels)==null?void 0:ft.policies)==null?void 0:xe[j.platform])==null?void 0:Et.outboundSenders)??[]).includes(ue);return s.jsxs("div",{className:"hub-alias-row",children:[s.jsxs("span",{className:`hub-chip${Pe?" hub-chip-pending":""}`,title:Pe?"Not saved yet โ€” press ๐Ÿ’พ Save permissions":void 0,children:[kr(ue),Pe?" ยท unsaved":""]}),s.jsx("button",{className:"admin-refresh-btn",disabled:G,onClick:()=>Is(j.platform,"send",ue),children:"โœ•"})]},`s-${ue}`)})}),s.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 10px"},children:[s.jsx("input",{type:"text",value:ge[j.platform]??"",onChange:ue=>$e(Pe=>({...Pe,[j.platform]:ue.target.value})),placeholder:"sender id, or Allow-All",disabled:G}),s.jsx("button",{className:"admin-refresh-btn",disabled:G||!(ge[j.platform]??"").trim(),onClick:()=>{Ms(j.platform,"send",ge[j.platform]??""),$e(ue=>({...ue,[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:K.silentDrop!==!1,disabled:G,onChange:()=>te(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:!!K.requireMention,disabled:G,onChange:()=>te(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:!!K.disabled,disabled:G,onChange:()=>te(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:!!K.requireApprovedTarget,disabled:G,onChange:()=>te(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=ui.filter(re=>re.status==="pending").length,K=ui.filter(re=>re.status==="approved").length,ne=ui.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:["โœ… ",K," 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"}),"."]}),Fr.length>0?s.jsx("div",{className:"hub-alias-list",children:Fr.map(j=>{var K,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=(K=n==null?void 0:n.channels)==null?void 0:K.statusRecipientDisplay)==null?void 0:ne[j])??j}),s.jsx("button",{className:"admin-refresh-btn",disabled:G,onClick:()=>qn(re=>re.filter(ue=>ue!==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:di,onChange:j=>Os(j.target.value),placeholder:"whatsapp:Name or whatsapp:+91***",disabled:G,maxLength:128}),s.jsx("button",{className:"admin-refresh-btn",disabled:G||!di.trim()||Fr.includes(di.trim()),onClick:()=>{qn(j=>[...j,di.trim()]),Os("")},children:"+ Add"})]}),s.jsxs("div",{className:"hub-send-form",style:{marginTop:10},children:[s.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:G,onClick:()=>void ke(),children:G?"โณ Savingโ€ฆ":"๐Ÿ’พ Save permissions"}),Object.keys(pe).length>0?s.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:G,onClick:()=>Ce({}),children:"Discard draft"}):null]}),ae?s.jsx("div",{className:`admin-row-msg${ae.kind==="err"?" admin-row-msg-err":""}`,children:ae.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 om(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:z,onChange:j=>R(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=>U(j.target.value),placeholder:"nightly build done ๐ŸŽ‰",disabled:A,maxLength:4e3})]}),s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:A||!z.trim()||!O,children:A?"โณ Sendingโ€ฆ":"๐Ÿ“ค Send test message"})]}),$?s.jsx("div",{className:`admin-row-msg${$.kind==="ok"?"":" admin-row-msg-err"}`,children:$.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(Bse,{authed:h,canWrite:qt,sessionExpired:Ta,reveal:fe})]}):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:((Fe=n.conversations)==null?void 0:Fe.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"})]})]}),((ct=n.conversations)==null?void 0:ct.analytics)&&n.conversations.analytics.totalConversations>0&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>V(!W),style:{marginBottom:12},children:W?"๐Ÿ“Š Hide Analytics":"๐Ÿ“Š Show Analytics"}),W?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,K)=>{var ue;const ne=((ue=n.conversations.analytics.topContacts[0])==null?void 0:ue.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:K<3?"#f59e0b":"var(--muted)"},children:K===0?"๐Ÿฅ‡":K===1?"๐Ÿฅˆ":K===2?"๐Ÿฅ‰":`${K+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}})})]},K)})})]}),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:K})=>{const ne=Math.max(...n.conversations.analytics.hourlyDistribution.map(ue=>ue.count),1),re=Math.round(K/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 โ€” ${K} 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:K})=>{const ne=Math.max(...n.conversations.analytics.dailyVolume.map(ue=>ue.count),1),re=Math.round(K/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}: ${K} messages`})},j)})}),s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:10,color:"var(--muted)",marginTop:4},children:[s.jsx("span",{children:(At=n.conversations.analytics.dailyVolume[0])==null?void 0:At.date}),s.jsx("span",{children:(en=n.conversations.analytics.dailyVolume[n.conversations.analytics.dailyVolume.length-1])==null?void 0:en.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||Sn?s.jsxs(s.Fragment,{children:[Un.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:"}),Un.map(j=>s.jsxs("button",{type:"button",onClick:()=>Wn(Re===j?"":j),style:{padding:"2px 10px",borderRadius:12,fontSize:11,cursor:"pointer",border:`1px solid ${Re===j?"#3b82f6":"var(--border)"}`,background:Re===j?"#3b82f620":"transparent",color:Re===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:qe,onChange:j=>It(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:[me," conversation",me===1?"":"s",qe?` matching "${qe}"`:""]}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:tm,style:{fontSize:12,padding:"4px 10px"},children:we.size===Jt.length?"โ˜‘ Deselect All":"โ˜ Select All"}),we.size>0&&s.jsx("button",{type:"button",className:"admin-refresh-btn",disabled:ln,onClick:()=>void Hu(),style:{fontSize:12,padding:"4px 10px",background:"#3b82f6",color:"#fff",border:"none"},children:ln?"โณ Exportingโ€ฆ":`๐Ÿ“ฆ Export ${we.size} as ZIP`})]}),s.jsxs("div",{className:"hub-session-list",children:[Jt.filter(j=>!Re||(j.tags??[]).includes(Re)).map(j=>{const K=Date.now()-j.lastActiveAt,ne=K<6e4?"just now":K<36e5?`${Math.round(K/6e4)}m ago`:K<864e5?`${Math.round(K/36e5)}h ago`:`${Math.round(K/864e5)}d ago`,re=De===j.key,{name:ue,phone:Pe}=Dt(j),it=async xe=>{if(xe.stopPropagation(),!h||!qt){le({kind:"err",text:"๐Ÿ” Log in (admin/operator) to clear conversations."});return}Qt(j.key);try{await J.clearGatewayConversation(j.key),Ur()}catch{}Qt(null)},ft=we.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:we.size>0&&!ft?.5:1,transition:"opacity 0.2s"},onClick:()=>Ee(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:ft,onClick:xe=>em(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"?"โœˆ๏ธ":"๐Ÿ’ฌ"," ",ue]}),s.jsxs("span",{className:"hub-card-id",children:[Pe&&s.jsx("span",{style:{color:"var(--text-secondary, #8b949e)",marginRight:6},children:Pe}),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=>wl(j,xe),title:"Export as text file",children:"๐Ÿ“„"}),s.jsx("button",{type:"button",className:"hub-mini-btn",onClick:xe=>lt(j,xe),title:"Export as PDF (opens print dialog)",children:"๐Ÿ“‘"})]}),s.jsx("button",{type:"button",className:"hub-mini-btn",disabled:On===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:Et=>{Et.stopPropagation(),xl(j.key,xe)},style:{background:"none",border:"none",color:"#3b82f6",cursor:"pointer",padding:0,fontSize:12,lineHeight:1},children:"ร—"})]},xe)),$t===j.key?s.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:2},children:s.jsx("input",{type:"text",value:Ea,onChange:xe=>sr(xe.target.value),onKeyDown:xe=>{xe.key==="Enter"&&bl(j.key,Ea),xe.key==="Escape"&&(oi(null),sr(""))},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(),oi(j.key),sr("")},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,Et)=>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()]})]},Et)),ie.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)}),cn&&!Sn&&s.jsx("div",{ref:_a,style:{height:1}}),Sn&&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โ€ฆ"})]}),!Sn&&!cn&&Jt.length>0&&s.jsxs("p",{className:"admin-hint",style:{textAlign:"center",padding:12},children:["All ",me," conversation",me===1?"":"s"," loaded."]})]})]}):Sn?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((K,ne)=>s.jsxs("li",{children:[s.jsx("span",{className:"hub-chip",children:K.kind}),s.jsx("span",{className:"hub-artifact-title",children:K.title||"(untitled)"}),K.preview?s.jsx("div",{className:"hub-artifact-preview",children:K.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:M===j.id||T!==null||h&&!qt,onClick:()=>Xu(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:Cs===j.id||h&&!qt,onClick:()=>void im(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:M===j.id||T!==null||h&&!qt,onClick:()=>Xu(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:Vu,children:[s.jsx("input",{type:"text",value:ja,onChange:j=>js(j.target.value),placeholder:"Search community skills (e.g. code-assist, deploy, testing)โ€ฆ"}),s.jsx("button",{type:"submit",className:"admin-refresh-btn",disabled:Sl,children:Sl?"Searchingโ€ฆ":"๐Ÿ”Ž Search"})]}),ci?s.jsx("div",{className:`admin-row-msg${ci.kind==="err"?" admin-row-msg-err":""}`,children:ci.text}):null,Ca&&!Sl?Lt.length>0?s.jsx("div",{className:"hub-session-list",children:Lt.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:Cs===j.name||h&&!qt,onClick:()=>void rm(j.name),children:Cs===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(K=>s.jsx("span",{className:"hub-chip",children:K},K))]})]},`m-${j.name}`))}):s.jsxs("div",{className:"empty-state",children:['No skills match "',ja,'" โ€” try a broader term, or add a registry to ',s.jsx("code",{children:"skills.registries"})," in config."]}):null]}):null,e==="subagents"&&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:((rw=n.subagents)==null?void 0:rw.total)??0}),s.jsx("div",{className:"admin-summary-label",children:"Runs recorded"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:((iw=n.subagents)==null?void 0:iw.running)??0}),s.jsx("div",{className:"admin-summary-label",children:"Running now"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:((aw=n.subagents)==null?void 0:aw.failed)??0}),s.jsx("div",{className:"admin-summary-label",children:"Failed"})]})]}),s.jsxs("p",{className:"admin-hint",children:["Each run is a separate child process. A transport of ",s.jsx("code",{children:"json"})," means the provider has no native tool protocol and the shared JSON fallback carried the tool calls; a refusal code means the run stopped deliberately instead of returning an answer."]}),(((sw=n.subagents)==null?void 0:sw.recent)??[]).length>0?s.jsx("div",{className:"hub-session-list",children:(((ow=n.subagents)==null?void 0:ow.recent)??[]).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.goal||"(no goal recorded)"}),s.jsxs("span",{className:"hub-card-id",children:[j.id.slice(0,8),j.startedAt?` ยท ${new Date(j.startedAt).toLocaleString()}`:""]})]}),s.jsx("div",{className:"hub-card-actions",children:s.jsx("span",{className:"hub-chip",children:Gse[j.status]??j.status})})]}),s.jsxs("div",{className:"hub-card-tools",children:[s.jsxs("span",{className:"hub-chip",children:["๐Ÿ”Œ ",j.provider??"provider unknown",j.model?` ยท ${j.model}`:""]}),s.jsxs("span",{className:"hub-chip",children:["๐Ÿ›  ",j.transport??"transport unknown"," transport"]}),s.jsxs("span",{className:"hub-chip",children:[j.llmCalls," model call",j.llmCalls===1?"":"s"]}),s.jsxs("span",{className:"hub-chip",children:[j.toolCalls," tool call",j.toolCalls===1?"":"s"]}),typeof j.durationMs=="number"?s.jsxs("span",{className:"hub-chip",children:[(j.durationMs/1e3).toFixed(1),"s"]}):null]}),j.refusalCode?s.jsxs("div",{className:"hub-card-note",children:["โ›” Refused before answering โ€” code ",s.jsx("code",{children:j.refusalCode})]}):null,j.error?s.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:j.error}):null,j.resultPreview?s.jsx("div",{className:"hub-artifact-preview",children:j.resultPreview}):null]},j.id))}):s.jsxs("div",{className:"empty-state",children:["No subagent runs recorded yet โ€” a run shows up here once the agent spawns one (the ",s.jsx("code",{children:"subagent"})," tool), and only if it actually started."]})]}):null]})}const TE={running:"โณ running",done:"โœ… done",failed:"โŒ failed",cancelled:"โน cancelled",timeout:"โฐ timed out",error:"๐Ÿ’ฅ error"};function OE(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 PE(e){return e===null?"โ€”":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function Vse(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 Yse(){const[e,t]=N.useState(null),[n,r]=N.useState(""),[i,a]=N.useState(300),[o,l]=N.useState(!1),[c,u]=N.useState(""),[d,f]=N.useState(null),[h,p]=N.useState([]),[g,m]=N.useState(!0),v=N.useRef(null),y=N.useRef(null),b=N.useCallback(async()=>{const _=await J.listTasks();_&&p(_.tasks)},[]);N.useEffect(()=>{J.fetchAdminAuthStatus().then(_=>{t(_?{configured:_.configured,authenticated:_.authenticated,role:_.role??null}:{configured:!1,authenticated:!1,role:null}),_!=null&&_.authenticated&&b()})},[b]),N.useEffect(()=>{var _,C;if(g&&(d==null?void 0:d.status)==="running")try{(C=(_=v.current)==null?void 0:_.scrollIntoView)==null||C.call(_,{block:"end"})}catch{}},[d==null?void 0:d.logs.length,d==null?void 0:d.status,g]),N.useEffect(()=>()=>{var _;return(_=y.current)==null?void 0:_.call(y)},[]);const w=N.useCallback((_,C)=>{var L;if((L=y.current)==null||L.call(y),f(_),u(""),!C)return;const T=J.subscribeTask(_.id,{onLog:M=>f(B=>B&&B.id===_.id?{...B,logs:[...B.logs,M]}:B),onStatus:M=>f(B=>B&&B.id===_.id?{...B,status:M}:B)});y.current=T},[]),k=N.useCallback(async()=>{const _=Kse(n);if(_.length===0){u("Type a command first โ€” e.g. `eval run --task smoke-test` or `gateway status`.");return}l(!0),u("");const C=await J.startTask(_,i*1e3);if(l(!1),!C.ok||!C.task){u(C.error||"Failed to start task.");return}r(""),b(),w(C.task,!0)},[n,i,w,b]),S=N.useCallback(async _=>{await J.cancelTask(_)},[]),x=N.useCallback(async _=>{const C=await J.getTask(_);C!=null&&C.task&&w(C.task,!1)},[w]),E=N.useCallback(()=>{var _;(_=y.current)==null||_.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:_=>{_.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:_=>r(_.target.value),autoComplete:"off",spellCheck:!1}),s.jsxs("select",{className:"admin-input task-timeout-select",title:"Task timeout",value:i,onChange:_=>a(Number(_.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 ${OE(d.status)}`,children:TE[d.status]}),s.jsxs("span",{className:"task-meta",children:["exit ",d.exitCode??"โ€”"," ยท ",PE(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:E,children:"โœ• Close"})]}),s.jsxs("div",{className:"task-console",children:[d.logs.map((_,C)=>s.jsx("div",{className:`task-line task-line-${_.stream}`,children:_.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:_=>m(_.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(_=>s.jsxs("tr",{className:(d==null?void 0:d.id)===_.id?"task-row-active":"",onClick:()=>void x(_.id),children:[s.jsx("td",{children:s.jsx("code",{children:_.command})}),s.jsx("td",{children:s.jsx("span",{className:`task-status ${OE(_.status)}`,children:TE[_.status]})}),s.jsx("td",{children:_.exitCode??"โ€”"}),s.jsx("td",{children:PE(_.durationMs)}),s.jsx("td",{children:Vse(_.startedAt)})]},_.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(Dy,{className:"admin-refresh-btn",to:"/admin",children:"๐Ÿ” Log in"}):s.jsx(Dy,{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 Xse(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Zse=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Qse=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Jse={};function RE(e,t){return(Jse.jsx?Qse:Zse).test(e)}const eoe=/[ \t\n\f\r]/g;function toe(e){return typeof e=="object"?e.type==="text"?ME(e.value):!1:ME(e)}function ME(e){return e.replace(eoe,"")===""}class Du{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Du.prototype.normal={};Du.prototype.property={};Du.prototype.space=void 0;function ER(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Du(n,r,t)}function ub(e){return e.toLowerCase()}class Fn{constructor(t,n){this.attribute=n,this.property=t}}Fn.prototype.attribute="";Fn.prototype.booleanish=!1;Fn.prototype.boolean=!1;Fn.prototype.commaOrSpaceSeparated=!1;Fn.prototype.commaSeparated=!1;Fn.prototype.defined=!1;Fn.prototype.mustUseProperty=!1;Fn.prototype.number=!1;Fn.prototype.overloadedBoolean=!1;Fn.prototype.property="";Fn.prototype.spaceSeparated=!1;Fn.prototype.space=void 0;let noe=0;const Ie=ks(),Pt=ks(),db=ks(),ce=ks(),at=ks(),is=ks(),Vn=ks();function ks(){return 2**++noe}const fb=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ie,booleanish:Pt,commaOrSpaceSeparated:Vn,commaSeparated:is,number:ce,overloadedBoolean:db,spaceSeparated:at},Symbol.toStringTag,{value:"Module"})),Sg=Object.keys(fb);class P0 extends Fn{constructor(t,n,r,i){let a=-1;if(super(t,n),IE(this,"space",i),typeof r=="number")for(;++a<Sg.length;){const o=Sg[a];IE(this,Sg[a],(r&fb[o])===fb[o])}}}P0.prototype.defined=!0;function IE(e,t,n){n&&(e[t]=n)}function gl(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[ub(r)]=r,n[ub(a.attribute)]=r}return new Du(t,n,e.space)}const _R=gl({properties:{ariaActiveDescendant:null,ariaAtomic:Pt,ariaAutoComplete:null,ariaBusy:Pt,ariaChecked:Pt,ariaColCount:ce,ariaColIndex:ce,ariaColSpan:ce,ariaControls:at,ariaCurrent:null,ariaDescribedBy:at,ariaDetails:null,ariaDisabled:Pt,ariaDropEffect:at,ariaErrorMessage:null,ariaExpanded:Pt,ariaFlowTo:at,ariaGrabbed:Pt,ariaHasPopup:null,ariaHidden:Pt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:at,ariaLevel:ce,ariaLive:null,ariaModal:Pt,ariaMultiLine:Pt,ariaMultiSelectable:Pt,ariaOrientation:null,ariaOwns:at,ariaPlaceholder:null,ariaPosInSet:ce,ariaPressed:Pt,ariaReadOnly:Pt,ariaRelevant:null,ariaRequired:Pt,ariaRoleDescription:at,ariaRowCount:ce,ariaRowIndex:ce,ariaRowSpan:ce,ariaSelected:Pt,ariaSetSize:ce,ariaSort:null,ariaValueMax:ce,ariaValueMin:ce,ariaValueNow:ce,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function jR(e,t){return t in e?e[t]:t}function AR(e,t){return jR(e,t.toLowerCase())}const roe=gl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:is,acceptCharset:at,accessKey:at,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alpha:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:at,autoFocus:Ie,autoPlay:Ie,blocking:at,capture:null,charSet:null,checked:Ie,cite:null,className:at,closedBy:null,colorSpace:null,cols:ce,colSpan:ce,command:null,commandFor:null,content:null,contentEditable:Pt,controls:Ie,controlsList:at,coords:ce|is,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:db,draggable:Pt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:at,height:ce,hidden:db,high:ce,href:null,hrefLang:null,htmlFor:at,httpEquiv:at,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:at,itemRef:at,itemScope:Ie,itemType:at,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:ce,manifest:null,max:null,maxLength:ce,media:null,method:null,min:null,minLength:ce,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,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:Ie,optimum:ce,pattern:null,ping:at,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:at,required:Ie,reversed:Ie,rows:ce,rowSpan:ce,sandbox:at,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootCustomElementRegistry:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shadowRootSerializable:Ie,shape:null,size:ce,sizes:null,slot:null,span:ce,spellCheck:Pt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ce,step:null,style:null,tabIndex:ce,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:Pt,width:ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:at,axis:null,background:null,bgColor:null,border:ce,borderColor:null,bottomMargin:ce,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:ce,leftMargin:ce,link:null,longDesc:null,lowSrc:null,marginHeight:ce,marginWidth:ce,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:ce,rules:null,scheme:null,scrolling:Pt,standby:null,summary:null,text:null,topMargin:ce,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ce,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ie,disablePictureInPicture:Ie,disableRemotePlayback:Ie,exportParts:is,part:at,prefix:null,property:null,results:ce,security:null,unselectable:null},space:"html",transform:AR}),ioe=gl({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:Vn,accentHeight:ce,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ce,amplitude:ce,arabicForm:null,ascent:ce,attributeName:null,attributeType:null,azimuth:ce,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ce,by:null,calcMode:null,capHeight:ce,className:at,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:ce,diffuseConstant:ce,direction:null,display:null,dur:null,divisor:ce,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:ce,enableBackground:null,end:null,event:null,exponent:ce,externalResourcesRequired:null,fill:null,fillOpacity:ce,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:is,g2:is,glyphName:is,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ce,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ce,horizOriginX:ce,horizOriginY:ce,id:null,ideographic:ce,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ce,k:ce,k1:ce,k2:ce,k3:ce,k4:ce,kernelMatrix:Vn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ce,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:ce,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:ce,overlineThickness:ce,paintOrder:null,panose1:null,path:null,pathLength:ce,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:at,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ce,pointsAtY:ce,pointsAtZ:ce,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Vn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Vn,rev:Vn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Vn,requiredFeatures:Vn,requiredFonts:Vn,requiredFormats:Vn,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:ce,specularExponent:ce,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ce,strikethroughThickness:ce,string:null,stroke:null,strokeDashArray:Vn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ce,strokeOpacity:ce,strokeWidth:null,style:null,surfaceScale:ce,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Vn,tabIndex:ce,tableValues:null,target:null,targetX:ce,targetY:ce,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Vn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ce,underlineThickness:ce,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ce,values:null,vAlphabetic:ce,vMathematical:ce,vectorEffect:null,vHanging:ce,vIdeographic:ce,version:null,vertAdvY:ce,vertOriginX:ce,vertOriginY:ce,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ce,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:jR}),CR=gl({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()}}),TR=gl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:AR}),OR=gl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),aoe={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"},soe=/[A-Z]/g,$E=/-[a-z]/g,ooe=/^data[-\w.:]+$/i;function loe(e,t){const n=ub(t);let r=t,i=Fn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&ooe.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace($E,uoe);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!$E.test(a)){let o=a.replace(soe,coe);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=P0}return new i(r,t)}function coe(e){return"-"+e.toLowerCase()}function uoe(e){return e.charAt(1).toUpperCase()}const doe=ER([_R,roe,CR,TR,OR],"html"),R0=ER([_R,ioe,CR,TR,OR],"svg");function foe(e){return e.join(" ").trim()}var M0={},LE=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,hoe=/\n/g,poe=/^\s*/,moe=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,goe=/^:\s*/,yoe=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,voe=/^[;\s]*/,boe=/^\s+|\s+$/g,xoe=`
165
+ `,DE="/",BE="*",Wa="",woe="comment",Soe="declaration";function koe(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(hoe);m&&(n+=m.length);var v=g.lastIndexOf(xoe);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(poe)}function d(g){var m;for(g=g||[];m=f();)m!==!1&&g.push(m);return g}function f(){var g=a();if(!(DE!=e.charAt(0)||BE!=e.charAt(1))){for(var m=2;Wa!=e.charAt(m)&&(BE!=e.charAt(m)||DE!=e.charAt(m+1));)++m;if(m+=2,Wa===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:woe,comment:v})}}function h(){var g=a(),m=c(moe);if(m){if(f(),!c(goe))return l("property missing ':'");var v=c(yoe),y=g({type:Soe,property:zE(m[0].replace(LE,Wa)),value:v?zE(v[0].replace(LE,Wa)):Wa});return c(voe),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 zE(e){return e?e.replace(boe,Wa):Wa}var Noe=koe,Eoe=Yi&&Yi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(M0,"__esModule",{value:!0});M0.default=joe;const _oe=Eoe(Noe);function joe(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,_oe.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 Kp={};Object.defineProperty(Kp,"__esModule",{value:!0});Kp.camelCase=void 0;var Aoe=/^--[a-zA-Z0-9_-]+$/,Coe=/-([a-z])/g,Toe=/^[^-]+$/,Ooe=/^-(webkit|moz|ms|o|khtml)-/,Poe=/^-(ms)-/,Roe=function(e){return!e||Toe.test(e)||Aoe.test(e)},Moe=function(e,t){return t.toUpperCase()},FE=function(e,t){return"".concat(t,"-")},Ioe=function(e,t){return t===void 0&&(t={}),Roe(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Poe,FE):e=e.replace(Ooe,FE),e.replace(Coe,Moe))};Kp.camelCase=Ioe;var $oe=Yi&&Yi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Loe=$oe(M0),Doe=Kp;function hb(e,t){var n={};return!e||typeof e!="string"||(0,Loe.default)(e,function(r,i){r&&i&&(n[(0,Doe.camelCase)(r,t)]=i)}),n}hb.default=hb;var Boe=hb;const zoe=Ze(Boe),PR=RR("end"),I0=RR("start");function RR(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 Foe(e){const t=I0(e),n=PR(e);if(t&&n)return{start:t,end:n}}function yc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?UE(e.position):"start"in e||"end"in e?UE(e):"line"in e||"column"in e?pb(e):""}function pb(e){return WE(e&&e.line)+":"+WE(e&&e.column)}function UE(e){return pb(e&&e.start)+"-"+pb(e&&e.end)}function WE(e){return e&&typeof e=="number"?e:1}class xn 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=yc(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}}xn.prototype.file="";xn.prototype.name="";xn.prototype.reason="";xn.prototype.message="";xn.prototype.stack="";xn.prototype.column=void 0;xn.prototype.line=void 0;xn.prototype.ancestors=void 0;xn.prototype.cause=void 0;xn.prototype.fatal=void 0;xn.prototype.place=void 0;xn.prototype.ruleId=void 0;xn.prototype.source=void 0;const $0={}.hasOwnProperty,Uoe=new Map,Woe=/[A-Z]/g,Hoe=new Set(["table","tbody","thead","tfoot","tr"]),Goe=new Set(["td","th"]),MR="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function qoe(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=ele(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=Joe(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"?R0:doe,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=IR(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function IR(e,t,n){if(t.type==="element")return Koe(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Voe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Xoe(e,t,n);if(t.type==="mdxjsEsm")return Yoe(e,t);if(t.type==="root")return Zoe(e,t,n);if(t.type==="text")return Qoe(e,t)}function Koe(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=R0,e.schema=i),e.ancestors.push(t);const a=LR(e,t.tagName,!1),o=tle(e,t);let l=D0(e,t);return Hoe.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!toe(c):!0})),$R(e,o,a,t),L0(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Voe(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)}wu(e,t.position)}function Yoe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);wu(e,t.position)}function Xoe(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=R0,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:LR(e,t.name,!0),o=nle(e,t),l=D0(e,t);return $R(e,o,a,t),L0(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Zoe(e,t,n){const r={};return L0(r,D0(e,t)),e.create(t,e.Fragment,r,n)}function Qoe(e,t){return t.value}function $R(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function L0(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Joe(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 ele(e,t){return n;function n(r,i,a,o){const l=Array.isArray(a.children),c=I0(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 tle(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&$0.call(t.properties,i)){const a=rle(e,i,t.properties[i]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&Goe.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 nle(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 wu(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 wu(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function D0(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Uoe;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=IR(e,a,o);l!==void 0&&n.push(l)}return n}function rle(e,t,n){const r=loe(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Xse(n):foe(n)),r.property==="style"){let i=typeof n=="object"?n:ile(e,String(n));return e.stylePropertyNameCase==="css"&&(i=ale(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?aoe[r.property]||r.property:r.attribute,n]}}function ile(e,t){try{return zoe(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new xn("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=MR+"#cannot-parse-style-attribute",i}}function LR(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=RE(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=RE(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return $0.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);wu(e)}function wu(e,t){const n=new xn("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=MR+"#cannot-handle-mdx-estrees-without-createevaluater",n}function ale(e){const t={};let n;for(n in e)$0.call(e,n)&&(t[sle(n)]=e[n]);return t}function sle(e){let t=e.replace(Woe,ole);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function ole(e){return"-"+e.toLowerCase()}const kg={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"]},lle={};function B0(e,t){const n=lle,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return DR(e,r,i)}function DR(e,t,n){if(cle(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 HE(e.children,t,n)}return Array.isArray(e)?HE(e,t,n):""}function HE(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=DR(e[i],t,n);return r.join("")}function cle(e){return!!(e&&typeof e=="object")}const GE=document.createElement("i");function z0(e){const t="&"+e+";";GE.innerHTML=t;const n=GE.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function tr(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 hr(e,t){return e.length>0?(tr(e,e.length,0,t),e):t}const qE={}.hasOwnProperty;function BR(e){const t={};let n=-1;for(;++n<e.length;)ule(t,e[n]);return t}function ule(e,t){let n;for(n in t){const i=(qE.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){qE.call(i,o)||(i[o]=[]);const l=a[o];dle(i[o],Array.isArray(l)?l:l?[l]:[])}}}function dle(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);tr(e,0,0,r)}function zR(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 Lr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const _n=Na(/[A-Za-z]/),vn=Na(/[\dA-Za-z]/),fle=Na(/[#-'*+\--9=?A-Z^-~]/);function Ph(e){return e!==null&&(e<32||e===127)}const mb=Na(/\d/),hle=Na(/[\dA-Fa-f]/),ple=Na(/[!-/:-@[-`{-~]/);function Ae(e){return e!==null&&e<-2}function ot(e){return e!==null&&(e<0||e===32)}function Be(e){return e===-2||e===-1||e===32}const Vp=Na(new RegExp("\\p{P}|\\p{S}","u")),gs=Na(/\s/);function Na(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function yl(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&vn(e.charCodeAt(n+1))&&vn(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 Be(c)?(e.enter(n),l(c)):t(c)}function l(c){return Be(c)&&a++<i?(e.consume(c),l):(e.exit(n),t(c))}}const mle={tokenize:gle};function gle(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 Ae(l)?(e.consume(l),e.exit("chunkText"),a):(e.consume(l),o)}}const yle={tokenize:vle},KE={tokenize:ble};function vle(e){const t=this,n=[];let r=0,i,a,o;return l;function l(w){if(r<n.length){const k=n[r];return t.containerState=k[1],e.attempt(k[0].continuation,c,u)(w)}return u(w)}function c(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&b();const k=t.events.length;let S=k,x;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){x=t.events[S][1].end;break}y(r);let E=k;for(;E<t.events.length;)t.events[E][1].end={...x},E++;return tr(t.events,S+1,0,t.events.slice(k)),t.events.length=E,u(w)}return l(w)}function u(w){if(r===n.length){if(!i)return h(w);if(i.currentConstruct&&i.currentConstruct.concrete)return g(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(KE,d,f)(w)}function d(w){return i&&b(),y(r),h(w)}function f(w){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,g(w)}function h(w){return t.containerState={},e.attempt(KE,p,g)(w)}function p(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function g(w){if(w===null){i&&b(),y(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),m(w)}function m(w){if(w===null){v(e.exit("chunkFlow"),!0),y(0),e.consume(w);return}return Ae(w)?(e.consume(w),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(w),m)}function v(w,k){const S=t.sliceStream(w);if(k&&S.push(null),w.previous=a,a&&(a.next=w),a=w,i.defineSkip(w.start),i.write(S),t.parser.lazy[w.start.line]){let x=i.events.length;for(;x--;)if(i.events[x][1].start.offset<o&&(!i.events[x][1].end||i.events[x][1].end.offset>o))return;const E=t.events.length;let _=E,C,T;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){if(C){T=t.events[_][1].end;break}C=!0}for(y(r),x=E;x<t.events.length;)t.events[x][1].end={...T},x++;tr(t.events,_+1,0,t.events.slice(E)),t.events.length=x}}function y(w){let k=n.length;for(;k-- >w;){const S=n[k];t.containerState=S[1],S[0].exit.call(t,e)}n.length=w}function b(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ble(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 Xo(e){if(e===null||ot(e)||gs(e))return 1;if(Vp(e))return 2}function Yp(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 gb={name:"attention",resolveAll:xle,tokenize:wle};function xle(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};VE(f,-c),VE(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=hr(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=hr(u,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),u=hr(u,Yp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=hr(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=hr(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,tr(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 wle(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Xo(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=Xo(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 VE(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Sle={name:"autolink",tokenize:kle};function kle(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 _n(p)?(e.consume(p),o):p===64?n(p):u(p)}function o(p){return p===43||p===45||p===46||vn(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||vn(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||Ph(p)?n(p):(e.consume(p),c)}function u(p){return p===64?(e.consume(p),d):fle(p)?(e.consume(p),u):n(p)}function d(p){return vn(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||vn(p))&&r++<63){const g=p===45?h:f;return e.consume(p),g}return n(p)}}const Bu={partial:!0,tokenize:Nle};function Nle(e,t,n){return r;function r(a){return Be(a)?Ue(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Ae(a)?t(a):n(a)}}const FR={continuation:{tokenize:_le},exit:jle,name:"blockQuote",tokenize:Ele};function Ele(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 Be(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function _le(e,t,n){const r=this;return i;function i(o){return Be(o)?Ue(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(FR,t,n)(o)}}function jle(e){e.exit("blockQuote")}const UR={name:"characterEscape",tokenize:Ale};function Ale(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 ple(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const WR={name:"characterReference",tokenize:Cle};function Cle(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=vn,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=hle,d):(e.enter("characterReferenceValue"),a=7,o=mb,d(f))}function d(f){if(f===59&&i){const h=e.exit("characterReferenceValue");return o===vn&&!z0(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 YE={partial:!0,tokenize:Ole},XE={concrete:!0,name:"codeFenced",tokenize:Tle};function Tle(e,t,n){const r=this,i={partial:!0,tokenize:S};let a=0,o=0,l;return c;function c(x){return u(x)}function u(x){const E=r.events[r.events.length-1];return a=E&&E[1].type==="linePrefix"?E[2].sliceSerialize(E[1],!0).length:0,l=x,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(x)}function d(x){return x===l?(o++,e.consume(x),d):o<3?n(x):(e.exit("codeFencedFenceSequence"),Be(x)?Ue(e,f,"whitespace")(x):f(x))}function f(x){return x===null||Ae(x)?(e.exit("codeFencedFence"),r.interrupt?t(x):e.check(YE,m,k)(x)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===null||Ae(x)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(x)):Be(x)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ue(e,p,"whitespace")(x)):x===96&&x===l?n(x):(e.consume(x),h)}function p(x){return x===null||Ae(x)?f(x):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===null||Ae(x)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(x)):x===96&&x===l?n(x):(e.consume(x),g)}function m(x){return e.attempt(i,k,v)(x)}function v(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),y}function y(x){return a>0&&Be(x)?Ue(e,b,"linePrefix",a+1)(x):b(x)}function b(x){return x===null||Ae(x)?e.check(YE,m,k)(x):(e.enter("codeFlowValue"),w(x))}function w(x){return x===null||Ae(x)?(e.exit("codeFlowValue"),b(x)):(e.consume(x),w)}function k(x){return e.exit("codeFenced"),t(x)}function S(x,E,_){let C=0;return T;function T(F){return x.enter("lineEnding"),x.consume(F),x.exit("lineEnding"),L}function L(F){return x.enter("codeFencedFence"),Be(F)?Ue(x,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):M(F)}function M(F){return F===l?(x.enter("codeFencedFenceSequence"),B(F)):_(F)}function B(F){return F===l?(C++,x.consume(F),B):C>=o?(x.exit("codeFencedFenceSequence"),Be(F)?Ue(x,I,"whitespace")(F):I(F)):_(F)}function I(F){return F===null||Ae(F)?(x.exit("codeFencedFence"),E(F)):_(F)}}}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 Ng={name:"codeIndented",tokenize:Rle},Ple={partial:!0,tokenize:Mle};function Rle(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):Ae(u)?e.attempt(Ple,o,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Ae(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function Mle(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Ae(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):Ae(o)?i(o):n(o)}}const Ile={name:"codeText",previous:Lle,resolve:$le,tokenize:Dle};function $le(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 Lle(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Dle(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)):Ae(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||Ae(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 Ble{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&&Vl(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),Vl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Vl(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);Vl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Vl(this.left,n.reverse())}}}function Vl(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 HR(e){const t={};let n=-1,r,i,a,o,l,c,u;const d=new Ble(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,zle(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 tr(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function zle(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 Fle={resolve:Wle,tokenize:Hle},Ule={partial:!0,tokenize:Gle};function Wle(e){return HR(e),e}function Hle(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):Ae(l)?e.check(Ule,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 Gle(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||Ae(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 GR(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||Ph(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||Ae(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||ot(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||Ph(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 qR(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):Ae(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||Ae(p)||l++>999?(e.exit("chunkString"),d(p)):(e.consume(p),c||(c=!Be(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),l++,f):f(p)}}function KR(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):Ae(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||Ae(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 vc(e,t){let n;return r;function r(i){return Ae(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Be(i)?Ue(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const qle={name:"definition",tokenize:Vle},Kle={partial:!0,tokenize:Yle};function Vle(e,t,n){const r=this;let i;return a;function a(p){return e.enter("definition"),o(p)}function o(p){return qR.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return i=Lr(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 ot(p)?vc(e,u)(p):u(p)}function u(p){return GR(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(Kle,f,f)(p)}function f(p){return Be(p)?Ue(e,h,"whitespace")(p):h(p)}function h(p){return p===null||Ae(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function Yle(e,t,n){return r;function r(l){return ot(l)?vc(e,i)(l):n(l)}function i(l){return KR(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return Be(l)?Ue(e,o,"whitespace")(l):o(l)}function o(l){return l===null||Ae(l)?t(l):n(l)}}const Xle={name:"hardBreakEscape",tokenize:Zle};function Zle(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Ae(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const Qle={name:"headingAtx",resolve:Jle,tokenize:ece};function Jle(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"},tr(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function ece(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||ot(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||Ae(d)?(e.exit("atxHeading"),t(d)):Be(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||ot(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const tce=["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"],ZE=["pre","script","style","textarea"],nce={concrete:!0,name:"htmlFlow",resolveTo:ace,tokenize:sce},rce={partial:!0,tokenize:lce},ice={partial:!0,tokenize:oce};function ace(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 sce(e,t,n){const r=this;let i,a,o,l,c;return u;function u(P){return d(P)}function d(P){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(P),f}function f(P){return P===33?(e.consume(P),h):P===47?(e.consume(P),a=!0,m):P===63?(e.consume(P),i=3,r.interrupt?t:A):_n(P)?(e.consume(P),o=String.fromCharCode(P),v):n(P)}function h(P){return P===45?(e.consume(P),i=2,p):P===91?(e.consume(P),i=5,l=0,g):_n(P)?(e.consume(P),i=4,r.interrupt?t:A):n(P)}function p(P){return P===45?(e.consume(P),r.interrupt?t:A):n(P)}function g(P){const oe="CDATA[";return P===oe.charCodeAt(l++)?(e.consume(P),l===oe.length?r.interrupt?t:M:g):n(P)}function m(P){return _n(P)?(e.consume(P),o=String.fromCharCode(P),v):n(P)}function v(P){if(P===null||P===47||P===62||ot(P)){const oe=P===47,be=o.toLowerCase();return!oe&&!a&&ZE.includes(be)?(i=1,r.interrupt?t(P):M(P)):tce.includes(o.toLowerCase())?(i=6,oe?(e.consume(P),y):r.interrupt?t(P):M(P)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):a?b(P):w(P))}return P===45||vn(P)?(e.consume(P),o+=String.fromCharCode(P),v):n(P)}function y(P){return P===62?(e.consume(P),r.interrupt?t:M):n(P)}function b(P){return Be(P)?(e.consume(P),b):T(P)}function w(P){return P===47?(e.consume(P),T):P===58||P===95||_n(P)?(e.consume(P),k):Be(P)?(e.consume(P),w):T(P)}function k(P){return P===45||P===46||P===58||P===95||vn(P)?(e.consume(P),k):S(P)}function S(P){return P===61?(e.consume(P),x):Be(P)?(e.consume(P),S):w(P)}function x(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),c=P,E):Be(P)?(e.consume(P),x):_(P)}function E(P){return P===c?(e.consume(P),c=null,C):P===null||Ae(P)?n(P):(e.consume(P),E)}function _(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||ot(P)?S(P):(e.consume(P),_)}function C(P){return P===47||P===62||Be(P)?w(P):n(P)}function T(P){return P===62?(e.consume(P),L):n(P)}function L(P){return P===null||Ae(P)?M(P):Be(P)?(e.consume(P),L):n(P)}function M(P){return P===45&&i===2?(e.consume(P),z):P===60&&i===1?(e.consume(P),R):P===62&&i===4?(e.consume(P),Z):P===63&&i===3?(e.consume(P),A):P===93&&i===5?(e.consume(P),U):Ae(P)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(rce,$,B)(P)):P===null||Ae(P)?(e.exit("htmlFlowData"),B(P)):(e.consume(P),M)}function B(P){return e.check(ice,I,$)(P)}function I(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),F}function F(P){return P===null||Ae(P)?B(P):(e.enter("htmlFlowData"),M(P))}function z(P){return P===45?(e.consume(P),A):M(P)}function R(P){return P===47?(e.consume(P),o="",O):M(P)}function O(P){if(P===62){const oe=o.toLowerCase();return ZE.includes(oe)?(e.consume(P),Z):M(P)}return _n(P)&&o.length<8?(e.consume(P),o+=String.fromCharCode(P),O):M(P)}function U(P){return P===93?(e.consume(P),A):M(P)}function A(P){return P===62?(e.consume(P),Z):P===45&&i===2?(e.consume(P),A):M(P)}function Z(P){return P===null||Ae(P)?(e.exit("htmlFlowData"),$(P)):(e.consume(P),Z)}function $(P){return e.exit("htmlFlow"),t(P)}}function oce(e,t,n){const r=this;return i;function i(o){return Ae(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 lce(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Bu,t,n)}}const cce={name:"htmlText",tokenize:uce};function uce(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),w):_n(A)?(e.consume(A),_):n(A)}function u(A){return A===45?(e.consume(A),d):A===91?(e.consume(A),a=0,g):_n(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):Ae(A)?(o=f,R(A)):(e.consume(A),f)}function h(A){return A===45?(e.consume(A),p):f(A)}function p(A){return A===62?z(A):A===45?h(A):f(A)}function g(A){const Z="CDATA[";return A===Z.charCodeAt(a++)?(e.consume(A),a===Z.length?m:g):n(A)}function m(A){return A===null?n(A):A===93?(e.consume(A),v):Ae(A)?(o=m,R(A)):(e.consume(A),m)}function v(A){return A===93?(e.consume(A),y):m(A)}function y(A){return A===62?z(A):A===93?(e.consume(A),y):m(A)}function b(A){return A===null||A===62?z(A):Ae(A)?(o=b,R(A)):(e.consume(A),b)}function w(A){return A===null?n(A):A===63?(e.consume(A),k):Ae(A)?(o=w,R(A)):(e.consume(A),w)}function k(A){return A===62?z(A):w(A)}function S(A){return _n(A)?(e.consume(A),x):n(A)}function x(A){return A===45||vn(A)?(e.consume(A),x):E(A)}function E(A){return Ae(A)?(o=E,R(A)):Be(A)?(e.consume(A),E):z(A)}function _(A){return A===45||vn(A)?(e.consume(A),_):A===47||A===62||ot(A)?C(A):n(A)}function C(A){return A===47?(e.consume(A),z):A===58||A===95||_n(A)?(e.consume(A),T):Ae(A)?(o=C,R(A)):Be(A)?(e.consume(A),C):z(A)}function T(A){return A===45||A===46||A===58||A===95||vn(A)?(e.consume(A),T):L(A)}function L(A){return A===61?(e.consume(A),M):Ae(A)?(o=L,R(A)):Be(A)?(e.consume(A),L):C(A)}function M(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),i=A,B):Ae(A)?(o=M,R(A)):Be(A)?(e.consume(A),M):(e.consume(A),I)}function B(A){return A===i?(e.consume(A),i=void 0,F):A===null?n(A):Ae(A)?(o=B,R(A)):(e.consume(A),B)}function I(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||ot(A)?C(A):(e.consume(A),I)}function F(A){return A===47||A===62||ot(A)?C(A):n(A)}function z(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function R(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),O}function O(A){return Be(A)?Ue(e,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):U(A)}function U(A){return e.enter("htmlTextData"),o(A)}}const F0={name:"labelEnd",resolveAll:pce,resolveTo:mce,tokenize:gce},dce={tokenize:yce},fce={tokenize:vce},hce={tokenize:bce};function pce(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&&tr(e,0,e.length,n),e}function mce(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=hr(l,e.slice(a+1,a+r+3)),l=hr(l,[["enter",d,t]]),l=hr(l,Yp(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),l=hr(l,[["exit",d,t],e[o-2],e[o-1],["exit",u,t]]),l=hr(l,e.slice(o+1)),l=hr(l,[["exit",c,t]]),tr(e,a,e.length,l),e}function gce(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(Lr(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(dce,d,o?d:f)(h):h===91?e.attempt(fce,d,o?u:f)(h):o?d(h):f(h)}function u(h){return e.attempt(hce,d,f)(h)}function d(h){return t(h)}function f(h){return a._balanced=!0,n(h)}}function yce(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 ot(f)?vc(e,a)(f):a(f)}function a(f){return f===41?d(f):GR(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return ot(f)?vc(e,c)(f):d(f)}function l(f){return n(f)}function c(f){return f===34||f===39||f===40?KR(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function u(f){return ot(f)?vc(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 vce(e,t,n){const r=this;return i;function i(l){return qR.call(r,e,a,o,"reference","referenceMarker","referenceString")(l)}function a(l){return r.parser.defined.includes(Lr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function o(l){return n(l)}}function bce(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 xce={name:"labelStartImage",resolveAll:F0.resolveAll,tokenize:wce};function wce(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 Sce={name:"labelStartLink",resolveAll:F0.resolveAll,tokenize:kce};function kce(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 Eg={name:"lineEnding",tokenize:Nce};function Nce(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ue(e,t,"linePrefix")}}const nf={name:"thematicBreak",tokenize:Ece};function Ece(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||Ae(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===i?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),Be(u)?Ue(e,l,"whitespace")(u):l(u))}}const Rn={continuation:{tokenize:Cce},exit:Oce,name:"list",tokenize:Ace},_ce={partial:!0,tokenize:Pce},jce={partial:!0,tokenize:Tce};function Ace(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:mb(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(nf,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 mb(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(Bu,r.interrupt?n:d,e.attempt(_ce,h,f))}function d(p){return r.containerState.initialBlankLine=!0,a++,h(p)}function f(p){return Be(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 Cce(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Bu,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||!Be(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(jce,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ue(e,e.attempt(Rn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function Tce(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 Pce(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!Be(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const QE={name:"setextUnderline",resolveTo:Rce,tokenize:Mce};function Rce(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 Mce(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"),Be(u)?Ue(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Ae(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Ice={tokenize:$ce};function $ce(e){const t=this,n=e.attempt(Bu,r,e.attempt(this.parser.constructs.flowInitial,i,Ue(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Fle,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 Lce={resolveAll:YR()},Dce=VR("string"),Bce=VR("text");function VR(e){return{resolveAll:YR(e==="text"?zce: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 YR(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 zce(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 Fce={42:Rn,43:Rn,45:Rn,48:Rn,49:Rn,50:Rn,51:Rn,52:Rn,53:Rn,54:Rn,55:Rn,56:Rn,57:Rn,62:FR},Uce={91:qle},Wce={[-2]:Ng,[-1]:Ng,32:Ng},Hce={35:Qle,42:nf,45:[QE,nf],60:nce,61:QE,95:nf,96:XE,126:XE},Gce={38:WR,92:UR},qce={[-5]:Eg,[-4]:Eg,[-3]:Eg,33:xce,38:WR,42:gb,60:[Sle,cce],91:Sce,92:[Xle,UR],93:F0,95:gb,96:Ile},Kce={null:[gb,Lce]},Vce={null:[42,95]},Yce={null:[]},Xce=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Vce,contentInitial:Uce,disable:Yce,document:Fce,flow:Hce,flowInitial:Wce,insideSpan:Kce,string:Gce,text:qce},Symbol.toStringTag,{value:"Module"}));function Zce(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:E(S),check:E(x),consume:b,enter:w,exit:k,interrupt:E(x,{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(L){return o=hr(o,L),v(),o[o.length-1]!==null?[]:(_(t,0),u.events=Yp(a,u.events,u),u.events)}function h(L,M){return Jce(p(L),M)}function p(L){return Qce(o,L)}function g(){const{_bufferIndex:L,_index:M,line:B,column:I,offset:F}=r;return{_bufferIndex:L,_index:M,line:B,column:I,offset:F}}function m(L){i[L.line]=L.column,T()}function v(){let L;for(;r._index<o.length;){const M=o[r._index];if(typeof M=="string")for(L=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===L&&r._bufferIndex<M.length;)y(M.charCodeAt(r._bufferIndex));else y(M)}}function y(L){d=d(L)}function b(L){Ae(L)?(r.line++,r.column=1,r.offset+=L===-3?2:1,T()):L!==-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=L}function w(L,M){const B=M||{};return B.type=L,B.start=g(),u.events.push(["enter",B,u]),l.push(B),B}function k(L){const M=l.pop();return M.end=g(),u.events.push(["exit",M,u]),M}function S(L,M){_(L,M.from)}function x(L,M){M.restore()}function E(L,M){return B;function B(I,F,z){let R,O,U,A;return Array.isArray(I)?$(I):"tokenize"in I?$([I]):Z(I);function Z(pe){return Ce;function Ce(G){const Y=G!==null&&pe[G],ae=G!==null&&pe.null,le=[...Array.isArray(Y)?Y:Y?[Y]:[],...Array.isArray(ae)?ae:ae?[ae]:[]];return $(le)(G)}}function $(pe){return R=pe,O=0,pe.length===0?z:P(pe[O])}function P(pe){return Ce;function Ce(G){return A=C(),U=pe,pe.partial||(u.currentConstruct=pe),pe.name&&u.parser.constructs.disable.null.includes(pe.name)?be():pe.tokenize.call(M?Object.assign(Object.create(u),M):u,c,oe,be)(G)}}function oe(pe){return L(U,A),F}function be(pe){return A.restore(),++O<R.length?P(R[O]):z}}}function _(L,M){L.resolveAll&&!a.includes(L)&&a.push(L),L.resolve&&tr(u.events,M,u.events.length-M,L.resolve(u.events.slice(M),u)),L.resolveTo&&(u.events=L.resolveTo(u.events,u))}function C(){const L=g(),M=u.previous,B=u.currentConstruct,I=u.events.length,F=Array.from(l);return{from:I,restore:z};function z(){r=L,u.previous=M,u.currentConstruct=B,u.events.length=I,l=F,T()}}function T(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Qce(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 Jce(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 eue(e){const r={constructs:BR([Xce,...(e||{}).extensions||[]]),content:i(mle),defined:[],document:i(yle),flow:i(Ice),lazy:{},string:i(Dce),text:i(Bce)};return r;function i(a){return o;function o(l){return Zce(r,a,l)}}}function tue(e){for(;!HR(e););return e}const JE=/[\0\t\n\r]/g;function nue(){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(JE.lastIndex=f,u=JE.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 rue=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function iue(e){return e.replace(rue,aue)}function aue(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return zR(n.slice(a?2:1),a?16:10)}return z0(n)||e}const XR={}.hasOwnProperty;function sue(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),oue(n)(tue(eue(n).document().write(nue()(e,t,!0))))}function oue(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(et),autolinkProtocol:C,autolinkEmail:C,atxHeading:a(_e),blockQuote:a(ae),characterEscape:C,characterReference:C,codeFenced:a(le),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(le,o),codeText:a(X,o),codeTextData:C,data:C,codeFlowValue:C,definition:a(je),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Ne),hardBreakEscape:a(ge),hardBreakTrailing:a(ge),htmlFlow:a($e,o),htmlFlowData:C,htmlText:a($e,o),htmlTextData:C,image:a(fe),label:o,link:a(et),listItem:a(Ee),listItemValue:h,listOrdered:a(De,f),listUnordered:a(De),paragraph:a(qe),reference:P,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(_e),strong:a(It),thematicBreak:a(Qt)},exit:{atxHeading:c(),atxHeadingSequence:S,autolink:c(),autolinkEmail:Y,autolinkProtocol:G,blockQuote:c(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:be,characterReferenceMarkerNumeric:be,characterReferenceValue:pe,characterReference:Ce,codeFenced:c(v),codeFencedFence:m,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:T,codeIndented:c(y),codeText:c(F),codeTextData:T,data:T,definition:c(),definitionDestinationString:k,definitionLabelString:b,definitionTitleString:w,emphasis:c(),hardBreakEscape:c(M),hardBreakTrailing:c(M),htmlFlow:c(B),htmlFlowData:T,htmlText:c(I),htmlTextData:T,image:c(R),label:U,labelText:O,lineEnding:L,link:c(z),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:oe,resourceDestinationString:A,resourceTitleString:Z,resource:$,setextHeading:c(_),setextHeadingLineSequence:E,setextHeadingText:x,strong:c(),thematicBreak:c()}};ZR(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(W){let V={type:"root",children:[]};const ie={stack:[V],tokenStack:[],config:t,enter:l,exit:u,buffer:o,resume:d,data:n},he=[];let we=-1;for(;++we<W.length;)if(W[we][1].type==="listOrdered"||W[we][1].type==="listUnordered")if(W[we][0]==="enter")he.push(we);else{const He=he.pop();we=i(W,He,we)}for(we=-1;++we<W.length;){const He=t[W[we][0]];XR.call(He,W[we][1].type)&&He[W[we][1].type].call(Object.assign({sliceSerialize:W[we][2].sliceSerialize},ie),W[we][1])}if(ie.tokenStack.length>0){const He=ie.tokenStack[ie.tokenStack.length-1];(He[1]||e_).call(ie,void 0,He[0])}for(V.position={start:Fi(W.length>0?W[0][1].start:{line:1,column:1,offset:0}),end:Fi(W.length>0?W[W.length-2][1].end:{line:1,column:1,offset:0})},we=-1;++we<t.transforms.length;)V=t.transforms[we](V)||V;return V}function i(W,V,ie){let he=V-1,we=-1,He=!1,ln,Tt,Un,wn;for(;++he<=ie;){const Re=W[he];switch(Re[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Re[0]==="enter"?we++:we--,wn=void 0;break}case"lineEndingBlank":{Re[0]==="enter"&&(ln&&!wn&&!we&&!Un&&(Un=he),wn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:wn=void 0}if(!we&&Re[0]==="enter"&&Re[1].type==="listItemPrefix"||we===-1&&Re[0]==="exit"&&(Re[1].type==="listUnordered"||Re[1].type==="listOrdered")){if(ln){let Wn=he;for(Tt=void 0;Wn--;){const $t=W[Wn];if($t[1].type==="lineEnding"||$t[1].type==="lineEndingBlank"){if($t[0]==="exit")continue;Tt&&(W[Tt][1].type="lineEndingBlank",He=!0),$t[1].type="lineEnding",Tt=Wn}else if(!($t[1].type==="linePrefix"||$t[1].type==="blockQuotePrefix"||$t[1].type==="blockQuotePrefixWhitespace"||$t[1].type==="blockQuoteMarker"||$t[1].type==="listItemIndent"))break}Un&&(!Tt||Un<Tt)&&(ln._spread=!0),ln.end=Object.assign({},Tt?W[Tt][1].start:Re[1].end),W.splice(Tt||he,0,["exit",ln,Re[2]]),he++,ie++}if(Re[1].type==="listItemPrefix"){const Wn={type:"listItem",_spread:!1,start:Object.assign({},Re[1].start),end:void 0};ln=Wn,W.splice(he,0,["enter",Wn,Re[2]]),he++,ie++,Un=void 0,wn=!0}}}return W[V][1]._spread=He,ie}function a(W,V){return ie;function ie(he){l.call(this,W(he),he),V&&V.call(this,he)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(W,V,ie){this.stack[this.stack.length-1].children.push(W),this.stack.push(W),this.tokenStack.push([V,ie||void 0]),W.position={start:Fi(V.start),end:void 0}}function c(W){return V;function V(ie){W&&W.call(this,ie),u.call(this,ie)}}function u(W,V){const ie=this.stack.pop(),he=this.tokenStack.pop();if(he)he[0].type!==W.type&&(V?V.call(this,W,he[0]):(he[1]||e_).call(this,W,he[0]));else throw new Error("Cannot close `"+W.type+"` ("+yc({start:W.start,end:W.end})+"): itโ€™s not open");ie.position.end=Fi(W.end)}function d(){return B0(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(W){if(this.data.expectingFirstListItemValue){const V=this.stack[this.stack.length-2];V.start=Number.parseInt(this.sliceSerialize(W),10),this.data.expectingFirstListItemValue=void 0}}function p(){const W=this.resume(),V=this.stack[this.stack.length-1];V.lang=W}function g(){const W=this.resume(),V=this.stack[this.stack.length-1];V.meta=W}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const W=this.resume(),V=this.stack[this.stack.length-1];V.value=W.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const W=this.resume(),V=this.stack[this.stack.length-1];V.value=W.replace(/(\r?\n|\r)$/g,"")}function b(W){const V=this.resume(),ie=this.stack[this.stack.length-1];ie.label=V,ie.identifier=Lr(this.sliceSerialize(W)).toLowerCase()}function w(){const W=this.resume(),V=this.stack[this.stack.length-1];V.title=W}function k(){const W=this.resume(),V=this.stack[this.stack.length-1];V.url=W}function S(W){const V=this.stack[this.stack.length-1];if(!V.depth){const ie=this.sliceSerialize(W).length;V.depth=ie}}function x(){this.data.setextHeadingSlurpLineEnding=!0}function E(W){const V=this.stack[this.stack.length-1];V.depth=this.sliceSerialize(W).codePointAt(0)===61?1:2}function _(){this.data.setextHeadingSlurpLineEnding=void 0}function C(W){const ie=this.stack[this.stack.length-1].children;let he=ie[ie.length-1];(!he||he.type!=="text")&&(he=On(),he.position={start:Fi(W.start),end:void 0},ie.push(he)),this.stack.push(he)}function T(W){const V=this.stack.pop();V.value+=this.sliceSerialize(W),V.position.end=Fi(W.end)}function L(W){const V=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ie=V.children[V.children.length-1];ie.position.end=Fi(W.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(V.type)&&(C.call(this,W),T.call(this,W))}function M(){this.data.atHardBreak=!0}function B(){const W=this.resume(),V=this.stack[this.stack.length-1];V.value=W}function I(){const W=this.resume(),V=this.stack[this.stack.length-1];V.value=W}function F(){const W=this.resume(),V=this.stack[this.stack.length-1];V.value=W}function z(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=V,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function R(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=V,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function O(W){const V=this.sliceSerialize(W),ie=this.stack[this.stack.length-2];ie.label=iue(V),ie.identifier=Lr(V).toLowerCase()}function U(){const W=this.stack[this.stack.length-1],V=this.resume(),ie=this.stack[this.stack.length-1];if(this.data.inReference=!0,ie.type==="link"){const he=W.children;ie.children=he}else ie.alt=V}function A(){const W=this.resume(),V=this.stack[this.stack.length-1];V.url=W}function Z(){const W=this.resume(),V=this.stack[this.stack.length-1];V.title=W}function $(){this.data.inReference=void 0}function P(){this.data.referenceType="collapsed"}function oe(W){const V=this.resume(),ie=this.stack[this.stack.length-1];ie.label=V,ie.identifier=Lr(this.sliceSerialize(W)).toLowerCase(),this.data.referenceType="full"}function be(W){this.data.characterReferenceType=W.type}function pe(W){const V=this.sliceSerialize(W),ie=this.data.characterReferenceType;let he;ie?(he=zR(V,ie==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):he=z0(V);const we=this.stack[this.stack.length-1];we.value+=he}function Ce(W){const V=this.stack.pop();V.position.end=Fi(W.end)}function G(W){T.call(this,W);const V=this.stack[this.stack.length-1];V.url=this.sliceSerialize(W)}function Y(W){T.call(this,W);const V=this.stack[this.stack.length-1];V.url="mailto:"+this.sliceSerialize(W)}function ae(){return{type:"blockquote",children:[]}}function le(){return{type:"code",lang:null,meta:null,value:""}}function X(){return{type:"inlineCode",value:""}}function je(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ne(){return{type:"emphasis",children:[]}}function _e(){return{type:"heading",depth:0,children:[]}}function ge(){return{type:"break"}}function $e(){return{type:"html",value:""}}function fe(){return{type:"image",title:null,url:"",alt:null}}function et(){return{type:"link",title:null,url:"",children:[]}}function De(W){return{type:"list",ordered:W.type==="listOrdered",start:null,spread:W._spread,children:[]}}function Ee(W){return{type:"listItem",spread:W._spread,checked:null,children:[]}}function qe(){return{type:"paragraph",children:[]}}function It(){return{type:"strong",children:[]}}function On(){return{type:"text",value:""}}function Qt(){return{type:"thematicBreak"}}}function Fi(e){return{line:e.line,column:e.column,offset:e.offset}}function ZR(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?ZR(e,r):lue(e,r)}}function lue(e,t){let n;for(n in t)if(XR.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 e_(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+yc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+yc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+yc({start:t.start,end:t.end})+") is still open")}function cue(e){const t=this;t.parser=n;function n(r){return sue(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function uue(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 due(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
168
+ `}]}function fue(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 hue(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pue(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mue(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=yl(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 gue(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 yue(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function QR(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 vue(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return QR(e,t);const i={src:yl(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 bue(e,t){const n={src:yl(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 xue(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 wue(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return QR(e,t);const i={href:yl(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 Sue(e,t){const n={href:yl(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 kue(e,t,n){const r=e.all(t),i=n?Nue(n):JR(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 Nue(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=JR(n[r])}return t}function JR(e){const t=e.spread;return t??e.children.length>1}function Eue(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 _ue(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jue(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Aue(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Cue(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=I0(t.children[1]),c=PR(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 Tue(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 t_=9,n_=32;function Pue(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(r_(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(r_(t.slice(i),i>0,!1)),a.join("")}function r_(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===t_||a===n_;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===t_||a===n_;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Rue(e,t){const n={type:"text",value:Pue(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Mue(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Iue={blockquote:uue,break:due,code:fue,delete:hue,emphasis:pue,footnoteReference:mue,heading:gue,html:yue,imageReference:vue,image:bue,inlineCode:xue,linkReference:wue,link:Sue,listItem:kue,list:Eue,paragraph:_ue,root:jue,strong:Aue,table:Cue,tableCell:Oue,tableRow:Tue,text:Rue,thematicBreak:Mue,toml:Rd,yaml:Rd,definition:Rd,footnoteDefinition:Rd};function Rd(){}const eM=-1,Xp=0,bc=1,Rh=2,U0=3,W0=4,H0=5,G0=6,tM=7,nM=8,rM=typeof self=="object"?self:globalThis,i_=(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 rM[e](t)},$ue=(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 Xp:case eM:return n(o,i);case bc:{const l=n([],i);for(const c of o)l.push(r(c));return l}case Rh:{const l=n({},i);for(const[c,u]of o)l[r(c)]=r(u);return l}case U0:return n(new Date(o),i);case W0:{const{source:l,flags:c}=o;return n(new RegExp(l,c),i)}case H0:{const l=n(new Map,i);for(const[c,u]of o)l.set(r(c),r(u));return l}case G0:{const l=n(new Set,i);for(const c of o)l.add(r(c));return l}case tM:{const{name:l,message:c}=o;return n(typeof rM[l]=="function"?i_(l,c):new Error(c),i)}case nM: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(i_(a,o),i)};return r},a_=e=>$ue(new Map,e)(0),za="",{toString:Lue}={},{keys:Due}=Object,Yl=e=>{const t=typeof e;if(t!=="object"||!e)return[Xp,t];const n=Lue.call(e).slice(8,-1);switch(n){case"Array":return[bc,za];case"Object":return[Rh,za];case"Date":return[U0,za];case"RegExp":return[W0,za];case"Map":return[H0,za];case"Set":return[G0,za];case"DataView":return[bc,n]}return n.includes("Array")?[bc,n]:e instanceof Error?[tM,e.name||"Error"]:[Rh,n]},Md=([e,t])=>e===Xp&&(t==="function"||t==="symbol"),Bue=(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]=Yl(o);switch(l){case Xp:{let d=o;switch(c){case"bigint":l=nM,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return i([eM],o)}return i([l,d],o)}case bc:{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 Rh:{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 Due(o))(e||!Md(Yl(o[h])))&&d.push([a(h),a(o[h])]);return f}case U0:return i([l,isNaN(o.getTime())?za:o.toISOString()],o);case W0:{const{source:d,flags:f}=o;return i([l,{source:d,flags:f}],o)}case H0:{const d=[],f=i([l,d],o);for(const[h,p]of o)(e||!(Md(Yl(h))||Md(Yl(p))))&&d.push([a(h),a(p)]);return f}case G0:{const d=[],f=i([l,d],o);for(const h of o)(e||!Md(Yl(h)))&&d.push(a(h));return f}}const{message:u}=o;return i([l,{name:c,message:u}],o)};return a},s_=(e,{json:t,lossy:n}={})=>{const r=[];return Bue(!(t||n),!!t,new Map,r)(e),r},Mh=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?a_(s_(e,t)):structuredClone(e):(e,t)=>a_(s_(e,t));function zue(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 Fue(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Uue(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||zue,r=e.options.footnoteBackLabel||Fue,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=yl(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:{...Mh(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 zu=function(e){if(e==null)return que;if(typeof e=="function")return Zp(e);if(typeof e=="object")return Array.isArray(e)?Wue(e):Hue(e);if(typeof e=="string")return Gue(e);throw new Error("Expected function, string, or object as test")};function Wue(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=zu(e[n]);return Zp(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function Hue(e){const t=e;return Zp(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function Gue(e){return Zp(t);function t(n){return n&&n.type===e}}function Zp(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 que(){return!0}function Kue(e){return e!==null&&typeof e=="object"&&"type"in e}const iM=[],Vue=!0,yb=!1,Yue="skip";function aM(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=zu(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=iM,g,m,v;if((!t||a(c,u,d[d.length-1]||void 0))&&(p=Xue(n(c,d)),p[0]===yb))return p;if("children"in c&&c.children){const y=c;if(y.children&&p[0]!==Yue)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]===yb)return g;m=typeof g[1]=="number"?g[1]:m+o}}return p}}}function Xue(e){return Array.isArray(e)?e:typeof e=="number"?[Vue,e]:e==null?iM:[e]}function Qp(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),aM(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 vb={}.hasOwnProperty,Zue={};function Que(e,t){const n=t||Zue,r=new Map,i=new Map,a=new Map,o={...Iue,...n.handlers},l={all:u,applyData:ede,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:c,options:n,patch:Jue,wrap:nde};return Qp(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(vb.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=Mh(v);return y.children=l.all(d),y}return Mh(d)}return(l.options.unknownHandler||tde)(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=o_(g.value)),!Array.isArray(g)&&g.type==="element")){const m=g.children[0];m&&m.type==="text"&&(m.value=o_(m.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function Jue(e,t){e.position&&(t.position=Foe(e))}function ede(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,Mh(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function tde(e,t){const n=t.data||{},r="value"in t&&!(vb.call(n,"hProperties")||vb.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 nde(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 o_(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function l_(e,t){const n=Que(e,t),r=n.one(e,void 0),i=Uue(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 rde(e,t){return e&&"run"in e?async function(n,r){const i=l_(n,{file:r,...t});await e.run(i,r)}:function(n,r){return l_(n,{file:r,...e||t})}}function c_(e){if(e)throw e}var rf=Object.prototype.hasOwnProperty,sM=Object.prototype.toString,u_=Object.defineProperty,d_=Object.getOwnPropertyDescriptor,f_=function(t){return typeof Array.isArray=="function"?Array.isArray(t):sM.call(t)==="[object Array]"},h_=function(t){if(!t||sM.call(t)!=="[object Object]")return!1;var n=rf.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&rf.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||rf.call(t,i)},p_=function(t,n){u_&&n.name==="__proto__"?u_(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},m_=function(t,n){if(n==="__proto__")if(rf.call(t,n)){if(d_)return d_(t,n).value}else return;return t[n]},ide=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=m_(l,n),i=m_(t,n),l!==i&&(d&&i&&(h_(i)||(a=f_(i)))?(a?(a=!1,o=r&&f_(r)?r:[]):o=r&&h_(r)?r:{},p_(l,{name:n,newValue:e(d,o,i)})):typeof i<"u"&&p_(l,{name:n,newValue:i}));return l};const _g=Ze(ide);function bb(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 ade(){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?sde(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 sde(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 Vr={basename:ode,dirname:lde,extname:cde,join:ude,sep:"/"};function ode(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Fu(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 lde(e){if(Fu(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 cde(e){Fu(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 ude(...e){let t=-1,n;for(;++t<e.length;)Fu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":dde(n)}function dde(e){Fu(e);const t=e.codePointAt(0)===47;let n=fde(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function fde(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 Fu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const hde={cwd:pde};function pde(){return"/"}function xb(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function mde(e){if(typeof e=="string")e=new URL(e);else if(!xb(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 gde(e)}function gde(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 jg=["history","path","basename","stem","extname","dirname"];class oM{constructor(t){let n;t?xb(t)?n={path:t}:typeof t=="string"||yde(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":hde.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<jg.length;){const a=jg[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)jg.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Vr.basename(this.path):void 0}set basename(t){Cg(t,"basename"),Ag(t,"basename"),this.path=Vr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Vr.dirname(this.path):void 0}set dirname(t){g_(this.basename,"dirname"),this.path=Vr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Vr.extname(this.path):void 0}set extname(t){if(Ag(t,"extname"),g_(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=Vr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){xb(t)&&(t=mde(t)),Cg(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Vr.basename(this.path,this.extname):void 0}set stem(t){Cg(t,"stem"),Ag(t,"stem"),this.path=Vr.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 xn(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 Ag(e,t){if(e&&e.includes(Vr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Vr.sep+"`")}function Cg(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function g_(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function yde(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const vde=function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a},bde={}.hasOwnProperty;class q0 extends vde{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=ade()}copy(){const t=new q0;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(_g(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Pg("data",this.frozen),this.namespace[t]=n,this):bde.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Pg("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=Id(t),r=this.parser||this.Parser;return Tg("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Tg("process",this.parser||this.Parser),Og("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,o){const l=Id(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);Sde(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(),Tg("processSync",this.parser||this.Parser),Og("processSync",this.compiler||this.Compiler),this.process(t,i),v_("processSync","process",n),r;function i(a,o){n=!0,c_(a),r=o}}run(t,n,r){y_(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=Id(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),v_("runSync","run",r),i;function a(o,l){c_(o),i=l,r=!0}}stringify(t,n){this.freeze();const r=Id(n),i=this.compiler||this.Compiler;return Og("stringify",i),y_(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Pg("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=_g(!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];bb(m)&&bb(p)&&(p=_g(!0,m,p)),r[h]=[u,p,...g]}}}}const xde=new q0().freeze();function Tg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Og(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Pg(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 y_(e){if(!bb(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function v_(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Id(e){return wde(e)?e:new oM(e)}function wde(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Sde(e){return typeof e=="string"||kde(e)}function kde(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Nde="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",b_=[],x_={allowDangerousHtml:!0},Ede=/^(https?|ircs?|mailto|xmpp)$/i,_de=[{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 jde(e){const t=Ade(e),n=Cde(e);return Tde(t.runSync(t.parse(n),n),e)}function Ade(e){const t=e.rehypePlugins||b_,n=e.remarkPlugins||b_,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...x_}:x_;return xde().use(cue).use(n).use(rde,r).use(t)}function Cde(e){const t=e.children||"",n=new oM;return typeof t=="string"&&(n.value=t),n}function Tde(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 _de)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Nde+d.id,void 0);return Qp(e,u),qoe(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 kg)if(Object.hasOwn(kg,p)&&Object.hasOwn(d.properties,p)){const g=d.properties[p],m=kg[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||Ede.test(e.slice(0,t))?e:""}function w_(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 Pde(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Rde(e,t,n){const i=zu((n||{}).ignore||[]),a=Mde(t);let o=-1;for(;++o<a.length;)aM(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 w=h.exec(u.value);for(;w;){const k=w.index,S={index:w.index,input:w.input,stack:[...d,u]};let x=p(...w,S);if(typeof x=="string"&&(x=x.length>0?{type:"text",value:x}:void 0),x===!1?h.lastIndex=k+1:(g!==k&&b.push({type:"text",value:u.value.slice(g,k)}),Array.isArray(x)?b.push(...x):x&&b.push(x),g=k+w[0].length,y=!0),!h.global)break;w=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 Mde(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([Ide(i[0]),$de(i[1])])}return t}function Ide(e){return typeof e=="string"?new RegExp(Pde(e),"g"):e}function $de(e){return typeof e=="function"?e:function(){return e}}const Rg="phrasing",Mg=["autolink","link","image","label"];function Lde(){return{transforms:[Hde],enter:{literalAutolink:Bde,literalAutolinkEmail:Ig,literalAutolinkHttp:Ig,literalAutolinkWww:Ig},exit:{literalAutolink:Wde,literalAutolinkEmail:Ude,literalAutolinkHttp:zde,literalAutolinkWww:Fde}}}function Dde(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Rg,notInConstruct:Mg},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Rg,notInConstruct:Mg},{character:":",before:"[ps]",after:"\\/",inConstruct:Rg,notInConstruct:Mg}]}}function Bde(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ig(e){this.config.enter.autolinkProtocol.call(this,e)}function zde(e){this.config.exit.autolinkProtocol.call(this,e)}function Fde(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 Ude(e){this.config.exit.autolinkEmail.call(this,e)}function Wde(e){this.exit(e)}function Hde(e){Rde(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Gde],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),qde]],{ignore:["link","linkReference"]})}function Gde(e,t,n,r,i){let a="";if(!lM(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!Kde(n)))return!1;const o=Vde(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 qde(e,t,n,r){return!lM(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 Vde(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=w_(e,"(");let a=w_(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 lM(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||gs(n)||Vp(n))&&(!t||n!==47)}cM.peek=rfe;function Yde(){this.buffer()}function Xde(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Zde(){this.buffer()}function Qde(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Jde(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Lr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function efe(e){this.exit(e)}function tfe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Lr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function nfe(e){this.exit(e)}function rfe(){return"["}function cM(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 ife(){return{enter:{gfmFootnoteCallString:Yde,gfmFootnoteCall:Xde,gfmFootnoteDefinitionLabelString:Zde,gfmFootnoteDefinition:Qde},exit:{gfmFootnoteCallString:Jde,gfmFootnoteCall:efe,gfmFootnoteDefinitionLabelString:tfe,gfmFootnoteDefinition:nfe}}}function afe(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:cM},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?uM:sfe))),u(),c}}function sfe(e,t,n){return t===0?e:uM(e,t,n)}function uM(e,t,n){return(n?"":" ")+e}const ofe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];dM.peek=ffe;function lfe(){return{canContainEols:["delete"],enter:{strikethrough:ufe},exit:{strikethrough:dfe}}}function cfe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:ofe}],handlers:{delete:dM}}}function ufe(e){this.enter({type:"delete",children:[]},e)}function dfe(e){this.exit(e)}function dM(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 ffe(){return"~"}function hfe(e){return e.length}function pfe(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||hfe,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=mfe(e[d][y]);if(n.alignDelimiters!==!1){const w=i(b);v[y]=w,(c[y]===void 0||w>c[y])&&(c[y]=w)}m.push(b)}o[d]=m,l[d]=v}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)a[f]=S_(r[f]);else{const m=S_(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 w=v+"-".repeat(b)+y;n.alignDelimiters!==!1&&(b=v.length+b+y.length,b>c[f]&&(c[f]=b),p[f]=b),h[f]=w}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 w="",k="";if(n.alignDelimiters!==!1){const S=c[f]-(v[f]||0),x=a[f];x===114?w=" ".repeat(S):x===99?S%2?(w=" ".repeat(S/2+.5),k=" ".repeat(S/2-.5)):(w=" ".repeat(S/2),k=w):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(w),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 mfe(e){return e==null?"":String(e)}function S_(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 gfe(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()),yfe);return i(),o}function yfe(e,t,n){return">"+(n?"":" ")+e}function vfe(e,t){return k_(e,t.inConstruct,!0)&&!k_(e,t.notInConstruct,!1)}function k_(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 N_(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
180
+ `&&vfe(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
181
+ `}function bfe(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 xfe(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 wfe(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 Sfe(e,t,n,r){const i=wfe(n),a=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(xfe(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(a,kfe);return f(),h}const l=n.createTracker(r),c=i.repeat(Math.max(bfe(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 kfe(e,t,n){return(n?"":" ")+e}function K0(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 Nfe(e,t,n,r){const i=K0(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 Efe(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 Su(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Ih(e,t,n){const r=Xo(e),i=Xo(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}}fM.peek=_fe;function fM(e,t,n,r){const i=Efe(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=Ih(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(c=Su(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=Ih(r.after.charCodeAt(0),f,i);h.inside&&(c=c.slice(0,-1)+Su(f));const p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function _fe(e,t,n){return n.options.emphasis||"*"}function jfe(e,t){let n=!1;return Qp(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,yb}),!!((!e.depth||e.depth<3)&&B0(e)&&(t.options.setext||n))}function Afe(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(jfe(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=Su(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),c(),l(),u}hM.peek=Cfe;function hM(e){return e.value||""}function Cfe(){return"<"}pM.peek=Tfe;function pM(e,t,n,r){const i=K0(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 Tfe(){return"!"}mM.peek=Ofe;function mM(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"!"}gM.peek=Pfe;function gM(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 Pfe(){return"`"}function yM(e,t){const n=B0(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))}vM.peek=Rfe;function vM(e,t,n,r){const i=K0(n),a=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,c;if(yM(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 Rfe(e,t,n){return yM(e,n)?"<":"["}bM.peek=Mfe;function bM(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 Mfe(){return"["}function V0(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 Ife(e){const t=V0(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 $fe(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 xM(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 Lfe(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?$fe(n):V0(n);const l=e.ordered?o==="."?")":".":Ife(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),xM(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 Dfe(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 Bfe(e,t,n,r){const i=Dfe(n);let a=n.bulletCurrent||V0(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 zfe(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),i(),o}const Ffe=zu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Ufe(e,t,n,r){return(e.children.some(function(o){return Ffe(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Wfe(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}wM.peek=Hfe;function wM(e,t,n,r){const i=Wfe(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=Ih(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(c=Su(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=Ih(r.after.charCodeAt(0),f,i);h.inside&&(c=c.slice(0,-1)+Su(f));const p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function Hfe(e,t,n){return n.options.strong||"*"}function Gfe(e,t,n,r){return n.safe(e.value,r)}function qfe(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=(xM(n)+(n.options.ruleSpaces?" ":"")).repeat(qfe(n));return n.options.ruleSpaces?r.slice(0,-1):r}const SM={blockquote:gfe,break:N_,code:Sfe,definition:Nfe,emphasis:fM,hardBreak:N_,heading:Afe,html:hM,image:pM,imageReference:mM,inlineCode:gM,link:vM,linkReference:bM,list:Lfe,listItem:Bfe,paragraph:zfe,root:Ufe,strong:wM,text:Gfe,thematicBreak:Kfe};function Vfe(){return{enter:{table:Yfe,tableData:E_,tableHeader:E_,tableRow:Zfe},exit:{codeText:Qfe,table:Xfe,tableData:$g,tableHeader:$g,tableRow:$g}}}function Yfe(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 Xfe(e){this.exit(e),this.data.inTable=void 0}function Zfe(e){this.enter({type:"tableRow",children:[]},e)}function $g(e){this.exit(e)}function E_(e){this.enter({type:"tableCell",children:[]},e)}function Qfe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Jfe));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Jfe(e,t){return t==="|"?t:e}function ehe(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"),w=m.containerPhrasing(p,{...v,before:a,after:a});return b(),y(),w}function u(p,g){return pfe(p,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function d(p,g,m){const v=p.children;let y=-1;const b=[],w=g.enter("table");for(;++y<v.length;)b[y]=f(v[y],g,m);return w(),b}function f(p,g,m){const v=p.children;let y=-1;const b=[],w=g.enter("tableRow");for(;++y<v.length;)b[y]=c(v[y],p,g,m);return w(),b}function h(p,g,m){let v=SM.inlineCode(p,g,m);return m.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function the(){return{exit:{taskListCheckValueChecked:__,taskListCheckValueUnchecked:__,paragraph:rhe}}}function nhe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:ihe}}}function __(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function rhe(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 ihe(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=SM.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 ahe(){return[Lde(),ife(),lfe(),Vfe(),the()]}function she(e){return{extensions:[Dde(),afe(e),cfe(),ehe(e),nhe()]}}const ohe={tokenize:hhe,partial:!0},kM={tokenize:phe,partial:!0},NM={tokenize:mhe,partial:!0},EM={tokenize:ghe,partial:!0},lhe={tokenize:yhe,partial:!0},_M={name:"wwwAutolink",tokenize:dhe,previous:AM},jM={name:"protocolAutolink",tokenize:fhe,previous:CM},$i={name:"emailAutolink",tokenize:uhe,previous:TM},si={};function che(){return{text:si}}let Ra=48;for(;Ra<123;)si[Ra]=$i,Ra++,Ra===58?Ra=65:Ra===91&&(Ra=97);si[43]=$i;si[45]=$i;si[46]=$i;si[95]=$i;si[72]=[$i,jM];si[104]=[$i,jM];si[87]=[$i,_M];si[119]=[$i,_M];function uhe(e,t,n){const r=this;let i,a;return o;function o(f){return!wb(f)||!TM.call(r,r.previous)||Y0(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(f))}function l(f){return wb(f)?(e.consume(f),l):f===64?(e.consume(f),c):n(f)}function c(f){return f===46?e.check(lhe,d,u)(f):f===45||f===95||vn(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&&_n(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function dhe(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!AM.call(r,r.previous)||Y0(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(ohe,e.attempt(kM,e.attempt(NM,a),n),n)(o))}function a(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function fhe(e,t,n){const r=this;let i="",a=!1;return o;function o(f){return(f===72||f===104)&&CM.call(r,r.previous)&&!Y0(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),l):n(f)}function l(f){if(_n(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||Ph(f)||ot(f)||gs(f)||Vp(f)?n(f):e.attempt(kM,e.attempt(NM,d),n)(f)}function d(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function hhe(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 phe(e,t,n){let r,i,a;return o;function o(u){return u===46||u===95?e.check(EM,c,l)(u):u===null||ot(u)||gs(u)||u!==45&&Vp(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 mhe(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(EM,t,a)(o):o===null||ot(o)||gs(o)?t(o):(e.consume(o),i)}function a(o){return o===41&&r++,e.consume(o),i}}function ghe(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||ot(l)||gs(l)?t(l):n(l)}function i(l){return l===null||l===40||l===91||ot(l)||gs(l)?t(l):r(l)}function a(l){return _n(l)?o(l):n(l)}function o(l){return l===59?(e.consume(l),r):_n(l)?(e.consume(l),o):n(l)}}function yhe(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return vn(a)?n(a):t(a)}}function AM(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ot(e)}function CM(e){return!_n(e)}function TM(e){return!(e===47||wb(e))}function wb(e){return e===43||e===45||e===46||e===95||vn(e)}function Y0(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 vhe={tokenize:_he,partial:!0};function bhe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:khe,continuation:{tokenize:Nhe},exit:Ehe}},text:{91:{name:"gfmFootnoteCall",tokenize:She},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:xhe,resolveTo:whe}}}}function xhe(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=Lr(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 whe(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 She(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||ot(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Lr(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return ot(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 khe(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||ot(g))return n(g);if(g===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return a=Lr(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return ot(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 Nhe(e,t,n){return e.check(Bu,t,e.attempt(vhe,t,n))}function Ehe(e){e.exit("gfmFootnoteDefinition")}function _he(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 jhe(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&&tr(h,h.length,0,Yp(p,o.slice(u+1,c),l)),tr(h,h.length,0,[["exit",f,l],["enter",o[c][1],l],["exit",o[c][1],l],["exit",d,l]]),tr(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=Xo(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=Xo(g);return v._open=!y||y===2&&!!m,v._close=!m||m===2&&!!y,l(g)}}}class Ahe{constructor(){this.map=[]}add(t,n,r){Che(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 Che(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 The(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:Phe,resolveAll:Rhe}}}}function Phe(e,t,n){const r=this;let i=0,a=0,o;return l;function l(T){let L=r.events.length-1;for(;L>-1;){const I=r.events[L][1].type;if(I==="lineEnding"||I==="linePrefix")L--;else break}const M=L>-1?r.events[L][1].type:null,B=M==="tableHead"||M==="tableRow"?x:c;return B===x&&r.parser.lazy[r.now().line]?n(T):B(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):Ae(T)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),p):n(T):Be(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||ot(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,Be(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 Be(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||Ae(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"),w):(e.exit("tableDelimiterFiller"),w(T))}function w(T){return Be(T)?Ue(e,k,"whitespace")(T):k(T)}function k(T){return T===124?g(T):T===null||Ae(T)?!o||i!==a?S(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):S(T)}function S(T){return n(T)}function x(T){return e.enter("tableRow"),E(T)}function E(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),E):T===null||Ae(T)?(e.exit("tableRow"),t(T)):Be(T)?Ue(e,E,"whitespace")(T):(e.enter("data"),_(T))}function _(T){return T===null||T===124||ot(T)?(e.exit("data"),E(T)):(e.consume(T),T===92?C:_)}function C(T){return T===92||T===124?(e.consume(T),_):_(T)}}function Rhe(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 Ahe;for(;++n<e.length;){const p=e[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(l=!1,c!==0&&(j_(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=$d(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=$d(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=$d(h,t,a,i,n,f)):o[1]!==0&&(f=$d(h,t,o,i,n,f)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(o[3]=n)}for(c!==0&&j_(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=The(t.events,n))}return e}function $d(e,t,n,r,i,a){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(a.end=Object.assign({},Hs(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const c=Hs(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=Hs(t.events,n[2]),d=Hs(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({},Hs(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function j_(e,t,n,r,i){const a=[],o=Hs(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 Hs(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Mhe={name:"tasklistCheck",tokenize:$he};function Ihe(){return{text:{91:Mhe}}}function $he(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 ot(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 Ae(c)?t(c):Be(c)?e.check({tokenize:Lhe},t,n)(c):n(c)}}function Lhe(e,t,n){return Ue(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function Dhe(e){return BR([che(),bhe(),jhe(e),Ohe(),Ihe()])}const Bhe={};function zhe(e){const t=this,n=e||Bhe,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Dhe(n)),a.push(ahe()),o.push(she(n))}const A_=function(e,t,n){const r=zu(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]},Ns=function(e){if(e==null)return Whe;if(typeof e=="string")return Uhe(e);if(typeof e=="object")return Fhe(e);if(typeof e=="function")return X0(e);throw new Error("Expected function, string, or array as `test`")};function Fhe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ns(e[n]);return X0(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function Uhe(e){return X0(t);function t(n){return n.tagName===e}}function X0(e){return t;function t(n,r,i){return!!(Hhe(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Whe(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function Hhe(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const C_=/\n/g,T_=/[\t ]+/g,Sb=Ns("br"),O_=Ns(Qhe),Ghe=Ns("p"),P_=Ns("tr"),qhe=Ns(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",Zhe,Jhe]),OM=Ns(["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=OM(e),a=MM(e,{whitespace:n.whitespace||"normal"}),o=[];(e.type==="text"||e.type==="comment")&&o.push(...RM(e,{breakBefore:!0,breakAfter:!0}));let l=-1;for(;++l<r.length;)o.push(...PM(r[l],e,{whitespace:a,breakBefore:l?void 0:i,breakAfter:l<r.length-1?Sb(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 PM(e,t,n){return e.type==="element"?Vhe(e,t,n):e.type==="text"?n.whitespace==="normal"?RM(e,n):Yhe(e):[]}function Vhe(e,t,n){const r=MM(e,n),i=e.children||[];let a=-1,o=[];if(qhe(e))return o;let l,c;for(Sb(e)||P_(e)&&A_(t,e,P_)?c=`
194
+ `:Ghe(e)?(l=2,c=2):OM(e)&&(l=1,c=1);++a<i.length;)o=o.concat(PM(i[a],e,{whitespace:r,breakBefore:a?void 0:l,breakAfter:a<i.length-1?Sb(i[a+1]):c}));return O_(e)&&A_(t,e,O_)&&o.push(" "),l&&o.unshift(l),c&&o.push(c),o}function RM(e,t){const n=String(e.value),r=[],i=[];let a=0;for(;a<=n.length;){C_.lastIndex=a;const c=C_.exec(n),u=c&&"index"in c?c.index:n.length;r.push(Xhe(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 Yhe(e){return[String(e.value)]}function Xhe(e,t,n){const r=[];let i=0,a;for(;i<e.length;){T_.lastIndex=i;const o=T_.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 MM(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 Zhe(e){return!!(e.properties||{}).hidden}function Qhe(e){return e.tagName==="td"||e.tagName==="th"}function Jhe(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function epe(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*\(/))},x=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:k,contains:x.concat([{begin:/\(/,end:/\)/,keywords:k,contains:x.concat(["self"]),relevance:0}]),relevance:0},_={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(E,_,S,x,[f,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords: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 tpe(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=epe(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 npe(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"],w=["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,...w,"set","shopt",...k,...S]},contains:[p,e.SHEBANG(),g,f,a,o,y,l,c,u,d,n]}}function rpe(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},w={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,w,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 ipe(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*\(/))},x=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:k,contains:x.concat([{begin:/\(/,end:/\)/,keywords:k,contains:x.concat(["self"]),relevance:0}]),relevance:0},_={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(E,_,S,x,[f,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords: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 ape(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]},w=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:"("+w+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,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 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(),dpe=["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(),fpe=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),hpe=["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 ppe(e){const t=e.regex,n=spe(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:":("+dpe.join("|")+")"},{begin:":(:)?("+fpe.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+hpe.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:upe.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+cpe.join("|")+")\\b"}]}}function mpe(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 gpe(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 ype(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 vpe(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 Gs="[0-9](_*[0-9])*",Ld=`\\.(${Gs})`,Dd="[0-9a-fA-F](_*[0-9a-fA-F])*",R_={className:"number",variants:[{begin:`(\\b(${Gs})((${Ld})|\\.)?|(${Ld}))[eE][+-]?(${Gs})[fFdD]?\\b`},{begin:`\\b(${Gs})((${Ld})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Ld})[fFdD]?\\b`},{begin:`\\b(${Gs})[fFdD]\\b`},{begin:`\\b0[xX]((${Dd})\\.?|(${Dd})?\\.(${Dd}))[pP][+-]?(${Gs})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Dd})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function IM(e,t,n){return n===-1?"":e.replace(t,r=>IM(e,t,n-1))}function bpe(e){const t=e.regex,n="[ร€-สธa-zA-Z_$][ร€-สธa-zA-Z_$0-9]*",r=n+IM("(?:<"+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,R_,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},R_,u]}}const M_="[A-Za-z$_][0-9A-Za-z$_]*",xpe=["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"],wpe=["true","false","null","undefined","NaN","Infinity"],$M=["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"],LM=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],DM=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Spe=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],kpe=[].concat(DM,$M,LM);function Npe(e){const t=e.regex,n=(O,{after:U})=>{const A="</"+O[0].slice(1);return O.input.indexOf(A,U)!==-1},r=M_,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,U)=>{const A=O[0].length+O.index,Z=O.input[A];if(Z==="<"||Z===","){U.ignoreMatch();return}Z===">"&&(n(O,{after:A})||U.ignoreMatch());let $;const P=O.input.substring(A);if($=P.match(/^\s*=/)){U.ignoreMatch();return}if(($=P.match(/^\s+extends\s+/))&&$.index===0){U.ignoreMatch();return}}},l={$pattern:M_,keyword:xpe,literal:wpe,built_in:kpe,"variable.language":Spe},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]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,v,{match:/\$\d+/},f];h.contains=w.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(w)});const k=[].concat(b,h.contains),S=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(k)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},E={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"}}]},_={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:{_:[...$M,...LM]}},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:[x],illegal:/%/},L={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function M(O){return t.concat("(?!",O.join("|"),")")}const B={match:t.concat(/\b/,M([...DM,"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},F={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",R={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:_},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,_,{scope:"attr",match:r+t.lookahead(":"),relevance:0},R,{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:z,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:[x,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:[x]},B,L,E,F,{match:/\$[(.]/}]}}const Epe="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",_pe={scope:"number",match:Epe,relevance:0};function jpe(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,_pe,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var qs="[0-9](_*[0-9])*",Bd=`\\.(${qs})`,zd="[0-9a-fA-F](_*[0-9a-fA-F])*",Ape={className:"number",variants:[{begin:`(\\b(${qs})((${Bd})|\\.)?|(${Bd}))[eE][+-]?(${qs})[fFdD]?\\b`},{begin:`\\b(${qs})((${Bd})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Bd})[fFdD]?\\b`},{begin:`\\b(${qs})[fFdD]\\b`},{begin:`\\b0[xX]((${zd})\\.?|(${zd})?\\.(${zd}))[pP][+-]?(${qs})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${zd})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Cpe(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=Ape,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 Tpe=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"],Ppe=["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"],Rpe=[...Ope,...Ppe],Mpe=["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(),BM=["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(),zM=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Ipe=["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(),$pe=BM.concat(zM).sort().reverse();function Lpe(e){const t=Tpe(e),n=$pe,r="and or not only",i="[\\w-]+",a="("+i+"|@\\{"+i+"\\})",o=[],l=[],c=function(w){return{className:"string",begin:"~?"+w+".*?"+w}},u=function(w,k,S){return{className:w,begin:k,relevance:S}},d={$pattern:/[a-z-]+/,keyword:r,attribute:Mpe.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("+Ipe.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("+Rpe.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:":("+BM.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+zM.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 Dpe(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 Bpe(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 zpe(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 Fpe(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 Upe(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 Wpe(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,F)=>{F.data._beginMatch=I[1]||I[2]},"on:end":(I,F)=>{F.data._beginMatch!==I[1]&&F.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 F=[];return I.forEach(z=>{F.push(z),z.toLowerCase()===z?F.push(z.toUpperCase()):F.push(z.toLowerCase())}),F})(v),built_in:b},S=I=>I.map(F=>F.replace(/\|\d+$/,"")),x={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",S(b).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},E=t.concat(r,"\\b(?!\\()"),_={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),E],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),E],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,_,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,g,m,x]},L={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(L);const M=[C,_,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,g,m,x],B={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",...M]},...M,{scope:"meta",variants:[{match:i},{match:a}]}]};return{case_insensitive:!1,keywords:k,contains:[B,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},o,L,_,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},x,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:k,contains:["self",B,o,_,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 Hpe(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 Gpe(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function qpe(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 Vpe(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 Ype(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}]},x=[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=x,m.contains=x;const T=[{begin:/^\s*=>/,starts:{end:"$",contains:x}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:x}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(T).concat(u).concat(x)}}function Xpe(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 Zpe=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_-]*/}}),Qpe=["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"],Jpe=["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"],eme=[...Qpe,...Jpe],tme=["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(),nme=["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(),rme=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),ime=["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 ame(e){const t=Zpe(e),n=rme,r=nme,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("+eme.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("+ime.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:tme.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 sme(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function ome(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(x=>x.replace(/\s+/,"\\s+"))),/\b/)}const w={scope:"keyword",match:b(h),relevance:0};function k(S,{exceptions:x,when:E}={}){const _=E;return x=x||[],S.map(C=>C.match(/\|\d+$/)||x.includes(C)?C:_(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)},w,y,m,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function FM(e){return e?typeof e=="string"?e:e.source:null}function Xl(e){return nt("(?=",e,")")}function nt(...e){return e.map(n=>FM(n)).join("")}function lme(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Nn(...e){return"("+(lme(e).capture?"":"?:")+e.map(r=>FM(r)).join("|")+")"}const Z0=e=>nt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),cme=["Protocol","Type"].map(Z0),I_=["init","self"].map(Z0),ume=["Any","Self"],Lg=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],$_=["false","nil","true"],dme=["assignment","associativity","higherThan","left","lowerThan","none","right"],fme=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],L_=["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"],UM=Nn(/[/=\-+!*%<>&|^~?]/,/[\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]/),WM=Nn(UM,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Dg=nt(UM,WM,"*"),HM=Nn(/[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]/),$h=Nn(HM,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),qr=nt(HM,$h,"*"),Fd=nt(/[A-Z]/,$h,"*"),hme=["attached","autoclosure",nt(/convention\(/,Nn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",nt(/objc\(/,qr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],pme=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function mme(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,Nn(...cme,...I_)],className:{2:"keyword"}},a={match:nt(/\./,Nn(...Lg)),relevance:0},o=Lg.filter(ge=>typeof ge=="string").concat(["_|0"]),l=Lg.filter(ge=>typeof ge!="string").concat(ume).map(Z0),c={variants:[{className:"keyword",match:Nn(...l,...I_)}]},u={$pattern:Nn(/\b\w+/,/#\w+/),keyword:o.concat(fme),literal:$_},d=[i,a,c],f={match:nt(/\./,Nn(...L_)),relevance:0},h={className:"built_in",match:nt(/\b/,Nn(...L_),/(?=\()/)},p=[f,h],g={match:/->/,relevance:0},m={className:"operator",relevance:0,variants:[{match:Dg},{match:`\\.(\\.|${WM})+`}]},v=[g,m],y="([0-9]_*)+",b="([0-9a-fA-F]_*)+",w={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)/)}),x=(ge="")=>({className:"subst",label:"interpol",begin:nt(/\\/,ge,/\(/),end:/\)/}),E=(ge="")=>({begin:nt(ge,/"""/),end:nt(/"""/,ge),contains:[k(ge),S(ge),x(ge)]}),_=(ge="")=>({begin:nt(ge,/"/),end:nt(/"/,ge),contains:[k(ge),x(ge)]}),C={className:"string",variants:[E(),E("#"),E("##"),E("###"),_(),_("#"),_("##"),_("###")]},T=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],L={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:T},M=ge=>{const $e=nt(ge,/\//),fe=nt(/\//,ge);return{begin:$e,end:fe,contains:[...T,{scope:"comment",begin:`#(?!.*${fe})`,end:/$/}]}},B={scope:"regexp",variants:[M("###"),M("##"),M("#"),L]},I={match:nt(/`/,qr,/`/)},F={className:"variable",match:/\$\d+/},z={className:"variable",match:`\\$${$h}+`},R=[I,F,z],O={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:pme,contains:[...v,w,C]}]}},U={scope:"keyword",match:nt(/@/,Nn(...hme),Xl(Nn(/\(/,/\s+/)))},A={scope:"meta",match:nt(/@/,qr)},Z=[O,U,A],$={match:Xl(/\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)/,$h,"+")},{className:"type",match:Fd,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:nt(/\s+&\s+/,Xl(Fd)),relevance:0}]},P={begin:/</,end:/>/,keywords:u,contains:[...r,...d,...Z,g,$]};$.contains.push(P);const oe={match:nt(qr,/\s*:/),keywords:"_|0",relevance:0},be={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",oe,...r,B,...d,...p,...v,w,C,...R,...Z,$]},pe={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,$]},Ce={begin:Nn(Xl(nt(qr,/\s*:/)),Xl(nt(qr,/\s+/,qr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:qr}]},G={begin:/\(/,end:/\)/,keywords:u,contains:[Ce,...r,...d,...v,w,C,...Z,$,be],endsParent:!0,illegal:/["']/},Y={match:[/(func|macro)/,/\s+/,Nn(I.match,qr,Dg)],className:{1:"keyword",3:"title.function"},contains:[pe,G,t],illegal:[/\[/,/%/]},ae={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[pe,G,t],illegal:/\[|%/},le={match:[/operator/,/\s+/,Dg],className:{1:"keyword",3:"title"}},X={begin:[/precedencegroup/,/\s+/,Fd],className:{1:"keyword",3:"title"},contains:[$],keywords:[...dme,...$_],end:/}/},je={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ne={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},_e={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,qr,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[pe,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:Fd},...d],relevance:0}]};for(const ge of C.variants){const $e=ge.contains.find(et=>et.label==="interpol");$e.keywords=u;const fe=[...d,...p,...v,w,C,...R];$e.contains=[...fe,{begin:/\(/,end:/\)/,contains:["self",...fe]}]}return{name:"Swift",keywords:u,contains:[...r,Y,ae,je,Ne,_e,le,X,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},B,...d,...p,...v,w,C,...R,...Z,$,be]}}const Lh="[A-Za-z$_][0-9A-Za-z$_]*",GM=["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"],qM=["true","false","null","undefined","NaN","Infinity"],KM=["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"],VM=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],YM=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],XM=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ZM=[].concat(YM,KM,VM);function gme(e){const t=e.regex,n=(O,{after:U})=>{const A="</"+O[0].slice(1);return O.input.indexOf(A,U)!==-1},r=Lh,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,U)=>{const A=O[0].length+O.index,Z=O.input[A];if(Z==="<"||Z===","){U.ignoreMatch();return}Z===">"&&(n(O,{after:A})||U.ignoreMatch());let $;const P=O.input.substring(A);if($=P.match(/^\s*=/)){U.ignoreMatch();return}if(($=P.match(/^\s+extends\s+/))&&$.index===0){U.ignoreMatch();return}}},l={$pattern:Lh,keyword:GM,literal:qM,built_in:ZM,"variable.language":XM},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]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,v,{match:/\$\d+/},f];h.contains=w.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(w)});const k=[].concat(b,h.contains),S=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(k)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},E={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"}}]},_={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:{_:[...KM,...VM]}},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:[x],illegal:/%/},L={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function M(O){return t.concat("(?!",O.join("|"),")")}const B={match:t.concat(/\b/,M([...YM,"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},F={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",R={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:_},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,_,{scope:"attr",match:r+t.lookahead(":"),relevance:0},R,{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:z,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:[x,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:[x]},B,L,E,F,{match:/\$[(.]/}]}}function yme(e){const t=e.regex,n=gme(e),r=Lh,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:Lh,keyword:GM.concat(c),literal:qM,built_in:ZM.concat(i),"variable.language":XM},d={className:"meta",begin:"@"+r},f=(m,v,y)=>{const b=m.contains.findIndex(w=>w.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 vme(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 bme(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 xme(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 wme(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 Sme={arduino:tpe,bash:npe,c:rpe,cpp:ipe,csharp:ape,css:ppe,diff:mpe,go:gpe,graphql:ype,ini:vpe,java:bpe,javascript:Npe,json:jpe,kotlin:Cpe,less:Lpe,lua:Dpe,makefile:Bpe,markdown:zpe,objectivec:Fpe,perl:Upe,php:Wpe,"php-template":Hpe,plaintext:Gpe,python:qpe,"python-repl":Kpe,r:Vpe,ruby:Ype,rust:Xpe,scss:ame,shell:sme,sql:ome,swift:mme,typescript:yme,vbnet:vme,wasm:bme,xml:xme,yaml:wme};function QM(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)&&QM(n)}),e}class D_{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function JM(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function ea(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 kme="</span>",B_=e=>!!e.scope,Nme=(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 Eme{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=JM(t)}openNode(t){if(!B_(t))return;const n=Nme(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){B_(t)&&(this.buffer+=kme)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const z_=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class Q0{constructor(){this.rootNode=z_(),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=z_({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=>{Q0._collapse(n)}))}}class _me extends Q0{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 Eme(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function ku(e){return e?typeof e=="string"?e:e.source:null}function e2(e){return Es("(?=",e,")")}function jme(e){return Es("(?:",e,")*")}function Ame(e){return Es("(?:",e,")?")}function Es(...e){return e.map(n=>ku(n)).join("")}function Cme(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function J0(...e){return"("+(Cme(e).capture?"":"?:")+e.map(r=>ku(r)).join("|")+")"}function t2(e){return new RegExp(e.toString()+"|").exec("").length-1}function Tme(e,t){const n=e&&e.exec(t);return n&&n.index===0}const Ome=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function ew(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const i=n;let a=ku(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 Pme=/\b\B/,n2="[a-zA-Z]\\w*",tw="[a-zA-Z_]\\w*",r2="\\b\\d+(\\.\\d+)?",i2="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",a2="\\b(0b[01]+)",Rme="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Mme=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Es(t,/.*\b/,e.binary,/\b.*/)),ea({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Nu={begin:"\\\\[\\s\\S]",relevance:0},Ime={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Nu]},$me={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Nu]},Lme={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/},Jp=function(e,t,n={}){const r=ea({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=J0("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:Es(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},Dme=Jp("//","$"),Bme=Jp("/\\*","\\*/"),zme=Jp("#","$"),Fme={scope:"number",begin:r2,relevance:0},Ume={scope:"number",begin:i2,relevance:0},Wme={scope:"number",begin:a2,relevance:0},Hme={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Nu,{begin:/\[/,end:/\]/,relevance:0,contains:[Nu]}]},Gme={scope:"title",begin:n2,relevance:0},qme={scope:"title",begin:tw,relevance:0},Kme={begin:"\\.\\s*"+tw,relevance:0},Vme=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 Ud=Object.freeze({__proto__:null,APOS_STRING_MODE:Ime,BACKSLASH_ESCAPE:Nu,BINARY_NUMBER_MODE:Wme,BINARY_NUMBER_RE:a2,COMMENT:Jp,C_BLOCK_COMMENT_MODE:Bme,C_LINE_COMMENT_MODE:Dme,C_NUMBER_MODE:Ume,C_NUMBER_RE:i2,END_SAME_AS_BEGIN:Vme,HASH_COMMENT_MODE:zme,IDENT_RE:n2,MATCH_NOTHING_RE:Pme,METHOD_GUARD:Kme,NUMBER_MODE:Fme,NUMBER_RE:r2,PHRASAL_WORDS_MODE:Lme,QUOTE_STRING_MODE:$me,REGEXP_MODE:Hme,RE_STARTERS_RE:Rme,SHEBANG:Mme,TITLE_MODE:Gme,UNDERSCORE_IDENT_RE:tw,UNDERSCORE_TITLE_MODE:qme});function Yme(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function Xme(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function Zme(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Yme,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Qme(e,t){Array.isArray(e.illegal)&&(e.illegal=J0(...e.illegal))}function Jme(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 ege(e,t){e.relevance===void 0&&(e.relevance=1)}const tge=(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=Es(n.beforeMatch,e2(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},nge=["of","and","for","in","not","or","if","then","parent","list","value"],rge="keyword";function s2(e,t,n=rge){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,s2(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,ige(c[0],c[1])]})}}function ige(e,t){return t?Number(t):age(e)?0:1}function age(e){return nge.includes(e.toLowerCase())}const F_={},as=e=>{console.error(e)},U_=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Ws=(e,t)=>{F_[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),F_[`${e}/${t}`]=!0)},Dh=new Error;function o2(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+=t2(t[l-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function sge(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw as("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Dh;if(typeof e.beginScope!="object"||e.beginScope===null)throw as("beginScope must be object"),Dh;o2(e,e.begin,{key:"beginScope"}),e.begin=ew(e.begin,{joinWith:""})}}function oge(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw as("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Dh;if(typeof e.endScope!="object"||e.endScope===null)throw as("endScope must be object"),Dh;o2(e,e.end,{key:"endScope"}),e.end=ew(e.end,{joinWith:""})}}function lge(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function cge(e){lge(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),sge(e),oge(e)}function uge(e){function t(o,l){return new RegExp(ku(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+=t2(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(ew(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;[Xme,Jme,cge,tge].forEach(d=>d(o,l)),e.compilerExtensions.forEach(d=>d(o,l)),o.__beforeBegin=null,[Zme,Qme,ege].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=s2(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=ku(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 dge(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=ea(e.classNameAliases||{}),a(e)}function l2(e){return e?e.endsWithParent||l2(e.starts):!1}function dge(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return ea(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:l2(e)?ea(e,{starts:e.starts?ea(e.starts):null}):Object.isFrozen(e)?ea(e):e}var fge="11.11.2";class hge extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const Bg=JM,W_=ea,H_=Symbol("nomatch"),pge=7,c2=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:_me};function c(z){return l.noHighlightRe.test(z)}function u(z){let R=z.className+" ";R+=z.parentNode?z.parentNode.className:"";const O=l.languageDetectRe.exec(R);if(O){const U=_(O[1]);return U||(U_(a.replace("{}",O[1])),U_("Falling back to no-highlight mode for this block.",z)),U?O[1]:"no-highlight"}return R.split(/\s+/).find(U=>c(U)||_(U))}function d(z,R,O){let U="",A="";typeof R=="object"?(U=z,O=R.ignoreIllegals,A=R.language):(Ws("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ws("10.7.0",`Please use highlight(code, options) instead.
197
+ https://github.com/highlightjs/highlight.js/issues/2277`),A=z,U=R),O===void 0&&(O=!0);const Z={code:U,language:A};I("before:highlight",Z);const $=Z.result?Z.result:f(Z.language,Z.code,O);return $.code=Z.code,I("after:highlight",$),$}function f(z,R,O,U){const A=Object.create(null);function Z(W,V){return W.keywords[V]}function $(){if(!fe.keywords){De.addText(Ee);return}let W=0;fe.keywordPatternRe.lastIndex=0;let V=fe.keywordPatternRe.exec(Ee),ie="";for(;V;){ie+=Ee.substring(W,V.index);const he=_e.case_insensitive?V[0].toLowerCase():V[0],we=Z(fe,he);if(we){const[He,ln]=we;if(De.addText(ie),ie="",A[he]=(A[he]||0)+1,A[he]<=pge&&(qe+=ln),He.startsWith("_"))ie+=V[0];else{const Tt=_e.classNameAliases[He]||He;be(V[0],Tt)}}else ie+=V[0];W=fe.keywordPatternRe.lastIndex,V=fe.keywordPatternRe.exec(Ee)}ie+=Ee.substring(W),De.addText(ie)}function P(){if(Ee==="")return;let W=null;if(typeof fe.subLanguage=="string"){if(!t[fe.subLanguage]){De.addText(Ee);return}W=f(fe.subLanguage,Ee,!0,et[fe.subLanguage]),et[fe.subLanguage]=W._top}else W=p(Ee,fe.subLanguage.length?fe.subLanguage:null);fe.relevance>0&&(qe+=W.relevance),De.__addSublanguage(W._emitter,W.language)}function oe(){fe.subLanguage!=null?P():$(),Ee=""}function be(W,V){W!==""&&(De.startScope(V),De.addText(W),De.endScope())}function pe(W,V){let ie=1;const he=V.length-1;for(;ie<=he;){if(!W._emit[ie]){ie++;continue}const we=_e.classNameAliases[W[ie]]||W[ie],He=V[ie];we?be(He,we):(Ee=He,$(),Ee=""),ie++}}function Ce(W,V){return W.scope&&typeof W.scope=="string"&&De.openNode(_e.classNameAliases[W.scope]||W.scope),W.beginScope&&(W.beginScope._wrap?(be(Ee,_e.classNameAliases[W.beginScope._wrap]||W.beginScope._wrap),Ee=""):W.beginScope._multi&&(pe(W.beginScope,V),Ee="")),fe=Object.create(W,{parent:{value:fe}}),fe}function G(W,V,ie){let he=Tme(W.endRe,ie);if(he){if(W["on:end"]){const we=new D_(W);W["on:end"](V,we),we.isMatchIgnored&&(he=!1)}if(he){for(;W.endsParent&&W.parent;)W=W.parent;return W}}if(W.endsWithParent)return G(W.parent,V,ie)}function Y(W){return fe.matcher.regexIndex===0?(Ee+=W[0],1):(Qt=!0,0)}function ae(W){const V=W[0],ie=W.rule,he=new D_(ie),we=[ie.__beforeBegin,ie["on:begin"]];for(const He of we)if(He&&(He(W,he),he.isMatchIgnored))return Y(V);return ie.skip?Ee+=V:(ie.excludeBegin&&(Ee+=V),oe(),!ie.returnBegin&&!ie.excludeBegin&&(Ee=V)),Ce(ie,W),ie.returnBegin?0:V.length}function le(W){const V=W[0],ie=R.substring(W.index),he=G(fe,W,ie);if(!he)return H_;const we=fe;fe.endScope&&fe.endScope._wrap?(oe(),be(V,fe.endScope._wrap)):fe.endScope&&fe.endScope._multi?(oe(),pe(fe.endScope,W)):we.skip?Ee+=V:(we.returnEnd||we.excludeEnd||(Ee+=V),oe(),we.excludeEnd&&(Ee=V));do fe.scope&&De.closeNode(),!fe.skip&&!fe.subLanguage&&(qe+=fe.relevance),fe=fe.parent;while(fe!==he.parent);return he.starts&&Ce(he.starts,W),we.returnEnd?0:V.length}function X(){const W=[];for(let V=fe;V!==_e;V=V.parent)V.scope&&W.unshift(V.scope);W.forEach(V=>De.openNode(V))}let je={};function Ne(W,V){const ie=V&&V[0];if(Ee+=W,ie==null)return oe(),0;if(je.type==="begin"&&V.type==="end"&&je.index===V.index&&ie===""){if(Ee+=R.slice(V.index,V.index+1),!i){const he=new Error(`0 width match regex (${z})`);throw he.languageName=z,he.badRule=je.rule,he}return 1}if(je=V,V.type==="begin")return ae(V);if(V.type==="illegal"&&!O){const he=new Error('Illegal lexeme "'+ie+'" for mode "'+(fe.scope||"<unnamed>")+'"');throw he.mode=fe,he}else if(V.type==="end"){const he=le(V);if(he!==H_)return he}if(V.type==="illegal"&&ie==="")return V.index===R.length||(Ee+=`
198
+ `),1;if(On>1e5&&On>V.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ee+=ie,ie.length}const _e=_(z);if(!_e)throw as(a.replace("{}",z)),new Error('Unknown language: "'+z+'"');const ge=uge(_e);let $e="",fe=U||ge;const et={},De=new l.__emitter(l);X();let Ee="",qe=0,It=0,On=0,Qt=!1;try{if(_e.__emitTokens)_e.__emitTokens(R,De);else{for(fe.matcher.considerAll();;){On++,Qt?Qt=!1:fe.matcher.considerAll(),fe.matcher.lastIndex=It;const W=fe.matcher.exec(R);if(!W)break;const V=R.substring(It,W.index),ie=Ne(V,W);It=W.index+ie}Ne(R.substring(It))}return De.finalize(),$e=De.toHTML(),{language:z,value:$e,relevance:qe,illegal:!1,_emitter:De,_top:fe}}catch(W){if(W.message&&W.message.includes("Illegal"))return{language:z,value:Bg(R),illegal:!0,relevance:0,_illegalBy:{message:W.message,index:It,context:R.slice(It-100,It+100),mode:W.mode,resultSoFar:$e},_emitter:De};if(i)return{language:z,value:Bg(R),illegal:!1,relevance:0,errorRaised:W,_emitter:De,_top:fe};throw W}}function h(z){const R={value:Bg(z),illegal:!1,relevance:0,_top:o,_emitter:new l.__emitter(l)};return R._emitter.addText(z),R}function p(z,R){R=R||l.languages||Object.keys(t);const O=h(z),U=R.filter(_).filter(T).map(oe=>f(oe,z,!1));U.unshift(O);const A=U.sort((oe,be)=>{if(oe.relevance!==be.relevance)return be.relevance-oe.relevance;if(oe.language&&be.language){if(_(oe.language).supersetOf===be.language)return 1;if(_(be.language).supersetOf===oe.language)return-1}return 0}),[Z,$]=A,P=Z;return P.secondBest=$,P}function g(z,R,O){const U=R&&n[R]||O;z.classList.add("hljs"),z.classList.add(`language-${U}`)}function m(z){let R=null;const O=u(z);if(c(O))return;if(I("before:highlightElement",{el:z,language:O}),z.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",z);return}if(z.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(z)),l.throwUnescapedHTML))throw new hge("One of your code blocks includes unescaped HTML.",z.innerHTML);R=z;const U=R.textContent,A=O?d(U,{language:O,ignoreIllegals:!0}):p(U);z.innerHTML=A.value,z.dataset.highlighted="yes",g(z,O,A.language),z.result={language:A.language,re:A.relevance,relevance:A.relevance},A.secondBest&&(z.secondBest={language:A.secondBest.language,relevance:A.secondBest.relevance}),I("after:highlightElement",{el:z,result:A,text:U})}function v(z){l=W_(l,z)}const y=()=>{k(),Ws("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function b(){k(),Ws("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let w=!1;function k(){function z(){k()}if(document.readyState==="loading"){w||window.addEventListener("DOMContentLoaded",z,!1),w=!0;return}document.querySelectorAll(l.cssSelector).forEach(m)}function S(z,R){let O=null;try{O=R(e)}catch(U){if(as("Language definition for '{}' could not be registered.".replace("{}",z)),i)as(U);else throw U;O=o}O.name||(O.name=z),t[z]=O,O.rawDefinition=R.bind(null,e),O.aliases&&C(O.aliases,{languageName:z})}function x(z){delete t[z];for(const R of Object.keys(n))n[R]===z&&delete n[R]}function E(){return Object.keys(t)}function _(z){return z=(z||"").toLowerCase(),t[z]||t[n[z]]}function C(z,{languageName:R}){typeof z=="string"&&(z=[z]),z.forEach(O=>{n[O.toLowerCase()]=R})}function T(z){const R=_(z);return R&&!R.disableAutodetect}function L(z){z["before:highlightBlock"]&&!z["before:highlightElement"]&&(z["before:highlightElement"]=R=>{z["before:highlightBlock"](Object.assign({block:R.el},R))}),z["after:highlightBlock"]&&!z["after:highlightElement"]&&(z["after:highlightElement"]=R=>{z["after:highlightBlock"](Object.assign({block:R.el},R))})}function M(z){L(z),r.push(z)}function B(z){const R=r.indexOf(z);R!==-1&&r.splice(R,1)}function I(z,R){const O=z;r.forEach(function(U){U[O]&&U[O](R)})}function F(z){return Ws("10.7.0","highlightBlock will be removed entirely in v12.0"),Ws("10.7.0","Please use highlightElement now."),m(z)}Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:k,highlightElement:m,highlightBlock:F,configure:v,initHighlighting:y,initHighlightingOnLoad:b,registerLanguage:S,unregisterLanguage:x,listLanguages:E,getLanguage:_,registerAliases:C,autoDetection:T,inherit:W_,addPlugin:M,removePlugin:B}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=fge,e.regex={concat:Es,lookahead:e2,either:J0,optional:Ame,anyNumberOfTimes:jme};for(const z in Ud)typeof Ud[z]=="object"&&QM(Ud[z]);return Object.assign(e,Ud),e},Zo=c2({});Zo.newInstance=()=>c2({});var mge=Zo;Zo.HighlightJS=Zo;Zo.default=Zo;const gge=Ze(mge),G_={},yge="hljs-";function vge(e){const t=gge.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||G_,h=typeof f.prefix=="string"?f.prefix:yge;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:bge,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||G_).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 bge{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 xge={};function wge(e){const t=e||xge,n=t.aliases,r=t.detect||!1,i=t.languages||Sme,a=t.plainText,o=t.prefix,l=t.subset;let c="hljs";const u=vge(i);if(n&&u.registerAlias(n),o){const d=o.indexOf("-");c=d===-1?o:o.slice(0,d)}return function(d,f){Qp(d,"element",function(h,p,g){if(h.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const m=Sge(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 w=b;if(m&&/Unknown language/.test(w.message)){f.message("Cannot highlight as `"+m+"`, itโ€™s not registered",{ancestors:[g,h],cause:w,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw w}!m&&y.data&&y.data.language&&h.properties.className.push("language-"+y.data.language),y.children.length>0&&(h.children=y.children)})}}function Sge(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 Bh="[A-Za-z$_][0-9A-Za-z$_]*",u2=["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"],d2=["true","false","null","undefined","NaN","Infinity"],f2=["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"],h2=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],p2=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],m2=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],g2=[].concat(p2,f2,h2);function kge(e){const t=e.regex,n=(O,{after:U})=>{const A="</"+O[0].slice(1);return O.input.indexOf(A,U)!==-1},r=Bh,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,U)=>{const A=O[0].length+O.index,Z=O.input[A];if(Z==="<"||Z===","){U.ignoreMatch();return}Z===">"&&(n(O,{after:A})||U.ignoreMatch());let $;const P=O.input.substring(A);if($=P.match(/^\s*=/)){U.ignoreMatch();return}if(($=P.match(/^\s+extends\s+/))&&$.index===0){U.ignoreMatch();return}}},l={$pattern:Bh,keyword:u2,literal:d2,built_in:g2,"variable.language":m2},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]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,v,{match:/\$\d+/},f];h.contains=w.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(w)});const k=[].concat(b,h.contains),S=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(k)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},E={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"}}]},_={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:{_:[...f2,...h2]}},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:[x],illegal:/%/},L={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function M(O){return t.concat("(?!",O.join("|"),")")}const B={match:t.concat(/\b/,M([...p2,"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},F={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",R={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:_},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,_,{scope:"attr",match:r+t.lookahead(":"),relevance:0},R,{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:z,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:[x,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:[x]},B,L,E,F,{match:/\$[(.]/}]}}function q_(e){const t=e.regex,n=kge(e),r=Bh,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:Bh,keyword:u2.concat(c),literal:d2,built_in:g2.concat(i),"variable.language":m2},d={className:"meta",begin:"@"+r},f=(m,v,y)=>{const b=m.contains.findIndex(w=>w.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 K_="[A-Za-z$_][0-9A-Za-z$_]*",Nge=["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"],Ege=["true","false","null","undefined","NaN","Infinity"],y2=["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"],v2=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],b2=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],_ge=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],jge=[].concat(b2,y2,v2);function V_(e){const t=e.regex,n=(O,{after:U})=>{const A="</"+O[0].slice(1);return O.input.indexOf(A,U)!==-1},r=K_,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,U)=>{const A=O[0].length+O.index,Z=O.input[A];if(Z==="<"||Z===","){U.ignoreMatch();return}Z===">"&&(n(O,{after:A})||U.ignoreMatch());let $;const P=O.input.substring(A);if($=P.match(/^\s*=/)){U.ignoreMatch();return}if(($=P.match(/^\s+extends\s+/))&&$.index===0){U.ignoreMatch();return}}},l={$pattern:K_,keyword:Nge,literal:Ege,built_in:jge,"variable.language":_ge},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]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,v,{match:/\$\d+/},f];h.contains=w.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(w)});const k=[].concat(b,h.contains),S=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(k)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},E={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"}}]},_={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:{_:[...y2,...v2]}},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:[x],illegal:/%/},L={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function M(O){return t.concat("(?!",O.join("|"),")")}const B={match:t.concat(/\b/,M([...b2,"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},F={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",R={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:_},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,_,{scope:"attr",match:r+t.lookahead(":"),relevance:0},R,{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:z,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:[x,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:[x]},B,L,E,F,{match:/\$[(.]/}]}}const Age="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",Cge={scope:"number",match:Age,relevance:0};function Tge(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,Cge,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"],w=["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,...w,"set","shopt",...k,...S]},contains:[p,e.SHEBANG(),g,f,a,o,y,l,c,u,d,n]}}function Y_(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[./~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function X_(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 Z_(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 Q_(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 Pge(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 Rge(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(x=>x.replace(/\s+/,"\\s+"))),/\b/)}const w={scope:"keyword",match:b(h),relevance:0};function k(S,{exceptions:x,when:E}={}){const _=E;return x=x||[],S.map(C=>C.match(/\|\d+$/)||x.includes(C)?C:_(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)},w,y,m,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function J_(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 Mge=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_-]*/}}),Ige=["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"],$ge=["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"],Lge=[...Ige,...$ge],Dge=["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(),Bge=["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(),zge=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Fge=["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 Uge(e){const t=e.regex,n=Mge(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:":("+Bge.join("|")+")"},{begin:":(:)?("+zge.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Fge.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:Dge.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Lge.join("|")+")\\b"}]}}function ej(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}const Wge={ts:q_,typescript:q_,js:V_,javascript:V_,json:Tge,bash:Oge,shell:Y_,sh:Y_,python:X_,py:X_,markdown:Z_,md:Z_,yaml:Q_,yml:Q_,diff:Pge,sql:Rge,html:J_,xml:J_,css:Uge,text:ej,plaintext:ej};function x2(e){if(e==null)return"";const t=e;return typeof t.value=="string"?t.value:Array.isArray(t.children)?t.children.map(x2).join(""):""}function Hge({lang:e,code:t,children:n}){const[r,i]=N.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 Gge({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=N.useMemo(()=>x2(n),[n]);return s.jsx(Hge,{lang:i,code:a,children:t})}function tj({text:e}){const t=N.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:Gge}),[]);return s.jsx("div",{className:"md-root",children:s.jsx(jde,{remarkPlugins:[zhe],rehypePlugins:[[wge,{languages:Wge}]],components:t,children:e??""})})}const nj=/```([\w+-]*)\n([\s\S]*?)```/g;function qge(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 Vge(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 Yge(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 rj=/https?:\/\/[^\s)\]}"'<>]+/i,ij=/(๐Ÿš€|deploy(?:ed|ment|ing)?|live at|published|available at|open the)/i;function Xge(e){return e.replace(/[.,;:!?]+$/,"")}function Zge(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(ij);!o&&i+1<t.length&&/deploy(?:ed|ment|ing)?:\s*$/i.test(a.trim())&&(o=t[i+1].match(ij));const l=a.match(rj)||(i+1<t.length?t[i+1].match(rj):null);if(!o||!l)continue;const c=Xge(l[0]);r.has(c)||(r.add(c),n.push({url:c,title:a.trim().slice(0,80)||"Deployment"}))}return n}function aj(e){const t=[],n=[],r=[];nj.lastIndex=0;let i;for(;(i=nj.exec(e))!==null;){const a=(i[1]||"").toLowerCase(),o=i[2];if(a==="diff"||o.includes("diff --git ")){const l=qge(o);l.length>0&&t.push({files:l,summary:`${l.length} file${l.length===1?"":"s"} changed`})}else Kge(o)&&n.push({verdict:Vge(o),title:Yge(o),body:o})}for(const a of Zge(e))r.push(a);return{diffs:t,results:n,deploys:r}}const Qge=/\x1b(?:\[[0-9;?]*[ -/]*[@-~]|\][^\x07\x1b]*(?:\x07|\x1b\\)|[@-Z\\-_])/g;function sj(e){return e?e.replace(Qge,""):""}const oj=3e5,Jge=2e3,eye=/\.(pdf|docx|xlsx|pptx)$/i,tye=/\.(png|jpe?g|gif|webp|bmp|tiff?)$/i,nye=/\.(txt|md|markdown|text|log|csv|tsv|json|xml|yaml|yml|html?|htaccess|css|js|mjs|cjs|jsx|ts|tsx|py|rb|go|rs|java|kt|c|h|cpp|cs|php|sh|bash|zsh|sql|ini|toml|cfg|conf|env)$/i;function rye(e){let t="";for(let r=0;r<e.length;r+=32768)t+=String.fromCharCode(...e.subarray(r,r+32768));return btoa(t)}function iye(e,t){const n=t.includes(0),r=t.length===0?1:t.reduce((i,a)=>a===9||a===10||a===13||a>=32&&a<127||a>=128?i+1:i,0)/t.length;return!n&&r>.9?{how:"text"}:eye.test(e)?{how:"binary"}:nye.test(e)?{how:"text"}:tye.test(e)?{how:"unsupported",reason:`"${e}" is an image, and this composer only sends text and documents. Save it into the project folder and ask me to describe it โ€” I can read images from there.`}:{how:"unsupported",reason:`"${e}" is not a text file and not a document type I can read. Attach a PDF, DOCX, XLSX, PPTX, or a text/CSV/JSON/Markdown file โ€” or put the file in the project folder and ask me to read it.`}}function aye(e){const t=["pending","running","done","blocked"].includes(e.status);return{id:e.id,description:e.description,status:t?e.status:"pending"}}function sye(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 oye={running:"โณ running",done:"โœ… done",failed:"โŒ failed",cancelled:"โน cancelled",timeout:"โฐ timed out",error:"๐Ÿ’ฅ error"};function nc({diff:e,selectable:t=!1,onCommitAccepted:n,lockedHint:r}){const[i,a]=N.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 nw({text:e,label:t}){const[n,r]=N.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 lye({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(nw,{text:e.body,label:"result output"})]}),s.jsx("pre",{className:"chat-result-body",children:e.body})]})}function cye({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(nw,{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 uye({children:e}){const t=N.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 dye({task:e,onCancel:t}){const n=e.status==="running",r=e.logs.map(i=>sj(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:oye[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(nw,{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=sj(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 lj({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 fye({request:e,onSave:t}){const[n,r]=N.useState({}),[i,a]=N.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 hye({result:e}){const[t,n]=N.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 pye(e){return e==="done"?"โœ…":e==="running"?"๐Ÿ”„":e==="blocked"?"โ›”":"โฌœ"}function cj({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:pye(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 uj({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:sye(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 mye(e){return(e.evidence??[]).filter(t=>typeof(t==null?void 0:t.ref)=="string"&&t.ref.trim().length>0)}function dj({findings:e}){return!e||e.length===0?null:s.jsx("div",{className:"chat-finding-cards",children:e.map((t,n)=>{const r=mye(t),i=t.verdict==="CONFIRMED"&&r.length>0;return s.jsxs("div",{className:`chat-finding-card ${i?"chat-finding-confirmed":"chat-finding-plausible"}`,children:[s.jsxs("div",{className:"chat-finding-head",children:[s.jsx("span",{className:"chat-finding-icon","aria-hidden":"true",children:i?"โœ…":"๐Ÿ”Ž"}),s.jsx("span",{className:"chat-finding-claim",children:t.claim}),s.jsx("span",{className:`chat-finding-verdict ${i?"chat-finding-verdict-ok":"chat-finding-verdict-guess"}`,title:i?"a check was performed and is shown below":"reasoned, not verified",children:i?"CONFIRMED":"PLAUSIBLE"})]}),t.outcome?s.jsx("div",{className:"chat-finding-outcome",children:t.outcome}):null,r.length>0?s.jsx("ul",{className:"chat-finding-evidence",children:r.map((a,o)=>s.jsxs("li",{children:[s.jsx("span",{className:"chat-finding-kind",children:a.kind}),s.jsx("code",{className:"chat-finding-ref",children:a.ref}),a.detail?s.jsxs("span",{className:"chat-finding-detail",children:["(",a.detail,")"]}):null]},o))}):s.jsx("div",{className:"chat-finding-noevidence",children:"no evidence โ€” reported as PLAUSIBLE, not verified"}),t.source?s.jsxs("div",{className:"chat-finding-source",children:["source: ",t.source]}):null]},`${n}-${t.claim}`)})})}function gye({worktree:e}){return s.jsxs("div",{className:"chat-worktree-card",children:[s.jsxs("div",{className:"chat-worktree-head",children:[s.jsx("span",{className:"chat-worktree-icon","aria-hidden":"true",children:"๐ŸŒฟ"}),s.jsx("span",{className:"chat-worktree-title",children:"Ran in an isolated worktree"}),s.jsx("span",{className:`chat-worktree-state ${e.removed?"chat-worktree-gone":"chat-worktree-kept"}`,children:e.removed?"removed":"kept"})]}),s.jsxs("div",{className:"chat-worktree-meta",children:[s.jsx("code",{className:"chat-worktree-dir",title:e.dir,children:e.dir}),s.jsxs("span",{className:"admin-hint",children:["base ",e.base.slice(0,7)]})]}),s.jsx("div",{className:"chat-worktree-note admin-hint",children:e.removed?"the diff below is what is left of it โ€” nothing was written into the project tree":"the directory above is still on disk"}),s.jsx(nc,{diff:e.diff.payload})]})}function yye({resume:e}){return s.jsxs("div",{className:"chat-resume-card",children:[s.jsxs("div",{className:"chat-resume-head",children:[s.jsx("span",{className:"chat-resume-icon","aria-hidden":"true",children:"โ†ฉ๏ธ"}),s.jsx("span",{className:"chat-resume-title",children:"Resumed a recorded run"}),s.jsx("span",{className:`chat-resume-state ${e.saved?"chat-resume-saved":"chat-resume-unsaved"}`,title:e.saved?"the record was written back, so a later resume can replay this run":"the record could NOT be written โ€” a later resume will replay nothing from this run",children:e.saved?"recorded":"not recorded"})]}),s.jsxs("div",{className:"chat-resume-meta",children:[s.jsxs("span",{children:[e.replayed," step",e.replayed===1?"":"s"," replayed"]}),s.jsxs("span",{children:[e.modelCalls," model call",e.modelCalls===1?"":"s"," made"]}),s.jsx("code",{className:"chat-resume-id",title:"the checkpoint record this run used",children:e.id})]}),s.jsx("div",{className:"chat-resume-note",children:e.notice})]})}function zg(){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 vye(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 fj(){var _l,Ms,Is,jl,Zu;const[e,t]=N.useState(null),[n,r]=N.useState([]),[i,a]=N.useState(""),[o,l]=N.useState(!1),[c,u]=N.useState(""),[d,f]=N.useState(null),[h,p]=N.useState(!1),[g,m]=N.useState(!1),[v,y]=N.useState(!1),[b,w]=N.useState(""),[k,S]=N.useState(null),[x,E]=N.useState([]),[_,C]=N.useState([]),[T,L]=N.useState(null),[M,B]=N.useState(null),[I,F]=N.useState(null),[z,R]=N.useState([]),[O,U]=N.useState([]),[A,Z]=N.useState([]),[$,P]=N.useState(null),oe=N.useRef([]),be=N.useRef([]),pe=N.useRef(null),Ce=N.useRef(null),G=N.useRef(null),Y=N.useRef([]),[ae,le]=N.useState(""),X=N.useRef(""),je=N.useRef(null),[Ne,_e]=N.useState(null),ge=N.useRef(zg()),$e=N.useRef(""),[fe,et]=N.useState([]),[De,Ee]=N.useState(!0),[qe,It]=N.useState(""),[On,Qt]=N.useState(null),[W,V]=N.useState(""),[ie,he]=N.useState([]),[we,He]=N.useState(null),[ln,Tt]=N.useState(!1),Un=N.useRef(null),wn=N.useRef(null),[Re,Wn]=N.useState(null),[$t,oi]=N.useState(null),[Ea,sr]=N.useState([]),[Jt,q]=N.useState(""),[me,Me]=N.useState(""),[Te,Hn]=N.useState(!1),[cn,zr]=N.useState(""),[Sn,_s]=N.useState([]),[vl,Uu]=N.useState(null),[Wu,_a]=N.useState(!1),[li,em]=N.useState([]),[tm,Hu]=N.useState([]),[bl,xl]=N.useState(""),wl=N.useRef(null),lt=N.useRef(null),ja=N.useRef(null),js=N.useRef(null),[Lt,Aa]=N.useState(null),[Ca,Gu]=N.useState(new Set);N.useEffect(()=>{J.fetchAdminAuthStatus().then(D=>{t(D?{configured:D.configured,authenticated:D.authenticated,role:D.role??null}:{configured:!1,authenticated:!1,role:null})})},[]),N.useEffect(()=>{var D,te;try{(te=(D=ja.current)==null?void 0:D.scrollTo)==null||te.call(D,{top:ja.current.scrollHeight})}catch{}},[n,o,x]),N.useEffect(()=>()=>{var D;(D=lt.current)==null||D.call(lt),lt.current=null},[]);const Sl=N.useCallback(async D=>{var ke,Nr;(ke=lt.current)==null||ke.call(lt),lt.current=null;const te=await J.getChatSession(D);if(!te)return;ge.current=D,r(te.turns.map(Bt=>({role:Bt.role,content:Bt.content,...Bt.role==="assistant"?{followups:[],artifacts:aj(Bt.content)}:{}}))),E([]),oe.current=[],C([]),be.current=[],L(null),pe.current=null,B(null),Ce.current=null,F(null),G.current=null,R([]),Y.current=[],X.current="",le(""),_e(null),u(""),S(null),P(null),Aa(null),Ee(!0);const ee=te.projectPath;if(ee){if(oi(ee),(Re==null?void 0:Re.path)===ee)return;(Nr=js.current)==null||Nr.call(js,ee)}else oi(null)},[Re]),As=N.useCallback(()=>{var D;(D=lt.current)==null||D.call(lt),lt.current=null,ge.current=zg(),oi(null),r([]),E([]),oe.current=[],C([]),be.current=[],L(null),pe.current=null,B(null),Ce.current=null,F(null),G.current=null,R([]),Y.current=[],X.current="",le(""),_e(null),u(""),S(null),P(null),Aa(null),he([]),He(null),a(""),Ee(!0)},[]),ci=N.useCallback(D=>{he(te=>[...te,D].slice(-10))},[]),Gn=N.useCallback(D=>{he(te=>te.filter((ee,ke)=>ke!==D))},[]),Cs=N.useCallback(async D=>{if(!D)return;if(D.size>oj){u(`Attachment "${D.name}" is too large (max ${Math.round(oj/1024)} KB).`);return}const te=new Uint8Array(await D.slice(0,8192).arrayBuffer()),ee=iye(D.name,te);if(ee.how==="unsupported"){u(ee.reason);return}if(ee.how==="binary"){const Nr=new Uint8Array(await D.arrayBuffer());ci({name:D.name,content:rye(Nr),kind:"file",encoding:"base64"});return}const ke=await D.text();ci({name:D.name,content:ke,kind:"file",encoding:"text"})},[ci]),Ts=N.useCallback(D=>{const te=D.currentTarget,ee=D.clipboardData.getData("text")||"";ee.length>=Jge&&(wn.current={start:te.selectionStart,end:te.selectionEnd},He({text:ee}))},[]),qu=N.useCallback(()=>{const D=we;if(!D)return;const te=wn.current;a(ee=>te?ee.slice(0,te.start)+ee.slice(te.end):ee),ci({name:"pasted-text.txt",content:D.text,kind:"paste",encoding:"text"}),He(null),wn.current=null},[we,ci]),Ku=N.useCallback(D=>{Qt(D.id),V(D.title==="(untitled conversation)"?"":D.title)},[]),ui=N.useCallback(async D=>{const te=await J.renameChatSession(D,W);te.ok?et(ee=>ee.map(ke=>ke.id===D?{...ke,title:W.trim()||ke.title}:ke)):u(te.error||"Could not rename the session."),Qt(null),V("")},[W]),kl=N.useCallback(async D=>{const te=await J.deleteChatSession(D);te.ok?(et(ee=>ee.filter(ke=>ke.id!==D)),ge.current===D&&As()):u(te.error||"Could not delete the session.")},[As]),Fr=(e==null?void 0:e.authenticated)===!0&&(e.role==="admin"||e.role==="operator");N.useEffect(()=>{Fr&&(J.listChatSessions().then(D=>{Array.isArray(D)&&et(D)}),J.listProjects().then(D=>{Array.isArray(D)&&sr(D)}))},[Fr]);const qn=N.useCallback(async D=>{const te=D.trim();if(!te)return;Me("");const ee=await J.attachProject(te);if(ee.ok&&ee.project){Wn(ee.project),q("");const ke=await J.listProjects();Array.isArray(ke)&&sr(ke)}else Me(ee.error||"Could not attach that directory.")},[]);js.current=qn;const di=N.useCallback(async D=>{Hn(!0),_a(!0),xl("");const te=await J.browseDirectories(D,{showDrives:!D});te.ok&&(zr(te.path),_s(te.entries),Uu(te.parent),te.drives&&em(te.drives),te.breadcrumbs&&Hu(te.breadcrumbs)),_a(!1)},[]),Os=N.useCallback(async D=>{_a(!0),xl("");const te=await J.browseDirectories(D);te.ok&&(zr(te.path),_s(te.entries),Uu(te.parent),te.breadcrumbs&&Hu(te.breadcrumbs)),_a(!1)},[]),kr=N.useCallback(async()=>{if(!cn)return;const D=await J.browseDirectories(cn);D.ok&&_s(D.entries)},[cn]);N.useEffect(()=>J.onChatRetryEvent(te=>{if(te.sessionId!==ge.current){J.listChatSessions().then(ee=>{Array.isArray(ee)&&et(ee)});return}r(ee=>[...ee,{role:"assistant",content:te.content}]),te.kind==="answer"&&_e(null)}),[]),N.useEffect(()=>(Te&&cn&&(wl.current=setInterval(()=>{kr()},5e3)),()=>{wl.current&&clearInterval(wl.current)}),[Te,cn,kr]);const nm=N.useCallback(async()=>{if(typeof window<"u"&&"showDirectoryPicker"in window)try{const ee=(await window.showDirectoryPicker({mode:"read"})).name;if(!ee){di();return}Me(""),l(!0);const ke=await J.resolveFolder(ee);l(!1),ke.ok&&ke.path?(q(ke.path),qn(ke.path)):Me('Folder "'+ee+'" 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}di()},[di,qn]),Dt=N.useCallback(async(D,te)=>{var Wr,Kn;const ee=D.trim(),ke=Array.isArray(te)?te:ie,Nr=!Array.isArray(te)&&(te==null?void 0:te.skipResolve)===!0;if(!ee&&ke.length===0||o)return;if(u(""),S(null),E([]),oe.current=[],C([]),be.current=[],L(null),pe.current=null,B(null),Ce.current=null,F(null),G.current=null,R([]),Y.current=[],r(Se=>[...Se,{role:"user",content:ee,attachments:ke.length>0?ke:void 0}]),a(""),he([]),He(null),$e.current=ee||`[${ke.length} attachment(s)]`,l(!0),Ee(!1),!Nr){const ct=((await J.chatResolve(ee)).matches??[])[0]??null;if(ct&&ct.command&&!ct.ambiguous&&ct.score>=.6){P({ask:ee,top:ct}),l(!1);return}if(ct&&ct.ambiguous&&!$){P({ask:ee,top:ct}),l(!1);return}}const Bt=ge.current,Pn=new AbortController;je.current=Pn,_e(null),(Wr=lt.current)==null||Wr.call(lt),lt.current=J.subscribeChat(Bt,{onToken:Se=>{X.current+=Se,le(X.current)},onProgress:Se=>{oe.current=[...oe.current,Se],E(oe.current)},onQuestion:Se=>{Aa(Se),Gu(new Set)},onTool:Se=>{const Fe=[...be.current],ct=Fe.findIndex(en=>en.id===Se.id),At={id:Se.id,tool:Se.tool,phase:Se.phase,args:Se.args,ok:Se.ok,result:Se.result,error:Se.error,durationMs:Se.durationMs};ct>=0?Fe[ct]=At:Fe.push(At),be.current=Fe,C(Fe)},onPlan:Se=>{const Fe={goal:Se.goal,steps:Se.steps.map(aye),revision:Se.revision};pe.current=Fe,L(Fe)},onDiff:Se=>{const Fe={files:Se.files,summary:Se.summary};Ce.current=Fe,B(Fe)},onSkillDraft:Se=>{const Fe={name:Se.name,description:Se.description,markdown:Se.markdown,updatedAt:Se.updatedAt,status:"pending"};G.current=Fe,F(Fe)},onFinding:Se=>{Y.current=[...Y.current,Se],R(Y.current)},onSecretRequest:Se=>{U(Fe=>{const ct=Fe.findIndex(At=>At.skillName===Se.skillName);if(ct>=0){const At=[...Fe];return At[ct]=Se,At}return[...Fe,Se]})},onExecutionResult:Se=>{Z(Fe=>[...Fe,Se])}});const Nt=await J.chatSend(Bt,ee||`(see ${ke.length} attachment${ke.length===1?"":"s"})`,{projectPath:Re==null?void 0:Re.path,attachments:ke.map(Se=>({name:Se.name,content:Se.content,kind:Se.kind,encoding:Se.encoding??"text"})),...h?{worktree:!0,keepWorktree:g}:{},...v?{resume:b.trim()||!0}:{}},Pn.signal);if(je.current=null,(Kn=lt.current)==null||Kn.call(lt),lt.current=null,X.current="",le(""),Nt.ok){S(Nt.generationFailed?null:`${Nt.provider??"provider"}${Nt.model?` / ${Nt.model}`:" (auto-routed)"}`),_e(Nt.generationFailed&&!Nt.retryQueued&&!Nt.refused?ee:null);const Se=Nt.content||"(the agent produced no text โ€” try rephrasing)";r(Fe=>[...Fe,{role:"assistant",content:Se,error:Nt.generationFailed,followups:Nt.followups,steps:oe.current,tools:be.current,plan:pe.current,diff:Ce.current,draft:G.current,findings:Nt.findings??Y.current,worktree:Nt.worktree,resume:Nt.resume,refused:Nt.refused,artifacts:aj(Se)}])}else Pn.signal.aborted?(u(""),_e(null)):Nt.unauthorized?(t(Se=>Se&&{...Se,authenticated:!1}),u("Session expired โ€” log in again to chat.")):(u(Nt.error||"The agent could not answer โ€” check that a provider API key is set for the dashboard process."),_e(ee));l(!1),Ee(!0)},[o,Re,ie,h,g,v,b]),Ps=N.useCallback(()=>{var D;(D=je.current)==null||D.abort()},[]),Ur=N.useCallback(async()=>{f(null);const D=await J.chatSupportBundle(ge.current);f(D.ok?{kind:"ok",text:"Support bundle downloaded โ€” attach it to your bug report."}:{kind:"err",text:D.error||"Could not build the support bundle."})},[]),Nl=N.useCallback(async D=>{F(ee=>ee&&{...ee,status:"saving"});const te=await J.skillDraftAccept(D);F(ee=>ee&&{...ee,status:te.ok?"saved":"error"}),te.ok||u(te.error||"Could not accept the draft.")},[]),qt=N.useCallback(async D=>{const te=await J.skillDraftReject(D);te.ok?F(ee=>ee&&{...ee,status:"rejected"}):u(te.error||"Could not reject the draft.")},[]),Vu=N.useCallback(D=>{Dt(`Revise the skill draft "${D}" โ€” improve it per your best judgment and present it again.`)},[Dt]),rm=N.useCallback(async D=>{const te=await J.saveSecrets(D);if(!te.ok){u(te.error||"Could not save secrets.");return}const ee=te.refused??[];ee.length>0&&u(ee.map(ke=>ke.reason==="provider-credential"?`${ke.name} is a provider credential โ€” set it up as a provider, skills never receive it.`:`${ke.name} was not saved (${ke.reason}).`).join(" "))},[]),im=N.useCallback(async D=>{const ke=((await J.chatResolve(D)).matches??[])[0]??null;if(!(ke!=null&&ke.command)){P(null);return}P(null),l(!0);const Nr=ke.command.split(/\s+/),Bt=await J.startTask(Nr,6e4);if(!Bt.ok||!Bt.task){u(Bt.error||"The command could not be started."),l(!1);return}const Pn=Bt.task.id,Nt={id:Pn,command:ke.command,status:Bt.task.status,exitCode:Bt.task.exitCode,durationMs:Bt.task.durationMs,logs:Bt.task.logs??[]};r(ct=>[...ct,{role:"assistant",content:"",task:Nt}]);const Wr=ct=>r(At=>At.map(en=>en.task&&en.task.id===Pn?{...en,task:{...en.task,...ct}}:en));let Kn=null;Kn=J.subscribeTask(Pn,{onLog:ct=>r(At=>At.map(en=>en.task&&en.task.id===Pn?{...en,task:{...en.task,logs:[...en.task.logs,ct]}}:en)),onStatus:ct=>{Wr({status:ct}),ct!=="running"&&(J.getTask(Pn).then(At=>{At!=null&&At.task&&Wr({exitCode:At.task.exitCode,durationMs:At.task.durationMs,logs:At.task.logs??[]})}),Kn==null||Kn(),l(!1))}});const Se=await J.getTask(Pn);Se!=null&&Se.task&&Wr({status:Se.task.status,exitCode:Se.task.exitCode,durationMs:Se.task.durationMs,logs:Se.task.logs??[]});const Fe=await J.getTask(Pn);Fe!=null&&Fe.task&&Fe.task.status!=="running"&&(Kn==null||Kn(),Wr({status:Fe.task.status,exitCode:Fe.task.exitCode,durationMs:Fe.task.durationMs,logs:Fe.task.logs??[]}),l(!1))},[]),Ta=N.useCallback(D=>{P(null),Dt(D,{skipResolve:!0})},[Dt]),Yu=N.useCallback(D=>{if(D.length===0)return;const te=Re?` in the attached project ${Re.path}`:"";Dt(`Commit exactly these files that I accepted on the diff card (and nothing else)${te}: ${D.join(", ")}. Show me a short confirmation before finishing.`)},[Dt,Re]),am=N.useCallback(async D=>{await J.cancelTask(D)},[]),Li=N.useCallback(async D=>{const te=Lt;if(!te)return;Aa(null);const ee=await J.chatRespond(ge.current,te.questionId,D);ee.ok||u(ee.error||"The question could not be answered โ€” try sending your message again.")},[Lt]),Rs=N.useCallback(()=>{if(!Lt)return;const D=Lt.multiSelect?[...Ca]:[...Ca][0];Lt.multiSelect?Li({index:[...Ca]}):Li(D!==void 0?{index:D}:{index:-1})},[Lt,Ca,Li]),sm=N.useCallback(()=>{Lt&&Li({index:-1})},[Lt,Li]),Xu=N.useCallback(D=>{Gu(te=>{const ee=new Set(te);return Lt!=null&&Lt.multiSelect?ee.has(D)?ee.delete(D):ee.add(D):(ee.clear(),ee.add(D)),ee})},[Lt]),om=N.useCallback(async()=>{var te;(te=lt.current)==null||te.call(lt),lt.current=null,ge.current=zg(),r([]),E([]),oe.current=[],C([]),be.current=[],L(null),pe.current=null,B(null),Ce.current=null,F(null),G.current=null,R([]),Y.current=[],X.current="",le(""),_e(null),u(""),S(null),P(null),Aa(null);const D=await J.listChatSessions();Array.isArray(D)&&et(D)},[]),El=((_l=[...n].reverse().find(D=>{var te;return D.role==="assistant"&&!D.error&&(((te=D.followups)==null?void 0:te.length)??0)>0}))==null?void 0:_l.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:[k?s.jsx("span",{className:"admin-hint",children:k}):null,s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void om(),disabled:o||n.length===0,children:"๐Ÿ—‘ New conversation"})]})]}),e!=null&&e.authenticated?Fr?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"chat-project-bar",children:Re?s.jsxs("div",{className:"chat-project-attached",children:[s.jsx("span",{className:"chat-project-icon",children:"๐Ÿ“"}),s.jsx("span",{className:"chat-project-name",children:Re.name}),s.jsxs("span",{className:"chat-project-meta",children:[Re.fileCount," files ยท ",Re.symbolCount," symbols",Re.truncated?" ยท truncated map":""]}),s.jsx("span",{className:"chat-project-path",title:Re.path,children:Re.path}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>Wn(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"}),Ea.length>0?s.jsx("span",{className:"chat-project-chips",children:Ea.filter(D=>D.kind!=="cwd").slice(0,3).map(D=>s.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void qn(D.path),children:D.name},D.path))}):null,s.jsx("input",{className:"chat-project-input",value:Jt,onChange:D=>q(D.target.value),onKeyDown:D=>{D.key==="Enter"&&(D.preventDefault(),qn(Jt))},placeholder:"or type a path, e.g. ~/code/my-app",disabled:o}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void qn(Jt),disabled:o||!Jt.trim(),children:"Attach"}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>void nm(),title:"Pick a project folder using your system's folder picker (Finder / Explorer)",children:"๐Ÿ—‚๏ธ Browse"}),me?s.jsx("span",{className:"chat-project-error",children:me}):null,Te?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:()=>Hn(!1),title:"Close",children:"โœ•"}),s.jsx("div",{className:"chat-browse-breadcrumbs",children:li.length>0&&!cn?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 di(),children:"๐Ÿ "}),tm.map((D,te)=>s.jsxs("span",{children:[s.jsx("span",{className:"chat-breadcrumb-sep",children:"/"}),s.jsx("button",{type:"button",className:"chat-breadcrumb",onClick:()=>void Os(D.path),children:D.name})]},D.path))]})})]}),li.length>0&&!cn?s.jsx("div",{className:"chat-browse-drives",children:li.map(D=>s.jsx("button",{type:"button",className:"chat-browse-drive",onClick:()=>void Os(D.path),children:D.name},D.path))}):null,Sn.length>5?s.jsx("div",{className:"chat-browse-search",children:s.jsx("input",{type:"text",className:"chat-browse-filter",placeholder:"๐Ÿ” Filter foldersโ€ฆ",value:bl,onChange:D=>xl(D.target.value),autoFocus:!0})}):null,s.jsx("div",{className:"chat-browse-list",children:Wu?s.jsx("span",{className:"admin-hint",children:"Loadingโ€ฆ"}):Sn.length===0?s.jsx("span",{className:"admin-hint",children:"No subdirectories found"}):Sn.filter(D=>!bl||D.name.toLowerCase().includes(bl.toLowerCase())).map(D=>s.jsxs("button",{type:"button",className:"chat-browse-entry",onClick:()=>void Os(D.path),children:[s.jsx("span",{className:"chat-browse-entry-icon",children:"๐Ÿ“"}),s.jsx("span",{className:"chat-browse-entry-name",children:D.name}),D.modified?s.jsx("span",{className:"chat-browse-entry-date",children:new Date(D.modified).toLocaleDateString()}):null]},D.path))}),s.jsxs("div",{className:"chat-browse-foot",children:[s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>void kr(),title:"Refresh folder list",children:"๐Ÿ”„"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>{Hn(!1),qn(cn)},disabled:!cn,children:"๐Ÿ“ Select this folder"})]})]}):null]})}),$t&&(!Re||Re.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})]}),Re?s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void qn($t),children:"๐Ÿ“ Switch to it"}):s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void qn($t),children:"๐Ÿ“ Attach it"})]}):null,s.jsxs("div",{className:"chat-layout",children:[De?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:As,children:"๏ผ‹ New"}),s.jsx("button",{type:"button",className:"chat-mini-action",title:"Collapse history",onClick:()=>Ee(!1),children:"โ–ธ"})]})]}),s.jsx("input",{className:"chat-session-search",placeholder:"Search conversationsโ€ฆ",value:qe,onChange:D=>It(D.target.value)}),fe.length===0?s.jsx("div",{className:"chat-sidebar-empty",children:"No past conversations yet."}):s.jsx("div",{className:"chat-sidebar-list",children:vye(fe,qe).map(({label:D,items:te})=>s.jsxs("div",{className:"chat-session-group",children:[s.jsx("div",{className:"chat-session-group-label",children:D}),te.map(ee=>s.jsx("div",{className:`chat-session-item${ee.id===ge.current?" chat-session-active":""}`,children:On===ee.id?s.jsxs("div",{className:"chat-session-rename",children:[s.jsx("input",{autoFocus:!0,value:W,onChange:ke=>V(ke.target.value),onKeyDown:ke=>{ke.key==="Enter"&&ui(ee.id),ke.key==="Escape"&&Qt(null)},placeholder:"Session title"}),s.jsx("button",{type:"button",className:"chat-mini-action",onClick:()=>void ui(ee.id),children:"โœ“"})]}):s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",className:"chat-session-main",onClick:()=>void Sl(ee.id),title:ee.preview||ee.title,children:[s.jsx("span",{className:"chat-session-title",children:ee.title}),s.jsx("span",{className:"chat-session-preview",children:ee.firstUser||ee.preview}),s.jsxs("span",{className:"chat-session-meta",children:[ee.projectPath?`๐Ÿ“ ${ee.projectPath.split("/").pop()} ยท `:"",ee.turnCount," msg",ee.turnCount===1?"":"s"," ยท ",new Date(ee.updatedAt).toLocaleString()]})]}),s.jsxs("span",{className:"chat-session-actions",children:[s.jsx("button",{type:"button",className:"chat-mini-action",title:"Rename",onClick:()=>Ku(ee),children:"โœ๏ธ"}),s.jsx("button",{type:"button",className:"chat-mini-action",title:"Delete",onClick:()=>void kl(ee.id),children:"๐Ÿ—‘"})]})]})},ee.id))]},D))})]}):s.jsx("div",{className:"chat-rail",children:s.jsx("button",{type:"button",className:"chat-rail-btn",onClick:()=>Ee(!0),title:"Show history",children:"๐Ÿ“"})}),s.jsxs("div",{className:"chat-main",children:[s.jsxs("div",{className:"chat-thread",ref:ja,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 Dt("what's the state of this project?"),children:"๐Ÿ“‹ assess this project"}),s.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Dt("run the test suite"),children:"๐Ÿงช run the tests"}),s.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Dt("stop the gateway"),children:"โน stop the gateway"}),s.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Dt("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 Dt("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 Dt("publish the current version"),children:"๐Ÿš€ publish the release"})]})]}):n.map((D,te)=>s.jsxs("div",{className:`chat-bubble chat-${D.role}${D.error?" chat-error":""}`,children:[s.jsx("div",{className:"chat-bubble-role",children:D.role==="user"?"You":"๐Ÿค– Agent"}),D.role==="assistant"?s.jsx("div",{className:"chat-bubble-text",children:s.jsx(tj,{text:D.content})}):s.jsx("div",{className:"chat-bubble-text",children:D.content}),D.role==="user"&&D.attachments&&D.attachments.length>0?s.jsxs("details",{className:"chat-steps",open:D.attachments.length===1,children:[s.jsxs("summary",{children:["๐Ÿ“Ž ",D.attachments.length," attachment",D.attachments.length===1?"":"s",":"," ",D.attachments.map(ee=>ee.name).join(", ")]}),D.attachments.map((ee,ke)=>s.jsxs("div",{className:"chat-attach-content",children:[s.jsxs("div",{className:"admin-hint",children:[ee.name," โ€” ",gt(ee.content.length)," chars"]}),s.jsx("pre",{children:ee.content})]},ke))]}):null,D.role==="assistant"&&D.diff?s.jsxs("details",{className:"chat-steps",open:!0,children:[s.jsxs("summary",{children:["Changes: ",D.diff.summary]}),s.jsx(nc,{diff:D.diff,selectable:!0,onCommitAccepted:Yu})]}):null,D.role==="assistant"&&D.artifacts&&(D.artifacts.diffs.length>0||D.artifacts.results.length>0||D.artifacts.deploys.length>0)?s.jsxs(uye,{children:[D.artifacts.diffs.map((ee,ke)=>s.jsx("div",{"data-artifact-card":!0,tabIndex:0,role:"group","aria-label":`Diff: ${ee.summary}`,className:"chat-artifact-item",children:Re?s.jsx(nc,{diff:ee,selectable:!0,onCommitAccepted:Yu}):s.jsx(nc,{diff:ee,lockedHint:"Attach a project to review and commit these changes."})},`diff-${ke}`)),D.artifacts.results.map((ee,ke)=>s.jsx("div",{"data-artifact-card":!0,tabIndex:0,role:"group","aria-label":`Result: ${ee.title}`,className:"chat-artifact-item",children:s.jsx(lye,{result:ee})},`result-${ke}`)),D.artifacts.deploys.map((ee,ke)=>s.jsx("div",{"data-artifact-card":!0,tabIndex:0,role:"group","aria-label":`Deployment: ${ee.url}`,className:"chat-artifact-item",children:s.jsx(cye,{deploy:ee})},`deploy-${ke}`))]}):null,D.role==="assistant"&&D.task?s.jsx(dye,{task:D.task,onCancel:D.task.status==="running"?()=>void am(D.task.id):void 0}):null,D.role==="assistant"&&D.draft?s.jsxs("details",{className:"chat-steps",open:!0,children:[s.jsxs("summary",{children:["Skill draft: ",D.draft.name]}),s.jsx(lj,{draft:D.draft,onAccept:Nl,onReject:qt,onEdit:Vu})]}):null,D.role==="assistant"&&D.plan?s.jsxs("details",{className:"chat-steps",open:!0,children:[s.jsxs("summary",{children:["Plan: ",D.plan.goal]}),s.jsx(cj,{plan:D.plan})]}):null,D.role==="assistant"&&D.refused?s.jsx("div",{className:"chat-refused-line",children:"โ›” This turn did not run โ€” the isolation it asked for could not be made. Nothing was written, and the reason is above."}):null,D.role==="assistant"&&D.worktree?s.jsx(gye,{worktree:D.worktree}):null,D.role==="assistant"&&D.resume?s.jsx(yye,{resume:D.resume}):null,D.role==="assistant"&&D.findings&&D.findings.length>0?s.jsx(dj,{findings:D.findings}):null,D.role==="assistant"&&D.tools&&D.tools.length>0?s.jsxs("details",{className:"chat-steps",open:!0,children:[s.jsxs("summary",{children:[D.tools.length," tool call",D.tools.length===1?"":"s"]}),s.jsx(uj,{tools:D.tools})]}):null,D.role==="assistant"&&D.steps&&D.steps.length>0?s.jsxs("details",{className:"chat-steps",children:[s.jsxs("summary",{children:[D.steps.length," step",D.steps.length===1?"":"s"]}),s.jsx("div",{className:"chat-step-line",children:D.steps.map((ee,ke)=>s.jsx("div",{children:ee.trim()},ke))})]}):null]},te)),o?s.jsxs("div",{className:"chat-bubble chat-assistant",children:[s.jsx("div",{className:"chat-bubble-role",children:"๐Ÿค– Agent"}),T?s.jsx(cj,{plan:T}):null,M?s.jsx(nc,{diff:M}):null,h&&o?s.jsx("div",{className:"chat-resume-line",children:"๐ŸŒฟ this turn is running in its own git worktree โ€” the diff arrives with the answer"}):null,v&&o?s.jsx("div",{className:"chat-resume-line",children:"โ†ฉ๏ธ this turn is replaying the recorded steps of this ask that are unchanged โ€” the count arrives with the answer"}):null,z.length>0?s.jsx(dj,{findings:z}):null,I?s.jsx(lj,{draft:I,onAccept:Nl,onReject:qt,onEdit:Vu}):null,O.map(D=>s.jsx(fye,{request:D,onSave:rm},D.skillName)),A.map((D,te)=>s.jsx(hye,{result:D},`${D.skillName}-${te}`)),s.jsx(uj,{tools:_,live:!0}),ae?s.jsx("div",{className:"chat-bubble-text chat-streaming",children:s.jsx(tj,{text:ae})}):null,s.jsx("div",{className:"chat-working",children:x.length>0?s.jsx("span",{className:"chat-working-lines",children:x.map((D,te)=>s.jsx("div",{className:"chat-step-line",children:D.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,d?s.jsx("div",{className:`admin-row-msg${d.kind==="err"?" admin-row-msg-err":""}`,children:d.text}):null,Ne&&!o?s.jsxs("div",{className:"chat-retry-row",children:[s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void Dt(Ne),children:"โ†ป Retry"}),s.jsx("span",{className:"admin-hint",children:"Re-send the last message โ€” the turn failed."})]}):null,$&&!o?s.jsx("div",{className:"chat-resolve-card",children:(Ms=$.top)!=null&&Ms.ambiguous&&((Is=$.top.options)!=null&&Is.length)?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"chat-resolve-head",children:[s.jsx("strong",{children:"๐Ÿค” Which do you mean?"}),' โ€” "',$.ask,'" maps to more than one action.']}),s.jsx("div",{className:"chat-resolve-options",children:$.top.options.map(D=>s.jsxs("button",{className:"chat-chip",type:"button",onClick:()=>void Dt(D.command),children:[D.summary," โ€” ",s.jsx("code",{children:D.command})]},D.command))}),s.jsx("div",{className:"chat-resolve-foot",children:s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>{P(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?"}),' โ€” "',$.ask,'"']}),s.jsx("div",{className:"chat-resolve-cmd",children:s.jsx("code",{children:(jl=$.top)==null?void 0:jl.command})}),(Zu=$.top)!=null&&Zu.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 im($.ask),children:"โ–ถ Run"}),s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>Ta($.ask),children:"โœ• No โ€” ask the agent"})]})]})}):null,Lt?s.jsxs("div",{className:"chat-resolve-card chat-question-card",children:[s.jsx("div",{className:"chat-resolve-head",children:s.jsxs("strong",{children:["๐Ÿค” ",Lt.question]})}),s.jsx("div",{className:"chat-resolve-options",children:Lt.choices.map((D,te)=>s.jsxs("button",{type:"button",className:`chat-chip${Ca.has(te)?" chat-chip-selected":""}`,onClick:()=>Xu(te),children:[D.label,D.description?s.jsxs("span",{className:"admin-hint",children:[" โ€” ",D.description]}):null]},`${D.label}-${te}`))}),s.jsxs("div",{className:"chat-resolve-foot",children:[s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:Rs,children:Lt.multiSelect?"Submit":"Choose"}),s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:sm,children:"Skip โ€” best judgment"})]})]}):null,El.length>0&&!o?s.jsxs("div",{className:"chat-followups",children:[s.jsx("span",{className:"admin-hint",children:"Next steps:"}),El.map((D,te)=>s.jsx("button",{className:"chat-chip",type:"button",onClick:()=>void Dt(D.prompt),children:D.label||D.prompt},te))]}):null,s.jsxs("form",{className:`chat-composer${ln?" chat-composer-drag":""}`,onSubmit:D=>{D.preventDefault(),Dt(i)},onDragOver:D=>{D.preventDefault(),Tt(!0)},onDragLeave:()=>Tt(!1),onDrop:D=>{var ee;D.preventDefault(),Tt(!1);const te=Array.from(((ee=D.dataTransfer)==null?void 0:ee.files)??[]);for(const ke of te.slice(0,10))Cs(ke)},children:[we?s.jsxs("div",{className:"chat-paste-offer",children:[s.jsxs("span",{className:"admin-hint",children:["๐Ÿ“„ You pasted ",gt(we.text.length)," characters. Attach it as a file instead?"]}),s.jsx("button",{type:"button",className:"chat-chip",onClick:qu,children:"Attach as text"}),s.jsx("button",{type:"button",className:"chat-mini-action",onClick:()=>{He(null),wn.current=null},children:"Keep inline"})]}):null,ie.length>0?s.jsx("div",{className:"chat-attach-row",children:ie.map((D,te)=>s.jsxs("span",{className:"chat-attach-chip",title:D.encoding==="base64"?`${D.name} (${gt(D.content.length)} base64 chars โ€” read on the server)`:`${D.name} (${gt(D.content.length)} chars)`,children:["๐Ÿ“Ž ",D.name,s.jsx("span",{className:"admin-hint",children:D.encoding==="base64"?`${Math.round(D.content.length*3/4096)} KB`:`${gt(D.content.length)}c`}),s.jsx("button",{type:"button",className:"chat-mini-action",onClick:()=>Gn(te),children:"โœ•"})]},`${D.name}-${te}`))}):null,s.jsxs("div",{className:"chat-input-row",children:[s.jsx("input",{ref:Un,type:"file",accept:".pdf,.docx,.xlsx,.pptx,.txt,.md,.markdown,.text,.log,.csv,.tsv,.json,.xml,.yaml,.yml,.html,.htm,text/*",style:{display:"none"},onChange:D=>{var ee;const te=(ee=D.target.files)==null?void 0:ee[0];te&&Cs(te),D.target.value=""}}),s.jsx("button",{type:"button",className:"chat-attach-btn",title:"Attach a file (up to 300 KB): PDF, DOCX, XLSX, PPTX or text โ€” documents are read on the server",disabled:o||ie.length>=10,onClick:()=>{var D;return(D=Un.current)==null?void 0:D.click()},children:"๐Ÿ“Ž"}),s.jsx("button",{type:"button",className:"chat-attach-btn","aria-label":"Download support bundle",title:"Download a support bundle for this chat: the session debug log (which backend served each turn) plus the conversation. Needs NUVIRA_DEBUG_LOG=1 in the dashboard process.",onClick:()=>void Ur(),children:"๐Ÿž"}),s.jsxs("button",{type:"button",className:`chat-attach-btn${h?" chat-attach-btn-on":""}`,"aria-label":"Run turns in an isolated git worktree","aria-pressed":h,title:h?"Turns run in their own git worktree and report the diff โ€” click to run in the project tree again":"Run turns in their own git worktree of the attached project, and report the diff against the base commit. Refuses rather than running in your tree when the directory cannot be isolated. Needs an attached project (or the server's own git working directory).",onClick:()=>{p(D=>!D),f(null)},children:["๐ŸŒฟ",h?" isolated":" isolate"]}),s.jsxs("button",{type:"button",className:`chat-attach-btn${v?" chat-attach-btn-on":""}`,"aria-label":"Replay this ask's recorded steps instead of paying for them again","aria-pressed":v,title:v?"Recorded steps whose input is unchanged are replayed instead of paid for โ€” click to run fresh again":"Replay the steps of an earlier run of this same ask whose input is unchanged, instead of paying for them again. The record is keyed by the ask and the directory; name a checkpoint id below to resume a specific one. A step whose input CHANGED is paid for again.",onClick:()=>{y(D=>!D),f(null)},children:["โ†ฉ๏ธ",v?" resuming":" resume"]}),v?s.jsx("input",{className:"chat-resume-input",value:b,onChange:D=>w(D.target.value),placeholder:"checkpoint id (blank = this ask's record)",title:"Resume this specific checkpoint record. Blank resumes the record for this ask in this directory.","aria-label":"Checkpoint id to resume",disabled:o}):null,h?s.jsxs("button",{type:"button",className:`chat-attach-btn${g?" chat-attach-btn-on":""}`,"aria-pressed":g,title:g?"The worktree is KEPT after the turn so you can look inside it":"The worktree is measured and removed after each turn",onClick:()=>m(D=>!D),children:["๐Ÿ“Œ",g?" keep":" drop"]}):null,s.jsx("textarea",{className:"chat-input-box",value:i,onChange:D=>a(D.target.value),onPaste:Ts,onKeyDown:D=>{D.key==="Enter"&&!D.shiftKey?(D.preventDefault(),Dt(i)):D.key==="ArrowUp"&&i===""&&$e.current&&(D.preventDefault(),a($e.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:Ps,children:"โน Cancel"}):null,s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:o||!i.trim()&&ie.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 bye={running:"โณ running",done:"โœ… done",failed:"โŒ failed",cancelled:"โน cancelled",timeout:"โฐ timed out",error:"๐Ÿ’ฅ error"};function w2({presets:e,customPlaceholder:t,timeoutMs:n=3e5,hint:r}){const[i,a]=N.useState(null),[o,l]=N.useState(!1),[c,u]=N.useState(""),[d,f]=N.useState(""),[h,p]=N.useState(null),[g,m]=N.useState([]),v=N.useRef(null),y=N.useRef(null);N.useEffect(()=>{J.fetchAdminAuthStatus().then(S=>{a(S?{authenticated:S.authenticated,role:S.role??null}:{authenticated:!1,role:null})})},[]),N.useEffect(()=>{var S,x;try{(x=(S=v.current)==null?void 0:S.scrollIntoView)==null||x.call(S,{block:"end"})}catch{}},[g]),N.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"),w=N.useCallback(async(S,x)=>{var T;if(o)return;l(!0),u(""),m([]);const E=await J.startTask(S,x??n);if(!E.ok||!E.task){u(E.error||"Could not start the command."),l(!1);return}const _=E.task;p(_);const C=await J.getTask(_.id);C!=null&&C.task&&m(C.task.logs.map(L=>({stream:L.stream,text:L.text}))),(T=y.current)==null||T.call(y),y.current=J.subscribeTask(_.id,{onLog:L=>m(M=>[...M,{stream:L.stream,text:L.text}]),onStatus:L=>{p(M=>M&&{...M,status:L}),L!=="running"&&l(!1)}})},[o,n]),k=N.useCallback(async()=>{h&&await J.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 w(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 w(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:bye[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,x)=>s.jsx("div",{children:S.text},x)):s.jsx("div",{className:"admin-hint",children:"Waiting for outputโ€ฆ"}),s.jsx("div",{ref:v})]})]}):null]})}const xye=[{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 hj(e){return typeof e!="number"?"โ€”":`${Math.round(e*100)}%`}function wye(e){return new Date(e).toLocaleString()}function Sye({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(w2,{presets:xye,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:wye(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:hj(r.summary.completionRate)}),s.jsx("td",{children:hj(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 kye=[{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 Nye(){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(w2,{presets:kye,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 Fg={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 Eye(){const[e,t]=N.useState(null),[n,r]=N.useState("all"),[i,a]=N.useState(null),[o,l]=N.useState(0),[c,u]=N.useState({}),[d,f]=N.useState(!1),[h,p]=N.useState(null),[g,m]=N.useState({status:"idle"}),[v,y]=N.useState(""),[b,w]=N.useState("Hello from agent-nuvira!"),[k,S]=N.useState(!1),[x,E]=N.useState(null),_=N.useRef(!0),C=N.useCallback(async()=>{const O=await J.getPlatformConfigs();_.current&&t(O)},[]);N.useEffect(()=>(C(),()=>{_.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 U=Fg[O.platform];y((U==null?void 0:U.testTarget)??""),w("Hello from agent-nuvira!"),E(null)},L=async()=>{if(!i)return;m({status:"checking"});const O=await J.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."}))},M=async()=>{if(!i)return;f(!0),p(null);const O=await J.setPlatformConfig(i.platform,c);f(!1),O.ok?(p({kind:"ok",text:"Token saved! Verifying..."}),C(),l(2),L()):p({kind:"err",text:O.error||"Save failed."})},B=async()=>{if(!i||!v)return;S(!0),E(null);const O=await J.sendChannelMessage(v,b);S(!1),O.ok?E({kind:"ok",text:"Message sent via "+O.platform+"! Check your "+i.label+" app."}):E({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,F=e.filter(O=>n==="configured"?O.configured:n==="unconfigured"?!O.configured:!0),z=i?Fg[i.platform]:null;function R(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:F.map(O=>{const U=Fg[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:(U==null?void 0:U.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:(U==null?void 0:U.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&&z?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:z.icon}),s.jsxs("span",{className:"wizard-title",children:["Getting Started: ",i.label]}),s.jsxs("div",{className:"wizard-steps-indicator",children:[s.jsx("span",{className:R(0),children:"1"}),s.jsx("span",{className:R(1),children:"2"}),s.jsx("span",{className:R(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:z.steps.map((O,U)=>s.jsx("li",{children:O},U))}),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:U=>u(A=>({...A,[O.varName]:U.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 M(),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=>w(O.target.value),placeholder:"Hello from agent-nuvira!"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void B(),disabled:k||!v,children:k?"Sending...":"Send test"})]}),x?s.jsx("div",{className:x.kind==="ok"?"admin-row-msg":"admin-row-msg 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:()=>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 _ye=[{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)"}],pj=[{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 jye({canWrite:e,sessionExpired:t}){const[n,r]=N.useState(null),[i,a]=N.useState(null),[o,l]=N.useState(!1),[c,u]=N.useState("overview"),d=N.useRef(!0),[f,h]=N.useState("bearer"),[p,g]=N.useState(""),[m,v]=N.useState(""),[y,b]=N.useState(""),[w,k]=N.useState("us-east-1"),[S,x]=N.useState(pj.filter(I=>I.checked).map(I=>I.name)),[E,_]=N.useState(!1),[C,T]=N.useState(null),L=N.useCallback(async()=>{const I=await J.getBedrockStatus();d.current&&r(I)},[]);N.useEffect(()=>(L(),()=>{d.current=!1}),[L]);const M=async()=>{l(!0),a(null);try{const I=await J.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)}},B=async()=>{_(!0),T(null);try{const I={BEDROCK_REGION:w};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 F=await J.setupBedrock(I);if(!d.current)return;F.ok?(T({kind:"ok",text:"โœ… Configuration saved! Running connectivity testโ€ฆ"}),u("overview"),await L(),setTimeout(()=>void M(),500)):T({kind:"err",text:F.error||"Save failed"})}catch{d.current&&T({kind:"err",text:"Could not reach the dashboard server."})}finally{d.current&&_(!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 M(),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:w,onChange:I=>k(I.target.value),children:_ye.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=${w}#/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:pj.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:F=>{F.target.checked?x(z=>[...z,I.name]):x(z=>z.filter(R=>R!==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 B(),disabled:E||f==="bearer"&&!p||f==="iam"&&(!m||!y),children:E?"โณ 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 Ug=["whatsapp","whatsapp_cloud","telegram","signal","slack","discord","email"];function Aye(){const[e,t]=N.useState([]),[n,r]=N.useState(!0),[i,a]=N.useState("all"),[o,l]=N.useState(null),[c,u]=N.useState(""),[d,f]=N.useState(""),[h,p]=N.useState(null),[g,m]=N.useState({}),[v,y]=N.useState({}),[b,w]=N.useState({}),[k,S]=N.useState(null),[x,E]=N.useState(!1),[_,C]=N.useState(!1),[T,L]=N.useState(!1),[M,B]=N.useState(12e4),I=N.useCallback(async()=>{r(!0);const G=await J.getContacts();G.ok&&G.contacts&&t(G.contacts);const Y=await J.gatewayPolicies();if(Y.ok&&Y.policies){const ae={};for(const le of Ug){const X=Y.policies[le];X&&(ae[le]={...X.outboundSenders!==void 0?{outboundSenders:X.outboundSenders}:{},...X.requireApprovedTarget!==void 0?{requireApprovedTarget:X.requireApprovedTarget}:{}})}m(ae),y(ae)}C(Y.askUserWait===!0),L(Y.askUserWait===!0),typeof Y.askUserTimeoutMs=="number"&&B(Y.askUserTimeoutMs),r(!1)},[]);N.useEffect(()=>{I()},[I]);const F=e.filter(G=>i==="all"||G.status===i),z=async G=>{p(null);const Y=await J.approveContact(G.platform,G.name);p(Y.ok?{kind:"ok",text:`โœ… ${G.name} approved.`}:{kind:"err",text:Y.error||"Failed."}),I()},R=async G=>{p(null);const Y=await J.rejectContact(G.platform,G.name);p(Y.ok?{kind:"ok",text:`๐Ÿšซ ${G.name} rejected.`}:{kind:"err",text:Y.error||"Failed."}),I()},O=async G=>{p(null);const Y=await J.deleteContact(G.platform,G.name);p(Y.ok?{kind:"ok",text:`๐Ÿ—‘๏ธ ${G.name} deleted.`}:{kind:"err",text:Y.error||"Failed."}),I()},U=async()=>{if(!o)return;p(null);const G=await J.updateContact(o.platform,o.id,{name:c,phone:d});p(G.ok?{kind:"ok",text:`โœ… ${c} updated.`}:{kind:"err",text:G.error||"Failed."}),l(null),I()},A=G=>G==="approved"?s.jsx("span",{className:"contact-status-badge approved",children:"โœ… Approved"}):G==="pending"?s.jsx("span",{className:"contact-status-badge pending",children:"โณ Pending"}):s.jsx("span",{className:"contact-status-badge rejected",children:"๐Ÿšซ Rejected"}),Z=G=>({telegram:"โœˆ๏ธ",whatsapp:"๐Ÿ“ฑ",whatsapp_cloud:"๐Ÿ“ฑ",email:"๐Ÿ“ง",slack:"๐Ÿ’ฌ",discord:"๐ŸŽฎ"})[G]||"๐Ÿ”Œ",$=G=>G?new Date(G).toLocaleString():"โ€”",P=G=>{const Y=(b[G]??"").trim();Y&&(m(ae=>{var je;const le={...ae[G]??{}},X=le.outboundSenders??((je=v[G])==null?void 0:je.outboundSenders)??[];return X.some(Ne=>Ne.toLowerCase()===Y.toLowerCase())||(le.outboundSenders=[...X,Y]),{...ae,[G]:le}}),w(ae=>({...ae,[G]:""})))},oe=(G,Y)=>{m(ae=>{var je;const le={...ae[G]??{}},X=le.outboundSenders??((je=v[G])==null?void 0:je.outboundSenders)??[];return le.outboundSenders=X.filter(Ne=>Ne.toLowerCase()!==Y.toLowerCase()),{...ae,[G]:le}})},be=G=>{m(Y=>{const ae={...Y[G]??{}};return ae.requireApprovedTarget=ae.requireApprovedTarget!==!0,{...Y,[G]:ae}})},pe=G=>{m(Y=>{const ae={...Y[G]??{}};return delete ae.outboundSenders,{...Y,[G]:ae}})},Ce=async()=>{E(!0),S(null);const G={};for(const le of Ug){const X=g[le]??{},je=v[le]??{};(JSON.stringify(X.outboundSenders??null)!==JSON.stringify(je.outboundSenders??null)||!!X.requireApprovedTarget!=!!je.requireApprovedTarget)&&(G[le]={...X.outboundSenders!==void 0?{outboundSenders:X.outboundSenders}:{outboundSenders:null},requireApprovedTarget:!!X.requireApprovedTarget})}const Y=_!==T;if(Object.keys(G).length===0&&!Y){E(!1),S({kind:"ok",text:"No changes to save."});return}const ae=await J.saveGatewayPolicies(G,void 0,void 0,{wait:_,timeoutMs:M});ae.ok?(S({kind:"ok",text:"โœ… Send authority saved."}),I()):S({kind:"err",text:ae.error||"Failed to save send authority."}),E(!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(G=>s.jsx("button",{type:"button",className:i===G?"platforms-filter-btn active":"platforms-filter-btn",onClick:()=>a(G),children:G==="all"?`All (${e.length})`:G==="approved"?`โœ… Approved (${e.filter(Y=>Y.status==="approved").length})`:G==="pending"?`โณ Pending (${e.filter(Y=>Y.status==="pending").length})`:`๐Ÿšซ Rejected (${e.filter(Y=>Y.status==="rejected").length})`},G)),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void I(),children:"๐Ÿ”„ Refresh"})]}),n?s.jsx("div",{className:"empty-state",children:"Loading contacts..."}):F.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:F.map(G=>s.jsxs("tr",{className:`contact-row status-${G.status}`,children:[s.jsxs("td",{children:[Z(G.platform)," ",G.platform]}),s.jsx("td",{className:"contact-name",children:G.name}),s.jsx("td",{className:"contact-id",children:s.jsx("code",{children:G.id})}),s.jsx("td",{className:"contact-phone",children:G.phone||"โ€”"}),s.jsx("td",{children:A(G.status)}),s.jsx("td",{className:"contact-date",children:$(G.registeredAt||G.addedAt)}),s.jsxs("td",{className:"contact-actions",children:[G.status!=="approved"&&s.jsx("button",{className:"admin-mini-btn contact-approve-btn",onClick:()=>void z(G),children:"โœ… Approve"}),G.status!=="rejected"&&s.jsx("button",{className:"admin-mini-btn contact-reject-btn",onClick:()=>void R(G),children:"๐Ÿšซ Reject"}),s.jsx("button",{className:"admin-mini-btn",onClick:()=>{l(G),u(G.name),f(G.phone||"")},children:"โœ๏ธ Edit"}),s.jsx("button",{className:"admin-mini-btn contact-delete-btn",onClick:()=>void O(G),children:"๐Ÿ—‘๏ธ"})]})]},`${G.platform}:${G.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:Ug.map(G=>{const Y=g[G]??{},ae=Y.outboundSenders??[],le=Y.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:[Z(G)," ",G]}),le?s.jsx("span",{className:"hub-chip",children:"open"}):s.jsx("span",{className:"hub-chip",children:"restricted"})]}),s.jsx("div",{className:"hub-alias-list",children:le?s.jsx("span",{className:"admin-hint",children:"Open โ€” anyone who can trigger the agent may send to others."}):ae.length===0?s.jsx("span",{className:"admin-hint",children:"(empty โ€” nobody may send to others)"}):ae.map(X=>s.jsxs("div",{className:"hub-alias-row",children:[s.jsx("span",{className:"hub-chip",children:X}),s.jsx("button",{className:"admin-refresh-btn",disabled:x,onClick:()=>oe(G,X),children:"โœ•"})]},`sa-${G}-${X}`))}),s.jsxs("div",{className:"hub-send-form",children:[s.jsx("input",{type:"text",value:b[G]??"",onChange:X=>w(je=>({...je,[G]:X.target.value})),placeholder:"sender id, or Allow-All",disabled:x}),s.jsx("button",{className:"admin-refresh-btn",disabled:x||!(b[G]??"").trim(),onClick:()=>P(G),children:"+ Sender"}),le?null:s.jsx("button",{className:"admin-refresh-btn",disabled:x,onClick:()=>pe(G),children:"โ†บ Reset to open"})]}),s.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginTop:6},children:[s.jsx("input",{type:"checkbox",checked:!!Y.requireApprovedTarget,disabled:x,onChange:()=>be(G)}),s.jsx("span",{className:"admin-hint",children:"Require approved recipients"})]})]},`sa-${G}`)})}),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"}),_?s.jsx("span",{className:"hub-chip",children:"wait for reply"}):s.jsx("span",{className:"hub-chip",children:"assume option 1"}),_!==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:_,disabled:x,onChange:()=>C(G=>!G)}),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."]})]}),_?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(M/1e3),disabled:x,onChange:G=>B(Math.max(5,Math.min(600,Number(G.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:x,onClick:()=>void Ce(),children:"๐Ÿ’พ Save send authority"})}),o&&s.jsx("div",{className:"wizard-overlay",onClick:()=>l(null),children:s.jsxs("div",{className:"wizard-modal",onClick:G=>G.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:G=>u(G.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:G=>f(G.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 U(),children:"Save"})]})]})]})})]})}const mj=["proven-dead","proof-expired","parked","never-verified"];function xo(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 Cye(e){if(e<=0)return"never";const t=(Date.now()-e)/(24*60*60*1e3);return t<1?`${(t*24).toFixed(1)}h`:`${t.toFixed(2)}d`}function Tye({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: ${xo(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: ${xo(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: ${xo(i)}`,children:s.jsx("div",{className:"timeline-bar-fill use",style:{width:`${l}%`}})})]})}function gj(e){return{fontSize:11,padding:"2px 8px",borderRadius:4,background:`${e}20`,color:e,border:`1px solid ${e}40`,whiteSpace:"nowrap"}}function Oye(){const[e,t]=N.useState(null),[n,r]=N.useState(!0),[i,a]=N.useState(null),[o,l]=N.useState("all"),[c,u]=N.useState("provider"),d=N.useRef(!0),f=N.useCallback(async()=>{try{const R=await fetch("/api/model-timeline");if(!R.ok)throw new Error("Failed to fetch timeline data");const O=await R.json();d.current&&(t(O),a(null))}catch(R){d.current&&a(R instanceof Error?R.message:"Failed to load timeline")}finally{d.current&&r(!1)}},[]),[h,p]=N.useState(null),[g,m]=N.useState(10),[v,y]=N.useState(!1),[b,w]=N.useState(null),k=N.useRef(!1),S=N.useCallback(async()=>{const R=await J.fetchVerifyBacklog();if(!d.current)return;p(R);const O=(R==null?void 0:R.status)==="running";k.current&&!O&&f(),k.current=O},[f]);N.useEffect(()=>{d.current=!0,f(),S();const R=setInterval(()=>void f(),3e4);return()=>{d.current=!1,clearInterval(R)}},[f,S]);const x=(h==null?void 0:h.status)==="running";N.useEffect(()=>{if(!x)return;const R=setInterval(()=>void S(),1e3);return()=>clearInterval(R)},[x,S]);const E=N.useCallback(async()=>{y(!0),w(null);const R=await J.startVerifyBacklog(g);if(d.current){if(R.state&&p(R.state),!R.ok){const O=R.refusal??R.error??"Could not start the run.";w({text:O,kind:R.refusal?"info":"error"})}y(!1)}},[g]);if(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})]});if(e&&!e.counts)return s.jsxs("div",{className:"admin-header",children:[s.jsx("h2",{className:"section-title",children:"๐Ÿ“… Model Discovery Timeline"}),s.jsxs("div",{className:"admin-row-msg admin-row-msg-err",children:["This dashboard server predates the reachability view. Restart it (",s.jsx("code",{children:"nuvira dashboard stop"}),", then start it again) and reload this page."]})]});const _=(e==null?void 0:e.entries)??[],C=e==null?void 0:e.counts,T=e==null?void 0:e.reachabilityCopy,L=e==null?void 0:e.freshnessCopy,M=C?mj.reduce((R,O)=>R+(C[O]??0),0):0,B=_.filter(R=>o==="routable"?R.reachability==="routable":o==="not-routable"?R.reachability!=="routable":!0),I=[...B].sort((R,O)=>c==="provider"?R.provider.localeCompare(O.provider)||R.model.localeCompare(O.model):O.lastProbedAt-R.lastProbedAt),F=new Map;for(const R of I){const O=F.get(R.provider);O?O.push(R):F.set(R.provider,[R])}const z=R=>({background:R?"#238636":"#21262d",border:`1px solid ${R?"#3fb950":"#30363d"}`,padding:"4px 12px",fontSize:12,cursor:"pointer"});return s.jsxs("div",{className:"admin-header",children:[s.jsx("h2",{className:"section-title",children:"๐Ÿ“… Model Discovery Timeline"}),s.jsxs("p",{className:"section-description",children:["The registry's age profile: when each tracked model was last probed, last ",s.jsx("em",{children:"verified"}),", and last used โ€” and which ones routing can actually reach. The Models page answers โ€œis it usable right nowโ€; this one answers โ€œwhat is ageing outโ€."]}),s.jsxs("div",{className:"stats-grid",style:{marginBottom:8},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:"Tracked models"})]}),s.jsxs("div",{className:"stat-card",style:{borderColor:"#3fb950"},children:[s.jsx("div",{className:"stat-value",style:{color:"#3fb950"},children:(C==null?void 0:C.routable)??0}),s.jsx("div",{className:"stat-label",children:"Routable now"})]}),s.jsxs("div",{className:"stat-card",style:{borderColor:"#8b949e"},children:[s.jsx("div",{className:"stat-value",style:{color:"#8b949e"},children:M}),s.jsx("div",{className:"stat-label",children:"Not routable"})]})]}),C?s.jsx("div",{style:{display:"flex",gap:14,flexWrap:"wrap",marginBottom:14,fontSize:11},children:mj.map(R=>{const O=T==null?void 0:T[R];return s.jsxs("span",{title:O==null?void 0:O.blurb,children:[s.jsx("span",{style:{color:(O==null?void 0:O.color)??"#8b949e"},children:"โ– "})," ",s.jsxs("span",{style:{color:"#8b949e"},children:[(O==null?void 0:O.label)??R,": ",s.jsx("strong",{style:{color:"#e6edf3"},children:C[R]??0})]})]},R)})}):null,h?s.jsxs("div",{style:{background:"#161b22",border:"1px solid #30363d",borderRadius:8,padding:"12px 14px",marginBottom:16},"data-testid":"verify-backlog-panel",children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[s.jsx("span",{style:{fontWeight:600,color:"#e6edf3"},children:"Work the backlog down"}),s.jsxs("span",{style:{fontSize:11,color:"#8b949e",flex:1,minWidth:260},children:["Each check is a real 1-token generation against one of your provider keys โ€” not a listing lookup. A never-verified model is an ",s.jsx("em",{children:"unknown"}),", not a broken one: a check either proves it routable or marks it proven dead. Runs are bounded and one at a time."]}),s.jsxs("label",{style:{fontSize:11,color:"#8b949e",display:"flex",alignItems:"center",gap:6},children:["How many",s.jsx("input",{type:"number",min:1,max:h.maxCount??25,value:g,disabled:v||x,"aria-label":"how many models to verify",onChange:R=>m(Number(R.target.value)),style:{width:64,background:"#0d1117",color:"#e6edf3",border:"1px solid #30363d",borderRadius:4,padding:"3px 6px",fontSize:12}})]}),s.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:v||x||!(g>0),onClick:()=>void E(),style:{background:"#238636",border:"1px solid #3fb950",padding:"4px 12px",fontSize:12,cursor:v||x?"default":"pointer"},"data-testid":"verify-backlog-start",children:x?"โณ Verifyingโ€ฆ":v?"Startingโ€ฆ":`โ–ถ Verify next ${g} now`})]}),x?s.jsxs("div",{className:"env-var-notice","data-testid":"verify-backlog-progress",children:["Probing"," ",s.jsx("code",{children:h.current?`${h.current.provider}/${h.current.model}`:"โ€ฆ"})," ","โ€” ",h.processed,"/",h.planned," done ยท ",h.verified," verified ยท ",h.unavailable," proven dead"]}):null,!x&&h.status==="done"?s.jsxs("div",{className:"env-var-notice","data-testid":"verify-backlog-summary",children:["โœ… ",h.verified," verified ยท โ›” ",h.unavailable," proven unavailable ยท โš ๏ธ ",h.errored," errored ยท โญ"," ",h.skipped," skipped",h.remaining!==null?` โ€” ${h.remaining} still never verified`:""]}):null,(h.results??[]).length>0?s.jsx("div",{style:{display:"flex",gap:10,flexWrap:"wrap",marginTop:8},children:(h.results??[]).map(R=>s.jsxs("span",{style:{fontSize:11,color:"#8b949e"},title:R.outcome==="verified"?"Proven routable โ€” a 1-token call succeeded":R.outcome==="unavailable"?"Proven dead โ€” the provider refused it (403/404), re-probing will not help":R.outcome==="skipped"?"Skipped โ€” verified recently enough":"Errored โ€” transient, still unknown, will be retried next run",children:[R.outcome==="verified"?"โœ…":R.outcome==="unavailable"?"โ›”":R.outcome==="skipped"?"โญ":"โš ๏ธ"," ",s.jsxs("code",{children:[R.provider,"/",R.model]})]},`${R.provider}:${R.model}`))}):null,b?s.jsx("div",{className:`env-var-notice${b.kind==="error"?" env-var-notice-error":""}`,"data-testid":"verify-backlog-message",children:b.text}):h.status==="idle"&&h.refusal?s.jsx("div",{className:"env-var-notice","data-testid":"verify-backlog-message",children:h.refusal}):null]}):null,s.jsxs("div",{style:{display:"flex",gap:8,marginBottom:16,flexWrap:"wrap"},children:[s.jsx("div",{style:{display:"flex",gap:4},children:["all","routable","not-routable"].map(R=>s.jsx("button",{className:`admin-refresh-btn ${o===R?"active":""}`,onClick:()=>l(R),style:z(o===R),children:R==="all"?"All":R==="routable"?"Routable":"Not routable"},R))}),s.jsx("div",{style:{display:"flex",gap:4},children:["provider","lastProbed"].map(R=>s.jsxs("button",{className:`admin-refresh-btn ${c===R?"active":""}`,onClick:()=>u(R),style:z(c===R),children:["Sort: ",R==="lastProbed"?"Last seen":"Provider"]},R))}),s.jsx("button",{className:"admin-refresh-btn",onClick:()=>void 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:4,fontSize:11,color:"#8b949e",flexWrap:"wrap"},children:[s.jsxs("span",{children:[s.jsx("span",{style:{color:"#58a6ff"},children:"โ– "})," Probe (last seen in the provider's catalog)"]}),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.jsxs("div",{style:{marginBottom:12,fontSize:11,color:"#8b949e"},children:[s.jsx("strong",{style:{color:"#e6edf3"},children:"Fresh"})," means the provider still lists it."," ",s.jsx("strong",{style:{color:"#e6edf3"},children:"Routable"})," means a turn has been proven to work on it within"," ",(e==null?void 0:e.freshDays)??7," days. A fresh model that was never verified is an unknown, not a failure โ€” background spot-checks work through those a few at a time."]}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from(F.entries()).map(([R,O])=>{const U=O.filter(A=>A.reachability==="routable").length;return 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:R==="groq"?"โšก":R==="gemini"?"๐ŸŒ€":R==="local"?"๐Ÿ’ป":"๐Ÿค–"}),s.jsx("span",{style:{fontWeight:600,color:"#e6edf3"},children:R}),s.jsxs("span",{style:{fontSize:12,color:"#8b949e"},children:["(",O.length," shown ยท ",U," routable)"]})]}),s.jsx("div",{style:{padding:"8px 14px"},children:O.map(A=>{const Z=Date.now(),$=T==null?void 0:T[A.reachability],P=L==null?void 0:L[A.freshness],oe=($==null?void 0:$.color)??"#8b949e";return s.jsxs("div",{"data-testid":`timeline-row-${A.provider}-${A.model}`,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:A.model}),s.jsxs("div",{style:{fontSize:11,color:"#8b949e",display:"flex",gap:12,flexWrap:"wrap"},children:[s.jsxs("span",{children:["Probed: ",xo(Z-A.lastProbedAt)]}),s.jsxs("span",{children:["Verified: ",A.lastVerifiedAt>0?xo(Z-A.lastVerifiedAt):"never"]}),A.lastUsedAt>0&&s.jsxs("span",{children:["Used: ",xo(Z-A.lastUsedAt)]}),A.latencyMs!==void 0&&s.jsxs("span",{children:[A.latencyMs,"ms"]}),A.errorRate>0&&s.jsxs("span",{style:{color:A.errorRate>.5?"#f85149":"#d29922"},children:["err ",(A.errorRate*100).toFixed(0),"%"]}),A.daysSinceVerify!==null&&A.daysSinceVerify>7&&s.jsxs("span",{style:{color:"#d29922"},children:["proof ",Cye(A.lastVerifiedAt)," old"]})]})]}),s.jsx(Tye,{entry:A}),P&&s.jsx("span",{style:gj(P.color),title:P.blurb,children:P.label}),s.jsx("span",{style:gj(oe),title:($==null?void 0:$.blurb)??A.reachability,"data-testid":`reachability-${A.provider}-${A.model}`,children:(($==null?void 0:$.label)??A.reachability).toUpperCase()})]},A.model)})})]},R)})}),B.length===0&&s.jsx("div",{style:{textAlign:"center",padding:"40px 20px",color:"#8b949e"},children:o==="routable"&&_.length>0?"No model is routable right now โ€” every tracked model is unverified, parked, expired or dead. The Models page shows what each provider would offer live.":"No models match the current filter"})]})}function Ma(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":gt(e)}function Pye(e){return e==null?"0%":(e*100).toFixed(1)+"%"}function Rye({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:Ma(t.total)}),s.jsx("div",{className:"stat-label",children:"Trajectories"})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-value",children:Pye(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:Ma((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:Ma(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:Ma(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:Ma(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?` ยท ${Ma(a.last7d)} recall(s) this week, ${Ma(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 Mye(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Iye({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:["๐Ÿ“… ",Mye(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 $ye({onFetch:e,onClear:t,onExport:n}){const[r,i]=N.useState([]),[a,o]=N.useState(!1),[l,c]=N.useState(""),[u,d]=N.useState(""),[f,h]=N.useState(null),[p,g]=N.useState(null);N.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,x=k.filter(C=>C.status==="success").length,E=k.filter(C=>C.status==="failure").length,_=S>0?Math.round(k.reduce((C,T)=>C+T.durationMs,0)/S):0;g({total:S,success:x,failure:E,avgDuration:_})}catch(k){console.error("Failed to fetch execution history:",k)}finally{o(!1)}},v=async k=>{if(n)try{const S=await n(k),x=new Blob([S],{type:k==="json"?"application/json":"text/csv"}),E=URL.createObjectURL(x),_=document.createElement("a");_.href=E,_.download=`execution-history.${k}`,_.click(),URL.revokeObjectURL(E)}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"โ“"}},w=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:[w(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 Lye({envVars:e,onSave:t,onDelete:n,onTest:r,readOnly:i=!1}){const[a,o]=N.useState(null),[l,c]=N.useState(""),[u,d]=N.useState(!1),[f,h]=N.useState(""),[p,g]=N.useState(""),[m,v]=N.useState(null),[y,b]=N.useState({}),w=[...e].sort((E,_)=>E.requiredBy&&!_.requiredBy?-1:!E.requiredBy&&_.requiredBy?1:E.name.localeCompare(_.name)),k=E=>{t(E,l),o(null),c("")},S=()=>{f&&p&&(t(f,p),h(""),g(""),d(!1))},x=async E=>{if(r){v(E);try{const _=await r(E);b(C=>({...C,[E]:_}))}catch{b(_=>({..._,[E]:!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:E=>h(E.target.value)}),s.jsx("input",{className:"env-var-input",type:"password",placeholder:"Value",value:p,onChange:E=>g(E.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:w.length===0?s.jsx("div",{className:"env-var-empty",children:"No environment variables configured. Add one to get started."}):w.map(E=>s.jsxs("div",{className:`env-var-row ${E.isSet?"env-var-set":"env-var-missing"} ${E.isProviderCredential?"env-var-blocked":""}`,children:[s.jsxs("div",{className:"env-var-row-header",children:[s.jsxs("span",{className:"env-var-name",children:[E.name,E.requiredBy&&s.jsxs("span",{className:"env-var-required-badge",children:["required by ",E.requiredBy]}),E.isProviderCredential&&s.jsx("span",{className:"env-var-blocked-badge",children:"๐Ÿ”’ provider credential (blocked)"})]}),s.jsx("span",{className:"env-var-status",children:E.isSet?"โœ… Set":"โŒ Not set"})]}),E.description&&s.jsx("div",{className:"env-var-description",children:E.description}),a===E.name?s.jsxs("div",{className:"env-var-edit",children:[s.jsx("input",{className:"env-var-input",type:"password",value:l,onChange:_=>c(_.target.value),placeholder:"Enter new value..."}),s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>k(E.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&&!E.isProviderCredential&&s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>{o(E.name),c("")},children:"โœ๏ธ Edit"}),r&&s.jsx("button",{className:"admin-mini-btn",type:"button",disabled:m===E.name,onClick:()=>x(E.name),children:m===E.name?"โณ Testing...":"๐Ÿงช Test"}),!i&&s.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",onClick:()=>n(E.name),children:"๐Ÿ—‘๏ธ Delete"}),y[E.name]!==void 0&&s.jsx("span",{className:`env-var-test-result ${y[E.name]?"env-var-test-pass":"env-var-test-fail"}`,children:y[E.name]?"โœ… Valid":"โŒ Invalid"})]})]},E.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 Dye(){const[e,t]=N.useState({configured:!1,authenticated:!1,role:null}),[n,r]=N.useState([]),[i,a]=N.useState(!0),[o,l]=N.useState(null),[c,u]=N.useState(null),d=e.authenticated&&(e.role==="admin"||e.role==="operator"),f=N.useCallback(async()=>{a(!0);const m=await J.fetchSkillEnv();r(m),a(!1)},[]);N.useEffect(()=>{J.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=N.useCallback(async(m,v)=>{var w;l(null),u(null);const y=await J.saveSecrets({[m]:v}),b=(w=y.refused)==null?void 0:w.find(k=>k.name===m);!y.ok||b?l(b?Bye(m,b.reason):y.error||`Could not save ${m}.`):u(`Saved ${m}.`),await f()},[f]),p=N.useCallback(async m=>{l(null),u(null);const v=await J.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=N.useCallback(async m=>{const v=await J.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(Lye,{envVars:n,onSave:(m,v)=>void h(m,v),onDelete:m=>void p(m),onTest:g,readOnly:!d})]})}function Bye(e,t){switch(t){case"provider-credential":return`${e} is a provider credential โ€” configure it in provider setup instead. Skills never receive it.`;case"invalid-name":return`${e} is not a valid environment variable name.`;case"write-failed":return`${e} could not be written to the env file.`;default:return`${e} was not saved (${t}).`}}const zye=[{id:"turn",title:"Turn behaviour",blurb:"How each turn runs. Unset means nobody has asked for anything, which is not the same as asking for no."},{id:"observability",title:"Observability",blurb:"What a run records about itself. Both are off by default and off unless asked for."},{id:"hooks",title:"Tool hooks",blurb:"A command run around every tool call, with the call on stdin as JSON. For a phase, a value here REPLACES the hooks declared in tools.hooks."}];function Fye(){const[e,t]=N.useState({configured:!1,authenticated:!1,role:null}),[n,r]=N.useState([]),[i,a]=N.useState(!0),[o,l]=N.useState(null),[c,u]=N.useState(null),[d,f]=N.useState({}),[h,p]=N.useState(null),g=e.authenticated&&(e.role==="admin"||e.role==="operator"),m=N.useCallback(async()=>{a(!0),r(await J.fetchProcessEnv()),a(!1)},[]);N.useEffect(()=>{J.fetchAdminAuthStatus().then(b=>{t(b?{configured:b.configured,authenticated:b.authenticated,role:b.role??null}:{configured:!1,authenticated:!1,role:null})}),m()},[m]);const v=N.useCallback(async(b,w)=>{p(b),l(null),u(null);const k=await J.saveProcessEnvVar(b,w);if(!k.ok||!k.row)l(k.error||`Could not set ${b}.`);else{const S=k.row;r(x=>x.map(E=>E.name===S.name?S:E)),f(x=>({...x,[b]:""})),u(`${b} = ${S.fileValue}. Takes effect on the next turn; the dashboard picked it up immediately.`)}p(null)},[]),y=N.useCallback(async b=>{p(b),l(null),u(null);const w=await J.deleteProcessEnvVar(b);if(!w.ok||!w.row)l(w.error||`Could not unset ${b}.`);else{const k=w.row;r(S=>S.map(x=>x.name===k.name?k:x)),f(S=>({...S,[b]:""})),u(w.removed?`${b} removed from the env file. ${k.unsetMeans}`:`${b} had no line in the env file. ${k.unsetMeans}`)}p(null)},[]);return s.jsxs("div",{children:[s.jsx("h2",{className:"section-title",children:"๐ŸŒฑ Process Environment"}),s.jsxs("div",{className:"env-var-header",children:[s.jsx("span",{className:"env-var-title",children:"These are the switches Agent-Nuvira reads for how a run behaves. Values are written to the credential env file and are not masked โ€” do not put a secret in a hook command."}),s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void m(),children:"โ†ป Refresh"})]}),s.jsxs("div",{className:"admin-hint",children:["A value exported in your shell ",s.jsx("strong",{children:"wins over this file"}),", for the dashboard and for every CLI run in that shell. A row that says ",s.jsx("em",{children:"shell value wins"})," is reporting exactly that, and writes here will not change it."]}),e.authenticated?null:s.jsx("div",{className:"admin-hint",children:e.configured?"Log in to view or change the process environment.":"Set up an admin account to change the process environment."}),e.authenticated&&!g?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โ€ฆ"}):zye.map(b=>{const w=n.filter(k=>k.group===b.id);return w.length===0?null:s.jsxs("section",{className:"process-env-group",children:[s.jsx("h3",{className:"process-env-group-title",children:b.title}),s.jsx("p",{className:"process-env-group-blurb",children:b.blurb}),s.jsx("div",{className:"env-var-list",children:w.map(k=>s.jsx(Uye,{row:k,draft:d[k.name]??"",busy:h===k.name,readOnly:!g,onDraft:S=>f(x=>({...x,[k.name]:S})),onSet:S=>void v(k.name,S),onUnset:()=>void y(k.name)},k.name))})]},b.id)})]})}function Uye({row:e,draft:t,busy:n,readOnly:r,onDraft:i,onSet:a,onUnset:o}){const l=e.state==="on",c=e.state!=="unset",u=f=>`admin-mini-btn${f?" process-env-active":""}`,d=e.kind==="flag"&&e.fileValue!==null&&e.fileValue!=="1"&&e.fileValue!=="0"?e.fileValue:null;return s.jsxs("div",{className:`env-var-row ${c?"env-var-set":"env-var-missing"}`,"data-testid":`process-env-row-${e.name}`,children:[s.jsxs("div",{className:"env-var-row-header",children:[s.jsxs("span",{className:"env-var-name",children:[e.name,e.shadowed?s.jsxs("span",{className:"env-var-blocked-badge",children:["โš ๏ธ shell value wins: ",e.processValue]}):null]}),s.jsxs("span",{className:"env-var-status",children:[e.kind==="flag"?l?"โœ… On":c?"โญ• Off":"โž– Unset":c?"โœ… Set":"โž– Unset",d?` (${d})`:""]})]}),s.jsxs("div",{className:"env-var-description",children:[s.jsx("strong",{children:e.label})," โ€” ",e.description]}),s.jsxs("div",{className:"env-var-description",children:["Unset: ",e.unsetMeans]}),e.cliEquivalent?s.jsxs("div",{className:"env-var-description",children:["Same switch: ",s.jsx("code",{children:e.cliEquivalent})]}):null,e.warning?s.jsxs("div",{className:"env-var-warning",children:["โš ๏ธ ",e.warning]}):null,r?null:s.jsxs("div",{className:"env-var-actions",children:[e.kind==="flag"?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:u(l),type:"button",disabled:n,onClick:()=>a("1"),children:"On"}),s.jsx("button",{className:u(c&&!l),type:"button",disabled:n,onClick:()=>a("0"),children:"Off"}),s.jsx("button",{className:u(!c),type:"button",disabled:n,onClick:o,children:"Unset"})]}):null,e.kind==="text"||e.acceptsValue?s.jsxs(s.Fragment,{children:[s.jsx("input",{className:"env-var-input",type:"text",value:t,placeholder:e.placeholder,disabled:n,onChange:f=>i(f.target.value),"aria-label":`${e.name} value`}),s.jsxs("button",{className:"admin-mini-btn",type:"button",disabled:n||t.trim()==="",onClick:()=>a(t),children:["๐Ÿ’พ ",e.valueLabel??"Save"]})]}):null,e.kind==="text"?s.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",disabled:n,onClick:o,children:"๐Ÿ—‘๏ธ Unset"}):null]})]})}function Wye(){const[e,t]=N.useState(null),[n,r]=N.useState(!1),[i,a]=N.useState("--"),o=N.useCallback(c=>{t(c),a(new Date().toLocaleTimeString())},[]),l=N.useCallback(c=>{r(c)},[]);return N.useEffect(()=>{J.fetchAll().then(d=>{d&&o(d)});const c=J.subscribe(o),u=J.onConnectionChange(l);return J.connect(),()=>{c(),u(),J.disconnect()}},[o,l]),s.jsx(lD,{connected:n,lastUpdated:i,children:s.jsxs(FL,{children:[s.jsx(tt,{path:"/",element:s.jsx(fj,{})}),s.jsx(tt,{path:"/overview",element:s.jsx(zie,{data:e})}),s.jsx(tt,{path:"/chat",element:s.jsx(k1,{to:"/",replace:!0})}),s.jsx(tt,{path:"/dag",element:s.jsx(Xie,{data:e})}),s.jsx(tt,{path:"/costs",element:s.jsx(Qie,{data:e})}),s.jsx(tt,{path:"/benchmarks",element:s.jsx(eae,{data:e})}),s.jsx(tt,{path:"/models",element:s.jsx(Lae,{})}),s.jsx(tt,{path:"/models/timeline",element:s.jsx(Oye,{})}),s.jsx(tt,{path:"/routing",element:s.jsx(vse,{data:e})}),s.jsx(tt,{path:"/requests",element:s.jsx(wse,{data:e})}),s.jsx(tt,{path:"/traces",element:s.jsx(Pse,{})}),s.jsx(tt,{path:"/hub",element:s.jsx(qse,{})}),s.jsx(tt,{path:"/tasks",element:s.jsx(Yse,{})}),s.jsx(tt,{path:"/chat",element:s.jsx(fj,{})}),s.jsx(tt,{path:"/evals",element:s.jsx(Sye,{data:e})}),s.jsx(tt,{path:"/platforms",element:s.jsx(Eye,{})}),s.jsx(tt,{path:"/bedrock",element:s.jsx(jye,{canWrite:!0,sessionExpired:c=>console.error(c)})}),s.jsx(tt,{path:"/contacts",element:s.jsx(Aye,{})}),s.jsx(tt,{path:"/gateway",element:s.jsx(Nye,{})}),s.jsx(tt,{path:"/env",element:s.jsx(Dye,{})}),s.jsx(tt,{path:"/process-env",element:s.jsx(Fye,{})}),s.jsx(tt,{path:"/memory",element:s.jsx(Rye,{data:e})}),s.jsx(tt,{path:"/history",element:s.jsx(Iye,{data:e})}),s.jsx(tt,{path:"/executions",element:s.jsx($ye,{onFetch:c=>J.fetchExecutionAudit(c)})}),s.jsx(tt,{path:"/system",element:s.jsx(tae,{data:e})}),s.jsx(tt,{path:"/admin",element:s.jsx(Lse,{})}),s.jsx(tt,{path:"*",element:s.jsx(k1,{to:"/",replace:!0})})]})})}CC(document.getElementById("root")).render(s.jsx(N.StrictMode,{children:s.jsx(YL,{children:s.jsx(Wye,{})})}));
207
+ //# sourceMappingURL=index-CsySzR41.js.map