agentstudio 0.1.18 → 0.1.21

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 (664) hide show
  1. package/README.md +26 -505
  2. package/bin/agentstudio.js +305 -0
  3. package/bin/agentstudio.js.map +1 -0
  4. package/bin/serviceManager.d.ts +16 -0
  5. package/bin/serviceManager.d.ts.map +1 -0
  6. package/bin/serviceManager.js +434 -0
  7. package/bin/serviceManager.js.map +1 -0
  8. package/config/index.d.ts +74 -0
  9. package/config/index.d.ts.map +1 -0
  10. package/config/index.js +166 -0
  11. package/config/index.js.map +1 -0
  12. package/config/paths.d.ts +81 -0
  13. package/config/paths.d.ts.map +1 -0
  14. package/config/paths.js +98 -0
  15. package/config/paths.js.map +1 -0
  16. package/index.d.ts +4 -0
  17. package/index.d.ts.map +1 -0
  18. package/index.js +369 -0
  19. package/index.js.map +1 -0
  20. package/jobs/taskTimeoutMonitor.d.ts +25 -0
  21. package/jobs/taskTimeoutMonitor.d.ts.map +1 -0
  22. package/jobs/taskTimeoutMonitor.js +94 -0
  23. package/jobs/taskTimeoutMonitor.js.map +1 -0
  24. package/middleware/a2aAuth.d.ts +38 -0
  25. package/middleware/a2aAuth.d.ts.map +1 -0
  26. package/middleware/a2aAuth.js +134 -0
  27. package/middleware/a2aAuth.js.map +1 -0
  28. package/{backend/dist/middleware → middleware}/auth.d.ts +3 -1
  29. package/middleware/auth.d.ts.map +1 -0
  30. package/middleware/auth.js +35 -0
  31. package/middleware/auth.js.map +1 -0
  32. package/middleware/httpsOnly.d.ts +38 -0
  33. package/middleware/httpsOnly.d.ts.map +1 -0
  34. package/middleware/httpsOnly.js +105 -0
  35. package/middleware/httpsOnly.js.map +1 -0
  36. package/middleware/rateLimiting.d.ts +37 -0
  37. package/middleware/rateLimiting.d.ts.map +1 -0
  38. package/middleware/rateLimiting.js +118 -0
  39. package/middleware/rateLimiting.js.map +1 -0
  40. package/package.json +43 -38
  41. package/public/assets/AgentsPage-Nvg2xu6K.js +10 -0
  42. package/public/assets/Button-Co56C389.js +1 -0
  43. package/public/assets/ChatPage-D6sol0ad.js +442 -0
  44. package/public/assets/CommandForm-Bk7F_HU8.js +7 -0
  45. package/public/assets/CommandsPage-DZHyOdKd.js +1 -0
  46. package/public/assets/DashboardPage-29qC7Ev1.js +15 -0
  47. package/public/assets/FileBrowser-BYweUPH4.js +6 -0
  48. package/public/assets/FileExplorer-DNYj6Tsx.js +1 -0
  49. package/public/assets/GeneralSettingsPage-D9Xa7Nd8.js +1 -0
  50. package/public/assets/LandingPage-CjnT-cvO.js +1 -0
  51. package/public/assets/LoginPage-DcaGNCXH.js +16 -0
  52. package/public/assets/McpAdminSettingsPage-DgR3E2Bd.js +7 -0
  53. package/public/assets/McpPage-CtWf1CoL.js +40 -0
  54. package/public/assets/MemorySettingsPage-JTry4Ccp.js +1 -0
  55. package/public/assets/PluginsPage-D-BHjQ3P.js +1 -0
  56. package/public/assets/ProjectSelector-DSXOjMQC.js +1 -0
  57. package/public/assets/ProjectsPage-lLUk4-Xa.js +21 -0
  58. package/public/assets/ScheduledTasksPage-5hPbd9Vs.js +1 -0
  59. package/public/assets/SettingsLayout-DGJspXLp.js +1 -0
  60. package/public/assets/SkillsPage-DBw0m7D2.js +18 -0
  61. package/{backend/dist/frontend/assets/SubagentForm-DXtTTIKg.js → public/assets/SubagentForm-BdUK1U4y.js} +2 -2
  62. package/public/assets/SubagentsPage-Dnq70IFd.js +1 -0
  63. package/{backend/dist/frontend/assets/ToastTestPage-DT4wuN5C.js → public/assets/ToastTestPage-BfJQRFIm.js} +1 -1
  64. package/public/assets/ToolsList-Dl5F2fWk.js +1 -0
  65. package/public/assets/UnifiedToolSelector-CNbPsiuq.js +1 -0
  66. package/public/assets/VersionSettingsPage-BfoCcham.js +5 -0
  67. package/public/assets/_basePickBy-7C_e0Xv1.js +1 -0
  68. package/public/assets/_baseUniq-eGJNLBzx.js +1 -0
  69. package/public/assets/agents-ChrA1R0y.js +1 -0
  70. package/public/assets/arc-CuA752eE.js +1 -0
  71. package/public/assets/architectureDiagram-VXUJARFQ-BnPYh1OW.js +36 -0
  72. package/public/assets/blockDiagram-VD42YOAC-72nsMt_i.js +122 -0
  73. package/public/assets/c4Diagram-YG6GDRKO-BNJSAXcg.js +10 -0
  74. package/public/assets/channel-CIunGC5m.js +1 -0
  75. package/public/assets/chunk-4BX2VUAB-RPxkCWhH.js +1 -0
  76. package/public/assets/chunk-55IACEB6-3ePDt0kp.js +1 -0
  77. package/public/assets/chunk-B4BG7PRW-CBg_BBfl.js +165 -0
  78. package/public/assets/chunk-DI55MBZ5-DIh69TUJ.js +220 -0
  79. package/public/assets/chunk-FMBD7UC4-BbjwhyTe.js +15 -0
  80. package/public/assets/chunk-QN33PNHL-BpH-o_YR.js +1 -0
  81. package/public/assets/chunk-QZHKN3VN-DYB7rh5Q.js +1 -0
  82. package/public/assets/chunk-TZMSLE5B-DPCYEVb3.js +1 -0
  83. package/public/assets/classDiagram-2ON5EDUG-aUQHFsTA.js +1 -0
  84. package/public/assets/classDiagram-v2-WZHVMYZB-aUQHFsTA.js +1 -0
  85. package/public/assets/clone-Ckf7tA1V.js +1 -0
  86. package/public/assets/cose-bilkent-S5V4N54A-CnpfmL-Y.js +1 -0
  87. package/public/assets/cytoscape.esm-DtBltrT8.js +331 -0
  88. package/public/assets/dagre-6UL2VRFP-DR9x77Xf.js +4 -0
  89. package/{backend/dist/frontend/assets/data-structures-DLJedtzx.js → public/assets/data-structures-C0h9Oap1.js} +1 -1
  90. package/public/assets/defaultLocale-C4B-KCzX.js +1 -0
  91. package/public/assets/diagram-PSM6KHXK-SONPsQNx.js +24 -0
  92. package/public/assets/diagram-QEK2KX5R-BKYFSfC1.js +43 -0
  93. package/public/assets/diagram-S2PKOQOG-CkM0APZj.js +24 -0
  94. package/public/assets/erDiagram-Q2GNP2WA-BX1DpOGx.js +60 -0
  95. package/public/assets/flowDiagram-NV44I4VS-HAAlzNbq.js +162 -0
  96. package/public/assets/ganttDiagram-LVOFAZNH-BqzWexqa.js +267 -0
  97. package/public/assets/gitGraphDiagram-NY62KEGX-CIPmSp43.js +65 -0
  98. package/public/assets/graph-m515btDj.js +1 -0
  99. package/public/assets/index-Bn3v3S9-.js +293 -0
  100. package/public/assets/index-DWieeYj4.css +1 -0
  101. package/public/assets/infoDiagram-F6ZHWCRC-Pn4yNWrF.js +2 -0
  102. package/public/assets/init-Gi6I4Gst.js +1 -0
  103. package/public/assets/journeyDiagram-XKPGCS4Q-BfzTomS0.js +139 -0
  104. package/public/assets/kanban-definition-3W4ZIXB7-Cgju7b-L.js +89 -0
  105. package/public/assets/katex-qrhCpa0F.js +261 -0
  106. package/public/assets/layout-BKQfQSxJ.js +1 -0
  107. package/public/assets/linear-DigtLz3B.js +1 -0
  108. package/public/assets/mindmap-definition-VGOIOE7T-qopraVFy.js +68 -0
  109. package/public/assets/monaco-editor-DHKm5-VF.js +19 -0
  110. package/public/assets/ordinal-Cboi1Yqb.js +1 -0
  111. package/public/assets/pieDiagram-ADFJNKIX-BcoaAI-L.js +30 -0
  112. package/public/assets/quadrantDiagram-AYHSOK5B-D-DwcoSd.js +7 -0
  113. package/public/assets/requirementDiagram-UZGBJVZJ-DbQCpx77.js +64 -0
  114. package/public/assets/sankeyDiagram-TZEHDZUN-BVk8387S.js +10 -0
  115. package/public/assets/sequenceDiagram-WL72ISMW-BdzICjxO.js +145 -0
  116. package/public/assets/stateDiagram-FKZM4ZOC-CYY-uUvJ.js +1 -0
  117. package/public/assets/stateDiagram-v2-4FDKWEC3-Dh2Kvomq.js +1 -0
  118. package/{backend/dist/frontend/assets/syntax-highlighting-YWvMU4Hm.js → public/assets/syntax-highlighting-CnREyncB.js} +5 -5
  119. package/public/assets/tabManager-B2LQO_Ll.js +30 -0
  120. package/{backend/dist/frontend/assets/table-D6q1rytw.js → public/assets/table-D0L2RL5i.js} +1 -1
  121. package/public/assets/timeline-definition-IT6M3QCI-BAvjPYvX.js +61 -0
  122. package/public/assets/tools-IcPNZlPj.js +1 -0
  123. package/public/assets/treemap-KMMF4GRG-DtkpVA56.js +128 -0
  124. package/{backend/dist/frontend/assets/ui-components-Cw21Epuw.js → public/assets/ui-components-D1St49qC.js} +231 -96
  125. package/public/assets/useAgents-BnDTkOG8.js +2 -0
  126. package/public/assets/useClaudeVersions-CD59tFWM.js +1 -0
  127. package/public/assets/useCommands-mvMu3mMD.js +1 -0
  128. package/public/assets/useProjects-YXOjaOwL.js +1 -0
  129. package/public/assets/xychartDiagram-PRI3JC2R-ByBTDWE2.js +7 -0
  130. package/{backend/dist/frontend → public}/index.html +8 -8
  131. package/routes/__tests__/a2a.integration.test.d.ts +11 -0
  132. package/routes/__tests__/a2a.integration.test.d.ts.map +1 -0
  133. package/routes/__tests__/a2a.integration.test.js +314 -0
  134. package/routes/__tests__/a2a.integration.test.js.map +1 -0
  135. package/routes/__tests__/a2a.test.d.ts +6 -0
  136. package/routes/__tests__/a2a.test.d.ts.map +1 -0
  137. package/routes/__tests__/a2a.test.js +622 -0
  138. package/routes/__tests__/a2a.test.js.map +1 -0
  139. package/routes/__tests__/agents.test.d.ts +6 -0
  140. package/routes/__tests__/agents.test.d.ts.map +1 -0
  141. package/routes/__tests__/agents.test.js +315 -0
  142. package/routes/__tests__/agents.test.js.map +1 -0
  143. package/routes/__tests__/sessions.test.d.ts +7 -0
  144. package/routes/__tests__/sessions.test.d.ts.map +1 -0
  145. package/routes/__tests__/sessions.test.js +330 -0
  146. package/routes/__tests__/sessions.test.js.map +1 -0
  147. package/routes/a2a.d.ts +18 -0
  148. package/routes/a2a.d.ts.map +1 -0
  149. package/routes/a2a.js +649 -0
  150. package/routes/a2a.js.map +1 -0
  151. package/routes/a2a.streaming.test.d.ts +2 -0
  152. package/routes/a2a.streaming.test.d.ts.map +1 -0
  153. package/routes/a2a.streaming.test.js +167 -0
  154. package/routes/a2a.streaming.test.js.map +1 -0
  155. package/routes/a2aManagement.d.ts +21 -0
  156. package/routes/a2aManagement.d.ts.map +1 -0
  157. package/routes/a2aManagement.js +466 -0
  158. package/routes/a2aManagement.js.map +1 -0
  159. package/{backend/dist/routes → routes}/agents.d.ts.map +1 -1
  160. package/routes/agents.js +997 -0
  161. package/routes/agents.js.map +1 -0
  162. package/{backend/dist/routes → routes}/auth.d.ts.map +1 -1
  163. package/routes/auth.js +135 -0
  164. package/routes/auth.js.map +1 -0
  165. package/{backend/dist/routes → routes}/commands.d.ts.map +1 -1
  166. package/{backend/dist/routes → routes}/commands.js +115 -31
  167. package/routes/commands.js.map +1 -0
  168. package/routes/config.d.ts +4 -0
  169. package/routes/config.d.ts.map +1 -0
  170. package/routes/config.js +211 -0
  171. package/routes/config.js.map +1 -0
  172. package/{backend/dist/routes → routes}/files.d.ts.map +1 -1
  173. package/{backend/dist/routes → routes}/files.js +103 -43
  174. package/routes/files.js.map +1 -0
  175. package/routes/mcp.d.ts +27 -0
  176. package/routes/mcp.d.ts.map +1 -0
  177. package/{backend/dist/routes → routes}/mcp.js +195 -105
  178. package/routes/mcp.js.map +1 -0
  179. package/routes/mcpAdmin.d.ts +16 -0
  180. package/routes/mcpAdmin.d.ts.map +1 -0
  181. package/routes/mcpAdmin.js +308 -0
  182. package/routes/mcpAdmin.js.map +1 -0
  183. package/routes/mcpAdminManagement.d.ts +17 -0
  184. package/routes/mcpAdminManagement.d.ts.map +1 -0
  185. package/routes/mcpAdminManagement.js +345 -0
  186. package/routes/mcpAdminManagement.js.map +1 -0
  187. package/routes/media.d.ts.map +1 -0
  188. package/{backend/dist/routes → routes}/media.js +52 -42
  189. package/routes/media.js.map +1 -0
  190. package/routes/mediaAuth.d.ts +8 -0
  191. package/routes/mediaAuth.d.ts.map +1 -0
  192. package/routes/mediaAuth.js +136 -0
  193. package/routes/mediaAuth.js.map +1 -0
  194. package/routes/plugins.d.ts +4 -0
  195. package/routes/plugins.d.ts.map +1 -0
  196. package/routes/plugins.js +339 -0
  197. package/routes/plugins.js.map +1 -0
  198. package/{backend/dist/routes → routes}/projects.d.ts.map +1 -1
  199. package/routes/projects.js +884 -0
  200. package/routes/projects.js.map +1 -0
  201. package/routes/scheduledTasks.d.ts +9 -0
  202. package/routes/scheduledTasks.d.ts.map +1 -0
  203. package/routes/scheduledTasks.js +320 -0
  204. package/routes/scheduledTasks.js.map +1 -0
  205. package/{backend/dist/routes → routes}/sessions.d.ts.map +1 -1
  206. package/{backend/dist/routes → routes}/sessions.js +258 -39
  207. package/routes/sessions.js.map +1 -0
  208. package/{backend/dist/routes → routes}/settings.d.ts.map +1 -1
  209. package/{backend/dist/routes → routes}/settings.js +82 -241
  210. package/routes/settings.js.map +1 -0
  211. package/{backend/dist/routes/mcp.d.ts → routes/skills.d.ts} +1 -1
  212. package/routes/skills.d.ts.map +1 -0
  213. package/routes/skills.js +272 -0
  214. package/routes/skills.js.map +1 -0
  215. package/routes/slack.d.ts +10 -0
  216. package/routes/slack.d.ts.map +1 -0
  217. package/routes/slack.js +189 -0
  218. package/routes/slack.js.map +1 -0
  219. package/{backend/dist/routes → routes}/slides.d.ts.map +1 -1
  220. package/{backend/dist/routes → routes}/slides.js +29 -27
  221. package/routes/slides.js.map +1 -0
  222. package/{backend/dist/routes → routes}/subagents.js +27 -22
  223. package/routes/subagents.js.map +1 -0
  224. package/schemas/a2a.d.ts +858 -0
  225. package/schemas/a2a.d.ts.map +1 -0
  226. package/schemas/a2a.js +300 -0
  227. package/schemas/a2a.js.map +1 -0
  228. package/scripts/postinstall.js +10 -0
  229. package/services/__tests__/pluginInstaller.test.d.ts +5 -0
  230. package/services/__tests__/pluginInstaller.test.d.ts.map +1 -0
  231. package/services/__tests__/pluginInstaller.test.js +290 -0
  232. package/services/__tests__/pluginInstaller.test.js.map +1 -0
  233. package/services/__tests__/pluginParser.test.d.ts +5 -0
  234. package/services/__tests__/pluginParser.test.d.ts.map +1 -0
  235. package/services/__tests__/pluginParser.test.js +272 -0
  236. package/services/__tests__/pluginParser.test.js.map +1 -0
  237. package/services/__tests__/pluginPaths.test.d.ts +5 -0
  238. package/services/__tests__/pluginPaths.test.d.ts.map +1 -0
  239. package/services/__tests__/pluginPaths.test.js +221 -0
  240. package/services/__tests__/pluginPaths.test.js.map +1 -0
  241. package/services/__tests__/pluginScanner.test.d.ts +5 -0
  242. package/services/__tests__/pluginScanner.test.d.ts.map +1 -0
  243. package/services/__tests__/pluginScanner.test.js +272 -0
  244. package/services/__tests__/pluginScanner.test.js.map +1 -0
  245. package/services/__tests__/pluginSymlink.test.d.ts +5 -0
  246. package/services/__tests__/pluginSymlink.test.d.ts.map +1 -0
  247. package/services/__tests__/pluginSymlink.test.js +318 -0
  248. package/services/__tests__/pluginSymlink.test.js.map +1 -0
  249. package/services/__tests__/slackAIService.test.d.ts +5 -0
  250. package/services/__tests__/slackAIService.test.d.ts.map +1 -0
  251. package/services/__tests__/slackAIService.test.js +477 -0
  252. package/services/__tests__/slackAIService.test.js.map +1 -0
  253. package/services/__tests__/slackThreadMapper.test.d.ts +5 -0
  254. package/services/__tests__/slackThreadMapper.test.d.ts.map +1 -0
  255. package/services/__tests__/slackThreadMapper.test.js +194 -0
  256. package/services/__tests__/slackThreadMapper.test.js.map +1 -0
  257. package/services/a2a/__tests__/a2aClientTool.integration.test.d.ts +6 -0
  258. package/services/a2a/__tests__/a2aClientTool.integration.test.d.ts.map +1 -0
  259. package/services/a2a/__tests__/a2aClientTool.integration.test.js +264 -0
  260. package/services/a2a/__tests__/a2aClientTool.integration.test.js.map +1 -0
  261. package/services/a2a/__tests__/a2aClientTool.test.d.ts +6 -0
  262. package/services/a2a/__tests__/a2aClientTool.test.d.ts.map +1 -0
  263. package/services/a2a/__tests__/a2aClientTool.test.js +418 -0
  264. package/services/a2a/__tests__/a2aClientTool.test.js.map +1 -0
  265. package/services/a2a/__tests__/a2aConfigService.test.d.ts +6 -0
  266. package/services/a2a/__tests__/a2aConfigService.test.d.ts.map +1 -0
  267. package/services/a2a/__tests__/a2aConfigService.test.js +431 -0
  268. package/services/a2a/__tests__/a2aConfigService.test.js.map +1 -0
  269. package/services/a2a/__tests__/a2aConfigServicePath.test.d.ts +2 -0
  270. package/services/a2a/__tests__/a2aConfigServicePath.test.d.ts.map +1 -0
  271. package/services/a2a/__tests__/a2aConfigServicePath.test.js +49 -0
  272. package/services/a2a/__tests__/a2aConfigServicePath.test.js.map +1 -0
  273. package/services/a2a/__tests__/a2aSdkMcp.test.d.ts +10 -0
  274. package/services/a2a/__tests__/a2aSdkMcp.test.d.ts.map +1 -0
  275. package/services/a2a/__tests__/a2aSdkMcp.test.js +239 -0
  276. package/services/a2a/__tests__/a2aSdkMcp.test.js.map +1 -0
  277. package/services/a2a/__tests__/agentCardService.test.d.ts +6 -0
  278. package/services/a2a/__tests__/agentCardService.test.d.ts.map +1 -0
  279. package/services/a2a/__tests__/agentCardService.test.js +292 -0
  280. package/services/a2a/__tests__/agentCardService.test.js.map +1 -0
  281. package/services/a2a/__tests__/apiKeyService.test.d.ts +6 -0
  282. package/services/a2a/__tests__/apiKeyService.test.d.ts.map +1 -0
  283. package/services/a2a/__tests__/apiKeyService.test.js +284 -0
  284. package/services/a2a/__tests__/apiKeyService.test.js.map +1 -0
  285. package/services/a2a/__tests__/buildQueryOptionsIntegration.test.d.ts +2 -0
  286. package/services/a2a/__tests__/buildQueryOptionsIntegration.test.d.ts.map +1 -0
  287. package/services/a2a/__tests__/buildQueryOptionsIntegration.test.js +70 -0
  288. package/services/a2a/__tests__/buildQueryOptionsIntegration.test.js.map +1 -0
  289. package/services/a2a/__tests__/dynamic_config_verification.test.d.ts +2 -0
  290. package/services/a2a/__tests__/dynamic_config_verification.test.d.ts.map +1 -0
  291. package/services/a2a/__tests__/dynamic_config_verification.test.js +67 -0
  292. package/services/a2a/__tests__/dynamic_config_verification.test.js.map +1 -0
  293. package/services/a2a/__tests__/integrateA2AMcpServer.test.d.ts +2 -0
  294. package/services/a2a/__tests__/integrateA2AMcpServer.test.d.ts.map +1 -0
  295. package/services/a2a/__tests__/integrateA2AMcpServer.test.js +112 -0
  296. package/services/a2a/__tests__/integrateA2AMcpServer.test.js.map +1 -0
  297. package/services/a2a/__tests__/taskManager.integration.test.d.ts +7 -0
  298. package/services/a2a/__tests__/taskManager.integration.test.d.ts.map +1 -0
  299. package/services/a2a/__tests__/taskManager.integration.test.js +346 -0
  300. package/services/a2a/__tests__/taskManager.integration.test.js.map +1 -0
  301. package/services/a2a/__tests__/taskManager.test.d.ts +7 -0
  302. package/services/a2a/__tests__/taskManager.test.d.ts.map +1 -0
  303. package/services/a2a/__tests__/taskManager.test.js +423 -0
  304. package/services/a2a/__tests__/taskManager.test.js.map +1 -0
  305. package/services/a2a/a2aClientTool.d.ts +73 -0
  306. package/services/a2a/a2aClientTool.d.ts.map +1 -0
  307. package/services/a2a/a2aClientTool.js +572 -0
  308. package/services/a2a/a2aClientTool.js.map +1 -0
  309. package/services/a2a/a2aConfigService.d.ts +50 -0
  310. package/services/a2a/a2aConfigService.d.ts.map +1 -0
  311. package/services/a2a/a2aConfigService.js +186 -0
  312. package/services/a2a/a2aConfigService.js.map +1 -0
  313. package/services/a2a/a2aHistoryService.d.ts +32 -0
  314. package/services/a2a/a2aHistoryService.d.ts.map +1 -0
  315. package/services/a2a/a2aHistoryService.js +108 -0
  316. package/services/a2a/a2aHistoryService.js.map +1 -0
  317. package/services/a2a/a2aIntegration.d.ts +9 -0
  318. package/services/a2a/a2aIntegration.d.ts.map +1 -0
  319. package/services/a2a/a2aIntegration.js +41 -0
  320. package/services/a2a/a2aIntegration.js.map +1 -0
  321. package/services/a2a/a2aQueryService.d.ts +71 -0
  322. package/services/a2a/a2aQueryService.d.ts.map +1 -0
  323. package/services/a2a/a2aQueryService.js +166 -0
  324. package/services/a2a/a2aQueryService.js.map +1 -0
  325. package/services/a2a/a2aSdkMcp.d.ts +51 -0
  326. package/services/a2a/a2aSdkMcp.d.ts.map +1 -0
  327. package/services/a2a/a2aSdkMcp.js +185 -0
  328. package/services/a2a/a2aSdkMcp.js.map +1 -0
  329. package/services/a2a/a2aStreamEvents.d.ts +94 -0
  330. package/services/a2a/a2aStreamEvents.d.ts.map +1 -0
  331. package/services/a2a/a2aStreamEvents.js +92 -0
  332. package/services/a2a/a2aStreamEvents.js.map +1 -0
  333. package/services/a2a/agentCardService.d.ts +34 -0
  334. package/services/a2a/agentCardService.d.ts.map +1 -0
  335. package/services/a2a/agentCardService.js +228 -0
  336. package/services/a2a/agentCardService.js.map +1 -0
  337. package/services/a2a/agentMappingService.d.ts +53 -0
  338. package/services/a2a/agentMappingService.d.ts.map +1 -0
  339. package/services/a2a/agentMappingService.js +185 -0
  340. package/services/a2a/agentMappingService.js.map +1 -0
  341. package/services/a2a/apiKeyService.d.ts +101 -0
  342. package/services/a2a/apiKeyService.d.ts.map +1 -0
  343. package/services/a2a/apiKeyService.js +314 -0
  344. package/services/a2a/apiKeyService.js.map +1 -0
  345. package/services/a2a/taskCleanup.d.ts +30 -0
  346. package/services/a2a/taskCleanup.d.ts.map +1 -0
  347. package/services/a2a/taskCleanup.js +184 -0
  348. package/services/a2a/taskCleanup.js.map +1 -0
  349. package/services/a2a/taskManager.d.ts +86 -0
  350. package/services/a2a/taskManager.d.ts.map +1 -0
  351. package/services/a2a/taskManager.js +263 -0
  352. package/services/a2a/taskManager.js.map +1 -0
  353. package/services/agentStorage.d.ts +27 -0
  354. package/services/agentStorage.d.ts.map +1 -0
  355. package/services/agentStorage.js +487 -0
  356. package/services/agentStorage.js.map +1 -0
  357. package/services/askUserQuestion/askUserQuestionIntegration.d.ts +24 -0
  358. package/services/askUserQuestion/askUserQuestionIntegration.d.ts.map +1 -0
  359. package/services/askUserQuestion/askUserQuestionIntegration.js +52 -0
  360. package/services/askUserQuestion/askUserQuestionIntegration.js.map +1 -0
  361. package/services/askUserQuestion/askUserQuestionMcp.d.ts +103 -0
  362. package/services/askUserQuestion/askUserQuestionMcp.d.ts.map +1 -0
  363. package/services/askUserQuestion/askUserQuestionMcp.js +129 -0
  364. package/services/askUserQuestion/askUserQuestionMcp.js.map +1 -0
  365. package/services/askUserQuestion/index.d.ts +13 -0
  366. package/services/askUserQuestion/index.d.ts.map +1 -0
  367. package/services/askUserQuestion/index.js +35 -0
  368. package/services/askUserQuestion/index.js.map +1 -0
  369. package/services/askUserQuestion/init.d.ts +17 -0
  370. package/services/askUserQuestion/init.d.ts.map +1 -0
  371. package/services/askUserQuestion/init.js +47 -0
  372. package/services/askUserQuestion/init.js.map +1 -0
  373. package/services/askUserQuestion/notificationChannel.d.ts +97 -0
  374. package/services/askUserQuestion/notificationChannel.d.ts.map +1 -0
  375. package/services/askUserQuestion/notificationChannel.js +147 -0
  376. package/services/askUserQuestion/notificationChannel.js.map +1 -0
  377. package/services/askUserQuestion/slackNotificationChannel.d.ts +35 -0
  378. package/services/askUserQuestion/slackNotificationChannel.d.ts.map +1 -0
  379. package/services/askUserQuestion/slackNotificationChannel.js +129 -0
  380. package/services/askUserQuestion/slackNotificationChannel.js.map +1 -0
  381. package/services/askUserQuestion/sseNotificationChannel.d.ts +36 -0
  382. package/services/askUserQuestion/sseNotificationChannel.d.ts.map +1 -0
  383. package/services/askUserQuestion/sseNotificationChannel.js +88 -0
  384. package/services/askUserQuestion/sseNotificationChannel.js.map +1 -0
  385. package/services/askUserQuestion/userInputRegistry.d.ts +107 -0
  386. package/services/askUserQuestion/userInputRegistry.d.ts.map +1 -0
  387. package/services/askUserQuestion/userInputRegistry.js +253 -0
  388. package/services/askUserQuestion/userInputRegistry.js.map +1 -0
  389. package/{backend/dist/services → services}/claudeSession.d.ts +20 -5
  390. package/services/claudeSession.d.ts.map +1 -0
  391. package/{backend/dist/services → services}/claudeSession.js +123 -41
  392. package/services/claudeSession.js.map +1 -0
  393. package/services/claudeVersionStorage.d.ts +20 -0
  394. package/services/claudeVersionStorage.d.ts.map +1 -0
  395. package/services/claudeVersionStorage.js +331 -0
  396. package/services/claudeVersionStorage.js.map +1 -0
  397. package/services/mcpAdmin/__tests__/adminApiKeyService.test.d.ts +5 -0
  398. package/services/mcpAdmin/__tests__/adminApiKeyService.test.d.ts.map +1 -0
  399. package/services/mcpAdmin/__tests__/adminApiKeyService.test.js +289 -0
  400. package/services/mcpAdmin/__tests__/adminApiKeyService.test.js.map +1 -0
  401. package/services/mcpAdmin/__tests__/mcpAdminRoutes.test.d.ts +5 -0
  402. package/services/mcpAdmin/__tests__/mcpAdminRoutes.test.d.ts.map +1 -0
  403. package/services/mcpAdmin/__tests__/mcpAdminRoutes.test.js +345 -0
  404. package/services/mcpAdmin/__tests__/mcpAdminRoutes.test.js.map +1 -0
  405. package/services/mcpAdmin/__tests__/mcpAdminServer.test.d.ts +5 -0
  406. package/services/mcpAdmin/__tests__/mcpAdminServer.test.d.ts.map +1 -0
  407. package/services/mcpAdmin/__tests__/mcpAdminServer.test.js +453 -0
  408. package/services/mcpAdmin/__tests__/mcpAdminServer.test.js.map +1 -0
  409. package/services/mcpAdmin/__tests__/tools.test.d.ts +5 -0
  410. package/services/mcpAdmin/__tests__/tools.test.d.ts.map +1 -0
  411. package/services/mcpAdmin/__tests__/tools.test.js +371 -0
  412. package/services/mcpAdmin/__tests__/tools.test.js.map +1 -0
  413. package/services/mcpAdmin/adminApiKeyService.d.ts +61 -0
  414. package/services/mcpAdmin/adminApiKeyService.d.ts.map +1 -0
  415. package/services/mcpAdmin/adminApiKeyService.js +270 -0
  416. package/services/mcpAdmin/adminApiKeyService.js.map +1 -0
  417. package/services/mcpAdmin/index.d.ts +10 -0
  418. package/services/mcpAdmin/index.d.ts.map +1 -0
  419. package/services/mcpAdmin/index.js +43 -0
  420. package/services/mcpAdmin/index.js.map +1 -0
  421. package/services/mcpAdmin/mcpAdminServer.d.ts +76 -0
  422. package/services/mcpAdmin/mcpAdminServer.d.ts.map +1 -0
  423. package/services/mcpAdmin/mcpAdminServer.js +243 -0
  424. package/services/mcpAdmin/mcpAdminServer.js.map +1 -0
  425. package/services/mcpAdmin/tools/agentTools.d.ts +27 -0
  426. package/services/mcpAdmin/tools/agentTools.d.ts.map +1 -0
  427. package/services/mcpAdmin/tools/agentTools.js +359 -0
  428. package/services/mcpAdmin/tools/agentTools.js.map +1 -0
  429. package/services/mcpAdmin/tools/index.d.ts +15 -0
  430. package/services/mcpAdmin/tools/index.d.ts.map +1 -0
  431. package/services/mcpAdmin/tools/index.js +30 -0
  432. package/services/mcpAdmin/tools/index.js.map +1 -0
  433. package/services/mcpAdmin/tools/mcpServerTools.d.ts +27 -0
  434. package/services/mcpAdmin/tools/mcpServerTools.d.ts.map +1 -0
  435. package/services/mcpAdmin/tools/mcpServerTools.js +334 -0
  436. package/services/mcpAdmin/tools/mcpServerTools.js.map +1 -0
  437. package/services/mcpAdmin/tools/projectTools.d.ts +27 -0
  438. package/services/mcpAdmin/tools/projectTools.d.ts.map +1 -0
  439. package/services/mcpAdmin/tools/projectTools.js +353 -0
  440. package/services/mcpAdmin/tools/projectTools.js.map +1 -0
  441. package/services/mcpAdmin/tools/systemTools.d.ts +23 -0
  442. package/services/mcpAdmin/tools/systemTools.d.ts.map +1 -0
  443. package/services/mcpAdmin/tools/systemTools.js +241 -0
  444. package/services/mcpAdmin/tools/systemTools.js.map +1 -0
  445. package/services/mcpAdmin/types.d.ts +124 -0
  446. package/services/mcpAdmin/types.d.ts.map +1 -0
  447. package/services/mcpAdmin/types.js +18 -0
  448. package/services/mcpAdmin/types.js.map +1 -0
  449. package/{backend/dist/services → services}/messageQueue.d.ts.map +1 -1
  450. package/{backend/dist/services → services}/messageQueue.js +16 -3
  451. package/services/messageQueue.js.map +1 -0
  452. package/services/pluginInstaller.d.ts +58 -0
  453. package/services/pluginInstaller.d.ts.map +1 -0
  454. package/services/pluginInstaller.js +321 -0
  455. package/services/pluginInstaller.js.map +1 -0
  456. package/services/pluginParser.d.ts +45 -0
  457. package/services/pluginParser.d.ts.map +1 -0
  458. package/services/pluginParser.js +437 -0
  459. package/services/pluginParser.js.map +1 -0
  460. package/services/pluginPaths.d.ts +80 -0
  461. package/services/pluginPaths.d.ts.map +1 -0
  462. package/services/pluginPaths.js +274 -0
  463. package/services/pluginPaths.js.map +1 -0
  464. package/services/pluginScanner.d.ts +36 -0
  465. package/services/pluginScanner.d.ts.map +1 -0
  466. package/services/pluginScanner.js +251 -0
  467. package/services/pluginScanner.js.map +1 -0
  468. package/services/pluginSymlink.d.ts +54 -0
  469. package/services/pluginSymlink.d.ts.map +1 -0
  470. package/services/pluginSymlink.js +223 -0
  471. package/services/pluginSymlink.js.map +1 -0
  472. package/services/projectMetadataStorage.d.ts +114 -0
  473. package/services/projectMetadataStorage.d.ts.map +1 -0
  474. package/services/projectMetadataStorage.js +711 -0
  475. package/services/projectMetadataStorage.js.map +1 -0
  476. package/services/scheduledTaskStorage.d.ts +52 -0
  477. package/services/scheduledTaskStorage.d.ts.map +1 -0
  478. package/services/scheduledTaskStorage.js +285 -0
  479. package/services/scheduledTaskStorage.js.map +1 -0
  480. package/services/schedulerService.d.ts +81 -0
  481. package/services/schedulerService.d.ts.map +1 -0
  482. package/services/schedulerService.js +743 -0
  483. package/services/schedulerService.js.map +1 -0
  484. package/{backend/dist/services → services}/sessionManager.d.ts +6 -4
  485. package/services/sessionManager.d.ts.map +1 -0
  486. package/{backend/dist/services → services}/sessionManager.js +77 -16
  487. package/services/sessionManager.js.map +1 -0
  488. package/services/skillStorage.d.ts +60 -0
  489. package/services/skillStorage.d.ts.map +1 -0
  490. package/services/skillStorage.js +398 -0
  491. package/services/skillStorage.js.map +1 -0
  492. package/services/slackAIService.d.ts +81 -0
  493. package/services/slackAIService.d.ts.map +1 -0
  494. package/services/slackAIService.js +1091 -0
  495. package/services/slackAIService.js.map +1 -0
  496. package/services/slackClient.d.ts +46 -0
  497. package/services/slackClient.d.ts.map +1 -0
  498. package/services/slackClient.js +85 -0
  499. package/services/slackClient.js.map +1 -0
  500. package/services/slackSessionLock.d.ts +79 -0
  501. package/services/slackSessionLock.d.ts.map +1 -0
  502. package/services/slackSessionLock.js +353 -0
  503. package/services/slackSessionLock.js.map +1 -0
  504. package/services/slackThreadMapper.d.ts +57 -0
  505. package/services/slackThreadMapper.d.ts.map +1 -0
  506. package/services/slackThreadMapper.js +140 -0
  507. package/services/slackThreadMapper.js.map +1 -0
  508. package/types/a2a.d.ts +275 -0
  509. package/types/a2a.d.ts.map +1 -0
  510. package/types/a2a.js +23 -0
  511. package/types/a2a.js.map +1 -0
  512. package/types/agents.d.ts +95 -0
  513. package/types/agents.d.ts.map +1 -0
  514. package/types/agents.js +46 -0
  515. package/types/agents.js.map +1 -0
  516. package/types/claude-history.d.ts +62 -0
  517. package/types/claude-history.d.ts.map +1 -0
  518. package/types/claude-history.js +4 -0
  519. package/types/claude-history.js.map +1 -0
  520. package/types/claude-versions.d.ts +36 -0
  521. package/types/claude-versions.d.ts.map +1 -0
  522. package/types/claude-versions.js +3 -0
  523. package/types/claude-versions.js.map +1 -0
  524. package/types/commands.d.ts +50 -0
  525. package/types/commands.d.ts.map +1 -0
  526. package/types/commands.js +23 -0
  527. package/types/commands.js.map +1 -0
  528. package/types/plugins.d.ts +144 -0
  529. package/types/plugins.d.ts.map +1 -0
  530. package/types/plugins.js +8 -0
  531. package/types/plugins.js.map +1 -0
  532. package/types/projects.d.ts +42 -0
  533. package/types/projects.d.ts.map +1 -0
  534. package/types/projects.js +4 -0
  535. package/types/projects.js.map +1 -0
  536. package/types/scheduledTasks.d.ts +164 -0
  537. package/types/scheduledTasks.d.ts.map +1 -0
  538. package/types/scheduledTasks.js +17 -0
  539. package/types/scheduledTasks.js.map +1 -0
  540. package/types/skills.d.ts +91 -0
  541. package/types/skills.d.ts.map +1 -0
  542. package/types/skills.js +6 -0
  543. package/types/skills.js.map +1 -0
  544. package/types/slack.d.ts +97 -0
  545. package/types/slack.d.ts.map +1 -0
  546. package/types/slack.js +8 -0
  547. package/types/slack.js.map +1 -0
  548. package/types/streaming.d.ts +12 -0
  549. package/types/streaming.d.ts.map +1 -0
  550. package/types/streaming.js +8 -0
  551. package/types/streaming.js.map +1 -0
  552. package/types/subagents.d.ts +26 -0
  553. package/types/subagents.d.ts.map +1 -0
  554. package/types/subagents.js +3 -0
  555. package/types/subagents.js.map +1 -0
  556. package/utils/__tests__/claudeUtils.test.d.ts +5 -0
  557. package/utils/__tests__/claudeUtils.test.d.ts.map +1 -0
  558. package/utils/__tests__/claudeUtils.test.js +282 -0
  559. package/utils/__tests__/claudeUtils.test.js.map +1 -0
  560. package/utils/__tests__/sessionUtils.test.d.ts +5 -0
  561. package/utils/__tests__/sessionUtils.test.d.ts.map +1 -0
  562. package/utils/__tests__/sessionUtils.test.js +295 -0
  563. package/utils/__tests__/sessionUtils.test.js.map +1 -0
  564. package/utils/agentCardCache.d.ts +93 -0
  565. package/utils/agentCardCache.d.ts.map +1 -0
  566. package/utils/agentCardCache.js +212 -0
  567. package/utils/agentCardCache.js.map +1 -0
  568. package/utils/claudeUtils.d.ts +54 -0
  569. package/utils/claudeUtils.d.ts.map +1 -0
  570. package/utils/claudeUtils.js +387 -0
  571. package/utils/claudeUtils.js.map +1 -0
  572. package/utils/fileUtils.d.ts +2 -0
  573. package/utils/fileUtils.d.ts.map +1 -0
  574. package/utils/fileUtils.js +11 -0
  575. package/utils/fileUtils.js.map +1 -0
  576. package/utils/jwt.d.ts +30 -0
  577. package/utils/jwt.d.ts.map +1 -0
  578. package/utils/jwt.js +95 -0
  579. package/utils/jwt.js.map +1 -0
  580. package/utils/sessionUtils.d.ts +64 -0
  581. package/utils/sessionUtils.d.ts.map +1 -0
  582. package/utils/sessionUtils.js +266 -0
  583. package/utils/sessionUtils.js.map +1 -0
  584. package/README.zh-CN.md +0 -525
  585. package/backend/dist/bin/agentstudio.js +0 -120
  586. package/backend/dist/bin/agentstudio.js.map +0 -1
  587. package/backend/dist/frontend/assets/AgentsPage-Dqb_aqAA.js +0 -1
  588. package/backend/dist/frontend/assets/ChatPage-L8Paywyc.js +0 -91
  589. package/backend/dist/frontend/assets/CommandForm-DLl7EIMS.js +0 -7
  590. package/backend/dist/frontend/assets/CommandsPage-Bzavq0Ec.js +0 -1
  591. package/backend/dist/frontend/assets/DashboardPage-B3o4AYFT.js +0 -15
  592. package/backend/dist/frontend/assets/FileBrowser-DL3ayaqb.js +0 -1
  593. package/backend/dist/frontend/assets/GeneralSettingsPage-CBN_de-V.js +0 -1
  594. package/backend/dist/frontend/assets/LandingPage-Dl4ioKos.js +0 -1
  595. package/backend/dist/frontend/assets/LoginPage-4QqRdiSi.js +0 -12
  596. package/backend/dist/frontend/assets/McpPage-CY3tYiqj.js +0 -39
  597. package/backend/dist/frontend/assets/MemorySettingsPage-DGxrok5K.js +0 -1
  598. package/backend/dist/frontend/assets/ProjectSelector-hgmGYVFh.js +0 -1
  599. package/backend/dist/frontend/assets/ProjectsPage-D399IM0c.js +0 -14
  600. package/backend/dist/frontend/assets/SettingsLayout-CL_K-lzJ.js +0 -1
  601. package/backend/dist/frontend/assets/SubagentsPage-Chbhj8p2.js +0 -1
  602. package/backend/dist/frontend/assets/UnifiedToolSelector-CsM9qBvs.js +0 -1
  603. package/backend/dist/frontend/assets/VersionSettingsPage-74Q-LVgA.js +0 -5
  604. package/backend/dist/frontend/assets/agents-ClAzIJTw.js +0 -1
  605. package/backend/dist/frontend/assets/authFetch-BATQyPG5.js +0 -1
  606. package/backend/dist/frontend/assets/index-B9YHa7XT.css +0 -1
  607. package/backend/dist/frontend/assets/index-B_CTNvca.js +0 -268
  608. package/backend/dist/frontend/assets/monaco-editor-C7Z4sOhS.js +0 -19
  609. package/backend/dist/frontend/assets/tabManager-DV8urRBM.js +0 -30
  610. package/backend/dist/frontend/assets/tools-C4EPanYi.js +0 -1
  611. package/backend/dist/frontend/assets/useAgents-DwnOE1_k.js +0 -2
  612. package/backend/dist/frontend/assets/useClaudeVersions-CQdGnCqv.js +0 -1
  613. package/backend/dist/frontend/assets/useCommands-CCVaurbt.js +0 -1
  614. package/backend/dist/index.d.ts +0 -3
  615. package/backend/dist/index.d.ts.map +0 -1
  616. package/backend/dist/index.js +0 -157
  617. package/backend/dist/index.js.map +0 -1
  618. package/backend/dist/middleware/auth.d.ts.map +0 -1
  619. package/backend/dist/middleware/auth.js +0 -21
  620. package/backend/dist/middleware/auth.js.map +0 -1
  621. package/backend/dist/routes/agents.js +0 -803
  622. package/backend/dist/routes/agents.js.map +0 -1
  623. package/backend/dist/routes/auth.js +0 -60
  624. package/backend/dist/routes/auth.js.map +0 -1
  625. package/backend/dist/routes/commands.js.map +0 -1
  626. package/backend/dist/routes/files.js.map +0 -1
  627. package/backend/dist/routes/mcp.d.ts.map +0 -1
  628. package/backend/dist/routes/mcp.js.map +0 -1
  629. package/backend/dist/routes/media.d.ts.map +0 -1
  630. package/backend/dist/routes/media.js.map +0 -1
  631. package/backend/dist/routes/projects.js +0 -528
  632. package/backend/dist/routes/projects.js.map +0 -1
  633. package/backend/dist/routes/sessions.js.map +0 -1
  634. package/backend/dist/routes/settings.js.map +0 -1
  635. package/backend/dist/routes/slides.js.map +0 -1
  636. package/backend/dist/routes/subagents.js.map +0 -1
  637. package/backend/dist/services/claudeSession.d.ts.map +0 -1
  638. package/backend/dist/services/claudeSession.js.map +0 -1
  639. package/backend/dist/services/messageQueue.js.map +0 -1
  640. package/backend/dist/services/sessionManager.d.ts.map +0 -1
  641. package/backend/dist/services/sessionManager.js.map +0 -1
  642. package/backend/dist/utils/jwt.d.ts +0 -15
  643. package/backend/dist/utils/jwt.d.ts.map +0 -1
  644. package/backend/dist/utils/jwt.js +0 -28
  645. package/backend/dist/utils/jwt.js.map +0 -1
  646. /package/{backend/dist/bin → bin}/agentstudio.d.ts +0 -0
  647. /package/{backend/dist/bin → bin}/agentstudio.d.ts.map +0 -0
  648. /package/{backend/dist/frontend → public}/assets/ChatPage-BvQmXfcP.css +0 -0
  649. /package/{backend/dist/frontend → public}/assets/agents-DwCY2K8p.css +0 -0
  650. /package/{backend/dist/frontend → public}/assets/dateFormat-CXa8VnEC.js +0 -0
  651. /package/{backend/dist/frontend → public}/cc-studio.png +0 -0
  652. /package/{backend/dist/frontend → public}/vite.svg +0 -0
  653. /package/{backend/dist/routes → routes}/agents.d.ts +0 -0
  654. /package/{backend/dist/routes → routes}/auth.d.ts +0 -0
  655. /package/{backend/dist/routes → routes}/commands.d.ts +0 -0
  656. /package/{backend/dist/routes → routes}/files.d.ts +0 -0
  657. /package/{backend/dist/routes → routes}/media.d.ts +0 -0
  658. /package/{backend/dist/routes → routes}/projects.d.ts +0 -0
  659. /package/{backend/dist/routes → routes}/sessions.d.ts +0 -0
  660. /package/{backend/dist/routes → routes}/settings.d.ts +0 -0
  661. /package/{backend/dist/routes → routes}/slides.d.ts +0 -0
  662. /package/{backend/dist/routes → routes}/subagents.d.ts +0 -0
  663. /package/{backend/dist/routes → routes}/subagents.d.ts.map +0 -0
  664. /package/{backend/dist/services → services}/messageQueue.d.ts +0 -0
@@ -0,0 +1,442 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dagre-6UL2VRFP-DR9x77Xf.js","assets/graph-m515btDj.js","assets/_baseUniq-eGJNLBzx.js","assets/layout-BKQfQSxJ.js","assets/_basePickBy-7C_e0Xv1.js","assets/clone-Ckf7tA1V.js","assets/data-structures-C0h9Oap1.js","assets/monaco-editor-DHKm5-VF.js","assets/syntax-highlighting-CnREyncB.js","assets/agents-ChrA1R0y.js","assets/tools-IcPNZlPj.js","assets/ui-components-D1St49qC.js","assets/agents-DwCY2K8p.css","assets/useAgents-BnDTkOG8.js","assets/tabManager-B2LQO_Ll.js","assets/index-Bn3v3S9-.js","assets/index-DWieeYj4.css","assets/useCommands-mvMu3mMD.js","assets/useClaudeVersions-CD59tFWM.js","assets/FileExplorer-DNYj6Tsx.js","assets/UnifiedToolSelector-CNbPsiuq.js","assets/FileBrowser-BYweUPH4.js","assets/ProjectSelector-DSXOjMQC.js","assets/cose-bilkent-S5V4N54A-CnpfmL-Y.js","assets/cytoscape.esm-DtBltrT8.js","assets/c4Diagram-YG6GDRKO-BNJSAXcg.js","assets/chunk-TZMSLE5B-DPCYEVb3.js","assets/flowDiagram-NV44I4VS-HAAlzNbq.js","assets/chunk-FMBD7UC4-BbjwhyTe.js","assets/chunk-55IACEB6-3ePDt0kp.js","assets/chunk-QN33PNHL-BpH-o_YR.js","assets/channel-CIunGC5m.js","assets/erDiagram-Q2GNP2WA-BX1DpOGx.js","assets/gitGraphDiagram-NY62KEGX-CIPmSp43.js","assets/chunk-4BX2VUAB-RPxkCWhH.js","assets/chunk-QZHKN3VN-DYB7rh5Q.js","assets/treemap-KMMF4GRG-DtkpVA56.js","assets/ganttDiagram-LVOFAZNH-BqzWexqa.js","assets/linear-DigtLz3B.js","assets/init-Gi6I4Gst.js","assets/defaultLocale-C4B-KCzX.js","assets/infoDiagram-F6ZHWCRC-Pn4yNWrF.js","assets/pieDiagram-ADFJNKIX-BcoaAI-L.js","assets/arc-CuA752eE.js","assets/ordinal-Cboi1Yqb.js","assets/quadrantDiagram-AYHSOK5B-D-DwcoSd.js","assets/xychartDiagram-PRI3JC2R-ByBTDWE2.js","assets/requirementDiagram-UZGBJVZJ-DbQCpx77.js","assets/sequenceDiagram-WL72ISMW-BdzICjxO.js","assets/classDiagram-2ON5EDUG-aUQHFsTA.js","assets/chunk-B4BG7PRW-CBg_BBfl.js","assets/classDiagram-v2-WZHVMYZB-aUQHFsTA.js","assets/stateDiagram-FKZM4ZOC-CYY-uUvJ.js","assets/chunk-DI55MBZ5-DIh69TUJ.js","assets/stateDiagram-v2-4FDKWEC3-Dh2Kvomq.js","assets/journeyDiagram-XKPGCS4Q-BfzTomS0.js","assets/timeline-definition-IT6M3QCI-BAvjPYvX.js","assets/mindmap-definition-VGOIOE7T-qopraVFy.js","assets/kanban-definition-3W4ZIXB7-Cgju7b-L.js","assets/sankeyDiagram-TZEHDZUN-BVk8387S.js","assets/diagram-S2PKOQOG-CkM0APZj.js","assets/diagram-QEK2KX5R-BKYFSfC1.js","assets/blockDiagram-VD42YOAC-72nsMt_i.js","assets/architectureDiagram-VXUJARFQ-BnPYh1OW.js","assets/diagram-PSM6KHXK-SONPsQNx.js"])))=>i.map(i=>d[i]);
2
+ import{j as p}from"./data-structures-C0h9Oap1.js";import{r as O,g as _u,W as mr}from"./monaco-editor-DHKm5-VF.js";import{o as eg,A as ec,a as tc,u as Tu,h as nw,l as iw,d as sw,p as aw,S as ow}from"./agents-ChrA1R0y.js";import{g as lw,h as cw,i as uw,j as hw,k as dw}from"./useAgents-BnDTkOG8.js";import{t as ws,u as fw}from"./tabManager-B2LQO_Ll.js";import{u as we,B as Qe,T as Ve,b as pw,K as gw,c as mw}from"./tools-IcPNZlPj.js";import{m as Zr,g as nd,ad as xw,o as yw,a4 as tg,t as rc,aQ as rg,aR as ng,X as An,k as ui,l as Rs,am as wa,L as va,C as Jr,n as Ca,j as nc,Z as Sa,aS as bw,I as pl,aT as kw,aU as na,aV as ww,E as vw,ab as ig,ar as Cw,ao as Sw,R as sg,aW as id,d as sd,aX as Eu,aG as _w,e as ag,aY as ad,S as od,aZ as Tw,ac as og,a_ as Ew,v as Aw,p as lg,a2 as Mw,an as Nw,a$ as vs,Q as cg,i as ug,q as ld,b0 as Lw,b1 as cd,Y as Iw}from"./ui-components-D1St49qC.js";import{s as $w,h as hg,f as jw,u as dg,i as Bw,j as Dw}from"./index-Bn3v3S9-.js";import{u as ic,f as sc}from"./useCommands-mvMu3mMD.js";import{u as Pw}from"./useClaudeVersions-CD59tFWM.js";import{e as ac,E as oc,F as ud}from"./FileExplorer-DNYj6Tsx.js";import{c as Re,h as fg}from"./syntax-highlighting-CnREyncB.js";import{U as Au}from"./UnifiedToolSelector-CNbPsiuq.js";import{F as Fw}from"./FileBrowser-BYweUPH4.js";import{P as Rw}from"./ProjectSelector-DSXOjMQC.js";const Xe=eg((e,t)=>({currentAgent:null,messages:[],isAiTyping:!1,currentSessionId:null,mcpStatus:{hasError:!1,connectedServers:[],connectionErrors:[],lastError:null,lastErrorDetails:void 0,lastUpdated:void 0},pendingUserQuestion:null,activeA2AStreams:{},sidebarCollapsed:!1,setCurrentAgent:r=>e(n=>({currentAgent:r,...n.currentAgent?.id!==r?.id?{messages:[],isAiTyping:!1,currentSessionId:null}:{}})),addMessage:r=>e(n=>({messages:[...n.messages,{...r,id:`${Date.now()}_${Math.random().toString(36).substr(2,9)}`,timestamp:Date.now(),agentId:n.currentAgent?.id||"unknown",messageParts:[]}]})),updateMessage:(r,n)=>e(i=>({messages:i.messages.map(s=>s.id===r?{...s,...n}:s)})),addTextPartToMessage:(r,n)=>e(i=>({messages:i.messages.map(s=>s.id===r?{...s,messageParts:[...s.messageParts||[],{id:`${Date.now()}_${Math.random().toString(36).substr(2,9)}`,type:"text",content:n,order:(s.messageParts||[]).length}]}:s)})),addThinkingPartToMessage:(r,n)=>e(i=>({messages:i.messages.map(s=>s.id===r?{...s,messageParts:[...s.messageParts||[],{id:`${Date.now()}_${Math.random().toString(36).substr(2,9)}`,type:"thinking",content:n,order:(s.messageParts||[]).length}]}:s)})),updateTextPartInMessage:(r,n,i)=>e(s=>({messages:s.messages.map(a=>a.id===r?{...a,messageParts:a.messageParts?.map(o=>o.type==="text"&&o.id===n?{...o,content:i}:o)}:a)})),updateThinkingPartInMessage:(r,n,i)=>e(s=>({messages:s.messages.map(a=>a.id===r?{...a,messageParts:a.messageParts?.map(o=>o.type==="thinking"&&o.id===n?{...o,content:i}:o)}:a)})),addCompactSummaryPartToMessage:(r,n)=>e(i=>({messages:i.messages.map(s=>s.id===r?{...s,messageParts:[...s.messageParts||[],{id:`${Date.now()}_${Math.random().toString(36).substr(2,9)}`,type:"compactSummary",content:n,order:(s.messageParts||[]).length}]}:s)})),addCommandPartToMessage:(r,n)=>e(i=>({messages:i.messages.map(s=>s.id===r?{...s,messageParts:[...s.messageParts||[],{id:`${Date.now()}_${Math.random().toString(36).substr(2,9)}`,type:"command",content:n,order:(s.messageParts||[]).length}]}:s)})),addToolPartToMessage:(r,n)=>e(i=>({messages:i.messages.map(s=>s.id===r?{...s,messageParts:[...s.messageParts||[],{id:`${Date.now()}_${Math.random().toString(36).substr(2,9)}`,type:"tool",toolData:{...n,id:`${Date.now()}_${Math.random().toString(36).substr(2,9)}`,isExecuting:n.isExecuting??!1},order:(s.messageParts||[]).length}]}:s)})),updateToolPartInMessage:(r,n,i)=>e(s=>({messages:s.messages.map(a=>a.id===r?{...a,messageParts:a.messageParts?.map(o=>o.type==="tool"&&o.toolData?.id===n?{...o,toolData:o.toolData?{...o.toolData,...i}:void 0}:o)}:a)})),interruptAllExecutingTools:()=>e(r=>({messages:r.messages.map(n=>({...n,messageParts:n.messageParts?.map(i=>i.type==="tool"&&i.toolData?.isExecuting?{...i,toolData:{...i.toolData,isExecuting:!1,isInterrupted:!0}}:i)}))})),setAiTyping:r=>e({isAiTyping:r}),setCurrentSessionId:r=>e({currentSessionId:r}),clearMessages:()=>e({messages:[]}),loadSessionMessages:r=>e({messages:r}),updateMcpStatus:r=>e(n=>({mcpStatus:{...n.mcpStatus,...r,lastUpdated:Date.now()}})),clearMcpStatus:()=>e({mcpStatus:{hasError:!1,connectedServers:[],connectionErrors:[],lastError:null,lastErrorDetails:void 0,lastUpdated:void 0}}),setPendingUserQuestion:r=>e({pendingUserQuestion:r}),setA2AStreamStart:(r,n,i)=>e(s=>({activeA2AStreams:{...s.activeA2AStreams,[r]:{sessionId:n,agentUrl:r,message:i,startedAt:Date.now(),isStreaming:!0,events:[]}}})),setA2AStreamEnd:r=>e(n=>{const i=n.activeA2AStreams[r];return i?{activeA2AStreams:{...n.activeA2AStreams,[r]:{...i,isStreaming:!1}}}:n}),addA2AStreamEvent:(r,n)=>e(i=>{const s=i.activeA2AStreams[r];return s?{activeA2AStreams:{...i.activeA2AStreams,[r]:{...s,events:[...s.events,n]}}}:{activeA2AStreams:{...i.activeA2AStreams,[r]:{sessionId:n.sessionId||"",agentUrl:r,message:"",startedAt:Date.now(),isStreaming:!0,events:[n]}}}}),getA2AStreamByUrl:r=>t().activeA2AStreams[r],setSidebarCollapsed:r=>e({sidebarCollapsed:r})})),Ow=({agentId:e,sessionId:t,projectPath:r,enabled:n=!0,interval:i=3e4,shouldCheckExistence:s=!1})=>{const a=O.useRef(null),o=O.useRef(0),l=O.useRef(!0),c=O.useRef(!1),u=O.useCallback(async()=>{if(!e||!t)return!1;try{const m=`${ec}/sessions/${e}/${t}/check`,b=await tc(m);if(b.ok){const y=await b.json();return console.log(`🔍 Session existence check: ${t} - ${y.exists?"exists":"not found"}`),y.exists}return!1}catch(m){return console.error("❌ Error checking session existence:",m),!1}},[e,t]),h=O.useCallback(async()=>{if(!(!e||!t||!n))try{const m=`${ec}/sessions/${e}/${t}/heartbeat`,b=await tc(m,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:r,timestamp:Date.now()})});if(b.ok){const y=await b.json();o.current=y.timestamp,console.log(`💓 Session heartbeat sent successfully: ${t}`),ws.updateCurrentTabActivity(e,t)}else console.warn(`⚠️ Failed to send heartbeat for session ${t}:`,b.status)}catch(m){console.error("💔 Error sending session heartbeat:",m)}},[e,t,r,n]),f=O.useCallback(()=>{l.current=!document.hidden,l.current&&n&&t&&h()},[h,n,t]),d=O.useCallback(async()=>{if(!(!n||!t||a.current)){if(s&&!c.current){const m=await u();if(c.current=!0,!m){console.log(`⏸️ Session ${t} not found in SessionManager, heartbeat not started`);return}}console.log(`💓 Starting heartbeat for session: ${t}`),h(),a.current=setInterval(()=>{h()},i)}},[n,t,h,i,s,u]),g=O.useCallback(()=>{a.current&&(console.log(`💔 Stopping heartbeat for session: ${t}`),clearInterval(a.current),a.current=null)},[t]);return O.useEffect(()=>(c.current=!1,t&&n?d():g(),()=>{g()}),[t,n,d,g]),O.useEffect(()=>(document.addEventListener("visibilitychange",f),()=>{document.removeEventListener("visibilitychange",f)}),[f]),O.useEffect(()=>()=>{g()},[g]),{sendHeartbeat:h,startHeartbeat:d,stopHeartbeat:g,checkSessionExists:u,lastHeartbeat:o.current}},zw=({agentId:e,sessionId:t,projectPath:r,enabled:n=!0,interval:i=3e4,isNewSession:s=!1,hasSuccessfulResponse:a=!1})=>{const o=O.useRef(null),l=O.useRef(!1),c=!t||!n?!1:s?a:!0,h=Ow({agentId:e,sessionId:t,projectPath:r,enabled:c,interval:i,shouldCheckExistence:!s&&!!t});return O.useEffect(()=>{o.current!==t&&(l.current=!1,o.current=t)},[t]),O.useEffect(()=>{c&&t&&!l.current&&(l.current=!0,console.log(`🚀 Heartbeat enabled for session: ${t} (new: ${s}, hasResponse: ${a})`))},[c,t,s,a]),{...h,isHeartbeatActive:c&&l.current}},Hw=()=>{const[e,t]=O.useState(!1);return O.useEffect(()=>{const r=()=>{t(window.innerWidth<640)};return r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),{isCompactMode:e}},Ww=({isOpen:e,onToggle:t,sessions:r,currentSessionId:n,onSwitchSession:i,isLoading:s=!1,searchTerm:a,onSearchChange:o})=>{const{t:l}=we("components"),c=O.useRef(null),u=O.useRef(null);O.useEffect(()=>{console.log("🎯 [DROPDOWN DEBUG] SessionsDropdown sessions updated:",{sessionCount:r.length,currentSessionId:n,searchTerm:a,sessions:r.map((f,d)=>({index:d+1,id:f.id,title:f.title,lastUpdated:f.lastUpdated,messageCount:f.messageCount,isCurrent:f.id===n}))})},[r,n,a]),O.useEffect(()=>{const f=d=>{c.current&&!c.current.contains(d.target)&&t()};return e&&document.addEventListener("mousedown",f),()=>{document.removeEventListener("mousedown",f)}},[e,t]),O.useEffect(()=>{e&&u.current&&setTimeout(()=>u.current?.focus(),100)},[e]);const h=r;return e?p.jsxs("div",{ref:c,className:"absolute top-full right-0 mt-1 w-80 bg-white rounded-lg shadow-lg border border-gray-200 z-50",children:[p.jsx("div",{className:"flex items-center justify-between p-3 border-b border-gray-100",children:p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx(Zr,{className:"w-4 h-4 text-gray-600"}),p.jsx("span",{className:"text-sm font-medium text-gray-900",children:l("sessionDropdown.sessionHistory")})]})}),p.jsx("div",{className:"p-3 border-b border-gray-100",children:p.jsxs("div",{className:"relative",children:[p.jsx(nd,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),p.jsx("input",{ref:u,type:"text",value:a,onChange:f=>o(f.target.value),placeholder:l("sessionDropdown.searchPlaceholder"),className:"w-full pl-9 pr-3 py-2 text-sm text-gray-900 border border-gray-200 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent placeholder-gray-500"})]})}),p.jsx("div",{className:"max-h-80 overflow-y-auto",children:s?p.jsx("div",{className:"flex items-center justify-center py-8",children:p.jsx("div",{className:"animate-spin rounded-full h-5 w-5 border-b-2 border-blue-600"})}):h.length>0?p.jsx("div",{className:"py-2",children:h.map((f,d)=>p.jsxs("div",{onClick:()=>{console.log(`🖱️ [DROPDOWN DEBUG] Clicking session ${d+1}:`,{id:f.id,title:f.title,isCurrent:f.id===n}),i(f.id)},className:`mx-2 px-3 py-2 rounded cursor-pointer hover:bg-gray-50 transition-colors ${n===f.id?"bg-blue-50 border border-blue-200":"border border-transparent"}`,children:[p.jsxs("div",{className:"text-sm font-medium text-gray-900 truncate",title:`ID: ${f.id}`,children:[d+1,". ",f.title]}),p.jsxs("div",{className:"text-xs text-gray-500 mt-0.5",children:[l("sessionDropdown.messageCount",{count:f.messageCount})," • ",new Date(f.lastUpdated).toLocaleString("zh-CN",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})]})]},f.id))}):p.jsx("div",{className:"text-center py-8",children:a?p.jsxs("div",{children:[p.jsx(nd,{className:"w-8 h-8 text-gray-300 mx-auto mb-2"}),p.jsx("p",{className:"text-sm text-gray-500",children:l("sessionDropdown.noMatchingSessions")})]}):p.jsxs("div",{children:[p.jsx(Zr,{className:"w-8 h-8 text-gray-300 mx-auto mb-2"}),p.jsx("p",{className:"text-sm text-gray-500",children:l("sessionDropdown.noSessionHistory")}),p.jsx("p",{className:"text-xs text-gray-400 mt-1",children:l("sessionDropdown.sessionWillAppear")})]})})})]}):null};function qw(e,t){return t?e.replace(/@([\w.-]+(?:\/[\w.-]+)*(?:\.\w+)?)/g,(r,n)=>n.startsWith("/")?n:t+"/"+n):e}function Uw(e,t,r){let n=e.content;return t&&(n=n.replace(/\$ARGUMENTS/g,t)),n=qw(n,r),`<command-message>${t?`${e.description} (参数: ${t})`:e.description}</command-message><command-name>${n}</command-name>`}function us(e){return e.startsWith("/")}function Vw(e){return e.startsWith("/")?e.slice(1):""}const Gw=({textareaRef:e,inputMessage:t,setInputMessage:r})=>{const[n,i]=O.useState([]),[s,a]=O.useState(null),[o,l]=O.useState(!1),c=O.useCallback(C=>{if(!e.current)return;const S=e.current,w=S.selectionStart||0,T=S.selectionEnd||0,$=t,M=$.substring(0,w)+C+$.substring(T);r(M),setTimeout(()=>{S.selectionStart=S.selectionEnd=w+C.length,S.focus()},0)},[t,r,e]),u=O.useCallback(C=>{const S=Date.now().toString()+Math.random().toString(36).substr(2,9),w=new FileReader;w.onload=T=>{T.target?.result&&i($=>{const M=[...$,{id:S,file:C,preview:T.target.result}],N=`[image${M.length}]`;return c(N),M})},w.readAsDataURL(C)},[c]),h=O.useCallback(C=>{const S=C.target.files;if(!S)return;Array.from(S).filter(T=>T.type.startsWith("image/")&&["image/jpeg","image/png","image/gif","image/webp"].includes(T.type)).forEach(u),C.target&&(C.target.value="")},[u]),f=O.useCallback(C=>{i(S=>S.filter(w=>w.id!==C))},[]),d=O.useCallback(C=>{a(C)},[]),g=O.useCallback(C=>{const S=C.clipboardData?.items;if(!S)return;let w=!1;for(let T=0;T<S.length;T++){const $=S[T];if($.type.startsWith("image/")){w=!0;const M=$.getAsFile();M&&u(M)}}w&&C.preventDefault()},[u]),m=O.useCallback(C=>{C.preventDefault(),l(!0)},[]),b=O.useCallback(C=>{C.preventDefault(),l(!1)},[]),y=O.useCallback(C=>{C.preventDefault(),l(!1);const S=C.dataTransfer?.files;if(!S)return;Array.from(S).filter(T=>T.type.startsWith("image/")&&["image/jpeg","image/png","image/gif","image/webp"].includes(T.type)).forEach(u)},[u]),k=O.useCallback(()=>{i([])},[]),v=O.useCallback(()=>n.map(C=>({id:C.id,data:C.preview.split(",")[1],mediaType:C.file.type,name:C.file.name})),[n]);return{selectedImages:n,previewImage:s,isDragOver:o,handleImageSelect:h,handleImageRemove:f,handleImagePreview:d,handlePaste:g,handleDragOver:m,handleDragLeave:b,handleDrop:y,clearImages:k,getImagesForBackend:v,setPreviewImage:a}},Yw=({messagesContainerRef:e,messagesEndRef:t,messages:r,isAiTyping:n})=>{const[i,s]=O.useState(!1),[a,o]=O.useState(0),l=O.useCallback((h=100)=>{if(!e.current)return!1;const{scrollTop:f,scrollHeight:d,clientHeight:g}=e.current;return d-f-g<h},[e]),c=O.useCallback((h="smooth")=>{t.current?.scrollIntoView({behavior:h})},[t]),u=O.useCallback(()=>{const h=l();s(!h),h&&o(0)},[l]);return O.useEffect(()=>{const h=e.current;if(h)return h.addEventListener("scroll",u),()=>h.removeEventListener("scroll",u)},[u,e]),O.useEffect(()=>{i?o(h=>h+1):c()},[r,n,i,c]),{isUserScrolling:i,newMessagesCount:a,scrollToBottom:c,setNewMessagesCount:o,setIsUserScrolling:s}},Xw=({projectPath:e,textareaRef:t})=>{const{t:r}=we("components"),[n,i]=O.useState(!1),[s,a]=O.useState(""),[o,l]=O.useState(null),[c,u]=O.useState(0),[h,f]=O.useState(null),[d,g]=O.useState(!1),[m,b]=O.useState(null),y=[{id:"init",name:"init",description:r("systemCommands.init.description"),content:"/init",scope:"system",isSystem:!0},{id:"clear",name:"clear",description:r("systemCommands.clear.description"),content:"/clear",scope:"system",isSystem:!0},{id:"compact",name:"compact",description:r("systemCommands.compact.description"),content:"/compact",scope:"system",isSystem:!0},{id:"agents",name:"agents",description:r("systemCommands.agents.description"),content:"/agents",scope:"system",isSystem:!0},{id:"settings",name:"settings",description:r("systemCommands.settings.description"),content:"/settings",scope:"system",isSystem:!0},{id:"help",name:"help",description:r("systemCommands.help.description"),content:"/help",scope:"system",isSystem:!0}],{data:k=[],error:v}=ic({scope:"user",search:s}),{data:C=[],error:S}=sc({projectId:e||"",search:s}),{data:w=[]}=ic({scope:"user"}),{data:T=[]}=sc({projectId:e||""}),$=O.useCallback(B=>{const H=y.find(j=>j.name===B),Q=T.find(j=>j.name===B),_=w.find(j=>j.name===B);return!!(H||Q||_)},[y,T,w]),M=O.useCallback(()=>{const B=y.map(_=>_.content),H=T.map(_=>`/${_.name}`),Q=w.map(_=>`/${_.name}`);return[...B,...H,...Q].join(", ")},[y,T,w]),E=v||S,N=O.useMemo(()=>[...y.filter(H=>H.name.toLowerCase().includes(s.toLowerCase())||H.description.toLowerCase().includes(s.toLowerCase())),...C,...k],[k,C,s,y]);O.useEffect(()=>{u(B=>N.length>0&&B>=N.length?0:B)},[N.length]);const D=O.useCallback(B=>{if(h&&f(null),B.length>0&&B[B.length-1]==="@"){const H=B.substring(0,B.length-1);if(H.length===0||/\s$/.test(H)){b(B.length-1),g(!0),t.current?.blur();return}}},[h,t]),R=O.useCallback(B=>(l(B),i(!1),`/${B.name}`),[]),I=O.useCallback(()=>{i(!1)},[]),F=O.useCallback((B,H)=>{if(!t.current||m===null)return H;let Q=B;e&&B.startsWith(e)&&(Q=B.slice(e.length),Q.startsWith("/")&&(Q=Q.slice(1)));const _=H.substring(0,m),j=H.substring(m+1),te=_+"@"+Q+" "+j;return g(!1),b(null),setTimeout(()=>{if(t.current){const A=m+1+Q.length+1;t.current.selectionStart=t.current.selectionEnd=A,t.current.focus()}},0),te},[m,e,t]),L=O.useCallback(()=>{g(!1),b(null),setTimeout(()=>{t.current?.focus()},0)},[t]);return{showCommandSelector:n,commandSearch:s,selectedCommand:o,selectedCommandIndex:c,commandWarning:h,showFileBrowser:d,atSymbolPosition:m,allCommands:N,SYSTEM_COMMANDS:y,userCommands:w,projectCommands:T,hasCommandsLoadError:E,userCommandsError:v,projectCommandsError:S,setSelectedCommand:l,setSelectedCommandIndex:u,setCommandWarning:f,setShowCommandSelector:i,setShowFileBrowser:g,setAtSymbolPosition:b,setCommandSearch:a,handleInputChange:D,handleCommandSelect:R,handleCommandSelectorClose:I,handleFileSelect:F,handleFileBrowserClose:L,isCommandDefined:$,getAllAvailableCommands:M}},Qw=({agent:e})=>{const[t,r]=O.useState(!1),[n,i]=O.useState([]),[s,a]=O.useState([]),[o,l]=O.useState(!1),[c,u]=O.useState("bypassPermissions"),[h,f]=O.useState("sonnet"),[d,g]=O.useState(!1),[m,b]=O.useState(!1),[y,k]=O.useState(void 0),[v,C]=O.useState(!1),[S,w]=O.useState(!1),[T,$]=O.useState({});return O.useEffect(()=>{if(e?.allowedTools?.length>0){const M=e.allowedTools.filter(D=>D.enabled),E=[],N=[];M.forEach(D=>{if(D.name.includes(".")&&!D.name.startsWith("mcp__")){const[R,I]=D.name.split("."),F=`mcp__${R}__${I}`;N.push(F)}else D.name.startsWith("mcp__")?N.push(D.name):E.push(D.name)}),i(E),a(N),l(N.length>0)}},[e?.allowedTools]),{showToolSelector:t,selectedRegularTools:n,selectedMcpTools:s,mcpToolsEnabled:o,permissionMode:c,selectedModel:h,showPermissionDropdown:d,showModelDropdown:m,selectedClaudeVersion:y,showVersionDropdown:v,isVersionLocked:S,setShowToolSelector:r,setSelectedRegularTools:i,setSelectedMcpTools:a,setMcpToolsEnabled:l,setPermissionMode:u,setSelectedModel:f,setShowPermissionDropdown:g,setShowModelDropdown:b,setSelectedClaudeVersion:k,setShowVersionDropdown:C,setIsVersionLocked:w,envVars:T,setEnvVars:$}},Kw=({initialModel:e="sonnet",initialVersion:t})=>{const{data:r}=Pw(),[n,i]=O.useState(e),[s,a]=O.useState(t),[o,l]=O.useState(!1),c=O.useMemo(()=>{if(!r?.versions)return[];if(s){const m=r.versions.find(y=>y.id===s),b=m?.models||[];return console.log(`📦 availableModels computed: selectedClaudeVersion=${s}, found version=${m?.name}, models=`,b.map(y=>y.id)),b}const d=r.versions.find(m=>m.id===r.defaultVersionId)||r.versions[0],g=d?.models||[];return console.log(`📦 availableModels computed (using default): defaultVersion=${d?.name}, models=`,g.map(m=>m.id)),g},[r,s]);return O.useEffect(()=>{c.length>0&&(c.some(g=>g.id===n)||(console.log(`🔄 Model validation: selectedModel=${n} is not in availableModels:`,c.map(g=>g.id),`selectedClaudeVersion=${s}, resetting to ${c[0].id}`),i(c[0].id)))},[c,n,s]),{claudeVersionsData:r,availableModels:c,selectedModel:n,selectedClaudeVersion:s,isVersionLocked:o,setSelectedModel:i,setSelectedClaudeVersion:a,setIsVersionLocked:l,handleVersionChange:d=>{a(d);const g=r?.versions.find(m=>m.id===d);g&&g.models&&g.models.length>0&&i(g.models[0].id)},handleModelChange:d=>{i(d)},resetToDefaults:()=>{a(void 0),i(e),l(!1)}}},Zw={activeTasks:new Map},lc=eg((e,t)=>({...Zw,registerTaskTool:(r,n)=>{console.log("📋 [SubAgentStore] Registering Task tool:",r,"sessionId:",n),e(i=>{const s=new Map(i.activeTasks);return s.has(r)||s.set(r,{parentToolUseId:r,sessionId:n,messageFlow:[],startedAt:Date.now(),lastUpdatedAt:Date.now()}),{activeTasks:s}})},activateSubAgent:(r,n)=>{if(t().activeTasks.has(r)){console.log("📋 [SubAgentStore] SubAgent already active for:",r);return}console.log("📋 [SubAgentStore] Activating SubAgent for parentToolUseId:",r),e(s=>{const a=new Map(s.activeTasks);return a.set(r,{parentToolUseId:r,sessionId:n,messageFlow:[],startedAt:Date.now(),lastUpdatedAt:Date.now()}),{activeTasks:a}})},addSubAgentMessagePart:(r,n)=>{e(i=>{if(!i.activeTasks.get(r)){console.log("📋 [SubAgentStore] Creating new task for parentToolUseId:",r);const u=new Map(i.activeTasks);return u.set(r,{parentToolUseId:r,sessionId:"",messageFlow:[{id:`msg_${r}_${Date.now()}`,role:"assistant",timestamp:new Date().toISOString(),messageParts:[n]}],startedAt:Date.now(),lastUpdatedAt:Date.now()}),{activeTasks:u}}const a=new Map(i.activeTasks),o=a.get(r),l=o.messageFlow.findIndex(u=>u.messageParts.some(h=>h.id===n.id));let c;if(l>=0)c=o.messageFlow.map((u,h)=>h===l?{...u,messageParts:u.messageParts.map(f=>f.id===n.id?n:f)}:u);else{const u=o.messageFlow[o.messageFlow.length-1];u&&u.role==="assistant"?c=[...o.messageFlow.slice(0,-1),{...u,messageParts:[...u.messageParts,n]}]:c=[...o.messageFlow,{id:`msg_${r}_${Date.now()}`,role:"assistant",timestamp:new Date().toISOString(),messageParts:[n]}]}return a.set(r,{...o,messageFlow:c,lastUpdatedAt:Date.now()}),console.log("📋 [SubAgentStore] Added message part to",r,"type:",n.type,"total parts:",c.reduce((u,h)=>u+h.messageParts.length,0)),{activeTasks:a}})},getSubAgentMessageFlow:r=>t().activeTasks.get(r)?.messageFlow||[],clearSubAgentTask:r=>{console.log("📋 [SubAgentStore] Clearing SubAgent task:",r),e(n=>{const i=new Map(n.activeTasks);return i.delete(r),{activeTasks:i}})},reset:()=>{console.log("📋 [SubAgentStore] Resetting state"),e({activeTasks:new Map})}})),Jw=({agentId:e,currentSessionId:t,projectPath:r,isCompactCommand:n=!1,abortControllerRef:i,onSessionChange:s,setIsInitializingSession:a,setCurrentSessionId:o,setIsNewSession:l,setAiTyping:c,setHasSuccessfulResponse:u})=>{const{t:h}=we("components"),f=Tu(),{addMessage:d,addTextPartToMessage:g,addThinkingPartToMessage:m,updateTextPartInMessage:b,updateThinkingPartInMessage:y,addToolPartToMessage:k,updateToolPartInMessage:v,updateMcpStatus:C,setPendingUserQuestion:S,setA2AStreamStart:w,setA2AStreamEnd:T,addA2AStreamEvent:$}=Xe(),M=O.useRef(null),E=O.useRef(new Map),N=O.useRef({activeBlocks:new Map,currentMessageId:null,isStreaming:!1,wasStreamProcessed:!1,pendingUpdate:null,rafId:null}),D=O.useCallback((_,j,te)=>{const A=N.current;A.pendingUpdate={blockId:_,content:j,type:te},A.rafId===null&&(A.rafId=requestAnimationFrame(()=>{const P=A.pendingUpdate,Y=M.current;if(!P||!Y){A.rafId=null;return}const U=A.activeBlocks.get(P.blockId);if(!U||!U.partId){console.warn("🌊 [STREAMING] No partId found for block:",P.blockId),A.rafId=null;return}P.type==="text"?b(Y,U.partId,P.content):P.type==="thinking"&&y(Y,U.partId,P.content),A.pendingUpdate=null,A.rafId=null}))},[b,y]),R=O.useCallback((_,j)=>`${_}-${Date.now()}-${j}`,[]),{registerTaskTool:I,activateSubAgent:F,addSubAgentMessagePart:L}=lc.getState(),B=O.useCallback(_=>{try{const j=_;j.type==="system"&&j.subtype==="init"&&console.log("📋 [INIT] Received system init message, not intercepting");const te=j.isSidechain===!0,A=j.parentToolUseId;if(te&&A){console.log("🎯 [SIDECHAIN] Intercepted sub-agent message, parentToolUseId:",A,"type:",j.type);const P=A,Y=j.sessionId||j.session_id;if(Y&&F(P,Y),j.type==="stream_event"&&j.event){const U=j.event;if(U.type==="content_block_start"&&U.content_block){const q=U.index,V=U.content_block;if(V.type==="text"){const K=`part_${P}_text_${q}_${Date.now()}`;L(P,{id:K,type:"text",content:"",order:q}),E.current.set(`${P}-${q}`,K),console.log("🎯 [SIDECHAIN] Started text block:",K)}else if(V.type==="thinking"){const K=`part_${P}_thinking_${q}_${Date.now()}`;L(P,{id:K,type:"thinking",content:"",order:q}),E.current.set(`${P}-${q}`,K)}else if(V.type==="tool_use"){const K=`part_${P}_tool_${q}_${Date.now()}`;L(P,{id:K,type:"tool",toolData:{id:V.id,toolName:V.name,toolInput:{},isError:!1},order:q}),E.current.set(`${P}-${q}`,K),console.log("🎯 [SIDECHAIN] Added tool_use to sub-agent:",V.name)}}if(U.type==="content_block_delta"&&U.delta){const q=U.index,V=U.delta,K=E.current.get(`${P}-${q}`);if(K){const ye=lc.getState().activeTasks.get(P);if(ye)for(const _e of ye.messageFlow){const ve=_e.messageParts.find(Le=>Le.id===K);if(ve){if(V.type==="text_delta"&&V.text){const Le=(ve.content||"")+V.text;L(P,{...ve,content:Le}),Le.length%100<10&&console.log("🎯 [SIDECHAIN] Text accumulated:",Le.length,"chars")}else if(V.type==="thinking_delta"&&V.thinking){const Le=(ve.content||"")+V.thinking;L(P,{...ve,content:Le})}break}}}}}if(j.type==="assistant"&&j.message){const U=j.message;if(console.log("🎯 [SIDECHAIN] Processing assistant message, blocks:",U.content?.length||0),U.content&&Array.isArray(U.content))for(let q=0;q<U.content.length;q++){const V=U.content[q];V.type==="text"&&V.text?(console.log("🎯 [SIDECHAIN] Adding text from assistant:",V.text.substring(0,50)),L(P,{id:`part_${P}_text_${q}_${Date.now()}`,type:"text",content:V.text,order:q})):V.type==="thinking"&&V.thinking?L(P,{id:`part_${P}_thinking_${q}_${Date.now()}`,type:"thinking",content:V.thinking,order:q}):V.type==="tool_use"&&(L(P,{id:`part_${P}_tool_${q}_${Date.now()}`,type:"tool",toolData:{id:V.id,toolName:V.name,toolInput:V.input||{},isError:!1},order:q}),console.log("🎯 [SIDECHAIN] Added tool_use from assistant:",V.name))}}if(j.type==="user"&&j.message){const U=j.message;if(U.content&&Array.isArray(U.content))for(const q of U.content){const V=q;if(V.type==="text"){console.log("🎯 [SIDECHAIN] Skipping user text (task prompt already shown)");continue}V.type==="tool_result"&&V.tool_use_id&&console.log("🎯 [SIDECHAIN] Tool result for:",V.tool_use_id,"error:",V.is_error)}}return}if(j.type==="stream_event"&&j.event){const P=j.event;if(console.log("🌊 [STREAMING] Detected stream_event:",P.type,"Full event:",JSON.stringify(j).substring(0,200)),N.current.wasStreamProcessed=!0,P.type==="message_start"){if(M.current)console.log("🌊 [STREAMING] message_start: AI message already exists, skipping:",M.current);else{d({content:"",role:"assistant"});const U=Xe.getState();M.current=U.messages[U.messages.length-1].id,N.current.currentMessageId=M.current,N.current.isStreaming=!0,console.log("🌊 [STREAMING] message_start: Created new AI message with ID:",M.current)}return}if(P.type==="content_block_start"){const Y=P.index,U=P.content_block;if(!M.current){d({content:"",role:"assistant"});const re=Xe.getState();M.current=re.messages[re.messages.length-1].id,N.current.currentMessageId=M.current,N.current.isStreaming=!0}const q=`block-${M.current}-${Y}`,V=Date.now();if(N.current.activeBlocks.has(q)){console.warn("🌊 [STREAMING] content_block_start: Block already exists, skipping:",q);return}if(U.type==="text"){g(M.current,"");const re=Xe.getState().messages.find(Le=>Le.id===M.current),_e=re?.messageParts?.[re.messageParts.length-1]?.id,ve={blockId:q,type:"text",content:"",isComplete:!1,messageId:M.current,partId:_e,startedAt:V,lastUpdatedAt:V};N.current.activeBlocks.set(q,ve),console.log("🌊 [STREAMING] content_block_start: Initialized text block",q,"partId:",_e)}else if(U.type==="thinking"){m(M.current,"");const re=Xe.getState().messages.find(Le=>Le.id===M.current),_e=re?.messageParts?.[re.messageParts.length-1]?.id,ve={blockId:q,type:"thinking",content:"",isComplete:!1,messageId:M.current,partId:_e,startedAt:V,lastUpdatedAt:V};N.current.activeBlocks.set(q,ve),console.log("🤔 [STREAMING] content_block_start: Initialized thinking block",q,"partId:",_e)}else if(U.type==="tool_use"){if(console.log("🔧 [STREAMING] content_block_start: Processing tool_use",{toolName:U.name,claudeId:U.id,blockId:q,messageId:M.current}),U.name==="Task"){const re=t||j.sessionId||j.session_id;re&&U.id&&(console.log("🎯 [TASK] Registering Task tool for sub-agent tracking:",U.id),I(U.id,re))}const K={toolName:U.name,toolInput:{},isExecuting:!0,claudeId:U.id};try{k(M.current,K),console.log("🔧 [STREAMING] content_block_start: addToolPartToMessage completed");const re=Xe.getState();console.log("🔧 [STREAMING] content_block_start: Got store state, messages count:",re.messages.length);const ye=re.messages.find(Oe=>Oe.id===M.current);console.log("🔧 [STREAMING] content_block_start: Found current message:",!!ye,"parts count:",ye?.messageParts?.length);const _e=ye?.messageParts?.[ye.messageParts.length-1];console.log("🔧 [STREAMING] content_block_start: Latest part:",{exists:!!_e,type:_e?.type,hasToolData:!!_e?.toolData,toolDataId:_e?.toolData?.id});const ve=_e?.toolData?.id;ve||console.error("🔧 [STREAMING] content_block_start: ⚠️ partId is undefined! Latest part:",_e);const Le={blockId:q,type:"tool_use",content:"",isComplete:!1,messageId:M.current,partId:ve,startedAt:V,lastUpdatedAt:V};N.current.activeBlocks.set(q,Le),console.log("🔧 [STREAMING] content_block_start: ✅ Initialized tool_use block",U.name,"blockId:",q,"partId:",ve,"claudeId:",U.id)}catch(re){throw console.error("🔧 [STREAMING] content_block_start: ❌ Error processing tool_use:",re),re}}return}if(P.type==="content_block_delta"&&M.current){const Y=P.index,U=P.delta,q=`block-${M.current}-${Y}`,V=Date.now();if(U.type==="text_delta"&&U.text!==void 0){let K=N.current.activeBlocks.get(q);if(K)K.content+=U.text,K.lastUpdatedAt=V,console.log(`🌊 [STREAMING] content_block_delta: Accumulated text delta "${U.text}" to block ${q}, total: "${K.content.substring(0,50)}..."`);else{console.warn("🌊 [STREAMING] content_block_delta: Missing content_block_start for text block, creating fallback"),g(M.current,"");const ye=Xe.getState().messages.find(Le=>Le.id===M.current),ve=ye?.messageParts?.[ye.messageParts.length-1]?.id;K={blockId:q,type:"text",content:U.text,isComplete:!1,messageId:M.current,partId:ve,startedAt:V,lastUpdatedAt:V},N.current.activeBlocks.set(q,K),console.log(`🌊 [STREAMING] content_block_delta: Created text block ${q} (fallback) with partId: ${ve}, content: "${U.text}"`)}D(q,K.content,"text")}else if(U.type==="thinking_delta"&&U.thinking!==void 0){let K=N.current.activeBlocks.get(q);if(K)K.content+=U.thinking,K.lastUpdatedAt=V,console.log(`🤔 [STREAMING] content_block_delta: Accumulated thinking delta "${U.thinking}" to block ${q}, total: "${K.content.substring(0,50)}..."`);else{console.warn("🤔 [STREAMING] content_block_delta: Missing content_block_start for thinking block, creating fallback"),m(M.current,"");const ye=Xe.getState().messages.find(Le=>Le.id===M.current),ve=ye?.messageParts?.[ye.messageParts.length-1]?.id;K={blockId:q,type:"thinking",content:U.thinking,isComplete:!1,messageId:M.current,partId:ve,startedAt:V,lastUpdatedAt:V},N.current.activeBlocks.set(q,K),console.log(`🤔 [STREAMING] content_block_delta: Created thinking block ${q} (fallback) with partId: ${ve}, content: "${U.thinking}"`)}D(q,K.content,"thinking")}else if(U.type==="input_json_delta"){const K=U.partial_json||"";let re=N.current.activeBlocks.get(q);if(re){re.content+=K,re.lastUpdatedAt=V;const ye=re.content,_e=ye.trim();if(re.partId&&_e.endsWith("}"))try{const ve=JSON.parse(ye);v(M.current,re.partId,{toolInput:ve}),console.log(`🔧 [STREAMING] content_block_delta: Updated tool_use block ${q}, parsed complete JSON`)}catch{console.log(`🔧 [STREAMING] content_block_delta: JSON not yet complete for ${q}, length: ${ye.length}`)}}else{if(console.warn("🔧 [STREAMING] content_block_delta: Missing content_block_start for tool block, creating fallback"),!P.content_block||P.content_block.type!=="tool_use"){console.error("🔧 [STREAMING] content_block_delta: Missing content_block info for tool, cannot create fallback");return}const ye=P.content_block.name,_e=P.content_block.id;k(M.current,{toolName:ye,toolInput:{},isExecuting:!0,claudeId:_e});const Le=Xe.getState().messages.find(it=>it.id===M.current),Mt=Le?.messageParts?.[Le.messageParts.length-1]?.toolData?.id;re={blockId:q,type:"tool_use",content:K,isComplete:!1,messageId:M.current,partId:Mt,startedAt:V,lastUpdatedAt:V},N.current.activeBlocks.set(q,re),console.log("🔧 [STREAMING] content_block_delta: Created tool_use block (fallback)",ye,"blockId:",q,"partId:",Mt,"initial fragment:",K)}}return}if(P.type==="content_block_stop"&&M.current){const Y=P.index,U=`block-${M.current}-${Y}`,q=N.current.activeBlocks.get(U);if(q){q.isComplete=!0,console.log(`🌊 [STREAMING] content_block_stop: Block ${U} complete, type: ${q.type}, content length: ${q.content.length}`);const V=N.current;if(V.pendingUpdate?.blockId===U){console.log(`🌊 [STREAMING] content_block_stop: Flushing pending RAF for ${U} immediately`),V.rafId!==null&&(cancelAnimationFrame(V.rafId),V.rafId=null);const K=V.pendingUpdate;q.partId&&(K.type==="text"?b(M.current,q.partId,K.content):K.type==="thinking"&&y(M.current,q.partId,K.content),console.log(`🌊 [STREAMING] content_block_stop: Flushed ${K.type} content for ${U}, length: ${K.content.length}`)),V.pendingUpdate=null}else if((q.type==="text"||q.type==="thinking")&&q.partId)console.log(`🌊 [STREAMING] content_block_stop: Final check - ensuring ${q.type} content saved, length: ${q.content.length}`),q.type==="text"?b(M.current,q.partId,q.content):q.type==="thinking"&&y(M.current,q.partId,q.content);else if(q.type==="tool_use"&&q.partId&&q.content){console.log(`🔧 [STREAMING] content_block_stop: Finalizing tool_use block ${U}, accumulated JSON length: ${q.content.length}`);try{const K=JSON.parse(q.content);v(M.current,q.partId,{toolInput:K}),console.log(`🔧 [STREAMING] content_block_stop: Successfully parsed final tool input for ${U}`)}catch(K){console.error(`🔧 [STREAMING] content_block_stop: Failed to parse final tool JSON for ${U}:`,K,"content:",q.content.substring(0,200))}}N.current.activeBlocks.delete(U),console.log(`🌊 [STREAMING] content_block_stop: Cleaned up block ${U}`)}return}if(P.type==="message_delta"){console.log("🌊 [STREAMING] message_delta:",P.delta);return}if(P.type==="message_stop"){if(N.current.isStreaming){console.log("🌊 [STREAMING] message_stop: Finalizing all streaming blocks, count:",N.current.activeBlocks.size);const Y=M.current,U=N.current;if(U.pendingUpdate&&U.rafId!==null){console.log(`🌊 [STREAMING] message_stop: Flushing pending RAF for ${U.pendingUpdate.blockId}`),cancelAnimationFrame(U.rafId),U.rafId=null;const q=U.pendingUpdate,V=U.activeBlocks.get(q.blockId);V&&V.partId&&Y&&(q.type==="text"?b(Y,V.partId,q.content):q.type==="thinking"&&y(Y,V.partId,q.content),console.log(`🌊 [STREAMING] message_stop: Flushed ${q.type} content, length: ${q.content.length}`)),U.pendingUpdate=null}Y&&U.activeBlocks.forEach(q=>{q.isComplete=!0,(q.type==="text"||q.type==="thinking")&&q.partId?(console.log(`🌊 [STREAMING] message_stop: Final check for ${q.type} block ${q.blockId}, length: ${q.content.length}`),q.type==="text"?b(Y,q.partId,q.content):q.type==="thinking"&&y(Y,q.partId,q.content)):q.partId||console.error(`❌ [STREAMING] message_stop: Missing partId for block ${q.blockId}, content LOST:`,q.content.substring(0,100))}),U.isStreaming=!1,U.currentMessageId=null,U.activeBlocks.clear(),console.log("🌊 [STREAMING] message_stop: All blocks finalized and cleared")}return}console.warn("🌊 [STREAMING] Unknown stream_event type:",P.type);return}if(j.type==="error"){console.error("Claude Code SDK error:",j),c(!1),a(!1),i.current=null;let P="";j.subtype&&j.message?(console.log("📋 Processing structured error with subtype:",j.subtype),P=`❌ **${{error_during_execution:h("agentChat.executionError"),error_max_turns:h("agentChat.maxTurnsReached"),error_max_budget_usd:h("agentChat.maxBudgetReached"),error_max_structured_output_retries:h("agentChat.maxRetriesReached")}[j.subtype]||h("agentChat.processingError")}**
3
+
4
+ ${j.message}`,P+=`
5
+
6
+ **${h("agentChatPanel.errors.suggestedActions")}**
7
+ `,j.subtype==="error_max_budget_usd"?P+=`- ${h("agentChatPanel.errors.checkBudget")}
8
+ `:j.subtype==="error_max_turns"&&(P+=`- ${h("agentChatPanel.errors.increaseMaxTurns")}
9
+ `),P+=`- ${h("agentChatPanel.errors.resendMessage")}
10
+ `,P+=`- ${h("agentChatPanel.errors.refreshPage")}`):j.error==="Claude Code SDK failed"&&j.message&&typeof j.message=="string"?(P=`${h("agentChat.errorMessages.claudeCodeSDKError")}
11
+
12
+ `,j.message.includes("not valid JSON")?P+=h("agentChatPanel.errors.jsonParseError"):j.message.includes("timeout")?P+=h("agentChatPanel.errors.timeoutError"):j.message.includes("context window")||j.message.includes("context_window")?P+=h("agentChatPanel.errors.contextWindowError"):P+=`${j.message}
13
+
14
+ **${h("agentChatPanel.errors.suggestedActions")}**
15
+ - ${h("agentChatPanel.errors.resendMessage")}
16
+ - ${h("agentChatPanel.errors.refreshPage")}`):(P=`${h("agentChat.errorMessages.claudeCodeSDKError")}
17
+
18
+ `,P+=`${j.message||j.error||h("agentChatPanel.errors.unknownError")}
19
+
20
+ **${h("agentChatPanel.errors.suggestedActions")}**
21
+ - ${h("agentChatPanel.errors.resendMessage")}
22
+ - ${h("agentChatPanel.errors.refreshPage")}`),M.current?g(M.current,`
23
+
24
+ `+P):d({content:P,role:"assistant"});return}if(j.type==="system"&&j.subtype==="init"&&(j.sessionId||j.session_id)){const P=j.sessionId||j.session_id;console.log("Setting session ID from AI response:",P),a(!1),!t&&P&&(o(P),l(!0),s&&s(P),f.invalidateQueries({queryKey:["agent-sessions",e]}));return}if(j.type==="mcp_status"){if(console.log("📡 MCP Status Event:",j),j.subtype==="connection_failed"){const P=j.failedServers||[];console.warn("🚨 MCP服务器连接失败:",P),C({hasError:!0,connectionErrors:P,lastError:`连接失败: ${P.map(Y=>Y.name).join(", ")}`})}else if(j.subtype==="connection_success"){const P=j.connectedServers||[];console.log("✅ MCP服务器连接成功:",P.map(Y=>Y.name)),C({hasError:!1,connectedServers:P,connectionErrors:[],lastError:null})}return}if(j.type==="mcp_error"){if(console.log("❌ MCP Error Event:",j),j.subtype==="execution_failed"){const P=j,Y=P.tool||"未知工具",U=P.error||"执行失败",q=P.details||"";console.error("❌ MCP工具执行失败:",{tool:Y,error:U,details:q}),C({hasError:!0,lastError:`工具执行失败: ${Y} - ${U}`,lastErrorDetails:q})}return}if(j.type==="awaiting_user_input"){console.log("🎤 [AskUserQuestion] Received awaiting_user_input event:",j);const P=j;S({toolUseId:P.toolUseId,toolName:P.toolName,questions:P.toolInput?.questions||[],timestamp:Date.now()}),console.log("🎤 [AskUserQuestion] Set pending question, MCP tool is waiting for user response");return}if(j.type==="a2a_stream_start"){const P=j;w(P.agentUrl,P.sessionId,P.message);return}if(j.type==="a2a_stream_data"){const P=j;P.agentUrl&&$(P.agentUrl,{type:P.event?.type||"unknown",sessionId:P.event?.sessionId,message:P.event?.message,timestamp:P.timestamp});return}if(j.type==="a2a_stream_end"){const P=j,Y=Xe.getState();for(const[U,q]of Object.entries(Y.activeA2AStreams))if(q.sessionId===P.sessionId){T(U);break}return}if(j.type==="session_resumed"&&j.subtype==="new_branch"){const P=j;console.log("🔄 Session resumed with new branch:",P),console.log("🔄 Updating session ID from",t,"to",P.newSessionId),a(!1),o(P.newSessionId),l(!0),s&&(console.log("🔄 Updating URL with new session ID:",P.newSessionId),s(P.newSessionId)),d({content:`${h("agentChat.sessionResumed")}
25
+
26
+ ${P.message}
27
+
28
+ ${h("agentChat.sessionIdUpdated")}`,role:"assistant"}),f.invalidateQueries({queryKey:["agent-sessions",e]}),t&&P.originalSessionId&&P.newSessionId&&(ws.handleSessionResume(e,P.originalSessionId,P.newSessionId),ws.recordSessionResume(e,P.originalSessionId,P.newSessionId),console.log(`🎯 TabManager updated for session resume: ${P.originalSessionId} → ${P.newSessionId}`)),console.log("✅ Session resume handling complete");return}if(j.type==="system"&&j.subtype==="init")return;if(j.type==="assistant"){if(N.current.wasStreamProcessed){console.log("📝 [ASSISTANT] Skipping assistant message - already processed via stream_event (prevents duplicates)");return}if(!M.current){d({content:"",role:"assistant"});const Y=Xe.getState();M.current=Y.messages[Y.messages.length-1].id,console.log("📝 Created new AI message with ID:",M.current)}if(j.message&&typeof j.message=="object"&&"content"in j.message&&j.message.content&&M.current){console.log("📝 Processing assistant message content blocks:",j.message.content.length,"aiMessageId:",M.current);for(const P of j.message.content)if(console.log("📝 Processing block:",{type:P.type,hasText:!!P.text,hasThinking:!!P.thinking,textLength:P.text?.length,thinkingLength:P.thinking?.length,toolName:P.name}),P.type==="text")P.text?(console.log("📝 Adding text part:",P.text.substring(0,100)+(P.text.length>100?"...":"")),n&&console.log("📦 Detected /compact command response, adding as compactSummary"),g(M.current,P.text)):console.warn("📝 Text block has no text content");else if(P.type==="thinking")P.thinking?(console.log("🤔 Adding thinking part:",P.thinking.substring(0,100)+(P.thinking.length>100?"...":"")),m(M.current,P.thinking)):console.warn("🤔 Thinking block has no thinking content");else if(P.type==="tool_use"){if(P.name){console.log("📝 Adding tool part:",P.name,"id:",P.id),P.name==="BashOutput"&&console.log("🐚 [BashOutput] Tool use detected, claudeId:",P.id,"input:",P.input);const Y={toolName:P.name,toolInput:P.input||{},isExecuting:!0,claudeId:P.id};k(M.current,Y)}}else console.log("📝 Unknown block type:",P.type)}else console.warn("📝 No content or aiMessageId for assistant message:",{hasMessage:!!j.message,hasContent:!!j.message?.content,aiMessageId:M.current});return}if(j.type==="user"){if(j.message&&typeof j.message=="object"&&"content"in j.message&&j.message.content&&M.current){for(const P of j.message.content)if(P.type==="tool_result"&&P.tool_use_id){console.log("🔧 Processing tool_result for tool_use_id:",P.tool_use_id,"content:",P.content,"is_error:",P.is_error);const Y=Xe.getState();let U=null,q=null;for(const V of Y.messages)if(V.messageParts){const K=V.messageParts.find(re=>re.type==="tool"&&re.toolData?.claudeId===P.tool_use_id);if(K){U=K,q=V.id;break}}if(console.log("🔧 Found target tool:",{toolData:U?.toolData,messageId:q,currentMessageId:M.current}),U?.toolData&&q){const V=typeof P.content=="string"?P.content:Array.isArray(P.content)?P.content.map(K=>K.text||String(K)).join(""):JSON.stringify(P.content);if(console.log("🔧 Updating tool with result, setting isExecuting: false"),U.toolData.toolName==="Task"&&U.toolData.claudeId){const K=U.toolData.claudeId;console.log("🎯 [TASK] Task tool completed, appending result to sub-agent flow:",K),V&&typeof V=="string"&&V.trim()&&(L(K,{id:`part_${K}_result_${Date.now()}`,type:"text",content:V,order:9999}),console.log("🎯 [TASK] Appended result text to sub-agent flow, length:",V.length))}U.toolData.toolName==="BashOutput"&&console.log("🐚 [BashOutput] Updating tool result:",{toolId:U.toolData.id,messageId:q,toolResult:V?.substring(0,200),rawContent:P.content}),v(q,U.toolData.id,{toolResult:V,isError:P.is_error||!1,isExecuting:!1})}else{console.warn("🔧 No target tool found for tool_use_id:",P.tool_use_id);const V=Y.messages.flatMap(K=>(K.messageParts||[]).filter(re=>re.type==="tool").map(re=>({claudeId:re.toolData?.claudeId,toolName:re.toolData?.toolName,isExecuting:re.toolData?.isExecuting})));console.warn("🔧 Available tools:",V)}}}return}if(j.type==="assistant"&&j.message&&typeof j.message=="object"&&"content"in j.message&&j.message.content&&M.current){for(const P of j.message.content)if(P.type==="tool_result"&&P.tool_use_id){console.log("🔧 Processing tool_result in assistant message for tool_use_id:",P.tool_use_id);const Y=Xe.getState();let U=null,q=null;for(const V of Y.messages)if(V.messageParts){const K=V.messageParts.find(re=>re.type==="tool"&&re.toolData?.claudeId===P.tool_use_id);if(K){U=K,q=V.id;break}}if(console.log("🔧 Found target tool in assistant message:",{toolData:U?.toolData,messageId:q,currentMessageId:M.current}),U?.toolData&&q){const V=typeof P.content=="string"?P.content:Array.isArray(P.content)?P.content.map(K=>K.text||String(K)).join(""):JSON.stringify(P.content);console.log("🔧 Updating tool with result in assistant message, setting isExecuting: false"),v(q,U.toolData.id,{toolResult:V,isError:P.is_error||!1,isExecuting:!1})}else console.warn("🔧 No target tool found for tool_use_id in assistant message:",P.tool_use_id)}return}if(j.type==="result"){console.log("Received result event:",{subtype:j.subtype,isSideChain:j.isSideChain});const P=j.isSideChain;if(P?console.log("Side chain result received, continuing main task..."):(console.log("Main task result received, stopping AI typing..."),N.current.isStreaming&&(console.log("🌊 [STREAMING] Finalizing all streaming blocks"),N.current.activeBlocks.forEach(Y=>{Y.isComplete=!0,console.log(`🌊 [STREAMING] Marked block ${Y.blockId} as complete`)}),N.current.isStreaming=!1,N.current.currentMessageId=null,N.current.rafId!==null&&(cancelAnimationFrame(N.current.rafId),N.current.rafId=null),N.current.activeBlocks.clear()),i.current=null,c(!1),j.subtype==="success"&&(u(!0),console.log("✅ Marked session as having successful response for heartbeat"),ac.emit(oc.AI_RESPONSE_COMPLETE,{agentId:e,sessionId:t,projectPath:r}),console.log("📡 Emitted AI_RESPONSE_COMPLETE event"))),!P){if(!M.current&&j.subtype==="success"){console.log("📝 Creating AI message from result event - no assistant messages received");const U=j.result;if(U&&typeof U=="string"){d({content:"",role:"assistant"});const V=Xe.getState();M.current=V.messages[V.messages.length-1].id,M.current&&g(M.current,U),console.log("📝 Added result content to new AI message:",U.substring(0,100))}else{console.warn("📝 Result event with no content - creating empty success message");const q={content:h("agentChat.taskComplete"),role:"assistant"};d(q);const V=Xe.getState();M.current=V.messages[V.messages.length-1].id}}if(M.current){const q=Xe.getState().messages.find(V=>V.id===M.current);q?.messageParts&&q.messageParts.forEach(V=>{V.type==="tool"&&V.toolData?.isExecuting&&(console.log("Force completing tool:",V.toolData.toolName,"claudeId:",V.toolData.claudeId),v(M.current,V.toolData.id,{isExecuting:!1,toolResult:V.toolData.toolResult||h("agentChat.executionCompleted")}))})}let Y="";j.subtype==="success"?Y="":j.subtype==="error_max_turns"?(Y=`
29
+
30
+ ${h("agentChat.maxTurnsReached")}`,j.permission_denials&&j.permission_denials.length>0&&(Y+=`
31
+
32
+ ${h("agentChat.permissionDenials")}`,j.permission_denials.forEach((U,q)=>{Y+=`
33
+ ${q+1}. ${U.tool_name}: \`${U.tool_input.command||U.tool_input.description||JSON.stringify(U.tool_input)}\``}),Y+=`
34
+
35
+ ${h("agentChat.permissionNote")}`)):j.subtype==="error_during_execution"?(Y=`
36
+
37
+ ${h("agentChat.executionError")}`,j.errors&&Array.isArray(j.errors)&&(Y+=`
38
+
39
+ ${j.errors.join(`
40
+ `)}`)):j.subtype==="error_max_budget_usd"?(Y=`
41
+
42
+ ${h("agentChat.maxBudgetReached")}`,j.errors&&Array.isArray(j.errors)&&(Y+=`
43
+
44
+ ${j.errors.join(`
45
+ `)}`)):j.subtype==="error_max_structured_output_retries"?(Y=`
46
+
47
+ ${h("agentChat.maxRetriesReached")}`,j.errors&&Array.isArray(j.errors)&&(Y+=`
48
+
49
+ ${j.errors.join(`
50
+ `)}`)):j.subtype==="error"?(Y=`
51
+
52
+ ${h("agentChat.processingError")}`,j.errors&&Array.isArray(j.errors)&&(Y+=`
53
+
54
+ ${j.errors.join(`
55
+ `)}`)):Y=`
56
+
57
+ ${h("agentChat.processingComplete")}`,M.current&&Y&&g(M.current,Y),t&&f.invalidateQueries({queryKey:["agent-sessions",e]})}return}}catch(j){console.error("❌ [STREAMING] Error in handleStreamMessage:",j),console.error("❌ [STREAMING] Error stack:",j instanceof Error?j.stack:"No stack trace"),console.error("❌ [STREAMING] Event data:",JSON.stringify(_).substring(0,500));try{M.current?g(M.current,`
58
+
59
+ ❌ **Streaming Error**: ${j instanceof Error?j.message:String(j)}
60
+
61
+ Please refresh the page and try again.`):d({content:`❌ **Streaming Error**: ${j instanceof Error?j.message:String(j)}
62
+
63
+ Please refresh the page and try again.`,role:"assistant"})}catch(te){console.error("❌ [STREAMING] Failed to display error message:",te)}c(!1)}},[e,t,r,n,i,s,a,o,l,c,u,h,f,d,g,m,b,y,k,v,C,S,w,T,$,D,R]),H=O.useCallback(_=>{if(console.error("SSE error:",_),c(!1),a(!1),i.current=null,_ instanceof DOMException&&_.name==="AbortError"){console.log("Request was aborted by user");return}let j=h("agentChat.genericError");_ instanceof Error&&(_.message.includes("network")||_.message.includes("fetch")?j=h("agentChatPanel.errors.networkError"):_.message.includes("timeout")?j=h("agentChatPanel.errors.requestTimeout"):_.message.includes("rate limit")||_.message.includes("429")?j=h("agentChatPanel.errors.rateLimit"):_.message.includes("unauthorized")||_.message.includes("401")?j=h("agentChatPanel.errors.unauthorized"):_.message.includes("forbidden")||_.message.includes("403")?j=h("agentChatPanel.errors.forbidden"):_.message.includes("500")||_.message.includes("internal server")?j=h("agentChatPanel.errors.internalServerError"):j=`❌ **${h("agentChatPanel.errors.processingError")}**
64
+
65
+ ${_.message||h("agentChatPanel.errors.unknownErrorRetry")}`),M.current?g(M.current,`
66
+
67
+ `+j):d({content:j,role:"assistant"})},[i,c,a,h,d,g]),Q=O.useCallback(()=>{M.current=null,N.current.wasStreamProcessed=!1,N.current.isStreaming=!1,N.current.currentMessageId=null},[]);return{handleStreamMessage:B,handleStreamError:H,resetMessageId:Q}};class ev{agentStore;onNewSession;onNavigate;onConfirm;constructor(t){this.agentStore=t.agentStore,this.onNewSession=t.onNewSession,this.onNavigate=t.onNavigate,this.onConfirm=t.onConfirm}async executeCommand(t,r){switch(t.name.toLowerCase()){case"clear":return this.handleClearCommand();case"init":return this.handleInitCommand();case"compact":return this.handleCompactCommand();case"agents":return this.handleAgentsCommand();case"settings":return this.handleSettingsCommand();case"help":return this.handleHelpCommand();default:return this.handleCustomCommand(t,r)}}handleClearCommand(){return this.onNewSession?(this.onNewSession(),{shouldSendToBackend:!1,message:"已清空对话,开始新会话",action:"newSession"}):(this.agentStore.clearMessages(),{shouldSendToBackend:!1,message:"已清空对话历史",action:"none"})}handleInitCommand(){return{shouldSendToBackend:!0}}handleCompactCommand(){return{shouldSendToBackend:!0}}handleAgentsCommand(){const t="是否要跳转到代理管理页面?";return this.onConfirm&&this.onConfirm(t,()=>{this.onNavigate&&this.onNavigate("/agents")}),{shouldSendToBackend:!1,message:t,action:"confirm",actionData:{path:"/agents"}}}handleSettingsCommand(){const t="是否要跳转到设置页面?";return this.onConfirm&&this.onConfirm(t,()=>{this.onNavigate&&this.onNavigate("/settings")}),{shouldSendToBackend:!1,message:t,action:"confirm",actionData:{path:"/settings"}}}handleHelpCommand(){return{shouldSendToBackend:!1,message:`
68
+ 可用命令:
69
+ • /clear - 清空对话历史
70
+ • /init - 初始化项目或重置对话上下文
71
+ • /compact - 压缩对话历史
72
+ • /agents - 管理AI代理
73
+ • /settings - 打开设置页面
74
+ • /help - 显示帮助信息
75
+ `.trim(),action:"none"}}handleCustomCommand(t,r){return t.name.includes("nav")||t.name.includes("goto")||"namespace"in t&&t.namespace==="nav"?{shouldSendToBackend:!1,message:`导航命令 ${t.name} 需要前端处理`,action:"confirm"}:t.name.includes("ui")||t.name.includes("show")||"namespace"in t&&t.namespace==="ui"?{shouldSendToBackend:!1,message:`UI命令 ${t.name} 在前端执行`,action:"none"}:{shouldSendToBackend:!0}}}function tv(e){return new ev(e)}const rv=e=>{const{agent:t,projectPath:r,inputMessage:n,selectedImages:i,isAiTyping:s,currentSessionId:a,hasCommandsLoadError:o,userCommandsError:l,projectCommandsError:c,SYSTEM_COMMANDS:u,userCommands:h,projectCommands:f,selectedCommand:d,selectedRegularTools:g,selectedMcpTools:m,mcpToolsEnabled:b,permissionMode:y,selectedModel:k,selectedClaudeVersion:v,abortControllerRef:C,onSessionChange:S,setInputMessage:w,clearImages:T,setSelectedCommand:$,setShowCommandSelector:M,setCommandWarning:E,setIsInitializingSession:N,setCurrentSessionId:D,setIsNewSession:R,setAiTyping:I,setHasSuccessfulResponse:F,setConfirmMessage:L,setConfirmAction:B,setShowConfirmDialog:H,handleNewSession:Q,isCommandDefined:_,getAllAvailableCommands:j,envVars:te}=e,{t:A}=we("components"),{addMessage:P,addCommandPartToMessage:Y,addTextPartToMessage:U}=Xe(),q=lw(),V=O.useRef(!1),K={agentId:t.id,currentSessionId:a,projectPath:r,isCompactCommand:V.current,abortControllerRef:C,onSessionChange:S,setIsInitializingSession:N,setCurrentSessionId:D,setIsNewSession:R,setAiTyping:I,setHasSuccessfulResponse:F},{handleStreamMessage:re,handleStreamError:ye,resetMessageId:_e}=Jw(K),ve=O.useCallback(()=>{if(s||!n.trim()&&i.length===0)return!0;if(us(n)){const Oe=n.slice(1).split(" ")[0].toLowerCase();return!_(Oe)}return!1},[n,s,i,_]),Le=O.useCallback(async()=>{if(!n.trim()&&i.length===0||s)return;let Oe=n.trim();const it=[...i].map(Ee=>({id:Ee.id,data:Ee.preview.split(",")[1],mediaType:Ee.file.type,name:Ee.file.name}));if(us(n)){const Ee=n.slice(1).split(" ")[0].toLowerCase();if(!_(Ee)){E(o?A("agentChat.commandsLoadErrorWarning",{command:Ee,commands:u.map(ze=>ze.content).join(", "),errorMessage:l?.message||c?.message||"Unknown error"}):A("agentChat.unknownCommandWarning",{command:Ee,commands:j()}));return}E(null);const st=tv({agentStore:Xe.getState(),onNewSession:Q,onNavigate:ze=>{$w(A("agentChat.navigateToAlert",{path:ze}))},onConfirm:(ze,Lt)=>{L(ze),B(()=>Lt),H(!0)}});let ft=d;if(ft||(ft=u.find(ze=>ze.name===Ee)||f.find(ze=>ze.name===Ee)||h.find(ze=>ze.name===Ee)||null),ft){const ze=await st.executeCommand(ft);if(ze.shouldSendToBackend){Oe=n.trim(),P({content:"",role:"user",images:it});const gt=Xe.getState(),G=gt.messages[gt.messages.length-1].id;Y(G,Oe)}else{const Lt=n.slice(ft.content.length).trim()||void 0,gt=Uw(ft,Lt,r);P({content:gt,role:"user",images:it}),w(""),T(),$(null),M(!1),ze.message&&ze.action!=="confirm"&&P({content:ze.message,role:"assistant"});return}}}else E(null);w(""),T(),$(null),M(!1),us(n.trim())||P({content:Oe||A("agentChat.sendImage"),role:"user",images:it});const yt={};I(!0),a||(console.log("🆕 No current session, will create new session"),N(!0));const Nt=new AbortController;C.current=Nt,V.current=Oe.trim()==="/compact",_e();try{const Ee=[...g,...b&&m.length>0?m:[]];await q.mutateAsync({agentId:t.id,message:Oe,images:it.length>0?it:void 0,context:yt,sessionId:a,projectPath:r,mcpTools:Ee.length>0?Ee:void 0,permissionMode:y,model:k,claudeVersion:v,envVars:te,channel:"web",abortController:Nt,onMessage:re,onError:ye})}catch(Ee){if(console.error("Chat error:",Ee),I(!1),N(!1),C.current=null,Ee instanceof DOMException&&Ee.name==="AbortError"){console.log("Request was aborted by user");return}let st=A("agentChatPanel.errors.connectionFailed");Ee instanceof Error&&(Ee.message.includes("Failed to fetch")||Ee.message.includes("NetworkError")?st=A("agentChatPanel.errors.networkConnectionFailed"):Ee.message.includes("timeout")?st=A("agentChatPanel.errors.connectionTimeout"):st=`❌ **${A("agentChatPanel.errors.connectionError")}**
76
+
77
+ ${Ee.message||A("agentChatPanel.errors.cannotConnectRetry")}`),P({content:st,role:"assistant"})}},[t,r,n,i,s,a,o,l,c,u,h,f,d,g,m,b,y,k,v,C,w,T,$,M,E,N,I,Q,_,j,A,P,Y,U,q,re,ye,_e,L,B,H]);return{isSendDisabled:ve,handleSendMessage:Le,handleStreamMessage:re,handleStreamError:ye,resetMessageId:_e}},nv=({agentId:e,currentSessionId:t,onSessionChange:r,textareaRef:n})=>{const i=Tu(),{setCurrentSessionId:s,clearMessages:a}=Xe(),[o,l]=O.useState(!1),[c,u]=O.useState(!1),[h,f]=O.useState(!1),d=O.useCallback(b=>{s(b),l(!0),u(!1),f(!1),r&&r(b),a(),i.invalidateQueries({queryKey:["agent-session-messages",e,b]})},[e,r,s,a,i]),g=O.useCallback(()=>{s(null),a(),u(!0),f(!1),r&&r(null),setTimeout(()=>{n?.current?.focus()},0)},[r,s,a,n]),m=O.useCallback(()=>{t&&(l(!0),a(),i.invalidateQueries({queryKey:["agent-session-messages",e,t]}))},[e,t,a,i]);return{isLoadingMessages:o,isNewSession:c,hasSuccessfulResponse:h,setIsLoadingMessages:l,setIsNewSession:u,setHasSuccessfulResponse:f,setCurrentSessionId:s,handleSwitchSession:d,handleNewSession:g,handleRefreshMessages:m}},iv=()=>{const[e,t]=O.useState(!1),[r,n]=O.useState(!1),[i,s]=O.useState(!1),[a,o]=O.useState(!1),[l,c]=O.useState(""),[u,h]=O.useState(null),[f,d]=O.useState(""),[g,m]=O.useState(!1),[b,y]=O.useState(!1),k=O.useCallback(()=>{u&&u(),n(!1),c(""),h(null)},[u]),v=O.useCallback(()=>{n(!1),c(""),h(null)},[]);return{showSessions:e,showConfirmDialog:r,showMobileSettings:i,showMcpStatusModal:a,confirmMessage:l,confirmAction:u,searchTerm:f,isStopping:g,isInitializingSession:b,setShowSessions:t,setShowConfirmDialog:n,setShowMobileSettings:s,setShowMcpStatusModal:o,setConfirmMessage:c,setConfirmAction:h,setSearchTerm:d,setIsStopping:m,setIsInitializingSession:y,handleConfirmDialog:k,handleCancelDialog:v}};function sv(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const av=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ov=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lv={};function hd(e,t){return(lv.jsx?ov:av).test(e)}const cv=/[ \t\n\f\r]/g;function uv(e){return typeof e=="object"?e.type==="text"?dd(e.value):!1:dd(e)}function dd(e){return e.replace(cv,"")===""}class Os{constructor(t,r,n){this.normal=r,this.property=t,n&&(this.space=n)}}Os.prototype.normal={};Os.prototype.property={};Os.prototype.space=void 0;function pg(e,t){const r={},n={};for(const i of e)Object.assign(r,i.property),Object.assign(n,i.normal);return new Os(r,n,t)}function cc(e){return e.toLowerCase()}class Ut{constructor(t,r){this.attribute=r,this.property=t}}Ut.prototype.attribute="";Ut.prototype.booleanish=!1;Ut.prototype.boolean=!1;Ut.prototype.commaOrSpaceSeparated=!1;Ut.prototype.commaSeparated=!1;Ut.prototype.defined=!1;Ut.prototype.mustUseProperty=!1;Ut.prototype.number=!1;Ut.prototype.overloadedBoolean=!1;Ut.prototype.property="";Ut.prototype.spaceSeparated=!1;Ut.prototype.space=void 0;let hv=0;const Te=Pn(),rt=Pn(),uc=Pn(),ee=Pn(),Ue=Pn(),Zn=Pn(),Yt=Pn();function Pn(){return 2**++hv}const hc=Object.freeze(Object.defineProperty({__proto__:null,boolean:Te,booleanish:rt,commaOrSpaceSeparated:Yt,commaSeparated:Zn,number:ee,overloadedBoolean:uc,spaceSeparated:Ue},Symbol.toStringTag,{value:"Module"})),gl=Object.keys(hc);class Mu extends Ut{constructor(t,r,n,i){let s=-1;if(super(t,r),fd(this,"space",i),typeof n=="number")for(;++s<gl.length;){const a=gl[s];fd(this,gl[s],(n&hc[a])===hc[a])}}}Mu.prototype.defined=!0;function fd(e,t,r){r&&(e[t]=r)}function wi(e){const t={},r={};for(const[n,i]of Object.entries(e.properties)){const s=new Mu(n,e.transform(e.attributes||{},n),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(s.mustUseProperty=!0),t[n]=s,r[cc(n)]=n,r[cc(s.attribute)]=n}return new Os(t,r,e.space)}const gg=wi({properties:{ariaActiveDescendant:null,ariaAtomic:rt,ariaAutoComplete:null,ariaBusy:rt,ariaChecked:rt,ariaColCount:ee,ariaColIndex:ee,ariaColSpan:ee,ariaControls:Ue,ariaCurrent:null,ariaDescribedBy:Ue,ariaDetails:null,ariaDisabled:rt,ariaDropEffect:Ue,ariaErrorMessage:null,ariaExpanded:rt,ariaFlowTo:Ue,ariaGrabbed:rt,ariaHasPopup:null,ariaHidden:rt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ue,ariaLevel:ee,ariaLive:null,ariaModal:rt,ariaMultiLine:rt,ariaMultiSelectable:rt,ariaOrientation:null,ariaOwns:Ue,ariaPlaceholder:null,ariaPosInSet:ee,ariaPressed:rt,ariaReadOnly:rt,ariaRelevant:null,ariaRequired:rt,ariaRoleDescription:Ue,ariaRowCount:ee,ariaRowIndex:ee,ariaRowSpan:ee,ariaSelected:rt,ariaSetSize:ee,ariaSort:null,ariaValueMax:ee,ariaValueMin:ee,ariaValueNow:ee,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function mg(e,t){return t in e?e[t]:t}function xg(e,t){return mg(e,t.toLowerCase())}const dv=wi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Zn,acceptCharset:Ue,accessKey:Ue,action:null,allow:null,allowFullScreen:Te,allowPaymentRequest:Te,allowUserMedia:Te,alt:null,as:null,async:Te,autoCapitalize:null,autoComplete:Ue,autoFocus:Te,autoPlay:Te,blocking:Ue,capture:null,charSet:null,checked:Te,cite:null,className:Ue,cols:ee,colSpan:null,content:null,contentEditable:rt,controls:Te,controlsList:Ue,coords:ee|Zn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Te,defer:Te,dir:null,dirName:null,disabled:Te,download:uc,draggable:rt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Te,formTarget:null,headers:Ue,height:ee,hidden:uc,high:ee,href:null,hrefLang:null,htmlFor:Ue,httpEquiv:Ue,id:null,imageSizes:null,imageSrcSet:null,inert:Te,inputMode:null,integrity:null,is:null,isMap:Te,itemId:null,itemProp:Ue,itemRef:Ue,itemScope:Te,itemType:Ue,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Te,low:ee,manifest:null,max:null,maxLength:ee,media:null,method:null,min:null,minLength:ee,multiple:Te,muted:Te,name:null,nonce:null,noModule:Te,noValidate:Te,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:Te,optimum:ee,pattern:null,ping:Ue,placeholder:null,playsInline:Te,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Te,referrerPolicy:null,rel:Ue,required:Te,reversed:Te,rows:ee,rowSpan:ee,sandbox:Ue,scope:null,scoped:Te,seamless:Te,selected:Te,shadowRootClonable:Te,shadowRootDelegatesFocus:Te,shadowRootMode:null,shape:null,size:ee,sizes:null,slot:null,span:ee,spellCheck:rt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ee,step:null,style:null,tabIndex:ee,target:null,title:null,translate:null,type:null,typeMustMatch:Te,useMap:null,value:rt,width:ee,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ue,axis:null,background:null,bgColor:null,border:ee,borderColor:null,bottomMargin:ee,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Te,declare:Te,event:null,face:null,frame:null,frameBorder:null,hSpace:ee,leftMargin:ee,link:null,longDesc:null,lowSrc:null,marginHeight:ee,marginWidth:ee,noResize:Te,noHref:Te,noShade:Te,noWrap:Te,object:null,profile:null,prompt:null,rev:null,rightMargin:ee,rules:null,scheme:null,scrolling:rt,standby:null,summary:null,text:null,topMargin:ee,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ee,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Te,disableRemotePlayback:Te,prefix:null,property:null,results:ee,security:null,unselectable:null},space:"html",transform:xg}),fv=wi({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",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:Yt,accentHeight:ee,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ee,amplitude:ee,arabicForm:null,ascent:ee,attributeName:null,attributeType:null,azimuth:ee,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ee,by:null,calcMode:null,capHeight:ee,className:Ue,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:ee,diffuseConstant:ee,direction:null,display:null,dur:null,divisor:ee,dominantBaseline:null,download:Te,dx:null,dy:null,edgeMode:null,editable:null,elevation:ee,enableBackground:null,end:null,event:null,exponent:ee,externalResourcesRequired:null,fill:null,fillOpacity:ee,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:Zn,g2:Zn,glyphName:Zn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ee,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ee,horizOriginX:ee,horizOriginY:ee,id:null,ideographic:ee,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ee,k:ee,k1:ee,k2:ee,k3:ee,k4:ee,kernelMatrix:Yt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ee,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ee,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:ee,overlineThickness:ee,paintOrder:null,panose1:null,path:null,pathLength:ee,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ue,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ee,pointsAtY:ee,pointsAtZ:ee,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Yt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Yt,rev:Yt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Yt,requiredFeatures:Yt,requiredFonts:Yt,requiredFormats:Yt,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:ee,specularExponent:ee,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ee,strikethroughThickness:ee,string:null,stroke:null,strokeDashArray:Yt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ee,strokeOpacity:ee,strokeWidth:null,style:null,surfaceScale:ee,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Yt,tabIndex:ee,tableValues:null,target:null,targetX:ee,targetY:ee,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Yt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ee,underlineThickness:ee,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ee,values:null,vAlphabetic:ee,vMathematical:ee,vectorEffect:null,vHanging:ee,vIdeographic:ee,version:null,vertAdvY:ee,vertOriginX:ee,vertOriginY:ee,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ee,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:mg}),yg=wi({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()}}),bg=wi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:xg}),kg=wi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),pv={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"},gv=/[A-Z]/g,pd=/-[a-z]/g,mv=/^data[-\w.:]+$/i;function xv(e,t){const r=cc(t);let n=t,i=Ut;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&mv.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(pd,bv);n="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!pd.test(s)){let a=s.replace(gv,yv);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Mu}return new i(n,t)}function yv(e){return"-"+e.toLowerCase()}function bv(e){return e.charAt(1).toUpperCase()}const kv=pg([gg,dv,yg,bg,kg],"html"),Nu=pg([gg,fv,yg,bg,kg],"svg");function wv(e){return e.join(" ").trim()}var qn={},ml,gd;function vv(){if(gd)return ml;gd=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,o=/^\s+|\s+$/g,l=`
78
+ `,c="/",u="*",h="",f="comment",d="declaration";ml=function(m,b){if(typeof m!="string")throw new TypeError("First argument must be a string");if(!m)return[];b=b||{};var y=1,k=1;function v(R){var I=R.match(t);I&&(y+=I.length);var F=R.lastIndexOf(l);k=~F?R.length-F:k+R.length}function C(){var R={line:y,column:k};return function(I){return I.position=new S(R),$(),I}}function S(R){this.start=R,this.end={line:y,column:k},this.source=b.source}S.prototype.content=m;function w(R){var I=new Error(b.source+":"+y+":"+k+": "+R);if(I.reason=R,I.filename=b.source,I.line=y,I.column=k,I.source=m,!b.silent)throw I}function T(R){var I=R.exec(m);if(I){var F=I[0];return v(F),m=m.slice(F.length),I}}function $(){T(r)}function M(R){var I;for(R=R||[];I=E();)I!==!1&&R.push(I);return R}function E(){var R=C();if(!(c!=m.charAt(0)||u!=m.charAt(1))){for(var I=2;h!=m.charAt(I)&&(u!=m.charAt(I)||c!=m.charAt(I+1));)++I;if(I+=2,h===m.charAt(I-1))return w("End of comment missing");var F=m.slice(2,I-2);return k+=2,v(F),m=m.slice(I),k+=2,R({type:f,comment:F})}}function N(){var R=C(),I=T(n);if(I){if(E(),!T(i))return w("property missing ':'");var F=T(s),L=R({type:d,property:g(I[0].replace(e,h)),value:F?g(F[0].replace(e,h)):h});return T(a),L}}function D(){var R=[];M(R);for(var I;I=N();)I!==!1&&(R.push(I),M(R));return R}return $(),D()};function g(m){return m?m.replace(o,h):h}return ml}var md;function Cv(){if(md)return qn;md=1;var e=qn&&qn.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(qn,"__esModule",{value:!0}),qn.default=r;const t=e(vv());function r(n,i){let s=null;if(!n||typeof n!="string")return s;const a=(0,t.default)(n),o=typeof i=="function";return a.forEach(l=>{if(l.type!=="declaration")return;const{property:c,value:u}=l;o?i(c,u,l):u&&(s=s||{},s[c]=u)}),s}return qn}var Fi={},xd;function Sv(){if(xd)return Fi;xd=1,Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,n=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(c){return!c||r.test(c)||e.test(c)},a=function(c,u){return u.toUpperCase()},o=function(c,u){return"".concat(u,"-")},l=function(c,u){return u===void 0&&(u={}),s(c)?c:(c=c.toLowerCase(),u.reactCompat?c=c.replace(i,o):c=c.replace(n,o),c.replace(t,a))};return Fi.camelCase=l,Fi}var Ri,yd;function _v(){if(yd)return Ri;yd=1;var e=Ri&&Ri.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Cv()),r=Sv();function n(i,s){var a={};return!i||typeof i!="string"||(0,t.default)(i,function(o,l){o&&l&&(a[(0,r.camelCase)(o,s)]=l)}),a}return n.default=n,Ri=n,Ri}var Tv=_v();const Ev=_u(Tv),wg=vg("end"),Lu=vg("start");function vg(e){return t;function t(r){const n=r&&r.position&&r.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function Av(e){const t=Lu(e),r=wg(e);if(t&&r)return{start:t,end:r}}function hs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?bd(e.position):"start"in e||"end"in e?bd(e):"line"in e||"column"in e?dc(e):""}function dc(e){return kd(e&&e.line)+":"+kd(e&&e.column)}function bd(e){return dc(e&&e.start)+"-"+dc(e&&e.end)}function kd(e){return e&&typeof e=="number"?e:1}class Et extends Error{constructor(t,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let i="",s={},a=!1;if(r&&("line"in r&&"column"in r?s={place:r}:"start"in r&&"end"in r?s={place:r}:"type"in r?s={ancestors:[r],place:r.position}:s={...r}),typeof t=="string"?i=t:!s.cause&&t&&(a=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof n=="string"){const l=n.indexOf(":");l===-1?s.ruleId=n:(s.source=n.slice(0,l),s.ruleId=n.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=hs(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Et.prototype.file="";Et.prototype.name="";Et.prototype.reason="";Et.prototype.message="";Et.prototype.stack="";Et.prototype.column=void 0;Et.prototype.line=void 0;Et.prototype.ancestors=void 0;Et.prototype.cause=void 0;Et.prototype.fatal=void 0;Et.prototype.place=void 0;Et.prototype.ruleId=void 0;Et.prototype.source=void 0;const Iu={}.hasOwnProperty,Mv=new Map,Nv=/[A-Z]/g,Lv=new Set(["table","tbody","thead","tfoot","tr"]),Iv=new Set(["td","th"]),Cg="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $v(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let n;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=zv(r,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");n=Ov(r,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:n,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Nu:kv,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=Sg(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function Sg(e,t,r){if(t.type==="element")return jv(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Bv(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Pv(e,t,r);if(t.type==="mdxjsEsm")return Dv(e,t);if(t.type==="root")return Fv(e,t,r);if(t.type==="text")return Rv(e,t)}function jv(e,t,r){const n=e.schema;let i=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(i=Nu,e.schema=i),e.ancestors.push(t);const s=Tg(e,t.tagName,!1),a=Hv(e,t);let o=ju(e,t);return Lv.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!uv(l):!0})),_g(e,a,s,t),$u(a,o),e.ancestors.pop(),e.schema=n,e.create(t,s,a,r)}function Bv(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Cs(e,t.position)}function Dv(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Cs(e,t.position)}function Pv(e,t,r){const n=e.schema;let i=n;t.name==="svg"&&n.space==="html"&&(i=Nu,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:Tg(e,t.name,!0),a=Wv(e,t),o=ju(e,t);return _g(e,a,s,t),$u(a,o),e.ancestors.pop(),e.schema=n,e.create(t,s,a,r)}function Fv(e,t,r){const n={};return $u(n,ju(e,t)),e.create(t,e.Fragment,n,r)}function Rv(e,t){return t.value}function _g(e,t,r,n){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=n)}function $u(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function Ov(e,t,r){return n;function n(i,s,a,o){const c=Array.isArray(a.children)?r:t;return o?c(s,a,o):c(s,a)}}function zv(e,t){return r;function r(n,i,s,a){const o=Array.isArray(s.children),l=Lu(n);return t(i,s,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Hv(e,t){const r={};let n,i;for(i in t.properties)if(i!=="children"&&Iu.call(t.properties,i)){const s=qv(e,i,t.properties[i]);if(s){const[a,o]=s;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&Iv.has(t.tagName)?n=o:r[a]=o}}if(n){const s=r.style||(r.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return r}function Wv(e,t){const r={};for(const n of t.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&e.evaluater){const s=n.data.estree.body[0];s.type;const a=s.expression;a.type;const o=a.properties[0];o.type,Object.assign(r,e.evaluater.evaluateExpression(o.argument))}else Cs(e,t.position);else{const i=n.name;let s;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&e.evaluater){const o=n.value.data.estree.body[0];o.type,s=e.evaluater.evaluateExpression(o.expression)}else Cs(e,t.position);else s=n.value===null?!0:n.value;r[i]=s}return r}function ju(e,t){const r=[];let n=-1;const i=e.passKeys?new Map:Mv;for(;++n<t.children.length;){const s=t.children[n];let a;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const c=i.get(l)||0;a=l+"-"+c,i.set(l,c+1)}}const o=Sg(e,s,a);o!==void 0&&r.push(o)}return r}function qv(e,t,r){const n=xv(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=n.commaSeparated?sv(r):wv(r)),n.property==="style"){let i=typeof r=="object"?r:Uv(e,String(r));return e.stylePropertyNameCase==="css"&&(i=Vv(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&n.space?pv[n.property]||n.property:n.attribute,r]}}function Uv(e,t){try{return Ev(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const n=r,i=new Et("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Cg+"#cannot-parse-style-attribute",i}}function Tg(e,t,r){let n;if(!r)n={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,a;for(;++s<i.length;){const o=hd(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(s&&o.type==="Literal"),optional:!1}:o}n=a}else n=hd(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){const i=n.value;return Iu.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(n);Cs(e)}function Cs(e,t){const r=new Et("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=Cg+"#cannot-handle-mdx-estrees-without-createevaluater",r}function Vv(e){const t={};let r;for(r in e)Iu.call(e,r)&&(t[Gv(r)]=e[r]);return t}function Gv(e){let t=e.replace(Nv,Yv);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Yv(e){return"-"+e.toLowerCase()}const xl={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"]},Xv={};function Bu(e,t){const r=Xv,n=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,i=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return Eg(e,n,i)}function Eg(e,t,r){if(Qv(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return wd(e.children,t,r)}return Array.isArray(e)?wd(e,t,r):""}function wd(e,t,r){const n=[];let i=-1;for(;++i<e.length;)n[i]=Eg(e[i],t,r);return n.join("")}function Qv(e){return!!(e&&typeof e=="object")}const vd=document.createElement("i");function Du(e){const t="&"+e+";";vd.innerHTML=t;const r=vd.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function Xt(e,t,r,n){const i=e.length;let s=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,r=r>0?r:0,n.length<1e4)a=Array.from(n),a.unshift(t,r),e.splice(...a);else for(r&&e.splice(t,r);s<n.length;)a=n.slice(s,s+1e4),a.unshift(t,0),e.splice(...a),s+=1e4,t+=1e4}function Jt(e,t){return e.length>0?(Xt(e,e.length,0,t),e):t}const Cd={}.hasOwnProperty;function Ag(e){const t={};let r=-1;for(;++r<e.length;)Kv(t,e[r]);return t}function Kv(e,t){let r;for(r in t){const i=(Cd.call(e,r)?e[r]:void 0)||(e[r]={}),s=t[r];let a;if(s)for(a in s){Cd.call(i,a)||(i[a]=[]);const o=s[a];Zv(i[a],Array.isArray(o)?o:o?[o]:[])}}}function Zv(e,t){let r=-1;const n=[];for(;++r<t.length;)(t[r].add==="after"?e:n).push(t[r]);Xt(e,0,0,n)}function Mg(e,t){const r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function ur(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const $t=an(/[A-Za-z]/),Ct=an(/[\dA-Za-z]/),Jv=an(/[#-'*+\--9=?A-Z^-~]/);function za(e){return e!==null&&(e<32||e===127)}const fc=an(/\d/),e2=an(/[\dA-Fa-f]/),t2=an(/[!-/:-@[-`{-~]/);function ge(e){return e!==null&&e<-2}function He(e){return e!==null&&(e<0||e===32)}function Me(e){return e===-2||e===-1||e===32}const No=an(new RegExp("\\p{P}|\\p{S}","u")),Mn=an(/\s/);function an(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function vi(e){const t=[];let r=-1,n=0,i=0;for(;++r<e.length;){const s=e.charCodeAt(r);let a="";if(s===37&&Ct(e.charCodeAt(r+1))&&Ct(e.charCodeAt(r+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const o=e.charCodeAt(r+1);s<56320&&o>56319&&o<57344?(a=String.fromCharCode(s,o),i=1):a="�"}else a=String.fromCharCode(s);a&&(t.push(e.slice(n,r),encodeURIComponent(a)),n=r+i+1,a=""),i&&(r+=i,i=0)}return t.join("")+e.slice(n)}function je(e,t,r,n){const i=n?n-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(l){return Me(l)?(e.enter(r),o(l)):t(l)}function o(l){return Me(l)&&s++<i?(e.consume(l),o):(e.exit(r),t(l))}}const r2={tokenize:n2};function n2(e){const t=e.attempt(this.parser.constructs.contentInitial,n,i);let r;return t;function n(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),je(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),s(o)}function s(o){const l=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=l),r=l,a(o)}function a(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return ge(o)?(e.consume(o),e.exit("chunkText"),s):(e.consume(o),a)}}const i2={tokenize:s2},Sd={tokenize:a2};function s2(e){const t=this,r=[];let n=0,i,s,a;return o;function o(v){if(n<r.length){const C=r[n];return t.containerState=C[1],e.attempt(C[0].continuation,l,c)(v)}return c(v)}function l(v){if(n++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&k();const C=t.events.length;let S=C,w;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){w=t.events[S][1].end;break}y(n);let T=C;for(;T<t.events.length;)t.events[T][1].end={...w},T++;return Xt(t.events,S+1,0,t.events.slice(C)),t.events.length=T,c(v)}return o(v)}function c(v){if(n===r.length){if(!i)return f(v);if(i.currentConstruct&&i.currentConstruct.concrete)return g(v);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Sd,u,h)(v)}function u(v){return i&&k(),y(n),f(v)}function h(v){return t.parser.lazy[t.now().line]=n!==r.length,a=t.now().offset,g(v)}function f(v){return t.containerState={},e.attempt(Sd,d,g)(v)}function d(v){return n++,r.push([t.currentConstruct,t.containerState]),f(v)}function g(v){if(v===null){i&&k(),y(0),e.consume(v);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),m(v)}function m(v){if(v===null){b(e.exit("chunkFlow"),!0),y(0),e.consume(v);return}return ge(v)?(e.consume(v),b(e.exit("chunkFlow")),n=0,t.interrupt=void 0,o):(e.consume(v),m)}function b(v,C){const S=t.sliceStream(v);if(C&&S.push(null),v.previous=s,s&&(s.next=v),s=v,i.defineSkip(v.start),i.write(S),t.parser.lazy[v.start.line]){let w=i.events.length;for(;w--;)if(i.events[w][1].start.offset<a&&(!i.events[w][1].end||i.events[w][1].end.offset>a))return;const T=t.events.length;let $=T,M,E;for(;$--;)if(t.events[$][0]==="exit"&&t.events[$][1].type==="chunkFlow"){if(M){E=t.events[$][1].end;break}M=!0}for(y(n),w=T;w<t.events.length;)t.events[w][1].end={...E},w++;Xt(t.events,$+1,0,t.events.slice(T)),t.events.length=w}}function y(v){let C=r.length;for(;C-- >v;){const S=r[C];t.containerState=S[1],S[0].exit.call(t,e)}r.length=v}function k(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function a2(e,t,r){return je(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function hi(e){if(e===null||He(e)||Mn(e))return 1;if(No(e))return 2}function Lo(e,t,r){const n=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!n.includes(s)&&(t=s(t,r),n.push(s))}return t}const pc={name:"attention",resolveAll:o2,tokenize:l2};function o2(e,t){let r=-1,n,i,s,a,o,l,c,u;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(n=r;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[n][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;l=e[n][1].end.offset-e[n][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const h={...e[n][1].end},f={...e[r][1].start};_d(h,-l),_d(f,l),a={type:l>1?"strongSequence":"emphasisSequence",start:h,end:{...e[n][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:f},s={type:l>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[r][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[n][1].end={...a.start},e[r][1].start={...o.end},c=[],e[n][1].end.offset-e[n][1].start.offset&&(c=Jt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])),c=Jt(c,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",s,t]]),c=Jt(c,Lo(t.parser.constructs.insideSpan.null,e.slice(n+1,r),t)),c=Jt(c,[["exit",s,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[r][1].end.offset-e[r][1].start.offset?(u=2,c=Jt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])):u=0,Xt(e,n-1,r-n+3,c),r=n+c.length-u-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function l2(e,t){const r=this.parser.constructs.attentionMarkers.null,n=this.previous,i=hi(n);let s;return a;function a(l){return s=l,e.enter("attentionSequence"),o(l)}function o(l){if(l===s)return e.consume(l),o;const c=e.exit("attentionSequence"),u=hi(l),h=!u||u===2&&i||r.includes(l),f=!i||i===2&&u||r.includes(n);return c._open=!!(s===42?h:h&&(i||!f)),c._close=!!(s===42?f:f&&(u||!h)),t(l)}}function _d(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const c2={name:"autolink",tokenize:u2};function u2(e,t,r){let n=0;return i;function i(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(d){return $t(d)?(e.consume(d),a):d===64?r(d):c(d)}function a(d){return d===43||d===45||d===46||Ct(d)?(n=1,o(d)):c(d)}function o(d){return d===58?(e.consume(d),n=0,l):(d===43||d===45||d===46||Ct(d))&&n++<32?(e.consume(d),o):(n=0,c(d))}function l(d){return d===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):d===null||d===32||d===60||za(d)?r(d):(e.consume(d),l)}function c(d){return d===64?(e.consume(d),u):Jv(d)?(e.consume(d),c):r(d)}function u(d){return Ct(d)?h(d):r(d)}function h(d){return d===46?(e.consume(d),n=0,u):d===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):f(d)}function f(d){if((d===45||Ct(d))&&n++<63){const g=d===45?f:h;return e.consume(d),g}return r(d)}}const zs={partial:!0,tokenize:h2};function h2(e,t,r){return n;function n(s){return Me(s)?je(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||ge(s)?t(s):r(s)}}const Ng={continuation:{tokenize:f2},exit:p2,name:"blockQuote",tokenize:d2};function d2(e,t,r){const n=this;return i;function i(a){if(a===62){const o=n.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),s}return r(a)}function s(a){return Me(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function f2(e,t,r){const n=this;return i;function i(a){return Me(a)?je(e,s,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return e.attempt(Ng,t,r)(a)}}function p2(e){e.exit("blockQuote")}const Lg={name:"characterEscape",tokenize:g2};function g2(e,t,r){return n;function n(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return t2(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(s)}}const Ig={name:"characterReference",tokenize:m2};function m2(e,t,r){const n=this;let i=0,s,a;return o;function o(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),l}function l(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,a=Ct,u(h))}function c(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,a=e2,u):(e.enter("characterReferenceValue"),s=7,a=fc,u(h))}function u(h){if(h===59&&i){const f=e.exit("characterReferenceValue");return a===Ct&&!Du(n.sliceSerialize(f))?r(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(h)&&i++<s?(e.consume(h),u):r(h)}}const Td={partial:!0,tokenize:y2},Ed={concrete:!0,name:"codeFenced",tokenize:x2};function x2(e,t,r){const n=this,i={partial:!0,tokenize:S};let s=0,a=0,o;return l;function l(w){return c(w)}function c(w){const T=n.events[n.events.length-1];return s=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,o=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(w)}function u(w){return w===o?(a++,e.consume(w),u):a<3?r(w):(e.exit("codeFencedFenceSequence"),Me(w)?je(e,h,"whitespace")(w):h(w))}function h(w){return w===null||ge(w)?(e.exit("codeFencedFence"),n.interrupt?t(w):e.check(Td,m,C)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(w))}function f(w){return w===null||ge(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(w)):Me(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),je(e,d,"whitespace")(w)):w===96&&w===o?r(w):(e.consume(w),f)}function d(w){return w===null||ge(w)?h(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===null||ge(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(w)):w===96&&w===o?r(w):(e.consume(w),g)}function m(w){return e.attempt(i,C,b)(w)}function b(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),y}function y(w){return s>0&&Me(w)?je(e,k,"linePrefix",s+1)(w):k(w)}function k(w){return w===null||ge(w)?e.check(Td,m,C)(w):(e.enter("codeFlowValue"),v(w))}function v(w){return w===null||ge(w)?(e.exit("codeFlowValue"),k(w)):(e.consume(w),v)}function C(w){return e.exit("codeFenced"),t(w)}function S(w,T,$){let M=0;return E;function E(F){return w.enter("lineEnding"),w.consume(F),w.exit("lineEnding"),N}function N(F){return w.enter("codeFencedFence"),Me(F)?je(w,D,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):D(F)}function D(F){return F===o?(w.enter("codeFencedFenceSequence"),R(F)):$(F)}function R(F){return F===o?(M++,w.consume(F),R):M>=a?(w.exit("codeFencedFenceSequence"),Me(F)?je(w,I,"whitespace")(F):I(F)):$(F)}function I(F){return F===null||ge(F)?(w.exit("codeFencedFence"),T(F)):$(F)}}}function y2(e,t,r){const n=this;return i;function i(a){return a===null?r(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s)}function s(a){return n.parser.lazy[n.now().line]?r(a):t(a)}}const yl={name:"codeIndented",tokenize:k2},b2={partial:!0,tokenize:w2};function k2(e,t,r){const n=this;return i;function i(c){return e.enter("codeIndented"),je(e,s,"linePrefix",5)(c)}function s(c){const u=n.events[n.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?a(c):r(c)}function a(c){return c===null?l(c):ge(c)?e.attempt(b2,a,l)(c):(e.enter("codeFlowValue"),o(c))}function o(c){return c===null||ge(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),o)}function l(c){return e.exit("codeIndented"),t(c)}}function w2(e,t,r){const n=this;return i;function i(a){return n.parser.lazy[n.now().line]?r(a):ge(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):je(e,s,"linePrefix",5)(a)}function s(a){const o=n.events[n.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):ge(a)?i(a):r(a)}}const v2={name:"codeText",previous:S2,resolve:C2,tokenize:_2};function C2(e){let t=e.length-4,r=3,n,i;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(n=r;++n<t;)if(e[n][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(n=r-1,t++;++n<=t;)i===void 0?n!==t&&e[n][1].type!=="lineEnding"&&(i=n):(n===t||e[n][1].type==="lineEnding")&&(e[i][1].type="codeTextData",n!==i+2&&(e[i][1].end=e[n-1][1].end,e.splice(i+2,n-i-2),t-=n-i-2,n=i+2),i=void 0);return e}function S2(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function _2(e,t,r){let n=0,i,s;return a;function a(h){return e.enter("codeText"),e.enter("codeTextSequence"),o(h)}function o(h){return h===96?(e.consume(h),n++,o):(e.exit("codeTextSequence"),l(h))}function l(h){return h===null?r(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),l):h===96?(s=e.enter("codeTextSequence"),i=0,u(h)):ge(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(h))}function c(h){return h===null||h===32||h===96||ge(h)?(e.exit("codeTextData"),l(h)):(e.consume(h),c)}function u(h){return h===96?(e.consume(h),i++,u):i===n?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(s.type="codeTextData",c(h))}}class T2{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,r){const n=r??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(t,n):t>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(t,r,n){const i=r||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return n&&Oi(this.left,n),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Oi(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Oi(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 r=this.left.splice(t,Number.POSITIVE_INFINITY);Oi(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Oi(this.left,r.reverse())}}}function Oi(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function $g(e){const t={};let r=-1,n,i,s,a,o,l,c;const u=new T2(e);for(;++r<u.length;){for(;r in t;)r=t[r];if(n=u.get(r),r&&n[1].type==="chunkFlow"&&u.get(r-1)[1].type==="listItemPrefix"&&(l=n[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(n[0]==="enter")n[1].contentType&&(Object.assign(t,E2(u,r)),r=t[r],c=!0);else if(n[1]._container){for(s=r,i=void 0;s--;)if(a=u.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(n[1].end={...u.get(i)[1].start},o=u.slice(i,r),o.unshift(n),u.splice(i,r-i+1,o))}}return Xt(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function E2(e,t){const r=e.get(t)[1],n=e.get(t)[2];let i=t-1;const s=[];let a=r._tokenizer;a||(a=n.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,l=[],c={};let u,h,f=-1,d=r,g=0,m=0;const b=[m];for(;d;){for(;e.get(++i)[1]!==d;);s.push(i),d._tokenizer||(u=n.sliceStream(d),d.next||u.push(null),h&&a.defineSkip(d.start),d._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),d._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),h=d,d=d.next}for(d=r;++f<o.length;)o[f][0]==="exit"&&o[f-1][0]==="enter"&&o[f][1].type===o[f-1][1].type&&o[f][1].start.line!==o[f][1].end.line&&(m=f+1,b.push(m),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(a.events=[],d?(d._tokenizer=void 0,d.previous=void 0):b.pop(),f=b.length;f--;){const y=o.slice(b[f],b[f+1]),k=s.pop();l.push([k,k+y.length-1]),e.splice(k,2,y)}for(l.reverse(),f=-1;++f<l.length;)c[g+l[f][0]]=g+l[f][1],g+=l[f][1]-l[f][0]-1;return c}const A2={resolve:N2,tokenize:L2},M2={partial:!0,tokenize:I2};function N2(e){return $g(e),e}function L2(e,t){let r;return n;function n(o){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):ge(o)?e.check(M2,a,s)(o):(e.consume(o),i)}function s(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function a(o){return e.consume(o),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,i}}function I2(e,t,r){const n=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),je(e,s,"linePrefix")}function s(a){if(a===null||ge(a))return r(a);const o=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):e.interrupt(n.parser.constructs.flow,r,t)(a)}}function jg(e,t,r,n,i,s,a,o,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return h;function h(y){return y===60?(e.enter(n),e.enter(i),e.enter(s),e.consume(y),e.exit(s),f):y===null||y===32||y===41||za(y)?r(y):(e.enter(n),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),m(y))}function f(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(i),e.exit(n),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),d(y))}function d(y){return y===62?(e.exit("chunkString"),e.exit(o),f(y)):y===null||y===60||ge(y)?r(y):(e.consume(y),y===92?g:d)}function g(y){return y===60||y===62||y===92?(e.consume(y),d):d(y)}function m(y){return!u&&(y===null||y===41||He(y))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(n),t(y)):u<c&&y===40?(e.consume(y),u++,m):y===41?(e.consume(y),u--,m):y===null||y===32||y===40||za(y)?r(y):(e.consume(y),y===92?b:m)}function b(y){return y===40||y===41||y===92?(e.consume(y),m):m(y)}}function Bg(e,t,r,n,i,s){const a=this;let o=0,l;return c;function c(d){return e.enter(n),e.enter(i),e.consume(d),e.exit(i),e.enter(s),u}function u(d){return o>999||d===null||d===91||d===93&&!l||d===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?r(d):d===93?(e.exit(s),e.enter(i),e.consume(d),e.exit(i),e.exit(n),t):ge(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),h(d))}function h(d){return d===null||d===91||d===93||ge(d)||o++>999?(e.exit("chunkString"),u(d)):(e.consume(d),l||(l=!Me(d)),d===92?f:h)}function f(d){return d===91||d===92||d===93?(e.consume(d),o++,h):h(d)}}function Dg(e,t,r,n,i,s){let a;return o;function o(f){return f===34||f===39||f===40?(e.enter(n),e.enter(i),e.consume(f),e.exit(i),a=f===40?41:f,l):r(f)}function l(f){return f===a?(e.enter(i),e.consume(f),e.exit(i),e.exit(n),t):(e.enter(s),c(f))}function c(f){return f===a?(e.exit(s),l(a)):f===null?r(f):ge(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),je(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(f))}function u(f){return f===a||f===null||ge(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?h:u)}function h(f){return f===a||f===92?(e.consume(f),u):u(f)}}function ds(e,t){let r;return n;function n(i){return ge(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),r=!0,n):Me(i)?je(e,n,r?"linePrefix":"lineSuffix")(i):t(i)}}const $2={name:"definition",tokenize:B2},j2={partial:!0,tokenize:D2};function B2(e,t,r){const n=this;let i;return s;function s(d){return e.enter("definition"),a(d)}function a(d){return Bg.call(n,e,o,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function o(d){return i=ur(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),l):r(d)}function l(d){return He(d)?ds(e,c)(d):c(d)}function c(d){return jg(e,u,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function u(d){return e.attempt(j2,h,h)(d)}function h(d){return Me(d)?je(e,f,"whitespace")(d):f(d)}function f(d){return d===null||ge(d)?(e.exit("definition"),n.parser.defined.push(i),t(d)):r(d)}}function D2(e,t,r){return n;function n(o){return He(o)?ds(e,i)(o):r(o)}function i(o){return Dg(e,s,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return Me(o)?je(e,a,"whitespace")(o):a(o)}function a(o){return o===null||ge(o)?t(o):r(o)}}const P2={name:"hardBreakEscape",tokenize:F2};function F2(e,t,r){return n;function n(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return ge(s)?(e.exit("hardBreakEscape"),t(s)):r(s)}}const R2={name:"headingAtx",resolve:O2,tokenize:z2};function O2(e,t){let r=e.length-2,n=3,i,s;return e[n][1].type==="whitespace"&&(n+=2),r-2>n&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&e[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(i={type:"atxHeadingText",start:e[n][1].start,end:e[r][1].end},s={type:"chunkText",start:e[n][1].start,end:e[r][1].end,contentType:"text"},Xt(e,n,r-n+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function z2(e,t,r){let n=0;return i;function i(u){return e.enter("atxHeading"),s(u)}function s(u){return e.enter("atxHeadingSequence"),a(u)}function a(u){return u===35&&n++<6?(e.consume(u),a):u===null||He(u)?(e.exit("atxHeadingSequence"),o(u)):r(u)}function o(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||ge(u)?(e.exit("atxHeading"),t(u)):Me(u)?je(e,o,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),o(u))}function c(u){return u===null||u===35||He(u)?(e.exit("atxHeadingText"),o(u)):(e.consume(u),c)}}const H2=["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"],Ad=["pre","script","style","textarea"],W2={concrete:!0,name:"htmlFlow",resolveTo:V2,tokenize:G2},q2={partial:!0,tokenize:X2},U2={partial:!0,tokenize:Y2};function V2(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 G2(e,t,r){const n=this;let i,s,a,o,l;return c;function c(A){return u(A)}function u(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),h}function h(A){return A===33?(e.consume(A),f):A===47?(e.consume(A),s=!0,m):A===63?(e.consume(A),i=3,n.interrupt?t:_):$t(A)?(e.consume(A),a=String.fromCharCode(A),b):r(A)}function f(A){return A===45?(e.consume(A),i=2,d):A===91?(e.consume(A),i=5,o=0,g):$t(A)?(e.consume(A),i=4,n.interrupt?t:_):r(A)}function d(A){return A===45?(e.consume(A),n.interrupt?t:_):r(A)}function g(A){const P="CDATA[";return A===P.charCodeAt(o++)?(e.consume(A),o===P.length?n.interrupt?t:D:g):r(A)}function m(A){return $t(A)?(e.consume(A),a=String.fromCharCode(A),b):r(A)}function b(A){if(A===null||A===47||A===62||He(A)){const P=A===47,Y=a.toLowerCase();return!P&&!s&&Ad.includes(Y)?(i=1,n.interrupt?t(A):D(A)):H2.includes(a.toLowerCase())?(i=6,P?(e.consume(A),y):n.interrupt?t(A):D(A)):(i=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(A):s?k(A):v(A))}return A===45||Ct(A)?(e.consume(A),a+=String.fromCharCode(A),b):r(A)}function y(A){return A===62?(e.consume(A),n.interrupt?t:D):r(A)}function k(A){return Me(A)?(e.consume(A),k):E(A)}function v(A){return A===47?(e.consume(A),E):A===58||A===95||$t(A)?(e.consume(A),C):Me(A)?(e.consume(A),v):E(A)}function C(A){return A===45||A===46||A===58||A===95||Ct(A)?(e.consume(A),C):S(A)}function S(A){return A===61?(e.consume(A),w):Me(A)?(e.consume(A),S):v(A)}function w(A){return A===null||A===60||A===61||A===62||A===96?r(A):A===34||A===39?(e.consume(A),l=A,T):Me(A)?(e.consume(A),w):$(A)}function T(A){return A===l?(e.consume(A),l=null,M):A===null||ge(A)?r(A):(e.consume(A),T)}function $(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||He(A)?S(A):(e.consume(A),$)}function M(A){return A===47||A===62||Me(A)?v(A):r(A)}function E(A){return A===62?(e.consume(A),N):r(A)}function N(A){return A===null||ge(A)?D(A):Me(A)?(e.consume(A),N):r(A)}function D(A){return A===45&&i===2?(e.consume(A),L):A===60&&i===1?(e.consume(A),B):A===62&&i===4?(e.consume(A),j):A===63&&i===3?(e.consume(A),_):A===93&&i===5?(e.consume(A),Q):ge(A)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(q2,te,R)(A)):A===null||ge(A)?(e.exit("htmlFlowData"),R(A)):(e.consume(A),D)}function R(A){return e.check(U2,I,te)(A)}function I(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),F}function F(A){return A===null||ge(A)?R(A):(e.enter("htmlFlowData"),D(A))}function L(A){return A===45?(e.consume(A),_):D(A)}function B(A){return A===47?(e.consume(A),a="",H):D(A)}function H(A){if(A===62){const P=a.toLowerCase();return Ad.includes(P)?(e.consume(A),j):D(A)}return $t(A)&&a.length<8?(e.consume(A),a+=String.fromCharCode(A),H):D(A)}function Q(A){return A===93?(e.consume(A),_):D(A)}function _(A){return A===62?(e.consume(A),j):A===45&&i===2?(e.consume(A),_):D(A)}function j(A){return A===null||ge(A)?(e.exit("htmlFlowData"),te(A)):(e.consume(A),j)}function te(A){return e.exit("htmlFlow"),t(A)}}function Y2(e,t,r){const n=this;return i;function i(a){return ge(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):r(a)}function s(a){return n.parser.lazy[n.now().line]?r(a):t(a)}}function X2(e,t,r){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(zs,t,r)}}const Q2={name:"htmlText",tokenize:K2};function K2(e,t,r){const n=this;let i,s,a;return o;function o(_){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(_),l}function l(_){return _===33?(e.consume(_),c):_===47?(e.consume(_),S):_===63?(e.consume(_),v):$t(_)?(e.consume(_),$):r(_)}function c(_){return _===45?(e.consume(_),u):_===91?(e.consume(_),s=0,g):$t(_)?(e.consume(_),k):r(_)}function u(_){return _===45?(e.consume(_),d):r(_)}function h(_){return _===null?r(_):_===45?(e.consume(_),f):ge(_)?(a=h,B(_)):(e.consume(_),h)}function f(_){return _===45?(e.consume(_),d):h(_)}function d(_){return _===62?L(_):_===45?f(_):h(_)}function g(_){const j="CDATA[";return _===j.charCodeAt(s++)?(e.consume(_),s===j.length?m:g):r(_)}function m(_){return _===null?r(_):_===93?(e.consume(_),b):ge(_)?(a=m,B(_)):(e.consume(_),m)}function b(_){return _===93?(e.consume(_),y):m(_)}function y(_){return _===62?L(_):_===93?(e.consume(_),y):m(_)}function k(_){return _===null||_===62?L(_):ge(_)?(a=k,B(_)):(e.consume(_),k)}function v(_){return _===null?r(_):_===63?(e.consume(_),C):ge(_)?(a=v,B(_)):(e.consume(_),v)}function C(_){return _===62?L(_):v(_)}function S(_){return $t(_)?(e.consume(_),w):r(_)}function w(_){return _===45||Ct(_)?(e.consume(_),w):T(_)}function T(_){return ge(_)?(a=T,B(_)):Me(_)?(e.consume(_),T):L(_)}function $(_){return _===45||Ct(_)?(e.consume(_),$):_===47||_===62||He(_)?M(_):r(_)}function M(_){return _===47?(e.consume(_),L):_===58||_===95||$t(_)?(e.consume(_),E):ge(_)?(a=M,B(_)):Me(_)?(e.consume(_),M):L(_)}function E(_){return _===45||_===46||_===58||_===95||Ct(_)?(e.consume(_),E):N(_)}function N(_){return _===61?(e.consume(_),D):ge(_)?(a=N,B(_)):Me(_)?(e.consume(_),N):M(_)}function D(_){return _===null||_===60||_===61||_===62||_===96?r(_):_===34||_===39?(e.consume(_),i=_,R):ge(_)?(a=D,B(_)):Me(_)?(e.consume(_),D):(e.consume(_),I)}function R(_){return _===i?(e.consume(_),i=void 0,F):_===null?r(_):ge(_)?(a=R,B(_)):(e.consume(_),R)}function I(_){return _===null||_===34||_===39||_===60||_===61||_===96?r(_):_===47||_===62||He(_)?M(_):(e.consume(_),I)}function F(_){return _===47||_===62||He(_)?M(_):r(_)}function L(_){return _===62?(e.consume(_),e.exit("htmlTextData"),e.exit("htmlText"),t):r(_)}function B(_){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),H}function H(_){return Me(_)?je(e,Q,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):Q(_)}function Q(_){return e.enter("htmlTextData"),a(_)}}const Pu={name:"labelEnd",resolveAll:tC,resolveTo:rC,tokenize:nC},Z2={tokenize:iC},J2={tokenize:sC},eC={tokenize:aC};function tC(e){let t=-1;const r=[];for(;++t<e.length;){const n=e[t][1];if(r.push(e[t]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){const i=n.type==="labelImage"?4:2;n.type="data",t+=i}}return e.length!==r.length&&Xt(e,0,e.length,r),e}function rC(e,t){let r=e.length,n=0,i,s,a,o;for(;r--;)if(i=e[r][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[r][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[r][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=r,i.type!=="labelLink")){n=2;break}}else i.type==="labelEnd"&&(a=r);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[s][1].start},end:{...e[a][1].end}},u={type:"labelText",start:{...e[s+n+2][1].end},end:{...e[a-2][1].start}};return o=[["enter",l,t],["enter",c,t]],o=Jt(o,e.slice(s+1,s+n+3)),o=Jt(o,[["enter",u,t]]),o=Jt(o,Lo(t.parser.constructs.insideSpan.null,e.slice(s+n+4,a-3),t)),o=Jt(o,[["exit",u,t],e[a-2],e[a-1],["exit",c,t]]),o=Jt(o,e.slice(a+1)),o=Jt(o,[["exit",l,t]]),Xt(e,s,e.length,o),e}function nC(e,t,r){const n=this;let i=n.events.length,s,a;for(;i--;)if((n.events[i][1].type==="labelImage"||n.events[i][1].type==="labelLink")&&!n.events[i][1]._balanced){s=n.events[i][1];break}return o;function o(f){return s?s._inactive?h(f):(a=n.parser.defined.includes(ur(n.sliceSerialize({start:s.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),l):r(f)}function l(f){return f===40?e.attempt(Z2,u,a?u:h)(f):f===91?e.attempt(J2,u,a?c:h)(f):a?u(f):h(f)}function c(f){return e.attempt(eC,u,h)(f)}function u(f){return t(f)}function h(f){return s._balanced=!0,r(f)}}function iC(e,t,r){return n;function n(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return He(h)?ds(e,s)(h):s(h)}function s(h){return h===41?u(h):jg(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function a(h){return He(h)?ds(e,l)(h):u(h)}function o(h){return r(h)}function l(h){return h===34||h===39||h===40?Dg(e,c,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):u(h)}function c(h){return He(h)?ds(e,u)(h):u(h)}function u(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):r(h)}}function sC(e,t,r){const n=this;return i;function i(o){return Bg.call(n,e,s,a,"reference","referenceMarker","referenceString")(o)}function s(o){return n.parser.defined.includes(ur(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(o):r(o)}function a(o){return r(o)}}function aC(e,t,r){return n;function n(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):r(s)}}const oC={name:"labelStartImage",resolveAll:Pu.resolveAll,tokenize:lC};function lC(e,t,r){const n=this;return i;function i(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),s}function s(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),a):r(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(o):t(o)}}const cC={name:"labelStartLink",resolveAll:Pu.resolveAll,tokenize:uC};function uC(e,t,r){const n=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(a):t(a)}}const bl={name:"lineEnding",tokenize:hC};function hC(e,t){return r;function r(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),je(e,t,"linePrefix")}}const _a={name:"thematicBreak",tokenize:dC};function dC(e,t,r){let n=0,i;return s;function s(c){return e.enter("thematicBreak"),a(c)}function a(c){return i=c,o(c)}function o(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):n>=3&&(c===null||ge(c))?(e.exit("thematicBreak"),t(c)):r(c)}function l(c){return c===i?(e.consume(c),n++,l):(e.exit("thematicBreakSequence"),Me(c)?je(e,o,"whitespace")(c):o(c))}}const zt={continuation:{tokenize:mC},exit:yC,name:"list",tokenize:gC},fC={partial:!0,tokenize:bC},pC={partial:!0,tokenize:xC};function gC(e,t,r){const n=this,i=n.events[n.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(d){const g=n.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!n.containerState.marker||d===n.containerState.marker:fc(d)){if(n.containerState.type||(n.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(_a,r,c)(d):c(d);if(!n.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(d)}return r(d)}function l(d){return fc(d)&&++a<10?(e.consume(d),l):(!n.interrupt||a<2)&&(n.containerState.marker?d===n.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),c(d)):r(d)}function c(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||d,e.check(zs,n.interrupt?r:u,e.attempt(fC,f,h))}function u(d){return n.containerState.initialBlankLine=!0,s++,f(d)}function h(d){return Me(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),f):r(d)}function f(d){return n.containerState.size=s+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function mC(e,t,r){const n=this;return n.containerState._closeFlow=void 0,e.check(zs,i,s);function i(o){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,je(e,t,"listItemIndent",n.containerState.size+1)(o)}function s(o){return n.containerState.furtherBlankLines||!Me(o)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,a(o)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(pC,t,a)(o))}function a(o){return n.containerState._closeFlow=!0,n.interrupt=void 0,je(e,e.attempt(zt,t,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function xC(e,t,r){const n=this;return je(e,i,"listItemIndent",n.containerState.size+1);function i(s){const a=n.events[n.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===n.containerState.size?t(s):r(s)}}function yC(e){e.exit(this.containerState.type)}function bC(e,t,r){const n=this;return je(e,i,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=n.events[n.events.length-1];return!Me(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):r(s)}}const Md={name:"setextUnderline",resolveTo:kC,tokenize:wC};function kC(e,t){let r=e.length,n,i,s;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){n=r;break}e[r][1].type==="paragraph"&&(i=r)}else e[r][1].type==="content"&&e.splice(r,1),!s&&e[r][1].type==="definition"&&(s=r);const a={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",a,t]),e.splice(s+1,0,["exit",e[n][1],t]),e[n][1].end={...e[s][1].end}):e[n][1]=a,e.push(["exit",a,t]),e}function wC(e,t,r){const n=this;let i;return s;function s(c){let u=n.events.length,h;for(;u--;)if(n.events[u][1].type!=="lineEnding"&&n.events[u][1].type!=="linePrefix"&&n.events[u][1].type!=="content"){h=n.events[u][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||h)?(e.enter("setextHeadingLine"),i=c,a(c)):r(c)}function a(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===i?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),Me(c)?je(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||ge(c)?(e.exit("setextHeadingLine"),t(c)):r(c)}}const vC={tokenize:CC};function CC(e){const t=this,r=e.attempt(zs,n,e.attempt(this.parser.constructs.flowInitial,i,je(e,e.attempt(this.parser.constructs.flow,i,e.attempt(A2,i)),"linePrefix")));return r;function n(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const SC={resolveAll:Fg()},_C=Pg("string"),TC=Pg("text");function Pg(e){return{resolveAll:Fg(e==="text"?EC:void 0),tokenize:t};function t(r){const n=this,i=this.parser.constructs[e],s=r.attempt(i,a,o);return a;function a(u){return c(u)?s(u):o(u)}function o(u){if(u===null){r.consume(u);return}return r.enter("data"),r.consume(u),l}function l(u){return c(u)?(r.exit("data"),s(u)):(r.consume(u),l)}function c(u){if(u===null)return!0;const h=i[u];let f=-1;if(h)for(;++f<h.length;){const d=h[f];if(!d.previous||d.previous.call(n,n.previous))return!0}return!1}}}function Fg(e){return t;function t(r,n){let i=-1,s;for(;++i<=r.length;)s===void 0?r[i]&&r[i][1].type==="data"&&(s=i,i++):(!r[i]||r[i][1].type!=="data")&&(i!==s+2&&(r[s][1].end=r[i-1][1].end,r.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(r,n):r}}function EC(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const n=e[r-1][1],i=t.sliceStream(n);let s=i.length,a=-1,o=0,l;for(;s--;){const c=i[s];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(c===-2)l=!0,o++;else if(c!==-1){s++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(o=0),o){const c={type:r===e.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:n.start._bufferIndex+a,_index:n.start._index+s,line:n.end.line,column:n.end.column-o,offset:n.end.offset-o},end:{...n.end}};n.end={...c.start},n.start.offset===n.end.offset?Object.assign(n,c):(e.splice(r,0,["enter",c,t],["exit",c,t]),r+=2)}r++}return e}const AC={42:zt,43:zt,45:zt,48:zt,49:zt,50:zt,51:zt,52:zt,53:zt,54:zt,55:zt,56:zt,57:zt,62:Ng},MC={91:$2},NC={[-2]:yl,[-1]:yl,32:yl},LC={35:R2,42:_a,45:[Md,_a],60:W2,61:Md,95:_a,96:Ed,126:Ed},IC={38:Ig,92:Lg},$C={[-5]:bl,[-4]:bl,[-3]:bl,33:oC,38:Ig,42:pc,60:[c2,Q2],91:cC,92:[P2,Lg],93:Pu,95:pc,96:v2},jC={null:[pc,SC]},BC={null:[42,95]},DC={null:[]},PC=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:BC,contentInitial:MC,disable:DC,document:AC,flow:LC,flowInitial:NC,insideSpan:jC,string:IC,text:$C},Symbol.toStringTag,{value:"Module"}));function FC(e,t,r){let n={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const i={},s=[];let a=[],o=[];const l={attempt:T(S),check:T(w),consume:k,enter:v,exit:C,interrupt:T(w,{interrupt:!0})},c={code:null,containerState:{},defineSkip:m,events:[],now:g,parser:e,previous:null,sliceSerialize:f,sliceStream:d,write:h};let u=t.tokenize.call(c,l);return t.resolveAll&&s.push(t),c;function h(N){return a=Jt(a,N),b(),a[a.length-1]!==null?[]:($(t,0),c.events=Lo(s,c.events,c),c.events)}function f(N,D){return OC(d(N),D)}function d(N){return RC(a,N)}function g(){const{_bufferIndex:N,_index:D,line:R,column:I,offset:F}=n;return{_bufferIndex:N,_index:D,line:R,column:I,offset:F}}function m(N){i[N.line]=N.column,E()}function b(){let N;for(;n._index<a.length;){const D=a[n._index];if(typeof D=="string")for(N=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===N&&n._bufferIndex<D.length;)y(D.charCodeAt(n._bufferIndex));else y(D)}}function y(N){u=u(N)}function k(N){ge(N)?(n.line++,n.column=1,n.offset+=N===-3?2:1,E()):N!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===a[n._index].length&&(n._bufferIndex=-1,n._index++)),c.previous=N}function v(N,D){const R=D||{};return R.type=N,R.start=g(),c.events.push(["enter",R,c]),o.push(R),R}function C(N){const D=o.pop();return D.end=g(),c.events.push(["exit",D,c]),D}function S(N,D){$(N,D.from)}function w(N,D){D.restore()}function T(N,D){return R;function R(I,F,L){let B,H,Q,_;return Array.isArray(I)?te(I):"tokenize"in I?te([I]):j(I);function j(U){return q;function q(V){const K=V!==null&&U[V],re=V!==null&&U.null,ye=[...Array.isArray(K)?K:K?[K]:[],...Array.isArray(re)?re:re?[re]:[]];return te(ye)(V)}}function te(U){return B=U,H=0,U.length===0?L:A(U[H])}function A(U){return q;function q(V){return _=M(),Q=U,U.partial||(c.currentConstruct=U),U.name&&c.parser.constructs.disable.null.includes(U.name)?Y():U.tokenize.call(D?Object.assign(Object.create(c),D):c,l,P,Y)(V)}}function P(U){return N(Q,_),F}function Y(U){return _.restore(),++H<B.length?A(B[H]):L}}}function $(N,D){N.resolveAll&&!s.includes(N)&&s.push(N),N.resolve&&Xt(c.events,D,c.events.length-D,N.resolve(c.events.slice(D),c)),N.resolveTo&&(c.events=N.resolveTo(c.events,c))}function M(){const N=g(),D=c.previous,R=c.currentConstruct,I=c.events.length,F=Array.from(o);return{from:I,restore:L};function L(){n=N,c.previous=D,c.currentConstruct=R,c.events.length=I,o=F,E()}}function E(){n.line in i&&n.column<2&&(n.column=i[n.line],n.offset+=i[n.line]-1)}}function RC(e,t){const r=t.start._index,n=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let a;if(r===i)a=[e[r].slice(n,s)];else{if(a=e.slice(r,i),n>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(n):a.shift()}s>0&&a.push(e[i].slice(0,s))}return a}function OC(e,t){let r=-1;const n=[];let i;for(;++r<e.length;){const s=e[r];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
79
+ `;break}case-3:{a=`\r
80
+ `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,n.push(a)}return n.join("")}function zC(e){const n={constructs:Ag([PC,...(e||{}).extensions||[]]),content:i(r2),defined:[],document:i(i2),flow:i(vC),lazy:{},string:i(_C),text:i(TC)};return n;function i(s){return a;function a(o){return FC(n,s,o)}}}function HC(e){for(;!$g(e););return e}const Nd=/[\0\t\n\r]/g;function WC(){let e=1,t="",r=!0,n;return i;function i(s,a,o){const l=[];let c,u,h,f,d;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),h=0,t="",r&&(s.charCodeAt(0)===65279&&h++,r=void 0);h<s.length;){if(Nd.lastIndex=h,c=Nd.exec(s),f=c&&c.index!==void 0?c.index:s.length,d=s.charCodeAt(f),!c){t=s.slice(h);break}if(d===10&&h===f&&n)l.push(-3),n=void 0;else switch(n&&(l.push(-5),n=void 0),h<f&&(l.push(s.slice(h,f)),e+=f-h),d){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:n=!0,e=1}h=f+1}return o&&(n&&l.push(-5),t&&l.push(t),l.push(null)),l}}const qC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function UC(e){return e.replace(qC,VC)}function VC(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const i=r.charCodeAt(1),s=i===120||i===88;return Mg(r.slice(s?2:1),s?16:10)}return Du(r)||e}const Rg={}.hasOwnProperty;function GC(e,t,r){return typeof t!="string"&&(r=t,t=void 0),YC(r)(HC(zC(r).document().write(WC()(e,t,!0))))}function YC(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Nt),autolinkProtocol:M,autolinkEmail:M,atxHeading:s(Oe),blockQuote:s(re),characterEscape:M,characterReference:M,codeFenced:s(ye),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(ye,a),codeText:s(_e,a),codeTextData:M,data:M,codeFlowValue:M,definition:s(ve),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(Le),hardBreakEscape:s(Mt),hardBreakTrailing:s(Mt),htmlFlow:s(it,a),htmlFlowData:M,htmlText:s(it,a),htmlTextData:M,image:s(yt),label:a,link:s(Nt),listItem:s(st),listItemValue:f,listOrdered:s(Ee,h),listUnordered:s(Ee),paragraph:s(ft),reference:A,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(Oe),strong:s(ze),thematicBreak:s(gt)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:K,autolinkProtocol:V,blockQuote:l(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:Y,characterReferenceMarkerNumeric:Y,characterReferenceValue:U,characterReference:q,codeFenced:l(b),codeFencedFence:m,codeFencedFenceInfo:d,codeFencedFenceMeta:g,codeFlowValue:E,codeIndented:l(y),codeText:l(F),codeTextData:E,data:E,definition:l(),definitionDestinationString:C,definitionLabelString:k,definitionTitleString:v,emphasis:l(),hardBreakEscape:l(D),hardBreakTrailing:l(D),htmlFlow:l(R),htmlFlowData:E,htmlText:l(I),htmlTextData:E,image:l(B),label:Q,labelText:H,lineEnding:N,link:l(L),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:P,resourceDestinationString:_,resourceTitleString:j,resource:te,setextHeading:l($),setextHeadingLineSequence:T,setextHeadingText:w,strong:l(),thematicBreak:l()}};Og(t,(e||{}).mdastExtensions||[]);const r={};return n;function n(G){let J={type:"root",children:[]};const me={stack:[J],tokenStack:[],config:t,enter:o,exit:c,buffer:a,resume:u,data:r},Se=[];let Ie=-1;for(;++Ie<G.length;)if(G[Ie][1].type==="listOrdered"||G[Ie][1].type==="listUnordered")if(G[Ie][0]==="enter")Se.push(Ie);else{const tt=Se.pop();Ie=i(G,tt,Ie)}for(Ie=-1;++Ie<G.length;){const tt=t[G[Ie][0]];Rg.call(tt,G[Ie][1].type)&&tt[G[Ie][1].type].call(Object.assign({sliceSerialize:G[Ie][2].sliceSerialize},me),G[Ie][1])}if(me.tokenStack.length>0){const tt=me.tokenStack[me.tokenStack.length-1];(tt[1]||Ld).call(me,void 0,tt[0])}for(J.position={start:Yr(G.length>0?G[0][1].start:{line:1,column:1,offset:0}),end:Yr(G.length>0?G[G.length-2][1].end:{line:1,column:1,offset:0})},Ie=-1;++Ie<t.transforms.length;)J=t.transforms[Ie](J)||J;return J}function i(G,J,me){let Se=J-1,Ie=-1,tt=!1,Be,We,at,ot;for(;++Se<=me;){const Ke=G[Se];switch(Ke[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ke[0]==="enter"?Ie++:Ie--,ot=void 0;break}case"lineEndingBlank":{Ke[0]==="enter"&&(Be&&!ot&&!Ie&&!at&&(at=Se),ot=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ot=void 0}if(!Ie&&Ke[0]==="enter"&&Ke[1].type==="listItemPrefix"||Ie===-1&&Ke[0]==="exit"&&(Ke[1].type==="listUnordered"||Ke[1].type==="listOrdered")){if(Be){let Kt=Se;for(We=void 0;Kt--;){const bt=G[Kt];if(bt[1].type==="lineEnding"||bt[1].type==="lineEndingBlank"){if(bt[0]==="exit")continue;We&&(G[We][1].type="lineEndingBlank",tt=!0),bt[1].type="lineEnding",We=Kt}else if(!(bt[1].type==="linePrefix"||bt[1].type==="blockQuotePrefix"||bt[1].type==="blockQuotePrefixWhitespace"||bt[1].type==="blockQuoteMarker"||bt[1].type==="listItemIndent"))break}at&&(!We||at<We)&&(Be._spread=!0),Be.end=Object.assign({},We?G[We][1].start:Ke[1].end),G.splice(We||Se,0,["exit",Be,Ke[2]]),Se++,me++}if(Ke[1].type==="listItemPrefix"){const Kt={type:"listItem",_spread:!1,start:Object.assign({},Ke[1].start),end:void 0};Be=Kt,G.splice(Se,0,["enter",Kt,Ke[2]]),Se++,me++,at=void 0,ot=!0}}}return G[J][1]._spread=tt,me}function s(G,J){return me;function me(Se){o.call(this,G(Se),Se),J&&J.call(this,Se)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(G,J,me){this.stack[this.stack.length-1].children.push(G),this.stack.push(G),this.tokenStack.push([J,me||void 0]),G.position={start:Yr(J.start),end:void 0}}function l(G){return J;function J(me){G&&G.call(this,me),c.call(this,me)}}function c(G,J){const me=this.stack.pop(),Se=this.tokenStack.pop();if(Se)Se[0].type!==G.type&&(J?J.call(this,G,Se[0]):(Se[1]||Ld).call(this,G,Se[0]));else throw new Error("Cannot close `"+G.type+"` ("+hs({start:G.start,end:G.end})+"): it’s not open");me.position.end=Yr(G.end)}function u(){return Bu(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function f(G){if(this.data.expectingFirstListItemValue){const J=this.stack[this.stack.length-2];J.start=Number.parseInt(this.sliceSerialize(G),10),this.data.expectingFirstListItemValue=void 0}}function d(){const G=this.resume(),J=this.stack[this.stack.length-1];J.lang=G}function g(){const G=this.resume(),J=this.stack[this.stack.length-1];J.meta=G}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const G=this.resume(),J=this.stack[this.stack.length-1];J.value=G.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const G=this.resume(),J=this.stack[this.stack.length-1];J.value=G.replace(/(\r?\n|\r)$/g,"")}function k(G){const J=this.resume(),me=this.stack[this.stack.length-1];me.label=J,me.identifier=ur(this.sliceSerialize(G)).toLowerCase()}function v(){const G=this.resume(),J=this.stack[this.stack.length-1];J.title=G}function C(){const G=this.resume(),J=this.stack[this.stack.length-1];J.url=G}function S(G){const J=this.stack[this.stack.length-1];if(!J.depth){const me=this.sliceSerialize(G).length;J.depth=me}}function w(){this.data.setextHeadingSlurpLineEnding=!0}function T(G){const J=this.stack[this.stack.length-1];J.depth=this.sliceSerialize(G).codePointAt(0)===61?1:2}function $(){this.data.setextHeadingSlurpLineEnding=void 0}function M(G){const me=this.stack[this.stack.length-1].children;let Se=me[me.length-1];(!Se||Se.type!=="text")&&(Se=Lt(),Se.position={start:Yr(G.start),end:void 0},me.push(Se)),this.stack.push(Se)}function E(G){const J=this.stack.pop();J.value+=this.sliceSerialize(G),J.position.end=Yr(G.end)}function N(G){const J=this.stack[this.stack.length-1];if(this.data.atHardBreak){const me=J.children[J.children.length-1];me.position.end=Yr(G.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(J.type)&&(M.call(this,G),E.call(this,G))}function D(){this.data.atHardBreak=!0}function R(){const G=this.resume(),J=this.stack[this.stack.length-1];J.value=G}function I(){const G=this.resume(),J=this.stack[this.stack.length-1];J.value=G}function F(){const G=this.resume(),J=this.stack[this.stack.length-1];J.value=G}function L(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const J=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=J,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function B(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const J=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=J,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function H(G){const J=this.sliceSerialize(G),me=this.stack[this.stack.length-2];me.label=UC(J),me.identifier=ur(J).toLowerCase()}function Q(){const G=this.stack[this.stack.length-1],J=this.resume(),me=this.stack[this.stack.length-1];if(this.data.inReference=!0,me.type==="link"){const Se=G.children;me.children=Se}else me.alt=J}function _(){const G=this.resume(),J=this.stack[this.stack.length-1];J.url=G}function j(){const G=this.resume(),J=this.stack[this.stack.length-1];J.title=G}function te(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function P(G){const J=this.resume(),me=this.stack[this.stack.length-1];me.label=J,me.identifier=ur(this.sliceSerialize(G)).toLowerCase(),this.data.referenceType="full"}function Y(G){this.data.characterReferenceType=G.type}function U(G){const J=this.sliceSerialize(G),me=this.data.characterReferenceType;let Se;me?(Se=Mg(J,me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Se=Du(J);const Ie=this.stack[this.stack.length-1];Ie.value+=Se}function q(G){const J=this.stack.pop();J.position.end=Yr(G.end)}function V(G){E.call(this,G);const J=this.stack[this.stack.length-1];J.url=this.sliceSerialize(G)}function K(G){E.call(this,G);const J=this.stack[this.stack.length-1];J.url="mailto:"+this.sliceSerialize(G)}function re(){return{type:"blockquote",children:[]}}function ye(){return{type:"code",lang:null,meta:null,value:""}}function _e(){return{type:"inlineCode",value:""}}function ve(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Le(){return{type:"emphasis",children:[]}}function Oe(){return{type:"heading",depth:0,children:[]}}function Mt(){return{type:"break"}}function it(){return{type:"html",value:""}}function yt(){return{type:"image",title:null,url:"",alt:null}}function Nt(){return{type:"link",title:null,url:"",children:[]}}function Ee(G){return{type:"list",ordered:G.type==="listOrdered",start:null,spread:G._spread,children:[]}}function st(G){return{type:"listItem",spread:G._spread,checked:null,children:[]}}function ft(){return{type:"paragraph",children:[]}}function ze(){return{type:"strong",children:[]}}function Lt(){return{type:"text",value:""}}function gt(){return{type:"thematicBreak"}}}function Yr(e){return{line:e.line,column:e.column,offset:e.offset}}function Og(e,t){let r=-1;for(;++r<t.length;){const n=t[r];Array.isArray(n)?Og(e,n):XC(e,n)}}function XC(e,t){let r;for(r in t)if(Rg.call(t,r))switch(r){case"canContainEols":{const n=t[r];n&&e[r].push(...n);break}case"transforms":{const n=t[r];n&&e[r].push(...n);break}case"enter":case"exit":{const n=t[r];n&&Object.assign(e[r],n);break}}}function Ld(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+hs({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+hs({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+hs({start:t.start,end:t.end})+") is still open")}function QC(e){const t=this;t.parser=r;function r(n){return GC(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function KC(e,t){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function ZC(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
81
+ `}]}function JC(e,t){const r=t.value?t.value+`
82
+ `:"",n={};t.lang&&(n.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:n,children:[{type:"text",value:r}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function eS(e,t){const r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function tS(e,t){const r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function rS(e,t){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=String(t.identifier).toUpperCase(),i=vi(n.toLowerCase()),s=e.footnoteOrder.indexOf(n);let a,o=e.footnoteCounts.get(n);o===void 0?(o=0,e.footnoteOrder.push(n),a=e.footnoteOrder.length):a=s+1,o+=1,e.footnoteCounts.set(n,o);const l={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+i,id:r+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function nS(e,t){const r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function iS(e,t){if(e.options.allowDangerousHtml){const r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function zg(e,t){const r=t.referenceType;let n="]";if(r==="collapsed"?n+="[]":r==="full"&&(n+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+n}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=n:i.push({type:"text",value:n}),i}function sS(e,t){const r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return zg(e,t);const i={src:vi(n.url||""),alt:t.alt};n.title!==null&&n.title!==void 0&&(i.title=n.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function aS(e,t){const r={src:vi(t.url)};t.alt!==null&&t.alt!==void 0&&(r.alt=t.alt),t.title!==null&&t.title!==void 0&&(r.title=t.title);const n={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,n),e.applyData(t,n)}function oS(e,t){const r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);const n={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,n),e.applyData(t,n)}function lS(e,t){const r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return zg(e,t);const i={href:vi(n.url||"")};n.title!==null&&n.title!==void 0&&(i.title=n.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function cS(e,t){const r={href:vi(t.url)};t.title!==null&&t.title!==void 0&&(r.title=t.title);const n={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function uS(e,t,r){const n=e.all(t),i=r?hS(r):Hg(t),s={},a=[];if(typeof t.checked=="boolean"){const u=n[0];let h;u&&u.type==="element"&&u.tagName==="p"?h=u:(h={type:"element",tagName:"p",properties:{},children:[]},n.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let o=-1;for(;++o<n.length;){const u=n[o];(i||o!==0||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:`
83
+ `}),u.type==="element"&&u.tagName==="p"&&!i?a.push(...u.children):a.push(u)}const l=n[n.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
84
+ `});const c={type:"element",tagName:"li",properties:s,children:a};return e.patch(t,c),e.applyData(t,c)}function hS(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const r=e.children;let n=-1;for(;!t&&++n<r.length;)t=Hg(r[n])}return t}function Hg(e){const t=e.spread;return t??e.children.length>1}function dS(e,t){const r={},n=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++i<n.length;){const a=n[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:r,children:e.wrap(n,!0)};return e.patch(t,s),e.applyData(t,s)}function fS(e,t){const r={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function pS(e,t){const r={type:"root",children:e.wrap(e.all(t))};return e.patch(t,r),e.applyData(t,r)}function gS(e,t){const r={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function mS(e,t){const r=e.all(t),n=r.shift(),i=[];if(n){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([n],!0)};e.patch(t.children[0],a),i.push(a)}if(r.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},o=Lu(t.children[1]),l=wg(t.children[t.children.length-1]);o&&l&&(a.position={start:o,end:l}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function xS(e,t,r){const n=r?r.children:void 0,s=(n?n.indexOf(t):1)===0?"th":"td",a=r&&r.type==="table"?r.align:void 0,o=a?a.length:t.children.length;let l=-1;const c=[];for(;++l<o;){const h=t.children[l],f={},d=a?a[l]:void 0;d&&(f.align=d);let g={type:"element",tagName:s,properties:f,children:[]};h&&(g.children=e.all(h),e.patch(h,g),g=e.applyData(h,g)),c.push(g)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function yS(e,t){const r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}const Id=9,$d=32;function bS(e){const t=String(e),r=/\r?\n|\r/g;let n=r.exec(t),i=0;const s=[];for(;n;)s.push(jd(t.slice(i,n.index),i>0,!0),n[0]),i=n.index+n[0].length,n=r.exec(t);return s.push(jd(t.slice(i),i>0,!1)),s.join("")}function jd(e,t,r){let n=0,i=e.length;if(t){let s=e.codePointAt(n);for(;s===Id||s===$d;)n++,s=e.codePointAt(n)}if(r){let s=e.codePointAt(i-1);for(;s===Id||s===$d;)i--,s=e.codePointAt(i-1)}return i>n?e.slice(n,i):""}function kS(e,t){const r={type:"text",value:bS(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function wS(e,t){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}const vS={blockquote:KC,break:ZC,code:JC,delete:eS,emphasis:tS,footnoteReference:rS,heading:nS,html:iS,imageReference:sS,image:aS,inlineCode:oS,linkReference:lS,link:cS,listItem:uS,list:dS,paragraph:fS,root:pS,strong:gS,table:mS,tableCell:yS,tableRow:xS,text:kS,thematicBreak:wS,toml:ia,yaml:ia,definition:ia,footnoteDefinition:ia};function ia(){}const Wg=-1,Io=0,fs=1,Ha=2,Fu=3,Ru=4,Ou=5,zu=6,qg=7,Ug=8,Bd=typeof self=="object"?self:globalThis,CS=(e,t)=>{const r=(i,s)=>(e.set(s,i),i),n=i=>{if(e.has(i))return e.get(i);const[s,a]=t[i];switch(s){case Io:case Wg:return r(a,i);case fs:{const o=r([],i);for(const l of a)o.push(n(l));return o}case Ha:{const o=r({},i);for(const[l,c]of a)o[n(l)]=n(c);return o}case Fu:return r(new Date(a),i);case Ru:{const{source:o,flags:l}=a;return r(new RegExp(o,l),i)}case Ou:{const o=r(new Map,i);for(const[l,c]of a)o.set(n(l),n(c));return o}case zu:{const o=r(new Set,i);for(const l of a)o.add(n(l));return o}case qg:{const{name:o,message:l}=a;return r(new Bd[o](l),i)}case Ug:return r(BigInt(a),i);case"BigInt":return r(Object(BigInt(a)),i);case"ArrayBuffer":return r(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return r(new DataView(o),a)}}return r(new Bd[s](a),i)};return n},Dd=e=>CS(new Map,e)(0),Un="",{toString:SS}={},{keys:_S}=Object,zi=e=>{const t=typeof e;if(t!=="object"||!e)return[Io,t];const r=SS.call(e).slice(8,-1);switch(r){case"Array":return[fs,Un];case"Object":return[Ha,Un];case"Date":return[Fu,Un];case"RegExp":return[Ru,Un];case"Map":return[Ou,Un];case"Set":return[zu,Un];case"DataView":return[fs,r]}return r.includes("Array")?[fs,r]:r.includes("Error")?[qg,r]:[Ha,r]},sa=([e,t])=>e===Io&&(t==="function"||t==="symbol"),TS=(e,t,r,n)=>{const i=(a,o)=>{const l=n.push(a)-1;return r.set(o,l),l},s=a=>{if(r.has(a))return r.get(a);let[o,l]=zi(a);switch(o){case Io:{let u=a;switch(l){case"bigint":o=Ug,u=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([Wg],a)}return i([o,u],a)}case fs:{if(l){let f=a;return l==="DataView"?f=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(f=new Uint8Array(a)),i([l,[...f]],a)}const u=[],h=i([o,u],a);for(const f of a)u.push(s(f));return h}case Ha:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(t&&"toJSON"in a)return s(a.toJSON());const u=[],h=i([o,u],a);for(const f of _S(a))(e||!sa(zi(a[f])))&&u.push([s(f),s(a[f])]);return h}case Fu:return i([o,a.toISOString()],a);case Ru:{const{source:u,flags:h}=a;return i([o,{source:u,flags:h}],a)}case Ou:{const u=[],h=i([o,u],a);for(const[f,d]of a)(e||!(sa(zi(f))||sa(zi(d))))&&u.push([s(f),s(d)]);return h}case zu:{const u=[],h=i([o,u],a);for(const f of a)(e||!sa(zi(f)))&&u.push(s(f));return h}}const{message:c}=a;return i([o,{name:l,message:c}],a)};return s},Pd=(e,{json:t,lossy:r}={})=>{const n=[];return TS(!(t||r),!!t,new Map,n)(e),n},Wa=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Dd(Pd(e,t)):structuredClone(e):(e,t)=>Dd(Pd(e,t));function ES(e,t){const r=[{type:"text",value:"↩"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function AS(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function MS(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||ES,n=e.options.footnoteBackLabel||AS,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),h=String(c.identifier).toUpperCase(),f=vi(h.toLowerCase());let d=0;const g=[],m=e.footnoteCounts.get(h);for(;m!==void 0&&++d<=m;){g.length>0&&g.push({type:"text",value:" "});let k=typeof r=="string"?r:r(l,d);typeof k=="string"&&(k={type:"text",value:k}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof n=="string"?n:n(l,d),className:["data-footnote-backref"]},children:Array.isArray(k)?k:[k]})}const b=u[u.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const k=b.children[b.children.length-1];k&&k.type==="text"?k.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...g)}else u.push(...g);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(u,!0)};e.patch(c,y),o.push(y)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Wa(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
85
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
86
+ `}]}}const $o=(function(e){if(e==null)return $S;if(typeof e=="function")return jo(e);if(typeof e=="object")return Array.isArray(e)?NS(e):LS(e);if(typeof e=="string")return IS(e);throw new Error("Expected function, string, or object as test")});function NS(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=$o(e[r]);return jo(n);function n(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function LS(e){const t=e;return jo(r);function r(n){const i=n;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function IS(e){return jo(t);function t(r){return r&&r.type===e}}function jo(e){return t;function t(r,n,i){return!!(jS(r)&&e.call(this,r,typeof n=="number"?n:void 0,i||void 0))}}function $S(){return!0}function jS(e){return e!==null&&typeof e=="object"&&"type"in e}const Vg=[],BS=!0,gc=!1,DS="skip";function Gg(e,t,r,n){let i;typeof t=="function"&&typeof r!="function"?(n=r,r=t):i=t;const s=$o(i),a=n?-1:1;o(e,void 0,[])();function o(l,c,u){const h=l&&typeof l=="object"?l:{};if(typeof h.type=="string"){const d=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(l.type+(d?"<"+d+">":""))+")"})}return f;function f(){let d=Vg,g,m,b;if((!t||s(l,c,u[u.length-1]||void 0))&&(d=PS(r(l,u)),d[0]===gc))return d;if("children"in l&&l.children){const y=l;if(y.children&&d[0]!==DS)for(m=(n?y.children.length:-1)+a,b=u.concat(y);m>-1&&m<y.children.length;){const k=y.children[m];if(g=o(k,m,b)(),g[0]===gc)return g;m=typeof g[1]=="number"?g[1]:m+a}}return d}}}function PS(e){return Array.isArray(e)?e:typeof e=="number"?[BS,e]:e==null?Vg:[e]}function Hu(e,t,r,n){let i,s,a;typeof t=="function"&&typeof r!="function"?(s=void 0,a=t,i=r):(s=t,a=r,i=n),Gg(e,s,o,i);function o(l,c){const u=c[c.length-1],h=u?u.children.indexOf(l):void 0;return a(l,h,u)}}const mc={}.hasOwnProperty,FS={};function RS(e,t){const r=t||FS,n=new Map,i=new Map,s=new Map,a={...vS,...r.handlers},o={all:c,applyData:zS,definitionById:n,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:l,options:r,patch:OS,wrap:WS};return Hu(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const h=u.type==="definition"?n:i,f=String(u.identifier).toUpperCase();h.has(f)||h.set(f,u)}}),o;function l(u,h){const f=u.type,d=o.handlers[f];if(mc.call(o.handlers,f)&&d)return d(o,u,h);if(o.options.passThrough&&o.options.passThrough.includes(f)){if("children"in u){const{children:m,...b}=u,y=Wa(b);return y.children=o.all(u),y}return Wa(u)}return(o.options.unknownHandler||HS)(o,u,h)}function c(u){const h=[];if("children"in u){const f=u.children;let d=-1;for(;++d<f.length;){const g=o.one(f[d],u);if(g){if(d&&f[d-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=Fd(g.value)),!Array.isArray(g)&&g.type==="element")){const m=g.children[0];m&&m.type==="text"&&(m.value=Fd(m.value))}Array.isArray(g)?h.push(...g):h.push(g)}}}return h}}function OS(e,t){e.position&&(t.position=Av(e))}function zS(e,t){let r=t;if(e&&e.data){const n=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof n=="string")if(r.type==="element")r.tagName=n;else{const a="children"in r?r.children:[r];r={type:"element",tagName:n,properties:{},children:a}}r.type==="element"&&s&&Object.assign(r.properties,Wa(s)),"children"in r&&r.children&&i!==null&&i!==void 0&&(r.children=i)}return r}function HS(e,t){const r=t.data||{},n="value"in t&&!(mc.call(r,"hProperties")||mc.call(r,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function WS(e,t){const r=[];let n=-1;for(t&&r.push({type:"text",value:`
87
+ `});++n<e.length;)n&&r.push({type:"text",value:`
88
+ `}),r.push(e[n]);return t&&e.length>0&&r.push({type:"text",value:`
89
+ `}),r}function Fd(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function Rd(e,t){const r=RS(e,t),n=r.one(e,void 0),i=MS(r),s=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
90
+ `},i),s}function qS(e,t){return e&&"run"in e?async function(r,n){const i=Rd(r,{file:n,...t});await e.run(i,n)}:function(r,n){return Rd(r,{file:n,...e||t})}}function Od(e){if(e)throw e}var kl,zd;function US(){if(zd)return kl;zd=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},s=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var u=e.call(c,"constructor"),h=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!h)return!1;var f;for(f in c);return typeof f>"u"||e.call(c,f)},a=function(c,u){r&&u.name==="__proto__"?r(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},o=function(c,u){if(u==="__proto__")if(e.call(c,u)){if(n)return n(c,u).value}else return;return c[u]};return kl=function l(){var c,u,h,f,d,g,m=arguments[0],b=1,y=arguments.length,k=!1;for(typeof m=="boolean"&&(k=m,m=arguments[1]||{},b=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});b<y;++b)if(c=arguments[b],c!=null)for(u in c)h=o(m,u),f=o(c,u),m!==f&&(k&&f&&(s(f)||(d=i(f)))?(d?(d=!1,g=h&&i(h)?h:[]):g=h&&s(h)?h:{},a(m,{name:u,newValue:l(k,g,f)})):typeof f<"u"&&a(m,{name:u,newValue:f}));return m},kl}var VS=US();const wl=_u(VS);function xc(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 GS(){const e=[],t={run:r,use:n};return t;function r(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(l,...c){const u=e[++s];let h=-1;if(l){a(l);return}for(;++h<i.length;)(c[h]===null||c[h]===void 0)&&(c[h]=i[h]);i=c,u?YS(u,o)(...c):a(null,...c)}}function n(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function YS(e,t){let r;return n;function n(...a){const o=e.length>a.length;let l;o&&a.push(i);try{l=e.apply(this,a)}catch(c){const u=c;if(o&&r)throw u;return i(u)}o||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(a,...o){r||(r=!0,t(a,...o))}function s(a){i(null,a)}}const br={basename:XS,dirname:QS,extname:KS,join:ZS,sep:"/"};function XS(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Hs(e);let r=0,n=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){r=i+1;break}}else n<0&&(s=!0,n=i+1);return n<0?"":e.slice(r,n)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){r=i+1;break}}else a<0&&(s=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(n=i):(o=-1,n=a));return r===n?n=a:n<0&&(n=e.length),e.slice(r,n)}function QS(e){if(Hs(e),e.length===0)return".";let t=-1,r=e.length,n;for(;--r;)if(e.codePointAt(r)===47){if(n){t=r;break}}else n||(n=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function KS(e){Hs(e);let t=e.length,r=-1,n=0,i=-1,s=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){n=t+1;break}continue}r<0&&(a=!0,r=t+1),o===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||r<0||s===0||s===1&&i===r-1&&i===n+1?"":e.slice(i,r)}function ZS(...e){let t=-1,r;for(;++t<e.length;)Hs(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":JS(r)}function JS(e){Hs(e);const t=e.codePointAt(0)===47;let r=e_(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function e_(e,t){let r="",n=0,i=-1,s=0,a=-1,o,l;for(;++a<=e.length;){if(a<e.length)o=e.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(r.length<2||n!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(l=r.lastIndexOf("/"),l!==r.length-1){l<0?(r="",n=0):(r=r.slice(0,l),n=r.length-1-r.lastIndexOf("/")),i=a,s=0;continue}}else if(r.length>0){r="",n=0,i=a,s=0;continue}}t&&(r=r.length>0?r+"/..":"..",n=2)}else r.length>0?r+="/"+e.slice(i+1,a):r=e.slice(i+1,a),n=a-i-1;i=a,s=0}else o===46&&s>-1?s++:s=-1}return r}function Hs(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const t_={cwd:r_};function r_(){return"/"}function yc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function n_(e){if(typeof e=="string")e=new URL(e);else if(!yc(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 i_(e)}function i_(e){if(e.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const n=t.codePointAt(r+2);if(n===70||n===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 vl=["history","path","basename","stem","extname","dirname"];class Yg{constructor(t){let r;t?yc(t)?r={path:t}:typeof t=="string"||s_(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":t_.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<vl.length;){const s=vl[n];s in r&&r[s]!==void 0&&r[s]!==null&&(this[s]=s==="history"?[...r[s]]:r[s])}let i;for(i in r)vl.includes(i)||(this[i]=r[i])}get basename(){return typeof this.path=="string"?br.basename(this.path):void 0}set basename(t){Sl(t,"basename"),Cl(t,"basename"),this.path=br.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?br.dirname(this.path):void 0}set dirname(t){Hd(this.basename,"dirname"),this.path=br.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?br.extname(this.path):void 0}set extname(t){if(Cl(t,"extname"),Hd(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=br.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){yc(t)&&(t=n_(t)),Sl(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?br.basename(this.path,this.extname):void 0}set stem(t){Sl(t,"stem"),Cl(t,"stem"),this.path=br.join(this.dirname||"",t+(this.extname||""))}fail(t,r,n){const i=this.message(t,r,n);throw i.fatal=!0,i}info(t,r,n){const i=this.message(t,r,n);return i.fatal=void 0,i}message(t,r,n){const i=new Et(t,r,n);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 Cl(e,t){if(e&&e.includes(br.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+br.sep+"`")}function Sl(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Hd(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function s_(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const a_=(function(e){const n=this.constructor.prototype,i=n[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,n),s}),o_={}.hasOwnProperty;class Wu extends a_{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=GS()}copy(){const t=new Wu;let r=-1;for(;++r<this.attachers.length;){const n=this.attachers[r];t.use(...n)}return t.data(wl(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(El("data",this.frozen),this.namespace[t]=r,this):o_.call(this.namespace,t)&&this.namespace[t]||void 0:t?(El("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[r,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);const i=r.call(t,...n);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const r=aa(t),n=this.parser||this.Parser;return _l("parse",n),n(String(r),r)}process(t,r){const n=this;return this.freeze(),_l("process",this.parser||this.Parser),Tl("process",this.compiler||this.Compiler),r?i(void 0,r):new Promise(i);function i(s,a){const o=aa(t),l=n.parse(o);n.run(l,o,function(u,h,f){if(u||!h||!f)return c(u);const d=h,g=n.stringify(d,f);u_(g)?f.value=g:f.result=g,c(u,f)});function c(u,h){u||!h?a(u):s?s(h):r(void 0,h)}}}processSync(t){let r=!1,n;return this.freeze(),_l("processSync",this.parser||this.Parser),Tl("processSync",this.compiler||this.Compiler),this.process(t,i),qd("processSync","process",r),n;function i(s,a){r=!0,Od(s),n=a}}run(t,r,n){Wd(t),this.freeze();const i=this.transformers;return!n&&typeof r=="function"&&(n=r,r=void 0),n?s(void 0,n):new Promise(s);function s(a,o){const l=aa(r);i.run(t,l,c);function c(u,h,f){const d=h||t;u?o(u):a?a(d):n(void 0,d,f)}}}runSync(t,r){let n=!1,i;return this.run(t,r,s),qd("runSync","run",n),i;function s(a,o){Od(a),i=o,n=!0}}stringify(t,r){this.freeze();const n=aa(r),i=this.compiler||this.Compiler;return Tl("stringify",i),Wd(t),i(t,n)}use(t,...r){const n=this.attachers,i=this.namespace;if(El("use",this.frozen),t!=null)if(typeof t=="function")l(t,r);else if(typeof t=="object")Array.isArray(t)?o(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...h]=c;l(u,h)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))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");o(c.plugins),c.settings&&(i.settings=wl(!0,i.settings,c.settings))}function o(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const h=c[u];s(h)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let h=-1,f=-1;for(;++h<n.length;)if(n[h][0]===c){f=h;break}if(f===-1)n.push([c,...u]);else if(u.length>0){let[d,...g]=u;const m=n[f][1];xc(m)&&xc(d)&&(d=wl(!0,m,d)),n[f]=[c,d,...g]}}}}const l_=new Wu().freeze();function _l(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Tl(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function El(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 Wd(e){if(!xc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function qd(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function aa(e){return c_(e)?e:new Yg(e)}function c_(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function u_(e){return typeof e=="string"||h_(e)}function h_(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const d_="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ud=[],Vd={allowDangerousHtml:!0},f_=/^(https?|ircs?|mailto|xmpp)$/i,p_=[{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 g_(e){const t=m_(e),r=x_(e);return y_(t.runSync(t.parse(r),r),e)}function m_(e){const t=e.rehypePlugins||Ud,r=e.remarkPlugins||Ud,n=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Vd}:Vd;return l_().use(QC).use(r).use(qS,n).use(t)}function x_(e){const t=e.children||"",r=new Yg;return typeof t=="string"&&(r.value=t),r}function y_(e,t){const r=t.allowedElements,n=t.allowElement,i=t.components,s=t.disallowedElements,a=t.skipHtml,o=t.unwrapDisallowed,l=t.urlTransform||b_;for(const u of p_)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+d_+u.id,void 0);return Hu(e,c),$v(e,{Fragment:p.Fragment,components:i,ignoreInvalidStyle:!0,jsx:p.jsx,jsxs:p.jsxs,passKeys:!0,passNode:!0});function c(u,h,f){if(u.type==="raw"&&f&&typeof h=="number")return a?f.children.splice(h,1):f.children[h]={type:"text",value:u.value},h;if(u.type==="element"){let d;for(d in xl)if(Object.hasOwn(xl,d)&&Object.hasOwn(u.properties,d)){const g=u.properties[d],m=xl[d];(m===null||m.includes(u.tagName))&&(u.properties[d]=l(String(g||""),d,u))}}if(u.type==="element"){let d=r?!r.includes(u.tagName):s?s.includes(u.tagName):!1;if(!d&&n&&typeof h=="number"&&(d=!n(u,h,f)),d&&f&&typeof h=="number")return o&&u.children?f.children.splice(h,1,...u.children):f.children.splice(h,1),h}}}function b_(e){const t=e.indexOf(":"),r=e.indexOf("?"),n=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||r!==-1&&t>r||n!==-1&&t>n||f_.test(e.slice(0,t))?e:""}function Gd(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let n=0,i=r.indexOf(t);for(;i!==-1;)n++,i=r.indexOf(t,i+t.length);return n}function k_(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function w_(e,t,r){const i=$o((r||{}).ignore||[]),s=v_(t);let a=-1;for(;++a<s.length;)Gg(e,"text",o);function o(c,u){let h=-1,f;for(;++h<u.length;){const d=u[h],g=f?f.children:void 0;if(i(d,g?g.indexOf(d):void 0,f))return;f=d}if(f)return l(c,u)}function l(c,u){const h=u[u.length-1],f=s[a][0],d=s[a][1];let g=0;const b=h.children.indexOf(c);let y=!1,k=[];f.lastIndex=0;let v=f.exec(c.value);for(;v;){const C=v.index,S={index:v.index,input:v.input,stack:[...u,c]};let w=d(...v,S);if(typeof w=="string"&&(w=w.length>0?{type:"text",value:w}:void 0),w===!1?f.lastIndex=C+1:(g!==C&&k.push({type:"text",value:c.value.slice(g,C)}),Array.isArray(w)?k.push(...w):w&&k.push(w),g=C+v[0].length,y=!0),!f.global)break;v=f.exec(c.value)}return y?(g<c.value.length&&k.push({type:"text",value:c.value.slice(g)}),h.children.splice(b,1,...k)):k=[c],b+k.length}}function v_(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const r=!e[0]||Array.isArray(e[0])?e:[e];let n=-1;for(;++n<r.length;){const i=r[n];t.push([C_(i[0]),S_(i[1])])}return t}function C_(e){return typeof e=="string"?new RegExp(k_(e),"g"):e}function S_(e){return typeof e=="function"?e:function(){return e}}const Al="phrasing",Ml=["autolink","link","image","label"];function __(){return{transforms:[I_],enter:{literalAutolink:E_,literalAutolinkEmail:Nl,literalAutolinkHttp:Nl,literalAutolinkWww:Nl},exit:{literalAutolink:L_,literalAutolinkEmail:N_,literalAutolinkHttp:A_,literalAutolinkWww:M_}}}function T_(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Al,notInConstruct:Ml},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Al,notInConstruct:Ml},{character:":",before:"[ps]",after:"\\/",inConstruct:Al,notInConstruct:Ml}]}}function E_(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Nl(e){this.config.enter.autolinkProtocol.call(this,e)}function A_(e){this.config.exit.autolinkProtocol.call(this,e)}function M_(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 N_(e){this.config.exit.autolinkEmail.call(this,e)}function L_(e){this.exit(e)}function I_(e){w_(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,$_],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),j_]],{ignore:["link","linkReference"]})}function $_(e,t,r,n,i){let s="";if(!Xg(i)||(/^w/i.test(t)&&(r=t+r,t="",s="http://"),!B_(r)))return!1;const a=D_(r+n);if(!a[0])return!1;const o={type:"link",title:null,url:s+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[o,{type:"text",value:a[1]}]:o}function j_(e,t,r,n){return!Xg(n,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+r,children:[{type:"text",value:t+"@"+r}]}}function B_(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 D_(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let r=t[0],n=r.indexOf(")");const i=Gd(e,"(");let s=Gd(e,")");for(;n!==-1&&i>s;)e+=r.slice(0,n+1),r=r.slice(n+1),n=r.indexOf(")"),s++;return[e,r]}function Xg(e,t){const r=e.input.charCodeAt(e.index-1);return(e.index===0||Mn(r)||No(r))&&(!t||r!==47)}Qg.peek=U_;function P_(){this.buffer()}function F_(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function R_(){this.buffer()}function O_(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function z_(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=ur(this.sliceSerialize(e)).toLowerCase(),r.label=t}function H_(e){this.exit(e)}function W_(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=ur(this.sliceSerialize(e)).toLowerCase(),r.label=t}function q_(e){this.exit(e)}function U_(){return"["}function Qg(e,t,r,n){const i=r.createTracker(n);let s=i.move("[^");const a=r.enter("footnoteReference"),o=r.enter("reference");return s+=i.move(r.safe(r.associationId(e),{after:"]",before:s})),o(),a(),s+=i.move("]"),s}function V_(){return{enter:{gfmFootnoteCallString:P_,gfmFootnoteCall:F_,gfmFootnoteDefinitionLabelString:R_,gfmFootnoteDefinition:O_},exit:{gfmFootnoteCallString:z_,gfmFootnoteCall:H_,gfmFootnoteDefinitionLabelString:W_,gfmFootnoteDefinition:q_}}}function G_(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:r,footnoteReference:Qg},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(n,i,s,a){const o=s.createTracker(a);let l=o.move("[^");const c=s.enter("footnoteDefinition"),u=s.enter("label");return l+=o.move(s.safe(s.associationId(n),{before:l,after:"]"})),u(),l+=o.move("]:"),n.children&&n.children.length>0&&(o.shift(4),l+=o.move((t?`
91
+ `:" ")+s.indentLines(s.containerFlow(n,o.current()),t?Kg:Y_))),c(),l}}function Y_(e,t,r){return t===0?e:Kg(e,t,r)}function Kg(e,t,r){return(r?"":" ")+e}const X_=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Zg.peek=eT;function Q_(){return{canContainEols:["delete"],enter:{strikethrough:Z_},exit:{strikethrough:J_}}}function K_(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:X_}],handlers:{delete:Zg}}}function Z_(e){this.enter({type:"delete",children:[]},e)}function J_(e){this.exit(e)}function Zg(e,t,r,n){const i=r.createTracker(n),s=r.enter("strikethrough");let a=i.move("~~");return a+=r.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),s(),a}function eT(){return"~"}function tT(e){return e.length}function rT(e,t){const r=t||{},n=(r.align||[]).concat(),i=r.stringLength||tT,s=[],a=[],o=[],l=[];let c=0,u=-1;for(;++u<e.length;){const m=[],b=[];let y=-1;for(e[u].length>c&&(c=e[u].length);++y<e[u].length;){const k=nT(e[u][y]);if(r.alignDelimiters!==!1){const v=i(k);b[y]=v,(l[y]===void 0||v>l[y])&&(l[y]=v)}m.push(k)}a[u]=m,o[u]=b}let h=-1;if(typeof n=="object"&&"length"in n)for(;++h<c;)s[h]=Yd(n[h]);else{const m=Yd(n);for(;++h<c;)s[h]=m}h=-1;const f=[],d=[];for(;++h<c;){const m=s[h];let b="",y="";m===99?(b=":",y=":"):m===108?b=":":m===114&&(y=":");let k=r.alignDelimiters===!1?1:Math.max(1,l[h]-b.length-y.length);const v=b+"-".repeat(k)+y;r.alignDelimiters!==!1&&(k=b.length+k+y.length,k>l[h]&&(l[h]=k),d[h]=k),f[h]=v}a.splice(1,0,f),o.splice(1,0,d),u=-1;const g=[];for(;++u<a.length;){const m=a[u],b=o[u];h=-1;const y=[];for(;++h<c;){const k=m[h]||"";let v="",C="";if(r.alignDelimiters!==!1){const S=l[h]-(b[h]||0),w=s[h];w===114?v=" ".repeat(S):w===99?S%2?(v=" ".repeat(S/2+.5),C=" ".repeat(S/2-.5)):(v=" ".repeat(S/2),C=v):C=" ".repeat(S)}r.delimiterStart!==!1&&!h&&y.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&k==="")&&(r.delimiterStart!==!1||h)&&y.push(" "),r.alignDelimiters!==!1&&y.push(v),y.push(k),r.alignDelimiters!==!1&&y.push(C),r.padding!==!1&&y.push(" "),(r.delimiterEnd!==!1||h!==c-1)&&y.push("|")}g.push(r.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return g.join(`
92
+ `)}function nT(e){return e==null?"":String(e)}function Yd(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 iT(e,t,r,n){const i=r.enter("blockquote"),s=r.createTracker(n);s.move("> "),s.shift(2);const a=r.indentLines(r.containerFlow(e,s.current()),sT);return i(),a}function sT(e,t,r){return">"+(r?"":" ")+e}function aT(e,t){return Xd(e,t.inConstruct,!0)&&!Xd(e,t.notInConstruct,!1)}function Xd(e,t,r){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return r;let n=-1;for(;++n<t.length;)if(e.includes(t[n]))return!0;return!1}function Qd(e,t,r,n){let i=-1;for(;++i<r.unsafe.length;)if(r.unsafe[i].character===`
93
+ `&&aT(r.stack,r.unsafe[i]))return/[ \t]/.test(n.before)?"":" ";return`\\
94
+ `}function oT(e,t){const r=String(e);let n=r.indexOf(t),i=n,s=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;n!==-1;)n===i?++s>a&&(a=s):s=1,i=n+t.length,n=r.indexOf(t,i);return a}function lT(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 cT(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 uT(e,t,r,n){const i=cT(r),s=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(lT(e,r)){const h=r.enter("codeIndented"),f=r.indentLines(s,hT);return h(),f}const o=r.createTracker(n),l=i.repeat(Math.max(oT(s,i)+1,3)),c=r.enter("codeFenced");let u=o.move(l);if(e.lang){const h=r.enter(`codeFencedLang${a}`);u+=o.move(r.safe(e.lang,{before:u,after:" ",encode:["`"],...o.current()})),h()}if(e.lang&&e.meta){const h=r.enter(`codeFencedMeta${a}`);u+=o.move(" "),u+=o.move(r.safe(e.meta,{before:u,after:`
95
+ `,encode:["`"],...o.current()})),h()}return u+=o.move(`
96
+ `),s&&(u+=o.move(s+`
97
+ `)),u+=o.move(l),c(),u}function hT(e,t,r){return(r?"":" ")+e}function qu(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 dT(e,t,r,n){const i=qu(r),s=i==='"'?"Quote":"Apostrophe",a=r.enter("definition");let o=r.enter("label");const l=r.createTracker(n);let c=l.move("[");return c+=l.move(r.safe(r.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=r.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(r.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=r.enter("destinationRaw"),c+=l.move(r.safe(e.url,{before:c,after:e.title?" ":`
98
+ `,...l.current()}))),o(),e.title&&(o=r.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(r.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),o()),a(),c}function fT(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 Ss(e){return"&#x"+e.toString(16).toUpperCase()+";"}function qa(e,t,r){const n=hi(e),i=hi(t);return n===void 0?i===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:n===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}}Jg.peek=pT;function Jg(e,t,r,n){const i=fT(r),s=r.enter("emphasis"),a=r.createTracker(n),o=a.move(i);let l=a.move(r.containerPhrasing(e,{after:i,before:o,...a.current()}));const c=l.charCodeAt(0),u=qa(n.before.charCodeAt(n.before.length-1),c,i);u.inside&&(l=Ss(c)+l.slice(1));const h=l.charCodeAt(l.length-1),f=qa(n.after.charCodeAt(0),h,i);f.inside&&(l=l.slice(0,-1)+Ss(h));const d=a.move(i);return s(),r.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},o+l+d}function pT(e,t,r){return r.options.emphasis||"*"}function gT(e,t){let r=!1;return Hu(e,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return r=!0,gc}),!!((!e.depth||e.depth<3)&&Bu(e)&&(t.options.setext||r))}function mT(e,t,r,n){const i=Math.max(Math.min(6,e.depth||1),1),s=r.createTracker(n);if(gT(e,r)){const u=r.enter("headingSetext"),h=r.enter("phrasing"),f=r.containerPhrasing(e,{...s.current(),before:`
99
+ `,after:`
100
+ `});return h(),u(),f+`
101
+ `+(i===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(`
102
+ `))+1))}const a="#".repeat(i),o=r.enter("headingAtx"),l=r.enter("phrasing");s.move(a+" ");let c=r.containerPhrasing(e,{before:"# ",after:`
103
+ `,...s.current()});return/^[\t ]/.test(c)&&(c=Ss(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,r.options.closeAtx&&(c+=" "+a),l(),o(),c}em.peek=xT;function em(e){return e.value||""}function xT(){return"<"}tm.peek=yT;function tm(e,t,r,n){const i=qu(r),s=i==='"'?"Quote":"Apostrophe",a=r.enter("image");let o=r.enter("label");const l=r.createTracker(n);let c=l.move("![");return c+=l.move(r.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=r.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(r.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=r.enter("destinationRaw"),c+=l.move(r.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=r.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(r.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),o()),c+=l.move(")"),a(),c}function yT(){return"!"}rm.peek=bT;function rm(e,t,r,n){const i=e.referenceType,s=r.enter("imageReference");let a=r.enter("label");const o=r.createTracker(n);let l=o.move("![");const c=r.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),a();const u=r.stack;r.stack=[],a=r.enter("reference");const h=r.safe(r.associationId(e),{before:l,after:"]",...o.current()});return a(),r.stack=u,s(),i==="full"||!c||c!==h?l+=o.move(h+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function bT(){return"!"}nm.peek=kT;function nm(e,t,r){let n=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(n);)i+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++s<r.unsafe.length;){const a=r.unsafe[s],o=r.compilePattern(a);let l;if(a.atBreak)for(;l=o.exec(n);){let c=l.index;n.charCodeAt(c)===10&&n.charCodeAt(c-1)===13&&c--,n=n.slice(0,c)+" "+n.slice(l.index+1)}}return i+n+i}function kT(){return"`"}function im(e,t){const r=Bu(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}sm.peek=wT;function sm(e,t,r,n){const i=qu(r),s=i==='"'?"Quote":"Apostrophe",a=r.createTracker(n);let o,l;if(im(e,r)){const u=r.stack;r.stack=[],o=r.enter("autolink");let h=a.move("<");return h+=a.move(r.containerPhrasing(e,{before:h,after:">",...a.current()})),h+=a.move(">"),o(),r.stack=u,h}o=r.enter("link"),l=r.enter("label");let c=a.move("[");return c+=a.move(r.containerPhrasing(e,{before:c,after:"](",...a.current()})),c+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=r.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(r.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=r.enter("destinationRaw"),c+=a.move(r.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=r.enter(`title${s}`),c+=a.move(" "+i),c+=a.move(r.safe(e.title,{before:c,after:i,...a.current()})),c+=a.move(i),l()),c+=a.move(")"),o(),c}function wT(e,t,r){return im(e,r)?"<":"["}am.peek=vT;function am(e,t,r,n){const i=e.referenceType,s=r.enter("linkReference");let a=r.enter("label");const o=r.createTracker(n);let l=o.move("[");const c=r.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),a();const u=r.stack;r.stack=[],a=r.enter("reference");const h=r.safe(r.associationId(e),{before:l,after:"]",...o.current()});return a(),r.stack=u,s(),i==="full"||!c||c!==h?l+=o.move(h+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function vT(){return"["}function Uu(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 CT(e){const t=Uu(e),r=e.options.bulletOther;if(!r)return t==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+r+"`) to be different");return r}function ST(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 om(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 _T(e,t,r,n){const i=r.enter("list"),s=r.bulletCurrent;let a=e.ordered?ST(r):Uu(r);const o=e.ordered?a==="."?")":".":CT(r);let l=t&&r.bulletLastUsed?a===r.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&u&&(!u.children||!u.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(l=!0),om(r)===a&&u){let h=-1;for(;++h<e.children.length;){const f=e.children[h];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(a=o),r.bulletCurrent=a;const c=r.containerFlow(e,n);return r.bulletLastUsed=a,r.bulletCurrent=s,i(),c}function TT(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 ET(e,t,r,n){const i=TT(r);let s=r.bulletCurrent||Uu(r);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(r.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let a=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=r.createTracker(n);o.move(s+" ".repeat(a-s.length)),o.shift(a);const l=r.enter("listItem"),c=r.indentLines(r.containerFlow(e,o.current()),u);return l(),c;function u(h,f,d){return f?(d?"":" ".repeat(a))+h:(d?s:s+" ".repeat(a-s.length))+h}}function AT(e,t,r,n){const i=r.enter("paragraph"),s=r.enter("phrasing"),a=r.containerPhrasing(e,n);return s(),i(),a}const MT=$o(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function NT(e,t,r,n){return(e.children.some(function(a){return MT(a)})?r.containerPhrasing:r.containerFlow).call(r,e,n)}function LT(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}lm.peek=IT;function lm(e,t,r,n){const i=LT(r),s=r.enter("strong"),a=r.createTracker(n),o=a.move(i+i);let l=a.move(r.containerPhrasing(e,{after:i,before:o,...a.current()}));const c=l.charCodeAt(0),u=qa(n.before.charCodeAt(n.before.length-1),c,i);u.inside&&(l=Ss(c)+l.slice(1));const h=l.charCodeAt(l.length-1),f=qa(n.after.charCodeAt(0),h,i);f.inside&&(l=l.slice(0,-1)+Ss(h));const d=a.move(i+i);return s(),r.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},o+l+d}function IT(e,t,r){return r.options.strong||"*"}function $T(e,t,r,n){return r.safe(e.value,n)}function jT(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 BT(e,t,r){const n=(om(r)+(r.options.ruleSpaces?" ":"")).repeat(jT(r));return r.options.ruleSpaces?n.slice(0,-1):n}const cm={blockquote:iT,break:Qd,code:uT,definition:dT,emphasis:Jg,hardBreak:Qd,heading:mT,html:em,image:tm,imageReference:rm,inlineCode:nm,link:sm,linkReference:am,list:_T,listItem:ET,paragraph:AT,root:NT,strong:lm,text:$T,thematicBreak:BT};function DT(){return{enter:{table:PT,tableData:Kd,tableHeader:Kd,tableRow:RT},exit:{codeText:OT,table:FT,tableData:Ll,tableHeader:Ll,tableRow:Ll}}}function PT(e){const t=e._align;this.enter({type:"table",align:t.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function FT(e){this.exit(e),this.data.inTable=void 0}function RT(e){this.enter({type:"tableRow",children:[]},e)}function Ll(e){this.exit(e)}function Kd(e){this.enter({type:"tableCell",children:[]},e)}function OT(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,zT));const r=this.stack[this.stack.length-1];r.type,r.value=t,this.exit(e)}function zT(e,t){return t==="|"?t:e}function HT(e){const t=e||{},r=t.tableCellPadding,n=t.tablePipeAlign,i=t.stringLength,s=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
104
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:f,table:a,tableCell:l,tableRow:o}};function a(d,g,m,b){return c(u(d,m,b),d.align)}function o(d,g,m,b){const y=h(d,m,b),k=c([y]);return k.slice(0,k.indexOf(`
105
+ `))}function l(d,g,m,b){const y=m.enter("tableCell"),k=m.enter("phrasing"),v=m.containerPhrasing(d,{...b,before:s,after:s});return k(),y(),v}function c(d,g){return rT(d,{align:g,alignDelimiters:n,padding:r,stringLength:i})}function u(d,g,m){const b=d.children;let y=-1;const k=[],v=g.enter("table");for(;++y<b.length;)k[y]=h(b[y],g,m);return v(),k}function h(d,g,m){const b=d.children;let y=-1;const k=[],v=g.enter("tableRow");for(;++y<b.length;)k[y]=l(b[y],d,g,m);return v(),k}function f(d,g,m){let b=cm.inlineCode(d,g,m);return m.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function WT(){return{exit:{taskListCheckValueChecked:Zd,taskListCheckValueUnchecked:Zd,paragraph:UT}}}function qT(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:VT}}}function Zd(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function UT(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const n=r.children[0];if(n&&n.type==="text"){const i=t.children;let s=-1,a;for(;++s<i.length;){const o=i[s];if(o.type==="paragraph"){a=o;break}}a===r&&(n.value=n.value.slice(1),n.value.length===0?r.children.shift():r.position&&n.position&&typeof n.position.start.offset=="number"&&(n.position.start.column++,n.position.start.offset++,r.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function VT(e,t,r,n){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",o=r.createTracker(n);s&&o.move(a);let l=cm.listItem(e,t,r,{...n,...o.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+a}}function GT(){return[__(),V_(),Q_(),DT(),WT()]}function YT(e){return{extensions:[T_(),G_(e),K_(),HT(e),qT()]}}const XT={tokenize:tE,partial:!0},um={tokenize:rE,partial:!0},hm={tokenize:nE,partial:!0},dm={tokenize:iE,partial:!0},QT={tokenize:sE,partial:!0},fm={name:"wwwAutolink",tokenize:JT,previous:gm},pm={name:"protocolAutolink",tokenize:eE,previous:mm},Hr={name:"emailAutolink",tokenize:ZT,previous:xm},Sr={};function KT(){return{text:Sr}}let mn=48;for(;mn<123;)Sr[mn]=Hr,mn++,mn===58?mn=65:mn===91&&(mn=97);Sr[43]=Hr;Sr[45]=Hr;Sr[46]=Hr;Sr[95]=Hr;Sr[72]=[Hr,pm];Sr[104]=[Hr,pm];Sr[87]=[Hr,fm];Sr[119]=[Hr,fm];function ZT(e,t,r){const n=this;let i,s;return a;function a(h){return!bc(h)||!xm.call(n,n.previous)||Vu(n.events)?r(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(h))}function o(h){return bc(h)?(e.consume(h),o):h===64?(e.consume(h),l):r(h)}function l(h){return h===46?e.check(QT,u,c)(h):h===45||h===95||Ct(h)?(s=!0,e.consume(h),l):u(h)}function c(h){return e.consume(h),i=!0,l}function u(h){return s&&i&&$t(n.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):r(h)}}function JT(e,t,r){const n=this;return i;function i(a){return a!==87&&a!==119||!gm.call(n,n.previous)||Vu(n.events)?r(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(XT,e.attempt(um,e.attempt(hm,s),r),r)(a))}function s(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function eE(e,t,r){const n=this;let i="",s=!1;return a;function a(h){return(h===72||h===104)&&mm.call(n,n.previous)&&!Vu(n.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),o):r(h)}function o(h){if($t(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),o;if(h===58){const f=i.toLowerCase();if(f==="http"||f==="https")return e.consume(h),l}return r(h)}function l(h){return h===47?(e.consume(h),s?c:(s=!0,l)):r(h)}function c(h){return h===null||za(h)||He(h)||Mn(h)||No(h)?r(h):e.attempt(um,e.attempt(hm,u),r)(h)}function u(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function tE(e,t,r){let n=0;return i;function i(a){return(a===87||a===119)&&n<3?(n++,e.consume(a),i):a===46&&n===3?(e.consume(a),s):r(a)}function s(a){return a===null?r(a):t(a)}}function rE(e,t,r){let n,i,s;return a;function a(c){return c===46||c===95?e.check(dm,l,o)(c):c===null||He(c)||Mn(c)||c!==45&&No(c)?l(c):(s=!0,e.consume(c),a)}function o(c){return c===95?n=!0:(i=n,n=void 0),e.consume(c),a}function l(c){return i||n||!s?r(c):t(c)}}function nE(e,t){let r=0,n=0;return i;function i(a){return a===40?(r++,e.consume(a),i):a===41&&n<r?s(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(dm,t,s)(a):a===null||He(a)||Mn(a)?t(a):(e.consume(a),i)}function s(a){return a===41&&n++,e.consume(a),i}}function iE(e,t,r){return n;function n(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),n):o===38?(e.consume(o),s):o===93?(e.consume(o),i):o===60||o===null||He(o)||Mn(o)?t(o):r(o)}function i(o){return o===null||o===40||o===91||He(o)||Mn(o)?t(o):n(o)}function s(o){return $t(o)?a(o):r(o)}function a(o){return o===59?(e.consume(o),n):$t(o)?(e.consume(o),a):r(o)}}function sE(e,t,r){return n;function n(s){return e.consume(s),i}function i(s){return Ct(s)?r(s):t(s)}}function gm(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||He(e)}function mm(e){return!$t(e)}function xm(e){return!(e===47||bc(e))}function bc(e){return e===43||e===45||e===46||e===95||Ct(e)}function Vu(e){let t=e.length,r=!1;for(;t--;){const n=e[t][1];if((n.type==="labelLink"||n.type==="labelImage")&&!n._balanced){r=!0;break}if(n._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const aE={tokenize:pE,partial:!0};function oE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:hE,continuation:{tokenize:dE},exit:fE}},text:{91:{name:"gfmFootnoteCall",tokenize:uE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:lE,resolveTo:cE}}}}function lE(e,t,r){const n=this;let i=n.events.length;const s=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let a;for(;i--;){const l=n.events[i][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return r(l);const c=ur(n.sliceSerialize({start:a.end,end:n.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?r(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function cE(e,t){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const n={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},o=[e[r+1],e[r+2],["enter",n,t],e[r+3],e[r+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",n,t]];return e.splice(r,e.length-r+1,...o),e}function uE(e,t,r){const n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let s=0,a;return o;function o(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),l}function l(h){return h!==94?r(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(h){if(s>999||h===93&&!a||h===null||h===91||He(h))return r(h);if(h===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return i.includes(ur(n.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):r(h)}return He(h)||(a=!0),s++,e.consume(h),h===92?u:c}function u(h){return h===91||h===92||h===93?(e.consume(h),s++,c):c(h)}}function hE(e,t,r){const n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let s,a=0,o;return l;function l(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):r(g)}function u(g){if(a>999||g===93&&!o||g===null||g===91||He(g))return r(g);if(g===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return s=ur(n.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return He(g)||(o=!0),a++,e.consume(g),g===92?h:u}function h(g){return g===91||g===92||g===93?(e.consume(g),a++,u):u(g)}function f(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(s)||i.push(s),je(e,d,"gfmFootnoteDefinitionWhitespace")):r(g)}function d(g){return t(g)}}function dE(e,t,r){return e.check(zs,t,e.attempt(aE,t,r))}function fE(e){e.exit("gfmFootnoteDefinition")}function pE(e,t,r){const n=this;return je(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=n.events[n.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(s):r(s)}}function gE(e){let r=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:s,resolveAll:i};return r==null&&(r=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function i(a,o){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let c=l;for(;c--;)if(a[c][0]==="exit"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[c][1].end.offset-a[c][1].start.offset){a[l][1].type="strikethroughSequence",a[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},a[c][1].start),end:Object.assign({},a[l][1].end)},h={type:"strikethroughText",start:Object.assign({},a[c][1].end),end:Object.assign({},a[l][1].start)},f=[["enter",u,o],["enter",a[c][1],o],["exit",a[c][1],o],["enter",h,o]],d=o.parser.constructs.insideSpan.null;d&&Xt(f,f.length,0,Lo(d,a.slice(c+1,l),o)),Xt(f,f.length,0,[["exit",h,o],["enter",a[l][1],o],["exit",a[l][1],o],["exit",u,o]]),Xt(a,c-1,l-c+3,f),l=c+f.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function s(a,o,l){const c=this.previous,u=this.events;let h=0;return f;function f(g){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(g):(a.enter("strikethroughSequenceTemporary"),d(g))}function d(g){const m=hi(c);if(g===126)return h>1?l(g):(a.consume(g),h++,d);if(h<2&&!r)return l(g);const b=a.exit("strikethroughSequenceTemporary"),y=hi(g);return b._open=!y||y===2&&!!m,b._close=!m||m===2&&!!y,o(g)}}}class mE{constructor(){this.map=[]}add(t,r,n){xE(this,t,r,n)}consume(t){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let r=this.map.length;const n=[];for(;r>0;)r-=1,n.push(t.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),t.length=this.map[r][0];n.push(t.slice()),t.length=0;let i=n.pop();for(;i;){for(const s of i)t.push(s);i=n.pop()}this.map.length=0}}function xE(e,t,r,n){let i=0;if(!(r===0&&n.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=r,e.map[i][2].push(...n);return}i+=1}e.map.push([t,r,n])}}function yE(e,t){let r=!1;const n=[];for(;t<e.length;){const i=e[t];if(r){if(i[0]==="enter")i[1].type==="tableContent"&&n.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=n.length-1;n[s]=n[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(r=!0);t+=1}return n}function bE(){return{flow:{null:{name:"table",tokenize:kE,resolveAll:wE}}}}function kE(e,t,r){const n=this;let i=0,s=0,a;return o;function o(E){let N=n.events.length-1;for(;N>-1;){const I=n.events[N][1].type;if(I==="lineEnding"||I==="linePrefix")N--;else break}const D=N>-1?n.events[N][1].type:null,R=D==="tableHead"||D==="tableRow"?w:l;return R===w&&n.parser.lazy[n.now().line]?r(E):R(E)}function l(E){return e.enter("tableHead"),e.enter("tableRow"),c(E)}function c(E){return E===124||(a=!0,s+=1),u(E)}function u(E){return E===null?r(E):ge(E)?s>1?(s=0,n.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),d):r(E):Me(E)?je(e,u,"whitespace")(E):(s+=1,a&&(a=!1,i+=1),E===124?(e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),a=!0,u):(e.enter("data"),h(E)))}function h(E){return E===null||E===124||He(E)?(e.exit("data"),u(E)):(e.consume(E),E===92?f:h)}function f(E){return E===92||E===124?(e.consume(E),h):h(E)}function d(E){return n.interrupt=!1,n.parser.lazy[n.now().line]?r(E):(e.enter("tableDelimiterRow"),a=!1,Me(E)?je(e,g,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):g(E))}function g(E){return E===45||E===58?b(E):E===124?(a=!0,e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),m):S(E)}function m(E){return Me(E)?je(e,b,"whitespace")(E):b(E)}function b(E){return E===58?(s+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(E),e.exit("tableDelimiterMarker"),y):E===45?(s+=1,y(E)):E===null||ge(E)?C(E):S(E)}function y(E){return E===45?(e.enter("tableDelimiterFiller"),k(E)):S(E)}function k(E){return E===45?(e.consume(E),k):E===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(E),e.exit("tableDelimiterMarker"),v):(e.exit("tableDelimiterFiller"),v(E))}function v(E){return Me(E)?je(e,C,"whitespace")(E):C(E)}function C(E){return E===124?g(E):E===null||ge(E)?!a||i!==s?S(E):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(E)):S(E)}function S(E){return r(E)}function w(E){return e.enter("tableRow"),T(E)}function T(E){return E===124?(e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),T):E===null||ge(E)?(e.exit("tableRow"),t(E)):Me(E)?je(e,T,"whitespace")(E):(e.enter("data"),$(E))}function $(E){return E===null||E===124||He(E)?(e.exit("data"),T(E)):(e.consume(E),E===92?M:$)}function M(E){return E===92||E===124?(e.consume(E),$):$(E)}}function wE(e,t){let r=-1,n=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,c,u,h;const f=new mE;for(;++r<e.length;){const d=e[r],g=d[1];d[0]==="enter"?g.type==="tableHead"?(o=!1,l!==0&&(Jd(f,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},f.add(r,0,[["enter",c,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(n=!0,h=void 0,s=[0,0,0,0],a=[0,r+1,0,0],o&&(o=!1,u={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},f.add(r,0,[["enter",u,t]])),i=g.type==="tableDelimiterRow"?2:u?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(n=!1,a[2]===0&&(s[1]!==0&&(a[0]=a[1],h=oa(f,t,s,i,void 0,h),s=[0,0,0,0]),a[2]=r)):g.type==="tableCellDivider"&&(n?n=!1:(s[1]!==0&&(a[0]=a[1],h=oa(f,t,s,i,void 0,h)),s=a,a=[s[1],r,0,0])):g.type==="tableHead"?(o=!0,l=r):g.type==="tableRow"||g.type==="tableDelimiterRow"?(l=r,s[1]!==0?(a[0]=a[1],h=oa(f,t,s,i,r,h)):a[1]!==0&&(h=oa(f,t,a,i,r,h)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(a[3]=r)}for(l!==0&&Jd(f,t,l,c,u),f.consume(t.events),r=-1;++r<t.events.length;){const d=t.events[r];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=yE(t.events,r))}return e}function oa(e,t,r,n,i,s){const a=n===1?"tableHeader":n===2?"tableDelimiter":"tableData",o="tableContent";r[0]!==0&&(s.end=Object.assign({},Yn(t.events,r[0])),e.add(r[0],0,[["exit",s,t]]));const l=Yn(t.events,r[1]);if(s={type:a,start:Object.assign({},l),end:Object.assign({},l)},e.add(r[1],0,[["enter",s,t]]),r[2]!==0){const c=Yn(t.events,r[2]),u=Yn(t.events,r[3]),h={type:o,start:Object.assign({},c),end:Object.assign({},u)};if(e.add(r[2],0,[["enter",h,t]]),n!==2){const f=t.events[r[2]],d=t.events[r[3]];if(f[1].end=Object.assign({},d[1].end),f[1].type="chunkText",f[1].contentType="text",r[3]>r[2]+1){const g=r[2]+1,m=r[3]-r[2]-1;e.add(g,m,[])}}e.add(r[3]+1,0,[["exit",h,t]])}return i!==void 0&&(s.end=Object.assign({},Yn(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function Jd(e,t,r,n,i){const s=[],a=Yn(t.events,r);i&&(i.end=Object.assign({},a),s.push(["exit",i,t])),n.end=Object.assign({},a),s.push(["exit",n,t]),e.add(r+1,0,s)}function Yn(e,t){const r=e[t],n=r[0]==="enter"?"start":"end";return r[1][n]}const vE={name:"tasklistCheck",tokenize:SE};function CE(){return{text:{91:vE}}}function SE(e,t,r){const n=this;return i;function i(l){return n.previous!==null||!n._gfmTasklistFirstContentOfListItem?r(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return He(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):r(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):r(l)}function o(l){return ge(l)?t(l):Me(l)?e.check({tokenize:_E},t,r)(l):r(l)}}function _E(e,t,r){return je(e,n,"whitespace");function n(i){return i===null?r(i):t(i)}}function TE(e){return Ag([KT(),oE(),gE(e),bE(),CE()])}const EE={};function AE(e){const t=this,r=e||EE,n=t.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),s=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),a=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(TE(r)),s.push(GT()),a.push(YT(r))}const ym={'code[class*="language-"]':{color:"#ccc",background:"none",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{color:"#ccc",background:"#2d2d2d",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:".5em 0",overflow:"auto"},':not(pre) > code[class*="language-"]':{background:"#2d2d2d",padding:".1em",borderRadius:".3em",whiteSpace:"normal"},comment:{color:"#999"},"block-comment":{color:"#999"},prolog:{color:"#999"},doctype:{color:"#999"},cdata:{color:"#999"},punctuation:{color:"#ccc"},tag:{color:"#e2777a"},"attr-name":{color:"#e2777a"},namespace:{color:"#e2777a"},deleted:{color:"#e2777a"},"function-name":{color:"#6196cc"},boolean:{color:"#f08d49"},number:{color:"#f08d49"},function:{color:"#f08d49"},property:{color:"#f8c555"},"class-name":{color:"#f8c555"},constant:{color:"#f8c555"},symbol:{color:"#f8c555"},selector:{color:"#cc99cd"},important:{color:"#cc99cd",fontWeight:"bold"},atrule:{color:"#cc99cd"},keyword:{color:"#cc99cd"},builtin:{color:"#cc99cd"},string:{color:"#7ec699"},char:{color:"#7ec699"},"attr-value":{color:"#7ec699"},regex:{color:"#7ec699"},variable:{color:"#7ec699"},operator:{color:"#67cdcc"},entity:{color:"#67cdcc",cursor:"help"},url:{color:"#67cdcc"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},inserted:{color:"green"}},ME={'pre[class*="language-"]':{color:"#d4d4d4",fontSize:"13px",textShadow:"none",fontFamily:'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:".5em 0",overflow:"auto",background:"#1e1e1e"},'code[class*="language-"]':{color:"#d4d4d4",fontSize:"13px",textShadow:"none",fontFamily:'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]::selection':{textShadow:"none",background:"#264F78"},'code[class*="language-"]::selection':{textShadow:"none",background:"#264F78"},'pre[class*="language-"] *::selection':{textShadow:"none",background:"#264F78"},'code[class*="language-"] *::selection':{textShadow:"none",background:"#264F78"},':not(pre) > code[class*="language-"]':{padding:".1em .3em",borderRadius:".3em",color:"#db4c69",background:"#1e1e1e"},".namespace":{Opacity:".7"},"doctype.doctype-tag":{color:"#569CD6"},"doctype.name":{color:"#9cdcfe"},comment:{color:"#6a9955"},prolog:{color:"#6a9955"},punctuation:{color:"#d4d4d4"},".language-html .language-css .token.punctuation":{color:"#d4d4d4"},".language-html .language-javascript .token.punctuation":{color:"#d4d4d4"},property:{color:"#9cdcfe"},tag:{color:"#569cd6"},boolean:{color:"#569cd6"},number:{color:"#b5cea8"},constant:{color:"#9cdcfe"},symbol:{color:"#b5cea8"},inserted:{color:"#b5cea8"},unit:{color:"#b5cea8"},selector:{color:"#d7ba7d"},"attr-name":{color:"#9cdcfe"},string:{color:"#ce9178"},char:{color:"#ce9178"},builtin:{color:"#ce9178"},deleted:{color:"#ce9178"},".language-css .token.string.url":{textDecoration:"underline"},operator:{color:"#d4d4d4"},entity:{color:"#569cd6"},"operator.arrow":{color:"#569CD6"},atrule:{color:"#ce9178"},"atrule.rule":{color:"#c586c0"},"atrule.url":{color:"#9cdcfe"},"atrule.url.function":{color:"#dcdcaa"},"atrule.url.punctuation":{color:"#d4d4d4"},keyword:{color:"#569CD6"},"keyword.module":{color:"#c586c0"},"keyword.control-flow":{color:"#c586c0"},function:{color:"#dcdcaa"},"function.maybe-class-name":{color:"#dcdcaa"},regex:{color:"#d16969"},important:{color:"#569cd6"},italic:{fontStyle:"italic"},"class-name":{color:"#4ec9b0"},"maybe-class-name":{color:"#4ec9b0"},console:{color:"#9cdcfe"},parameter:{color:"#9cdcfe"},interpolation:{color:"#9cdcfe"},"punctuation.interpolation-punctuation":{color:"#569cd6"},variable:{color:"#9cdcfe"},"imports.maybe-class-name":{color:"#9cdcfe"},"exports.maybe-class-name":{color:"#9cdcfe"},escape:{color:"#d7ba7d"},"tag.punctuation":{color:"#808080"},cdata:{color:"#808080"},"attr-value":{color:"#ce9178"},"attr-value.punctuation":{color:"#ce9178"},"attr-value.punctuation.attr-equals":{color:"#d4d4d4"},namespace:{color:"#4ec9b0"},'pre[class*="language-javascript"]':{color:"#9cdcfe"},'code[class*="language-javascript"]':{color:"#9cdcfe"},'pre[class*="language-jsx"]':{color:"#9cdcfe"},'code[class*="language-jsx"]':{color:"#9cdcfe"},'pre[class*="language-typescript"]':{color:"#9cdcfe"},'code[class*="language-typescript"]':{color:"#9cdcfe"},'pre[class*="language-tsx"]':{color:"#9cdcfe"},'code[class*="language-tsx"]':{color:"#9cdcfe"},'pre[class*="language-css"]':{color:"#ce9178"},'code[class*="language-css"]':{color:"#ce9178"},'pre[class*="language-html"]':{color:"#d4d4d4"},'code[class*="language-html"]':{color:"#d4d4d4"},".language-regex .token.anchor":{color:"#dcdcaa"},".language-html .token.punctuation":{color:"#808080"},'pre[class*="language-"] > code[class*="language-"]':{position:"relative",zIndex:"1"},".line-highlight.line-highlight":{background:"#f7ebc6",boxShadow:"inset 5px 0 0 #f7d87c",zIndex:"0"}};var ef={name:"mermaid",version:"11.12.0",description:"Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.",type:"module",module:"./dist/mermaid.core.mjs",types:"./dist/mermaid.d.ts",exports:{".":{types:"./dist/mermaid.d.ts",import:"./dist/mermaid.core.mjs",default:"./dist/mermaid.core.mjs"},"./*":"./*"},keywords:["diagram","markdown","flowchart","sequence diagram","gantt","class diagram","git graph","mindmap","packet diagram","c4 diagram","er diagram","pie chart","pie diagram","quadrant chart","requirement diagram","graph"],scripts:{clean:"rimraf dist",dev:"pnpm -w dev","docs:code":"typedoc src/defaultConfig.ts src/config.ts src/mermaid.ts && prettier --write ./src/docs/config/setup","docs:build":"rimraf ../../docs && pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts","docs:verify":"pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts --verify","docs:pre:vitepress":"pnpm --filter ./src/docs prefetch && rimraf src/vitepress && pnpm docs:code && tsx scripts/docs.cli.mts --vitepress && pnpm --filter ./src/vitepress install --no-frozen-lockfile --ignore-scripts","docs:build:vitepress":"pnpm docs:pre:vitepress && (cd src/vitepress && pnpm run build) && cpy --flat src/docs/landing/ ./src/vitepress/.vitepress/dist/landing","docs:dev":'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev" "tsx scripts/docs.cli.mts --watch --vitepress"',"docs:dev:docker":'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev:docker" "tsx scripts/docs.cli.mts --watch --vitepress"',"docs:serve":"pnpm docs:build:vitepress && vitepress serve src/vitepress","docs:spellcheck":'cspell "src/docs/**/*.md"',"docs:release-version":"tsx scripts/update-release-version.mts","docs:verify-version":"tsx scripts/update-release-version.mts --verify","types:build-config":"tsx scripts/create-types-from-json-schema.mts","types:verify-config":"tsx scripts/create-types-from-json-schema.mts --verify",checkCircle:"npx madge --circular ./src",prepublishOnly:"pnpm docs:verify-version"},repository:{type:"git",url:"https://github.com/mermaid-js/mermaid"},author:"Knut Sveidqvist",license:"MIT",standard:{ignore:["**/parser/*.js","dist/**/*.js","cypress/**/*.js"],globals:["page"]},dependencies:{"@braintree/sanitize-url":"^7.1.1","@iconify/utils":"^3.0.1","@mermaid-js/parser":"workspace:^","@types/d3":"^7.4.3",cytoscape:"^3.29.3","cytoscape-cose-bilkent":"^4.1.0","cytoscape-fcose":"^2.2.0",d3:"^7.9.0","d3-sankey":"^0.12.3","dagre-d3-es":"7.0.11",dayjs:"^1.11.18",dompurify:"^3.2.5",katex:"^0.16.22",khroma:"^2.1.0","lodash-es":"^4.17.21",marked:"^16.2.1",roughjs:"^4.6.6",stylis:"^4.3.6","ts-dedent":"^2.2.0",uuid:"^11.1.0"},devDependencies:{"@adobe/jsonschema2md":"^8.0.5","@iconify/types":"^2.0.0","@types/cytoscape":"^3.21.9","@types/cytoscape-fcose":"^2.2.4","@types/d3-sankey":"^0.12.4","@types/d3-scale":"^4.0.9","@types/d3-scale-chromatic":"^3.1.0","@types/d3-selection":"^3.0.11","@types/d3-shape":"^3.1.7","@types/jsdom":"^21.1.7","@types/katex":"^0.16.7","@types/lodash-es":"^4.17.12","@types/micromatch":"^4.0.9","@types/stylis":"^4.2.7","@types/uuid":"^10.0.0",ajv:"^8.17.1",canvas:"^3.1.2",chokidar:"3.6.0",concurrently:"^9.1.2","csstree-validator":"^4.0.1",globby:"^14.1.0",jison:"^0.4.18","js-base64":"^3.7.8",jsdom:"^26.1.0","json-schema-to-typescript":"^15.0.4",micromatch:"^4.0.8","path-browserify":"^1.0.1",prettier:"^3.5.3",remark:"^15.0.1","remark-frontmatter":"^5.0.0","remark-gfm":"^4.0.1",rimraf:"^6.0.1","start-server-and-test":"^2.0.13","type-fest":"^4.35.0",typedoc:"^0.28.12","typedoc-plugin-markdown":"^4.8.1",typescript:"~5.7.3","unist-util-flatmap":"^1.0.0","unist-util-visit":"^5.0.0",vitepress:"^1.6.4","vitepress-plugin-search":"1.0.4-alpha.22"},files:["dist/","README.md"],publishConfig:{access:"public"}},Ta={exports:{}},NE=Ta.exports,tf;function LE(){return tf||(tf=1,(function(e,t){(function(r,n){e.exports=n()})(NE,(function(){var r=1e3,n=6e4,i=36e5,s="millisecond",a="second",o="minute",l="hour",c="day",u="week",h="month",f="quarter",d="year",g="date",m="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,k={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(I){var F=["th","st","nd","rd"],L=I%100;return"["+I+(F[(L-20)%10]||F[L]||F[0])+"]"}},v=function(I,F,L){var B=String(I);return!B||B.length>=F?I:""+Array(F+1-B.length).join(L)+I},C={s:v,z:function(I){var F=-I.utcOffset(),L=Math.abs(F),B=Math.floor(L/60),H=L%60;return(F<=0?"+":"-")+v(B,2,"0")+":"+v(H,2,"0")},m:function I(F,L){if(F.date()<L.date())return-I(L,F);var B=12*(L.year()-F.year())+(L.month()-F.month()),H=F.clone().add(B,h),Q=L-H<0,_=F.clone().add(B+(Q?-1:1),h);return+(-(B+(L-H)/(Q?H-_:_-H))||0)},a:function(I){return I<0?Math.ceil(I)||0:Math.floor(I)},p:function(I){return{M:h,y:d,w:u,d:c,D:g,h:l,m:o,s:a,ms:s,Q:f}[I]||String(I||"").toLowerCase().replace(/s$/,"")},u:function(I){return I===void 0}},S="en",w={};w[S]=k;var T="$isDayjsObject",$=function(I){return I instanceof D||!(!I||!I[T])},M=function I(F,L,B){var H;if(!F)return S;if(typeof F=="string"){var Q=F.toLowerCase();w[Q]&&(H=Q),L&&(w[Q]=L,H=Q);var _=F.split("-");if(!H&&_.length>1)return I(_[0])}else{var j=F.name;w[j]=F,H=j}return!B&&H&&(S=H),H||!B&&S},E=function(I,F){if($(I))return I.clone();var L=typeof F=="object"?F:{};return L.date=I,L.args=arguments,new D(L)},N=C;N.l=M,N.i=$,N.w=function(I,F){return E(I,{locale:F.$L,utc:F.$u,x:F.$x,$offset:F.$offset})};var D=(function(){function I(L){this.$L=M(L.locale,null,!0),this.parse(L),this.$x=this.$x||L.x||{},this[T]=!0}var F=I.prototype;return F.parse=function(L){this.$d=(function(B){var H=B.date,Q=B.utc;if(H===null)return new Date(NaN);if(N.u(H))return new Date;if(H instanceof Date)return new Date(H);if(typeof H=="string"&&!/Z$/i.test(H)){var _=H.match(b);if(_){var j=_[2]-1||0,te=(_[7]||"0").substring(0,3);return Q?new Date(Date.UTC(_[1],j,_[3]||1,_[4]||0,_[5]||0,_[6]||0,te)):new Date(_[1],j,_[3]||1,_[4]||0,_[5]||0,_[6]||0,te)}}return new Date(H)})(L),this.init()},F.init=function(){var L=this.$d;this.$y=L.getFullYear(),this.$M=L.getMonth(),this.$D=L.getDate(),this.$W=L.getDay(),this.$H=L.getHours(),this.$m=L.getMinutes(),this.$s=L.getSeconds(),this.$ms=L.getMilliseconds()},F.$utils=function(){return N},F.isValid=function(){return this.$d.toString()!==m},F.isSame=function(L,B){var H=E(L);return this.startOf(B)<=H&&H<=this.endOf(B)},F.isAfter=function(L,B){return E(L)<this.startOf(B)},F.isBefore=function(L,B){return this.endOf(B)<E(L)},F.$g=function(L,B,H){return N.u(L)?this[B]:this.set(H,L)},F.unix=function(){return Math.floor(this.valueOf()/1e3)},F.valueOf=function(){return this.$d.getTime()},F.startOf=function(L,B){var H=this,Q=!!N.u(B)||B,_=N.p(L),j=function(K,re){var ye=N.w(H.$u?Date.UTC(H.$y,re,K):new Date(H.$y,re,K),H);return Q?ye:ye.endOf(c)},te=function(K,re){return N.w(H.toDate()[K].apply(H.toDate("s"),(Q?[0,0,0,0]:[23,59,59,999]).slice(re)),H)},A=this.$W,P=this.$M,Y=this.$D,U="set"+(this.$u?"UTC":"");switch(_){case d:return Q?j(1,0):j(31,11);case h:return Q?j(1,P):j(0,P+1);case u:var q=this.$locale().weekStart||0,V=(A<q?A+7:A)-q;return j(Q?Y-V:Y+(6-V),P);case c:case g:return te(U+"Hours",0);case l:return te(U+"Minutes",1);case o:return te(U+"Seconds",2);case a:return te(U+"Milliseconds",3);default:return this.clone()}},F.endOf=function(L){return this.startOf(L,!1)},F.$set=function(L,B){var H,Q=N.p(L),_="set"+(this.$u?"UTC":""),j=(H={},H[c]=_+"Date",H[g]=_+"Date",H[h]=_+"Month",H[d]=_+"FullYear",H[l]=_+"Hours",H[o]=_+"Minutes",H[a]=_+"Seconds",H[s]=_+"Milliseconds",H)[Q],te=Q===c?this.$D+(B-this.$W):B;if(Q===h||Q===d){var A=this.clone().set(g,1);A.$d[j](te),A.init(),this.$d=A.set(g,Math.min(this.$D,A.daysInMonth())).$d}else j&&this.$d[j](te);return this.init(),this},F.set=function(L,B){return this.clone().$set(L,B)},F.get=function(L){return this[N.p(L)]()},F.add=function(L,B){var H,Q=this;L=Number(L);var _=N.p(B),j=function(P){var Y=E(Q);return N.w(Y.date(Y.date()+Math.round(P*L)),Q)};if(_===h)return this.set(h,this.$M+L);if(_===d)return this.set(d,this.$y+L);if(_===c)return j(1);if(_===u)return j(7);var te=(H={},H[o]=n,H[l]=i,H[a]=r,H)[_]||1,A=this.$d.getTime()+L*te;return N.w(A,this)},F.subtract=function(L,B){return this.add(-1*L,B)},F.format=function(L){var B=this,H=this.$locale();if(!this.isValid())return H.invalidDate||m;var Q=L||"YYYY-MM-DDTHH:mm:ssZ",_=N.z(this),j=this.$H,te=this.$m,A=this.$M,P=H.weekdays,Y=H.months,U=H.meridiem,q=function(re,ye,_e,ve){return re&&(re[ye]||re(B,Q))||_e[ye].slice(0,ve)},V=function(re){return N.s(j%12||12,re,"0")},K=U||function(re,ye,_e){var ve=re<12?"AM":"PM";return _e?ve.toLowerCase():ve};return Q.replace(y,(function(re,ye){return ye||(function(_e){switch(_e){case"YY":return String(B.$y).slice(-2);case"YYYY":return N.s(B.$y,4,"0");case"M":return A+1;case"MM":return N.s(A+1,2,"0");case"MMM":return q(H.monthsShort,A,Y,3);case"MMMM":return q(Y,A);case"D":return B.$D;case"DD":return N.s(B.$D,2,"0");case"d":return String(B.$W);case"dd":return q(H.weekdaysMin,B.$W,P,2);case"ddd":return q(H.weekdaysShort,B.$W,P,3);case"dddd":return P[B.$W];case"H":return String(j);case"HH":return N.s(j,2,"0");case"h":return V(1);case"hh":return V(2);case"a":return K(j,te,!0);case"A":return K(j,te,!1);case"m":return String(te);case"mm":return N.s(te,2,"0");case"s":return String(B.$s);case"ss":return N.s(B.$s,2,"0");case"SSS":return N.s(B.$ms,3,"0");case"Z":return _}return null})(re)||_.replace(":","")}))},F.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},F.diff=function(L,B,H){var Q,_=this,j=N.p(B),te=E(L),A=(te.utcOffset()-this.utcOffset())*n,P=this-te,Y=function(){return N.m(_,te)};switch(j){case d:Q=Y()/12;break;case h:Q=Y();break;case f:Q=Y()/3;break;case u:Q=(P-A)/6048e5;break;case c:Q=(P-A)/864e5;break;case l:Q=P/i;break;case o:Q=P/n;break;case a:Q=P/r;break;default:Q=P}return H?Q:N.a(Q)},F.daysInMonth=function(){return this.endOf(h).$D},F.$locale=function(){return w[this.$L]},F.locale=function(L,B){if(!L)return this.$L;var H=this.clone(),Q=M(L,B,!0);return Q&&(H.$L=Q),H},F.clone=function(){return N.w(this.$d,this)},F.toDate=function(){return new Date(this.valueOf())},F.toJSON=function(){return this.isValid()?this.toISOString():null},F.toISOString=function(){return this.$d.toISOString()},F.toString=function(){return this.$d.toUTCString()},I})(),R=D.prototype;return E.prototype=R,[["$ms",s],["$s",a],["$m",o],["$H",l],["$W",c],["$M",h],["$y",d],["$D",g]].forEach((function(I){R[I[1]]=function(F){return this.$g(F,I[0],I[1])}})),E.extend=function(I,F){return I.$i||(I(F,D,E),I.$i=!0),E},E.locale=M,E.isDayjs=$,E.unix=function(I){return E(1e3*I)},E.en=w[S],E.Ls=w,E.p={},E}))})(Ta)),Ta.exports}var IE=LE();const $E=_u(IE);var bm=Object.defineProperty,x=(e,t)=>bm(e,"name",{value:t,configurable:!0}),jE=(e,t)=>{for(var r in t)bm(e,r,{get:t[r],enumerable:!0})},Lr={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},X={trace:x((...e)=>{},"trace"),debug:x((...e)=>{},"debug"),info:x((...e)=>{},"info"),warn:x((...e)=>{},"warn"),error:x((...e)=>{},"error"),fatal:x((...e)=>{},"fatal")},Gu=x(function(e="fatal"){let t=Lr.fatal;typeof e=="string"?e.toLowerCase()in Lr&&(t=Lr[e]):typeof e=="number"&&(t=e),X.trace=()=>{},X.debug=()=>{},X.info=()=>{},X.warn=()=>{},X.error=()=>{},X.fatal=()=>{},t<=Lr.fatal&&(X.fatal=console.error?console.error.bind(console,Zt("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Zt("FATAL"))),t<=Lr.error&&(X.error=console.error?console.error.bind(console,Zt("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Zt("ERROR"))),t<=Lr.warn&&(X.warn=console.warn?console.warn.bind(console,Zt("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Zt("WARN"))),t<=Lr.info&&(X.info=console.info?console.info.bind(console,Zt("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Zt("INFO"))),t<=Lr.debug&&(X.debug=console.debug?console.debug.bind(console,Zt("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Zt("DEBUG"))),t<=Lr.trace&&(X.trace=console.debug?console.debug.bind(console,Zt("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Zt("TRACE")))},"setLogLevel"),Zt=x(e=>`%c${$E().format("ss.SSS")} : ${e} : `,"format");const Ea={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),hsl2rgb:({h:e,s:t,l:r},n)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;const i=r<.5?r*(1+t):r+t-r*t,s=2*r-i;switch(n){case"r":return Ea.hue2rgb(s,i,e+1/3)*255;case"g":return Ea.hue2rgb(s,i,e)*255;case"b":return Ea.hue2rgb(s,i,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},n)=>{e/=255,t/=255,r/=255;const i=Math.max(e,t,r),s=Math.min(e,t,r),a=(i+s)/2;if(n==="l")return a*100;if(i===s)return 0;const o=i-s,l=a>.5?o/(2-i-s):o/(i+s);if(n==="s")return l*100;switch(i){case e:return((t-r)/o+(t<r?6:0))*60;case t:return((r-e)/o+2)*60;case r:return((e-t)/o+4)*60;default:return-1}}},BE={clamp:(e,t,r)=>t>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},DE={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},ke={channel:Ea,lang:BE,unit:DE},Xr={};for(let e=0;e<=255;e++)Xr[e]=ke.unit.dec2hex(e);const wt={ALL:0,RGB:1,HSL:2};class PE{constructor(){this.type=wt.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=wt.ALL}is(t){return this.type===t}}class FE{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new PE}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=wt.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:n,l:i}=t;r===void 0&&(t.h=ke.channel.rgb2hsl(t,"h")),n===void 0&&(t.s=ke.channel.rgb2hsl(t,"s")),i===void 0&&(t.l=ke.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:n,b:i}=t;r===void 0&&(t.r=ke.channel.hsl2rgb(t,"r")),n===void 0&&(t.g=ke.channel.hsl2rgb(t,"g")),i===void 0&&(t.b=ke.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(wt.HSL)&&r!==void 0?r:(this._ensureHSL(),ke.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(wt.HSL)&&r!==void 0?r:(this._ensureHSL(),ke.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(wt.HSL)&&r!==void 0?r:(this._ensureHSL(),ke.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(wt.RGB)&&r!==void 0?r:(this._ensureRGB(),ke.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(wt.RGB)&&r!==void 0?r:(this._ensureRGB(),ke.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(wt.RGB)&&r!==void 0?r:(this._ensureRGB(),ke.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(wt.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(wt.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(wt.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(wt.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(wt.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(wt.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const Bo=new FE({r:0,g:0,b:0,a:0},"transparent"),Jn={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(Jn.re);if(!t)return;const r=t[1],n=parseInt(r,16),i=r.length,s=i%4===0,a=i>4,o=a?1:17,l=a?8:4,c=s?0:-1,u=a?255:15;return Bo.set({r:(n>>l*(c+3)&u)*o,g:(n>>l*(c+2)&u)*o,b:(n>>l*(c+1)&u)*o,a:s?(n&u)*o/255:1},e)},stringify:e=>{const{r:t,g:r,b:n,a:i}=e;return i<1?`#${Xr[Math.round(t)]}${Xr[Math.round(r)]}${Xr[Math.round(n)]}${Xr[Math.round(i*255)]}`:`#${Xr[Math.round(t)]}${Xr[Math.round(r)]}${Xr[Math.round(n)]}`}},wn={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{const t=e.match(wn.hueRe);if(t){const[,r,n]=t;switch(n){case"grad":return ke.channel.clamp.h(parseFloat(r)*.9);case"rad":return ke.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return ke.channel.clamp.h(parseFloat(r)*360)}}return ke.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(wn.re);if(!r)return;const[,n,i,s,a,o]=r;return Bo.set({h:wn._hue2deg(n),s:ke.channel.clamp.s(parseFloat(i)),l:ke.channel.clamp.l(parseFloat(s)),a:a?ke.channel.clamp.a(o?parseFloat(a)/100:parseFloat(a)):1},e)},stringify:e=>{const{h:t,s:r,l:n,a:i}=e;return i<1?`hsla(${ke.lang.round(t)}, ${ke.lang.round(r)}%, ${ke.lang.round(n)}%, ${i})`:`hsl(${ke.lang.round(t)}, ${ke.lang.round(r)}%, ${ke.lang.round(n)}%)`}},ps={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:e=>{e=e.toLowerCase();const t=ps.colors[e];if(t)return Jn.parse(t)},stringify:e=>{const t=Jn.stringify(e);for(const r in ps.colors)if(ps.colors[r]===t)return r}},ts={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const r=e.match(ts.re);if(!r)return;const[,n,i,s,a,o,l,c,u]=r;return Bo.set({r:ke.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:ke.channel.clamp.g(a?parseFloat(s)*2.55:parseFloat(s)),b:ke.channel.clamp.b(l?parseFloat(o)*2.55:parseFloat(o)),a:c?ke.channel.clamp.a(u?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:n,a:i}=e;return i<1?`rgba(${ke.lang.round(t)}, ${ke.lang.round(r)}, ${ke.lang.round(n)}, ${ke.lang.round(i)})`:`rgb(${ke.lang.round(t)}, ${ke.lang.round(r)}, ${ke.lang.round(n)})`}},vr={format:{keyword:ps,hex:Jn,rgb:ts,rgba:ts,hsl:wn,hsla:wn},parse:e=>{if(typeof e!="string")return e;const t=Jn.parse(e)||ts.parse(e)||wn.parse(e)||ps.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(wt.HSL)||e.data.r===void 0?wn.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?ts.stringify(e):Jn.stringify(e)},km=(e,t)=>{const r=vr.parse(e);for(const n in t)r[n]=ke.channel.clamp[n](t[n]);return vr.stringify(r)},gs=(e,t,r=0,n=1)=>{if(typeof e!="number")return km(e,{a:t});const i=Bo.set({r:ke.channel.clamp.r(e),g:ke.channel.clamp.g(t),b:ke.channel.clamp.b(r),a:ke.channel.clamp.a(n)});return vr.stringify(i)},RE=e=>{const{r:t,g:r,b:n}=vr.parse(e),i=.2126*ke.channel.toLinear(t)+.7152*ke.channel.toLinear(r)+.0722*ke.channel.toLinear(n);return ke.lang.round(i)},OE=e=>RE(e)>=.5,Ws=e=>!OE(e),wm=(e,t,r)=>{const n=vr.parse(e),i=n[t],s=ke.channel.clamp[t](i+r);return i!==s&&(n[t]=s),vr.stringify(n)},ae=(e,t)=>wm(e,"l",t),fe=(e,t)=>wm(e,"l",-t),W=(e,t)=>{const r=vr.parse(e),n={};for(const i in t)t[i]&&(n[i]=r[i]+t[i]);return km(e,n)},zE=(e,t,r=50)=>{const{r:n,g:i,b:s,a}=vr.parse(e),{r:o,g:l,b:c,a:u}=vr.parse(t),h=r/100,f=h*2-1,d=a-u,m=((f*d===-1?f:(f+d)/(1+f*d))+1)/2,b=1-m,y=n*m+o*b,k=i*m+l*b,v=s*m+c*b,C=a*h+u*(1-h);return gs(y,k,v,C)},ne=(e,t=100)=>{const r=vr.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,zE(r,e,t)};/*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */const{entries:vm,setPrototypeOf:rf,isFrozen:HE,getPrototypeOf:WE,getOwnPropertyDescriptor:qE}=Object;let{freeze:Pt,seal:er,create:kc}=Object,{apply:wc,construct:vc}=typeof Reflect<"u"&&Reflect;Pt||(Pt=function(t){return t});er||(er=function(t){return t});wc||(wc=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s];return t.apply(r,i)});vc||(vc=function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return new t(...n)});const la=Ft(Array.prototype.forEach),UE=Ft(Array.prototype.lastIndexOf),nf=Ft(Array.prototype.pop),Hi=Ft(Array.prototype.push),VE=Ft(Array.prototype.splice),Aa=Ft(String.prototype.toLowerCase),Il=Ft(String.prototype.toString),$l=Ft(String.prototype.match),Wi=Ft(String.prototype.replace),GE=Ft(String.prototype.indexOf),YE=Ft(String.prototype.trim),sr=Ft(Object.prototype.hasOwnProperty),It=Ft(RegExp.prototype.test),qi=XE(TypeError);function Ft(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return wc(e,t,n)}}function XE(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return vc(e,r)}}function Ae(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Aa;rf&&rf(e,null);let n=t.length;for(;n--;){let i=t[n];if(typeof i=="string"){const s=r(i);s!==i&&(HE(t)||(t[n]=s),i=s)}e[i]=!0}return e}function QE(e){for(let t=0;t<e.length;t++)sr(e,t)||(e[t]=null);return e}function jr(e){const t=kc(null);for(const[r,n]of vm(e))sr(e,r)&&(Array.isArray(n)?t[r]=QE(n):n&&typeof n=="object"&&n.constructor===Object?t[r]=jr(n):t[r]=n);return t}function Ui(e,t){for(;e!==null;){const n=qE(e,t);if(n){if(n.get)return Ft(n.get);if(typeof n.value=="function")return Ft(n.value)}e=WE(e)}function r(){return null}return r}const sf=Pt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),jl=Pt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Bl=Pt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),KE=Pt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Dl=Pt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ZE=Pt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),af=Pt(["#text"]),of=Pt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Pl=Pt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),lf=Pt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ca=Pt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),JE=er(/\{\{[\w\W]*|[\w\W]*\}\}/gm),eA=er(/<%[\w\W]*|[\w\W]*%>/gm),tA=er(/\$\{[\w\W]*/gm),rA=er(/^data-[\-\w.\u00B7-\uFFFF]+$/),nA=er(/^aria-[\-\w]+$/),Cm=er(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),iA=er(/^(?:\w+script|data):/i),sA=er(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Sm=er(/^html$/i),aA=er(/^[a-z][.\w]*(-[.\w]+)+$/i);var cf=Object.freeze({__proto__:null,ARIA_ATTR:nA,ATTR_WHITESPACE:sA,CUSTOM_ELEMENT:aA,DATA_ATTR:rA,DOCTYPE_NAME:Sm,ERB_EXPR:eA,IS_ALLOWED_URI:Cm,IS_SCRIPT_OR_DATA:iA,MUSTACHE_EXPR:JE,TMPLIT_EXPR:tA});const Vi={element:1,text:3,progressingInstruction:7,comment:8,document:9},oA=function(){return typeof window>"u"?null:window},lA=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const s="dompurify"+(n?"#"+n:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},uf=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function _m(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:oA();const t=he=>_m(he);if(t.version="3.3.0",t.removed=[],!e||!e.document||e.document.nodeType!==Vi.document||!e.Element)return t.isSupported=!1,t;let{document:r}=e;const n=r,i=n.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:o,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:f,trustedTypes:d}=e,g=l.prototype,m=Ui(g,"cloneNode"),b=Ui(g,"remove"),y=Ui(g,"nextSibling"),k=Ui(g,"childNodes"),v=Ui(g,"parentNode");if(typeof a=="function"){const he=r.createElement("template");he.content&&he.content.ownerDocument&&(r=he.content.ownerDocument)}let C,S="";const{implementation:w,createNodeIterator:T,createDocumentFragment:$,getElementsByTagName:M}=r,{importNode:E}=n;let N=uf();t.isSupported=typeof vm=="function"&&typeof v=="function"&&w&&w.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:D,ERB_EXPR:R,TMPLIT_EXPR:I,DATA_ATTR:F,ARIA_ATTR:L,IS_SCRIPT_OR_DATA:B,ATTR_WHITESPACE:H,CUSTOM_ELEMENT:Q}=cf;let{IS_ALLOWED_URI:_}=cf,j=null;const te=Ae({},[...sf,...jl,...Bl,...Dl,...af]);let A=null;const P=Ae({},[...of,...Pl,...lf,...ca]);let Y=Object.seal(kc(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),U=null,q=null;const V=Object.seal(kc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let K=!0,re=!0,ye=!1,_e=!0,ve=!1,Le=!0,Oe=!1,Mt=!1,it=!1,yt=!1,Nt=!1,Ee=!1,st=!0,ft=!1;const ze="user-content-";let Lt=!0,gt=!1,G={},J=null;const me=Ae({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Se=null;const Ie=Ae({},["audio","video","img","source","image","track"]);let tt=null;const Be=Ae({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),We="http://www.w3.org/1998/Math/MathML",at="http://www.w3.org/2000/svg",ot="http://www.w3.org/1999/xhtml";let Ke=ot,Kt=!1,bt=null;const Js=Ae({},[We,at,ot],Il);let hn=Ae({},["mi","mo","mn","ms","mtext"]),Ar=Ae({},["annotation-xml"]);const ea=Ae({},["title","style","font","a","script"]);let dn=null;const ul=["application/xhtml+xml","text/html"],Mi="text/html";let Ze=null,qr=null;const Ni=r.createElement("form"),fn=function(z){return z instanceof RegExp||z instanceof Function},pn=function(){let z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(qr&&qr===z)){if((!z||typeof z!="object")&&(z={}),z=jr(z),dn=ul.indexOf(z.PARSER_MEDIA_TYPE)===-1?Mi:z.PARSER_MEDIA_TYPE,Ze=dn==="application/xhtml+xml"?Il:Aa,j=sr(z,"ALLOWED_TAGS")?Ae({},z.ALLOWED_TAGS,Ze):te,A=sr(z,"ALLOWED_ATTR")?Ae({},z.ALLOWED_ATTR,Ze):P,bt=sr(z,"ALLOWED_NAMESPACES")?Ae({},z.ALLOWED_NAMESPACES,Il):Js,tt=sr(z,"ADD_URI_SAFE_ATTR")?Ae(jr(Be),z.ADD_URI_SAFE_ATTR,Ze):Be,Se=sr(z,"ADD_DATA_URI_TAGS")?Ae(jr(Ie),z.ADD_DATA_URI_TAGS,Ze):Ie,J=sr(z,"FORBID_CONTENTS")?Ae({},z.FORBID_CONTENTS,Ze):me,U=sr(z,"FORBID_TAGS")?Ae({},z.FORBID_TAGS,Ze):jr({}),q=sr(z,"FORBID_ATTR")?Ae({},z.FORBID_ATTR,Ze):jr({}),G=sr(z,"USE_PROFILES")?z.USE_PROFILES:!1,K=z.ALLOW_ARIA_ATTR!==!1,re=z.ALLOW_DATA_ATTR!==!1,ye=z.ALLOW_UNKNOWN_PROTOCOLS||!1,_e=z.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ve=z.SAFE_FOR_TEMPLATES||!1,Le=z.SAFE_FOR_XML!==!1,Oe=z.WHOLE_DOCUMENT||!1,yt=z.RETURN_DOM||!1,Nt=z.RETURN_DOM_FRAGMENT||!1,Ee=z.RETURN_TRUSTED_TYPE||!1,it=z.FORCE_BODY||!1,st=z.SANITIZE_DOM!==!1,ft=z.SANITIZE_NAMED_PROPS||!1,Lt=z.KEEP_CONTENT!==!1,gt=z.IN_PLACE||!1,_=z.ALLOWED_URI_REGEXP||Cm,Ke=z.NAMESPACE||ot,hn=z.MATHML_TEXT_INTEGRATION_POINTS||hn,Ar=z.HTML_INTEGRATION_POINTS||Ar,Y=z.CUSTOM_ELEMENT_HANDLING||{},z.CUSTOM_ELEMENT_HANDLING&&fn(z.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Y.tagNameCheck=z.CUSTOM_ELEMENT_HANDLING.tagNameCheck),z.CUSTOM_ELEMENT_HANDLING&&fn(z.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Y.attributeNameCheck=z.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),z.CUSTOM_ELEMENT_HANDLING&&typeof z.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Y.allowCustomizedBuiltInElements=z.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ve&&(re=!1),Nt&&(yt=!0),G&&(j=Ae({},af),A=[],G.html===!0&&(Ae(j,sf),Ae(A,of)),G.svg===!0&&(Ae(j,jl),Ae(A,Pl),Ae(A,ca)),G.svgFilters===!0&&(Ae(j,Bl),Ae(A,Pl),Ae(A,ca)),G.mathMl===!0&&(Ae(j,Dl),Ae(A,lf),Ae(A,ca))),z.ADD_TAGS&&(typeof z.ADD_TAGS=="function"?V.tagCheck=z.ADD_TAGS:(j===te&&(j=jr(j)),Ae(j,z.ADD_TAGS,Ze))),z.ADD_ATTR&&(typeof z.ADD_ATTR=="function"?V.attributeCheck=z.ADD_ATTR:(A===P&&(A=jr(A)),Ae(A,z.ADD_ATTR,Ze))),z.ADD_URI_SAFE_ATTR&&Ae(tt,z.ADD_URI_SAFE_ATTR,Ze),z.FORBID_CONTENTS&&(J===me&&(J=jr(J)),Ae(J,z.FORBID_CONTENTS,Ze)),Lt&&(j["#text"]=!0),Oe&&Ae(j,["html","head","body"]),j.table&&(Ae(j,["tbody"]),delete U.tbody),z.TRUSTED_TYPES_POLICY){if(typeof z.TRUSTED_TYPES_POLICY.createHTML!="function")throw qi('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof z.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw qi('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=z.TRUSTED_TYPES_POLICY,S=C.createHTML("")}else C===void 0&&(C=lA(d,i)),C!==null&&typeof S=="string"&&(S=C.createHTML(""));Pt&&Pt(z),qr=z}},Li=Ae({},[...jl,...Bl,...KE]),Ii=Ae({},[...Dl,...ZE]),hl=function(z){let Z=v(z);(!Z||!Z.tagName)&&(Z={namespaceURI:Ke,tagName:"template"});const se=Aa(z.tagName),qe=Aa(Z.tagName);return bt[z.namespaceURI]?z.namespaceURI===at?Z.namespaceURI===ot?se==="svg":Z.namespaceURI===We?se==="svg"&&(qe==="annotation-xml"||hn[qe]):!!Li[se]:z.namespaceURI===We?Z.namespaceURI===ot?se==="math":Z.namespaceURI===at?se==="math"&&Ar[qe]:!!Ii[se]:z.namespaceURI===ot?Z.namespaceURI===at&&!Ar[qe]||Z.namespaceURI===We&&!hn[qe]?!1:!Ii[se]&&(ea[se]||!Li[se]):!!(dn==="application/xhtml+xml"&&bt[z.namespaceURI]):!1},Vt=function(z){Hi(t.removed,{element:z});try{v(z).removeChild(z)}catch{b(z)}},pr=function(z,Z){try{Hi(t.removed,{attribute:Z.getAttributeNode(z),from:Z})}catch{Hi(t.removed,{attribute:null,from:Z})}if(Z.removeAttribute(z),z==="is")if(yt||Nt)try{Vt(Z)}catch{}else try{Z.setAttribute(z,"")}catch{}},$i=function(z){let Z=null,se=null;if(it)z="<remove></remove>"+z;else{const Je=$l(z,/^[\r\n\t ]+/);se=Je&&Je[0]}dn==="application/xhtml+xml"&&Ke===ot&&(z='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+z+"</body></html>");const qe=C?C.createHTML(z):z;if(Ke===ot)try{Z=new f().parseFromString(qe,dn)}catch{}if(!Z||!Z.documentElement){Z=w.createDocument(Ke,"template",null);try{Z.documentElement.innerHTML=Kt?S:qe}catch{}}const pt=Z.body||Z.documentElement;return z&&se&&pt.insertBefore(r.createTextNode(se),pt.childNodes[0]||null),Ke===ot?M.call(Z,Oe?"html":"body")[0]:Oe?Z.documentElement:pt},Ur=function(z){return T.call(z.ownerDocument||z,z,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Mr=function(z){return z instanceof h&&(typeof z.nodeName!="string"||typeof z.textContent!="string"||typeof z.removeChild!="function"||!(z.attributes instanceof u)||typeof z.removeAttribute!="function"||typeof z.setAttribute!="function"||typeof z.namespaceURI!="string"||typeof z.insertBefore!="function"||typeof z.hasChildNodes!="function")},ta=function(z){return typeof o=="function"&&z instanceof o};function nr(he,z,Z){la(he,se=>{se.call(t,z,Z,qr)})}const ra=function(z){let Z=null;if(nr(N.beforeSanitizeElements,z,null),Mr(z))return Vt(z),!0;const se=Ze(z.nodeName);if(nr(N.uponSanitizeElement,z,{tagName:se,allowedTags:j}),Le&&z.hasChildNodes()&&!ta(z.firstElementChild)&&It(/<[/\w!]/g,z.innerHTML)&&It(/<[/\w!]/g,z.textContent)||z.nodeType===Vi.progressingInstruction||Le&&z.nodeType===Vi.comment&&It(/<[/\w]/g,z.data))return Vt(z),!0;if(!(V.tagCheck instanceof Function&&V.tagCheck(se))&&(!j[se]||U[se])){if(!U[se]&&ji(se)&&(Y.tagNameCheck instanceof RegExp&&It(Y.tagNameCheck,se)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(se)))return!1;if(Lt&&!J[se]){const qe=v(z)||z.parentNode,pt=k(z)||z.childNodes;if(pt&&qe){const Je=pt.length;for(let kt=Je-1;kt>=0;--kt){const ir=m(pt[kt],!0);ir.__removalCount=(z.__removalCount||0)+1,qe.insertBefore(ir,y(z))}}}return Vt(z),!0}return z instanceof l&&!hl(z)||(se==="noscript"||se==="noembed"||se==="noframes")&&It(/<\/no(script|embed|frames)/i,z.innerHTML)?(Vt(z),!0):(ve&&z.nodeType===Vi.text&&(Z=z.textContent,la([D,R,I],qe=>{Z=Wi(Z,qe," ")}),z.textContent!==Z&&(Hi(t.removed,{element:z.cloneNode()}),z.textContent=Z)),nr(N.afterSanitizeElements,z,null),!1)},Wn=function(z,Z,se){if(st&&(Z==="id"||Z==="name")&&(se in r||se in Ni))return!1;if(!(re&&!q[Z]&&It(F,Z))){if(!(K&&It(L,Z))){if(!(V.attributeCheck instanceof Function&&V.attributeCheck(Z,z))){if(!A[Z]||q[Z]){if(!(ji(z)&&(Y.tagNameCheck instanceof RegExp&&It(Y.tagNameCheck,z)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(z))&&(Y.attributeNameCheck instanceof RegExp&&It(Y.attributeNameCheck,Z)||Y.attributeNameCheck instanceof Function&&Y.attributeNameCheck(Z,z))||Z==="is"&&Y.allowCustomizedBuiltInElements&&(Y.tagNameCheck instanceof RegExp&&It(Y.tagNameCheck,se)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(se))))return!1}else if(!tt[Z]){if(!It(_,Wi(se,H,""))){if(!((Z==="src"||Z==="xlink:href"||Z==="href")&&z!=="script"&&GE(se,"data:")===0&&Se[z])){if(!(ye&&!It(B,Wi(se,H,"")))){if(se)return!1}}}}}}}return!0},ji=function(z){return z!=="annotation-xml"&&$l(z,Q)},gn=function(z){nr(N.beforeSanitizeAttributes,z,null);const{attributes:Z}=z;if(!Z||Mr(z))return;const se={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:A,forceKeepAttr:void 0};let qe=Z.length;for(;qe--;){const pt=Z[qe],{name:Je,namespaceURI:kt,value:ir}=pt,Vr=Ze(Je),Bi=ir;let lt=Je==="value"?Bi:YE(Bi);if(se.attrName=Vr,se.attrValue=lt,se.keepAttr=!0,se.forceKeepAttr=void 0,nr(N.uponSanitizeAttribute,z,se),lt=se.attrValue,ft&&(Vr==="id"||Vr==="name")&&(pr(Je,z),lt=ze+lt),Le&&It(/((--!?|])>)|<\/(style|title|textarea)/i,lt)){pr(Je,z);continue}if(Vr==="attributename"&&$l(lt,"href")){pr(Je,z);continue}if(se.forceKeepAttr)continue;if(!se.keepAttr){pr(Je,z);continue}if(!_e&&It(/\/>/i,lt)){pr(Je,z);continue}ve&&la([D,R,I],Pi=>{lt=Wi(lt,Pi," ")});const Di=Ze(z.nodeName);if(!Wn(Di,Vr,lt)){pr(Je,z);continue}if(C&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!kt)switch(d.getAttributeType(Di,Vr)){case"TrustedHTML":{lt=C.createHTML(lt);break}case"TrustedScriptURL":{lt=C.createScriptURL(lt);break}}if(lt!==Bi)try{kt?z.setAttributeNS(kt,Je,lt):z.setAttribute(Je,lt),Mr(z)?Vt(z):nf(t.removed)}catch{pr(Je,z)}}nr(N.afterSanitizeAttributes,z,null)},dl=function he(z){let Z=null;const se=Ur(z);for(nr(N.beforeSanitizeShadowDOM,z,null);Z=se.nextNode();)nr(N.uponSanitizeShadowNode,Z,null),ra(Z),gn(Z),Z.content instanceof s&&he(Z.content);nr(N.afterSanitizeShadowDOM,z,null)};return t.sanitize=function(he){let z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Z=null,se=null,qe=null,pt=null;if(Kt=!he,Kt&&(he="<!-->"),typeof he!="string"&&!ta(he))if(typeof he.toString=="function"){if(he=he.toString(),typeof he!="string")throw qi("dirty is not a string, aborting")}else throw qi("toString is not a function");if(!t.isSupported)return he;if(Mt||pn(z),t.removed=[],typeof he=="string"&&(gt=!1),gt){if(he.nodeName){const ir=Ze(he.nodeName);if(!j[ir]||U[ir])throw qi("root node is forbidden and cannot be sanitized in-place")}}else if(he instanceof o)Z=$i("<!---->"),se=Z.ownerDocument.importNode(he,!0),se.nodeType===Vi.element&&se.nodeName==="BODY"||se.nodeName==="HTML"?Z=se:Z.appendChild(se);else{if(!yt&&!ve&&!Oe&&he.indexOf("<")===-1)return C&&Ee?C.createHTML(he):he;if(Z=$i(he),!Z)return yt?null:Ee?S:""}Z&&it&&Vt(Z.firstChild);const Je=Ur(gt?he:Z);for(;qe=Je.nextNode();)ra(qe),gn(qe),qe.content instanceof s&&dl(qe.content);if(gt)return he;if(yt){if(Nt)for(pt=$.call(Z.ownerDocument);Z.firstChild;)pt.appendChild(Z.firstChild);else pt=Z;return(A.shadowroot||A.shadowrootmode)&&(pt=E.call(n,pt,!0)),pt}let kt=Oe?Z.outerHTML:Z.innerHTML;return Oe&&j["!doctype"]&&Z.ownerDocument&&Z.ownerDocument.doctype&&Z.ownerDocument.doctype.name&&It(Sm,Z.ownerDocument.doctype.name)&&(kt="<!DOCTYPE "+Z.ownerDocument.doctype.name+`>
106
+ `+kt),ve&&la([D,R,I],ir=>{kt=Wi(kt,ir," ")}),C&&Ee?C.createHTML(kt):kt},t.setConfig=function(){let he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};pn(he),Mt=!0},t.clearConfig=function(){qr=null,Mt=!1},t.isValidAttribute=function(he,z,Z){qr||pn({});const se=Ze(he),qe=Ze(z);return Wn(se,qe,Z)},t.addHook=function(he,z){typeof z=="function"&&Hi(N[he],z)},t.removeHook=function(he,z){if(z!==void 0){const Z=UE(N[he],z);return Z===-1?void 0:VE(N[he],Z,1)[0]}return nf(N[he])},t.removeHooks=function(he){N[he]=[]},t.removeAllHooks=function(){N=uf()},t}var di=_m(),Tm=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,ms=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,cA=/\s*%%.*\n/gm,ri,Em=(ri=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},x(ri,"UnknownDiagramError"),ri),Nn={},Yu=x(function(e,t){e=e.replace(Tm,"").replace(ms,"").replace(cA,`
107
+ `);for(const[r,{detector:n}]of Object.entries(Nn))if(n(e,t))return r;throw new Em(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),Cc=x((...e)=>{for(const{id:t,detector:r,loader:n}of e)Am(t,r,n)},"registerLazyLoadedDiagrams"),Am=x((e,t,r)=>{Nn[e]&&X.warn(`Detector with key ${e} already exists. Overwriting.`),Nn[e]={detector:t,loader:r},X.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),uA=x(e=>Nn[e].loader,"getDiagramLoader"),Sc=x((e,t,{depth:r=2,clobber:n=!1}={})=>{const i={depth:r,clobber:n};return Array.isArray(t)&&!Array.isArray(e)?(t.forEach(s=>Sc(e,s,i)),e):Array.isArray(t)&&Array.isArray(e)?(t.forEach(s=>{e.includes(s)||e.push(s)}),e):e===void 0||r<=0?e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t:(t!==void 0&&typeof e=="object"&&typeof t=="object"&&Object.keys(t).forEach(s=>{typeof t[s]=="object"&&(e[s]===void 0||typeof e[s]=="object")?(e[s]===void 0&&(e[s]=Array.isArray(t[s])?[]:{}),e[s]=Sc(e[s],t[s],{depth:r-1,clobber:n})):(n||typeof e[s]!="object"&&typeof t[s]!="object")&&(e[s]=t[s])}),e)},"assignWithDepth"),ut=Sc,Do="#ffffff",Po="#f2f2f2",jt=x((e,t)=>t?W(e,{s:-40,l:10}):W(e,{s:-40,l:-10}),"mkBorder"),ni,hA=(ni=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||W(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||W(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||jt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||jt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||jt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||jt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||ne(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||ne(this.tertiaryColor),this.lineColor=this.lineColor||ne(this.background),this.arrowheadColor=this.arrowheadColor||ne(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?fe(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||fe(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||ne(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||ae(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||fe(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||fe(this.mainBkg,10)):(this.rowOdd=this.rowOdd||ae(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||ae(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||W(this.primaryColor,{h:30}),this.cScale4=this.cScale4||W(this.primaryColor,{h:60}),this.cScale5=this.cScale5||W(this.primaryColor,{h:90}),this.cScale6=this.cScale6||W(this.primaryColor,{h:120}),this.cScale7=this.cScale7||W(this.primaryColor,{h:150}),this.cScale8=this.cScale8||W(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||W(this.primaryColor,{h:270}),this.cScale10=this.cScale10||W(this.primaryColor,{h:300}),this.cScale11=this.cScale11||W(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=fe(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=fe(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||ne(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||ae(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||fe(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||W(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||W(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||W(this.primaryColor,{h:64}),this.fillType3=this.fillType3||W(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||W(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||W(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||W(this.primaryColor,{h:128}),this.fillType7=this.fillType7||W(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||W(this.primaryColor,{l:-10}),this.pie5=this.pie5||W(this.secondaryColor,{l:-10}),this.pie6=this.pie6||W(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||W(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||W(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||W(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||W(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||W(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||W(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.archEdgeColor=this.archEdgeColor||"#777",this.archEdgeArrowColor=this.archEdgeArrowColor||"#777",this.archEdgeWidth=this.archEdgeWidth||"3",this.archGroupBorderColor=this.archGroupBorderColor||"#000",this.archGroupBorderWidth=this.archGroupBorderWidth||"2px",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||W(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ws(this.quadrant1Fill)?ae(this.quadrant1Fill):fe(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?fe(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||W(this.primaryColor,{h:-30}),this.git4=this.git4||W(this.primaryColor,{h:-60}),this.git5=this.git5||W(this.primaryColor,{h:-90}),this.git6=this.git6||W(this.primaryColor,{h:60}),this.git7=this.git7||W(this.primaryColor,{h:120}),this.darkMode?(this.git0=ae(this.git0,25),this.git1=ae(this.git1,25),this.git2=ae(this.git2,25),this.git3=ae(this.git3,25),this.git4=ae(this.git4,25),this.git5=ae(this.git5,25),this.git6=ae(this.git6,25),this.git7=ae(this.git7,25)):(this.git0=fe(this.git0,25),this.git1=fe(this.git1,25),this.git2=fe(this.git2,25),this.git3=fe(this.git3,25),this.git4=fe(this.git4,25),this.git5=fe(this.git5,25),this.git6=fe(this.git6,25),this.git7=fe(this.git7,25)),this.gitInv0=this.gitInv0||ne(this.git0),this.gitInv1=this.gitInv1||ne(this.git1),this.gitInv2=this.gitInv2||ne(this.git2),this.gitInv3=this.gitInv3||ne(this.git3),this.gitInv4=this.gitInv4||ne(this.git4),this.gitInv5=this.gitInv5||ne(this.git5),this.gitInv6=this.gitInv6||ne(this.git6),this.gitInv7=this.gitInv7||ne(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Do,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Po}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(n=>{this[n]=t[n]}),this.updateColors(),r.forEach(n=>{this[n]=t[n]})}},x(ni,"Theme"),ni),dA=x(e=>{const t=new hA;return t.calculate(e),t},"getThemeVariables"),ii,fA=(ii=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=ae(this.primaryColor,16),this.tertiaryColor=W(this.primaryColor,{h:-160}),this.primaryBorderColor=ne(this.background),this.secondaryBorderColor=jt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=jt(this.tertiaryColor,this.darkMode),this.primaryTextColor=ne(this.primaryColor),this.secondaryTextColor=ne(this.secondaryColor),this.tertiaryTextColor=ne(this.tertiaryColor),this.lineColor=ne(this.background),this.textColor=ne(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=ae(ne("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=gs(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.sectionBkgColor=fe("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=fe(this.sectionBkgColor,10),this.taskBorderColor=gs(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=gs(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||ae(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||fe(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){this.secondBkg=ae(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=ae(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.altSectionBkgColor=this.background,this.taskBkgColor=ae(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=this.darkTextColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=W(this.primaryColor,{h:64}),this.fillType3=W(this.secondaryColor,{h:64}),this.fillType4=W(this.primaryColor,{h:-64}),this.fillType5=W(this.secondaryColor,{h:-64}),this.fillType6=W(this.primaryColor,{h:128}),this.fillType7=W(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||W(this.primaryColor,{h:30}),this.cScale4=this.cScale4||W(this.primaryColor,{h:60}),this.cScale5=this.cScale5||W(this.primaryColor,{h:90}),this.cScale6=this.cScale6||W(this.primaryColor,{h:120}),this.cScale7=this.cScale7||W(this.primaryColor,{h:150}),this.cScale8=this.cScale8||W(this.primaryColor,{h:210}),this.cScale9=this.cScale9||W(this.primaryColor,{h:270}),this.cScale10=this.cScale10||W(this.primaryColor,{h:300}),this.cScale11=this.cScale11||W(this.primaryColor,{h:330});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||ne(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScalePeer"+t]=this["cScalePeer"+t]||ae(this["cScale"+t],10);for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||W(this.mainBkg,{h:30,s:-30,l:-(-10+t*4)}),this["surfacePeer"+t]=this["surfacePeer"+t]||W(this.mainBkg,{h:30,s:-30,l:-(-7+t*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||W(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ws(this.quadrant1Fill)?ae(this.quadrant1Fill):fe(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"},this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.background},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?fe(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=ae(this.secondaryColor,20),this.git1=ae(this.pie2||this.secondaryColor,20),this.git2=ae(this.pie3||this.tertiaryColor,20),this.git3=ae(this.pie4||W(this.primaryColor,{h:-30}),20),this.git4=ae(this.pie5||W(this.primaryColor,{h:-60}),20),this.git5=ae(this.pie6||W(this.primaryColor,{h:-90}),10),this.git6=ae(this.pie7||W(this.primaryColor,{h:60}),10),this.git7=ae(this.pie8||W(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||ne(this.git0),this.gitInv1=this.gitInv1||ne(this.git1),this.gitInv2=this.gitInv2||ne(this.git2),this.gitInv3=this.gitInv3||ne(this.git3),this.gitInv4=this.gitInv4||ne(this.git4),this.gitInv5=this.gitInv5||ne(this.git5),this.gitInv6=this.gitInv6||ne(this.git6),this.gitInv7=this.gitInv7||ne(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||ne(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||ne(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||ae(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||ae(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(n=>{this[n]=t[n]}),this.updateColors(),r.forEach(n=>{this[n]=t[n]})}},x(ii,"Theme"),ii),pA=x(e=>{const t=new fA;return t.calculate(e),t},"getThemeVariables"),si,gA=(si=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=W(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=W(this.primaryColor,{h:-160}),this.primaryBorderColor=jt(this.primaryColor,this.darkMode),this.secondaryBorderColor=jt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=jt(this.tertiaryColor,this.darkMode),this.primaryTextColor=ne(this.primaryColor),this.secondaryTextColor=ne(this.secondaryColor),this.tertiaryTextColor=ne(this.tertiaryColor),this.lineColor=ne(this.background),this.textColor=ne(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=gs(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||W(this.primaryColor,{h:30}),this.cScale4=this.cScale4||W(this.primaryColor,{h:60}),this.cScale5=this.cScale5||W(this.primaryColor,{h:90}),this.cScale6=this.cScale6||W(this.primaryColor,{h:120}),this.cScale7=this.cScale7||W(this.primaryColor,{h:150}),this.cScale8=this.cScale8||W(this.primaryColor,{h:210}),this.cScale9=this.cScale9||W(this.primaryColor,{h:270}),this.cScale10=this.cScale10||W(this.primaryColor,{h:300}),this.cScale11=this.cScale11||W(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||fe(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||fe(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=fe(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||fe(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||W(this["cScale"+t],{h:180});for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||W(this.mainBkg,{h:30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||W(this.mainBkg,{h:30,l:-(7+t*5)});if(this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!=="calculated"){this.cScaleLabel0=this.cScaleLabel0||ne(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||ne(this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.actorBorder=ae(this.border1,23),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||ae(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||ae(this.primaryColor,1),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=W(this.primaryColor,{h:64}),this.fillType3=W(this.secondaryColor,{h:64}),this.fillType4=W(this.primaryColor,{h:-64}),this.fillType5=W(this.secondaryColor,{h:-64}),this.fillType6=W(this.primaryColor,{h:128}),this.fillType7=W(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||W(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||W(this.primaryColor,{l:-10}),this.pie5=this.pie5||W(this.secondaryColor,{l:-30}),this.pie6=this.pie6||W(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||W(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||W(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||W(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||W(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||W(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||W(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||W(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ws(this.quadrant1Fill)?ae(this.quadrant1Fill):fe(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||W(this.primaryColor,{h:-30}),this.git4=this.git4||W(this.primaryColor,{h:-60}),this.git5=this.git5||W(this.primaryColor,{h:-90}),this.git6=this.git6||W(this.primaryColor,{h:60}),this.git7=this.git7||W(this.primaryColor,{h:120}),this.darkMode?(this.git0=ae(this.git0,25),this.git1=ae(this.git1,25),this.git2=ae(this.git2,25),this.git3=ae(this.git3,25),this.git4=ae(this.git4,25),this.git5=ae(this.git5,25),this.git6=ae(this.git6,25),this.git7=ae(this.git7,25)):(this.git0=fe(this.git0,25),this.git1=fe(this.git1,25),this.git2=fe(this.git2,25),this.git3=fe(this.git3,25),this.git4=fe(this.git4,25),this.git5=fe(this.git5,25),this.git6=fe(this.git6,25),this.git7=fe(this.git7,25)),this.gitInv0=this.gitInv0||fe(ne(this.git0),25),this.gitInv1=this.gitInv1||ne(this.git1),this.gitInv2=this.gitInv2||ne(this.git2),this.gitInv3=this.gitInv3||ne(this.git3),this.gitInv4=this.gitInv4||ne(this.git4),this.gitInv5=this.gitInv5||ne(this.git5),this.gitInv6=this.gitInv6||ne(this.git6),this.gitInv7=this.gitInv7||ne(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||ne(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||ne(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Do,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Po}calculate(t){if(Object.keys(this).forEach(n=>{this[n]==="calculated"&&(this[n]=void 0)}),typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(n=>{this[n]=t[n]}),this.updateColors(),r.forEach(n=>{this[n]=t[n]})}},x(si,"Theme"),si),mA=x(e=>{const t=new gA;return t.calculate(e),t},"getThemeVariables"),ai,xA=(ai=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=ae("#cde498",10),this.primaryBorderColor=jt(this.primaryColor,this.darkMode),this.secondaryBorderColor=jt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=jt(this.tertiaryColor,this.darkMode),this.primaryTextColor=ne(this.primaryColor),this.secondaryTextColor=ne(this.secondaryColor),this.tertiaryTextColor=ne(this.primaryColor),this.lineColor=ne(this.background),this.textColor=ne(this.background),this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.actorBorder=fe(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||W(this.primaryColor,{h:30}),this.cScale4=this.cScale4||W(this.primaryColor,{h:60}),this.cScale5=this.cScale5||W(this.primaryColor,{h:90}),this.cScale6=this.cScale6||W(this.primaryColor,{h:120}),this.cScale7=this.cScale7||W(this.primaryColor,{h:150}),this.cScale8=this.cScale8||W(this.primaryColor,{h:210}),this.cScale9=this.cScale9||W(this.primaryColor,{h:270}),this.cScale10=this.cScale10||W(this.primaryColor,{h:300}),this.cScale11=this.cScale11||W(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||fe(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||fe(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=fe(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||fe(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||W(this["cScale"+t],{h:180});this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||W(this.mainBkg,{h:30,s:-30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||W(this.mainBkg,{h:30,s:-30,l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||ae(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||ae(this.mainBkg,20),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=W(this.primaryColor,{h:64}),this.fillType3=W(this.secondaryColor,{h:64}),this.fillType4=W(this.primaryColor,{h:-64}),this.fillType5=W(this.secondaryColor,{h:-64}),this.fillType6=W(this.primaryColor,{h:128}),this.fillType7=W(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||W(this.primaryColor,{l:-30}),this.pie5=this.pie5||W(this.secondaryColor,{l:-30}),this.pie6=this.pie6||W(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||W(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||W(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||W(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||W(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||W(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||W(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||W(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ws(this.quadrant1Fill)?ae(this.quadrant1Fill):fe(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.mainBkg},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||W(this.primaryColor,{h:-30}),this.git4=this.git4||W(this.primaryColor,{h:-60}),this.git5=this.git5||W(this.primaryColor,{h:-90}),this.git6=this.git6||W(this.primaryColor,{h:60}),this.git7=this.git7||W(this.primaryColor,{h:120}),this.darkMode?(this.git0=ae(this.git0,25),this.git1=ae(this.git1,25),this.git2=ae(this.git2,25),this.git3=ae(this.git3,25),this.git4=ae(this.git4,25),this.git5=ae(this.git5,25),this.git6=ae(this.git6,25),this.git7=ae(this.git7,25)):(this.git0=fe(this.git0,25),this.git1=fe(this.git1,25),this.git2=fe(this.git2,25),this.git3=fe(this.git3,25),this.git4=fe(this.git4,25),this.git5=fe(this.git5,25),this.git6=fe(this.git6,25),this.git7=fe(this.git7,25)),this.gitInv0=this.gitInv0||ne(this.git0),this.gitInv1=this.gitInv1||ne(this.git1),this.gitInv2=this.gitInv2||ne(this.git2),this.gitInv3=this.gitInv3||ne(this.git3),this.gitInv4=this.gitInv4||ne(this.git4),this.gitInv5=this.gitInv5||ne(this.git5),this.gitInv6=this.gitInv6||ne(this.git6),this.gitInv7=this.gitInv7||ne(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||ne(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||ne(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Do,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Po}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(n=>{this[n]=t[n]}),this.updateColors(),r.forEach(n=>{this[n]=t[n]})}},x(ai,"Theme"),ai),yA=x(e=>{const t=new xA;return t.calculate(e),t},"getThemeVariables"),oi,bA=(oi=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=ae(this.contrast,55),this.background="#ffffff",this.tertiaryColor=W(this.primaryColor,{h:-160}),this.primaryBorderColor=jt(this.primaryColor,this.darkMode),this.secondaryBorderColor=jt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=jt(this.tertiaryColor,this.darkMode),this.primaryTextColor=ne(this.primaryColor),this.secondaryTextColor=ne(this.secondaryColor),this.tertiaryTextColor=ne(this.tertiaryColor),this.lineColor=ne(this.background),this.textColor=ne(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||ae(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.secondBkg=ae(this.contrast,55),this.border2=this.contrast,this.actorBorder=ae(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||ne(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||ae(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||fe(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||W(this.mainBkg,{l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||W(this.mainBkg,{l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.sectionBkgColor=ae(this.contrast,30),this.sectionBkgColor2=ae(this.contrast,30),this.taskBorderColor=fe(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=ae(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=fe(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.vertLineColor=this.critBkgColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||"#000",this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=W(this.primaryColor,{h:64}),this.fillType3=W(this.secondaryColor,{h:64}),this.fillType4=W(this.primaryColor,{h:-64}),this.fillType5=W(this.secondaryColor,{h:-64}),this.fillType6=W(this.primaryColor,{h:128}),this.fillType7=W(this.secondaryColor,{h:128});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||W(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ws(this.quadrant1Fill)?ae(this.quadrant1Fill):fe(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=fe(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||W(this.primaryColor,{h:-30}),this.git4=this.pie5||W(this.primaryColor,{h:-60}),this.git5=this.pie6||W(this.primaryColor,{h:-90}),this.git6=this.pie7||W(this.primaryColor,{h:60}),this.git7=this.pie8||W(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||ne(this.git0),this.gitInv1=this.gitInv1||ne(this.git1),this.gitInv2=this.gitInv2||ne(this.git2),this.gitInv3=this.gitInv3||ne(this.git3),this.gitInv4=this.gitInv4||ne(this.git4),this.gitInv5=this.gitInv5||ne(this.git5),this.gitInv6=this.gitInv6||ne(this.git6),this.gitInv7=this.gitInv7||ne(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1="white",this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3="white",this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Do,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Po}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(n=>{this[n]=t[n]}),this.updateColors(),r.forEach(n=>{this[n]=t[n]})}},x(oi,"Theme"),oi),kA=x(e=>{const t=new bA;return t.calculate(e),t},"getThemeVariables"),Pr={base:{getThemeVariables:dA},dark:{getThemeVariables:pA},default:{getThemeVariables:mA},forest:{getThemeVariables:yA},neutral:{getThemeVariables:kA}},gr={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:!0,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:""},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},Mm={...gr,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:Pr.default.getThemeVariables(),sequence:{...gr.sequence,messageFont:x(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:x(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:x(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1},gantt:{...gr.gantt,tickInterval:void 0,useWidth:void 0},c4:{...gr.c4,useWidth:void 0,personFont:x(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...gr.flowchart,inheritDir:!1},external_personFont:x(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:x(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:x(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:x(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:x(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:x(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:x(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:x(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:x(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:x(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:x(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:x(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:x(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:x(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:x(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:x(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:x(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:x(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:x(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:x(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:x(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...gr.pie,useWidth:984},xyChart:{...gr.xyChart,useWidth:void 0},requirement:{...gr.requirement,useWidth:void 0},packet:{...gr.packet},radar:{...gr.radar},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","}},Nm=x((e,t="")=>Object.keys(e).reduce((r,n)=>Array.isArray(e[n])?r:typeof e[n]=="object"&&e[n]!==null?[...r,t+n,...Nm(e[n],"")]:[...r,t+n],[]),"keyify"),wA=new Set(Nm(Mm,"")),Lm=Mm,Ua=x(e=>{if(X.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>Ua(t));return}for(const t of Object.keys(e)){if(X.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!wA.has(t)||e[t]==null){X.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){X.debug("sanitizing object",t),Ua(e[t]);continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)t.includes(n)&&(X.debug("sanitizing css option",t),e[t]=vA(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const r=e.themeVariables[t];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}X.debug("After sanitization",e)}},"sanitizeDirective"),vA=x(e=>{let t=0,r=0;for(const n of e){if(t<r)return"{ /* ERROR: Unbalanced CSS */ }";n==="{"?t++:n==="}"&&r++}return t!==r?"{ /* ERROR: Unbalanced CSS */ }":e},"sanitizeCss"),fi=Object.freeze(Lm),Ht=ut({},fi),Va,Ln=[],xs=ut({},fi),Fo=x((e,t)=>{let r=ut({},e),n={};for(const i of t)jm(i),n=ut(n,i);if(r=ut(r,n),n.theme&&n.theme in Pr){const i=ut({},Va),s=ut(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in Pr&&(r.themeVariables=Pr[r.theme].getThemeVariables(s))}return xs=r,Bm(xs),xs},"updateCurrentConfig"),CA=x(e=>(Ht=ut({},fi),Ht=ut(Ht,e),e.theme&&Pr[e.theme]&&(Ht.themeVariables=Pr[e.theme].getThemeVariables(e.themeVariables)),Fo(Ht,Ln),Ht),"setSiteConfig"),SA=x(e=>{Va=ut({},e)},"saveConfigFromInitialize"),_A=x(e=>(Ht=ut(Ht,e),Fo(Ht,Ln),Ht),"updateSiteConfig"),Im=x(()=>ut({},Ht),"getSiteConfig"),$m=x(e=>(Bm(e),ut(xs,e),St()),"setConfig"),St=x(()=>ut({},xs),"getConfig"),jm=x(e=>{e&&(["secure",...Ht.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(X.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&jm(e[t])}))},"sanitize"),TA=x(e=>{Ua(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),Ln.push(e),Fo(Ht,Ln)},"addDirective"),Ga=x((e=Ht)=>{Ln=[],Fo(e,Ln)},"reset"),EA={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},hf={},AA=x(e=>{hf[e]||(X.warn(EA[e]),hf[e]=!0)},"issueWarning"),Bm=x(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&AA("LAZY_LOAD_DEPRECATED")},"checkConfig"),r6=x(()=>{let e={};Va&&(e=ut(e,Va));for(const t of Ln)e=ut(e,t);return e},"getUserDefinedConfig"),qs=/<br\s*\/?>/gi,MA=x(e=>e?Fm(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),NA=(()=>{let e=!1;return()=>{e||(Dm(),e=!0)}})();function Dm(){const e="data-temp-href-target";di.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),di.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}x(Dm,"setupDompurifyHooks");var Pm=x(e=>(NA(),di.sanitize(e)),"removeScript"),df=x((e,t)=>{if(t.flowchart?.htmlLabels!==!1){const r=t.securityLevel;r==="antiscript"||r==="strict"?e=Pm(e):r!=="loose"&&(e=Fm(e),e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=e.replace(/=/g,"&equals;"),e=jA(e))}return e},"sanitizeMore"),tr=x((e,t)=>e&&(t.dompurifyConfig?e=di.sanitize(df(e,t),t.dompurifyConfig).toString():e=di.sanitize(df(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),LA=x((e,t)=>typeof e=="string"?tr(e,t):e.flat().map(r=>tr(r,t)),"sanitizeTextOrArray"),IA=x(e=>qs.test(e),"hasBreaks"),$A=x(e=>e.split(qs),"splitBreaks"),jA=x(e=>e.replace(/#br#/g,"<br/>"),"placeholderToBreak"),Fm=x(e=>e.replace(qs,"#br#"),"breakToPlaceholder"),BA=x(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),dt=x(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),DA=x(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),PA=x(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),ff=x(function(e){const t=e.split(/(,)/),r=[];for(let n=0;n<t.length;n++){let i=t[n];if(i===","&&n>0&&n+1<t.length){const s=t[n-1],a=t[n+1];FA(s,a)&&(i=s+","+a,n++,r.pop())}r.push(RA(i))}return r.join("")},"parseGenericTypes"),_c=x((e,t)=>Math.max(0,e.split(t).length-1),"countOccurrence"),FA=x((e,t)=>{const r=_c(e,"~"),n=_c(t,"~");return r===1&&n===1},"shouldCombineSets"),RA=x(e=>{const t=_c(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const n=[...e];let i=n.indexOf("~"),s=n.lastIndexOf("~");for(;i!==-1&&s!==-1&&i!==s;)n[i]="<",n[s]=">",i=n.indexOf("~"),s=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")},"processSet"),pf=x(()=>window.MathMLElement!==void 0,"isMathMLSupported"),Tc=/\$\$(.*)\$\$/g,pi=x(e=>(e.match(Tc)?.length??0)>0,"hasKatex"),n6=x(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await Xu(e,t),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",r);const i={width:r.clientWidth,height:r.clientHeight};return r.remove(),i},"calculateMathMLDimensions"),OA=x(async(e,t)=>{if(!pi(e))return e;if(!(pf()||t.legacyMathML||t.forceLegacyMathML))return e.replace(Tc,"MathML is unsupported in this environment.");{const{default:r}=await Re(async()=>{const{default:i}=await import("./katex-qrhCpa0F.js");return{default:i}},[]),n=t.forceLegacyMathML||!pf()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(qs).map(i=>pi(i)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${i}</div>`:`<div>${i}</div>`).join("").replace(Tc,(i,s)=>r.renderToString(s,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),Xu=x(async(e,t)=>tr(await OA(e,t),t),"renderKatexSanitized"),Ci={getRows:MA,sanitizeText:tr,sanitizeTextOrArray:LA,hasBreaks:IA,splitBreaks:$A,lineBreakRegex:qs,removeScript:Pm,getUrl:BA,evaluate:dt,getMax:DA,getMin:PA},zA=x(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),HA=x(function(e,t,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${t}px;`)):(n.set("height",e),n.set("width",t)),n},"calculateSvgSizeAttrs"),Rm=x(function(e,t,r,n){const i=HA(t,r,n);zA(e,i)},"configureSvgSize"),WA=x(function(e,t,r,n){const i=t.node().getBBox(),s=i.width,a=i.height;X.info(`SVG bounds: ${s}x${a}`,i);let o=0,l=0;X.info(`Graph bounds: ${o}x${l}`,e),o=s+r*2,l=a+r*2,X.info(`Calculated bounds: ${o}x${l}`),Rm(t,l,o,n);const c=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),Ma={},qA=x((e,t,r)=>{let n="";return e in Ma&&Ma[e]?n=Ma[e](r):X.warn(`No theme found for ${e}`),` & {
108
+ font-family: ${r.fontFamily};
109
+ font-size: ${r.fontSize};
110
+ fill: ${r.textColor}
111
+ }
112
+ @keyframes edge-animation-frame {
113
+ from {
114
+ stroke-dashoffset: 0;
115
+ }
116
+ }
117
+ @keyframes dash {
118
+ to {
119
+ stroke-dashoffset: 0;
120
+ }
121
+ }
122
+ & .edge-animation-slow {
123
+ stroke-dasharray: 9,5 !important;
124
+ stroke-dashoffset: 900;
125
+ animation: dash 50s linear infinite;
126
+ stroke-linecap: round;
127
+ }
128
+ & .edge-animation-fast {
129
+ stroke-dasharray: 9,5 !important;
130
+ stroke-dashoffset: 900;
131
+ animation: dash 20s linear infinite;
132
+ stroke-linecap: round;
133
+ }
134
+ /* Classes common for multiple diagrams */
135
+
136
+ & .error-icon {
137
+ fill: ${r.errorBkgColor};
138
+ }
139
+ & .error-text {
140
+ fill: ${r.errorTextColor};
141
+ stroke: ${r.errorTextColor};
142
+ }
143
+
144
+ & .edge-thickness-normal {
145
+ stroke-width: 1px;
146
+ }
147
+ & .edge-thickness-thick {
148
+ stroke-width: 3.5px
149
+ }
150
+ & .edge-pattern-solid {
151
+ stroke-dasharray: 0;
152
+ }
153
+ & .edge-thickness-invisible {
154
+ stroke-width: 0;
155
+ fill: none;
156
+ }
157
+ & .edge-pattern-dashed{
158
+ stroke-dasharray: 3;
159
+ }
160
+ .edge-pattern-dotted {
161
+ stroke-dasharray: 2;
162
+ }
163
+
164
+ & .marker {
165
+ fill: ${r.lineColor};
166
+ stroke: ${r.lineColor};
167
+ }
168
+ & .marker.cross {
169
+ stroke: ${r.lineColor};
170
+ }
171
+
172
+ & svg {
173
+ font-family: ${r.fontFamily};
174
+ font-size: ${r.fontSize};
175
+ }
176
+ & p {
177
+ margin: 0
178
+ }
179
+
180
+ ${n}
181
+
182
+ ${t}
183
+ `},"getStyles"),UA=x((e,t)=>{t!==void 0&&(Ma[e]=t)},"addStylesForDiagram"),VA=qA,Om={};jE(Om,{clear:()=>GA,getAccDescription:()=>KA,getAccTitle:()=>XA,getDiagramTitle:()=>JA,setAccDescription:()=>QA,setAccTitle:()=>YA,setDiagramTitle:()=>ZA});var Qu="",Ku="",Zu="",Ju=x(e=>tr(e,St()),"sanitizeText"),GA=x(()=>{Qu="",Zu="",Ku=""},"clear"),YA=x(e=>{Qu=Ju(e).replace(/^\s+/g,"")},"setAccTitle"),XA=x(()=>Qu,"getAccTitle"),QA=x(e=>{Zu=Ju(e).replace(/\n\s+/g,`
184
+ `)},"setAccDescription"),KA=x(()=>Zu,"getAccDescription"),ZA=x(e=>{Ku=Ju(e)},"setDiagramTitle"),JA=x(()=>Ku,"getDiagramTitle"),gf=X,eM=Gu,Pe=St,i6=$m,s6=fi,eh=x(e=>tr(e,Pe()),"sanitizeText"),tM=WA,rM=x(()=>Om,"getCommonDb"),Ya={},Xa=x((e,t,r)=>{Ya[e]&&gf.warn(`Diagram with id ${e} already registered. Overwriting.`),Ya[e]=t,r&&Am(e,r),UA(e,t.styles),t.injectUtils?.(gf,eM,Pe,eh,tM,rM(),()=>{})},"registerDiagram"),Ec=x(e=>{if(e in Ya)return Ya[e];throw new nM(e)},"getDiagram"),li,nM=(li=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},x(li,"DiagramNotFoundError"),li),iM={value:()=>{}};function zm(){for(var e=0,t=arguments.length,r={},n;e<t;++e){if(!(n=arguments[e]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new Na(r)}function Na(e){this._=e}function sM(e,t){return e.trim().split(/^|\s+/).map(function(r){var n="",i=r.indexOf(".");if(i>=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}Na.prototype=zm.prototype={constructor:Na,on:function(e,t){var r=this._,n=sM(e+"",r),i,s=-1,a=n.length;if(arguments.length<2){for(;++s<a;)if((i=(e=n[s]).type)&&(i=aM(r[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=n[s]).type)r[i]=mf(r[i],e.name,t);else if(t==null)for(i in r)r[i]=mf(r[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new Na(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var r=new Array(i),n=0,i,s;n<i;++n)r[n]=arguments[n+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],n=0,i=s.length;n<i;++n)s[n].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var n=this._[e],i=0,s=n.length;i<s;++i)n[i].value.apply(t,r)}};function aM(e,t){for(var r=0,n=e.length,i;r<n;++r)if((i=e[r]).name===t)return i.value}function mf(e,t,r){for(var n=0,i=e.length;n<i;++n)if(e[n].name===t){e[n]=iM,e=e.slice(0,n).concat(e.slice(n+1));break}return r!=null&&e.push({name:t,value:r}),e}var Ac="http://www.w3.org/1999/xhtml";const xf={svg:"http://www.w3.org/2000/svg",xhtml:Ac,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ro(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),xf.hasOwnProperty(t)?{space:xf[t],local:e}:e}function oM(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Ac&&t.documentElement.namespaceURI===Ac?t.createElement(e):t.createElementNS(r,e)}}function lM(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Hm(e){var t=Ro(e);return(t.local?lM:oM)(t)}function cM(){}function th(e){return e==null?cM:function(){return this.querySelector(e)}}function uM(e){typeof e!="function"&&(e=th(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var s=t[i],a=s.length,o=n[i]=new Array(a),l,c,u=0;u<a;++u)(l=s[u])&&(c=e.call(l,l.__data__,u,s))&&("__data__"in l&&(c.__data__=l.__data__),o[u]=c);return new Qt(n,this._parents)}function hM(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function dM(){return[]}function Wm(e){return e==null?dM:function(){return this.querySelectorAll(e)}}function fM(e){return function(){return hM(e.apply(this,arguments))}}function pM(e){typeof e=="function"?e=fM(e):e=Wm(e);for(var t=this._groups,r=t.length,n=[],i=[],s=0;s<r;++s)for(var a=t[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&(n.push(e.call(l,l.__data__,c,a)),i.push(l));return new Qt(n,i)}function qm(e){return function(){return this.matches(e)}}function Um(e){return function(t){return t.matches(e)}}var gM=Array.prototype.find;function mM(e){return function(){return gM.call(this.children,e)}}function xM(){return this.firstElementChild}function yM(e){return this.select(e==null?xM:mM(typeof e=="function"?e:Um(e)))}var bM=Array.prototype.filter;function kM(){return Array.from(this.children)}function wM(e){return function(){return bM.call(this.children,e)}}function vM(e){return this.selectAll(e==null?kM:wM(typeof e=="function"?e:Um(e)))}function CM(e){typeof e!="function"&&(e=qm(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var s=t[i],a=s.length,o=n[i]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new Qt(n,this._parents)}function Vm(e){return new Array(e.length)}function SM(){return new Qt(this._enter||this._groups.map(Vm),this._parents)}function Qa(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Qa.prototype={constructor:Qa,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function _M(e){return function(){return e}}function TM(e,t,r,n,i,s){for(var a=0,o,l=t.length,c=s.length;a<c;++a)(o=t[a])?(o.__data__=s[a],n[a]=o):r[a]=new Qa(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function EM(e,t,r,n,i,s,a){var o,l,c=new Map,u=t.length,h=s.length,f=new Array(u),d;for(o=0;o<u;++o)(l=t[o])&&(f[o]=d=a.call(l,l.__data__,o,t)+"",c.has(d)?i[o]=l:c.set(d,l));for(o=0;o<h;++o)d=a.call(e,s[o],o,s)+"",(l=c.get(d))?(n[o]=l,l.__data__=s[o],c.delete(d)):r[o]=new Qa(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(f[o])===l&&(i[o]=l)}function AM(e){return e.__data__}function MM(e,t){if(!arguments.length)return Array.from(this,AM);var r=t?EM:TM,n=this._parents,i=this._groups;typeof e!="function"&&(e=_M(e));for(var s=i.length,a=new Array(s),o=new Array(s),l=new Array(s),c=0;c<s;++c){var u=n[c],h=i[c],f=h.length,d=NM(e.call(u,u&&u.__data__,c,n)),g=d.length,m=o[c]=new Array(g),b=a[c]=new Array(g),y=l[c]=new Array(f);r(u,h,m,b,y,d,t);for(var k=0,v=0,C,S;k<g;++k)if(C=m[k]){for(k>=v&&(v=k+1);!(S=b[v])&&++v<g;);C._next=S||null}}return a=new Qt(a,n),a._enter=o,a._exit=l,a}function NM(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function LM(){return new Qt(this._exit||this._groups.map(Vm),this._parents)}function IM(e,t,r){var n=this.enter(),i=this,s=this.exit();return typeof e=="function"?(n=e(n),n&&(n=n.selection())):n=n.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),r==null?s.remove():r(s),n&&i?n.merge(i).order():i}function $M(e){for(var t=e.selection?e.selection():e,r=this._groups,n=t._groups,i=r.length,s=n.length,a=Math.min(i,s),o=new Array(i),l=0;l<a;++l)for(var c=r[l],u=n[l],h=c.length,f=o[l]=new Array(h),d,g=0;g<h;++g)(d=c[g]||u[g])&&(f[g]=d);for(;l<i;++l)o[l]=r[l];return new Qt(o,this._parents)}function jM(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var n=e[t],i=n.length-1,s=n[i],a;--i>=0;)(a=n[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function BM(e){e||(e=DM);function t(h,f){return h&&f?e(h.__data__,f.__data__):!h-!f}for(var r=this._groups,n=r.length,i=new Array(n),s=0;s<n;++s){for(var a=r[s],o=a.length,l=i[s]=new Array(o),c,u=0;u<o;++u)(c=a[u])&&(l[u]=c);l.sort(t)}return new Qt(i,this._parents).order()}function DM(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function PM(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function FM(){return Array.from(this)}function RM(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],i=0,s=n.length;i<s;++i){var a=n[i];if(a)return a}return null}function OM(){let e=0;for(const t of this)++e;return e}function zM(){return!this.node()}function HM(e){for(var t=this._groups,r=0,n=t.length;r<n;++r)for(var i=t[r],s=0,a=i.length,o;s<a;++s)(o=i[s])&&e.call(o,o.__data__,s,i);return this}function WM(e){return function(){this.removeAttribute(e)}}function qM(e){return function(){this.removeAttributeNS(e.space,e.local)}}function UM(e,t){return function(){this.setAttribute(e,t)}}function VM(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function GM(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function YM(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function XM(e,t){var r=Ro(e);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((t==null?r.local?qM:WM:typeof t=="function"?r.local?YM:GM:r.local?VM:UM)(r,t))}function Gm(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function QM(e){return function(){this.style.removeProperty(e)}}function KM(e,t,r){return function(){this.style.setProperty(e,t,r)}}function ZM(e,t,r){return function(){var n=t.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,r)}}function JM(e,t,r){return arguments.length>1?this.each((t==null?QM:typeof t=="function"?ZM:KM)(e,t,r??"")):gi(this.node(),e)}function gi(e,t){return e.style.getPropertyValue(t)||Gm(e).getComputedStyle(e,null).getPropertyValue(t)}function eN(e){return function(){delete this[e]}}function tN(e,t){return function(){this[e]=t}}function rN(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function nN(e,t){return arguments.length>1?this.each((t==null?eN:typeof t=="function"?rN:tN)(e,t)):this.node()[e]}function Ym(e){return e.trim().split(/^|\s+/)}function rh(e){return e.classList||new Xm(e)}function Xm(e){this._node=e,this._names=Ym(e.getAttribute("class")||"")}Xm.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Qm(e,t){for(var r=rh(e),n=-1,i=t.length;++n<i;)r.add(t[n])}function Km(e,t){for(var r=rh(e),n=-1,i=t.length;++n<i;)r.remove(t[n])}function iN(e){return function(){Qm(this,e)}}function sN(e){return function(){Km(this,e)}}function aN(e,t){return function(){(t.apply(this,arguments)?Qm:Km)(this,e)}}function oN(e,t){var r=Ym(e+"");if(arguments.length<2){for(var n=rh(this.node()),i=-1,s=r.length;++i<s;)if(!n.contains(r[i]))return!1;return!0}return this.each((typeof t=="function"?aN:t?iN:sN)(r,t))}function lN(){this.textContent=""}function cN(e){return function(){this.textContent=e}}function uN(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function hN(e){return arguments.length?this.each(e==null?lN:(typeof e=="function"?uN:cN)(e)):this.node().textContent}function dN(){this.innerHTML=""}function fN(e){return function(){this.innerHTML=e}}function pN(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function gN(e){return arguments.length?this.each(e==null?dN:(typeof e=="function"?pN:fN)(e)):this.node().innerHTML}function mN(){this.nextSibling&&this.parentNode.appendChild(this)}function xN(){return this.each(mN)}function yN(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function bN(){return this.each(yN)}function kN(e){var t=typeof e=="function"?e:Hm(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function wN(){return null}function vN(e,t){var r=typeof e=="function"?e:Hm(e),n=t==null?wN:typeof t=="function"?t:th(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}function CN(){var e=this.parentNode;e&&e.removeChild(this)}function SN(){return this.each(CN)}function _N(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function TN(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function EN(e){return this.select(e?TN:_N)}function AN(e){return arguments.length?this.property("__data__",e):this.node().__data__}function MN(e){return function(t){e.call(this,t,this.__data__)}}function NN(e){return e.trim().split(/^|\s+/).map(function(t){var r="",n=t.indexOf(".");return n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),{type:t,name:r}})}function LN(e){return function(){var t=this.__on;if(t){for(var r=0,n=-1,i=t.length,s;r<i;++r)s=t[r],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++n]=s;++n?t.length=n:delete this.__on}}}function IN(e,t,r){return function(){var n=this.__on,i,s=MN(t);if(n){for(var a=0,o=n.length;a<o;++a)if((i=n[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=r),i.value=t;return}}this.addEventListener(e.type,s,r),i={type:e.type,name:e.name,value:t,listener:s,options:r},n?n.push(i):this.__on=[i]}}function $N(e,t,r){var n=NN(e+""),i,s=n.length,a;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,c=o.length,u;l<c;++l)for(i=0,u=o[l];i<s;++i)if((a=n[i]).type===u.type&&a.name===u.name)return u.value}return}for(o=t?IN:LN,i=0;i<s;++i)this.each(o(n[i],t,r));return this}function Zm(e,t,r){var n=Gm(e),i=n.CustomEvent;typeof i=="function"?i=new i(t,r):(i=n.document.createEvent("Event"),r?(i.initEvent(t,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function jN(e,t){return function(){return Zm(this,e,t)}}function BN(e,t){return function(){return Zm(this,e,t.apply(this,arguments))}}function DN(e,t){return this.each((typeof t=="function"?BN:jN)(e,t))}function*PN(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],i=0,s=n.length,a;i<s;++i)(a=n[i])&&(yield a)}var Jm=[null];function Qt(e,t){this._groups=e,this._parents=t}function Us(){return new Qt([[document.documentElement]],Jm)}function FN(){return this}Qt.prototype=Us.prototype={constructor:Qt,select:uM,selectAll:pM,selectChild:yM,selectChildren:vM,filter:CM,data:MM,enter:SM,exit:LM,join:IM,merge:$M,selection:FN,order:jM,sort:BM,call:PM,nodes:FM,node:RM,size:OM,empty:zM,each:HM,attr:XM,style:JM,property:nN,classed:oN,text:hN,html:gN,raise:xN,lower:bN,append:kN,insert:vN,remove:SN,clone:EN,datum:AN,on:$N,dispatch:DN,[Symbol.iterator]:PN};function $e(e){return typeof e=="string"?new Qt([[document.querySelector(e)]],[document.documentElement]):new Qt([[e]],Jm)}function nh(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function e0(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function Vs(){}var _s=.7,Ka=1/_s,ei="\\s*([+-]?\\d+)\\s*",Ts="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",wr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",RN=/^#([0-9a-f]{3,8})$/,ON=new RegExp(`^rgb\\(${ei},${ei},${ei}\\)$`),zN=new RegExp(`^rgb\\(${wr},${wr},${wr}\\)$`),HN=new RegExp(`^rgba\\(${ei},${ei},${ei},${Ts}\\)$`),WN=new RegExp(`^rgba\\(${wr},${wr},${wr},${Ts}\\)$`),qN=new RegExp(`^hsl\\(${Ts},${wr},${wr}\\)$`),UN=new RegExp(`^hsla\\(${Ts},${wr},${wr},${Ts}\\)$`),yf={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};nh(Vs,Es,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:bf,formatHex:bf,formatHex8:VN,formatHsl:GN,formatRgb:kf,toString:kf});function bf(){return this.rgb().formatHex()}function VN(){return this.rgb().formatHex8()}function GN(){return t0(this).formatHsl()}function kf(){return this.rgb().formatRgb()}function Es(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=RN.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?wf(t):r===3?new qt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?ua(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?ua(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=ON.exec(e))?new qt(t[1],t[2],t[3],1):(t=zN.exec(e))?new qt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=HN.exec(e))?ua(t[1],t[2],t[3],t[4]):(t=WN.exec(e))?ua(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=qN.exec(e))?Sf(t[1],t[2]/100,t[3]/100,1):(t=UN.exec(e))?Sf(t[1],t[2]/100,t[3]/100,t[4]):yf.hasOwnProperty(e)?wf(yf[e]):e==="transparent"?new qt(NaN,NaN,NaN,0):null}function wf(e){return new qt(e>>16&255,e>>8&255,e&255,1)}function ua(e,t,r,n){return n<=0&&(e=t=r=NaN),new qt(e,t,r,n)}function YN(e){return e instanceof Vs||(e=Es(e)),e?(e=e.rgb(),new qt(e.r,e.g,e.b,e.opacity)):new qt}function Mc(e,t,r,n){return arguments.length===1?YN(e):new qt(e,t,r,n??1)}function qt(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}nh(qt,Mc,e0(Vs,{brighter(e){return e=e==null?Ka:Math.pow(Ka,e),new qt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?_s:Math.pow(_s,e),new qt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new qt(Tn(this.r),Tn(this.g),Tn(this.b),Za(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:vf,formatHex:vf,formatHex8:XN,formatRgb:Cf,toString:Cf}));function vf(){return`#${vn(this.r)}${vn(this.g)}${vn(this.b)}`}function XN(){return`#${vn(this.r)}${vn(this.g)}${vn(this.b)}${vn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Cf(){const e=Za(this.opacity);return`${e===1?"rgb(":"rgba("}${Tn(this.r)}, ${Tn(this.g)}, ${Tn(this.b)}${e===1?")":`, ${e})`}`}function Za(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Tn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function vn(e){return e=Tn(e),(e<16?"0":"")+e.toString(16)}function Sf(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new lr(e,t,r,n)}function t0(e){if(e instanceof lr)return new lr(e.h,e.s,e.l,e.opacity);if(e instanceof Vs||(e=Es(e)),!e)return new lr;if(e instanceof lr)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),s=Math.max(t,r,n),a=NaN,o=s-i,l=(s+i)/2;return o?(t===s?a=(r-n)/o+(r<n)*6:r===s?a=(n-t)/o+2:a=(t-r)/o+4,o/=l<.5?s+i:2-s-i,a*=60):o=l>0&&l<1?0:a,new lr(a,o,l,e.opacity)}function QN(e,t,r,n){return arguments.length===1?t0(e):new lr(e,t,r,n??1)}function lr(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}nh(lr,QN,e0(Vs,{brighter(e){return e=e==null?Ka:Math.pow(Ka,e),new lr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?_s:Math.pow(_s,e),new lr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new qt(Fl(e>=240?e-240:e+120,i,n),Fl(e,i,n),Fl(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new lr(_f(this.h),ha(this.s),ha(this.l),Za(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=Za(this.opacity);return`${e===1?"hsl(":"hsla("}${_f(this.h)}, ${ha(this.s)*100}%, ${ha(this.l)*100}%${e===1?")":`, ${e})`}`}}));function _f(e){return e=(e||0)%360,e<0?e+360:e}function ha(e){return Math.max(0,Math.min(1,e||0))}function Fl(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const ih=e=>()=>e;function r0(e,t){return function(r){return e+r*t}}function KN(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function a6(e,t){var r=t-e;return r?r0(e,r>180||r<-180?r-360*Math.round(r/360):r):ih(isNaN(e)?t:e)}function ZN(e){return(e=+e)==1?n0:function(t,r){return r-t?KN(t,r,e):ih(isNaN(t)?r:t)}}function n0(e,t){var r=t-e;return r?r0(e,r):ih(isNaN(e)?t:e)}const Tf=(function e(t){var r=ZN(t);function n(i,s){var a=r((i=Mc(i)).r,(s=Mc(s)).r),o=r(i.g,s.g),l=r(i.b,s.b),c=n0(i.opacity,s.opacity);return function(u){return i.r=a(u),i.g=o(u),i.b=l(u),i.opacity=c(u),i+""}}return n.gamma=e,n})(1);function Qr(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var Nc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Rl=new RegExp(Nc.source,"g");function JN(e){return function(){return e}}function eL(e){return function(t){return e(t)+""}}function tL(e,t){var r=Nc.lastIndex=Rl.lastIndex=0,n,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(n=Nc.exec(e))&&(i=Rl.exec(t));)(s=i.index)>r&&(s=t.slice(r,s),o[a]?o[a]+=s:o[++a]=s),(n=n[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,l.push({i:a,x:Qr(n,i)})),r=Rl.lastIndex;return r<t.length&&(s=t.slice(r),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?eL(l[0].x):JN(t):(t=l.length,function(c){for(var u=0,h;u<t;++u)o[(h=l[u]).i]=h.x(c);return o.join("")})}var Ef=180/Math.PI,Lc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function i0(e,t,r,n,i,s){var a,o,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*r+t*n)&&(r-=e*l,n-=t*l),(o=Math.sqrt(r*r+n*n))&&(r/=o,n/=o,l/=o),e*n<t*r&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:s,rotate:Math.atan2(t,e)*Ef,skewX:Math.atan(l)*Ef,scaleX:a,scaleY:o}}var da;function rL(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Lc:i0(t.a,t.b,t.c,t.d,t.e,t.f)}function nL(e){return e==null||(da||(da=document.createElementNS("http://www.w3.org/2000/svg","g")),da.setAttribute("transform",e),!(e=da.transform.baseVal.consolidate()))?Lc:(e=e.matrix,i0(e.a,e.b,e.c,e.d,e.e,e.f))}function s0(e,t,r,n){function i(c){return c.length?c.pop()+" ":""}function s(c,u,h,f,d,g){if(c!==h||u!==f){var m=d.push("translate(",null,t,null,r);g.push({i:m-4,x:Qr(c,h)},{i:m-2,x:Qr(u,f)})}else(h||f)&&d.push("translate("+h+t+f+r)}function a(c,u,h,f){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),f.push({i:h.push(i(h)+"rotate(",null,n)-2,x:Qr(c,u)})):u&&h.push(i(h)+"rotate("+u+n)}function o(c,u,h,f){c!==u?f.push({i:h.push(i(h)+"skewX(",null,n)-2,x:Qr(c,u)}):u&&h.push(i(h)+"skewX("+u+n)}function l(c,u,h,f,d,g){if(c!==h||u!==f){var m=d.push(i(d)+"scale(",null,",",null,")");g.push({i:m-4,x:Qr(c,h)},{i:m-2,x:Qr(u,f)})}else(h!==1||f!==1)&&d.push(i(d)+"scale("+h+","+f+")")}return function(c,u){var h=[],f=[];return c=e(c),u=e(u),s(c.translateX,c.translateY,u.translateX,u.translateY,h,f),a(c.rotate,u.rotate,h,f),o(c.skewX,u.skewX,h,f),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,h,f),c=u=null,function(d){for(var g=-1,m=f.length,b;++g<m;)h[(b=f[g]).i]=b.x(d);return h.join("")}}}var iL=s0(rL,"px, ","px)","deg)"),sL=s0(nL,", ",")",")"),mi=0,rs=0,Gi=0,a0=1e3,Ja,ns,eo=0,In=0,Oo=0,As=typeof performance=="object"&&performance.now?performance:Date,o0=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function sh(){return In||(o0(aL),In=As.now()+Oo)}function aL(){In=0}function to(){this._call=this._time=this._next=null}to.prototype=l0.prototype={constructor:to,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?sh():+r)+(t==null?0:+t),!this._next&&ns!==this&&(ns?ns._next=this:Ja=this,ns=this),this._call=e,this._time=r,Ic()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ic())}};function l0(e,t,r){var n=new to;return n.restart(e,t,r),n}function oL(){sh(),++mi;for(var e=Ja,t;e;)(t=In-e._time)>=0&&e._call.call(void 0,t),e=e._next;--mi}function Af(){In=(eo=As.now())+Oo,mi=rs=0;try{oL()}finally{mi=0,cL(),In=0}}function lL(){var e=As.now(),t=e-eo;t>a0&&(Oo-=t,eo=e)}function cL(){for(var e,t=Ja,r,n=1/0;t;)t._call?(n>t._time&&(n=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:Ja=r);ns=e,Ic(n)}function Ic(e){if(!mi){rs&&(rs=clearTimeout(rs));var t=e-In;t>24?(e<1/0&&(rs=setTimeout(Af,e-As.now()-Oo)),Gi&&(Gi=clearInterval(Gi))):(Gi||(eo=As.now(),Gi=setInterval(lL,a0)),mi=1,o0(Af))}}function Mf(e,t,r){var n=new to;return t=t==null?0:+t,n.restart(i=>{n.stop(),e(i+t)},t,r),n}var uL=zm("start","end","cancel","interrupt"),hL=[],c0=0,Nf=1,$c=2,La=3,Lf=4,jc=5,Ia=6;function zo(e,t,r,n,i,s){var a=e.__transition;if(!a)e.__transition={};else if(r in a)return;dL(e,r,{name:t,index:n,group:i,on:uL,tween:hL,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:c0})}function ah(e,t){var r=fr(e,t);if(r.state>c0)throw new Error("too late; already scheduled");return r}function _r(e,t){var r=fr(e,t);if(r.state>La)throw new Error("too late; already running");return r}function fr(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function dL(e,t,r){var n=e.__transition,i;n[t]=r,r.timer=l0(s,0,r.time);function s(c){r.state=Nf,r.timer.restart(a,r.delay,r.time),r.delay<=c&&a(c-r.delay)}function a(c){var u,h,f,d;if(r.state!==Nf)return l();for(u in n)if(d=n[u],d.name===r.name){if(d.state===La)return Mf(a);d.state===Lf?(d.state=Ia,d.timer.stop(),d.on.call("interrupt",e,e.__data__,d.index,d.group),delete n[u]):+u<t&&(d.state=Ia,d.timer.stop(),d.on.call("cancel",e,e.__data__,d.index,d.group),delete n[u])}if(Mf(function(){r.state===La&&(r.state=Lf,r.timer.restart(o,r.delay,r.time),o(c))}),r.state=$c,r.on.call("start",e,e.__data__,r.index,r.group),r.state===$c){for(r.state=La,i=new Array(f=r.tween.length),u=0,h=-1;u<f;++u)(d=r.tween[u].value.call(e,e.__data__,r.index,r.group))&&(i[++h]=d);i.length=h+1}}function o(c){for(var u=c<r.duration?r.ease.call(null,c/r.duration):(r.timer.restart(l),r.state=jc,1),h=-1,f=i.length;++h<f;)i[h].call(e,u);r.state===jc&&(r.on.call("end",e,e.__data__,r.index,r.group),l())}function l(){r.state=Ia,r.timer.stop(),delete n[t];for(var c in n)return;delete e.__transition}}function fL(e,t){var r=e.__transition,n,i,s=!0,a;if(r){t=t==null?null:t+"";for(a in r){if((n=r[a]).name!==t){s=!1;continue}i=n.state>$c&&n.state<jc,n.state=Ia,n.timer.stop(),n.on.call(i?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete r[a]}s&&delete e.__transition}}function pL(e){return this.each(function(){fL(this,e)})}function gL(e,t){var r,n;return function(){var i=_r(this,e),s=i.tween;if(s!==r){n=r=s;for(var a=0,o=n.length;a<o;++a)if(n[a].name===t){n=n.slice(),n.splice(a,1);break}}i.tween=n}}function mL(e,t,r){var n,i;if(typeof r!="function")throw new Error;return function(){var s=_r(this,e),a=s.tween;if(a!==n){i=(n=a).slice();for(var o={name:t,value:r},l=0,c=i.length;l<c;++l)if(i[l].name===t){i[l]=o;break}l===c&&i.push(o)}s.tween=i}}function xL(e,t){var r=this._id;if(e+="",arguments.length<2){for(var n=fr(this.node(),r).tween,i=0,s=n.length,a;i<s;++i)if((a=n[i]).name===e)return a.value;return null}return this.each((t==null?gL:mL)(r,e,t))}function oh(e,t,r){var n=e._id;return e.each(function(){var i=_r(this,n);(i.value||(i.value={}))[t]=r.apply(this,arguments)}),function(i){return fr(i,n).value[t]}}function u0(e,t){var r;return(typeof t=="number"?Qr:t instanceof Es?Tf:(r=Es(t))?(t=r,Tf):tL)(e,t)}function yL(e){return function(){this.removeAttribute(e)}}function bL(e){return function(){this.removeAttributeNS(e.space,e.local)}}function kL(e,t,r){var n,i=r+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===n?s:s=t(n=a,r)}}function wL(e,t,r){var n,i=r+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===n?s:s=t(n=a,r)}}function vL(e,t,r){var n,i,s;return function(){var a,o=r(this),l;return o==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=o+"",a===l?null:a===n&&l===i?s:(i=l,s=t(n=a,o)))}}function CL(e,t,r){var n,i,s;return function(){var a,o=r(this),l;return o==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=o+"",a===l?null:a===n&&l===i?s:(i=l,s=t(n=a,o)))}}function SL(e,t){var r=Ro(e),n=r==="transform"?sL:u0;return this.attrTween(e,typeof t=="function"?(r.local?CL:vL)(r,n,oh(this,"attr."+e,t)):t==null?(r.local?bL:yL)(r):(r.local?wL:kL)(r,n,t))}function _L(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function TL(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function EL(e,t){var r,n;function i(){var s=t.apply(this,arguments);return s!==n&&(r=(n=s)&&TL(e,s)),r}return i._value=t,i}function AL(e,t){var r,n;function i(){var s=t.apply(this,arguments);return s!==n&&(r=(n=s)&&_L(e,s)),r}return i._value=t,i}function ML(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var n=Ro(e);return this.tween(r,(n.local?EL:AL)(n,t))}function NL(e,t){return function(){ah(this,e).delay=+t.apply(this,arguments)}}function LL(e,t){return t=+t,function(){ah(this,e).delay=t}}function IL(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?NL:LL)(t,e)):fr(this.node(),t).delay}function $L(e,t){return function(){_r(this,e).duration=+t.apply(this,arguments)}}function jL(e,t){return t=+t,function(){_r(this,e).duration=t}}function BL(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?$L:jL)(t,e)):fr(this.node(),t).duration}function DL(e,t){if(typeof t!="function")throw new Error;return function(){_r(this,e).ease=t}}function PL(e){var t=this._id;return arguments.length?this.each(DL(t,e)):fr(this.node(),t).ease}function FL(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;_r(this,e).ease=r}}function RL(e){if(typeof e!="function")throw new Error;return this.each(FL(this._id,e))}function OL(e){typeof e!="function"&&(e=qm(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var s=t[i],a=s.length,o=n[i]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new Rr(n,this._parents,this._name,this._id)}function zL(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,n=t.length,i=r.length,s=Math.min(n,i),a=new Array(n),o=0;o<s;++o)for(var l=t[o],c=r[o],u=l.length,h=a[o]=new Array(u),f,d=0;d<u;++d)(f=l[d]||c[d])&&(h[d]=f);for(;o<n;++o)a[o]=t[o];return new Rr(a,this._parents,this._name,this._id)}function HL(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function WL(e,t,r){var n,i,s=HL(t)?ah:_r;return function(){var a=s(this,e),o=a.on;o!==n&&(i=(n=o).copy()).on(t,r),a.on=i}}function qL(e,t){var r=this._id;return arguments.length<2?fr(this.node(),r).on.on(e):this.each(WL(r,e,t))}function UL(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function VL(){return this.on("end.remove",UL(this._id))}function GL(e){var t=this._name,r=this._id;typeof e!="function"&&(e=th(e));for(var n=this._groups,i=n.length,s=new Array(i),a=0;a<i;++a)for(var o=n[a],l=o.length,c=s[a]=new Array(l),u,h,f=0;f<l;++f)(u=o[f])&&(h=e.call(u,u.__data__,f,o))&&("__data__"in u&&(h.__data__=u.__data__),c[f]=h,zo(c[f],t,r,f,c,fr(u,r)));return new Rr(s,this._parents,t,r)}function YL(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Wm(e));for(var n=this._groups,i=n.length,s=[],a=[],o=0;o<i;++o)for(var l=n[o],c=l.length,u,h=0;h<c;++h)if(u=l[h]){for(var f=e.call(u,u.__data__,h,l),d,g=fr(u,r),m=0,b=f.length;m<b;++m)(d=f[m])&&zo(d,t,r,m,f,g);s.push(f),a.push(u)}return new Rr(s,a,t,r)}var XL=Us.prototype.constructor;function QL(){return new XL(this._groups,this._parents)}function KL(e,t){var r,n,i;return function(){var s=gi(this,e),a=(this.style.removeProperty(e),gi(this,e));return s===a?null:s===r&&a===n?i:i=t(r=s,n=a)}}function h0(e){return function(){this.style.removeProperty(e)}}function ZL(e,t,r){var n,i=r+"",s;return function(){var a=gi(this,e);return a===i?null:a===n?s:s=t(n=a,r)}}function JL(e,t,r){var n,i,s;return function(){var a=gi(this,e),o=r(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),gi(this,e))),a===l?null:a===n&&l===i?s:(i=l,s=t(n=a,o))}}function eI(e,t){var r,n,i,s="style."+t,a="end."+s,o;return function(){var l=_r(this,e),c=l.on,u=l.value[s]==null?o||(o=h0(t)):void 0;(c!==r||i!==u)&&(n=(r=c).copy()).on(a,i=u),l.on=n}}function tI(e,t,r){var n=(e+="")=="transform"?iL:u0;return t==null?this.styleTween(e,KL(e,n)).on("end.style."+e,h0(e)):typeof t=="function"?this.styleTween(e,JL(e,n,oh(this,"style."+e,t))).each(eI(this._id,e)):this.styleTween(e,ZL(e,n,t),r).on("end.style."+e,null)}function rI(e,t,r){return function(n){this.style.setProperty(e,t.call(this,n),r)}}function nI(e,t,r){var n,i;function s(){var a=t.apply(this,arguments);return a!==i&&(n=(i=a)&&rI(e,a,r)),n}return s._value=t,s}function iI(e,t,r){var n="style."+(e+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,nI(e,t,r??""))}function sI(e){return function(){this.textContent=e}}function aI(e){return function(){var t=e(this);this.textContent=t??""}}function oI(e){return this.tween("text",typeof e=="function"?aI(oh(this,"text",e)):sI(e==null?"":e+""))}function lI(e){return function(t){this.textContent=e.call(this,t)}}function cI(e){var t,r;function n(){var i=e.apply(this,arguments);return i!==r&&(t=(r=i)&&lI(i)),t}return n._value=e,n}function uI(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,cI(e))}function hI(){for(var e=this._name,t=this._id,r=d0(),n=this._groups,i=n.length,s=0;s<i;++s)for(var a=n[s],o=a.length,l,c=0;c<o;++c)if(l=a[c]){var u=fr(l,t);zo(l,e,r,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Rr(n,this._parents,e,r)}function dI(){var e,t,r=this,n=r._id,i=r.size();return new Promise(function(s,a){var o={value:a},l={value:function(){--i===0&&s()}};r.each(function(){var c=_r(this,n),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(l)),c.on=t}),i===0&&s()})}var fI=0;function Rr(e,t,r,n){this._groups=e,this._parents=t,this._name=r,this._id=n}function d0(){return++fI}var Ir=Us.prototype;Rr.prototype={constructor:Rr,select:GL,selectAll:YL,selectChild:Ir.selectChild,selectChildren:Ir.selectChildren,filter:OL,merge:zL,selection:QL,transition:hI,call:Ir.call,nodes:Ir.nodes,node:Ir.node,size:Ir.size,empty:Ir.empty,each:Ir.each,on:qL,attr:SL,attrTween:ML,style:tI,styleTween:iI,text:oI,textTween:uI,remove:VL,tween:xL,delay:IL,duration:BL,ease:PL,easeVarying:RL,end:dI,[Symbol.iterator]:Ir[Symbol.iterator]};function pI(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var gI={time:null,delay:0,duration:250,ease:pI};function mI(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function xI(e){var t,r;e instanceof Rr?(t=e._id,e=e._name):(t=d0(),(r=gI).time=sh(),e=e==null?null:e+"");for(var n=this._groups,i=n.length,s=0;s<i;++s)for(var a=n[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&zo(l,e,t,c,a,r||mI(l,t));return new Rr(n,this._parents,e,t)}Us.prototype.interrupt=pL;Us.prototype.transition=xI;const Bc=Math.PI,Dc=2*Bc,yn=1e-6,yI=Dc-yn;function f0(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function bI(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return f0;const r=10**t;return function(n){this._+=n[0];for(let i=1,s=n.length;i<s;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}class kI{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?f0:bI(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,i){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,r,n,i,s,a){this._append`C${+t},${+r},${+n},${+i},${this._x1=+s},${this._y1=+a}`}arcTo(t,r,n,i,s){if(t=+t,r=+r,n=+n,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,o=this._y1,l=n-t,c=i-r,u=a-t,h=o-r,f=u*u+h*h;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(f>yn)if(!(Math.abs(h*l-c*u)>yn)||!s)this._append`L${this._x1=t},${this._y1=r}`;else{let d=n-a,g=i-o,m=l*l+c*c,b=d*d+g*g,y=Math.sqrt(m),k=Math.sqrt(f),v=s*Math.tan((Bc-Math.acos((m+f-b)/(2*y*k)))/2),C=v/k,S=v/y;Math.abs(C-1)>yn&&this._append`L${t+C*u},${r+C*h}`,this._append`A${s},${s},0,0,${+(h*d>u*g)},${this._x1=t+S*l},${this._y1=r+S*c}`}}arc(t,r,n,i,s,a){if(t=+t,r=+r,n=+n,a=!!a,n<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(i),l=n*Math.sin(i),c=t+o,u=r+l,h=1^a,f=a?i-s:s-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>yn||Math.abs(this._y1-u)>yn)&&this._append`L${c},${u}`,n&&(f<0&&(f=f%Dc+Dc),f>yI?this._append`A${n},${n},0,1,${h},${t-o},${r-l}A${n},${n},0,1,${h},${this._x1=c},${this._y1=u}`:f>yn&&this._append`A${n},${n},0,${+(f>=Bc)},${h},${this._x1=t+n*Math.cos(s)},${this._y1=r+n*Math.sin(s)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function Vn(e){return function(){return e}}const o6=Math.abs,l6=Math.atan2,c6=Math.cos,u6=Math.max,h6=Math.min,d6=Math.sin,f6=Math.sqrt,If=1e-12,lh=Math.PI,$f=lh/2,p6=2*lh;function g6(e){return e>1?0:e<-1?lh:Math.acos(e)}function m6(e){return e>=1?$f:e<=-1?-$f:Math.asin(e)}function wI(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new kI(t)}function vI(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function p0(e){this._context=e}p0.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 ro(e){return new p0(e)}function CI(e){return e[0]}function SI(e){return e[1]}function _I(e,t){var r=Vn(!0),n=null,i=ro,s=null,a=wI(o);e=typeof e=="function"?e:e===void 0?CI:Vn(e),t=typeof t=="function"?t:t===void 0?SI:Vn(t);function o(l){var c,u=(l=vI(l)).length,h,f=!1,d;for(n==null&&(s=i(d=a())),c=0;c<=u;++c)!(c<u&&r(h=l[c],c,l))===f&&((f=!f)?s.lineStart():s.lineEnd()),f&&s.point(+e(h,c,l),+t(h,c,l));if(d)return s=null,d+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:Vn(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:Vn(+l),o):t},o.defined=function(l){return arguments.length?(r=typeof l=="function"?l:Vn(!!l),o):r},o.curve=function(l){return arguments.length?(i=l,n!=null&&(s=i(n)),o):i},o.context=function(l){return arguments.length?(l==null?n=s=null:s=i(n=l),o):n},o}class g0{constructor(t,r){this._context=t,this._x=r}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,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function m0(e){return new g0(e,!0)}function x0(e){return new g0(e,!1)}function tn(){}function no(e,t,r){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+r)/6)}function Ho(e){this._context=e}Ho.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:no(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:no(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function $a(e){return new Ho(e)}function y0(e){this._context=e}y0.prototype={areaStart:tn,areaEnd:tn,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:no(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function TI(e){return new y0(e)}function b0(e){this._context=e}b0.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 r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:no(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function EI(e){return new b0(e)}function k0(e,t){this._basis=new Ho(e),this._beta=t}k0.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var n=e[0],i=t[0],s=e[r]-n,a=t[r]-i,o=-1,l;++o<=r;)l=o/r,this._basis.point(this._beta*e[o]+(1-this._beta)*(n+l*s),this._beta*t[o]+(1-this._beta)*(i+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const AI=(function e(t){function r(n){return t===1?new Ho(n):new k0(n,t)}return r.beta=function(n){return e(+n)},r})(.85);function io(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function ch(e,t){this._context=e,this._k=(1-t)/6}ch.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:io(this,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,this._x1=e,this._y1=t;break;case 2:this._point=3;default:io(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const w0=(function e(t){function r(n){return new ch(n,t)}return r.tension=function(n){return e(+n)},r})(0);function uh(e,t){this._context=e,this._k=(1-t)/6}uh.prototype={areaStart:tn,areaEnd:tn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:io(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const MI=(function e(t){function r(n){return new uh(n,t)}return r.tension=function(n){return e(+n)},r})(0);function hh(e,t){this._context=e,this._k=(1-t)/6}hh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=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,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:io(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const NI=(function e(t){function r(n){return new hh(n,t)}return r.tension=function(n){return e(+n)},r})(0);function dh(e,t,r){var n=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>If){var o=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);n=(n*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>If){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-r*e._l12_2a)/u}e._context.bezierCurveTo(n,i,s,a,e._x2,e._y2)}function v0(e,t){this._context=e,this._alpha=t}v0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}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;default:dh(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const C0=(function e(t){function r(n){return t?new v0(n,t):new ch(n,0)}return r.alpha=function(n){return e(+n)},r})(.5);function S0(e,t){this._context=e,this._alpha=t}S0.prototype={areaStart:tn,areaEnd:tn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:dh(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const LI=(function e(t){function r(n){return t?new S0(n,t):new uh(n,0)}return r.alpha=function(n){return e(+n)},r})(.5);function _0(e,t){this._context=e,this._alpha=t}_0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=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){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:dh(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const II=(function e(t){function r(n){return t?new _0(n,t):new hh(n,0)}return r.alpha=function(n){return e(+n)},r})(.5);function T0(e){this._context=e}T0.prototype={areaStart:tn,areaEnd:tn,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 $I(e){return new T0(e)}function jf(e){return e<0?-1:1}function Bf(e,t,r){var n=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(n||i<0&&-0),a=(r-e._y1)/(i||n<0&&-0),o=(s*i+a*n)/(n+i);return(jf(s)+jf(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function Df(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Ol(e,t,r){var n=e._x0,i=e._y0,s=e._x1,a=e._y1,o=(s-n)/3;e._context.bezierCurveTo(n+o,i+o*t,s-o,a-o*r,s,a)}function so(e){this._context=e}so.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:Ol(this,this._t0,Df(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 r=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,Ol(this,Df(this,r=Bf(this,e,t)),r);break;default:Ol(this,this._t0,r=Bf(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function E0(e){this._context=new A0(e)}(E0.prototype=Object.create(so.prototype)).point=function(e,t){so.prototype.point.call(this,t,e)};function A0(e){this._context=e}A0.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,r,n,i,s){this._context.bezierCurveTo(t,e,n,r,s,i)}};function M0(e){return new so(e)}function N0(e){return new E0(e)}function L0(e){this._context=e}L0.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,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=Pf(e),i=Pf(t),s=0,a=1;a<r;++s,++a)this._context.bezierCurveTo(n[0][s],i[0][s],n[1][s],i[1][s],e[a],t[a]);(this._line||this._line!==0&&r===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 Pf(e){var t,r=e.length-1,n,i=new Array(r),s=new Array(r),a=new Array(r);for(i[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,s[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/s[t-1],s[t]-=n,a[t]-=n*a[t-1];for(i[r-1]=a[r-1]/s[r-1],t=r-2;t>=0;--t)i[t]=(a[t]-i[t+1])/s[t];for(s[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function I0(e){return new L0(e)}function Wo(e,t){this._context=e,this._t=t}Wo.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 r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function $0(e){return new Wo(e,.5)}function j0(e){return new Wo(e,0)}function B0(e){return new Wo(e,1)}function is(e,t,r){this.k=e,this.x=t,this.y=r}is.prototype={constructor:is,scale:function(e){return e===1?this:new is(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new is(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};is.prototype;var jI=x(e=>{const{securityLevel:t}=Pe();let r=$e("body");if(t==="sandbox"){const s=$e(`#i${e}`).node()?.contentDocument??document;r=$e(s.body)}return r.select(`#${e}`)},"selectSvgElement");function fh(e){return typeof e>"u"||e===null}x(fh,"isNothing");function D0(e){return typeof e=="object"&&e!==null}x(D0,"isObject");function P0(e){return Array.isArray(e)?e:fh(e)?[]:[e]}x(P0,"toArray");function F0(e,t){var r,n,i,s;if(t)for(s=Object.keys(t),r=0,n=s.length;r<n;r+=1)i=s[r],e[i]=t[i];return e}x(F0,"extend");function R0(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}x(R0,"repeat");function O0(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}x(O0,"isNegativeZero");var BI=fh,DI=D0,PI=P0,FI=R0,RI=O0,OI=F0,ht={isNothing:BI,isObject:DI,toArray:PI,repeat:FI,isNegativeZero:RI,extend:OI};function ph(e,t){var r="",n=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
185
+
186
+ `+e.mark.snippet),n+" "+r):n}x(ph,"formatError");function xi(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=ph(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}x(xi,"YAMLException$1");xi.prototype=Object.create(Error.prototype);xi.prototype.constructor=xi;xi.prototype.toString=x(function(t){return this.name+": "+ph(this,t)},"toString");var Wt=xi;function ja(e,t,r,n,i){var s="",a="",o=Math.floor(i/2)-1;return n-t>o&&(s=" ... ",t=n-o+s.length),r-n>o&&(a=" ...",r=n+o-a.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+a,pos:n-t+s.length}}x(ja,"getLine");function Ba(e,t){return ht.repeat(" ",t-e.length)+e}x(Ba,"padStart");function z0(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],i=[],s,a=-1;s=r.exec(e.buffer);)i.push(s.index),n.push(s.index+s[0].length),e.position<=s.index&&a<0&&(a=n.length-2);a<0&&(a=n.length-1);var o="",l,c,u=Math.min(e.line+t.linesAfter,i.length).toString().length,h=t.maxLength-(t.indent+u+3);for(l=1;l<=t.linesBefore&&!(a-l<0);l++)c=ja(e.buffer,n[a-l],i[a-l],e.position-(n[a]-n[a-l]),h),o=ht.repeat(" ",t.indent)+Ba((e.line-l+1).toString(),u)+" | "+c.str+`
187
+ `+o;for(c=ja(e.buffer,n[a],i[a],e.position,h),o+=ht.repeat(" ",t.indent)+Ba((e.line+1).toString(),u)+" | "+c.str+`
188
+ `,o+=ht.repeat("-",t.indent+u+3+c.pos)+`^
189
+ `,l=1;l<=t.linesAfter&&!(a+l>=i.length);l++)c=ja(e.buffer,n[a+l],i[a+l],e.position-(n[a]-n[a+l]),h),o+=ht.repeat(" ",t.indent)+Ba((e.line+l+1).toString(),u)+" | "+c.str+`
190
+ `;return o.replace(/\n$/,"")}x(z0,"makeSnippet");var zI=z0,HI=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],WI=["scalar","sequence","mapping"];function H0(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}x(H0,"compileStyleAliases");function W0(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(HI.indexOf(r)===-1)throw new Wt('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=H0(t.styleAliases||null),WI.indexOf(this.kind)===-1)throw new Wt('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}x(W0,"Type$1");var _t=W0;function Pc(e,t){var r=[];return e[t].forEach(function(n){var i=r.length;r.forEach(function(s,a){s.tag===n.tag&&s.kind===n.kind&&s.multi===n.multi&&(i=a)}),r[i]=n}),r}x(Pc,"compileList");function q0(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function n(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(x(n,"collectType"),t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(n);return e}x(q0,"compileMap");function ao(e){return this.extend(e)}x(ao,"Schema$1");ao.prototype.extend=x(function(t){var r=[],n=[];if(t instanceof _t)n.push(t);else if(Array.isArray(t))n=n.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(r=r.concat(t.implicit)),t.explicit&&(n=n.concat(t.explicit));else throw new Wt("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(s){if(!(s instanceof _t))throw new Wt("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new Wt("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new Wt("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(s){if(!(s instanceof _t))throw new Wt("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(ao.prototype);return i.implicit=(this.implicit||[]).concat(r),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=Pc(i,"implicit"),i.compiledExplicit=Pc(i,"explicit"),i.compiledTypeMap=q0(i.compiledImplicit,i.compiledExplicit),i},"extend");var qI=ao,UI=new _t("tag:yaml.org,2002:str",{kind:"scalar",construct:x(function(e){return e!==null?e:""},"construct")}),VI=new _t("tag:yaml.org,2002:seq",{kind:"sequence",construct:x(function(e){return e!==null?e:[]},"construct")}),GI=new _t("tag:yaml.org,2002:map",{kind:"mapping",construct:x(function(e){return e!==null?e:{}},"construct")}),YI=new qI({explicit:[UI,VI,GI]});function U0(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}x(U0,"resolveYamlNull");function V0(){return null}x(V0,"constructYamlNull");function G0(e){return e===null}x(G0,"isNull");var XI=new _t("tag:yaml.org,2002:null",{kind:"scalar",resolve:U0,construct:V0,predicate:G0,represent:{canonical:x(function(){return"~"},"canonical"),lowercase:x(function(){return"null"},"lowercase"),uppercase:x(function(){return"NULL"},"uppercase"),camelcase:x(function(){return"Null"},"camelcase"),empty:x(function(){return""},"empty")},defaultStyle:"lowercase"});function Y0(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}x(Y0,"resolveYamlBoolean");function X0(e){return e==="true"||e==="True"||e==="TRUE"}x(X0,"constructYamlBoolean");function Q0(e){return Object.prototype.toString.call(e)==="[object Boolean]"}x(Q0,"isBoolean");var QI=new _t("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Y0,construct:X0,predicate:Q0,represent:{lowercase:x(function(e){return e?"true":"false"},"lowercase"),uppercase:x(function(e){return e?"TRUE":"FALSE"},"uppercase"),camelcase:x(function(e){return e?"True":"False"},"camelcase")},defaultStyle:"lowercase"});function K0(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}x(K0,"isHexCode");function Z0(e){return 48<=e&&e<=55}x(Z0,"isOctCode");function J0(e){return 48<=e&&e<=57}x(J0,"isDecCode");function ex(e){if(e===null)return!1;var t=e.length,r=0,n=!1,i;if(!t)return!1;if(i=e[r],(i==="-"||i==="+")&&(i=e[++r]),i==="0"){if(r+1===t)return!0;if(i=e[++r],i==="b"){for(r++;r<t;r++)if(i=e[r],i!=="_"){if(i!=="0"&&i!=="1")return!1;n=!0}return n&&i!=="_"}if(i==="x"){for(r++;r<t;r++)if(i=e[r],i!=="_"){if(!K0(e.charCodeAt(r)))return!1;n=!0}return n&&i!=="_"}if(i==="o"){for(r++;r<t;r++)if(i=e[r],i!=="_"){if(!Z0(e.charCodeAt(r)))return!1;n=!0}return n&&i!=="_"}}if(i==="_")return!1;for(;r<t;r++)if(i=e[r],i!=="_"){if(!J0(e.charCodeAt(r)))return!1;n=!0}return!(!n||i==="_")}x(ex,"resolveYamlInteger");function tx(e){var t=e,r=1,n;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),n=t[0],(n==="-"||n==="+")&&(n==="-"&&(r=-1),t=t.slice(1),n=t[0]),t==="0")return 0;if(n==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}x(tx,"constructYamlInteger");function rx(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!ht.isNegativeZero(e)}x(rx,"isInteger");var KI=new _t("tag:yaml.org,2002:int",{kind:"scalar",resolve:ex,construct:tx,predicate:rx,represent:{binary:x(function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},"binary"),octal:x(function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},"octal"),decimal:x(function(e){return e.toString(10)},"decimal"),hexadecimal:x(function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),ZI=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function nx(e){return!(e===null||!ZI.test(e)||e[e.length-1]==="_")}x(nx,"resolveYamlFloat");function ix(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}x(ix,"constructYamlFloat");var JI=/^[-+]?[0-9]+e/;function sx(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(ht.isNegativeZero(e))return"-0.0";return r=e.toString(10),JI.test(r)?r.replace("e",".e"):r}x(sx,"representYamlFloat");function ax(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ht.isNegativeZero(e))}x(ax,"isFloat");var e$=new _t("tag:yaml.org,2002:float",{kind:"scalar",resolve:nx,construct:ix,predicate:ax,represent:sx,defaultStyle:"lowercase"}),ox=YI.extend({implicit:[XI,QI,KI,e$]}),t$=ox,lx=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),cx=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function ux(e){return e===null?!1:lx.exec(e)!==null||cx.exec(e)!==null}x(ux,"resolveYamlTimestamp");function hx(e){var t,r,n,i,s,a,o,l=0,c=null,u,h,f;if(t=lx.exec(e),t===null&&(t=cx.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],n=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(r,n,i));if(s=+t[4],a=+t[5],o=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(u=+t[10],h=+(t[11]||0),c=(u*60+h)*6e4,t[9]==="-"&&(c=-c)),f=new Date(Date.UTC(r,n,i,s,a,o,l)),c&&f.setTime(f.getTime()-c),f}x(hx,"constructYamlTimestamp");function dx(e){return e.toISOString()}x(dx,"representYamlTimestamp");var r$=new _t("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:ux,construct:hx,instanceOf:Date,represent:dx});function fx(e){return e==="<<"||e===null}x(fx,"resolveYamlMerge");var n$=new _t("tag:yaml.org,2002:merge",{kind:"scalar",resolve:fx}),gh=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
191
+ \r`;function px(e){if(e===null)return!1;var t,r,n=0,i=e.length,s=gh;for(r=0;r<i;r++)if(t=s.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;n+=6}return n%8===0}x(px,"resolveYamlBinary");function gx(e){var t,r,n=e.replace(/[\r\n=]/g,""),i=n.length,s=gh,a=0,o=[];for(t=0;t<i;t++)t%4===0&&t&&(o.push(a>>16&255),o.push(a>>8&255),o.push(a&255)),a=a<<6|s.indexOf(n.charAt(t));return r=i%4*6,r===0?(o.push(a>>16&255),o.push(a>>8&255),o.push(a&255)):r===18?(o.push(a>>10&255),o.push(a>>2&255)):r===12&&o.push(a>>4&255),new Uint8Array(o)}x(gx,"constructYamlBinary");function mx(e){var t="",r=0,n,i,s=e.length,a=gh;for(n=0;n<s;n++)n%3===0&&n&&(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[n];return i=s%3,i===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):i===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):i===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}x(mx,"representYamlBinary");function xx(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}x(xx,"isBinary");var i$=new _t("tag:yaml.org,2002:binary",{kind:"scalar",resolve:px,construct:gx,predicate:xx,represent:mx}),s$=Object.prototype.hasOwnProperty,a$=Object.prototype.toString;function yx(e){if(e===null)return!0;var t=[],r,n,i,s,a,o=e;for(r=0,n=o.length;r<n;r+=1){if(i=o[r],a=!1,a$.call(i)!=="[object Object]")return!1;for(s in i)if(s$.call(i,s))if(!a)a=!0;else return!1;if(!a)return!1;if(t.indexOf(s)===-1)t.push(s);else return!1}return!0}x(yx,"resolveYamlOmap");function bx(e){return e!==null?e:[]}x(bx,"constructYamlOmap");var o$=new _t("tag:yaml.org,2002:omap",{kind:"sequence",resolve:yx,construct:bx}),l$=Object.prototype.toString;function kx(e){if(e===null)return!0;var t,r,n,i,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(n=a[t],l$.call(n)!=="[object Object]"||(i=Object.keys(n),i.length!==1))return!1;s[t]=[i[0],n[i[0]]]}return!0}x(kx,"resolveYamlPairs");function wx(e){if(e===null)return[];var t,r,n,i,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1)n=a[t],i=Object.keys(n),s[t]=[i[0],n[i[0]]];return s}x(wx,"constructYamlPairs");var c$=new _t("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:kx,construct:wx}),u$=Object.prototype.hasOwnProperty;function vx(e){if(e===null)return!0;var t,r=e;for(t in r)if(u$.call(r,t)&&r[t]!==null)return!1;return!0}x(vx,"resolveYamlSet");function Cx(e){return e!==null?e:{}}x(Cx,"constructYamlSet");var h$=new _t("tag:yaml.org,2002:set",{kind:"mapping",resolve:vx,construct:Cx}),Sx=t$.extend({implicit:[r$,n$],explicit:[i$,o$,c$,h$]}),rn=Object.prototype.hasOwnProperty,oo=1,_x=2,Tx=3,lo=4,zl=1,d$=2,Ff=3,f$=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,p$=/[\x85\u2028\u2029]/,g$=/[,\[\]\{\}]/,Ex=/^(?:!|!!|![a-z\-]+!)$/i,Ax=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Fc(e){return Object.prototype.toString.call(e)}x(Fc,"_class");function hr(e){return e===10||e===13}x(hr,"is_EOL");function en(e){return e===9||e===32}x(en,"is_WHITE_SPACE");function Bt(e){return e===9||e===32||e===10||e===13}x(Bt,"is_WS_OR_EOL");function Cn(e){return e===44||e===91||e===93||e===123||e===125}x(Cn,"is_FLOW_INDICATOR");function Mx(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}x(Mx,"fromHexCode");function Nx(e){return e===120?2:e===117?4:e===85?8:0}x(Nx,"escapedHexLen");function Lx(e){return 48<=e&&e<=57?e-48:-1}x(Lx,"fromDecimalCode");function Rc(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
192
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}x(Rc,"simpleEscapeSequence");function Ix(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}x(Ix,"charFromCodepoint");var $x=new Array(256),jx=new Array(256);for(xn=0;xn<256;xn++)$x[xn]=Rc(xn)?1:0,jx[xn]=Rc(xn);var xn;function Bx(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Sx,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}x(Bx,"State$1");function mh(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=zI(r),new Wt(t,r)}x(mh,"generateError");function de(e,t){throw mh(e,t)}x(de,"throwError");function Ms(e,t){e.onWarning&&e.onWarning.call(null,mh(e,t))}x(Ms,"throwWarning");var Rf={YAML:x(function(t,r,n){var i,s,a;t.version!==null&&de(t,"duplication of %YAML directive"),n.length!==1&&de(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&de(t,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),a=parseInt(i[2],10),s!==1&&de(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=a<2,a!==1&&a!==2&&Ms(t,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:x(function(t,r,n){var i,s;n.length!==2&&de(t,"TAG directive accepts exactly two arguments"),i=n[0],s=n[1],Ex.test(i)||de(t,"ill-formed tag handle (first argument) of the TAG directive"),rn.call(t.tagMap,i)&&de(t,'there is a previously declared suffix for "'+i+'" tag handle'),Ax.test(s)||de(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{de(t,"tag prefix is malformed: "+s)}t.tagMap[i]=s},"handleTagDirective")};function Fr(e,t,r,n){var i,s,a,o;if(t<r){if(o=e.input.slice(t,r),n)for(i=0,s=o.length;i<s;i+=1)a=o.charCodeAt(i),a===9||32<=a&&a<=1114111||de(e,"expected valid JSON character");else f$.test(o)&&de(e,"the stream contains non-printable characters");e.result+=o}}x(Fr,"captureSegment");function Oc(e,t,r,n){var i,s,a,o;for(ht.isObject(r)||de(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(r),a=0,o=i.length;a<o;a+=1)s=i[a],rn.call(t,s)||(t[s]=r[s],n[s]=!0)}x(Oc,"mergeMappings");function Sn(e,t,r,n,i,s,a,o,l){var c,u;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),c=0,u=i.length;c<u;c+=1)Array.isArray(i[c])&&de(e,"nested arrays are not supported inside keys"),typeof i=="object"&&Fc(i[c])==="[object Object]"&&(i[c]="[object Object]");if(typeof i=="object"&&Fc(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(c=0,u=s.length;c<u;c+=1)Oc(e,t,s[c],r);else Oc(e,t,s,r);else!e.json&&!rn.call(r,i)&&rn.call(t,i)&&(e.line=a||e.line,e.lineStart=o||e.lineStart,e.position=l||e.position,de(e,"duplicated mapping key")),i==="__proto__"?Object.defineProperty(t,i,{configurable:!0,enumerable:!0,writable:!0,value:s}):t[i]=s,delete r[i];return t}x(Sn,"storeMappingPair");function qo(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):de(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}x(qo,"readLineBreak");function et(e,t,r){for(var n=0,i=e.input.charCodeAt(e.position);i!==0;){for(;en(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(hr(i))for(qo(e),i=e.input.charCodeAt(e.position),n++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return r!==-1&&n!==0&&e.lineIndent<r&&Ms(e,"deficient indentation"),n}x(et,"skipSeparationSpace");function Gs(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||Bt(r)))}x(Gs,"testDocumentSeparator");function Uo(e,t){t===1?e.result+=" ":t>1&&(e.result+=ht.repeat(`
193
+ `,t-1))}x(Uo,"writeFoldedLines");function Dx(e,t,r){var n,i,s,a,o,l,c,u,h=e.kind,f=e.result,d;if(d=e.input.charCodeAt(e.position),Bt(d)||Cn(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(i=e.input.charCodeAt(e.position+1),Bt(i)||r&&Cn(i)))return!1;for(e.kind="scalar",e.result="",s=a=e.position,o=!1;d!==0;){if(d===58){if(i=e.input.charCodeAt(e.position+1),Bt(i)||r&&Cn(i))break}else if(d===35){if(n=e.input.charCodeAt(e.position-1),Bt(n))break}else{if(e.position===e.lineStart&&Gs(e)||r&&Cn(d))break;if(hr(d))if(l=e.line,c=e.lineStart,u=e.lineIndent,et(e,!1,-1),e.lineIndent>=t){o=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=l,e.lineStart=c,e.lineIndent=u;break}}o&&(Fr(e,s,a,!1),Uo(e,e.line-l),s=a=e.position,o=!1),en(d)||(a=e.position+1),d=e.input.charCodeAt(++e.position)}return Fr(e,s,a,!1),e.result?!0:(e.kind=h,e.result=f,!1)}x(Dx,"readPlainScalar");function Px(e,t){var r,n,i;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(Fr(e,n,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)n=e.position,e.position++,i=e.position;else return!0;else hr(r)?(Fr(e,n,i,!0),Uo(e,et(e,!1,t)),n=i=e.position):e.position===e.lineStart&&Gs(e)?de(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);de(e,"unexpected end of the stream within a single quoted scalar")}x(Px,"readSingleQuotedScalar");function Fx(e,t){var r,n,i,s,a,o;if(o=e.input.charCodeAt(e.position),o!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=n=e.position;(o=e.input.charCodeAt(e.position))!==0;){if(o===34)return Fr(e,r,e.position,!0),e.position++,!0;if(o===92){if(Fr(e,r,e.position,!0),o=e.input.charCodeAt(++e.position),hr(o))et(e,!1,t);else if(o<256&&$x[o])e.result+=jx[o],e.position++;else if((a=Nx(o))>0){for(i=a,s=0;i>0;i--)o=e.input.charCodeAt(++e.position),(a=Mx(o))>=0?s=(s<<4)+a:de(e,"expected hexadecimal character");e.result+=Ix(s),e.position++}else de(e,"unknown escape sequence");r=n=e.position}else hr(o)?(Fr(e,r,n,!0),Uo(e,et(e,!1,t)),r=n=e.position):e.position===e.lineStart&&Gs(e)?de(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}de(e,"unexpected end of the stream within a double quoted scalar")}x(Fx,"readDoubleQuotedScalar");function Rx(e,t){var r=!0,n,i,s,a=e.tag,o,l=e.anchor,c,u,h,f,d,g=Object.create(null),m,b,y,k;if(k=e.input.charCodeAt(e.position),k===91)u=93,d=!1,o=[];else if(k===123)u=125,d=!0,o={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),k=e.input.charCodeAt(++e.position);k!==0;){if(et(e,!0,t),k=e.input.charCodeAt(e.position),k===u)return e.position++,e.tag=a,e.anchor=l,e.kind=d?"mapping":"sequence",e.result=o,!0;r?k===44&&de(e,"expected the node content, but found ','"):de(e,"missed comma between flow collection entries"),b=m=y=null,h=f=!1,k===63&&(c=e.input.charCodeAt(e.position+1),Bt(c)&&(h=f=!0,e.position++,et(e,!0,t))),n=e.line,i=e.lineStart,s=e.position,$n(e,t,oo,!1,!0),b=e.tag,m=e.result,et(e,!0,t),k=e.input.charCodeAt(e.position),(f||e.line===n)&&k===58&&(h=!0,k=e.input.charCodeAt(++e.position),et(e,!0,t),$n(e,t,oo,!1,!0),y=e.result),d?Sn(e,o,g,b,m,y,n,i,s):h?o.push(Sn(e,null,g,b,m,y,n,i,s)):o.push(m),et(e,!0,t),k=e.input.charCodeAt(e.position),k===44?(r=!0,k=e.input.charCodeAt(++e.position)):r=!1}de(e,"unexpected end of the stream within a flow collection")}x(Rx,"readFlowCollection");function Ox(e,t){var r,n,i=zl,s=!1,a=!1,o=t,l=0,c=!1,u,h;if(h=e.input.charCodeAt(e.position),h===124)n=!1;else if(h===62)n=!0;else return!1;for(e.kind="scalar",e.result="";h!==0;)if(h=e.input.charCodeAt(++e.position),h===43||h===45)zl===i?i=h===43?Ff:d$:de(e,"repeat of a chomping mode identifier");else if((u=Lx(h))>=0)u===0?de(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?de(e,"repeat of an indentation width identifier"):(o=t+u-1,a=!0);else break;if(en(h)){do h=e.input.charCodeAt(++e.position);while(en(h));if(h===35)do h=e.input.charCodeAt(++e.position);while(!hr(h)&&h!==0)}for(;h!==0;){for(qo(e),e.lineIndent=0,h=e.input.charCodeAt(e.position);(!a||e.lineIndent<o)&&h===32;)e.lineIndent++,h=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>o&&(o=e.lineIndent),hr(h)){l++;continue}if(e.lineIndent<o){i===Ff?e.result+=ht.repeat(`
194
+ `,s?1+l:l):i===zl&&s&&(e.result+=`
195
+ `);break}for(n?en(h)?(c=!0,e.result+=ht.repeat(`
196
+ `,s?1+l:l)):c?(c=!1,e.result+=ht.repeat(`
197
+ `,l+1)):l===0?s&&(e.result+=" "):e.result+=ht.repeat(`
198
+ `,l):e.result+=ht.repeat(`
199
+ `,s?1+l:l),s=!0,a=!0,l=0,r=e.position;!hr(h)&&h!==0;)h=e.input.charCodeAt(++e.position);Fr(e,r,e.position,!1)}return!0}x(Ox,"readBlockScalar");function zc(e,t){var r,n=e.tag,i=e.anchor,s=[],a,o=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,de(e,"tab characters must not be used in indentation")),!(l!==45||(a=e.input.charCodeAt(e.position+1),!Bt(a))));){if(o=!0,e.position++,et(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(r=e.line,$n(e,t,Tx,!1,!0),s.push(e.result),et(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&l!==0)de(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return o?(e.tag=n,e.anchor=i,e.kind="sequence",e.result=s,!0):!1}x(zc,"readBlockSequence");function zx(e,t,r){var n,i,s,a,o,l,c=e.tag,u=e.anchor,h={},f=Object.create(null),d=null,g=null,m=null,b=!1,y=!1,k;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=h),k=e.input.charCodeAt(e.position);k!==0;){if(!b&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,de(e,"tab characters must not be used in indentation")),n=e.input.charCodeAt(e.position+1),s=e.line,(k===63||k===58)&&Bt(n))k===63?(b&&(Sn(e,h,f,d,g,null,a,o,l),d=g=m=null),y=!0,b=!0,i=!0):b?(b=!1,i=!0):de(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,k=n;else{if(a=e.line,o=e.lineStart,l=e.position,!$n(e,r,_x,!1,!0))break;if(e.line===s){for(k=e.input.charCodeAt(e.position);en(k);)k=e.input.charCodeAt(++e.position);if(k===58)k=e.input.charCodeAt(++e.position),Bt(k)||de(e,"a whitespace character is expected after the key-value separator within a block mapping"),b&&(Sn(e,h,f,d,g,null,a,o,l),d=g=m=null),y=!0,b=!1,i=!1,d=e.tag,g=e.result;else if(y)de(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=u,!0}else if(y)de(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=u,!0}if((e.line===s||e.lineIndent>t)&&(b&&(a=e.line,o=e.lineStart,l=e.position),$n(e,t,lo,!0,i)&&(b?g=e.result:m=e.result),b||(Sn(e,h,f,d,g,m,a,o,l),d=g=m=null),et(e,!0,-1),k=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&k!==0)de(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return b&&Sn(e,h,f,d,g,null,a,o,l),y&&(e.tag=c,e.anchor=u,e.kind="mapping",e.result=h),y}x(zx,"readBlockMapping");function Hx(e){var t,r=!1,n=!1,i,s,a;if(a=e.input.charCodeAt(e.position),a!==33)return!1;if(e.tag!==null&&de(e,"duplication of a tag property"),a=e.input.charCodeAt(++e.position),a===60?(r=!0,a=e.input.charCodeAt(++e.position)):a===33?(n=!0,i="!!",a=e.input.charCodeAt(++e.position)):i="!",t=e.position,r){do a=e.input.charCodeAt(++e.position);while(a!==0&&a!==62);e.position<e.length?(s=e.input.slice(t,e.position),a=e.input.charCodeAt(++e.position)):de(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!Bt(a);)a===33&&(n?de(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),Ex.test(i)||de(e,"named tag handle cannot contain such characters"),n=!0,t=e.position+1)),a=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),g$.test(s)&&de(e,"tag suffix cannot contain flow indicator characters")}s&&!Ax.test(s)&&de(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{de(e,"tag name is malformed: "+s)}return r?e.tag=s:rn.call(e.tagMap,i)?e.tag=e.tagMap[i]+s:i==="!"?e.tag="!"+s:i==="!!"?e.tag="tag:yaml.org,2002:"+s:de(e,'undeclared tag handle "'+i+'"'),!0}x(Hx,"readTagProperty");function Wx(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&de(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Bt(r)&&!Cn(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&de(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}x(Wx,"readAnchorProperty");function qx(e){var t,r,n;if(n=e.input.charCodeAt(e.position),n!==42)return!1;for(n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!Bt(n)&&!Cn(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&de(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),rn.call(e.anchorMap,r)||de(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],et(e,!0,-1),!0}x(qx,"readAlias");function $n(e,t,r,n,i){var s,a,o,l=1,c=!1,u=!1,h,f,d,g,m,b;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=a=o=lo===r||Tx===r,n&&et(e,!0,-1)&&(c=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;Hx(e)||Wx(e);)et(e,!0,-1)?(c=!0,o=s,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):o=!1;if(o&&(o=c||i),(l===1||lo===r)&&(oo===r||_x===r?m=t:m=t+1,b=e.position-e.lineStart,l===1?o&&(zc(e,b)||zx(e,b,m))||Rx(e,m)?u=!0:(a&&Ox(e,m)||Px(e,m)||Fx(e,m)?u=!0:qx(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&de(e,"alias node should not have any properties")):Dx(e,m,oo===r)&&(u=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(u=o&&zc(e,b))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&de(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),h=0,f=e.implicitTypes.length;h<f;h+=1)if(g=e.implicitTypes[h],g.resolve(e.result)){e.result=g.construct(e.result),e.tag=g.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(rn.call(e.typeMap[e.kind||"fallback"],e.tag))g=e.typeMap[e.kind||"fallback"][e.tag];else for(g=null,d=e.typeMap.multi[e.kind||"fallback"],h=0,f=d.length;h<f;h+=1)if(e.tag.slice(0,d[h].tag.length)===d[h].tag){g=d[h];break}g||de(e,"unknown tag !<"+e.tag+">"),e.result!==null&&g.kind!==e.kind&&de(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):de(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||u}x($n,"composeNode");function Ux(e){var t=e.position,r,n,i,s=!1,a;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(a=e.input.charCodeAt(e.position))!==0&&(et(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(s=!0,a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!Bt(a);)a=e.input.charCodeAt(++e.position);for(n=e.input.slice(r,e.position),i=[],n.length<1&&de(e,"directive name must not be less than one character in length");a!==0;){for(;en(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!hr(a));break}if(hr(a))break;for(r=e.position;a!==0&&!Bt(a);)a=e.input.charCodeAt(++e.position);i.push(e.input.slice(r,e.position))}a!==0&&qo(e),rn.call(Rf,n)?Rf[n](e,n,i):Ms(e,'unknown document directive "'+n+'"')}if(et(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,et(e,!0,-1)):s&&de(e,"directives end mark is expected"),$n(e,e.lineIndent-1,lo,!1,!0),et(e,!0,-1),e.checkLineBreaks&&p$.test(e.input.slice(t,e.position))&&Ms(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Gs(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,et(e,!0,-1));return}if(e.position<e.length-1)de(e,"end of the stream or a document separator is expected");else return}x(Ux,"readDocument");function xh(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
200
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new Bx(e,t),n=e.indexOf("\0");for(n!==-1&&(r.position=n,de(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)Ux(r);return r.documents}x(xh,"loadDocuments");function m$(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var n=xh(e,r);if(typeof t!="function")return n;for(var i=0,s=n.length;i<s;i+=1)t(n[i])}x(m$,"loadAll$1");function Vx(e,t){var r=xh(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new Wt("expected a single document in the stream, but found more")}}x(Vx,"load$1");var x$=Vx,y$={load:x$},Gx=Object.prototype.toString,Yx=Object.prototype.hasOwnProperty,yh=65279,b$=9,Ns=10,k$=13,w$=32,v$=33,C$=34,Hc=35,S$=37,_$=38,T$=39,E$=42,Xx=44,A$=45,co=58,M$=61,N$=62,L$=63,I$=64,Qx=91,Kx=93,$$=96,Zx=123,j$=124,Jx=125,At={};At[0]="\\0";At[7]="\\a";At[8]="\\b";At[9]="\\t";At[10]="\\n";At[11]="\\v";At[12]="\\f";At[13]="\\r";At[27]="\\e";At[34]='\\"';At[92]="\\\\";At[133]="\\N";At[160]="\\_";At[8232]="\\L";At[8233]="\\P";var B$=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],D$=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function ey(e,t){var r,n,i,s,a,o,l;if(t===null)return{};for(r={},n=Object.keys(t),i=0,s=n.length;i<s;i+=1)a=n[i],o=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),l=e.compiledTypeMap.fallback[a],l&&Yx.call(l.styleAliases,o)&&(o=l.styleAliases[o]),r[a]=o;return r}x(ey,"compileStyleMap");function ty(e){var t,r,n;if(t=e.toString(16).toUpperCase(),e<=255)r="x",n=2;else if(e<=65535)r="u",n=4;else if(e<=4294967295)r="U",n=8;else throw new Wt("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+ht.repeat("0",n-t.length)+t}x(ty,"encodeHex");var P$=1,Ls=2;function ry(e){this.schema=e.schema||Sx,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=ht.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=ey(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Ls:P$,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}x(ry,"State");function Wc(e,t){for(var r=ht.repeat(" ",t),n=0,i=-1,s="",a,o=e.length;n<o;)i=e.indexOf(`
201
+ `,n),i===-1?(a=e.slice(n),n=o):(a=e.slice(n,i+1),n=i+1),a.length&&a!==`
202
+ `&&(s+=r),s+=a;return s}x(Wc,"indentString");function uo(e,t){return`
203
+ `+ht.repeat(" ",e.indent*t)}x(uo,"generateNextLine");function ny(e,t){var r,n,i;for(r=0,n=e.implicitTypes.length;r<n;r+=1)if(i=e.implicitTypes[r],i.resolve(t))return!0;return!1}x(ny,"testImplicitResolving");function Is(e){return e===w$||e===b$}x(Is,"isWhitespace");function yi(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==yh||65536<=e&&e<=1114111}x(yi,"isPrintable");function qc(e){return yi(e)&&e!==yh&&e!==k$&&e!==Ns}x(qc,"isNsCharOrWhitespace");function Uc(e,t,r){var n=qc(e),i=n&&!Is(e);return(r?n:n&&e!==Xx&&e!==Qx&&e!==Kx&&e!==Zx&&e!==Jx)&&e!==Hc&&!(t===co&&!i)||qc(t)&&!Is(t)&&e===Hc||t===co&&i}x(Uc,"isPlainSafe");function iy(e){return yi(e)&&e!==yh&&!Is(e)&&e!==A$&&e!==L$&&e!==co&&e!==Xx&&e!==Qx&&e!==Kx&&e!==Zx&&e!==Jx&&e!==Hc&&e!==_$&&e!==E$&&e!==v$&&e!==j$&&e!==M$&&e!==N$&&e!==T$&&e!==C$&&e!==S$&&e!==I$&&e!==$$}x(iy,"isPlainSafeFirst");function sy(e){return!Is(e)&&e!==co}x(sy,"isPlainSafeLast");function Kn(e,t){var r=e.charCodeAt(t),n;return r>=55296&&r<=56319&&t+1<e.length&&(n=e.charCodeAt(t+1),n>=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}x(Kn,"codePointAt");function bh(e){var t=/^\n* /;return t.test(e)}x(bh,"needIndentIndicator");var ay=1,Vc=2,oy=3,ly=4,Xn=5;function cy(e,t,r,n,i,s,a,o){var l,c=0,u=null,h=!1,f=!1,d=n!==-1,g=-1,m=iy(Kn(e,0))&&sy(Kn(e,e.length-1));if(t||a)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=Kn(e,l),!yi(c))return Xn;m=m&&Uc(c,u,o),u=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=Kn(e,l),c===Ns)h=!0,d&&(f=f||l-g-1>n&&e[g+1]!==" ",g=l);else if(!yi(c))return Xn;m=m&&Uc(c,u,o),u=c}f=f||d&&l-g-1>n&&e[g+1]!==" "}return!h&&!f?m&&!a&&!i(e)?ay:s===Ls?Xn:Vc:r>9&&bh(e)?Xn:a?s===Ls?Xn:Vc:f?ly:oy}x(cy,"chooseScalarStyle");function uy(e,t,r,n,i){e.dump=(function(){if(t.length===0)return e.quotingType===Ls?'""':"''";if(!e.noCompatMode&&(B$.indexOf(t)!==-1||D$.test(t)))return e.quotingType===Ls?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,r),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),o=n||e.flowLevel>-1&&r>=e.flowLevel;function l(c){return ny(e,c)}switch(x(l,"testAmbiguity"),cy(t,o,e.indent,a,l,e.quotingType,e.forceQuotes&&!n,i)){case ay:return t;case Vc:return"'"+t.replace(/'/g,"''")+"'";case oy:return"|"+Gc(t,e.indent)+Yc(Wc(t,s));case ly:return">"+Gc(t,e.indent)+Yc(Wc(hy(t,a),s));case Xn:return'"'+dy(t)+'"';default:throw new Wt("impossible error: invalid scalar style")}})()}x(uy,"writeScalar");function Gc(e,t){var r=bh(e)?String(t):"",n=e[e.length-1]===`
204
+ `,i=n&&(e[e.length-2]===`
205
+ `||e===`
206
+ `),s=i?"+":n?"":"-";return r+s+`
207
+ `}x(Gc,"blockHeader");function Yc(e){return e[e.length-1]===`
208
+ `?e.slice(0,-1):e}x(Yc,"dropEndingNewline");function hy(e,t){for(var r=/(\n+)([^\n]*)/g,n=(function(){var c=e.indexOf(`
209
+ `);return c=c!==-1?c:e.length,r.lastIndex=c,Xc(e.slice(0,c),t)})(),i=e[0]===`
210
+ `||e[0]===" ",s,a;a=r.exec(e);){var o=a[1],l=a[2];s=l[0]===" ",n+=o+(!i&&!s&&l!==""?`
211
+ `:"")+Xc(l,t),i=s}return n}x(hy,"foldString");function Xc(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,n,i=0,s,a=0,o=0,l="";n=r.exec(e);)o=n.index,o-i>t&&(s=a>i?a:o,l+=`
212
+ `+e.slice(i,s),i=s+1),a=o;return l+=`
213
+ `,e.length-i>t&&a>i?l+=e.slice(i,a)+`
214
+ `+e.slice(a+1):l+=e.slice(i),l.slice(1)}x(Xc,"foldLine");function dy(e){for(var t="",r=0,n,i=0;i<e.length;r>=65536?i+=2:i++)r=Kn(e,i),n=At[r],!n&&yi(r)?(t+=e[i],r>=65536&&(t+=e[i+1])):t+=n||ty(r);return t}x(dy,"escapeString");function fy(e,t,r){var n="",i=e.tag,s,a,o;for(s=0,a=r.length;s<a;s+=1)o=r[s],e.replacer&&(o=e.replacer.call(r,String(s),o)),(Cr(e,t,o,!1,!1)||typeof o>"u"&&Cr(e,t,null,!1,!1))&&(n!==""&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=i,e.dump="["+n+"]"}x(fy,"writeFlowSequence");function Qc(e,t,r,n){var i="",s=e.tag,a,o,l;for(a=0,o=r.length;a<o;a+=1)l=r[a],e.replacer&&(l=e.replacer.call(r,String(a),l)),(Cr(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&Cr(e,t+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=uo(e,t)),e.dump&&Ns===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=s,e.dump=i||"[]"}x(Qc,"writeBlockSequence");function py(e,t,r){var n="",i=e.tag,s=Object.keys(r),a,o,l,c,u;for(a=0,o=s.length;a<o;a+=1)u="",n!==""&&(u+=", "),e.condenseFlow&&(u+='"'),l=s[a],c=r[l],e.replacer&&(c=e.replacer.call(r,l,c)),Cr(e,t,l,!1,!1)&&(e.dump.length>1024&&(u+="? "),u+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Cr(e,t,c,!1,!1)&&(u+=e.dump,n+=u));e.tag=i,e.dump="{"+n+"}"}x(py,"writeFlowMapping");function gy(e,t,r,n){var i="",s=e.tag,a=Object.keys(r),o,l,c,u,h,f;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new Wt("sortKeys must be a boolean or a function");for(o=0,l=a.length;o<l;o+=1)f="",(!n||i!=="")&&(f+=uo(e,t)),c=a[o],u=r[c],e.replacer&&(u=e.replacer.call(r,c,u)),Cr(e,t+1,c,!0,!0,!0)&&(h=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,h&&(e.dump&&Ns===e.dump.charCodeAt(0)?f+="?":f+="? "),f+=e.dump,h&&(f+=uo(e,t)),Cr(e,t+1,u,!0,h)&&(e.dump&&Ns===e.dump.charCodeAt(0)?f+=":":f+=": ",f+=e.dump,i+=f));e.tag=s,e.dump=i||"{}"}x(gy,"writeBlockMapping");function Kc(e,t,r){var n,i,s,a,o,l;for(i=r?e.explicitTypes:e.implicitTypes,s=0,a=i.length;s<a;s+=1)if(o=i[s],(o.instanceOf||o.predicate)&&(!o.instanceOf||typeof t=="object"&&t instanceof o.instanceOf)&&(!o.predicate||o.predicate(t))){if(r?o.multi&&o.representName?e.tag=o.representName(t):e.tag=o.tag:e.tag="?",o.represent){if(l=e.styleMap[o.tag]||o.defaultStyle,Gx.call(o.represent)==="[object Function]")n=o.represent(t,l);else if(Yx.call(o.represent,l))n=o.represent[l](t,l);else throw new Wt("!<"+o.tag+'> tag resolver accepts not "'+l+'" style');e.dump=n}return!0}return!1}x(Kc,"detectType");function Cr(e,t,r,n,i,s,a){e.tag=null,e.dump=r,Kc(e,r,!1)||Kc(e,r,!0);var o=Gx.call(e.dump),l=n,c;n&&(n=e.flowLevel<0||e.flowLevel>t);var u=o==="[object Object]"||o==="[object Array]",h,f;if(u&&(h=e.duplicates.indexOf(r),f=h!==-1),(e.tag!==null&&e.tag!=="?"||f||e.indent!==2&&t>0)&&(i=!1),f&&e.usedDuplicates[h])e.dump="*ref_"+h;else{if(u&&f&&!e.usedDuplicates[h]&&(e.usedDuplicates[h]=!0),o==="[object Object]")n&&Object.keys(e.dump).length!==0?(gy(e,t,e.dump,i),f&&(e.dump="&ref_"+h+e.dump)):(py(e,t,e.dump),f&&(e.dump="&ref_"+h+" "+e.dump));else if(o==="[object Array]")n&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?Qc(e,t-1,e.dump,i):Qc(e,t,e.dump,i),f&&(e.dump="&ref_"+h+e.dump)):(fy(e,t,e.dump),f&&(e.dump="&ref_"+h+" "+e.dump));else if(o==="[object String]")e.tag!=="?"&&uy(e,e.dump,t,s,l);else{if(o==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Wt("unacceptable kind of an object to dump "+o)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}x(Cr,"writeNode");function my(e,t){var r=[],n=[],i,s;for(ho(e,r,n),i=0,s=n.length;i<s;i+=1)t.duplicates.push(r[n[i]]);t.usedDuplicates=new Array(s)}x(my,"getDuplicateReferences");function ho(e,t,r){var n,i,s;if(e!==null&&typeof e=="object")if(i=t.indexOf(e),i!==-1)r.indexOf(i)===-1&&r.push(i);else if(t.push(e),Array.isArray(e))for(i=0,s=e.length;i<s;i+=1)ho(e[i],t,r);else for(n=Object.keys(e),i=0,s=n.length;i<s;i+=1)ho(e[n[i]],t,r)}x(ho,"inspectNode");function F$(e,t){t=t||{};var r=new ry(t);r.noRefs||my(e,r);var n=e;return r.replacer&&(n=r.replacer.call({"":n},"",n)),Cr(r,0,n,!0,!0)?r.dump+`
215
+ `:""}x(F$,"dump$1");function R$(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}x(R$,"renamed");var O$=ox,z$=y$.load;/*! Bundled license information:
216
+
217
+ js-yaml/dist/js-yaml.mjs:
218
+ (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *)
219
+ */var vt={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4},Of={arrow_point:9,arrow_cross:12.5,arrow_circle:12.5};function ss(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=Ye(e),t=Ye(t);const[r,n]=[e.x,e.y],[i,s]=[t.x,t.y],a=i-r,o=s-n;return{angle:Math.atan(o/a),deltaX:a,deltaY:o}}x(ss,"calculateDeltaAndAngle");var Ye=x(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),H$=x(e=>({x:x(function(t,r,n){let i=0;const s=Ye(n[0]).x<Ye(n[n.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(vt,e.arrowTypeStart)){const{angle:d,deltaX:g}=ss(n[0],n[1]);i=vt[e.arrowTypeStart]*Math.cos(d)*(g>=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(vt,e.arrowTypeEnd)){const{angle:d,deltaX:g}=ss(n[n.length-1],n[n.length-2]);i=vt[e.arrowTypeEnd]*Math.cos(d)*(g>=0?1:-1)}const a=Math.abs(Ye(t).x-Ye(n[n.length-1]).x),o=Math.abs(Ye(t).y-Ye(n[n.length-1]).y),l=Math.abs(Ye(t).x-Ye(n[0]).x),c=Math.abs(Ye(t).y-Ye(n[0]).y),u=vt[e.arrowTypeStart],h=vt[e.arrowTypeEnd],f=1;if(a<h&&a>0&&o<h){let d=h+f-a;d*=s==="right"?-1:1,i-=d}if(l<u&&l>0&&c<u){let d=u+f-l;d*=s==="right"?-1:1,i+=d}return Ye(t).x+i},"x"),y:x(function(t,r,n){let i=0;const s=Ye(n[0]).y<Ye(n[n.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(vt,e.arrowTypeStart)){const{angle:d,deltaY:g}=ss(n[0],n[1]);i=vt[e.arrowTypeStart]*Math.abs(Math.sin(d))*(g>=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(vt,e.arrowTypeEnd)){const{angle:d,deltaY:g}=ss(n[n.length-1],n[n.length-2]);i=vt[e.arrowTypeEnd]*Math.abs(Math.sin(d))*(g>=0?1:-1)}const a=Math.abs(Ye(t).y-Ye(n[n.length-1]).y),o=Math.abs(Ye(t).x-Ye(n[n.length-1]).x),l=Math.abs(Ye(t).y-Ye(n[0]).y),c=Math.abs(Ye(t).x-Ye(n[0]).x),u=vt[e.arrowTypeStart],h=vt[e.arrowTypeEnd],f=1;if(a<h&&a>0&&o<h){let d=h+f-a;d*=s==="up"?-1:1,i-=d}if(l<u&&l>0&&c<u){let d=u+f-l;d*=s==="up"?-1:1,i+=d}return Ye(t).y+i},"y")}),"getLineFunctionsWithOffset"),kh=x(({flowchart:e})=>{const t=e?.subGraphTitleMargin?.top??0,r=e?.subGraphTitleMargin?.bottom??0,n=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:n}},"getSubGraphTitleMargins"),W$=x(e=>{const{handDrawnSeed:t}=Pe();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),Si=x(e=>{const t=q$([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),q$=x(e=>{const t=new Map;return e.forEach(r=>{const[n,i]=r.split(":");t.set(n.trim(),i?.trim())}),t},"styles2Map"),xy=x(e=>e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens","isLabelStyle"),ce=x(e=>{const{stylesArray:t}=Si(e),r=[],n=[],i=[],s=[];return t.forEach(a=>{const o=a[0];xy(o)?r.push(a.join(":")+" !important"):(n.push(a.join(":")+" !important"),o.includes("stroke")&&i.push(a.join(":")+" !important"),o==="fill"&&s.push(a.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:t,borderStyles:i,backgroundStyles:s}},"styles2String"),le=x((e,t)=>{const{themeVariables:r,handDrawnSeed:n}=Pe(),{nodeBorder:i,mainBkg:s}=r,{stylesMap:a}=Si(e);return Object.assign({roughness:.7,fill:a.get("fill")||s,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:a.get("stroke")||i,seed:n,strokeWidth:a.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:U$(a.get("stroke-dasharray"))},t)},"userNodeOverrides"),U$=x(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const i=isNaN(t[0])?0:t[0];return[i,i]}const r=isNaN(t[0])?0:t[0],n=isNaN(t[1])?0:t[1];return[r,n]},"getStrokeDashArray"),Yi={},ct={},zf;function V$(){return zf||(zf=1,Object.defineProperty(ct,"__esModule",{value:!0}),ct.BLANK_URL=ct.relativeFirstCharacters=ct.whitespaceEscapeCharsRegex=ct.urlSchemeRegex=ct.ctrlCharactersRegex=ct.htmlCtrlEntityRegex=ct.htmlEntitiesRegex=ct.invalidProtocolRegex=void 0,ct.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,ct.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,ct.htmlCtrlEntityRegex=/&(newline|tab);/gi,ct.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,ct.urlSchemeRegex=/^.+(:|&colon;)/gim,ct.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,ct.relativeFirstCharacters=[".","/"],ct.BLANK_URL="about:blank"),ct}var Hf;function G$(){if(Hf)return Yi;Hf=1,Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.sanitizeUrl=void 0;var e=V$();function t(a){return e.relativeFirstCharacters.indexOf(a[0])>-1}function r(a){var o=a.replace(e.ctrlCharactersRegex,"");return o.replace(e.htmlEntitiesRegex,function(l,c){return String.fromCharCode(c)})}function n(a){return URL.canParse(a)}function i(a){try{return decodeURIComponent(a)}catch{return a}}function s(a){if(!a)return e.BLANK_URL;var o,l=i(a.trim());do l=r(l).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),l=i(l),o=l.match(e.ctrlCharactersRegex)||l.match(e.htmlEntitiesRegex)||l.match(e.htmlCtrlEntityRegex)||l.match(e.whitespaceEscapeCharsRegex);while(o&&o.length>0);var c=l;if(!c)return e.BLANK_URL;if(t(c))return c;var u=c.trimStart(),h=u.match(e.urlSchemeRegex);if(!h)return c;var f=h[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(f))return e.BLANK_URL;var d=u.replace(/\\/g,"/");if(f==="mailto:"||f.includes("://"))return d;if(f==="http:"||f==="https:"){if(!n(d))return e.BLANK_URL;var g=new URL(d);return g.protocol=g.protocol.toLowerCase(),g.hostname=g.hostname.toLowerCase(),g.toString()}return d}return Yi.sanitizeUrl=s,Yi}var Y$=G$(),yy=typeof global=="object"&&global&&global.Object===Object&&global,X$=typeof self=="object"&&self&&self.Object===Object&&self,Tr=yy||X$||Function("return this")(),fo=Tr.Symbol,by=Object.prototype,Q$=by.hasOwnProperty,K$=by.toString,Xi=fo?fo.toStringTag:void 0;function Z$(e){var t=Q$.call(e,Xi),r=e[Xi];try{e[Xi]=void 0;var n=!0}catch{}var i=K$.call(e);return n&&(t?e[Xi]=r:delete e[Xi]),i}var J$=Object.prototype,ej=J$.toString;function tj(e){return ej.call(e)}var rj="[object Null]",nj="[object Undefined]",Wf=fo?fo.toStringTag:void 0;function _i(e){return e==null?e===void 0?nj:rj:Wf&&Wf in Object(e)?Z$(e):tj(e)}function Fn(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ij="[object AsyncFunction]",sj="[object Function]",aj="[object GeneratorFunction]",oj="[object Proxy]";function wh(e){if(!Fn(e))return!1;var t=_i(e);return t==sj||t==aj||t==ij||t==oj}var Hl=Tr["__core-js_shared__"],qf=(function(){var e=/[^.]+$/.exec(Hl&&Hl.keys&&Hl.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function lj(e){return!!qf&&qf in e}var cj=Function.prototype,uj=cj.toString;function Rn(e){if(e!=null){try{return uj.call(e)}catch{}try{return e+""}catch{}}return""}var hj=/[\\^$.*+?()[\]{}|]/g,dj=/^\[object .+?Constructor\]$/,fj=Function.prototype,pj=Object.prototype,gj=fj.toString,mj=pj.hasOwnProperty,xj=RegExp("^"+gj.call(mj).replace(hj,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function yj(e){if(!Fn(e)||lj(e))return!1;var t=wh(e)?xj:dj;return t.test(Rn(e))}function bj(e,t){return e?.[t]}function On(e,t){var r=bj(e,t);return yj(r)?r:void 0}var $s=On(Object,"create");function kj(){this.__data__=$s?$s(null):{},this.size=0}function wj(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var vj="__lodash_hash_undefined__",Cj=Object.prototype,Sj=Cj.hasOwnProperty;function _j(e){var t=this.__data__;if($s){var r=t[e];return r===vj?void 0:r}return Sj.call(t,e)?t[e]:void 0}var Tj=Object.prototype,Ej=Tj.hasOwnProperty;function Aj(e){var t=this.__data__;return $s?t[e]!==void 0:Ej.call(t,e)}var Mj="__lodash_hash_undefined__";function Nj(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=$s&&t===void 0?Mj:t,this}function jn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}jn.prototype.clear=kj;jn.prototype.delete=wj;jn.prototype.get=_j;jn.prototype.has=Aj;jn.prototype.set=Nj;function Lj(){this.__data__=[],this.size=0}function Vo(e,t){return e===t||e!==e&&t!==t}function Go(e,t){for(var r=e.length;r--;)if(Vo(e[r][0],t))return r;return-1}var Ij=Array.prototype,$j=Ij.splice;function jj(e){var t=this.__data__,r=Go(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():$j.call(t,r,1),--this.size,!0}function Bj(e){var t=this.__data__,r=Go(t,e);return r<0?void 0:t[r][1]}function Dj(e){return Go(this.__data__,e)>-1}function Pj(e,t){var r=this.__data__,n=Go(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function Wr(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Wr.prototype.clear=Lj;Wr.prototype.delete=jj;Wr.prototype.get=Bj;Wr.prototype.has=Dj;Wr.prototype.set=Pj;var js=On(Tr,"Map");function Fj(){this.size=0,this.__data__={hash:new jn,map:new(js||Wr),string:new jn}}function Rj(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Yo(e,t){var r=e.__data__;return Rj(t)?r[typeof t=="string"?"string":"hash"]:r.map}function Oj(e){var t=Yo(this,e).delete(e);return this.size-=t?1:0,t}function zj(e){return Yo(this,e).get(e)}function Hj(e){return Yo(this,e).has(e)}function Wj(e,t){var r=Yo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function on(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}on.prototype.clear=Fj;on.prototype.delete=Oj;on.prototype.get=zj;on.prototype.has=Hj;on.prototype.set=Wj;var qj="Expected a function";function Ys(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(qj);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var a=e.apply(this,n);return r.cache=s.set(i,a)||s,a};return r.cache=new(Ys.Cache||on),r}Ys.Cache=on;function Uj(){this.__data__=new Wr,this.size=0}function Vj(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function Gj(e){return this.__data__.get(e)}function Yj(e){return this.__data__.has(e)}var Xj=200;function Qj(e,t){var r=this.__data__;if(r instanceof Wr){var n=r.__data__;if(!js||n.length<Xj-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new on(n)}return r.set(e,t),this.size=r.size,this}function Ti(e){var t=this.__data__=new Wr(e);this.size=t.size}Ti.prototype.clear=Uj;Ti.prototype.delete=Vj;Ti.prototype.get=Gj;Ti.prototype.has=Yj;Ti.prototype.set=Qj;var po=(function(){try{var e=On(Object,"defineProperty");return e({},"",{}),e}catch{}})();function vh(e,t,r){t=="__proto__"&&po?po(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function Zc(e,t,r){(r!==void 0&&!Vo(e[t],r)||r===void 0&&!(t in e))&&vh(e,t,r)}function Kj(e){return function(t,r,n){for(var i=-1,s=Object(t),a=n(t),o=a.length;o--;){var l=a[++i];if(r(s[l],l,s)===!1)break}return t}}var Zj=Kj(),ky=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Uf=ky&&typeof module=="object"&&module&&!module.nodeType&&module,Jj=Uf&&Uf.exports===ky,Vf=Jj?Tr.Buffer:void 0,Gf=Vf?Vf.allocUnsafe:void 0;function eB(e,t){if(t)return e.slice();var r=e.length,n=Gf?Gf(r):new e.constructor(r);return e.copy(n),n}var Yf=Tr.Uint8Array;function tB(e){var t=new e.constructor(e.byteLength);return new Yf(t).set(new Yf(e)),t}function rB(e,t){var r=t?tB(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function nB(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var Xf=Object.create,iB=(function(){function e(){}return function(t){if(!Fn(t))return{};if(Xf)return Xf(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}})();function wy(e,t){return function(r){return e(t(r))}}var vy=wy(Object.getPrototypeOf,Object),sB=Object.prototype;function Xo(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||sB;return e===r}function aB(e){return typeof e.constructor=="function"&&!Xo(e)?iB(vy(e)):{}}function Xs(e){return e!=null&&typeof e=="object"}var oB="[object Arguments]";function Qf(e){return Xs(e)&&_i(e)==oB}var Cy=Object.prototype,lB=Cy.hasOwnProperty,cB=Cy.propertyIsEnumerable,go=Qf((function(){return arguments})())?Qf:function(e){return Xs(e)&&lB.call(e,"callee")&&!cB.call(e,"callee")},mo=Array.isArray,uB=9007199254740991;function Sy(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=uB}function Qo(e){return e!=null&&Sy(e.length)&&!wh(e)}function hB(e){return Xs(e)&&Qo(e)}function dB(){return!1}var _y=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Kf=_y&&typeof module=="object"&&module&&!module.nodeType&&module,fB=Kf&&Kf.exports===_y,Zf=fB?Tr.Buffer:void 0,pB=Zf?Zf.isBuffer:void 0,Ch=pB||dB,gB="[object Object]",mB=Function.prototype,xB=Object.prototype,Ty=mB.toString,yB=xB.hasOwnProperty,bB=Ty.call(Object);function kB(e){if(!Xs(e)||_i(e)!=gB)return!1;var t=vy(e);if(t===null)return!0;var r=yB.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Ty.call(r)==bB}var wB="[object Arguments]",vB="[object Array]",CB="[object Boolean]",SB="[object Date]",_B="[object Error]",TB="[object Function]",EB="[object Map]",AB="[object Number]",MB="[object Object]",NB="[object RegExp]",LB="[object Set]",IB="[object String]",$B="[object WeakMap]",jB="[object ArrayBuffer]",BB="[object DataView]",DB="[object Float32Array]",PB="[object Float64Array]",FB="[object Int8Array]",RB="[object Int16Array]",OB="[object Int32Array]",zB="[object Uint8Array]",HB="[object Uint8ClampedArray]",WB="[object Uint16Array]",qB="[object Uint32Array]",Ge={};Ge[DB]=Ge[PB]=Ge[FB]=Ge[RB]=Ge[OB]=Ge[zB]=Ge[HB]=Ge[WB]=Ge[qB]=!0;Ge[wB]=Ge[vB]=Ge[jB]=Ge[CB]=Ge[BB]=Ge[SB]=Ge[_B]=Ge[TB]=Ge[EB]=Ge[AB]=Ge[MB]=Ge[NB]=Ge[LB]=Ge[IB]=Ge[$B]=!1;function UB(e){return Xs(e)&&Sy(e.length)&&!!Ge[_i(e)]}function VB(e){return function(t){return e(t)}}var Ey=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ys=Ey&&typeof module=="object"&&module&&!module.nodeType&&module,GB=ys&&ys.exports===Ey,Wl=GB&&yy.process,Jf=(function(){try{var e=ys&&ys.require&&ys.require("util").types;return e||Wl&&Wl.binding&&Wl.binding("util")}catch{}})(),ep=Jf&&Jf.isTypedArray,Sh=ep?VB(ep):UB;function Jc(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var YB=Object.prototype,XB=YB.hasOwnProperty;function QB(e,t,r){var n=e[t];(!(XB.call(e,t)&&Vo(n,r))||r===void 0&&!(t in e))&&vh(e,t,r)}function KB(e,t,r,n){var i=!r;r||(r={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=void 0;l===void 0&&(l=e[o]),i?vh(r,o,l):QB(r,o,l)}return r}function ZB(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var JB=9007199254740991,e3=/^(?:0|[1-9]\d*)$/;function Ay(e,t){var r=typeof e;return t=t??JB,!!t&&(r=="number"||r!="symbol"&&e3.test(e))&&e>-1&&e%1==0&&e<t}var t3=Object.prototype,r3=t3.hasOwnProperty;function n3(e,t){var r=mo(e),n=!r&&go(e),i=!r&&!n&&Ch(e),s=!r&&!n&&!i&&Sh(e),a=r||n||i||s,o=a?ZB(e.length,String):[],l=o.length;for(var c in e)(t||r3.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Ay(c,l)))&&o.push(c);return o}function i3(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var s3=Object.prototype,a3=s3.hasOwnProperty;function o3(e){if(!Fn(e))return i3(e);var t=Xo(e),r=[];for(var n in e)n=="constructor"&&(t||!a3.call(e,n))||r.push(n);return r}function My(e){return Qo(e)?n3(e,!0):o3(e)}function l3(e){return KB(e,My(e))}function c3(e,t,r,n,i,s,a){var o=Jc(e,r),l=Jc(t,r),c=a.get(l);if(c){Zc(e,r,c);return}var u=s?s(o,l,r+"",e,t,a):void 0,h=u===void 0;if(h){var f=mo(l),d=!f&&Ch(l),g=!f&&!d&&Sh(l);u=l,f||d||g?mo(o)?u=o:hB(o)?u=nB(o):d?(h=!1,u=eB(l,!0)):g?(h=!1,u=rB(l,!0)):u=[]:kB(l)||go(l)?(u=o,go(o)?u=l3(o):(!Fn(o)||wh(o))&&(u=aB(l))):h=!1}h&&(a.set(l,u),i(u,l,n,s,a),a.delete(l)),Zc(e,r,u)}function Ny(e,t,r,n,i){e!==t&&Zj(t,function(s,a){if(i||(i=new Ti),Fn(s))c3(e,t,a,r,Ny,n,i);else{var o=n?n(Jc(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),Zc(e,a,o)}},My)}function Ly(e){return e}function u3(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var tp=Math.max;function h3(e,t,r){return t=tp(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,s=tp(n.length-t,0),a=Array(s);++i<s;)a[i]=n[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=n[i];return o[t]=r(a),u3(e,this,o)}}function d3(e){return function(){return e}}var f3=po?function(e,t){return po(e,"toString",{configurable:!0,enumerable:!1,value:d3(t),writable:!0})}:Ly,p3=800,g3=16,m3=Date.now;function x3(e){var t=0,r=0;return function(){var n=m3(),i=g3-(n-r);if(r=n,i>0){if(++t>=p3)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var y3=x3(f3);function b3(e,t){return y3(h3(e,t,Ly),e+"")}function k3(e,t,r){if(!Fn(r))return!1;var n=typeof t;return(n=="number"?Qo(r)&&Ay(t,r.length):n=="string"&&t in r)?Vo(r[t],e):!1}function w3(e){return b3(function(t,r){var n=-1,i=r.length,s=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,a&&k3(r[0],r[1],a)&&(s=i<3?void 0:s,i=1),t=Object(t);++n<i;){var o=r[n];o&&e(t,o,n,s)}return t})}var v3=w3(function(e,t,r){Ny(e,t,r)}),C3="​",S3={curveBasis:$a,curveBasisClosed:TI,curveBasisOpen:EI,curveBumpX:m0,curveBumpY:x0,curveBundle:AI,curveCardinalClosed:MI,curveCardinalOpen:NI,curveCardinal:w0,curveCatmullRomClosed:LI,curveCatmullRomOpen:II,curveCatmullRom:C0,curveLinear:ro,curveLinearClosed:$I,curveMonotoneX:M0,curveMonotoneY:N0,curveNatural:I0,curveStep:$0,curveStepAfter:B0,curveStepBefore:j0},_3=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,T3=x(function(e,t){const r=Iy(e,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const a=r.map(o=>o.args);Ua(a),n=ut(n,[...a])}else n=r.args;if(!n)return;let i=Yu(e,t);const s="config";return n[s]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[s],delete n[s]),n},"detectInit"),Iy=x(function(e,t=null){try{const r=new RegExp(`[%]{2}(?![{]${_3.source})(?=[}][%]{2}).*
220
+ `,"ig");e=e.trim().replace(r,"").replace(/'/gm,'"'),X.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let n;const i=[];for(;(n=ms.exec(e))!==null;)if(n.index===ms.lastIndex&&ms.lastIndex++,n&&!t||t&&n[1]?.match(t)||t&&n[2]?.match(t)){const s=n[1]?n[1]:n[2],a=n[3]?n[3].trim():n[4]?JSON.parse(n[4].trim()):null;i.push({type:s,args:a})}return i.length===0?{type:e,args:null}:i.length===1?i[0]:i}catch(r){return X.error(`ERROR: ${r.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),E3=x(function(e){return e.replace(ms,"")},"removeDirectives"),A3=x(function(e,t){for(const[r,n]of t.entries())if(n.match(e))return r;return-1},"isSubstringInArray");function _h(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return S3[r]??t}x(_h,"interpolateToCurve");function $y(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?Y$.sanitizeUrl(r):r}x($y,"formatUrl");var M3=x((e,...t)=>{const r=e.split("."),n=r.length-1,i=r[n];let s=window;for(let a=0;a<n;a++)if(s=s[r[a]],!s){X.error(`Function name: ${e} not found in window`);return}s[i](...t)},"runFunc");function Th(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}x(Th,"distance");function jy(e){let t,r=0;e.forEach(i=>{r+=Th(i,t),t=i});const n=r/2;return Eh(e,n)}x(jy,"traverseEdge");function By(e){return e.length===1?e[0]:jy(e)}x(By,"calcLabelPosition");var rp=x((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),Eh=x((e,t)=>{let r,n=t;for(const i of e){if(r){const s=Th(i,r);if(s===0)return r;if(s<n)n-=s;else{const a=n/s;if(a<=0)return r;if(a>=1)return{x:i.x,y:i.y};if(a>0&&a<1)return{x:rp((1-a)*r.x+a*i.x,5),y:rp((1-a)*r.y+a*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),N3=x((e,t,r)=>{X.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const i=Eh(t,25),s=e?10:5,a=Math.atan2(t[0].y-i.y,t[0].x-i.x),o={x:0,y:0};return o.x=Math.sin(a)*s+(t[0].x+i.x)/2,o.y=-Math.cos(a)*s+(t[0].y+i.y)/2,o},"calcCardinalityPosition");function Dy(e,t,r){const n=structuredClone(r);X.info("our points",n),t!=="start_left"&&t!=="start_right"&&n.reverse();const i=25+e,s=Eh(n,i),a=10+e*.5,o=Math.atan2(n[0].y-s.y,n[0].x-s.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(o+Math.PI)*a+(n[0].x+s.x)/2,l.y=-Math.cos(o+Math.PI)*a+(n[0].y+s.y)/2):t==="end_right"?(l.x=Math.sin(o-Math.PI)*a+(n[0].x+s.x)/2-5,l.y=-Math.cos(o-Math.PI)*a+(n[0].y+s.y)/2-5):t==="end_left"?(l.x=Math.sin(o)*a+(n[0].x+s.x)/2-5,l.y=-Math.cos(o)*a+(n[0].y+s.y)/2-5):(l.x=Math.sin(o)*a+(n[0].x+s.x)/2,l.y=-Math.cos(o)*a+(n[0].y+s.y)/2),l}x(Dy,"calcTerminalLabelPosition");function Py(e){let t="",r="";for(const n of e)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":t=t+n+";");return{style:t,labelStyle:r}}x(Py,"getStylesFromArray");var np=0,L3=x(()=>(np++,"id-"+Math.random().toString(36).substr(2,12)+"-"+np),"generateId");function Fy(e){let t="";const r="0123456789abcdef",n=r.length;for(let i=0;i<e;i++)t+=r.charAt(Math.floor(Math.random()*n));return t}x(Fy,"makeRandomHex");var I3=x(e=>Fy(e.length),"random"),$3=x(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),j3=x(function(e,t){const r=t.text.replace(Ci.lineBreakRegex," "),[,n]=Ko(t.fontSize),i=e.append("text");i.attr("x",t.x),i.attr("y",t.y),i.style("text-anchor",t.anchor),i.style("font-family",t.fontFamily),i.style("font-size",n),i.style("font-weight",t.fontWeight),i.attr("fill",t.fill),t.class!==void 0&&i.attr("class",t.class);const s=i.append("tspan");return s.attr("x",t.x+t.textMargin*2),s.attr("fill",t.fill),s.text(r),i},"drawSimpleText"),B3=Ys((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),Ci.lineBreakRegex.test(e)))return e;const n=e.split(" ").filter(Boolean),i=[];let s="";return n.forEach((a,o)=>{const l=Or(`${a} `,r),c=Or(s,r);if(l>t){const{hyphenatedStrings:f,remainingWord:d}=D3(a,t,"-",r);i.push(s,...f),s=d}else c+l>=t?(i.push(s),s=a):s=[s,a].filter(Boolean).join(" ");o+1===n.length&&i.push(s)}),i.filter(a=>a!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),D3=Ys((e,t,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const i=[...e],s=[];let a="";return i.forEach((o,l)=>{const c=`${a}${o}`;if(Or(c,n)>=t){const h=l+1,f=i.length===h,d=`${c}${r}`;s.push(f?c:d),a=""}else a=c}),{hyphenatedStrings:s,remainingWord:a}},(e,t,r="-",n)=>`${e}${t}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);function Ry(e,t){return Ah(e,t).height}x(Ry,"calculateTextHeight");function Or(e,t){return Ah(e,t).width}x(Or,"calculateTextWidth");var Ah=Ys((e,t)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=t;if(!e)return{width:0,height:0};const[,s]=Ko(r),a=["sans-serif",n],o=e.split(Ci.lineBreakRegex),l=[],c=$e("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const u=c.append("svg");for(const f of a){let d=0;const g={width:0,height:0,lineHeight:0};for(const m of o){const b=$3();b.text=m||C3;const y=j3(u,b).style("font-size",s).style("font-weight",i).style("font-family",f),k=(y._groups||y)[0][0].getBBox();if(k.width===0&&k.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,k.width)),d=Math.round(k.height),g.height+=d,g.lineHeight=Math.round(Math.max(g.lineHeight,d))}l.push(g)}u.remove();const h=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[h]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),ci,P3=(ci=class{constructor(t=!1,r){this.count=0,this.count=r?r.length:0,this.next=t?()=>this.count++:()=>Date.now()}},x(ci,"InitIDGenerator"),ci),fa,F3=x(function(e){return fa=fa||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),fa.innerHTML=e,unescape(fa.textContent)},"entityDecode");function Mh(e){return"str"in e}x(Mh,"isDetailedError");var R3=x((e,t,r,n)=>{if(!n)return;const i=e.node()?.getBBox();i&&e.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",t)},"insertTitle"),Ko=x(e=>{if(typeof e=="number")return[e,e+"px"];const t=parseInt(e??"",10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+"px"]:[t,e]},"parseFontSize");function Nh(e,t){return v3({},e,t)}x(Nh,"cleanAndMerge");var cr={assignWithDepth:ut,wrapLabel:B3,calculateTextHeight:Ry,calculateTextWidth:Or,calculateTextDimensions:Ah,cleanAndMerge:Nh,detectInit:T3,detectDirective:Iy,isSubstringInArray:A3,interpolateToCurve:_h,calcLabelPosition:By,calcCardinalityPosition:N3,calcTerminalLabelPosition:Dy,formatUrl:$y,getStylesFromArray:Py,generateId:L3,random:I3,runFunc:M3,entityDecode:F3,insertTitle:R3,isLabelCoordinateInPath:Oy,parseFontSize:Ko,InitIDGenerator:P3},O3=x(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/#\w+;/g,function(r){const n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"fl°°"+n+"¶ß":"fl°"+n+"¶ß"}),t},"encodeEntities"),zn=x(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),x6=x((e,t,{counter:r=0,prefix:n,suffix:i},s)=>s||`${n?`${n}_`:""}${e}_${t}_${r}${i?`_${i}`:""}`,"getEdgeId");function Tt(e){return e??null}x(Tt,"handleUndefinedAttr");function Oy(e,t){const r=Math.round(e.x),n=Math.round(e.y),i=t.replace(/(\d+\.\d+)/g,s=>Math.round(parseFloat(s)).toString());return i.includes(r.toString())||i.includes(n.toString())}x(Oy,"isLabelCoordinateInPath");const z3=Object.freeze({left:0,top:0,width:16,height:16}),xo=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),zy=Object.freeze({...z3,...xo}),H3=Object.freeze({...zy,body:"",hidden:!1}),W3=Object.freeze({width:null,height:null}),q3=Object.freeze({...W3,...xo}),U3=(e,t,r,n="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;n=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const o=i.pop(),l=i.pop(),c={provider:i.length>0?i[0]:n,prefix:l,name:o};return ql(c)?c:null}const s=i[0],a=s.split("-");if(a.length>1){const o={provider:n,prefix:a.shift(),name:a.join("-")};return ql(o)?o:null}if(r&&n===""){const o={provider:n,prefix:"",name:s};return ql(o,r)?o:null}return null},ql=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function V3(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const n=((e.rotate||0)+(t.rotate||0))%4;return n&&(r.rotate=n),r}function ip(e,t){const r=V3(e,t);for(const n in H3)n in xo?n in e&&!(n in r)&&(r[n]=xo[n]):n in t?r[n]=t[n]:n in e&&(r[n]=e[n]);return r}function G3(e,t){const r=e.icons,n=e.aliases||Object.create(null),i=Object.create(null);function s(a){if(r[a])return i[a]=[];if(!(a in i)){i[a]=null;const o=n[a]&&n[a].parent,l=o&&s(o);l&&(i[a]=[o].concat(l))}return i[a]}return(t||Object.keys(r).concat(Object.keys(n))).forEach(s),i}function sp(e,t,r){const n=e.icons,i=e.aliases||Object.create(null);let s={};function a(o){s=ip(n[o]||i[o],s)}return a(t),r.forEach(a),ip(e,s)}function Y3(e,t){if(e.icons[t])return sp(e,t,[]);const r=G3(e,[t])[t];return r?sp(e,t,r):null}const X3=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Q3=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ap(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const n=e.split(X3);if(n===null||!n.length)return e;const i=[];let s=n.shift(),a=Q3.test(s);for(;;){if(a){const o=parseFloat(s);isNaN(o)?i.push(s):i.push(Math.ceil(o*t*r)/r)}else i.push(s);if(s=n.shift(),s===void 0)return i.join("");a=!a}}function K3(e,t="defs"){let r="";const n=e.indexOf("<"+t);for(;n>=0;){const i=e.indexOf(">",n),s=e.indexOf("</"+t);if(i===-1||s===-1)break;const a=e.indexOf(">",s);if(a===-1)break;r+=e.slice(i+1,s).trim(),e=e.slice(0,n).trim()+e.slice(a+1)}return{defs:r,content:e}}function Z3(e,t){return e?"<defs>"+e+"</defs>"+t:t}function J3(e,t,r){const n=K3(e);return Z3(n.defs,t+n.content+r)}const eD=e=>e==="unset"||e==="undefined"||e==="none";function tD(e,t){const r={...zy,...e},n={...q3,...t},i={left:r.left,top:r.top,width:r.width,height:r.height};let s=r.body;[r,n].forEach(m=>{const b=[],y=m.hFlip,k=m.vFlip;let v=m.rotate;y?k?v+=2:(b.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),b.push("scale(-1 1)"),i.top=i.left=0):k&&(b.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),b.push("scale(1 -1)"),i.top=i.left=0);let C;switch(v<0&&(v-=Math.floor(v/4)*4),v=v%4,v){case 1:C=i.height/2+i.top,b.unshift("rotate(90 "+C.toString()+" "+C.toString()+")");break;case 2:b.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:C=i.width/2+i.left,b.unshift("rotate(-90 "+C.toString()+" "+C.toString()+")");break}v%2===1&&(i.left!==i.top&&(C=i.left,i.left=i.top,i.top=C),i.width!==i.height&&(C=i.width,i.width=i.height,i.height=C)),b.length&&(s=J3(s,'<g transform="'+b.join(" ")+'">',"</g>"))});const a=n.width,o=n.height,l=i.width,c=i.height;let u,h;a===null?(h=o===null?"1em":o==="auto"?c:o,u=ap(h,l/c)):(u=a==="auto"?l:a,h=o===null?ap(u,c/l):o==="auto"?c:o);const f={},d=(m,b)=>{eD(b)||(f[m]=b.toString())};d("width",u),d("height",h);const g=[i.left,i.top,l,c];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:s}}const rD=/\sid="(\S+)"/g,nD="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let iD=0;function sD(e,t=nD){const r=[];let n;for(;n=rD.exec(e);)r.push(n[1]);if(!r.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return r.forEach(s=>{const a=typeof t=="function"?t(s):t+(iD++).toString(),o=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+o+')([")]|\\.[a-z])',"g"),"$1"+a+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}function aD(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in t)r+=" "+n+'="'+t[n]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+e+"</svg>"}function Lh(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Hn=Lh();function Hy(e){Hn=e}var bs={exec:()=>null};function De(e,t=""){let r=typeof e=="string"?e:e.source,n={replace:(i,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(Dt.caret,"$1"),r=r.replace(i,a),n},getRegex:()=>new RegExp(r,t)};return n}var Dt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},oD=/^(?:[ \t]*(?:\n|$))+/,lD=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,cD=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Qs=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,uD=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ih=/(?:[*+-]|\d{1,9}[.)])/,Wy=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,qy=De(Wy).replace(/bull/g,Ih).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),hD=De(Wy).replace(/bull/g,Ih).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),$h=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,dD=/^[^\n]+/,jh=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,fD=De(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",jh).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),pD=De(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ih).getRegex(),Zo="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Bh=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,gD=De("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Bh).replace("tag",Zo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Uy=De($h).replace("hr",Qs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Zo).getRegex(),mD=De(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Uy).getRegex(),Dh={blockquote:mD,code:lD,def:fD,fences:cD,heading:uD,hr:Qs,html:gD,lheading:qy,list:pD,newline:oD,paragraph:Uy,table:bs,text:dD},op=De("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Qs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Zo).getRegex(),xD={...Dh,lheading:hD,table:op,paragraph:De($h).replace("hr",Qs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",op).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Zo).getRegex()},yD={...Dh,html:De(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Bh).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:bs,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:De($h).replace("hr",Qs).replace("heading",` *#{1,6} *[^
221
+ ]`).replace("lheading",qy).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},bD=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,kD=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Vy=/^( {2,}|\\)\n(?!\s*$)/,wD=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Jo=/[\p{P}\p{S}]/u,Ph=/[\s\p{P}\p{S}]/u,Gy=/[^\s\p{P}\p{S}]/u,vD=De(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ph).getRegex(),Yy=/(?!~)[\p{P}\p{S}]/u,CD=/(?!~)[\s\p{P}\p{S}]/u,SD=/(?:[^\s\p{P}\p{S}]|~)/u,_D=/\[(?:[^\[\]`]|`[^`]*?`)*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,Xy=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,TD=De(Xy,"u").replace(/punct/g,Jo).getRegex(),ED=De(Xy,"u").replace(/punct/g,Yy).getRegex(),Qy="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",AD=De(Qy,"gu").replace(/notPunctSpace/g,Gy).replace(/punctSpace/g,Ph).replace(/punct/g,Jo).getRegex(),MD=De(Qy,"gu").replace(/notPunctSpace/g,SD).replace(/punctSpace/g,CD).replace(/punct/g,Yy).getRegex(),ND=De("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Gy).replace(/punctSpace/g,Ph).replace(/punct/g,Jo).getRegex(),LD=De(/\\(punct)/,"gu").replace(/punct/g,Jo).getRegex(),ID=De(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),$D=De(Bh).replace("(?:-->|$)","-->").getRegex(),jD=De("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",$D).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),yo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,BD=De(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",yo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ky=De(/^!?\[(label)\]\[(ref)\]/).replace("label",yo).replace("ref",jh).getRegex(),Zy=De(/^!?\[(ref)\](?:\[\])?/).replace("ref",jh).getRegex(),DD=De("reflink|nolink(?!\\()","g").replace("reflink",Ky).replace("nolink",Zy).getRegex(),lp=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Fh={_backpedal:bs,anyPunctuation:LD,autolink:ID,blockSkip:_D,br:Vy,code:kD,del:bs,emStrongLDelim:TD,emStrongRDelimAst:AD,emStrongRDelimUnd:ND,escape:bD,link:BD,nolink:Zy,punctuation:vD,reflink:Ky,reflinkSearch:DD,tag:jD,text:wD,url:bs},PD={...Fh,link:De(/^!?\[(label)\]\((.*?)\)/).replace("label",yo).getRegex(),reflink:De(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",yo).getRegex()},eu={...Fh,emStrongRDelimAst:MD,emStrongLDelim:ED,url:De(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",lp).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:De(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",lp).getRegex()},FD={...eu,br:De(Vy).replace("{2,}","*").getRegex(),text:De(eu.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},pa={normal:Dh,gfm:xD,pedantic:yD},Qi={normal:Fh,gfm:eu,breaks:FD,pedantic:PD},RD={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},cp=e=>RD[e];function xr(e,t){if(t){if(Dt.escapeTest.test(e))return e.replace(Dt.escapeReplace,cp)}else if(Dt.escapeTestNoEncode.test(e))return e.replace(Dt.escapeReplaceNoEncode,cp);return e}function up(e){try{e=encodeURI(e).replace(Dt.percentDecode,"%")}catch{return null}return e}function hp(e,t){let r=e.replace(Dt.findPipe,(s,a,o)=>{let l=!1,c=a;for(;--c>=0&&o[c]==="\\";)l=!l;return l?"|":" |"}),n=r.split(Dt.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(Dt.slashPipe,"|");return n}function Ki(e,t,r){let n=e.length;if(n===0)return"";let i=0;for(;i<n&&e.charAt(n-i-1)===t;)i++;return e.slice(0,n-i)}function OD(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return r>0?-2:-1}function dp(e,t,r,n,i){let s=t.href,a=t.title||null,o=e[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:s,title:a,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function zD(e,t,r){let n=e.match(r.other.indentCodeCompensation);if(n===null)return t;let i=n[1];return t.split(`
222
+ `).map(s=>{let a=s.match(r.other.beginningSpace);if(a===null)return s;let[o]=a;return o.length>=i.length?s.slice(i.length):s}).join(`
223
+ `)}var bo=class{options;rules;lexer;constructor(t){this.options=t||Hn}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let n=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Ki(n,`
224
+ `)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let n=r[0],i=zD(n,r[3]||"",this.rules);return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let n=r[2].trim();if(this.rules.other.endingHash.test(n)){let i=Ki(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:Ki(r[0],`
225
+ `)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let n=Ki(r[0],`
226
+ `).split(`
227
+ `),i="",s="",a=[];for(;n.length>0;){let o=!1,l=[],c;for(c=0;c<n.length;c++)if(this.rules.other.blockquoteStart.test(n[c]))l.push(n[c]),o=!0;else if(!o)l.push(n[c]);else break;n=n.slice(c);let u=l.join(`
228
+ `),h=u.replace(this.rules.other.blockquoteSetextReplace,`
229
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
230
+ ${u}`:u,s=s?`${s}
231
+ ${h}`:h;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,a,!0),this.lexer.state.top=f,n.length===0)break;let d=a.at(-1);if(d?.type==="code")break;if(d?.type==="blockquote"){let g=d,m=g.raw+`
232
+ `+n.join(`
233
+ `),b=this.blockquote(m);a[a.length-1]=b,i=i.substring(0,i.length-g.raw.length)+b.raw,s=s.substring(0,s.length-g.text.length)+b.text;break}else if(d?.type==="list"){let g=d,m=g.raw+`
234
+ `+n.join(`
235
+ `),b=this.list(m);a[a.length-1]=b,i=i.substring(0,i.length-d.raw.length)+b.raw,s=s.substring(0,s.length-g.raw.length)+b.raw,n=m.substring(a.at(-1).raw.length).split(`
236
+ `);continue}}return{type:"blockquote",raw:i,tokens:a,text:s}}}list(t){let r=this.rules.block.list.exec(t);if(r){let n=r[1].trim(),i=n.length>1,s={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let a=this.rules.other.listItemRegex(n),o=!1;for(;t;){let c=!1,u="",h="";if(!(r=a.exec(t))||this.rules.block.hr.test(t))break;u=r[0],t=t.substring(u.length);let f=r[2].split(`
237
+ `,1)[0].replace(this.rules.other.listReplaceTabs,k=>" ".repeat(3*k.length)),d=t.split(`
238
+ `,1)[0],g=!f.trim(),m=0;if(this.options.pedantic?(m=2,h=f.trimStart()):g?m=r[1].length+1:(m=r[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,h=f.slice(m),m+=r[1].length),g&&this.rules.other.blankLine.test(d)&&(u+=d+`
239
+ `,t=t.substring(d.length+1),c=!0),!c){let k=this.rules.other.nextBulletRegex(m),v=this.rules.other.hrRegex(m),C=this.rules.other.fencesBeginRegex(m),S=this.rules.other.headingBeginRegex(m),w=this.rules.other.htmlBeginRegex(m);for(;t;){let T=t.split(`
240
+ `,1)[0],$;if(d=T,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),$=d):$=d.replace(this.rules.other.tabCharGlobal," "),C.test(d)||S.test(d)||w.test(d)||k.test(d)||v.test(d))break;if($.search(this.rules.other.nonSpaceChar)>=m||!d.trim())h+=`
241
+ `+$.slice(m);else{if(g||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||C.test(f)||S.test(f)||v.test(f))break;h+=`
242
+ `+d}!g&&!d.trim()&&(g=!0),u+=T+`
243
+ `,t=t.substring(T.length+1),f=$.slice(m)}}s.loose||(o?s.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(o=!0));let b=null,y;this.options.gfm&&(b=this.rules.other.listIsTask.exec(h),b&&(y=b[0]!=="[ ] ",h=h.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:u,task:!!b,checked:y,loose:!1,text:h,tokens:[]}),s.raw+=u}let l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let c=0;c<s.items.length;c++)if(this.lexer.state.top=!1,s.items[c].tokens=this.lexer.blockTokens(s.items[c].text,[]),!s.loose){let u=s.items[c].tokens.filter(f=>f.type==="space"),h=u.length>0&&u.some(f=>this.rules.other.anyLine.test(f.raw));s.loose=h}if(s.loose)for(let c=0;c<s.items.length;c++)s.items[c].loose=!0;return s}}html(t){let r=this.rules.block.html.exec(t);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(t){let r=this.rules.block.def.exec(t);if(r){let n=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:n,raw:r[0],href:i,title:s}}}table(t){let r=this.rules.block.table.exec(t);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let n=hp(r[1]),i=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
244
+ `):[],a={type:"table",raw:r[0],header:[],align:[],rows:[]};if(n.length===i.length){for(let o of i)this.rules.other.tableAlignRight.test(o)?a.align.push("right"):this.rules.other.tableAlignCenter.test(o)?a.align.push("center"):this.rules.other.tableAlignLeft.test(o)?a.align.push("left"):a.align.push(null);for(let o=0;o<n.length;o++)a.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:a.align[o]});for(let o of s)a.rows.push(hp(o,a.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:a.align[c]})));return a}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let n=r[1].charAt(r[1].length-1)===`
245
+ `?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=Ki(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=OD(r[2],"()");if(a===-2)return;if(a>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+a;r[2]=r[2].substring(0,a),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let i=r[2],s="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(i);a&&(i=a[1],s=a[3])}else s=r[3]?r[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),dp(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(t,r){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=r[i.toLowerCase()];if(!s){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return dp(n,s,n[0],this.lexer,this.rules)}}emStrong(t,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!n||this.rules.inline.punctuation.exec(n))){let s=[...i[0]].length-1,a,o,l=s,c=0,u=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,r=r.slice(-1*t.length+s);(i=u.exec(r))!=null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(o=[...a].length,i[3]||i[4]){l+=o;continue}else if((i[5]||i[6])&&s%3&&!((s+o)%3)){c+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+c);let h=[...i[0]][0].length,f=t.slice(0,s+i.index+h+o);if(Math.min(s,o)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let d=f.slice(2,-2);return{type:"strong",raw:f,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let n,i;return r[2]==="@"?(n=r[1],i="mailto:"+n):(n=r[1],i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let r;if(r=this.rules.inline.url.exec(t)){let n,i;if(r[2]==="@")n=r[0],i="mailto:"+n;else{let s;do s=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(s!==r[0]);n=r[0],r[1]==="www."?i="http://"+r[0]:i=r[0]}return{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}},ar=class tu{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Hn,this.options.tokenizer=this.options.tokenizer||new bo,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:Dt,block:pa.normal,inline:Qi.normal};this.options.pedantic?(r.block=pa.pedantic,r.inline=Qi.pedantic):this.options.gfm&&(r.block=pa.gfm,this.options.breaks?r.inline=Qi.breaks:r.inline=Qi.gfm),this.tokenizer.rules=r}static get rules(){return{block:pa,inline:Qi}}static lex(t,r){return new tu(r).lex(t)}static lexInline(t,r){return new tu(r).inlineTokens(t)}lex(t){t=t.replace(Dt.carriageReturn,`
246
+ `),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],n=!1){for(this.options.pedantic&&(t=t.replace(Dt.tabCharGlobal," ").replace(Dt.spaceLine,""));t;){let i;if(this.options.extensions?.block?.some(a=>(i=a.call({lexer:this},t,r))?(t=t.substring(i.raw.length),r.push(i),!0):!1))continue;if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length);let a=r.at(-1);i.raw.length===1&&a!==void 0?a.raw+=`
247
+ `:r.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
248
+ `)?"":`
249
+ `)+i.raw,a.text+=`
250
+ `+i.text,this.inlineQueue.at(-1).src=a.text):r.push(i);continue}if(i=this.tokenizer.fences(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.heading(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.hr(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.blockquote(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.list(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.html(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.def(t)){t=t.substring(i.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
251
+ `)?"":`
252
+ `)+i.raw,a.text+=`
253
+ `+i.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},r.push(i));continue}if(i=this.tokenizer.table(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.lheading(t)){t=t.substring(i.raw.length),r.push(i);continue}let s=t;if(this.options.extensions?.startBlock){let a=1/0,o=t.slice(1),l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},o),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(s=t.substring(0,a+1))}if(this.state.top&&(i=this.tokenizer.paragraph(s))){let a=r.at(-1);n&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
254
+ `)?"":`
255
+ `)+i.raw,a.text+=`
256
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(i),n=s.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length);let a=r.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
257
+ `)?"":`
258
+ `)+i.raw,a.text+=`
259
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(i);continue}if(t){let a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let n=t,i=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)o.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let s=!1,a="";for(;t;){s||(a=""),s=!1;let o;if(this.options.extensions?.inline?.some(c=>(o=c.call({lexer:this},t,r))?(t=t.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.escape(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.tag(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.link(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(o.raw.length);let c=r.at(-1);o.type==="text"&&c?.type==="text"?(c.raw+=o.raw,c.text+=o.text):r.push(o);continue}if(o=this.tokenizer.emStrong(t,n,a)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.codespan(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.br(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.del(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.autolink(t)){t=t.substring(o.raw.length),r.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(t))){t=t.substring(o.raw.length),r.push(o);continue}let l=t;if(this.options.extensions?.startInline){let c=1/0,u=t.slice(1),h;this.options.extensions.startInline.forEach(f=>{h=f.call({lexer:this},u),typeof h=="number"&&h>=0&&(c=Math.min(c,h))}),c<1/0&&c>=0&&(l=t.substring(0,c+1))}if(o=this.tokenizer.inlineText(l)){t=t.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(a=o.raw.slice(-1)),s=!0;let c=r.at(-1);c?.type==="text"?(c.raw+=o.raw,c.text+=o.text):r.push(o);continue}if(t){let c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return r}},ko=class{options;parser;constructor(t){this.options=t||Hn}space(t){return""}code({text:t,lang:r,escaped:n}){let i=(r||"").match(Dt.notSpaceStart)?.[0],s=t.replace(Dt.endingNewline,"")+`
260
+ `;return i?'<pre><code class="language-'+xr(i)+'">'+(n?s:xr(s,!0))+`</code></pre>
261
+ `:"<pre><code>"+(n?s:xr(s,!0))+`</code></pre>
262
+ `}blockquote({tokens:t}){return`<blockquote>
263
+ ${this.parser.parse(t)}</blockquote>
264
+ `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:r}){return`<h${r}>${this.parser.parseInline(t)}</h${r}>
265
+ `}hr(t){return`<hr>
266
+ `}list(t){let r=t.ordered,n=t.start,i="";for(let o=0;o<t.items.length;o++){let l=t.items[o];i+=this.listitem(l)}let s=r?"ol":"ul",a=r&&n!==1?' start="'+n+'"':"";return"<"+s+a+`>
267
+ `+i+"</"+s+`>
268
+ `}listitem(t){let r="";if(t.task){let n=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=n+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=n+" "+xr(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):r+=n+" "}return r+=this.parser.parse(t.tokens,!!t.loose),`<li>${r}</li>
269
+ `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
270
+ `}table(t){let r="",n="";for(let s=0;s<t.header.length;s++)n+=this.tablecell(t.header[s]);r+=this.tablerow({text:n});let i="";for(let s=0;s<t.rows.length;s++){let a=t.rows[s];n="";for(let o=0;o<a.length;o++)n+=this.tablecell(a[o]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
271
+ <thead>
272
+ `+r+`</thead>
273
+ `+i+`</table>
274
+ `}tablerow({text:t}){return`<tr>
275
+ ${t}</tr>
276
+ `}tablecell(t){let r=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+r+`</${n}>
277
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${xr(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:r,tokens:n}){let i=this.parser.parseInline(n),s=up(t);if(s===null)return i;t=s;let a='<a href="'+t+'"';return r&&(a+=' title="'+xr(r)+'"'),a+=">"+i+"</a>",a}image({href:t,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let s=up(t);if(s===null)return xr(n);t=s;let a=`<img src="${t}" alt="${n}"`;return r&&(a+=` title="${xr(r)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:xr(t.text)}},Rh=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},or=class ru{options;renderer;textRenderer;constructor(t){this.options=t||Hn,this.options.renderer=this.options.renderer||new ko,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Rh}static parse(t,r){return new ru(r).parse(t)}static parseInline(t,r){return new ru(r).parseInline(t)}parse(t,r=!0){let n="";for(let i=0;i<t.length;i++){let s=t[i];if(this.options.extensions?.renderers?.[s.type]){let o=s,l=this.options.extensions.renderers[o.type].call({parser:this},o);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){n+=l||"";continue}}let a=s;switch(a.type){case"space":{n+=this.renderer.space(a);continue}case"hr":{n+=this.renderer.hr(a);continue}case"heading":{n+=this.renderer.heading(a);continue}case"code":{n+=this.renderer.code(a);continue}case"table":{n+=this.renderer.table(a);continue}case"blockquote":{n+=this.renderer.blockquote(a);continue}case"list":{n+=this.renderer.list(a);continue}case"html":{n+=this.renderer.html(a);continue}case"def":{n+=this.renderer.def(a);continue}case"paragraph":{n+=this.renderer.paragraph(a);continue}case"text":{let o=a,l=this.renderer.text(o);for(;i+1<t.length&&t[i+1].type==="text";)o=t[++i],l+=`
278
+ `+this.renderer.text(o);r?n+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):n+=l;continue}default:{let o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(t,r=this.renderer){let n="";for(let i=0;i<t.length;i++){let s=t[i];if(this.options.extensions?.renderers?.[s.type]){let o=this.options.extensions.renderers[s.type].call({parser:this},s);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){n+=o||"";continue}}let a=s;switch(a.type){case"escape":{n+=r.text(a);break}case"html":{n+=r.html(a);break}case"link":{n+=r.link(a);break}case"image":{n+=r.image(a);break}case"strong":{n+=r.strong(a);break}case"em":{n+=r.em(a);break}case"codespan":{n+=r.codespan(a);break}case"br":{n+=r.br(a);break}case"del":{n+=r.del(a);break}case"text":{n+=r.text(a);break}default:{let o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}},as=class{options;block;constructor(t){this.options=t||Hn}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?ar.lex:ar.lexInline}provideParser(){return this.block?or.parse:or.parseInline}},HD=class{defaults=Lh();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=or;Renderer=ko;TextRenderer=Rh;Lexer=ar;Tokenizer=bo;Hooks=as;constructor(...t){this.use(...t)}walkTokens(t,r){let n=[];for(let i of t)switch(n=n.concat(r.call(this,i)),i.type){case"table":{let s=i;for(let a of s.header)n=n.concat(this.walkTokens(a.tokens,r));for(let a of s.rows)for(let o of a)n=n.concat(this.walkTokens(o.tokens,r));break}case"list":{let s=i;n=n.concat(this.walkTokens(s.items,r));break}default:{let s=i;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(a=>{let o=s[a].flat(1/0);n=n.concat(this.walkTokens(o,r))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,r)))}}return n}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let a=r.renderers[s.name];a?r.renderers[s.name]=function(...o){let l=s.renderer.apply(this,o);return l===!1&&(l=a.apply(this,o)),l}:r.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[s.level];a?a.unshift(s.tokenizer):r[s.level]=[s.tokenizer],s.start&&(s.level==="block"?r.startBlock?r.startBlock.push(s.start):r.startBlock=[s.start]:s.level==="inline"&&(r.startInline?r.startInline.push(s.start):r.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(r.childTokens[s.name]=s.childTokens)}),i.extensions=r),n.renderer){let s=this.defaults.renderer||new ko(this.defaults);for(let a in n.renderer){if(!(a in s))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let o=a,l=n.renderer[o],c=s[o];s[o]=(...u)=>{let h=l.apply(s,u);return h===!1&&(h=c.apply(s,u)),h||""}}i.renderer=s}if(n.tokenizer){let s=this.defaults.tokenizer||new bo(this.defaults);for(let a in n.tokenizer){if(!(a in s))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let o=a,l=n.tokenizer[o],c=s[o];s[o]=(...u)=>{let h=l.apply(s,u);return h===!1&&(h=c.apply(s,u)),h}}i.tokenizer=s}if(n.hooks){let s=this.defaults.hooks||new as;for(let a in n.hooks){if(!(a in s))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let o=a,l=n.hooks[o],c=s[o];as.passThroughHooks.has(a)?s[o]=u=>{if(this.defaults.async&&as.passThroughHooksRespectAsync.has(a))return(async()=>{let f=await l.call(s,u);return c.call(s,f)})();let h=l.call(s,u);return c.call(s,h)}:s[o]=(...u)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(s,u);return f===!1&&(f=await c.apply(s,u)),f})();let h=l.apply(s,u);return h===!1&&(h=c.apply(s,u)),h}}i.hooks=s}if(n.walkTokens){let s=this.defaults.walkTokens,a=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(a.call(this,o)),s&&(l=l.concat(s.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return ar.lex(t,r??this.defaults)}parser(t,r){return or.parse(t,r??this.defaults)}parseMarkdown(t){return(r,n)=>{let i={...n},s={...this.defaults,...i},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=t),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(r):r,l=await(s.hooks?await s.hooks.provideLexer():t?ar.lex:ar.lexInline)(o,s),c=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let u=await(s.hooks?await s.hooks.provideParser():t?or.parse:or.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(u):u})().catch(a);try{s.hooks&&(r=s.hooks.preprocess(r));let o=(s.hooks?s.hooks.provideLexer():t?ar.lex:ar.lexInline)(r,s);s.hooks&&(o=s.hooks.processAllTokens(o)),s.walkTokens&&this.walkTokens(o,s.walkTokens);let l=(s.hooks?s.hooks.provideParser():t?or.parse:or.parseInline)(o,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(o){return a(o)}}}onError(t,r){return n=>{if(n.message+=`
279
+ Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+xr(n.message+"",!0)+"</pre>";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},Bn=new HD;function Fe(e,t){return Bn.parse(e,t)}Fe.options=Fe.setOptions=function(e){return Bn.setOptions(e),Fe.defaults=Bn.defaults,Hy(Fe.defaults),Fe};Fe.getDefaults=Lh;Fe.defaults=Hn;Fe.use=function(...e){return Bn.use(...e),Fe.defaults=Bn.defaults,Hy(Fe.defaults),Fe};Fe.walkTokens=function(e,t){return Bn.walkTokens(e,t)};Fe.parseInline=Bn.parseInline;Fe.Parser=or;Fe.parser=or.parse;Fe.Renderer=ko;Fe.TextRenderer=Rh;Fe.Lexer=ar;Fe.lexer=ar.lex;Fe.Tokenizer=bo;Fe.Hooks=as;Fe.parse=Fe;Fe.options;Fe.setOptions;Fe.use;Fe.walkTokens;Fe.parseInline;or.parse;ar.lex;function Jy(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=Array.from(typeof e=="string"?[e]:e);n[n.length-1]=n[n.length-1].replace(/\r?\n([\t ]*)$/,"");var i=n.reduce(function(o,l){var c=l.match(/\n([\t ]+|(?!\s).)/g);return c?o.concat(c.map(function(u){var h,f;return(f=(h=u.match(/[\t ]/g))===null||h===void 0?void 0:h.length)!==null&&f!==void 0?f:0})):o},[]);if(i.length){var s=new RegExp(`
280
+ [ ]{`+Math.min.apply(Math,i)+"}","g");n=n.map(function(o){return o.replace(s,`
281
+ `)})}n[0]=n[0].replace(/^\r?\n/,"");var a=n[0];return t.forEach(function(o,l){var c=a.match(/(?:^|\n)( *)$/),u=c?c[1]:"",h=o;typeof o=="string"&&o.includes(`
282
+ `)&&(h=String(o).split(`
283
+ `).map(function(f,d){return d===0?f:""+u+f}).join(`
284
+ `)),a+=h+n[l+1]}),a}var WD={body:'<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',height:80,width:80},nu=new Map,eb=new Map,qD=x(e=>{for(const t of e){if(!t.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(X.debug("Registering icon pack:",t.name),"loader"in t)eb.set(t.name,t.loader);else if("icons"in t)nu.set(t.name,t.icons);else throw X.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),tb=x(async(e,t)=>{const r=U3(e,!0,t!==void 0);if(!r)throw new Error(`Invalid icon name: ${e}`);const n=r.prefix||t;if(!n)throw new Error(`Icon name must contain a prefix: ${e}`);let i=nu.get(n);if(!i){const a=eb.get(n);if(!a)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await a(),prefix:n},nu.set(n,i)}catch(o){throw X.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=Y3(i,r.name);if(!s)throw new Error(`Icon not found: ${e}`);return s},"getRegisteredIconData"),UD=x(async e=>{try{return await tb(e),!0}catch{return!1}},"isIconAvailable"),Ks=x(async(e,t,r)=>{let n;try{n=await tb(e,t?.fallbackPrefix)}catch(a){X.error(a),n=WD}const i=tD(n,t),s=aD(sD(i.body),{...i.attributes,...r});return tr(s,St())},"getIconSVG");function rb(e,{markdownAutoWrap:t}){const n=e.replace(/<br\/>/g,`
285
+ `).replace(/\n{2,}/g,`
286
+ `),i=Jy(n);return t===!1?i.replace(/ /g,"&nbsp;"):i}x(rb,"preprocessMarkdown");function nb(e,t={}){const r=rb(e,t),n=Fe.lexer(r),i=[[]];let s=0;function a(o,l="normal"){o.type==="text"?o.text.split(`
287
+ `).forEach((u,h)=>{h!==0&&(s++,i.push([])),u.split(" ").forEach(f=>{f=f.replace(/&#39;/g,"'"),f&&i[s].push({content:f,type:l})})}):o.type==="strong"||o.type==="em"?o.tokens.forEach(c=>{a(c,o.type)}):o.type==="html"&&i[s].push({content:o.text,type:"normal"})}return x(a,"processNode"),n.forEach(o=>{o.type==="paragraph"?o.tokens?.forEach(l=>{a(l)}):o.type==="html"?i[s].push({content:o.text,type:"normal"}):i[s].push({content:o.raw,type:"normal"})}),i}x(nb,"markdownToLines");function ib(e,{markdownAutoWrap:t}={}){const r=Fe.lexer(e);function n(i){return i.type==="text"?t===!1?i.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):i.text.replace(/\n */g,"<br/>"):i.type==="strong"?`<strong>${i.tokens?.map(n).join("")}</strong>`:i.type==="em"?`<em>${i.tokens?.map(n).join("")}</em>`:i.type==="paragraph"?`<p>${i.tokens?.map(n).join("")}</p>`:i.type==="space"?"":i.type==="html"?`${i.text}`:i.type==="escape"?i.text:(X.warn(`Unsupported markdown: ${i.type}`),i.raw)}return x(n,"output"),r.map(n).join("")}x(ib,"markdownToHTML");function sb(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}x(sb,"splitTextToChars");function ab(e,t){const r=sb(t.content);return Oh(e,[],r,t.type)}x(ab,"splitWordToFitWidth");function Oh(e,t,r,n){if(r.length===0)return[{content:t.join(""),type:n},{content:"",type:n}];const[i,...s]=r,a=[...t,i];return e([{content:a.join(""),type:n}])?Oh(e,a,s,n):(t.length===0&&i&&(t.push(i),r.shift()),[{content:t.join(""),type:n},{content:r.join(""),type:n}])}x(Oh,"splitWordToFitWidthRecursion");function ob(e,t){if(e.some(({content:r})=>r.includes(`
288
+ `)))throw new Error("splitLineToFitWidth does not support newlines in the line");return wo(e,t)}x(ob,"splitLineToFitWidth");function wo(e,t,r=[],n=[]){if(e.length===0)return n.length>0&&r.push(n),r.length>0?r:[];let i="";e[0].content===" "&&(i=" ",e.shift());const s=e.shift()??{content:" ",type:"normal"},a=[...n];if(i!==""&&a.push({content:i,type:"normal"}),a.push(s),t(a))return wo(e,t,r,a);if(n.length>0)r.push(n),e.unshift(s);else if(s.content){const[o,l]=ab(t,s);r.push([o]),l.content&&e.unshift(l)}return wo(e,t,r)}x(wo,"splitLineToFitWidthRecursion");function iu(e,t){t&&e.attr("style",t)}x(iu,"applyStyle");async function lb(e,t,r,n,i=!1,s=St()){const a=e.append("foreignObject");a.attr("width",`${10*r}px`),a.attr("height",`${10*r}px`);const o=a.append("xhtml:div"),l=pi(t.label)?await Xu(t.label.replace(Ci.lineBreakRegex,`
289
+ `),s):tr(t.label,s),c=t.isNode?"nodeLabel":"edgeLabel",u=o.append("span");u.html(l),iu(u,t.labelStyle),u.attr("class",`${c} ${n}`),iu(o,t.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),o.style("max-width",r+"px"),o.style("text-align","center"),o.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&o.attr("class","labelBkg");let h=o.node().getBoundingClientRect();return h.width===r&&(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",r+"px"),h=o.node().getBoundingClientRect()),a.node()}x(lb,"addHtmlSpan");function el(e,t,r){return e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em")}x(el,"createTspan");function cb(e,t,r){const n=e.append("text"),i=el(n,1,t);tl(i,r);const s=i.node().getComputedTextLength();return n.remove(),s}x(cb,"computeWidthOfText");function VD(e,t,r){const n=e.append("text"),i=el(n,1,t);tl(i,[{content:r,type:"normal"}]);const s=i.node()?.getBoundingClientRect();return s&&n.remove(),s}x(VD,"computeDimensionOfText");function ub(e,t,r,n=!1){const s=t.append("g"),a=s.insert("rect").attr("class","background").attr("style","stroke: none"),o=s.append("text").attr("y","-10.1");let l=0;for(const c of r){const u=x(f=>cb(s,1.1,f)<=e,"checkWidth"),h=u(c)?[c]:ob(c,u);for(const f of h){const d=el(o,l,1.1);tl(d,f),l++}}if(n){const c=o.node().getBBox(),u=2;return a.attr("x",c.x-u).attr("y",c.y-u).attr("width",c.width+2*u).attr("height",c.height+2*u),s.node()}else return o.node()}x(ub,"createFormattedText");function tl(e,t){e.text(""),t.forEach((r,n)=>{const i=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");n===0?i.text(r.content):i.text(" "+r.content)})}x(tl,"updateTextContentAndStyles");async function hb(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,s,a)=>(r.push((async()=>{const o=`${s}:${a}`;return await UD(o)?await Ks(o,void 0,{class:"label-icon"}):`<i class='${tr(i,t).replace(":"," ")}'></i>`})()),i));const n=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}x(hb,"replaceIconSubstring");var ln=x(async(e,t="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:s=!0,isNode:a=!0,width:o=200,addSvgBackground:l=!1}={},c)=>{if(X.debug("XYZ createText",t,r,n,i,s,a,"addSvgBackground: ",l),s){const u=ib(t,c),h=await hb(zn(u),c),f=t.replace(/\\\\/g,"\\"),d={isNode:a,label:pi(t)?f:h,labelStyle:r.replace("fill:","color:")};return await lb(e,d,o,i,l,c)}else{const u=t.replace(/<br\s*\/?>/g,"<br/>"),h=nb(u.replace("<br>","<br/>"),c),f=ub(o,e,h,t?l:!1);if(a){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const d=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");$e(f).attr("style",d)}else{const d=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");$e(f).select("rect").attr("style",d.replace(/background:/g,"fill:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");$e(f).select("text").attr("style",g)}return f}},"createText");function Ul(e,t,r){if(e&&e.length){const[n,i]=t,s=Math.PI/180*r,a=Math.cos(s),o=Math.sin(s);for(const l of e){const[c,u]=l;l[0]=(c-n)*a-(u-i)*o+n,l[1]=(c-n)*o+(u-i)*a+i}}}function GD(e,t){return e[0]===t[0]&&e[1]===t[1]}function YD(e,t,r,n=1){const i=r,s=Math.max(t,.1),a=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,o=[0,0];if(i)for(const c of a)Ul(c,o,i);const l=(function(c,u,h){const f=[];for(const k of c){const v=[...k];GD(v[0],v[v.length-1])||v.push([v[0][0],v[0][1]]),v.length>2&&f.push(v)}const d=[];u=Math.max(u,.1);const g=[];for(const k of f)for(let v=0;v<k.length-1;v++){const C=k[v],S=k[v+1];if(C[1]!==S[1]){const w=Math.min(C[1],S[1]);g.push({ymin:w,ymax:Math.max(C[1],S[1]),x:w===C[1]?C[0]:S[0],islope:(S[0]-C[0])/(S[1]-C[1])})}}if(g.sort(((k,v)=>k.ymin<v.ymin?-1:k.ymin>v.ymin?1:k.x<v.x?-1:k.x>v.x?1:k.ymax===v.ymax?0:(k.ymax-v.ymax)/Math.abs(k.ymax-v.ymax))),!g.length)return d;let m=[],b=g[0].ymin,y=0;for(;m.length||g.length;){if(g.length){let k=-1;for(let v=0;v<g.length&&!(g[v].ymin>b);v++)k=v;g.splice(0,k+1).forEach((v=>{m.push({s:b,edge:v})}))}if(m=m.filter((k=>!(k.edge.ymax<=b))),m.sort(((k,v)=>k.edge.x===v.edge.x?0:(k.edge.x-v.edge.x)/Math.abs(k.edge.x-v.edge.x))),(h!==1||y%u==0)&&m.length>1)for(let k=0;k<m.length;k+=2){const v=k+1;if(v>=m.length)break;const C=m[k].edge,S=m[v].edge;d.push([[Math.round(C.x),b],[Math.round(S.x),b]])}b+=h,m.forEach((k=>{k.edge.x=k.edge.x+h*k.edge.islope})),y++}return d})(a,s,n);if(i){for(const c of a)Ul(c,o,-i);(function(c,u,h){const f=[];c.forEach((d=>f.push(...d))),Ul(f,u,h)})(l,o,-i)}return l}function Zs(e,t){var r;const n=t.hachureAngle+90;let i=t.hachureGap;i<0&&(i=4*t.strokeWidth),i=Math.round(Math.max(i,.1));let s=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(s=i),YD(e,i,n,s||1)}class zh{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const n=Zs(t,r);return{type:"fillSketch",ops:this.renderLines(n,r)}}renderLines(t,r){const n=[];for(const i of t)n.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],r));return n}}function rl(e){const t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}class XD extends zh{fillPolygons(t,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=Zs(t,Object.assign({},r,{hachureGap:n})),s=Math.PI/180*r.hachureAngle,a=[],o=.5*n*Math.cos(s),l=.5*n*Math.sin(s);for(const[c,u]of i)rl([c,u])&&a.push([[c[0]-o,c[1]+l],[...u]],[[c[0]+o,c[1]-l],[...u]]);return{type:"fillSketch",ops:this.renderLines(a,r)}}}class QD extends zh{fillPolygons(t,r){const n=this._fillPolygons(t,r),i=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),s=this._fillPolygons(t,i);return n.ops=n.ops.concat(s.ops),n}}class KD{constructor(t){this.helper=t}fillPolygons(t,r){const n=Zs(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(n,r)}dotsOnLines(t,r){const n=[];let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);let s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const a=i/4;for(const o of t){const l=rl(o),c=l/i,u=Math.ceil(c)-1,h=l-u*i,f=(o[0][0]+o[1][0])/2-i/4,d=Math.min(o[0][1],o[1][1]);for(let g=0;g<u;g++){const m=d+h+g*i,b=f-a+2*Math.random()*a,y=m-a+2*Math.random()*a,k=this.helper.ellipse(b,y,s,s,r);n.push(...k.ops)}}return{type:"fillSketch",ops:n}}}class ZD{constructor(t){this.helper=t}fillPolygons(t,r){const n=Zs(t,r);return{type:"fillSketch",ops:this.dashedLine(n,r)}}dashedLine(t,r){const n=r.dashOffset<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashOffset,i=r.dashGap<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashGap,s=[];return t.forEach((a=>{const o=rl(a),l=Math.floor(o/(n+i)),c=(o+i-l*(n+i))/2;let u=a[0],h=a[1];u[0]>h[0]&&(u=a[1],h=a[0]);const f=Math.atan((h[1]-u[1])/(h[0]-u[0]));for(let d=0;d<l;d++){const g=d*(n+i),m=g+n,b=[u[0]+g*Math.cos(f)+c*Math.cos(f),u[1]+g*Math.sin(f)+c*Math.sin(f)],y=[u[0]+m*Math.cos(f)+c*Math.cos(f),u[1]+m*Math.sin(f)+c*Math.sin(f)];s.push(...this.helper.doubleLineOps(b[0],b[1],y[0],y[1],r))}})),s}}class JD{constructor(t){this.helper=t}fillPolygons(t,r){const n=r.hachureGap<0?4*r.strokeWidth:r.hachureGap,i=r.zigzagOffset<0?n:r.zigzagOffset,s=Zs(t,r=Object.assign({},r,{hachureGap:n+i}));return{type:"fillSketch",ops:this.zigzagLines(s,i,r)}}zigzagLines(t,r,n){const i=[];return t.forEach((s=>{const a=rl(s),o=Math.round(a/(2*r));let l=s[0],c=s[1];l[0]>c[0]&&(l=s[1],c=s[0]);const u=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let h=0;h<o;h++){const f=2*h*r,d=2*(h+1)*r,g=Math.sqrt(2*Math.pow(r,2)),m=[l[0]+f*Math.cos(u),l[1]+f*Math.sin(u)],b=[l[0]+d*Math.cos(u),l[1]+d*Math.sin(u)],y=[m[0]+g*Math.cos(u+Math.PI/4),m[1]+g*Math.sin(u+Math.PI/4)];i.push(...this.helper.doubleLineOps(m[0],m[1],y[0],y[1],n),...this.helper.doubleLineOps(y[0],y[1],b[0],b[1],n))}})),i}}const Ot={};class e5{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const t5=0,Vl=1,fp=2,ga={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function Gl(e,t){return e.type===t}function Hh(e){const t=[],r=(function(a){const o=new Array;for(;a!=="";)if(a.match(/^([ \t\r\n,]+)/))a=a.substr(RegExp.$1.length);else if(a.match(/^([aAcChHlLmMqQsStTvVzZ])/))o[o.length]={type:t5,text:RegExp.$1},a=a.substr(RegExp.$1.length);else{if(!a.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];o[o.length]={type:Vl,text:`${parseFloat(RegExp.$1)}`},a=a.substr(RegExp.$1.length)}return o[o.length]={type:fp,text:""},o})(e);let n="BOD",i=0,s=r[i];for(;!Gl(s,fp);){let a=0;const o=[];if(n==="BOD"){if(s.text!=="M"&&s.text!=="m")return Hh("M0,0"+e);i++,a=ga[s.text],n=s.text}else Gl(s,Vl)?a=ga[n]:(i++,a=ga[s.text],n=s.text);if(!(i+a<r.length))throw new Error("Path data ended short");for(let l=i;l<i+a;l++){const c=r[l];if(!Gl(c,Vl))throw new Error("Param not a number: "+n+","+c.text);o[o.length]=+c.text}if(typeof ga[n]!="number")throw new Error("Bad segment: "+n);{const l={key:n,data:o};t.push(l),i+=a,s=r[i],n==="M"&&(n="L"),n==="m"&&(n="l")}}return t}function db(e){let t=0,r=0,n=0,i=0;const s=[];for(const{key:a,data:o}of e)switch(a){case"M":s.push({key:"M",data:[...o]}),[t,r]=o,[n,i]=o;break;case"m":t+=o[0],r+=o[1],s.push({key:"M",data:[t,r]}),n=t,i=r;break;case"L":s.push({key:"L",data:[...o]}),[t,r]=o;break;case"l":t+=o[0],r+=o[1],s.push({key:"L",data:[t,r]});break;case"C":s.push({key:"C",data:[...o]}),t=o[4],r=o[5];break;case"c":{const l=o.map(((c,u)=>u%2?c+r:c+t));s.push({key:"C",data:l}),t=l[4],r=l[5];break}case"Q":s.push({key:"Q",data:[...o]}),t=o[2],r=o[3];break;case"q":{const l=o.map(((c,u)=>u%2?c+r:c+t));s.push({key:"Q",data:l}),t=l[2],r=l[3];break}case"A":s.push({key:"A",data:[...o]}),t=o[5],r=o[6];break;case"a":t+=o[5],r+=o[6],s.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],t,r]});break;case"H":s.push({key:"H",data:[...o]}),t=o[0];break;case"h":t+=o[0],s.push({key:"H",data:[t]});break;case"V":s.push({key:"V",data:[...o]}),r=o[0];break;case"v":r+=o[0],s.push({key:"V",data:[r]});break;case"S":s.push({key:"S",data:[...o]}),t=o[2],r=o[3];break;case"s":{const l=o.map(((c,u)=>u%2?c+r:c+t));s.push({key:"S",data:l}),t=l[2],r=l[3];break}case"T":s.push({key:"T",data:[...o]}),t=o[0],r=o[1];break;case"t":t+=o[0],r+=o[1],s.push({key:"T",data:[t,r]});break;case"Z":case"z":s.push({key:"Z",data:[]}),t=n,r=i}return s}function fb(e){const t=[];let r="",n=0,i=0,s=0,a=0,o=0,l=0;for(const{key:c,data:u}of e){switch(c){case"M":t.push({key:"M",data:[...u]}),[n,i]=u,[s,a]=u;break;case"C":t.push({key:"C",data:[...u]}),n=u[4],i=u[5],o=u[2],l=u[3];break;case"L":t.push({key:"L",data:[...u]}),[n,i]=u;break;case"H":n=u[0],t.push({key:"L",data:[n,i]});break;case"V":i=u[0],t.push({key:"L",data:[n,i]});break;case"S":{let h=0,f=0;r==="C"||r==="S"?(h=n+(n-o),f=i+(i-l)):(h=n,f=i),t.push({key:"C",data:[h,f,...u]}),o=u[0],l=u[1],n=u[2],i=u[3];break}case"T":{const[h,f]=u;let d=0,g=0;r==="Q"||r==="T"?(d=n+(n-o),g=i+(i-l)):(d=n,g=i);const m=n+2*(d-n)/3,b=i+2*(g-i)/3,y=h+2*(d-h)/3,k=f+2*(g-f)/3;t.push({key:"C",data:[m,b,y,k,h,f]}),o=d,l=g,n=h,i=f;break}case"Q":{const[h,f,d,g]=u,m=n+2*(h-n)/3,b=i+2*(f-i)/3,y=d+2*(h-d)/3,k=g+2*(f-g)/3;t.push({key:"C",data:[m,b,y,k,d,g]}),o=h,l=f,n=d,i=g;break}case"A":{const h=Math.abs(u[0]),f=Math.abs(u[1]),d=u[2],g=u[3],m=u[4],b=u[5],y=u[6];h===0||f===0?(t.push({key:"C",data:[n,i,b,y,b,y]}),n=b,i=y):(n!==b||i!==y)&&(pb(n,i,b,y,h,f,d,g,m).forEach((function(k){t.push({key:"C",data:k})})),n=b,i=y);break}case"Z":t.push({key:"Z",data:[]}),n=s,i=a}r=c}return t}function Zi(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function pb(e,t,r,n,i,s,a,o,l,c){const u=(h=a,Math.PI*h/180);var h;let f=[],d=0,g=0,m=0,b=0;if(c)[d,g,m,b]=c;else{[e,t]=Zi(e,t,-u),[r,n]=Zi(r,n,-u);const R=(e-r)/2,I=(t-n)/2;let F=R*R/(i*i)+I*I/(s*s);F>1&&(F=Math.sqrt(F),i*=F,s*=F);const L=i*i,B=s*s,H=L*B-L*I*I-B*R*R,Q=L*I*I+B*R*R,_=(o===l?-1:1)*Math.sqrt(Math.abs(H/Q));m=_*i*I/s+(e+r)/2,b=_*-s*R/i+(t+n)/2,d=Math.asin(parseFloat(((t-b)/s).toFixed(9))),g=Math.asin(parseFloat(((n-b)/s).toFixed(9))),e<m&&(d=Math.PI-d),r<m&&(g=Math.PI-g),d<0&&(d=2*Math.PI+d),g<0&&(g=2*Math.PI+g),l&&d>g&&(d-=2*Math.PI),!l&&g>d&&(g-=2*Math.PI)}let y=g-d;if(Math.abs(y)>120*Math.PI/180){const R=g,I=r,F=n;g=l&&g>d?d+120*Math.PI/180*1:d+120*Math.PI/180*-1,f=pb(r=m+i*Math.cos(g),n=b+s*Math.sin(g),I,F,i,s,a,0,l,[g,R,m,b])}y=g-d;const k=Math.cos(d),v=Math.sin(d),C=Math.cos(g),S=Math.sin(g),w=Math.tan(y/4),T=4/3*i*w,$=4/3*s*w,M=[e,t],E=[e+T*v,t-$*k],N=[r+T*S,n-$*C],D=[r,n];if(E[0]=2*M[0]-E[0],E[1]=2*M[1]-E[1],c)return[E,N,D].concat(f);{f=[E,N,D].concat(f);const R=[];for(let I=0;I<f.length;I+=3){const F=Zi(f[I][0],f[I][1],u),L=Zi(f[I+1][0],f[I+1][1],u),B=Zi(f[I+2][0],f[I+2][1],u);R.push([F[0],F[1],L[0],L[1],B[0],B[1]])}return R}}const r5={randOffset:function(e,t){return be(e,t)},randOffsetWithRange:function(e,t,r){return vo(e,t,r)},ellipse:function(e,t,r,n,i){const s=mb(r,n,i);return su(e,t,i,s).opset},doubleLineOps:function(e,t,r,n,i){return nn(e,t,r,n,i,!0)}};function gb(e,t,r,n,i){return{type:"path",ops:nn(e,t,r,n,i)}}function Da(e,t,r){const n=(e||[]).length;if(n>2){const i=[];for(let s=0;s<n-1;s++)i.push(...nn(e[s][0],e[s][1],e[s+1][0],e[s+1][1],r));return t&&i.push(...nn(e[n-1][0],e[n-1][1],e[0][0],e[0][1],r)),{type:"path",ops:i}}return n===2?gb(e[0][0],e[0][1],e[1][0],e[1][1],r):{type:"path",ops:[]}}function n5(e,t,r,n,i){return(function(s,a){return Da(s,!0,a)})([[e,t],[e+r,t],[e+r,t+n],[e,t+n]],i)}function pp(e,t){if(e.length){const r=typeof e[0][0]=="number"?[e]:e,n=ma(r[0],1*(1+.2*t.roughness),t),i=t.disableMultiStroke?[]:ma(r[0],1.5*(1+.22*t.roughness),xp(t));for(let s=1;s<r.length;s++){const a=r[s];if(a.length){const o=ma(a,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:ma(a,1.5*(1+.22*t.roughness),xp(t));for(const c of o)c.op!=="move"&&n.push(c);for(const c of l)c.op!=="move"&&i.push(c)}}return{type:"path",ops:n.concat(i)}}return{type:"path",ops:[]}}function mb(e,t,r){const n=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),i=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*n)),s=2*Math.PI/i;let a=Math.abs(e/2),o=Math.abs(t/2);const l=1-r.curveFitting;return a+=be(a*l,r),o+=be(o*l,r),{increment:s,rx:a,ry:o}}function su(e,t,r,n){const[i,s]=yp(n.increment,e,t,n.rx,n.ry,1,n.increment*vo(.1,vo(.4,1,r),r),r);let a=Co(i,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[o]=yp(n.increment,e,t,n.rx,n.ry,1.5,0,r),l=Co(o,null,r);a=a.concat(l)}return{estimatedPoints:s,opset:{type:"path",ops:a}}}function gp(e,t,r,n,i,s,a,o,l){const c=e,u=t;let h=Math.abs(r/2),f=Math.abs(n/2);h+=be(.01*h,l),f+=be(.01*f,l);let d=i,g=s;for(;d<0;)d+=2*Math.PI,g+=2*Math.PI;g-d>2*Math.PI&&(d=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,b=Math.min(m/2,(g-d)/2),y=bp(b,c,u,h,f,d,g,1,l);if(!l.disableMultiStroke){const k=bp(b,c,u,h,f,d,g,1.5,l);y.push(...k)}return a&&(o?y.push(...nn(c,u,c+h*Math.cos(d),u+f*Math.sin(d),l),...nn(c,u,c+h*Math.cos(g),u+f*Math.sin(g),l)):y.push({op:"lineTo",data:[c,u]},{op:"lineTo",data:[c+h*Math.cos(d),u+f*Math.sin(d)]})),{type:"path",ops:y}}function mp(e,t){const r=fb(db(Hh(e))),n=[];let i=[0,0],s=[0,0];for(const{key:a,data:o}of r)switch(a){case"M":s=[o[0],o[1]],i=[o[0],o[1]];break;case"L":n.push(...nn(s[0],s[1],o[0],o[1],t)),s=[o[0],o[1]];break;case"C":{const[l,c,u,h,f,d]=o;n.push(...i5(l,c,u,h,f,d,s,t)),s=[f,d];break}case"Z":n.push(...nn(s[0],s[1],i[0],i[1],t)),s=[i[0],i[1]]}return{type:"path",ops:n}}function Yl(e,t){const r=[];for(const n of e)if(n.length){const i=t.maxRandomnessOffset||0,s=n.length;if(s>2){r.push({op:"move",data:[n[0][0]+be(i,t),n[0][1]+be(i,t)]});for(let a=1;a<s;a++)r.push({op:"lineTo",data:[n[a][0]+be(i,t),n[a][1]+be(i,t)]})}}return{type:"fillPath",ops:r}}function Gn(e,t){return(function(r,n){let i=r.fillStyle||"hachure";if(!Ot[i])switch(i){case"zigzag":Ot[i]||(Ot[i]=new XD(n));break;case"cross-hatch":Ot[i]||(Ot[i]=new QD(n));break;case"dots":Ot[i]||(Ot[i]=new KD(n));break;case"dashed":Ot[i]||(Ot[i]=new ZD(n));break;case"zigzag-line":Ot[i]||(Ot[i]=new JD(n));break;default:i="hachure",Ot[i]||(Ot[i]=new zh(n))}return Ot[i]})(t,r5).fillPolygons(e,t)}function xp(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function xb(e){return e.randomizer||(e.randomizer=new e5(e.seed||0)),e.randomizer.next()}function vo(e,t,r,n=1){return r.roughness*n*(xb(r)*(t-e)+e)}function be(e,t,r=1){return vo(-e,e,t,r)}function nn(e,t,r,n,i,s=!1){const a=s?i.disableMultiStrokeFill:i.disableMultiStroke,o=au(e,t,r,n,i,!0,!1);if(a)return o;const l=au(e,t,r,n,i,!0,!0);return o.concat(l)}function au(e,t,r,n,i,s,a){const o=Math.pow(e-r,2)+Math.pow(t-n,2),l=Math.sqrt(o);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let u=i.maxRandomnessOffset||0;u*u*100>o&&(u=l/10);const h=u/2,f=.2+.2*xb(i);let d=i.bowing*i.maxRandomnessOffset*(n-t)/200,g=i.bowing*i.maxRandomnessOffset*(e-r)/200;d=be(d,i,c),g=be(g,i,c);const m=[],b=()=>be(h,i,c),y=()=>be(u,i,c),k=i.preserveVertices;return a?m.push({op:"move",data:[e+(k?0:b()),t+(k?0:b())]}):m.push({op:"move",data:[e+(k?0:be(u,i,c)),t+(k?0:be(u,i,c))]}),a?m.push({op:"bcurveTo",data:[d+e+(r-e)*f+b(),g+t+(n-t)*f+b(),d+e+2*(r-e)*f+b(),g+t+2*(n-t)*f+b(),r+(k?0:b()),n+(k?0:b())]}):m.push({op:"bcurveTo",data:[d+e+(r-e)*f+y(),g+t+(n-t)*f+y(),d+e+2*(r-e)*f+y(),g+t+2*(n-t)*f+y(),r+(k?0:y()),n+(k?0:y())]}),m}function ma(e,t,r){if(!e.length)return[];const n=[];n.push([e[0][0]+be(t,r),e[0][1]+be(t,r)]),n.push([e[0][0]+be(t,r),e[0][1]+be(t,r)]);for(let i=1;i<e.length;i++)n.push([e[i][0]+be(t,r),e[i][1]+be(t,r)]),i===e.length-1&&n.push([e[i][0]+be(t,r),e[i][1]+be(t,r)]);return Co(n,null,r)}function Co(e,t,r){const n=e.length,i=[];if(n>3){const s=[],a=1-r.curveTightness;i.push({op:"move",data:[e[1][0],e[1][1]]});for(let o=1;o+2<n;o++){const l=e[o];s[0]=[l[0],l[1]],s[1]=[l[0]+(a*e[o+1][0]-a*e[o-1][0])/6,l[1]+(a*e[o+1][1]-a*e[o-1][1])/6],s[2]=[e[o+1][0]+(a*e[o][0]-a*e[o+2][0])/6,e[o+1][1]+(a*e[o][1]-a*e[o+2][1])/6],s[3]=[e[o+1][0],e[o+1][1]],i.push({op:"bcurveTo",data:[s[1][0],s[1][1],s[2][0],s[2][1],s[3][0],s[3][1]]})}}else n===3?(i.push({op:"move",data:[e[1][0],e[1][1]]}),i.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):n===2&&i.push(...au(e[0][0],e[0][1],e[1][0],e[1][1],r,!0,!0));return i}function yp(e,t,r,n,i,s,a,o){const l=[],c=[];if(o.roughness===0){e/=4,c.push([t+n*Math.cos(-e),r+i*Math.sin(-e)]);for(let u=0;u<=2*Math.PI;u+=e){const h=[t+n*Math.cos(u),r+i*Math.sin(u)];l.push(h),c.push(h)}c.push([t+n*Math.cos(0),r+i*Math.sin(0)]),c.push([t+n*Math.cos(e),r+i*Math.sin(e)])}else{const u=be(.5,o)-Math.PI/2;c.push([be(s,o)+t+.9*n*Math.cos(u-e),be(s,o)+r+.9*i*Math.sin(u-e)]);const h=2*Math.PI+u-.01;for(let f=u;f<h;f+=e){const d=[be(s,o)+t+n*Math.cos(f),be(s,o)+r+i*Math.sin(f)];l.push(d),c.push(d)}c.push([be(s,o)+t+n*Math.cos(u+2*Math.PI+.5*a),be(s,o)+r+i*Math.sin(u+2*Math.PI+.5*a)]),c.push([be(s,o)+t+.98*n*Math.cos(u+a),be(s,o)+r+.98*i*Math.sin(u+a)]),c.push([be(s,o)+t+.9*n*Math.cos(u+.5*a),be(s,o)+r+.9*i*Math.sin(u+.5*a)])}return[c,l]}function bp(e,t,r,n,i,s,a,o,l){const c=s+be(.1,l),u=[];u.push([be(o,l)+t+.9*n*Math.cos(c-e),be(o,l)+r+.9*i*Math.sin(c-e)]);for(let h=c;h<=a;h+=e)u.push([be(o,l)+t+n*Math.cos(h),be(o,l)+r+i*Math.sin(h)]);return u.push([t+n*Math.cos(a),r+i*Math.sin(a)]),u.push([t+n*Math.cos(a),r+i*Math.sin(a)]),Co(u,null,l)}function i5(e,t,r,n,i,s,a,o){const l=[],c=[o.maxRandomnessOffset||1,(o.maxRandomnessOffset||1)+.3];let u=[0,0];const h=o.disableMultiStroke?1:2,f=o.preserveVertices;for(let d=0;d<h;d++)d===0?l.push({op:"move",data:[a[0],a[1]]}):l.push({op:"move",data:[a[0]+(f?0:be(c[0],o)),a[1]+(f?0:be(c[0],o))]}),u=f?[i,s]:[i+be(c[d],o),s+be(c[d],o)],l.push({op:"bcurveTo",data:[e+be(c[d],o),t+be(c[d],o),r+be(c[d],o),n+be(c[d],o),u[0],u[1]]});return l}function Ji(e){return[...e]}function kp(e,t=0){const r=e.length;if(r<3)throw new Error("A curve must have at least three points.");const n=[];if(r===3)n.push(Ji(e[0]),Ji(e[1]),Ji(e[2]),Ji(e[2]));else{const i=[];i.push(e[0],e[0]);for(let o=1;o<e.length;o++)i.push(e[o]),o===e.length-1&&i.push(e[o]);const s=[],a=1-t;n.push(Ji(i[0]));for(let o=1;o+2<i.length;o++){const l=i[o];s[0]=[l[0],l[1]],s[1]=[l[0]+(a*i[o+1][0]-a*i[o-1][0])/6,l[1]+(a*i[o+1][1]-a*i[o-1][1])/6],s[2]=[i[o+1][0]+(a*i[o][0]-a*i[o+2][0])/6,i[o+1][1]+(a*i[o][1]-a*i[o+2][1])/6],s[3]=[i[o+1][0],i[o+1][1]],n.push(s[1],s[2],s[3])}}return n}function Pa(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function s5(e,t,r){const n=Pa(t,r);if(n===0)return Pa(e,t);let i=((e[0]-t[0])*(r[0]-t[0])+(e[1]-t[1])*(r[1]-t[1]))/n;return i=Math.max(0,Math.min(1,i)),Pa(e,bn(t,r,i))}function bn(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function ou(e,t,r,n){const i=n||[];if((function(o,l){const c=o[l+0],u=o[l+1],h=o[l+2],f=o[l+3];let d=3*u[0]-2*c[0]-f[0];d*=d;let g=3*u[1]-2*c[1]-f[1];g*=g;let m=3*h[0]-2*f[0]-c[0];m*=m;let b=3*h[1]-2*f[1]-c[1];return b*=b,d<m&&(d=m),g<b&&(g=b),d+g})(e,t)<r){const o=e[t+0];i.length?(s=i[i.length-1],a=o,Math.sqrt(Pa(s,a))>1&&i.push(o)):i.push(o),i.push(e[t+3])}else{const l=e[t+0],c=e[t+1],u=e[t+2],h=e[t+3],f=bn(l,c,.5),d=bn(c,u,.5),g=bn(u,h,.5),m=bn(f,d,.5),b=bn(d,g,.5),y=bn(m,b,.5);ou([l,f,m,y],0,r,i),ou([y,b,g,h],0,r,i)}var s,a;return i}function a5(e,t){return So(e,0,e.length,t)}function So(e,t,r,n,i){const s=i||[],a=e[t],o=e[r-1];let l=0,c=1;for(let u=t+1;u<r-1;++u){const h=s5(e[u],a,o);h>l&&(l=h,c=u)}return Math.sqrt(l)>n?(So(e,t,c+1,n,s),So(e,c,r,n,s)):(s.length||s.push(a),s.push(o)),s}function Xl(e,t=.15,r){const n=[],i=(e.length-1)/3;for(let s=0;s<i;s++)ou(e,3*s,t,n);return r&&r>0?So(n,0,n.length,r):n}const Gt="none";class _o{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,n){return{shape:t,sets:r||[],options:n||this.defaultOptions}}line(t,r,n,i,s){const a=this._o(s);return this._d("line",[gb(t,r,n,i,a)],a)}rectangle(t,r,n,i,s){const a=this._o(s),o=[],l=n5(t,r,n,i,a);if(a.fill){const c=[[t,r],[t+n,r],[t+n,r+i],[t,r+i]];a.fillStyle==="solid"?o.push(Yl([c],a)):o.push(Gn([c],a))}return a.stroke!==Gt&&o.push(l),this._d("rectangle",o,a)}ellipse(t,r,n,i,s){const a=this._o(s),o=[],l=mb(n,i,a),c=su(t,r,a,l);if(a.fill)if(a.fillStyle==="solid"){const u=su(t,r,a,l).opset;u.type="fillPath",o.push(u)}else o.push(Gn([c.estimatedPoints],a));return a.stroke!==Gt&&o.push(c.opset),this._d("ellipse",o,a)}circle(t,r,n,i){const s=this.ellipse(t,r,n,n,i);return s.shape="circle",s}linearPath(t,r){const n=this._o(r);return this._d("linearPath",[Da(t,!1,n)],n)}arc(t,r,n,i,s,a,o=!1,l){const c=this._o(l),u=[],h=gp(t,r,n,i,s,a,o,!0,c);if(o&&c.fill)if(c.fillStyle==="solid"){const f=Object.assign({},c);f.disableMultiStroke=!0;const d=gp(t,r,n,i,s,a,!0,!1,f);d.type="fillPath",u.push(d)}else u.push((function(f,d,g,m,b,y,k){const v=f,C=d;let S=Math.abs(g/2),w=Math.abs(m/2);S+=be(.01*S,k),w+=be(.01*w,k);let T=b,$=y;for(;T<0;)T+=2*Math.PI,$+=2*Math.PI;$-T>2*Math.PI&&(T=0,$=2*Math.PI);const M=($-T)/k.curveStepCount,E=[];for(let N=T;N<=$;N+=M)E.push([v+S*Math.cos(N),C+w*Math.sin(N)]);return E.push([v+S*Math.cos($),C+w*Math.sin($)]),E.push([v,C]),Gn([E],k)})(t,r,n,i,s,a,c));return c.stroke!==Gt&&u.push(h),this._d("arc",u,c)}curve(t,r){const n=this._o(r),i=[],s=pp(t,n);if(n.fill&&n.fill!==Gt)if(n.fillStyle==="solid"){const a=pp(t,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(a.ops)})}else{const a=[],o=t;if(o.length){const l=typeof o[0][0]=="number"?[o]:o;for(const c of l)c.length<3?a.push(...c):c.length===3?a.push(...Xl(kp([c[0],c[0],c[1],c[2]]),10,(1+n.roughness)/2)):a.push(...Xl(kp(c),10,(1+n.roughness)/2))}a.length&&i.push(Gn([a],n))}return n.stroke!==Gt&&i.push(s),this._d("curve",i,n)}polygon(t,r){const n=this._o(r),i=[],s=Da(t,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(Yl([t],n)):i.push(Gn([t],n))),n.stroke!==Gt&&i.push(s),this._d("polygon",i,n)}path(t,r){const n=this._o(r),i=[];if(!t)return this._d("path",i,n);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const s=n.fill&&n.fill!=="transparent"&&n.fill!==Gt,a=n.stroke!==Gt,o=!!(n.simplification&&n.simplification<1),l=(function(u,h,f){const d=fb(db(Hh(u))),g=[];let m=[],b=[0,0],y=[];const k=()=>{y.length>=4&&m.push(...Xl(y,h)),y=[]},v=()=>{k(),m.length&&(g.push(m),m=[])};for(const{key:S,data:w}of d)switch(S){case"M":v(),b=[w[0],w[1]],m.push(b);break;case"L":k(),m.push([w[0],w[1]]);break;case"C":if(!y.length){const T=m.length?m[m.length-1]:b;y.push([T[0],T[1]])}y.push([w[0],w[1]]),y.push([w[2],w[3]]),y.push([w[4],w[5]]);break;case"Z":k(),m.push([b[0],b[1]])}if(v(),!f)return g;const C=[];for(const S of g){const w=a5(S,f);w.length&&C.push(w)}return C})(t,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),c=mp(t,n);if(s)if(n.fillStyle==="solid")if(l.length===1){const u=mp(t,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(u.ops)})}else i.push(Yl(l,n));else i.push(Gn(l,n));return a&&(o?l.forEach((u=>{i.push(Da(u,!1,n))})):i.push(c)),this._d("path",i,n)}opsToPath(t,r){let n="";for(const i of t.ops){const s=typeof r=="number"&&r>=0?i.data.map((a=>+a.toFixed(r))):i.data;switch(i.op){case"move":n+=`M${s[0]} ${s[1]} `;break;case"bcurveTo":n+=`C${s[0]} ${s[1]}, ${s[2]} ${s[3]}, ${s[4]} ${s[5]} `;break;case"lineTo":n+=`L${s[0]} ${s[1]} `}}return n.trim()}toPaths(t){const r=t.sets||[],n=t.options||this.defaultOptions,i=[];for(const s of r){let a=null;switch(s.type){case"path":a={d:this.opsToPath(s),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Gt};break;case"fillPath":a={d:this.opsToPath(s),stroke:Gt,strokeWidth:0,fill:n.fill||Gt};break;case"fillSketch":a=this.fillSketch(s,n)}a&&i.push(a)}return i}fillSketch(t,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||Gt,strokeWidth:n,fill:Gt}}_mergedShape(t){return t.filter(((r,n)=>n===0||r.op!=="move"))}}class o5{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new _o(r)}draw(t){const r=t.sets||[],n=t.options||this.getDefaultOptions(),i=this.ctx,s=t.options.fixedDecimalPlaceDigits;for(const a of r)switch(a.type){case"path":i.save(),i.strokeStyle=n.stroke==="none"?"transparent":n.stroke,i.lineWidth=n.strokeWidth,n.strokeLineDash&&i.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(i.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(i,a,s),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";const o=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,a,s,o),i.restore();break}case"fillSketch":this.fillSketch(i,a,n)}}fillSketch(t,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2),t.save(),n.fillLineDash&&t.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(t.lineDashOffset=n.fillLineDashOffset),t.strokeStyle=n.fill||"",t.lineWidth=i,this._drawToContext(t,r,n.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,n,i="nonzero"){t.beginPath();for(const s of r.ops){const a=typeof n=="number"&&n>=0?s.data.map((o=>+o.toFixed(n))):s.data;switch(s.op){case"move":t.moveTo(a[0],a[1]);break;case"bcurveTo":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":t.lineTo(a[0],a[1])}}r.type==="fillPath"?t.fill(i):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,n,i,s){const a=this.gen.line(t,r,n,i,s);return this.draw(a),a}rectangle(t,r,n,i,s){const a=this.gen.rectangle(t,r,n,i,s);return this.draw(a),a}ellipse(t,r,n,i,s){const a=this.gen.ellipse(t,r,n,i,s);return this.draw(a),a}circle(t,r,n,i){const s=this.gen.circle(t,r,n,i);return this.draw(s),s}linearPath(t,r){const n=this.gen.linearPath(t,r);return this.draw(n),n}polygon(t,r){const n=this.gen.polygon(t,r);return this.draw(n),n}arc(t,r,n,i,s,a,o=!1,l){const c=this.gen.arc(t,r,n,i,s,a,o,l);return this.draw(c),c}curve(t,r){const n=this.gen.curve(t,r);return this.draw(n),n}path(t,r){const n=this.gen.path(t,r);return this.draw(n),n}}const xa="http://www.w3.org/2000/svg";class l5{constructor(t,r){this.svg=t,this.gen=new _o(r)}draw(t){const r=t.sets||[],n=t.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,s=i.createElementNS(xa,"g"),a=t.options.fixedDecimalPlaceDigits;for(const o of r){let l=null;switch(o.type){case"path":l=i.createElementNS(xa,"path"),l.setAttribute("d",this.opsToPath(o,a)),l.setAttribute("stroke",n.stroke),l.setAttribute("stroke-width",n.strokeWidth+""),l.setAttribute("fill","none"),n.strokeLineDash&&l.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":l=i.createElementNS(xa,"path"),l.setAttribute("d",this.opsToPath(o,a)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",n.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(i,o,n)}l&&s.appendChild(l)}return s}fillSketch(t,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);const s=t.createElementNS(xa,"path");return s.setAttribute("d",this.opsToPath(r,n.fixedDecimalPlaceDigits)),s.setAttribute("stroke",n.fill||""),s.setAttribute("stroke-width",i+""),s.setAttribute("fill","none"),n.fillLineDash&&s.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&s.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),s}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,n,i,s){const a=this.gen.line(t,r,n,i,s);return this.draw(a)}rectangle(t,r,n,i,s){const a=this.gen.rectangle(t,r,n,i,s);return this.draw(a)}ellipse(t,r,n,i,s){const a=this.gen.ellipse(t,r,n,i,s);return this.draw(a)}circle(t,r,n,i){const s=this.gen.circle(t,r,n,i);return this.draw(s)}linearPath(t,r){const n=this.gen.linearPath(t,r);return this.draw(n)}polygon(t,r){const n=this.gen.polygon(t,r);return this.draw(n)}arc(t,r,n,i,s,a,o=!1,l){const c=this.gen.arc(t,r,n,i,s,a,o,l);return this.draw(c)}curve(t,r){const n=this.gen.curve(t,r);return this.draw(n)}path(t,r){const n=this.gen.path(t,r);return this.draw(n)}}var oe={canvas:(e,t)=>new o5(e,t),svg:(e,t)=>new l5(e,t),generator:e=>new _o(e),newSeed:()=>_o.newSeed()},xe=x(async(e,t,r)=>{let n;const i=t.useHtmlLabels||dt(Pe()?.htmlLabels);r?n=r:n="node default";const s=e.insert("g").attr("class",n).attr("id",t.domId||t.id),a=s.insert("g").attr("class","label").attr("style",Tt(t.labelStyle));let o;t.label===void 0?o="":o=typeof t.label=="string"?t.label:t.label[0];const l=await ln(a,tr(zn(o),Pe()),{useHtmlLabels:i,width:t.width||Pe().flowchart?.wrappingWidth,cssClasses:"markdown-node-label",style:t.labelStyle,addSvgBackground:!!t.icon||!!t.img});let c=l.getBBox();const u=(t?.padding??0)/2;if(i){const h=l.children[0],f=$e(l),d=h.getElementsByTagName("img");if(d){const g=o.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...d].map(m=>new Promise(b=>{function y(){if(m.style.display="flex",m.style.flexDirection="column",g){const k=Pe().fontSize?Pe().fontSize:window.getComputedStyle(document.body).fontSize,v=5,[C=Lm.fontSize]=Ko(k),S=C*v+"px";m.style.minWidth=S,m.style.maxWidth=S}else m.style.width="100%";b(m)}x(y,"setupImage"),setTimeout(()=>{m.complete&&y()}),m.addEventListener("error",y),m.addEventListener("load",y)})))}c=h.getBoundingClientRect(),f.attr("width",c.width),f.attr("height",c.height)}return i?a.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"):a.attr("transform","translate(0, "+-c.height/2+")"),t.centerLabel&&a.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:s,bbox:c,halfPadding:u,label:a}},"labelHelper"),Ql=x(async(e,t,r)=>{const n=r.useHtmlLabels||dt(Pe()?.flowchart?.htmlLabels),i=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await ln(i,tr(zn(t),Pe()),{useHtmlLabels:n,width:r.width||Pe()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let a=s.getBBox();const o=r.padding/2;if(dt(Pe()?.flowchart?.htmlLabels)){const l=s.children[0],c=$e(s);a=l.getBoundingClientRect(),c.attr("width",a.width),c.attr("height",a.height)}return n?i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"):i.attr("transform","translate(0, "+-a.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:e,bbox:a,halfPadding:o,label:i}},"insertLabel"),ue=x((e,t)=>{const r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds"),pe=x((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function Ne(e){const t=e.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}x(Ne,"createPathFromPoints");function sn(e,t,r,n,i,s){const a=[],l=r-e,c=n-t,u=l/s,h=2*Math.PI/u,f=t+c/2;for(let d=0;d<=50;d++){const g=d/50,m=e+g*l,b=f+i*Math.sin(h*(m-e));a.push({x:m,y:b})}return a}x(sn,"generateFullSineWavePoints");function Bs(e,t,r,n,i,s){const a=[],o=i*Math.PI/180,u=(s*Math.PI/180-o)/(n-1);for(let h=0;h<n;h++){const f=o+h*u,d=e+r*Math.cos(f),g=t+r*Math.sin(f);a.push({x:-d,y:-g})}return a}x(Bs,"generateCirclePoints");var c5=x((e,t)=>{var r=e.x,n=e.y,i=t.x-r,s=t.y-n,a=e.width/2,o=e.height/2,l,c;return Math.abs(s)*a>Math.abs(i)*o?(s<0&&(o=-o),l=s===0?0:o*i/s,c=o):(i<0&&(a=-a),l=a,c=i===0?0:a*s/i),{x:r+l,y:n+c}},"intersectRect"),Ei=c5;function yb(e,t){t&&e.attr("style",t)}x(yb,"applyStyle");async function bb(e){const t=$e(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),r=t.append("xhtml:div"),n=Pe();let i=e.label;e.label&&pi(e.label)&&(i=await Xu(e.label.replace(Ci.lineBreakRegex,`
290
+ `),n));const a='<span class="'+(e.isNode?"nodeLabel":"edgeLabel")+'" '+(e.labelStyle?'style="'+e.labelStyle+'"':"")+">"+i+"</span>";return r.html(tr(a,n)),yb(r,e.labelStyle),r.style("display","inline-block"),r.style("padding-right","1px"),r.style("white-space","nowrap"),r.attr("xmlns","http://www.w3.org/1999/xhtml"),t.node()}x(bb,"addHtmlLabel");var u5=x(async(e,t,r,n)=>{let i=e||"";if(typeof i=="object"&&(i=i[0]),dt(Pe().flowchart.htmlLabels)){i=i.replace(/\\n|\n/g,"<br />"),X.info("vertexText"+i);const s={isNode:n,label:zn(i).replace(/fa[blrs]?:fa-[\w-]+/g,o=>`<i class='${o.replace(":"," ")}'></i>`),labelStyle:t&&t.replace("fill:","color:")};return await bb(s)}else{const s=document.createElementNS("http://www.w3.org/2000/svg","text");s.setAttribute("style",t.replace("color:","fill:"));let a=[];typeof i=="string"?a=i.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(i)?a=i:a=[];for(const o of a){const l=document.createElementNS("http://www.w3.org/2000/svg","tspan");l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),l.setAttribute("dy","1em"),l.setAttribute("x","0"),r?l.setAttribute("class","title-row"):l.setAttribute("class","row"),l.textContent=o.trim(),s.appendChild(l)}return s}},"createLabel"),_n=u5,cn=x((e,t,r,n,i)=>["M",e+i,t,"H",e+r-i,"A",i,i,0,0,1,e+r,t+i,"V",t+n-i,"A",i,i,0,0,1,e+r-i,t+n,"H",e+i,"A",i,i,0,0,1,e,t+n-i,"V",t+i,"A",i,i,0,0,1,e+i,t,"Z"].join(" "),"createRoundedRectPathD"),kb=x(async(e,t)=>{X.info("Creating subgraph rect for ",t.id,t);const r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:s,clusterBorder:a}=n,{labelStyles:o,nodeStyles:l,borderStyles:c,backgroundStyles:u}=ce(t),h=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.id).attr("data-look",t.look),f=dt(r.flowchart.htmlLabels),d=h.insert("g").attr("class","cluster-label "),g=await ln(d,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0});let m=g.getBBox();if(dt(r.flowchart.htmlLabels)){const T=g.children[0],$=$e(g);m=T.getBoundingClientRect(),$.attr("width",m.width),$.attr("height",m.height)}const b=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(b-t.width)/2-t.padding:t.diff=-t.padding;const y=t.height,k=t.x-b/2,v=t.y-y/2;X.trace("Data ",t,JSON.stringify(t));let C;if(t.look==="handDrawn"){const T=oe.svg(h),$=le(t,{roughness:.7,fill:s,stroke:a,fillWeight:3,seed:i}),M=T.path(cn(k,v,b,y,0),$);C=h.insert(()=>(X.debug("Rough node insert CXC",M),M),":first-child"),C.select("path:nth-child(2)").attr("style",c.join(";")),C.select("path").attr("style",u.join(";").replace("fill","stroke"))}else C=h.insert("rect",":first-child"),C.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",k).attr("y",v).attr("width",b).attr("height",y);const{subGraphTitleTopMargin:S}=kh(r);if(d.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+S})`),o){const T=d.select("span");T&&T.attr("style",o)}const w=C.node().getBBox();return t.offsetX=0,t.width=w.width,t.height=w.height,t.offsetY=m.height-t.padding/2,t.intersect=function(T){return Ei(t,T)},{cluster:h,labelBBox:m}},"rect"),h5=x((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.id),n=r.insert("rect",":first-child"),i=0*t.padding,s=i/2;n.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-s).attr("y",t.y-t.height/2-s).attr("width",t.width+i).attr("height",t.height+i).attr("fill","none");const a=n.node().getBBox();return t.width=a.width,t.height=a.height,t.intersect=function(o){return Ei(t,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),d5=x(async(e,t)=>{const r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:s,compositeBackground:a,compositeTitleBackground:o,nodeBorder:l}=n,c=e.insert("g").attr("class",t.cssClasses).attr("id",t.id).attr("data-id",t.id).attr("data-look",t.look),u=c.insert("g",":first-child"),h=c.insert("g").attr("class","cluster-label");let f=c.append("rect");const d=h.node().appendChild(await _n(t.label,t.labelStyle,void 0,!0));let g=d.getBBox();if(dt(r.flowchart.htmlLabels)){const M=d.children[0],E=$e(d);g=M.getBoundingClientRect(),E.attr("width",g.width),E.attr("height",g.height)}const m=0*t.padding,b=m/2,y=(t.width<=g.width+t.padding?g.width+t.padding:t.width)+m;t.width<=g.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const k=t.height+m,v=t.height+m-g.height-6,C=t.x-y/2,S=t.y-k/2;t.width=y;const w=t.y-t.height/2-b+g.height+2;let T;if(t.look==="handDrawn"){const M=t.cssClasses.includes("statediagram-cluster-alt"),E=oe.svg(c),N=t.rx||t.ry?E.path(cn(C,S,y,k,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:i}):E.rectangle(C,S,y,k,{seed:i});T=c.insert(()=>N,":first-child");const D=E.rectangle(C,w,y,v,{fill:M?s:a,fillStyle:M?"hachure":"solid",stroke:l,seed:i});T=c.insert(()=>N,":first-child"),f=c.insert(()=>D)}else T=u.insert("rect",":first-child"),T.attr("class","outer").attr("x",C).attr("y",S).attr("width",y).attr("height",k).attr("data-look",t.look),f.attr("class","inner").attr("x",C).attr("y",w).attr("width",y).attr("height",v);h.attr("transform",`translate(${t.x-g.width/2}, ${S+1-(dt(r.flowchart.htmlLabels)?0:3)})`);const $=T.node().getBBox();return t.height=$.height,t.offsetX=0,t.offsetY=g.height-t.padding/2,t.labelBBox=g,t.intersect=function(M){return Ei(t,M)},{cluster:c,labelBBox:g}},"roundedWithTitle"),f5=x(async(e,t)=>{X.info("Creating subgraph rect for ",t.id,t);const r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:s,clusterBorder:a}=n,{labelStyles:o,nodeStyles:l,borderStyles:c,backgroundStyles:u}=ce(t),h=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.id).attr("data-look",t.look),f=dt(r.flowchart.htmlLabels),d=h.insert("g").attr("class","cluster-label "),g=await ln(d,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width});let m=g.getBBox();if(dt(r.flowchart.htmlLabels)){const T=g.children[0],$=$e(g);m=T.getBoundingClientRect(),$.attr("width",m.width),$.attr("height",m.height)}const b=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(b-t.width)/2-t.padding:t.diff=-t.padding;const y=t.height,k=t.x-b/2,v=t.y-y/2;X.trace("Data ",t,JSON.stringify(t));let C;if(t.look==="handDrawn"){const T=oe.svg(h),$=le(t,{roughness:.7,fill:s,stroke:a,fillWeight:4,seed:i}),M=T.path(cn(k,v,b,y,t.rx),$);C=h.insert(()=>(X.debug("Rough node insert CXC",M),M),":first-child"),C.select("path:nth-child(2)").attr("style",c.join(";")),C.select("path").attr("style",u.join(";").replace("fill","stroke"))}else C=h.insert("rect",":first-child"),C.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",k).attr("y",v).attr("width",b).attr("height",y);const{subGraphTitleTopMargin:S}=kh(r);if(d.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+S})`),o){const T=d.select("span");T&&T.attr("style",o)}const w=C.node().getBBox();return t.offsetX=0,t.width=w.width,t.height=w.height,t.offsetY=m.height-t.padding/2,t.intersect=function(T){return Ei(t,T)},{cluster:h,labelBBox:m}},"kanbanSection"),p5=x((e,t)=>{const r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:s}=n,a=e.insert("g").attr("class",t.cssClasses).attr("id",t.id).attr("data-look",t.look),o=a.insert("g",":first-child"),l=0*t.padding,c=t.width+l;t.diff=-t.padding;const u=t.height+l,h=t.x-c/2,f=t.y-u/2;t.width=c;let d;if(t.look==="handDrawn"){const b=oe.svg(a).rectangle(h,f,c,u,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:s,seed:i});d=a.insert(()=>b,":first-child")}else d=o.insert("rect",":first-child"),d.attr("class","divider").attr("x",h).attr("y",f).attr("width",c).attr("height",u).attr("data-look",t.look);const g=d.node().getBBox();return t.height=g.height,t.offsetX=0,t.offsetY=0,t.intersect=function(m){return Ei(t,m)},{cluster:a,labelBBox:{}}},"divider"),g5=kb,m5={rect:kb,squareRect:g5,roundedWithTitle:d5,noteGroup:h5,divider:p5,kanbanSection:f5},wb=new Map,x5=x(async(e,t)=>{const r=t.shape||"rect",n=await m5[r](e,t);return wb.set(t.id,n),n},"insertCluster"),C6=x(()=>{wb=new Map},"clear");function vb(e,t){return e.intersect(t)}x(vb,"intersectNode");var y5=vb;function Cb(e,t,r,n){var i=e.x,s=e.y,a=i-n.x,o=s-n.y,l=Math.sqrt(t*t*o*o+r*r*a*a),c=Math.abs(t*r*a/l);n.x<i&&(c=-c);var u=Math.abs(t*r*o/l);return n.y<s&&(u=-u),{x:i+c,y:s+u}}x(Cb,"intersectEllipse");var Sb=Cb;function _b(e,t,r){return Sb(e,t,t,r)}x(_b,"intersectCircle");var b5=_b;function Tb(e,t,r,n){{const i=t.y-e.y,s=e.x-t.x,a=t.x*e.y-e.x*t.y,o=i*r.x+s*r.y+a,l=i*n.x+s*n.y+a,c=1e-6;if(o!==0&&l!==0&&lu(o,l))return;const u=n.y-r.y,h=r.x-n.x,f=n.x*r.y-r.x*n.y,d=u*e.x+h*e.y+f,g=u*t.x+h*t.y+f;if(Math.abs(d)<c&&Math.abs(g)<c&&lu(d,g))return;const m=i*h-u*s;if(m===0)return;const b=Math.abs(m/2);let y=s*f-h*a;const k=y<0?(y-b)/m:(y+b)/m;y=u*a-i*f;const v=y<0?(y-b)/m:(y+b)/m;return{x:k,y:v}}}x(Tb,"intersectLine");function lu(e,t){return e*t>0}x(lu,"sameSign");var k5=Tb;function Eb(e,t,r){let n=e.x,i=e.y,s=[],a=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(u){a=Math.min(a,u.x),o=Math.min(o,u.y)}):(a=Math.min(a,t.x),o=Math.min(o,t.y));let l=n-e.width/2-a,c=i-e.height/2-o;for(let u=0;u<t.length;u++){let h=t[u],f=t[u<t.length-1?u+1:0],d=k5(e,r,{x:l+h.x,y:c+h.y},{x:l+f.x,y:c+f.y});d&&s.push(d)}return s.length?(s.length>1&&s.sort(function(u,h){let f=u.x-r.x,d=u.y-r.y,g=Math.sqrt(f*f+d*d),m=h.x-r.x,b=h.y-r.y,y=Math.sqrt(m*m+b*b);return g<y?-1:g===y?0:1}),s[0]):e}x(Eb,"intersectPolygon");var w5=Eb,ie={node:y5,circle:b5,ellipse:Sb,polygon:w5,rect:Ei};function Ab(e,t){const{labelStyles:r}=ce(t);t.labelStyle=r;const n=pe(t);let i=n;n||(i="anchor");const s=e.insert("g").attr("class",i).attr("id",t.domId||t.id),a=1,{cssStyles:o}=t,l=oe.svg(s),c=le(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(c.roughness=0);const u=l.circle(0,0,a*2,c),h=s.insert(()=>u,":first-child");return h.attr("class","anchor").attr("style",Tt(o)),ue(t,h),t.intersect=function(f){return X.info("Circle intersect",t,a,f),ie.circle(t,a,f)},s}x(Ab,"anchor");function cu(e,t,r,n,i,s,a){const l=(e+r)/2,c=(t+n)/2,u=Math.atan2(n-t,r-e),h=(r-e)/2,f=(n-t)/2,d=h/i,g=f/s,m=Math.sqrt(d**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const b=Math.sqrt(1-m**2),y=l+b*s*Math.sin(u)*(a?-1:1),k=c-b*i*Math.cos(u)*(a?-1:1),v=Math.atan2((t-k)/s,(e-y)/i);let S=Math.atan2((n-k)/s,(r-y)/i)-v;a&&S<0&&(S+=2*Math.PI),!a&&S>0&&(S-=2*Math.PI);const w=[];for(let T=0;T<20;T++){const $=T/19,M=v+$*S,E=y+i*Math.cos(M),N=k+s*Math.sin(M);w.push({x:E,y:N})}return w}x(cu,"generateArcPoints");async function Mb(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await xe(e,t,pe(t)),a=s.width+t.padding+20,o=s.height+t.padding,l=o/2,c=l/(2.5+o/50),{cssStyles:u}=t,h=[{x:a/2,y:-o/2},{x:-a/2,y:-o/2},...cu(-a/2,-o/2,-a/2,o/2,c,l,!1),{x:a/2,y:o/2},...cu(a/2,o/2,a/2,-o/2,c,l,!0)],f=oe.svg(i),d=le(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const g=Ne(h),m=f.path(g,d),b=i.insert(()=>m,":first-child");return b.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",u),n&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",n),b.attr("transform",`translate(${c/2}, 0)`),ue(t,b),t.intersect=function(y){return ie.polygon(t,h,y)},i}x(Mb,"bowTieRect");function un(e,t,r,n){return e.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}x(un,"insertPolygonShape");async function Nb(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await xe(e,t,pe(t)),a=s.height+t.padding,o=12,l=s.width+t.padding+o,c=0,u=l,h=-a,f=0,d=[{x:c+o,y:h},{x:u,y:h},{x:u,y:f},{x:c,y:f},{x:c,y:h+o},{x:c+o,y:h}];let g;const{cssStyles:m}=t;if(t.look==="handDrawn"){const b=oe.svg(i),y=le(t,{}),k=Ne(d),v=b.path(k,y);g=i.insert(()=>v,":first-child").attr("transform",`translate(${-l/2}, ${a/2})`),m&&g.attr("style",m)}else g=un(i,l,a,d);return n&&g.attr("style",n),ue(t,g),t.intersect=function(b){return ie.polygon(t,d,b)},i}x(Nb,"card");function Lb(e,t){const{nodeStyles:r}=ce(t);t.label="";const n=e.insert("g").attr("class",pe(t)).attr("id",t.domId??t.id),{cssStyles:i}=t,s=Math.max(28,t.width??0),a=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}],o=oe.svg(n),l=le(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=Ne(a),u=o.path(c,l),h=n.insert(()=>u,":first-child");return i&&t.look!=="handDrawn"&&h.selectAll("path").attr("style",i),r&&t.look!=="handDrawn"&&h.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(f){return ie.polygon(t,a,f)},n}x(Lb,"choice");async function Wh(e,t,r){const{labelStyles:n,nodeStyles:i}=ce(t);t.labelStyle=n;const{shapeSvg:s,bbox:a,halfPadding:o}=await xe(e,t,pe(t)),l=r?.padding??o,c=a.width/2+l;let u;const{cssStyles:h}=t;if(t.look==="handDrawn"){const f=oe.svg(s),d=le(t,{}),g=f.circle(0,0,c*2,d);u=s.insert(()=>g,":first-child"),u.attr("class","basic label-container").attr("style",Tt(h))}else u=s.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",c).attr("cx",0).attr("cy",0);return ue(t,u),t.calcIntersect=function(f,d){const g=f.width/2;return ie.circle(f,g,d)},t.intersect=function(f){return X.info("Circle intersect",t,c,f),ie.circle(t,c,f)},s}x(Wh,"circle");function Ib(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=e*2,i={x:n/2*t,y:n/2*r},s={x:-(n/2)*t,y:n/2*r},a={x:-(n/2)*t,y:-(n/2)*r},o={x:n/2*t,y:-(n/2)*r};return`M ${s.x},${s.y} L ${o.x},${o.y}
291
+ M ${i.x},${i.y} L ${a.x},${a.y}`}x(Ib,"createLine");function $b(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r,t.label="";const i=e.insert("g").attr("class",pe(t)).attr("id",t.domId??t.id),s=Math.max(30,t?.width??0),{cssStyles:a}=t,o=oe.svg(i),l=le(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=o.circle(0,0,s*2,l),u=Ib(s),h=o.path(u,l),f=i.insert(()=>c,":first-child");return f.insert(()=>h),a&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",a),n&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",n),ue(t,f),t.intersect=function(d){return X.info("crossedCircle intersect",t,{radius:s,point:d}),ie.circle(t,s,d)},i}x($b,"crossedCircle");function Br(e,t,r,n=100,i=0,s=180){const a=[],o=i*Math.PI/180,u=(s*Math.PI/180-o)/(n-1);for(let h=0;h<n;h++){const f=o+h*u,d=e+r*Math.cos(f),g=t+r*Math.sin(f);a.push({x:-d,y:-g})}return a}x(Br,"generateCirclePoints");async function jb(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await xe(e,t,pe(t)),o=s.width+(t.padding??0),l=s.height+(t.padding??0),c=Math.max(5,l*.1),{cssStyles:u}=t,h=[...Br(o/2,-l/2,c,30,-90,0),{x:-o/2-c,y:c},...Br(o/2+c*2,-c,c,20,-180,-270),...Br(o/2+c*2,c,c,20,-90,-180),{x:-o/2-c,y:-l/2},...Br(o/2,l/2,c,20,0,90)],f=[{x:o/2,y:-l/2-c},{x:-o/2,y:-l/2-c},...Br(o/2,-l/2,c,20,-90,0),{x:-o/2-c,y:-c},...Br(o/2+o*.1,-c,c,20,-180,-270),...Br(o/2+o*.1,c,c,20,-90,-180),{x:-o/2-c,y:l/2},...Br(o/2,l/2,c,20,0,90),{x:-o/2,y:l/2+c},{x:o/2,y:l/2+c}],d=oe.svg(i),g=le(t,{fill:"none"});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const b=Ne(h).replace("Z",""),y=d.path(b,g),k=Ne(f),v=d.path(k,{...g}),C=i.insert("g",":first-child");return C.insert(()=>v,":first-child").attr("stroke-opacity",0),C.insert(()=>y,":first-child"),C.attr("class","text"),u&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",u),n&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.attr("transform",`translate(${c}, 0)`),a.attr("transform",`translate(${-o/2+c-(s.x-(s.left??0))},${-l/2+(t.padding??0)/2-(s.y-(s.top??0))})`),ue(t,C),t.intersect=function(S){return ie.polygon(t,f,S)},i}x(jb,"curlyBraceLeft");function Dr(e,t,r,n=100,i=0,s=180){const a=[],o=i*Math.PI/180,u=(s*Math.PI/180-o)/(n-1);for(let h=0;h<n;h++){const f=o+h*u,d=e+r*Math.cos(f),g=t+r*Math.sin(f);a.push({x:d,y:g})}return a}x(Dr,"generateCirclePoints");async function Bb(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await xe(e,t,pe(t)),o=s.width+(t.padding??0),l=s.height+(t.padding??0),c=Math.max(5,l*.1),{cssStyles:u}=t,h=[...Dr(o/2,-l/2,c,20,-90,0),{x:o/2+c,y:-c},...Dr(o/2+c*2,-c,c,20,-180,-270),...Dr(o/2+c*2,c,c,20,-90,-180),{x:o/2+c,y:l/2},...Dr(o/2,l/2,c,20,0,90)],f=[{x:-o/2,y:-l/2-c},{x:o/2,y:-l/2-c},...Dr(o/2,-l/2,c,20,-90,0),{x:o/2+c,y:-c},...Dr(o/2+c*2,-c,c,20,-180,-270),...Dr(o/2+c*2,c,c,20,-90,-180),{x:o/2+c,y:l/2},...Dr(o/2,l/2,c,20,0,90),{x:o/2,y:l/2+c},{x:-o/2,y:l/2+c}],d=oe.svg(i),g=le(t,{fill:"none"});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const b=Ne(h).replace("Z",""),y=d.path(b,g),k=Ne(f),v=d.path(k,{...g}),C=i.insert("g",":first-child");return C.insert(()=>v,":first-child").attr("stroke-opacity",0),C.insert(()=>y,":first-child"),C.attr("class","text"),u&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",u),n&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.attr("transform",`translate(${-c}, 0)`),a.attr("transform",`translate(${-o/2+(t.padding??0)/2-(s.x-(s.left??0))},${-l/2+(t.padding??0)/2-(s.y-(s.top??0))})`),ue(t,C),t.intersect=function(S){return ie.polygon(t,f,S)},i}x(Bb,"curlyBraceRight");function mt(e,t,r,n=100,i=0,s=180){const a=[],o=i*Math.PI/180,u=(s*Math.PI/180-o)/(n-1);for(let h=0;h<n;h++){const f=o+h*u,d=e+r*Math.cos(f),g=t+r*Math.sin(f);a.push({x:-d,y:-g})}return a}x(mt,"generateCirclePoints");async function Db(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await xe(e,t,pe(t)),o=s.width+(t.padding??0),l=s.height+(t.padding??0),c=Math.max(5,l*.1),{cssStyles:u}=t,h=[...mt(o/2,-l/2,c,30,-90,0),{x:-o/2-c,y:c},...mt(o/2+c*2,-c,c,20,-180,-270),...mt(o/2+c*2,c,c,20,-90,-180),{x:-o/2-c,y:-l/2},...mt(o/2,l/2,c,20,0,90)],f=[...mt(-o/2+c+c/2,-l/2,c,20,-90,-180),{x:o/2-c/2,y:c},...mt(-o/2-c/2,-c,c,20,0,90),...mt(-o/2-c/2,c,c,20,-90,0),{x:o/2-c/2,y:-c},...mt(-o/2+c+c/2,l/2,c,30,-180,-270)],d=[{x:o/2,y:-l/2-c},{x:-o/2,y:-l/2-c},...mt(o/2,-l/2,c,20,-90,0),{x:-o/2-c,y:-c},...mt(o/2+c*2,-c,c,20,-180,-270),...mt(o/2+c*2,c,c,20,-90,-180),{x:-o/2-c,y:l/2},...mt(o/2,l/2,c,20,0,90),{x:-o/2,y:l/2+c},{x:o/2-c-c/2,y:l/2+c},...mt(-o/2+c+c/2,-l/2,c,20,-90,-180),{x:o/2-c/2,y:c},...mt(-o/2-c/2,-c,c,20,0,90),...mt(-o/2-c/2,c,c,20,-90,0),{x:o/2-c/2,y:-c},...mt(-o/2+c+c/2,l/2,c,30,-180,-270)],g=oe.svg(i),m=le(t,{fill:"none"});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=Ne(h).replace("Z",""),k=g.path(y,m),C=Ne(f).replace("Z",""),S=g.path(C,m),w=Ne(d),T=g.path(w,{...m}),$=i.insert("g",":first-child");return $.insert(()=>T,":first-child").attr("stroke-opacity",0),$.insert(()=>k,":first-child"),$.insert(()=>S,":first-child"),$.attr("class","text"),u&&t.look!=="handDrawn"&&$.selectAll("path").attr("style",u),n&&t.look!=="handDrawn"&&$.selectAll("path").attr("style",n),$.attr("transform",`translate(${c-c/4}, 0)`),a.attr("transform",`translate(${-o/2+(t.padding??0)/2-(s.x-(s.left??0))},${-l/2+(t.padding??0)/2-(s.y-(s.top??0))})`),ue(t,$),t.intersect=function(M){return ie.polygon(t,d,M)},i}x(Db,"curlyBraces");async function Pb(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await xe(e,t,pe(t)),a=80,o=20,l=Math.max(a,(s.width+(t.padding??0)*2)*1.25,t?.width??0),c=Math.max(o,s.height+(t.padding??0)*2,t?.height??0),u=c/2,{cssStyles:h}=t,f=oe.svg(i),d=le(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const g=l,m=c,b=g-u,y=m/4,k=[{x:b,y:0},{x:y,y:0},{x:0,y:m/2},{x:y,y:m},{x:b,y:m},...Bs(-b,-m/2,u,50,270,90)],v=Ne(k),C=f.path(v,d),S=i.insert(()=>C,":first-child");return S.attr("class","basic label-container"),h&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",h),n&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",n),S.attr("transform",`translate(${-l/2}, ${-c/2})`),ue(t,S),t.intersect=function(w){return ie.polygon(t,k,w)},i}x(Pb,"curvedTrapezoid");var v5=x((e,t,r,n,i,s)=>[`M${e},${t+s}`,`a${i},${s} 0,0,0 ${r},0`,`a${i},${s} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${s} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),C5=x((e,t,r,n,i,s)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${i},${s} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${s} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),S5=x((e,t,r,n,i,s)=>[`M${e-r/2},${-n/2}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");async function Fb(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await xe(e,t,pe(t)),o=Math.max(s.width+t.padding,t.width??0),l=o/2,c=l/(2.5+o/50),u=Math.max(s.height+c+t.padding,t.height??0);let h;const{cssStyles:f}=t;if(t.look==="handDrawn"){const d=oe.svg(i),g=C5(0,0,o,u,l,c),m=S5(0,c,o,u,l,c),b=d.path(g,le(t,{})),y=d.path(m,le(t,{fill:"none"}));h=i.insert(()=>y,":first-child"),h=i.insert(()=>b,":first-child"),h.attr("class","basic label-container"),f&&h.attr("style",f)}else{const d=v5(0,0,o,u,l,c);h=i.insert("path",":first-child").attr("d",d).attr("class","basic label-container").attr("style",Tt(f)).attr("style",n)}return h.attr("label-offset-y",c),h.attr("transform",`translate(${-o/2}, ${-(u/2+c)})`),ue(t,h),a.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${-(s.height/2)+(t.padding??0)/1.5-(s.y-(s.top??0))})`),t.intersect=function(d){const g=ie.rect(t,d),m=g.x-(t.x??0);if(l!=0&&(Math.abs(m)<(t.width??0)/2||Math.abs(m)==(t.width??0)/2&&Math.abs(g.y-(t.y??0))>(t.height??0)/2-c)){let b=c*c*(1-m*m/(l*l));b>0&&(b=Math.sqrt(b)),b=c-b,d.y-(t.y??0)>0&&(b=-b),g.y+=b}return g},i}x(Fb,"cylinder");async function Rb(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await xe(e,t,pe(t)),o=s.width+t.padding,l=s.height+t.padding,c=l*.2,u=-o/2,h=-l/2-c/2,{cssStyles:f}=t,d=oe.svg(i),g=le(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:u,y:h+c},{x:-u,y:h+c},{x:-u,y:-h},{x:u,y:-h},{x:u,y:h},{x:-u,y:h},{x:-u,y:h+c}],b=d.polygon(m.map(k=>[k.x,k.y]),g),y=i.insert(()=>b,":first-child");return y.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",f),n&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",n),a.attr("transform",`translate(${u+(t.padding??0)/2-(s.x-(s.left??0))}, ${h+c+(t.padding??0)/2-(s.y-(s.top??0))})`),ue(t,y),t.intersect=function(k){return ie.rect(t,k)},i}x(Rb,"dividedRectangle");async function Ob(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:a}=await xe(e,t,pe(t)),l=s.width/2+a+5,c=s.width/2+a;let u;const{cssStyles:h}=t;if(t.look==="handDrawn"){const f=oe.svg(i),d=le(t,{roughness:.2,strokeWidth:2.5}),g=le(t,{roughness:.2,strokeWidth:1.5}),m=f.circle(0,0,l*2,d),b=f.circle(0,0,c*2,g);u=i.insert("g",":first-child"),u.attr("class",Tt(t.cssClasses)).attr("style",Tt(h)),u.node()?.appendChild(m),u.node()?.appendChild(b)}else{u=i.insert("g",":first-child");const f=u.insert("circle",":first-child"),d=u.insert("circle");u.attr("class","basic label-container").attr("style",n),f.attr("class","outer-circle").attr("style",n).attr("r",l).attr("cx",0).attr("cy",0),d.attr("class","inner-circle").attr("style",n).attr("r",c).attr("cx",0).attr("cy",0)}return ue(t,u),t.intersect=function(f){return X.info("DoubleCircle intersect",t,l,f),ie.circle(t,l,f)},i}x(Ob,"doublecircle");function zb(e,t,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=ce(t);t.label="",t.labelStyle=n;const s=e.insert("g").attr("class",pe(t)).attr("id",t.domId??t.id),a=7,{cssStyles:o}=t,l=oe.svg(s),{nodeBorder:c}=r,u=le(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(u.roughness=0);const h=l.circle(0,0,a*2,u),f=s.insert(()=>h,":first-child");return f.selectAll("path").attr("style",`fill: ${c} !important;`),o&&o.length>0&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",o),i&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",i),ue(t,f),t.intersect=function(d){return X.info("filledCircle intersect",t,{radius:a,point:d}),ie.circle(t,a,d)},s}x(zb,"filledCircle");async function Hb(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await xe(e,t,pe(t)),o=s.width+(t.padding??0),l=o+s.height,c=o+s.height,u=[{x:0,y:-l},{x:c,y:-l},{x:c/2,y:0}],{cssStyles:h}=t,f=oe.svg(i),d=le(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const g=Ne(u),m=f.path(g,d),b=i.insert(()=>m,":first-child").attr("transform",`translate(${-l/2}, ${l/2})`);return h&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",h),n&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),t.width=o,t.height=l,ue(t,b),a.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${-l/2+(t.padding??0)/2+(s.y-(s.top??0))})`),t.intersect=function(y){return X.info("Triangle intersect",t,u,y),ie.polygon(t,u,y)},i}x(Hb,"flippedTriangle");function Wb(e,t,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:s}=ce(t);t.label="";const a=e.insert("g").attr("class",pe(t)).attr("id",t.domId??t.id),{cssStyles:o}=t;let l=Math.max(70,t?.width??0),c=Math.max(10,t?.height??0);r==="LR"&&(l=Math.max(10,t?.width??0),c=Math.max(70,t?.height??0));const u=-1*l/2,h=-1*c/2,f=oe.svg(a),d=le(t,{stroke:i.lineColor,fill:i.lineColor});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const g=f.rectangle(u,h,l,c,d),m=a.insert(()=>g,":first-child");o&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",o),s&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",s),ue(t,m);const b=n?.padding??0;return t.width&&t.height&&(t.width+=b/2||0,t.height+=b/2||0),t.intersect=function(y){return ie.rect(t,y)},a}x(Wb,"forkJoin");async function qb(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const i=80,s=50,{shapeSvg:a,bbox:o}=await xe(e,t,pe(t)),l=Math.max(i,o.width+(t.padding??0)*2,t?.width??0),c=Math.max(s,o.height+(t.padding??0)*2,t?.height??0),u=c/2,{cssStyles:h}=t,f=oe.svg(a),d=le(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const g=[{x:-l/2,y:-c/2},{x:l/2-u,y:-c/2},...Bs(-l/2+u,0,u,50,90,270),{x:l/2-u,y:c/2},{x:-l/2,y:c/2}],m=Ne(g),b=f.path(m,d),y=a.insert(()=>b,":first-child");return y.attr("class","basic label-container"),h&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",h),n&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",n),ue(t,y),t.intersect=function(k){return X.info("Pill intersect",t,{radius:u,point:k}),ie.polygon(t,g,k)},a}x(qb,"halfRoundedRectangle");async function Ub(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await xe(e,t,pe(t)),a=s.height+(t.padding??0),o=s.width+(t.padding??0)*2.5,{cssStyles:l}=t,c=oe.svg(i),u=le(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let h=o/2;const f=h/6;h=h+f;const d=a/2,g=d/2,m=h-g,b=[{x:-m,y:-d},{x:0,y:-d},{x:m,y:-d},{x:h,y:0},{x:m,y:d},{x:0,y:d},{x:-m,y:d},{x:-h,y:0}],y=Ne(b),k=c.path(y,u),v=i.insert(()=>k,":first-child");return v.attr("class","basic label-container"),l&&t.look!=="handDrawn"&&v.selectChildren("path").attr("style",l),n&&t.look!=="handDrawn"&&v.selectChildren("path").attr("style",n),t.width=o,t.height=a,ue(t,v),t.intersect=function(C){return ie.polygon(t,b,C)},i}x(Ub,"hexagon");async function Vb(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.label="",t.labelStyle=r;const{shapeSvg:i}=await xe(e,t,pe(t)),s=Math.max(30,t?.width??0),a=Math.max(30,t?.height??0),{cssStyles:o}=t,l=oe.svg(i),c=le(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const u=[{x:0,y:0},{x:s,y:0},{x:0,y:a},{x:s,y:a}],h=Ne(u),f=l.path(h,c),d=i.insert(()=>f,":first-child");return d.attr("class","basic label-container"),o&&t.look!=="handDrawn"&&d.selectChildren("path").attr("style",o),n&&t.look!=="handDrawn"&&d.selectChildren("path").attr("style",n),d.attr("transform",`translate(${-s/2}, ${-a/2})`),ue(t,d),t.intersect=function(g){return X.info("Pill intersect",t,{points:u}),ie.polygon(t,u,g)},i}x(Vb,"hourglass");async function Gb(e,t,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=ce(t);t.labelStyle=i;const s=t.assetHeight??48,a=t.assetWidth??48,o=Math.max(s,a),l=n?.wrappingWidth;t.width=Math.max(o,l??0);const{shapeSvg:c,bbox:u,label:h}=await xe(e,t,"icon-shape default"),f=t.pos==="t",d=o,g=o,{nodeBorder:m}=r,{stylesMap:b}=Si(t),y=-g/2,k=-d/2,v=t.label?8:0,C=oe.svg(c),S=le(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const w=C.rectangle(y,k,g,d,S),T=Math.max(g,u.width),$=d+u.height+v,M=C.rectangle(-T/2,-$/2,T,$,{...S,fill:"transparent",stroke:"none"}),E=c.insert(()=>w,":first-child"),N=c.insert(()=>M);if(t.icon){const D=c.append("g");D.html(`<g>${await Ks(t.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const R=D.node().getBBox(),I=R.width,F=R.height,L=R.x,B=R.y;D.attr("transform",`translate(${-I/2-L},${f?u.height/2+v/2-F/2-B:-u.height/2-v/2-F/2-B})`),D.attr("style",`color: ${b.get("stroke")??m};`)}return h.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${f?-$/2:$/2-u.height})`),E.attr("transform",`translate(0,${f?u.height/2+v/2:-u.height/2-v/2})`),ue(t,N),t.intersect=function(D){if(X.info("iconSquare intersect",t,D),!t.label)return ie.rect(t,D);const R=t.x??0,I=t.y??0,F=t.height??0;let L=[];return f?L=[{x:R-u.width/2,y:I-F/2},{x:R+u.width/2,y:I-F/2},{x:R+u.width/2,y:I-F/2+u.height+v},{x:R+g/2,y:I-F/2+u.height+v},{x:R+g/2,y:I+F/2},{x:R-g/2,y:I+F/2},{x:R-g/2,y:I-F/2+u.height+v},{x:R-u.width/2,y:I-F/2+u.height+v}]:L=[{x:R-g/2,y:I-F/2},{x:R+g/2,y:I-F/2},{x:R+g/2,y:I-F/2+d},{x:R+u.width/2,y:I-F/2+d},{x:R+u.width/2/2,y:I+F/2},{x:R-u.width/2,y:I+F/2},{x:R-u.width/2,y:I-F/2+d},{x:R-g/2,y:I-F/2+d}],ie.polygon(t,L,D)},c}x(Gb,"icon");async function Yb(e,t,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=ce(t);t.labelStyle=i;const s=t.assetHeight??48,a=t.assetWidth??48,o=Math.max(s,a),l=n?.wrappingWidth;t.width=Math.max(o,l??0);const{shapeSvg:c,bbox:u,label:h}=await xe(e,t,"icon-shape default"),f=20,d=t.label?8:0,g=t.pos==="t",{nodeBorder:m,mainBkg:b}=r,{stylesMap:y}=Si(t),k=oe.svg(c),v=le(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const C=y.get("fill");v.stroke=C??b;const S=c.append("g");t.icon&&S.html(`<g>${await Ks(t.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const w=S.node().getBBox(),T=w.width,$=w.height,M=w.x,E=w.y,N=Math.max(T,$)*Math.SQRT2+f*2,D=k.circle(0,0,N,v),R=Math.max(N,u.width),I=N+u.height+d,F=k.rectangle(-R/2,-I/2,R,I,{...v,fill:"transparent",stroke:"none"}),L=c.insert(()=>D,":first-child"),B=c.insert(()=>F);return S.attr("transform",`translate(${-T/2-M},${g?u.height/2+d/2-$/2-E:-u.height/2-d/2-$/2-E})`),S.attr("style",`color: ${y.get("stroke")??m};`),h.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${g?-I/2:I/2-u.height})`),L.attr("transform",`translate(0,${g?u.height/2+d/2:-u.height/2-d/2})`),ue(t,B),t.intersect=function(H){return X.info("iconSquare intersect",t,H),ie.rect(t,H)},c}x(Yb,"iconCircle");async function Xb(e,t,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=ce(t);t.labelStyle=i;const s=t.assetHeight??48,a=t.assetWidth??48,o=Math.max(s,a),l=n?.wrappingWidth;t.width=Math.max(o,l??0);const{shapeSvg:c,bbox:u,halfPadding:h,label:f}=await xe(e,t,"icon-shape default"),d=t.pos==="t",g=o+h*2,m=o+h*2,{nodeBorder:b,mainBkg:y}=r,{stylesMap:k}=Si(t),v=-m/2,C=-g/2,S=t.label?8:0,w=oe.svg(c),T=le(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const $=k.get("fill");T.stroke=$??y;const M=w.path(cn(v,C,m,g,5),T),E=Math.max(m,u.width),N=g+u.height+S,D=w.rectangle(-E/2,-N/2,E,N,{...T,fill:"transparent",stroke:"none"}),R=c.insert(()=>M,":first-child").attr("class","icon-shape2"),I=c.insert(()=>D);if(t.icon){const F=c.append("g");F.html(`<g>${await Ks(t.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const L=F.node().getBBox(),B=L.width,H=L.height,Q=L.x,_=L.y;F.attr("transform",`translate(${-B/2-Q},${d?u.height/2+S/2-H/2-_:-u.height/2-S/2-H/2-_})`),F.attr("style",`color: ${k.get("stroke")??b};`)}return f.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${d?-N/2:N/2-u.height})`),R.attr("transform",`translate(0,${d?u.height/2+S/2:-u.height/2-S/2})`),ue(t,I),t.intersect=function(F){if(X.info("iconSquare intersect",t,F),!t.label)return ie.rect(t,F);const L=t.x??0,B=t.y??0,H=t.height??0;let Q=[];return d?Q=[{x:L-u.width/2,y:B-H/2},{x:L+u.width/2,y:B-H/2},{x:L+u.width/2,y:B-H/2+u.height+S},{x:L+m/2,y:B-H/2+u.height+S},{x:L+m/2,y:B+H/2},{x:L-m/2,y:B+H/2},{x:L-m/2,y:B-H/2+u.height+S},{x:L-u.width/2,y:B-H/2+u.height+S}]:Q=[{x:L-m/2,y:B-H/2},{x:L+m/2,y:B-H/2},{x:L+m/2,y:B-H/2+g},{x:L+u.width/2,y:B-H/2+g},{x:L+u.width/2/2,y:B+H/2},{x:L-u.width/2,y:B+H/2},{x:L-u.width/2,y:B-H/2+g},{x:L-m/2,y:B-H/2+g}],ie.polygon(t,Q,F)},c}x(Xb,"iconRounded");async function Qb(e,t,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=ce(t);t.labelStyle=i;const s=t.assetHeight??48,a=t.assetWidth??48,o=Math.max(s,a),l=n?.wrappingWidth;t.width=Math.max(o,l??0);const{shapeSvg:c,bbox:u,halfPadding:h,label:f}=await xe(e,t,"icon-shape default"),d=t.pos==="t",g=o+h*2,m=o+h*2,{nodeBorder:b,mainBkg:y}=r,{stylesMap:k}=Si(t),v=-m/2,C=-g/2,S=t.label?8:0,w=oe.svg(c),T=le(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const $=k.get("fill");T.stroke=$??y;const M=w.path(cn(v,C,m,g,.1),T),E=Math.max(m,u.width),N=g+u.height+S,D=w.rectangle(-E/2,-N/2,E,N,{...T,fill:"transparent",stroke:"none"}),R=c.insert(()=>M,":first-child"),I=c.insert(()=>D);if(t.icon){const F=c.append("g");F.html(`<g>${await Ks(t.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const L=F.node().getBBox(),B=L.width,H=L.height,Q=L.x,_=L.y;F.attr("transform",`translate(${-B/2-Q},${d?u.height/2+S/2-H/2-_:-u.height/2-S/2-H/2-_})`),F.attr("style",`color: ${k.get("stroke")??b};`)}return f.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${d?-N/2:N/2-u.height})`),R.attr("transform",`translate(0,${d?u.height/2+S/2:-u.height/2-S/2})`),ue(t,I),t.intersect=function(F){if(X.info("iconSquare intersect",t,F),!t.label)return ie.rect(t,F);const L=t.x??0,B=t.y??0,H=t.height??0;let Q=[];return d?Q=[{x:L-u.width/2,y:B-H/2},{x:L+u.width/2,y:B-H/2},{x:L+u.width/2,y:B-H/2+u.height+S},{x:L+m/2,y:B-H/2+u.height+S},{x:L+m/2,y:B+H/2},{x:L-m/2,y:B+H/2},{x:L-m/2,y:B-H/2+u.height+S},{x:L-u.width/2,y:B-H/2+u.height+S}]:Q=[{x:L-m/2,y:B-H/2},{x:L+m/2,y:B-H/2},{x:L+m/2,y:B-H/2+g},{x:L+u.width/2,y:B-H/2+g},{x:L+u.width/2/2,y:B+H/2},{x:L-u.width/2,y:B+H/2},{x:L-u.width/2,y:B-H/2+g},{x:L-m/2,y:B-H/2+g}],ie.polygon(t,Q,F)},c}x(Qb,"iconSquare");async function Kb(e,t,{config:{flowchart:r}}){const n=new Image;n.src=t?.img??"",await n.decode();const i=Number(n.naturalWidth.toString().replace("px","")),s=Number(n.naturalHeight.toString().replace("px",""));t.imageAspectRatio=i/s;const{labelStyles:a}=ce(t);t.labelStyle=a;const o=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;const l=Math.max(t.label?o??0:0,t?.assetWidth??i),c=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,u=t.constraint==="on"?c/t.imageAspectRatio:t?.assetHeight??s;t.width=Math.max(c,o??0);const{shapeSvg:h,bbox:f,label:d}=await xe(e,t,"image-shape default"),g=t.pos==="t",m=-c/2,b=-u/2,y=t.label?8:0,k=oe.svg(h),v=le(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const C=k.rectangle(m,b,c,u,v),S=Math.max(c,f.width),w=u+f.height+y,T=k.rectangle(-S/2,-w/2,S,w,{...v,fill:"none",stroke:"none"}),$=h.insert(()=>C,":first-child"),M=h.insert(()=>T);if(t.img){const E=h.append("image");E.attr("href",t.img),E.attr("width",c),E.attr("height",u),E.attr("preserveAspectRatio","none"),E.attr("transform",`translate(${-c/2},${g?w/2-u:-w/2})`)}return d.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-u/2-f.height/2-y/2:u/2-f.height/2+y/2})`),$.attr("transform",`translate(0,${g?f.height/2+y/2:-f.height/2-y/2})`),ue(t,M),t.intersect=function(E){if(X.info("iconSquare intersect",t,E),!t.label)return ie.rect(t,E);const N=t.x??0,D=t.y??0,R=t.height??0;let I=[];return g?I=[{x:N-f.width/2,y:D-R/2},{x:N+f.width/2,y:D-R/2},{x:N+f.width/2,y:D-R/2+f.height+y},{x:N+c/2,y:D-R/2+f.height+y},{x:N+c/2,y:D+R/2},{x:N-c/2,y:D+R/2},{x:N-c/2,y:D-R/2+f.height+y},{x:N-f.width/2,y:D-R/2+f.height+y}]:I=[{x:N-c/2,y:D-R/2},{x:N+c/2,y:D-R/2},{x:N+c/2,y:D-R/2+u},{x:N+f.width/2,y:D-R/2+u},{x:N+f.width/2/2,y:D+R/2},{x:N-f.width/2,y:D+R/2},{x:N-f.width/2,y:D-R/2+u},{x:N-c/2,y:D-R/2+u}],ie.polygon(t,I,E)},h}x(Kb,"imageSquare");async function Zb(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await xe(e,t,pe(t)),a=Math.max(s.width+(t.padding??0)*2,t?.width??0),o=Math.max(s.height+(t.padding??0)*2,t?.height??0),l=[{x:0,y:0},{x:a,y:0},{x:a+3*o/6,y:-o},{x:-3*o/6,y:-o}];let c;const{cssStyles:u}=t;if(t.look==="handDrawn"){const h=oe.svg(i),f=le(t,{}),d=Ne(l),g=h.path(d,f);c=i.insert(()=>g,":first-child").attr("transform",`translate(${-a/2}, ${o/2})`),u&&c.attr("style",u)}else c=un(i,a,o,l);return n&&c.attr("style",n),t.width=a,t.height=o,ue(t,c),t.intersect=function(h){return ie.polygon(t,l,h)},i}x(Zb,"inv_trapezoid");async function nl(e,t,r){const{labelStyles:n,nodeStyles:i}=ce(t);t.labelStyle=n;const{shapeSvg:s,bbox:a}=await xe(e,t,pe(t)),o=Math.max(a.width+r.labelPaddingX*2,t?.width||0),l=Math.max(a.height+r.labelPaddingY*2,t?.height||0),c=-o/2,u=-l/2;let h,{rx:f,ry:d}=t;const{cssStyles:g}=t;if(r?.rx&&r.ry&&(f=r.rx,d=r.ry),t.look==="handDrawn"){const m=oe.svg(s),b=le(t,{}),y=f||d?m.path(cn(c,u,o,l,f||0),b):m.rectangle(c,u,o,l,b);h=s.insert(()=>y,":first-child"),h.attr("class","basic label-container").attr("style",Tt(g))}else h=s.insert("rect",":first-child"),h.attr("class","basic label-container").attr("style",i).attr("rx",Tt(f)).attr("ry",Tt(d)).attr("x",c).attr("y",u).attr("width",o).attr("height",l);return ue(t,h),t.calcIntersect=function(m,b){return ie.rect(m,b)},t.intersect=function(m){return ie.rect(t,m)},s}x(nl,"drawRect");async function Jb(e,t){const{shapeSvg:r,bbox:n,label:i}=await xe(e,t,"label"),s=r.insert("rect",":first-child");return s.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),i.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),ue(t,s),t.intersect=function(l){return ie.rect(t,l)},r}x(Jb,"labelRect");async function ek(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await xe(e,t,pe(t)),a=Math.max(s.width+(t.padding??0),t?.width??0),o=Math.max(s.height+(t.padding??0),t?.height??0),l=[{x:0,y:0},{x:a+3*o/6,y:0},{x:a,y:-o},{x:-(3*o)/6,y:-o}];let c;const{cssStyles:u}=t;if(t.look==="handDrawn"){const h=oe.svg(i),f=le(t,{}),d=Ne(l),g=h.path(d,f);c=i.insert(()=>g,":first-child").attr("transform",`translate(${-a/2}, ${o/2})`),u&&c.attr("style",u)}else c=un(i,a,o,l);return n&&c.attr("style",n),t.width=a,t.height=o,ue(t,c),t.intersect=function(h){return ie.polygon(t,l,h)},i}x(ek,"lean_left");async function tk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await xe(e,t,pe(t)),a=Math.max(s.width+(t.padding??0),t?.width??0),o=Math.max(s.height+(t.padding??0),t?.height??0),l=[{x:-3*o/6,y:0},{x:a,y:0},{x:a+3*o/6,y:-o},{x:0,y:-o}];let c;const{cssStyles:u}=t;if(t.look==="handDrawn"){const h=oe.svg(i),f=le(t,{}),d=Ne(l),g=h.path(d,f);c=i.insert(()=>g,":first-child").attr("transform",`translate(${-a/2}, ${o/2})`),u&&c.attr("style",u)}else c=un(i,a,o,l);return n&&c.attr("style",n),t.width=a,t.height=o,ue(t,c),t.intersect=function(h){return ie.polygon(t,l,h)},i}x(tk,"lean_right");function rk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.label="",t.labelStyle=r;const i=e.insert("g").attr("class",pe(t)).attr("id",t.domId??t.id),{cssStyles:s}=t,a=Math.max(35,t?.width??0),o=Math.max(35,t?.height??0),l=7,c=[{x:a,y:0},{x:0,y:o+l/2},{x:a-2*l,y:o+l/2},{x:0,y:2*o},{x:a,y:o-l/2},{x:2*l,y:o-l/2}],u=oe.svg(i),h=le(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");const f=Ne(c),d=u.path(f,h),g=i.insert(()=>d,":first-child");return s&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",s),n&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",n),g.attr("transform",`translate(-${a/2},${-o})`),ue(t,g),t.intersect=function(m){return X.info("lightningBolt intersect",t,m),ie.polygon(t,c,m)},i}x(rk,"lightningBolt");var _5=x((e,t,r,n,i,s,a)=>[`M${e},${t+s}`,`a${i},${s} 0,0,0 ${r},0`,`a${i},${s} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${s} 0,0,0 ${r},0`,`l0,${-n}`,`M${e},${t+s+a}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),T5=x((e,t,r,n,i,s,a)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${i},${s} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${s} 0,0,0 ${r},0`,`l0,${-n}`,`M${e},${t+s+a}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),E5=x((e,t,r,n,i,s)=>[`M${e-r/2},${-n/2}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");async function nk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await xe(e,t,pe(t)),o=Math.max(s.width+(t.padding??0),t.width??0),l=o/2,c=l/(2.5+o/50),u=Math.max(s.height+c+(t.padding??0),t.height??0),h=u*.1;let f;const{cssStyles:d}=t;if(t.look==="handDrawn"){const g=oe.svg(i),m=T5(0,0,o,u,l,c,h),b=E5(0,c,o,u,l,c),y=le(t,{}),k=g.path(m,y),v=g.path(b,y);i.insert(()=>v,":first-child").attr("class","line"),f=i.insert(()=>k,":first-child"),f.attr("class","basic label-container"),d&&f.attr("style",d)}else{const g=_5(0,0,o,u,l,c,h);f=i.insert("path",":first-child").attr("d",g).attr("class","basic label-container").attr("style",Tt(d)).attr("style",n)}return f.attr("label-offset-y",c),f.attr("transform",`translate(${-o/2}, ${-(u/2+c)})`),ue(t,f),a.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${-(s.height/2)+c-(s.y-(s.top??0))})`),t.intersect=function(g){const m=ie.rect(t,g),b=m.x-(t.x??0);if(l!=0&&(Math.abs(b)<(t.width??0)/2||Math.abs(b)==(t.width??0)/2&&Math.abs(m.y-(t.y??0))>(t.height??0)/2-c)){let y=c*c*(1-b*b/(l*l));y>0&&(y=Math.sqrt(y)),y=c-y,g.y-(t.y??0)>0&&(y=-y),m.y+=y}return m},i}x(nk,"linedCylinder");async function ik(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await xe(e,t,pe(t)),o=Math.max(s.width+(t.padding??0)*2,t?.width??0),l=Math.max(s.height+(t.padding??0)*2,t?.height??0),c=l/4,u=l+c,{cssStyles:h}=t,f=oe.svg(i),d=le(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const g=[{x:-o/2-o/2*.1,y:-u/2},{x:-o/2-o/2*.1,y:u/2},...sn(-o/2-o/2*.1,u/2,o/2+o/2*.1,u/2,c,.8),{x:o/2+o/2*.1,y:-u/2},{x:-o/2-o/2*.1,y:-u/2},{x:-o/2,y:-u/2},{x:-o/2,y:u/2*1.1},{x:-o/2,y:-u/2}],m=f.polygon(g.map(y=>[y.x,y.y]),d),b=i.insert(()=>m,":first-child");return b.attr("class","basic label-container"),h&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",h),n&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",n),b.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-o/2+(t.padding??0)+o/2*.1/2-(s.x-(s.left??0))},${-l/2+(t.padding??0)-c/2-(s.y-(s.top??0))})`),ue(t,b),t.intersect=function(y){return ie.polygon(t,g,y)},i}x(ik,"linedWaveEdgedRect");async function sk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await xe(e,t,pe(t)),o=Math.max(s.width+(t.padding??0)*2,t?.width??0),l=Math.max(s.height+(t.padding??0)*2,t?.height??0),c=5,u=-o/2,h=-l/2,{cssStyles:f}=t,d=oe.svg(i),g=le(t,{}),m=[{x:u-c,y:h+c},{x:u-c,y:h+l+c},{x:u+o-c,y:h+l+c},{x:u+o-c,y:h+l},{x:u+o,y:h+l},{x:u+o,y:h+l-c},{x:u+o+c,y:h+l-c},{x:u+o+c,y:h-c},{x:u+c,y:h-c},{x:u+c,y:h},{x:u,y:h},{x:u,y:h+c}],b=[{x:u,y:h+c},{x:u+o-c,y:h+c},{x:u+o-c,y:h+l},{x:u+o,y:h+l},{x:u+o,y:h},{x:u,y:h}];t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const y=Ne(m),k=d.path(y,g),v=Ne(b),C=d.path(v,{...g,fill:"none"}),S=i.insert(()=>C,":first-child");return S.insert(()=>k,":first-child"),S.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",f),n&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",n),a.attr("transform",`translate(${-(s.width/2)-c-(s.x-(s.left??0))}, ${-(s.height/2)+c-(s.y-(s.top??0))})`),ue(t,S),t.intersect=function(w){return ie.polygon(t,m,w)},i}x(sk,"multiRect");async function ak(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await xe(e,t,pe(t)),o=Math.max(s.width+(t.padding??0)*2,t?.width??0),l=Math.max(s.height+(t.padding??0)*2,t?.height??0),c=l/4,u=l+c,h=-o/2,f=-u/2,d=5,{cssStyles:g}=t,m=sn(h-d,f+u+d,h+o-d,f+u+d,c,.8),b=m?.[m.length-1],y=[{x:h-d,y:f+d},{x:h-d,y:f+u+d},...m,{x:h+o-d,y:b.y-d},{x:h+o,y:b.y-d},{x:h+o,y:b.y-2*d},{x:h+o+d,y:b.y-2*d},{x:h+o+d,y:f-d},{x:h+d,y:f-d},{x:h+d,y:f},{x:h,y:f},{x:h,y:f+d}],k=[{x:h,y:f+d},{x:h+o-d,y:f+d},{x:h+o-d,y:b.y-d},{x:h+o,y:b.y-d},{x:h+o,y:f},{x:h,y:f}],v=oe.svg(i),C=le(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const S=Ne(y),w=v.path(S,C),T=Ne(k),$=v.path(T,C),M=i.insert(()=>w,":first-child");return M.insert(()=>$),M.attr("class","basic label-container"),g&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",g),n&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",n),M.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-(s.width/2)-d-(s.x-(s.left??0))}, ${-(s.height/2)+d-c/2-(s.y-(s.top??0))})`),ue(t,M),t.intersect=function(E){return ie.polygon(t,y,E)},i}x(ak,"multiWaveEdgedRectangle");async function ok(e,t,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=ce(t);t.labelStyle=n,t.useHtmlLabels||St().flowchart?.htmlLabels!==!1||(t.centerLabel=!0);const{shapeSvg:a,bbox:o,label:l}=await xe(e,t,pe(t)),c=Math.max(o.width+(t.padding??0)*2,t?.width??0),u=Math.max(o.height+(t.padding??0)*2,t?.height??0),h=-c/2,f=-u/2,{cssStyles:d}=t,g=oe.svg(a),m=le(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const b=g.rectangle(h,f,c,u,m),y=a.insert(()=>b,":first-child");return y.attr("class","basic label-container"),d&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",d),i&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",i),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),ue(t,y),t.intersect=function(k){return ie.rect(t,k)},a}x(ok,"note");var A5=x((e,t,r)=>[`M${e+r/2},${t}`,`L${e+r},${t-r/2}`,`L${e+r/2},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function lk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await xe(e,t,pe(t)),a=s.width+t.padding,o=s.height+t.padding,l=a+o,c=.5,u=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let h;const{cssStyles:f}=t;if(t.look==="handDrawn"){const d=oe.svg(i),g=le(t,{}),m=A5(0,0,l),b=d.path(m,g);h=i.insert(()=>b,":first-child").attr("transform",`translate(${-l/2+c}, ${l/2})`),f&&h.attr("style",f)}else h=un(i,l,l,u),h.attr("transform",`translate(${-l/2+c}, ${l/2})`);return n&&h.attr("style",n),ue(t,h),t.calcIntersect=function(d,g){const m=d.width,b=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],y=ie.polygon(d,b,g);return{x:y.x-.5,y:y.y-.5}},t.intersect=function(d){return this.calcIntersect(t,d)},i}x(lk,"question");async function ck(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await xe(e,t,pe(t)),o=Math.max(s.width+(t.padding??0),t?.width??0),l=Math.max(s.height+(t.padding??0),t?.height??0),c=-o/2,u=-l/2,h=u/2,f=[{x:c+h,y:u},{x:c,y:0},{x:c+h,y:-u},{x:-c,y:-u},{x:-c,y:u}],{cssStyles:d}=t,g=oe.svg(i),m=le(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const b=Ne(f),y=g.path(b,m),k=i.insert(()=>y,":first-child");return k.attr("class","basic label-container"),d&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",d),n&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",n),k.attr("transform",`translate(${-h/2},0)`),a.attr("transform",`translate(${-h/2-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),ue(t,k),t.intersect=function(v){return ie.polygon(t,f,v)},i}x(ck,"rect_left_inv_arrow");async function uk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;let i;t.cssClasses?i="node "+t.cssClasses:i="node default";const s=e.insert("g").attr("class",i).attr("id",t.domId||t.id),a=s.insert("g"),o=s.insert("g").attr("class","label").attr("style",n),l=t.description,c=t.label,u=o.node().appendChild(await _n(c,t.labelStyle,!0,!0));let h={width:0,height:0};if(dt(Pe()?.flowchart?.htmlLabels)){const $=u.children[0],M=$e(u);h=$.getBoundingClientRect(),M.attr("width",h.width),M.attr("height",h.height)}X.info("Text 2",l);const f=l||[],d=u.getBBox(),g=o.node().appendChild(await _n(f.join?f.join("<br/>"):f,t.labelStyle,!0,!0)),m=g.children[0],b=$e(g);h=m.getBoundingClientRect(),b.attr("width",h.width),b.attr("height",h.height);const y=(t.padding||0)/2;$e(g).attr("transform","translate( "+(h.width>d.width?0:(d.width-h.width)/2)+", "+(d.height+y+5)+")"),$e(u).attr("transform","translate( "+(h.width<d.width?0:-(d.width-h.width)/2)+", 0)"),h=o.node().getBBox(),o.attr("transform","translate("+-h.width/2+", "+(-h.height/2-y+3)+")");const k=h.width+(t.padding||0),v=h.height+(t.padding||0),C=-h.width/2-y,S=-h.height/2-y;let w,T;if(t.look==="handDrawn"){const $=oe.svg(s),M=le(t,{}),E=$.path(cn(C,S,k,v,t.rx||0),M),N=$.line(-h.width/2-y,-h.height/2-y+d.height+y,h.width/2+y,-h.height/2-y+d.height+y,M);T=s.insert(()=>(X.debug("Rough node insert CXC",E),N),":first-child"),w=s.insert(()=>(X.debug("Rough node insert CXC",E),E),":first-child")}else w=a.insert("rect",":first-child"),T=a.insert("line"),w.attr("class","outer title-state").attr("style",n).attr("x",-h.width/2-y).attr("y",-h.height/2-y).attr("width",h.width+(t.padding||0)).attr("height",h.height+(t.padding||0)),T.attr("class","divider").attr("x1",-h.width/2-y).attr("x2",h.width/2+y).attr("y1",-h.height/2-y+d.height+y).attr("y2",-h.height/2-y+d.height+y);return ue(t,w),t.intersect=function($){return ie.rect(t,$)},s}x(uk,"rectWithTitle");function os(e,t,r,n,i,s,a){const l=(e+r)/2,c=(t+n)/2,u=Math.atan2(n-t,r-e),h=(r-e)/2,f=(n-t)/2,d=h/i,g=f/s,m=Math.sqrt(d**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const b=Math.sqrt(1-m**2),y=l+b*s*Math.sin(u)*(a?-1:1),k=c-b*i*Math.cos(u)*(a?-1:1),v=Math.atan2((t-k)/s,(e-y)/i);let S=Math.atan2((n-k)/s,(r-y)/i)-v;a&&S<0&&(S+=2*Math.PI),!a&&S>0&&(S-=2*Math.PI);const w=[];for(let T=0;T<20;T++){const $=T/19,M=v+$*S,E=y+i*Math.cos(M),N=k+s*Math.sin(M);w.push({x:E,y:N})}return w}x(os,"generateArcPoints");async function hk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await xe(e,t,pe(t)),a=t?.padding??0,o=t?.padding??0,l=(t?.width?t?.width:s.width)+a*2,c=(t?.height?t?.height:s.height)+o*2,u=t.radius||5,h=t.taper||5,{cssStyles:f}=t,d=oe.svg(i),g=le(t,{});t.stroke&&(g.stroke=t.stroke),t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-l/2+h,y:-c/2},{x:l/2-h,y:-c/2},...os(l/2-h,-c/2,l/2,-c/2+h,u,u,!0),{x:l/2,y:-c/2+h},{x:l/2,y:c/2-h},...os(l/2,c/2-h,l/2-h,c/2,u,u,!0),{x:l/2-h,y:c/2},{x:-l/2+h,y:c/2},...os(-l/2+h,c/2,-l/2,c/2-h,u,u,!0),{x:-l/2,y:c/2-h},{x:-l/2,y:-c/2+h},...os(-l/2,-c/2+h,-l/2+h,-c/2,u,u,!0)],b=Ne(m),y=d.path(b,g),k=i.insert(()=>y,":first-child");return k.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",f),n&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",n),ue(t,k),t.intersect=function(v){return ie.polygon(t,m,v)},i}x(hk,"roundedRect");async function dk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await xe(e,t,pe(t)),o=t?.padding??0,l=Math.max(s.width+(t.padding??0)*2,t?.width??0),c=Math.max(s.height+(t.padding??0)*2,t?.height??0),u=-s.width/2-o,h=-s.height/2-o,{cssStyles:f}=t,d=oe.svg(i),g=le(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:u,y:h},{x:u+l+8,y:h},{x:u+l+8,y:h+c},{x:u-8,y:h+c},{x:u-8,y:h},{x:u,y:h},{x:u,y:h+c}],b=d.polygon(m.map(k=>[k.x,k.y]),g),y=i.insert(()=>b,":first-child");return y.attr("class","basic label-container").attr("style",Tt(f)),n&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",n),f&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",n),a.attr("transform",`translate(${-l/2+4+(t.padding??0)-(s.x-(s.left??0))},${-c/2+(t.padding??0)-(s.y-(s.top??0))})`),ue(t,y),t.intersect=function(k){return ie.rect(t,k)},i}x(dk,"shadedProcess");async function fk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await xe(e,t,pe(t)),o=Math.max(s.width+(t.padding??0)*2,t?.width??0),l=Math.max(s.height+(t.padding??0)*2,t?.height??0),c=-o/2,u=-l/2,{cssStyles:h}=t,f=oe.svg(i),d=le(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const g=[{x:c,y:u},{x:c,y:u+l},{x:c+o,y:u+l},{x:c+o,y:u-l/2}],m=Ne(g),b=f.path(m,d),y=i.insert(()=>b,":first-child");return y.attr("class","basic label-container"),h&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",h),n&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",n),y.attr("transform",`translate(0, ${l/4})`),a.attr("transform",`translate(${-o/2+(t.padding??0)-(s.x-(s.left??0))}, ${-l/4+(t.padding??0)-(s.y-(s.top??0))})`),ue(t,y),t.intersect=function(k){return ie.polygon(t,g,k)},i}x(fk,"slopedRect");async function pk(e,t){const r={rx:0,ry:0,labelPaddingX:t.labelPaddingX??(t?.padding||0)*2,labelPaddingY:(t?.padding||0)*1};return nl(e,t,r)}x(pk,"squareRect");async function gk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await xe(e,t,pe(t)),a=s.height+t.padding,o=s.width+a/4+t.padding,l=a/2,{cssStyles:c}=t,u=oe.svg(i),h=le(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");const f=[{x:-o/2+l,y:-a/2},{x:o/2-l,y:-a/2},...Bs(-o/2+l,0,l,50,90,270),{x:o/2-l,y:a/2},...Bs(o/2-l,0,l,50,270,450)],d=Ne(f),g=u.path(d,h),m=i.insert(()=>g,":first-child");return m.attr("class","basic label-container outer-path"),c&&t.look!=="handDrawn"&&m.selectChildren("path").attr("style",c),n&&t.look!=="handDrawn"&&m.selectChildren("path").attr("style",n),ue(t,m),t.intersect=function(b){return ie.polygon(t,f,b)},i}x(gk,"stadium");async function mk(e,t){return nl(e,t,{rx:5,ry:5})}x(mk,"state");function xk(e,t,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=ce(t);t.labelStyle=n;const{cssStyles:s}=t,{lineColor:a,stateBorder:o,nodeBorder:l}=r,c=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),u=oe.svg(c),h=le(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");const f=u.circle(0,0,14,{...h,stroke:a,strokeWidth:2}),d=o??l,g=u.circle(0,0,5,{...h,fill:d,stroke:d,strokeWidth:2,fillStyle:"solid"}),m=c.insert(()=>f,":first-child");return m.insert(()=>g),s&&m.selectAll("path").attr("style",s),i&&m.selectAll("path").attr("style",i),ue(t,m),t.intersect=function(b){return ie.circle(t,7,b)},c}x(xk,"stateEnd");function yk(e,t,{config:{themeVariables:r}}){const{lineColor:n}=r,i=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let s;if(t.look==="handDrawn"){const o=oe.svg(i).circle(0,0,14,W$(n));s=i.insert(()=>o),s.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else s=i.insert("circle",":first-child"),s.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return ue(t,s),t.intersect=function(a){return ie.circle(t,7,a)},i}x(yk,"stateStart");async function bk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await xe(e,t,pe(t)),a=(t?.padding||0)/2,o=s.width+t.padding,l=s.height+t.padding,c=-s.width/2-a,u=-s.height/2-a,h=[{x:0,y:0},{x:o,y:0},{x:o,y:-l},{x:0,y:-l},{x:0,y:0},{x:-8,y:0},{x:o+8,y:0},{x:o+8,y:-l},{x:-8,y:-l},{x:-8,y:0}];if(t.look==="handDrawn"){const f=oe.svg(i),d=le(t,{}),g=f.rectangle(c-8,u,o+16,l,d),m=f.line(c,u,c,u+l,d),b=f.line(c+o,u,c+o,u+l,d);i.insert(()=>m,":first-child"),i.insert(()=>b,":first-child");const y=i.insert(()=>g,":first-child"),{cssStyles:k}=t;y.attr("class","basic label-container").attr("style",Tt(k)),ue(t,y)}else{const f=un(i,o,l,h);n&&f.attr("style",n),ue(t,f)}return t.intersect=function(f){return ie.polygon(t,h,f)},i}x(bk,"subroutine");async function kk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await xe(e,t,pe(t)),a=Math.max(s.width+(t.padding??0)*2,t?.width??0),o=Math.max(s.height+(t.padding??0)*2,t?.height??0),l=-a/2,c=-o/2,u=.2*o,h=.2*o,{cssStyles:f}=t,d=oe.svg(i),g=le(t,{}),m=[{x:l-u/2,y:c},{x:l+a+u/2,y:c},{x:l+a+u/2,y:c+o},{x:l-u/2,y:c+o}],b=[{x:l+a-u/2,y:c+o},{x:l+a+u/2,y:c+o},{x:l+a+u/2,y:c+o-h}];t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const y=Ne(m),k=d.path(y,g),v=Ne(b),C=d.path(v,{...g,fillStyle:"solid"}),S=i.insert(()=>C,":first-child");return S.insert(()=>k,":first-child"),S.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",f),n&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",n),ue(t,S),t.intersect=function(w){return ie.polygon(t,m,w)},i}x(kk,"taggedRect");async function wk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await xe(e,t,pe(t)),o=Math.max(s.width+(t.padding??0)*2,t?.width??0),l=Math.max(s.height+(t.padding??0)*2,t?.height??0),c=l/4,u=.2*o,h=.2*l,f=l+c,{cssStyles:d}=t,g=oe.svg(i),m=le(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const b=[{x:-o/2-o/2*.1,y:f/2},...sn(-o/2-o/2*.1,f/2,o/2+o/2*.1,f/2,c,.8),{x:o/2+o/2*.1,y:-f/2},{x:-o/2-o/2*.1,y:-f/2}],y=-o/2+o/2*.1,k=-f/2-h*.4,v=[{x:y+o-u,y:(k+l)*1.4},{x:y+o,y:k+l-h},{x:y+o,y:(k+l)*.9},...sn(y+o,(k+l)*1.3,y+o-u,(k+l)*1.5,-l*.03,.5)],C=Ne(b),S=g.path(C,m),w=Ne(v),T=g.path(w,{...m,fillStyle:"solid"}),$=i.insert(()=>T,":first-child");return $.insert(()=>S,":first-child"),$.attr("class","basic label-container"),d&&t.look!=="handDrawn"&&$.selectAll("path").attr("style",d),n&&t.look!=="handDrawn"&&$.selectAll("path").attr("style",n),$.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-o/2+(t.padding??0)-(s.x-(s.left??0))},${-l/2+(t.padding??0)-c/2-(s.y-(s.top??0))})`),ue(t,$),t.intersect=function(M){return ie.polygon(t,b,M)},i}x(wk,"taggedWaveEdgedRectangle");async function vk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await xe(e,t,pe(t)),a=Math.max(s.width+t.padding,t?.width||0),o=Math.max(s.height+t.padding,t?.height||0),l=-a/2,c=-o/2,u=i.insert("rect",":first-child");return u.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",a).attr("height",o),ue(t,u),t.intersect=function(h){return ie.rect(t,h)},i}x(vk,"text");var M5=x((e,t,r,n,i,s)=>`M${e},${t}
292
+ a${i},${s} 0,0,1 0,${-n}
293
+ l${r},0
294
+ a${i},${s} 0,0,1 0,${n}
295
+ M${r},${-n}
296
+ a${i},${s} 0,0,0 0,${n}
297
+ l${-r},0`,"createCylinderPathD"),N5=x((e,t,r,n,i,s)=>[`M${e},${t}`,`M${e+r},${t}`,`a${i},${s} 0,0,0 0,${-n}`,`l${-r},0`,`a${i},${s} 0,0,0 0,${n}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),L5=x((e,t,r,n,i,s)=>[`M${e+r/2},${-n/2}`,`a${i},${s} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD");async function Ck(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a,halfPadding:o}=await xe(e,t,pe(t)),l=t.look==="neo"?o*2:o,c=s.height+l,u=c/2,h=u/(2.5+c/50),f=s.width+h+l,{cssStyles:d}=t;let g;if(t.look==="handDrawn"){const m=oe.svg(i),b=N5(0,0,f,c,h,u),y=L5(0,0,f,c,h,u),k=m.path(b,le(t,{})),v=m.path(y,le(t,{fill:"none"}));g=i.insert(()=>v,":first-child"),g=i.insert(()=>k,":first-child"),g.attr("class","basic label-container"),d&&g.attr("style",d)}else{const m=M5(0,0,f,c,h,u);g=i.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Tt(d)).attr("style",n),g.attr("class","basic label-container"),d&&g.selectAll("path").attr("style",d),n&&g.selectAll("path").attr("style",n)}return g.attr("label-offset-x",h),g.attr("transform",`translate(${-f/2}, ${c/2} )`),a.attr("transform",`translate(${-(s.width/2)-h-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),ue(t,g),t.intersect=function(m){const b=ie.rect(t,m),y=b.y-(t.y??0);if(u!=0&&(Math.abs(y)<(t.height??0)/2||Math.abs(y)==(t.height??0)/2&&Math.abs(b.x-(t.x??0))>(t.width??0)/2-h)){let k=h*h*(1-y*y/(u*u));k!=0&&(k=Math.sqrt(Math.abs(k))),k=h-k,m.x-(t.x??0)>0&&(k=-k),b.x+=k}return b},i}x(Ck,"tiltedCylinder");async function Sk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await xe(e,t,pe(t)),a=s.width+t.padding,o=s.height+t.padding,l=[{x:-3*o/6,y:0},{x:a+3*o/6,y:0},{x:a,y:-o},{x:0,y:-o}];let c;const{cssStyles:u}=t;if(t.look==="handDrawn"){const h=oe.svg(i),f=le(t,{}),d=Ne(l),g=h.path(d,f);c=i.insert(()=>g,":first-child").attr("transform",`translate(${-a/2}, ${o/2})`),u&&c.attr("style",u)}else c=un(i,a,o,l);return n&&c.attr("style",n),t.width=a,t.height=o,ue(t,c),t.intersect=function(h){return ie.polygon(t,l,h)},i}x(Sk,"trapezoid");async function _k(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await xe(e,t,pe(t)),a=60,o=20,l=Math.max(a,s.width+(t.padding??0)*2,t?.width??0),c=Math.max(o,s.height+(t.padding??0)*2,t?.height??0),{cssStyles:u}=t,h=oe.svg(i),f=le(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const d=[{x:-l/2*.8,y:-c/2},{x:l/2*.8,y:-c/2},{x:l/2,y:-c/2*.6},{x:l/2,y:c/2},{x:-l/2,y:c/2},{x:-l/2,y:-c/2*.6}],g=Ne(d),m=h.path(g,f),b=i.insert(()=>m,":first-child");return b.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",u),n&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),ue(t,b),t.intersect=function(y){return ie.polygon(t,d,y)},i}x(_k,"trapezoidalPentagon");async function Tk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await xe(e,t,pe(t)),o=dt(Pe().flowchart?.htmlLabels),l=s.width+(t.padding??0),c=l+s.height,u=l+s.height,h=[{x:0,y:0},{x:u,y:0},{x:u/2,y:-c}],{cssStyles:f}=t,d=oe.svg(i),g=le(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=Ne(h),b=d.path(m,g),y=i.insert(()=>b,":first-child").attr("transform",`translate(${-c/2}, ${c/2})`);return f&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",f),n&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",n),t.width=l,t.height=c,ue(t,y),a.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${c/2-(s.height+(t.padding??0)/(o?2:1)-(s.y-(s.top??0)))})`),t.intersect=function(k){return X.info("Triangle intersect",t,h,k),ie.polygon(t,h,k)},i}x(Tk,"triangle");async function Ek(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await xe(e,t,pe(t)),o=Math.max(s.width+(t.padding??0)*2,t?.width??0),l=Math.max(s.height+(t.padding??0)*2,t?.height??0),c=l/8,u=l+c,{cssStyles:h}=t,d=70-o,g=d>0?d/2:0,m=oe.svg(i),b=le(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const y=[{x:-o/2-g,y:u/2},...sn(-o/2-g,u/2,o/2+g,u/2,c,.8),{x:o/2+g,y:-u/2},{x:-o/2-g,y:-u/2}],k=Ne(y),v=m.path(k,b),C=i.insert(()=>v,":first-child");return C.attr("class","basic label-container"),h&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",h),n&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-o/2+(t.padding??0)-(s.x-(s.left??0))},${-l/2+(t.padding??0)-c-(s.y-(s.top??0))})`),ue(t,C),t.intersect=function(S){return ie.polygon(t,y,S)},i}x(Ek,"waveEdgedRectangle");async function Ak(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await xe(e,t,pe(t)),a=100,o=50,l=Math.max(s.width+(t.padding??0)*2,t?.width??0),c=Math.max(s.height+(t.padding??0)*2,t?.height??0),u=l/c;let h=l,f=c;h>f*u?f=h/u:h=f*u,h=Math.max(h,a),f=Math.max(f,o);const d=Math.min(f*.2,f/4),g=f+d*2,{cssStyles:m}=t,b=oe.svg(i),y=le(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const k=[{x:-h/2,y:g/2},...sn(-h/2,g/2,h/2,g/2,d,1),{x:h/2,y:-g/2},...sn(h/2,-g/2,-h/2,-g/2,d,-1)],v=Ne(k),C=b.path(v,y),S=i.insert(()=>C,":first-child");return S.attr("class","basic label-container"),m&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",m),n&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",n),ue(t,S),t.intersect=function(w){return ie.polygon(t,k,w)},i}x(Ak,"waveRectangle");async function Mk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await xe(e,t,pe(t)),o=Math.max(s.width+(t.padding??0)*2,t?.width??0),l=Math.max(s.height+(t.padding??0)*2,t?.height??0),c=5,u=-o/2,h=-l/2,{cssStyles:f}=t,d=oe.svg(i),g=le(t,{}),m=[{x:u-c,y:h-c},{x:u-c,y:h+l},{x:u+o,y:h+l},{x:u+o,y:h-c}],b=`M${u-c},${h-c} L${u+o},${h-c} L${u+o},${h+l} L${u-c},${h+l} L${u-c},${h-c}
298
+ M${u-c},${h} L${u+o},${h}
299
+ M${u},${h-c} L${u},${h+l}`;t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const y=d.path(b,g),k=i.insert(()=>y,":first-child");return k.attr("transform",`translate(${c/2}, ${c/2})`),k.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",f),n&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",n),a.attr("transform",`translate(${-(s.width/2)+c/2-(s.x-(s.left??0))}, ${-(s.height/2)+c/2-(s.y-(s.top??0))})`),ue(t,k),t.intersect=function(v){return ie.polygon(t,m,v)},i}x(Mk,"windowPane");async function qh(e,t){const r=t;if(r.alias&&(t.label=r.alias),t.look==="handDrawn"){const{themeVariables:te}=St(),{background:A}=te,P={...t,id:t.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${A}`]};await qh(e,P)}const n=St();t.useHtmlLabels=n.htmlLabels;let i=n.er?.diagramPadding??10,s=n.er?.entityPadding??6;const{cssStyles:a}=t,{labelStyles:o,nodeStyles:l}=ce(t);if(r.attributes.length===0&&t.label){const te={rx:0,ry:0,labelPaddingX:i,labelPaddingY:i*1.5};Or(t.label,n)+te.labelPaddingX*2<n.er.minEntityWidth&&(t.width=n.er.minEntityWidth);const A=await nl(e,t,te);if(!dt(n.htmlLabels)){const P=A.select("text"),Y=P.node()?.getBBox();P.attr("transform",`translate(${-Y.width/2}, 0)`)}return A}n.htmlLabels||(i*=1.25,s*=1.25);let c=pe(t);c||(c="node default");const u=e.insert("g").attr("class",c).attr("id",t.domId||t.id),h=await Qn(u,t.label??"",n,0,0,["name"],o);h.height+=s;let f=0;const d=[],g=[];let m=0,b=0,y=0,k=0,v=!0,C=!0;for(const te of r.attributes){const A=await Qn(u,te.type,n,0,f,["attribute-type"],o);m=Math.max(m,A.width+i);const P=await Qn(u,te.name,n,0,f,["attribute-name"],o);b=Math.max(b,P.width+i);const Y=await Qn(u,te.keys.join(),n,0,f,["attribute-keys"],o);y=Math.max(y,Y.width+i);const U=await Qn(u,te.comment,n,0,f,["attribute-comment"],o);k=Math.max(k,U.width+i);const q=Math.max(A.height,P.height,Y.height,U.height)+s;g.push({yOffset:f,rowHeight:q}),f+=q}let S=4;y<=i&&(v=!1,y=0,S--),k<=i&&(C=!1,k=0,S--);const w=u.node().getBBox();if(h.width+i*2-(m+b+y+k)>0){const te=h.width+i*2-(m+b+y+k);m+=te/S,b+=te/S,y>0&&(y+=te/S),k>0&&(k+=te/S)}const T=m+b+y+k,$=oe.svg(u),M=le(t,{});t.look!=="handDrawn"&&(M.roughness=0,M.fillStyle="solid");let E=0;g.length>0&&(E=g.reduce((te,A)=>te+(A?.rowHeight??0),0));const N=Math.max(w.width+i*2,t?.width||0,T),D=Math.max((E??0)+h.height,t?.height||0),R=-N/2,I=-D/2;u.selectAll("g:not(:first-child)").each((te,A,P)=>{const Y=$e(P[A]),U=Y.attr("transform");let q=0,V=0;if(U){const re=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(U);re&&(q=parseFloat(re[1]),V=parseFloat(re[2]),Y.attr("class").includes("attribute-name")?q+=m:Y.attr("class").includes("attribute-keys")?q+=m+b:Y.attr("class").includes("attribute-comment")&&(q+=m+b+y))}Y.attr("transform",`translate(${R+i/2+q}, ${V+I+h.height+s/2})`)}),u.select(".name").attr("transform","translate("+-h.width/2+", "+(I+s/2)+")");const F=$.rectangle(R,I,N,D,M),L=u.insert(()=>F,":first-child").attr("style",a.join("")),{themeVariables:B}=St(),{rowEven:H,rowOdd:Q,nodeBorder:_}=B;d.push(0);for(const[te,A]of g.entries()){const Y=(te+1)%2===0&&A.yOffset!==0,U=$.rectangle(R,h.height+I+A?.yOffset,N,A?.rowHeight,{...M,fill:Y?H:Q,stroke:_});u.insert(()=>U,"g.label").attr("style",a.join("")).attr("class",`row-rect-${Y?"even":"odd"}`)}let j=$.line(R,h.height+I,N+R,h.height+I,M);u.insert(()=>j).attr("class","divider"),j=$.line(m+R,h.height+I,m+R,D+I,M),u.insert(()=>j).attr("class","divider"),v&&(j=$.line(m+b+R,h.height+I,m+b+R,D+I,M),u.insert(()=>j).attr("class","divider")),C&&(j=$.line(m+b+y+R,h.height+I,m+b+y+R,D+I,M),u.insert(()=>j).attr("class","divider"));for(const te of d)j=$.line(R,h.height+I+te,N+R,h.height+I+te,M),u.insert(()=>j).attr("class","divider");if(ue(t,L),l&&t.look!=="handDrawn"){const A=l.split(";")?.filter(P=>P.includes("stroke"))?.map(P=>`${P}`).join("; ");u.selectAll("path").attr("style",A??""),u.selectAll(".row-rect-even path").attr("style",l)}return t.intersect=function(te){return ie.rect(t,te)},u}x(qh,"erBox");async function Qn(e,t,r,n=0,i=0,s=[],a=""){const o=e.insert("g").attr("class",`label ${s.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",a);t!==ff(t)&&(t=ff(t),t=t.replaceAll("<","&lt;").replaceAll(">","&gt;"));const l=o.node().appendChild(await ln(o,t,{width:Or(t,r)+100,style:a,useHtmlLabels:r.htmlLabels},r));if(t.includes("&lt;")||t.includes("&gt;")){let u=l.children[0];for(u.textContent=u.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">");u.childNodes[0];)u=u.childNodes[0],u.textContent=u.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">")}let c=l.getBBox();if(dt(r.htmlLabels)){const u=l.children[0];u.style.textAlign="start";const h=$e(l);c=u.getBoundingClientRect(),h.attr("width",c.width),h.attr("height",c.height)}return c}x(Qn,"addText");async function Nk(e,t,r,n,i=r.class.padding??12){const s=n?0:3,a=e.insert("g").attr("class",pe(t)).attr("id",t.domId||t.id);let o=null,l=null,c=null,u=null,h=0,f=0,d=0;if(o=a.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const k=t.annotations[0];await ls(o,{text:`«${k}»`},0),h=o.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await ls(l,t,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,c=a.insert("g").attr("class","members-group text");let m=0;for(const k of t.members){const v=await ls(c,k,m,[k.parseClassifier()]);m+=v+s}d=c.node().getBBox().height,d<=0&&(d=i/2),u=a.insert("g").attr("class","methods-group text");let b=0;for(const k of t.methods){const v=await ls(u,k,b,[k.parseClassifier()]);b+=v+s}let y=a.node().getBBox();if(o!==null){const k=o.node().getBBox();o.attr("transform",`translate(${-k.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${h})`),y=a.node().getBBox(),c.attr("transform",`translate(0, ${h+f+i*2})`),y=a.node().getBBox(),u.attr("transform",`translate(0, ${h+f+(d?d+i*4:i*2)})`),y=a.node().getBBox(),{shapeSvg:a,bbox:y}}x(Nk,"textHelper");async function ls(e,t,r,n=[]){const i=e.insert("g").attr("class","label").attr("style",n.join("; ")),s=St();let a="useHtmlLabels"in t?t.useHtmlLabels:dt(s.htmlLabels)??!0,o="";"text"in t?o=t.text:o=t.label,!a&&o.startsWith("\\")&&(o=o.substring(1)),pi(o)&&(a=!0);const l=await ln(i,eh(zn(o)),{width:Or(o,s)+50,classes:"markdown-node-label",useHtmlLabels:a},s);let c,u=1;if(a){const h=l.children[0],f=$e(l);u=h.innerHTML.split("<br>").length,h.innerHTML.includes("</math>")&&(u+=h.innerHTML.split("<mrow>").length-1);const d=h.getElementsByTagName("img");if(d){const g=o.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...d].map(m=>new Promise(b=>{function y(){if(m.style.display="flex",m.style.flexDirection="column",g){const k=s.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,C=parseInt(k,10)*5+"px";m.style.minWidth=C,m.style.maxWidth=C}else m.style.width="100%";b(m)}x(y,"setupImage"),setTimeout(()=>{m.complete&&y()}),m.addEventListener("error",y),m.addEventListener("load",y)})))}c=h.getBoundingClientRect(),f.attr("width",c.width),f.attr("height",c.height)}else{n.includes("font-weight: bolder")&&$e(l).selectAll("tspan").attr("font-weight",""),u=l.children.length;const h=l.children[0];(l.textContent===""||l.textContent.includes("&gt"))&&(h.textContent=o[0]+o.substring(1).replaceAll("&gt;",">").replaceAll("&lt;","<").trim(),o[1]===" "&&(h.textContent=h.textContent[0]+" "+h.textContent.substring(1))),h.textContent==="undefined"&&(h.textContent=""),c=l.getBBox()}return i.attr("transform","translate(0,"+(-c.height/(2*u)+r)+")"),c.height}x(ls,"addText");async function Lk(e,t){const r=Pe(),n=r.class.padding??12,i=n,s=t.useHtmlLabels??dt(r.htmlLabels)??!0,a=t;a.annotations=a.annotations??[],a.members=a.members??[],a.methods=a.methods??[];const{shapeSvg:o,bbox:l}=await Nk(e,t,r,s,i),{labelStyles:c,nodeStyles:u}=ce(t);t.labelStyle=c,t.cssStyles=a.styles||"";const h=a.styles?.join(";")||u||"";t.cssStyles||(t.cssStyles=h.replaceAll("!important","").split(";"));const f=a.members.length===0&&a.methods.length===0&&!r.class?.hideEmptyMembersBox,d=oe.svg(o),g=le(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=l.width;let b=l.height;a.members.length===0&&a.methods.length===0?b+=i:a.members.length>0&&a.methods.length===0&&(b+=i*2);const y=-m/2,k=-b/2,v=d.rectangle(y-n,k-n-(f?n:a.members.length===0&&a.methods.length===0?-n/2:0),m+2*n,b+2*n+(f?n*2:a.members.length===0&&a.methods.length===0?-n:0),g),C=o.insert(()=>v,":first-child");C.attr("class","basic label-container");const S=C.node().getBBox();o.selectAll(".text").each((M,E,N)=>{const D=$e(N[E]),R=D.attr("transform");let I=0;if(R){const H=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(R);H&&(I=parseFloat(H[2]))}let F=I+k+n-(f?n:a.members.length===0&&a.methods.length===0?-n/2:0);s||(F-=4);let L=y;(D.attr("class").includes("label-group")||D.attr("class").includes("annotation-group"))&&(L=-D.node()?.getBBox().width/2||0,o.selectAll("text").each(function(B,H,Q){window.getComputedStyle(Q[H]).textAnchor==="middle"&&(L=0)})),D.attr("transform",`translate(${L}, ${F})`)});const w=o.select(".annotation-group").node().getBBox().height-(f?n/2:0)||0,T=o.select(".label-group").node().getBBox().height-(f?n/2:0)||0,$=o.select(".members-group").node().getBBox().height-(f?n/2:0)||0;if(a.members.length>0||a.methods.length>0||f){const M=d.line(S.x,w+T+k+n,S.x+S.width,w+T+k+n,g);o.insert(()=>M).attr("class","divider").attr("style",h)}if(f||a.members.length>0||a.methods.length>0){const M=d.line(S.x,w+T+$+k+i*2+n,S.x+S.width,w+T+$+k+n+i*2,g);o.insert(()=>M).attr("class","divider").attr("style",h)}if(a.look!=="handDrawn"&&o.selectAll("path").attr("style",h),C.select(":nth-child(2)").attr("style",h),o.selectAll(".divider").select("path").attr("style",h),t.labelStyle?o.selectAll("span").attr("style",t.labelStyle):o.selectAll("span").attr("style",h),!s){const M=RegExp(/color\s*:\s*([^;]*)/),E=M.exec(h);if(E){const N=E[0].replace("color","fill");o.selectAll("tspan").attr("style",N)}else if(c){const N=M.exec(c);if(N){const D=N[0].replace("color","fill");o.selectAll("tspan").attr("style",D)}}}return ue(t,C),t.intersect=function(M){return ie.rect(t,M)},o}x(Lk,"classBox");async function Ik(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const i=t,s=t,a=20,o=20,l="verifyMethod"in t,c=pe(t),u=e.insert("g").attr("class",c).attr("id",t.domId??t.id);let h;l?h=await yr(u,`&lt;&lt;${i.type}&gt;&gt;`,0,t.labelStyle):h=await yr(u,"&lt;&lt;Element&gt;&gt;",0,t.labelStyle);let f=h;const d=await yr(u,i.name,f,t.labelStyle+"; font-weight: bold;");if(f+=d+o,l){const w=await yr(u,`${i.requirementId?`ID: ${i.requirementId}`:""}`,f,t.labelStyle);f+=w;const T=await yr(u,`${i.text?`Text: ${i.text}`:""}`,f,t.labelStyle);f+=T;const $=await yr(u,`${i.risk?`Risk: ${i.risk}`:""}`,f,t.labelStyle);f+=$,await yr(u,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,f,t.labelStyle)}else{const w=await yr(u,`${s.type?`Type: ${s.type}`:""}`,f,t.labelStyle);f+=w,await yr(u,`${s.docRef?`Doc Ref: ${s.docRef}`:""}`,f,t.labelStyle)}const g=(u.node()?.getBBox().width??200)+a,m=(u.node()?.getBBox().height??200)+a,b=-g/2,y=-m/2,k=oe.svg(u),v=le(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const C=k.rectangle(b,y,g,m,v),S=u.insert(()=>C,":first-child");if(S.attr("class","basic label-container").attr("style",n),u.selectAll(".label").each((w,T,$)=>{const M=$e($[T]),E=M.attr("transform");let N=0,D=0;if(E){const L=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(E);L&&(N=parseFloat(L[1]),D=parseFloat(L[2]))}const R=D-m/2;let I=b+a/2;(T===0||T===1)&&(I=N),M.attr("transform",`translate(${I}, ${R+a})`)}),f>h+d+o){const w=k.line(b,y+h+d+o,b+g,y+h+d+o,v);u.insert(()=>w).attr("style",n)}return ue(t,S),t.intersect=function(w){return ie.rect(t,w)},u}x(Ik,"requirementBox");async function yr(e,t,r,n=""){if(t==="")return 0;const i=e.insert("g").attr("class","label").attr("style",n),s=Pe(),a=s.htmlLabels??!0,o=await ln(i,eh(zn(t)),{width:Or(t,s)+50,classes:"markdown-node-label",useHtmlLabels:a,style:n},s);let l;if(a){const c=o.children[0],u=$e(o);l=c.getBoundingClientRect(),u.attr("width",l.width),u.attr("height",l.height)}else{const c=o.children[0];for(const u of c.children)u.textContent=u.textContent.replaceAll("&gt;",">").replaceAll("&lt;","<"),n&&u.setAttribute("style",n);l=o.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}x(yr,"addText");var I5=x(e=>{switch(e){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function $k(e,t,{config:r}){const{labelStyles:n,nodeStyles:i}=ce(t);t.labelStyle=n||"";const s=10,a=t.width;t.width=(t.width??200)-10;const{shapeSvg:o,bbox:l,label:c}=await xe(e,t,pe(t)),u=t.padding||10;let h="",f;"ticket"in t&&t.ticket&&r?.kanban?.ticketBaseUrl&&(h=r?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),f=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",h).attr("target","_blank"));const d={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await Ql(f,"ticket"in t&&t.ticket||"",d):{label:g,bbox:m}=await Ql(o,"ticket"in t&&t.ticket||"",d);const{label:b,bbox:y}=await Ql(o,"assigned"in t&&t.assigned||"",d);t.width=a;const k=10,v=t?.width||0,C=Math.max(m.height,y.height)/2,S=Math.max(l.height+k*2,t?.height||0)+C,w=-v/2,T=-S/2;c.attr("transform","translate("+(u-v/2)+", "+(-C-l.height/2)+")"),g.attr("transform","translate("+(u-v/2)+", "+(-C+l.height/2)+")"),b.attr("transform","translate("+(u+v/2-y.width-2*s)+", "+(-C+l.height/2)+")");let $;const{rx:M,ry:E}=t,{cssStyles:N}=t;if(t.look==="handDrawn"){const D=oe.svg(o),R=le(t,{}),I=M||E?D.path(cn(w,T,v,S,M||0),R):D.rectangle(w,T,v,S,R);$=o.insert(()=>I,":first-child"),$.attr("class","basic label-container").attr("style",N||null)}else{$=o.insert("rect",":first-child"),$.attr("class","basic label-container __APA__").attr("style",i).attr("rx",M??5).attr("ry",E??5).attr("x",w).attr("y",T).attr("width",v).attr("height",S);const D="priority"in t&&t.priority;if(D){const R=o.append("line"),I=w+2,F=T+Math.floor((M??0)/2),L=T+S-Math.floor((M??0)/2);R.attr("x1",I).attr("y1",F).attr("x2",I).attr("y2",L).attr("stroke-width","4").attr("stroke",I5(D))}}return ue(t,$),t.height=S,t.intersect=function(D){return ie.rect(t,D)},o}x($k,"kanbanItem");async function jk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:a,label:o}=await xe(e,t,pe(t)),l=s.width+10*a,c=s.height+8*a,u=.15*l,{cssStyles:h}=t,f=s.width+20,d=s.height+20,g=Math.max(l,f),m=Math.max(c,d);o.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`);let b;const y=`M0 0
300
+ a${u},${u} 1 0,0 ${g*.25},${-1*m*.1}
301
+ a${u},${u} 1 0,0 ${g*.25},0
302
+ a${u},${u} 1 0,0 ${g*.25},0
303
+ a${u},${u} 1 0,0 ${g*.25},${m*.1}
304
+
305
+ a${u},${u} 1 0,0 ${g*.15},${m*.33}
306
+ a${u*.8},${u*.8} 1 0,0 0,${m*.34}
307
+ a${u},${u} 1 0,0 ${-1*g*.15},${m*.33}
308
+
309
+ a${u},${u} 1 0,0 ${-1*g*.25},${m*.15}
310
+ a${u},${u} 1 0,0 ${-1*g*.25},0
311
+ a${u},${u} 1 0,0 ${-1*g*.25},0
312
+ a${u},${u} 1 0,0 ${-1*g*.25},${-1*m*.15}
313
+
314
+ a${u},${u} 1 0,0 ${-1*g*.1},${-1*m*.33}
315
+ a${u*.8},${u*.8} 1 0,0 0,${-1*m*.34}
316
+ a${u},${u} 1 0,0 ${g*.1},${-1*m*.33}
317
+ H0 V0 Z`;if(t.look==="handDrawn"){const k=oe.svg(i),v=le(t,{}),C=k.path(y,v);b=i.insert(()=>C,":first-child"),b.attr("class","basic label-container").attr("style",Tt(h))}else b=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",y);return b.attr("transform",`translate(${-g/2}, ${-m/2})`),ue(t,b),t.calcIntersect=function(k,v){return ie.rect(k,v)},t.intersect=function(k){return X.info("Bang intersect",t,k),ie.rect(t,k)},i}x(jk,"bang");async function Bk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:a,label:o}=await xe(e,t,pe(t)),l=s.width+2*a,c=s.height+2*a,u=.15*l,h=.25*l,f=.35*l,d=.2*l,{cssStyles:g}=t;let m;const b=`M0 0
318
+ a${u},${u} 0 0,1 ${l*.25},${-1*l*.1}
319
+ a${f},${f} 1 0,1 ${l*.4},${-1*l*.1}
320
+ a${h},${h} 1 0,1 ${l*.35},${l*.2}
321
+
322
+ a${u},${u} 1 0,1 ${l*.15},${c*.35}
323
+ a${d},${d} 1 0,1 ${-1*l*.15},${c*.65}
324
+
325
+ a${h},${u} 1 0,1 ${-1*l*.25},${l*.15}
326
+ a${f},${f} 1 0,1 ${-1*l*.5},0
327
+ a${u},${u} 1 0,1 ${-1*l*.25},${-1*l*.15}
328
+
329
+ a${u},${u} 1 0,1 ${-1*l*.1},${-1*c*.35}
330
+ a${d},${d} 1 0,1 ${l*.1},${-1*c*.65}
331
+ H0 V0 Z`;if(t.look==="handDrawn"){const y=oe.svg(i),k=le(t,{}),v=y.path(b,k);m=i.insert(()=>v,":first-child"),m.attr("class","basic label-container").attr("style",Tt(g))}else m=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",b);return o.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),m.attr("transform",`translate(${-l/2}, ${-c/2})`),ue(t,m),t.calcIntersect=function(y,k){return ie.rect(y,k)},t.intersect=function(y){return X.info("Cloud intersect",t,y),ie.rect(t,y)},i}x(Bk,"cloud");async function Dk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:a,label:o}=await xe(e,t,pe(t)),l=s.width+8*a,c=s.height+2*a,u=5,h=`
332
+ M${-l/2} ${c/2-u}
333
+ v${-c+2*u}
334
+ q0,-${u} ${u},-${u}
335
+ h${l-2*u}
336
+ q${u},0 ${u},${u}
337
+ v${c-2*u}
338
+ q0,${u} -${u},${u}
339
+ h${-l+2*u}
340
+ q-${u},0 -${u},-${u}
341
+ Z
342
+ `,f=i.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+t.type).attr("style",n).attr("d",h);return i.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",c/2).attr("x2",l/2).attr("y2",c/2),o.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),i.append(()=>o.node()),ue(t,f),t.calcIntersect=function(d,g){return ie.rect(d,g)},t.intersect=function(d){return ie.rect(t,d)},i}x(Dk,"defaultMindmapNode");async function Pk(e,t){const r={padding:t.padding??0};return Wh(e,t,r)}x(Pk,"mindmapCircle");var $5=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:pk},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:hk},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:gk},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:bk},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Fb},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Wh},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:jk},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Bk},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:lk},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Ub},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:tk},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:ek},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:Sk},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:Zb},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Ob},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:vk},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Nb},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:dk},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:yk},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:xk},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Wb},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Vb},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:jb},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Bb},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Db},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:rk},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:Ek},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:qb},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:Ck},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:nk},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Pb},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Rb},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:Tk},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Mk},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:zb},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:_k},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Hb},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:fk},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:ak},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:sk},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Mb},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:$b},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:wk},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:kk},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:Ak},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:ck},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:ik}],j5=x(()=>{const t=[...Object.entries({state:mk,choice:Lb,note:ok,rectWithTitle:uk,labelRect:Jb,iconSquare:Qb,iconCircle:Yb,icon:Gb,iconRounded:Xb,imageSquare:Kb,anchor:Ab,kanbanItem:$k,mindmapCircle:Pk,defaultMindmapNode:Dk,classBox:Lk,erBox:qh,requirementBox:Ik}),...$5.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),Fk=j5();function B5(e){return e in Fk}x(B5,"isValidShape");var il=new Map;async function Rk(e,t,r){let n,i;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const s=t.shape?Fk[t.shape]:void 0;if(!s)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let a;r.config.securityLevel==="sandbox"?a="_top":t.linkTarget&&(a=t.linkTarget||"_blank"),n=e.insert("svg:a").attr("xlink:href",t.link).attr("target",a??null),i=await s(n,t,r)}else i=await s(e,t,r),n=i;return t.tooltip&&i.attr("title",t.tooltip),il.set(t.id,n),t.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}x(Rk,"insertNode");var S6=x((e,t)=>{il.set(t.id,e)},"setNodeElem"),_6=x(()=>{il.clear()},"clear"),T6=x(e=>{const t=il.get(e.id);X.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const r=8,n=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+n-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),n},"positionNode"),D5=x((e,t,r,n,i,s)=>{t.arrowTypeStart&&wp(e,"start",t.arrowTypeStart,r,n,i,s),t.arrowTypeEnd&&wp(e,"end",t.arrowTypeEnd,r,n,i,s)},"addEdgeMarkers"),P5={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},wp=x((e,t,r,n,i,s,a)=>{const o=P5[r];if(!o){X.warn(`Unknown arrow type: ${r}`);return}const l=o.type,u=`${i}_${s}-${l}${t==="start"?"Start":"End"}`;if(a&&a.trim()!==""){const h=a.replace(/[^\dA-Za-z]/g,"_"),f=`${u}_${h}`;if(!document.getElementById(f)){const d=document.getElementById(u);if(d){const g=d.cloneNode(!0);g.id=f,g.querySelectorAll("path, circle, line").forEach(b=>{b.setAttribute("stroke",a),o.fill&&b.setAttribute("fill",a)}),d.parentNode?.appendChild(g)}}e.attr(`marker-${t}`,`url(${n}#${f})`)}else e.attr(`marker-${t}`,`url(${n}#${u})`)},"addEdgeMarker"),To=new Map,xt=new Map,E6=x(()=>{To.clear(),xt.clear()},"clear"),ya=x(e=>e?e.reduce((r,n)=>r+";"+n,""):"","getLabelStyles"),F5=x(async(e,t)=>{let r=dt(Pe().flowchart.htmlLabels);const{labelStyles:n}=ce(t);t.labelStyle=n;const i=await ln(e,t.label,{style:t.labelStyle,useHtmlLabels:r,addSvgBackground:!0,isNode:!1});X.info("abc82",t,t.labelType);const s=e.insert("g").attr("class","edgeLabel"),a=s.insert("g").attr("class","label").attr("data-id",t.id);a.node().appendChild(i);let o=i.getBBox();if(r){const c=i.children[0],u=$e(i);o=c.getBoundingClientRect(),u.attr("width",o.width),u.attr("height",o.height)}a.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),To.set(t.id,s),t.width=o.width,t.height=o.height;let l;if(t.startLabelLeft){const c=await _n(t.startLabelLeft,ya(t.labelStyle)),u=e.insert("g").attr("class","edgeTerminals"),h=u.insert("g").attr("class","inner");l=h.node().appendChild(c);const f=c.getBBox();h.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),xt.get(t.id)||xt.set(t.id,{}),xt.get(t.id).startLeft=u,cs(l,t.startLabelLeft)}if(t.startLabelRight){const c=await _n(t.startLabelRight,ya(t.labelStyle)),u=e.insert("g").attr("class","edgeTerminals"),h=u.insert("g").attr("class","inner");l=u.node().appendChild(c),h.node().appendChild(c);const f=c.getBBox();h.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),xt.get(t.id)||xt.set(t.id,{}),xt.get(t.id).startRight=u,cs(l,t.startLabelRight)}if(t.endLabelLeft){const c=await _n(t.endLabelLeft,ya(t.labelStyle)),u=e.insert("g").attr("class","edgeTerminals"),h=u.insert("g").attr("class","inner");l=h.node().appendChild(c);const f=c.getBBox();h.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),u.node().appendChild(c),xt.get(t.id)||xt.set(t.id,{}),xt.get(t.id).endLeft=u,cs(l,t.endLabelLeft)}if(t.endLabelRight){const c=await _n(t.endLabelRight,ya(t.labelStyle)),u=e.insert("g").attr("class","edgeTerminals"),h=u.insert("g").attr("class","inner");l=h.node().appendChild(c);const f=c.getBBox();h.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),u.node().appendChild(c),xt.get(t.id)||xt.set(t.id,{}),xt.get(t.id).endRight=u,cs(l,t.endLabelRight)}return i},"insertEdgeLabel");function cs(e,t){Pe().flowchart.htmlLabels&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}x(cs,"setTerminalWidth");var R5=x((e,t)=>{X.debug("Moving label abc88 ",e.id,e.label,To.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const n=Pe(),{subGraphTitleTotalMargin:i}=kh(n);if(e.label){const s=To.get(e.id);let a=e.x,o=e.y;if(r){const l=cr.calcLabelPosition(r);X.debug("Moving label "+e.label+" from (",a,",",o,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(a=l.x,o=l.y)}s.attr("transform",`translate(${a}, ${o+i/2})`)}if(e.startLabelLeft){const s=xt.get(e.id).startLeft;let a=e.x,o=e.y;if(r){const l=cr.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(e.startLabelRight){const s=xt.get(e.id).startRight;let a=e.x,o=e.y;if(r){const l=cr.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(e.endLabelLeft){const s=xt.get(e.id).endLeft;let a=e.x,o=e.y;if(r){const l=cr.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(e.endLabelRight){const s=xt.get(e.id).endRight;let a=e.x,o=e.y;if(r){const l=cr.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}},"positionEdgeLabel"),O5=x((e,t)=>{const r=e.x,n=e.y,i=Math.abs(t.x-r),s=Math.abs(t.y-n),a=e.width/2,o=e.height/2;return i>=a||s>=o},"outsideNode"),z5=x((e,t,r)=>{X.debug(`intersection calc abc89:
343
+ outsidePoint: ${JSON.stringify(t)}
344
+ insidePoint : ${JSON.stringify(r)}
345
+ node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const n=e.x,i=e.y,s=Math.abs(n-r.x),a=e.width/2;let o=r.x<t.x?a-s:a+s;const l=e.height/2,c=Math.abs(t.y-r.y),u=Math.abs(t.x-r.x);if(Math.abs(i-t.y)*a>Math.abs(n-t.x)*l){let h=r.y<t.y?t.y-l-i:i-l-t.y;o=u*h/c;const f={x:r.x<t.x?r.x+o:r.x-u+o,y:r.y<t.y?r.y+c-h:r.y-c+h};return o===0&&(f.x=t.x,f.y=t.y),u===0&&(f.x=t.x),c===0&&(f.y=t.y),X.debug(`abc89 top/bottom calc, Q ${c}, q ${h}, R ${u}, r ${o}`,f),f}else{r.x<t.x?o=t.x-a-n:o=n-a-t.x;let h=c*o/u,f=r.x<t.x?r.x+u-o:r.x-u+o,d=r.y<t.y?r.y+h:r.y-h;return X.debug(`sides calc abc89, Q ${c}, q ${h}, R ${u}, r ${o}`,{_x:f,_y:d}),o===0&&(f=t.x,d=t.y),u===0&&(f=t.x),c===0&&(d=t.y),{x:f,y:d}}},"intersection"),vp=x((e,t)=>{X.warn("abc88 cutPathAtIntersect",e,t);let r=[],n=e[0],i=!1;return e.forEach(s=>{if(X.info("abc88 checking point",s,t),!O5(t,s)&&!i){const a=z5(t,n,s);X.debug("abc88 inside",s,n,a),X.debug("abc88 intersection",a,t);let o=!1;r.forEach(l=>{o=o||l.x===a.x&&l.y===a.y}),r.some(l=>l.x===a.x&&l.y===a.y)?X.warn("abc88 no intersect",a,r):r.push(a),i=!0}else X.warn("abc88 outside",s,n),n=s,i||r.push(s)}),X.debug("returning points",r),r},"cutPathAtIntersect");function Ok(e){const t=[],r=[];for(let n=1;n<e.length-1;n++){const i=e[n-1],s=e[n],a=e[n+1];(i.x===s.x&&s.y===a.y&&Math.abs(s.x-a.x)>5&&Math.abs(s.y-i.y)>5||i.y===s.y&&s.x===a.x&&Math.abs(s.x-i.x)>5&&Math.abs(s.y-a.y)>5)&&(t.push(s),r.push(n))}return{cornerPoints:t,cornerPointPositions:r}}x(Ok,"extractCornerPoints");var Cp=x(function(e,t,r){const n=t.x-e.x,i=t.y-e.y,s=Math.sqrt(n*n+i*i),a=r/s;return{x:t.x-a*n,y:t.y-a*i}},"findAdjacentPoint"),H5=x(function(e){const{cornerPointPositions:t}=Ok(e),r=[];for(let n=0;n<e.length;n++)if(t.includes(n)){const i=e[n-1],s=e[n+1],a=e[n],o=Cp(i,a,5),l=Cp(s,a,5),c=l.x-o.x,u=l.y-o.y;r.push(o);const h=Math.sqrt(2)*2;let f={x:a.x,y:a.y};if(Math.abs(s.x-i.x)>10&&Math.abs(s.y-i.y)>=10){X.debug("Corner point fixing",Math.abs(s.x-i.x),Math.abs(s.y-i.y));const d=5;a.x===o.x?f={x:c<0?o.x-d+h:o.x+d-h,y:u<0?o.y-h:o.y+h}:f={x:c<0?o.x-h:o.x+h,y:u<0?o.y-d+h:o.y+d-h}}else X.debug("Corner point skipping fixing",Math.abs(s.x-i.x),Math.abs(s.y-i.y));r.push(f,l)}else r.push(e[n]);return r},"fixCorners"),W5=x((e,t,r)=>{const n=e-t-r,i=2,s=2,a=i+s,o=Math.floor(n/a),l=Array(o).fill(`${i} ${s}`).join(" ");return`0 ${t} ${l} ${r}`},"generateDashArray"),q5=x(function(e,t,r,n,i,s,a,o=!1){const{handDrawnSeed:l}=Pe();let c=t.points,u=!1;const h=i;var f=s;const d=[];for(const I in t.cssCompiledStyles)xy(I)||d.push(t.cssCompiledStyles[I]);X.debug("UIO intersect check",t.points,f.x,h.x),f.intersect&&h.intersect&&!o&&(c=c.slice(1,t.points.length-1),c.unshift(h.intersect(c[0])),X.debug("Last point UIO",t.start,"-->",t.end,c[c.length-1],f,f.intersect(c[c.length-1])),c.push(f.intersect(c[c.length-1])));const g=btoa(JSON.stringify(c));t.toCluster&&(X.info("to cluster abc88",r.get(t.toCluster)),c=vp(t.points,r.get(t.toCluster).node),u=!0),t.fromCluster&&(X.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(c,null,2)),c=vp(c.reverse(),r.get(t.fromCluster).node).reverse(),u=!0);let m=c.filter(I=>!Number.isNaN(I.y));m=H5(m);let b=$a;switch(b=ro,t.curve){case"linear":b=ro;break;case"basis":b=$a;break;case"cardinal":b=w0;break;case"bumpX":b=m0;break;case"bumpY":b=x0;break;case"catmullRom":b=C0;break;case"monotoneX":b=M0;break;case"monotoneY":b=N0;break;case"natural":b=I0;break;case"step":b=$0;break;case"stepAfter":b=B0;break;case"stepBefore":b=j0;break;default:b=$a}const{x:y,y:k}=H$(t),v=_I().x(y).y(k).curve(b);let C;switch(t.thickness){case"normal":C="edge-thickness-normal";break;case"thick":C="edge-thickness-thick";break;case"invisible":C="edge-thickness-invisible";break;default:C="edge-thickness-normal"}switch(t.pattern){case"solid":C+=" edge-pattern-solid";break;case"dotted":C+=" edge-pattern-dotted";break;case"dashed":C+=" edge-pattern-dashed";break;default:C+=" edge-pattern-solid"}let S,w=t.curve==="rounded"?zk(Hk(m,t),5):v(m);const T=Array.isArray(t.style)?t.style:[t.style];let $=T.find(I=>I?.startsWith("stroke:")),M=!1;if(t.look==="handDrawn"){const I=oe.svg(e);Object.assign([],m);const F=I.path(w,{roughness:.3,seed:l});C+=" transition",S=$e(F).select("path").attr("id",t.id).attr("class"," "+C+(t.classes?" "+t.classes:"")).attr("style",T?T.reduce((B,H)=>B+";"+H,""):"");let L=S.attr("d");S.attr("d",L),e.node().appendChild(S.node())}else{const I=d.join(";"),F=T?T.reduce((te,A)=>te+A+";",""):"";let L="";t.animate&&(L=" edge-animation-fast"),t.animation&&(L=" edge-animation-"+t.animation);const B=(I?I+";"+F+";":F)+";"+(T?T.reduce((te,A)=>te+";"+A,""):"");S=e.append("path").attr("d",w).attr("id",t.id).attr("class"," "+C+(t.classes?" "+t.classes:"")+(L??"")).attr("style",B),$=B.match(/stroke:([^;]+)/)?.[1],M=t.animate===!0||!!t.animation||I.includes("animation");const H=S.node(),Q=typeof H.getTotalLength=="function"?H.getTotalLength():0,_=Of[t.arrowTypeStart]||0,j=Of[t.arrowTypeEnd]||0;if(t.look==="neo"&&!M){const A=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?W5(Q,_,j):`0 ${_} ${Q-_-j} ${j}`}; stroke-dashoffset: 0;`;S.attr("style",A+S.attr("style"))}}S.attr("data-edge",!0),S.attr("data-et","edge"),S.attr("data-id",t.id),S.attr("data-points",g),t.showPoints&&m.forEach(I=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",I.x).attr("cy",I.y)});let E="";(Pe().flowchart.arrowMarkerAbsolute||Pe().state.arrowMarkerAbsolute)&&(E=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,E=E.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),X.info("arrowTypeStart",t.arrowTypeStart),X.info("arrowTypeEnd",t.arrowTypeEnd),D5(S,t,E,a,n,$);const N=Math.floor(c.length/2),D=c[N];cr.isLabelCoordinateInPath(D,S.attr("d"))||(u=!0);let R={};return u&&(R.updatedPath=c),R.originalPath=t.points,R},"insertEdge");function zk(e,t){if(e.length<2)return"";let r="";const n=e.length,i=1e-5;for(let s=0;s<n;s++){const a=e[s],o=e[s-1],l=e[s+1];if(s===0)r+=`M${a.x},${a.y}`;else if(s===n-1)r+=`L${a.x},${a.y}`;else{const c=a.x-o.x,u=a.y-o.y,h=l.x-a.x,f=l.y-a.y,d=Math.hypot(c,u),g=Math.hypot(h,f);if(d<i||g<i){r+=`L${a.x},${a.y}`;continue}const m=c/d,b=u/d,y=h/g,k=f/g,v=m*y+b*k,C=Math.max(-1,Math.min(1,v)),S=Math.acos(C);if(S<i||Math.abs(Math.PI-S)<i){r+=`L${a.x},${a.y}`;continue}const w=Math.min(t/Math.sin(S/2),d/2,g/2),T=a.x-m*w,$=a.y-b*w,M=a.x+y*w,E=a.y+k*w;r+=`L${T},${$}`,r+=`Q${a.x},${a.y} ${M},${E}`}}return r}x(zk,"generateRoundedPath");function uu(e,t){if(!e||!t)return{angle:0,deltaX:0,deltaY:0};const r=t.x-e.x,n=t.y-e.y;return{angle:Math.atan2(n,r),deltaX:r,deltaY:n}}x(uu,"calculateDeltaAndAngle");function Hk(e,t){const r=e.map(i=>({...i}));if(e.length>=2&&vt[t.arrowTypeStart]){const i=vt[t.arrowTypeStart],s=e[0],a=e[1],{angle:o}=uu(s,a),l=i*Math.cos(o),c=i*Math.sin(o);r[0].x=s.x+l,r[0].y=s.y+c}const n=e.length;if(n>=2&&vt[t.arrowTypeEnd]){const i=vt[t.arrowTypeEnd],s=e[n-1],a=e[n-2],{angle:o}=uu(a,s),l=i*Math.cos(o),c=i*Math.sin(o);r[n-1].x=s.x-l,r[n-1].y=s.y-c}return r}x(Hk,"applyMarkerOffsetsToPoints");var U5=x((e,t,r,n)=>{t.forEach(i=>{o4[i](e,r,n)})},"insertMarkers"),V5=x((e,t,r)=>{X.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),G5=x((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),Y5=x((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),X5=x((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),Q5=x((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),K5=x((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),Z5=x((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),J5=x((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),e4=x((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),t4=x((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),r4=x((e,t,r)=>{const n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),n4=x((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),i4=x((e,t,r)=>{const n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),s4=x((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
346
+ L20,10
347
+ M20,10
348
+ L0,20`)},"requirement_arrow"),a4=x((e,t,r)=>{const n=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),o4={extension:V5,composition:G5,aggregation:Y5,dependency:X5,lollipop:Q5,point:K5,circle:Z5,cross:J5,barb:e4,only_one:t4,zero_or_one:r4,one_or_more:n4,zero_or_more:i4,requirement_arrow:s4,requirement_contains:a4},l4=U5,c4={common:Ci,getConfig:St,insertCluster:x5,insertEdge:q5,insertEdgeLabel:F5,insertMarkers:l4,insertNode:Rk,interpolateToCurve:_h,labelHelper:xe,log:X,positionEdgeLabel:R5},Ds={},Wk=x(e=>{for(const t of e)Ds[t.name]=t},"registerLayoutLoaders"),u4=x(()=>{Wk([{name:"dagre",loader:x(async()=>await Re(()=>import("./dagre-6UL2VRFP-DR9x77Xf.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22])),"loader")},{name:"cose-bilkent",loader:x(async()=>await Re(()=>import("./cose-bilkent-S5V4N54A-CnpfmL-Y.js"),__vite__mapDeps([23,24,7,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22])),"loader")}])},"registerDefaultLayoutLoaders");u4();var A6=x(async(e,t)=>{if(!(e.layoutAlgorithm in Ds))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);const r=Ds[e.layoutAlgorithm];return(await r.loader()).render(e,t,c4,{algorithm:r.algorithm})},"render"),M6=x((e="",{fallback:t="dagre"}={})=>{if(e in Ds)return e;if(t in Ds)return X.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),qk="comm",Uk="rule",Vk="decl",h4="@import",d4="@namespace",f4="@keyframes",p4="@layer",Gk=Math.abs,Uh=String.fromCharCode;function Yk(e){return e.trim()}function Fa(e,t,r){return e.replace(t,r)}function g4(e,t,r){return e.indexOf(t,r)}function ti(e,t){return e.charCodeAt(t)|0}function bi(e,t,r){return e.slice(t,r)}function kr(e){return e.length}function m4(e){return e.length}function ba(e,t){return t.push(e),e}var sl=1,ki=1,Xk=0,rr=0,nt=0,Ai="";function Vh(e,t,r,n,i,s,a,o){return{value:e,root:t,parent:r,type:n,props:i,children:s,line:sl,column:ki,length:a,return:"",siblings:o}}function x4(){return nt}function y4(){return nt=rr>0?ti(Ai,--rr):0,ki--,nt===10&&(ki=1,sl--),nt}function dr(){return nt=rr<Xk?ti(Ai,rr++):0,ki++,nt===10&&(ki=1,sl++),nt}function Kr(){return ti(Ai,rr)}function Ra(){return rr}function al(e,t){return bi(Ai,e,t)}function Ps(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function b4(e){return sl=ki=1,Xk=kr(Ai=e),rr=0,[]}function k4(e){return Ai="",e}function Kl(e){return Yk(al(rr-1,hu(e===91?e+2:e===40?e+1:e)))}function w4(e){for(;(nt=Kr())&&nt<33;)dr();return Ps(e)>2||Ps(nt)>3?"":" "}function v4(e,t){for(;--t&&dr()&&!(nt<48||nt>102||nt>57&&nt<65||nt>70&&nt<97););return al(e,Ra()+(t<6&&Kr()==32&&dr()==32))}function hu(e){for(;dr();)switch(nt){case e:return rr;case 34:case 39:e!==34&&e!==39&&hu(nt);break;case 40:e===41&&hu(e);break;case 92:dr();break}return rr}function C4(e,t){for(;dr()&&e+nt!==57;)if(e+nt===84&&Kr()===47)break;return"/*"+al(t,rr-1)+"*"+Uh(e===47?e:dr())}function S4(e){for(;!Ps(Kr());)dr();return al(e,rr)}function _4(e){return k4(Oa("",null,null,null,[""],e=b4(e),0,[0],e))}function Oa(e,t,r,n,i,s,a,o,l){for(var c=0,u=0,h=a,f=0,d=0,g=0,m=1,b=1,y=1,k=0,v="",C=i,S=s,w=n,T=v;b;)switch(g=k,k=dr()){case 40:if(g!=108&&ti(T,h-1)==58){g4(T+=Fa(Kl(k),"&","&\f"),"&\f",Gk(c?o[c-1]:0))!=-1&&(y=-1);break}case 34:case 39:case 91:T+=Kl(k);break;case 9:case 10:case 13:case 32:T+=w4(g);break;case 92:T+=v4(Ra()-1,7);continue;case 47:switch(Kr()){case 42:case 47:ba(T4(C4(dr(),Ra()),t,r,l),l),(Ps(g||1)==5||Ps(Kr()||1)==5)&&kr(T)&&bi(T,-1,void 0)!==" "&&(T+=" ");break;default:T+="/"}break;case 123*m:o[c++]=kr(T)*y;case 125*m:case 59:case 0:switch(k){case 0:case 125:b=0;case 59+u:y==-1&&(T=Fa(T,/\f/g,"")),d>0&&(kr(T)-h||m===0&&g===47)&&ba(d>32?_p(T+";",n,r,h-1,l):_p(Fa(T," ","")+";",n,r,h-2,l),l);break;case 59:T+=";";default:if(ba(w=Sp(T,t,r,c,u,i,o,v,C=[],S=[],h,s),s),k===123)if(u===0)Oa(T,t,w,w,C,s,h,o,S);else{switch(f){case 99:if(ti(T,3)===110)break;case 108:if(ti(T,2)===97)break;default:u=0;case 100:case 109:case 115:}u?Oa(e,w,w,n&&ba(Sp(e,w,w,0,0,i,o,v,i,C=[],h,S),S),i,S,h,o,n?C:S):Oa(T,w,w,w,[""],S,0,o,S)}}c=u=d=0,m=y=1,v=T="",h=a;break;case 58:h=1+kr(T),d=g;default:if(m<1){if(k==123)--m;else if(k==125&&m++==0&&y4()==125)continue}switch(T+=Uh(k),k*m){case 38:y=u>0?1:(T+="\f",-1);break;case 44:o[c++]=(kr(T)-1)*y,y=1;break;case 64:Kr()===45&&(T+=Kl(dr())),f=Kr(),u=h=kr(v=T+=S4(Ra())),k++;break;case 45:g===45&&kr(T)==2&&(m=0)}}return s}function Sp(e,t,r,n,i,s,a,o,l,c,u,h){for(var f=i-1,d=i===0?s:[""],g=m4(d),m=0,b=0,y=0;m<n;++m)for(var k=0,v=bi(e,f+1,f=Gk(b=a[m])),C=e;k<g;++k)(C=Yk(b>0?d[k]+" "+v:Fa(v,/&\f/g,d[k])))&&(l[y++]=C);return Vh(e,t,r,i===0?Uk:o,l,c,u,h)}function T4(e,t,r,n){return Vh(e,t,r,qk,Uh(x4()),bi(e,2,-2),0,n)}function _p(e,t,r,n,i){return Vh(e,t,r,Vk,bi(e,0,n),bi(e,n+1,-1),n,i)}function du(e,t){for(var r="",n=0;n<e.length;n++)r+=t(e[n],n,e,t)||"";return r}function E4(e,t,r,n){switch(e.type){case p4:if(e.children.length)break;case h4:case d4:case Vk:return e.return=e.return||e.value;case qk:return"";case f4:return e.return=e.value+"{"+du(e.children,n)+"}";case Uk:if(!kr(e.value=e.props.join(",")))return""}return kr(r=du(e.children,n))?e.return=e.value+"{"+r+"}":""}var A4=wy(Object.keys,Object),M4=Object.prototype,N4=M4.hasOwnProperty;function L4(e){if(!Xo(e))return A4(e);var t=[];for(var r in Object(e))N4.call(e,r)&&r!="constructor"&&t.push(r);return t}var fu=On(Tr,"DataView"),pu=On(Tr,"Promise"),gu=On(Tr,"Set"),mu=On(Tr,"WeakMap"),Tp="[object Map]",I4="[object Object]",Ep="[object Promise]",Ap="[object Set]",Mp="[object WeakMap]",Np="[object DataView]",$4=Rn(fu),j4=Rn(js),B4=Rn(pu),D4=Rn(gu),P4=Rn(mu),kn=_i;(fu&&kn(new fu(new ArrayBuffer(1)))!=Np||js&&kn(new js)!=Tp||pu&&kn(pu.resolve())!=Ep||gu&&kn(new gu)!=Ap||mu&&kn(new mu)!=Mp)&&(kn=function(e){var t=_i(e),r=t==I4?e.constructor:void 0,n=r?Rn(r):"";if(n)switch(n){case $4:return Np;case j4:return Tp;case B4:return Ep;case D4:return Ap;case P4:return Mp}return t});var F4="[object Map]",R4="[object Set]",O4=Object.prototype,z4=O4.hasOwnProperty;function Lp(e){if(e==null)return!0;if(Qo(e)&&(mo(e)||typeof e=="string"||typeof e.splice=="function"||Ch(e)||Sh(e)||go(e)))return!e.length;var t=kn(e);if(t==F4||t==R4)return!e.size;if(Xo(e))return!L4(e).length;for(var r in e)if(z4.call(e,r))return!1;return!0}var Qk="c4",H4=x(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),W4=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./c4Diagram-YG6GDRKO-BNJSAXcg.js");return{diagram:t}},__vite__mapDeps([25,26,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:Qk,diagram:e}},"loader"),q4={id:Qk,detector:H4,loader:W4},U4=q4,Kk="flowchart",V4=x((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),G4=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-HAAlzNbq.js");return{diagram:t}},__vite__mapDeps([27,28,29,30,31,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:Kk,diagram:e}},"loader"),Y4={id:Kk,detector:V4,loader:G4},X4=Y4,Zk="flowchart-v2",Q4=x((e,t)=>t?.flowchart?.defaultRenderer==="dagre-d3"?!1:(t?.flowchart?.defaultRenderer==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer==="dagre-wrapper"?!0:/^\s*flowchart/.test(e)),"detector"),K4=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-HAAlzNbq.js");return{diagram:t}},__vite__mapDeps([27,28,29,30,31,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:Zk,diagram:e}},"loader"),Z4={id:Zk,detector:Q4,loader:K4},J4=Z4,Jk="er",eP=x(e=>/^\s*erDiagram/.test(e),"detector"),tP=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./erDiagram-Q2GNP2WA-BX1DpOGx.js");return{diagram:t}},__vite__mapDeps([32,29,30,31,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:Jk,diagram:e}},"loader"),rP={id:Jk,detector:eP,loader:tP},nP=rP,e1="gitGraph",iP=x(e=>/^\s*gitGraph/.test(e),"detector"),sP=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./gitGraphDiagram-NY62KEGX-CIPmSp43.js");return{diagram:t}},__vite__mapDeps([33,34,35,36,8,7,2,4,5,6,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:e1,diagram:e}},"loader"),aP={id:e1,detector:iP,loader:sP},oP=aP,t1="gantt",lP=x(e=>/^\s*gantt/.test(e),"detector"),cP=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./ganttDiagram-LVOFAZNH-BqzWexqa.js");return{diagram:t}},__vite__mapDeps([37,7,38,39,40,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:t1,diagram:e}},"loader"),uP={id:t1,detector:lP,loader:cP},hP=uP,r1="info",dP=x(e=>/^\s*info/.test(e),"detector"),fP=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./infoDiagram-F6ZHWCRC-Pn4yNWrF.js");return{diagram:t}},__vite__mapDeps([41,36,8,7,2,4,5,6,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:r1,diagram:e}},"loader"),pP={id:r1,detector:dP,loader:fP},n1="pie",gP=x(e=>/^\s*pie/.test(e),"detector"),mP=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./pieDiagram-ADFJNKIX-BcoaAI-L.js");return{diagram:t}},__vite__mapDeps([42,34,36,8,7,2,4,5,43,44,39,6,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:n1,diagram:e}},"loader"),xP={id:n1,detector:gP,loader:mP},i1="quadrantChart",yP=x(e=>/^\s*quadrantChart/.test(e),"detector"),bP=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./quadrantDiagram-AYHSOK5B-D-DwcoSd.js");return{diagram:t}},__vite__mapDeps([45,38,39,40,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:i1,diagram:e}},"loader"),kP={id:i1,detector:yP,loader:bP},wP=kP,s1="xychart",vP=x(e=>/^\s*xychart(-beta)?/.test(e),"detector"),CP=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./xychartDiagram-PRI3JC2R-ByBTDWE2.js");return{diagram:t}},__vite__mapDeps([46,39,44,38,40,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:s1,diagram:e}},"loader"),SP={id:s1,detector:vP,loader:CP},_P=SP,a1="requirement",TP=x(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),EP=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./requirementDiagram-UZGBJVZJ-DbQCpx77.js");return{diagram:t}},__vite__mapDeps([47,29,30,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:a1,diagram:e}},"loader"),AP={id:a1,detector:TP,loader:EP},MP=AP,o1="sequence",NP=x(e=>/^\s*sequenceDiagram/.test(e),"detector"),LP=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./sequenceDiagram-WL72ISMW-BdzICjxO.js");return{diagram:t}},__vite__mapDeps([48,26,35,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:o1,diagram:e}},"loader"),IP={id:o1,detector:NP,loader:LP},$P=IP,l1="class",jP=x((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),BP=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./classDiagram-2ON5EDUG-aUQHFsTA.js");return{diagram:t}},__vite__mapDeps([49,50,28,29,30,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:l1,diagram:e}},"loader"),DP={id:l1,detector:jP,loader:BP},PP=DP,c1="classDiagram",FP=x((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),RP=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./classDiagram-v2-WZHVMYZB-aUQHFsTA.js");return{diagram:t}},__vite__mapDeps([51,50,28,29,30,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:c1,diagram:e}},"loader"),OP={id:c1,detector:FP,loader:RP},zP=OP,u1="state",HP=x((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),WP=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./stateDiagram-FKZM4ZOC-CYY-uUvJ.js");return{diagram:t}},__vite__mapDeps([52,53,29,30,1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:u1,diagram:e}},"loader"),qP={id:u1,detector:HP,loader:WP},UP=qP,h1="stateDiagram",VP=x((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),GP=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./stateDiagram-v2-4FDKWEC3-Dh2Kvomq.js");return{diagram:t}},__vite__mapDeps([54,53,29,30,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:h1,diagram:e}},"loader"),YP={id:h1,detector:VP,loader:GP},XP=YP,d1="journey",QP=x(e=>/^\s*journey/.test(e),"detector"),KP=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./journeyDiagram-XKPGCS4Q-BfzTomS0.js");return{diagram:t}},__vite__mapDeps([55,26,28,43,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:d1,diagram:e}},"loader"),ZP={id:d1,detector:QP,loader:KP},JP=ZP,eF=x((e,t,r)=>{X.debug(`rendering svg for syntax error
349
+ `);const n=jI(t),i=n.append("g");n.attr("viewBox","0 0 2412 512"),Rm(n,100,512,!0),i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),f1={draw:eF},tF=f1,rF={db:{},renderer:f1,parser:{parse:x(()=>{},"parse")}},nF=rF,p1="flowchart-elk",iF=x((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),sF=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-HAAlzNbq.js");return{diagram:t}},__vite__mapDeps([27,28,29,30,31,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:p1,diagram:e}},"loader"),aF={id:p1,detector:iF,loader:sF},oF=aF,g1="timeline",lF=x(e=>/^\s*timeline/.test(e),"detector"),cF=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./timeline-definition-IT6M3QCI-BAvjPYvX.js");return{diagram:t}},__vite__mapDeps([56,43,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:g1,diagram:e}},"loader"),uF={id:g1,detector:lF,loader:cF},hF=uF,m1="mindmap",dF=x(e=>/^\s*mindmap/.test(e),"detector"),fF=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./mindmap-definition-VGOIOE7T-qopraVFy.js");return{diagram:t}},__vite__mapDeps([57,29,30,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:m1,diagram:e}},"loader"),pF={id:m1,detector:dF,loader:fF},gF=pF,x1="kanban",mF=x(e=>/^\s*kanban/.test(e),"detector"),xF=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./kanban-definition-3W4ZIXB7-Cgju7b-L.js");return{diagram:t}},__vite__mapDeps([58,28,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:x1,diagram:e}},"loader"),yF={id:x1,detector:mF,loader:xF},bF=yF,y1="sankey",kF=x(e=>/^\s*sankey(-beta)?/.test(e),"detector"),wF=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./sankeyDiagram-TZEHDZUN-BVk8387S.js");return{diagram:t}},__vite__mapDeps([59,44,39,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:y1,diagram:e}},"loader"),vF={id:y1,detector:kF,loader:wF},CF=vF,b1="packet",SF=x(e=>/^\s*packet(-beta)?/.test(e),"detector"),_F=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./diagram-S2PKOQOG-CkM0APZj.js");return{diagram:t}},__vite__mapDeps([60,34,36,8,7,2,4,5,6,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:b1,diagram:e}},"loader"),TF={id:b1,detector:SF,loader:_F},k1="radar",EF=x(e=>/^\s*radar-beta/.test(e),"detector"),AF=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./diagram-QEK2KX5R-BKYFSfC1.js");return{diagram:t}},__vite__mapDeps([61,34,36,8,7,2,4,5,6,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:k1,diagram:e}},"loader"),MF={id:k1,detector:EF,loader:AF},w1="block",NF=x(e=>/^\s*block(-beta)?/.test(e),"detector"),LF=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./blockDiagram-VD42YOAC-72nsMt_i.js");return{diagram:t}},__vite__mapDeps([62,28,5,2,1,31,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:w1,diagram:e}},"loader"),IF={id:w1,detector:NF,loader:LF},$F=IF,v1="architecture",jF=x(e=>/^\s*architecture/.test(e),"detector"),BF=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./architectureDiagram-VXUJARFQ-BnPYh1OW.js");return{diagram:t}},__vite__mapDeps([63,34,36,8,7,2,4,5,24,6,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:v1,diagram:e}},"loader"),DF={id:v1,detector:jF,loader:BF},PF=DF,C1="treemap",FF=x(e=>/^\s*treemap/.test(e),"detector"),RF=x(async()=>{const{diagram:e}=await Re(async()=>{const{diagram:t}=await import("./diagram-PSM6KHXK-SONPsQNx.js");return{diagram:t}},__vite__mapDeps([64,30,34,36,8,7,2,4,5,40,44,39,6,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));return{id:C1,diagram:e}},"loader"),OF={id:C1,detector:FF,loader:RF},Ip=!1,ol=x(()=>{Ip||(Ip=!0,Xa("error",nF,e=>e.toLowerCase().trim()==="error"),Xa("---",{db:{clear:x(()=>{},"clear")},styles:{},renderer:{draw:x(()=>{},"draw")},parser:{parse:x(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:x(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),Cc(oF,gF,PF),Cc(U4,bF,zP,PP,nP,hP,pP,xP,MP,$P,J4,X4,hF,oP,XP,UP,JP,wP,CF,TF,_P,$F,MF,OF))},"addDiagrams"),zF=x(async()=>{X.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Nn).map(async([r,{detector:n,loader:i}])=>{if(i)try{Ec(r)}catch{try{const{diagram:s,id:a}=await i();Xa(a,s,n)}catch(s){throw X.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Nn[r],s}}}))).filter(r=>r.status==="rejected");if(t.length>0){X.error(`Failed to load ${t.length} external diagrams`);for(const r of t)X.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),HF="graphics-document document";function S1(e,t){e.attr("role",HF),t!==""&&e.attr("aria-roledescription",t)}x(S1,"setA11yDiagramInfo");function _1(e,t,r,n){if(e.insert!==void 0){if(r){const i=`chart-desc-${n}`;e.attr("aria-describedby",i),e.insert("desc",":first-child").attr("id",i).text(r)}if(t){const i=`chart-title-${n}`;e.attr("aria-labelledby",i),e.insert("title",":first-child").attr("id",i).text(t)}}}x(_1,"addSVGa11yTitleDescription");var En,xu=(En=class{constructor(t,r,n,i,s){this.type=t,this.text=r,this.db=n,this.parser=i,this.renderer=s}static async fromText(t,r={}){const n=St(),i=Yu(t,n);t=O3(t)+`
350
+ `;try{Ec(i)}catch{const c=uA(i);if(!c)throw new Em(`Diagram ${i} not found.`);const{id:u,diagram:h}=await c();Xa(u,h)}const{db:s,parser:a,renderer:o,init:l}=Ec(i);return a.parser&&(a.parser.yy=s),s.clear?.(),l?.(n),r.title&&s.setDiagramTitle?.(r.title),await a.parse(t),new En(i,t,s,a,o)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},x(En,"Diagram"),En),$p=[],WF=x(()=>{$p.forEach(e=>{e()}),$p=[]},"attachFunctions"),qF=x(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function T1(e){const t=e.match(Tm);if(!t)return{text:e,metadata:{}};let r=z$(t[1],{schema:O$})??{};r=typeof r=="object"&&!Array.isArray(r)?r:{};const n={};return r.displayMode&&(n.displayMode=r.displayMode.toString()),r.title&&(n.title=r.title.toString()),r.config&&(n.config=r.config),{text:e.slice(t[0].length),metadata:n}}x(T1,"extractFrontMatter");var UF=x(e=>e.replace(/\r\n?/g,`
351
+ `).replace(/<(\w+)([^>]*)>/g,(t,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),VF=x(e=>{const{text:t,metadata:r}=T1(e),{displayMode:n,title:i,config:s={}}=r;return n&&(s.gantt||(s.gantt={}),s.gantt.displayMode=n),{title:i,config:s,text:t}},"processFrontmatter"),GF=x(e=>{const t=cr.detectInit(e)??{},r=cr.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:n})=>n==="wrap"):r?.type==="wrap"&&(t.wrap=!0),{text:E3(e),directive:t}},"processDirectives");function Gh(e){const t=UF(e),r=VF(t),n=GF(r.text),i=Nh(r.config,n.directive);return e=qF(n.text),{code:e,title:r.title,config:i}}x(Gh,"preprocessDiagram");function E1(e){const t=new TextEncoder().encode(e),r=Array.from(t,n=>String.fromCodePoint(n)).join("");return btoa(r)}x(E1,"toBase64");var YF=5e4,XF="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",QF="sandbox",KF="loose",ZF="http://www.w3.org/2000/svg",JF="http://www.w3.org/1999/xlink",eR="http://www.w3.org/1999/xhtml",tR="100%",rR="100%",nR="border:0;margin:0;",iR="margin:0",sR="allow-top-navigation-by-user-activation allow-popups",aR='The "iframe" tag is not supported by your browser.',oR=["foreignobject"],lR=["dominant-baseline"];function Yh(e){const t=Gh(e);return Ga(),TA(t.config??{}),t}x(Yh,"processAndSetConfigs");async function A1(e,t){ol();try{const{code:r,config:n}=Yh(e);return{diagramType:(await N1(r)).type,config:n}}catch(r){if(t?.suppressErrors)return!1;throw r}}x(A1,"parse");var jp=x((e,t,r=[])=>`
352
+ .${e} ${t} { ${r.join(" !important; ")} !important; }`,"cssImportantStyles"),cR=x((e,t=new Map)=>{let r="";if(e.themeCSS!==void 0&&(r+=`
353
+ ${e.themeCSS}`),e.fontFamily!==void 0&&(r+=`
354
+ :root { --mermaid-font-family: ${e.fontFamily}}`),e.altFontFamily!==void 0&&(r+=`
355
+ :root { --mermaid-alt-font-family: ${e.altFontFamily}}`),t instanceof Map){const a=e.htmlLabels??e.flowchart?.htmlLabels?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(o=>{Lp(o.styles)||a.forEach(l=>{r+=jp(o.id,l,o.styles)}),Lp(o.textStyles)||(r+=jp(o.id,"tspan",(o?.textStyles||[]).map(l=>l.replace("color","fill"))))})}return r},"createCssStyles"),uR=x((e,t,r,n)=>{const i=cR(e,r),s=VA(t,i,e.themeVariables);return du(_4(`${n}{${s}}`),E4)},"createUserStyles"),hR=x((e="",t,r)=>{let n=e;return!r&&!t&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=zn(n),n=n.replace(/<br>/g,"<br/>"),n},"cleanUpSvgCode"),dR=x((e="",t)=>{const r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":rR,n=E1(`<body style="${iR}">${e}</body>`);return`<iframe style="width:${tR};height:${r};${nR}" src="data:text/html;charset=UTF-8;base64,${n}" sandbox="${sR}">
356
+ ${aR}
357
+ </iframe>`},"putIntoIFrame"),Bp=x((e,t,r,n,i)=>{const s=e.append("div");s.attr("id",r),n&&s.attr("style",n);const a=s.append("svg").attr("id",t).attr("width","100%").attr("xmlns",ZF);return i&&a.attr("xmlns:xlink",i),a.append("g"),e},"appendDivSvgG");function yu(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}x(yu,"sandboxedIframe");var fR=x((e,t,r,n)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(n)?.remove()},"removeExistingElements"),pR=x(async function(e,t,r){ol();const n=Yh(t);t=n.code;const i=St();X.debug(i),t.length>(i?.maxTextSize??YF)&&(t=XF);const s="#"+e,a="i"+e,o="#"+a,l="d"+e,c="#"+l,u=x(()=>{const R=$e(f?o:c).node();R&&"remove"in R&&R.remove()},"removeTempElements");let h=$e("body");const f=i.securityLevel===QF,d=i.securityLevel===KF,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const D=yu($e(r),a);h=$e(D.nodes()[0].contentDocument.body),h.node().style.margin=0}else h=$e(r);Bp(h,e,l,`font-family: ${g}`,JF)}else{if(fR(document,e,l,a),f){const D=yu($e("body"),a);h=$e(D.nodes()[0].contentDocument.body),h.node().style.margin=0}else h=$e("body");Bp(h,e,l)}let m,b;try{m=await xu.fromText(t,{title:n.title})}catch(D){if(i.suppressErrorRendering)throw u(),D;m=await xu.fromText("error"),b=D}const y=h.select(c).node(),k=m.type,v=y.firstChild,C=v.firstChild,S=m.renderer.getClasses?.(t,m),w=uR(i,k,S,s),T=document.createElement("style");T.innerHTML=w,v.insertBefore(T,C);try{await m.renderer.draw(t,e,ef.version,m)}catch(D){throw i.suppressErrorRendering?u():tF.draw(t,e,ef.version),D}const $=h.select(`${c} svg`),M=m.db.getAccTitle?.(),E=m.db.getAccDescription?.();L1(k,$,M,E),h.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",eR);let N=h.select(c).node().innerHTML;if(X.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),N=hR(N,f,dt(i.arrowMarkerAbsolute)),f){const D=h.select(c+" svg").node();N=dR(N,D)}else d||(N=di.sanitize(N,{ADD_TAGS:oR,ADD_ATTR:lR,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(WF(),b)throw b;return u(),{diagramType:k,svg:N,bindFunctions:m.db.bindFunctions}},"render");function M1(e={}){const t=ut({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),SA(t),t?.theme&&t.theme in Pr?t.themeVariables=Pr[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=Pr.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?CA(t):Im();Gu(r.logLevel),ol()}x(M1,"initialize");var N1=x((e,t={})=>{const{code:r}=Gh(e);return xu.fromText(r,t)},"getDiagramFromText");function L1(e,t,r,n){S1(t,e),_1(t,r,n,t.attr("id"))}x(L1,"addA11yInfo");var Dn=Object.freeze({render:pR,parse:A1,getDiagramFromText:N1,initialize:M1,getConfig:St,setConfig:$m,getSiteConfig:Im,updateSiteConfig:_A,reset:x(()=>{Ga()},"reset"),globalReset:x(()=>{Ga(fi)},"globalReset"),defaultConfig:fi});Gu(St().logLevel);Ga(St());var gR=x((e,t,r)=>{X.warn(e),Mh(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),I1=x(async function(e={querySelector:".mermaid"}){try{await mR(e)}catch(t){if(Mh(t)&&X.error(t.str),zr.parseError&&zr.parseError(t),!e.suppressErrors)throw X.error("Use the suppressErrors option to suppress these errors"),t}},"run"),mR=x(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const n=Dn.getConfig();X.debug(`${e?"":"No "}Callback function found`);let i;if(r)i=r;else if(t)i=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");X.debug(`Found ${i.length} diagrams`),n?.startOnLoad!==void 0&&(X.debug("Start On Load: "+n?.startOnLoad),Dn.updateSiteConfig({startOnLoad:n?.startOnLoad}));const s=new cr.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let a;const o=[];for(const l of Array.from(i)){if(X.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const c=`mermaid-${s.next()}`;a=l.innerHTML,a=Jy(cr.entityDecode(a)).trim().replace(/<br\s*\/?>/gi,"<br/>");const u=cr.detectInit(a);u&&X.debug("Detected early reinit: ",u);try{const{svg:h,bindFunctions:f}=await D1(c,a,l);l.innerHTML=h,e&&await e(c),f&&f(l)}catch(h){gR(h,o,zr.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),$1=x(function(e){Dn.initialize(e)},"initialize"),xR=x(async function(e,t,r){X.warn("mermaid.init is deprecated. Please use run instead."),e&&$1(e);const n={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?n.querySelector=t:t&&(t instanceof HTMLElement?n.nodes=[t]:n.nodes=t),await I1(n)},"init"),yR=x(async(e,{lazyLoad:t=!0}={})=>{ol(),Cc(...e),t===!1&&await zF()},"registerExternalDiagrams"),j1=x(function(){if(zr.startOnLoad){const{startOnLoad:e}=Dn.getConfig();e&&zr.run().catch(t=>X.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",j1,!1);var bR=x(function(e){zr.parseError=e},"setParseErrorHandler"),Eo=[],Zl=!1,B1=x(async()=>{if(!Zl){for(Zl=!0;Eo.length>0;){const e=Eo.shift();if(e)try{await e()}catch(t){X.error("Error executing queue",t)}}Zl=!1}},"executeQueue"),kR=x(async(e,t)=>new Promise((r,n)=>{const i=x(()=>new Promise((s,a)=>{Dn.parse(e,t).then(o=>{s(o),r(o)},o=>{X.error("Error parsing",o),zr.parseError?.(o),a(o),n(o)})}),"performCall");Eo.push(i),B1().catch(n)}),"parse"),D1=x((e,t,r)=>new Promise((n,i)=>{const s=x(()=>new Promise((a,o)=>{Dn.render(e,t,r).then(l=>{a(l),n(l)},l=>{X.error("Error parsing",l),zr.parseError?.(l),o(l),i(l)})}),"performCall");Eo.push(s),B1().catch(i)}),"render"),wR=x(()=>Object.keys(Nn).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),zr={startOnLoad:!0,mermaidAPI:Dn,parse:kR,render:D1,init:xR,run:I1,registerExternalDiagrams:yR,registerLayoutLoaders:Wk,initialize:$1,parseError:void 0,contentLoaded:j1,setParseErrorHandler:bR,detectType:Yu,registerIconPacks:qD,getRegisteredDiagramsMetadata:wR},Dp=zr;/*! Check if previously processed *//*!
358
+ * Wait for document loaded before starting the execution
359
+ */let vR=0;const CR=({code:e,isDark:t=!1})=>{const r=O.useRef(null),n=O.useRef(null),i=O.useRef(null),[s,a]=O.useState(null),[o]=O.useState(()=>`mermaid-diagram-${++vR}`),[l,c]=O.useState(!1),[u,h]=O.useState(!1),[f,d]=O.useState(!1),[g,m]=O.useState(0),b=async()=>{try{await navigator.clipboard.writeText(e),h(!0),setTimeout(()=>h(!1),2e3)}catch(w){console.error("复制失败:",w)}},y=async(w,T,$=!1,M=!1)=>{try{Dp.initialize({startOnLoad:!1,theme:t?"dark":"default",securityLevel:"strict",fontFamily:"ui-sans-serif, system-ui, sans-serif",suppressErrorRendering:!0,themeVariables:{darkMode:t}}),w.innerHTML="";const{svg:E}=await Dp.render(T,e),N=document.createElement("div");N.className="flex justify-center items-start w-full h-full",N.innerHTML=E,w.innerHTML="",w.appendChild(N);const D=N.querySelector("svg");if(D){const R=D.getAttribute("viewBox"),I=D.getAttribute("width"),F=D.getAttribute("height");!R&&I&&F&&D.setAttribute("viewBox",`0 0 ${I} ${F}`);let L=0,B=0;const H=R||(I&&F?`0 0 ${I} ${F}`:null);if(H){const Q=H.split(/\s+/);Q.length===4&&(L=parseFloat(Q[2]),B=parseFloat(Q[3]))}D.removeAttribute("width"),D.removeAttribute("height"),M?($?(D.style.maxWidth="100%",D.style.maxHeight="100%",D.style.width="auto",D.style.height="auto"):(D.style.maxWidth="100%",D.style.maxHeight="560px",D.style.width="auto",D.style.height="auto"),$&&L&&B&&console.log("适应模式:以当前显示为 100% 基准")):(D.style.maxWidth="none",D.style.maxHeight="none",D.style.width="auto",D.style.height="auto")}a(null)}catch(E){console.error("Mermaid 渲染错误:",E),a(E instanceof Error?E.message:"渲染图表时发生错误"),setTimeout(()=>{document.querySelectorAll('[id^="dmermaid"], .error-icon, .error-text').forEach(D=>D.remove())},100)}};O.useEffect(()=>{r.current&&y(r.current,o,!1,!0)},[e,t,o]),O.useEffect(()=>{if(f&&n.current){const w=i.current,T=w?{x:w.scrollLeft,y:w.scrollTop}:null,$=g===0;y(n.current,`${o}-fullscreen`,!0,$),T&&w&&g!==0&&setTimeout(()=>{w.scrollLeft=T.x,w.scrollTop=T.y},50)}},[f,e,t,o,g]);const k=w=>{m(w)},v=()=>g===0?100:g,C=()=>{const w=v(),T=Math.min(200,w+10);console.log("放大:",{baseZoom:w,newZoom:T,zoomLevel:g}),k(T)},S=()=>{const w=v(),T=Math.max(50,w-10);console.log("缩小:",{baseZoom:w,newZoom:T,zoomLevel:g}),k(T)};return s?p.jsx("div",{className:"my-2 border border-red-300 dark:border-red-700 rounded-lg overflow-hidden bg-white dark:bg-gray-800",children:p.jsxs("details",{className:"group",children:[p.jsxs("summary",{className:"flex items-center gap-2 px-3 py-2 cursor-pointer bg-red-50 dark:bg-red-900/20 hover:bg-red-100 dark:hover:bg-red-900/30 transition-colors list-none",children:[p.jsx("svg",{className:"w-4 h-4 text-red-500 dark:text-red-400 flex-shrink-0",viewBox:"0 0 20 20",fill:"currentColor",children:p.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})}),p.jsx("span",{className:"text-sm font-medium text-red-800 dark:text-red-200 flex-1",children:"Mermaid 图表语法错误"}),p.jsx("svg",{className:"w-4 h-4 text-red-600 dark:text-red-400 transition-transform group-open:rotate-180",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),p.jsx("div",{className:"border-t border-red-200 dark:border-red-800",children:p.jsxs("div",{className:"p-3 bg-red-50 dark:bg-red-900/10",children:[p.jsxs("div",{className:"mb-3",children:[p.jsx("div",{className:"text-xs font-medium text-red-700 dark:text-red-300 mb-1",children:"错误信息:"}),p.jsx("div",{className:"text-xs text-red-600 dark:text-red-400 bg-white dark:bg-gray-900 p-2 rounded border border-red-200 dark:border-red-800 font-mono",children:s})]}),p.jsxs("div",{children:[p.jsx("div",{className:"text-xs font-medium text-red-700 dark:text-red-300 mb-1",children:"原始代码:"}),p.jsx("pre",{className:"text-xs bg-white dark:bg-gray-900 p-2 rounded border border-red-200 dark:border-red-800 overflow-x-auto max-h-40 overflow-y-auto",children:p.jsx("code",{className:"text-red-800 dark:text-red-200 font-mono",children:e})})]})]})})]})}):p.jsxs("div",{className:"my-4 border border-gray-200 dark:border-gray-700 rounded-lg bg-white dark:bg-gray-800",children:[p.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/50",children:[p.jsx("div",{className:"flex items-center space-x-2",children:p.jsxs("div",{className:"flex items-center text-xs text-gray-500 dark:text-gray-400",children:[p.jsx("svg",{className:"w-4 h-4 mr-1.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})}),p.jsx("span",{className:"font-medium",children:"Mermaid 图表"})]})}),p.jsxs("div",{className:"flex items-center space-x-1",children:[p.jsx("button",{onClick:()=>d(!0),className:"p-1.5 rounded hover:bg-gray-200 dark:hover:bg-gray-700 text-gray-600 dark:text-gray-400 transition-colors",title:"全屏查看",children:p.jsx(xw,{className:"w-4 h-4"})}),p.jsx("button",{onClick:()=>c(!l),className:"p-1.5 rounded hover:bg-gray-200 dark:hover:bg-gray-700 text-gray-600 dark:text-gray-400 transition-colors",title:l?"隐藏源码":"查看源码",children:p.jsx(yw,{className:"w-4 h-4"})}),p.jsx("button",{onClick:b,className:"p-1.5 rounded hover:bg-gray-200 dark:hover:bg-gray-700 text-gray-600 dark:text-gray-400 transition-colors",title:"复制源码",children:u?p.jsx(tg,{className:"w-4 h-4 text-green-600 dark:text-green-400"}):p.jsx(rc,{className:"w-4 h-4"})})]})]}),p.jsx("div",{ref:r,className:"flex items-center justify-center py-3 px-4",style:{maxHeight:"600px",minHeight:"200px"}}),l&&p.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700",children:p.jsx("div",{className:"bg-gray-900 dark:bg-gray-950 p-4 rounded-b-lg overflow-x-auto",children:p.jsx("pre",{className:"text-sm text-gray-100 font-mono",children:p.jsx("code",{children:e})})})}),f&&p.jsx("div",{className:"fixed inset-0 z-50 bg-black/80 flex items-center justify-center p-4",children:p.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg shadow-2xl w-full h-full max-w-7xl max-h-[90vh] flex flex-col",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800",children:[p.jsx("div",{className:"flex items-center space-x-2",children:p.jsxs("div",{className:"flex items-center text-sm text-gray-500 dark:text-gray-400",children:[p.jsx("svg",{className:"w-5 h-5 mr-2",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})}),p.jsx("span",{className:"font-medium",children:"Mermaid 图表"})]})}),p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsxs("div",{className:"flex items-center space-x-1 border-r border-gray-300 dark:border-gray-600 pr-2 mr-2",children:[p.jsx("button",{onClick:S,className:"p-1.5 rounded hover:bg-gray-200 dark:hover:bg-gray-700 text-gray-600 dark:text-gray-400 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",title:`缩小 (当前${v()}%)`,disabled:v()<=50,children:p.jsx(rg,{className:"w-4 h-4"})}),p.jsx("span",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 min-w-[4rem] text-center",children:g===0?"适应":`${g}%`}),p.jsx("button",{onClick:C,className:"p-1.5 rounded hover:bg-gray-200 dark:hover:bg-gray-700 text-gray-600 dark:text-gray-400 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",title:`放大 (当前${v()}%)`,disabled:v()>=200,children:p.jsx(ng,{className:"w-4 h-4"})}),p.jsx("button",{onClick:()=>k(100),className:"px-2 py-1 text-xs rounded hover:bg-gray-200 dark:hover:bg-gray-700 text-gray-600 dark:text-gray-400 transition-colors",title:"100% 原始大小",children:"100%"}),p.jsx("button",{onClick:()=>k(0),className:`px-2 py-1 text-xs rounded transition-colors ${g===0?"bg-blue-100 dark:bg-blue-900 text-blue-700 dark:text-blue-300":"hover:bg-gray-200 dark:hover:bg-gray-700 text-gray-600 dark:text-gray-400"}`,title:"适应窗口大小",children:"适应"})]}),p.jsx("button",{onClick:()=>{d(!1),m(0)},className:"p-1.5 rounded hover:bg-gray-200 dark:hover:bg-gray-700 text-gray-600 dark:text-gray-400 transition-colors",title:"关闭",children:p.jsx(An,{className:"w-5 h-5"})})]})]}),p.jsx("div",{ref:i,className:"flex-1 overflow-auto p-6 bg-gray-50 dark:bg-gray-900",children:p.jsx("div",{ref:n,className:g===0?"w-full h-full flex items-center justify-center":"flex items-center justify-center min-h-full",style:g===0?{}:(()=>{const w=g/100;return console.log("应用变换:",{zoomLevel:g,scale:w,message:"适应模式为100%基准,直接应用缩放"}),{transform:`scale(${w})`,transformOrigin:"center center",transition:"transform 0.2s ease-in-out"}})()})})]})})]})},ks=({content:e,isUserMessage:t=!1})=>{const[r,n]=O.useState(!1),i=s=>t?"text-white":s;return O.useEffect(()=>{const s=()=>{n(document.documentElement.classList.contains("dark"))};s();const a=new MutationObserver(s);return a.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>a.disconnect()},[]),p.jsx("div",{className:"break-words overflow-wrap-anywhere word-break-break-all",children:p.jsx(g_,{remarkPlugins:[AE],components:{code({inline:s,className:a,children:o,...l}){const c=/language-(\w+)/.exec(a||""),u=c?c[1]:"";return!s&&u==="mermaid"?p.jsx(CR,{code:String(o).replace(/\n$/,""),isDark:r}):!s&&c?p.jsx(fg,{style:ym,language:u,PreTag:"div",className:"rounded-md text-sm overflow-auto",wrapLines:!0,wrapLongLines:!0,...l,children:String(o).replace(/\n$/,"")}):p.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 text-gray-800 dark:text-gray-200 px-1 py-0.5 rounded text-sm font-mono",...l,children:o})},h1:({children:s})=>p.jsx("h1",{className:`text-lg font-bold mt-4 mb-2 ${i("text-gray-900 dark:text-gray-100")}`,children:s}),h2:({children:s})=>p.jsx("h2",{className:`text-base font-bold mt-3 mb-2 ${i("text-gray-900 dark:text-gray-100")}`,children:s}),h3:({children:s})=>p.jsx("h3",{className:`text-sm font-bold mt-2 mb-1 ${i("text-gray-900 dark:text-gray-100")}`,children:s}),p:({children:s})=>p.jsx("p",{className:`mb-2 leading-relaxed break-words overflow-wrap-anywhere ${i("text-gray-800 dark:text-gray-200")}`,children:s}),ul:({children:s})=>p.jsx("ul",{className:"list-disc list-inside mb-2 space-y-1",children:s}),ol:({children:s})=>p.jsx("ol",{className:"list-decimal list-inside mb-2 space-y-1",children:s}),li:({children:s})=>p.jsx("li",{className:`leading-relaxed break-words overflow-wrap-anywhere ${i("text-gray-800 dark:text-gray-200")}`,children:s}),blockquote:({children:s})=>p.jsx("blockquote",{className:`border-l-4 border-gray-300 dark:border-gray-600 pl-3 italic mb-2 ${i("text-gray-600 dark:text-gray-400")}`,children:s}),strong:({children:s})=>p.jsx("strong",{className:`font-semibold ${i("text-gray-900 dark:text-gray-100")}`,children:s}),em:({children:s})=>p.jsx("em",{className:"italic",children:s}),a:({children:s,href:a})=>p.jsx("a",{href:a,className:"text-blue-600 hover:text-blue-800 underline",target:"_blank",rel:"noopener noreferrer",children:s}),table:({children:s})=>p.jsx("table",{className:"border-collapse border border-gray-300 dark:border-gray-600 mb-2 text-sm",children:s}),th:({children:s})=>p.jsx("th",{className:`border border-gray-300 dark:border-gray-600 px-2 py-1 bg-gray-100 dark:bg-gray-800 font-semibold text-left ${i("text-gray-900 dark:text-gray-100")}`,children:s}),td:({children:s})=>p.jsx("td",{className:`border border-gray-300 dark:border-gray-600 px-2 py-1 ${i("text-gray-800 dark:text-gray-200")}`,children:s})},children:e})})},SR=({text:e,maxLength:t=300})=>{const{t:r}=we("components"),[n,i]=O.useState(!1),s=e.length>t,a=n||!s?e:e.substring(0,t)+"...";return p.jsxs("div",{children:[p.jsx("div",{className:"text-sm text-gray-800 dark:text-gray-200 whitespace-pre-wrap",children:a}),s&&p.jsx("button",{onClick:()=>i(!n),className:"mt-2 text-xs text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 transition-colors",children:r(n?"subAgentMessageFlow.collapse":"subAgentMessageFlow.expand")})]})},_R=e=>({id:e.toolData?.id||e.id,toolName:e.toolData?.toolName||"Unknown",toolInput:e.toolData?.toolInput||{},toolResult:e.toolData?.toolResult,isExecuting:!1,isError:e.toolData?.isError,timestamp:new Date}),TR=({content:e})=>{const{t}=we("components"),[r,n]=O.useState(!1);return p.jsxs("details",{className:"my-2",open:r,onToggle:i=>n(i.target.open),children:[p.jsxs("summary",{className:"cursor-pointer text-gray-500 dark:text-gray-400 text-sm hover:text-gray-700 dark:hover:text-gray-300 transition-colors select-none",children:["💭 ",t("subAgentMessageFlow.thinking")]}),p.jsx("div",{className:"mt-2 pl-4 border-l-2 border-gray-200 dark:border-gray-700",children:p.jsx("div",{className:"text-gray-600 dark:text-gray-300 text-sm whitespace-pre-wrap break-words leading-relaxed italic",children:e})})]})},ER=e=>e.flatMap(t=>t.messageParts).sort((t,r)=>t.order-r.order),P1=({taskPrompt:e,messageFlow:t,defaultExpanded:r=!1})=>{const{t:n}=we("components"),[i,s]=O.useState(r),a=t.reduce((l,c)=>l+c.messageParts.filter(u=>u.type==="tool").length,0),o=ER(t);return p.jsxs("div",{className:"mt-3 border-t border-gray-200 dark:border-gray-700 pt-3",children:[p.jsxs("button",{onClick:()=>s(!i),className:"flex items-center space-x-2 text-sm text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200 transition-colors w-full",children:[i?p.jsx(ui,{className:"w-4 h-4 flex-shrink-0"}):p.jsx(Rs,{className:"w-4 h-4 flex-shrink-0"}),p.jsx("span",{className:"font-medium",children:n("subAgentMessageFlow.title")}),p.jsxs("span",{className:"text-xs text-gray-400 dark:text-gray-500",children:["(",n("subAgentMessageFlow.messageCount",{count:t.length}),", ",n("subAgentMessageFlow.toolCount",{count:a}),")"]})]}),i&&p.jsxs("div",{className:"mt-3 pl-3 border-l-2 border-purple-200 dark:border-purple-800 space-y-3",children:[p.jsxs("div",{className:"bg-blue-50 dark:bg-blue-900/30 rounded-lg p-3 border border-blue-200 dark:border-blue-800",children:[p.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[p.jsx(wa,{className:"w-4 h-4 text-blue-600 dark:text-blue-400"}),p.jsx("span",{className:"text-xs font-medium text-blue-700 dark:text-blue-400",children:n("subAgentMessageFlow.taskInput")})]}),p.jsx(SR,{text:e,maxLength:300})]}),o.map(l=>l.type==="text"&&l.content?p.jsx("div",{className:"text-sm text-gray-700 dark:text-gray-300",children:p.jsx(ks,{content:l.content,isUserMessage:!1})},l.id):l.type==="thinking"&&l.content?p.jsx(TR,{content:l.content},l.id):l.type==="tool"&&l.toolData?p.jsx("div",{children:p.jsx(z1,{execution:_R(l)})},l.id):null)]})]})},AR=e=>{if(e<1e3)return`${e}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const t=Math.floor(e/6e4),r=Math.floor(e%6e4/1e3);return`${t}m ${r}s`},MR=({result:e})=>{const{t}=we("components");return p.jsxs("div",{className:"flex flex-wrap gap-3 mt-3 text-xs",children:[e.status&&p.jsxs("div",{className:`flex items-center space-x-1 px-2 py-1 rounded ${e.status==="completed"?"bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400":e.status==="failed"?"bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-400":"bg-yellow-100 dark:bg-yellow-900/30 text-yellow-700 dark:text-yellow-400"}`,children:[e.status==="completed"?p.jsx(Jr,{className:"w-3 h-3"}):e.status==="failed"?p.jsx(Ca,{className:"w-3 h-3"}):p.jsx(nc,{className:"w-3 h-3"}),p.jsx("span",{children:t(`taskTool.status.${e.status}`)})]}),e.totalDurationMs!==void 0&&p.jsxs("div",{className:"flex items-center space-x-1 px-2 py-1 bg-gray-100 dark:bg-gray-700 rounded text-gray-600 dark:text-gray-400",children:[p.jsx(Zr,{className:"w-3 h-3"}),p.jsx("span",{children:AR(e.totalDurationMs)})]}),e.totalToolUseCount!==void 0&&e.totalToolUseCount>0&&p.jsxs("div",{className:"flex items-center space-x-1 px-2 py-1 bg-blue-100 dark:bg-blue-900/30 rounded text-blue-600 dark:text-blue-400",children:[p.jsx(Sa,{className:"w-3 h-3"}),p.jsx("span",{children:t("taskTool.toolCallCount",{count:e.totalToolUseCount})})]}),e.totalTokens!==void 0&&p.jsxs("div",{className:"flex items-center space-x-1 px-2 py-1 bg-purple-100 dark:bg-purple-900/30 rounded text-purple-600 dark:text-purple-400",children:[p.jsx(bw,{className:"w-3 h-3"}),p.jsxs("span",{children:[e.totalTokens.toLocaleString()," tokens"]})]})]})},NR=({execution:e})=>{const{t}=we("components"),r=e.toolInput,n=e.toolUseResult,i=e.claudeId||e.toolData?.claudeId;console.log("🎯 [TaskTool] claudeId:",i,"isExecuting:",e.isExecuting);const s=lc(u=>u.activeTasks),a=i?s.get(i):void 0;i&&console.log("🎯 [TaskTool] activeTask:",a?`found with ${a.messageFlow.length} messages`:"not found");const o=O.useMemo(()=>!e.isExecuting&&n?.subAgentMessageFlow?n.subAgentMessageFlow:a?.messageFlow&&a.messageFlow.length>0?a.messageFlow:n?.subAgentMessageFlow||[],[e.isExecuting,n?.subAgentMessageFlow,a?.messageFlow]),l=()=>{if(r.description)return r.description.trim()},c=r.prompt||n?.prompt||"";return p.jsx(Qe,{execution:e,subtitle:l(),showResult:!1,hideToolName:!1,children:p.jsxs("div",{className:"space-y-3",children:[p.jsx(Ve,{label:t("taskTool.taskDescriptionLabel"),value:r.description}),p.jsxs("div",{children:[p.jsx("span",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 block mb-1",children:t("taskTool.agentType")}),p.jsx("span",{className:"text-sm px-2 py-1 bg-blue-100 dark:bg-blue-900/30 text-blue-800 dark:text-blue-300 rounded",children:r.subagent_type})]}),r.model&&p.jsxs("div",{children:[p.jsx("span",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 block mb-1",children:t("taskTool.model")}),p.jsx("span",{className:`text-sm px-2 py-1 rounded ${r.model==="sonnet"?"bg-orange-100 dark:bg-orange-900/30 text-orange-800 dark:text-orange-300":r.model==="opus"?"bg-purple-100 dark:bg-purple-900/30 text-purple-800 dark:text-purple-300":"bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-300"}`,children:r.model.charAt(0).toUpperCase()+r.model.slice(1)})]}),r.resume&&p.jsxs("div",{children:[p.jsx("span",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 block mb-1",children:t("taskTool.resumeTask")}),p.jsx("span",{className:"text-sm px-2 py-1 bg-amber-100 dark:bg-amber-900/30 text-amber-800 dark:text-amber-300 rounded",children:t("taskTool.fromPreviousExecution")}),p.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1 font-mono",children:r.resume})]}),e.isExecuting&&p.jsxs("div",{className:"flex items-center space-x-2 text-blue-600 dark:text-blue-400",children:[p.jsx(va,{className:"w-4 h-4 animate-spin"}),p.jsx("span",{className:"text-sm",children:r.model?t("taskTool.executingWithModel",{model:r.model}):t("taskTool.executing")}),a&&p.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["(",a.messageFlow.reduce((u,h)=>u+h.messageParts.length,0)," ",t("taskTool.partsReceived"),")"]})]}),!e.isExecuting&&n&&p.jsx(MR,{result:n}),o.length>0&&c&&p.jsx(P1,{taskPrompt:c,messageFlow:o,defaultExpanded:e.isExecuting})]})})},LR=({execution:e})=>{const{t}=we("components"),r=e.toolInput,n=()=>{if(r.command)return r.command.trim()},i=()=>e.isExecuting?t("bashTool.executing"):e.isError?e.toolResult||t("bashTool.executionError"):e.toolResult||"";return p.jsx(Qe,{execution:e,subtitle:n(),showResult:!1,hideToolName:!1,children:p.jsxs("div",{className:"space-y-3",children:[r.description&&p.jsx("div",{className:"text-sm text-gray-600 mb-2",children:r.description}),p.jsxs("div",{className:"bg-gray-900 rounded-lg p-4 font-mono text-sm",children:[p.jsxs("div",{className:"flex items-start",children:[p.jsx("span",{className:"text-green-400 mr-2 select-none",children:"$"}),p.jsx("span",{className:"text-white break-all flex-1",children:r.command})]}),!e.isExecuting&&e.toolResult&&p.jsx("div",{className:"mt-2",children:p.jsx("pre",{className:`whitespace-pre-wrap break-words ${e.isError?"text-red-400":"text-gray-300"}`,children:i()})}),e.isExecuting&&p.jsx("div",{className:"mt-2",children:p.jsx("span",{className:"text-yellow-400 animate-pulse",children:t("bashTool.executing")})})]}),r.timeout&&p.jsx("div",{className:"text-xs text-gray-500",children:t("bashTool.timeout",{timeout:r.timeout})})]})})},IR=({execution:e})=>{const{t}=we("components"),r=e.toolInput,n=()=>{if(r.pattern)return r.pattern},i=s=>!s||!s.trim()?t("globTool.noFilesFound"):(s.trim().split(`
360
+ `).filter(o=>o.trim()).length===0,s);return p.jsxs(Qe,{execution:e,subtitle:n(),hideToolName:!1,showResult:!1,children:[p.jsxs("div",{children:[p.jsx(Ve,{label:t("globTool.patternLabel"),value:r.pattern,isCode:!0}),r.path&&p.jsx(Ve,{label:t("globTool.pathLabel"),value:r.path})]}),e.toolResult&&!e.isError&&p.jsxs("div",{className:"mt-3",children:[p.jsx("p",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 mb-2",children:t("globTool.matchingResults")}),p.jsx("div",{className:"p-3 rounded-md border bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-700 text-sm font-mono whitespace-pre-wrap break-words text-blue-700 dark:text-blue-300",children:i(e.toolResult)})]})]})},$R=({execution:e})=>{const{t}=we("components"),r=e.toolInput,n=()=>{if(r.pattern)return`"${r.pattern}"`},i=s=>{if(!s.trim())return t("grepTool.noMatchesFound");const a=r.output_mode||"files_with_matches";return a==="files_with_matches"?s:a==="count"?`${t("grepTool.matchStatistics")}:
361
+
362
+ ${s}`:s};return p.jsxs(Qe,{execution:e,subtitle:n(),showResult:!1,hideToolName:!1,children:[p.jsxs("div",{children:[p.jsx(Ve,{label:t("grepTool.patternLabel"),value:r.pattern,isCode:!0}),r.path&&p.jsx(Ve,{label:t("grepTool.pathLabel"),value:r.path}),r.glob&&p.jsx(Ve,{label:t("grepTool.globLabel"),value:r.glob}),r.type&&p.jsx(Ve,{label:t("grepTool.typeLabel"),value:r.type}),r.output_mode&&p.jsx(Ve,{label:t("grepTool.outputModeLabel"),value:r.output_mode}),p.jsxs("div",{className:"flex flex-wrap gap-2 mt-2",children:[r["-i"]&&p.jsx("span",{className:"px-2 py-1 bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 text-xs rounded",children:t("grepTool.ignoreCase")}),r["-n"]&&p.jsx("span",{className:"px-2 py-1 bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 text-xs rounded",children:t("grepTool.showLineNumbers")}),r["-A"]&&p.jsx("span",{className:"px-2 py-1 bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 text-xs rounded",children:t("grepTool.afterLines",{count:r["-A"]})}),r["-B"]&&p.jsx("span",{className:"px-2 py-1 bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 text-xs rounded",children:t("grepTool.beforeLines",{count:r["-B"]})}),r["-C"]&&p.jsx("span",{className:"px-2 py-1 bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 text-xs rounded",children:t("grepTool.contextLines",{count:r["-C"]})}),r.multiline&&p.jsx("span",{className:"px-2 py-1 bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 text-xs rounded",children:t("grepTool.multilineMode")})]})]}),e.toolResult&&!e.isError&&p.jsxs("div",{className:"mt-3",children:[p.jsx("p",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 mb-2",children:t("grepTool.searchResults")}),p.jsx("div",{className:"p-3 rounded-md border bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-700 text-sm font-mono whitespace-pre-wrap break-words text-green-700 dark:text-green-300",children:i(e.toolResult)})]})]})},jR=({execution:e})=>{const{t}=we("components"),r=e.toolInput,n=()=>{if(!r.path)return;const i=r.path;return i.split("/").slice(-2).join("/")||i};return p.jsxs(Qe,{execution:e,subtitle:n(),hideToolName:!1,children:[p.jsxs("div",{children:[p.jsx(Ve,{label:t("lsTool.directoryPath"),value:r.path}),r.ignore&&r.ignore.length>0&&p.jsx(Ve,{label:t("lsTool.ignorePatterns"),value:r.ignore.join(", ")})]}),e.toolResult&&!e.isError&&p.jsxs("div",{className:"mt-3",children:[p.jsx("p",{className:"text-xs font-medium text-gray-600 mb-2",children:t("lsTool.directoryStructure")}),p.jsx("div",{className:"p-3 rounded-md border bg-yellow-50 border-yellow-200 text-sm font-mono whitespace-pre-wrap break-words text-yellow-800",children:e.toolResult})]})]})},BR=({execution:e})=>{const{t}=we("components"),r=e.toolInput;return p.jsx(Qe,{execution:e,hideToolName:!1,children:p.jsxs("div",{children:[p.jsxs("div",{className:"mb-3",children:[p.jsx("p",{className:"text-xs font-medium text-gray-600 mb-2",children:t("exitPlanModeTool.implementationPlan")}),p.jsx("div",{className:"p-3 rounded-md border bg-emerald-50 border-emerald-200",children:p.jsx("div",{className:"text-sm text-emerald-800 whitespace-pre-wrap break-words",children:r.plan})})]}),p.jsxs("div",{className:"text-xs text-emerald-600 bg-emerald-100 p-2 rounded",children:["📋 ",t("exitPlanModeTool.planModeExited")]})]})})},DR=({execution:e})=>{const{t}=we("components"),r=e.toolInput,n=()=>r.file_path?r.file_path.split("/").pop()||r.file_path:void 0;return p.jsx(Qe,{execution:e,subtitle:n(),showResult:!1,hideToolName:!1,children:p.jsxs("div",{children:[p.jsx(Ve,{label:t("readTool.readFile"),value:r.file_path}),r.offset&&p.jsx(Ve,{label:t("readTool.startLine"),value:r.offset}),r.limit&&p.jsx(Ve,{label:t("readTool.readLines"),value:r.limit})]})})};function Er(){}Er.prototype={diff:function(t,r){var n,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=i.callback;typeof i=="function"&&(s=i,i={});var a=this;function o(C){return C=a.postProcess(C,i),s?(setTimeout(function(){s(C)},0),!0):C}t=this.castInput(t,i),r=this.castInput(r,i),t=this.removeEmpty(this.tokenize(t,i)),r=this.removeEmpty(this.tokenize(r,i));var l=r.length,c=t.length,u=1,h=l+c;i.maxEditLength!=null&&(h=Math.min(h,i.maxEditLength));var f=(n=i.timeout)!==null&&n!==void 0?n:1/0,d=Date.now()+f,g=[{oldPos:-1,lastComponent:void 0}],m=this.extractCommon(g[0],r,t,0,i);if(g[0].oldPos+1>=c&&m+1>=l)return o(Pp(a,g[0].lastComponent,r,t,a.useLongestToken));var b=-1/0,y=1/0;function k(){for(var C=Math.max(b,-u);C<=Math.min(y,u);C+=2){var S=void 0,w=g[C-1],T=g[C+1];w&&(g[C-1]=void 0);var $=!1;if(T){var M=T.oldPos-C;$=T&&0<=M&&M<l}var E=w&&w.oldPos+1<c;if(!$&&!E){g[C]=void 0;continue}if(!E||$&&w.oldPos<T.oldPos?S=a.addToPath(T,!0,!1,0,i):S=a.addToPath(w,!1,!0,1,i),m=a.extractCommon(S,r,t,C,i),S.oldPos+1>=c&&m+1>=l)return o(Pp(a,S.lastComponent,r,t,a.useLongestToken));g[C]=S,S.oldPos+1>=c&&(y=Math.min(y,C-1)),m+1>=l&&(b=Math.max(b,C+1))}u++}if(s)(function C(){setTimeout(function(){if(u>h||Date.now()>d)return s();k()||C()},0)})();else for(;u<=h&&Date.now()<=d;){var v=k();if(v)return v}},addToPath:function(t,r,n,i,s){var a=t.lastComponent;return a&&!s.oneChangePerToken&&a.added===r&&a.removed===n?{oldPos:t.oldPos+i,lastComponent:{count:a.count+1,added:r,removed:n,previousComponent:a.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:r,removed:n,previousComponent:a}}},extractCommon:function(t,r,n,i,s){for(var a=r.length,o=n.length,l=t.oldPos,c=l-i,u=0;c+1<a&&l+1<o&&this.equals(n[l+1],r[c+1],s);)c++,l++,u++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return u&&!s.oneChangePerToken&&(t.lastComponent={count:u,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=l,c},equals:function(t,r,n){return n.comparator?n.comparator(t,r):t===r||n.ignoreCase&&t.toLowerCase()===r.toLowerCase()},removeEmpty:function(t){for(var r=[],n=0;n<t.length;n++)t[n]&&r.push(t[n]);return r},castInput:function(t){return t},tokenize:function(t){return Array.from(t)},join:function(t){return t.join("")},postProcess:function(t){return t}};function Pp(e,t,r,n,i){for(var s=[],a;t;)s.push(t),a=t.previousComponent,delete t.previousComponent,t=a;s.reverse();for(var o=0,l=s.length,c=0,u=0;o<l;o++){var h=s[o];if(h.removed)h.value=e.join(n.slice(u,u+h.count)),u+=h.count;else{if(!h.added&&i){var f=r.slice(c,c+h.count);f=f.map(function(d,g){var m=n[u+g];return m.length>d.length?m:d}),h.value=e.join(f)}else h.value=e.join(r.slice(c,c+h.count));c+=h.count,h.added||(u+=h.count)}}return s}function Fp(e,t){var r;for(r=0;r<e.length&&r<t.length;r++)if(e[r]!=t[r])return e.slice(0,r);return e.slice(0,r)}function Rp(e,t){var r;if(!e||!t||e[e.length-1]!=t[t.length-1])return"";for(r=0;r<e.length&&r<t.length;r++)if(e[e.length-(r+1)]!=t[t.length-(r+1)])return e.slice(-r);return e.slice(-r)}function bu(e,t,r){if(e.slice(0,t.length)!=t)throw Error("string ".concat(JSON.stringify(e)," doesn't start with prefix ").concat(JSON.stringify(t),"; this is a bug"));return r+e.slice(t.length)}function ku(e,t,r){if(!t)return e+r;if(e.slice(-t.length)!=t)throw Error("string ".concat(JSON.stringify(e)," doesn't end with suffix ").concat(JSON.stringify(t),"; this is a bug"));return e.slice(0,-t.length)+r}function es(e,t){return bu(e,t,"")}function ka(e,t){return ku(e,t,"")}function Op(e,t){return t.slice(0,PR(e,t))}function PR(e,t){var r=0;e.length>t.length&&(r=e.length-t.length);var n=t.length;e.length<t.length&&(n=e.length);var i=Array(n),s=0;i[0]=0;for(var a=1;a<n;a++){for(t[a]==t[s]?i[a]=i[s]:i[a]=s;s>0&&t[a]!=t[s];)s=i[s];t[a]==t[s]&&s++}s=0;for(var o=r;o<e.length;o++){for(;s>0&&e[o]!=t[s];)s=i[s];e[o]==t[s]&&s++}return s}var Ao="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",FR=new RegExp("[".concat(Ao,"]+|\\s+|[^").concat(Ao,"]"),"ug"),ll=new Er;ll.equals=function(e,t,r){return r.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()};ll.tokenize=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r;if(t.intlSegmenter){if(t.intlSegmenter.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');r=Array.from(t.intlSegmenter.segment(e),function(s){return s.segment})}else r=e.match(FR)||[];var n=[],i=null;return r.forEach(function(s){/\s/.test(s)?i==null?n.push(s):n.push(n.pop()+s):/\s/.test(i)?n[n.length-1]==i?n.push(n.pop()+s):n.push(i+s):n.push(s),i=s}),n};ll.join=function(e){return e.map(function(t,r){return r==0?t:t.replace(/^\s+/,"")}).join("")};ll.postProcess=function(e,t){if(!e||t.oneChangePerToken)return e;var r=null,n=null,i=null;return e.forEach(function(s){s.added?n=s:s.removed?i=s:((n||i)&&zp(r,i,n,s),r=s,n=null,i=null)}),(n||i)&&zp(r,i,n,null),e};function zp(e,t,r,n){if(t&&r){var i=t.value.match(/^\s*/)[0],s=t.value.match(/\s*$/)[0],a=r.value.match(/^\s*/)[0],o=r.value.match(/\s*$/)[0];if(e){var l=Fp(i,a);e.value=ku(e.value,a,l),t.value=es(t.value,l),r.value=es(r.value,l)}if(n){var c=Rp(s,o);n.value=bu(n.value,o,c),t.value=ka(t.value,c),r.value=ka(r.value,c)}}else if(r)e&&(r.value=r.value.replace(/^\s*/,"")),n&&(n.value=n.value.replace(/^\s*/,""));else if(e&&n){var u=n.value.match(/^\s*/)[0],h=t.value.match(/^\s*/)[0],f=t.value.match(/\s*$/)[0],d=Fp(u,h);t.value=es(t.value,d);var g=Rp(es(u,d),f);t.value=ka(t.value,g),n.value=bu(n.value,u,g),e.value=ku(e.value,u,u.slice(0,u.length-g.length))}else if(n){var m=n.value.match(/^\s*/)[0],b=t.value.match(/\s*$/)[0],y=Op(b,m);t.value=ka(t.value,y)}else if(e){var k=e.value.match(/\s*$/)[0],v=t.value.match(/^\s*/)[0],C=Op(k,v);t.value=es(t.value,C)}}var RR=new Er;RR.tokenize=function(e){var t=new RegExp("(\\r?\\n)|[".concat(Ao,"]+|[^\\S\\n\\r]+|[^").concat(Ao,"]"),"ug");return e.match(t)||[]};var cl=new Er;cl.tokenize=function(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
363
+ `));var r=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var i=0;i<n.length;i++){var s=n[i];i%2&&!t.newlineIsToken?r[r.length-1]+=s:r.push(s)}return r};cl.equals=function(e,t,r){return r.ignoreWhitespace?((!r.newlineIsToken||!e.includes(`
364
+ `))&&(e=e.trim()),(!r.newlineIsToken||!t.includes(`
365
+ `))&&(t=t.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(e.endsWith(`
366
+ `)&&(e=e.slice(0,-1)),t.endsWith(`
367
+ `)&&(t=t.slice(0,-1))),Er.prototype.equals.call(this,e,t,r)};function Hp(e,t,r){return cl.diff(e,t,r)}var OR=new Er;OR.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var zR=new Er;zR.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function Wp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function qp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Wp(Object(r),!0).forEach(function(n){qR(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function HR(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function WR(e){var t=HR(e,"string");return typeof t=="symbol"?t:t+""}function wu(e){"@babel/helpers - typeof";return wu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wu(e)}function qR(e,t,r){return t=WR(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jl(e){return UR(e)||VR(e)||GR(e)||YR()}function UR(e){if(Array.isArray(e))return vu(e)}function VR(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function GR(e,t){if(e){if(typeof e=="string")return vu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vu(e,t)}}function vu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function YR(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
368
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Fs=new Er;Fs.useLongestToken=!0;Fs.tokenize=cl.tokenize;Fs.castInput=function(e,t){var r=t.undefinedReplacement,n=t.stringifyReplacer,i=n===void 0?function(s,a){return typeof a>"u"?r:a}:n;return typeof e=="string"?e:JSON.stringify(Cu(e,null,null,i),i," ")};Fs.equals=function(e,t,r){return Er.prototype.equals.call(Fs,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"),r)};function Cu(e,t,r,n,i){t=t||[],r=r||[],n&&(e=n(i,e));var s;for(s=0;s<t.length;s+=1)if(t[s]===e)return r[s];var a;if(Object.prototype.toString.call(e)==="[object Array]"){for(t.push(e),a=new Array(e.length),r.push(a),s=0;s<e.length;s+=1)a[s]=Cu(e[s],t,r,n,i);return t.pop(),r.pop(),a}if(e&&e.toJSON&&(e=e.toJSON()),wu(e)==="object"&&e!==null){t.push(e),a={},r.push(a);var o=[],l;for(l in e)Object.prototype.hasOwnProperty.call(e,l)&&o.push(l);for(o.sort(),s=0;s<o.length;s+=1)l=o[s],a[l]=Cu(e[l],t,r,n,l);t.pop(),r.pop()}else a=e;return a}var Su=new Er;Su.tokenize=function(e){return e.slice()};Su.join=Su.removeEmpty=function(e){return e};function XR(e,t,r,n,i,s,a){if(a||(a={}),typeof a=="function"&&(a={callback:a}),typeof a.context>"u"&&(a.context=4),a.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(a.callback){var o=a,l=o.callback;Hp(r,n,qp(qp({},a),{},{callback:function(h){var f=c(h);l(f)}}))}else return c(Hp(r,n,a));function c(u){if(!u)return;u.push({value:"",lines:[]});function h($){return $.map(function(M){return" "+M})}for(var f=[],d=0,g=0,m=[],b=1,y=1,k=function(){var M=u[v],E=M.lines||QR(M.value);if(M.lines=E,M.added||M.removed){var N;if(!d){var D=u[v-1];d=b,g=y,D&&(m=a.context>0?h(D.lines.slice(-a.context)):[],d-=m.length,g-=m.length)}(N=m).push.apply(N,Jl(E.map(function(B){return(M.added?"+":"-")+B}))),M.added?y+=E.length:b+=E.length}else{if(d)if(E.length<=a.context*2&&v<u.length-2){var R;(R=m).push.apply(R,Jl(h(E)))}else{var I,F=Math.min(E.length,a.context);(I=m).push.apply(I,Jl(h(E.slice(0,F))));var L={oldStart:d,oldLines:b-d+F,newStart:g,newLines:y-g+F,lines:m};f.push(L),d=0,g=0,m=[]}b+=E.length,y+=E.length}},v=0;v<u.length;v++)k();for(var C=0,S=f;C<S.length;C++)for(var w=S[C],T=0;T<w.lines.length;T++)w.lines[T].endsWith(`
369
+ `)?w.lines[T]=w.lines[T].slice(0,-1):(w.lines.splice(T+1,0,"\"),T++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:s,hunks:f}}}function QR(e){var t=e.endsWith(`
370
+ `),r=e.split(`
371
+ `).map(function(n){return n+`
372
+ `});return t?r.pop():r.push(r.pop().slice(0,-1)),r}const F1=({oldText:e,newText:t,oldStartLine:r=1,newStartLine:n=1})=>{const i=XR("old","new",e,t,"","",{context:3});return!i.hunks||i.hunks.length===0?p.jsx("pre",{className:"diff-container",children:p.jsx("code",{children:"No changes detected."})}):p.jsx("pre",{className:"diff-container",children:p.jsx("code",{children:i.hunks.map((s,a)=>{let o=s.oldStart+(r-1),l=s.newStart+(n-1);const c=s.oldStart+(r-1),u=s.newStart+(n-1);return p.jsxs("div",{className:"diff-hunk",children:[p.jsxs("div",{className:"hunk-header",children:[p.jsx("span",{className:"line-gutter",children:"..."}),p.jsx("span",{className:"line-content",children:`@@ -${c},${s.oldLines} +${u},${s.newLines} @@`})]}),s.lines.filter(h=>h.substring(1).trim()!=="No newline at end of file").map((h,f)=>{const d=h.startsWith("+")?"add":h.startsWith("-")?"del":"context";let g="diff-line",m="",b="";switch(d){case"add":g+=" diff-added",b=(l++).toString();break;case"del":g+=" diff-removed",m=(o++).toString();break;case"context":m=(o++).toString(),b=(l++).toString();break}return p.jsxs("div",{className:g,children:[p.jsxs("span",{className:"line-gutter",children:[m.padStart(4)," ",b.padStart(4)]}),p.jsx("span",{className:"line-prefix",children:h.charAt(0)}),p.jsx("span",{className:"line-content",children:h.substring(1)})]},f)})]},a)})})})},KR=({execution:e})=>{const{t}=we("components"),r=e.toolInput,n=e.toolUseResult,i=()=>r.file_path?r.file_path.split("/").pop()||r.file_path:void 0,s=()=>{if(n?.structuredPatch&&n.structuredPatch.length>0){const l=n.structuredPatch[0];return{oldStartLine:l.oldStart,newStartLine:l.newStart}}return{oldStartLine:1,newStartLine:1}},{oldStartLine:a,newStartLine:o}=s();return p.jsx(Qe,{execution:e,subtitle:i(),showResult:!1,hideToolName:!1,children:p.jsxs("div",{children:[p.jsx(Ve,{label:t("editTool.editFile"),value:r.file_path}),r.replace_all&&p.jsx(Ve,{label:t("editTool.replaceAll"),value:t("editTool.yes")}),p.jsx("div",{className:"mt-3",children:p.jsx(F1,{oldText:r.old_string,newText:r.new_string,oldStartLine:a,newStartLine:o})})]})})},ZR=({execution:e})=>{const{t}=we("components"),r=e.toolInput,n=Array.isArray(r?.edits)?r.edits:[],i=`${r.file_path} - ${t("multiEditTool.batchEdit",{count:n.length})}`;return p.jsx(Qe,{execution:e,showResult:!1,subtitle:i,hideToolName:!1,children:p.jsxs("div",{children:[p.jsx(Ve,{label:t("multiEditTool.filePath"),value:r.file_path}),p.jsxs("div",{className:"mt-3",children:[p.jsx("p",{className:"text-xs font-medium text-gray-600 mb-2",children:t("multiEditTool.batchEdit",{count:n.length})}),p.jsx("div",{className:"space-y-4 max-h-96 overflow-y-auto",children:n.map((s,a)=>p.jsxs("div",{className:"border border-gray-200 rounded-md bg-white",children:[p.jsx("div",{className:"px-3 py-2 bg-gray-50 border-b border-gray-200 rounded-t-md",children:p.jsxs("div",{className:"text-xs font-medium text-gray-600",children:[t("multiEditTool.operation",{number:a+1}),s.replace_all&&p.jsx("span",{className:"ml-2 px-2 py-1 bg-orange-200 text-orange-800 rounded text-xs",children:t("multiEditTool.replaceAll")})]})}),p.jsx("div",{className:"p-3",children:p.jsx(F1,{oldText:s.old_string,newText:s.new_string})})]},a))})]})]})})},Up={".js":"javascript",".jsx":"jsx",".ts":"typescript",".tsx":"tsx",".py":"python",".java":"java",".c":"c",".cpp":"cpp",".cc":"cpp",".cxx":"cpp",".h":"c",".hpp":"cpp",".cs":"csharp",".php":"php",".rb":"ruby",".go":"go",".rs":"rust",".swift":"swift",".kt":"kotlin",".scala":"scala",".sh":"bash",".bash":"bash",".zsh":"bash",".fish":"bash",".ps1":"powershell",".sql":"sql",".html":"html",".htm":"html",".xml":"xml",".css":"css",".scss":"scss",".sass":"sass",".less":"less",".json":"json",".yaml":"yaml",".yml":"yaml",".toml":"toml",".ini":"ini",".cfg":"ini",".conf":"ini",".dockerfile":"dockerfile",".docker":"dockerfile",".vim":"vim",".lua":"lua",".r":"r",".R":"r",".matlab":"matlab",".m":"matlab",".pl":"perl",".pm":"perl",".tex":"latex",".cls":"latex",".sty":"latex",".md":"markdown",".markdown":"markdown",".mdown":"markdown",".mkd":"markdown",".mdx":"markdown",".txt":"text",".log":"text",".gitignore":"text",".gitattributes":"text",".editorconfig":"text",".env":"bash",".env.example":"bash",".env.local":"bash",".env.production":"bash",".env.development":"bash",".csv":"csv"};function JR(e){if(!e)return"text";const t=e.toLowerCase().match(/\.[^.]*$/)?.[0];if(t&&Up[t])return Up[t];const r=e.toLowerCase().split("/").pop()||"";return r.startsWith(".env")?"bash":r==="dockerfile"||r==="dockerfile.dev"||r==="dockerfile.prod"?"dockerfile":r==="makefile"||r==="makefile.am"?"makefile":r==="package.json"||r==="tsconfig.json"||r==="tslint.json"?"json":"text"}const eO=({content:e,filePath:t="",className:r=""})=>{const n=JR(t),i=document.documentElement.classList.contains("dark");return p.jsxs("div",{className:`bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md ${r}`,children:[p.jsx("div",{className:"px-4 py-2 bg-gray-50 dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700 rounded-t-md",children:p.jsxs("div",{className:"text-xs font-medium text-gray-600 dark:text-gray-400",children:["文件内容 (",n,")"]})}),p.jsx("div",{className:"p-4",children:p.jsx(fg,{language:n,style:i?ME:ym,customStyle:{margin:0,background:"transparent",fontSize:"14px"},wrapLines:!0,wrapLongLines:!0,showLineNumbers:!0,lineNumberStyle:{minWidth:"3em",paddingRight:"1em",color:i?"#9ca3af":"#666",borderRight:i?"1px solid #4b5563":"1px solid #ddd",marginRight:"1em"},children:e})})]})},tO=({execution:e})=>{const{t}=we("components"),r=e.toolInput,n=()=>r.file_path?r.file_path.split("/").pop()||r.file_path:void 0;return p.jsx(Qe,{execution:e,subtitle:n(),showResult:!1,hideToolName:!1,children:p.jsxs("div",{children:[p.jsx(Ve,{label:t("writeTool.filePath"),value:r.file_path}),p.jsxs("div",{className:"mt-3",children:[p.jsx(eO,{content:r.content,filePath:r.file_path}),p.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mt-2",children:t("writeTool.fileSize",{size:r.content?.length||0})})]})]})})},rO=({execution:e})=>{const{t}=we("components"),r=e.toolInput;return p.jsx(Qe,{execution:e,hideToolName:!1,children:p.jsxs("div",{children:[p.jsx(Ve,{label:t("notebookReadTool.notebookPath"),value:r.notebook_path}),r.cell_id&&p.jsx(Ve,{label:t("notebookReadTool.cellId"),value:r.cell_id})]})})},nO=({execution:e})=>{const{t}=we("components"),r=e.toolInput;return p.jsx(Qe,{execution:e,hideToolName:!1,children:p.jsxs("div",{children:[p.jsx(Ve,{label:t("notebookEditTool.notebookPath"),value:r.notebook_path}),p.jsxs("div",{className:"flex flex-wrap gap-2 mt-2 mb-3",children:[r.edit_mode&&p.jsx("span",{className:`px-2 py-1 text-xs rounded ${r.edit_mode==="insert"?"bg-green-200 text-green-800":r.edit_mode==="delete"?"bg-red-200 text-red-800":"bg-blue-200 text-blue-800"}`,children:r.edit_mode==="insert"?t("notebookEditTool.insert"):r.edit_mode==="delete"?t("notebookEditTool.delete"):t("notebookEditTool.replace")}),r.cell_type&&p.jsx("span",{className:"px-2 py-1 bg-purple-200 text-purple-800 text-xs rounded",children:r.cell_type==="code"?t("notebookEditTool.code"):t("notebookEditTool.markdown")})]}),r.cell_id&&p.jsx(Ve,{label:t("notebookEditTool.cellId"),value:r.cell_id}),r.edit_mode!=="delete"&&p.jsx(Ve,{label:t("notebookEditTool.newContent"),value:r.new_source&&r.new_source.length>300?r.new_source.substring(0,300)+`
373
+ `+t("notebookEditTool.truncated"):r.new_source||"",isCode:!0})]})})},iO=({execution:e})=>{const{t}=we("components"),r=e.toolInput,n=()=>r.server?`${t("listMcpResourcesTool.server")}: ${r.server}`:t("listMcpResourcesTool.allServers");return p.jsx(Qe,{execution:e,subtitle:n(),hideToolName:!1,children:p.jsxs("div",{className:"space-y-3",children:[p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx(pl,{className:"w-4 h-4 text-blue-500"}),p.jsx("h4",{className:"text-sm font-medium text-gray-700",children:t("listMcpResourcesTool.title")})]}),r.server&&p.jsx(Ve,{label:t("listMcpResourcesTool.serverName"),value:r.server}),e.toolResult&&p.jsxs("div",{className:"mt-3",children:[p.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[p.jsx(kw,{className:"w-4 h-4 text-green-500"}),p.jsx("span",{className:"text-sm font-medium text-gray-700",children:t("listMcpResourcesTool.resources")})]}),p.jsx("div",{className:"bg-gray-50 p-3 rounded-md border border-gray-200",children:p.jsx("pre",{className:"text-sm text-gray-600 whitespace-pre-wrap font-mono",children:e.toolResult})})]}),e.isExecuting&&p.jsxs("div",{className:"flex items-center space-x-2 text-blue-600",children:[p.jsx(pl,{className:"w-4 h-4 animate-pulse"}),p.jsx("span",{className:"text-sm",children:t("listMcpResourcesTool.loading")})]}),e.isError&&p.jsxs("div",{className:"flex items-center space-x-2 text-red-600",children:[p.jsx(pl,{className:"w-4 h-4"}),p.jsx("span",{className:"text-sm",children:t("listMcpResourcesTool.error")})]}),p.jsx("div",{className:"text-xs text-gray-500 mt-2 p-2 bg-blue-50 rounded",children:t("listMcpResourcesTool.description")})]})})},sO=({execution:e})=>{const{t}=we("components"),r=e.toolInput,n=()=>`${r.server}: ${r.uri.split("/").pop()||r.uri}`;return p.jsx(Qe,{execution:e,subtitle:n(),hideToolName:!1,children:p.jsxs("div",{className:"space-y-3",children:[p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx(na,{className:"w-5 h-5 text-indigo-500"}),p.jsx("h4",{className:"text-sm font-medium text-gray-700",children:t("readMcpResourceTool.title")})]}),p.jsxs("div",{className:"flex items-center space-x-2 p-2 bg-indigo-50 rounded border border-indigo-200",children:[p.jsx(na,{className:"w-4 h-4 text-indigo-600"}),p.jsx("span",{className:"text-sm font-medium text-indigo-800",children:r.server})]}),p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center space-x-1 mb-1",children:[p.jsx(ww,{className:"w-3 h-3 text-gray-500"}),p.jsx("span",{className:"text-xs font-medium text-gray-600",children:t("readMcpResourceTool.resourceUri")})]}),p.jsx("div",{className:"bg-gray-50 p-2 rounded border border-gray-200",children:p.jsx("code",{className:"text-xs text-gray-700 font-mono break-all",children:r.uri})})]}),e.toolResult&&p.jsxs("div",{className:"mt-4",children:[p.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[p.jsx(vw,{className:"w-4 h-4 text-green-500"}),p.jsx("span",{className:"text-sm font-medium text-gray-700",children:t("readMcpResourceTool.content")})]}),p.jsx("div",{className:"bg-white p-3 rounded-md border border-gray-200 max-h-96 overflow-y-auto",children:(()=>{try{const i=JSON.parse(e.toolResult);return p.jsx("pre",{className:"text-sm text-gray-700 whitespace-pre-wrap font-mono",children:JSON.stringify(i,null,2)})}catch{return p.jsx("pre",{className:"text-sm text-gray-700 whitespace-pre-wrap",children:e.toolResult})}})()})]}),e.isExecuting&&p.jsxs("div",{className:"flex items-center space-x-2 text-indigo-600",children:[p.jsx(ig,{className:"w-4 h-4 animate-bounce"}),p.jsx("span",{className:"text-sm",children:t("readMcpResourceTool.loading")})]}),e.isError&&p.jsxs("div",{className:"flex items-center space-x-2 text-red-600",children:[p.jsx(na,{className:"w-4 h-4"}),p.jsx("span",{className:"text-sm",children:t("readMcpResourceTool.error")})]}),p.jsx("div",{className:"text-xs text-gray-500 p-2 bg-gray-50 rounded",children:p.jsxs("div",{className:"flex items-start space-x-1",children:[p.jsx(na,{className:"w-3 h-3 mt-0.5 flex-shrink-0"}),p.jsx("span",{children:t("readMcpResourceTool.description")})]})}),e.toolResult&&p.jsx("div",{className:"text-xs text-gray-400 text-right",children:t("readMcpResourceTool.contentSize",{size:new Blob([e.toolResult]).size})})]})})},aO=({execution:e})=>{const{t}=we("components"),r=e.toolInput,n=()=>{const i=r.message_prefix;return i.length>30?`${i.substring(0,30)}...`:i};return p.jsx(Qe,{execution:e,subtitle:n(),hideToolName:!1,children:p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx(Zr,{className:"w-5 h-5 text-purple-500"}),p.jsx("h4",{className:"text-sm font-medium text-gray-700",children:t("timeMachineTool.title")})]}),p.jsx("div",{className:"text-xs text-purple-600 bg-purple-50 p-3 rounded-md border border-purple-200",children:p.jsxs("div",{className:"flex items-start space-x-1",children:[p.jsx(Cw,{className:"w-3 h-3 mt-0.5 flex-shrink-0"}),p.jsx("span",{children:t("timeMachineTool.description")})]})}),p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center space-x-1 mb-1",children:[p.jsx(Sw,{className:"w-3 h-3 text-gray-500"}),p.jsx("span",{className:"text-xs font-medium text-gray-600",children:t("timeMachineTool.targetMessage")})]}),p.jsx("div",{className:"bg-gray-50 p-2 rounded border border-gray-200",children:p.jsxs("p",{className:"text-sm text-gray-700 italic",children:['"',r.message_prefix,'"']})})]}),p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center space-x-1 mb-1",children:[p.jsx(sg,{className:"w-3 h-3 text-green-500"}),p.jsx("span",{className:"text-xs font-medium text-gray-600",children:t("timeMachineTool.correction")})]}),p.jsx("div",{className:"bg-green-50 p-2 rounded border border-green-200",children:p.jsxs("p",{className:"text-sm text-gray-700",children:['"',r.course_correction,'"']})})]}),r.restore_code!==void 0&&p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsxs("span",{className:"text-xs font-medium text-gray-600",children:[t("timeMachineTool.restoreCode"),":"]}),p.jsx("span",{className:`text-xs px-2 py-1 rounded-full ${r.restore_code?"bg-green-100 text-green-800":"bg-gray-100 text-gray-600"}`,children:r.restore_code?t("common.enabled"):t("common.disabled")})]}),e.toolResult&&p.jsxs("div",{className:"mt-3",children:[p.jsx("div",{className:"text-xs font-medium text-gray-600 mb-1",children:t("timeMachineTool.result")}),p.jsx("div",{className:"bg-purple-50 p-3 rounded-md border border-purple-200",children:p.jsx("pre",{className:"text-sm text-gray-700 whitespace-pre-wrap",children:e.toolResult})})]}),e.isExecuting&&p.jsxs("div",{className:"flex items-center space-x-2 text-purple-600",children:[p.jsx(Zr,{className:"w-4 h-4 animate-spin"}),p.jsx("span",{className:"text-sm",children:t("timeMachineTool.rewinding")})]}),e.isError&&p.jsxs("div",{className:"flex items-center space-x-2 text-red-600",children:[p.jsx(Zr,{className:"w-4 h-4"}),p.jsx("span",{className:"text-sm",children:t("timeMachineTool.error")})]})]})})},$r="__TYPE_SOMETHING__",Vp=({execution:e,onSubmit:t})=>{const{t:r}=we("components"),n=e.toolInput,i=Xe(w=>w.pendingUserQuestion);if(!n||!n.questions||!Array.isArray(n.questions))return p.jsx(Qe,{execution:e,hideToolName:!1,overrideToolName:r("askUserQuestionTool.title"),children:p.jsx("div",{className:"text-red-600 text-sm",children:r("askUserQuestionTool.invalidInput","Invalid question input")})});const[s,a]=O.useState(new Map),[o,l]=O.useState(!1),[c,u]=O.useState(new Map),h=O.useRef(new Map),f=O.useMemo(()=>{if(!i||!e.toolInput)return!1;const w=e.toolInput.questions,T=i.questions;return!!(w&&T&&w.length===T.length&&w[0]?.question===T[0]?.question)},[i,e]),d=f&&!e.toolResult&&!o,g=O.useMemo(()=>{if(!e.toolResult)return null;const w=String(e.toolResult),T=w.match(/^User response:\s*(.+)$/s);return T?T[1].trim():w.trim()},[e.toolResult]),m=O.useCallback((w,T,$)=>{d&&(a(M=>{const E=new Map(M),N=E.get(w)||[];if($)if(N.includes(T))E.set(w,N.filter(D=>D!==T));else{const D=N.filter(R=>R!==$r);E.set(w,[...D,T])}else E.set(w,[T]);return E}),T!==$r&&u(M=>{const E=new Map(M);return E.delete(w),E}))},[d]),b=O.useCallback((w,T)=>{d&&(a($=>{const M=new Map($),E=M.get(w)||[];return T?E.includes($r)?M.set(w,E.filter(N=>N!==$r)):M.set(w,[...E,$r]):M.set(w,[$r]),M}),setTimeout(()=>{const $=h.current.get(w);$&&$.focus()},100))},[d]),y=O.useCallback((w,T)=>{u($=>{const M=new Map($);return M.set(w,T),M})},[]),k=O.useMemo(()=>{if(!d)return!1;for(let w=0;w<n.questions.length;w++){const T=s.get(w)||[];if(T.length===0)return!1;if(T.includes($r)){const $=c.get(w)||"";if(T.length===1&&!$.trim())return!1}}return!0},[d,n.questions.length,s,c]),v=O.useCallback(()=>{const w=[];return n.questions.forEach((T,$)=>{const M=s.get($)||[];if(M.length>0){const E=[];M.forEach(N=>{if(N===$r){const D=c.get($)||"";D.trim()&&E.push(D.trim())}else E.push(N)}),E.length>0&&(n.questions.length===1?w.push(E.join(", ")):w.push(`Q${$+1}: ${E.join(", ")}`))}}),w.join(`
374
+ `)},[n.questions,s,c]),C=O.useCallback(async()=>{if(!(!k||!t||!i)){l(!0);try{const w=v();console.log("🎤 [AskUserQuestion] Submitting response:",w),await t(i.toolUseId,w)}catch(w){console.error("🎤 [AskUserQuestion] Failed to submit response:",w)}finally{l(!1)}}},[k,t,i,v]),S=()=>{const w=n.questions,T=w.length,$=w[0],M=$.header||($.question.length>30?$.question.substring(0,30)+"...":$.question);return T===1?M:`${M} (+${T-1})`};return p.jsx(Qe,{execution:e,subtitle:S(),defaultExpanded:!0,showResult:!1,hideToolName:!1,overrideToolName:r("askUserQuestionTool.title"),customIcon:p.jsx(wa,{className:"w-4 h-4 text-blue-500"}),children:p.jsxs("div",{className:"space-y-4",children:[p.jsx("div",{className:"space-y-4",children:n.questions.map((w,T)=>{const $=s.get(T)||[];return p.jsxs("div",{className:"border border-gray-200 rounded-lg p-3 bg-white",children:[p.jsx("div",{className:"flex items-center justify-between mb-2",children:p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsxs("span",{className:"text-sm font-medium text-gray-700",children:["Q",T+1]}),w.header&&p.jsx("span",{className:"text-xs px-2 py-1 bg-blue-100 text-blue-800 rounded-full",children:w.header}),w.multiSelect&&p.jsx("span",{className:"text-xs px-2 py-1 bg-purple-100 text-purple-800 rounded-full",children:r("askUserQuestionTool.multiSelect")})]})}),p.jsx("div",{className:"mb-3",children:p.jsx("p",{className:"text-sm text-gray-800 font-medium",children:w.question})}),p.jsxs("div",{className:"space-y-2",children:[w.options.map((M,E)=>{const N=$.includes(M.label),D=d;return p.jsxs("div",{onClick:()=>m(T,M.label,w.multiSelect||!1),className:`
375
+ flex items-start space-x-2 p-2 rounded border transition-all
376
+ ${D?"cursor-pointer":"cursor-default"}
377
+ ${N?"border-blue-500 bg-blue-50 ring-1 ring-blue-500":"border-gray-100 hover:bg-gray-50"}
378
+ ${!D&&!N?"opacity-60":""}
379
+ `,children:[w.multiSelect?p.jsx(Gp,{className:`w-4 h-4 mt-0.5 ${N?"text-blue-500":"text-gray-400"}`,checked:N}):N?p.jsx(Jr,{className:"w-4 h-4 mt-0.5 text-blue-500"}):p.jsx(id,{className:"w-4 h-4 mt-0.5 text-gray-400"}),p.jsxs("div",{className:"flex-1",children:[p.jsx("div",{className:`text-sm font-medium ${N?"text-blue-700":"text-gray-700"}`,children:M.label}),M.description&&p.jsx("div",{className:"text-xs text-gray-500 mt-1",children:M.description})]})]},E)}),(()=>{const M=$.includes($r),E=d,N=c.get(T)||"",D=g&&!w.options.some(R=>R.label===g);return e.toolResult&&D?p.jsxs("div",{className:"flex items-start space-x-2 p-2 rounded border border-green-500 bg-green-50 ring-1 ring-green-500",children:[p.jsx(Jr,{className:"w-4 h-4 mt-0.5 text-green-500"}),p.jsxs("div",{className:"flex-1 flex items-center space-x-2",children:[p.jsx(sd,{className:"w-4 h-4 text-green-600"}),p.jsxs("span",{className:"text-sm font-medium text-green-700",children:[r("askUserQuestionTool.typeSomething")," ",g]})]})]}):p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{onClick:()=>b(T,w.multiSelect||!1),className:`
380
+ flex items-start space-x-2 p-2 rounded border transition-all
381
+ ${E?"cursor-pointer":"cursor-default"}
382
+ ${M?"border-blue-500 bg-blue-50 ring-1 ring-blue-500":"border-gray-100 border-dashed hover:bg-gray-50"}
383
+ ${!E&&!M?"opacity-60":""}
384
+ `,children:[w.multiSelect?p.jsx(Gp,{className:`w-4 h-4 mt-0.5 ${M?"text-blue-500":"text-gray-400"}`,checked:M}):M?p.jsx(Jr,{className:"w-4 h-4 mt-0.5 text-blue-500"}):p.jsx(id,{className:"w-4 h-4 mt-0.5 text-gray-400"}),p.jsxs("div",{className:"flex-1 flex items-center space-x-2",children:[p.jsx(sd,{className:`w-4 h-4 ${M?"text-blue-500":"text-gray-400"}`}),p.jsx("div",{className:`text-sm font-medium ${M?"text-blue-700":"text-gray-500"}`,children:r("askUserQuestionTool.typeSomething")})]})]}),M&&d&&p.jsx("div",{className:"ml-6",children:p.jsx("input",{ref:R=>{h.current.set(T,R)},type:"text",value:N,onChange:R=>y(T,R.target.value),placeholder:r("askUserQuestionTool.typeSomethingPlaceholder"),className:"w-full px-3 py-2 text-sm border border-blue-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white",onKeyDown:R=>{R.key==="Enter"&&k&&(R.preventDefault(),C())}})})]})})()]})]},T)})}),d&&p.jsx("div",{className:"flex justify-end pt-2",children:p.jsx("button",{onClick:C,disabled:!k||o,className:`
385
+ flex items-center space-x-2 px-4 py-2 rounded-lg text-sm font-medium transition-all
386
+ ${k&&!o?"bg-blue-500 text-white hover:bg-blue-600 shadow-sm":"bg-gray-200 text-gray-400 cursor-not-allowed"}
387
+ `,children:o?p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"}),p.jsx("span",{children:r("askUserQuestionTool.submitting")})]}):p.jsxs(p.Fragment,{children:[p.jsx(Eu,{className:"w-4 h-4"}),p.jsx("span",{children:r("askUserQuestionTool.submit")})]})})}),e.toolResult&&p.jsxs("div",{className:"flex items-center space-x-2 text-green-600 py-2",children:[p.jsx(tg,{className:"w-4 h-4"}),p.jsx("span",{className:"text-sm font-medium",children:r("askUserQuestionTool.completed")})]}),e.isExecuting&&!f&&p.jsxs("div",{className:"flex items-center space-x-2 text-blue-600 py-2",children:[p.jsx(wa,{className:"w-4 h-4 animate-pulse"}),p.jsx("span",{className:"text-sm",children:r("askUserQuestionTool.waitingForResponse")})]}),e.isError&&p.jsxs("div",{className:"flex items-center space-x-2 text-red-600 py-2",children:[p.jsx(wa,{className:"w-4 h-4"}),p.jsx("span",{className:"text-sm",children:r("askUserQuestionTool.error")})]})]})})},Gp=({className:e,checked:t})=>p.jsxs("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[p.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2",strokeWidth:"2"}),t&&p.jsx("path",{d:"M9 12l2 2 4-4",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),oO=({execution:e})=>{const{t}=we("components"),r=e.toolInput;return p.jsxs(Qe,{execution:e,hideToolName:!1,subtitle:r.url,children:[p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[p.jsx("span",{className:"text-xs font-medium text-gray-600",children:t("webFetchTool.urlLabel")}),p.jsx("a",{href:r.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 text-sm underline break-all",children:r.url})]}),p.jsx(Ve,{label:t("webFetchTool.analysisPromptLabel"),value:r.prompt&&r.prompt.length>200?r.prompt.substring(0,200)+`
388
+ `+t("webFetchTool.truncated"):r.prompt||"",isCode:!0})]}),e.toolResult&&!e.isError&&p.jsxs("div",{className:"mt-3",children:[p.jsx("p",{className:"text-xs font-medium text-gray-600 mb-2",children:t("webFetchTool.webAnalysisResult")}),p.jsx("div",{className:"p-3 rounded-md border bg-teal-50 border-teal-200 text-sm whitespace-pre-wrap break-words text-teal-800",children:e.toolResult})]})]})},lO=({execution:e})=>{const{t}=we("components"),r=e.toolInput,n=Array.isArray(r?.allowed_domains)?r.allowed_domains:[],i=Array.isArray(r?.blocked_domains)?r.blocked_domains:[],s=()=>{if(r.query)return`${r.query}`};return p.jsxs(Qe,{execution:e,subtitle:s(),showResult:!1,hideToolName:!1,children:[p.jsxs("div",{children:[p.jsx(Ve,{label:t("webSearchTool.searchQueryLabel"),value:r.query}),(n.length>0||i.length>0)&&p.jsxs("div",{className:"mt-2 space-y-1",children:[n.length>0&&p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p.jsx("span",{className:"text-xs font-medium text-green-600",children:t("webSearchTool.allowedDomains")}),n.map((a,o)=>p.jsx("span",{className:"px-2 py-1 bg-green-100 text-green-700 text-xs rounded",children:a},o))]}),i.length>0&&p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p.jsx("span",{className:"text-xs font-medium text-red-600",children:t("webSearchTool.blockedDomains")}),i.map((a,o)=>p.jsx("span",{className:"px-2 py-1 bg-red-100 text-red-700 text-xs rounded",children:a},o))]})]})]}),e.toolResult&&!e.isError&&p.jsxs("div",{className:"mt-3",children:[p.jsx("p",{className:"text-xs font-medium text-gray-600 mb-2",children:t("webSearchTool.searchResults")}),p.jsx("div",{className:"p-3 rounded-md border bg-sky-50 border-sky-200 text-sm whitespace-pre-wrap break-words text-sky-800",children:e.toolResult})]})]})};function R1(e){const t=e.split("__");return t.length!==3||t[0]!=="mcp"?null:{toolId:e,prefix:t[0],serverName:t[1],toolName:t[2]}}function cO(e){return e.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function uO(e){try{const t=JSON.parse(e);return Array.isArray(t)?{content:t}:t&&typeof t=="object"&&("content"in t||"isError"in t)?t:{content:{type:"text",text:e}}}catch{return{content:{type:"text",text:e}}}}const hO=({content:e})=>{switch(e.type){case"text":return p.jsx("div",{className:"p-3 rounded-md border bg-green-50 border-green-200",children:p.jsx("pre",{className:"text-sm font-mono text-green-700 whitespace-pre-wrap break-words",children:e.text})});case"image":{const{t:r}=we("components"),n=e;return p.jsxs("div",{className:"p-3 rounded-md border bg-blue-50 border-blue-200",children:[p.jsx("div",{className:"text-xs font-medium text-blue-600 mb-2",children:r("mcpTool.image",{mimeType:n.mimeType})}),p.jsx("img",{src:`data:${n.mimeType};base64,${n.data}`,alt:"MCP Tool Result",className:"max-w-full h-auto rounded border shadow-sm",style:{maxHeight:"400px"}})]})}case"resource":{const{t:r}=we("components"),n=e;return p.jsxs("div",{className:"p-3 rounded-md border bg-purple-50 border-purple-200",children:[p.jsx("div",{className:"text-xs font-medium text-purple-600 mb-2",children:r("mcpTool.resource")}),p.jsxs("div",{className:"text-sm text-purple-700 space-y-1",children:[p.jsxs("div",{children:[p.jsxs("span",{className:"font-medium",children:[r("mcpTool.uri"),":"]})," ",n.resource.uri]}),n.resource.name&&p.jsxs("div",{children:[p.jsxs("span",{className:"font-medium",children:[r("mcpTool.name"),":"]})," ",n.resource.name]}),n.resource.description&&p.jsxs("div",{children:[p.jsxs("span",{className:"font-medium",children:[r("mcpTool.description"),":"]})," ",n.resource.description]}),n.resource.mimeType&&p.jsxs("div",{children:[p.jsxs("span",{className:"font-medium",children:[r("mcpTool.type"),":"]})," ",n.resource.mimeType]})]})]})}default:const{t}=we("components");return p.jsxs("div",{className:"p-3 rounded-md border bg-gray-50 border-gray-200",children:[p.jsx("div",{className:"text-xs font-medium text-gray-600 mb-2",children:t("mcpTool.unknownType",{type:e.type})}),p.jsx("pre",{className:"text-sm font-mono text-gray-700 whitespace-pre-wrap break-words",children:JSON.stringify(e,null,2)})]})}},dO=({result:e,isError:t})=>{const{t:r}=we("components");if(!e)return null;if(t)return p.jsxs("div",{className:"mt-3",children:[p.jsx("p",{className:"text-xs font-medium text-gray-600 mb-2",children:r("mcpTool.errorMessage")}),p.jsx("div",{className:"p-3 rounded-md border bg-red-50 border-red-200 text-red-700 text-sm font-mono whitespace-pre-wrap break-words",children:e})]});const n=uO(e);if(!n||!n.content)return p.jsxs("div",{className:"mt-3",children:[p.jsx("p",{className:"text-xs font-medium text-gray-600 mb-2",children:r("mcpTool.executionResult")}),p.jsx("div",{className:"p-3 rounded-md border bg-green-50 border-green-200 text-green-700 text-sm font-mono whitespace-pre-wrap break-words",children:e})]});const i=Array.isArray(n.content)?n.content:[n.content];return p.jsxs("div",{className:"mt-3",children:[p.jsx("p",{className:"text-xs font-medium text-gray-600 mb-2",children:r("mcpTool.executionResult")}),n._meta?.progress!==void 0&&n._meta?.progressTotal&&p.jsxs("div",{className:"mb-3 p-2 bg-blue-50 border border-blue-200 rounded text-sm",children:[p.jsx("div",{className:"text-blue-700 mb-1",children:r("mcpTool.progress",{current:n._meta.progress,total:n._meta.progressTotal})}),p.jsx("div",{className:"w-full bg-blue-200 rounded-full h-2",children:p.jsx("div",{className:"bg-blue-600 h-2 rounded-full transition-all duration-300",style:{width:`${n._meta.progress/n._meta.progressTotal*100}%`}})})]}),p.jsx("div",{className:"space-y-3",children:i.map((s,a)=>p.jsx(hO,{content:s},a))})]})},fO=({execution:e})=>{const{t}=we("components"),r=R1(e.toolName);if(!r)return p.jsx(Qe,{execution:e});const{serverName:n,toolName:i}=r,s=cO(i),a={...e,toolName:s},o=t("mcpTool.subtitle",{toolName:i,serverName:n});return p.jsx(Qe,{execution:a,subtitle:o,showResult:!1,isMcpTool:!0,hideToolName:!1,children:p.jsxs("div",{className:"space-y-3",children:[p.jsx(Ve,{label:t("mcpTool.parameters"),value:e.toolInput,isCode:!0}),e.toolResult&&p.jsx(dO,{result:e.toolResult,isError:e.isError})]})})},pO=e=>e.filter(t=>t.kind==="text"&&!!t.text).map(t=>t.text).join(""),Yp=e=>{if(typeof e=="string")return e;if(typeof e=="object"&&e!==null)return e.response},gO=e=>{if(!e||typeof e!="string")return"Unknown Agent";try{const r=new URL(e).hostname;if(/^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$/.test(r))return r;const i=r.split(".");return i.length>=2?i[0]:r}catch{const t=e.match(/\/([^/]+)$/);return t?t[1]:e}},O1=({execution:e})=>{const{t}=we(),r=e.toolInput;let n;if(e.toolResult)if(e.isError===!0)n={success:!1,error:e.toolResult};else{const R=e.toolResult;let I;const F=R.match(/\[System\] Session ID: ([a-f0-9-]+)/);F&&(I=F[1]);try{const L=JSON.parse(R);typeof L=="object"&&L!==null?n={success:L.success!==!1,data:L.data||L.response||R,sessionId:L.sessionId||I,contextId:L.contextId,taskId:L.taskId,error:L.error}:n={success:!0,data:R,sessionId:I}}catch{n={success:!0,data:R,sessionId:I}}}const i=r.agentName||gO(r.agentUrl),s=!n&&!e.toolResult,a=n?.status==="running"||n?.status==="pending",o=n?.success===!0||!!n?.data&&!n?.error,l=n?.success===!1||!!n?.error,c=(D,R)=>D?R==="working"?{icon:p.jsx(va,{className:"w-4 h-4 animate-spin"}),className:"bg-blue-100 text-blue-800 border-blue-200 dark:bg-blue-900/30 dark:text-blue-300 dark:border-blue-800",text:t("tools.a2a.working","Working")}:R==="input-required"?{icon:p.jsx(nc,{className:"w-4 h-4"}),className:"bg-yellow-100 text-yellow-800 border-yellow-200 dark:bg-yellow-900/30 dark:text-yellow-300 dark:border-yellow-800",text:t("tools.a2a.inputRequired","Input Required")}:{icon:p.jsx(va,{className:"w-4 h-4 animate-spin"}),className:"bg-purple-100 text-purple-800 border-purple-200 dark:bg-purple-900/30 dark:text-purple-300 dark:border-purple-800",text:t("tools.a2a.streaming","Streaming...")}:s||a?{icon:p.jsx(va,{className:"w-4 h-4 animate-spin"}),className:"bg-blue-100 text-blue-800 border-blue-200 dark:bg-blue-900/30 dark:text-blue-300 dark:border-blue-800",text:a?t("tools.a2a.running","Running"):t("tools.a2a.calling","Calling")}:R==="completed"||o&&!l?{icon:p.jsx(Jr,{className:"w-4 h-4"}),className:"bg-green-100 text-green-800 border-green-200 dark:bg-green-900/30 dark:text-green-300 dark:border-green-800",text:t("tools.a2a.success","Success")}:R==="failed"||R==="rejected"||l&&!o?{icon:p.jsx(Ca,{className:"w-4 h-4"}),className:"bg-red-100 text-red-800 border-red-200 dark:bg-red-900/30 dark:text-red-300 dark:border-red-800",text:t("tools.a2a.error","Failed")}:R==="canceled"?{icon:p.jsx(Ca,{className:"w-4 h-4"}),className:"bg-gray-100 text-gray-800 border-gray-200 dark:bg-gray-800/30 dark:text-gray-300 dark:border-gray-700",text:t("tools.a2a.canceled","Canceled")}:n?{icon:p.jsx(Jr,{className:"w-4 h-4"}),className:"bg-green-100 text-green-800 border-green-200 dark:bg-green-900/30 dark:text-green-300 dark:border-green-800",text:t("tools.a2a.success","Success")}:{icon:p.jsx(Ca,{className:"w-4 h-4"}),className:"bg-red-100 text-red-800 border-red-200 dark:bg-red-900/30 dark:text-red-300 dark:border-red-800",text:t("tools.a2a.error","Failed")},u=(D,R)=>{let I=i;return r.useTask&&(I+=` • ${t("tools.a2a.asyncTask","Async Task")}`),R?I+=` • ${R}`:D?I+=` • ${t("tools.a2a.streaming","Streaming...")}`:s?I+=` • ${t("tools.a2a.calling","Calling...")}`:a?I+=` • ${t("tools.a2a.running","Running...")}`:l&&!o?I+=` • ${t("tools.a2a.error","Failed")}`:(o||n)&&(I+=` • ${t("tools.a2a.success","Success")}`),I},[h]=hg(),f=h.get("project"),[d,g]=mr.useState([]),[m]=mr.useState([]),[b,y]=mr.useState(!1),[k,v]=mr.useState(!1),[C]=mr.useState(),S=Xe(D=>D.activeA2AStreams[r.agentUrl]),w=S?.sessionId||n?.sessionId||r.sessionId;mr.useEffect(()=>{S?.isStreaming===!0?(v(!0),y(!0)):S&&S.isStreaming===!1&&v(!1)},[S?.isStreaming]),mr.useEffect(()=>{(n?.error||e.isError)&&v(!1)},[n?.error,e.isError]),mr.useEffect(()=>{if(!S?.events||S.events.length===0)return;const D=[];let R=null;const I=new Map;for(const F of S.events)if(F.type==="system")R={id:`sys-${Date.now()}-${Math.random()}`,role:"assistant",timestamp:new Date().toISOString(),messageParts:[{id:`sys-part-${Date.now()}`,type:"text",content:`[System] Session ID: ${F.sessionId||"N/A"}`,order:0}]},D.push(R);else if(F.type==="assistant"&&F.message?.content){R={id:`assistant-${Date.now()}-${Math.random()}`,role:"assistant",timestamp:new Date().toISOString(),messageParts:[]},D.push(R);for(const L of F.message.content)if(L.type==="text")R.messageParts.push({id:`text-${Date.now()}-${Math.random()}`,type:"text",content:L.text||"",order:R.messageParts.length});else if(L.type==="tool_use"){const B=L.id||`tool-${Date.now()}`,H={id:B,type:"tool",toolData:{id:B,toolName:L.name||"unknown",toolInput:L.input||{},toolResult:void 0,isError:!1},order:R.messageParts.length};R.messageParts.push(H),L.id&&I.set(L.id,H)}}else if(F.type==="user"&&F.message?.content){for(const L of F.message.content)if(L.type==="tool_result"&&L.tool_use_id){const B=I.get(L.tool_use_id);B&&B.toolData&&(B.toolData.toolResult=typeof L.content=="string"?L.content:JSON.stringify(L.content),B.toolData.isError=L.is_error||!1)}}D.length>0&&g(D)},[S?.events]);const{currentService:T}=jw(),{getToken:$}=nw(),M=T?$(T.id)?.token:null;mr.useEffect(()=>{if(!w||!f)return;(async()=>{try{const I=`/api/a2a/history/${encodeURIComponent(f)}/${w}`,F=await fetch(I,{headers:M?{Authorization:`Bearer ${M}`}:{}});if(!F.ok){console.error("Failed to fetch A2A history:",F.status);return}const{history:L}=await F.json();y(!0),L&&Array.isArray(L)&&E(L),v(!1)}catch(R){console.error("Error fetching A2A history:",R),y(!1),v(!1)}})()},[w,f,M]);const E=D=>{const R=[];let I=null;const F=new Map;for(const L of D)if(L.type==="system")(!I||I.role!=="assistant")&&(I={id:`sys-${Date.now()}`,role:"assistant",timestamp:new Date().toISOString(),messageParts:[]},R.push(I)),I.messageParts.push({id:`sys-part-${Date.now()}`,type:"text",content:`[System] Session ID: ${L.sessionId||"N/A"}`,order:I.messageParts.length});else if(L.type==="assistant"&&L.message?.content){(!I||I.role!=="assistant")&&(I={id:L.sessionId||`assistant-${Date.now()}`,role:"assistant",timestamp:new Date().toISOString(),messageParts:[]},R.push(I));for(const B of L.message.content)if(B.type==="text")I.messageParts.push({id:`text-${Date.now()}-${Math.random()}`,type:"text",content:B.text,order:I.messageParts.length});else if(B.type==="tool_use"){const H={id:B.id||`tool-${Date.now()}`,type:"tool",toolData:{id:B.id,toolName:B.name,toolInput:B.input,toolResult:void 0,isError:!1},order:I.messageParts.length};I.messageParts.push(H),B.id&&F.set(B.id,H)}}else if(L.type==="user"&&L.message?.content){for(const B of L.message.content)if(B.type==="tool_result"&&B.tool_use_id){const H=F.get(B.tool_use_id);H&&H.toolData&&(H.toolData.toolResult=typeof B.content=="string"?B.content:JSON.stringify(B.content),H.toolData.isError=B.is_error||!1)}}g(R)},N=c(k,C);return p.jsx(Qe,{execution:e,subtitle:u(k,C),showResult:!1,isMcpTool:!0,hideToolName:!1,customIcon:p.jsx(ad,{className:"w-4 h-4 text-purple-600 dark:text-purple-400"}),overrideToolName:"call_external_agent",children:p.jsxs("div",{className:"space-y-3",children:[p.jsxs("div",{className:"bg-gray-50 dark:bg-gray-800/50 rounded-lg p-4 space-y-3",children:[p.jsxs("div",{className:`inline-flex items-center gap-2 px-3 py-1 rounded-full border text-sm font-medium ${N.className}`,children:[N.icon,N.text]}),p.jsxs("div",{className:"bg-white dark:bg-gray-900 border dark:border-gray-700 rounded px-3 py-2 text-sm font-mono text-gray-800 dark:text-gray-200",children:[p.jsx("span",{className:"text-gray-500 dark:text-gray-400 mr-2",children:"Agent:"}),p.jsx("span",{className:"break-all",children:r.agentUrl})]}),p.jsxs("div",{className:"bg-white dark:bg-gray-900 border dark:border-gray-700 rounded px-3 py-2 text-sm text-gray-800 dark:text-gray-200",children:[p.jsx("span",{className:"text-gray-500 dark:text-gray-400 mr-2 block mb-1",children:"Message:"}),p.jsx("div",{className:"whitespace-pre-wrap",children:r.message})]})]}),b&&p.jsxs("div",{className:"flex items-center gap-2 text-sm text-purple-600 dark:text-purple-400",children:[p.jsxs("div",{className:"relative",children:[p.jsx("div",{className:"w-2 h-2 bg-purple-500 rounded-full animate-pulse"}),k&&p.jsx("div",{className:"absolute inset-0 w-2 h-2 bg-purple-500 rounded-full animate-ping"})]}),p.jsx("span",{children:k?C?`${t("tools.a2a.taskState","Task state")}: ${C}`:t("tools.a2a.liveStreaming","Live streaming from external agent..."):t("tools.a2a.connected","Connected to history stream")})]}),d.length>0&&p.jsx(P1,{taskPrompt:r.message,messageFlow:d,defaultExpanded:!0}),m.length>0&&p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-gray-700 dark:text-gray-300",children:[p.jsx(_w,{className:"w-4 h-4"}),t("tools.a2a.artifacts","Artifacts")," (",m.length,")"]}),p.jsx("div",{className:"space-y-2",children:m.map(D=>p.jsxs("div",{className:"bg-white dark:bg-gray-900 border dark:border-gray-700 rounded-lg p-3",children:[p.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-gray-800 dark:text-gray-200 mb-2",children:[p.jsx(ag,{className:"w-4 h-4 text-blue-500"}),D.name||D.artifactId]}),D.description&&p.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2",children:D.description}),p.jsx("pre",{className:"text-xs bg-gray-50 dark:bg-gray-800 rounded p-2 overflow-x-auto",children:pO(D.parts)||JSON.stringify(D.parts,null,2)})]},D.artifactId))})]}),n&&!d.length&&p.jsxs(p.Fragment,{children:[Yp(n.data)&&p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[p.jsx(ad,{className:"w-4 h-4"}),t("tools.a2a.response","Response")]}),p.jsx("pre",{className:"bg-gray-900 text-green-400 rounded-lg px-3 py-2 text-sm font-mono overflow-x-auto whitespace-pre-wrap border dark:border-gray-700",children:Yp(n.data)})]}),n.error&&p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-red-700 dark:text-red-400 mb-2",children:[p.jsx(nc,{className:"w-4 h-4"}),t("tools.a2a.error","Error")]}),p.jsx("pre",{className:"bg-red-50 dark:bg-red-900/20 text-red-800 dark:text-red-300 border border-red-200 dark:border-red-800 rounded-lg px-3 py-2 text-sm font-mono overflow-x-auto whitespace-pre-wrap",children:n.error})]}),(n.taskId||n.contextId||typeof n.data=="object"&&n.data?.metadata)&&p.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 pt-2 border-t border-gray-200 dark:border-gray-700 space-y-1",children:[n.taskId&&p.jsxs("div",{children:["Task ID: ",n.taskId]}),n.contextId&&p.jsxs("div",{children:["Context ID: ",n.contextId]}),typeof n.data=="object"&&n.data?.metadata&&p.jsxs("div",{children:["Metadata: ",JSON.stringify(n.data.metadata)]})]})]})]})})},mO=({execution:e})=>{const{t}=we("components"),n=e.toolInput?.skill||t("skillTool.unknownSkill"),i=e.toolUseResult,s=i?.commandName,a=()=>s&&s!==n?`${n} → ${s}`:n,o=p.jsx(od,{className:"w-4 h-4"});return p.jsx(Qe,{execution:e,subtitle:a(),customIcon:o,overrideToolName:t("skillTool.toolName"),hideToolName:!1,children:p.jsxs("div",{className:"space-y-3",children:[p.jsxs("div",{children:[p.jsx("span",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 block mb-1",children:t("skillTool.skillName")}),p.jsx("span",{className:"text-sm px-2 py-1 bg-gradient-to-r from-purple-100 to-pink-100 dark:from-purple-900/30 dark:to-pink-900/30 text-purple-800 dark:text-purple-300 rounded font-medium",children:n})]}),s&&s!==n&&p.jsxs("div",{children:[p.jsx("span",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 block mb-1",children:t("skillTool.commandName")}),p.jsx("span",{className:"text-sm px-2 py-1 bg-blue-100 dark:bg-blue-900/30 text-blue-800 dark:text-blue-300 rounded font-mono",children:s})]}),e.isExecuting&&p.jsxs("div",{className:"flex items-center space-x-2 text-purple-600 dark:text-purple-400",children:[p.jsx("div",{className:"w-4 h-4 border-2 border-purple-600 dark:border-purple-400 border-t-transparent rounded-full animate-spin"}),p.jsx("span",{className:"text-sm",children:t("skillTool.loading")})]}),!e.isExecuting&&i?.success&&p.jsxs("div",{className:"flex items-center space-x-2 text-green-600 dark:text-green-400",children:[p.jsx(od,{className:"w-4 h-4"}),p.jsx("span",{className:"text-sm",children:t("skillTool.launched")})]})]})})},xO={"a2a-client__call_external_agent":O1},z1=({execution:e,onAskUserQuestionSubmit:t})=>{const{t:r}=we("components"),n=R1(e.toolName);if(n){if(n.serverName==="ask-user-question"&&n.toolName==="ask_user_question")return p.jsx(Vp,{execution:e,onSubmit:t});const i=`${n.serverName}__${n.toolName}`,s=xO[i];return s?p.jsx(s,{execution:e}):p.jsx(fO,{execution:e})}switch(e.toolName){case"Task":return p.jsx(NR,{execution:e});case"Bash":return p.jsx(LR,{execution:e});case"BashOutput":return p.jsx(mw,{execution:e});case"KillBash":return p.jsx(gw,{execution:e});case"Glob":return p.jsx(IR,{execution:e});case"Grep":return p.jsx($R,{execution:e});case"LS":return p.jsx(jR,{execution:e});case"exit_plan_mode":return p.jsx(BR,{execution:e});case"Read":return p.jsx(DR,{execution:e});case"Edit":return p.jsx(KR,{execution:e});case"MultiEdit":return p.jsx(ZR,{execution:e});case"Write":return p.jsx(tO,{execution:e});case"NotebookRead":return p.jsx(rO,{execution:e});case"NotebookEdit":return p.jsx(nO,{execution:e});case"ListMcpResources":return p.jsx(iO,{execution:e});case"ReadMcpResource":return p.jsx(sO,{execution:e});case"TimeMachine":return p.jsx(aO,{execution:e});case"AskUserQuestion":return p.jsx(Vp,{execution:e,onSubmit:t});case"WebFetch":return p.jsx(oO,{execution:e});case"TodoWrite":return p.jsx(pw,{execution:e});case"WebSearch":return p.jsx(lO,{execution:e});case"call_external_agent":return p.jsx(O1,{execution:e});case"Skill":return p.jsx(mO,{execution:e});default:return p.jsx(Qe,{execution:e,children:p.jsxs("div",{children:[p.jsx("p",{className:"text-sm text-gray-600 mb-2",children:r("toolRenderer.unknownToolType")}),p.jsx("div",{className:"text-xs text-gray-500 bg-gray-100 p-2 rounded font-mono",children:JSON.stringify(e.toolInput,null,2)})]})})}},yO=e=>({id:`tool_${Date.now()}_${Math.random()}`,toolName:e.toolName,toolInput:e.toolInput,toolResult:e.toolResult,toolUseResult:e.toolUseResult,isExecuting:e.isExecuting||!1,isError:e.isError||!1,timestamp:new Date,claudeId:e.claudeId}),Xp=e=>{const t=yO(e);return p.jsx(z1,{execution:t,onAskUserQuestionSubmit:e.onAskUserQuestionSubmit})},Mo=({images:e,initialIndex:t=0,onClose:r})=>{const[n,i]=O.useState(()=>!e||e.length===0?0:Math.min(t,e.length-1)),[s,a]=O.useState(1),[o,l]=O.useState({x:0,y:0}),[c,u]=O.useState(!1),[h,f]=O.useState({x:0,y:0}),[d,g]=O.useState(0),[m,b]=O.useState(!1),y=O.useRef(null),k=O.useRef(null),v=()=>{if(!y.current||!k.current)return 1;const L=y.current,B=k.current,H=L.naturalWidth,Q=L.naturalHeight,_=B.clientWidth,j=B.clientHeight-120,te=_/H,A=j/Q;return Math.min(te,A,1)},C=()=>{b(!0);const L=v();a(L),l({x:0,y:0})},S=e&&e.length>0?e[n]:"",w=()=>{e&&n>0&&i(n-1)},T=()=>{e&&n<e.length-1&&i(n+1)};O.useEffect(()=>{if(e&&e.length>0){const L=Math.min(t,e.length-1);i(L)}},[e,t]),O.useEffect(()=>{S&&(a(1),l({x:0,y:0}),g(0),u(!1),b(!1))},[S]),O.useEffect(()=>{if(!S)return;const L=B=>{switch(B.key){case"Escape":r();break;case"ArrowLeft":B.preventDefault(),w();break;case"ArrowRight":B.preventDefault(),T();break;case"ArrowUp":B.preventDefault(),w();break;case"ArrowDown":B.preventDefault(),T();break;case"=":case"+":(B.ctrlKey||B.metaKey)&&(B.preventDefault(),$("in"));break;case"-":(B.ctrlKey||B.metaKey)&&(B.preventDefault(),$("out"));break;case"0":(B.ctrlKey||B.metaKey)&&(B.preventDefault(),F());break;case"r":case"R":(B.ctrlKey||B.metaKey)&&(B.preventDefault(),M());break}};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[S,n,e?.length]);const $=L=>{a(B=>{const H=L==="in"?B*1.2:B/1.2;return Math.max(.1,Math.min(5,H))})},M=()=>{g(L=>(L+90)%360)},E=L=>{L.target===y.current&&(u(!0),f({x:L.clientX-o.x,y:L.clientY-o.y}))},N=L=>{c&&l({x:L.clientX-h.x,y:L.clientY-h.y})},D=()=>{u(!1)},R=L=>{L.preventDefault();const B=L.deltaY>0?"out":"in";$(B)},I=()=>{if(S){const L=document.createElement("a");L.href=S,L.download=`image-${n+1}.jpg`,L.click()}},F=()=>{const L=v();a(L),l({x:0,y:0}),g(0)};return!e||e.length===0?null:p.jsxs("div",{ref:k,className:"fixed inset-0 bg-black bg-opacity-90 flex items-center justify-center z-50",onClick:L=>{L.target===k.current&&r()},onMouseMove:N,onMouseUp:D,onWheel:R,children:[p.jsxs("div",{className:"absolute top-4 left-1/2 transform -translate-x-1/2 flex items-center space-x-2 bg-black bg-opacity-50 rounded-lg px-4 py-2 z-10",children:[e.length>1&&p.jsxs(p.Fragment,{children:[p.jsxs("span",{className:"text-white text-sm",children:[n+1," / ",e.length]}),p.jsx("div",{className:"w-px h-6 bg-gray-500"})]}),p.jsx("button",{onClick:()=>$("out"),className:"text-white hover:text-gray-300 p-2 hover:bg-white hover:bg-opacity-20 rounded transition-colors",title:"缩小 (Ctrl + -)",children:p.jsx(rg,{className:"w-5 h-5"})}),p.jsxs("span",{className:"text-white text-sm min-w-16 text-center",children:[Math.round(s*100),"%"]}),p.jsx("button",{onClick:()=>$("in"),className:"text-white hover:text-gray-300 p-2 hover:bg-white hover:bg-opacity-20 rounded transition-colors",title:"放大 (Ctrl + +)",children:p.jsx(ng,{className:"w-5 h-5"})}),p.jsx("div",{className:"w-px h-6 bg-gray-500"}),p.jsx("button",{onClick:M,className:"text-white hover:text-gray-300 p-2 hover:bg-white hover:bg-opacity-20 rounded transition-colors",title:"旋转 90°",children:p.jsx(Tw,{className:"w-5 h-5"})}),p.jsx("button",{onClick:F,className:"text-white hover:text-gray-300 p-2 hover:bg-white hover:bg-opacity-20 rounded transition-colors text-sm",title:"适应窗口大小",children:"适应"}),p.jsx("button",{onClick:()=>{a(1),l({x:0,y:0}),g(0)},className:"text-white hover:text-gray-300 p-2 hover:bg-white hover:bg-opacity-20 rounded transition-colors text-sm",title:"显示原始大小",children:"1:1"}),p.jsx("button",{onClick:I,className:"text-white hover:text-gray-300 p-2 hover:bg-white hover:bg-opacity-20 rounded transition-colors",title:"下载图片",children:p.jsx(ig,{className:"w-5 h-5"})})]}),e.length>1&&p.jsxs(p.Fragment,{children:[p.jsx("button",{onClick:w,disabled:n===0,className:`absolute left-4 top-1/2 transform -translate-y-1/2 text-white p-3 rounded-full transition-all z-10 ${n===0?"opacity-50 cursor-not-allowed":"hover:text-gray-300 hover:bg-white hover:bg-opacity-20"}`,title:"上一张 (←)",children:p.jsx(og,{className:"w-8 h-8"})}),p.jsx("button",{onClick:T,disabled:n===e.length-1,className:`absolute right-4 top-1/2 transform -translate-y-1/2 text-white p-3 rounded-full transition-all z-10 ${n===e.length-1?"opacity-50 cursor-not-allowed":"hover:text-gray-300 hover:bg-white hover:bg-opacity-20"}`,title:"下一张 (→)",children:p.jsx(Rs,{className:"w-8 h-8"})})]}),p.jsx("button",{onClick:r,className:"absolute top-4 right-4 text-white hover:text-gray-300 p-2 hover:bg-white hover:bg-opacity-20 rounded-full transition-colors z-10",title:"关闭预览 (ESC)",children:p.jsx(An,{className:"w-6 h-6"})}),p.jsx("img",{ref:y,src:S,alt:`图片预览 ${n+1}/${e.length}`,className:`max-w-none transition-transform ${c?"cursor-grabbing":"cursor-grab"}`,style:{transform:`translate(${o.x}px, ${o.y}px) scale(${s}) rotate(${d}deg)`,maxHeight:"none",maxWidth:"none",opacity:m?1:0},onLoad:C,onMouseDown:E,onDoubleClick:F,draggable:!1,onClick:L=>L.stopPropagation()}),p.jsx("div",{className:"absolute bottom-4 left-1/2 transform -translate-x-1/2 text-white text-sm bg-black bg-opacity-50 rounded px-3 py-1",children:e.length>1?"方向键切换 • 鼠标拖拽移动 • 滚轮缩放 • 双击适应窗口 • ESC关闭":"鼠标拖拽移动 • 滚轮缩放 • 双击适应窗口 • ESC关闭"})]})},bO=({content:e})=>{const{t}=we("components"),r=typeof e=="string"?e:Array.isArray(e)?e.map(s=>s.text||JSON.stringify(s)).join(""):String(e),[n,i]=O.useState(!1);return p.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg bg-gray-50 dark:bg-gray-800/50",children:[p.jsxs("button",{onClick:()=>i(!n),className:"w-full flex items-center justify-between p-3 text-left hover:bg-gray-100 dark:hover:bg-gray-700/50 transition-colors",children:[p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx(Ew,{className:"w-4 h-4 text-gray-600 dark:text-gray-400"}),p.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:t("compactSummary.title")})]}),p.jsxs("div",{className:"flex items-center space-x-1",children:[p.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:t(n?"compactSummary.collapse":"compactSummary.expand")}),n?p.jsx(ui,{className:"w-4 h-4 text-gray-500 dark:text-gray-400"}):p.jsx(Rs,{className:"w-4 h-4 text-gray-500 dark:text-gray-400"})]})]}),n&&p.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 p-4 bg-white dark:bg-gray-800",children:p.jsx("div",{className:"text-sm",children:p.jsx(ks,{content:r})})})]})},kO=({message:e,onAskUserQuestionSubmit:t})=>{const[r,n]=O.useState([]),[i,s]=O.useState(0),a=()=>{const c=[];return e.messageParts&&e.messageParts.length>0&&e.messageParts.forEach(u=>{u.type==="image"&&u.imageData&&c.push(`data:${u.imageData.mediaType};base64,${u.imageData.data}`)}),e.images&&e.images.length>0&&e.images.forEach(u=>{c.push(`data:${u.mediaType};base64,${u.data}`)}),c},o=c=>{const u=a(),h=u.indexOf(c);n(u),s(h>=0?h:0)},l=()=>{n([]),s(0)};if(e.messageParts&&e.messageParts.length>0){const c=[...e.messageParts].sort((u,h)=>u.order-h.order);return p.jsxs("div",{className:"space-y-3",children:[c.map(u=>{if(u.type==="command"&&u.content){const h=u.content.trim(),f=h.indexOf(" "),d=f>0?h.substring(0,f):h,g=f>0?h.substring(f+1).trim():"";return p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"inline-flex items-center px-2.5 py-1 bg-gray-800 dark:bg-gray-900 text-emerald-400 dark:text-emerald-300 rounded-md text-sm font-mono font-medium",children:d}),g&&p.jsx("span",{className:"text-gray-100 text-sm",children:g})]},u.id)}else{if(u.type==="compactSummary"&&u.content)return p.jsx("div",{children:p.jsx(bO,{content:u.content})},u.id);if(u.type==="text"&&u.content)return p.jsx("div",{children:p.jsx(ks,{content:u.content,isUserMessage:e.role==="user"})},u.id);if(u.type==="thinking"&&u.content)return p.jsxs("details",{className:"my-2",children:[p.jsx("summary",{className:"cursor-pointer text-gray-500 dark:text-gray-400 text-sm hover:text-gray-700 dark:hover:text-gray-300 transition-colors select-none",children:"💭 思考过程..."}),p.jsx("div",{className:"mt-2 pl-4 border-l-2 border-gray-200 dark:border-gray-700",children:p.jsx("div",{className:"text-gray-600 dark:text-gray-300 text-sm whitespace-pre-wrap break-words leading-relaxed italic",children:u.content})})]},u.id);if(u.type==="tool"&&u.toolData)return p.jsx(Xp,{toolName:u.toolData.toolName,toolInput:u.toolData.toolInput,toolResult:u.toolData.toolResult,toolUseResult:u.toolData.toolUseResult,isError:u.toolData.isError,isExecuting:u.toolData.isExecuting,claudeId:u.toolData.claudeId,onAskUserQuestionSubmit:t},u.id);if(u.type==="image"&&u.imageData){const h=`data:${u.imageData.mediaType};base64,${u.imageData.data}`;return p.jsx("div",{className:"inline-block",children:p.jsx("img",{src:h,alt:u.imageData.filename||"Image",className:"max-w-32 max-h-32 object-cover rounded-lg border border-gray-200 dark:border-gray-700 cursor-pointer hover:opacity-80 transition-opacity",onClick:()=>o(h),title:u.imageData.filename||"Click to preview"})},u.id)}else if(u.type==="text"&&u.content&&u.content.includes("unknown"))if(u.content.includes('"type":"thinking"')||u.content.includes('"thinking"')||u.content.includes("thinking")){let f=u.content;try{if(u.content.includes('"thinking":')){const d=u.content.match(/"thinking":"([^"]+)"/);d&&d[1]&&(f=d[1].replace(/\\n/g,`
389
+ `).replace(/\\"/g,'"'))}}catch(d){console.warn("Failed to parse thinking content:",d)}return p.jsxs("details",{className:"my-2",children:[p.jsx("summary",{className:"cursor-pointer text-gray-500 dark:text-gray-400 text-sm hover:text-gray-700 dark:hover:text-gray-300 transition-colors select-none",children:"💭 思考过程... (历史消息)"}),p.jsx("div",{className:"mt-2 pl-4 border-l-2 border-gray-200 dark:border-gray-700",children:p.jsx("div",{className:"text-gray-600 dark:text-gray-300 text-sm whitespace-pre-wrap break-words leading-relaxed italic",children:f})})]},u.id)}else return p.jsx("div",{children:p.jsx(ks,{content:u.content,isUserMessage:e.role==="user"})},u.id)}return null}),p.jsx(Mo,{images:r,initialIndex:i,onClose:l})]})}return p.jsxs("div",{className:"space-y-2",children:[e.images&&e.images.length>0&&p.jsx("div",{className:"flex flex-wrap gap-2",children:e.images.map(c=>{const u=`data:${c.mediaType};base64,${c.data}`;return p.jsx("img",{src:u,alt:c.filename||"Image",className:"max-w-32 max-h-32 object-cover rounded-lg border border-gray-200 dark:border-gray-700 cursor-pointer hover:opacity-80 transition-opacity",onClick:()=>o(u),title:c.filename||"Click to preview"},c.id)})}),e.content&&p.jsx("div",{children:(()=>{const c=e.content.match(/<command-message>.*?<\/command-message>\s*<command-name>(.+?)<\/command-name>/);if(c){const u=c[1].trim(),h=u.indexOf(" "),f=h>0?u.substring(0,h):u,d=h>0?u.substring(h+1).trim():"";return p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"inline-flex items-center px-2.5 py-1 bg-gray-800 dark:bg-gray-900 text-emerald-400 dark:text-emerald-300 rounded-md text-sm font-mono font-medium",children:f}),d&&p.jsx("span",{className:"text-gray-100 text-sm",children:d})]})}else return p.jsx(ks,{content:e.content,isUserMessage:e.role==="user"})})()}),e.toolUsage&&e.toolUsage.length>0&&p.jsx("div",{className:"space-y-2",children:e.toolUsage.map(c=>p.jsx(Xp,{toolName:c.toolName,toolInput:c.toolInput,toolResult:c.toolResult,toolUseResult:c.toolUseResult,isError:c.isError,isExecuting:c.isExecuting,claudeId:c.claudeId,onAskUserQuestionSubmit:t},c.id))}),p.jsx(Mo,{images:r,initialIndex:i,onClose:l})]})},wO=O.memo(kO),vO=({messages:e,isLoadingMessages:t,isInitializingSession:r,isAiTyping:n,isStopping:i,messagesContainerRef:s,messagesEndRef:a,onAskUserQuestionSubmit:o})=>{const{t:l}=we("components"),c=O.useMemo(()=>e.map(u=>p.jsx("div",{className:"px-4",children:p.jsx("div",{className:`text-sm leading-relaxed break-words overflow-hidden ${u.role==="user"?"text-white p-3 rounded-lg":"text-gray-800 dark:text-gray-200"}`,style:u.role==="user"?{backgroundColor:"hsl(var(--primary))",color:"white"}:{},children:p.jsx(wO,{message:u,onAskUserQuestionSubmit:o})})},u.id)),[e,o]);return p.jsxs("div",{ref:s,className:"flex-1 overflow-y-auto space-y-4 py-4 relative",children:[t&&p.jsx("div",{className:"flex items-center justify-center py-8",children:p.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[p.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-gray-900 dark:border-gray-100"}),p.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:l("agentChatPanel.loadingMessages")})]})}),!t&&e.length===0&&p.jsx("div",{className:"flex items-center justify-center h-full",children:p.jsx("div",{className:"text-center text-gray-500 dark:text-gray-400"})}),!t&&c,r&&p.jsx("div",{className:"px-4",children:p.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[p.jsxs("div",{className:"flex space-x-1",children:[p.jsx("div",{className:"w-2 h-2 bg-gray-400 dark:bg-gray-500 rounded-full animate-bounce"}),p.jsx("div",{className:"w-2 h-2 bg-gray-400 dark:bg-gray-500 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),p.jsx("div",{className:"w-2 h-2 bg-gray-400 dark:bg-gray-500 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]}),p.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:l("agentChatPanel.initializingSession")})]})}),!r&&(n||i)&&p.jsx("div",{className:"px-4",children:p.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[p.jsxs("div",{className:"flex space-x-1",children:[p.jsx("div",{className:"w-2 h-2 bg-gray-400 dark:bg-gray-500 rounded-full animate-bounce"}),p.jsx("div",{className:"w-2 h-2 bg-gray-400 dark:bg-gray-500 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),p.jsx("div",{className:"w-2 h-2 bg-gray-400 dark:bg-gray-500 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]}),i&&p.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:l("agentChat.stopping")})]})}),p.jsx("div",{ref:a})]})},CO=({envVars:e,onChange:t})=>{const{t:r}=we("components"),[n,i]=O.useState(""),[s,a]=O.useState(""),o=()=>{if(!n.trim())return;const u={...e,[n.trim()]:s};t(u),i(""),a("")},l=u=>{const h={...e};delete h[u],t(h)},c=(u,h,f)=>{if(u!==h){const d={...e};delete d[u],d[h]=f,t(d)}else{const d={...e,[u]:f};t(d)}};return p.jsxs("div",{className:"space-y-3",children:[p.jsx("div",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:r("agentChat.envVars.title","Environment Variables")}),p.jsxs("div",{className:"space-y-2",children:[Object.entries(e).length===0&&p.jsx("div",{className:"text-sm text-gray-400 italic px-2",children:r("agentChat.envVars.noVars","No environment variables set")}),Object.entries(e).map(([u,h])=>p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx("input",{type:"text",value:u,onChange:f=>c(u,f.target.value,h),className:"flex-1 min-w-0 px-2 py-1 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-500",placeholder:r("agentChat.envVars.key","KEY")}),p.jsx("span",{className:"text-gray-400",children:"="}),p.jsx("input",{type:"text",value:h,onChange:f=>c(u,u,f.target.value),className:"flex-1 min-w-0 px-2 py-1 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-500",placeholder:r("agentChat.envVars.value","VALUE")}),p.jsx("button",{onClick:()=>l(u),className:"p-1 text-gray-400 hover:text-red-500 hover:bg-gray-100 dark:hover:bg-gray-700 rounded transition-colors",title:r("agentChat.envVars.delete","Remove"),children:p.jsx(Aw,{className:"w-4 h-4"})})]},u))]}),p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx("input",{type:"text",value:n,onChange:u=>i(u.target.value),onKeyDown:u=>u.key==="Enter"&&o(),className:"flex-1 min-w-0 px-2 py-1 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-500",placeholder:r("agentChat.envVars.key","NEW_KEY")}),p.jsx("span",{className:"text-gray-400",children:"="}),p.jsx("input",{type:"text",value:s,onChange:u=>a(u.target.value),onKeyDown:u=>u.key==="Enter"&&o(),className:"flex-1 min-w-0 px-2 py-1 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-500",placeholder:r("agentChat.envVars.value","VALUE")}),p.jsx("button",{onClick:o,disabled:!n.trim(),className:"p-1 text-blue-600 hover:bg-blue-50 dark:text-blue-400 dark:hover:bg-blue-900/30 rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:r("agentChat.envVars.add","Add"),children:p.jsx(lg,{className:"w-4 h-4"})})]})]})},H1=({permissionMode:e,onPermissionModeChange:t,selectedClaudeVersion:r,onClaudeVersionChange:n,selectedModel:i,onModelChange:s,availableModels:a,claudeVersionsData:o,isVersionLocked:l,isAiTyping:c,envVars:u,onEnvVarsChange:h,className:f=""})=>{const{t:d}=we("components"),[g,m]=O.useState(!1),b=O.useRef(null);O.useEffect(()=>{const $=M=>{b.current&&!b.current.contains(M.target)&&m(!1)};return g&&document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[g]);const y=$=>{t($)},k=$=>{n($)},v=$=>{s($)},C=o?.versions&&o.versions.length>1,S=a.length>=2,w=a.find($=>$.id===i)?.name||i,T={default:d("agentChat.permissionMode.default"),acceptEdits:d("agentChat.permissionMode.acceptEdits"),bypassPermissions:d("agentChat.permissionMode.bypassPermissions")}[e];return p.jsxs("div",{className:`relative ${f}`,ref:b,children:[p.jsxs("button",{onClick:()=>m(!g),className:`flex items-center space-x-2 px-3 py-2 text-sm rounded-lg transition-colors border ${g?"border-blue-500 bg-blue-50 dark:bg-blue-900/30":"border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-800"}`,disabled:c,title:d("agentChat.settings.title"),children:[p.jsxs("div",{className:"flex items-center space-x-2 text-gray-700 dark:text-gray-300",children:[p.jsx("span",{className:"font-medium",children:w}),p.jsx("span",{className:"text-gray-300 dark:text-gray-600",children:"|"}),p.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:T})]}),p.jsx(ui,{className:`w-3 h-3 text-gray-400 transition-transform ${g?"transform rotate-180":""}`})]}),g&&p.jsxs("div",{className:"absolute bottom-full left-0 mb-2 w-[400px] bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl shadow-2xl z-50 flex flex-col max-h-[80vh]",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 dark:border-gray-700",children:[p.jsxs("h3",{className:"font-semibold text-gray-900 dark:text-white flex items-center gap-2",children:[p.jsx(Mw,{className:"w-4 h-4"}),d("agentChat.settings.title","Chat Configuration")]}),p.jsx("button",{onClick:()=>m(!1),className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 p-1 rounded-md hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",children:p.jsx(An,{className:"w-4 h-4"})})]}),p.jsxs("div",{className:"overflow-y-auto p-4 space-y-6",children:[(S||C)&&p.jsxs("div",{className:"space-y-3",children:[p.jsx("div",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:d("agentChat.settings.modelAndVersion","Supplier & Model")}),p.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[C&&p.jsxs("div",{className:"space-y-1.5",children:[p.jsx("label",{className:"text-xs text-gray-500 dark:text-gray-400 ml-1",children:d("agentChat.settings.claudeVersion")}),p.jsxs("div",{className:"relative",children:[p.jsxs("select",{value:r||"",onChange:$=>k($.target.value||void 0),disabled:l,className:`w-full appearance-none px-3 py-2 text-sm rounded-lg border bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:outline-none focus:ring-2 focus:ring-blue-500 ${l?"opacity-50 cursor-not-allowed border-gray-200 dark:border-gray-700":"border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}`,children:[p.jsx("option",{value:"",children:o?.defaultVersionId?`${d("agentChat.claudeVersion.default")} (${o.versions.find($=>$.id===o.defaultVersionId)?.name})`:d("agentChat.claudeVersion.default")}),o.versions.filter($=>o.defaultVersionId&&$.id!==o.defaultVersionId).map($=>p.jsx("option",{value:$.id,children:$.name},$.id))]}),p.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center px-2 pointer-events-none text-gray-500",children:p.jsx(ui,{className:"w-4 h-4"})})]})]}),S&&p.jsxs("div",{className:"space-y-1.5",children:[p.jsx("label",{className:"text-xs text-gray-500 dark:text-gray-400 ml-1",children:d("agentChat.settings.model")}),p.jsx("div",{className:"grid grid-cols-1 gap-2",children:a.map($=>p.jsxs("button",{onClick:()=>v($.id),className:`flex items-center justify-between px-3 py-2 text-sm rounded-lg border transition-all ${i===$.id?"border-purple-500 bg-purple-50 dark:bg-purple-900/20 text-purple-700 dark:text-purple-300 shadow-sm":"border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600 text-gray-700 dark:text-gray-300"}`,children:[p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx(Nw,{className:"w-4 h-4 opacity-70"}),p.jsx("span",{className:"font-medium",children:$.name})]}),$.isVision&&p.jsx("span",{className:"text-xs bg-gray-100 dark:bg-gray-700 px-1.5 py-0.5 rounded text-gray-500",children:"Vision"})]},$.id))})]})]})]}),p.jsx("div",{className:"h-px bg-gray-100 dark:bg-gray-700"}),p.jsxs("div",{className:"space-y-3",children:[p.jsx("div",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:d("agentChat.settings.permissionMode")}),p.jsx("div",{className:"grid grid-cols-3 gap-2",children:[{value:"default",label:d("agentChat.permissionMode.default"),icon:Sa},{value:"acceptEdits",label:d("agentChat.permissionMode.acceptEdits"),icon:Sa},{value:"bypassPermissions",label:d("agentChat.permissionMode.bypassPermissions"),icon:Sa}].map($=>p.jsxs("button",{onClick:()=>y($.value),className:`flex flex-col items-center justify-center p-2 text-xs rounded-lg border transition-all text-center gap-1.5 h-full ${e===$.value?"border-blue-500 bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 shadow-sm":"border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600 text-gray-600 dark:text-gray-400"}`,children:[p.jsx($.icon,{className:`w-4 h-4 ${e===$.value?"text-blue-500":"text-gray-400"}`}),p.jsx("span",{className:"leading-tight",children:$.label})]},$.value))})]}),p.jsx("div",{className:"h-px bg-gray-100 dark:bg-gray-700"}),p.jsx("div",{children:p.jsx(CO,{envVars:u,onChange:h})})]})]})]})},SO=({inputMessage:e,setInputMessage:t,selectedImages:r,isDragOver:n,isAiTyping:i,isSendDisabled:s,showToolSelector:a,setShowToolSelector:o,selectedRegularTools:l,setSelectedRegularTools:c,selectedMcpTools:u,setSelectedMcpTools:h,mcpToolsEnabled:f,setMcpToolsEnabled:d,permissionMode:g,setPermissionMode:m,selectedModel:b,setSelectedModel:y,selectedClaudeVersion:k,setSelectedClaudeVersion:v,availableModels:C,claudeVersionsData:S,isVersionLocked:w,agent:T,textareaRef:$,fileInputRef:M,envVars:E,setEnvVars:N,onSend:D,onStopGeneration:R,onKeyDown:I,onImageSelect:F,onPaste:L,onDragOver:B,onDragLeave:H,onDrop:Q})=>{const{t:_}=we("components");return p.jsxs("div",{className:`flex-shrink-0 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 ${n?"bg-blue-50 dark:bg-blue-900/30 border-blue-300 dark:border-blue-700":""}`,onDragOver:B,onDragLeave:H,onDrop:Q,children:[n&&p.jsx("div",{className:"absolute inset-0 bg-blue-100 dark:bg-blue-900/50 bg-opacity-75 flex items-center justify-center z-10 pointer-events-none",children:p.jsxs("div",{className:"text-blue-600 dark:text-blue-300 text-lg font-medium flex items-center space-x-2",children:[p.jsx(vs,{className:"w-6 h-6"}),p.jsx("span",{children:_("agentChat.dropImageHere")})]})}),p.jsx("div",{className:"p-4 pb-2",children:p.jsx("textarea",{ref:$,value:e,onChange:t,onKeyDown:I,onPaste:L,placeholder:r.length>0?_("agentChat.addDescription"):_("agentChat.inputPlaceholder"),rows:1,className:"w-full resize-none border border-gray-300 dark:border-gray-600 rounded-lg px-4 py-3 text-sm bg-white dark:bg-gray-800 text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none focus:ring-2 focus:border-transparent transition-all duration-200 disabled:bg-gray-50 dark:disabled:bg-gray-700 disabled:text-gray-500 dark:disabled:text-gray-400",style:{"--focus-ring-color":"hsl(var(--primary))",minHeight:"44px",maxHeight:"120px"},disabled:i})}),p.jsx("div",{className:"px-4 pb-4 pt-2 border-t border-gray-100 dark:border-gray-700",children:p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center space-x-1",children:[p.jsx("input",{ref:M,type:"file",accept:"image/jpeg,image/png,image/gif,image/webp",multiple:!0,onChange:F,className:"hidden"}),p.jsxs("div",{className:"relative",children:[p.jsx("button",{onClick:()=>o(!a),className:`p-2 transition-colors rounded-lg ${a||l.length>0||f&&u.length>0?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/30 hover:bg-blue-100 dark:hover:bg-blue-900/50":"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"}`,title:_("agentChat.toolSelection"),disabled:i,children:p.jsx(cg,{className:"w-4 h-4"})}),(l.length>0||f&&u.length>0)&&p.jsx("span",{className:"absolute -top-1 -right-1 text-white text-xs rounded-full w-5 h-5 flex items-center justify-center bg-blue-600 dark:bg-blue-500",children:l.length+(f?u.filter(j=>j.startsWith("mcp__")&&j.split("__").length===3).length:0)}),p.jsx(Au,{isOpen:a,onClose:()=>o(!1),selectedRegularTools:l,onRegularToolsChange:c,selectedMcpTools:u,onMcpToolsChange:h,mcpToolsEnabled:f,onMcpEnabledChange:d,presetTools:T.allowedTools})]}),p.jsxs("div",{className:"relative",children:[p.jsx("button",{onClick:()=>M.current?.click(),className:`p-2 transition-colors rounded-lg ${r.length>0?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/30 hover:bg-blue-100 dark:hover:bg-blue-900/50":"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"}`,title:r.length>0?_("agentChat.imageSelection")+` (${_("agentChat.selectedCount",{count:r.length})})`:_("agentChat.imageSelection"),disabled:i,children:p.jsx(vs,{className:"w-4 h-4"})}),r.length>0&&p.jsx("span",{className:"absolute -top-1 -right-1 text-white text-xs rounded-full w-5 h-5 flex items-center justify-center bg-blue-600 dark:bg-blue-500",children:r.length})]})]}),p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx(H1,{permissionMode:g,onPermissionModeChange:m,selectedClaudeVersion:k,onClaudeVersionChange:j=>v(j||""),selectedModel:b,onModelChange:y,availableModels:C,claudeVersionsData:S,isVersionLocked:w,isAiTyping:i,envVars:E,onEnvVarsChange:N}),i?p.jsxs("button",{onClick:R,className:"flex items-center space-x-2 px-4 py-2 text-white rounded-lg transition-colors text-sm font-medium shadow-sm",style:{backgroundColor:"rgb(239, 68, 68)"},title:_("agentChatPanel.stopGeneration"),children:[p.jsx(ug,{className:"w-4 h-4"}),p.jsx("span",{children:_("agentChatPanel.stop")})]}):p.jsxs("button",{onClick:D,disabled:s,className:"flex items-center space-x-2 px-4 py-2 text-white rounded-lg hover:opacity-90 disabled:bg-gray-300 dark:disabled:bg-gray-700 dark:disabled:text-gray-500 disabled:cursor-not-allowed transition-all duration-200 text-sm font-medium shadow-sm",style:{backgroundColor:s?void 0:"hsl(var(--primary))"},title:i?_("agentChatPanel.aiTyping"):!e.trim()&&r.length===0?_("agentChatPanel.noContentToSend"):_("agentChatPanel.sendMessage"),children:[p.jsx(Eu,{className:"w-4 h-4"}),p.jsx("span",{children:_("agentChatPanel.send")})]})]})]})})]})},_O=({inputMessage:e,setInputMessage:t,selectedImages:r,isDragOver:n,isAiTyping:i,isSendDisabled:s,showToolSelector:a,setShowToolSelector:o,selectedRegularTools:l,setSelectedRegularTools:c,selectedMcpTools:u,setSelectedMcpTools:h,mcpToolsEnabled:f,setMcpToolsEnabled:d,permissionMode:g,setPermissionMode:m,selectedModel:b,setSelectedModel:y,selectedClaudeVersion:k,setSelectedClaudeVersion:v,availableModels:C,claudeVersionsData:S,isVersionLocked:w,envVars:T,onEnvVarsChange:$,agent:M,textareaRef:E,fileInputRef:N,onSend:D,onStopGeneration:R,onKeyDown:I,onImageSelect:F,onPaste:L,onDragOver:B,onDragLeave:H,onDrop:Q})=>{const{t:_}=we("components");return p.jsxs("div",{className:`flex-shrink-0 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 ${n?"bg-blue-50 dark:bg-blue-900/30 border-blue-300 dark:border-blue-700":""}`,onDragOver:B,onDragLeave:H,onDrop:Q,children:[r.length>0&&p.jsx("div",{className:"p-3 pb-2 border-b border-gray-100 dark:border-gray-700",children:p.jsx("div",{className:"flex flex-wrap gap-2",children:r.map(j=>p.jsxs("div",{className:"relative group",children:[p.jsx("img",{src:j.preview,alt:_("agentChat.imagePreview"),className:"w-12 h-12 object-cover rounded-lg border border-gray-200 dark:border-gray-600 cursor-pointer hover:opacity-80 transition-opacity",onClick:()=>{}}),p.jsx("button",{onClick:()=>{},className:"absolute -top-1 -right-1 w-4 h-4 bg-red-500 text-white rounded-full flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity text-xs hover:bg-red-600",title:_("agentChat.deleteImage"),children:"×"})]},j.id))})}),n&&p.jsx("div",{className:"absolute inset-0 bg-blue-100 dark:bg-blue-900/50 bg-opacity-75 flex items-center justify-center z-10 pointer-events-none",children:p.jsxs("div",{className:"text-blue-600 dark:text-blue-300 text-sm font-medium flex items-center space-x-2",children:[p.jsx(vs,{className:"w-5 h-5"}),p.jsx("span",{children:_("agentChat.dropImageHere")})]})}),p.jsxs("div",{className:"p-3",children:[p.jsxs("div",{className:"flex items-center justify-between mb-3",children:[p.jsxs("div",{className:"flex space-x-2",children:[p.jsxs("div",{className:"relative",children:[p.jsx("button",{onClick:()=>o(!a),className:`p-2 transition-colors rounded-lg ${l.length>0||f&&u.length>0?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/30 hover:bg-blue-100 dark:hover:bg-blue-900/50":"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"}`,title:l.length>0||f&&u.length>0?_("agentChat.toolSelection")+` (${_("agentChat.selectedCount",{count:l.length+(f?u.length:0)})})`:_("agentChat.toolSelection"),disabled:i,children:p.jsx(cg,{className:"w-4 h-4"})}),(l.length>0||f&&u.length>0)&&p.jsx("span",{className:"absolute -top-1 -right-1 text-white text-xs rounded-full w-5 h-5 flex items-center justify-center bg-blue-600 dark:bg-blue-500",children:l.length+(f?u.filter(j=>j.startsWith("mcp__")&&j.split("__").length===3).length:0)}),p.jsx(Au,{isOpen:a,onClose:()=>o(!1),selectedRegularTools:l,onRegularToolsChange:c,selectedMcpTools:u,onMcpToolsChange:h,mcpToolsEnabled:f,onMcpEnabledChange:d,presetTools:M.allowedTools})]}),p.jsxs("div",{className:"relative",children:[p.jsx("button",{onClick:()=>N.current?.click(),className:`p-2 transition-colors rounded-lg ${r.length>0?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/30 hover:bg-blue-100 dark:hover:bg-blue-900/50":"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"}`,title:r.length>0?_("agentChat.imageSelection")+` (${r.length})`:_("agentChat.imageSelection"),disabled:i,children:p.jsx(vs,{className:"w-4 h-4"})}),r.length>0&&p.jsx("span",{className:"absolute -top-1 -right-1 text-white text-xs rounded-full w-5 h-5 flex items-center justify-center bg-blue-600 dark:bg-blue-500",children:r.length})]})]}),p.jsx(H1,{permissionMode:g,onPermissionModeChange:m,selectedClaudeVersion:k,onClaudeVersionChange:j=>v(j||""),selectedModel:b,onModelChange:y,availableModels:C,claudeVersionsData:S,isVersionLocked:w,isAiTyping:i,envVars:T,onEnvVarsChange:$})]}),p.jsxs("div",{className:"flex items-end space-x-2",children:[p.jsx("div",{className:"flex-1 relative",children:p.jsx("textarea",{ref:E,value:e,onChange:t,onKeyDown:I,onPaste:L,placeholder:_("agentChat.inputPlaceholder"),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none text-sm",rows:e.split(`
390
+ `).length,style:{minHeight:"40px",maxHeight:"120px"},disabled:i})}),i?p.jsx("button",{onClick:R,className:"px-3 py-2 rounded-lg font-medium transition-all duration-200 bg-red-600 dark:bg-red-500 text-white hover:bg-red-700 dark:hover:bg-red-600 shadow-sm",title:_("agentChat.stop"),children:p.jsx(ug,{className:"w-4 h-4"})}):p.jsx("button",{onClick:D,disabled:s,className:`px-3 py-2 rounded-lg font-medium transition-all duration-200 ${s?"bg-gray-300 dark:bg-gray-600 text-gray-500 dark:text-gray-400 cursor-not-allowed":"bg-blue-600 dark:bg-blue-500 text-white hover:bg-blue-700 dark:hover:bg-blue-600 shadow-sm"}`,title:_("agentChat.send"),children:p.jsx(Eu,{className:"w-4 h-4"})})]})]}),p.jsx("input",{ref:N,type:"file",accept:"image/*",multiple:!0,onChange:F,style:{display:"none"}})]})},TO=e=>[{id:"init",name:"init",description:e("commandSelector.systemCommands.init.description"),content:"/init",scope:"system",isSystem:!0},{id:"clear",name:"clear",description:e("commandSelector.systemCommands.clear.description"),content:"/clear",scope:"system",isSystem:!0},{id:"compact",name:"compact",description:e("commandSelector.systemCommands.compact.description"),content:"/compact",scope:"system",isSystem:!0},{id:"agents",name:"agents",description:e("commandSelector.systemCommands.agents.description"),content:"/agents",scope:"system",isSystem:!0},{id:"settings",name:"settings",description:e("commandSelector.systemCommands.settings.description"),content:"/settings",scope:"system",isSystem:!0},{id:"help",name:"help",description:e("commandSelector.systemCommands.help.description"),content:"/help",scope:"system",isSystem:!0}],EO=({isOpen:e,onSelect:t,onClose:r,searchTerm:n,position:i,projectId:s,selectedIndex:a=0,onSelectedIndexChange:o})=>{const{t:l}=we("components"),c=O.useRef(null);O.useEffect(()=>{const S=w=>{c.current&&!c.current.contains(w.target)&&r?.()};if(e)return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[e,r]);const{data:u=[]}=ic({scope:"user",search:n}),{data:h=[]}=sc({projectId:s||"",search:n}),g=[...TO(l).filter(S=>S.name.toLowerCase().includes(n.toLowerCase())||S.description.toLowerCase().includes(n.toLowerCase())),...h,...u];if(O.useEffect(()=>{g.length>0&&a>=g.length&&o?.(0)},[g.length,a,o]),O.useEffect(()=>{if(e&&c.current){const S=c.current.querySelector(`[data-index="${a}"]`);S&&S.scrollIntoView({block:"nearest",behavior:"smooth"})}},[a,e]),!e||g.length===0)return null;const m=65,b=20,y=4,k=i.top-b-y,v=g.length*m,C=Math.min(v,k);return p.jsx("div",{ref:c,className:"fixed z-50 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg min-w-72 max-w-96 overflow-hidden",style:{bottom:window.innerHeight-i.top+y,left:i.left,maxHeight:`${C}px`},children:p.jsx("div",{className:"overflow-y-auto",style:{maxHeight:`${C}px`},children:g.map((S,w)=>{const T="isSystem"in S,$=w===a,M=()=>T?S.name:S.namespace?`${S.namespace}:${S.name}`:S.name;return p.jsx("div",{"data-index":w,className:`px-4 py-3 cursor-pointer flex items-center border-b border-gray-100 dark:border-gray-700 last:border-b-0 ${$?"bg-blue-50 dark:bg-blue-900/30 border-blue-200 dark:border-blue-700":"hover:bg-gray-50 dark:hover:bg-gray-700"}`,onClick:()=>t(S),onMouseEnter:()=>o?.(w),children:p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:`text-sm font-medium truncate ${$?"text-blue-900 dark:text-blue-300":"text-gray-900 dark:text-gray-100"}`,children:M()}),S.description&&p.jsx("div",{className:`text-xs truncate ${$?"text-blue-700 dark:text-blue-400":"text-gray-500 dark:text-gray-400"}`,children:S.description})]})},S.id)})})})},Qp=({showCommandSelector:e,showFileBrowser:t,commandSearch:r,selectedCommandIndex:n,atSymbolPosition:i,projectPath:s,textareaRef:a,inputMessage:o,onCommandSelect:l,onSetInputMessage:c,onSetShowCommandSelector:u,onSetSelectedCommandIndex:h,onSetShowFileBrowser:f,onSetAtSymbolPosition:d})=>{const{t:g}=we("components"),m=C=>{l(C),c(`/${C.name}`),u(!1),a.current&&a.current.focus()},b=()=>{u(!1)},y=(C,S)=>{if(!a.current||i===null)return;let w=C.replace(/\\/g,"/");if(s){const E=s.replace(/\\/g,"/"),N=E.endsWith("/")?E.slice(0,-1):E;w.startsWith(N)&&(w=w.substring(N.length+1))}const T=o.substring(0,i),$=o.substring(i+1),M=T+"@"+w+" "+$;c(M),f(!1),d(null),setTimeout(()=>{if(a.current){const E=i+1+w.length+1;a.current.setSelectionRange(E,E),a.current.focus()}},0)},k=()=>{f(!1),d(null),setTimeout(()=>{a.current?.focus()},0)},v=()=>{if(!a.current)return{top:0,left:0};const C=a.current.getBoundingClientRect();return{top:C.top,left:C.left}};return p.jsxs(p.Fragment,{children:[p.jsx(EO,{isOpen:e,onSelect:m,onClose:b,searchTerm:r,position:v(),projectId:s,selectedIndex:n,onSelectedIndexChange:h}),t&&p.jsx(Fw,{title:g("agentChat.fileBrowser.title",{projectPath:s?s.split("/").pop():g("agentChat.fileBrowser.currentProject")}),initialPath:s,allowFiles:!0,allowDirectories:!1,restrictToProject:!0,onSelect:y,onClose:k})]})},AO=e=>t=>{if(t.key==="Escape"&&e.showFileBrowser){t.preventDefault(),e.onSetShowFileBrowser(!1),e.onSetAtSymbolPosition(null);return}if(t.key==="Enter"&&!t.shiftKey&&e.showCommandSelector&&e.allCommands.length>0){t.preventDefault();const r=e.allCommands[e.selectedCommandIndex];r&&(e.onCommandSelect(r),e.onSetInputMessage(`/${r.name}`),e.onSetShowCommandSelector(!1),setTimeout(()=>{e.textareaRef.current?.focus()},0));return}if(e.showCommandSelector&&e.allCommands.length>0){if(t.key==="ArrowUp"||t.ctrlKey&&t.key==="p"){t.preventDefault(),e.onSetSelectedCommandIndex(e.selectedCommandIndex>0?e.selectedCommandIndex-1:e.allCommands.length-1);return}if(t.key==="ArrowDown"||t.ctrlKey&&t.key==="n"){t.preventDefault(),e.onSetSelectedCommandIndex(e.selectedCommandIndex<e.allCommands.length-1?e.selectedCommandIndex+1:0);return}if(t.key==="Escape"){t.preventDefault(),e.onSetShowCommandSelector(!1);return}}e.onHandleKeyDown(t)},Kp=({isOpen:e,message:t,onConfirm:r,onCancel:n,confirmText:i="确认",cancelText:s="取消"})=>e?p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-50",onClick:n}),p.jsxs("div",{className:"relative bg-white rounded-lg shadow-lg max-w-md w-full mx-4 p-6",children:[p.jsx("button",{onClick:n,className:"absolute top-4 right-4 text-gray-400 hover:text-gray-600 transition-colors",children:p.jsx(An,{size:20})}),p.jsxs("div",{className:"pr-8",children:[p.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"命令确认"}),p.jsx("p",{className:"text-gray-700 whitespace-pre-line mb-6",children:t})]}),p.jsxs("div",{className:"flex justify-end space-x-3",children:[p.jsx("button",{onClick:n,className:"px-4 py-2 text-gray-700 bg-gray-100 hover:bg-gray-200 rounded-lg transition-colors",children:s}),p.jsx("button",{onClick:r,className:"px-4 py-2 text-white bg-blue-600 hover:bg-blue-700 rounded-lg transition-colors",children:i})]})]})]}):null,Zp=({isOpen:e,onClose:t,mcpStatus:r})=>{const[n,i]=O.useState(new Set),[s,a]=O.useState(null);if(!e)return null;const o=h=>h?new Date(h).toLocaleString():"未知",l=(r.connectedServers?.length||0)>0||(r.connectionErrors?.length||0)>0,c=h=>{const f=new Set(n);f.has(h)?f.delete(h):f.add(h),i(f)},u=async(h,f)=>{try{await navigator.clipboard.writeText(h),a(f),setTimeout(()=>a(null),2e3)}catch(d){console.error("Failed to copy error text:",d)}};return p.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:p.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[90vh] overflow-hidden",children:[p.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700",children:[p.jsxs("div",{className:"flex items-center space-x-2",children:[r.hasError?p.jsx(ld,{className:"w-5 h-5 text-red-500"}):p.jsx(Jr,{className:"w-5 h-5 text-green-500"}),p.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"MCP 工具状态"})]}),p.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",children:p.jsx(An,{className:"w-5 h-5"})})]}),p.jsxs("div",{className:"p-4 space-y-4 max-h-[calc(90vh-120px)] overflow-y-auto",children:[p.jsx("div",{className:`p-3 rounded-lg ${r.hasError?"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800":"bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800"}`,children:p.jsxs("div",{className:"flex items-center space-x-2",children:[r.hasError?p.jsx(Lw,{className:"w-4 h-4 text-red-500"}):p.jsx(cd,{className:"w-4 h-4 text-green-500"}),p.jsx("span",{className:`font-medium ${r.hasError?"text-red-700 dark:text-red-300":"text-green-700 dark:text-green-300"}`,children:r.hasError?"MCP 工具存在问题":"MCP 工具运行正常"})]})}),r.lastUpdated&&p.jsxs("div",{className:"flex items-center space-x-2 text-sm text-gray-500 dark:text-gray-400",children:[p.jsx(Zr,{className:"w-4 h-4"}),p.jsxs("span",{children:["最后更新: ",o(r.lastUpdated)]})]}),r.connectedServers&&r.connectedServers.length>0&&p.jsxs("div",{children:[p.jsxs("h4",{className:"font-medium text-gray-900 dark:text-white mb-2",children:["✅ 已连接的服务器 (",r.connectedServers.length,")"]}),p.jsx("div",{className:"space-y-2",children:r.connectedServers.map((h,f)=>p.jsxs("div",{className:"flex items-center space-x-2 p-2 bg-green-50 dark:bg-green-900/20 rounded border border-green-200 dark:border-green-800",children:[p.jsx(Jr,{className:"w-4 h-4 text-green-500 flex-shrink-0"}),p.jsx("span",{className:"text-sm text-green-700 dark:text-green-300 font-medium",children:h.name}),p.jsxs("span",{className:"text-xs text-green-600 dark:text-green-400",children:["(",h.status,")"]})]},f))})]}),r.connectionErrors&&r.connectionErrors.length>0&&p.jsxs("div",{children:[p.jsxs("h4",{className:"font-medium text-gray-900 dark:text-white mb-2",children:["❌ 连接失败的服务器 (",r.connectionErrors.length,")"]}),p.jsx("div",{className:"space-y-2",children:r.connectionErrors.map((h,f)=>{const d=n.has(f),g=h.error&&h.error.length>50,m=s===f;return p.jsxs("div",{className:"p-2 bg-red-50 dark:bg-red-900/20 rounded border border-red-200 dark:border-red-800",children:[p.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[p.jsx(ld,{className:"w-4 h-4 text-red-500 flex-shrink-0"}),p.jsx("span",{className:"text-sm text-red-700 dark:text-red-300 font-medium",children:h.name}),p.jsxs("span",{className:"text-xs text-red-600 dark:text-red-400",children:["(",h.status,")"]}),g&&p.jsx("button",{onClick:()=>c(f),className:"ml-auto p-1 hover:bg-red-100 dark:hover:bg-red-800/30 rounded",title:d?"收起详细错误":"展开详细错误",children:d?p.jsx(ui,{className:"w-3 h-3 text-red-500"}):p.jsx(Rs,{className:"w-3 h-3 text-red-500"})})]}),h.error&&p.jsx("div",{className:"ml-6",children:g?p.jsxs("div",{children:[p.jsx("p",{className:"text-xs text-red-600 dark:text-red-400 mb-1",children:d?h.error:`${h.error.substring(0,50)}...`}),d&&p.jsx("div",{className:"flex items-center justify-between mt-2",children:p.jsxs("button",{onClick:()=>u(h.error,f),className:"flex items-center space-x-1 px-2 py-1 text-xs bg-red-100 dark:bg-red-800/30 hover:bg-red-200 dark:hover:bg-red-800/50 rounded transition-colors",title:"复制错误信息",children:[p.jsx(rc,{className:"w-3 h-3"}),p.jsx("span",{children:m?"已复制":"复制错误"})]})})]}):p.jsx("p",{className:"text-xs text-red-600 dark:text-red-400",children:h.error})})]},f)})})]}),r.lastError&&p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center justify-between mb-2",children:[p.jsx("h4",{className:"font-medium text-gray-900 dark:text-white",children:"🚨 最近的错误"}),p.jsxs("button",{onClick:()=>u(`${r.lastError}${r.lastErrorDetails?`
391
+ 详情: `+r.lastErrorDetails:""}`,-1),className:"flex items-center space-x-1 px-2 py-1 text-xs bg-red-100 dark:bg-red-800/30 hover:bg-red-200 dark:hover:bg-red-800/50 rounded transition-colors",title:"复制错误信息",children:[p.jsx(rc,{className:"w-3 h-3"}),p.jsx("span",{children:s===-1?"已复制":"复制"})]})]}),p.jsxs("div",{className:"p-3 bg-red-50 dark:bg-red-900/20 rounded border border-red-200 dark:border-red-800",children:[p.jsx("p",{className:"text-sm text-red-700 dark:text-red-300 mb-1 font-mono",children:r.lastError}),r.lastErrorDetails&&p.jsx("div",{className:"mt-2 pt-2 border-t border-red-200 dark:border-red-700",children:p.jsxs("p",{className:"text-xs text-red-600 dark:text-red-400 font-mono whitespace-pre-wrap",children:[p.jsx("span",{className:"font-semibold",children:"详情:"}),p.jsx("br",{}),r.lastErrorDetails]})})]})]}),!l&&p.jsxs("div",{className:"text-center py-8",children:[p.jsx(cd,{className:"w-12 h-12 text-gray-400 mx-auto mb-3"}),p.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"暂无 MCP 服务器信息"}),p.jsx("p",{className:"text-sm text-gray-400 dark:text-gray-500 mt-1",children:"当使用 MCP 工具时,状态信息将显示在这里"})]})]}),p.jsx("div",{className:"p-4 border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-750",children:p.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"MCP (Model Context Protocol) 工具允许 AI 与外部系统交互。 如果遇到连接问题,请检查 MCP 服务器配置。"})})]})})},MO=e=>{const{t}=we("components"),{inputMessage:r,selectedImages:n,isAiTyping:i,isMobile:s,showToolSelector:a,selectedRegularTools:o,selectedMcpTools:l,mcpToolsEnabled:c,showCommandSelector:u,showFileBrowser:h,commandSearch:f,selectedCommand:d,selectedCommandIndex:g,atSymbolPosition:m,commandWarning:b,permissionMode:y,selectedModel:k,selectedClaudeVersion:v,showMobileSettings:C,isVersionLocked:S,isDragOver:w,previewImage:T,showConfirmDialog:$,confirmMessage:M,showMcpStatusModal:E,availableModels:N,claudeVersionsData:D,agent:R,projectPath:I,mcpStatus:F,textareaRef:L,fileInputRef:B,onSend:H,handleKeyDown:Q,handleImageSelect:_,handleImageRemove:j,handleImagePreview:te,handlePaste:A,handleDragOver:P,handleDragLeave:Y,handleDrop:U,handleStopGeneration:q,onSetInputMessage:V,onSetShowToolSelector:K,onSetSelectedRegularTools:re,onSetSelectedMcpTools:ye,onSetMcpToolsEnabled:_e,onSetPermissionMode:ve,onSetSelectedModel:Le,onSetSelectedClaudeVersion:Oe,onSetShowMobileSettings:Mt,onSetPreviewImage:it,onSetShowMcpStatusModal:yt,onCommandSelect:Nt,onSetShowCommandSelector:Ee,onSetSelectedCommandIndex:st,onSetShowFileBrowser:ft,onSetAtSymbolPosition:ze,onSetCommandWarning:Lt,onSetCommandSearch:gt,handleConfirmDialog:G,handleCancelDialog:J,isSendDisabled:me,envVars:Se,onSetEnvVars:Ie}=e,tt=O.useCallback(Be=>{const We=Be.target.value;if(V(We),b&&Lt(null),We.length>0&&We[We.length-1]==="@"){const at=We.substring(0,We.length-1);if(at.length===0||/\s$/.test(at)){ze(We.length-1),ft(!0),L.current?.blur();return}}if(us(We)){const at=Vw(We);at!==f&&(gt(at),st(0)),u||Ee(!0)}else u&&(Ee(!1),st(0))},[b,f,u,V,ze,ft,Ee,Lt,st,gt,L]);return s?p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"flex-shrink-0 bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 p-3 space-y-3",children:[b&&p.jsxs("div",{className:"bg-red-50 dark:bg-red-900/30 border border-red-200 dark:border-red-800 rounded-lg p-2 flex items-start space-x-2",children:[p.jsx("div",{className:"flex-shrink-0",children:p.jsx("svg",{className:"w-4 h-4 text-red-600 dark:text-red-400 mt-0.5",fill:"currentColor",viewBox:"0 0 20 20",children:p.jsx("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),p.jsx("div",{className:"flex-1",children:p.jsx("p",{className:"text-xs text-red-800 dark:text-red-300",children:b})})]}),p.jsx(_O,{inputMessage:r,setInputMessage:tt,selectedImages:n,isDragOver:w,isAiTyping:i,isSendDisabled:me(),showToolSelector:a,setShowToolSelector:K,selectedRegularTools:o,setSelectedRegularTools:re,selectedMcpTools:l,setSelectedMcpTools:ye,mcpToolsEnabled:c,setMcpToolsEnabled:_e,permissionMode:y,setPermissionMode:ve,selectedModel:k,setSelectedModel:Le,selectedClaudeVersion:v,setSelectedClaudeVersion:Oe,availableModels:N,claudeVersionsData:D,isVersionLocked:S,agent:R,textareaRef:L,fileInputRef:B,onSend:H,onStopGeneration:q,onKeyDown:Q,onImageSelect:_,onPaste:A,onDragOver:P,onDragLeave:Y,onDrop:U,envVars:Se,onEnvVarsChange:Ie}),p.jsx(Au,{isOpen:a,onClose:()=>K(!1),selectedRegularTools:o,onRegularToolsChange:re,selectedMcpTools:l,onMcpToolsChange:ye,mcpToolsEnabled:c,onMcpEnabledChange:_e,presetTools:R.allowedTools})]}),C&&p.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:p.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg p-6 m-4 max-w-sm w-full",children:[p.jsxs("div",{className:"flex justify-between items-center mb-4",children:[p.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:t("agentChat.settings")}),p.jsx("button",{onClick:()=>Mt(!1),className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:p.jsx(An,{className:"w-6 h-6"})})]}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:t("agentChat.permissionMode")}),p.jsxs("select",{value:y,onChange:Be=>ve(Be.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-white",children:[p.jsx("option",{value:"default",children:t("agentChat.default")}),p.jsx("option",{value:"acceptEdits",children:t("agentChat.acceptEdits")}),p.jsx("option",{value:"bypassPermissions",children:t("agentChat.bypassPermissions")})]})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:t("agentChat.model")}),p.jsx("select",{value:k,onChange:Be=>Le(Be.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-white",children:N.map(Be=>p.jsx("option",{value:Be.id,children:Be.name},Be.id))})]}),!S&&p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:t("agentChat.version")}),p.jsx("select",{value:v,onChange:Be=>Oe(Be.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-white",children:D?.availableVersions?.map(Be=>p.jsx("option",{value:Be.id,children:Be.name},Be.id))})]})]})]})}),p.jsx(Qp,{showCommandSelector:u,showFileBrowser:h,commandSearch:f,selectedCommand:d,selectedCommandIndex:g,atSymbolPosition:m,projectPath:I,textareaRef:L,inputMessage:r,onCommandSelect:Nt,onSetInputMessage:V,onSetShowCommandSelector:Ee,onSetSelectedCommandIndex:st,onSetShowFileBrowser:ft,onSetAtSymbolPosition:ze}),p.jsx(Kp,{isOpen:$,message:M,onConfirm:G,onCancel:J}),p.jsx(Mo,{images:T?[T]:[],onClose:()=>it(null)}),p.jsx(Zp,{isOpen:E,onClose:()=>yt(!1),mcpStatus:F})]}):p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:`flex-shrink-0 border-t border-gray-200 dark:border-gray-700 ${w?"bg-blue-50 dark:bg-blue-900/30 border-blue-300 dark:border-blue-700":""}`,onDragOver:P,onDragLeave:Y,onDrop:U,children:[n.length>0&&p.jsx("div",{className:"p-4 pb-2 border-b border-gray-100 dark:border-gray-700",children:p.jsx("div",{className:"flex flex-wrap gap-2",children:n.map(Be=>p.jsxs("div",{className:"relative group",children:[p.jsx("img",{src:Be.preview,alt:t("agentChat.imagePreview"),className:"w-16 h-16 object-cover rounded-lg border border-gray-200 dark:border-gray-600 cursor-pointer hover:opacity-80 transition-opacity",onClick:()=>te(Be.preview)}),p.jsx("button",{onClick:()=>j(Be.id),className:"absolute -top-1 -right-1 w-5 h-5 bg-red-500 text-white rounded-full flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity text-xs hover:bg-red-600",title:t("agentChat.deleteImage"),children:p.jsx(An,{className:"w-3 h-3"})})]},Be.id))})}),w&&p.jsx("div",{className:"absolute inset-0 bg-blue-100 dark:bg-blue-900/50 bg-opacity-75 flex items-center justify-center z-10 pointer-events-none",children:p.jsxs("div",{className:"text-blue-600 dark:text-blue-300 text-lg font-medium flex items-center space-x-2",children:[p.jsx(vs,{className:"w-6 h-6"}),p.jsx("span",{children:t("agentChat.dropImageHere")})]})}),b&&p.jsx("div",{className:"px-4 pt-3 pb-2",children:p.jsxs("div",{className:"bg-red-50 dark:bg-red-900/30 border border-red-200 dark:border-red-800 rounded-lg p-3 flex items-start space-x-2",children:[p.jsx("div",{className:"flex-shrink-0",children:p.jsx("svg",{className:"w-5 h-5 text-red-600 dark:text-red-400 mt-0.5",fill:"currentColor",viewBox:"0 0 20 20",children:p.jsx("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),p.jsx("div",{className:"flex-1",children:p.jsx("p",{className:"text-sm text-red-800 dark:text-red-300",children:b})})]})}),p.jsx(SO,{inputMessage:r,setInputMessage:tt,selectedImages:n,isDragOver:w,isAiTyping:i,isSendDisabled:me(),showToolSelector:a,setShowToolSelector:K,selectedRegularTools:o,setSelectedRegularTools:re,selectedMcpTools:l,setSelectedMcpTools:ye,mcpToolsEnabled:c,setMcpToolsEnabled:_e,permissionMode:y,setPermissionMode:ve,selectedModel:k,setSelectedModel:Le,selectedClaudeVersion:v,setSelectedClaudeVersion:Oe,availableModels:N,claudeVersionsData:D,isVersionLocked:S,agent:R,textareaRef:L,fileInputRef:B,onSend:H,onStopGeneration:q,onKeyDown:Q,onImageSelect:_,onPaste:A,onDragOver:P,onDragLeave:Y,onDrop:U,envVars:Se,setEnvVars:Ie})]}),p.jsx(Qp,{showCommandSelector:u,showFileBrowser:h,commandSearch:f,selectedCommand:d,selectedCommandIndex:g,atSymbolPosition:m,projectPath:I,textareaRef:L,inputMessage:r,onCommandSelect:Nt,onSetInputMessage:V,onSetShowCommandSelector:Ee,onSetSelectedCommandIndex:st,onSetShowFileBrowser:ft,onSetAtSymbolPosition:ze}),p.jsx(Kp,{isOpen:$,message:M,onConfirm:G,onCancel:J}),p.jsx(Mo,{images:T?[T]:[],onClose:()=>it(null)}),p.jsx(Zp,{isOpen:E,onClose:()=>yt(!1),mcpStatus:F})]})},NO=({agent:e,projectPath:t,onSessionChange:r})=>{const{t:n}=we("components"),{isCompactMode:i}=Hw(),{isMobile:s}=dg(),a=O.useRef(null),o=O.useRef(null),l=O.useRef(null),c=O.useRef(null),u=O.useRef(null),[h,f]=O.useState(""),{messages:d,isAiTyping:g,currentSessionId:m,mcpStatus:b,pendingUserQuestion:y,addMessage:k,interruptAllExecutingTools:v,setAiTyping:C,loadSessionMessages:S,setPendingUserQuestion:w}=Xe(),T=iv(),{showSessions:$,showConfirmDialog:M,showMobileSettings:E,showMcpStatusModal:N,confirmMessage:D,searchTerm:R,isStopping:I,isInitializingSession:F,setShowSessions:L,setShowConfirmDialog:B,setShowMobileSettings:H,setShowMcpStatusModal:Q,setConfirmMessage:_,setConfirmAction:j,setSearchTerm:te,setIsStopping:A,setIsInitializingSession:P,handleConfirmDialog:Y,handleCancelDialog:U}=T,q=nv({agentId:e.id,currentSessionId:m,onSessionChange:r,textareaRef:l}),{isLoadingMessages:V,isNewSession:K,hasSuccessfulResponse:re,setIsLoadingMessages:ye,setIsNewSession:_e,setHasSuccessfulResponse:ve,setCurrentSessionId:Le,handleSwitchSession:Oe,handleNewSession:Mt,handleRefreshMessages:it}=q,{selectedImages:yt,previewImage:Nt,isDragOver:Ee,handleImageSelect:st,handleImageRemove:ft,handleImagePreview:ze,handlePaste:Lt,handleDragOver:gt,handleDragLeave:G,handleDrop:J,clearImages:me,setPreviewImage:Se}=Gw({textareaRef:l,inputMessage:h,setInputMessage:f}),Ie=Yw({messagesContainerRef:a,messagesEndRef:o,messages:d,isAiTyping:g}),tt=Xw({projectPath:t,textareaRef:l}),Be=Qw({agent:e}),We=Kw({initialModel:"claude-3-5-sonnet-20241022"}),{commandSearch:at,selectedCommand:ot,selectedCommandIndex:Ke,commandWarning:Kt,showCommandSelector:bt,showFileBrowser:Js,atSymbolPosition:hn,allCommands:Ar,SYSTEM_COMMANDS:ea,userCommands:dn,projectCommands:ul,userCommandsError:Mi,projectCommandsError:Ze,setSelectedCommand:qr,setSelectedCommandIndex:Ni,setCommandWarning:fn,setShowCommandSelector:pn,setShowFileBrowser:Li,setAtSymbolPosition:Ii,setCommandSearch:hl,handleCommandSelect:Vt,isCommandDefined:pr,getAllAvailableCommands:$i}=tt,{selectedModel:Ur,selectedClaudeVersion:Mr,isVersionLocked:ta,claudeVersionsData:nr,availableModels:ra,setSelectedModel:Wn,setSelectedClaudeVersion:ji,setIsVersionLocked:gn}=We,{showToolSelector:dl,selectedRegularTools:he,selectedMcpTools:z,mcpToolsEnabled:Z,permissionMode:se,showPermissionDropdown:qe,showModelDropdown:pt,showVersionDropdown:Je,setShowToolSelector:kt,setSelectedRegularTools:ir,setSelectedMcpTools:Vr,setMcpToolsEnabled:Bi,setPermissionMode:lt,setShowPermissionDropdown:Di,setShowModelDropdown:Pi,setShowVersionDropdown:Xh,envVars:Qh,setEnvVars:W1}=Be,{isUserScrolling:Kh,newMessagesCount:Zh,scrollToBottom:Jh,setNewMessagesCount:q1,setIsUserScrolling:U1}=Ie,[V1,G1]=O.useState("默认服务");O.useEffect(()=>{const Ce=iw(),Rt=sw(Ce);Rt&&G1(Rt.name)},[]);const Y1=cw(),{data:ed}=uw(e.id,R,t),{data:Nr}=hw(e.id,m,t),{data:fl}=fw();zw({agentId:e.id,sessionId:m,projectPath:t,enabled:!!m,isNewSession:K,hasSuccessfulResponse:re}),O.useEffect(()=>ws.startSmartMonitoring(),[]),O.useEffect(()=>{if(m&&e.id)return console.log(`🎯 Setting up wakeup listener for session: ${m}`),ws.setupWakeupListener(e.id,m)},[m,e.id]);const td=Mi||Ze;O.useEffect(()=>{Ni(Ce=>Ar.length>0&&Ce>=Ar.length?0:Ce)},[Ar.length]);const X1=Ce=>{Oe(Ce),L(!1)},Q1=()=>{Mt(),L(!1),te("")},K1=async()=>{if(!(!u.current||!m))try{A(!0),console.log("🛑 Stopping generation for session:",m);try{await Y1.mutateAsync(m),console.log("✅ Successfully interrupted session via API")}catch(Ce){console.error("❌ Failed to interrupt session:",Ce);const Rt=Ce instanceof Error?Ce.message:"Unknown error";k({content:`${n("agentChat.stopFailed")}
392
+
393
+ ${Rt}`,role:"assistant"}),A(!1);return}v(),u.current.abort(),u.current=null,C(!1),A(!1),P(!1),k({content:n("agentChat.generationStopped"),role:"assistant"})}catch(Ce){console.error("Error stopping generation:",Ce),A(!1),P(!1)}},{isSendDisabled:Z1,handleSendMessage:rd}=rv({agent:e,projectPath:t,inputMessage:h,selectedImages:yt,isAiTyping:g,currentSessionId:m,hasCommandsLoadError:!!td,userCommandsError:Mi||void 0,projectCommandsError:Ze||void 0,SYSTEM_COMMANDS:ea,userCommands:dn,projectCommands:ul,selectedCommand:ot,selectedRegularTools:he,selectedMcpTools:z,mcpToolsEnabled:Z,permissionMode:se,selectedModel:Ur,selectedClaudeVersion:Mr,abortControllerRef:u,onSessionChange:r,setInputMessage:f,clearImages:me,setSelectedCommand:qr,setShowCommandSelector:pn,setCommandWarning:fn,setIsInitializingSession:P,setCurrentSessionId:Le,setIsNewSession:_e,setAiTyping:C,setHasSuccessfulResponse:ve,setConfirmMessage:_,setConfirmAction:j,setShowConfirmDialog:B,handleNewSession:Mt,isCommandDefined:pr,getAllAvailableCommands:$i,envVars:Qh}),J1=async(Ce,Rt)=>{console.log("🎤 [AskUserQuestion] Submitting response for tool:",Ce);try{const Gr=await tc(`${ec}/agents/user-response`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolUseId:Ce,response:Rt,sessionId:m,agentId:e.id})});if(!Gr.ok){const rw=await Gr.json().catch(()=>({}));throw new Error(rw.error||`HTTP ${Gr.status}`)}console.log("✅ [AskUserQuestion] Response submitted successfully"),w(null)}catch(Gr){console.error("🎤 [AskUserQuestion] Submit failed:",Gr)}},ew=AO({showCommandSelector:bt,showFileBrowser:Js,commandSearch:at,selectedCommand:ot,selectedCommandIndex:Ke,atSymbolPosition:hn,projectPath:t,textareaRef:l,inputMessage:h,allCommands:Ar,onCommandSelect:Vt,onSetInputMessage:f,onSetShowCommandSelector:pn,onSetSelectedCommandIndex:Ni,onSetShowFileBrowser:Li,onSetAtSymbolPosition:Ii,onHandleKeyDown:Ce=>{if(Ce.key==="Enter"&&!Ce.shiftKey){if(Ce.preventDefault(),us(h)){const Rt=h.slice(1).split(" ")[0].toLowerCase();if(!pr(Rt)){fn(td?n("agentChat.commandsLoadErrorWarning",{command:Rt,commands:ea.map(Gr=>Gr.content).join(", "),errorMessage:Mi?.message||Ze?.message||"Unknown error"}):n("agentChat.unknownCommandWarning",{command:Rt,commands:$i()}));return}}rd();return}}}),tw=()=>{const Ce=l.current;Ce&&(Ce.style.height="auto",Ce.style.height=Math.min(Ce.scrollHeight,100)+"px")};return O.useEffect(()=>{tw()},[h]),O.useEffect(()=>{console.log("🔍 Session messages effect triggered:",{sessionMessagesData:Nr?.messages?.length||0,currentSessionId:m,hasSessionMessagesData:!!Nr,messagesLength:Nr?.messages?.length,isLoadingMessages:V}),Nr?.messages&&m?(console.log("✅ Loading session messages:",Nr.messages.length),S(Nr.messages),V&&setTimeout(()=>{ye(!1)},100)):m&&Nr&&Nr.messages?.length===0&&(console.log("🗑️ Loading empty session messages"),S([]),V&&setTimeout(()=>{ye(!1)},100))},[Nr,m,S,V,n]),O.useEffect(()=>{const Ce=Rt=>{Rt.target.closest(".dropdown-container")||(Di(!1),Pi(!1),Xh(!1))};return document.addEventListener("mousedown",Ce),()=>document.removeEventListener("mousedown",Ce)},[]),O.useEffect(()=>{if(!m||!fl?.sessions){gn(!1);return}const Ce=fl.sessions.find(Rt=>Rt.sessionId===m);Ce?(console.log(`🔒 Found active session: ${m}, version: ${Ce.claudeVersionId}, model: ${Ce.modelId}`),Ce.claudeVersionId?(Mr!==Ce.claudeVersionId&&(console.log(`🔄 Changing Claude version from ${Mr} to ${Ce.claudeVersionId}`),ji(Ce.claudeVersionId)),Ce.modelId&&Ur!==Ce.modelId&&(console.log(`🔄 Restoring model from ${Ur} to ${Ce.modelId}`),Wn(Ce.modelId)),gn(!0),console.log(`🔒 Locked to Claude version: ${Ce.claudeVersionId}, model: ${Ce.modelId}`)):(gn(!1),console.log("🔓 Session has no specific version, unlocked but keeping user selection"))):(gn(!1),console.log(`🔓 Session ${m} not in active sessions, unlocked but keeping user selection`))},[m,fl,Mr,Ur,Wn]),p.jsxs("div",{className:"flex flex-col h-full bg-white dark:bg-gray-900",children:[p.jsx("div",{className:"flex-shrink-0 h-12 px-4 border-b border-gray-200 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 flex items-center",children:p.jsxs("div",{className:"flex items-center justify-between w-full",children:[p.jsx("div",{className:"flex-1 min-w-0",children:p.jsxs("h1",{className:"text-base font-semibold flex items-center space-x-2 text-gray-900 dark:text-white",children:[p.jsx("span",{className:"text-lg flex-shrink-0",children:e.ui.icon}),p.jsxs("span",{className:"truncate",children:["[",V1,"]"]}),t&&p.jsx("span",{className:"text-sm opacity-75 font-normal truncate flex-shrink-0",title:t,children:t.split("/").pop()||t}),m&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-sm opacity-75",children:"-"}),p.jsx("span",{className:"text-sm opacity-75 truncate",children:ed?.sessions?.find(Ce=>Ce.id===m)?.title||n("agentChat.currentSession")})]})]})}),p.jsxs("div",{className:"flex space-x-1 flex-shrink-0 ml-2",children:[p.jsx("button",{onClick:Q1,className:"p-1.5 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md transition-colors text-gray-600 dark:text-gray-300",title:n("agentChat.newSession"),children:p.jsx(lg,{className:"w-4 h-4"})}),p.jsxs("div",{className:"relative",children:[p.jsx("button",{onClick:()=>L(!$),className:"p-1.5 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md transition-colors text-gray-600 dark:text-gray-300",title:n("agentChat.sessionHistory"),children:p.jsx(Zr,{className:"w-4 h-4"})}),p.jsx(Ww,{isOpen:$,onToggle:()=>L(!$),sessions:ed?.sessions||[],currentSessionId:m,onSwitchSession:X1,isLoading:!1,searchTerm:R,onSearchChange:te})]}),p.jsx("button",{onClick:it,disabled:!m||V,className:"p-1.5 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md transition-colors text-gray-600 dark:text-gray-300 disabled:opacity-50 disabled:cursor-not-allowed",title:n("agentChat.refreshMessages"),children:p.jsx(sg,{className:`w-4 h-4 ${V?"animate-spin":""}`})})]})]})}),p.jsxs("div",{className:"flex-1 relative min-h-0",children:[p.jsxs("div",{ref:a,className:"absolute inset-0 px-5 py-5 overflow-y-auto space-y-4",children:[p.jsx("div",{className:"px-4",children:p.jsx("div",{className:"text-sm leading-relaxed break-words overflow-hidden text-gray-600 dark:text-gray-400",children:e.ui.welcomeMessage||e.description})}),V?p.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-3",children:[p.jsxs("div",{className:"flex space-x-2",children:[p.jsx("div",{className:"w-3 h-3 bg-gray-400 dark:bg-gray-500 rounded-full animate-bounce"}),p.jsx("div",{className:"w-3 h-3 bg-gray-400 dark:bg-gray-500 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),p.jsx("div",{className:"w-3 h-3 bg-gray-400 dark:bg-gray-500 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]}),p.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:n("agentChat.loadingMessages")})]}):p.jsx(vO,{messages:d,isLoadingMessages:V,isInitializingSession:F,isAiTyping:g,isStopping:I,messagesContainerRef:a,messagesEndRef:o,isUserScrolling:Kh,newMessagesCount:Zh,onScrollToBottom:Jh,onAskUserQuestionSubmit:J1}),p.jsx("div",{ref:o})]}),Kh&&Zh>0&&p.jsxs("button",{onClick:()=>{Jh(),U1(!1),q1(0)},className:"absolute bottom-4 left-1/2 transform -translate-x-1/2 bg-blue-500 hover:bg-blue-600 text-white rounded-full px-4 py-2 shadow-lg flex items-center space-x-2 transition-all duration-200 z-10",children:[p.jsx("span",{className:"text-sm font-medium",children:n("agentChat.scrollToLatest")}),p.jsx(ui,{className:"w-4 h-4"})]})]}),p.jsx(MO,{inputMessage:h,selectedImages:yt,isAiTyping:g,isStopping:I,isMobile:s,showToolSelector:dl,selectedRegularTools:he,selectedMcpTools:z,mcpToolsEnabled:Z,showCommandSelector:bt,showFileBrowser:Js,commandSearch:at,selectedCommand:ot,selectedCommandIndex:Ke,atSymbolPosition:hn,commandWarning:Kt||"",permissionMode:se,selectedModel:Ur,selectedClaudeVersion:Mr||"",showPermissionDropdown:qe,showModelDropdown:pt,showVersionDropdown:Je,showMobileSettings:E,isCompactMode:i,isVersionLocked:ta,isDragOver:Ee,previewImage:Nt,showConfirmDialog:M,confirmMessage:D||"",showMcpStatusModal:N,availableModels:ra,claudeVersionsData:nr,agent:e,projectPath:t,mcpStatus:b,textareaRef:l,fileInputRef:c,onSend:rd,handleKeyDown:ew,handleImageSelect:st,handleImageRemove:ft,handleImagePreview:ze,handlePaste:Lt,handleDragOver:gt,handleDragLeave:G,handleDrop:J,handleStopGeneration:K1,onSetInputMessage:f,onSetShowToolSelector:kt,onSetSelectedRegularTools:ir,onSetSelectedMcpTools:Vr,onSetMcpToolsEnabled:Bi,onSetPermissionMode:lt,onSetSelectedModel:Wn,onSetSelectedClaudeVersion:ji,onSetShowPermissionDropdown:Di,onSetShowModelDropdown:Pi,onSetShowVersionDropdown:Xh,onSetShowMobileSettings:H,onSetPreviewImage:Se,onSetShowConfirmDialog:B,onSetShowMcpStatusModal:Q,onCommandSelect:Vt,onSetShowCommandSelector:pn,onSetSelectedCommandIndex:Ni,onSetShowFileBrowser:Li,onSetAtSymbolPosition:Ii,onSetCommandWarning:fn,onSetCommandSearch:hl,handleConfirmDialog:Y,handleCancelDialog:U,isSendDisabled:()=>Z1()||!!y,envVars:Qh,onSetEnvVars:W1})]})},Jp=({isPanelVisible:e,onToggle:t,position:r,className:n=""})=>{const a=(r==="left"?e?"left":"right":e?"right":"left")==="left"?og:Rs,o=()=>{const l="fixed top-1/2 transform -translate-y-1/2 z-20";return r==="left"?`${l} left-2`:`${l} right-2`};return p.jsx("button",{onClick:t,className:`
394
+ ${o()}
395
+ w-8 h-8 rounded-full
396
+ bg-gray-500/10 dark:bg-gray-400/10
397
+ border border-gray-500/20 dark:border-gray-400/20
398
+ text-gray-600 dark:text-gray-300
399
+ hover:bg-gray-500/20 dark:hover:bg-gray-400/20
400
+ hover:scale-110 hover:border-gray-500/40 dark:hover:border-gray-400/40
401
+ hover:text-gray-800 dark:hover:text-white
402
+ transition-all duration-200 ease-in-out
403
+ flex items-center justify-center
404
+ backdrop-blur-sm
405
+ shadow-sm hover:shadow-md
406
+ ${n}
407
+ `,title:r==="left"?e?"隐藏聊天界面":"显示聊天界面":e?"隐藏可视化界面":"显示可视化界面",children:p.jsx(a,{className:"w-4 h-4"})})},LO=({children:e,defaultLeftWidth:t=35,minWidth:r=20,maxWidth:n=80,hideLeftPanel:i=!1,hideRightPanel:s=!1,onToggleLeftPanel:a,onToggleRightPanel:o,mobileLayout:l="stack"})=>{const{isMobile:c,rightPanelOpen:u,setRightPanelOpen:h}=dg(),[f,d]=O.useState(t),[g,m]=O.useState(!1),[b,y]=O.useState("left"),k=O.useRef(null),v=w=>{c||(w.preventDefault(),m(!0))},C=O.useCallback(w=>{if(!g||!k.current||c)return;const T=k.current.getBoundingClientRect(),$=(w.clientX-T.left)/T.width*100,M=Math.min(Math.max($,r),n);d(M)},[g,r,n,c]),S=O.useCallback(()=>{m(!1)},[]);if(O.useEffect(()=>(g&&!c?(document.addEventListener("mousemove",C),document.addEventListener("mouseup",S),document.body.style.cursor="col-resize",document.body.style.userSelect="none"):(document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",S),document.body.style.cursor="",document.body.style.userSelect=""),()=>{document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",S),document.body.style.cursor="",document.body.style.userSelect=""}),[g,C,S,c]),c){if(l==="tabs"){const w=!s;return p.jsxs("div",{className:"flex flex-col h-full bg-gray-100",children:[w&&p.jsxs("div",{className:"flex-shrink-0 flex border-b border-gray-200 bg-white",children:[p.jsx("button",{onClick:()=>{y("left"),h(!1)},className:`flex-1 px-4 py-3 text-sm font-medium transition-colors ${b==="left"&&!u?"text-blue-600 border-b-2 border-blue-600 bg-blue-50":"text-gray-500 hover:text-gray-700 hover:bg-gray-50"}`,children:"Chat"}),p.jsx("button",{onClick:()=>{y("right"),h(!0)},className:`flex-1 px-4 py-3 text-sm font-medium transition-colors ${b==="right"||u?"text-blue-600 border-b-2 border-blue-600 bg-blue-50":"text-gray-500 hover:text-gray-700 hover:bg-gray-50"}`,children:"Preview"})]}),p.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:!s&&w&&(b==="right"||u)?p.jsx("div",{className:"h-full",children:e[1]}):p.jsx("div",{className:"h-full",children:e[0]})})]})}return p.jsxs("div",{className:"flex flex-col h-full bg-gray-100",children:[p.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:e[0]}),!s&&u&&p.jsxs("div",{className:"fixed inset-0 z-50 lg:hidden",children:[p.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-50",onClick:()=>h(!1)}),p.jsxs("div",{className:"absolute inset-4 bg-white rounded-lg shadow-xl overflow-hidden",children:[p.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200",children:[p.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Preview"}),p.jsx("button",{onClick:()=>h(!1),className:"p-2 text-gray-500 hover:text-gray-700 rounded-md hover:bg-gray-100",children:p.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),p.jsx("div",{className:"h-[calc(100%-73px)]",children:e[1]})]})]}),!s&&!u&&o&&p.jsx("button",{onClick:()=>h(!0),className:"fixed bottom-6 right-6 z-40 bg-blue-600 text-white p-4 rounded-full shadow-lg hover:bg-blue-700 transition-colors lg:hidden",title:"Open Preview",children:p.jsxs("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})})]})}return p.jsxs("div",{ref:k,className:"flex h-full bg-gray-100 relative",children:[p.jsx("div",{className:`
408
+ flex flex-col relative
409
+ ${i?"hidden":"block"}
410
+ `,style:{width:s?"100%":`${f}%`},children:e[0]}),!i&&!s&&p.jsx("div",{className:`
411
+ resize-separator relative z-10
412
+ ${g?"w-2 bg-blue-500":"w-1.5 bg-gray-300 hover:bg-blue-400"}
413
+ cursor-col-resize transition-all duration-200
414
+ flex items-center justify-center
415
+ group
416
+ `,onMouseDown:v,children:p.jsx("div",{className:"absolute inset-y-0 flex items-center justify-center",children:p.jsx("div",{className:"flex flex-col items-center justify-center gap-1 py-2",children:p.jsxs("div",{className:"flex gap-0.5 opacity-40 group-hover:opacity-70 transition-opacity",children:[p.jsx("div",{className:"w-0.5 h-4 bg-gray-600 dark:bg-gray-400 rounded-full"}),p.jsx("div",{className:"w-0.5 h-4 bg-gray-600 dark:bg-gray-400 rounded-full"})]})})})}),p.jsx("div",{className:`
417
+ flex flex-col border-l border-gray-200 relative
418
+ ${s?"hidden":"block"}
419
+ `,style:{width:i?"100%":`${100-f}%`},children:e[1]}),a&&p.jsx(Jp,{isPanelVisible:!i,onToggle:a,position:"left",className:"panel-toggle-left"}),o&&p.jsx(Jp,{isPanelVisible:!s,onToggle:o,position:"right",className:"panel-toggle-right"})]})},IO=({currentView:e,onViewChange:t,hasCustomComponent:r,className:n=""})=>{if(!r)return null;const i=()=>{t(e==="files"?"custom":"files")},s=e==="files"?Iw:ag,a=e==="files"?"Agent 界面":"文件浏览器";return p.jsxs("button",{onClick:i,className:`
420
+ fixed bottom-6 right-6 z-30
421
+ w-12 h-12 rounded-full
422
+ bg-white dark:bg-gray-800
423
+ border border-gray-200 dark:border-gray-600
424
+ shadow-lg hover:shadow-xl
425
+ text-gray-600 dark:text-gray-300
426
+ hover:text-blue-600 dark:hover:text-blue-400
427
+ hover:bg-blue-50 dark:hover:bg-blue-900/20
428
+ hover:border-blue-200 dark:hover:border-blue-700
429
+ transition-all duration-200 ease-in-out
430
+ flex items-center justify-center
431
+ group
432
+ backdrop-blur-sm
433
+ ${n}
434
+ `,title:`切换到${a}`,children:[p.jsx(s,{className:"w-5 h-5"}),p.jsx("div",{className:`
435
+ absolute bottom-full right-0 mb-2 px-2 py-1
436
+ bg-gray-900 dark:bg-gray-700
437
+ text-white text-xs rounded
438
+ opacity-0 group-hover:opacity-100
439
+ transition-opacity duration-200
440
+ pointer-events-none
441
+ whitespace-nowrap
442
+ `,children:a})]})},$O=({agent:e,projectPath:t,CustomComponent:r})=>{const[n,i]=O.useState(r?"custom":"files"),s=!!r;return p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"h-full bg-white dark:bg-gray-900 overflow-hidden",children:s?p.jsxs(p.Fragment,{children:[p.jsx("div",{className:`h-full ${n==="custom"?"block":"hidden"}`,children:p.jsx(r,{agent:e,projectPath:t})}),p.jsx("div",{className:`h-full ${n==="files"?"block":"hidden"}`,children:p.jsx(ud,{projectPath:t,onFileSelect:a=>{console.log("Selected file:",a)},className:"h-full"})})]}):p.jsx(ud,{projectPath:t,onFileSelect:a=>{console.log("Selected file:",a)},className:"h-full"})}),p.jsx(IO,{currentView:n,onViewChange:i,hasCustomComponent:s,className:"floating-toggle"})]})},jO=({projectPath:e})=>{const{t}=we("agents"),{data:r,isLoading:n,error:i}=aw(e),s=Tu(),a=O.useRef({}),o=()=>{s.invalidateQueries({queryKey:["slides",e]}),s.invalidateQueries({queryKey:["slide-content"]}),Object.values(a.current).forEach(c=>{c?.refreshIframe&&c.refreshIframe()})};if(O.useEffect(()=>{const c=u=>{console.log("🔄 Received AI_RESPONSE_COMPLETE event in SlidePreviewPanel:",u),u.projectPath===e&&(console.log("🔄 Auto-refreshing slides after AI response completion"),o())};return ac.on(oc.AI_RESPONSE_COMPLETE,c),()=>{ac.off(oc.AI_RESPONSE_COMPLETE,c)}},[e,s]),n)return p.jsx("div",{className:"flex items-center justify-center h-full",children:p.jsx("div",{className:"text-gray-500",children:t("slidePreview.loading")})});if(i)return p.jsx("div",{className:"flex items-center justify-center h-full",children:p.jsx("div",{className:"text-red-500",children:t("slidePreview.loadError")})});const l=r?.slides||[];return p.jsxs("div",{className:"flex flex-col h-full bg-gray-50 dark:bg-gray-900",children:[p.jsx("div",{className:"h-12 px-5 bg-gray-100 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 flex items-center",children:p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center space-x-3",children:[p.jsx("h2",{className:"text-lg font-semibold text-gray-800 dark:text-white",children:t("slidePreview.title")}),p.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400 bg-gray-100 dark:bg-gray-700 px-2 py-0.5 rounded",children:r?.title||"Presentation"})]}),p.jsxs("button",{onClick:o,disabled:n,className:"flex items-center space-x-1 px-3 py-1.5 text-sm bg-blue-50 dark:bg-blue-900/30 hover:bg-blue-100 dark:hover:bg-blue-900/50 text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 rounded-md transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:t("slidePreview.refreshTitle"),children:[p.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),p.jsx("span",{children:t("slidePreview.refresh")})]})]})}),p.jsx("div",{className:"flex-1 overflow-y-auto",children:l.length===0?p.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500 dark:text-gray-400 p-5",children:[p.jsx("div",{className:"text-lg mb-2",children:t("slidePreview.noSlides")}),p.jsx("div",{className:"text-sm",children:t("slidePreview.createWithAI")})]}):p.jsx("div",{className:"space-y-4 p-5",children:l.map(c=>p.jsx(ow,{ref:u=>{u?a.current[c.index]=u:delete a.current[c.index]},slide:c,totalSlides:l.length,projectPath:e},c.index))})})]})},BO={rightPanelComponent:jO,onMount:e=>{console.log(`Slides agent ${e} mounted`)},onUnmount:e=>{console.log(`Slides agent ${e} unmounted`)}},DO={onMount:e=>{console.log(`Chat agent ${e} mounted`)},onUnmount:e=>{console.log(`Chat agent ${e} unmounted`)}},PO={slides:BO,chat:DO},FO=e=>PO[e];function RO({status:e,originalTitle:t=document.title,workingText:r="🤖 AI 正在工作",completedText:n="✅ 已完成",errorText:i="❌ 发生错误",marqueeSpeed:s=300,blinkInterval:a=800}){const o=O.useRef(null),l=O.useRef(!document.hidden),c=O.useRef(t),u=O.useRef("idle");O.useEffect(()=>{document.hidden||(c.current=t)},[t]);const h=()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},f=()=>{h(),document.title=c.current},d=m=>{h();let b=0;const y=`${m}... `,k=()=>{const v=y.slice(b)+y.slice(0,b);document.title=v,b=(b+1)%y.length};k(),o.current=window.setInterval(k,s)},g=m=>{h();let b=!0;const y=()=>{document.title=b?m:c.current,b=!b};y(),o.current=window.setInterval(y,a)};O.useEffect(()=>{const m=()=>{if(l.current=!document.hidden,!document.hidden)f();else{const b=u.current;b==="working"?d(r):b==="completed"?g(n):b==="error"&&g(i)}};return document.addEventListener("visibilitychange",m),()=>{document.removeEventListener("visibilitychange",m),h()}},[r,n,i,s,a]),O.useEffect(()=>{u.current=e,document.hidden&&(e==="working"?d(r):e==="completed"?g(n):e==="error"?g(i):e==="idle"&&f())},[e,r,n,i]),O.useEffect(()=>()=>{h(),document.title=c.current},[])}const OO=()=>{const{t:e}=we("pages"),{agentId:t}=Bw(),[r]=hg(),n=Dw(),i=r.get("project"),s=r.get("session"),{data:a,isLoading:o,error:l}=dw(t),{setCurrentAgent:c,setCurrentSessionId:u,isAiTyping:h}=Xe(),[f,d]=O.useState(!1),[g,m]=O.useState(!1),[b,y]=O.useState(!1),[k,v]=O.useState(null),[C,S]=O.useState(!1),w=mr.useRef(!1),T=a?.agent;O.useEffect(()=>{h?(w.current=!0,S(!1)):w.current&&(document.hidden||(S(!0),w.current=!1))},[h]),O.useEffect(()=>{const B=()=>{!document.hidden&&!h&&w.current&&(S(!0),w.current=!1)};return document.addEventListener("visibilitychange",B),()=>document.removeEventListener("visibilitychange",B)},[h]);const $=O.useMemo(()=>k?"error":h?"working":!h&&w.current&&!C?"completed":"idle",[h,k,C]);RO({status:$,originalTitle:T?`${T.ui.icon} ${T.name} - AgentStudio`:"AgentStudio",workingText:e("chat.tabNotification.working"),completedText:e("chat.tabNotification.completed"),errorText:e("chat.tabNotification.error")}),O.useEffect(()=>{if(l){v(l);const B=setTimeout(()=>v(null),5e3);return()=>clearTimeout(B)}},[l]),O.useEffect(()=>{console.log("🎯 ChatPage agent/session effect:",{hasAgent:!!T,agentId:T?.id,sessionId:s,urlSessionId:r.get("session")}),T&&(console.log("🎯 Setting current agent:",T.id),c(T),s&&(console.log("🎯 Setting session ID:",s),u(s)))},[T,s,c,u]),O.useEffect(()=>{T&&!i&&d(!0)},[T,i]);const M=B=>{const H=new URLSearchParams;H.set("project",B),s&&H.set("session",s),n(`/chat/${t}?${H.toString()}`,{replace:!0}),d(!1)},E=B=>{const H=new URLSearchParams;i&&H.set("project",i),B&&H.set("session",B),n(`/chat/${t}?${H.toString()}`,{replace:!0})},N=()=>{d(!1),n("/agents")},D=O.useMemo(()=>{if(T?.ui?.componentType)return FO(T.ui.componentType)},[T]),R=D?.rightPanelComponent;if(O.useEffect(()=>{if(!(!T||!D))return D.onMount&&D.onMount(T.id),()=>{D.onUnmount&&D.onUnmount(T.id)}},[T,D]),o)return p.jsx("div",{className:"min-h-screen bg-gray-100 dark:bg-gray-900 flex items-center justify-center",children:p.jsxs("div",{className:"text-center",children:[p.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"}),p.jsx("div",{className:"text-gray-600 dark:text-gray-400",children:e("chat.loading")})]})});if(l||!T)return p.jsx("div",{className:"min-h-screen bg-gray-100 dark:bg-gray-900 flex items-center justify-center",children:p.jsxs("div",{className:"text-center max-w-md",children:[p.jsx("div",{className:"text-6xl mb-6",children:"❌"}),p.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white mb-4",children:e("chat.agentNotFound")}),p.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:e("chat.agentNotFoundDesc")}),p.jsx("button",{onClick:()=>window.close(),className:"px-6 py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:e("chat.closePage")})]})});if(!T.enabled)return p.jsx("div",{className:"min-h-screen bg-gray-100 dark:bg-gray-900 flex items-center justify-center",children:p.jsxs("div",{className:"text-center max-w-md",children:[p.jsx("div",{className:"text-6xl mb-6 opacity-50",children:T.ui.icon}),p.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white mb-4",children:e("chat.agentDisabled")}),p.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:e("chat.agentDisabledDesc",{name:T.name})}),p.jsx("div",{className:"flex space-x-4 justify-center",children:p.jsx("button",{onClick:()=>window.close(),className:"px-6 py-3 bg-gray-600 text-white rounded-lg hover:bg-gray-700 transition-colors",children:e("chat.closePage")})})]})});const I=()=>{const B=!g;m(B),B&&b&&y(!1)},F=()=>{const B=!b;y(B),B&&g&&m(!1)},L=()=>p.jsxs(LO,{hideLeftPanel:g,hideRightPanel:b,onToggleLeftPanel:I,onToggleRightPanel:F,mobileLayout:"tabs",children:[p.jsx(NO,{agent:T,projectPath:i||void 0,onSessionChange:E}),p.jsx($O,{agent:T,projectPath:i||void 0,CustomComponent:R})]});return p.jsxs("div",{className:"h-screen bg-gray-100 dark:bg-gray-900",children:[L(),f&&T&&p.jsx(Rw,{agent:T,onProjectSelect:M,onClose:N})]})},N6=Object.freeze(Object.defineProperty({__proto__:null,ChatPage:OO},Symbol.toStringTag,{value:"Module"}));export{If as $,gs as A,jE as B,tM as C,Nh as D,St as E,Lm as F,I3 as G,jI as H,ef as I,O$ as J,mA as K,pi as L,n6 as M,Ko as N,BA as O,Xu as P,qs as Q,vr as R,wI as S,lh as T,ke as U,c6 as V,d6 as W,Vn as X,$f as Y,C3 as Z,x as _,XA as a,qt as a$,p6 as a0,f6 as a1,h6 as a2,o6 as a3,l6 as a4,m6 as a5,u6 as a6,g6 as a7,ff as a8,_I as a9,ue as aA,S6 as aB,q5 as aC,R5 as aD,F5 as aE,VD as aF,vI as aG,r6 as aH,Ks as aI,qD as aJ,WD as aK,ih as aL,Qr as aM,Tf as aN,tL as aO,Es as aP,Fn as aQ,k3 as aR,My as aS,Vo as aT,Qo as aU,mo as aV,Ly as aW,Ay as aX,QB as aY,ce as aZ,xy as a_,$a as aa,L3 as ab,WA as ac,Ws as ad,ae,fe as af,Om as ag,x5 as ah,Rk as ai,T6 as aj,H$ as ak,dt as al,ln as am,kh as an,hb as ao,zn as ap,Py as aq,b3 as ar,hB as as,d3 as at,wh as au,Lp as av,l4 as aw,_6 as ax,E6 as ay,C6 as az,YA as b,YN as b0,nh as b1,e0 as b2,Vs as b3,n0 as b4,a6 as b5,$E as b6,y3 as b7,h3 as b8,Zj as b9,w3 as bA,Xo as bB,N6 as bC,vh as ba,VB as bb,v3 as bc,Xs as bd,_i as be,fo as bf,n3 as bg,L4 as bh,Ys as bi,go as bj,KB as bk,vy as bl,tB as bm,rB as bn,kn as bo,Jf as bp,nB as bq,Ch as br,eB as bs,aB as bt,Ti as bu,on as bv,Yf as bw,Sh as bx,Sy as by,gu as bz,Pe as c,$e as d,Rm as e,ut as f,KA as g,Or as h,tr as i,Y$ as j,Ci as k,X as l,Ry as m,i6 as n,M6 as o,ZA as p,JA as q,A6 as r,QA as s,z$ as t,cr as u,B5 as v,B3 as w,x6 as x,GA as y,s6 as z};