agentstudio 0.3.3 → 0.4.0
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.
- package/bin/agentstudio.js +44 -4
- package/bin/agentstudio.js.map +1 -1
- package/bin/serviceManager.d.ts.map +1 -1
- package/bin/serviceManager.js +312 -28
- package/bin/serviceManager.js.map +1 -1
- package/config/engineConfig.d.ts +96 -0
- package/config/engineConfig.d.ts.map +1 -0
- package/config/engineConfig.js +429 -0
- package/config/engineConfig.js.map +1 -0
- package/engines/claude/__tests__/supportedModels.test.d.ts +10 -0
- package/engines/claude/__tests__/supportedModels.test.d.ts.map +1 -0
- package/engines/claude/__tests__/supportedModels.test.js +89 -0
- package/engines/claude/__tests__/supportedModels.test.js.map +1 -0
- package/engines/claude/aguiAdapter.d.ts +101 -0
- package/engines/claude/aguiAdapter.d.ts.map +1 -0
- package/engines/claude/aguiAdapter.js +382 -0
- package/engines/claude/aguiAdapter.js.map +1 -0
- package/engines/claude/claudeEngine.d.ts +42 -0
- package/engines/claude/claudeEngine.d.ts.map +1 -0
- package/engines/claude/claudeEngine.js +325 -0
- package/engines/claude/claudeEngine.js.map +1 -0
- package/engines/claude/index.d.ts +8 -0
- package/engines/claude/index.d.ts.map +1 -0
- package/engines/claude/index.js +14 -0
- package/engines/claude/index.js.map +1 -0
- package/engines/cursor/__tests__/a2aAdapter.test.d.ts +6 -0
- package/engines/cursor/__tests__/a2aAdapter.test.d.ts.map +1 -0
- package/engines/cursor/__tests__/a2aAdapter.test.js +376 -0
- package/engines/cursor/__tests__/a2aAdapter.test.js.map +1 -0
- package/engines/cursor/a2aAdapter.d.ts +180 -0
- package/engines/cursor/a2aAdapter.d.ts.map +1 -0
- package/engines/cursor/a2aAdapter.js +405 -0
- package/engines/cursor/a2aAdapter.js.map +1 -0
- package/engines/cursor/aguiAdapter.d.ts +97 -0
- package/engines/cursor/aguiAdapter.d.ts.map +1 -0
- package/engines/cursor/aguiAdapter.js +507 -0
- package/engines/cursor/aguiAdapter.js.map +1 -0
- package/engines/cursor/cursorEngine.d.ts +68 -0
- package/engines/cursor/cursorEngine.d.ts.map +1 -0
- package/engines/cursor/cursorEngine.js +465 -0
- package/engines/cursor/cursorEngine.js.map +1 -0
- package/engines/cursor/index.d.ts +11 -0
- package/engines/cursor/index.d.ts.map +1 -0
- package/engines/cursor/index.js +21 -0
- package/engines/cursor/index.js.map +1 -0
- package/engines/engineManager.d.ts +80 -0
- package/engines/engineManager.d.ts.map +1 -0
- package/engines/engineManager.js +137 -0
- package/engines/engineManager.js.map +1 -0
- package/engines/index.d.ts +26 -0
- package/engines/index.d.ts.map +1 -0
- package/engines/index.js +81 -0
- package/engines/index.js.map +1 -0
- package/engines/types.d.ts +319 -0
- package/engines/types.d.ts.map +1 -0
- package/engines/types.js +69 -0
- package/engines/types.js.map +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +178 -25
- package/index.js.map +1 -1
- package/middleware/auth.d.ts.map +1 -1
- package/middleware/auth.js +4 -0
- package/middleware/auth.js.map +1 -1
- package/package.json +7 -1
- package/public/assets/AgentsPage-D462iGRy.js +10 -0
- package/public/assets/{Button-BoiVlafj.js → Button-B_6lGF64.js} +1 -1
- package/public/assets/ChatPage-NjuRQPaL.js +478 -0
- package/public/assets/{CommandForm-Se4iemMp.js → CommandForm-DwGvE9A_.js} +1 -1
- package/public/assets/CommandsPage-DeUS8fhJ.js +1 -0
- package/public/assets/CursorConfigPage-Bl1Blrbr.js +1 -0
- package/public/assets/{DashboardPage-DbCVzPKz.js → DashboardPage-DH-2iuqf.js} +1 -1
- package/public/assets/EngineGate-DxTYx9wb.js +1 -0
- package/public/assets/{FileBrowser-DcoBWzKK.js → FileBrowser-CeGsJnUL.js} +5 -5
- package/public/assets/{FileExplorer-B41BB0LM.js → FileExplorer-x5R0Tcmk.js} +1 -1
- package/public/assets/GeneralSettingsPage-lhNEJQD_.js +1 -0
- package/public/assets/HooksPage-9fingjdz.js +1 -0
- package/public/assets/LandingPage-BAzi8PDo.js +1 -0
- package/public/assets/LoginPage-kQ_NWy8p.js +16 -0
- package/public/assets/McpAdminSettingsPage-DQHpWHRC.js +7 -0
- package/public/assets/McpPage-DLHfmhSJ.js +20 -0
- package/public/assets/{MemorySettingsPage-DYSuz-hU.js → MemorySettingsPage-CRIPja9X.js} +1 -1
- package/public/assets/ModelsPage-Bb5vSsuc.js +1 -0
- package/public/assets/PluginsPage-BhKM7gV7.js +12 -0
- package/public/assets/ProjectSelector-Cbct6pnn.js +1 -0
- package/public/assets/ProjectsPage-lQo7-7dt.js +21 -0
- package/public/assets/RulesPage-BRnB7__3.js +1 -0
- package/public/assets/ScheduledTasksPage-CZiABTSb.js +1 -0
- package/public/assets/SettingsLayout-BfG7ftoT.js +1 -0
- package/public/assets/SkillsPage-CL6MKxQ9.js +18 -0
- package/public/assets/{SubagentForm-C0R084ja.js → SubagentForm-BzzeWg0W.js} +2 -2
- package/public/assets/{SubagentsPage-BKFNmqxg.js → SubagentsPage-DhFP2kDE.js} +1 -1
- package/public/assets/SystemInfoPage-CFHUN3j8.js +1 -0
- package/public/assets/{TelemetrySettingsPage-Ck2btMol.js → TelemetrySettingsPage-BcZFVBXN.js} +1 -1
- package/public/assets/{ToastTestPage-B79DFhqI.js → ToastTestPage-BtGnZdyk.js} +1 -1
- package/public/assets/{ToolsList-Kfxwp80g.js → ToolsList-CTsQr53G.js} +1 -1
- package/public/assets/{UnifiedToolSelector-CkafUbz3.js → UnifiedToolSelector-BP6fuyzG.js} +1 -1
- package/public/assets/VersionSettingsPage-DjOjyL3X.js +5 -0
- package/public/assets/VoiceSettingsPage-d3l9AWBn.js +1 -0
- package/public/assets/WebSocketTunnelPage-CfHtJR9r.js +1 -0
- package/public/assets/_basePickBy-Bac3af5O.js +1 -0
- package/public/assets/{_baseUniq-COj5YnAO.js → _baseUniq-Dvh9sZ-T.js} +1 -1
- package/public/assets/{agents-3mB536QF.js → agents-KlPdWQ8K.js} +1 -1
- package/public/assets/arc-CRR5EPpK.js +1 -0
- package/public/assets/{architectureDiagram-VXUJARFQ-DD1BwT1T.js → architectureDiagram-VXUJARFQ-Ct1p8kmV.js} +1 -1
- package/public/assets/{blockDiagram-VD42YOAC-DFKUIZc6.js → blockDiagram-VD42YOAC-CX_8YiYn.js} +1 -1
- package/public/assets/{c4Diagram-YG6GDRKO-B0VVIIvh.js → c4Diagram-YG6GDRKO-BIBVWIY4.js} +1 -1
- package/public/assets/channel-CPs-2Y_m.js +1 -0
- package/public/assets/{chunk-4BX2VUAB-DM8J7YO9.js → chunk-4BX2VUAB-CQNNXsb5.js} +1 -1
- package/public/assets/{chunk-55IACEB6-BjhdmGlM.js → chunk-55IACEB6-N_ZrGhOu.js} +1 -1
- package/public/assets/{chunk-B4BG7PRW-1RJ6n2xv.js → chunk-B4BG7PRW-CI6DkhbM.js} +1 -1
- package/public/assets/{chunk-DI55MBZ5-1-EHSO67.js → chunk-DI55MBZ5-Dgj-Eo9U.js} +1 -1
- package/public/assets/{chunk-FMBD7UC4-DV3SMJK_.js → chunk-FMBD7UC4-o4B0HzSK.js} +1 -1
- package/public/assets/{chunk-QN33PNHL-IlsCTdDq.js → chunk-QN33PNHL-DXlfdPIk.js} +1 -1
- package/public/assets/{chunk-QZHKN3VN-DJXs-Fqo.js → chunk-QZHKN3VN-ZCBUGD7e.js} +1 -1
- package/public/assets/{chunk-TZMSLE5B-BxHO9wa1.js → chunk-TZMSLE5B-N3lZ106d.js} +1 -1
- package/public/assets/classDiagram-2ON5EDUG-DCwNRxvC.js +1 -0
- package/public/assets/classDiagram-v2-WZHVMYZB-DCwNRxvC.js +1 -0
- package/public/assets/clone-C3DcKvhB.js +1 -0
- package/public/assets/{cose-bilkent-S5V4N54A-BVJXoW_K.js → cose-bilkent-S5V4N54A-Crc39J9q.js} +1 -1
- package/public/assets/{dagre-6UL2VRFP-DHDnVshA.js → dagre-6UL2VRFP-nC3WLCf7.js} +1 -1
- package/public/assets/{diagram-PSM6KHXK-40qGxDeg.js → diagram-PSM6KHXK-B5DQIDQ3.js} +1 -1
- package/public/assets/diagram-QEK2KX5R-BccDOQuz.js +43 -0
- package/public/assets/{diagram-S2PKOQOG-D7AX72a5.js → diagram-S2PKOQOG-D-Cv16WE.js} +1 -1
- package/public/assets/{erDiagram-Q2GNP2WA-BHsgeBpL.js → erDiagram-Q2GNP2WA-Dr0ZgvnS.js} +1 -1
- package/public/assets/{flowDiagram-NV44I4VS-BYqChOSE.js → flowDiagram-NV44I4VS-DGbbfVi5.js} +1 -1
- package/public/assets/{ganttDiagram-LVOFAZNH-CZFFSLKX.js → ganttDiagram-LVOFAZNH-C-3Wnf96.js} +1 -1
- package/public/assets/{gitGraphDiagram-NY62KEGX-C5Bgrf0J.js → gitGraphDiagram-NY62KEGX--Q8whT5z.js} +1 -1
- package/public/assets/{graph-BP5lFRBg.js → graph-CO1DMS2E.js} +1 -1
- package/public/assets/{index-BEPv9Bqe.js → index-B5hSSnK3.js} +58 -58
- package/public/assets/index-gbHlIp96.css +1 -0
- package/public/assets/infoDiagram-F6ZHWCRC-DSR9cM2B.js +2 -0
- package/public/assets/{journeyDiagram-XKPGCS4Q--abC1RHz.js → journeyDiagram-XKPGCS4Q-Cc00zHNt.js} +1 -1
- package/public/assets/{kanban-definition-3W4ZIXB7-BJeChfWu.js → kanban-definition-3W4ZIXB7-BF_gHshF.js} +6 -6
- package/public/assets/{layout-DjAix4WK.js → layout-BxoLV88o.js} +1 -1
- package/public/assets/{linear-Cw0z8VNY.js → linear-Y8e2e012.js} +1 -1
- package/public/assets/{mindmap-definition-VGOIOE7T-U_T9xIUk.js → mindmap-definition-VGOIOE7T-CzpuQA4p.js} +1 -1
- package/public/assets/{pieDiagram-ADFJNKIX-B0mT9OgH.js → pieDiagram-ADFJNKIX-B22MhIcy.js} +2 -2
- package/public/assets/{quadrantDiagram-AYHSOK5B-BWdlgO0u.js → quadrantDiagram-AYHSOK5B-CTT9bIA8.js} +1 -1
- package/public/assets/{requirementDiagram-UZGBJVZJ-B-8LxsGB.js → requirementDiagram-UZGBJVZJ-B_vjXDH9.js} +1 -1
- package/public/assets/{sankeyDiagram-TZEHDZUN-OXuxkgGA.js → sankeyDiagram-TZEHDZUN-CKfZ4633.js} +1 -1
- package/public/assets/{sequenceDiagram-WL72ISMW-Bt5twlzi.js → sequenceDiagram-WL72ISMW-BmTPN6j6.js} +1 -1
- package/public/assets/{stateDiagram-FKZM4ZOC-Dmph7TeW.js → stateDiagram-FKZM4ZOC-y2fQE1C7.js} +1 -1
- package/public/assets/stateDiagram-v2-4FDKWEC3-C4CM6z52.js +1 -0
- package/public/assets/{table-DjMdAdjH.js → table-BJUz-ck5.js} +1 -1
- package/public/assets/{timeline-definition-IT6M3QCI-CcV8nyIH.js → timeline-definition-IT6M3QCI-DsXlR68n.js} +1 -1
- package/public/assets/{tools-BAI9XHGS.js → tools-BZTR2NP1.js} +1 -1
- package/public/assets/{treemap-KMMF4GRG-DBuwkj4f.js → treemap-KMMF4GRG-Cecs9uxX.js} +1 -1
- package/public/assets/{ui-components-DaGtjl0g.js → ui-components-DjgDPiqV.js} +153 -128
- package/public/assets/useAgents-8KXN6U61.js +2 -0
- package/public/assets/{useClaudeVersions-Cy71v4HE.js → useClaudeVersions-DicHLV6A.js} +1 -1
- package/public/assets/useCommands-DbSH48ba.js +1 -0
- package/public/assets/{useProjects-XgfgISgV.js → useProjects-Bbh6hJMM.js} +1 -1
- package/public/assets/{useSessions-CQgq4d84.js → useSessions-DOa4-xiB.js} +1 -1
- package/public/assets/{xychartDiagram-PRI3JC2R-Bo9K-U2S.js → xychartDiagram-PRI3JC2R-C2IWhyM7.js} +1 -1
- package/public/index.html +5 -5
- package/routes/a2a.d.ts +7 -0
- package/routes/a2a.d.ts.map +1 -1
- package/routes/a2a.js +193 -21
- package/routes/a2a.js.map +1 -1
- package/routes/agents.d.ts.map +1 -1
- package/routes/agents.js +45 -2
- package/routes/agents.js.map +1 -1
- package/routes/agui.d.ts +16 -0
- package/routes/agui.d.ts.map +1 -0
- package/routes/agui.js +520 -0
- package/routes/agui.js.map +1 -0
- package/routes/commands.d.ts.map +1 -1
- package/routes/commands.js +35 -3
- package/routes/commands.js.map +1 -1
- package/routes/cursorA2a.d.ts +18 -0
- package/routes/cursorA2a.d.ts.map +1 -0
- package/routes/cursorA2a.js +393 -0
- package/routes/cursorA2a.js.map +1 -0
- package/routes/engine.d.ts +12 -0
- package/routes/engine.d.ts.map +1 -0
- package/routes/engine.js +178 -0
- package/routes/engine.js.map +1 -0
- package/routes/gitVersions.d.ts +10 -0
- package/routes/gitVersions.d.ts.map +1 -0
- package/routes/gitVersions.js +147 -0
- package/routes/gitVersions.js.map +1 -0
- package/routes/hooks.d.ts +11 -0
- package/routes/hooks.d.ts.map +1 -0
- package/routes/hooks.js +303 -0
- package/routes/hooks.js.map +1 -0
- package/routes/mcp.d.ts.map +1 -1
- package/routes/mcp.js +28 -3
- package/routes/mcp.js.map +1 -1
- package/routes/plugins.d.ts.map +1 -1
- package/routes/plugins.js +317 -4
- package/routes/plugins.js.map +1 -1
- package/routes/rules.d.ts +9 -0
- package/routes/rules.d.ts.map +1 -0
- package/routes/rules.js +470 -0
- package/routes/rules.js.map +1 -0
- package/routes/sessions.d.ts.map +1 -1
- package/routes/sessions.js +68 -32
- package/routes/sessions.js.map +1 -1
- package/routes/speechToText.d.ts +8 -0
- package/routes/speechToText.d.ts.map +1 -0
- package/routes/speechToText.js +216 -0
- package/routes/speechToText.js.map +1 -0
- package/schemas/a2a.d.ts +2 -2
- package/services/__tests__/agentImporter.test.d.ts +5 -0
- package/services/__tests__/agentImporter.test.d.ts.map +1 -0
- package/services/__tests__/agentImporter.test.js +379 -0
- package/services/__tests__/agentImporter.test.js.map +1 -0
- package/services/__tests__/marketplaceUpdateService.test.d.ts +5 -0
- package/services/__tests__/marketplaceUpdateService.test.d.ts.map +1 -0
- package/services/__tests__/marketplaceUpdateService.test.js +227 -0
- package/services/__tests__/marketplaceUpdateService.test.js.map +1 -0
- package/services/__tests__/pluginInstaller.test.js +172 -0
- package/services/__tests__/pluginInstaller.test.js.map +1 -1
- package/services/__tests__/projectMetadataStorage.test.js +19 -4
- package/services/__tests__/projectMetadataStorage.test.js.map +1 -1
- package/services/a2a/__tests__/agentCardService.test.js +224 -0
- package/services/a2a/__tests__/agentCardService.test.js.map +1 -1
- package/services/a2a/__tests__/cursorA2aService.test.d.ts +6 -0
- package/services/a2a/__tests__/cursorA2aService.test.d.ts.map +1 -0
- package/services/a2a/__tests__/cursorA2aService.test.js +359 -0
- package/services/a2a/__tests__/cursorA2aService.test.js.map +1 -0
- package/services/a2a/agentCardService.d.ts +22 -0
- package/services/a2a/agentCardService.d.ts.map +1 -1
- package/services/a2a/agentCardService.js +246 -0
- package/services/a2a/agentCardService.js.map +1 -1
- package/services/a2a/cursorA2aService.d.ts +126 -0
- package/services/a2a/cursorA2aService.d.ts.map +1 -0
- package/services/a2a/cursorA2aService.js +336 -0
- package/services/a2a/cursorA2aService.js.map +1 -0
- package/services/agentImporter.d.ts +62 -0
- package/services/agentImporter.d.ts.map +1 -0
- package/services/agentImporter.js +335 -0
- package/services/agentImporter.js.map +1 -0
- package/services/cursorConfigService.d.ts +75 -0
- package/services/cursorConfigService.d.ts.map +1 -0
- package/services/cursorConfigService.js +538 -0
- package/services/cursorConfigService.js.map +1 -0
- package/services/gitVersionService.d.ts +52 -0
- package/services/gitVersionService.d.ts.map +1 -0
- package/services/gitVersionService.js +377 -0
- package/services/gitVersionService.js.map +1 -0
- package/services/marketplaceUpdateService.d.ts +66 -0
- package/services/marketplaceUpdateService.d.ts.map +1 -0
- package/services/marketplaceUpdateService.js +364 -0
- package/services/marketplaceUpdateService.js.map +1 -0
- package/services/mcpAdmin/__tests__/scheduledTaskTools.test.d.ts +5 -0
- package/services/mcpAdmin/__tests__/scheduledTaskTools.test.d.ts.map +1 -0
- package/services/mcpAdmin/__tests__/scheduledTaskTools.test.js +429 -0
- package/services/mcpAdmin/__tests__/scheduledTaskTools.test.js.map +1 -0
- package/services/mcpAdmin/tools/index.d.ts +1 -0
- package/services/mcpAdmin/tools/index.d.ts.map +1 -1
- package/services/mcpAdmin/tools/index.js +5 -1
- package/services/mcpAdmin/tools/index.js.map +1 -1
- package/services/mcpAdmin/tools/scheduledTaskTools.d.ts +64 -0
- package/services/mcpAdmin/tools/scheduledTaskTools.d.ts.map +1 -0
- package/services/mcpAdmin/tools/scheduledTaskTools.js +1002 -0
- package/services/mcpAdmin/tools/scheduledTaskTools.js.map +1 -0
- package/services/mcpAdmin/types.d.ts +1 -1
- package/services/mcpAdmin/types.d.ts.map +1 -1
- package/services/pluginInstaller.d.ts +55 -1
- package/services/pluginInstaller.d.ts.map +1 -1
- package/services/pluginInstaller.js +437 -13
- package/services/pluginInstaller.js.map +1 -1
- package/services/projectMetadataStorage.d.ts.map +1 -1
- package/services/projectMetadataStorage.js +4 -2
- package/services/projectMetadataStorage.js.map +1 -1
- package/services/sessionEventBus.d.ts +67 -0
- package/services/sessionEventBus.d.ts.map +1 -0
- package/services/sessionEventBus.js +106 -0
- package/services/sessionEventBus.js.map +1 -0
- package/services/sessionManager.d.ts.map +1 -1
- package/services/sessionManager.js +4 -2
- package/services/sessionManager.js.map +1 -1
- package/services/speechToText/__tests__/speechToText.test.d.ts +5 -0
- package/services/speechToText/__tests__/speechToText.test.d.ts.map +1 -0
- package/services/speechToText/__tests__/speechToText.test.js +208 -0
- package/services/speechToText/__tests__/speechToText.test.js.map +1 -0
- package/services/speechToText/index.d.ts +25 -0
- package/services/speechToText/index.d.ts.map +1 -0
- package/services/speechToText/index.js +228 -0
- package/services/speechToText/index.js.map +1 -0
- package/services/speechToText/providers/aliyun.d.ts +22 -0
- package/services/speechToText/providers/aliyun.d.ts.map +1 -0
- package/services/speechToText/providers/aliyun.js +185 -0
- package/services/speechToText/providers/aliyun.js.map +1 -0
- package/services/speechToText/providers/google.d.ts +24 -0
- package/services/speechToText/providers/google.d.ts.map +1 -0
- package/services/speechToText/providers/google.js +205 -0
- package/services/speechToText/providers/google.js.map +1 -0
- package/services/speechToText/providers/openaiCompatible.d.ts +22 -0
- package/services/speechToText/providers/openaiCompatible.d.ts.map +1 -0
- package/services/speechToText/providers/openaiCompatible.js +198 -0
- package/services/speechToText/providers/openaiCompatible.js.map +1 -0
- package/services/speechToText/providers/tencent.d.ts +23 -0
- package/services/speechToText/providers/tencent.d.ts.map +1 -0
- package/services/speechToText/providers/tencent.js +215 -0
- package/services/speechToText/providers/tencent.js.map +1 -0
- package/services/speechToText/types.d.ts +102 -0
- package/services/speechToText/types.d.ts.map +1 -0
- package/services/speechToText/types.js +43 -0
- package/services/speechToText/types.js.map +1 -0
- package/services/taskExecutor/__tests__/mcp-tools-integration.test.d.ts +8 -2
- package/services/taskExecutor/__tests__/mcp-tools-integration.test.d.ts.map +1 -1
- package/services/taskExecutor/__tests__/mcp-tools-integration.test.js +215 -72
- package/services/taskExecutor/__tests__/mcp-tools-integration.test.js.map +1 -1
- package/services/taskExecutor/taskWorker.js +9 -1
- package/services/taskExecutor/taskWorker.js.map +1 -1
- package/services/telemetry.js +1 -1
- package/types/a2a.d.ts +20 -0
- package/types/a2a.d.ts.map +1 -1
- package/types/engine.d.ts +314 -0
- package/types/engine.d.ts.map +1 -0
- package/types/engine.js +14 -0
- package/types/engine.js.map +1 -0
- package/types/hooks.d.ts +45 -0
- package/types/hooks.d.ts.map +1 -0
- package/types/hooks.js +9 -0
- package/types/hooks.js.map +1 -0
- package/types/plugins.d.ts +86 -2
- package/types/plugins.d.ts.map +1 -1
- package/types/plugins.js +1 -0
- package/types/plugins.js.map +1 -1
- package/types/rules.d.ts +51 -0
- package/types/rules.d.ts.map +1 -0
- package/types/rules.js +9 -0
- package/types/rules.js.map +1 -0
- package/utils/__tests__/cursorIdeAgentParser.test.d.ts +7 -0
- package/utils/__tests__/cursorIdeAgentParser.test.d.ts.map +1 -0
- package/utils/__tests__/cursorIdeAgentParser.test.js +289 -0
- package/utils/__tests__/cursorIdeAgentParser.test.js.map +1 -0
- package/utils/claudeUtils.d.ts +3 -1
- package/utils/claudeUtils.d.ts.map +1 -1
- package/utils/claudeUtils.js +26 -12
- package/utils/claudeUtils.js.map +1 -1
- package/utils/cursorCliHistoryParser.d.ts +58 -0
- package/utils/cursorCliHistoryParser.d.ts.map +1 -0
- package/utils/cursorCliHistoryParser.js +664 -0
- package/utils/cursorCliHistoryParser.js.map +1 -0
- package/utils/cursorIdeAgentParser.d.ts +49 -0
- package/utils/cursorIdeAgentParser.d.ts.map +1 -0
- package/utils/cursorIdeAgentParser.js +332 -0
- package/utils/cursorIdeAgentParser.js.map +1 -0
- package/public/assets/AgentsPage-gSnkPp2k.js +0 -10
- package/public/assets/ChatPage-BMrfVkpt.js +0 -471
- package/public/assets/CommandsPage-B6u4IO7L.js +0 -1
- package/public/assets/GeneralSettingsPage-BbEbWJUQ.js +0 -1
- package/public/assets/LandingPage-DFPm2d4Y.js +0 -1
- package/public/assets/LoginPage-D5kZJqhk.js +0 -16
- package/public/assets/McpAdminSettingsPage-D32iUEjH.js +0 -7
- package/public/assets/McpPage-QT4qs391.js +0 -20
- package/public/assets/PluginsPage-BotzuK9f.js +0 -1
- package/public/assets/ProjectSelector-DujNObqr.js +0 -1
- package/public/assets/ProjectsPage-CRWe6HPl.js +0 -21
- package/public/assets/ScheduledTasksPage-Beeurg-w.js +0 -1
- package/public/assets/SettingsLayout-BfkBUyI_.js +0 -1
- package/public/assets/SkillsPage-B59bAr6W.js +0 -18
- package/public/assets/SystemInfoPage-D89s7PjE.js +0 -1
- package/public/assets/VersionSettingsPage-CaB4PH6h.js +0 -5
- package/public/assets/WebSocketTunnelPage-Cbru_-hL.js +0 -1
- package/public/assets/_basePickBy-5fAM04Ra.js +0 -1
- package/public/assets/arc-C2gTU2ZR.js +0 -1
- package/public/assets/channel-DcVTcy-S.js +0 -1
- package/public/assets/classDiagram-2ON5EDUG-BXVT6Q7h.js +0 -1
- package/public/assets/classDiagram-v2-WZHVMYZB-BXVT6Q7h.js +0 -1
- package/public/assets/clone-Bp6orjIq.js +0 -1
- package/public/assets/diagram-QEK2KX5R-BfMGeeRo.js +0 -43
- package/public/assets/index-BgR-BTTw.css +0 -1
- package/public/assets/infoDiagram-F6ZHWCRC-C6OApgqf.js +0 -2
- package/public/assets/stateDiagram-v2-4FDKWEC3-DyE8O3Kx.js +0 -1
- package/public/assets/useAgents-D5EDAc_E.js +0 -2
- package/public/assets/useCommands-BgoCfyuu.js +0 -1
|
@@ -1,471 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dagre-6UL2VRFP-DHDnVshA.js","assets/graph-BP5lFRBg.js","assets/_baseUniq-COj5YnAO.js","assets/layout-DjAix4WK.js","assets/_basePickBy-5fAM04Ra.js","assets/clone-Bp6orjIq.js","assets/data-structures-ChC1tqVg.js","assets/monaco-editor-BWfQfpij.js","assets/syntax-highlighting-DGbNjS3S.js","assets/agents-3mB536QF.js","assets/tools-BAI9XHGS.js","assets/ui-components-DaGtjl0g.js","assets/agents-DwCY2K8p.css","assets/useAgents-D5EDAc_E.js","assets/useSessions-CQgq4d84.js","assets/index-BEPv9Bqe.js","assets/index-BgR-BTTw.css","assets/useCommands-BgoCfyuu.js","assets/useClaudeVersions-Cy71v4HE.js","assets/FileExplorer-B41BB0LM.js","assets/UnifiedToolSelector-CkafUbz3.js","assets/FileBrowser-DcoBWzKK.js","assets/ProjectSelector-DujNObqr.js","assets/cose-bilkent-S5V4N54A-BVJXoW_K.js","assets/cytoscape.esm-DtBltrT8.js","assets/c4Diagram-YG6GDRKO-B0VVIIvh.js","assets/chunk-TZMSLE5B-BxHO9wa1.js","assets/flowDiagram-NV44I4VS-BYqChOSE.js","assets/chunk-FMBD7UC4-DV3SMJK_.js","assets/chunk-55IACEB6-BjhdmGlM.js","assets/chunk-QN33PNHL-IlsCTdDq.js","assets/channel-DcVTcy-S.js","assets/erDiagram-Q2GNP2WA-BHsgeBpL.js","assets/gitGraphDiagram-NY62KEGX-C5Bgrf0J.js","assets/chunk-4BX2VUAB-DM8J7YO9.js","assets/chunk-QZHKN3VN-DJXs-Fqo.js","assets/treemap-KMMF4GRG-DBuwkj4f.js","assets/ganttDiagram-LVOFAZNH-CZFFSLKX.js","assets/linear-Cw0z8VNY.js","assets/init-Gi6I4Gst.js","assets/defaultLocale-C4B-KCzX.js","assets/infoDiagram-F6ZHWCRC-C6OApgqf.js","assets/pieDiagram-ADFJNKIX-B0mT9OgH.js","assets/arc-C2gTU2ZR.js","assets/ordinal-Cboi1Yqb.js","assets/quadrantDiagram-AYHSOK5B-BWdlgO0u.js","assets/xychartDiagram-PRI3JC2R-Bo9K-U2S.js","assets/requirementDiagram-UZGBJVZJ-B-8LxsGB.js","assets/sequenceDiagram-WL72ISMW-Bt5twlzi.js","assets/classDiagram-2ON5EDUG-BXVT6Q7h.js","assets/chunk-B4BG7PRW-1RJ6n2xv.js","assets/classDiagram-v2-WZHVMYZB-BXVT6Q7h.js","assets/stateDiagram-FKZM4ZOC-Dmph7TeW.js","assets/chunk-DI55MBZ5-1-EHSO67.js","assets/stateDiagram-v2-4FDKWEC3-DyE8O3Kx.js","assets/journeyDiagram-XKPGCS4Q--abC1RHz.js","assets/timeline-definition-IT6M3QCI-CcV8nyIH.js","assets/mindmap-definition-VGOIOE7T-U_T9xIUk.js","assets/kanban-definition-3W4ZIXB7-BJeChfWu.js","assets/sankeyDiagram-TZEHDZUN-OXuxkgGA.js","assets/diagram-S2PKOQOG-D7AX72a5.js","assets/diagram-QEK2KX5R-BfMGeeRo.js","assets/blockDiagram-VD42YOAC-DFKUIZc6.js","assets/architectureDiagram-VXUJARFQ-DD1BwT1T.js","assets/diagram-PSM6KHXK-40qGxDeg.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{j as p}from"./data-structures-ChC1tqVg.js";import{r as O,g as Au,W as xr}from"./monaco-editor-BWfQfpij.js";import{o as sg,A as qa,a as Ua,u as Mu,h as f1,l as p1,d as g1,p as m1,S as x1}from"./agents-3mB536QF.js";import{g as y1,h as b1,i as k1,j as w1,k as v1}from"./useAgents-D5EDAc_E.js";import{u as C1}from"./useSessions-CQgq4d84.js";import{u as ve,B as Qe,T as Ve,b as S1,K as _1,c as T1}from"./tools-BAI9XHGS.js";import{m as Zr,g as ld,at as E1,o as A1,Y as ag,I as sc,a_ as og,a$ as lg,X as En,k as fi,l as Ps,ay as Sa,L as _a,C as Jr,n as Ta,j as ac,Z as Ea,b0 as M1,_ as bl,b1 as N1,b2 as aa,b3 as L1,E as I1,ar as cg,aC as $1,az as j1,U as ug,b4 as cd,d as ud,w as Nu,V as B1,e as hg,ak as hd,S as dd,b5 as D1,as as dg,b6 as P1,y as R1,v as fg,r as F1,ax as O1,b7 as ks,ab as pg,i as gg,z as fd,ae as z1,ac as pd,u as W1}from"./ui-components-DaGtjl0g.js";import{c as H1,m as mg,k as q1,b as xg,n as U1,u as V1}from"./index-BEPv9Bqe.js";import{u as oc,f as lc}from"./useCommands-BgoCfyuu.js";import{u as G1}from"./useClaudeVersions-Cy71v4HE.js";import{e as cc,E as uc,F as gd}from"./FileExplorer-B41BB0LM.js";import{c as Oe,h as yg}from"./syntax-highlighting-DGbNjS3S.js";import{U as Lu}from"./UnifiedToolSelector-CkafUbz3.js";import{F as Y1}from"./FileBrowser-DcoBWzKK.js";import{P as X1}from"./ProjectSelector-DujNObqr.js";const Ke=sg((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})}));class nt{static instance;static STORAGE_KEY="active_chat_tabs";static WAKEUP_SIGNAL_KEY="tab_wakeup_signal";static WAKEUP_RESPONSE_KEY="tab_wakeup_response";static TAB_TIMEOUT=300*1e3;currentTabId;cleanupInterval;lastKnownSession=null;sessionResumeHistory=[];constructor(){this.currentTabId=this.generateTabId(),this.startCleanupTimer(),this.setupBeforeUnloadHandler(),console.log(`📱 TabManager initialized with ID: ${this.currentTabId}`)}static getInstance(){return nt.instance||(nt.instance=new nt),nt.instance}registerCurrentTab(t,r){const n=this.getActiveTabs(),i=this.getTabKey(t,r),s={agentId:t,sessionId:r,url:window.location.href,lastSeen:Date.now(),tabId:this.currentTabId,title:document.title};n[i]=s,this.saveActiveTabs(n),console.log(`📱 Tab registered: ${this.currentTabId} for session ${r}`),this.lastKnownSession={agentId:t,sessionId:r}}updateCurrentTabActivity(t,r){const n=this.getActiveTabs(),i=this.getTabKey(t,r);n[i]&&n[i].tabId===this.currentTabId&&(n[i].lastSeen=Date.now(),n[i].url=window.location.href,n[i].title=document.title,this.saveActiveTabs(n),this.lastKnownSession={agentId:t,sessionId:r})}hasActiveTab(t,r){return this.findActiveTabForSession(t,r)!==null}findActiveTabForSession(t,r){const n=this.getActiveTabs(),i=this.getTabKey(t,r);if(n[i]&&Date.now()-n[i].lastSeen<nt.TAB_TIMEOUT)return n[i];for(const[s,a]of Object.entries(n))if(a.agentId===t&&a.sessionId===r){if(Date.now()-a.lastSeen<nt.TAB_TIMEOUT)return a;delete n[s],this.saveActiveTabs(n),console.log(`🗑️ Cleaned up expired tab: ${r}`)}return null}async wakeupExistingTab(t,r,n){if(!this.findActiveTabForSession(t,r))return!1;const s={type:"WAKEUP",agentId:t,sessionId:r,requestId:this.generateRequestId(),timestamp:Date.now(),sourceUrl:n||window.location.href};return console.log(`🔔 Sending wakeup signal for session: ${r}`),localStorage.setItem(nt.WAKEUP_SIGNAL_KEY,JSON.stringify(s)),new Promise(a=>{const o=setTimeout(()=>{console.log(`⏰ Wakeup timeout for session ${r}`),a(!1)},2e3),c=setInterval(()=>{const u=localStorage.getItem(nt.WAKEUP_RESPONSE_KEY);if(u)try{const h=JSON.parse(u);if(h.requestId===s.requestId){clearTimeout(o),localStorage.removeItem(nt.WAKEUP_RESPONSE_KEY),console.log(`✅ Tab awakened successfully: ${r}`),a(h.success);return}}catch(h){console.error("Error parsing wakeup response:",h)}},100);setTimeout(()=>clearInterval(c),2e3)})}setupWakeupListener(t,r){const n=s=>{if(s.key===nt.WAKEUP_SIGNAL_KEY&&s.newValue)try{const a=JSON.parse(s.newValue);a.type==="WAKEUP"&&a.agentId===t&&a.sessionId===r&&this.handleWakeupSignal(a)}catch(a){console.error("Error handling wakeup signal:",a)}};window.addEventListener("storage",n);const i=setInterval(()=>{const s=localStorage.getItem(nt.WAKEUP_SIGNAL_KEY);if(s)try{const a=JSON.parse(s);a.type==="WAKEUP"&&a.agentId===t&&a.sessionId===r&&Date.now()-a.timestamp<5e3&&this.handleWakeupSignal(a)}catch(a){console.error("Error polling wakeup signal:",a)}},500);return console.log(`🎯 Wakeup listener setup for session: ${r}`),()=>{window.removeEventListener("storage",n),clearInterval(i),console.log(`🎯 Wakeup listener cleaned up for session: ${r}`)}}updateCurrentTabSession(t,r,n,i){const s=this.getActiveTabs(),a=this.getTabKey(t,r);s[a]&&s[a].tabId===this.currentTabId&&delete s[a];const o=this.getTabKey(n,i);s[o]={agentId:n,sessionId:i,url:window.location.href,lastSeen:Date.now(),tabId:this.currentTabId,title:document.title},this.saveActiveTabs(s),console.log(`🔄 Tab session updated: ${r} → ${i}`),this.lastKnownSession={agentId:n,sessionId:i}}unregisterCurrentTabSession(t,r){const n=this.getActiveTabs(),i=this.getTabKey(t,r);n[i]&&n[i].tabId===this.currentTabId&&(delete n[i],this.saveActiveTabs(n),console.log(`📤 Unregistered current tab from session: ${r}`)),this.lastKnownSession&&this.lastKnownSession.agentId===t&&this.lastKnownSession.sessionId===r&&(this.lastKnownSession=null)}handleSessionResume(t,r,n){const i=this.getActiveTabs(),s=this.getTabKey(t,r),a=this.getTabKey(t,n);i[s]&&i[s].tabId===this.currentTabId?(delete i[s],i[a]={agentId:t,sessionId:n,url:window.location.href,lastSeen:Date.now(),tabId:this.currentTabId,title:document.title},this.saveActiveTabs(i),console.log(`🔄 Session resumed: ${r} → ${n}`),this.lastKnownSession={agentId:t,sessionId:n}):(this.registerCurrentTab(t,n),console.log(`🆕 Resumed session registered: ${n}`))}recordSessionResume(t,r,n){this.sessionResumeHistory.push({originalSessionId:r,newSessionId:n,timestamp:Date.now(),agentId:t}),this.sessionResumeHistory.length>100&&(this.sessionResumeHistory=this.sessionResumeHistory.slice(-100)),console.log(`📝 Recorded session resume: ${r} → ${n}`)}smartUpdateCurrentTab(){const t=window.location.href,r=this.parseSessionFromUrl(t);if(!r){this.lastKnownSession&&(this.unregisterCurrentTabSession(this.lastKnownSession.agentId,this.lastKnownSession.sessionId),this.lastKnownSession=null);return}const{agentId:n,sessionId:i}=r;if(this.lastKnownSession){const{agentId:s,sessionId:a}=this.lastKnownSession;a!==i||s!==n?this.sessionResumeHistory.find(l=>l.originalSessionId===a&&l.newSessionId===i&&l.agentId===n&&Date.now()-l.timestamp<3e4)?(this.handleSessionResume(n,a,i),console.log(`🔄 Detected session resume via URL: ${a} → ${i}`)):(this.updateCurrentTabSession(s,a,n,i),console.log(`🎯 Regular session switch: ${a} → ${i}`)):this.updateCurrentTabActivity(n,i)}else this.registerCurrentTab(n,i),console.log(`🎯 Initial session register: ${i}`);this.lastKnownSession={agentId:n,sessionId:i}}startSmartMonitoring(){this.smartUpdateCurrentTab();const t=()=>{setTimeout(()=>this.smartUpdateCurrentTab(),100)};window.addEventListener("popstate",t);const r=history.pushState,n=history.replaceState;return history.pushState=function(...i){r.apply(this,i),t()},history.replaceState=function(...i){n.apply(this,i),t()},console.log(`🎯 Smart monitoring started for tab: ${this.currentTabId}`),()=>{window.removeEventListener("popstate",t),history.pushState=r,history.replaceState=n,console.log(`🛑 Smart monitoring stopped for tab: ${this.currentTabId}`)}}handleWakeupSignal(t){console.log(`🔔 Received wakeup signal for session: ${t.sessionId}`);try{if(window.focus(),window.parent&&window.parent!==window&&window.parent.focus(),document.hidden){const n=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});document.dispatchEvent(n)}}catch(n){console.log("Focus attempt failed:",n)}this.flashPageTitle(),this.playNotificationSound(),t.sourceUrl&&t.sourceUrl!==window.location.href?this.isSameSession(t.sourceUrl,window.location.href)?(console.log("🎯 URLs point to same session, forcing visibility"),this.makePageVisible()):(console.log(`🔄 Navigating to: ${t.sourceUrl}`),window.history.replaceState(null,"",t.sourceUrl),window.location.reload()):this.makePageVisible();const r={requestId:t.requestId,agentId:t.agentId,sessionId:t.sessionId,success:!0,timestamp:Date.now()};localStorage.setItem(nt.WAKEUP_RESPONSE_KEY,JSON.stringify(r)),localStorage.removeItem(nt.WAKEUP_SIGNAL_KEY),this.updateCurrentTabActivity(t.agentId,t.sessionId),console.log(`✅ Wakeup signal processed successfully for session: ${t.sessionId}`)}flashPageTitle(){const t=document.title;let r=0;const n=setInterval(()=>{document.title=r%2===0?"🔔 会话已唤起":t,r++,r>6&&(clearInterval(n),document.title=t)},500),i=()=>{clearInterval(n),document.title=t,window.removeEventListener("focus",i)};window.addEventListener("focus",i)}playNotificationSound(){try{const t=new(window.AudioContext||window.webkitAudioContext),r=t.createOscillator(),n=t.createGain();r.connect(n),n.connect(t.destination),r.frequency.setValueAtTime(800,t.currentTime),r.frequency.setValueAtTime(600,t.currentTime+.1),n.gain.setValueAtTime(.1,t.currentTime),n.gain.exponentialRampToValueAtTime(.01,t.currentTime+.2),r.start(t.currentTime),r.stop(t.currentTime+.2)}catch(t){console.log("Audio notification not supported:",t)}}makePageVisible(){try{window.scrollTo(0,0),document.fullscreenEnabled&&document.documentElement.requestFullscreen?.()?.then(()=>{setTimeout(()=>{document.exitFullscreen?.()},100)}).catch(n=>console.log("Fullscreen toggle failed:",n));const t=document.createElement("div");t.style.cssText=`
|
|
3
|
-
position: fixed;
|
|
4
|
-
top: 50%;
|
|
5
|
-
left: 50%;
|
|
6
|
-
transform: translate(-50%, -50%);
|
|
7
|
-
background: rgba(59, 130, 246, 0.9);
|
|
8
|
-
color: white;
|
|
9
|
-
padding: 20px 40px;
|
|
10
|
-
border-radius: 12px;
|
|
11
|
-
font-size: 18px;
|
|
12
|
-
font-weight: bold;
|
|
13
|
-
z-index: 999999;
|
|
14
|
-
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
|
|
15
|
-
animation: bounce 0.6s ease-in-out;
|
|
16
|
-
`;const r=document.createElement("style");r.textContent=`
|
|
17
|
-
@keyframes bounce {
|
|
18
|
-
0%, 20%, 53%, 80%, 100% {
|
|
19
|
-
transform: translate(-50%, -50%) translateY(0);
|
|
20
|
-
}
|
|
21
|
-
40%, 43% {
|
|
22
|
-
transform: translate(-50%, -50%) translateY(-20px);
|
|
23
|
-
}
|
|
24
|
-
70% {
|
|
25
|
-
transform: translate(-50%, -50%) translateY(-10px);
|
|
26
|
-
}
|
|
27
|
-
90% {
|
|
28
|
-
transform: translate(-50%, -50%) translateY(-5px);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
`,document.head.appendChild(r),t.textContent="🎯 会话已激活",document.body.appendChild(t),setTimeout(()=>{document.body.contains(t)&&document.body.removeChild(t),document.head.contains(r)&&document.head.removeChild(r)},2e3),console.log("🎯 Made page more visible")}catch(t){console.log("Make page visible failed:",t)}}parseSessionFromUrl(t){try{const r=new URL(t),n=r.pathname.split("/"),i=n.indexOf("chat");if(i!==-1&&n[i+1]){const s=n[i+1],a=r.searchParams.get("session");if(s&&a)return{agentId:s,sessionId:a}}return null}catch(r){return console.error("Error parsing session from URL:",r),null}}isSameSession(t,r){try{const n=this.parseSessionFromUrl(t),i=this.parseSessionFromUrl(r);return!n||!i?!1:n.agentId===i.agentId&&n.sessionId===i.sessionId}catch(n){return console.error("Error comparing session URLs:",n),!1}}getActiveTabs(){try{const t=localStorage.getItem(nt.STORAGE_KEY);return t?JSON.parse(t):{}}catch(t){return console.error("Error reading active tabs:",t),{}}}saveActiveTabs(t){try{localStorage.setItem(nt.STORAGE_KEY,JSON.stringify(t))}catch(r){console.error("Error saving active tabs:",r)}}getTabKey(t,r){return`${t}_${r}`}generateTabId(){return`tab_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}generateRequestId(){return`req_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}startCleanupTimer(){this.cleanupInterval=window.setInterval(()=>{this.cleanupExpiredTabs()},6e4)}cleanupExpiredTabs(){const t=this.getActiveTabs(),r=Date.now();let n=0;Object.keys(t).forEach(i=>{r-t[i].lastSeen>nt.TAB_TIMEOUT&&(delete t[i],n++)}),n>0&&(this.saveActiveTabs(t),console.log(`🗑️ Cleaned up ${n} expired tabs`))}setupBeforeUnloadHandler(){window.addEventListener("beforeunload",()=>{const t=this.getActiveTabs();Object.keys(t).forEach(r=>{t[r].tabId===this.currentTabId&&delete t[r]}),this.saveActiveTabs(t)})}getDebugInfo(){return{tabs:this.getActiveTabs(),currentTabId:this.currentTabId,lastKnownSession:this.lastKnownSession,resumeHistory:this.sessionResumeHistory}}clearAllTabs(){localStorage.removeItem(nt.STORAGE_KEY),localStorage.removeItem(nt.WAKEUP_SIGNAL_KEY),localStorage.removeItem(nt.WAKEUP_RESPONSE_KEY),this.sessionResumeHistory=[],this.lastKnownSession=null,console.log("🗑️ All tab records cleared")}stopCleanupTimer(){this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=void 0,console.log("🛑 Cleanup timer stopped"))}}const vr=nt.getInstance();window.tabManagerDebug={showTabs:()=>console.table(vr.getDebugInfo().tabs),clearAll:()=>vr.clearAllTabs(),testWakeup:(e,t)=>vr.wakeupExistingTab(e,t),getCurrentTabId:()=>vr.getDebugInfo().currentTabId,getDebugInfo:()=>vr.getDebugInfo()};const K1=({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=`${qa}/sessions/${e}/${t}/check`,b=await Ua(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=`${qa}/sessions/${e}/${t}/heartbeat`,b=await Ua(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}`),vr.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]),d=O.useCallback(()=>{l.current=!document.hidden,l.current&&n&&t&&h()},[h,n,t]),f=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?f():g(),()=>{g()}),[t,n,f,g]),O.useEffect(()=>(document.addEventListener("visibilitychange",d),()=>{document.removeEventListener("visibilitychange",d)}),[d]),O.useEffect(()=>()=>{g()},[g]),{sendHeartbeat:h,startHeartbeat:f,stopHeartbeat:g,checkSessionExists:u,lastHeartbeat:o.current}},Q1=({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=K1({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}},Z1=()=>{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}},J1=({isOpen:e,onToggle:t,sessions:r,currentSessionId:n,onSwitchSession:i,isLoading:s=!1,searchTerm:a,onSearchChange:o})=>{const{t:l}=ve("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((d,f)=>({index:f+1,id:d.id,title:d.title,lastUpdated:d.lastUpdated,messageCount:d.messageCount,isCurrent:d.id===n}))})},[r,n,a]),O.useEffect(()=>{const d=f=>{c.current&&!c.current.contains(f.target)&&t()};return e&&document.addEventListener("mousedown",d),()=>{document.removeEventListener("mousedown",d)}},[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(ld,{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:d=>o(d.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((d,f)=>p.jsxs("div",{onClick:()=>{console.log(`🖱️ [DROPDOWN DEBUG] Clicking session ${f+1}:`,{id:d.id,title:d.title,isCurrent:d.id===n}),i(d.id)},className:`mx-2 px-3 py-2 rounded cursor-pointer hover:bg-gray-50 transition-colors ${n===d.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: ${d.id}`,children:[f+1,". ",d.title]}),p.jsxs("div",{className:"text-xs text-gray-500 mt-0.5",children:[l("sessionDropdown.messageCount",{count:d.messageCount})," • ",new Date(d.lastUpdated).toLocaleString("zh-CN",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})]})]},d.id))}):p.jsx("div",{className:"text-center py-8",children:a?p.jsxs("div",{children:[p.jsx(ld,{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 ev(e,t){return t?e.replace(/@([\w.-]+(?:\/[\w.-]+)*(?:\.\w+)?)/g,(r,n)=>n.startsWith("/")?n:t+"/"+n):e}function tv(e,t,r){let n=e.content;return t&&(n=n.replace(/\$ARGUMENTS/g,t)),n=ev(n,r),`<command-message>${t?`${e.description} (参数: ${t})`:e.description}</command-message><command-name>${n}</command-name>`}function cs(e){return e.startsWith("/")}function rv(e){return e.startsWith("/")?e.slice(1):""}const nv=({textareaRef:e,inputMessage:t,setInputMessage:r})=>{const[n,i]=O.useState([]),[s,a]=O.useState(null),[o,l]=O.useState(!1),c=O.useCallback(S=>{if(!e.current)return;const C=e.current,w=C.selectionStart||0,T=C.selectionEnd||0,I=t,M=I.substring(0,w)+S+I.substring(T);r(M),setTimeout(()=>{C.selectionStart=C.selectionEnd=w+S.length,C.focus()},0)},[t,r,e]),u=O.useCallback(S=>{const C=Date.now().toString()+Math.random().toString(36).substr(2,9),w=new FileReader;w.onload=T=>{T.target?.result&&i(I=>{const M=[...I,{id:C,file:S,preview:T.target.result}],N=`[image${M.length}]`;return c(N),M})},w.readAsDataURL(S)},[c]),h=O.useCallback(S=>{const C=S.target.files;if(!C)return;Array.from(C).filter(T=>T.type.startsWith("image/")&&["image/jpeg","image/png","image/gif","image/webp"].includes(T.type)).forEach(u),S.target&&(S.target.value="")},[u]),d=O.useCallback(S=>{i(C=>C.filter(w=>w.id!==S))},[]),f=O.useCallback(S=>{a(S)},[]),g=O.useCallback(S=>{const C=S.clipboardData?.items;if(!C)return;let w=!1;for(let T=0;T<C.length;T++){const I=C[T];if(I.type.startsWith("image/")){w=!0;const M=I.getAsFile();M&&u(M)}}w&&S.preventDefault()},[u]),m=O.useCallback(S=>{S.preventDefault(),l(!0)},[]),b=O.useCallback(S=>{S.preventDefault(),l(!1)},[]),y=O.useCallback(S=>{S.preventDefault(),l(!1);const C=S.dataTransfer?.files;if(!C)return;Array.from(C).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(S=>({id:S.id,data:S.preview.split(",")[1],mediaType:S.file.type,name:S.file.name})),[n]);return{selectedImages:n,previewImage:s,isDragOver:o,handleImageSelect:h,handleImageRemove:d,handleImagePreview:f,handlePaste:g,handleDragOver:m,handleDragLeave:b,handleDrop:y,clearImages:k,getImagesForBackend:v,setPreviewImage:a}},iv=({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:d,scrollHeight:f,clientHeight:g}=e.current;return f-d-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}},sv=({projectPath:e,textareaRef:t})=>{const{t:r}=ve("components"),[n,i]=O.useState(!1),[s,a]=O.useState(""),[o,l]=O.useState(null),[c,u]=O.useState(0),[h,d]=O.useState(null),[f,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}=oc({scope:"user",search:s}),{data:S=[],error:C}=lc({projectId:e||"",search:s}),{data:w=[]}=oc({scope:"user"}),{data:T=[]}=lc({projectId:e||""}),I=O.useCallback(R=>{const W=y.find(j=>j.name===R),X=T.find(j=>j.name===R),_=w.find(j=>j.name===R);return!!(W||X||_)},[y,T,w]),M=O.useCallback(()=>{const R=y.map(_=>_.content),W=T.map(_=>`/${_.name}`),X=w.map(_=>`/${_.name}`);return[...R,...W,...X].join(", ")},[y,T,w]),E=v||C,N=O.useMemo(()=>[...y.filter(W=>W.name.toLowerCase().includes(s.toLowerCase())||W.description.toLowerCase().includes(s.toLowerCase())),...S,...k],[k,S,s,y]);O.useEffect(()=>{u(R=>N.length>0&&R>=N.length?0:R)},[N.length]);const D=O.useCallback(R=>{if(h&&d(null),R.length>0&&R[R.length-1]==="@"){const W=R.substring(0,R.length-1);if(W.length===0||/\s$/.test(W)){b(R.length-1),g(!0),t.current?.blur();return}}},[h,t]),P=O.useCallback(R=>(l(R),i(!1),`/${R.name}`),[]),$=O.useCallback(()=>{i(!1)},[]),F=O.useCallback((R,W)=>{if(!t.current||m===null)return W;let X=R;e&&R.startsWith(e)&&(X=R.slice(e.length),X.startsWith("/")&&(X=X.slice(1)));const _=W.substring(0,m),j=W.substring(m+1),te=_+"@"+X+" "+j;return g(!1),b(null),setTimeout(()=>{if(t.current){const A=m+1+X.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:f,atSymbolPosition:m,allCommands:N,SYSTEM_COMMANDS:y,userCommands:w,projectCommands:T,hasCommandsLoadError:E,userCommandsError:v,projectCommandsError:C,setSelectedCommand:l,setSelectedCommandIndex:u,setCommandWarning:d,setShowCommandSelector:i,setShowFileBrowser:g,setAtSymbolPosition:b,setCommandSearch:a,handleInputChange:D,handleCommandSelect:P,handleCommandSelectorClose:$,handleFileSelect:F,handleFileBrowserClose:L,isCommandDefined:I,getAllAvailableCommands:M}},av=({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,d]=O.useState("sonnet"),[f,g]=O.useState(!1),[m,b]=O.useState(!1),[y,k]=O.useState(void 0),[v,S]=O.useState(!1),[C,w]=O.useState(!1),[T,I]=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[P,$]=D.name.split("."),F=`mcp__${P}__${$}`;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:f,showModelDropdown:m,selectedClaudeVersion:y,showVersionDropdown:v,isVersionLocked:C,setShowToolSelector:r,setSelectedRegularTools:i,setSelectedMcpTools:a,setMcpToolsEnabled:l,setPermissionMode:u,setSelectedModel:d,setShowPermissionDropdown:g,setShowModelDropdown:b,setSelectedClaudeVersion:k,setShowVersionDropdown:S,setIsVersionLocked:w,envVars:T,setEnvVars:I}},ov=({initialModel:e="sonnet",initialVersion:t})=>{const{data:r}=G1(),[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 f=r.versions.find(m=>m.id===r.defaultVersionId)||r.versions[0],g=f?.models||[];return console.log(`📦 availableModels computed (using default): defaultVersion=${f?.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:f=>{a(f);const g=r?.versions.find(m=>m.id===f);g&&g.models&&g.models.length>0&&i(g.models[0].id)},handleModelChange:f=>{i(f)},resetToDefaults:()=>{a(void 0),i(e),l(!1)}}},lv={activeTasks:new Map},hc=sg((e,t)=>({...lv,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(d=>d.id===n.id?n:d)}: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})}})),cv=({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}=ve("components"),d=Mu(),{addMessage:f,addTextPartToMessage:g,addThinkingPartToMessage:m,updateTextPartInMessage:b,updateThinkingPartInMessage:y,addToolPartToMessage:k,updateToolPartInMessage:v,updateMcpStatus:S,setPendingUserQuestion:C,setA2AStreamStart:w,setA2AStreamEnd:T,addA2AStreamEvent:I}=Ke(),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 B=A.pendingUpdate,Y=M.current;if(!B||!Y){A.rafId=null;return}const U=A.activeBlocks.get(B.blockId);if(!U||!U.partId){console.warn("🌊 [STREAMING] No partId found for block:",B.blockId),A.rafId=null;return}B.type==="text"?b(Y,U.partId,B.content):B.type==="thinking"&&y(Y,U.partId,B.content),A.pendingUpdate=null,A.rafId=null}))},[b,y]),P=O.useCallback((_,j)=>`${_}-${Date.now()}-${j}`,[]),{registerTaskTool:$,activateSubAgent:F,addSubAgentMessagePart:L}=hc.getState(),R=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 B=A,Y=j.sessionId||j.session_id;if(Y&&F(B,Y),j.type==="stream_event"&&j.event){const U=j.event;if(U.type==="content_block_start"&&U.content_block){const q=U.index,G=U.content_block;if(G.type==="text"){const Q=`part_${B}_text_${q}_${Date.now()}`;L(B,{id:Q,type:"text",content:"",order:q}),E.current.set(`${B}-${q}`,Q),console.log("🎯 [SIDECHAIN] Started text block:",Q)}else if(G.type==="thinking"){const Q=`part_${B}_thinking_${q}_${Date.now()}`;L(B,{id:Q,type:"thinking",content:"",order:q}),E.current.set(`${B}-${q}`,Q)}else if(G.type==="tool_use"){const Q=`part_${B}_tool_${q}_${Date.now()}`;L(B,{id:Q,type:"tool",toolData:{id:G.id,toolName:G.name,toolInput:{},isError:!1},order:q}),E.current.set(`${B}-${q}`,Q),console.log("🎯 [SIDECHAIN] Added tool_use to sub-agent:",G.name)}}if(U.type==="content_block_delta"&&U.delta){const q=U.index,G=U.delta,Q=E.current.get(`${B}-${q}`);if(Q){const ge=hc.getState().activeTasks.get(B);if(ge)for(const Se of ge.messageFlow){const Ce=Se.messageParts.find(Le=>Le.id===Q);if(Ce){if(G.type==="text_delta"&&G.text){const Le=(Ce.content||"")+G.text;L(B,{...Ce,content:Le}),Le.length%100<10&&console.log("🎯 [SIDECHAIN] Text accumulated:",Le.length,"chars")}else if(G.type==="thinking_delta"&&G.thinking){const Le=(Ce.content||"")+G.thinking;L(B,{...Ce,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 G=U.content[q];G.type==="text"&&G.text?(console.log("🎯 [SIDECHAIN] Adding text from assistant:",G.text.substring(0,50)),L(B,{id:`part_${B}_text_${q}_${Date.now()}`,type:"text",content:G.text,order:q})):G.type==="thinking"&&G.thinking?L(B,{id:`part_${B}_thinking_${q}_${Date.now()}`,type:"thinking",content:G.thinking,order:q}):G.type==="tool_use"&&(L(B,{id:`part_${B}_tool_${q}_${Date.now()}`,type:"tool",toolData:{id:G.id,toolName:G.name,toolInput:G.input||{},isError:!1},order:q}),console.log("🎯 [SIDECHAIN] Added tool_use from assistant:",G.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 G=q;if(G.type==="text"){console.log("🎯 [SIDECHAIN] Skipping user text (task prompt already shown)");continue}G.type==="tool_result"&&G.tool_use_id&&console.log("🎯 [SIDECHAIN] Tool result for:",G.tool_use_id,"error:",G.is_error)}}return}if(j.type==="stream_event"&&j.event){const B=j.event;if(console.log("🌊 [STREAMING] Detected stream_event:",B.type,"Full event:",JSON.stringify(j).substring(0,200)),N.current.wasStreamProcessed=!0,B.type==="message_start"){if(M.current)console.log("🌊 [STREAMING] message_start: AI message already exists, skipping:",M.current);else{f({content:"",role:"assistant"});const U=Ke.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(B.type==="content_block_start"){const Y=B.index,U=B.content_block;if(!M.current){f({content:"",role:"assistant"});const re=Ke.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}`,G=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=Ke.getState().messages.find(Le=>Le.id===M.current),Se=re?.messageParts?.[re.messageParts.length-1]?.id,Ce={blockId:q,type:"text",content:"",isComplete:!1,messageId:M.current,partId:Se,startedAt:G,lastUpdatedAt:G};N.current.activeBlocks.set(q,Ce),console.log("🌊 [STREAMING] content_block_start: Initialized text block",q,"partId:",Se)}else if(U.type==="thinking"){m(M.current,"");const re=Ke.getState().messages.find(Le=>Le.id===M.current),Se=re?.messageParts?.[re.messageParts.length-1]?.id,Ce={blockId:q,type:"thinking",content:"",isComplete:!1,messageId:M.current,partId:Se,startedAt:G,lastUpdatedAt:G};N.current.activeBlocks.set(q,Ce),console.log("🤔 [STREAMING] content_block_start: Initialized thinking block",q,"partId:",Se)}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),$(U.id,re))}const Q={toolName:U.name,toolInput:{},isExecuting:!0,claudeId:U.id};try{k(M.current,Q),console.log("🔧 [STREAMING] content_block_start: addToolPartToMessage completed");const re=Ke.getState();console.log("🔧 [STREAMING] content_block_start: Got store state, messages count:",re.messages.length);const ge=re.messages.find(ze=>ze.id===M.current);console.log("🔧 [STREAMING] content_block_start: Found current message:",!!ge,"parts count:",ge?.messageParts?.length);const Se=ge?.messageParts?.[ge.messageParts.length-1];console.log("🔧 [STREAMING] content_block_start: Latest part:",{exists:!!Se,type:Se?.type,hasToolData:!!Se?.toolData,toolDataId:Se?.toolData?.id});const Ce=Se?.toolData?.id;Ce||console.error("🔧 [STREAMING] content_block_start: ⚠️ partId is undefined! Latest part:",Se);const Le={blockId:q,type:"tool_use",content:"",isComplete:!1,messageId:M.current,partId:Ce,startedAt:G,lastUpdatedAt:G};N.current.activeBlocks.set(q,Le),console.log("🔧 [STREAMING] content_block_start: ✅ Initialized tool_use block",U.name,"blockId:",q,"partId:",Ce,"claudeId:",U.id)}catch(re){throw console.error("🔧 [STREAMING] content_block_start: ❌ Error processing tool_use:",re),re}}return}if(B.type==="content_block_delta"&&M.current){const Y=B.index,U=B.delta,q=`block-${M.current}-${Y}`,G=Date.now();if(U.type==="text_delta"&&U.text!==void 0){let Q=N.current.activeBlocks.get(q);if(Q)Q.content+=U.text,Q.lastUpdatedAt=G,console.log(`🌊 [STREAMING] content_block_delta: Accumulated text delta "${U.text}" to block ${q}, total: "${Q.content.substring(0,50)}..."`);else{console.warn("🌊 [STREAMING] content_block_delta: Missing content_block_start for text block, creating fallback"),g(M.current,"");const ge=Ke.getState().messages.find(Le=>Le.id===M.current),Ce=ge?.messageParts?.[ge.messageParts.length-1]?.id;Q={blockId:q,type:"text",content:U.text,isComplete:!1,messageId:M.current,partId:Ce,startedAt:G,lastUpdatedAt:G},N.current.activeBlocks.set(q,Q),console.log(`🌊 [STREAMING] content_block_delta: Created text block ${q} (fallback) with partId: ${Ce}, content: "${U.text}"`)}D(q,Q.content,"text")}else if(U.type==="thinking_delta"&&U.thinking!==void 0){let Q=N.current.activeBlocks.get(q);if(Q)Q.content+=U.thinking,Q.lastUpdatedAt=G,console.log(`🤔 [STREAMING] content_block_delta: Accumulated thinking delta "${U.thinking}" to block ${q}, total: "${Q.content.substring(0,50)}..."`);else{console.warn("🤔 [STREAMING] content_block_delta: Missing content_block_start for thinking block, creating fallback"),m(M.current,"");const ge=Ke.getState().messages.find(Le=>Le.id===M.current),Ce=ge?.messageParts?.[ge.messageParts.length-1]?.id;Q={blockId:q,type:"thinking",content:U.thinking,isComplete:!1,messageId:M.current,partId:Ce,startedAt:G,lastUpdatedAt:G},N.current.activeBlocks.set(q,Q),console.log(`🤔 [STREAMING] content_block_delta: Created thinking block ${q} (fallback) with partId: ${Ce}, content: "${U.thinking}"`)}D(q,Q.content,"thinking")}else if(U.type==="input_json_delta"){const Q=U.partial_json||"";let re=N.current.activeBlocks.get(q);if(re){re.content+=Q,re.lastUpdatedAt=G;const ge=re.content,Se=ge.trim();if(re.partId&&Se.endsWith("}"))try{const Ce=JSON.parse(ge);v(M.current,re.partId,{toolInput:Ce}),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: ${ge.length}`)}}else{if(console.warn("🔧 [STREAMING] content_block_delta: Missing content_block_start for tool block, creating fallback"),!B.content_block||B.content_block.type!=="tool_use"){console.error("🔧 [STREAMING] content_block_delta: Missing content_block info for tool, cannot create fallback");return}const ge=B.content_block.name,Se=B.content_block.id;k(M.current,{toolName:ge,toolInput:{},isExecuting:!0,claudeId:Se});const Le=Ke.getState().messages.find(ct=>ct.id===M.current),Je=Le?.messageParts?.[Le.messageParts.length-1]?.toolData?.id;re={blockId:q,type:"tool_use",content:Q,isComplete:!1,messageId:M.current,partId:Je,startedAt:G,lastUpdatedAt:G},N.current.activeBlocks.set(q,re),console.log("🔧 [STREAMING] content_block_delta: Created tool_use block (fallback)",ge,"blockId:",q,"partId:",Je,"initial fragment:",Q)}}return}if(B.type==="content_block_stop"&&M.current){const Y=B.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 G=N.current;if(G.pendingUpdate?.blockId===U){console.log(`🌊 [STREAMING] content_block_stop: Flushing pending RAF for ${U} immediately`),G.rafId!==null&&(cancelAnimationFrame(G.rafId),G.rafId=null);const Q=G.pendingUpdate;q.partId&&(Q.type==="text"?b(M.current,q.partId,Q.content):Q.type==="thinking"&&y(M.current,q.partId,Q.content),console.log(`🌊 [STREAMING] content_block_stop: Flushed ${Q.type} content for ${U}, length: ${Q.content.length}`)),G.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 Q=JSON.parse(q.content);v(M.current,q.partId,{toolInput:Q}),console.log(`🔧 [STREAMING] content_block_stop: Successfully parsed final tool input for ${U}`)}catch(Q){console.error(`🔧 [STREAMING] content_block_stop: Failed to parse final tool JSON for ${U}:`,Q,"content:",q.content.substring(0,200))}}N.current.activeBlocks.delete(U),console.log(`🌊 [STREAMING] content_block_stop: Cleaned up block ${U}`)}return}if(B.type==="message_delta"){console.log("🌊 [STREAMING] message_delta:",B.delta);return}if(B.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,G=U.activeBlocks.get(q.blockId);G&&G.partId&&Y&&(q.type==="text"?b(Y,G.partId,q.content):q.type==="thinking"&&y(Y,G.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:",B.type);return}if(j.type==="error"){console.error("Claude Code SDK error:",j),c(!1),a(!1),i.current=null;let B="";j.subtype&&j.message?(console.log("📋 Processing structured error with subtype:",j.subtype),B=`❌ **${{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")}**
|
|
32
|
-
|
|
33
|
-
${j.message}`,B+=`
|
|
34
|
-
|
|
35
|
-
**${h("agentChatPanel.errors.suggestedActions")}**
|
|
36
|
-
`,j.subtype==="error_max_budget_usd"?B+=`- ${h("agentChatPanel.errors.checkBudget")}
|
|
37
|
-
`:j.subtype==="error_max_turns"&&(B+=`- ${h("agentChatPanel.errors.increaseMaxTurns")}
|
|
38
|
-
`),B+=`- ${h("agentChatPanel.errors.resendMessage")}
|
|
39
|
-
`,B+=`- ${h("agentChatPanel.errors.refreshPage")}`):j.error==="Claude Code SDK failed"&&j.message&&typeof j.message=="string"?(B=`${h("agentChat.errorMessages.claudeCodeSDKError")}
|
|
40
|
-
|
|
41
|
-
`,j.message.includes("not valid JSON")?B+=h("agentChatPanel.errors.jsonParseError"):j.message.includes("timeout")?B+=h("agentChatPanel.errors.timeoutError"):j.message.includes("context window")||j.message.includes("context_window")?B+=h("agentChatPanel.errors.contextWindowError"):B+=`${j.message}
|
|
42
|
-
|
|
43
|
-
**${h("agentChatPanel.errors.suggestedActions")}**
|
|
44
|
-
- ${h("agentChatPanel.errors.resendMessage")}
|
|
45
|
-
- ${h("agentChatPanel.errors.refreshPage")}`):(B=`${h("agentChat.errorMessages.claudeCodeSDKError")}
|
|
46
|
-
|
|
47
|
-
`,B+=`${j.message||j.error||h("agentChatPanel.errors.unknownError")}
|
|
48
|
-
|
|
49
|
-
**${h("agentChatPanel.errors.suggestedActions")}**
|
|
50
|
-
- ${h("agentChatPanel.errors.resendMessage")}
|
|
51
|
-
- ${h("agentChatPanel.errors.refreshPage")}`),M.current?g(M.current,`
|
|
52
|
-
|
|
53
|
-
`+B):f({content:B,role:"assistant"});return}if(j.type==="system"&&j.subtype==="init"&&(j.sessionId||j.session_id)){const B=j.sessionId||j.session_id;console.log("Setting session ID from AI response:",B),a(!1),!t&&B&&(o(B),l(!0),s&&s(B),d.invalidateQueries({queryKey:["agent-sessions",e]}));return}if(j.type==="mcp_status"){if(console.log("📡 MCP Status Event:",j),j.subtype==="connection_failed"){const B=j.failedServers||[];console.warn("🚨 MCP服务器连接失败:",B),S({hasError:!0,connectionErrors:B,lastError:`连接失败: ${B.map(Y=>Y.name).join(", ")}`})}else if(j.subtype==="connection_success"){const B=j.connectedServers||[];console.log("✅ MCP服务器连接成功:",B.map(Y=>Y.name)),S({hasError:!1,connectedServers:B,connectionErrors:[],lastError:null})}return}if(j.type==="mcp_error"){if(console.log("❌ MCP Error Event:",j),j.subtype==="execution_failed"){const B=j,Y=B.tool||"未知工具",U=B.error||"执行失败",q=B.details||"";console.error("❌ MCP工具执行失败:",{tool:Y,error:U,details:q}),S({hasError:!0,lastError:`工具执行失败: ${Y} - ${U}`,lastErrorDetails:q})}return}if(j.type==="awaiting_user_input"){console.log("🎤 [AskUserQuestion] Received awaiting_user_input event:",j);const B=j;C({toolUseId:B.toolUseId,toolName:B.toolName,questions:B.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 B=j;w(B.agentUrl,B.sessionId,B.message);return}if(j.type==="a2a_stream_data"){const B=j;B.agentUrl&&I(B.agentUrl,{type:B.event?.type||"unknown",sessionId:B.event?.sessionId,message:B.event?.message,timestamp:B.timestamp});return}if(j.type==="a2a_stream_end"){const B=j,Y=Ke.getState();for(const[U,q]of Object.entries(Y.activeA2AStreams))if(q.sessionId===B.sessionId){T(U);break}return}if(j.type==="session_resumed"&&j.subtype==="new_branch"){const B=j;console.log("🔄 Session resumed with new branch:",B),console.log("🔄 Updating session ID from",t,"to",B.newSessionId),a(!1),o(B.newSessionId),l(!0),s&&(console.log("🔄 Updating URL with new session ID:",B.newSessionId),s(B.newSessionId)),f({content:`${h("agentChat.sessionResumed")}
|
|
54
|
-
|
|
55
|
-
${B.message}
|
|
56
|
-
|
|
57
|
-
${h("agentChat.sessionIdUpdated")}`,role:"assistant"}),d.invalidateQueries({queryKey:["agent-sessions",e]}),t&&B.originalSessionId&&B.newSessionId&&(vr.handleSessionResume(e,B.originalSessionId,B.newSessionId),vr.recordSessionResume(e,B.originalSessionId,B.newSessionId),console.log(`🎯 TabManager updated for session resume: ${B.originalSessionId} → ${B.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){f({content:"",role:"assistant"});const Y=Ke.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 B of j.message.content)if(console.log("📝 Processing block:",{type:B.type,hasText:!!B.text,hasThinking:!!B.thinking,textLength:B.text?.length,thinkingLength:B.thinking?.length,toolName:B.name}),B.type==="text")B.text?(console.log("📝 Adding text part:",B.text.substring(0,100)+(B.text.length>100?"...":"")),n&&console.log("📦 Detected /compact command response, adding as compactSummary"),g(M.current,B.text)):console.warn("📝 Text block has no text content");else if(B.type==="thinking")B.thinking?(console.log("🤔 Adding thinking part:",B.thinking.substring(0,100)+(B.thinking.length>100?"...":"")),m(M.current,B.thinking)):console.warn("🤔 Thinking block has no thinking content");else if(B.type==="tool_use"){if(B.name){console.log("📝 Adding tool part:",B.name,"id:",B.id),B.name==="BashOutput"&&console.log("🐚 [BashOutput] Tool use detected, claudeId:",B.id,"input:",B.input);const Y={toolName:B.name,toolInput:B.input||{},isExecuting:!0,claudeId:B.id};k(M.current,Y)}}else console.log("📝 Unknown block type:",B.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 B of j.message.content)if(B.type==="tool_result"&&B.tool_use_id){console.log("🔧 Processing tool_result for tool_use_id:",B.tool_use_id,"content:",B.content,"is_error:",B.is_error);const Y=Ke.getState();let U=null,q=null;for(const G of Y.messages)if(G.messageParts){const Q=G.messageParts.find(re=>re.type==="tool"&&re.toolData?.claudeId===B.tool_use_id);if(Q){U=Q,q=G.id;break}}if(console.log("🔧 Found target tool:",{toolData:U?.toolData,messageId:q,currentMessageId:M.current}),U?.toolData&&q){const G=typeof B.content=="string"?B.content:Array.isArray(B.content)?B.content.map(Q=>Q.text||String(Q)).join(""):JSON.stringify(B.content);if(console.log("🔧 Updating tool with result, setting isExecuting: false"),U.toolData.toolName==="Task"&&U.toolData.claudeId){const Q=U.toolData.claudeId;console.log("🎯 [TASK] Task tool completed, appending result to sub-agent flow:",Q),G&&typeof G=="string"&&G.trim()&&(L(Q,{id:`part_${Q}_result_${Date.now()}`,type:"text",content:G,order:9999}),console.log("🎯 [TASK] Appended result text to sub-agent flow, length:",G.length))}U.toolData.toolName==="BashOutput"&&console.log("🐚 [BashOutput] Updating tool result:",{toolId:U.toolData.id,messageId:q,toolResult:G?.substring(0,200),rawContent:B.content}),v(q,U.toolData.id,{toolResult:G,isError:B.is_error||!1,isExecuting:!1})}else{console.warn("🔧 No target tool found for tool_use_id:",B.tool_use_id);const G=Y.messages.flatMap(Q=>(Q.messageParts||[]).filter(re=>re.type==="tool").map(re=>({claudeId:re.toolData?.claudeId,toolName:re.toolData?.toolName,isExecuting:re.toolData?.isExecuting})));console.warn("🔧 Available tools:",G)}}}return}if(j.type==="assistant"&&j.message&&typeof j.message=="object"&&"content"in j.message&&j.message.content&&M.current){for(const B of j.message.content)if(B.type==="tool_result"&&B.tool_use_id){console.log("🔧 Processing tool_result in assistant message for tool_use_id:",B.tool_use_id);const Y=Ke.getState();let U=null,q=null;for(const G of Y.messages)if(G.messageParts){const Q=G.messageParts.find(re=>re.type==="tool"&&re.toolData?.claudeId===B.tool_use_id);if(Q){U=Q,q=G.id;break}}if(console.log("🔧 Found target tool in assistant message:",{toolData:U?.toolData,messageId:q,currentMessageId:M.current}),U?.toolData&&q){const G=typeof B.content=="string"?B.content:Array.isArray(B.content)?B.content.map(Q=>Q.text||String(Q)).join(""):JSON.stringify(B.content);console.log("🔧 Updating tool with result in assistant message, setting isExecuting: false"),v(q,U.toolData.id,{toolResult:G,isError:B.is_error||!1,isExecuting:!1})}else console.warn("🔧 No target tool found for tool_use_id in assistant message:",B.tool_use_id)}return}if(j.type==="result"){console.log("Received result event:",{subtype:j.subtype,isSideChain:j.isSideChain});const B=j.isSideChain;if(B?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"),cc.emit(uc.AI_RESPONSE_COMPLETE,{agentId:e,sessionId:t,projectPath:r}),console.log("📡 Emitted AI_RESPONSE_COMPLETE event"))),!B){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"){f({content:"",role:"assistant"});const G=Ke.getState();M.current=G.messages[G.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"};f(q);const G=Ke.getState();M.current=G.messages[G.messages.length-1].id}}if(M.current){const q=Ke.getState().messages.find(G=>G.id===M.current);q?.messageParts&&q.messageParts.forEach(G=>{G.type==="tool"&&G.toolData?.isExecuting&&(console.log("Force completing tool:",G.toolData.toolName,"claudeId:",G.toolData.claudeId),v(M.current,G.toolData.id,{isExecuting:!1,toolResult:G.toolData.toolResult||h("agentChat.executionCompleted")}))})}let Y="";j.subtype==="success"?Y="":j.subtype==="error_max_turns"?(Y=`
|
|
58
|
-
|
|
59
|
-
${h("agentChat.maxTurnsReached")}`,j.permission_denials&&j.permission_denials.length>0&&(Y+=`
|
|
60
|
-
|
|
61
|
-
${h("agentChat.permissionDenials")}`,j.permission_denials.forEach((U,q)=>{Y+=`
|
|
62
|
-
${q+1}. ${U.tool_name}: \`${U.tool_input.command||U.tool_input.description||JSON.stringify(U.tool_input)}\``}),Y+=`
|
|
63
|
-
|
|
64
|
-
${h("agentChat.permissionNote")}`)):j.subtype==="error_during_execution"?(Y=`
|
|
65
|
-
|
|
66
|
-
${h("agentChat.executionError")}`,j.errors&&Array.isArray(j.errors)&&(Y+=`
|
|
67
|
-
|
|
68
|
-
${j.errors.join(`
|
|
69
|
-
`)}`)):j.subtype==="error_max_budget_usd"?(Y=`
|
|
70
|
-
|
|
71
|
-
${h("agentChat.maxBudgetReached")}`,j.errors&&Array.isArray(j.errors)&&(Y+=`
|
|
72
|
-
|
|
73
|
-
${j.errors.join(`
|
|
74
|
-
`)}`)):j.subtype==="error_max_structured_output_retries"?(Y=`
|
|
75
|
-
|
|
76
|
-
${h("agentChat.maxRetriesReached")}`,j.errors&&Array.isArray(j.errors)&&(Y+=`
|
|
77
|
-
|
|
78
|
-
${j.errors.join(`
|
|
79
|
-
`)}`)):j.subtype==="error"?(Y=`
|
|
80
|
-
|
|
81
|
-
${h("agentChat.processingError")}`,j.errors&&Array.isArray(j.errors)&&(Y+=`
|
|
82
|
-
|
|
83
|
-
${j.errors.join(`
|
|
84
|
-
`)}`)):Y=`
|
|
85
|
-
|
|
86
|
-
${h("agentChat.processingComplete")}`,M.current&&Y&&g(M.current,Y),t&&d.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,`
|
|
87
|
-
|
|
88
|
-
❌ **Streaming Error**: ${j instanceof Error?j.message:String(j)}
|
|
89
|
-
|
|
90
|
-
Please refresh the page and try again.`):f({content:`❌ **Streaming Error**: ${j instanceof Error?j.message:String(j)}
|
|
91
|
-
|
|
92
|
-
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,d,f,g,m,b,y,k,v,S,C,w,T,I,D,P]),W=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")}**
|
|
93
|
-
|
|
94
|
-
${_.message||h("agentChatPanel.errors.unknownErrorRetry")}`),M.current?g(M.current,`
|
|
95
|
-
|
|
96
|
-
`+j):f({content:j,role:"assistant"})},[i,c,a,h,f,g]),X=O.useCallback(()=>{M.current=null,N.current.wasStreamProcessed=!1,N.current.isStreaming=!1,N.current.currentMessageId=null},[]);return{handleStreamMessage:R,handleStreamError:W,resetMessageId:X}};class uv{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:`
|
|
97
|
-
可用命令:
|
|
98
|
-
• /clear - 清空对话历史
|
|
99
|
-
• /init - 初始化项目或重置对话上下文
|
|
100
|
-
• /compact - 压缩对话历史
|
|
101
|
-
• /agents - 管理AI代理
|
|
102
|
-
• /settings - 打开设置页面
|
|
103
|
-
• /help - 显示帮助信息
|
|
104
|
-
`.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 hv(e){return new uv(e)}const dv=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:d,selectedCommand:f,selectedRegularTools:g,selectedMcpTools:m,mcpToolsEnabled:b,permissionMode:y,selectedModel:k,selectedClaudeVersion:v,abortControllerRef:S,onSessionChange:C,setInputMessage:w,clearImages:T,setSelectedCommand:I,setShowCommandSelector:M,setCommandWarning:E,setIsInitializingSession:N,setCurrentSessionId:D,setIsNewSession:P,setAiTyping:$,setHasSuccessfulResponse:F,setConfirmMessage:L,setConfirmAction:R,setShowConfirmDialog:W,handleNewSession:X,isCommandDefined:_,getAllAvailableCommands:j,envVars:te}=e,{t:A}=ve("components"),{addMessage:B,addCommandPartToMessage:Y,addTextPartToMessage:U}=Ke(),q=y1(),G=O.useRef(!1),Q={agentId:t.id,currentSessionId:a,projectPath:r,isCompactCommand:G.current,abortControllerRef:S,onSessionChange:C,setIsInitializingSession:N,setCurrentSessionId:D,setIsNewSession:P,setAiTyping:$,setHasSuccessfulResponse:F},{handleStreamMessage:re,handleStreamError:ge,resetMessageId:Se}=cv(Q),Ce=O.useCallback(()=>{if(s||!n.trim()&&i.length===0)return!0;if(cs(n)){const ze=n.slice(1).split(" ")[0].toLowerCase();return!_(ze)}return!1},[n,s,i,_]),Le=O.useCallback(async()=>{if(!n.trim()&&i.length===0||s)return;let ze=n.trim();const ct=[...i].map(Ee=>({id:Ee.id,data:Ee.preview.split(",")[1],mediaType:Ee.file.type,name:Ee.file.name}));if(cs(n)){const Ee=n.slice(1).split(" ")[0].toLowerCase();if(!_(Ee)){E(o?A("agentChat.commandsLoadErrorWarning",{command:Ee,commands:u.map(We=>We.content).join(", "),errorMessage:l?.message||c?.message||"Unknown error"}):A("agentChat.unknownCommandWarning",{command:Ee,commands:j()}));return}E(null);const ut=hv({agentStore:Ke.getState(),onNewSession:X,onNavigate:We=>{H1(A("agentChat.navigateToAlert",{path:We}))},onConfirm:(We,Ct)=>{L(We),R(()=>Ct),W(!0)}});let gt=f;if(gt||(gt=u.find(We=>We.name===Ee)||d.find(We=>We.name===Ee)||h.find(We=>We.name===Ee)||null),gt){const We=await ut.executeCommand(gt);if(We.shouldSendToBackend){ze=n.trim(),B({content:"",role:"user",images:ct});const yt=Ke.getState(),V=yt.messages[yt.messages.length-1].id;Y(V,ze)}else{const Ct=n.slice(gt.content.length).trim()||void 0,yt=tv(gt,Ct,r);B({content:yt,role:"user",images:ct}),w(""),T(),I(null),M(!1),We.message&&We.action!=="confirm"&&B({content:We.message,role:"assistant"});return}}}else E(null);w(""),T(),I(null),M(!1),cs(n.trim())||B({content:ze||A("agentChat.sendImage"),role:"user",images:ct});const $t={};$(!0),a||(console.log("🆕 No current session, will create new session"),N(!0));const vt=new AbortController;S.current=vt,G.current=ze.trim()==="/compact",Se();try{const Ee=[...g,...b&&m.length>0?m:[]];await q.mutateAsync({agentId:t.id,message:ze,images:ct.length>0?ct:void 0,context:$t,sessionId:a,projectPath:r,mcpTools:Ee.length>0?Ee:void 0,permissionMode:y,model:k,claudeVersion:v,envVars:te,channel:"web",abortController:vt,onMessage:re,onError:ge})}catch(Ee){if(console.error("Chat error:",Ee),$(!1),N(!1),S.current=null,Ee instanceof DOMException&&Ee.name==="AbortError"){console.log("Request was aborted by user");return}let ut=A("agentChatPanel.errors.connectionFailed");Ee instanceof Error&&(Ee.message.includes("Failed to fetch")||Ee.message.includes("NetworkError")?ut=A("agentChatPanel.errors.networkConnectionFailed"):Ee.message.includes("timeout")?ut=A("agentChatPanel.errors.connectionTimeout"):ut=`❌ **${A("agentChatPanel.errors.connectionError")}**
|
|
105
|
-
|
|
106
|
-
${Ee.message||A("agentChatPanel.errors.cannotConnectRetry")}`),B({content:ut,role:"assistant"})}},[t,r,n,i,s,a,o,l,c,u,h,d,f,g,m,b,y,k,v,S,w,T,I,M,E,N,$,X,_,j,A,B,Y,U,q,re,ge,Se,L,R,W]);return{isSendDisabled:Ce,handleSendMessage:Le,handleStreamMessage:re,handleStreamError:ge,resetMessageId:Se}},fv=({agentId:e,currentSessionId:t,onSessionChange:r,textareaRef:n})=>{const i=Mu(),{setCurrentSessionId:s,clearMessages:a}=Ke(),[o,l]=O.useState(!1),[c,u]=O.useState(!1),[h,d]=O.useState(!1),f=O.useCallback(b=>{s(b),l(!0),u(!1),d(!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),d(!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:d,setCurrentSessionId:s,handleSwitchSession:f,handleNewSession:g,handleRefreshMessages:m}},pv=()=>{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),[d,f]=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:d,isStopping:g,isInitializingSession:b,setShowSessions:t,setShowConfirmDialog:n,setShowMobileSettings:s,setShowMcpStatusModal:o,setConfirmMessage:c,setConfirmAction:h,setSearchTerm:f,setIsStopping:m,setIsInitializingSession:y,handleConfirmDialog:k,handleCancelDialog:v}};function gv(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const mv=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xv=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yv={};function md(e,t){return(yv.jsx?xv:mv).test(e)}const bv=/[ \t\n\f\r]/g;function kv(e){return typeof e=="object"?e.type==="text"?xd(e.value):!1:xd(e)}function xd(e){return e.replace(bv,"")===""}class Rs{constructor(t,r,n){this.normal=r,this.property=t,n&&(this.space=n)}}Rs.prototype.normal={};Rs.prototype.property={};Rs.prototype.space=void 0;function bg(e,t){const r={},n={};for(const i of e)Object.assign(r,i.property),Object.assign(n,i.normal);return new Rs(r,n,t)}function dc(e){return e.toLowerCase()}class Yt{constructor(t,r){this.attribute=r,this.property=t}}Yt.prototype.attribute="";Yt.prototype.booleanish=!1;Yt.prototype.boolean=!1;Yt.prototype.commaOrSpaceSeparated=!1;Yt.prototype.commaSeparated=!1;Yt.prototype.defined=!1;Yt.prototype.mustUseProperty=!1;Yt.prototype.number=!1;Yt.prototype.overloadedBoolean=!1;Yt.prototype.property="";Yt.prototype.spaceSeparated=!1;Yt.prototype.space=void 0;let wv=0;const Te=Dn(),ot=Dn(),fc=Dn(),ee=Dn(),Ue=Dn(),ti=Dn(),Kt=Dn();function Dn(){return 2**++wv}const pc=Object.freeze(Object.defineProperty({__proto__:null,boolean:Te,booleanish:ot,commaOrSpaceSeparated:Kt,commaSeparated:ti,number:ee,overloadedBoolean:fc,spaceSeparated:Ue},Symbol.toStringTag,{value:"Module"})),kl=Object.keys(pc);class Iu extends Yt{constructor(t,r,n,i){let s=-1;if(super(t,r),yd(this,"space",i),typeof n=="number")for(;++s<kl.length;){const a=kl[s];yd(this,kl[s],(n&pc[a])===pc[a])}}}Iu.prototype.defined=!0;function yd(e,t,r){r&&(e[t]=r)}function Si(e){const t={},r={};for(const[n,i]of Object.entries(e.properties)){const s=new Iu(n,e.transform(e.attributes||{},n),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(s.mustUseProperty=!0),t[n]=s,r[dc(n)]=n,r[dc(s.attribute)]=n}return new Rs(t,r,e.space)}const kg=Si({properties:{ariaActiveDescendant:null,ariaAtomic:ot,ariaAutoComplete:null,ariaBusy:ot,ariaChecked:ot,ariaColCount:ee,ariaColIndex:ee,ariaColSpan:ee,ariaControls:Ue,ariaCurrent:null,ariaDescribedBy:Ue,ariaDetails:null,ariaDisabled:ot,ariaDropEffect:Ue,ariaErrorMessage:null,ariaExpanded:ot,ariaFlowTo:Ue,ariaGrabbed:ot,ariaHasPopup:null,ariaHidden:ot,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ue,ariaLevel:ee,ariaLive:null,ariaModal:ot,ariaMultiLine:ot,ariaMultiSelectable:ot,ariaOrientation:null,ariaOwns:Ue,ariaPlaceholder:null,ariaPosInSet:ee,ariaPressed:ot,ariaReadOnly:ot,ariaRelevant:null,ariaRequired:ot,ariaRoleDescription:Ue,ariaRowCount:ee,ariaRowIndex:ee,ariaRowSpan:ee,ariaSelected:ot,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 wg(e,t){return t in e?e[t]:t}function vg(e,t){return wg(e,t.toLowerCase())}const vv=Si({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ti,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:ot,controls:Te,controlsList:Ue,coords:ee|ti,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Te,defer:Te,dir:null,dirName:null,disabled:Te,download:fc,draggable:ot,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Te,formTarget:null,headers:Ue,height:ee,hidden:fc,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:ot,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:ot,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:ot,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:vg}),Cv=Si({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:Kt,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:ti,g2:ti,glyphName:ti,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:Kt,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:Kt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Kt,rev:Kt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Kt,requiredFeatures:Kt,requiredFonts:Kt,requiredFormats:Kt,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:Kt,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:Kt,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:Kt,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:wg}),Cg=Si({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()}}),Sg=Si({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:vg}),_g=Si({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Sv={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"},_v=/[A-Z]/g,bd=/-[a-z]/g,Tv=/^data[-\w.:]+$/i;function Ev(e,t){const r=dc(t);let n=t,i=Yt;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&Tv.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(bd,Mv);n="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!bd.test(s)){let a=s.replace(_v,Av);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Iu}return new i(n,t)}function Av(e){return"-"+e.toLowerCase()}function Mv(e){return e.charAt(1).toUpperCase()}const Nv=bg([kg,vv,Cg,Sg,_g],"html"),$u=bg([kg,Cv,Cg,Sg,_g],"svg");function Lv(e){return e.join(" ").trim()}var Gn={},wl,kd;function Iv(){if(kd)return wl;kd=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=`
|
|
107
|
-
`,c="/",u="*",h="",d="comment",f="declaration";wl=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(P){var $=P.match(t);$&&(y+=$.length);var F=P.lastIndexOf(l);k=~F?P.length-F:k+P.length}function S(){var P={line:y,column:k};return function($){return $.position=new C(P),I(),$}}function C(P){this.start=P,this.end={line:y,column:k},this.source=b.source}C.prototype.content=m;function w(P){var $=new Error(b.source+":"+y+":"+k+": "+P);if($.reason=P,$.filename=b.source,$.line=y,$.column=k,$.source=m,!b.silent)throw $}function T(P){var $=P.exec(m);if($){var F=$[0];return v(F),m=m.slice(F.length),$}}function I(){T(r)}function M(P){var $;for(P=P||[];$=E();)$!==!1&&P.push($);return P}function E(){var P=S();if(!(c!=m.charAt(0)||u!=m.charAt(1))){for(var $=2;h!=m.charAt($)&&(u!=m.charAt($)||c!=m.charAt($+1));)++$;if($+=2,h===m.charAt($-1))return w("End of comment missing");var F=m.slice(2,$-2);return k+=2,v(F),m=m.slice($),k+=2,P({type:d,comment:F})}}function N(){var P=S(),$=T(n);if($){if(E(),!T(i))return w("property missing ':'");var F=T(s),L=P({type:f,property:g($[0].replace(e,h)),value:F?g(F[0].replace(e,h)):h});return T(a),L}}function D(){var P=[];M(P);for(var $;$=N();)$!==!1&&(P.push($),M(P));return P}return I(),D()};function g(m){return m?m.replace(o,h):h}return wl}var wd;function $v(){if(wd)return Gn;wd=1;var e=Gn&&Gn.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Gn,"__esModule",{value:!0}),Gn.default=r;const t=e(Iv());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 Gn}var Pi={},vd;function jv(){if(vd)return Pi;vd=1,Object.defineProperty(Pi,"__esModule",{value:!0}),Pi.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 Pi.camelCase=l,Pi}var Ri,Cd;function Bv(){if(Cd)return Ri;Cd=1;var e=Ri&&Ri.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e($v()),r=jv();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 Dv=Bv();const Pv=Au(Dv),Tg=Eg("end"),ju=Eg("start");function Eg(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 Rv(e){const t=ju(e),r=Tg(e);if(t&&r)return{start:t,end:r}}function us(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Sd(e.position):"start"in e||"end"in e?Sd(e):"line"in e||"column"in e?gc(e):""}function gc(e){return _d(e&&e.line)+":"+_d(e&&e.column)}function Sd(e){return gc(e&&e.start)+"-"+gc(e&&e.end)}function _d(e){return e&&typeof e=="number"?e:1}class Lt 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=us(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}}Lt.prototype.file="";Lt.prototype.name="";Lt.prototype.reason="";Lt.prototype.message="";Lt.prototype.stack="";Lt.prototype.column=void 0;Lt.prototype.line=void 0;Lt.prototype.ancestors=void 0;Lt.prototype.cause=void 0;Lt.prototype.fatal=void 0;Lt.prototype.place=void 0;Lt.prototype.ruleId=void 0;Lt.prototype.source=void 0;const Bu={}.hasOwnProperty,Fv=new Map,Ov=/[A-Z]/g,zv=new Set(["table","tbody","thead","tfoot","tr"]),Wv=new Set(["td","th"]),Ag="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Hv(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=Qv(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=Kv(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"?$u:Nv,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=Mg(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function Mg(e,t,r){if(t.type==="element")return qv(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Uv(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Gv(e,t,r);if(t.type==="mdxjsEsm")return Vv(e,t);if(t.type==="root")return Yv(e,t,r);if(t.type==="text")return Xv(e,t)}function qv(e,t,r){const n=e.schema;let i=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(i=$u,e.schema=i),e.ancestors.push(t);const s=Lg(e,t.tagName,!1),a=Zv(e,t);let o=Pu(e,t);return zv.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!kv(l):!0})),Ng(e,a,s,t),Du(a,o),e.ancestors.pop(),e.schema=n,e.create(t,s,a,r)}function Uv(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)}ws(e,t.position)}function Vv(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ws(e,t.position)}function Gv(e,t,r){const n=e.schema;let i=n;t.name==="svg"&&n.space==="html"&&(i=$u,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:Lg(e,t.name,!0),a=Jv(e,t),o=Pu(e,t);return Ng(e,a,s,t),Du(a,o),e.ancestors.pop(),e.schema=n,e.create(t,s,a,r)}function Yv(e,t,r){const n={};return Du(n,Pu(e,t)),e.create(t,e.Fragment,n,r)}function Xv(e,t){return t.value}function Ng(e,t,r,n){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=n)}function Du(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function Kv(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 Qv(e,t){return r;function r(n,i,s,a){const o=Array.isArray(s.children),l=ju(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 Zv(e,t){const r={};let n,i;for(i in t.properties)if(i!=="children"&&Bu.call(t.properties,i)){const s=e2(e,i,t.properties[i]);if(s){const[a,o]=s;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&Wv.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 Jv(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 ws(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 ws(e,t.position);else s=n.value===null?!0:n.value;r[i]=s}return r}function Pu(e,t){const r=[];let n=-1;const i=e.passKeys?new Map:Fv;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=Mg(e,s,a);o!==void 0&&r.push(o)}return r}function e2(e,t,r){const n=Ev(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=n.commaSeparated?gv(r):Lv(r)),n.property==="style"){let i=typeof r=="object"?r:t2(e,String(r));return e.stylePropertyNameCase==="css"&&(i=r2(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&n.space?Sv[n.property]||n.property:n.attribute,r]}}function t2(e,t){try{return Pv(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const n=r,i=new Lt("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=Ag+"#cannot-parse-style-attribute",i}}function Lg(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=md(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=md(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){const i=n.value;return Bu.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(n);ws(e)}function ws(e,t){const r=new Lt("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=Ag+"#cannot-handle-mdx-estrees-without-createevaluater",r}function r2(e){const t={};let r;for(r in e)Bu.call(e,r)&&(t[n2(r)]=e[r]);return t}function n2(e){let t=e.replace(Ov,i2);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function i2(e){return"-"+e.toLowerCase()}const vl={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"]},s2={};function Ru(e,t){const r=s2,n=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,i=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return Ig(e,n,i)}function Ig(e,t,r){if(a2(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 Td(e.children,t,r)}return Array.isArray(e)?Td(e,t,r):""}function Td(e,t,r){const n=[];let i=-1;for(;++i<e.length;)n[i]=Ig(e[i],t,r);return n.join("")}function a2(e){return!!(e&&typeof e=="object")}const Ed=document.createElement("i");function Fu(e){const t="&"+e+";";Ed.innerHTML=t;const r=Ed.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function Qt(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 nr(e,t){return e.length>0?(Qt(e,e.length,0,t),e):t}const Ad={}.hasOwnProperty;function $g(e){const t={};let r=-1;for(;++r<e.length;)o2(t,e[r]);return t}function o2(e,t){let r;for(r in t){const i=(Ad.call(e,r)?e[r]:void 0)||(e[r]={}),s=t[r];let a;if(s)for(a in s){Ad.call(i,a)||(i[a]=[]);const o=s[a];l2(i[a],Array.isArray(o)?o:o?[o]:[])}}}function l2(e,t){let r=-1;const n=[];for(;++r<t.length;)(t[r].add==="after"?e:n).push(t[r]);Qt(e,0,0,n)}function jg(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 dr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Dt=an(/[A-Za-z]/),Et=an(/[\dA-Za-z]/),c2=an(/[#-'*+\--9=?A-Z^-~]/);function Va(e){return e!==null&&(e<32||e===127)}const mc=an(/\d/),u2=an(/[\dA-Fa-f]/),h2=an(/[!-/:-@[-`{-~]/);function me(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 Bo=an(new RegExp("\\p{P}|\\p{S}","u")),An=an(/\s/);function an(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function _i(e){const t=[];let r=-1,n=0,i=0;for(;++r<e.length;){const s=e.charCodeAt(r);let a="";if(s===37&&Et(e.charCodeAt(r+1))&&Et(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 d2={tokenize:f2};function f2(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 me(o)?(e.consume(o),e.exit("chunkText"),s):(e.consume(o),a)}}const p2={tokenize:g2},Md={tokenize:m2};function g2(e){const t=this,r=[];let n=0,i,s,a;return o;function o(v){if(n<r.length){const S=r[n];return t.containerState=S[1],e.attempt(S[0].continuation,l,c)(v)}return c(v)}function l(v){if(n++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&k();const S=t.events.length;let C=S,w;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){w=t.events[C][1].end;break}y(n);let T=S;for(;T<t.events.length;)t.events[T][1].end={...w},T++;return Qt(t.events,C+1,0,t.events.slice(S)),t.events.length=T,c(v)}return o(v)}function c(v){if(n===r.length){if(!i)return d(v);if(i.currentConstruct&&i.currentConstruct.concrete)return g(v);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Md,u,h)(v)}function u(v){return i&&k(),y(n),d(v)}function h(v){return t.parser.lazy[t.now().line]=n!==r.length,a=t.now().offset,g(v)}function d(v){return t.containerState={},e.attempt(Md,f,g)(v)}function f(v){return n++,r.push([t.currentConstruct,t.containerState]),d(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 me(v)?(e.consume(v),b(e.exit("chunkFlow")),n=0,t.interrupt=void 0,o):(e.consume(v),m)}function b(v,S){const C=t.sliceStream(v);if(S&&C.push(null),v.previous=s,s&&(s.next=v),s=v,i.defineSkip(v.start),i.write(C),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 I=T,M,E;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(M){E=t.events[I][1].end;break}M=!0}for(y(n),w=T;w<t.events.length;)t.events[w][1].end={...E},w++;Qt(t.events,I+1,0,t.events.slice(T)),t.events.length=w}}function y(v){let S=r.length;for(;S-- >v;){const C=r[S];t.containerState=C[1],C[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 m2(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 pi(e){if(e===null||He(e)||An(e))return 1;if(Bo(e))return 2}function Do(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 xc={name:"attention",resolveAll:x2,tokenize:y2};function x2(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},d={...e[r][1].start};Nd(h,-l),Nd(d,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:d},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=nr(c,[["enter",e[n][1],t],["exit",e[n][1],t]])),c=nr(c,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",s,t]]),c=nr(c,Do(t.parser.constructs.insideSpan.null,e.slice(n+1,r),t)),c=nr(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=nr(c,[["enter",e[r][1],t],["exit",e[r][1],t]])):u=0,Qt(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 y2(e,t){const r=this.parser.constructs.attentionMarkers.null,n=this.previous,i=pi(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=pi(l),h=!u||u===2&&i||r.includes(l),d=!i||i===2&&u||r.includes(n);return c._open=!!(s===42?h:h&&(i||!d)),c._close=!!(s===42?d:d&&(u||!h)),t(l)}}function Nd(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const b2={name:"autolink",tokenize:k2};function k2(e,t,r){let n=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(f){return Dt(f)?(e.consume(f),a):f===64?r(f):c(f)}function a(f){return f===43||f===45||f===46||Et(f)?(n=1,o(f)):c(f)}function o(f){return f===58?(e.consume(f),n=0,l):(f===43||f===45||f===46||Et(f))&&n++<32?(e.consume(f),o):(n=0,c(f))}function l(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||Va(f)?r(f):(e.consume(f),l)}function c(f){return f===64?(e.consume(f),u):c2(f)?(e.consume(f),c):r(f)}function u(f){return Et(f)?h(f):r(f)}function h(f){return f===46?(e.consume(f),n=0,u):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):d(f)}function d(f){if((f===45||Et(f))&&n++<63){const g=f===45?d:h;return e.consume(f),g}return r(f)}}const Fs={partial:!0,tokenize:w2};function w2(e,t,r){return n;function n(s){return Me(s)?je(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||me(s)?t(s):r(s)}}const Bg={continuation:{tokenize:C2},exit:S2,name:"blockQuote",tokenize:v2};function v2(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 C2(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(Bg,t,r)(a)}}function S2(e){e.exit("blockQuote")}const Dg={name:"characterEscape",tokenize:_2};function _2(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 h2(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(s)}}const Pg={name:"characterReference",tokenize:T2};function T2(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=Et,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=u2,u):(e.enter("characterReferenceValue"),s=7,a=mc,u(h))}function u(h){if(h===59&&i){const d=e.exit("characterReferenceValue");return a===Et&&!Fu(n.sliceSerialize(d))?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 Ld={partial:!0,tokenize:A2},Id={concrete:!0,name:"codeFenced",tokenize:E2};function E2(e,t,r){const n=this,i={partial:!0,tokenize:C};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||me(w)?(e.exit("codeFencedFence"),n.interrupt?t(w):e.check(Ld,m,S)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),d(w))}function d(w){return w===null||me(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(w)):Me(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),je(e,f,"whitespace")(w)):w===96&&w===o?r(w):(e.consume(w),d)}function f(w){return w===null||me(w)?h(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===null||me(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,S,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||me(w)?e.check(Ld,m,S)(w):(e.enter("codeFlowValue"),v(w))}function v(w){return w===null||me(w)?(e.exit("codeFlowValue"),k(w)):(e.consume(w),v)}function S(w){return e.exit("codeFenced"),t(w)}function C(w,T,I){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"),P(F)):I(F)}function P(F){return F===o?(M++,w.consume(F),P):M>=a?(w.exit("codeFencedFenceSequence"),Me(F)?je(w,$,"whitespace")(F):$(F)):I(F)}function $(F){return F===null||me(F)?(w.exit("codeFencedFence"),T(F)):I(F)}}}function A2(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 Cl={name:"codeIndented",tokenize:N2},M2={partial:!0,tokenize:L2};function N2(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):me(c)?e.attempt(M2,a,l)(c):(e.enter("codeFlowValue"),o(c))}function o(c){return c===null||me(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),o)}function l(c){return e.exit("codeIndented"),t(c)}}function L2(e,t,r){const n=this;return i;function i(a){return n.parser.lazy[n.now().line]?r(a):me(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):me(a)?i(a):r(a)}}const I2={name:"codeText",previous:j2,resolve:$2,tokenize:B2};function $2(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 j2(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function B2(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)):me(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||me(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 D2{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&&Fi(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),Fi(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Fi(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);Fi(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Fi(this.left,r.reverse())}}}function Fi(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 Rg(e){const t={};let r=-1,n,i,s,a,o,l,c;const u=new D2(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,P2(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 Qt(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function P2(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,d=-1,f=r,g=0,m=0;const b=[m];for(;f;){for(;e.get(++i)[1]!==f;);s.push(i),f._tokenizer||(u=n.sliceStream(f),f.next||u.push(null),h&&a.defineSkip(f.start),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),h=f,f=f.next}for(f=r;++d<o.length;)o[d][0]==="exit"&&o[d-1][0]==="enter"&&o[d][1].type===o[d-1][1].type&&o[d][1].start.line!==o[d][1].end.line&&(m=d+1,b.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(a.events=[],f?(f._tokenizer=void 0,f.previous=void 0):b.pop(),d=b.length;d--;){const y=o.slice(b[d],b[d+1]),k=s.pop();l.push([k,k+y.length-1]),e.splice(k,2,y)}for(l.reverse(),d=-1;++d<l.length;)c[g+l[d][0]]=g+l[d][1],g+=l[d][1]-l[d][0]-1;return c}const R2={resolve:O2,tokenize:z2},F2={partial:!0,tokenize:W2};function O2(e){return Rg(e),e}function z2(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):me(o)?e.check(F2,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 W2(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||me(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 Fg(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),d):y===null||y===32||y===41||Va(y)?r(y):(e.enter(n),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),m(y))}function d(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"}),f(y))}function f(y){return y===62?(e.exit("chunkString"),e.exit(o),d(y)):y===null||y===60||me(y)?r(y):(e.consume(y),y===92?g:f)}function g(y){return y===60||y===62||y===92?(e.consume(y),f):f(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||Va(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 Og(e,t,r,n,i,s){const a=this;let o=0,l;return c;function c(f){return e.enter(n),e.enter(i),e.consume(f),e.exit(i),e.enter(s),u}function u(f){return o>999||f===null||f===91||f===93&&!l||f===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?r(f):f===93?(e.exit(s),e.enter(i),e.consume(f),e.exit(i),e.exit(n),t):me(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===null||f===91||f===93||me(f)||o++>999?(e.exit("chunkString"),u(f)):(e.consume(f),l||(l=!Me(f)),f===92?d:h)}function d(f){return f===91||f===92||f===93?(e.consume(f),o++,h):h(f)}}function zg(e,t,r,n,i,s){let a;return o;function o(d){return d===34||d===39||d===40?(e.enter(n),e.enter(i),e.consume(d),e.exit(i),a=d===40?41:d,l):r(d)}function l(d){return d===a?(e.enter(i),e.consume(d),e.exit(i),e.exit(n),t):(e.enter(s),c(d))}function c(d){return d===a?(e.exit(s),l(a)):d===null?r(d):me(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),je(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(d){return d===a||d===null||me(d)?(e.exit("chunkString"),c(d)):(e.consume(d),d===92?h:u)}function h(d){return d===a||d===92?(e.consume(d),u):u(d)}}function hs(e,t){let r;return n;function n(i){return me(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 H2={name:"definition",tokenize:U2},q2={partial:!0,tokenize:V2};function U2(e,t,r){const n=this;let i;return s;function s(f){return e.enter("definition"),a(f)}function a(f){return Og.call(n,e,o,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function o(f){return i=dr(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),l):r(f)}function l(f){return He(f)?hs(e,c)(f):c(f)}function c(f){return Fg(e,u,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return e.attempt(q2,h,h)(f)}function h(f){return Me(f)?je(e,d,"whitespace")(f):d(f)}function d(f){return f===null||me(f)?(e.exit("definition"),n.parser.defined.push(i),t(f)):r(f)}}function V2(e,t,r){return n;function n(o){return He(o)?hs(e,i)(o):r(o)}function i(o){return zg(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||me(o)?t(o):r(o)}}const G2={name:"hardBreakEscape",tokenize:Y2};function Y2(e,t,r){return n;function n(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return me(s)?(e.exit("hardBreakEscape"),t(s)):r(s)}}const X2={name:"headingAtx",resolve:K2,tokenize:Q2};function K2(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"},Qt(e,n,r-n+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function Q2(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||me(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 Z2=["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"],$d=["pre","script","style","textarea"],J2={concrete:!0,name:"htmlFlow",resolveTo:rC,tokenize:nC},eC={partial:!0,tokenize:sC},tC={partial:!0,tokenize:iC};function rC(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 nC(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),d):A===47?(e.consume(A),s=!0,m):A===63?(e.consume(A),i=3,n.interrupt?t:_):Dt(A)?(e.consume(A),a=String.fromCharCode(A),b):r(A)}function d(A){return A===45?(e.consume(A),i=2,f):A===91?(e.consume(A),i=5,o=0,g):Dt(A)?(e.consume(A),i=4,n.interrupt?t:_):r(A)}function f(A){return A===45?(e.consume(A),n.interrupt?t:_):r(A)}function g(A){const B="CDATA[";return A===B.charCodeAt(o++)?(e.consume(A),o===B.length?n.interrupt?t:D:g):r(A)}function m(A){return Dt(A)?(e.consume(A),a=String.fromCharCode(A),b):r(A)}function b(A){if(A===null||A===47||A===62||He(A)){const B=A===47,Y=a.toLowerCase();return!B&&!s&&$d.includes(Y)?(i=1,n.interrupt?t(A):D(A)):Z2.includes(a.toLowerCase())?(i=6,B?(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||Et(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||Dt(A)?(e.consume(A),S):Me(A)?(e.consume(A),v):E(A)}function S(A){return A===45||A===46||A===58||A===95||Et(A)?(e.consume(A),S):C(A)}function C(A){return A===61?(e.consume(A),w):Me(A)?(e.consume(A),C):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):I(A)}function T(A){return A===l?(e.consume(A),l=null,M):A===null||me(A)?r(A):(e.consume(A),T)}function I(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||He(A)?C(A):(e.consume(A),I)}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||me(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),R):A===62&&i===4?(e.consume(A),j):A===63&&i===3?(e.consume(A),_):A===93&&i===5?(e.consume(A),X):me(A)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(eC,te,P)(A)):A===null||me(A)?(e.exit("htmlFlowData"),P(A)):(e.consume(A),D)}function P(A){return e.check(tC,$,te)(A)}function $(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),F}function F(A){return A===null||me(A)?P(A):(e.enter("htmlFlowData"),D(A))}function L(A){return A===45?(e.consume(A),_):D(A)}function R(A){return A===47?(e.consume(A),a="",W):D(A)}function W(A){if(A===62){const B=a.toLowerCase();return $d.includes(B)?(e.consume(A),j):D(A)}return Dt(A)&&a.length<8?(e.consume(A),a+=String.fromCharCode(A),W):D(A)}function X(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||me(A)?(e.exit("htmlFlowData"),te(A)):(e.consume(A),j)}function te(A){return e.exit("htmlFlow"),t(A)}}function iC(e,t,r){const n=this;return i;function i(a){return me(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 sC(e,t,r){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Fs,t,r)}}const aC={name:"htmlText",tokenize:oC};function oC(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(_),C):_===63?(e.consume(_),v):Dt(_)?(e.consume(_),I):r(_)}function c(_){return _===45?(e.consume(_),u):_===91?(e.consume(_),s=0,g):Dt(_)?(e.consume(_),k):r(_)}function u(_){return _===45?(e.consume(_),f):r(_)}function h(_){return _===null?r(_):_===45?(e.consume(_),d):me(_)?(a=h,R(_)):(e.consume(_),h)}function d(_){return _===45?(e.consume(_),f):h(_)}function f(_){return _===62?L(_):_===45?d(_):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):me(_)?(a=m,R(_)):(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(_):me(_)?(a=k,R(_)):(e.consume(_),k)}function v(_){return _===null?r(_):_===63?(e.consume(_),S):me(_)?(a=v,R(_)):(e.consume(_),v)}function S(_){return _===62?L(_):v(_)}function C(_){return Dt(_)?(e.consume(_),w):r(_)}function w(_){return _===45||Et(_)?(e.consume(_),w):T(_)}function T(_){return me(_)?(a=T,R(_)):Me(_)?(e.consume(_),T):L(_)}function I(_){return _===45||Et(_)?(e.consume(_),I):_===47||_===62||He(_)?M(_):r(_)}function M(_){return _===47?(e.consume(_),L):_===58||_===95||Dt(_)?(e.consume(_),E):me(_)?(a=M,R(_)):Me(_)?(e.consume(_),M):L(_)}function E(_){return _===45||_===46||_===58||_===95||Et(_)?(e.consume(_),E):N(_)}function N(_){return _===61?(e.consume(_),D):me(_)?(a=N,R(_)):Me(_)?(e.consume(_),N):M(_)}function D(_){return _===null||_===60||_===61||_===62||_===96?r(_):_===34||_===39?(e.consume(_),i=_,P):me(_)?(a=D,R(_)):Me(_)?(e.consume(_),D):(e.consume(_),$)}function P(_){return _===i?(e.consume(_),i=void 0,F):_===null?r(_):me(_)?(a=P,R(_)):(e.consume(_),P)}function $(_){return _===null||_===34||_===39||_===60||_===61||_===96?r(_):_===47||_===62||He(_)?M(_):(e.consume(_),$)}function F(_){return _===47||_===62||He(_)?M(_):r(_)}function L(_){return _===62?(e.consume(_),e.exit("htmlTextData"),e.exit("htmlText"),t):r(_)}function R(_){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),W}function W(_){return Me(_)?je(e,X,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):X(_)}function X(_){return e.enter("htmlTextData"),a(_)}}const Ou={name:"labelEnd",resolveAll:hC,resolveTo:dC,tokenize:fC},lC={tokenize:pC},cC={tokenize:gC},uC={tokenize:mC};function hC(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&&Qt(e,0,e.length,r),e}function dC(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=nr(o,e.slice(s+1,s+n+3)),o=nr(o,[["enter",u,t]]),o=nr(o,Do(t.parser.constructs.insideSpan.null,e.slice(s+n+4,a-3),t)),o=nr(o,[["exit",u,t],e[a-2],e[a-1],["exit",c,t]]),o=nr(o,e.slice(a+1)),o=nr(o,[["exit",l,t]]),Qt(e,s,e.length,o),e}function fC(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(d){return s?s._inactive?h(d):(a=n.parser.defined.includes(dr(n.sliceSerialize({start:s.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelEnd"),l):r(d)}function l(d){return d===40?e.attempt(lC,u,a?u:h)(d):d===91?e.attempt(cC,u,a?c:h)(d):a?u(d):h(d)}function c(d){return e.attempt(uC,u,h)(d)}function u(d){return t(d)}function h(d){return s._balanced=!0,r(d)}}function pC(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)?hs(e,s)(h):s(h)}function s(h){return h===41?u(h):Fg(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function a(h){return He(h)?hs(e,l)(h):u(h)}function o(h){return r(h)}function l(h){return h===34||h===39||h===40?zg(e,c,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):u(h)}function c(h){return He(h)?hs(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 gC(e,t,r){const n=this;return i;function i(o){return Og.call(n,e,s,a,"reference","referenceMarker","referenceString")(o)}function s(o){return n.parser.defined.includes(dr(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(o):r(o)}function a(o){return r(o)}}function mC(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 xC={name:"labelStartImage",resolveAll:Ou.resolveAll,tokenize:yC};function yC(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 bC={name:"labelStartLink",resolveAll:Ou.resolveAll,tokenize:kC};function kC(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 Sl={name:"lineEnding",tokenize:wC};function wC(e,t){return r;function r(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),je(e,t,"linePrefix")}}const Aa={name:"thematicBreak",tokenize:vC};function vC(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||me(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 qt={continuation:{tokenize:TC},exit:AC,name:"list",tokenize:_C},CC={partial:!0,tokenize:MC},SC={partial:!0,tokenize:EC};function _C(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(f){const g=n.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!n.containerState.marker||f===n.containerState.marker:mc(f)){if(n.containerState.type||(n.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Aa,r,c)(f):c(f);if(!n.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return r(f)}function l(f){return mc(f)&&++a<10?(e.consume(f),l):(!n.interrupt||a<2)&&(n.containerState.marker?f===n.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):r(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||f,e.check(Fs,n.interrupt?r:u,e.attempt(CC,d,h))}function u(f){return n.containerState.initialBlankLine=!0,s++,d(f)}function h(f){return Me(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),d):r(f)}function d(f){return n.containerState.size=s+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function TC(e,t,r){const n=this;return n.containerState._closeFlow=void 0,e.check(Fs,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(SC,t,a)(o))}function a(o){return n.containerState._closeFlow=!0,n.interrupt=void 0,je(e,e.attempt(qt,t,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function EC(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 AC(e){e.exit(this.containerState.type)}function MC(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 jd={name:"setextUnderline",resolveTo:NC,tokenize:LC};function NC(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 LC(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||me(c)?(e.exit("setextHeadingLine"),t(c)):r(c)}}const IC={tokenize:$C};function $C(e){const t=this,r=e.attempt(Fs,n,e.attempt(this.parser.constructs.flowInitial,i,je(e,e.attempt(this.parser.constructs.flow,i,e.attempt(R2,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 jC={resolveAll:Hg()},BC=Wg("string"),DC=Wg("text");function Wg(e){return{resolveAll:Hg(e==="text"?PC: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 d=-1;if(h)for(;++d<h.length;){const f=h[d];if(!f.previous||f.previous.call(n,n.previous))return!0}return!1}}}function Hg(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 PC(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 RC={42:qt,43:qt,45:qt,48:qt,49:qt,50:qt,51:qt,52:qt,53:qt,54:qt,55:qt,56:qt,57:qt,62:Bg},FC={91:H2},OC={[-2]:Cl,[-1]:Cl,32:Cl},zC={35:X2,42:Aa,45:[jd,Aa],60:J2,61:jd,95:Aa,96:Id,126:Id},WC={38:Pg,92:Dg},HC={[-5]:Sl,[-4]:Sl,[-3]:Sl,33:xC,38:Pg,42:xc,60:[b2,aC],91:bC,92:[G2,Dg],93:Ou,95:xc,96:I2},qC={null:[xc,jC]},UC={null:[42,95]},VC={null:[]},GC=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:UC,contentInitial:FC,disable:VC,document:RC,flow:zC,flowInitial:OC,insideSpan:qC,string:WC,text:HC},Symbol.toStringTag,{value:"Module"}));function YC(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(C),check:T(w),consume:k,enter:v,exit:S,interrupt:T(w,{interrupt:!0})},c={code:null,containerState:{},defineSkip:m,events:[],now:g,parser:e,previous:null,sliceSerialize:d,sliceStream:f,write:h};let u=t.tokenize.call(c,l);return t.resolveAll&&s.push(t),c;function h(N){return a=nr(a,N),b(),a[a.length-1]!==null?[]:(I(t,0),c.events=Do(s,c.events,c),c.events)}function d(N,D){return KC(f(N),D)}function f(N){return XC(a,N)}function g(){const{_bufferIndex:N,_index:D,line:P,column:$,offset:F}=n;return{_bufferIndex:N,_index:D,line:P,column:$,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){me(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 P=D||{};return P.type=N,P.start=g(),c.events.push(["enter",P,c]),o.push(P),P}function S(N){const D=o.pop();return D.end=g(),c.events.push(["exit",D,c]),D}function C(N,D){I(N,D.from)}function w(N,D){D.restore()}function T(N,D){return P;function P($,F,L){let R,W,X,_;return Array.isArray($)?te($):"tokenize"in $?te([$]):j($);function j(U){return q;function q(G){const Q=G!==null&&U[G],re=G!==null&&U.null,ge=[...Array.isArray(Q)?Q:Q?[Q]:[],...Array.isArray(re)?re:re?[re]:[]];return te(ge)(G)}}function te(U){return R=U,W=0,U.length===0?L:A(U[W])}function A(U){return q;function q(G){return _=M(),X=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,B,Y)(G)}}function B(U){return N(X,_),F}function Y(U){return _.restore(),++W<R.length?A(R[W]):L}}}function I(N,D){N.resolveAll&&!s.includes(N)&&s.push(N),N.resolve&&Qt(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,P=c.currentConstruct,$=c.events.length,F=Array.from(o);return{from:$,restore:L};function L(){n=N,c.previous=D,c.currentConstruct=P,c.events.length=$,o=F,E()}}function E(){n.line in i&&n.column<2&&(n.column=i[n.line],n.offset+=i[n.line]-1)}}function XC(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 KC(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=`
|
|
108
|
-
`;break}case-3:{a=`\r
|
|
109
|
-
`;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 QC(e){const n={constructs:$g([GC,...(e||{}).extensions||[]]),content:i(d2),defined:[],document:i(p2),flow:i(IC),lazy:{},string:i(BC),text:i(DC)};return n;function i(s){return a;function a(o){return YC(n,s,o)}}}function ZC(e){for(;!Rg(e););return e}const Bd=/[\0\t\n\r]/g;function JC(){let e=1,t="",r=!0,n;return i;function i(s,a,o){const l=[];let c,u,h,d,f;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(Bd.lastIndex=h,c=Bd.exec(s),d=c&&c.index!==void 0?c.index:s.length,f=s.charCodeAt(d),!c){t=s.slice(h);break}if(f===10&&h===d&&n)l.push(-3),n=void 0;else switch(n&&(l.push(-5),n=void 0),h<d&&(l.push(s.slice(h,d)),e+=d-h),f){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=d+1}return o&&(n&&l.push(-5),t&&l.push(t),l.push(null)),l}}const eS=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function tS(e){return e.replace(eS,rS)}function rS(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const i=r.charCodeAt(1),s=i===120||i===88;return jg(r.slice(s?2:1),s?16:10)}return Fu(r)||e}const qg={}.hasOwnProperty;function nS(e,t,r){return typeof t!="string"&&(r=t,t=void 0),iS(r)(ZC(QC(r).document().write(JC()(e,t,!0))))}function iS(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(vt),autolinkProtocol:M,autolinkEmail:M,atxHeading:s(ze),blockQuote:s(re),characterEscape:M,characterReference:M,codeFenced:s(ge),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(ge,a),codeText:s(Se,a),codeTextData:M,data:M,codeFlowValue:M,definition:s(Ce),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(Le),hardBreakEscape:s(Je),hardBreakTrailing:s(Je),htmlFlow:s(ct,a),htmlFlowData:M,htmlText:s(ct,a),htmlTextData:M,image:s($t),label:a,link:s(vt),listItem:s(ut),listItemValue:d,listOrdered:s(Ee,h),listUnordered:s(Ee),paragraph:s(gt),reference:A,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(ze),strong:s(We),thematicBreak:s(yt)},exit:{atxHeading:l(),atxHeadingSequence:C,autolink:l(),autolinkEmail:Q,autolinkProtocol:G,blockQuote:l(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:Y,characterReferenceMarkerNumeric:Y,characterReferenceValue:U,characterReference:q,codeFenced:l(b),codeFencedFence:m,codeFencedFenceInfo:f,codeFencedFenceMeta:g,codeFlowValue:E,codeIndented:l(y),codeText:l(F),codeTextData:E,data:E,definition:l(),definitionDestinationString:S,definitionLabelString:k,definitionTitleString:v,emphasis:l(),hardBreakEscape:l(D),hardBreakTrailing:l(D),htmlFlow:l(P),htmlFlowData:E,htmlText:l($),htmlTextData:E,image:l(R),label:X,labelText:W,lineEnding:N,link:l(L),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:B,resourceDestinationString:_,resourceTitleString:j,resource:te,setextHeading:l(I),setextHeadingLineSequence:T,setextHeadingText:w,strong:l(),thematicBreak:l()}};Ug(t,(e||{}).mdastExtensions||[]);const r={};return n;function n(V){let J={type:"root",children:[]};const xe={stack:[J],tokenStack:[],config:t,enter:o,exit:c,buffer:a,resume:u,data:r},_e=[];let Ie=-1;for(;++Ie<V.length;)if(V[Ie][1].type==="listOrdered"||V[Ie][1].type==="listUnordered")if(V[Ie][0]==="enter")_e.push(Ie);else{const st=_e.pop();Ie=i(V,st,Ie)}for(Ie=-1;++Ie<V.length;){const st=t[V[Ie][0]];qg.call(st,V[Ie][1].type)&&st[V[Ie][1].type].call(Object.assign({sliceSerialize:V[Ie][2].sliceSerialize},xe),V[Ie][1])}if(xe.tokenStack.length>0){const st=xe.tokenStack[xe.tokenStack.length-1];(st[1]||Dd).call(xe,void 0,st[0])}for(J.position={start:Yr(V.length>0?V[0][1].start:{line:1,column:1,offset:0}),end:Yr(V.length>0?V[V.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(V,J,xe){let _e=J-1,Ie=-1,st=!1,Be,qe,mt,bt;for(;++_e<=xe;){const Ze=V[_e];switch(Ze[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ze[0]==="enter"?Ie++:Ie--,bt=void 0;break}case"lineEndingBlank":{Ze[0]==="enter"&&(Be&&!bt&&!Ie&&!mt&&(mt=_e),bt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:bt=void 0}if(!Ie&&Ze[0]==="enter"&&Ze[1].type==="listItemPrefix"||Ie===-1&&Ze[0]==="exit"&&(Ze[1].type==="listUnordered"||Ze[1].type==="listOrdered")){if(Be){let Jt=_e;for(qe=void 0;Jt--;){const jt=V[Jt];if(jt[1].type==="lineEnding"||jt[1].type==="lineEndingBlank"){if(jt[0]==="exit")continue;qe&&(V[qe][1].type="lineEndingBlank",st=!0),jt[1].type="lineEnding",qe=Jt}else if(!(jt[1].type==="linePrefix"||jt[1].type==="blockQuotePrefix"||jt[1].type==="blockQuotePrefixWhitespace"||jt[1].type==="blockQuoteMarker"||jt[1].type==="listItemIndent"))break}mt&&(!qe||mt<qe)&&(Be._spread=!0),Be.end=Object.assign({},qe?V[qe][1].start:Ze[1].end),V.splice(qe||_e,0,["exit",Be,Ze[2]]),_e++,xe++}if(Ze[1].type==="listItemPrefix"){const Jt={type:"listItem",_spread:!1,start:Object.assign({},Ze[1].start),end:void 0};Be=Jt,V.splice(_e,0,["enter",Jt,Ze[2]]),_e++,xe++,mt=void 0,bt=!0}}}return V[J][1]._spread=st,xe}function s(V,J){return xe;function xe(_e){o.call(this,V(_e),_e),J&&J.call(this,_e)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(V,J,xe){this.stack[this.stack.length-1].children.push(V),this.stack.push(V),this.tokenStack.push([J,xe||void 0]),V.position={start:Yr(J.start),end:void 0}}function l(V){return J;function J(xe){V&&V.call(this,xe),c.call(this,xe)}}function c(V,J){const xe=this.stack.pop(),_e=this.tokenStack.pop();if(_e)_e[0].type!==V.type&&(J?J.call(this,V,_e[0]):(_e[1]||Dd).call(this,V,_e[0]));else throw new Error("Cannot close `"+V.type+"` ("+us({start:V.start,end:V.end})+"): it’s not open");xe.position.end=Yr(V.end)}function u(){return Ru(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function d(V){if(this.data.expectingFirstListItemValue){const J=this.stack[this.stack.length-2];J.start=Number.parseInt(this.sliceSerialize(V),10),this.data.expectingFirstListItemValue=void 0}}function f(){const V=this.resume(),J=this.stack[this.stack.length-1];J.lang=V}function g(){const V=this.resume(),J=this.stack[this.stack.length-1];J.meta=V}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const V=this.resume(),J=this.stack[this.stack.length-1];J.value=V.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const V=this.resume(),J=this.stack[this.stack.length-1];J.value=V.replace(/(\r?\n|\r)$/g,"")}function k(V){const J=this.resume(),xe=this.stack[this.stack.length-1];xe.label=J,xe.identifier=dr(this.sliceSerialize(V)).toLowerCase()}function v(){const V=this.resume(),J=this.stack[this.stack.length-1];J.title=V}function S(){const V=this.resume(),J=this.stack[this.stack.length-1];J.url=V}function C(V){const J=this.stack[this.stack.length-1];if(!J.depth){const xe=this.sliceSerialize(V).length;J.depth=xe}}function w(){this.data.setextHeadingSlurpLineEnding=!0}function T(V){const J=this.stack[this.stack.length-1];J.depth=this.sliceSerialize(V).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function M(V){const xe=this.stack[this.stack.length-1].children;let _e=xe[xe.length-1];(!_e||_e.type!=="text")&&(_e=Ct(),_e.position={start:Yr(V.start),end:void 0},xe.push(_e)),this.stack.push(_e)}function E(V){const J=this.stack.pop();J.value+=this.sliceSerialize(V),J.position.end=Yr(V.end)}function N(V){const J=this.stack[this.stack.length-1];if(this.data.atHardBreak){const xe=J.children[J.children.length-1];xe.position.end=Yr(V.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(J.type)&&(M.call(this,V),E.call(this,V))}function D(){this.data.atHardBreak=!0}function P(){const V=this.resume(),J=this.stack[this.stack.length-1];J.value=V}function $(){const V=this.resume(),J=this.stack[this.stack.length-1];J.value=V}function F(){const V=this.resume(),J=this.stack[this.stack.length-1];J.value=V}function L(){const V=this.stack[this.stack.length-1];if(this.data.inReference){const J=this.data.referenceType||"shortcut";V.type+="Reference",V.referenceType=J,delete V.url,delete V.title}else delete V.identifier,delete V.label;this.data.referenceType=void 0}function R(){const V=this.stack[this.stack.length-1];if(this.data.inReference){const J=this.data.referenceType||"shortcut";V.type+="Reference",V.referenceType=J,delete V.url,delete V.title}else delete V.identifier,delete V.label;this.data.referenceType=void 0}function W(V){const J=this.sliceSerialize(V),xe=this.stack[this.stack.length-2];xe.label=tS(J),xe.identifier=dr(J).toLowerCase()}function X(){const V=this.stack[this.stack.length-1],J=this.resume(),xe=this.stack[this.stack.length-1];if(this.data.inReference=!0,xe.type==="link"){const _e=V.children;xe.children=_e}else xe.alt=J}function _(){const V=this.resume(),J=this.stack[this.stack.length-1];J.url=V}function j(){const V=this.resume(),J=this.stack[this.stack.length-1];J.title=V}function te(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function B(V){const J=this.resume(),xe=this.stack[this.stack.length-1];xe.label=J,xe.identifier=dr(this.sliceSerialize(V)).toLowerCase(),this.data.referenceType="full"}function Y(V){this.data.characterReferenceType=V.type}function U(V){const J=this.sliceSerialize(V),xe=this.data.characterReferenceType;let _e;xe?(_e=jg(J,xe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):_e=Fu(J);const Ie=this.stack[this.stack.length-1];Ie.value+=_e}function q(V){const J=this.stack.pop();J.position.end=Yr(V.end)}function G(V){E.call(this,V);const J=this.stack[this.stack.length-1];J.url=this.sliceSerialize(V)}function Q(V){E.call(this,V);const J=this.stack[this.stack.length-1];J.url="mailto:"+this.sliceSerialize(V)}function re(){return{type:"blockquote",children:[]}}function ge(){return{type:"code",lang:null,meta:null,value:""}}function Se(){return{type:"inlineCode",value:""}}function Ce(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Le(){return{type:"emphasis",children:[]}}function ze(){return{type:"heading",depth:0,children:[]}}function Je(){return{type:"break"}}function ct(){return{type:"html",value:""}}function $t(){return{type:"image",title:null,url:"",alt:null}}function vt(){return{type:"link",title:null,url:"",children:[]}}function Ee(V){return{type:"list",ordered:V.type==="listOrdered",start:null,spread:V._spread,children:[]}}function ut(V){return{type:"listItem",spread:V._spread,checked:null,children:[]}}function gt(){return{type:"paragraph",children:[]}}function We(){return{type:"strong",children:[]}}function Ct(){return{type:"text",value:""}}function yt(){return{type:"thematicBreak"}}}function Yr(e){return{line:e.line,column:e.column,offset:e.offset}}function Ug(e,t){let r=-1;for(;++r<t.length;){const n=t[r];Array.isArray(n)?Ug(e,n):sS(e,n)}}function sS(e,t){let r;for(r in t)if(qg.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 Dd(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+us({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+us({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+us({start:t.start,end:t.end})+") is still open")}function aS(e){const t=this;t.parser=r;function r(n){return nS(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function oS(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 lS(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
|
|
110
|
-
`}]}function cS(e,t){const r=t.value?t.value+`
|
|
111
|
-
`:"",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 uS(e,t){const r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function hS(e,t){const r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function dS(e,t){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=String(t.identifier).toUpperCase(),i=_i(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 fS(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 pS(e,t){if(e.options.allowDangerousHtml){const r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function Vg(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 gS(e,t){const r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return Vg(e,t);const i={src:_i(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 mS(e,t){const r={src:_i(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 xS(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 yS(e,t){const r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return Vg(e,t);const i={href:_i(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 bS(e,t){const r={href:_i(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 kS(e,t,r){const n=e.all(t),i=r?wS(r):Gg(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:`
|
|
112
|
-
`}),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:`
|
|
113
|
-
`});const c={type:"element",tagName:"li",properties:s,children:a};return e.patch(t,c),e.applyData(t,c)}function wS(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=Gg(r[n])}return t}function Gg(e){const t=e.spread;return t??e.children.length>1}function vS(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 CS(e,t){const r={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function SS(e,t){const r={type:"root",children:e.wrap(e.all(t))};return e.patch(t,r),e.applyData(t,r)}function _S(e,t){const r={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function TS(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=ju(t.children[1]),l=Tg(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 ES(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],d={},f=a?a[l]:void 0;f&&(d.align=f);let g={type:"element",tagName:s,properties:d,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 AS(e,t){const r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}const Pd=9,Rd=32;function MS(e){const t=String(e),r=/\r?\n|\r/g;let n=r.exec(t),i=0;const s=[];for(;n;)s.push(Fd(t.slice(i,n.index),i>0,!0),n[0]),i=n.index+n[0].length,n=r.exec(t);return s.push(Fd(t.slice(i),i>0,!1)),s.join("")}function Fd(e,t,r){let n=0,i=e.length;if(t){let s=e.codePointAt(n);for(;s===Pd||s===Rd;)n++,s=e.codePointAt(n)}if(r){let s=e.codePointAt(i-1);for(;s===Pd||s===Rd;)i--,s=e.codePointAt(i-1)}return i>n?e.slice(n,i):""}function NS(e,t){const r={type:"text",value:MS(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function LS(e,t){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}const IS={blockquote:oS,break:lS,code:cS,delete:uS,emphasis:hS,footnoteReference:dS,heading:fS,html:pS,imageReference:gS,image:mS,inlineCode:xS,linkReference:yS,link:bS,listItem:kS,list:vS,paragraph:CS,root:SS,strong:_S,table:TS,tableCell:AS,tableRow:ES,text:NS,thematicBreak:LS,toml:oa,yaml:oa,definition:oa,footnoteDefinition:oa};function oa(){}const Yg=-1,Po=0,ds=1,Ga=2,zu=3,Wu=4,Hu=5,qu=6,Xg=7,Kg=8,Od=typeof self=="object"?self:globalThis,$S=(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 Po:case Yg:return r(a,i);case ds:{const o=r([],i);for(const l of a)o.push(n(l));return o}case Ga:{const o=r({},i);for(const[l,c]of a)o[n(l)]=n(c);return o}case zu:return r(new Date(a),i);case Wu:{const{source:o,flags:l}=a;return r(new RegExp(o,l),i)}case Hu:{const o=r(new Map,i);for(const[l,c]of a)o.set(n(l),n(c));return o}case qu:{const o=r(new Set,i);for(const l of a)o.add(n(l));return o}case Xg:{const{name:o,message:l}=a;return r(new Od[o](l),i)}case Kg: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 Od[s](a),i)};return n},zd=e=>$S(new Map,e)(0),Yn="",{toString:jS}={},{keys:BS}=Object,Oi=e=>{const t=typeof e;if(t!=="object"||!e)return[Po,t];const r=jS.call(e).slice(8,-1);switch(r){case"Array":return[ds,Yn];case"Object":return[Ga,Yn];case"Date":return[zu,Yn];case"RegExp":return[Wu,Yn];case"Map":return[Hu,Yn];case"Set":return[qu,Yn];case"DataView":return[ds,r]}return r.includes("Array")?[ds,r]:r.includes("Error")?[Xg,r]:[Ga,r]},la=([e,t])=>e===Po&&(t==="function"||t==="symbol"),DS=(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]=Oi(a);switch(o){case Po:{let u=a;switch(l){case"bigint":o=Kg,u=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([Yg],a)}return i([o,u],a)}case ds:{if(l){let d=a;return l==="DataView"?d=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(d=new Uint8Array(a)),i([l,[...d]],a)}const u=[],h=i([o,u],a);for(const d of a)u.push(s(d));return h}case Ga:{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 d of BS(a))(e||!la(Oi(a[d])))&&u.push([s(d),s(a[d])]);return h}case zu:return i([o,a.toISOString()],a);case Wu:{const{source:u,flags:h}=a;return i([o,{source:u,flags:h}],a)}case Hu:{const u=[],h=i([o,u],a);for(const[d,f]of a)(e||!(la(Oi(d))||la(Oi(f))))&&u.push([s(d),s(f)]);return h}case qu:{const u=[],h=i([o,u],a);for(const d of a)(e||!la(Oi(d)))&&u.push(s(d));return h}}const{message:c}=a;return i([o,{name:l,message:c}],a)};return s},Wd=(e,{json:t,lossy:r}={})=>{const n=[];return DS(!(t||r),!!t,new Map,n)(e),n},Ya=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?zd(Wd(e,t)):structuredClone(e):(e,t)=>zd(Wd(e,t));function PS(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 RS(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function FS(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||PS,n=e.options.footnoteBackLabel||RS,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(),d=_i(h.toLowerCase());let f=0;const g=[],m=e.footnoteCounts.get(h);for(;m!==void 0&&++f<=m;){g.length>0&&g.push({type:"text",value:" "});let k=typeof r=="string"?r:r(l,f);typeof k=="string"&&(k={type:"text",value:k}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+d+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof n=="string"?n:n(l,f),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-"+d},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:{...Ya(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
114
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
|
|
115
|
-
`}]}}const Ro=(function(e){if(e==null)return HS;if(typeof e=="function")return Fo(e);if(typeof e=="object")return Array.isArray(e)?OS(e):zS(e);if(typeof e=="string")return WS(e);throw new Error("Expected function, string, or object as test")});function OS(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=Ro(e[r]);return Fo(n);function n(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function zS(e){const t=e;return Fo(r);function r(n){const i=n;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function WS(e){return Fo(t);function t(r){return r&&r.type===e}}function Fo(e){return t;function t(r,n,i){return!!(qS(r)&&e.call(this,r,typeof n=="number"?n:void 0,i||void 0))}}function HS(){return!0}function qS(e){return e!==null&&typeof e=="object"&&"type"in e}const Qg=[],US=!0,yc=!1,VS="skip";function Zg(e,t,r,n){let i;typeof t=="function"&&typeof r!="function"?(n=r,r=t):i=t;const s=Ro(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 f=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(d,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return d;function d(){let f=Qg,g,m,b;if((!t||s(l,c,u[u.length-1]||void 0))&&(f=GS(r(l,u)),f[0]===yc))return f;if("children"in l&&l.children){const y=l;if(y.children&&f[0]!==VS)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]===yc)return g;m=typeof g[1]=="number"?g[1]:m+a}}return f}}}function GS(e){return Array.isArray(e)?e:typeof e=="number"?[US,e]:e==null?Qg:[e]}function Uu(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),Zg(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 bc={}.hasOwnProperty,YS={};function XS(e,t){const r=t||YS,n=new Map,i=new Map,s=new Map,a={...IS,...r.handlers},o={all:c,applyData:QS,definitionById:n,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:l,options:r,patch:KS,wrap:JS};return Uu(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const h=u.type==="definition"?n:i,d=String(u.identifier).toUpperCase();h.has(d)||h.set(d,u)}}),o;function l(u,h){const d=u.type,f=o.handlers[d];if(bc.call(o.handlers,d)&&f)return f(o,u,h);if(o.options.passThrough&&o.options.passThrough.includes(d)){if("children"in u){const{children:m,...b}=u,y=Ya(b);return y.children=o.all(u),y}return Ya(u)}return(o.options.unknownHandler||ZS)(o,u,h)}function c(u){const h=[];if("children"in u){const d=u.children;let f=-1;for(;++f<d.length;){const g=o.one(d[f],u);if(g){if(f&&d[f-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=Hd(g.value)),!Array.isArray(g)&&g.type==="element")){const m=g.children[0];m&&m.type==="text"&&(m.value=Hd(m.value))}Array.isArray(g)?h.push(...g):h.push(g)}}}return h}}function KS(e,t){e.position&&(t.position=Rv(e))}function QS(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,Ya(s)),"children"in r&&r.children&&i!==null&&i!==void 0&&(r.children=i)}return r}function ZS(e,t){const r=t.data||{},n="value"in t&&!(bc.call(r,"hProperties")||bc.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 JS(e,t){const r=[];let n=-1;for(t&&r.push({type:"text",value:`
|
|
116
|
-
`});++n<e.length;)n&&r.push({type:"text",value:`
|
|
117
|
-
`}),r.push(e[n]);return t&&e.length>0&&r.push({type:"text",value:`
|
|
118
|
-
`}),r}function Hd(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function qd(e,t){const r=XS(e,t),n=r.one(e,void 0),i=FS(r),s=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
|
|
119
|
-
`},i),s}function e_(e,t){return e&&"run"in e?async function(r,n){const i=qd(r,{file:n,...t});await e.run(i,n)}:function(r,n){return qd(r,{file:n,...e||t})}}function Ud(e){if(e)throw e}var _l,Vd;function t_(){if(Vd)return _l;Vd=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 d;for(d in c);return typeof d>"u"||e.call(c,d)},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 _l=function l(){var c,u,h,d,f,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),d=o(c,u),m!==d&&(k&&d&&(s(d)||(f=i(d)))?(f?(f=!1,g=h&&i(h)?h:[]):g=h&&s(h)?h:{},a(m,{name:u,newValue:l(k,g,d)})):typeof d<"u"&&a(m,{name:u,newValue:d}));return m},_l}var r_=t_();const Tl=Au(r_);function kc(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 n_(){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?i_(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 i_(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 kr={basename:s_,dirname:a_,extname:o_,join:l_,sep:"/"};function s_(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Os(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 a_(e){if(Os(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 o_(e){Os(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 l_(...e){let t=-1,r;for(;++t<e.length;)Os(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":c_(r)}function c_(e){Os(e);const t=e.codePointAt(0)===47;let r=u_(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function u_(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 Os(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const h_={cwd:d_};function d_(){return"/"}function wc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function f_(e){if(typeof e=="string")e=new URL(e);else if(!wc(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 p_(e)}function p_(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 El=["history","path","basename","stem","extname","dirname"];class Jg{constructor(t){let r;t?wc(t)?r={path:t}:typeof t=="string"||g_(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":h_.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<El.length;){const s=El[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)El.includes(i)||(this[i]=r[i])}get basename(){return typeof this.path=="string"?kr.basename(this.path):void 0}set basename(t){Ml(t,"basename"),Al(t,"basename"),this.path=kr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?kr.dirname(this.path):void 0}set dirname(t){Gd(this.basename,"dirname"),this.path=kr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?kr.extname(this.path):void 0}set extname(t){if(Al(t,"extname"),Gd(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=kr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){wc(t)&&(t=f_(t)),Ml(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?kr.basename(this.path,this.extname):void 0}set stem(t){Ml(t,"stem"),Al(t,"stem"),this.path=kr.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 Lt(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 Al(e,t){if(e&&e.includes(kr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+kr.sep+"`")}function Ml(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Gd(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function g_(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const m_=(function(e){const n=this.constructor.prototype,i=n[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,n),s}),x_={}.hasOwnProperty;class Vu extends m_{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=n_()}copy(){const t=new Vu;let r=-1;for(;++r<this.attachers.length;){const n=this.attachers[r];t.use(...n)}return t.data(Tl(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(Il("data",this.frozen),this.namespace[t]=r,this):x_.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Il("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=ca(t),n=this.parser||this.Parser;return Nl("parse",n),n(String(r),r)}process(t,r){const n=this;return this.freeze(),Nl("process",this.parser||this.Parser),Ll("process",this.compiler||this.Compiler),r?i(void 0,r):new Promise(i);function i(s,a){const o=ca(t),l=n.parse(o);n.run(l,o,function(u,h,d){if(u||!h||!d)return c(u);const f=h,g=n.stringify(f,d);k_(g)?d.value=g:d.result=g,c(u,d)});function c(u,h){u||!h?a(u):s?s(h):r(void 0,h)}}}processSync(t){let r=!1,n;return this.freeze(),Nl("processSync",this.parser||this.Parser),Ll("processSync",this.compiler||this.Compiler),this.process(t,i),Xd("processSync","process",r),n;function i(s,a){r=!0,Ud(s),n=a}}run(t,r,n){Yd(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=ca(r);i.run(t,l,c);function c(u,h,d){const f=h||t;u?o(u):a?a(f):n(void 0,f,d)}}}runSync(t,r){let n=!1,i;return this.run(t,r,s),Xd("runSync","run",n),i;function s(a,o){Ud(a),i=o,n=!0}}stringify(t,r){this.freeze();const n=ca(r),i=this.compiler||this.Compiler;return Ll("stringify",i),Yd(t),i(t,n)}use(t,...r){const n=this.attachers,i=this.namespace;if(Il("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=Tl(!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,d=-1;for(;++h<n.length;)if(n[h][0]===c){d=h;break}if(d===-1)n.push([c,...u]);else if(u.length>0){let[f,...g]=u;const m=n[d][1];kc(m)&&kc(f)&&(f=Tl(!0,m,f)),n[d]=[c,f,...g]}}}}const y_=new Vu().freeze();function Nl(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ll(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Il(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 Yd(e){if(!kc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Xd(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ca(e){return b_(e)?e:new Jg(e)}function b_(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function k_(e){return typeof e=="string"||w_(e)}function w_(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const v_="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Kd=[],Qd={allowDangerousHtml:!0},C_=/^(https?|ircs?|mailto|xmpp)$/i,S_=[{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 __(e){const t=T_(e),r=E_(e);return A_(t.runSync(t.parse(r),r),e)}function T_(e){const t=e.rehypePlugins||Kd,r=e.remarkPlugins||Kd,n=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Qd}:Qd;return y_().use(aS).use(r).use(e_,n).use(t)}function E_(e){const t=e.children||"",r=new Jg;return typeof t=="string"&&(r.value=t),r}function A_(e,t){const r=t.allowedElements,n=t.allowElement,i=t.components,s=t.disallowedElements,a=t.skipHtml,o=t.unwrapDisallowed,l=t.urlTransform||M_;for(const u of S_)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+v_+u.id,void 0);return Uu(e,c),Hv(e,{Fragment:p.Fragment,components:i,ignoreInvalidStyle:!0,jsx:p.jsx,jsxs:p.jsxs,passKeys:!0,passNode:!0});function c(u,h,d){if(u.type==="raw"&&d&&typeof h=="number")return a?d.children.splice(h,1):d.children[h]={type:"text",value:u.value},h;if(u.type==="element"){let f;for(f in vl)if(Object.hasOwn(vl,f)&&Object.hasOwn(u.properties,f)){const g=u.properties[f],m=vl[f];(m===null||m.includes(u.tagName))&&(u.properties[f]=l(String(g||""),f,u))}}if(u.type==="element"){let f=r?!r.includes(u.tagName):s?s.includes(u.tagName):!1;if(!f&&n&&typeof h=="number"&&(f=!n(u,h,d)),f&&d&&typeof h=="number")return o&&u.children?d.children.splice(h,1,...u.children):d.children.splice(h,1),h}}}function M_(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||C_.test(e.slice(0,t))?e:""}function Zd(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 N_(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function L_(e,t,r){const i=Ro((r||{}).ignore||[]),s=I_(t);let a=-1;for(;++a<s.length;)Zg(e,"text",o);function o(c,u){let h=-1,d;for(;++h<u.length;){const f=u[h],g=d?d.children:void 0;if(i(f,g?g.indexOf(f):void 0,d))return;d=f}if(d)return l(c,u)}function l(c,u){const h=u[u.length-1],d=s[a][0],f=s[a][1];let g=0;const b=h.children.indexOf(c);let y=!1,k=[];d.lastIndex=0;let v=d.exec(c.value);for(;v;){const S=v.index,C={index:v.index,input:v.input,stack:[...u,c]};let w=f(...v,C);if(typeof w=="string"&&(w=w.length>0?{type:"text",value:w}:void 0),w===!1?d.lastIndex=S+1:(g!==S&&k.push({type:"text",value:c.value.slice(g,S)}),Array.isArray(w)?k.push(...w):w&&k.push(w),g=S+v[0].length,y=!0),!d.global)break;v=d.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 I_(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([$_(i[0]),j_(i[1])])}return t}function $_(e){return typeof e=="string"?new RegExp(N_(e),"g"):e}function j_(e){return typeof e=="function"?e:function(){return e}}const $l="phrasing",jl=["autolink","link","image","label"];function B_(){return{transforms:[W_],enter:{literalAutolink:P_,literalAutolinkEmail:Bl,literalAutolinkHttp:Bl,literalAutolinkWww:Bl},exit:{literalAutolink:z_,literalAutolinkEmail:O_,literalAutolinkHttp:R_,literalAutolinkWww:F_}}}function D_(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:$l,notInConstruct:jl},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:$l,notInConstruct:jl},{character:":",before:"[ps]",after:"\\/",inConstruct:$l,notInConstruct:jl}]}}function P_(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Bl(e){this.config.enter.autolinkProtocol.call(this,e)}function R_(e){this.config.exit.autolinkProtocol.call(this,e)}function F_(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 O_(e){this.config.exit.autolinkEmail.call(this,e)}function z_(e){this.exit(e)}function W_(e){L_(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,H_],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),q_]],{ignore:["link","linkReference"]})}function H_(e,t,r,n,i){let s="";if(!em(i)||(/^w/i.test(t)&&(r=t+r,t="",s="http://"),!U_(r)))return!1;const a=V_(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 q_(e,t,r,n){return!em(n,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+r,children:[{type:"text",value:t+"@"+r}]}}function U_(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 V_(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=Zd(e,"(");let s=Zd(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 em(e,t){const r=e.input.charCodeAt(e.index-1);return(e.index===0||An(r)||Bo(r))&&(!t||r!==47)}tm.peek=tT;function G_(){this.buffer()}function Y_(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function X_(){this.buffer()}function K_(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Q_(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=dr(this.sliceSerialize(e)).toLowerCase(),r.label=t}function Z_(e){this.exit(e)}function J_(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=dr(this.sliceSerialize(e)).toLowerCase(),r.label=t}function eT(e){this.exit(e)}function tT(){return"["}function tm(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 rT(){return{enter:{gfmFootnoteCallString:G_,gfmFootnoteCall:Y_,gfmFootnoteDefinitionLabelString:X_,gfmFootnoteDefinition:K_},exit:{gfmFootnoteCallString:Q_,gfmFootnoteCall:Z_,gfmFootnoteDefinitionLabelString:J_,gfmFootnoteDefinition:eT}}}function nT(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:r,footnoteReference:tm},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?`
|
|
120
|
-
`:" ")+s.indentLines(s.containerFlow(n,o.current()),t?rm:iT))),c(),l}}function iT(e,t,r){return t===0?e:rm(e,t,r)}function rm(e,t,r){return(r?"":" ")+e}const sT=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];nm.peek=uT;function aT(){return{canContainEols:["delete"],enter:{strikethrough:lT},exit:{strikethrough:cT}}}function oT(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:sT}],handlers:{delete:nm}}}function lT(e){this.enter({type:"delete",children:[]},e)}function cT(e){this.exit(e)}function nm(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 uT(){return"~"}function hT(e){return e.length}function dT(e,t){const r=t||{},n=(r.align||[]).concat(),i=r.stringLength||hT,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=fT(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]=Jd(n[h]);else{const m=Jd(n);for(;++h<c;)s[h]=m}h=-1;const d=[],f=[];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),f[h]=k),d[h]=v}a.splice(1,0,d),o.splice(1,0,f),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="",S="";if(r.alignDelimiters!==!1){const C=l[h]-(b[h]||0),w=s[h];w===114?v=" ".repeat(C):w===99?C%2?(v=" ".repeat(C/2+.5),S=" ".repeat(C/2-.5)):(v=" ".repeat(C/2),S=v):S=" ".repeat(C)}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(S),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(`
|
|
121
|
-
`)}function fT(e){return e==null?"":String(e)}function Jd(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 pT(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()),gT);return i(),a}function gT(e,t,r){return">"+(r?"":" ")+e}function mT(e,t){return ef(e,t.inConstruct,!0)&&!ef(e,t.notInConstruct,!1)}function ef(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 tf(e,t,r,n){let i=-1;for(;++i<r.unsafe.length;)if(r.unsafe[i].character===`
|
|
122
|
-
`&&mT(r.stack,r.unsafe[i]))return/[ \t]/.test(n.before)?"":" ";return`\\
|
|
123
|
-
`}function xT(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 yT(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 bT(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 kT(e,t,r,n){const i=bT(r),s=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(yT(e,r)){const h=r.enter("codeIndented"),d=r.indentLines(s,wT);return h(),d}const o=r.createTracker(n),l=i.repeat(Math.max(xT(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:`
|
|
124
|
-
`,encode:["`"],...o.current()})),h()}return u+=o.move(`
|
|
125
|
-
`),s&&(u+=o.move(s+`
|
|
126
|
-
`)),u+=o.move(l),c(),u}function wT(e,t,r){return(r?"":" ")+e}function Gu(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 vT(e,t,r,n){const i=Gu(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?" ":`
|
|
127
|
-
`,...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 CT(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 vs(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Xa(e,t,r){const n=pi(e),i=pi(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}}im.peek=ST;function im(e,t,r,n){const i=CT(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=Xa(n.before.charCodeAt(n.before.length-1),c,i);u.inside&&(l=vs(c)+l.slice(1));const h=l.charCodeAt(l.length-1),d=Xa(n.after.charCodeAt(0),h,i);d.inside&&(l=l.slice(0,-1)+vs(h));const f=a.move(i);return s(),r.attentionEncodeSurroundingInfo={after:d.outside,before:u.outside},o+l+f}function ST(e,t,r){return r.options.emphasis||"*"}function _T(e,t){let r=!1;return Uu(e,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return r=!0,yc}),!!((!e.depth||e.depth<3)&&Ru(e)&&(t.options.setext||r))}function TT(e,t,r,n){const i=Math.max(Math.min(6,e.depth||1),1),s=r.createTracker(n);if(_T(e,r)){const u=r.enter("headingSetext"),h=r.enter("phrasing"),d=r.containerPhrasing(e,{...s.current(),before:`
|
|
128
|
-
`,after:`
|
|
129
|
-
`});return h(),u(),d+`
|
|
130
|
-
`+(i===1?"=":"-").repeat(d.length-(Math.max(d.lastIndexOf("\r"),d.lastIndexOf(`
|
|
131
|
-
`))+1))}const a="#".repeat(i),o=r.enter("headingAtx"),l=r.enter("phrasing");s.move(a+" ");let c=r.containerPhrasing(e,{before:"# ",after:`
|
|
132
|
-
`,...s.current()});return/^[\t ]/.test(c)&&(c=vs(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,r.options.closeAtx&&(c+=" "+a),l(),o(),c}sm.peek=ET;function sm(e){return e.value||""}function ET(){return"<"}am.peek=AT;function am(e,t,r,n){const i=Gu(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 AT(){return"!"}om.peek=MT;function om(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 MT(){return"!"}lm.peek=NT;function lm(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 NT(){return"`"}function cm(e,t){const r=Ru(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))}um.peek=LT;function um(e,t,r,n){const i=Gu(r),s=i==='"'?"Quote":"Apostrophe",a=r.createTracker(n);let o,l;if(cm(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 LT(e,t,r){return cm(e,r)?"<":"["}hm.peek=IT;function hm(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 IT(){return"["}function Yu(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 $T(e){const t=Yu(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 jT(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 dm(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 BT(e,t,r,n){const i=r.enter("list"),s=r.bulletCurrent;let a=e.ordered?jT(r):Yu(r);const o=e.ordered?a==="."?")":".":$T(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),dm(r)===a&&u){let h=-1;for(;++h<e.children.length;){const d=e.children[h];if(d&&d.type==="listItem"&&d.children&&d.children[0]&&d.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 DT(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 PT(e,t,r,n){const i=DT(r);let s=r.bulletCurrent||Yu(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,d,f){return d?(f?"":" ".repeat(a))+h:(f?s:s+" ".repeat(a-s.length))+h}}function RT(e,t,r,n){const i=r.enter("paragraph"),s=r.enter("phrasing"),a=r.containerPhrasing(e,n);return s(),i(),a}const FT=Ro(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function OT(e,t,r,n){return(e.children.some(function(a){return FT(a)})?r.containerPhrasing:r.containerFlow).call(r,e,n)}function zT(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}fm.peek=WT;function fm(e,t,r,n){const i=zT(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=Xa(n.before.charCodeAt(n.before.length-1),c,i);u.inside&&(l=vs(c)+l.slice(1));const h=l.charCodeAt(l.length-1),d=Xa(n.after.charCodeAt(0),h,i);d.inside&&(l=l.slice(0,-1)+vs(h));const f=a.move(i+i);return s(),r.attentionEncodeSurroundingInfo={after:d.outside,before:u.outside},o+l+f}function WT(e,t,r){return r.options.strong||"*"}function HT(e,t,r,n){return r.safe(e.value,n)}function qT(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 UT(e,t,r){const n=(dm(r)+(r.options.ruleSpaces?" ":"")).repeat(qT(r));return r.options.ruleSpaces?n.slice(0,-1):n}const pm={blockquote:pT,break:tf,code:kT,definition:vT,emphasis:im,hardBreak:tf,heading:TT,html:sm,image:am,imageReference:om,inlineCode:lm,link:um,linkReference:hm,list:BT,listItem:PT,paragraph:RT,root:OT,strong:fm,text:HT,thematicBreak:UT};function VT(){return{enter:{table:GT,tableData:rf,tableHeader:rf,tableRow:XT},exit:{codeText:KT,table:YT,tableData:Dl,tableHeader:Dl,tableRow:Dl}}}function GT(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 YT(e){this.exit(e),this.data.inTable=void 0}function XT(e){this.enter({type:"tableRow",children:[]},e)}function Dl(e){this.exit(e)}function rf(e){this.enter({type:"tableCell",children:[]},e)}function KT(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,QT));const r=this.stack[this.stack.length-1];r.type,r.value=t,this.exit(e)}function QT(e,t){return t==="|"?t:e}function ZT(e){const t=e||{},r=t.tableCellPadding,n=t.tablePipeAlign,i=t.stringLength,s=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
133
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:d,table:a,tableCell:l,tableRow:o}};function a(f,g,m,b){return c(u(f,m,b),f.align)}function o(f,g,m,b){const y=h(f,m,b),k=c([y]);return k.slice(0,k.indexOf(`
|
|
134
|
-
`))}function l(f,g,m,b){const y=m.enter("tableCell"),k=m.enter("phrasing"),v=m.containerPhrasing(f,{...b,before:s,after:s});return k(),y(),v}function c(f,g){return dT(f,{align:g,alignDelimiters:n,padding:r,stringLength:i})}function u(f,g,m){const b=f.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(f,g,m){const b=f.children;let y=-1;const k=[],v=g.enter("tableRow");for(;++y<b.length;)k[y]=l(b[y],f,g,m);return v(),k}function d(f,g,m){let b=pm.inlineCode(f,g,m);return m.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function JT(){return{exit:{taskListCheckValueChecked:nf,taskListCheckValueUnchecked:nf,paragraph:tE}}}function eE(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:rE}}}function nf(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function tE(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 rE(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=pm.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 nE(){return[B_(),rT(),aT(),VT(),JT()]}function iE(e){return{extensions:[D_(),nT(e),oT(),ZT(e),eE()]}}const sE={tokenize:hE,partial:!0},gm={tokenize:dE,partial:!0},mm={tokenize:fE,partial:!0},xm={tokenize:pE,partial:!0},aE={tokenize:gE,partial:!0},ym={name:"wwwAutolink",tokenize:cE,previous:km},bm={name:"protocolAutolink",tokenize:uE,previous:wm},Vr={name:"emailAutolink",tokenize:lE,previous:vm},Tr={};function oE(){return{text:Tr}}let gn=48;for(;gn<123;)Tr[gn]=Vr,gn++,gn===58?gn=65:gn===91&&(gn=97);Tr[43]=Vr;Tr[45]=Vr;Tr[46]=Vr;Tr[95]=Vr;Tr[72]=[Vr,bm];Tr[104]=[Vr,bm];Tr[87]=[Vr,ym];Tr[119]=[Vr,ym];function lE(e,t,r){const n=this;let i,s;return a;function a(h){return!vc(h)||!vm.call(n,n.previous)||Xu(n.events)?r(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(h))}function o(h){return vc(h)?(e.consume(h),o):h===64?(e.consume(h),l):r(h)}function l(h){return h===46?e.check(aE,u,c)(h):h===45||h===95||Et(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&&Dt(n.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):r(h)}}function cE(e,t,r){const n=this;return i;function i(a){return a!==87&&a!==119||!km.call(n,n.previous)||Xu(n.events)?r(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(sE,e.attempt(gm,e.attempt(mm,s),r),r)(a))}function s(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function uE(e,t,r){const n=this;let i="",s=!1;return a;function a(h){return(h===72||h===104)&&wm.call(n,n.previous)&&!Xu(n.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),o):r(h)}function o(h){if(Dt(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),o;if(h===58){const d=i.toLowerCase();if(d==="http"||d==="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||Va(h)||He(h)||An(h)||Bo(h)?r(h):e.attempt(gm,e.attempt(mm,u),r)(h)}function u(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function hE(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 dE(e,t,r){let n,i,s;return a;function a(c){return c===46||c===95?e.check(xm,l,o)(c):c===null||He(c)||An(c)||c!==45&&Bo(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 fE(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(xm,t,s)(a):a===null||He(a)||An(a)?t(a):(e.consume(a),i)}function s(a){return a===41&&n++,e.consume(a),i}}function pE(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)||An(o)?t(o):r(o)}function i(o){return o===null||o===40||o===91||He(o)||An(o)?t(o):n(o)}function s(o){return Dt(o)?a(o):r(o)}function a(o){return o===59?(e.consume(o),n):Dt(o)?(e.consume(o),a):r(o)}}function gE(e,t,r){return n;function n(s){return e.consume(s),i}function i(s){return Et(s)?r(s):t(s)}}function km(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||He(e)}function wm(e){return!Dt(e)}function vm(e){return!(e===47||vc(e))}function vc(e){return e===43||e===45||e===46||e===95||Et(e)}function Xu(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 mE={tokenize:SE,partial:!0};function xE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:wE,continuation:{tokenize:vE},exit:CE}},text:{91:{name:"gfmFootnoteCall",tokenize:kE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:yE,resolveTo:bE}}}}function yE(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=dr(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 bE(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 kE(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 d=e.exit("gfmFootnoteCallString");return i.includes(dr(n.sliceSerialize(d)))?(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 wE(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=dr(n.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}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 d(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(s)||i.push(s),je(e,f,"gfmFootnoteDefinitionWhitespace")):r(g)}function f(g){return t(g)}}function vE(e,t,r){return e.check(Fs,t,e.attempt(mE,t,r))}function CE(e){e.exit("gfmFootnoteDefinition")}function SE(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 _E(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)},d=[["enter",u,o],["enter",a[c][1],o],["exit",a[c][1],o],["enter",h,o]],f=o.parser.constructs.insideSpan.null;f&&Qt(d,d.length,0,Do(f,a.slice(c+1,l),o)),Qt(d,d.length,0,[["exit",h,o],["enter",a[l][1],o],["exit",a[l][1],o],["exit",u,o]]),Qt(a,c-1,l-c+3,d),l=c+d.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 d;function d(g){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(g):(a.enter("strikethroughSequenceTemporary"),f(g))}function f(g){const m=pi(c);if(g===126)return h>1?l(g):(a.consume(g),h++,f);if(h<2&&!r)return l(g);const b=a.exit("strikethroughSequenceTemporary"),y=pi(g);return b._open=!y||y===2&&!!m,b._close=!m||m===2&&!!y,o(g)}}}class TE{constructor(){this.map=[]}add(t,r,n){EE(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 EE(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 AE(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 ME(){return{flow:{null:{name:"table",tokenize:NE,resolveAll:LE}}}}function NE(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 $=n.events[N][1].type;if($==="lineEnding"||$==="linePrefix")N--;else break}const D=N>-1?n.events[N][1].type:null,P=D==="tableHead"||D==="tableRow"?w:l;return P===w&&n.parser.lazy[n.now().line]?r(E):P(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):me(E)?s>1?(s=0,n.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),f):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?d:h)}function d(E){return E===92||E===124?(e.consume(E),h):h(E)}function f(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):C(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||me(E)?S(E):C(E)}function y(E){return E===45?(e.enter("tableDelimiterFiller"),k(E)):C(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,S,"whitespace")(E):S(E)}function S(E){return E===124?g(E):E===null||me(E)?!a||i!==s?C(E):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(E)):C(E)}function C(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||me(E)?(e.exit("tableRow"),t(E)):Me(E)?je(e,T,"whitespace")(E):(e.enter("data"),I(E))}function I(E){return E===null||E===124||He(E)?(e.exit("data"),T(E)):(e.consume(E),E===92?M:I)}function M(E){return E===92||E===124?(e.consume(E),I):I(E)}}function LE(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 d=new TE;for(;++r<e.length;){const f=e[r],g=f[1];f[0]==="enter"?g.type==="tableHead"?(o=!1,l!==0&&(sf(d,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},d.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)},d.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=ua(d,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=ua(d,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=ua(d,t,s,i,r,h)):a[1]!==0&&(h=ua(d,t,a,i,r,h)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(a[3]=r)}for(l!==0&&sf(d,t,l,c,u),d.consume(t.events),r=-1;++r<t.events.length;){const f=t.events[r];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=AE(t.events,r))}return e}function ua(e,t,r,n,i,s){const a=n===1?"tableHeader":n===2?"tableDelimiter":"tableData",o="tableContent";r[0]!==0&&(s.end=Object.assign({},Qn(t.events,r[0])),e.add(r[0],0,[["exit",s,t]]));const l=Qn(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=Qn(t.events,r[2]),u=Qn(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 d=t.events[r[2]],f=t.events[r[3]];if(d[1].end=Object.assign({},f[1].end),d[1].type="chunkText",d[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({},Qn(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function sf(e,t,r,n,i){const s=[],a=Qn(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 Qn(e,t){const r=e[t],n=r[0]==="enter"?"start":"end";return r[1][n]}const IE={name:"tasklistCheck",tokenize:jE};function $E(){return{text:{91:IE}}}function jE(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 me(l)?t(l):Me(l)?e.check({tokenize:BE},t,r)(l):r(l)}}function BE(e,t,r){return je(e,n,"whitespace");function n(i){return i===null?r(i):t(i)}}function DE(e){return $g([oE(),xE(),_E(e),ME(),$E()])}const PE={};function RE(e){const t=this,r=e||PE,n=t.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),s=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),a=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(DE(r)),s.push(nE()),a.push(iE(r))}const Cm={'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"}},FE={'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 af={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"}},Ma={exports:{}},OE=Ma.exports,of;function zE(){return of||(of=1,(function(e,t){(function(r,n){e.exports=n()})(OE,(function(){var r=1e3,n=6e4,i=36e5,s="millisecond",a="second",o="minute",l="hour",c="day",u="week",h="month",d="quarter",f="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($){var F=["th","st","nd","rd"],L=$%100;return"["+$+(F[(L-20)%10]||F[L]||F[0])+"]"}},v=function($,F,L){var R=String($);return!R||R.length>=F?$:""+Array(F+1-R.length).join(L)+$},S={s:v,z:function($){var F=-$.utcOffset(),L=Math.abs(F),R=Math.floor(L/60),W=L%60;return(F<=0?"+":"-")+v(R,2,"0")+":"+v(W,2,"0")},m:function $(F,L){if(F.date()<L.date())return-$(L,F);var R=12*(L.year()-F.year())+(L.month()-F.month()),W=F.clone().add(R,h),X=L-W<0,_=F.clone().add(R+(X?-1:1),h);return+(-(R+(L-W)/(X?W-_:_-W))||0)},a:function($){return $<0?Math.ceil($)||0:Math.floor($)},p:function($){return{M:h,y:f,w:u,d:c,D:g,h:l,m:o,s:a,ms:s,Q:d}[$]||String($||"").toLowerCase().replace(/s$/,"")},u:function($){return $===void 0}},C="en",w={};w[C]=k;var T="$isDayjsObject",I=function($){return $ instanceof D||!(!$||!$[T])},M=function $(F,L,R){var W;if(!F)return C;if(typeof F=="string"){var X=F.toLowerCase();w[X]&&(W=X),L&&(w[X]=L,W=X);var _=F.split("-");if(!W&&_.length>1)return $(_[0])}else{var j=F.name;w[j]=F,W=j}return!R&&W&&(C=W),W||!R&&C},E=function($,F){if(I($))return $.clone();var L=typeof F=="object"?F:{};return L.date=$,L.args=arguments,new D(L)},N=S;N.l=M,N.i=I,N.w=function($,F){return E($,{locale:F.$L,utc:F.$u,x:F.$x,$offset:F.$offset})};var D=(function(){function $(L){this.$L=M(L.locale,null,!0),this.parse(L),this.$x=this.$x||L.x||{},this[T]=!0}var F=$.prototype;return F.parse=function(L){this.$d=(function(R){var W=R.date,X=R.utc;if(W===null)return new Date(NaN);if(N.u(W))return new Date;if(W instanceof Date)return new Date(W);if(typeof W=="string"&&!/Z$/i.test(W)){var _=W.match(b);if(_){var j=_[2]-1||0,te=(_[7]||"0").substring(0,3);return X?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(W)})(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,R){var W=E(L);return this.startOf(R)<=W&&W<=this.endOf(R)},F.isAfter=function(L,R){return E(L)<this.startOf(R)},F.isBefore=function(L,R){return this.endOf(R)<E(L)},F.$g=function(L,R,W){return N.u(L)?this[R]:this.set(W,L)},F.unix=function(){return Math.floor(this.valueOf()/1e3)},F.valueOf=function(){return this.$d.getTime()},F.startOf=function(L,R){var W=this,X=!!N.u(R)||R,_=N.p(L),j=function(Q,re){var ge=N.w(W.$u?Date.UTC(W.$y,re,Q):new Date(W.$y,re,Q),W);return X?ge:ge.endOf(c)},te=function(Q,re){return N.w(W.toDate()[Q].apply(W.toDate("s"),(X?[0,0,0,0]:[23,59,59,999]).slice(re)),W)},A=this.$W,B=this.$M,Y=this.$D,U="set"+(this.$u?"UTC":"");switch(_){case f:return X?j(1,0):j(31,11);case h:return X?j(1,B):j(0,B+1);case u:var q=this.$locale().weekStart||0,G=(A<q?A+7:A)-q;return j(X?Y-G:Y+(6-G),B);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,R){var W,X=N.p(L),_="set"+(this.$u?"UTC":""),j=(W={},W[c]=_+"Date",W[g]=_+"Date",W[h]=_+"Month",W[f]=_+"FullYear",W[l]=_+"Hours",W[o]=_+"Minutes",W[a]=_+"Seconds",W[s]=_+"Milliseconds",W)[X],te=X===c?this.$D+(R-this.$W):R;if(X===h||X===f){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,R){return this.clone().$set(L,R)},F.get=function(L){return this[N.p(L)]()},F.add=function(L,R){var W,X=this;L=Number(L);var _=N.p(R),j=function(B){var Y=E(X);return N.w(Y.date(Y.date()+Math.round(B*L)),X)};if(_===h)return this.set(h,this.$M+L);if(_===f)return this.set(f,this.$y+L);if(_===c)return j(1);if(_===u)return j(7);var te=(W={},W[o]=n,W[l]=i,W[a]=r,W)[_]||1,A=this.$d.getTime()+L*te;return N.w(A,this)},F.subtract=function(L,R){return this.add(-1*L,R)},F.format=function(L){var R=this,W=this.$locale();if(!this.isValid())return W.invalidDate||m;var X=L||"YYYY-MM-DDTHH:mm:ssZ",_=N.z(this),j=this.$H,te=this.$m,A=this.$M,B=W.weekdays,Y=W.months,U=W.meridiem,q=function(re,ge,Se,Ce){return re&&(re[ge]||re(R,X))||Se[ge].slice(0,Ce)},G=function(re){return N.s(j%12||12,re,"0")},Q=U||function(re,ge,Se){var Ce=re<12?"AM":"PM";return Se?Ce.toLowerCase():Ce};return X.replace(y,(function(re,ge){return ge||(function(Se){switch(Se){case"YY":return String(R.$y).slice(-2);case"YYYY":return N.s(R.$y,4,"0");case"M":return A+1;case"MM":return N.s(A+1,2,"0");case"MMM":return q(W.monthsShort,A,Y,3);case"MMMM":return q(Y,A);case"D":return R.$D;case"DD":return N.s(R.$D,2,"0");case"d":return String(R.$W);case"dd":return q(W.weekdaysMin,R.$W,B,2);case"ddd":return q(W.weekdaysShort,R.$W,B,3);case"dddd":return B[R.$W];case"H":return String(j);case"HH":return N.s(j,2,"0");case"h":return G(1);case"hh":return G(2);case"a":return Q(j,te,!0);case"A":return Q(j,te,!1);case"m":return String(te);case"mm":return N.s(te,2,"0");case"s":return String(R.$s);case"ss":return N.s(R.$s,2,"0");case"SSS":return N.s(R.$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,R,W){var X,_=this,j=N.p(R),te=E(L),A=(te.utcOffset()-this.utcOffset())*n,B=this-te,Y=function(){return N.m(_,te)};switch(j){case f:X=Y()/12;break;case h:X=Y();break;case d:X=Y()/3;break;case u:X=(B-A)/6048e5;break;case c:X=(B-A)/864e5;break;case l:X=B/i;break;case o:X=B/n;break;case a:X=B/r;break;default:X=B}return W?X:N.a(X)},F.daysInMonth=function(){return this.endOf(h).$D},F.$locale=function(){return w[this.$L]},F.locale=function(L,R){if(!L)return this.$L;var W=this.clone(),X=M(L,R,!0);return X&&(W.$L=X),W},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()},$})(),P=D.prototype;return E.prototype=P,[["$ms",s],["$s",a],["$m",o],["$H",l],["$W",c],["$M",h],["$y",f],["$D",g]].forEach((function($){P[$[1]]=function(F){return this.$g(F,$[0],$[1])}})),E.extend=function($,F){return $.$i||($(F,D,E),$.$i=!0),E},E.locale=M,E.isDayjs=I,E.unix=function($){return E(1e3*$)},E.en=w[C],E.Ls=w,E.p={},E}))})(Ma)),Ma.exports}var WE=zE();const HE=Au(WE);var Sm=Object.defineProperty,x=(e,t)=>Sm(e,"name",{value:t,configurable:!0}),qE=(e,t)=>{for(var r in t)Sm(e,r,{get:t[r],enumerable:!0})},Br={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},K={trace:x((...e)=>{},"trace"),debug:x((...e)=>{},"debug"),info:x((...e)=>{},"info"),warn:x((...e)=>{},"warn"),error:x((...e)=>{},"error"),fatal:x((...e)=>{},"fatal")},Ku=x(function(e="fatal"){let t=Br.fatal;typeof e=="string"?e.toLowerCase()in Br&&(t=Br[e]):typeof e=="number"&&(t=e),K.trace=()=>{},K.debug=()=>{},K.info=()=>{},K.warn=()=>{},K.error=()=>{},K.fatal=()=>{},t<=Br.fatal&&(K.fatal=console.error?console.error.bind(console,rr("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",rr("FATAL"))),t<=Br.error&&(K.error=console.error?console.error.bind(console,rr("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",rr("ERROR"))),t<=Br.warn&&(K.warn=console.warn?console.warn.bind(console,rr("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",rr("WARN"))),t<=Br.info&&(K.info=console.info?console.info.bind(console,rr("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",rr("INFO"))),t<=Br.debug&&(K.debug=console.debug?console.debug.bind(console,rr("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",rr("DEBUG"))),t<=Br.trace&&(K.trace=console.debug?console.debug.bind(console,rr("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",rr("TRACE")))},"setLogLevel"),rr=x(e=>`%c${HE().format("ss.SSS")} : ${e} : `,"format");const Na={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 Na.hue2rgb(s,i,e+1/3)*255;case"g":return Na.hue2rgb(s,i,e)*255;case"b":return Na.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}}},UE={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},VE={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},we={channel:Na,lang:UE,unit:VE},Xr={};for(let e=0;e<=255;e++)Xr[e]=we.unit.dec2hex(e);const _t={ALL:0,RGB:1,HSL:2};class GE{constructor(){this.type=_t.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=_t.ALL}is(t){return this.type===t}}class YE{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new GE}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=_t.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:n,l:i}=t;r===void 0&&(t.h=we.channel.rgb2hsl(t,"h")),n===void 0&&(t.s=we.channel.rgb2hsl(t,"s")),i===void 0&&(t.l=we.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:n,b:i}=t;r===void 0&&(t.r=we.channel.hsl2rgb(t,"r")),n===void 0&&(t.g=we.channel.hsl2rgb(t,"g")),i===void 0&&(t.b=we.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(_t.HSL)&&r!==void 0?r:(this._ensureHSL(),we.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(_t.HSL)&&r!==void 0?r:(this._ensureHSL(),we.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(_t.HSL)&&r!==void 0?r:(this._ensureHSL(),we.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(_t.RGB)&&r!==void 0?r:(this._ensureRGB(),we.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(_t.RGB)&&r!==void 0?r:(this._ensureRGB(),we.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(_t.RGB)&&r!==void 0?r:(this._ensureRGB(),we.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(_t.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(_t.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(_t.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(_t.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(_t.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(_t.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const Oo=new YE({r:0,g:0,b:0,a:0},"transparent"),ri={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(ri.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 Oo.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)]}`}},kn={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(kn.hueRe);if(t){const[,r,n]=t;switch(n){case"grad":return we.channel.clamp.h(parseFloat(r)*.9);case"rad":return we.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return we.channel.clamp.h(parseFloat(r)*360)}}return we.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(kn.re);if(!r)return;const[,n,i,s,a,o]=r;return Oo.set({h:kn._hue2deg(n),s:we.channel.clamp.s(parseFloat(i)),l:we.channel.clamp.l(parseFloat(s)),a:a?we.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(${we.lang.round(t)}, ${we.lang.round(r)}%, ${we.lang.round(n)}%, ${i})`:`hsl(${we.lang.round(t)}, ${we.lang.round(r)}%, ${we.lang.round(n)}%)`}},fs={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=fs.colors[e];if(t)return ri.parse(t)},stringify:e=>{const t=ri.stringify(e);for(const r in fs.colors)if(fs.colors[r]===t)return r}},es={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(es.re);if(!r)return;const[,n,i,s,a,o,l,c,u]=r;return Oo.set({r:we.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:we.channel.clamp.g(a?parseFloat(s)*2.55:parseFloat(s)),b:we.channel.clamp.b(l?parseFloat(o)*2.55:parseFloat(o)),a:c?we.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(${we.lang.round(t)}, ${we.lang.round(r)}, ${we.lang.round(n)}, ${we.lang.round(i)})`:`rgb(${we.lang.round(t)}, ${we.lang.round(r)}, ${we.lang.round(n)})`}},Sr={format:{keyword:fs,hex:ri,rgb:es,rgba:es,hsl:kn,hsla:kn},parse:e=>{if(typeof e!="string")return e;const t=ri.parse(e)||es.parse(e)||kn.parse(e)||fs.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(_t.HSL)||e.data.r===void 0?kn.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?es.stringify(e):ri.stringify(e)},_m=(e,t)=>{const r=Sr.parse(e);for(const n in t)r[n]=we.channel.clamp[n](t[n]);return Sr.stringify(r)},ps=(e,t,r=0,n=1)=>{if(typeof e!="number")return _m(e,{a:t});const i=Oo.set({r:we.channel.clamp.r(e),g:we.channel.clamp.g(t),b:we.channel.clamp.b(r),a:we.channel.clamp.a(n)});return Sr.stringify(i)},XE=e=>{const{r:t,g:r,b:n}=Sr.parse(e),i=.2126*we.channel.toLinear(t)+.7152*we.channel.toLinear(r)+.0722*we.channel.toLinear(n);return we.lang.round(i)},KE=e=>XE(e)>=.5,zs=e=>!KE(e),Tm=(e,t,r)=>{const n=Sr.parse(e),i=n[t],s=we.channel.clamp[t](i+r);return i!==s&&(n[t]=s),Sr.stringify(n)},se=(e,t)=>Tm(e,"l",t),fe=(e,t)=>Tm(e,"l",-t),H=(e,t)=>{const r=Sr.parse(e),n={};for(const i in t)t[i]&&(n[i]=r[i]+t[i]);return _m(e,n)},QE=(e,t,r=50)=>{const{r:n,g:i,b:s,a}=Sr.parse(e),{r:o,g:l,b:c,a:u}=Sr.parse(t),h=r/100,d=h*2-1,f=a-u,m=((d*f===-1?d:(d+f)/(1+d*f))+1)/2,b=1-m,y=n*m+o*b,k=i*m+l*b,v=s*m+c*b,S=a*h+u*(1-h);return ps(y,k,v,S)},ne=(e,t=100)=>{const r=Sr.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,QE(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:Em,setPrototypeOf:lf,isFrozen:ZE,getPrototypeOf:JE,getOwnPropertyDescriptor:eA}=Object;let{freeze:Ot,seal:ir,create:Cc}=Object,{apply:Sc,construct:_c}=typeof Reflect<"u"&&Reflect;Ot||(Ot=function(t){return t});ir||(ir=function(t){return t});Sc||(Sc=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)});_c||(_c=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 ha=zt(Array.prototype.forEach),tA=zt(Array.prototype.lastIndexOf),cf=zt(Array.prototype.pop),zi=zt(Array.prototype.push),rA=zt(Array.prototype.splice),La=zt(String.prototype.toLowerCase),Pl=zt(String.prototype.toString),Rl=zt(String.prototype.match),Wi=zt(String.prototype.replace),nA=zt(String.prototype.indexOf),iA=zt(String.prototype.trim),or=zt(Object.prototype.hasOwnProperty),Bt=zt(RegExp.prototype.test),Hi=sA(TypeError);function zt(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 Sc(e,t,n)}}function sA(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return _c(e,r)}}function Ae(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:La;lf&&lf(e,null);let n=t.length;for(;n--;){let i=t[n];if(typeof i=="string"){const s=r(i);s!==i&&(ZE(t)||(t[n]=s),i=s)}e[i]=!0}return e}function aA(e){for(let t=0;t<e.length;t++)or(e,t)||(e[t]=null);return e}function Rr(e){const t=Cc(null);for(const[r,n]of Em(e))or(e,r)&&(Array.isArray(n)?t[r]=aA(n):n&&typeof n=="object"&&n.constructor===Object?t[r]=Rr(n):t[r]=n);return t}function qi(e,t){for(;e!==null;){const n=eA(e,t);if(n){if(n.get)return zt(n.get);if(typeof n.value=="function")return zt(n.value)}e=JE(e)}function r(){return null}return r}const uf=Ot(["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"]),Fl=Ot(["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"]),Ol=Ot(["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"]),oA=Ot(["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"]),zl=Ot(["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"]),lA=Ot(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),hf=Ot(["#text"]),df=Ot(["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"]),Wl=Ot(["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"]),ff=Ot(["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"]),da=Ot(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),cA=ir(/\{\{[\w\W]*|[\w\W]*\}\}/gm),uA=ir(/<%[\w\W]*|[\w\W]*%>/gm),hA=ir(/\$\{[\w\W]*/gm),dA=ir(/^data-[\-\w.\u00B7-\uFFFF]+$/),fA=ir(/^aria-[\-\w]+$/),Am=ir(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),pA=ir(/^(?:\w+script|data):/i),gA=ir(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Mm=ir(/^html$/i),mA=ir(/^[a-z][.\w]*(-[.\w]+)+$/i);var pf=Object.freeze({__proto__:null,ARIA_ATTR:fA,ATTR_WHITESPACE:gA,CUSTOM_ELEMENT:mA,DATA_ATTR:dA,DOCTYPE_NAME:Mm,ERB_EXPR:uA,IS_ALLOWED_URI:Am,IS_SCRIPT_OR_DATA:pA,MUSTACHE_EXPR:cA,TMPLIT_EXPR:hA});const Ui={element:1,text:3,progressingInstruction:7,comment:8,document:9},xA=function(){return typeof window>"u"?null:window},yA=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}},gf=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Nm(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:xA();const t=he=>Nm(he);if(t.version="3.3.0",t.removed=[],!e||!e.document||e.document.nodeType!==Ui.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:d,trustedTypes:f}=e,g=l.prototype,m=qi(g,"cloneNode"),b=qi(g,"remove"),y=qi(g,"nextSibling"),k=qi(g,"childNodes"),v=qi(g,"parentNode");if(typeof a=="function"){const he=r.createElement("template");he.content&&he.content.ownerDocument&&(r=he.content.ownerDocument)}let S,C="";const{implementation:w,createNodeIterator:T,createDocumentFragment:I,getElementsByTagName:M}=r,{importNode:E}=n;let N=gf();t.isSupported=typeof Em=="function"&&typeof v=="function"&&w&&w.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:D,ERB_EXPR:P,TMPLIT_EXPR:$,DATA_ATTR:F,ARIA_ATTR:L,IS_SCRIPT_OR_DATA:R,ATTR_WHITESPACE:W,CUSTOM_ELEMENT:X}=pf;let{IS_ALLOWED_URI:_}=pf,j=null;const te=Ae({},[...uf,...Fl,...Ol,...zl,...hf]);let A=null;const B=Ae({},[...df,...Wl,...ff,...da]);let Y=Object.seal(Cc(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 G=Object.seal(Cc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Q=!0,re=!0,ge=!1,Se=!0,Ce=!1,Le=!0,ze=!1,Je=!1,ct=!1,$t=!1,vt=!1,Ee=!1,ut=!0,gt=!1;const We="user-content-";let Ct=!0,yt=!1,V={},J=null;const xe=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 _e=null;const Ie=Ae({},["audio","video","img","source","image","track"]);let st=null;const Be=Ae({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),qe="http://www.w3.org/1998/Math/MathML",mt="http://www.w3.org/2000/svg",bt="http://www.w3.org/1999/xhtml";let Ze=bt,Jt=!1,jt=null;const gl=Ae({},[qe,mt,bt],Pl);let Wn=Ae({},["mi","mo","mn","ms","mtext"]),Hn=Ae({},["annotation-xml"]);const Qs=Ae({},["title","style","font","a","script"]);let Nr=null;const Zs=["application/xhtml+xml","text/html"],ml="text/html";let et=null,Lr=null;const Js=r.createElement("form"),hn=function(z){return z instanceof RegExp||z instanceof Function},qn=function(){let z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Lr&&Lr===z)){if((!z||typeof z!="object")&&(z={}),z=Rr(z),Nr=Zs.indexOf(z.PARSER_MEDIA_TYPE)===-1?ml:z.PARSER_MEDIA_TYPE,et=Nr==="application/xhtml+xml"?Pl:La,j=or(z,"ALLOWED_TAGS")?Ae({},z.ALLOWED_TAGS,et):te,A=or(z,"ALLOWED_ATTR")?Ae({},z.ALLOWED_ATTR,et):B,jt=or(z,"ALLOWED_NAMESPACES")?Ae({},z.ALLOWED_NAMESPACES,Pl):gl,st=or(z,"ADD_URI_SAFE_ATTR")?Ae(Rr(Be),z.ADD_URI_SAFE_ATTR,et):Be,_e=or(z,"ADD_DATA_URI_TAGS")?Ae(Rr(Ie),z.ADD_DATA_URI_TAGS,et):Ie,J=or(z,"FORBID_CONTENTS")?Ae({},z.FORBID_CONTENTS,et):xe,U=or(z,"FORBID_TAGS")?Ae({},z.FORBID_TAGS,et):Rr({}),q=or(z,"FORBID_ATTR")?Ae({},z.FORBID_ATTR,et):Rr({}),V=or(z,"USE_PROFILES")?z.USE_PROFILES:!1,Q=z.ALLOW_ARIA_ATTR!==!1,re=z.ALLOW_DATA_ATTR!==!1,ge=z.ALLOW_UNKNOWN_PROTOCOLS||!1,Se=z.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ce=z.SAFE_FOR_TEMPLATES||!1,Le=z.SAFE_FOR_XML!==!1,ze=z.WHOLE_DOCUMENT||!1,$t=z.RETURN_DOM||!1,vt=z.RETURN_DOM_FRAGMENT||!1,Ee=z.RETURN_TRUSTED_TYPE||!1,ct=z.FORCE_BODY||!1,ut=z.SANITIZE_DOM!==!1,gt=z.SANITIZE_NAMED_PROPS||!1,Ct=z.KEEP_CONTENT!==!1,yt=z.IN_PLACE||!1,_=z.ALLOWED_URI_REGEXP||Am,Ze=z.NAMESPACE||bt,Wn=z.MATHML_TEXT_INTEGRATION_POINTS||Wn,Hn=z.HTML_INTEGRATION_POINTS||Hn,Y=z.CUSTOM_ELEMENT_HANDLING||{},z.CUSTOM_ELEMENT_HANDLING&&hn(z.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Y.tagNameCheck=z.CUSTOM_ELEMENT_HANDLING.tagNameCheck),z.CUSTOM_ELEMENT_HANDLING&&hn(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),Ce&&(re=!1),vt&&($t=!0),V&&(j=Ae({},hf),A=[],V.html===!0&&(Ae(j,uf),Ae(A,df)),V.svg===!0&&(Ae(j,Fl),Ae(A,Wl),Ae(A,da)),V.svgFilters===!0&&(Ae(j,Ol),Ae(A,Wl),Ae(A,da)),V.mathMl===!0&&(Ae(j,zl),Ae(A,ff),Ae(A,da))),z.ADD_TAGS&&(typeof z.ADD_TAGS=="function"?G.tagCheck=z.ADD_TAGS:(j===te&&(j=Rr(j)),Ae(j,z.ADD_TAGS,et))),z.ADD_ATTR&&(typeof z.ADD_ATTR=="function"?G.attributeCheck=z.ADD_ATTR:(A===B&&(A=Rr(A)),Ae(A,z.ADD_ATTR,et))),z.ADD_URI_SAFE_ATTR&&Ae(st,z.ADD_URI_SAFE_ATTR,et),z.FORBID_CONTENTS&&(J===xe&&(J=Rr(J)),Ae(J,z.FORBID_CONTENTS,et)),Ct&&(j["#text"]=!0),ze&&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 Hi('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof z.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Hi('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=z.TRUSTED_TYPES_POLICY,C=S.createHTML("")}else S===void 0&&(S=yA(f,i)),S!==null&&typeof C=="string"&&(C=S.createHTML(""));Ot&&Ot(z),Lr=z}},ea=Ae({},[...Fl,...Ol,...oA]),ta=Ae({},[...zl,...lA]),Ii=function(z){let Z=v(z);(!Z||!Z.tagName)&&(Z={namespaceURI:Ze,tagName:"template"});const oe=La(z.tagName),Pe=La(Z.tagName);return jt[z.namespaceURI]?z.namespaceURI===mt?Z.namespaceURI===bt?oe==="svg":Z.namespaceURI===qe?oe==="svg"&&(Pe==="annotation-xml"||Wn[Pe]):!!ea[oe]:z.namespaceURI===qe?Z.namespaceURI===bt?oe==="math":Z.namespaceURI===mt?oe==="math"&&Hn[Pe]:!!ta[oe]:z.namespaceURI===bt?Z.namespaceURI===mt&&!Hn[Pe]||Z.namespaceURI===qe&&!Wn[Pe]?!1:!ta[oe]&&(Qs[oe]||!ea[oe]):!!(Nr==="application/xhtml+xml"&&jt[z.namespaceURI]):!1},Wt=function(z){zi(t.removed,{element:z});try{v(z).removeChild(z)}catch{b(z)}},Ir=function(z,Z){try{zi(t.removed,{attribute:Z.getAttributeNode(z),from:Z})}catch{zi(t.removed,{attribute:null,from:Z})}if(Z.removeAttribute(z),z==="is")if($t||vt)try{Wt(Z)}catch{}else try{Z.setAttribute(z,"")}catch{}},Un=function(z){let Z=null,oe=null;if(ct)z="<remove></remove>"+z;else{const Ge=Rl(z,/^[\r\n\t ]+/);oe=Ge&&Ge[0]}Nr==="application/xhtml+xml"&&Ze===bt&&(z='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+z+"</body></html>");const Pe=S?S.createHTML(z):z;if(Ze===bt)try{Z=new d().parseFromString(Pe,Nr)}catch{}if(!Z||!Z.documentElement){Z=w.createDocument(Ze,"template",null);try{Z.documentElement.innerHTML=Jt?C:Pe}catch{}}const tt=Z.body||Z.documentElement;return z&&oe&&tt.insertBefore(r.createTextNode(oe),tt.childNodes[0]||null),Ze===bt?M.call(Z,ze?"html":"body")[0]:ze?Z.documentElement:tt},dn=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)},fn=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")},$i=function(z){return typeof o=="function"&&z instanceof o};function er(he,z,Z){ha(he,oe=>{oe.call(t,z,Z,Lr)})}const ra=function(z){let Z=null;if(er(N.beforeSanitizeElements,z,null),fn(z))return Wt(z),!0;const oe=et(z.nodeName);if(er(N.uponSanitizeElement,z,{tagName:oe,allowedTags:j}),Le&&z.hasChildNodes()&&!$i(z.firstElementChild)&&Bt(/<[/\w!]/g,z.innerHTML)&&Bt(/<[/\w!]/g,z.textContent)||z.nodeType===Ui.progressingInstruction||Le&&z.nodeType===Ui.comment&&Bt(/<[/\w]/g,z.data))return Wt(z),!0;if(!(G.tagCheck instanceof Function&&G.tagCheck(oe))&&(!j[oe]||U[oe])){if(!U[oe]&&Bi(oe)&&(Y.tagNameCheck instanceof RegExp&&Bt(Y.tagNameCheck,oe)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(oe)))return!1;if(Ct&&!J[oe]){const Pe=v(z)||z.parentNode,tt=k(z)||z.childNodes;if(tt&&Pe){const Ge=tt.length;for(let St=Ge-1;St>=0;--St){const tr=m(tt[St],!0);tr.__removalCount=(z.__removalCount||0)+1,Pe.insertBefore(tr,y(z))}}}return Wt(z),!0}return z instanceof l&&!Ii(z)||(oe==="noscript"||oe==="noembed"||oe==="noframes")&&Bt(/<\/no(script|embed|frames)/i,z.innerHTML)?(Wt(z),!0):(Ce&&z.nodeType===Ui.text&&(Z=z.textContent,ha([D,P,$],Pe=>{Z=Wi(Z,Pe," ")}),z.textContent!==Z&&(zi(t.removed,{element:z.cloneNode()}),z.textContent=Z)),er(N.afterSanitizeElements,z,null),!1)},ji=function(z,Z,oe){if(ut&&(Z==="id"||Z==="name")&&(oe in r||oe in Js))return!1;if(!(re&&!q[Z]&&Bt(F,Z))){if(!(Q&&Bt(L,Z))){if(!(G.attributeCheck instanceof Function&&G.attributeCheck(Z,z))){if(!A[Z]||q[Z]){if(!(Bi(z)&&(Y.tagNameCheck instanceof RegExp&&Bt(Y.tagNameCheck,z)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(z))&&(Y.attributeNameCheck instanceof RegExp&&Bt(Y.attributeNameCheck,Z)||Y.attributeNameCheck instanceof Function&&Y.attributeNameCheck(Z,z))||Z==="is"&&Y.allowCustomizedBuiltInElements&&(Y.tagNameCheck instanceof RegExp&&Bt(Y.tagNameCheck,oe)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(oe))))return!1}else if(!st[Z]){if(!Bt(_,Wi(oe,W,""))){if(!((Z==="src"||Z==="xlink:href"||Z==="href")&&z!=="script"&&nA(oe,"data:")===0&&_e[z])){if(!(ge&&!Bt(R,Wi(oe,W,"")))){if(oe)return!1}}}}}}}return!0},Bi=function(z){return z!=="annotation-xml"&&Rl(z,X)},Di=function(z){er(N.beforeSanitizeAttributes,z,null);const{attributes:Z}=z;if(!Z||fn(z))return;const oe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:A,forceKeepAttr:void 0};let Pe=Z.length;for(;Pe--;){const tt=Z[Pe],{name:Ge,namespaceURI:St,value:tr}=tt,$r=et(Ge),Vn=tr;let at=Ge==="value"?Vn:iA(Vn);if(oe.attrName=$r,oe.attrValue=at,oe.keepAttr=!0,oe.forceKeepAttr=void 0,er(N.uponSanitizeAttribute,z,oe),at=oe.attrValue,gt&&($r==="id"||$r==="name")&&(Ir(Ge,z),at=We+at),Le&&Bt(/((--!?|])>)|<\/(style|title|textarea)/i,at)){Ir(Ge,z);continue}if($r==="attributename"&&Rl(at,"href")){Ir(Ge,z);continue}if(oe.forceKeepAttr)continue;if(!oe.keepAttr){Ir(Ge,z);continue}if(!Se&&Bt(/\/>/i,at)){Ir(Ge,z);continue}Ce&&ha([D,P,$],ia=>{at=Wi(at,ia," ")});const na=et(z.nodeName);if(!ji(na,$r,at)){Ir(Ge,z);continue}if(S&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!St)switch(f.getAttributeType(na,$r)){case"TrustedHTML":{at=S.createHTML(at);break}case"TrustedScriptURL":{at=S.createScriptURL(at);break}}if(at!==Vn)try{St?z.setAttributeNS(St,Ge,at):z.setAttribute(Ge,at),fn(z)?Wt(z):cf(t.removed)}catch{Ir(Ge,z)}}er(N.afterSanitizeAttributes,z,null)},pn=function he(z){let Z=null;const oe=dn(z);for(er(N.beforeSanitizeShadowDOM,z,null);Z=oe.nextNode();)er(N.uponSanitizeShadowNode,Z,null),ra(Z),Di(Z),Z.content instanceof s&&he(Z.content);er(N.afterSanitizeShadowDOM,z,null)};return t.sanitize=function(he){let z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Z=null,oe=null,Pe=null,tt=null;if(Jt=!he,Jt&&(he="<!-->"),typeof he!="string"&&!$i(he))if(typeof he.toString=="function"){if(he=he.toString(),typeof he!="string")throw Hi("dirty is not a string, aborting")}else throw Hi("toString is not a function");if(!t.isSupported)return he;if(Je||qn(z),t.removed=[],typeof he=="string"&&(yt=!1),yt){if(he.nodeName){const tr=et(he.nodeName);if(!j[tr]||U[tr])throw Hi("root node is forbidden and cannot be sanitized in-place")}}else if(he instanceof o)Z=Un("<!---->"),oe=Z.ownerDocument.importNode(he,!0),oe.nodeType===Ui.element&&oe.nodeName==="BODY"||oe.nodeName==="HTML"?Z=oe:Z.appendChild(oe);else{if(!$t&&!Ce&&!ze&&he.indexOf("<")===-1)return S&&Ee?S.createHTML(he):he;if(Z=Un(he),!Z)return $t?null:Ee?C:""}Z&&ct&&Wt(Z.firstChild);const Ge=dn(yt?he:Z);for(;Pe=Ge.nextNode();)ra(Pe),Di(Pe),Pe.content instanceof s&&pn(Pe.content);if(yt)return he;if($t){if(vt)for(tt=I.call(Z.ownerDocument);Z.firstChild;)tt.appendChild(Z.firstChild);else tt=Z;return(A.shadowroot||A.shadowrootmode)&&(tt=E.call(n,tt,!0)),tt}let St=ze?Z.outerHTML:Z.innerHTML;return ze&&j["!doctype"]&&Z.ownerDocument&&Z.ownerDocument.doctype&&Z.ownerDocument.doctype.name&&Bt(Mm,Z.ownerDocument.doctype.name)&&(St="<!DOCTYPE "+Z.ownerDocument.doctype.name+`>
|
|
135
|
-
`+St),Ce&&ha([D,P,$],tr=>{St=Wi(St,tr," ")}),S&&Ee?S.createHTML(St):St},t.setConfig=function(){let he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};qn(he),Je=!0},t.clearConfig=function(){Lr=null,Je=!1},t.isValidAttribute=function(he,z,Z){Lr||qn({});const oe=et(he),Pe=et(z);return ji(oe,Pe,Z)},t.addHook=function(he,z){typeof z=="function"&&zi(N[he],z)},t.removeHook=function(he,z){if(z!==void 0){const Z=tA(N[he],z);return Z===-1?void 0:rA(N[he],Z,1)[0]}return cf(N[he])},t.removeHooks=function(he){N[he]=[]},t.removeAllHooks=function(){N=gf()},t}var gi=Nm(),Lm=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,gs=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,bA=/\s*%%.*\n/gm,si,Im=(si=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},x(si,"UnknownDiagramError"),si),Mn={},Qu=x(function(e,t){e=e.replace(Lm,"").replace(gs,"").replace(bA,`
|
|
136
|
-
`);for(const[r,{detector:n}]of Object.entries(Mn))if(n(e,t))return r;throw new Im(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),Tc=x((...e)=>{for(const{id:t,detector:r,loader:n}of e)$m(t,r,n)},"registerLazyLoadedDiagrams"),$m=x((e,t,r)=>{Mn[e]&&K.warn(`Detector with key ${e} already exists. Overwriting.`),Mn[e]={detector:t,loader:r},K.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),kA=x(e=>Mn[e].loader,"getDiagramLoader"),Ec=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=>Ec(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]=Ec(e[s],t[s],{depth:r-1,clobber:n})):(n||typeof e[s]!="object"&&typeof t[s]!="object")&&(e[s]=t[s])}),e)},"assignWithDepth"),dt=Ec,zo="#ffffff",Wo="#f2f2f2",Pt=x((e,t)=>t?H(e,{s:-40,l:10}):H(e,{s:-40,l:-10}),"mkBorder"),ai,wA=(ai=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||H(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||H(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Pt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Pt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Pt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Pt(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||se(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||se(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||se(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||H(this.primaryColor,{h:30}),this.cScale4=this.cScale4||H(this.primaryColor,{h:60}),this.cScale5=this.cScale5||H(this.primaryColor,{h:90}),this.cScale6=this.cScale6||H(this.primaryColor,{h:120}),this.cScale7=this.cScale7||H(this.primaryColor,{h:150}),this.cScale8=this.cScale8||H(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||H(this.primaryColor,{h:270}),this.cScale10=this.cScale10||H(this.primaryColor,{h:300}),this.cScale11=this.cScale11||H(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]||se(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]||H(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||H(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||H(this.primaryColor,{h:64}),this.fillType3=this.fillType3||H(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||H(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||H(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||H(this.primaryColor,{h:128}),this.fillType7=this.fillType7||H(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||H(this.primaryColor,{l:-10}),this.pie5=this.pie5||H(this.secondaryColor,{l:-10}),this.pie6=this.pie6||H(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||H(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||H(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||H(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||H(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||H(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||H(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||H(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||H(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||H(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||H(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||H(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||H(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||zs(this.quadrant1Fill)?se(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||H(this.primaryColor,{h:-30}),this.git4=this.git4||H(this.primaryColor,{h:-60}),this.git5=this.git5||H(this.primaryColor,{h:-90}),this.git6=this.git6||H(this.primaryColor,{h:60}),this.git7=this.git7||H(this.primaryColor,{h:120}),this.darkMode?(this.git0=se(this.git0,25),this.git1=se(this.git1,25),this.git2=se(this.git2,25),this.git3=se(this.git3,25),this.git4=se(this.git4,25),this.git5=se(this.git5,25),this.git6=se(this.git6,25),this.git7=se(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||zo,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Wo}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),vA=x(e=>{const t=new wA;return t.calculate(e),t},"getThemeVariables"),oi,CA=(oi=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=se(this.primaryColor,16),this.tertiaryColor=H(this.primaryColor,{h:-160}),this.primaryBorderColor=ne(this.background),this.secondaryBorderColor=Pt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Pt(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=se(ne("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=ps(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=ps(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=ps(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||se(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||fe(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){this.secondBkg=se(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=se(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=se(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=H(this.primaryColor,{h:64}),this.fillType3=H(this.secondaryColor,{h:64}),this.fillType4=H(this.primaryColor,{h:-64}),this.fillType5=H(this.secondaryColor,{h:-64}),this.fillType6=H(this.primaryColor,{h:128}),this.fillType7=H(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||H(this.primaryColor,{h:30}),this.cScale4=this.cScale4||H(this.primaryColor,{h:60}),this.cScale5=this.cScale5||H(this.primaryColor,{h:90}),this.cScale6=this.cScale6||H(this.primaryColor,{h:120}),this.cScale7=this.cScale7||H(this.primaryColor,{h:150}),this.cScale8=this.cScale8||H(this.primaryColor,{h:210}),this.cScale9=this.cScale9||H(this.primaryColor,{h:270}),this.cScale10=this.cScale10||H(this.primaryColor,{h:300}),this.cScale11=this.cScale11||H(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]||se(this["cScale"+t],10);for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||H(this.mainBkg,{h:30,s:-30,l:-(-10+t*4)}),this["surfacePeer"+t]=this["surfacePeer"+t]||H(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||H(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||H(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||H(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||H(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||H(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||H(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||zs(this.quadrant1Fill)?se(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=se(this.secondaryColor,20),this.git1=se(this.pie2||this.secondaryColor,20),this.git2=se(this.pie3||this.tertiaryColor,20),this.git3=se(this.pie4||H(this.primaryColor,{h:-30}),20),this.git4=se(this.pie5||H(this.primaryColor,{h:-60}),20),this.git5=se(this.pie6||H(this.primaryColor,{h:-90}),10),this.git6=se(this.pie7||H(this.primaryColor,{h:60}),10),this.git7=se(this.pie8||H(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||se(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||se(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(oi,"Theme"),oi),SA=x(e=>{const t=new CA;return t.calculate(e),t},"getThemeVariables"),li,_A=(li=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=H(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=H(this.primaryColor,{h:-160}),this.primaryBorderColor=Pt(this.primaryColor,this.darkMode),this.secondaryBorderColor=Pt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Pt(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=ps(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||H(this.primaryColor,{h:30}),this.cScale4=this.cScale4||H(this.primaryColor,{h:60}),this.cScale5=this.cScale5||H(this.primaryColor,{h:90}),this.cScale6=this.cScale6||H(this.primaryColor,{h:120}),this.cScale7=this.cScale7||H(this.primaryColor,{h:150}),this.cScale8=this.cScale8||H(this.primaryColor,{h:210}),this.cScale9=this.cScale9||H(this.primaryColor,{h:270}),this.cScale10=this.cScale10||H(this.primaryColor,{h:300}),this.cScale11=this.cScale11||H(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]||H(this["cScale"+t],{h:180});for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||H(this.mainBkg,{h:30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||H(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=se(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||se(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||se(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=H(this.primaryColor,{h:64}),this.fillType3=H(this.secondaryColor,{h:64}),this.fillType4=H(this.primaryColor,{h:-64}),this.fillType5=H(this.secondaryColor,{h:-64}),this.fillType6=H(this.primaryColor,{h:128}),this.fillType7=H(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||H(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||H(this.primaryColor,{l:-10}),this.pie5=this.pie5||H(this.secondaryColor,{l:-30}),this.pie6=this.pie6||H(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||H(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||H(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||H(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||H(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||H(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||H(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||H(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||H(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||H(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||H(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||H(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||H(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||zs(this.quadrant1Fill)?se(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||H(this.primaryColor,{h:-30}),this.git4=this.git4||H(this.primaryColor,{h:-60}),this.git5=this.git5||H(this.primaryColor,{h:-90}),this.git6=this.git6||H(this.primaryColor,{h:60}),this.git7=this.git7||H(this.primaryColor,{h:120}),this.darkMode?(this.git0=se(this.git0,25),this.git1=se(this.git1,25),this.git2=se(this.git2,25),this.git3=se(this.git3,25),this.git4=se(this.git4,25),this.git5=se(this.git5,25),this.git6=se(this.git6,25),this.git7=se(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||zo,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Wo}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(li,"Theme"),li),TA=x(e=>{const t=new _A;return t.calculate(e),t},"getThemeVariables"),ci,EA=(ci=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=se("#cde498",10),this.primaryBorderColor=Pt(this.primaryColor,this.darkMode),this.secondaryBorderColor=Pt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Pt(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||H(this.primaryColor,{h:30}),this.cScale4=this.cScale4||H(this.primaryColor,{h:60}),this.cScale5=this.cScale5||H(this.primaryColor,{h:90}),this.cScale6=this.cScale6||H(this.primaryColor,{h:120}),this.cScale7=this.cScale7||H(this.primaryColor,{h:150}),this.cScale8=this.cScale8||H(this.primaryColor,{h:210}),this.cScale9=this.cScale9||H(this.primaryColor,{h:270}),this.cScale10=this.cScale10||H(this.primaryColor,{h:300}),this.cScale11=this.cScale11||H(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]||H(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]||H(this.mainBkg,{h:30,s:-30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||H(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||se(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||se(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=H(this.primaryColor,{h:64}),this.fillType3=H(this.secondaryColor,{h:64}),this.fillType4=H(this.primaryColor,{h:-64}),this.fillType5=H(this.secondaryColor,{h:-64}),this.fillType6=H(this.primaryColor,{h:128}),this.fillType7=H(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||H(this.primaryColor,{l:-30}),this.pie5=this.pie5||H(this.secondaryColor,{l:-30}),this.pie6=this.pie6||H(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||H(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||H(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||H(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||H(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||H(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||H(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||H(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||H(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||H(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||H(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||H(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||H(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||zs(this.quadrant1Fill)?se(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||H(this.primaryColor,{h:-30}),this.git4=this.git4||H(this.primaryColor,{h:-60}),this.git5=this.git5||H(this.primaryColor,{h:-90}),this.git6=this.git6||H(this.primaryColor,{h:60}),this.git7=this.git7||H(this.primaryColor,{h:120}),this.darkMode?(this.git0=se(this.git0,25),this.git1=se(this.git1,25),this.git2=se(this.git2,25),this.git3=se(this.git3,25),this.git4=se(this.git4,25),this.git5=se(this.git5,25),this.git6=se(this.git6,25),this.git7=se(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||zo,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Wo}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(ci,"Theme"),ci),AA=x(e=>{const t=new EA;return t.calculate(e),t},"getThemeVariables"),ui,MA=(ui=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=se(this.contrast,55),this.background="#ffffff",this.tertiaryColor=H(this.primaryColor,{h:-160}),this.primaryBorderColor=Pt(this.primaryColor,this.darkMode),this.secondaryBorderColor=Pt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Pt(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||se(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.secondBkg=se(this.contrast,55),this.border2=this.contrast,this.actorBorder=se(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]||se(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]||H(this.mainBkg,{l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||H(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=se(this.contrast,30),this.sectionBkgColor2=se(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=se(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=H(this.primaryColor,{h:64}),this.fillType3=H(this.secondaryColor,{h:64}),this.fillType4=H(this.primaryColor,{h:-64}),this.fillType5=H(this.secondaryColor,{h:-64}),this.fillType6=H(this.primaryColor,{h:128}),this.fillType7=H(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||H(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||H(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||H(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||H(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||H(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||H(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||zs(this.quadrant1Fill)?se(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||H(this.primaryColor,{h:-30}),this.git4=this.pie5||H(this.primaryColor,{h:-60}),this.git5=this.pie6||H(this.primaryColor,{h:-90}),this.git6=this.pie7||H(this.primaryColor,{h:60}),this.git7=this.pie8||H(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||zo,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Wo}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(ui,"Theme"),ui),NA=x(e=>{const t=new MA;return t.calculate(e),t},"getThemeVariables"),zr={base:{getThemeVariables:vA},dark:{getThemeVariables:SA},default:{getThemeVariables:TA},forest:{getThemeVariables:AA},neutral:{getThemeVariables:NA}},mr={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},jm={...mr,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:zr.default.getThemeVariables(),sequence:{...mr.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:{...mr.gantt,tickInterval:void 0,useWidth:void 0},c4:{...mr.c4,useWidth:void 0,personFont:x(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...mr.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:{...mr.pie,useWidth:984},xyChart:{...mr.xyChart,useWidth:void 0},requirement:{...mr.requirement,useWidth:void 0},packet:{...mr.packet},radar:{...mr.radar},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","}},Bm=x((e,t="")=>Object.keys(e).reduce((r,n)=>Array.isArray(e[n])?r:typeof e[n]=="object"&&e[n]!==null?[...r,t+n,...Bm(e[n],"")]:[...r,t+n],[]),"keyify"),LA=new Set(Bm(jm,"")),Dm=jm,Ka=x(e=>{if(K.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>Ka(t));return}for(const t of Object.keys(e)){if(K.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!LA.has(t)||e[t]==null){K.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){K.debug("sanitizing object",t),Ka(e[t]);continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)t.includes(n)&&(K.debug("sanitizing css option",t),e[t]=IA(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]="")}K.debug("After sanitization",e)}},"sanitizeDirective"),IA=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"),mi=Object.freeze(Dm),Ut=dt({},mi),Qa,Nn=[],ms=dt({},mi),Ho=x((e,t)=>{let r=dt({},e),n={};for(const i of t)Fm(i),n=dt(n,i);if(r=dt(r,n),n.theme&&n.theme in zr){const i=dt({},Qa),s=dt(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in zr&&(r.themeVariables=zr[r.theme].getThemeVariables(s))}return ms=r,Om(ms),ms},"updateCurrentConfig"),$A=x(e=>(Ut=dt({},mi),Ut=dt(Ut,e),e.theme&&zr[e.theme]&&(Ut.themeVariables=zr[e.theme].getThemeVariables(e.themeVariables)),Ho(Ut,Nn),Ut),"setSiteConfig"),jA=x(e=>{Qa=dt({},e)},"saveConfigFromInitialize"),BA=x(e=>(Ut=dt(Ut,e),Ho(Ut,Nn),Ut),"updateSiteConfig"),Pm=x(()=>dt({},Ut),"getSiteConfig"),Rm=x(e=>(Om(e),dt(ms,e),At()),"setConfig"),At=x(()=>dt({},ms),"getConfig"),Fm=x(e=>{e&&(["secure",...Ut.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(K.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"&&Fm(e[t])}))},"sanitize"),DA=x(e=>{Ka(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),Nn.push(e),Ho(Ut,Nn)},"addDirective"),Za=x((e=Ut)=>{Nn=[],Ho(e,Nn)},"reset"),PA={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},mf={},RA=x(e=>{mf[e]||(K.warn(PA[e]),mf[e]=!0)},"issueWarning"),Om=x(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&RA("LAZY_LOAD_DEPRECATED")},"checkConfig"),d6=x(()=>{let e={};Qa&&(e=dt(e,Qa));for(const t of Nn)e=dt(e,t);return e},"getUserDefinedConfig"),Ws=/<br\s*\/?>/gi,FA=x(e=>e?Hm(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),OA=(()=>{let e=!1;return()=>{e||(zm(),e=!0)}})();function zm(){const e="data-temp-href-target";gi.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),gi.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(zm,"setupDompurifyHooks");var Wm=x(e=>(OA(),gi.sanitize(e)),"removeScript"),xf=x((e,t)=>{if(t.flowchart?.htmlLabels!==!1){const r=t.securityLevel;r==="antiscript"||r==="strict"?e=Wm(e):r!=="loose"&&(e=Hm(e),e=e.replace(/</g,"<").replace(/>/g,">"),e=e.replace(/=/g,"="),e=qA(e))}return e},"sanitizeMore"),sr=x((e,t)=>e&&(t.dompurifyConfig?e=gi.sanitize(xf(e,t),t.dompurifyConfig).toString():e=gi.sanitize(xf(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),zA=x((e,t)=>typeof e=="string"?sr(e,t):e.flat().map(r=>sr(r,t)),"sanitizeTextOrArray"),WA=x(e=>Ws.test(e),"hasBreaks"),HA=x(e=>e.split(Ws),"splitBreaks"),qA=x(e=>e.replace(/#br#/g,"<br/>"),"placeholderToBreak"),Hm=x(e=>e.replace(Ws,"#br#"),"breakToPlaceholder"),UA=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"),pt=x(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),VA=x(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),GA=x(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),yf=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];YA(s,a)&&(i=s+","+a,n++,r.pop())}r.push(XA(i))}return r.join("")},"parseGenericTypes"),Ac=x((e,t)=>Math.max(0,e.split(t).length-1),"countOccurrence"),YA=x((e,t)=>{const r=Ac(e,"~"),n=Ac(t,"~");return r===1&&n===1},"shouldCombineSets"),XA=x(e=>{const t=Ac(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"),bf=x(()=>window.MathMLElement!==void 0,"isMathMLSupported"),Mc=/\$\$(.*)\$\$/g,xi=x(e=>(e.match(Mc)?.length??0)>0,"hasKatex"),f6=x(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await Zu(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"),KA=x(async(e,t)=>{if(!xi(e))return e;if(!(bf()||t.legacyMathML||t.forceLegacyMathML))return e.replace(Mc,"MathML is unsupported in this environment.");{const{default:r}=await Oe(async()=>{const{default:i}=await import("./katex-qrhCpa0F.js");return{default:i}},[]),n=t.forceLegacyMathML||!bf()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(Ws).map(i=>xi(i)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${i}</div>`:`<div>${i}</div>`).join("").replace(Mc,(i,s)=>r.renderToString(s,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),Zu=x(async(e,t)=>sr(await KA(e,t),t),"renderKatexSanitized"),Ti={getRows:FA,sanitizeText:sr,sanitizeTextOrArray:zA,hasBreaks:WA,splitBreaks:HA,lineBreakRegex:Ws,removeScript:Wm,getUrl:UA,evaluate:pt,getMax:VA,getMin:GA},QA=x(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),ZA=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"),qm=x(function(e,t,r,n){const i=ZA(t,r,n);QA(e,i)},"configureSvgSize"),JA=x(function(e,t,r,n){const i=t.node().getBBox(),s=i.width,a=i.height;K.info(`SVG bounds: ${s}x${a}`,i);let o=0,l=0;K.info(`Graph bounds: ${o}x${l}`,e),o=s+r*2,l=a+r*2,K.info(`Calculated bounds: ${o}x${l}`),qm(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"),Ia={},eM=x((e,t,r)=>{let n="";return e in Ia&&Ia[e]?n=Ia[e](r):K.warn(`No theme found for ${e}`),` & {
|
|
137
|
-
font-family: ${r.fontFamily};
|
|
138
|
-
font-size: ${r.fontSize};
|
|
139
|
-
fill: ${r.textColor}
|
|
140
|
-
}
|
|
141
|
-
@keyframes edge-animation-frame {
|
|
142
|
-
from {
|
|
143
|
-
stroke-dashoffset: 0;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
@keyframes dash {
|
|
147
|
-
to {
|
|
148
|
-
stroke-dashoffset: 0;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
& .edge-animation-slow {
|
|
152
|
-
stroke-dasharray: 9,5 !important;
|
|
153
|
-
stroke-dashoffset: 900;
|
|
154
|
-
animation: dash 50s linear infinite;
|
|
155
|
-
stroke-linecap: round;
|
|
156
|
-
}
|
|
157
|
-
& .edge-animation-fast {
|
|
158
|
-
stroke-dasharray: 9,5 !important;
|
|
159
|
-
stroke-dashoffset: 900;
|
|
160
|
-
animation: dash 20s linear infinite;
|
|
161
|
-
stroke-linecap: round;
|
|
162
|
-
}
|
|
163
|
-
/* Classes common for multiple diagrams */
|
|
164
|
-
|
|
165
|
-
& .error-icon {
|
|
166
|
-
fill: ${r.errorBkgColor};
|
|
167
|
-
}
|
|
168
|
-
& .error-text {
|
|
169
|
-
fill: ${r.errorTextColor};
|
|
170
|
-
stroke: ${r.errorTextColor};
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
& .edge-thickness-normal {
|
|
174
|
-
stroke-width: 1px;
|
|
175
|
-
}
|
|
176
|
-
& .edge-thickness-thick {
|
|
177
|
-
stroke-width: 3.5px
|
|
178
|
-
}
|
|
179
|
-
& .edge-pattern-solid {
|
|
180
|
-
stroke-dasharray: 0;
|
|
181
|
-
}
|
|
182
|
-
& .edge-thickness-invisible {
|
|
183
|
-
stroke-width: 0;
|
|
184
|
-
fill: none;
|
|
185
|
-
}
|
|
186
|
-
& .edge-pattern-dashed{
|
|
187
|
-
stroke-dasharray: 3;
|
|
188
|
-
}
|
|
189
|
-
.edge-pattern-dotted {
|
|
190
|
-
stroke-dasharray: 2;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
& .marker {
|
|
194
|
-
fill: ${r.lineColor};
|
|
195
|
-
stroke: ${r.lineColor};
|
|
196
|
-
}
|
|
197
|
-
& .marker.cross {
|
|
198
|
-
stroke: ${r.lineColor};
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
& svg {
|
|
202
|
-
font-family: ${r.fontFamily};
|
|
203
|
-
font-size: ${r.fontSize};
|
|
204
|
-
}
|
|
205
|
-
& p {
|
|
206
|
-
margin: 0
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
${n}
|
|
210
|
-
|
|
211
|
-
${t}
|
|
212
|
-
`},"getStyles"),tM=x((e,t)=>{t!==void 0&&(Ia[e]=t)},"addStylesForDiagram"),rM=eM,Um={};qE(Um,{clear:()=>nM,getAccDescription:()=>oM,getAccTitle:()=>sM,getDiagramTitle:()=>cM,setAccDescription:()=>aM,setAccTitle:()=>iM,setDiagramTitle:()=>lM});var Ju="",eh="",th="",rh=x(e=>sr(e,At()),"sanitizeText"),nM=x(()=>{Ju="",th="",eh=""},"clear"),iM=x(e=>{Ju=rh(e).replace(/^\s+/g,"")},"setAccTitle"),sM=x(()=>Ju,"getAccTitle"),aM=x(e=>{th=rh(e).replace(/\n\s+/g,`
|
|
213
|
-
`)},"setAccDescription"),oM=x(()=>th,"getAccDescription"),lM=x(e=>{eh=rh(e)},"setDiagramTitle"),cM=x(()=>eh,"getDiagramTitle"),kf=K,uM=Ku,Re=At,p6=Rm,g6=mi,nh=x(e=>sr(e,Re()),"sanitizeText"),hM=JA,dM=x(()=>Um,"getCommonDb"),Ja={},eo=x((e,t,r)=>{Ja[e]&&kf.warn(`Diagram with id ${e} already registered. Overwriting.`),Ja[e]=t,r&&$m(e,r),tM(e,t.styles),t.injectUtils?.(kf,uM,Re,nh,hM,dM(),()=>{})},"registerDiagram"),Nc=x(e=>{if(e in Ja)return Ja[e];throw new fM(e)},"getDiagram"),hi,fM=(hi=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},x(hi,"DiagramNotFoundError"),hi),pM={value:()=>{}};function Vm(){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 $a(r)}function $a(e){this._=e}function gM(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}})}$a.prototype=Vm.prototype={constructor:$a,on:function(e,t){var r=this._,n=gM(e+"",r),i,s=-1,a=n.length;if(arguments.length<2){for(;++s<a;)if((i=(e=n[s]).type)&&(i=mM(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]=wf(r[i],e.name,t);else if(t==null)for(i in r)r[i]=wf(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 $a(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 mM(e,t){for(var r=0,n=e.length,i;r<n;++r)if((i=e[r]).name===t)return i.value}function wf(e,t,r){for(var n=0,i=e.length;n<i;++n)if(e[n].name===t){e[n]=pM,e=e.slice(0,n).concat(e.slice(n+1));break}return r!=null&&e.push({name:t,value:r}),e}var Lc="http://www.w3.org/1999/xhtml";const vf={svg:"http://www.w3.org/2000/svg",xhtml:Lc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function qo(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),vf.hasOwnProperty(t)?{space:vf[t],local:e}:e}function xM(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Lc&&t.documentElement.namespaceURI===Lc?t.createElement(e):t.createElementNS(r,e)}}function yM(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Gm(e){var t=qo(e);return(t.local?yM:xM)(t)}function bM(){}function ih(e){return e==null?bM:function(){return this.querySelector(e)}}function kM(e){typeof e!="function"&&(e=ih(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 Zt(n,this._parents)}function wM(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function vM(){return[]}function Ym(e){return e==null?vM:function(){return this.querySelectorAll(e)}}function CM(e){return function(){return wM(e.apply(this,arguments))}}function SM(e){typeof e=="function"?e=CM(e):e=Ym(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 Zt(n,i)}function Xm(e){return function(){return this.matches(e)}}function Km(e){return function(t){return t.matches(e)}}var _M=Array.prototype.find;function TM(e){return function(){return _M.call(this.children,e)}}function EM(){return this.firstElementChild}function AM(e){return this.select(e==null?EM:TM(typeof e=="function"?e:Km(e)))}var MM=Array.prototype.filter;function NM(){return Array.from(this.children)}function LM(e){return function(){return MM.call(this.children,e)}}function IM(e){return this.selectAll(e==null?NM:LM(typeof e=="function"?e:Km(e)))}function $M(e){typeof e!="function"&&(e=Xm(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 Zt(n,this._parents)}function Qm(e){return new Array(e.length)}function jM(){return new Zt(this._enter||this._groups.map(Qm),this._parents)}function to(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}to.prototype={constructor:to,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 BM(e){return function(){return e}}function DM(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 to(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function PM(e,t,r,n,i,s,a){var o,l,c=new Map,u=t.length,h=s.length,d=new Array(u),f;for(o=0;o<u;++o)(l=t[o])&&(d[o]=f=a.call(l,l.__data__,o,t)+"",c.has(f)?i[o]=l:c.set(f,l));for(o=0;o<h;++o)f=a.call(e,s[o],o,s)+"",(l=c.get(f))?(n[o]=l,l.__data__=s[o],c.delete(f)):r[o]=new to(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(d[o])===l&&(i[o]=l)}function RM(e){return e.__data__}function FM(e,t){if(!arguments.length)return Array.from(this,RM);var r=t?PM:DM,n=this._parents,i=this._groups;typeof e!="function"&&(e=BM(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],d=h.length,f=OM(e.call(u,u&&u.__data__,c,n)),g=f.length,m=o[c]=new Array(g),b=a[c]=new Array(g),y=l[c]=new Array(d);r(u,h,m,b,y,f,t);for(var k=0,v=0,S,C;k<g;++k)if(S=m[k]){for(k>=v&&(v=k+1);!(C=b[v])&&++v<g;);S._next=C||null}}return a=new Zt(a,n),a._enter=o,a._exit=l,a}function OM(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function zM(){return new Zt(this._exit||this._groups.map(Qm),this._parents)}function WM(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 HM(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,d=o[l]=new Array(h),f,g=0;g<h;++g)(f=c[g]||u[g])&&(d[g]=f);for(;l<i;++l)o[l]=r[l];return new Zt(o,this._parents)}function qM(){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 UM(e){e||(e=VM);function t(h,d){return h&&d?e(h.__data__,d.__data__):!h-!d}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 Zt(i,this._parents).order()}function VM(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function GM(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function YM(){return Array.from(this)}function XM(){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 KM(){let e=0;for(const t of this)++e;return e}function QM(){return!this.node()}function ZM(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 JM(e){return function(){this.removeAttribute(e)}}function eN(e){return function(){this.removeAttributeNS(e.space,e.local)}}function tN(e,t){return function(){this.setAttribute(e,t)}}function rN(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function nN(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function iN(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 sN(e,t){var r=qo(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?eN:JM:typeof t=="function"?r.local?iN:nN:r.local?rN:tN)(r,t))}function Zm(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function aN(e){return function(){this.style.removeProperty(e)}}function oN(e,t,r){return function(){this.style.setProperty(e,t,r)}}function lN(e,t,r){return function(){var n=t.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,r)}}function cN(e,t,r){return arguments.length>1?this.each((t==null?aN:typeof t=="function"?lN:oN)(e,t,r??"")):yi(this.node(),e)}function yi(e,t){return e.style.getPropertyValue(t)||Zm(e).getComputedStyle(e,null).getPropertyValue(t)}function uN(e){return function(){delete this[e]}}function hN(e,t){return function(){this[e]=t}}function dN(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function fN(e,t){return arguments.length>1?this.each((t==null?uN:typeof t=="function"?dN:hN)(e,t)):this.node()[e]}function Jm(e){return e.trim().split(/^|\s+/)}function sh(e){return e.classList||new e0(e)}function e0(e){this._node=e,this._names=Jm(e.getAttribute("class")||"")}e0.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 t0(e,t){for(var r=sh(e),n=-1,i=t.length;++n<i;)r.add(t[n])}function r0(e,t){for(var r=sh(e),n=-1,i=t.length;++n<i;)r.remove(t[n])}function pN(e){return function(){t0(this,e)}}function gN(e){return function(){r0(this,e)}}function mN(e,t){return function(){(t.apply(this,arguments)?t0:r0)(this,e)}}function xN(e,t){var r=Jm(e+"");if(arguments.length<2){for(var n=sh(this.node()),i=-1,s=r.length;++i<s;)if(!n.contains(r[i]))return!1;return!0}return this.each((typeof t=="function"?mN:t?pN:gN)(r,t))}function yN(){this.textContent=""}function bN(e){return function(){this.textContent=e}}function kN(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function wN(e){return arguments.length?this.each(e==null?yN:(typeof e=="function"?kN:bN)(e)):this.node().textContent}function vN(){this.innerHTML=""}function CN(e){return function(){this.innerHTML=e}}function SN(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function _N(e){return arguments.length?this.each(e==null?vN:(typeof e=="function"?SN:CN)(e)):this.node().innerHTML}function TN(){this.nextSibling&&this.parentNode.appendChild(this)}function EN(){return this.each(TN)}function AN(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function MN(){return this.each(AN)}function NN(e){var t=typeof e=="function"?e:Gm(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function LN(){return null}function IN(e,t){var r=typeof e=="function"?e:Gm(e),n=t==null?LN:typeof t=="function"?t:ih(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}function $N(){var e=this.parentNode;e&&e.removeChild(this)}function jN(){return this.each($N)}function BN(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function DN(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function PN(e){return this.select(e?DN:BN)}function RN(e){return arguments.length?this.property("__data__",e):this.node().__data__}function FN(e){return function(t){e.call(this,t,this.__data__)}}function ON(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 zN(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 WN(e,t,r){return function(){var n=this.__on,i,s=FN(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 HN(e,t,r){var n=ON(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?WN:zN,i=0;i<s;++i)this.each(o(n[i],t,r));return this}function n0(e,t,r){var n=Zm(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 qN(e,t){return function(){return n0(this,e,t)}}function UN(e,t){return function(){return n0(this,e,t.apply(this,arguments))}}function VN(e,t){return this.each((typeof t=="function"?UN:qN)(e,t))}function*GN(){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 i0=[null];function Zt(e,t){this._groups=e,this._parents=t}function Hs(){return new Zt([[document.documentElement]],i0)}function YN(){return this}Zt.prototype=Hs.prototype={constructor:Zt,select:kM,selectAll:SM,selectChild:AM,selectChildren:IM,filter:$M,data:FM,enter:jM,exit:zM,join:WM,merge:HM,selection:YN,order:qM,sort:UM,call:GM,nodes:YM,node:XM,size:KM,empty:QM,each:ZM,attr:sN,style:cN,property:fN,classed:xN,text:wN,html:_N,raise:EN,lower:MN,append:NN,insert:IN,remove:jN,clone:PN,datum:RN,on:HN,dispatch:VN,[Symbol.iterator]:GN};function $e(e){return typeof e=="string"?new Zt([[document.querySelector(e)]],[document.documentElement]):new Zt([[e]],i0)}function ah(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function s0(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function qs(){}var Cs=.7,ro=1/Cs,ni="\\s*([+-]?\\d+)\\s*",Ss="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Cr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",XN=/^#([0-9a-f]{3,8})$/,KN=new RegExp(`^rgb\\(${ni},${ni},${ni}\\)$`),QN=new RegExp(`^rgb\\(${Cr},${Cr},${Cr}\\)$`),ZN=new RegExp(`^rgba\\(${ni},${ni},${ni},${Ss}\\)$`),JN=new RegExp(`^rgba\\(${Cr},${Cr},${Cr},${Ss}\\)$`),eL=new RegExp(`^hsl\\(${Ss},${Cr},${Cr}\\)$`),tL=new RegExp(`^hsla\\(${Ss},${Cr},${Cr},${Ss}\\)$`),Cf={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};ah(qs,_s,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Sf,formatHex:Sf,formatHex8:rL,formatHsl:nL,formatRgb:_f,toString:_f});function Sf(){return this.rgb().formatHex()}function rL(){return this.rgb().formatHex8()}function nL(){return a0(this).formatHsl()}function _f(){return this.rgb().formatRgb()}function _s(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=XN.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Tf(t):r===3?new Gt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?fa(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?fa(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=KN.exec(e))?new Gt(t[1],t[2],t[3],1):(t=QN.exec(e))?new Gt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ZN.exec(e))?fa(t[1],t[2],t[3],t[4]):(t=JN.exec(e))?fa(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=eL.exec(e))?Mf(t[1],t[2]/100,t[3]/100,1):(t=tL.exec(e))?Mf(t[1],t[2]/100,t[3]/100,t[4]):Cf.hasOwnProperty(e)?Tf(Cf[e]):e==="transparent"?new Gt(NaN,NaN,NaN,0):null}function Tf(e){return new Gt(e>>16&255,e>>8&255,e&255,1)}function fa(e,t,r,n){return n<=0&&(e=t=r=NaN),new Gt(e,t,r,n)}function iL(e){return e instanceof qs||(e=_s(e)),e?(e=e.rgb(),new Gt(e.r,e.g,e.b,e.opacity)):new Gt}function Ic(e,t,r,n){return arguments.length===1?iL(e):new Gt(e,t,r,n??1)}function Gt(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}ah(Gt,Ic,s0(qs,{brighter(e){return e=e==null?ro:Math.pow(ro,e),new Gt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Cs:Math.pow(Cs,e),new Gt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Gt(_n(this.r),_n(this.g),_n(this.b),no(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:Ef,formatHex:Ef,formatHex8:sL,formatRgb:Af,toString:Af}));function Ef(){return`#${wn(this.r)}${wn(this.g)}${wn(this.b)}`}function sL(){return`#${wn(this.r)}${wn(this.g)}${wn(this.b)}${wn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Af(){const e=no(this.opacity);return`${e===1?"rgb(":"rgba("}${_n(this.r)}, ${_n(this.g)}, ${_n(this.b)}${e===1?")":`, ${e})`}`}function no(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function _n(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function wn(e){return e=_n(e),(e<16?"0":"")+e.toString(16)}function Mf(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new ur(e,t,r,n)}function a0(e){if(e instanceof ur)return new ur(e.h,e.s,e.l,e.opacity);if(e instanceof qs||(e=_s(e)),!e)return new ur;if(e instanceof ur)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 ur(a,o,l,e.opacity)}function aL(e,t,r,n){return arguments.length===1?a0(e):new ur(e,t,r,n??1)}function ur(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}ah(ur,aL,s0(qs,{brighter(e){return e=e==null?ro:Math.pow(ro,e),new ur(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Cs:Math.pow(Cs,e),new ur(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 Gt(Hl(e>=240?e-240:e+120,i,n),Hl(e,i,n),Hl(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new ur(Nf(this.h),pa(this.s),pa(this.l),no(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=no(this.opacity);return`${e===1?"hsl(":"hsla("}${Nf(this.h)}, ${pa(this.s)*100}%, ${pa(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Nf(e){return e=(e||0)%360,e<0?e+360:e}function pa(e){return Math.max(0,Math.min(1,e||0))}function Hl(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 oh=e=>()=>e;function o0(e,t){return function(r){return e+r*t}}function oL(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 m6(e,t){var r=t-e;return r?o0(e,r>180||r<-180?r-360*Math.round(r/360):r):oh(isNaN(e)?t:e)}function lL(e){return(e=+e)==1?l0:function(t,r){return r-t?oL(t,r,e):oh(isNaN(t)?r:t)}}function l0(e,t){var r=t-e;return r?o0(e,r):oh(isNaN(e)?t:e)}const Lf=(function e(t){var r=lL(t);function n(i,s){var a=r((i=Ic(i)).r,(s=Ic(s)).r),o=r(i.g,s.g),l=r(i.b,s.b),c=l0(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 Kr(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var $c=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ql=new RegExp($c.source,"g");function cL(e){return function(){return e}}function uL(e){return function(t){return e(t)+""}}function hL(e,t){var r=$c.lastIndex=ql.lastIndex=0,n,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(n=$c.exec(e))&&(i=ql.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:Kr(n,i)})),r=ql.lastIndex;return r<t.length&&(s=t.slice(r),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?uL(l[0].x):cL(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 If=180/Math.PI,jc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function c0(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)*If,skewX:Math.atan(l)*If,scaleX:a,scaleY:o}}var ga;function dL(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?jc:c0(t.a,t.b,t.c,t.d,t.e,t.f)}function fL(e){return e==null||(ga||(ga=document.createElementNS("http://www.w3.org/2000/svg","g")),ga.setAttribute("transform",e),!(e=ga.transform.baseVal.consolidate()))?jc:(e=e.matrix,c0(e.a,e.b,e.c,e.d,e.e,e.f))}function u0(e,t,r,n){function i(c){return c.length?c.pop()+" ":""}function s(c,u,h,d,f,g){if(c!==h||u!==d){var m=f.push("translate(",null,t,null,r);g.push({i:m-4,x:Kr(c,h)},{i:m-2,x:Kr(u,d)})}else(h||d)&&f.push("translate("+h+t+d+r)}function a(c,u,h,d){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),d.push({i:h.push(i(h)+"rotate(",null,n)-2,x:Kr(c,u)})):u&&h.push(i(h)+"rotate("+u+n)}function o(c,u,h,d){c!==u?d.push({i:h.push(i(h)+"skewX(",null,n)-2,x:Kr(c,u)}):u&&h.push(i(h)+"skewX("+u+n)}function l(c,u,h,d,f,g){if(c!==h||u!==d){var m=f.push(i(f)+"scale(",null,",",null,")");g.push({i:m-4,x:Kr(c,h)},{i:m-2,x:Kr(u,d)})}else(h!==1||d!==1)&&f.push(i(f)+"scale("+h+","+d+")")}return function(c,u){var h=[],d=[];return c=e(c),u=e(u),s(c.translateX,c.translateY,u.translateX,u.translateY,h,d),a(c.rotate,u.rotate,h,d),o(c.skewX,u.skewX,h,d),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,h,d),c=u=null,function(f){for(var g=-1,m=d.length,b;++g<m;)h[(b=d[g]).i]=b.x(f);return h.join("")}}}var pL=u0(dL,"px, ","px)","deg)"),gL=u0(fL,", ",")",")"),bi=0,ts=0,Vi=0,h0=1e3,io,rs,so=0,Ln=0,Uo=0,Ts=typeof performance=="object"&&performance.now?performance:Date,d0=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function lh(){return Ln||(d0(mL),Ln=Ts.now()+Uo)}function mL(){Ln=0}function ao(){this._call=this._time=this._next=null}ao.prototype=f0.prototype={constructor:ao,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?lh():+r)+(t==null?0:+t),!this._next&&rs!==this&&(rs?rs._next=this:io=this,rs=this),this._call=e,this._time=r,Bc()},stop:function(){this._call&&(this._call=null,this._time=1/0,Bc())}};function f0(e,t,r){var n=new ao;return n.restart(e,t,r),n}function xL(){lh(),++bi;for(var e=io,t;e;)(t=Ln-e._time)>=0&&e._call.call(void 0,t),e=e._next;--bi}function $f(){Ln=(so=Ts.now())+Uo,bi=ts=0;try{xL()}finally{bi=0,bL(),Ln=0}}function yL(){var e=Ts.now(),t=e-so;t>h0&&(Uo-=t,so=e)}function bL(){for(var e,t=io,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:io=r);rs=e,Bc(n)}function Bc(e){if(!bi){ts&&(ts=clearTimeout(ts));var t=e-Ln;t>24?(e<1/0&&(ts=setTimeout($f,e-Ts.now()-Uo)),Vi&&(Vi=clearInterval(Vi))):(Vi||(so=Ts.now(),Vi=setInterval(yL,h0)),bi=1,d0($f))}}function jf(e,t,r){var n=new ao;return t=t==null?0:+t,n.restart(i=>{n.stop(),e(i+t)},t,r),n}var kL=Vm("start","end","cancel","interrupt"),wL=[],p0=0,Bf=1,Dc=2,ja=3,Df=4,Pc=5,Ba=6;function Vo(e,t,r,n,i,s){var a=e.__transition;if(!a)e.__transition={};else if(r in a)return;vL(e,r,{name:t,index:n,group:i,on:kL,tween:wL,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:p0})}function ch(e,t){var r=gr(e,t);if(r.state>p0)throw new Error("too late; already scheduled");return r}function Er(e,t){var r=gr(e,t);if(r.state>ja)throw new Error("too late; already running");return r}function gr(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function vL(e,t,r){var n=e.__transition,i;n[t]=r,r.timer=f0(s,0,r.time);function s(c){r.state=Bf,r.timer.restart(a,r.delay,r.time),r.delay<=c&&a(c-r.delay)}function a(c){var u,h,d,f;if(r.state!==Bf)return l();for(u in n)if(f=n[u],f.name===r.name){if(f.state===ja)return jf(a);f.state===Df?(f.state=Ba,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete n[u]):+u<t&&(f.state=Ba,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete n[u])}if(jf(function(){r.state===ja&&(r.state=Df,r.timer.restart(o,r.delay,r.time),o(c))}),r.state=Dc,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Dc){for(r.state=ja,i=new Array(d=r.tween.length),u=0,h=-1;u<d;++u)(f=r.tween[u].value.call(e,e.__data__,r.index,r.group))&&(i[++h]=f);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=Pc,1),h=-1,d=i.length;++h<d;)i[h].call(e,u);r.state===Pc&&(r.on.call("end",e,e.__data__,r.index,r.group),l())}function l(){r.state=Ba,r.timer.stop(),delete n[t];for(var c in n)return;delete e.__transition}}function CL(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>Dc&&n.state<Pc,n.state=Ba,n.timer.stop(),n.on.call(i?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete r[a]}s&&delete e.__transition}}function SL(e){return this.each(function(){CL(this,e)})}function _L(e,t){var r,n;return function(){var i=Er(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 TL(e,t,r){var n,i;if(typeof r!="function")throw new Error;return function(){var s=Er(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 EL(e,t){var r=this._id;if(e+="",arguments.length<2){for(var n=gr(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?_L:TL)(r,e,t))}function uh(e,t,r){var n=e._id;return e.each(function(){var i=Er(this,n);(i.value||(i.value={}))[t]=r.apply(this,arguments)}),function(i){return gr(i,n).value[t]}}function g0(e,t){var r;return(typeof t=="number"?Kr:t instanceof _s?Lf:(r=_s(t))?(t=r,Lf):hL)(e,t)}function AL(e){return function(){this.removeAttribute(e)}}function ML(e){return function(){this.removeAttributeNS(e.space,e.local)}}function NL(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 LL(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 IL(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 $L(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 jL(e,t){var r=qo(e),n=r==="transform"?gL:g0;return this.attrTween(e,typeof t=="function"?(r.local?$L:IL)(r,n,uh(this,"attr."+e,t)):t==null?(r.local?ML:AL)(r):(r.local?LL:NL)(r,n,t))}function BL(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function DL(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function PL(e,t){var r,n;function i(){var s=t.apply(this,arguments);return s!==n&&(r=(n=s)&&DL(e,s)),r}return i._value=t,i}function RL(e,t){var r,n;function i(){var s=t.apply(this,arguments);return s!==n&&(r=(n=s)&&BL(e,s)),r}return i._value=t,i}function FL(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=qo(e);return this.tween(r,(n.local?PL:RL)(n,t))}function OL(e,t){return function(){ch(this,e).delay=+t.apply(this,arguments)}}function zL(e,t){return t=+t,function(){ch(this,e).delay=t}}function WL(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?OL:zL)(t,e)):gr(this.node(),t).delay}function HL(e,t){return function(){Er(this,e).duration=+t.apply(this,arguments)}}function qL(e,t){return t=+t,function(){Er(this,e).duration=t}}function UL(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?HL:qL)(t,e)):gr(this.node(),t).duration}function VL(e,t){if(typeof t!="function")throw new Error;return function(){Er(this,e).ease=t}}function GL(e){var t=this._id;return arguments.length?this.each(VL(t,e)):gr(this.node(),t).ease}function YL(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Er(this,e).ease=r}}function XL(e){if(typeof e!="function")throw new Error;return this.each(YL(this._id,e))}function KL(e){typeof e!="function"&&(e=Xm(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 Hr(n,this._parents,this._name,this._id)}function QL(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),d,f=0;f<u;++f)(d=l[f]||c[f])&&(h[f]=d);for(;o<n;++o)a[o]=t[o];return new Hr(a,this._parents,this._name,this._id)}function ZL(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 JL(e,t,r){var n,i,s=ZL(t)?ch:Er;return function(){var a=s(this,e),o=a.on;o!==n&&(i=(n=o).copy()).on(t,r),a.on=i}}function eI(e,t){var r=this._id;return arguments.length<2?gr(this.node(),r).on.on(e):this.each(JL(r,e,t))}function tI(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function rI(){return this.on("end.remove",tI(this._id))}function nI(e){var t=this._name,r=this._id;typeof e!="function"&&(e=ih(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,d=0;d<l;++d)(u=o[d])&&(h=e.call(u,u.__data__,d,o))&&("__data__"in u&&(h.__data__=u.__data__),c[d]=h,Vo(c[d],t,r,d,c,gr(u,r)));return new Hr(s,this._parents,t,r)}function iI(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Ym(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 d=e.call(u,u.__data__,h,l),f,g=gr(u,r),m=0,b=d.length;m<b;++m)(f=d[m])&&Vo(f,t,r,m,d,g);s.push(d),a.push(u)}return new Hr(s,a,t,r)}var sI=Hs.prototype.constructor;function aI(){return new sI(this._groups,this._parents)}function oI(e,t){var r,n,i;return function(){var s=yi(this,e),a=(this.style.removeProperty(e),yi(this,e));return s===a?null:s===r&&a===n?i:i=t(r=s,n=a)}}function m0(e){return function(){this.style.removeProperty(e)}}function lI(e,t,r){var n,i=r+"",s;return function(){var a=yi(this,e);return a===i?null:a===n?s:s=t(n=a,r)}}function cI(e,t,r){var n,i,s;return function(){var a=yi(this,e),o=r(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),yi(this,e))),a===l?null:a===n&&l===i?s:(i=l,s=t(n=a,o))}}function uI(e,t){var r,n,i,s="style."+t,a="end."+s,o;return function(){var l=Er(this,e),c=l.on,u=l.value[s]==null?o||(o=m0(t)):void 0;(c!==r||i!==u)&&(n=(r=c).copy()).on(a,i=u),l.on=n}}function hI(e,t,r){var n=(e+="")=="transform"?pL:g0;return t==null?this.styleTween(e,oI(e,n)).on("end.style."+e,m0(e)):typeof t=="function"?this.styleTween(e,cI(e,n,uh(this,"style."+e,t))).each(uI(this._id,e)):this.styleTween(e,lI(e,n,t),r).on("end.style."+e,null)}function dI(e,t,r){return function(n){this.style.setProperty(e,t.call(this,n),r)}}function fI(e,t,r){var n,i;function s(){var a=t.apply(this,arguments);return a!==i&&(n=(i=a)&&dI(e,a,r)),n}return s._value=t,s}function pI(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,fI(e,t,r??""))}function gI(e){return function(){this.textContent=e}}function mI(e){return function(){var t=e(this);this.textContent=t??""}}function xI(e){return this.tween("text",typeof e=="function"?mI(uh(this,"text",e)):gI(e==null?"":e+""))}function yI(e){return function(t){this.textContent=e.call(this,t)}}function bI(e){var t,r;function n(){var i=e.apply(this,arguments);return i!==r&&(t=(r=i)&&yI(i)),t}return n._value=e,n}function kI(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,bI(e))}function wI(){for(var e=this._name,t=this._id,r=x0(),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=gr(l,t);Vo(l,e,r,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Hr(n,this._parents,e,r)}function vI(){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=Er(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 CI=0;function Hr(e,t,r,n){this._groups=e,this._parents=t,this._name=r,this._id=n}function x0(){return++CI}var Dr=Hs.prototype;Hr.prototype={constructor:Hr,select:nI,selectAll:iI,selectChild:Dr.selectChild,selectChildren:Dr.selectChildren,filter:KL,merge:QL,selection:aI,transition:wI,call:Dr.call,nodes:Dr.nodes,node:Dr.node,size:Dr.size,empty:Dr.empty,each:Dr.each,on:eI,attr:jL,attrTween:FL,style:hI,styleTween:pI,text:xI,textTween:kI,remove:rI,tween:EL,delay:WL,duration:UL,ease:GL,easeVarying:XL,end:vI,[Symbol.iterator]:Dr[Symbol.iterator]};function SI(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var _I={time:null,delay:0,duration:250,ease:SI};function TI(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 EI(e){var t,r;e instanceof Hr?(t=e._id,e=e._name):(t=x0(),(r=_I).time=lh(),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])&&Vo(l,e,t,c,a,r||TI(l,t));return new Hr(n,this._parents,e,t)}Hs.prototype.interrupt=SL;Hs.prototype.transition=EI;const Rc=Math.PI,Fc=2*Rc,xn=1e-6,AI=Fc-xn;function y0(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function MI(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return y0;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 NI{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?y0:MI(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,d=u*u+h*h;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(d>xn)if(!(Math.abs(h*l-c*u)>xn)||!s)this._append`L${this._x1=t},${this._y1=r}`;else{let f=n-a,g=i-o,m=l*l+c*c,b=f*f+g*g,y=Math.sqrt(m),k=Math.sqrt(d),v=s*Math.tan((Rc-Math.acos((m+d-b)/(2*y*k)))/2),S=v/k,C=v/y;Math.abs(S-1)>xn&&this._append`L${t+S*u},${r+S*h}`,this._append`A${s},${s},0,0,${+(h*f>u*g)},${this._x1=t+C*l},${this._y1=r+C*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,d=a?i-s:s-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>xn||Math.abs(this._y1-u)>xn)&&this._append`L${c},${u}`,n&&(d<0&&(d=d%Fc+Fc),d>AI?this._append`A${n},${n},0,1,${h},${t-o},${r-l}A${n},${n},0,1,${h},${this._x1=c},${this._y1=u}`:d>xn&&this._append`A${n},${n},0,${+(d>=Rc)},${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 Xn(e){return function(){return e}}const x6=Math.abs,y6=Math.atan2,b6=Math.cos,k6=Math.max,w6=Math.min,v6=Math.sin,C6=Math.sqrt,Pf=1e-12,hh=Math.PI,Rf=hh/2,S6=2*hh;function _6(e){return e>1?0:e<-1?hh:Math.acos(e)}function T6(e){return e>=1?Rf:e<=-1?-Rf:Math.asin(e)}function LI(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 NI(t)}function II(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function b0(e){this._context=e}b0.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 oo(e){return new b0(e)}function $I(e){return e[0]}function jI(e){return e[1]}function BI(e,t){var r=Xn(!0),n=null,i=oo,s=null,a=LI(o);e=typeof e=="function"?e:e===void 0?$I:Xn(e),t=typeof t=="function"?t:t===void 0?jI:Xn(t);function o(l){var c,u=(l=II(l)).length,h,d=!1,f;for(n==null&&(s=i(f=a())),c=0;c<=u;++c)!(c<u&&r(h=l[c],c,l))===d&&((d=!d)?s.lineStart():s.lineEnd()),d&&s.point(+e(h,c,l),+t(h,c,l));if(f)return s=null,f+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:Xn(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:Xn(+l),o):t},o.defined=function(l){return arguments.length?(r=typeof l=="function"?l:Xn(!!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 k0{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 w0(e){return new k0(e,!0)}function v0(e){return new k0(e,!1)}function tn(){}function lo(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 Go(e){this._context=e}Go.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:lo(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:lo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Da(e){return new Go(e)}function C0(e){this._context=e}C0.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:lo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function DI(e){return new C0(e)}function S0(e){this._context=e}S0.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:lo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function PI(e){return new S0(e)}function _0(e,t){this._basis=new Go(e),this._beta=t}_0.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 RI=(function e(t){function r(n){return t===1?new Go(n):new _0(n,t)}return r.beta=function(n){return e(+n)},r})(.85);function co(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 dh(e,t){this._context=e,this._k=(1-t)/6}dh.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:co(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:co(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 T0=(function e(t){function r(n){return new dh(n,t)}return r.tension=function(n){return e(+n)},r})(0);function fh(e,t){this._context=e,this._k=(1-t)/6}fh.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:co(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 FI=(function e(t){function r(n){return new fh(n,t)}return r.tension=function(n){return e(+n)},r})(0);function ph(e,t){this._context=e,this._k=(1-t)/6}ph.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:co(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 OI=(function e(t){function r(n){return new ph(n,t)}return r.tension=function(n){return e(+n)},r})(0);function gh(e,t,r){var n=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>Pf){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>Pf){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 E0(e,t){this._context=e,this._alpha=t}E0.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:gh(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 A0=(function e(t){function r(n){return t?new E0(n,t):new dh(n,0)}return r.alpha=function(n){return e(+n)},r})(.5);function M0(e,t){this._context=e,this._alpha=t}M0.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:gh(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 zI=(function e(t){function r(n){return t?new M0(n,t):new fh(n,0)}return r.alpha=function(n){return e(+n)},r})(.5);function N0(e,t){this._context=e,this._alpha=t}N0.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:gh(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 WI=(function e(t){function r(n){return t?new N0(n,t):new ph(n,0)}return r.alpha=function(n){return e(+n)},r})(.5);function L0(e){this._context=e}L0.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 HI(e){return new L0(e)}function Ff(e){return e<0?-1:1}function Of(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(Ff(s)+Ff(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function zf(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Ul(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 uo(e){this._context=e}uo.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:Ul(this,this._t0,zf(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,Ul(this,zf(this,r=Of(this,e,t)),r);break;default:Ul(this,this._t0,r=Of(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function I0(e){this._context=new $0(e)}(I0.prototype=Object.create(uo.prototype)).point=function(e,t){uo.prototype.point.call(this,t,e)};function $0(e){this._context=e}$0.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 j0(e){return new uo(e)}function B0(e){return new I0(e)}function D0(e){this._context=e}D0.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=Wf(e),i=Wf(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 Wf(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 P0(e){return new D0(e)}function Yo(e,t){this._context=e,this._t=t}Yo.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 R0(e){return new Yo(e,.5)}function F0(e){return new Yo(e,0)}function O0(e){return new Yo(e,1)}function ns(e,t,r){this.k=e,this.x=t,this.y=r}ns.prototype={constructor:ns,scale:function(e){return e===1?this:new ns(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ns(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+")"}};ns.prototype;var qI=x(e=>{const{securityLevel:t}=Re();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 mh(e){return typeof e>"u"||e===null}x(mh,"isNothing");function z0(e){return typeof e=="object"&&e!==null}x(z0,"isObject");function W0(e){return Array.isArray(e)?e:mh(e)?[]:[e]}x(W0,"toArray");function H0(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(H0,"extend");function q0(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}x(q0,"repeat");function U0(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}x(U0,"isNegativeZero");var UI=mh,VI=z0,GI=W0,YI=q0,XI=U0,KI=H0,ft={isNothing:UI,isObject:VI,toArray:GI,repeat:YI,isNegativeZero:XI,extend:KI};function xh(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+=`
|
|
214
|
-
|
|
215
|
-
`+e.mark.snippet),n+" "+r):n}x(xh,"formatError");function ki(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=xh(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}x(ki,"YAMLException$1");ki.prototype=Object.create(Error.prototype);ki.prototype.constructor=ki;ki.prototype.toString=x(function(t){return this.name+": "+xh(this,t)},"toString");var Vt=ki;function Pa(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(Pa,"getLine");function Ra(e,t){return ft.repeat(" ",t-e.length)+e}x(Ra,"padStart");function V0(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=Pa(e.buffer,n[a-l],i[a-l],e.position-(n[a]-n[a-l]),h),o=ft.repeat(" ",t.indent)+Ra((e.line-l+1).toString(),u)+" | "+c.str+`
|
|
216
|
-
`+o;for(c=Pa(e.buffer,n[a],i[a],e.position,h),o+=ft.repeat(" ",t.indent)+Ra((e.line+1).toString(),u)+" | "+c.str+`
|
|
217
|
-
`,o+=ft.repeat("-",t.indent+u+3+c.pos)+`^
|
|
218
|
-
`,l=1;l<=t.linesAfter&&!(a+l>=i.length);l++)c=Pa(e.buffer,n[a+l],i[a+l],e.position-(n[a]-n[a+l]),h),o+=ft.repeat(" ",t.indent)+Ra((e.line+l+1).toString(),u)+" | "+c.str+`
|
|
219
|
-
`;return o.replace(/\n$/,"")}x(V0,"makeSnippet");var QI=V0,ZI=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],JI=["scalar","sequence","mapping"];function G0(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}x(G0,"compileStyleAliases");function Y0(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(ZI.indexOf(r)===-1)throw new Vt('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=G0(t.styleAliases||null),JI.indexOf(this.kind)===-1)throw new Vt('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}x(Y0,"Type$1");var Mt=Y0;function Oc(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(Oc,"compileList");function X0(){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(X0,"compileMap");function ho(e){return this.extend(e)}x(ho,"Schema$1");ho.prototype.extend=x(function(t){var r=[],n=[];if(t instanceof Mt)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 Vt("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(s){if(!(s instanceof Mt))throw new Vt("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new Vt("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 Vt("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 Mt))throw new Vt("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(ho.prototype);return i.implicit=(this.implicit||[]).concat(r),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=Oc(i,"implicit"),i.compiledExplicit=Oc(i,"explicit"),i.compiledTypeMap=X0(i.compiledImplicit,i.compiledExplicit),i},"extend");var e$=ho,t$=new Mt("tag:yaml.org,2002:str",{kind:"scalar",construct:x(function(e){return e!==null?e:""},"construct")}),r$=new Mt("tag:yaml.org,2002:seq",{kind:"sequence",construct:x(function(e){return e!==null?e:[]},"construct")}),n$=new Mt("tag:yaml.org,2002:map",{kind:"mapping",construct:x(function(e){return e!==null?e:{}},"construct")}),i$=new e$({explicit:[t$,r$,n$]});function K0(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}x(K0,"resolveYamlNull");function Q0(){return null}x(Q0,"constructYamlNull");function Z0(e){return e===null}x(Z0,"isNull");var s$=new Mt("tag:yaml.org,2002:null",{kind:"scalar",resolve:K0,construct:Q0,predicate:Z0,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 J0(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(J0,"resolveYamlBoolean");function ex(e){return e==="true"||e==="True"||e==="TRUE"}x(ex,"constructYamlBoolean");function tx(e){return Object.prototype.toString.call(e)==="[object Boolean]"}x(tx,"isBoolean");var a$=new Mt("tag:yaml.org,2002:bool",{kind:"scalar",resolve:J0,construct:ex,predicate:tx,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 rx(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}x(rx,"isHexCode");function nx(e){return 48<=e&&e<=55}x(nx,"isOctCode");function ix(e){return 48<=e&&e<=57}x(ix,"isDecCode");function sx(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(!rx(e.charCodeAt(r)))return!1;n=!0}return n&&i!=="_"}if(i==="o"){for(r++;r<t;r++)if(i=e[r],i!=="_"){if(!nx(e.charCodeAt(r)))return!1;n=!0}return n&&i!=="_"}}if(i==="_")return!1;for(;r<t;r++)if(i=e[r],i!=="_"){if(!ix(e.charCodeAt(r)))return!1;n=!0}return!(!n||i==="_")}x(sx,"resolveYamlInteger");function ax(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(ax,"constructYamlInteger");function ox(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!ft.isNegativeZero(e)}x(ox,"isInteger");var o$=new Mt("tag:yaml.org,2002:int",{kind:"scalar",resolve:sx,construct:ax,predicate:ox,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"]}}),l$=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function lx(e){return!(e===null||!l$.test(e)||e[e.length-1]==="_")}x(lx,"resolveYamlFloat");function cx(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(cx,"constructYamlFloat");var c$=/^[-+]?[0-9]+e/;function ux(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(ft.isNegativeZero(e))return"-0.0";return r=e.toString(10),c$.test(r)?r.replace("e",".e"):r}x(ux,"representYamlFloat");function hx(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ft.isNegativeZero(e))}x(hx,"isFloat");var u$=new Mt("tag:yaml.org,2002:float",{kind:"scalar",resolve:lx,construct:cx,predicate:hx,represent:ux,defaultStyle:"lowercase"}),dx=i$.extend({implicit:[s$,a$,o$,u$]}),h$=dx,fx=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),px=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 gx(e){return e===null?!1:fx.exec(e)!==null||px.exec(e)!==null}x(gx,"resolveYamlTimestamp");function mx(e){var t,r,n,i,s,a,o,l=0,c=null,u,h,d;if(t=fx.exec(e),t===null&&(t=px.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)),d=new Date(Date.UTC(r,n,i,s,a,o,l)),c&&d.setTime(d.getTime()-c),d}x(mx,"constructYamlTimestamp");function xx(e){return e.toISOString()}x(xx,"representYamlTimestamp");var d$=new Mt("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:gx,construct:mx,instanceOf:Date,represent:xx});function yx(e){return e==="<<"||e===null}x(yx,"resolveYamlMerge");var f$=new Mt("tag:yaml.org,2002:merge",{kind:"scalar",resolve:yx}),yh=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
220
|
-
\r`;function bx(e){if(e===null)return!1;var t,r,n=0,i=e.length,s=yh;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(bx,"resolveYamlBinary");function kx(e){var t,r,n=e.replace(/[\r\n=]/g,""),i=n.length,s=yh,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(kx,"constructYamlBinary");function wx(e){var t="",r=0,n,i,s=e.length,a=yh;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(wx,"representYamlBinary");function vx(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}x(vx,"isBinary");var p$=new Mt("tag:yaml.org,2002:binary",{kind:"scalar",resolve:bx,construct:kx,predicate:vx,represent:wx}),g$=Object.prototype.hasOwnProperty,m$=Object.prototype.toString;function Cx(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,m$.call(i)!=="[object Object]")return!1;for(s in i)if(g$.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(Cx,"resolveYamlOmap");function Sx(e){return e!==null?e:[]}x(Sx,"constructYamlOmap");var x$=new Mt("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Cx,construct:Sx}),y$=Object.prototype.toString;function _x(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],y$.call(n)!=="[object Object]"||(i=Object.keys(n),i.length!==1))return!1;s[t]=[i[0],n[i[0]]]}return!0}x(_x,"resolveYamlPairs");function Tx(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(Tx,"constructYamlPairs");var b$=new Mt("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:_x,construct:Tx}),k$=Object.prototype.hasOwnProperty;function Ex(e){if(e===null)return!0;var t,r=e;for(t in r)if(k$.call(r,t)&&r[t]!==null)return!1;return!0}x(Ex,"resolveYamlSet");function Ax(e){return e!==null?e:{}}x(Ax,"constructYamlSet");var w$=new Mt("tag:yaml.org,2002:set",{kind:"mapping",resolve:Ex,construct:Ax}),Mx=h$.extend({implicit:[d$,f$],explicit:[p$,x$,b$,w$]}),rn=Object.prototype.hasOwnProperty,fo=1,Nx=2,Lx=3,po=4,Vl=1,v$=2,Hf=3,C$=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,S$=/[\x85\u2028\u2029]/,_$=/[,\[\]\{\}]/,Ix=/^(?:!|!!|![a-z\-]+!)$/i,$x=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function zc(e){return Object.prototype.toString.call(e)}x(zc,"_class");function fr(e){return e===10||e===13}x(fr,"is_EOL");function en(e){return e===9||e===32}x(en,"is_WHITE_SPACE");function Rt(e){return e===9||e===32||e===10||e===13}x(Rt,"is_WS_OR_EOL");function vn(e){return e===44||e===91||e===93||e===123||e===125}x(vn,"is_FLOW_INDICATOR");function jx(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}x(jx,"fromHexCode");function Bx(e){return e===120?2:e===117?4:e===85?8:0}x(Bx,"escapedHexLen");function Dx(e){return 48<=e&&e<=57?e-48:-1}x(Dx,"fromDecimalCode");function Wc(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
221
|
-
`: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(Wc,"simpleEscapeSequence");function Px(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}x(Px,"charFromCodepoint");var Rx=new Array(256),Fx=new Array(256);for(mn=0;mn<256;mn++)Rx[mn]=Wc(mn)?1:0,Fx[mn]=Wc(mn);var mn;function Ox(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Mx,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(Ox,"State$1");function bh(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=QI(r),new Vt(t,r)}x(bh,"generateError");function de(e,t){throw bh(e,t)}x(de,"throwError");function Es(e,t){e.onWarning&&e.onWarning.call(null,bh(e,t))}x(Es,"throwWarning");var qf={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&&Es(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],Ix.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'),$x.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 Wr(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 C$.test(o)&&de(e,"the stream contains non-printable characters");e.result+=o}}x(Wr,"captureSegment");function Hc(e,t,r,n){var i,s,a,o;for(ft.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(Hc,"mergeMappings");function Cn(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"&&zc(i[c])==="[object Object]"&&(i[c]="[object Object]");if(typeof i=="object"&&zc(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)Hc(e,t,s[c],r);else Hc(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(Cn,"storeMappingPair");function Xo(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(Xo,"readLineBreak");function it(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(fr(i))for(Xo(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&&Es(e,"deficient indentation"),n}x(it,"skipSeparationSpace");function Us(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||Rt(r)))}x(Us,"testDocumentSeparator");function Ko(e,t){t===1?e.result+=" ":t>1&&(e.result+=ft.repeat(`
|
|
222
|
-
`,t-1))}x(Ko,"writeFoldedLines");function zx(e,t,r){var n,i,s,a,o,l,c,u,h=e.kind,d=e.result,f;if(f=e.input.charCodeAt(e.position),Rt(f)||vn(f)||f===35||f===38||f===42||f===33||f===124||f===62||f===39||f===34||f===37||f===64||f===96||(f===63||f===45)&&(i=e.input.charCodeAt(e.position+1),Rt(i)||r&&vn(i)))return!1;for(e.kind="scalar",e.result="",s=a=e.position,o=!1;f!==0;){if(f===58){if(i=e.input.charCodeAt(e.position+1),Rt(i)||r&&vn(i))break}else if(f===35){if(n=e.input.charCodeAt(e.position-1),Rt(n))break}else{if(e.position===e.lineStart&&Us(e)||r&&vn(f))break;if(fr(f))if(l=e.line,c=e.lineStart,u=e.lineIndent,it(e,!1,-1),e.lineIndent>=t){o=!0,f=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=l,e.lineStart=c,e.lineIndent=u;break}}o&&(Wr(e,s,a,!1),Ko(e,e.line-l),s=a=e.position,o=!1),en(f)||(a=e.position+1),f=e.input.charCodeAt(++e.position)}return Wr(e,s,a,!1),e.result?!0:(e.kind=h,e.result=d,!1)}x(zx,"readPlainScalar");function Wx(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(Wr(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 fr(r)?(Wr(e,n,i,!0),Ko(e,it(e,!1,t)),n=i=e.position):e.position===e.lineStart&&Us(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(Wx,"readSingleQuotedScalar");function Hx(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 Wr(e,r,e.position,!0),e.position++,!0;if(o===92){if(Wr(e,r,e.position,!0),o=e.input.charCodeAt(++e.position),fr(o))it(e,!1,t);else if(o<256&&Rx[o])e.result+=Fx[o],e.position++;else if((a=Bx(o))>0){for(i=a,s=0;i>0;i--)o=e.input.charCodeAt(++e.position),(a=jx(o))>=0?s=(s<<4)+a:de(e,"expected hexadecimal character");e.result+=Px(s),e.position++}else de(e,"unknown escape sequence");r=n=e.position}else fr(o)?(Wr(e,r,n,!0),Ko(e,it(e,!1,t)),r=n=e.position):e.position===e.lineStart&&Us(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(Hx,"readDoubleQuotedScalar");function qx(e,t){var r=!0,n,i,s,a=e.tag,o,l=e.anchor,c,u,h,d,f,g=Object.create(null),m,b,y,k;if(k=e.input.charCodeAt(e.position),k===91)u=93,f=!1,o=[];else if(k===123)u=125,f=!0,o={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),k=e.input.charCodeAt(++e.position);k!==0;){if(it(e,!0,t),k=e.input.charCodeAt(e.position),k===u)return e.position++,e.tag=a,e.anchor=l,e.kind=f?"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=d=!1,k===63&&(c=e.input.charCodeAt(e.position+1),Rt(c)&&(h=d=!0,e.position++,it(e,!0,t))),n=e.line,i=e.lineStart,s=e.position,In(e,t,fo,!1,!0),b=e.tag,m=e.result,it(e,!0,t),k=e.input.charCodeAt(e.position),(d||e.line===n)&&k===58&&(h=!0,k=e.input.charCodeAt(++e.position),it(e,!0,t),In(e,t,fo,!1,!0),y=e.result),f?Cn(e,o,g,b,m,y,n,i,s):h?o.push(Cn(e,null,g,b,m,y,n,i,s)):o.push(m),it(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(qx,"readFlowCollection");function Ux(e,t){var r,n,i=Vl,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)Vl===i?i=h===43?Hf:v$:de(e,"repeat of a chomping mode identifier");else if((u=Dx(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(!fr(h)&&h!==0)}for(;h!==0;){for(Xo(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),fr(h)){l++;continue}if(e.lineIndent<o){i===Hf?e.result+=ft.repeat(`
|
|
223
|
-
`,s?1+l:l):i===Vl&&s&&(e.result+=`
|
|
224
|
-
`);break}for(n?en(h)?(c=!0,e.result+=ft.repeat(`
|
|
225
|
-
`,s?1+l:l)):c?(c=!1,e.result+=ft.repeat(`
|
|
226
|
-
`,l+1)):l===0?s&&(e.result+=" "):e.result+=ft.repeat(`
|
|
227
|
-
`,l):e.result+=ft.repeat(`
|
|
228
|
-
`,s?1+l:l),s=!0,a=!0,l=0,r=e.position;!fr(h)&&h!==0;)h=e.input.charCodeAt(++e.position);Wr(e,r,e.position,!1)}return!0}x(Ux,"readBlockScalar");function qc(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),!Rt(a))));){if(o=!0,e.position++,it(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(r=e.line,In(e,t,Lx,!1,!0),s.push(e.result),it(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(qc,"readBlockSequence");function Vx(e,t,r){var n,i,s,a,o,l,c=e.tag,u=e.anchor,h={},d=Object.create(null),f=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)&&Rt(n))k===63?(b&&(Cn(e,h,d,f,g,null,a,o,l),f=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,!In(e,r,Nx,!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),Rt(k)||de(e,"a whitespace character is expected after the key-value separator within a block mapping"),b&&(Cn(e,h,d,f,g,null,a,o,l),f=g=m=null),y=!0,b=!1,i=!1,f=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),In(e,t,po,!0,i)&&(b?g=e.result:m=e.result),b||(Cn(e,h,d,f,g,m,a,o,l),f=g=m=null),it(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&&Cn(e,h,d,f,g,null,a,o,l),y&&(e.tag=c,e.anchor=u,e.kind="mapping",e.result=h),y}x(Vx,"readBlockMapping");function Gx(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&&!Rt(a);)a===33&&(n?de(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),Ix.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),_$.test(s)&&de(e,"tag suffix cannot contain flow indicator characters")}s&&!$x.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(Gx,"readTagProperty");function Yx(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&&!Rt(r)&&!vn(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(Yx,"readAnchorProperty");function Xx(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&&!Rt(n)&&!vn(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],it(e,!0,-1),!0}x(Xx,"readAlias");function In(e,t,r,n,i){var s,a,o,l=1,c=!1,u=!1,h,d,f,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=po===r||Lx===r,n&&it(e,!0,-1)&&(c=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;Gx(e)||Yx(e);)it(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||po===r)&&(fo===r||Nx===r?m=t:m=t+1,b=e.position-e.lineStart,l===1?o&&(qc(e,b)||Vx(e,b,m))||qx(e,m)?u=!0:(a&&Ux(e,m)||Wx(e,m)||Hx(e,m)?u=!0:Xx(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&de(e,"alias node should not have any properties")):zx(e,m,fo===r)&&(u=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(u=o&&qc(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,d=e.implicitTypes.length;h<d;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,f=e.typeMap.multi[e.kind||"fallback"],h=0,d=f.length;h<d;h+=1)if(e.tag.slice(0,f[h].tag.length)===f[h].tag){g=f[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(In,"composeNode");function Kx(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&&(it(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&&!Rt(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&&!fr(a));break}if(fr(a))break;for(r=e.position;a!==0&&!Rt(a);)a=e.input.charCodeAt(++e.position);i.push(e.input.slice(r,e.position))}a!==0&&Xo(e),rn.call(qf,n)?qf[n](e,n,i):Es(e,'unknown document directive "'+n+'"')}if(it(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,it(e,!0,-1)):s&&de(e,"directives end mark is expected"),In(e,e.lineIndent-1,po,!1,!0),it(e,!0,-1),e.checkLineBreaks&&S$.test(e.input.slice(t,e.position))&&Es(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Us(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,it(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(Kx,"readDocument");function kh(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
229
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new Ox(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;)Kx(r);return r.documents}x(kh,"loadDocuments");function T$(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var n=kh(e,r);if(typeof t!="function")return n;for(var i=0,s=n.length;i<s;i+=1)t(n[i])}x(T$,"loadAll$1");function Qx(e,t){var r=kh(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new Vt("expected a single document in the stream, but found more")}}x(Qx,"load$1");var E$=Qx,A$={load:E$},Zx=Object.prototype.toString,Jx=Object.prototype.hasOwnProperty,wh=65279,M$=9,As=10,N$=13,L$=32,I$=33,$$=34,Uc=35,j$=37,B$=38,D$=39,P$=42,ey=44,R$=45,go=58,F$=61,O$=62,z$=63,W$=64,ty=91,ry=93,H$=96,ny=123,q$=124,iy=125,It={};It[0]="\\0";It[7]="\\a";It[8]="\\b";It[9]="\\t";It[10]="\\n";It[11]="\\v";It[12]="\\f";It[13]="\\r";It[27]="\\e";It[34]='\\"';It[92]="\\\\";It[133]="\\N";It[160]="\\_";It[8232]="\\L";It[8233]="\\P";var U$=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],V$=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function sy(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&&Jx.call(l.styleAliases,o)&&(o=l.styleAliases[o]),r[a]=o;return r}x(sy,"compileStyleMap");function ay(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 Vt("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+ft.repeat("0",n-t.length)+t}x(ay,"encodeHex");var G$=1,Ms=2;function oy(e){this.schema=e.schema||Mx,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=ft.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=sy(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==='"'?Ms:G$,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(oy,"State");function Vc(e,t){for(var r=ft.repeat(" ",t),n=0,i=-1,s="",a,o=e.length;n<o;)i=e.indexOf(`
|
|
230
|
-
`,n),i===-1?(a=e.slice(n),n=o):(a=e.slice(n,i+1),n=i+1),a.length&&a!==`
|
|
231
|
-
`&&(s+=r),s+=a;return s}x(Vc,"indentString");function mo(e,t){return`
|
|
232
|
-
`+ft.repeat(" ",e.indent*t)}x(mo,"generateNextLine");function ly(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(ly,"testImplicitResolving");function Ns(e){return e===L$||e===M$}x(Ns,"isWhitespace");function wi(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==wh||65536<=e&&e<=1114111}x(wi,"isPrintable");function Gc(e){return wi(e)&&e!==wh&&e!==N$&&e!==As}x(Gc,"isNsCharOrWhitespace");function Yc(e,t,r){var n=Gc(e),i=n&&!Ns(e);return(r?n:n&&e!==ey&&e!==ty&&e!==ry&&e!==ny&&e!==iy)&&e!==Uc&&!(t===go&&!i)||Gc(t)&&!Ns(t)&&e===Uc||t===go&&i}x(Yc,"isPlainSafe");function cy(e){return wi(e)&&e!==wh&&!Ns(e)&&e!==R$&&e!==z$&&e!==go&&e!==ey&&e!==ty&&e!==ry&&e!==ny&&e!==iy&&e!==Uc&&e!==B$&&e!==P$&&e!==I$&&e!==q$&&e!==F$&&e!==O$&&e!==D$&&e!==$$&&e!==j$&&e!==W$&&e!==H$}x(cy,"isPlainSafeFirst");function uy(e){return!Ns(e)&&e!==go}x(uy,"isPlainSafeLast");function ei(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(ei,"codePointAt");function vh(e){var t=/^\n* /;return t.test(e)}x(vh,"needIndentIndicator");var hy=1,Xc=2,dy=3,fy=4,Zn=5;function py(e,t,r,n,i,s,a,o){var l,c=0,u=null,h=!1,d=!1,f=n!==-1,g=-1,m=cy(ei(e,0))&&uy(ei(e,e.length-1));if(t||a)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=ei(e,l),!wi(c))return Zn;m=m&&Yc(c,u,o),u=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=ei(e,l),c===As)h=!0,f&&(d=d||l-g-1>n&&e[g+1]!==" ",g=l);else if(!wi(c))return Zn;m=m&&Yc(c,u,o),u=c}d=d||f&&l-g-1>n&&e[g+1]!==" "}return!h&&!d?m&&!a&&!i(e)?hy:s===Ms?Zn:Xc:r>9&&vh(e)?Zn:a?s===Ms?Zn:Xc:d?fy:dy}x(py,"chooseScalarStyle");function gy(e,t,r,n,i){e.dump=(function(){if(t.length===0)return e.quotingType===Ms?'""':"''";if(!e.noCompatMode&&(U$.indexOf(t)!==-1||V$.test(t)))return e.quotingType===Ms?'"'+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 ly(e,c)}switch(x(l,"testAmbiguity"),py(t,o,e.indent,a,l,e.quotingType,e.forceQuotes&&!n,i)){case hy:return t;case Xc:return"'"+t.replace(/'/g,"''")+"'";case dy:return"|"+Kc(t,e.indent)+Qc(Vc(t,s));case fy:return">"+Kc(t,e.indent)+Qc(Vc(my(t,a),s));case Zn:return'"'+xy(t)+'"';default:throw new Vt("impossible error: invalid scalar style")}})()}x(gy,"writeScalar");function Kc(e,t){var r=vh(e)?String(t):"",n=e[e.length-1]===`
|
|
233
|
-
`,i=n&&(e[e.length-2]===`
|
|
234
|
-
`||e===`
|
|
235
|
-
`),s=i?"+":n?"":"-";return r+s+`
|
|
236
|
-
`}x(Kc,"blockHeader");function Qc(e){return e[e.length-1]===`
|
|
237
|
-
`?e.slice(0,-1):e}x(Qc,"dropEndingNewline");function my(e,t){for(var r=/(\n+)([^\n]*)/g,n=(function(){var c=e.indexOf(`
|
|
238
|
-
`);return c=c!==-1?c:e.length,r.lastIndex=c,Zc(e.slice(0,c),t)})(),i=e[0]===`
|
|
239
|
-
`||e[0]===" ",s,a;a=r.exec(e);){var o=a[1],l=a[2];s=l[0]===" ",n+=o+(!i&&!s&&l!==""?`
|
|
240
|
-
`:"")+Zc(l,t),i=s}return n}x(my,"foldString");function Zc(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+=`
|
|
241
|
-
`+e.slice(i,s),i=s+1),a=o;return l+=`
|
|
242
|
-
`,e.length-i>t&&a>i?l+=e.slice(i,a)+`
|
|
243
|
-
`+e.slice(a+1):l+=e.slice(i),l.slice(1)}x(Zc,"foldLine");function xy(e){for(var t="",r=0,n,i=0;i<e.length;r>=65536?i+=2:i++)r=ei(e,i),n=It[r],!n&&wi(r)?(t+=e[i],r>=65536&&(t+=e[i+1])):t+=n||ay(r);return t}x(xy,"escapeString");function yy(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)),(_r(e,t,o,!1,!1)||typeof o>"u"&&_r(e,t,null,!1,!1))&&(n!==""&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=i,e.dump="["+n+"]"}x(yy,"writeFlowSequence");function Jc(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)),(_r(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&_r(e,t+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=mo(e,t)),e.dump&&As===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=s,e.dump=i||"[]"}x(Jc,"writeBlockSequence");function by(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)),_r(e,t,l,!1,!1)&&(e.dump.length>1024&&(u+="? "),u+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),_r(e,t,c,!1,!1)&&(u+=e.dump,n+=u));e.tag=i,e.dump="{"+n+"}"}x(by,"writeFlowMapping");function ky(e,t,r,n){var i="",s=e.tag,a=Object.keys(r),o,l,c,u,h,d;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new Vt("sortKeys must be a boolean or a function");for(o=0,l=a.length;o<l;o+=1)d="",(!n||i!=="")&&(d+=mo(e,t)),c=a[o],u=r[c],e.replacer&&(u=e.replacer.call(r,c,u)),_r(e,t+1,c,!0,!0,!0)&&(h=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,h&&(e.dump&&As===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,h&&(d+=mo(e,t)),_r(e,t+1,u,!0,h)&&(e.dump&&As===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,i+=d));e.tag=s,e.dump=i||"{}"}x(ky,"writeBlockMapping");function eu(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,Zx.call(o.represent)==="[object Function]")n=o.represent(t,l);else if(Jx.call(o.represent,l))n=o.represent[l](t,l);else throw new Vt("!<"+o.tag+'> tag resolver accepts not "'+l+'" style');e.dump=n}return!0}return!1}x(eu,"detectType");function _r(e,t,r,n,i,s,a){e.tag=null,e.dump=r,eu(e,r,!1)||eu(e,r,!0);var o=Zx.call(e.dump),l=n,c;n&&(n=e.flowLevel<0||e.flowLevel>t);var u=o==="[object Object]"||o==="[object Array]",h,d;if(u&&(h=e.duplicates.indexOf(r),d=h!==-1),(e.tag!==null&&e.tag!=="?"||d||e.indent!==2&&t>0)&&(i=!1),d&&e.usedDuplicates[h])e.dump="*ref_"+h;else{if(u&&d&&!e.usedDuplicates[h]&&(e.usedDuplicates[h]=!0),o==="[object Object]")n&&Object.keys(e.dump).length!==0?(ky(e,t,e.dump,i),d&&(e.dump="&ref_"+h+e.dump)):(by(e,t,e.dump),d&&(e.dump="&ref_"+h+" "+e.dump));else if(o==="[object Array]")n&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?Jc(e,t-1,e.dump,i):Jc(e,t,e.dump,i),d&&(e.dump="&ref_"+h+e.dump)):(yy(e,t,e.dump),d&&(e.dump="&ref_"+h+" "+e.dump));else if(o==="[object String]")e.tag!=="?"&&gy(e,e.dump,t,s,l);else{if(o==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Vt("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(_r,"writeNode");function wy(e,t){var r=[],n=[],i,s;for(xo(e,r,n),i=0,s=n.length;i<s;i+=1)t.duplicates.push(r[n[i]]);t.usedDuplicates=new Array(s)}x(wy,"getDuplicateReferences");function xo(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)xo(e[i],t,r);else for(n=Object.keys(e),i=0,s=n.length;i<s;i+=1)xo(e[n[i]],t,r)}x(xo,"inspectNode");function Y$(e,t){t=t||{};var r=new oy(t);r.noRefs||wy(e,r);var n=e;return r.replacer&&(n=r.replacer.call({"":n},"",n)),_r(r,0,n,!0,!0)?r.dump+`
|
|
244
|
-
`:""}x(Y$,"dump$1");function X$(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(X$,"renamed");var K$=dx,Q$=A$.load;/*! Bundled license information:
|
|
245
|
-
|
|
246
|
-
js-yaml/dist/js-yaml.mjs:
|
|
247
|
-
(*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *)
|
|
248
|
-
*/var Tt={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4},Uf={arrow_point:9,arrow_cross:12.5,arrow_circle:12.5};function is(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=Xe(e),t=Xe(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(is,"calculateDeltaAndAngle");var Xe=x(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),Z$=x(e=>({x:x(function(t,r,n){let i=0;const s=Xe(n[0]).x<Xe(n[n.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(Tt,e.arrowTypeStart)){const{angle:f,deltaX:g}=is(n[0],n[1]);i=Tt[e.arrowTypeStart]*Math.cos(f)*(g>=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Tt,e.arrowTypeEnd)){const{angle:f,deltaX:g}=is(n[n.length-1],n[n.length-2]);i=Tt[e.arrowTypeEnd]*Math.cos(f)*(g>=0?1:-1)}const a=Math.abs(Xe(t).x-Xe(n[n.length-1]).x),o=Math.abs(Xe(t).y-Xe(n[n.length-1]).y),l=Math.abs(Xe(t).x-Xe(n[0]).x),c=Math.abs(Xe(t).y-Xe(n[0]).y),u=Tt[e.arrowTypeStart],h=Tt[e.arrowTypeEnd],d=1;if(a<h&&a>0&&o<h){let f=h+d-a;f*=s==="right"?-1:1,i-=f}if(l<u&&l>0&&c<u){let f=u+d-l;f*=s==="right"?-1:1,i+=f}return Xe(t).x+i},"x"),y:x(function(t,r,n){let i=0;const s=Xe(n[0]).y<Xe(n[n.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(Tt,e.arrowTypeStart)){const{angle:f,deltaY:g}=is(n[0],n[1]);i=Tt[e.arrowTypeStart]*Math.abs(Math.sin(f))*(g>=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Tt,e.arrowTypeEnd)){const{angle:f,deltaY:g}=is(n[n.length-1],n[n.length-2]);i=Tt[e.arrowTypeEnd]*Math.abs(Math.sin(f))*(g>=0?1:-1)}const a=Math.abs(Xe(t).y-Xe(n[n.length-1]).y),o=Math.abs(Xe(t).x-Xe(n[n.length-1]).x),l=Math.abs(Xe(t).y-Xe(n[0]).y),c=Math.abs(Xe(t).x-Xe(n[0]).x),u=Tt[e.arrowTypeStart],h=Tt[e.arrowTypeEnd],d=1;if(a<h&&a>0&&o<h){let f=h+d-a;f*=s==="up"?-1:1,i-=f}if(l<u&&l>0&&c<u){let f=u+d-l;f*=s==="up"?-1:1,i+=f}return Xe(t).y+i},"y")}),"getLineFunctionsWithOffset"),Ch=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"),J$=x(e=>{const{handDrawnSeed:t}=Re();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),Ei=x(e=>{const t=ej([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),ej=x(e=>{const t=new Map;return e.forEach(r=>{const[n,i]=r.split(":");t.set(n.trim(),i?.trim())}),t},"styles2Map"),vy=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}=Ei(e),r=[],n=[],i=[],s=[];return t.forEach(a=>{const o=a[0];vy(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}=Re(),{nodeBorder:i,mainBkg:s}=r,{stylesMap:a}=Ei(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:tj(a.get("stroke-dasharray"))},t)},"userNodeOverrides"),tj=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"),Gi={},ht={},Vf;function rj(){return Vf||(Vf=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.BLANK_URL=ht.relativeFirstCharacters=ht.whitespaceEscapeCharsRegex=ht.urlSchemeRegex=ht.ctrlCharactersRegex=ht.htmlCtrlEntityRegex=ht.htmlEntitiesRegex=ht.invalidProtocolRegex=void 0,ht.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,ht.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,ht.htmlCtrlEntityRegex=/&(newline|tab);/gi,ht.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,ht.urlSchemeRegex=/^.+(:|:)/gim,ht.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,ht.relativeFirstCharacters=[".","/"],ht.BLANK_URL="about:blank"),ht}var Gf;function nj(){if(Gf)return Gi;Gf=1,Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.sanitizeUrl=void 0;var e=rj();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 d=h[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(d))return e.BLANK_URL;var f=u.replace(/\\/g,"/");if(d==="mailto:"||d.includes("://"))return f;if(d==="http:"||d==="https:"){if(!n(f))return e.BLANK_URL;var g=new URL(f);return g.protocol=g.protocol.toLowerCase(),g.hostname=g.hostname.toLowerCase(),g.toString()}return f}return Gi.sanitizeUrl=s,Gi}var ij=nj(),Cy=typeof global=="object"&&global&&global.Object===Object&&global,sj=typeof self=="object"&&self&&self.Object===Object&&self,Ar=Cy||sj||Function("return this")(),yo=Ar.Symbol,Sy=Object.prototype,aj=Sy.hasOwnProperty,oj=Sy.toString,Yi=yo?yo.toStringTag:void 0;function lj(e){var t=aj.call(e,Yi),r=e[Yi];try{e[Yi]=void 0;var n=!0}catch{}var i=oj.call(e);return n&&(t?e[Yi]=r:delete e[Yi]),i}var cj=Object.prototype,uj=cj.toString;function hj(e){return uj.call(e)}var dj="[object Null]",fj="[object Undefined]",Yf=yo?yo.toStringTag:void 0;function Ai(e){return e==null?e===void 0?fj:dj:Yf&&Yf in Object(e)?lj(e):hj(e)}function Pn(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var pj="[object AsyncFunction]",gj="[object Function]",mj="[object GeneratorFunction]",xj="[object Proxy]";function Sh(e){if(!Pn(e))return!1;var t=Ai(e);return t==gj||t==mj||t==pj||t==xj}var Gl=Ar["__core-js_shared__"],Xf=(function(){var e=/[^.]+$/.exec(Gl&&Gl.keys&&Gl.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function yj(e){return!!Xf&&Xf in e}var bj=Function.prototype,kj=bj.toString;function Rn(e){if(e!=null){try{return kj.call(e)}catch{}try{return e+""}catch{}}return""}var wj=/[\\^$.*+?()[\]{}|]/g,vj=/^\[object .+?Constructor\]$/,Cj=Function.prototype,Sj=Object.prototype,_j=Cj.toString,Tj=Sj.hasOwnProperty,Ej=RegExp("^"+_j.call(Tj).replace(wj,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Aj(e){if(!Pn(e)||yj(e))return!1;var t=Sh(e)?Ej:vj;return t.test(Rn(e))}function Mj(e,t){return e?.[t]}function Fn(e,t){var r=Mj(e,t);return Aj(r)?r:void 0}var Ls=Fn(Object,"create");function Nj(){this.__data__=Ls?Ls(null):{},this.size=0}function Lj(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ij="__lodash_hash_undefined__",$j=Object.prototype,jj=$j.hasOwnProperty;function Bj(e){var t=this.__data__;if(Ls){var r=t[e];return r===Ij?void 0:r}return jj.call(t,e)?t[e]:void 0}var Dj=Object.prototype,Pj=Dj.hasOwnProperty;function Rj(e){var t=this.__data__;return Ls?t[e]!==void 0:Pj.call(t,e)}var Fj="__lodash_hash_undefined__";function Oj(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Ls&&t===void 0?Fj:t,this}function $n(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])}}$n.prototype.clear=Nj;$n.prototype.delete=Lj;$n.prototype.get=Bj;$n.prototype.has=Rj;$n.prototype.set=Oj;function zj(){this.__data__=[],this.size=0}function Qo(e,t){return e===t||e!==e&&t!==t}function Zo(e,t){for(var r=e.length;r--;)if(Qo(e[r][0],t))return r;return-1}var Wj=Array.prototype,Hj=Wj.splice;function qj(e){var t=this.__data__,r=Zo(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Hj.call(t,r,1),--this.size,!0}function Uj(e){var t=this.__data__,r=Zo(t,e);return r<0?void 0:t[r][1]}function Vj(e){return Zo(this.__data__,e)>-1}function Gj(e,t){var r=this.__data__,n=Zo(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function Gr(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])}}Gr.prototype.clear=zj;Gr.prototype.delete=qj;Gr.prototype.get=Uj;Gr.prototype.has=Vj;Gr.prototype.set=Gj;var Is=Fn(Ar,"Map");function Yj(){this.size=0,this.__data__={hash:new $n,map:new(Is||Gr),string:new $n}}function Xj(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Jo(e,t){var r=e.__data__;return Xj(t)?r[typeof t=="string"?"string":"hash"]:r.map}function Kj(e){var t=Jo(this,e).delete(e);return this.size-=t?1:0,t}function Qj(e){return Jo(this,e).get(e)}function Zj(e){return Jo(this,e).has(e)}function Jj(e,t){var r=Jo(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=Yj;on.prototype.delete=Kj;on.prototype.get=Qj;on.prototype.has=Zj;on.prototype.set=Jj;var eB="Expected a function";function Vs(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(eB);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(Vs.Cache||on),r}Vs.Cache=on;function tB(){this.__data__=new Gr,this.size=0}function rB(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function nB(e){return this.__data__.get(e)}function iB(e){return this.__data__.has(e)}var sB=200;function aB(e,t){var r=this.__data__;if(r instanceof Gr){var n=r.__data__;if(!Is||n.length<sB-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 Mi(e){var t=this.__data__=new Gr(e);this.size=t.size}Mi.prototype.clear=tB;Mi.prototype.delete=rB;Mi.prototype.get=nB;Mi.prototype.has=iB;Mi.prototype.set=aB;var bo=(function(){try{var e=Fn(Object,"defineProperty");return e({},"",{}),e}catch{}})();function _h(e,t,r){t=="__proto__"&&bo?bo(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function tu(e,t,r){(r!==void 0&&!Qo(e[t],r)||r===void 0&&!(t in e))&&_h(e,t,r)}function oB(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 lB=oB(),_y=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Kf=_y&&typeof module=="object"&&module&&!module.nodeType&&module,cB=Kf&&Kf.exports===_y,Qf=cB?Ar.Buffer:void 0,Zf=Qf?Qf.allocUnsafe:void 0;function uB(e,t){if(t)return e.slice();var r=e.length,n=Zf?Zf(r):new e.constructor(r);return e.copy(n),n}var Jf=Ar.Uint8Array;function hB(e){var t=new e.constructor(e.byteLength);return new Jf(t).set(new Jf(e)),t}function dB(e,t){var r=t?hB(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function fB(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var ep=Object.create,pB=(function(){function e(){}return function(t){if(!Pn(t))return{};if(ep)return ep(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}})();function Ty(e,t){return function(r){return e(t(r))}}var Ey=Ty(Object.getPrototypeOf,Object),gB=Object.prototype;function el(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||gB;return e===r}function mB(e){return typeof e.constructor=="function"&&!el(e)?pB(Ey(e)):{}}function Gs(e){return e!=null&&typeof e=="object"}var xB="[object Arguments]";function tp(e){return Gs(e)&&Ai(e)==xB}var Ay=Object.prototype,yB=Ay.hasOwnProperty,bB=Ay.propertyIsEnumerable,ko=tp((function(){return arguments})())?tp:function(e){return Gs(e)&&yB.call(e,"callee")&&!bB.call(e,"callee")},wo=Array.isArray,kB=9007199254740991;function My(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=kB}function tl(e){return e!=null&&My(e.length)&&!Sh(e)}function wB(e){return Gs(e)&&tl(e)}function vB(){return!1}var Ny=typeof exports=="object"&&exports&&!exports.nodeType&&exports,rp=Ny&&typeof module=="object"&&module&&!module.nodeType&&module,CB=rp&&rp.exports===Ny,np=CB?Ar.Buffer:void 0,SB=np?np.isBuffer:void 0,Th=SB||vB,_B="[object Object]",TB=Function.prototype,EB=Object.prototype,Ly=TB.toString,AB=EB.hasOwnProperty,MB=Ly.call(Object);function NB(e){if(!Gs(e)||Ai(e)!=_B)return!1;var t=Ey(e);if(t===null)return!0;var r=AB.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Ly.call(r)==MB}var LB="[object Arguments]",IB="[object Array]",$B="[object Boolean]",jB="[object Date]",BB="[object Error]",DB="[object Function]",PB="[object Map]",RB="[object Number]",FB="[object Object]",OB="[object RegExp]",zB="[object Set]",WB="[object String]",HB="[object WeakMap]",qB="[object ArrayBuffer]",UB="[object DataView]",VB="[object Float32Array]",GB="[object Float64Array]",YB="[object Int8Array]",XB="[object Int16Array]",KB="[object Int32Array]",QB="[object Uint8Array]",ZB="[object Uint8ClampedArray]",JB="[object Uint16Array]",eD="[object Uint32Array]",Ye={};Ye[VB]=Ye[GB]=Ye[YB]=Ye[XB]=Ye[KB]=Ye[QB]=Ye[ZB]=Ye[JB]=Ye[eD]=!0;Ye[LB]=Ye[IB]=Ye[qB]=Ye[$B]=Ye[UB]=Ye[jB]=Ye[BB]=Ye[DB]=Ye[PB]=Ye[RB]=Ye[FB]=Ye[OB]=Ye[zB]=Ye[WB]=Ye[HB]=!1;function tD(e){return Gs(e)&&My(e.length)&&!!Ye[Ai(e)]}function rD(e){return function(t){return e(t)}}var Iy=typeof exports=="object"&&exports&&!exports.nodeType&&exports,xs=Iy&&typeof module=="object"&&module&&!module.nodeType&&module,nD=xs&&xs.exports===Iy,Yl=nD&&Cy.process,ip=(function(){try{var e=xs&&xs.require&&xs.require("util").types;return e||Yl&&Yl.binding&&Yl.binding("util")}catch{}})(),sp=ip&&ip.isTypedArray,Eh=sp?rD(sp):tD;function ru(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var iD=Object.prototype,sD=iD.hasOwnProperty;function aD(e,t,r){var n=e[t];(!(sD.call(e,t)&&Qo(n,r))||r===void 0&&!(t in e))&&_h(e,t,r)}function oD(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?_h(r,o,l):aD(r,o,l)}return r}function lD(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var cD=9007199254740991,uD=/^(?:0|[1-9]\d*)$/;function $y(e,t){var r=typeof e;return t=t??cD,!!t&&(r=="number"||r!="symbol"&&uD.test(e))&&e>-1&&e%1==0&&e<t}var hD=Object.prototype,dD=hD.hasOwnProperty;function fD(e,t){var r=wo(e),n=!r&&ko(e),i=!r&&!n&&Th(e),s=!r&&!n&&!i&&Eh(e),a=r||n||i||s,o=a?lD(e.length,String):[],l=o.length;for(var c in e)(t||dD.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||$y(c,l)))&&o.push(c);return o}function pD(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var gD=Object.prototype,mD=gD.hasOwnProperty;function xD(e){if(!Pn(e))return pD(e);var t=el(e),r=[];for(var n in e)n=="constructor"&&(t||!mD.call(e,n))||r.push(n);return r}function jy(e){return tl(e)?fD(e,!0):xD(e)}function yD(e){return oD(e,jy(e))}function bD(e,t,r,n,i,s,a){var o=ru(e,r),l=ru(t,r),c=a.get(l);if(c){tu(e,r,c);return}var u=s?s(o,l,r+"",e,t,a):void 0,h=u===void 0;if(h){var d=wo(l),f=!d&&Th(l),g=!d&&!f&&Eh(l);u=l,d||f||g?wo(o)?u=o:wB(o)?u=fB(o):f?(h=!1,u=uB(l,!0)):g?(h=!1,u=dB(l,!0)):u=[]:NB(l)||ko(l)?(u=o,ko(o)?u=yD(o):(!Pn(o)||Sh(o))&&(u=mB(l))):h=!1}h&&(a.set(l,u),i(u,l,n,s,a),a.delete(l)),tu(e,r,u)}function By(e,t,r,n,i){e!==t&&lB(t,function(s,a){if(i||(i=new Mi),Pn(s))bD(e,t,a,r,By,n,i);else{var o=n?n(ru(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),tu(e,a,o)}},jy)}function Dy(e){return e}function kD(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 ap=Math.max;function wD(e,t,r){return t=ap(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,s=ap(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),kD(e,this,o)}}function vD(e){return function(){return e}}var CD=bo?function(e,t){return bo(e,"toString",{configurable:!0,enumerable:!1,value:vD(t),writable:!0})}:Dy,SD=800,_D=16,TD=Date.now;function ED(e){var t=0,r=0;return function(){var n=TD(),i=_D-(n-r);if(r=n,i>0){if(++t>=SD)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var AD=ED(CD);function MD(e,t){return AD(wD(e,t,Dy),e+"")}function ND(e,t,r){if(!Pn(r))return!1;var n=typeof t;return(n=="number"?tl(r)&&$y(t,r.length):n=="string"&&t in r)?Qo(r[t],e):!1}function LD(e){return MD(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&&ND(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 ID=LD(function(e,t,r){By(e,t,r)}),$D="",jD={curveBasis:Da,curveBasisClosed:DI,curveBasisOpen:PI,curveBumpX:w0,curveBumpY:v0,curveBundle:RI,curveCardinalClosed:FI,curveCardinalOpen:OI,curveCardinal:T0,curveCatmullRomClosed:zI,curveCatmullRomOpen:WI,curveCatmullRom:A0,curveLinear:oo,curveLinearClosed:HI,curveMonotoneX:j0,curveMonotoneY:B0,curveNatural:P0,curveStep:R0,curveStepAfter:O0,curveStepBefore:F0},BD=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,DD=x(function(e,t){const r=Py(e,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const a=r.map(o=>o.args);Ka(a),n=dt(n,[...a])}else n=r.args;if(!n)return;let i=Qu(e,t);const s="config";return n[s]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[s],delete n[s]),n},"detectInit"),Py=x(function(e,t=null){try{const r=new RegExp(`[%]{2}(?![{]${BD.source})(?=[}][%]{2}).*
|
|
249
|
-
`,"ig");e=e.trim().replace(r,"").replace(/'/gm,'"'),K.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let n;const i=[];for(;(n=gs.exec(e))!==null;)if(n.index===gs.lastIndex&&gs.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 K.error(`ERROR: ${r.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),PD=x(function(e){return e.replace(gs,"")},"removeDirectives"),RD=x(function(e,t){for(const[r,n]of t.entries())if(n.match(e))return r;return-1},"isSubstringInArray");function Ah(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return jD[r]??t}x(Ah,"interpolateToCurve");function Ry(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?ij.sanitizeUrl(r):r}x(Ry,"formatUrl");var FD=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){K.error(`Function name: ${e} not found in window`);return}s[i](...t)},"runFunc");function Mh(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}x(Mh,"distance");function Fy(e){let t,r=0;e.forEach(i=>{r+=Mh(i,t),t=i});const n=r/2;return Nh(e,n)}x(Fy,"traverseEdge");function Oy(e){return e.length===1?e[0]:Fy(e)}x(Oy,"calcLabelPosition");var op=x((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),Nh=x((e,t)=>{let r,n=t;for(const i of e){if(r){const s=Mh(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:op((1-a)*r.x+a*i.x,5),y:op((1-a)*r.y+a*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),OD=x((e,t,r)=>{K.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const i=Nh(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 zy(e,t,r){const n=structuredClone(r);K.info("our points",n),t!=="start_left"&&t!=="start_right"&&n.reverse();const i=25+e,s=Nh(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(zy,"calcTerminalLabelPosition");function Wy(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(Wy,"getStylesFromArray");var lp=0,zD=x(()=>(lp++,"id-"+Math.random().toString(36).substr(2,12)+"-"+lp),"generateId");function Hy(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(Hy,"makeRandomHex");var WD=x(e=>Hy(e.length),"random"),HD=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"),qD=x(function(e,t){const r=t.text.replace(Ti.lineBreakRegex," "),[,n]=rl(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"),UD=Vs((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),Ti.lineBreakRegex.test(e)))return e;const n=e.split(" ").filter(Boolean),i=[];let s="";return n.forEach((a,o)=>{const l=qr(`${a} `,r),c=qr(s,r);if(l>t){const{hyphenatedStrings:d,remainingWord:f}=VD(a,t,"-",r);i.push(s,...d),s=f}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}`),VD=Vs((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(qr(c,n)>=t){const h=l+1,d=i.length===h,f=`${c}${r}`;s.push(d?c:f),a=""}else a=c}),{hyphenatedStrings:s,remainingWord:a}},(e,t,r="-",n)=>`${e}${t}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);function qy(e,t){return Lh(e,t).height}x(qy,"calculateTextHeight");function qr(e,t){return Lh(e,t).width}x(qr,"calculateTextWidth");var Lh=Vs((e,t)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=t;if(!e)return{width:0,height:0};const[,s]=rl(r),a=["sans-serif",n],o=e.split(Ti.lineBreakRegex),l=[],c=$e("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const u=c.append("svg");for(const d of a){let f=0;const g={width:0,height:0,lineHeight:0};for(const m of o){const b=HD();b.text=m||$D;const y=qD(u,b).style("font-size",s).style("font-weight",i).style("font-family",d),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)),f=Math.round(k.height),g.height+=f,g.lineHeight=Math.round(Math.max(g.lineHeight,f))}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}`),di,GD=(di=class{constructor(t=!1,r){this.count=0,this.count=r?r.length:0,this.next=t?()=>this.count++:()=>Date.now()}},x(di,"InitIDGenerator"),di),ma,YD=x(function(e){return ma=ma||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),ma.innerHTML=e,unescape(ma.textContent)},"entityDecode");function Ih(e){return"str"in e}x(Ih,"isDetailedError");var XD=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"),rl=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 $h(e,t){return ID({},e,t)}x($h,"cleanAndMerge");var hr={assignWithDepth:dt,wrapLabel:UD,calculateTextHeight:qy,calculateTextWidth:qr,calculateTextDimensions:Lh,cleanAndMerge:$h,detectInit:DD,detectDirective:Py,isSubstringInArray:RD,interpolateToCurve:Ah,calcLabelPosition:Oy,calcCardinalityPosition:OD,calcTerminalLabelPosition:zy,formatUrl:Ry,getStylesFromArray:Wy,generateId:zD,random:WD,runFunc:FD,entityDecode:YD,insertTitle:XD,isLabelCoordinateInPath:Uy,parseFontSize:rl,InitIDGenerator:GD},KD=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"),On=x(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),E6=x((e,t,{counter:r=0,prefix:n,suffix:i},s)=>s||`${n?`${n}_`:""}${e}_${t}_${r}${i?`_${i}`:""}`,"getEdgeId");function Nt(e){return e??null}x(Nt,"handleUndefinedAttr");function Uy(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(Uy,"isLabelCoordinateInPath");const QD=Object.freeze({left:0,top:0,width:16,height:16}),vo=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Vy=Object.freeze({...QD,...vo}),ZD=Object.freeze({...Vy,body:"",hidden:!1}),JD=Object.freeze({width:null,height:null}),e3=Object.freeze({...JD,...vo}),t3=(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 Xl(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 Xl(o)?o:null}if(r&&n===""){const o={provider:n,prefix:"",name:s};return Xl(o,r)?o:null}return null},Xl=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function r3(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 cp(e,t){const r=r3(e,t);for(const n in ZD)n in vo?n in e&&!(n in r)&&(r[n]=vo[n]):n in t?r[n]=t[n]:n in e&&(r[n]=e[n]);return r}function n3(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 up(e,t,r){const n=e.icons,i=e.aliases||Object.create(null);let s={};function a(o){s=cp(n[o]||i[o],s)}return a(t),r.forEach(a),cp(e,s)}function i3(e,t){if(e.icons[t])return up(e,t,[]);const r=n3(e,[t])[t];return r?up(e,t,r):null}const s3=/(-?[0-9.]*[0-9]+[0-9.]*)/g,a3=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function hp(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(s3);if(n===null||!n.length)return e;const i=[];let s=n.shift(),a=a3.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 o3(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 l3(e,t){return e?"<defs>"+e+"</defs>"+t:t}function c3(e,t,r){const n=o3(e);return l3(n.defs,t+n.content+r)}const u3=e=>e==="unset"||e==="undefined"||e==="none";function h3(e,t){const r={...Vy,...e},n={...e3,...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 S;switch(v<0&&(v-=Math.floor(v/4)*4),v=v%4,v){case 1:S=i.height/2+i.top,b.unshift("rotate(90 "+S.toString()+" "+S.toString()+")");break;case 2:b.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:S=i.width/2+i.left,b.unshift("rotate(-90 "+S.toString()+" "+S.toString()+")");break}v%2===1&&(i.left!==i.top&&(S=i.left,i.left=i.top,i.top=S),i.width!==i.height&&(S=i.width,i.width=i.height,i.height=S)),b.length&&(s=c3(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=hp(h,l/c)):(u=a==="auto"?l:a,h=o===null?hp(u,c/l):o==="auto"?c:o);const d={},f=(m,b)=>{u3(b)||(d[m]=b.toString())};f("width",u),f("height",h);const g=[i.left,i.top,l,c];return d.viewBox=g.join(" "),{attributes:d,viewBox:g,body:s}}const d3=/\sid="(\S+)"/g,f3="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let p3=0;function g3(e,t=f3){const r=[];let n;for(;n=d3.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+(p3++).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 m3(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 jh(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var zn=jh();function Gy(e){zn=e}var ys={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(Ft.caret,"$1"),r=r.replace(i,a),n},getRegex:()=>new RegExp(r,t)};return n}var Ft={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")},x3=/^(?:[ \t]*(?:\n|$))+/,y3=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,b3=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ys=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,k3=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Bh=/(?:[*+-]|\d{1,9}[.)])/,Yy=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Xy=De(Yy).replace(/bull/g,Bh).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(),w3=De(Yy).replace(/bull/g,Bh).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(),Dh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,v3=/^[^\n]+/,Ph=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,C3=De(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ph).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),S3=De(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Bh).getRegex(),nl="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",Rh=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,_3=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",Rh).replace("tag",nl).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ky=De(Dh).replace("hr",Ys).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",nl).getRegex(),T3=De(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ky).getRegex(),Fh={blockquote:T3,code:y3,def:C3,fences:b3,heading:k3,hr:Ys,html:_3,lheading:Xy,list:S3,newline:x3,paragraph:Ky,table:ys,text:v3},dp=De("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ys).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",nl).getRegex(),E3={...Fh,lheading:w3,table:dp,paragraph:De(Dh).replace("hr",Ys).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",dp).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",nl).getRegex()},A3={...Fh,html:De(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Rh).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:ys,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:De(Dh).replace("hr",Ys).replace("heading",` *#{1,6} *[^
|
|
250
|
-
]`).replace("lheading",Xy).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},M3=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,N3=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Qy=/^( {2,}|\\)\n(?!\s*$)/,L3=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,il=/[\p{P}\p{S}]/u,Oh=/[\s\p{P}\p{S}]/u,Zy=/[^\s\p{P}\p{S}]/u,I3=De(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Oh).getRegex(),Jy=/(?!~)[\p{P}\p{S}]/u,$3=/(?!~)[\s\p{P}\p{S}]/u,j3=/(?:[^\s\p{P}\p{S}]|~)/u,B3=/\[(?:[^\[\]`]|`[^`]*?`)*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,eb=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,D3=De(eb,"u").replace(/punct/g,il).getRegex(),P3=De(eb,"u").replace(/punct/g,Jy).getRegex(),tb="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",R3=De(tb,"gu").replace(/notPunctSpace/g,Zy).replace(/punctSpace/g,Oh).replace(/punct/g,il).getRegex(),F3=De(tb,"gu").replace(/notPunctSpace/g,j3).replace(/punctSpace/g,$3).replace(/punct/g,Jy).getRegex(),O3=De("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Zy).replace(/punctSpace/g,Oh).replace(/punct/g,il).getRegex(),z3=De(/\\(punct)/,"gu").replace(/punct/g,il).getRegex(),W3=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(),H3=De(Rh).replace("(?:-->|$)","-->").getRegex(),q3=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",H3).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Co=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,U3=De(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Co).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),rb=De(/^!?\[(label)\]\[(ref)\]/).replace("label",Co).replace("ref",Ph).getRegex(),nb=De(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ph).getRegex(),V3=De("reflink|nolink(?!\\()","g").replace("reflink",rb).replace("nolink",nb).getRegex(),fp=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,zh={_backpedal:ys,anyPunctuation:z3,autolink:W3,blockSkip:B3,br:Qy,code:N3,del:ys,emStrongLDelim:D3,emStrongRDelimAst:R3,emStrongRDelimUnd:O3,escape:M3,link:U3,nolink:nb,punctuation:I3,reflink:rb,reflinkSearch:V3,tag:q3,text:L3,url:ys},G3={...zh,link:De(/^!?\[(label)\]\((.*?)\)/).replace("label",Co).getRegex(),reflink:De(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Co).getRegex()},nu={...zh,emStrongRDelimAst:F3,emStrongLDelim:P3,url:De(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",fp).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",fp).getRegex()},Y3={...nu,br:De(Qy).replace("{2,}","*").getRegex(),text:De(nu.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},xa={normal:Fh,gfm:E3,pedantic:A3},Xi={normal:zh,gfm:nu,breaks:Y3,pedantic:G3},X3={"&":"&","<":"<",">":">",'"':""","'":"'"},pp=e=>X3[e];function yr(e,t){if(t){if(Ft.escapeTest.test(e))return e.replace(Ft.escapeReplace,pp)}else if(Ft.escapeTestNoEncode.test(e))return e.replace(Ft.escapeReplaceNoEncode,pp);return e}function gp(e){try{e=encodeURI(e).replace(Ft.percentDecode,"%")}catch{return null}return e}function mp(e,t){let r=e.replace(Ft.findPipe,(s,a,o)=>{let l=!1,c=a;for(;--c>=0&&o[c]==="\\";)l=!l;return l?"|":" |"}),n=r.split(Ft.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(Ft.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 K3(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 xp(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 Q3(e,t,r){let n=e.match(r.other.indentCodeCompensation);if(n===null)return t;let i=n[1];return t.split(`
|
|
251
|
-
`).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(`
|
|
252
|
-
`)}var So=class{options;rules;lexer;constructor(t){this.options=t||zn}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,`
|
|
253
|
-
`)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let n=r[0],i=Q3(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],`
|
|
254
|
-
`)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let n=Ki(r[0],`
|
|
255
|
-
`).split(`
|
|
256
|
-
`),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(`
|
|
257
|
-
`),h=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
258
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
|
|
259
|
-
${u}`:u,s=s?`${s}
|
|
260
|
-
${h}`:h;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,a,!0),this.lexer.state.top=d,n.length===0)break;let f=a.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){let g=f,m=g.raw+`
|
|
261
|
-
`+n.join(`
|
|
262
|
-
`),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(f?.type==="list"){let g=f,m=g.raw+`
|
|
263
|
-
`+n.join(`
|
|
264
|
-
`),b=this.list(m);a[a.length-1]=b,i=i.substring(0,i.length-f.raw.length)+b.raw,s=s.substring(0,s.length-g.raw.length)+b.raw,n=m.substring(a.at(-1).raw.length).split(`
|
|
265
|
-
`);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 d=r[2].split(`
|
|
266
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,k=>" ".repeat(3*k.length)),f=t.split(`
|
|
267
|
-
`,1)[0],g=!d.trim(),m=0;if(this.options.pedantic?(m=2,h=d.trimStart()):g?m=r[1].length+1:(m=r[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,h=d.slice(m),m+=r[1].length),g&&this.rules.other.blankLine.test(f)&&(u+=f+`
|
|
268
|
-
`,t=t.substring(f.length+1),c=!0),!c){let k=this.rules.other.nextBulletRegex(m),v=this.rules.other.hrRegex(m),S=this.rules.other.fencesBeginRegex(m),C=this.rules.other.headingBeginRegex(m),w=this.rules.other.htmlBeginRegex(m);for(;t;){let T=t.split(`
|
|
269
|
-
`,1)[0],I;if(f=T,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),I=f):I=f.replace(this.rules.other.tabCharGlobal," "),S.test(f)||C.test(f)||w.test(f)||k.test(f)||v.test(f))break;if(I.search(this.rules.other.nonSpaceChar)>=m||!f.trim())h+=`
|
|
270
|
-
`+I.slice(m);else{if(g||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(d)||C.test(d)||v.test(d))break;h+=`
|
|
271
|
-
`+f}!g&&!f.trim()&&(g=!0),u+=T+`
|
|
272
|
-
`,t=t.substring(T.length+1),d=I.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(d=>d.type==="space"),h=u.length>0&&u.some(d=>this.rules.other.anyLine.test(d.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=mp(r[1]),i=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
273
|
-
`):[],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(mp(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)===`
|
|
274
|
-
`?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=K3(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)),xp(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 xp(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,d=t.slice(0,s+i.index+h+o);if(Math.min(s,o)%2){let g=d.slice(1,-1);return{type:"em",raw:d,text:g,tokens:this.lexer.inlineTokens(g)}}let f=d.slice(2,-2);return{type:"strong",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}}}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}}}},lr=class iu{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||zn,this.options.tokenizer=this.options.tokenizer||new So,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:Ft,block:xa.normal,inline:Xi.normal};this.options.pedantic?(r.block=xa.pedantic,r.inline=Xi.pedantic):this.options.gfm&&(r.block=xa.gfm,this.options.breaks?r.inline=Xi.breaks:r.inline=Xi.gfm),this.tokenizer.rules=r}static get rules(){return{block:xa,inline:Xi}}static lex(t,r){return new iu(r).lex(t)}static lexInline(t,r){return new iu(r).inlineTokens(t)}lex(t){t=t.replace(Ft.carriageReturn,`
|
|
275
|
-
`),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(Ft.tabCharGlobal," ").replace(Ft.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+=`
|
|
276
|
-
`: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(`
|
|
277
|
-
`)?"":`
|
|
278
|
-
`)+i.raw,a.text+=`
|
|
279
|
-
`+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(`
|
|
280
|
-
`)?"":`
|
|
281
|
-
`)+i.raw,a.text+=`
|
|
282
|
-
`+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(`
|
|
283
|
-
`)?"":`
|
|
284
|
-
`)+i.raw,a.text+=`
|
|
285
|
-
`+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(`
|
|
286
|
-
`)?"":`
|
|
287
|
-
`)+i.raw,a.text+=`
|
|
288
|
-
`+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(d=>{h=d.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}},_o=class{options;parser;constructor(t){this.options=t||zn}space(t){return""}code({text:t,lang:r,escaped:n}){let i=(r||"").match(Ft.notSpaceStart)?.[0],s=t.replace(Ft.endingNewline,"")+`
|
|
289
|
-
`;return i?'<pre><code class="language-'+yr(i)+'">'+(n?s:yr(s,!0))+`</code></pre>
|
|
290
|
-
`:"<pre><code>"+(n?s:yr(s,!0))+`</code></pre>
|
|
291
|
-
`}blockquote({tokens:t}){return`<blockquote>
|
|
292
|
-
${this.parser.parse(t)}</blockquote>
|
|
293
|
-
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:r}){return`<h${r}>${this.parser.parseInline(t)}</h${r}>
|
|
294
|
-
`}hr(t){return`<hr>
|
|
295
|
-
`}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+`>
|
|
296
|
-
`+i+"</"+s+`>
|
|
297
|
-
`}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+" "+yr(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>
|
|
298
|
-
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
299
|
-
`}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>
|
|
300
|
-
<thead>
|
|
301
|
-
`+r+`</thead>
|
|
302
|
-
`+i+`</table>
|
|
303
|
-
`}tablerow({text:t}){return`<tr>
|
|
304
|
-
${t}</tr>
|
|
305
|
-
`}tablecell(t){let r=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+r+`</${n}>
|
|
306
|
-
`}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>${yr(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=gp(t);if(s===null)return i;t=s;let a='<a href="'+t+'"';return r&&(a+=' title="'+yr(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=gp(t);if(s===null)return yr(n);t=s;let a=`<img src="${t}" alt="${n}"`;return r&&(a+=` title="${yr(r)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:yr(t.text)}},Wh=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""}},cr=class su{options;renderer;textRenderer;constructor(t){this.options=t||zn,this.options.renderer=this.options.renderer||new _o,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Wh}static parse(t,r){return new su(r).parse(t)}static parseInline(t,r){return new su(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+=`
|
|
307
|
-
`+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}},ss=class{options;block;constructor(t){this.options=t||zn}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?lr.lex:lr.lexInline}provideParser(){return this.block?cr.parse:cr.parseInline}},Z3=class{defaults=jh();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=cr;Renderer=_o;TextRenderer=Wh;Lexer=lr;Tokenizer=So;Hooks=ss;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 _o(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 So(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 ss;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];ss.passThroughHooks.has(a)?s[o]=u=>{if(this.defaults.async&&ss.passThroughHooksRespectAsync.has(a))return(async()=>{let d=await l.call(s,u);return c.call(s,d)})();let h=l.call(s,u);return c.call(s,h)}:s[o]=(...u)=>{if(this.defaults.async)return(async()=>{let d=await l.apply(s,u);return d===!1&&(d=await c.apply(s,u)),d})();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 lr.lex(t,r??this.defaults)}parser(t,r){return cr.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?lr.lex:lr.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?cr.parse:cr.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?lr.lex:lr.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?cr.parse:cr.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+=`
|
|
308
|
-
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+yr(n.message+"",!0)+"</pre>";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},jn=new Z3;function Fe(e,t){return jn.parse(e,t)}Fe.options=Fe.setOptions=function(e){return jn.setOptions(e),Fe.defaults=jn.defaults,Gy(Fe.defaults),Fe};Fe.getDefaults=jh;Fe.defaults=zn;Fe.use=function(...e){return jn.use(...e),Fe.defaults=jn.defaults,Gy(Fe.defaults),Fe};Fe.walkTokens=function(e,t){return jn.walkTokens(e,t)};Fe.parseInline=jn.parseInline;Fe.Parser=cr;Fe.parser=cr.parse;Fe.Renderer=_o;Fe.TextRenderer=Wh;Fe.Lexer=lr;Fe.lexer=lr.lex;Fe.Tokenizer=So;Fe.Hooks=ss;Fe.parse=Fe;Fe.options;Fe.setOptions;Fe.use;Fe.walkTokens;Fe.parseInline;cr.parse;lr.lex;function ib(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,d;return(d=(h=u.match(/[\t ]/g))===null||h===void 0?void 0:h.length)!==null&&d!==void 0?d:0})):o},[]);if(i.length){var s=new RegExp(`
|
|
309
|
-
[ ]{`+Math.min.apply(Math,i)+"}","g");n=n.map(function(o){return o.replace(s,`
|
|
310
|
-
`)})}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(`
|
|
311
|
-
`)&&(h=String(o).split(`
|
|
312
|
-
`).map(function(d,f){return f===0?d:""+u+d}).join(`
|
|
313
|
-
`)),a+=h+n[l+1]}),a}var J3={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},au=new Map,sb=new Map,e5=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(K.debug("Registering icon pack:",t.name),"loader"in t)sb.set(t.name,t.loader);else if("icons"in t)au.set(t.name,t.icons);else throw K.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),ab=x(async(e,t)=>{const r=t3(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=au.get(n);if(!i){const a=sb.get(n);if(!a)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await a(),prefix:n},au.set(n,i)}catch(o){throw K.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=i3(i,r.name);if(!s)throw new Error(`Icon not found: ${e}`);return s},"getRegisteredIconData"),t5=x(async e=>{try{return await ab(e),!0}catch{return!1}},"isIconAvailable"),Xs=x(async(e,t,r)=>{let n;try{n=await ab(e,t?.fallbackPrefix)}catch(a){K.error(a),n=J3}const i=h3(n,t),s=m3(g3(i.body),{...i.attributes,...r});return sr(s,At())},"getIconSVG");function ob(e,{markdownAutoWrap:t}){const n=e.replace(/<br\/>/g,`
|
|
314
|
-
`).replace(/\n{2,}/g,`
|
|
315
|
-
`),i=ib(n);return t===!1?i.replace(/ /g," "):i}x(ob,"preprocessMarkdown");function lb(e,t={}){const r=ob(e,t),n=Fe.lexer(r),i=[[]];let s=0;function a(o,l="normal"){o.type==="text"?o.text.split(`
|
|
316
|
-
`).forEach((u,h)=>{h!==0&&(s++,i.push([])),u.split(" ").forEach(d=>{d=d.replace(/'/g,"'"),d&&i[s].push({content:d,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(lb,"markdownToLines");function cb(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," "):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:(K.warn(`Unsupported markdown: ${i.type}`),i.raw)}return x(n,"output"),r.map(n).join("")}x(cb,"markdownToHTML");function ub(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}x(ub,"splitTextToChars");function hb(e,t){const r=ub(t.content);return Hh(e,[],r,t.type)}x(hb,"splitWordToFitWidth");function Hh(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}])?Hh(e,a,s,n):(t.length===0&&i&&(t.push(i),r.shift()),[{content:t.join(""),type:n},{content:r.join(""),type:n}])}x(Hh,"splitWordToFitWidthRecursion");function db(e,t){if(e.some(({content:r})=>r.includes(`
|
|
317
|
-
`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return To(e,t)}x(db,"splitLineToFitWidth");function To(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 To(e,t,r,a);if(n.length>0)r.push(n),e.unshift(s);else if(s.content){const[o,l]=hb(t,s);r.push([o]),l.content&&e.unshift(l)}return To(e,t,r)}x(To,"splitLineToFitWidthRecursion");function ou(e,t){t&&e.attr("style",t)}x(ou,"applyStyle");async function fb(e,t,r,n,i=!1,s=At()){const a=e.append("foreignObject");a.attr("width",`${10*r}px`),a.attr("height",`${10*r}px`);const o=a.append("xhtml:div"),l=xi(t.label)?await Zu(t.label.replace(Ti.lineBreakRegex,`
|
|
318
|
-
`),s):sr(t.label,s),c=t.isNode?"nodeLabel":"edgeLabel",u=o.append("span");u.html(l),ou(u,t.labelStyle),u.attr("class",`${c} ${n}`),ou(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(fb,"addHtmlSpan");function sl(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(sl,"createTspan");function pb(e,t,r){const n=e.append("text"),i=sl(n,1,t);al(i,r);const s=i.node().getComputedTextLength();return n.remove(),s}x(pb,"computeWidthOfText");function r5(e,t,r){const n=e.append("text"),i=sl(n,1,t);al(i,[{content:r,type:"normal"}]);const s=i.node()?.getBoundingClientRect();return s&&n.remove(),s}x(r5,"computeDimensionOfText");function gb(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(d=>pb(s,1.1,d)<=e,"checkWidth"),h=u(c)?[c]:db(c,u);for(const d of h){const f=sl(o,l,1.1);al(f,d),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(gb,"createFormattedText");function al(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(al,"updateTextContentAndStyles");async function mb(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,s,a)=>(r.push((async()=>{const o=`${s}:${a}`;return await t5(o)?await Xs(o,void 0,{class:"label-icon"}):`<i class='${sr(i,t).replace(":"," ")}'></i>`})()),i));const n=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}x(mb,"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(K.debug("XYZ createText",t,r,n,i,s,a,"addSvgBackground: ",l),s){const u=cb(t,c),h=await mb(On(u),c),d=t.replace(/\\\\/g,"\\"),f={isNode:a,label:xi(t)?d:h,labelStyle:r.replace("fill:","color:")};return await fb(e,f,o,i,l,c)}else{const u=t.replace(/<br\s*\/?>/g,"<br/>"),h=lb(u.replace("<br>","<br/>"),c),d=gb(o,e,h,t?l:!1);if(a){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const f=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");$e(d).attr("style",f)}else{const f=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");$e(d).select("rect").attr("style",f.replace(/background:/g,"fill:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");$e(d).select("text").attr("style",g)}return d}},"createText");function Kl(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 n5(e,t){return e[0]===t[0]&&e[1]===t[1]}function i5(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)Kl(c,o,i);const l=(function(c,u,h){const d=[];for(const k of c){const v=[...k];n5(v[0],v[v.length-1])||v.push([v[0][0],v[0][1]]),v.length>2&&d.push(v)}const f=[];u=Math.max(u,.1);const g=[];for(const k of d)for(let v=0;v<k.length-1;v++){const S=k[v],C=k[v+1];if(S[1]!==C[1]){const w=Math.min(S[1],C[1]);g.push({ymin:w,ymax:Math.max(S[1],C[1]),x:w===S[1]?S[0]:C[0],islope:(C[0]-S[0])/(C[1]-S[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 f;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 S=m[k].edge,C=m[v].edge;f.push([[Math.round(S.x),b],[Math.round(C.x),b]])}b+=h,m.forEach((k=>{k.edge.x=k.edge.x+h*k.edge.islope})),y++}return f})(a,s,n);if(i){for(const c of a)Kl(c,o,-i);(function(c,u,h){const d=[];c.forEach((f=>d.push(...f))),Kl(d,u,h)})(l,o,-i)}return l}function Ks(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),i5(e,i,n,s||1)}class qh{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const n=Ks(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 ol(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 s5 extends qh{fillPolygons(t,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=Ks(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)ol([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 a5 extends qh{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 o5{constructor(t){this.helper=t}fillPolygons(t,r){const n=Ks(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=ol(o),c=l/i,u=Math.ceil(c)-1,h=l-u*i,d=(o[0][0]+o[1][0])/2-i/4,f=Math.min(o[0][1],o[1][1]);for(let g=0;g<u;g++){const m=f+h+g*i,b=d-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 l5{constructor(t){this.helper=t}fillPolygons(t,r){const n=Ks(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=ol(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 d=Math.atan((h[1]-u[1])/(h[0]-u[0]));for(let f=0;f<l;f++){const g=f*(n+i),m=g+n,b=[u[0]+g*Math.cos(d)+c*Math.cos(d),u[1]+g*Math.sin(d)+c*Math.sin(d)],y=[u[0]+m*Math.cos(d)+c*Math.cos(d),u[1]+m*Math.sin(d)+c*Math.sin(d)];s.push(...this.helper.doubleLineOps(b[0],b[1],y[0],y[1],r))}})),s}}class c5{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=Ks(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=ol(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 d=2*h*r,f=2*(h+1)*r,g=Math.sqrt(2*Math.pow(r,2)),m=[l[0]+d*Math.cos(u),l[1]+d*Math.sin(u)],b=[l[0]+f*Math.cos(u),l[1]+f*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 Ht={};class u5{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const h5=0,Ql=1,yp=2,ya={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 Zl(e,t){return e.type===t}function Uh(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:h5,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:Ql,text:`${parseFloat(RegExp.$1)}`},a=a.substr(RegExp.$1.length)}return o[o.length]={type:yp,text:""},o})(e);let n="BOD",i=0,s=r[i];for(;!Zl(s,yp);){let a=0;const o=[];if(n==="BOD"){if(s.text!=="M"&&s.text!=="m")return Uh("M0,0"+e);i++,a=ya[s.text],n=s.text}else Zl(s,Ql)?a=ya[n]:(i++,a=ya[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(!Zl(c,Ql))throw new Error("Param not a number: "+n+","+c.text);o[o.length]=+c.text}if(typeof ya[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 xb(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 yb(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,d=0;r==="C"||r==="S"?(h=n+(n-o),d=i+(i-l)):(h=n,d=i),t.push({key:"C",data:[h,d,...u]}),o=u[0],l=u[1],n=u[2],i=u[3];break}case"T":{const[h,d]=u;let f=0,g=0;r==="Q"||r==="T"?(f=n+(n-o),g=i+(i-l)):(f=n,g=i);const m=n+2*(f-n)/3,b=i+2*(g-i)/3,y=h+2*(f-h)/3,k=d+2*(g-d)/3;t.push({key:"C",data:[m,b,y,k,h,d]}),o=f,l=g,n=h,i=d;break}case"Q":{const[h,d,f,g]=u,m=n+2*(h-n)/3,b=i+2*(d-i)/3,y=f+2*(h-f)/3,k=g+2*(d-g)/3;t.push({key:"C",data:[m,b,y,k,f,g]}),o=h,l=d,n=f,i=g;break}case"A":{const h=Math.abs(u[0]),d=Math.abs(u[1]),f=u[2],g=u[3],m=u[4],b=u[5],y=u[6];h===0||d===0?(t.push({key:"C",data:[n,i,b,y,b,y]}),n=b,i=y):(n!==b||i!==y)&&(bb(n,i,b,y,h,d,f,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 Qi(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function bb(e,t,r,n,i,s,a,o,l,c){const u=(h=a,Math.PI*h/180);var h;let d=[],f=0,g=0,m=0,b=0;if(c)[f,g,m,b]=c;else{[e,t]=Qi(e,t,-u),[r,n]=Qi(r,n,-u);const P=(e-r)/2,$=(t-n)/2;let F=P*P/(i*i)+$*$/(s*s);F>1&&(F=Math.sqrt(F),i*=F,s*=F);const L=i*i,R=s*s,W=L*R-L*$*$-R*P*P,X=L*$*$+R*P*P,_=(o===l?-1:1)*Math.sqrt(Math.abs(W/X));m=_*i*$/s+(e+r)/2,b=_*-s*P/i+(t+n)/2,f=Math.asin(parseFloat(((t-b)/s).toFixed(9))),g=Math.asin(parseFloat(((n-b)/s).toFixed(9))),e<m&&(f=Math.PI-f),r<m&&(g=Math.PI-g),f<0&&(f=2*Math.PI+f),g<0&&(g=2*Math.PI+g),l&&f>g&&(f-=2*Math.PI),!l&&g>f&&(g-=2*Math.PI)}let y=g-f;if(Math.abs(y)>120*Math.PI/180){const P=g,$=r,F=n;g=l&&g>f?f+120*Math.PI/180*1:f+120*Math.PI/180*-1,d=bb(r=m+i*Math.cos(g),n=b+s*Math.sin(g),$,F,i,s,a,0,l,[g,P,m,b])}y=g-f;const k=Math.cos(f),v=Math.sin(f),S=Math.cos(g),C=Math.sin(g),w=Math.tan(y/4),T=4/3*i*w,I=4/3*s*w,M=[e,t],E=[e+T*v,t-I*k],N=[r+T*C,n-I*S],D=[r,n];if(E[0]=2*M[0]-E[0],E[1]=2*M[1]-E[1],c)return[E,N,D].concat(d);{d=[E,N,D].concat(d);const P=[];for(let $=0;$<d.length;$+=3){const F=Qi(d[$][0],d[$][1],u),L=Qi(d[$+1][0],d[$+1][1],u),R=Qi(d[$+2][0],d[$+2][1],u);P.push([F[0],F[1],L[0],L[1],R[0],R[1]])}return P}}const d5={randOffset:function(e,t){return ke(e,t)},randOffsetWithRange:function(e,t,r){return Eo(e,t,r)},ellipse:function(e,t,r,n,i){const s=wb(r,n,i);return lu(e,t,i,s).opset},doubleLineOps:function(e,t,r,n,i){return nn(e,t,r,n,i,!0)}};function kb(e,t,r,n,i){return{type:"path",ops:nn(e,t,r,n,i)}}function Fa(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?kb(e[0][0],e[0][1],e[1][0],e[1][1],r):{type:"path",ops:[]}}function f5(e,t,r,n,i){return(function(s,a){return Fa(s,!0,a)})([[e,t],[e+r,t],[e+r,t+n],[e,t+n]],i)}function bp(e,t){if(e.length){const r=typeof e[0][0]=="number"?[e]:e,n=ba(r[0],1*(1+.2*t.roughness),t),i=t.disableMultiStroke?[]:ba(r[0],1.5*(1+.22*t.roughness),vp(t));for(let s=1;s<r.length;s++){const a=r[s];if(a.length){const o=ba(a,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:ba(a,1.5*(1+.22*t.roughness),vp(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 wb(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+=ke(a*l,r),o+=ke(o*l,r),{increment:s,rx:a,ry:o}}function lu(e,t,r,n){const[i,s]=Cp(n.increment,e,t,n.rx,n.ry,1,n.increment*Eo(.1,Eo(.4,1,r),r),r);let a=Ao(i,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[o]=Cp(n.increment,e,t,n.rx,n.ry,1.5,0,r),l=Ao(o,null,r);a=a.concat(l)}return{estimatedPoints:s,opset:{type:"path",ops:a}}}function kp(e,t,r,n,i,s,a,o,l){const c=e,u=t;let h=Math.abs(r/2),d=Math.abs(n/2);h+=ke(.01*h,l),d+=ke(.01*d,l);let f=i,g=s;for(;f<0;)f+=2*Math.PI,g+=2*Math.PI;g-f>2*Math.PI&&(f=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,b=Math.min(m/2,(g-f)/2),y=Sp(b,c,u,h,d,f,g,1,l);if(!l.disableMultiStroke){const k=Sp(b,c,u,h,d,f,g,1.5,l);y.push(...k)}return a&&(o?y.push(...nn(c,u,c+h*Math.cos(f),u+d*Math.sin(f),l),...nn(c,u,c+h*Math.cos(g),u+d*Math.sin(g),l)):y.push({op:"lineTo",data:[c,u]},{op:"lineTo",data:[c+h*Math.cos(f),u+d*Math.sin(f)]})),{type:"path",ops:y}}function wp(e,t){const r=yb(xb(Uh(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,d,f]=o;n.push(...p5(l,c,u,h,d,f,s,t)),s=[d,f];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 Jl(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]+ke(i,t),n[0][1]+ke(i,t)]});for(let a=1;a<s;a++)r.push({op:"lineTo",data:[n[a][0]+ke(i,t),n[a][1]+ke(i,t)]})}}return{type:"fillPath",ops:r}}function Kn(e,t){return(function(r,n){let i=r.fillStyle||"hachure";if(!Ht[i])switch(i){case"zigzag":Ht[i]||(Ht[i]=new s5(n));break;case"cross-hatch":Ht[i]||(Ht[i]=new a5(n));break;case"dots":Ht[i]||(Ht[i]=new o5(n));break;case"dashed":Ht[i]||(Ht[i]=new l5(n));break;case"zigzag-line":Ht[i]||(Ht[i]=new c5(n));break;default:i="hachure",Ht[i]||(Ht[i]=new qh(n))}return Ht[i]})(t,d5).fillPolygons(e,t)}function vp(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function vb(e){return e.randomizer||(e.randomizer=new u5(e.seed||0)),e.randomizer.next()}function Eo(e,t,r,n=1){return r.roughness*n*(vb(r)*(t-e)+e)}function ke(e,t,r=1){return Eo(-e,e,t,r)}function nn(e,t,r,n,i,s=!1){const a=s?i.disableMultiStrokeFill:i.disableMultiStroke,o=cu(e,t,r,n,i,!0,!1);if(a)return o;const l=cu(e,t,r,n,i,!0,!0);return o.concat(l)}function cu(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,d=.2+.2*vb(i);let f=i.bowing*i.maxRandomnessOffset*(n-t)/200,g=i.bowing*i.maxRandomnessOffset*(e-r)/200;f=ke(f,i,c),g=ke(g,i,c);const m=[],b=()=>ke(h,i,c),y=()=>ke(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:ke(u,i,c)),t+(k?0:ke(u,i,c))]}),a?m.push({op:"bcurveTo",data:[f+e+(r-e)*d+b(),g+t+(n-t)*d+b(),f+e+2*(r-e)*d+b(),g+t+2*(n-t)*d+b(),r+(k?0:b()),n+(k?0:b())]}):m.push({op:"bcurveTo",data:[f+e+(r-e)*d+y(),g+t+(n-t)*d+y(),f+e+2*(r-e)*d+y(),g+t+2*(n-t)*d+y(),r+(k?0:y()),n+(k?0:y())]}),m}function ba(e,t,r){if(!e.length)return[];const n=[];n.push([e[0][0]+ke(t,r),e[0][1]+ke(t,r)]),n.push([e[0][0]+ke(t,r),e[0][1]+ke(t,r)]);for(let i=1;i<e.length;i++)n.push([e[i][0]+ke(t,r),e[i][1]+ke(t,r)]),i===e.length-1&&n.push([e[i][0]+ke(t,r),e[i][1]+ke(t,r)]);return Ao(n,null,r)}function Ao(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(...cu(e[0][0],e[0][1],e[1][0],e[1][1],r,!0,!0));return i}function Cp(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=ke(.5,o)-Math.PI/2;c.push([ke(s,o)+t+.9*n*Math.cos(u-e),ke(s,o)+r+.9*i*Math.sin(u-e)]);const h=2*Math.PI+u-.01;for(let d=u;d<h;d+=e){const f=[ke(s,o)+t+n*Math.cos(d),ke(s,o)+r+i*Math.sin(d)];l.push(f),c.push(f)}c.push([ke(s,o)+t+n*Math.cos(u+2*Math.PI+.5*a),ke(s,o)+r+i*Math.sin(u+2*Math.PI+.5*a)]),c.push([ke(s,o)+t+.98*n*Math.cos(u+a),ke(s,o)+r+.98*i*Math.sin(u+a)]),c.push([ke(s,o)+t+.9*n*Math.cos(u+.5*a),ke(s,o)+r+.9*i*Math.sin(u+.5*a)])}return[c,l]}function Sp(e,t,r,n,i,s,a,o,l){const c=s+ke(.1,l),u=[];u.push([ke(o,l)+t+.9*n*Math.cos(c-e),ke(o,l)+r+.9*i*Math.sin(c-e)]);for(let h=c;h<=a;h+=e)u.push([ke(o,l)+t+n*Math.cos(h),ke(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)]),Ao(u,null,l)}function p5(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,d=o.preserveVertices;for(let f=0;f<h;f++)f===0?l.push({op:"move",data:[a[0],a[1]]}):l.push({op:"move",data:[a[0]+(d?0:ke(c[0],o)),a[1]+(d?0:ke(c[0],o))]}),u=d?[i,s]:[i+ke(c[f],o),s+ke(c[f],o)],l.push({op:"bcurveTo",data:[e+ke(c[f],o),t+ke(c[f],o),r+ke(c[f],o),n+ke(c[f],o),u[0],u[1]]});return l}function Zi(e){return[...e]}function _p(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(Zi(e[0]),Zi(e[1]),Zi(e[2]),Zi(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(Zi(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 Oa(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function g5(e,t,r){const n=Oa(t,r);if(n===0)return Oa(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)),Oa(e,yn(t,r,i))}function yn(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function uu(e,t,r,n){const i=n||[];if((function(o,l){const c=o[l+0],u=o[l+1],h=o[l+2],d=o[l+3];let f=3*u[0]-2*c[0]-d[0];f*=f;let g=3*u[1]-2*c[1]-d[1];g*=g;let m=3*h[0]-2*d[0]-c[0];m*=m;let b=3*h[1]-2*d[1]-c[1];return b*=b,f<m&&(f=m),g<b&&(g=b),f+g})(e,t)<r){const o=e[t+0];i.length?(s=i[i.length-1],a=o,Math.sqrt(Oa(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],d=yn(l,c,.5),f=yn(c,u,.5),g=yn(u,h,.5),m=yn(d,f,.5),b=yn(f,g,.5),y=yn(m,b,.5);uu([l,d,m,y],0,r,i),uu([y,b,g,h],0,r,i)}var s,a;return i}function m5(e,t){return Mo(e,0,e.length,t)}function Mo(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=g5(e[u],a,o);h>l&&(l=h,c=u)}return Math.sqrt(l)>n?(Mo(e,t,c+1,n,s),Mo(e,c,r,n,s)):(s.length||s.push(a),s.push(o)),s}function ec(e,t=.15,r){const n=[],i=(e.length-1)/3;for(let s=0;s<i;s++)uu(e,3*s,t,n);return r&&r>0?Mo(n,0,n.length,r):n}const Xt="none";class No{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",[kb(t,r,n,i,a)],a)}rectangle(t,r,n,i,s){const a=this._o(s),o=[],l=f5(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(Jl([c],a)):o.push(Kn([c],a))}return a.stroke!==Xt&&o.push(l),this._d("rectangle",o,a)}ellipse(t,r,n,i,s){const a=this._o(s),o=[],l=wb(n,i,a),c=lu(t,r,a,l);if(a.fill)if(a.fillStyle==="solid"){const u=lu(t,r,a,l).opset;u.type="fillPath",o.push(u)}else o.push(Kn([c.estimatedPoints],a));return a.stroke!==Xt&&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",[Fa(t,!1,n)],n)}arc(t,r,n,i,s,a,o=!1,l){const c=this._o(l),u=[],h=kp(t,r,n,i,s,a,o,!0,c);if(o&&c.fill)if(c.fillStyle==="solid"){const d=Object.assign({},c);d.disableMultiStroke=!0;const f=kp(t,r,n,i,s,a,!0,!1,d);f.type="fillPath",u.push(f)}else u.push((function(d,f,g,m,b,y,k){const v=d,S=f;let C=Math.abs(g/2),w=Math.abs(m/2);C+=ke(.01*C,k),w+=ke(.01*w,k);let T=b,I=y;for(;T<0;)T+=2*Math.PI,I+=2*Math.PI;I-T>2*Math.PI&&(T=0,I=2*Math.PI);const M=(I-T)/k.curveStepCount,E=[];for(let N=T;N<=I;N+=M)E.push([v+C*Math.cos(N),S+w*Math.sin(N)]);return E.push([v+C*Math.cos(I),S+w*Math.sin(I)]),E.push([v,S]),Kn([E],k)})(t,r,n,i,s,a,c));return c.stroke!==Xt&&u.push(h),this._d("arc",u,c)}curve(t,r){const n=this._o(r),i=[],s=bp(t,n);if(n.fill&&n.fill!==Xt)if(n.fillStyle==="solid"){const a=bp(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(...ec(_p([c[0],c[0],c[1],c[2]]),10,(1+n.roughness)/2)):a.push(...ec(_p(c),10,(1+n.roughness)/2))}a.length&&i.push(Kn([a],n))}return n.stroke!==Xt&&i.push(s),this._d("curve",i,n)}polygon(t,r){const n=this._o(r),i=[],s=Fa(t,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(Jl([t],n)):i.push(Kn([t],n))),n.stroke!==Xt&&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!==Xt,a=n.stroke!==Xt,o=!!(n.simplification&&n.simplification<1),l=(function(u,h,d){const f=yb(xb(Uh(u))),g=[];let m=[],b=[0,0],y=[];const k=()=>{y.length>=4&&m.push(...ec(y,h)),y=[]},v=()=>{k(),m.length&&(g.push(m),m=[])};for(const{key:C,data:w}of f)switch(C){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(),!d)return g;const S=[];for(const C of g){const w=m5(C,d);w.length&&S.push(w)}return S})(t,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),c=wp(t,n);if(s)if(n.fillStyle==="solid")if(l.length===1){const u=wp(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(Jl(l,n));else i.push(Kn(l,n));return a&&(o?l.forEach((u=>{i.push(Fa(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:Xt};break;case"fillPath":a={d:this.opsToPath(s),stroke:Xt,strokeWidth:0,fill:n.fill||Xt};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||Xt,strokeWidth:n,fill:Xt}}_mergedShape(t){return t.filter(((r,n)=>n===0||r.op!=="move"))}}class x5{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new No(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 ka="http://www.w3.org/2000/svg";class y5{constructor(t,r){this.svg=t,this.gen=new No(r)}draw(t){const r=t.sets||[],n=t.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,s=i.createElementNS(ka,"g"),a=t.options.fixedDecimalPlaceDigits;for(const o of r){let l=null;switch(o.type){case"path":l=i.createElementNS(ka,"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(ka,"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(ka,"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 ae={canvas:(e,t)=>new x5(e,t),svg:(e,t)=>new y5(e,t),generator:e=>new No(e),newSeed:()=>No.newSeed()},ye=x(async(e,t,r)=>{let n;const i=t.useHtmlLabels||pt(Re()?.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",Nt(t.labelStyle));let o;t.label===void 0?o="":o=typeof t.label=="string"?t.label:t.label[0];const l=await ln(a,sr(On(o),Re()),{useHtmlLabels:i,width:t.width||Re().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],d=$e(l),f=h.getElementsByTagName("img");if(f){const g=o.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...f].map(m=>new Promise(b=>{function y(){if(m.style.display="flex",m.style.flexDirection="column",g){const k=Re().fontSize?Re().fontSize:window.getComputedStyle(document.body).fontSize,v=5,[S=Dm.fontSize]=rl(k),C=S*v+"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(),d.attr("width",c.width),d.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"),tc=x(async(e,t,r)=>{const n=r.useHtmlLabels||pt(Re()?.flowchart?.htmlLabels),i=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await ln(i,sr(On(t),Re()),{useHtmlLabels:n,width:r.width||Re()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let a=s.getBBox();const o=r.padding/2;if(pt(Re()?.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,d=t+c/2;for(let f=0;f<=50;f++){const g=f/50,m=e+g*l,b=d+i*Math.sin(h*(m-e));a.push({x:m,y:b})}return a}x(sn,"generateFullSineWavePoints");function $s(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 d=o+h*u,f=e+r*Math.cos(d),g=t+r*Math.sin(d);a.push({x:-f,y:-g})}return a}x($s,"generateCirclePoints");var b5=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"),Ni=b5;function Cb(e,t){t&&e.attr("style",t)}x(Cb,"applyStyle");async function Sb(e){const t=$e(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),r=t.append("xhtml:div"),n=Re();let i=e.label;e.label&&xi(e.label)&&(i=await Zu(e.label.replace(Ti.lineBreakRegex,`
|
|
319
|
-
`),n));const a='<span class="'+(e.isNode?"nodeLabel":"edgeLabel")+'" '+(e.labelStyle?'style="'+e.labelStyle+'"':"")+">"+i+"</span>";return r.html(sr(a,n)),Cb(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(Sb,"addHtmlLabel");var k5=x(async(e,t,r,n)=>{let i=e||"";if(typeof i=="object"&&(i=i[0]),pt(Re().flowchart.htmlLabels)){i=i.replace(/\\n|\n/g,"<br />"),K.info("vertexText"+i);const s={isNode:n,label:On(i).replace(/fa[blrs]?:fa-[\w-]+/g,o=>`<i class='${o.replace(":"," ")}'></i>`),labelStyle:t&&t.replace("fill:","color:")};return await Sb(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"),Sn=k5,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"),_b=x(async(e,t)=>{K.info("Creating subgraph rect for ",t.id,t);const r=Re(),{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),d=pt(r.flowchart.htmlLabels),f=h.insert("g").attr("class","cluster-label "),g=await ln(f,t.label,{style:t.labelStyle,useHtmlLabels:d,isNode:!0});let m=g.getBBox();if(pt(r.flowchart.htmlLabels)){const T=g.children[0],I=$e(g);m=T.getBoundingClientRect(),I.attr("width",m.width),I.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;K.trace("Data ",t,JSON.stringify(t));let S;if(t.look==="handDrawn"){const T=ae.svg(h),I=le(t,{roughness:.7,fill:s,stroke:a,fillWeight:3,seed:i}),M=T.path(cn(k,v,b,y,0),I);S=h.insert(()=>(K.debug("Rough node insert CXC",M),M),":first-child"),S.select("path:nth-child(2)").attr("style",c.join(";")),S.select("path").attr("style",u.join(";").replace("fill","stroke"))}else S=h.insert("rect",":first-child"),S.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:C}=Ch(r);if(f.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+C})`),o){const T=f.select("span");T&&T.attr("style",o)}const w=S.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 Ni(t,T)},{cluster:h,labelBBox:m}},"rect"),w5=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 Ni(t,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),v5=x(async(e,t)=>{const r=Re(),{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 d=c.append("rect");const f=h.node().appendChild(await Sn(t.label,t.labelStyle,void 0,!0));let g=f.getBBox();if(pt(r.flowchart.htmlLabels)){const M=f.children[0],E=$e(f);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,S=t.x-y/2,C=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=ae.svg(c),N=t.rx||t.ry?E.path(cn(S,C,y,k,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:i}):E.rectangle(S,C,y,k,{seed:i});T=c.insert(()=>N,":first-child");const D=E.rectangle(S,w,y,v,{fill:M?s:a,fillStyle:M?"hachure":"solid",stroke:l,seed:i});T=c.insert(()=>N,":first-child"),d=c.insert(()=>D)}else T=u.insert("rect",":first-child"),T.attr("class","outer").attr("x",S).attr("y",C).attr("width",y).attr("height",k).attr("data-look",t.look),d.attr("class","inner").attr("x",S).attr("y",w).attr("width",y).attr("height",v);h.attr("transform",`translate(${t.x-g.width/2}, ${C+1-(pt(r.flowchart.htmlLabels)?0:3)})`);const I=T.node().getBBox();return t.height=I.height,t.offsetX=0,t.offsetY=g.height-t.padding/2,t.labelBBox=g,t.intersect=function(M){return Ni(t,M)},{cluster:c,labelBBox:g}},"roundedWithTitle"),C5=x(async(e,t)=>{K.info("Creating subgraph rect for ",t.id,t);const r=Re(),{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),d=pt(r.flowchart.htmlLabels),f=h.insert("g").attr("class","cluster-label "),g=await ln(f,t.label,{style:t.labelStyle,useHtmlLabels:d,isNode:!0,width:t.width});let m=g.getBBox();if(pt(r.flowchart.htmlLabels)){const T=g.children[0],I=$e(g);m=T.getBoundingClientRect(),I.attr("width",m.width),I.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;K.trace("Data ",t,JSON.stringify(t));let S;if(t.look==="handDrawn"){const T=ae.svg(h),I=le(t,{roughness:.7,fill:s,stroke:a,fillWeight:4,seed:i}),M=T.path(cn(k,v,b,y,t.rx),I);S=h.insert(()=>(K.debug("Rough node insert CXC",M),M),":first-child"),S.select("path:nth-child(2)").attr("style",c.join(";")),S.select("path").attr("style",u.join(";").replace("fill","stroke"))}else S=h.insert("rect",":first-child"),S.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:C}=Ch(r);if(f.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+C})`),o){const T=f.select("span");T&&T.attr("style",o)}const w=S.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 Ni(t,T)},{cluster:h,labelBBox:m}},"kanbanSection"),S5=x((e,t)=>{const r=Re(),{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,d=t.y-u/2;t.width=c;let f;if(t.look==="handDrawn"){const b=ae.svg(a).rectangle(h,d,c,u,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:s,seed:i});f=a.insert(()=>b,":first-child")}else f=o.insert("rect",":first-child"),f.attr("class","divider").attr("x",h).attr("y",d).attr("width",c).attr("height",u).attr("data-look",t.look);const g=f.node().getBBox();return t.height=g.height,t.offsetX=0,t.offsetY=0,t.intersect=function(m){return Ni(t,m)},{cluster:a,labelBBox:{}}},"divider"),_5=_b,T5={rect:_b,squareRect:_5,roundedWithTitle:v5,noteGroup:w5,divider:S5,kanbanSection:C5},Tb=new Map,E5=x(async(e,t)=>{const r=t.shape||"rect",n=await T5[r](e,t);return Tb.set(t.id,n),n},"insertCluster"),$6=x(()=>{Tb=new Map},"clear");function Eb(e,t){return e.intersect(t)}x(Eb,"intersectNode");var A5=Eb;function Ab(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(Ab,"intersectEllipse");var Mb=Ab;function Nb(e,t,r){return Mb(e,t,t,r)}x(Nb,"intersectCircle");var M5=Nb;function Lb(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&&hu(o,l))return;const u=n.y-r.y,h=r.x-n.x,d=n.x*r.y-r.x*n.y,f=u*e.x+h*e.y+d,g=u*t.x+h*t.y+d;if(Math.abs(f)<c&&Math.abs(g)<c&&hu(f,g))return;const m=i*h-u*s;if(m===0)return;const b=Math.abs(m/2);let y=s*d-h*a;const k=y<0?(y-b)/m:(y+b)/m;y=u*a-i*d;const v=y<0?(y-b)/m:(y+b)/m;return{x:k,y:v}}}x(Lb,"intersectLine");function hu(e,t){return e*t>0}x(hu,"sameSign");var N5=Lb;function Ib(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],d=t[u<t.length-1?u+1:0],f=N5(e,r,{x:l+h.x,y:c+h.y},{x:l+d.x,y:c+d.y});f&&s.push(f)}return s.length?(s.length>1&&s.sort(function(u,h){let d=u.x-r.x,f=u.y-r.y,g=Math.sqrt(d*d+f*f),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(Ib,"intersectPolygon");var L5=Ib,ie={node:A5,circle:M5,ellipse:Mb,polygon:L5,rect:Ni};function $b(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=ae.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",Nt(o)),ue(t,h),t.intersect=function(d){return K.info("Circle intersect",t,a,d),ie.circle(t,a,d)},s}x($b,"anchor");function du(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,d=(n-t)/2,f=h/i,g=d/s,m=Math.sqrt(f**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 C=Math.atan2((n-k)/s,(r-y)/i)-v;a&&C<0&&(C+=2*Math.PI),!a&&C>0&&(C-=2*Math.PI);const w=[];for(let T=0;T<20;T++){const I=T/19,M=v+I*C,E=y+i*Math.cos(M),N=k+s*Math.sin(M);w.push({x:E,y:N})}return w}x(du,"generateArcPoints");async function jb(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await ye(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},...du(-a/2,-o/2,-a/2,o/2,c,l,!1),{x:a/2,y:o/2},...du(a/2,o/2,a/2,-o/2,c,l,!0)],d=ae.svg(i),f=le(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const g=Ne(h),m=d.path(g,f),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(jb,"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 Bb(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await ye(e,t,pe(t)),a=s.height+t.padding,o=12,l=s.width+t.padding+o,c=0,u=l,h=-a,d=0,f=[{x:c+o,y:h},{x:u,y:h},{x:u,y:d},{x:c,y:d},{x:c,y:h+o},{x:c+o,y:h}];let g;const{cssStyles:m}=t;if(t.look==="handDrawn"){const b=ae.svg(i),y=le(t,{}),k=Ne(f),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,f);return n&&g.attr("style",n),ue(t,g),t.intersect=function(b){return ie.polygon(t,f,b)},i}x(Bb,"card");function Db(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=ae.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(d){return ie.polygon(t,a,d)},n}x(Db,"choice");async function Vh(e,t,r){const{labelStyles:n,nodeStyles:i}=ce(t);t.labelStyle=n;const{shapeSvg:s,bbox:a,halfPadding:o}=await ye(e,t,pe(t)),l=r?.padding??o,c=a.width/2+l;let u;const{cssStyles:h}=t;if(t.look==="handDrawn"){const d=ae.svg(s),f=le(t,{}),g=d.circle(0,0,c*2,f);u=s.insert(()=>g,":first-child"),u.attr("class","basic label-container").attr("style",Nt(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(d,f){const g=d.width/2;return ie.circle(d,g,f)},t.intersect=function(d){return K.info("Circle intersect",t,c,d),ie.circle(t,c,d)},s}x(Vh,"circle");function Pb(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}
|
|
320
|
-
M ${i.x},${i.y} L ${a.x},${a.y}`}x(Pb,"createLine");function Rb(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=ae.svg(i),l=le(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=o.circle(0,0,s*2,l),u=Pb(s),h=o.path(u,l),d=i.insert(()=>c,":first-child");return d.insert(()=>h),a&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",a),n&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",n),ue(t,d),t.intersect=function(f){return K.info("crossedCircle intersect",t,{radius:s,point:f}),ie.circle(t,s,f)},i}x(Rb,"crossedCircle");function Fr(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 d=o+h*u,f=e+r*Math.cos(d),g=t+r*Math.sin(d);a.push({x:-f,y:-g})}return a}x(Fr,"generateCirclePoints");async function Fb(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await ye(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=[...Fr(o/2,-l/2,c,30,-90,0),{x:-o/2-c,y:c},...Fr(o/2+c*2,-c,c,20,-180,-270),...Fr(o/2+c*2,c,c,20,-90,-180),{x:-o/2-c,y:-l/2},...Fr(o/2,l/2,c,20,0,90)],d=[{x:o/2,y:-l/2-c},{x:-o/2,y:-l/2-c},...Fr(o/2,-l/2,c,20,-90,0),{x:-o/2-c,y:-c},...Fr(o/2+o*.1,-c,c,20,-180,-270),...Fr(o/2+o*.1,c,c,20,-90,-180),{x:-o/2-c,y:l/2},...Fr(o/2,l/2,c,20,0,90),{x:-o/2,y:l/2+c},{x:o/2,y:l/2+c}],f=ae.svg(i),g=le(t,{fill:"none"});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const b=Ne(h).replace("Z",""),y=f.path(b,g),k=Ne(d),v=f.path(k,{...g}),S=i.insert("g",":first-child");return S.insert(()=>v,":first-child").attr("stroke-opacity",0),S.insert(()=>y,":first-child"),S.attr("class","text"),u&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",u),n&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.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,S),t.intersect=function(C){return ie.polygon(t,d,C)},i}x(Fb,"curlyBraceLeft");function Or(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 d=o+h*u,f=e+r*Math.cos(d),g=t+r*Math.sin(d);a.push({x:f,y:g})}return a}x(Or,"generateCirclePoints");async function Ob(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await ye(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=[...Or(o/2,-l/2,c,20,-90,0),{x:o/2+c,y:-c},...Or(o/2+c*2,-c,c,20,-180,-270),...Or(o/2+c*2,c,c,20,-90,-180),{x:o/2+c,y:l/2},...Or(o/2,l/2,c,20,0,90)],d=[{x:-o/2,y:-l/2-c},{x:o/2,y:-l/2-c},...Or(o/2,-l/2,c,20,-90,0),{x:o/2+c,y:-c},...Or(o/2+c*2,-c,c,20,-180,-270),...Or(o/2+c*2,c,c,20,-90,-180),{x:o/2+c,y:l/2},...Or(o/2,l/2,c,20,0,90),{x:o/2,y:l/2+c},{x:-o/2,y:l/2+c}],f=ae.svg(i),g=le(t,{fill:"none"});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const b=Ne(h).replace("Z",""),y=f.path(b,g),k=Ne(d),v=f.path(k,{...g}),S=i.insert("g",":first-child");return S.insert(()=>v,":first-child").attr("stroke-opacity",0),S.insert(()=>y,":first-child"),S.attr("class","text"),u&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",u),n&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.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,S),t.intersect=function(C){return ie.polygon(t,d,C)},i}x(Ob,"curlyBraceRight");function kt(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 d=o+h*u,f=e+r*Math.cos(d),g=t+r*Math.sin(d);a.push({x:-f,y:-g})}return a}x(kt,"generateCirclePoints");async function zb(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await ye(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=[...kt(o/2,-l/2,c,30,-90,0),{x:-o/2-c,y:c},...kt(o/2+c*2,-c,c,20,-180,-270),...kt(o/2+c*2,c,c,20,-90,-180),{x:-o/2-c,y:-l/2},...kt(o/2,l/2,c,20,0,90)],d=[...kt(-o/2+c+c/2,-l/2,c,20,-90,-180),{x:o/2-c/2,y:c},...kt(-o/2-c/2,-c,c,20,0,90),...kt(-o/2-c/2,c,c,20,-90,0),{x:o/2-c/2,y:-c},...kt(-o/2+c+c/2,l/2,c,30,-180,-270)],f=[{x:o/2,y:-l/2-c},{x:-o/2,y:-l/2-c},...kt(o/2,-l/2,c,20,-90,0),{x:-o/2-c,y:-c},...kt(o/2+c*2,-c,c,20,-180,-270),...kt(o/2+c*2,c,c,20,-90,-180),{x:-o/2-c,y:l/2},...kt(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},...kt(-o/2+c+c/2,-l/2,c,20,-90,-180),{x:o/2-c/2,y:c},...kt(-o/2-c/2,-c,c,20,0,90),...kt(-o/2-c/2,c,c,20,-90,0),{x:o/2-c/2,y:-c},...kt(-o/2+c+c/2,l/2,c,30,-180,-270)],g=ae.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),S=Ne(d).replace("Z",""),C=g.path(S,m),w=Ne(f),T=g.path(w,{...m}),I=i.insert("g",":first-child");return I.insert(()=>T,":first-child").attr("stroke-opacity",0),I.insert(()=>k,":first-child"),I.insert(()=>C,":first-child"),I.attr("class","text"),u&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",u),n&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",n),I.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,I),t.intersect=function(M){return ie.polygon(t,f,M)},i}x(zb,"curlyBraces");async function Wb(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await ye(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,d=ae.svg(i),f=le(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.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},...$s(-b,-m/2,u,50,270,90)],v=Ne(k),S=d.path(v,f),C=i.insert(()=>S,":first-child");return C.attr("class","basic label-container"),h&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",h),n&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",n),C.attr("transform",`translate(${-l/2}, ${-c/2})`),ue(t,C),t.intersect=function(w){return ie.polygon(t,k,w)},i}x(Wb,"curvedTrapezoid");var I5=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"),$5=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"),j5=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 Hb(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await ye(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:d}=t;if(t.look==="handDrawn"){const f=ae.svg(i),g=$5(0,0,o,u,l,c),m=j5(0,c,o,u,l,c),b=f.path(g,le(t,{})),y=f.path(m,le(t,{fill:"none"}));h=i.insert(()=>y,":first-child"),h=i.insert(()=>b,":first-child"),h.attr("class","basic label-container"),d&&h.attr("style",d)}else{const f=I5(0,0,o,u,l,c);h=i.insert("path",":first-child").attr("d",f).attr("class","basic label-container").attr("style",Nt(d)).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(f){const g=ie.rect(t,f),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,f.y-(t.y??0)>0&&(b=-b),g.y+=b}return g},i}x(Hb,"cylinder");async function qb(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await ye(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:d}=t,f=ae.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=f.polygon(m.map(k=>[k.x,k.y]),g),y=i.insert(()=>b,":first-child");return y.attr("class","basic label-container"),d&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",d),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(qb,"dividedRectangle");async function Ub(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:a}=await ye(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 d=ae.svg(i),f=le(t,{roughness:.2,strokeWidth:2.5}),g=le(t,{roughness:.2,strokeWidth:1.5}),m=d.circle(0,0,l*2,f),b=d.circle(0,0,c*2,g);u=i.insert("g",":first-child"),u.attr("class",Nt(t.cssClasses)).attr("style",Nt(h)),u.node()?.appendChild(m),u.node()?.appendChild(b)}else{u=i.insert("g",":first-child");const d=u.insert("circle",":first-child"),f=u.insert("circle");u.attr("class","basic label-container").attr("style",n),d.attr("class","outer-circle").attr("style",n).attr("r",l).attr("cx",0).attr("cy",0),f.attr("class","inner-circle").attr("style",n).attr("r",c).attr("cx",0).attr("cy",0)}return ue(t,u),t.intersect=function(d){return K.info("DoubleCircle intersect",t,l,d),ie.circle(t,l,d)},i}x(Ub,"doublecircle");function Vb(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=ae.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),d=s.insert(()=>h,":first-child");return d.selectAll("path").attr("style",`fill: ${c} !important;`),o&&o.length>0&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",o),i&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",i),ue(t,d),t.intersect=function(f){return K.info("filledCircle intersect",t,{radius:a,point:f}),ie.circle(t,a,f)},s}x(Vb,"filledCircle");async function Gb(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await ye(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,d=ae.svg(i),f=le(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const g=Ne(u),m=d.path(g,f),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 K.info("Triangle intersect",t,u,y),ie.polygon(t,u,y)},i}x(Gb,"flippedTriangle");function Yb(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,d=ae.svg(a),f=le(t,{stroke:i.lineColor,fill:i.lineColor});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const g=d.rectangle(u,h,l,c,f),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(Yb,"forkJoin");async function Xb(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const i=80,s=50,{shapeSvg:a,bbox:o}=await ye(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,d=ae.svg(a),f=le(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const g=[{x:-l/2,y:-c/2},{x:l/2-u,y:-c/2},...$s(-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=d.path(m,f),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 K.info("Pill intersect",t,{radius:u,point:k}),ie.polygon(t,g,k)},a}x(Xb,"halfRoundedRectangle");async function Kb(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await ye(e,t,pe(t)),a=s.height+(t.padding??0),o=s.width+(t.padding??0)*2.5,{cssStyles:l}=t,c=ae.svg(i),u=le(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let h=o/2;const d=h/6;h=h+d;const f=a/2,g=f/2,m=h-g,b=[{x:-m,y:-f},{x:0,y:-f},{x:m,y:-f},{x:h,y:0},{x:m,y:f},{x:0,y:f},{x:-m,y:f},{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(S){return ie.polygon(t,b,S)},i}x(Kb,"hexagon");async function Qb(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.label="",t.labelStyle=r;const{shapeSvg:i}=await ye(e,t,pe(t)),s=Math.max(30,t?.width??0),a=Math.max(30,t?.height??0),{cssStyles:o}=t,l=ae.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),d=l.path(h,c),f=i.insert(()=>d,":first-child");return f.attr("class","basic label-container"),o&&t.look!=="handDrawn"&&f.selectChildren("path").attr("style",o),n&&t.look!=="handDrawn"&&f.selectChildren("path").attr("style",n),f.attr("transform",`translate(${-s/2}, ${-a/2})`),ue(t,f),t.intersect=function(g){return K.info("Pill intersect",t,{points:u}),ie.polygon(t,u,g)},i}x(Qb,"hourglass");async function Zb(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 ye(e,t,"icon-shape default"),d=t.pos==="t",f=o,g=o,{nodeBorder:m}=r,{stylesMap:b}=Ei(t),y=-g/2,k=-f/2,v=t.label?8:0,S=ae.svg(c),C=le(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const w=S.rectangle(y,k,g,f,C),T=Math.max(g,u.width),I=f+u.height+v,M=S.rectangle(-T/2,-I/2,T,I,{...C,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 Xs(t.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const P=D.node().getBBox(),$=P.width,F=P.height,L=P.x,R=P.y;D.attr("transform",`translate(${-$/2-L},${d?u.height/2+v/2-F/2-R:-u.height/2-v/2-F/2-R})`),D.attr("style",`color: ${b.get("stroke")??m};`)}return h.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${d?-I/2:I/2-u.height})`),E.attr("transform",`translate(0,${d?u.height/2+v/2:-u.height/2-v/2})`),ue(t,N),t.intersect=function(D){if(K.info("iconSquare intersect",t,D),!t.label)return ie.rect(t,D);const P=t.x??0,$=t.y??0,F=t.height??0;let L=[];return d?L=[{x:P-u.width/2,y:$-F/2},{x:P+u.width/2,y:$-F/2},{x:P+u.width/2,y:$-F/2+u.height+v},{x:P+g/2,y:$-F/2+u.height+v},{x:P+g/2,y:$+F/2},{x:P-g/2,y:$+F/2},{x:P-g/2,y:$-F/2+u.height+v},{x:P-u.width/2,y:$-F/2+u.height+v}]:L=[{x:P-g/2,y:$-F/2},{x:P+g/2,y:$-F/2},{x:P+g/2,y:$-F/2+f},{x:P+u.width/2,y:$-F/2+f},{x:P+u.width/2/2,y:$+F/2},{x:P-u.width/2,y:$+F/2},{x:P-u.width/2,y:$-F/2+f},{x:P-g/2,y:$-F/2+f}],ie.polygon(t,L,D)},c}x(Zb,"icon");async function Jb(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 ye(e,t,"icon-shape default"),d=20,f=t.label?8:0,g=t.pos==="t",{nodeBorder:m,mainBkg:b}=r,{stylesMap:y}=Ei(t),k=ae.svg(c),v=le(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const S=y.get("fill");v.stroke=S??b;const C=c.append("g");t.icon&&C.html(`<g>${await Xs(t.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const w=C.node().getBBox(),T=w.width,I=w.height,M=w.x,E=w.y,N=Math.max(T,I)*Math.SQRT2+d*2,D=k.circle(0,0,N,v),P=Math.max(N,u.width),$=N+u.height+f,F=k.rectangle(-P/2,-$/2,P,$,{...v,fill:"transparent",stroke:"none"}),L=c.insert(()=>D,":first-child"),R=c.insert(()=>F);return C.attr("transform",`translate(${-T/2-M},${g?u.height/2+f/2-I/2-E:-u.height/2-f/2-I/2-E})`),C.attr("style",`color: ${y.get("stroke")??m};`),h.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${g?-$/2:$/2-u.height})`),L.attr("transform",`translate(0,${g?u.height/2+f/2:-u.height/2-f/2})`),ue(t,R),t.intersect=function(W){return K.info("iconSquare intersect",t,W),ie.rect(t,W)},c}x(Jb,"iconCircle");async function ek(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:d}=await ye(e,t,"icon-shape default"),f=t.pos==="t",g=o+h*2,m=o+h*2,{nodeBorder:b,mainBkg:y}=r,{stylesMap:k}=Ei(t),v=-m/2,S=-g/2,C=t.label?8:0,w=ae.svg(c),T=le(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const I=k.get("fill");T.stroke=I??y;const M=w.path(cn(v,S,m,g,5),T),E=Math.max(m,u.width),N=g+u.height+C,D=w.rectangle(-E/2,-N/2,E,N,{...T,fill:"transparent",stroke:"none"}),P=c.insert(()=>M,":first-child").attr("class","icon-shape2"),$=c.insert(()=>D);if(t.icon){const F=c.append("g");F.html(`<g>${await Xs(t.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const L=F.node().getBBox(),R=L.width,W=L.height,X=L.x,_=L.y;F.attr("transform",`translate(${-R/2-X},${f?u.height/2+C/2-W/2-_:-u.height/2-C/2-W/2-_})`),F.attr("style",`color: ${k.get("stroke")??b};`)}return d.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${f?-N/2:N/2-u.height})`),P.attr("transform",`translate(0,${f?u.height/2+C/2:-u.height/2-C/2})`),ue(t,$),t.intersect=function(F){if(K.info("iconSquare intersect",t,F),!t.label)return ie.rect(t,F);const L=t.x??0,R=t.y??0,W=t.height??0;let X=[];return f?X=[{x:L-u.width/2,y:R-W/2},{x:L+u.width/2,y:R-W/2},{x:L+u.width/2,y:R-W/2+u.height+C},{x:L+m/2,y:R-W/2+u.height+C},{x:L+m/2,y:R+W/2},{x:L-m/2,y:R+W/2},{x:L-m/2,y:R-W/2+u.height+C},{x:L-u.width/2,y:R-W/2+u.height+C}]:X=[{x:L-m/2,y:R-W/2},{x:L+m/2,y:R-W/2},{x:L+m/2,y:R-W/2+g},{x:L+u.width/2,y:R-W/2+g},{x:L+u.width/2/2,y:R+W/2},{x:L-u.width/2,y:R+W/2},{x:L-u.width/2,y:R-W/2+g},{x:L-m/2,y:R-W/2+g}],ie.polygon(t,X,F)},c}x(ek,"iconRounded");async function tk(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:d}=await ye(e,t,"icon-shape default"),f=t.pos==="t",g=o+h*2,m=o+h*2,{nodeBorder:b,mainBkg:y}=r,{stylesMap:k}=Ei(t),v=-m/2,S=-g/2,C=t.label?8:0,w=ae.svg(c),T=le(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const I=k.get("fill");T.stroke=I??y;const M=w.path(cn(v,S,m,g,.1),T),E=Math.max(m,u.width),N=g+u.height+C,D=w.rectangle(-E/2,-N/2,E,N,{...T,fill:"transparent",stroke:"none"}),P=c.insert(()=>M,":first-child"),$=c.insert(()=>D);if(t.icon){const F=c.append("g");F.html(`<g>${await Xs(t.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const L=F.node().getBBox(),R=L.width,W=L.height,X=L.x,_=L.y;F.attr("transform",`translate(${-R/2-X},${f?u.height/2+C/2-W/2-_:-u.height/2-C/2-W/2-_})`),F.attr("style",`color: ${k.get("stroke")??b};`)}return d.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${f?-N/2:N/2-u.height})`),P.attr("transform",`translate(0,${f?u.height/2+C/2:-u.height/2-C/2})`),ue(t,$),t.intersect=function(F){if(K.info("iconSquare intersect",t,F),!t.label)return ie.rect(t,F);const L=t.x??0,R=t.y??0,W=t.height??0;let X=[];return f?X=[{x:L-u.width/2,y:R-W/2},{x:L+u.width/2,y:R-W/2},{x:L+u.width/2,y:R-W/2+u.height+C},{x:L+m/2,y:R-W/2+u.height+C},{x:L+m/2,y:R+W/2},{x:L-m/2,y:R+W/2},{x:L-m/2,y:R-W/2+u.height+C},{x:L-u.width/2,y:R-W/2+u.height+C}]:X=[{x:L-m/2,y:R-W/2},{x:L+m/2,y:R-W/2},{x:L+m/2,y:R-W/2+g},{x:L+u.width/2,y:R-W/2+g},{x:L+u.width/2/2,y:R+W/2},{x:L-u.width/2,y:R+W/2},{x:L-u.width/2,y:R-W/2+g},{x:L-m/2,y:R-W/2+g}],ie.polygon(t,X,F)},c}x(tk,"iconSquare");async function rk(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:d,label:f}=await ye(e,t,"image-shape default"),g=t.pos==="t",m=-c/2,b=-u/2,y=t.label?8:0,k=ae.svg(h),v=le(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const S=k.rectangle(m,b,c,u,v),C=Math.max(c,d.width),w=u+d.height+y,T=k.rectangle(-C/2,-w/2,C,w,{...v,fill:"none",stroke:"none"}),I=h.insert(()=>S,":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 f.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${g?-u/2-d.height/2-y/2:u/2-d.height/2+y/2})`),I.attr("transform",`translate(0,${g?d.height/2+y/2:-d.height/2-y/2})`),ue(t,M),t.intersect=function(E){if(K.info("iconSquare intersect",t,E),!t.label)return ie.rect(t,E);const N=t.x??0,D=t.y??0,P=t.height??0;let $=[];return g?$=[{x:N-d.width/2,y:D-P/2},{x:N+d.width/2,y:D-P/2},{x:N+d.width/2,y:D-P/2+d.height+y},{x:N+c/2,y:D-P/2+d.height+y},{x:N+c/2,y:D+P/2},{x:N-c/2,y:D+P/2},{x:N-c/2,y:D-P/2+d.height+y},{x:N-d.width/2,y:D-P/2+d.height+y}]:$=[{x:N-c/2,y:D-P/2},{x:N+c/2,y:D-P/2},{x:N+c/2,y:D-P/2+u},{x:N+d.width/2,y:D-P/2+u},{x:N+d.width/2/2,y:D+P/2},{x:N-d.width/2,y:D+P/2},{x:N-d.width/2,y:D-P/2+u},{x:N-c/2,y:D-P/2+u}],ie.polygon(t,$,E)},h}x(rk,"imageSquare");async function nk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await ye(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=ae.svg(i),d=le(t,{}),f=Ne(l),g=h.path(f,d);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(nk,"inv_trapezoid");async function ll(e,t,r){const{labelStyles:n,nodeStyles:i}=ce(t);t.labelStyle=n;const{shapeSvg:s,bbox:a}=await ye(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:d,ry:f}=t;const{cssStyles:g}=t;if(r?.rx&&r.ry&&(d=r.rx,f=r.ry),t.look==="handDrawn"){const m=ae.svg(s),b=le(t,{}),y=d||f?m.path(cn(c,u,o,l,d||0),b):m.rectangle(c,u,o,l,b);h=s.insert(()=>y,":first-child"),h.attr("class","basic label-container").attr("style",Nt(g))}else h=s.insert("rect",":first-child"),h.attr("class","basic label-container").attr("style",i).attr("rx",Nt(d)).attr("ry",Nt(f)).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(ll,"drawRect");async function ik(e,t){const{shapeSvg:r,bbox:n,label:i}=await ye(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(ik,"labelRect");async function sk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await ye(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=ae.svg(i),d=le(t,{}),f=Ne(l),g=h.path(f,d);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,"lean_left");async function ak(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await ye(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=ae.svg(i),d=le(t,{}),f=Ne(l),g=h.path(f,d);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(ak,"lean_right");function ok(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=ae.svg(i),h=le(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");const d=Ne(c),f=u.path(d,h),g=i.insert(()=>f,":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 K.info("lightningBolt intersect",t,m),ie.polygon(t,c,m)},i}x(ok,"lightningBolt");var B5=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"),D5=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"),P5=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 lk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await ye(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 d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const g=ae.svg(i),m=D5(0,0,o,u,l,c,h),b=P5(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"),d=i.insert(()=>k,":first-child"),d.attr("class","basic label-container"),f&&d.attr("style",f)}else{const g=B5(0,0,o,u,l,c,h);d=i.insert("path",":first-child").attr("d",g).attr("class","basic label-container").attr("style",Nt(f)).attr("style",n)}return d.attr("label-offset-y",c),d.attr("transform",`translate(${-o/2}, ${-(u/2+c)})`),ue(t,d),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(lk,"linedCylinder");async function ck(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await ye(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,d=ae.svg(i),f=le(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.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=d.polygon(g.map(y=>[y.x,y.y]),f),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(ck,"linedWaveEdgedRect");async function uk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await ye(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:d}=t,f=ae.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=f.path(y,g),v=Ne(b),S=f.path(v,{...g,fill:"none"}),C=i.insert(()=>S,":first-child");return C.insert(()=>k,":first-child"),C.attr("class","basic label-container"),d&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",d),n&&t.look!=="handDrawn"&&C.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,C),t.intersect=function(w){return ie.polygon(t,m,w)},i}x(uk,"multiRect");async function hk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await ye(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,d=-u/2,f=5,{cssStyles:g}=t,m=sn(h-f,d+u+f,h+o-f,d+u+f,c,.8),b=m?.[m.length-1],y=[{x:h-f,y:d+f},{x:h-f,y:d+u+f},...m,{x:h+o-f,y:b.y-f},{x:h+o,y:b.y-f},{x:h+o,y:b.y-2*f},{x:h+o+f,y:b.y-2*f},{x:h+o+f,y:d-f},{x:h+f,y:d-f},{x:h+f,y:d},{x:h,y:d},{x:h,y:d+f}],k=[{x:h,y:d+f},{x:h+o-f,y:d+f},{x:h+o-f,y:b.y-f},{x:h+o,y:b.y-f},{x:h+o,y:d},{x:h,y:d}],v=ae.svg(i),S=le(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const C=Ne(y),w=v.path(C,S),T=Ne(k),I=v.path(T,S),M=i.insert(()=>w,":first-child");return M.insert(()=>I),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)-f-(s.x-(s.left??0))}, ${-(s.height/2)+f-c/2-(s.y-(s.top??0))})`),ue(t,M),t.intersect=function(E){return ie.polygon(t,y,E)},i}x(hk,"multiWaveEdgedRectangle");async function dk(e,t,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=ce(t);t.labelStyle=n,t.useHtmlLabels||At().flowchart?.htmlLabels!==!1||(t.centerLabel=!0);const{shapeSvg:a,bbox:o,label:l}=await ye(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,d=-u/2,{cssStyles:f}=t,g=ae.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,d,c,u,m),y=a.insert(()=>b,":first-child");return y.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",f),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(dk,"note");var R5=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 fk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await ye(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:d}=t;if(t.look==="handDrawn"){const f=ae.svg(i),g=le(t,{}),m=R5(0,0,l),b=f.path(m,g);h=i.insert(()=>b,":first-child").attr("transform",`translate(${-l/2+c}, ${l/2})`),d&&h.attr("style",d)}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(f,g){const m=f.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(f,b,g);return{x:y.x-.5,y:y.y-.5}},t.intersect=function(f){return this.calcIntersect(t,f)},i}x(fk,"question");async function pk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await ye(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,d=[{x:c+h,y:u},{x:c,y:0},{x:c+h,y:-u},{x:-c,y:-u},{x:-c,y:u}],{cssStyles:f}=t,g=ae.svg(i),m=le(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const b=Ne(d),y=g.path(b,m),k=i.insert(()=>y,":first-child");return 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),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,d,v)},i}x(pk,"rect_left_inv_arrow");async function gk(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 Sn(c,t.labelStyle,!0,!0));let h={width:0,height:0};if(pt(Re()?.flowchart?.htmlLabels)){const I=u.children[0],M=$e(u);h=I.getBoundingClientRect(),M.attr("width",h.width),M.attr("height",h.height)}K.info("Text 2",l);const d=l||[],f=u.getBBox(),g=o.node().appendChild(await Sn(d.join?d.join("<br/>"):d,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>f.width?0:(f.width-h.width)/2)+", "+(f.height+y+5)+")"),$e(u).attr("transform","translate( "+(h.width<f.width?0:-(f.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),S=-h.width/2-y,C=-h.height/2-y;let w,T;if(t.look==="handDrawn"){const I=ae.svg(s),M=le(t,{}),E=I.path(cn(S,C,k,v,t.rx||0),M),N=I.line(-h.width/2-y,-h.height/2-y+f.height+y,h.width/2+y,-h.height/2-y+f.height+y,M);T=s.insert(()=>(K.debug("Rough node insert CXC",E),N),":first-child"),w=s.insert(()=>(K.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+f.height+y).attr("y2",-h.height/2-y+f.height+y);return ue(t,w),t.intersect=function(I){return ie.rect(t,I)},s}x(gk,"rectWithTitle");function as(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,d=(n-t)/2,f=h/i,g=d/s,m=Math.sqrt(f**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 C=Math.atan2((n-k)/s,(r-y)/i)-v;a&&C<0&&(C+=2*Math.PI),!a&&C>0&&(C-=2*Math.PI);const w=[];for(let T=0;T<20;T++){const I=T/19,M=v+I*C,E=y+i*Math.cos(M),N=k+s*Math.sin(M);w.push({x:E,y:N})}return w}x(as,"generateArcPoints");async function mk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await ye(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:d}=t,f=ae.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},...as(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},...as(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},...as(-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},...as(-l/2,-c/2+h,-l/2+h,-c/2,u,u,!0)],b=Ne(m),y=f.path(b,g),k=i.insert(()=>y,":first-child");return k.attr("class","basic label-container outer-path"),d&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",d),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(mk,"roundedRect");async function xk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await ye(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:d}=t,f=ae.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=f.polygon(m.map(k=>[k.x,k.y]),g),y=i.insert(()=>b,":first-child");return y.attr("class","basic label-container").attr("style",Nt(d)),n&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",n),d&&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(xk,"shadedProcess");async function yk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await ye(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,d=ae.svg(i),f=le(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.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=d.path(m,f),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(yk,"slopedRect");async function bk(e,t){const r={rx:0,ry:0,labelPaddingX:t.labelPaddingX??(t?.padding||0)*2,labelPaddingY:(t?.padding||0)*1};return ll(e,t,r)}x(bk,"squareRect");async function kk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await ye(e,t,pe(t)),a=s.height+t.padding,o=s.width+a/4+t.padding,l=a/2,{cssStyles:c}=t,u=ae.svg(i),h=le(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");const d=[{x:-o/2+l,y:-a/2},{x:o/2-l,y:-a/2},...$s(-o/2+l,0,l,50,90,270),{x:o/2-l,y:a/2},...$s(o/2-l,0,l,50,270,450)],f=Ne(d),g=u.path(f,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,d,b)},i}x(kk,"stadium");async function wk(e,t){return ll(e,t,{rx:5,ry:5})}x(wk,"state");function vk(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=ae.svg(c),h=le(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");const d=u.circle(0,0,14,{...h,stroke:a,strokeWidth:2}),f=o??l,g=u.circle(0,0,5,{...h,fill:f,stroke:f,strokeWidth:2,fillStyle:"solid"}),m=c.insert(()=>d,":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(vk,"stateEnd");function Ck(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=ae.svg(i).circle(0,0,14,J$(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(Ck,"stateStart");async function Sk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await ye(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 d=ae.svg(i),f=le(t,{}),g=d.rectangle(c-8,u,o+16,l,f),m=d.line(c,u,c,u+l,f),b=d.line(c+o,u,c+o,u+l,f);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",Nt(k)),ue(t,y)}else{const d=un(i,o,l,h);n&&d.attr("style",n),ue(t,d)}return t.intersect=function(d){return ie.polygon(t,h,d)},i}x(Sk,"subroutine");async function _k(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await ye(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:d}=t,f=ae.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=f.path(y,g),v=Ne(b),S=f.path(v,{...g,fillStyle:"solid"}),C=i.insert(()=>S,":first-child");return C.insert(()=>k,":first-child"),C.attr("class","basic label-container"),d&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",d),n&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",n),ue(t,C),t.intersect=function(w){return ie.polygon(t,m,w)},i}x(_k,"taggedRect");async function Tk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await ye(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,d=l+c,{cssStyles:f}=t,g=ae.svg(i),m=le(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const b=[{x:-o/2-o/2*.1,y:d/2},...sn(-o/2-o/2*.1,d/2,o/2+o/2*.1,d/2,c,.8),{x:o/2+o/2*.1,y:-d/2},{x:-o/2-o/2*.1,y:-d/2}],y=-o/2+o/2*.1,k=-d/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)],S=Ne(b),C=g.path(S,m),w=Ne(v),T=g.path(w,{...m,fillStyle:"solid"}),I=i.insert(()=>T,":first-child");return I.insert(()=>C,":first-child"),I.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",f),n&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",n),I.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,I),t.intersect=function(M){return ie.polygon(t,b,M)},i}x(Tk,"taggedWaveEdgedRectangle");async function Ek(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await ye(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(Ek,"text");var F5=x((e,t,r,n,i,s)=>`M${e},${t}
|
|
321
|
-
a${i},${s} 0,0,1 0,${-n}
|
|
322
|
-
l${r},0
|
|
323
|
-
a${i},${s} 0,0,1 0,${n}
|
|
324
|
-
M${r},${-n}
|
|
325
|
-
a${i},${s} 0,0,0 0,${n}
|
|
326
|
-
l${-r},0`,"createCylinderPathD"),O5=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"),z5=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 Ak(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a,halfPadding:o}=await ye(e,t,pe(t)),l=t.look==="neo"?o*2:o,c=s.height+l,u=c/2,h=u/(2.5+c/50),d=s.width+h+l,{cssStyles:f}=t;let g;if(t.look==="handDrawn"){const m=ae.svg(i),b=O5(0,0,d,c,h,u),y=z5(0,0,d,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"),f&&g.attr("style",f)}else{const m=F5(0,0,d,c,h,u);g=i.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Nt(f)).attr("style",n),g.attr("class","basic label-container"),f&&g.selectAll("path").attr("style",f),n&&g.selectAll("path").attr("style",n)}return g.attr("label-offset-x",h),g.attr("transform",`translate(${-d/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(Ak,"tiltedCylinder");async function Mk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await ye(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=ae.svg(i),d=le(t,{}),f=Ne(l),g=h.path(f,d);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(Mk,"trapezoid");async function Nk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await ye(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=ae.svg(i),d=le(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=[{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(f),m=h.path(g,d),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,f,y)},i}x(Nk,"trapezoidalPentagon");async function Lk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await ye(e,t,pe(t)),o=pt(Re().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:d}=t,f=ae.svg(i),g=le(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=Ne(h),b=f.path(m,g),y=i.insert(()=>b,":first-child").attr("transform",`translate(${-c/2}, ${c/2})`);return d&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",d),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 K.info("Triangle intersect",t,h,k),ie.polygon(t,h,k)},i}x(Lk,"triangle");async function Ik(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await ye(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,f=70-o,g=f>0?f/2:0,m=ae.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),S=i.insert(()=>v,":first-child");return S.attr("class","basic label-container"),h&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",h),n&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.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,S),t.intersect=function(C){return ie.polygon(t,y,C)},i}x(Ik,"waveEdgedRectangle");async function $k(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s}=await ye(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,d=c;h>d*u?d=h/u:h=d*u,h=Math.max(h,a),d=Math.max(d,o);const f=Math.min(d*.2,d/4),g=d+f*2,{cssStyles:m}=t,b=ae.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,f,1),{x:h/2,y:-g/2},...sn(h/2,-g/2,-h/2,-g/2,f,-1)],v=Ne(k),S=b.path(v,y),C=i.insert(()=>S,":first-child");return C.attr("class","basic label-container"),m&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",m),n&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",n),ue(t,C),t.intersect=function(w){return ie.polygon(t,k,w)},i}x($k,"waveRectangle");async function jk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await ye(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:d}=t,f=ae.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}
|
|
327
|
-
M${u-c},${h} L${u+o},${h}
|
|
328
|
-
M${u},${h-c} L${u},${h+l}`;t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const y=f.path(b,g),k=i.insert(()=>y,":first-child");return k.attr("transform",`translate(${c/2}, ${c/2})`),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),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(jk,"windowPane");async function Gh(e,t){const r=t;if(r.alias&&(t.label=r.alias),t.look==="handDrawn"){const{themeVariables:te}=At(),{background:A}=te,B={...t,id:t.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${A}`]};await Gh(e,B)}const n=At();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};qr(t.label,n)+te.labelPaddingX*2<n.er.minEntityWidth&&(t.width=n.er.minEntityWidth);const A=await ll(e,t,te);if(!pt(n.htmlLabels)){const B=A.select("text"),Y=B.node()?.getBBox();B.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 Jn(u,t.label??"",n,0,0,["name"],o);h.height+=s;let d=0;const f=[],g=[];let m=0,b=0,y=0,k=0,v=!0,S=!0;for(const te of r.attributes){const A=await Jn(u,te.type,n,0,d,["attribute-type"],o);m=Math.max(m,A.width+i);const B=await Jn(u,te.name,n,0,d,["attribute-name"],o);b=Math.max(b,B.width+i);const Y=await Jn(u,te.keys.join(),n,0,d,["attribute-keys"],o);y=Math.max(y,Y.width+i);const U=await Jn(u,te.comment,n,0,d,["attribute-comment"],o);k=Math.max(k,U.width+i);const q=Math.max(A.height,B.height,Y.height,U.height)+s;g.push({yOffset:d,rowHeight:q}),d+=q}let C=4;y<=i&&(v=!1,y=0,C--),k<=i&&(S=!1,k=0,C--);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/C,b+=te/C,y>0&&(y+=te/C),k>0&&(k+=te/C)}const T=m+b+y+k,I=ae.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),P=-N/2,$=-D/2;u.selectAll("g:not(:first-child)").each((te,A,B)=>{const Y=$e(B[A]),U=Y.attr("transform");let q=0,G=0;if(U){const re=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(U);re&&(q=parseFloat(re[1]),G=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(${P+i/2+q}, ${G+$+h.height+s/2})`)}),u.select(".name").attr("transform","translate("+-h.width/2+", "+($+s/2)+")");const F=I.rectangle(P,$,N,D,M),L=u.insert(()=>F,":first-child").attr("style",a.join("")),{themeVariables:R}=At(),{rowEven:W,rowOdd:X,nodeBorder:_}=R;f.push(0);for(const[te,A]of g.entries()){const Y=(te+1)%2===0&&A.yOffset!==0,U=I.rectangle(P,h.height+$+A?.yOffset,N,A?.rowHeight,{...M,fill:Y?W:X,stroke:_});u.insert(()=>U,"g.label").attr("style",a.join("")).attr("class",`row-rect-${Y?"even":"odd"}`)}let j=I.line(P,h.height+$,N+P,h.height+$,M);u.insert(()=>j).attr("class","divider"),j=I.line(m+P,h.height+$,m+P,D+$,M),u.insert(()=>j).attr("class","divider"),v&&(j=I.line(m+b+P,h.height+$,m+b+P,D+$,M),u.insert(()=>j).attr("class","divider")),S&&(j=I.line(m+b+y+P,h.height+$,m+b+y+P,D+$,M),u.insert(()=>j).attr("class","divider"));for(const te of f)j=I.line(P,h.height+$+te,N+P,h.height+$+te,M),u.insert(()=>j).attr("class","divider");if(ue(t,L),l&&t.look!=="handDrawn"){const A=l.split(";")?.filter(B=>B.includes("stroke"))?.map(B=>`${B}`).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(Gh,"erBox");async function Jn(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!==yf(t)&&(t=yf(t),t=t.replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await ln(o,t,{width:qr(t,r)+100,style:a,useHtmlLabels:r.htmlLabels},r));if(t.includes("<")||t.includes(">")){let u=l.children[0];for(u.textContent=u.textContent.replaceAll("<","<").replaceAll(">",">");u.childNodes[0];)u=u.childNodes[0],u.textContent=u.textContent.replaceAll("<","<").replaceAll(">",">")}let c=l.getBBox();if(pt(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(Jn,"addText");async function Bk(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,d=0,f=0;if(o=a.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const k=t.annotations[0];await os(o,{text:`«${k}»`},0),h=o.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await os(l,t,0,["font-weight: bolder"]);const g=l.node().getBBox();d=g.height,c=a.insert("g").attr("class","members-group text");let m=0;for(const k of t.members){const v=await os(c,k,m,[k.parseClassifier()]);m+=v+s}f=c.node().getBBox().height,f<=0&&(f=i/2),u=a.insert("g").attr("class","methods-group text");let b=0;for(const k of t.methods){const v=await os(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+d+i*2})`),y=a.node().getBBox(),u.attr("transform",`translate(0, ${h+d+(f?f+i*4:i*2)})`),y=a.node().getBBox(),{shapeSvg:a,bbox:y}}x(Bk,"textHelper");async function os(e,t,r,n=[]){const i=e.insert("g").attr("class","label").attr("style",n.join("; ")),s=At();let a="useHtmlLabels"in t?t.useHtmlLabels:pt(s.htmlLabels)??!0,o="";"text"in t?o=t.text:o=t.label,!a&&o.startsWith("\\")&&(o=o.substring(1)),xi(o)&&(a=!0);const l=await ln(i,nh(On(o)),{width:qr(o,s)+50,classes:"markdown-node-label",useHtmlLabels:a},s);let c,u=1;if(a){const h=l.children[0],d=$e(l);u=h.innerHTML.split("<br>").length,h.innerHTML.includes("</math>")&&(u+=h.innerHTML.split("<mrow>").length-1);const f=h.getElementsByTagName("img");if(f){const g=o.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...f].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,S=parseInt(k,10)*5+"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(),d.attr("width",c.width),d.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(">"))&&(h.textContent=o[0]+o.substring(1).replaceAll(">",">").replaceAll("<","<").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(os,"addText");async function Dk(e,t){const r=Re(),n=r.class.padding??12,i=n,s=t.useHtmlLabels??pt(r.htmlLabels)??!0,a=t;a.annotations=a.annotations??[],a.members=a.members??[],a.methods=a.methods??[];const{shapeSvg:o,bbox:l}=await Bk(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 d=a.members.length===0&&a.methods.length===0&&!r.class?.hideEmptyMembersBox,f=ae.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=f.rectangle(y-n,k-n-(d?n:a.members.length===0&&a.methods.length===0?-n/2:0),m+2*n,b+2*n+(d?n*2:a.members.length===0&&a.methods.length===0?-n:0),g),S=o.insert(()=>v,":first-child");S.attr("class","basic label-container");const C=S.node().getBBox();o.selectAll(".text").each((M,E,N)=>{const D=$e(N[E]),P=D.attr("transform");let $=0;if(P){const W=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(P);W&&($=parseFloat(W[2]))}let F=$+k+n-(d?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(R,W,X){window.getComputedStyle(X[W]).textAnchor==="middle"&&(L=0)})),D.attr("transform",`translate(${L}, ${F})`)});const w=o.select(".annotation-group").node().getBBox().height-(d?n/2:0)||0,T=o.select(".label-group").node().getBBox().height-(d?n/2:0)||0,I=o.select(".members-group").node().getBBox().height-(d?n/2:0)||0;if(a.members.length>0||a.methods.length>0||d){const M=f.line(C.x,w+T+k+n,C.x+C.width,w+T+k+n,g);o.insert(()=>M).attr("class","divider").attr("style",h)}if(d||a.members.length>0||a.methods.length>0){const M=f.line(C.x,w+T+I+k+i*2+n,C.x+C.width,w+T+I+k+n+i*2,g);o.insert(()=>M).attr("class","divider").attr("style",h)}if(a.look!=="handDrawn"&&o.selectAll("path").attr("style",h),S.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,S),t.intersect=function(M){return ie.rect(t,M)},o}x(Dk,"classBox");async function Pk(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 br(u,`<<${i.type}>>`,0,t.labelStyle):h=await br(u,"<<Element>>",0,t.labelStyle);let d=h;const f=await br(u,i.name,d,t.labelStyle+"; font-weight: bold;");if(d+=f+o,l){const w=await br(u,`${i.requirementId?`ID: ${i.requirementId}`:""}`,d,t.labelStyle);d+=w;const T=await br(u,`${i.text?`Text: ${i.text}`:""}`,d,t.labelStyle);d+=T;const I=await br(u,`${i.risk?`Risk: ${i.risk}`:""}`,d,t.labelStyle);d+=I,await br(u,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,d,t.labelStyle)}else{const w=await br(u,`${s.type?`Type: ${s.type}`:""}`,d,t.labelStyle);d+=w,await br(u,`${s.docRef?`Doc Ref: ${s.docRef}`:""}`,d,t.labelStyle)}const g=(u.node()?.getBBox().width??200)+a,m=(u.node()?.getBBox().height??200)+a,b=-g/2,y=-m/2,k=ae.svg(u),v=le(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const S=k.rectangle(b,y,g,m,v),C=u.insert(()=>S,":first-child");if(C.attr("class","basic label-container").attr("style",n),u.selectAll(".label").each((w,T,I)=>{const M=$e(I[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 P=D-m/2;let $=b+a/2;(T===0||T===1)&&($=N),M.attr("transform",`translate(${$}, ${P+a})`)}),d>h+f+o){const w=k.line(b,y+h+f+o,b+g,y+h+f+o,v);u.insert(()=>w).attr("style",n)}return ue(t,C),t.intersect=function(w){return ie.rect(t,w)},u}x(Pk,"requirementBox");async function br(e,t,r,n=""){if(t==="")return 0;const i=e.insert("g").attr("class","label").attr("style",n),s=Re(),a=s.htmlLabels??!0,o=await ln(i,nh(On(t)),{width:qr(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(">",">").replaceAll("<","<"),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(br,"addText");var W5=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 Rk(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 ye(e,t,pe(t)),u=t.padding||10;let h="",d;"ticket"in t&&t.ticket&&r?.kanban?.ticketBaseUrl&&(h=r?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),d=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",h).attr("target","_blank"));const f={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1};let g,m;d?{label:g,bbox:m}=await tc(d,"ticket"in t&&t.ticket||"",f):{label:g,bbox:m}=await tc(o,"ticket"in t&&t.ticket||"",f);const{label:b,bbox:y}=await tc(o,"assigned"in t&&t.assigned||"",f);t.width=a;const k=10,v=t?.width||0,S=Math.max(m.height,y.height)/2,C=Math.max(l.height+k*2,t?.height||0)+S,w=-v/2,T=-C/2;c.attr("transform","translate("+(u-v/2)+", "+(-S-l.height/2)+")"),g.attr("transform","translate("+(u-v/2)+", "+(-S+l.height/2)+")"),b.attr("transform","translate("+(u+v/2-y.width-2*s)+", "+(-S+l.height/2)+")");let I;const{rx:M,ry:E}=t,{cssStyles:N}=t;if(t.look==="handDrawn"){const D=ae.svg(o),P=le(t,{}),$=M||E?D.path(cn(w,T,v,C,M||0),P):D.rectangle(w,T,v,C,P);I=o.insert(()=>$,":first-child"),I.attr("class","basic label-container").attr("style",N||null)}else{I=o.insert("rect",":first-child"),I.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",C);const D="priority"in t&&t.priority;if(D){const P=o.append("line"),$=w+2,F=T+Math.floor((M??0)/2),L=T+C-Math.floor((M??0)/2);P.attr("x1",$).attr("y1",F).attr("x2",$).attr("y2",L).attr("stroke-width","4").attr("stroke",W5(D))}}return ue(t,I),t.height=C,t.intersect=function(D){return ie.rect(t,D)},o}x(Rk,"kanbanItem");async function Fk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:a,label:o}=await ye(e,t,pe(t)),l=s.width+10*a,c=s.height+8*a,u=.15*l,{cssStyles:h}=t,d=s.width+20,f=s.height+20,g=Math.max(l,d),m=Math.max(c,f);o.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`);let b;const y=`M0 0
|
|
329
|
-
a${u},${u} 1 0,0 ${g*.25},${-1*m*.1}
|
|
330
|
-
a${u},${u} 1 0,0 ${g*.25},0
|
|
331
|
-
a${u},${u} 1 0,0 ${g*.25},0
|
|
332
|
-
a${u},${u} 1 0,0 ${g*.25},${m*.1}
|
|
333
|
-
|
|
334
|
-
a${u},${u} 1 0,0 ${g*.15},${m*.33}
|
|
335
|
-
a${u*.8},${u*.8} 1 0,0 0,${m*.34}
|
|
336
|
-
a${u},${u} 1 0,0 ${-1*g*.15},${m*.33}
|
|
337
|
-
|
|
338
|
-
a${u},${u} 1 0,0 ${-1*g*.25},${m*.15}
|
|
339
|
-
a${u},${u} 1 0,0 ${-1*g*.25},0
|
|
340
|
-
a${u},${u} 1 0,0 ${-1*g*.25},0
|
|
341
|
-
a${u},${u} 1 0,0 ${-1*g*.25},${-1*m*.15}
|
|
342
|
-
|
|
343
|
-
a${u},${u} 1 0,0 ${-1*g*.1},${-1*m*.33}
|
|
344
|
-
a${u*.8},${u*.8} 1 0,0 0,${-1*m*.34}
|
|
345
|
-
a${u},${u} 1 0,0 ${g*.1},${-1*m*.33}
|
|
346
|
-
H0 V0 Z`;if(t.look==="handDrawn"){const k=ae.svg(i),v=le(t,{}),S=k.path(y,v);b=i.insert(()=>S,":first-child"),b.attr("class","basic label-container").attr("style",Nt(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 K.info("Bang intersect",t,k),ie.rect(t,k)},i}x(Fk,"bang");async function Ok(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:a,label:o}=await ye(e,t,pe(t)),l=s.width+2*a,c=s.height+2*a,u=.15*l,h=.25*l,d=.35*l,f=.2*l,{cssStyles:g}=t;let m;const b=`M0 0
|
|
347
|
-
a${u},${u} 0 0,1 ${l*.25},${-1*l*.1}
|
|
348
|
-
a${d},${d} 1 0,1 ${l*.4},${-1*l*.1}
|
|
349
|
-
a${h},${h} 1 0,1 ${l*.35},${l*.2}
|
|
350
|
-
|
|
351
|
-
a${u},${u} 1 0,1 ${l*.15},${c*.35}
|
|
352
|
-
a${f},${f} 1 0,1 ${-1*l*.15},${c*.65}
|
|
353
|
-
|
|
354
|
-
a${h},${u} 1 0,1 ${-1*l*.25},${l*.15}
|
|
355
|
-
a${d},${d} 1 0,1 ${-1*l*.5},0
|
|
356
|
-
a${u},${u} 1 0,1 ${-1*l*.25},${-1*l*.15}
|
|
357
|
-
|
|
358
|
-
a${u},${u} 1 0,1 ${-1*l*.1},${-1*c*.35}
|
|
359
|
-
a${f},${f} 1 0,1 ${l*.1},${-1*c*.65}
|
|
360
|
-
H0 V0 Z`;if(t.look==="handDrawn"){const y=ae.svg(i),k=le(t,{}),v=y.path(b,k);m=i.insert(()=>v,":first-child"),m.attr("class","basic label-container").attr("style",Nt(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 K.info("Cloud intersect",t,y),ie.rect(t,y)},i}x(Ok,"cloud");async function zk(e,t){const{labelStyles:r,nodeStyles:n}=ce(t);t.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:a,label:o}=await ye(e,t,pe(t)),l=s.width+8*a,c=s.height+2*a,u=5,h=`
|
|
361
|
-
M${-l/2} ${c/2-u}
|
|
362
|
-
v${-c+2*u}
|
|
363
|
-
q0,-${u} ${u},-${u}
|
|
364
|
-
h${l-2*u}
|
|
365
|
-
q${u},0 ${u},${u}
|
|
366
|
-
v${c-2*u}
|
|
367
|
-
q0,${u} -${u},${u}
|
|
368
|
-
h${-l+2*u}
|
|
369
|
-
q-${u},0 -${u},-${u}
|
|
370
|
-
Z
|
|
371
|
-
`,d=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,d),t.calcIntersect=function(f,g){return ie.rect(f,g)},t.intersect=function(f){return ie.rect(t,f)},i}x(zk,"defaultMindmapNode");async function Wk(e,t){const r={padding:t.padding??0};return Vh(e,t,r)}x(Wk,"mindmapCircle");var H5=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:bk},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:mk},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:kk},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:Sk},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Hb},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Vh},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Fk},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Ok},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:fk},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Kb},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:ak},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:sk},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:Mk},{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:nk},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Ub},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:Ek},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Bb},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:xk},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:Ck},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:vk},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Yb},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Qb},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Fb},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Ob},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:zb},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:ok},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:Ik},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Xb},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:Ak},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:lk},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Wb},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:qb},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:Lk},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:jk},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Vb},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:Nk},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Gb},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:yk},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:hk},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:uk},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:jb},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Rb},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:Tk},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:_k},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:$k},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:pk},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:ck}],q5=x(()=>{const t=[...Object.entries({state:wk,choice:Db,note:dk,rectWithTitle:gk,labelRect:ik,iconSquare:tk,iconCircle:Jb,icon:Zb,iconRounded:ek,imageSquare:rk,anchor:$b,kanbanItem:Rk,mindmapCircle:Wk,defaultMindmapNode:zk,classBox:Dk,erBox:Gh,requirementBox:Pk}),...H5.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),Hk=q5();function U5(e){return e in Hk}x(U5,"isValidShape");var cl=new Map;async function qk(e,t,r){let n,i;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const s=t.shape?Hk[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),cl.set(t.id,n),t.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}x(qk,"insertNode");var j6=x((e,t)=>{cl.set(t.id,e)},"setNodeElem"),B6=x(()=>{cl.clear()},"clear"),D6=x(e=>{const t=cl.get(e.id);K.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"),V5=x((e,t,r,n,i,s)=>{t.arrowTypeStart&&Tp(e,"start",t.arrowTypeStart,r,n,i,s),t.arrowTypeEnd&&Tp(e,"end",t.arrowTypeEnd,r,n,i,s)},"addEdgeMarkers"),G5={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}},Tp=x((e,t,r,n,i,s,a)=>{const o=G5[r];if(!o){K.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,"_"),d=`${u}_${h}`;if(!document.getElementById(d)){const f=document.getElementById(u);if(f){const g=f.cloneNode(!0);g.id=d,g.querySelectorAll("path, circle, line").forEach(b=>{b.setAttribute("stroke",a),o.fill&&b.setAttribute("fill",a)}),f.parentNode?.appendChild(g)}}e.attr(`marker-${t}`,`url(${n}#${d})`)}else e.attr(`marker-${t}`,`url(${n}#${u})`)},"addEdgeMarker"),Lo=new Map,wt=new Map,P6=x(()=>{Lo.clear(),wt.clear()},"clear"),wa=x(e=>e?e.reduce((r,n)=>r+";"+n,""):"","getLabelStyles"),Y5=x(async(e,t)=>{let r=pt(Re().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});K.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+")"),Lo.set(t.id,s),t.width=o.width,t.height=o.height;let l;if(t.startLabelLeft){const c=await Sn(t.startLabelLeft,wa(t.labelStyle)),u=e.insert("g").attr("class","edgeTerminals"),h=u.insert("g").attr("class","inner");l=h.node().appendChild(c);const d=c.getBBox();h.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),wt.get(t.id)||wt.set(t.id,{}),wt.get(t.id).startLeft=u,ls(l,t.startLabelLeft)}if(t.startLabelRight){const c=await Sn(t.startLabelRight,wa(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 d=c.getBBox();h.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),wt.get(t.id)||wt.set(t.id,{}),wt.get(t.id).startRight=u,ls(l,t.startLabelRight)}if(t.endLabelLeft){const c=await Sn(t.endLabelLeft,wa(t.labelStyle)),u=e.insert("g").attr("class","edgeTerminals"),h=u.insert("g").attr("class","inner");l=h.node().appendChild(c);const d=c.getBBox();h.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),u.node().appendChild(c),wt.get(t.id)||wt.set(t.id,{}),wt.get(t.id).endLeft=u,ls(l,t.endLabelLeft)}if(t.endLabelRight){const c=await Sn(t.endLabelRight,wa(t.labelStyle)),u=e.insert("g").attr("class","edgeTerminals"),h=u.insert("g").attr("class","inner");l=h.node().appendChild(c);const d=c.getBBox();h.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),u.node().appendChild(c),wt.get(t.id)||wt.set(t.id,{}),wt.get(t.id).endRight=u,ls(l,t.endLabelRight)}return i},"insertEdgeLabel");function ls(e,t){Re().flowchart.htmlLabels&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}x(ls,"setTerminalWidth");var X5=x((e,t)=>{K.debug("Moving label abc88 ",e.id,e.label,Lo.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const n=Re(),{subGraphTitleTotalMargin:i}=Ch(n);if(e.label){const s=Lo.get(e.id);let a=e.x,o=e.y;if(r){const l=hr.calcLabelPosition(r);K.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=wt.get(e.id).startLeft;let a=e.x,o=e.y;if(r){const l=hr.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=wt.get(e.id).startRight;let a=e.x,o=e.y;if(r){const l=hr.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=wt.get(e.id).endLeft;let a=e.x,o=e.y;if(r){const l=hr.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=wt.get(e.id).endRight;let a=e.x,o=e.y;if(r){const l=hr.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}},"positionEdgeLabel"),K5=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"),Q5=x((e,t,r)=>{K.debug(`intersection calc abc89:
|
|
372
|
-
outsidePoint: ${JSON.stringify(t)}
|
|
373
|
-
insidePoint : ${JSON.stringify(r)}
|
|
374
|
-
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 d={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&&(d.x=t.x,d.y=t.y),u===0&&(d.x=t.x),c===0&&(d.y=t.y),K.debug(`abc89 top/bottom calc, Q ${c}, q ${h}, R ${u}, r ${o}`,d),d}else{r.x<t.x?o=t.x-a-n:o=n-a-t.x;let h=c*o/u,d=r.x<t.x?r.x+u-o:r.x-u+o,f=r.y<t.y?r.y+h:r.y-h;return K.debug(`sides calc abc89, Q ${c}, q ${h}, R ${u}, r ${o}`,{_x:d,_y:f}),o===0&&(d=t.x,f=t.y),u===0&&(d=t.x),c===0&&(f=t.y),{x:d,y:f}}},"intersection"),Ep=x((e,t)=>{K.warn("abc88 cutPathAtIntersect",e,t);let r=[],n=e[0],i=!1;return e.forEach(s=>{if(K.info("abc88 checking point",s,t),!K5(t,s)&&!i){const a=Q5(t,n,s);K.debug("abc88 inside",s,n,a),K.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)?K.warn("abc88 no intersect",a,r):r.push(a),i=!0}else K.warn("abc88 outside",s,n),n=s,i||r.push(s)}),K.debug("returning points",r),r},"cutPathAtIntersect");function Uk(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(Uk,"extractCornerPoints");var Ap=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"),Z5=x(function(e){const{cornerPointPositions:t}=Uk(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=Ap(i,a,5),l=Ap(s,a,5),c=l.x-o.x,u=l.y-o.y;r.push(o);const h=Math.sqrt(2)*2;let d={x:a.x,y:a.y};if(Math.abs(s.x-i.x)>10&&Math.abs(s.y-i.y)>=10){K.debug("Corner point fixing",Math.abs(s.x-i.x),Math.abs(s.y-i.y));const f=5;a.x===o.x?d={x:c<0?o.x-f+h:o.x+f-h,y:u<0?o.y-h:o.y+h}:d={x:c<0?o.x-h:o.x+h,y:u<0?o.y-f+h:o.y+f-h}}else K.debug("Corner point skipping fixing",Math.abs(s.x-i.x),Math.abs(s.y-i.y));r.push(d,l)}else r.push(e[n]);return r},"fixCorners"),J5=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"),eP=x(function(e,t,r,n,i,s,a,o=!1){const{handDrawnSeed:l}=Re();let c=t.points,u=!1;const h=i;var d=s;const f=[];for(const $ in t.cssCompiledStyles)vy($)||f.push(t.cssCompiledStyles[$]);K.debug("UIO intersect check",t.points,d.x,h.x),d.intersect&&h.intersect&&!o&&(c=c.slice(1,t.points.length-1),c.unshift(h.intersect(c[0])),K.debug("Last point UIO",t.start,"-->",t.end,c[c.length-1],d,d.intersect(c[c.length-1])),c.push(d.intersect(c[c.length-1])));const g=btoa(JSON.stringify(c));t.toCluster&&(K.info("to cluster abc88",r.get(t.toCluster)),c=Ep(t.points,r.get(t.toCluster).node),u=!0),t.fromCluster&&(K.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(c,null,2)),c=Ep(c.reverse(),r.get(t.fromCluster).node).reverse(),u=!0);let m=c.filter($=>!Number.isNaN($.y));m=Z5(m);let b=Da;switch(b=oo,t.curve){case"linear":b=oo;break;case"basis":b=Da;break;case"cardinal":b=T0;break;case"bumpX":b=w0;break;case"bumpY":b=v0;break;case"catmullRom":b=A0;break;case"monotoneX":b=j0;break;case"monotoneY":b=B0;break;case"natural":b=P0;break;case"step":b=R0;break;case"stepAfter":b=O0;break;case"stepBefore":b=F0;break;default:b=Da}const{x:y,y:k}=Z$(t),v=BI().x(y).y(k).curve(b);let S;switch(t.thickness){case"normal":S="edge-thickness-normal";break;case"thick":S="edge-thickness-thick";break;case"invisible":S="edge-thickness-invisible";break;default:S="edge-thickness-normal"}switch(t.pattern){case"solid":S+=" edge-pattern-solid";break;case"dotted":S+=" edge-pattern-dotted";break;case"dashed":S+=" edge-pattern-dashed";break;default:S+=" edge-pattern-solid"}let C,w=t.curve==="rounded"?Vk(Gk(m,t),5):v(m);const T=Array.isArray(t.style)?t.style:[t.style];let I=T.find($=>$?.startsWith("stroke:")),M=!1;if(t.look==="handDrawn"){const $=ae.svg(e);Object.assign([],m);const F=$.path(w,{roughness:.3,seed:l});S+=" transition",C=$e(F).select("path").attr("id",t.id).attr("class"," "+S+(t.classes?" "+t.classes:"")).attr("style",T?T.reduce((R,W)=>R+";"+W,""):"");let L=C.attr("d");C.attr("d",L),e.node().appendChild(C.node())}else{const $=f.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 R=($?$+";"+F+";":F)+";"+(T?T.reduce((te,A)=>te+";"+A,""):"");C=e.append("path").attr("d",w).attr("id",t.id).attr("class"," "+S+(t.classes?" "+t.classes:"")+(L??"")).attr("style",R),I=R.match(/stroke:([^;]+)/)?.[1],M=t.animate===!0||!!t.animation||$.includes("animation");const W=C.node(),X=typeof W.getTotalLength=="function"?W.getTotalLength():0,_=Uf[t.arrowTypeStart]||0,j=Uf[t.arrowTypeEnd]||0;if(t.look==="neo"&&!M){const A=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?J5(X,_,j):`0 ${_} ${X-_-j} ${j}`}; stroke-dashoffset: 0;`;C.attr("style",A+C.attr("style"))}}C.attr("data-edge",!0),C.attr("data-et","edge"),C.attr("data-id",t.id),C.attr("data-points",g),t.showPoints&&m.forEach($=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",$.x).attr("cy",$.y)});let E="";(Re().flowchart.arrowMarkerAbsolute||Re().state.arrowMarkerAbsolute)&&(E=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,E=E.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),K.info("arrowTypeStart",t.arrowTypeStart),K.info("arrowTypeEnd",t.arrowTypeEnd),V5(C,t,E,a,n,I);const N=Math.floor(c.length/2),D=c[N];hr.isLabelCoordinateInPath(D,C.attr("d"))||(u=!0);let P={};return u&&(P.updatedPath=c),P.originalPath=t.points,P},"insertEdge");function Vk(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,d=l.y-a.y,f=Math.hypot(c,u),g=Math.hypot(h,d);if(f<i||g<i){r+=`L${a.x},${a.y}`;continue}const m=c/f,b=u/f,y=h/g,k=d/g,v=m*y+b*k,S=Math.max(-1,Math.min(1,v)),C=Math.acos(S);if(C<i||Math.abs(Math.PI-C)<i){r+=`L${a.x},${a.y}`;continue}const w=Math.min(t/Math.sin(C/2),f/2,g/2),T=a.x-m*w,I=a.y-b*w,M=a.x+y*w,E=a.y+k*w;r+=`L${T},${I}`,r+=`Q${a.x},${a.y} ${M},${E}`}}return r}x(Vk,"generateRoundedPath");function fu(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(fu,"calculateDeltaAndAngle");function Gk(e,t){const r=e.map(i=>({...i}));if(e.length>=2&&Tt[t.arrowTypeStart]){const i=Tt[t.arrowTypeStart],s=e[0],a=e[1],{angle:o}=fu(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&&Tt[t.arrowTypeEnd]){const i=Tt[t.arrowTypeEnd],s=e[n-1],a=e[n-2],{angle:o}=fu(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(Gk,"applyMarkerOffsetsToPoints");var tP=x((e,t,r,n)=>{t.forEach(i=>{xP[i](e,r,n)})},"insertMarkers"),rP=x((e,t,r)=>{K.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"),nP=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"),iP=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"),sP=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"),aP=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"),oP=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"),lP=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"),cP=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"),uP=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"),hP=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"),dP=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"),fP=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"),pP=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"),gP=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
|
|
375
|
-
L20,10
|
|
376
|
-
M20,10
|
|
377
|
-
L0,20`)},"requirement_arrow"),mP=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"),xP={extension:rP,composition:nP,aggregation:iP,dependency:sP,lollipop:aP,point:oP,circle:lP,cross:cP,barb:uP,only_one:hP,zero_or_one:dP,one_or_more:fP,zero_or_more:pP,requirement_arrow:gP,requirement_contains:mP},yP=tP,bP={common:Ti,getConfig:At,insertCluster:E5,insertEdge:eP,insertEdgeLabel:Y5,insertMarkers:yP,insertNode:qk,interpolateToCurve:Ah,labelHelper:ye,log:K,positionEdgeLabel:X5},js={},Yk=x(e=>{for(const t of e)js[t.name]=t},"registerLayoutLoaders"),kP=x(()=>{Yk([{name:"dagre",loader:x(async()=>await Oe(()=>import("./dagre-6UL2VRFP-DHDnVshA.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 Oe(()=>import("./cose-bilkent-S5V4N54A-BVJXoW_K.js"),__vite__mapDeps([23,24,7,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22])),"loader")}])},"registerDefaultLayoutLoaders");kP();var R6=x(async(e,t)=>{if(!(e.layoutAlgorithm in js))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);const r=js[e.layoutAlgorithm];return(await r.loader()).render(e,t,bP,{algorithm:r.algorithm})},"render"),F6=x((e="",{fallback:t="dagre"}={})=>{if(e in js)return e;if(t in js)return K.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"),Xk="comm",Kk="rule",Qk="decl",wP="@import",vP="@namespace",CP="@keyframes",SP="@layer",Zk=Math.abs,Yh=String.fromCharCode;function Jk(e){return e.trim()}function za(e,t,r){return e.replace(t,r)}function _P(e,t,r){return e.indexOf(t,r)}function ii(e,t){return e.charCodeAt(t)|0}function vi(e,t,r){return e.slice(t,r)}function wr(e){return e.length}function TP(e){return e.length}function va(e,t){return t.push(e),e}var ul=1,Ci=1,ew=0,ar=0,lt=0,Li="";function Xh(e,t,r,n,i,s,a,o){return{value:e,root:t,parent:r,type:n,props:i,children:s,line:ul,column:Ci,length:a,return:"",siblings:o}}function EP(){return lt}function AP(){return lt=ar>0?ii(Li,--ar):0,Ci--,lt===10&&(Ci=1,ul--),lt}function pr(){return lt=ar<ew?ii(Li,ar++):0,Ci++,lt===10&&(Ci=1,ul++),lt}function Qr(){return ii(Li,ar)}function Wa(){return ar}function hl(e,t){return vi(Li,e,t)}function Bs(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 MP(e){return ul=Ci=1,ew=wr(Li=e),ar=0,[]}function NP(e){return Li="",e}function rc(e){return Jk(hl(ar-1,pu(e===91?e+2:e===40?e+1:e)))}function LP(e){for(;(lt=Qr())&<<33;)pr();return Bs(e)>2||Bs(lt)>3?"":" "}function IP(e,t){for(;--t&&pr()&&!(lt<48||lt>102||lt>57&<<65||lt>70&<<97););return hl(e,Wa()+(t<6&&Qr()==32&&pr()==32))}function pu(e){for(;pr();)switch(lt){case e:return ar;case 34:case 39:e!==34&&e!==39&&pu(lt);break;case 40:e===41&&pu(e);break;case 92:pr();break}return ar}function $P(e,t){for(;pr()&&e+lt!==57;)if(e+lt===84&&Qr()===47)break;return"/*"+hl(t,ar-1)+"*"+Yh(e===47?e:pr())}function jP(e){for(;!Bs(Qr());)pr();return hl(e,ar)}function BP(e){return NP(Ha("",null,null,null,[""],e=MP(e),0,[0],e))}function Ha(e,t,r,n,i,s,a,o,l){for(var c=0,u=0,h=a,d=0,f=0,g=0,m=1,b=1,y=1,k=0,v="",S=i,C=s,w=n,T=v;b;)switch(g=k,k=pr()){case 40:if(g!=108&&ii(T,h-1)==58){_P(T+=za(rc(k),"&","&\f"),"&\f",Zk(c?o[c-1]:0))!=-1&&(y=-1);break}case 34:case 39:case 91:T+=rc(k);break;case 9:case 10:case 13:case 32:T+=LP(g);break;case 92:T+=IP(Wa()-1,7);continue;case 47:switch(Qr()){case 42:case 47:va(DP($P(pr(),Wa()),t,r,l),l),(Bs(g||1)==5||Bs(Qr()||1)==5)&&wr(T)&&vi(T,-1,void 0)!==" "&&(T+=" ");break;default:T+="/"}break;case 123*m:o[c++]=wr(T)*y;case 125*m:case 59:case 0:switch(k){case 0:case 125:b=0;case 59+u:y==-1&&(T=za(T,/\f/g,"")),f>0&&(wr(T)-h||m===0&&g===47)&&va(f>32?Np(T+";",n,r,h-1,l):Np(za(T," ","")+";",n,r,h-2,l),l);break;case 59:T+=";";default:if(va(w=Mp(T,t,r,c,u,i,o,v,S=[],C=[],h,s),s),k===123)if(u===0)Ha(T,t,w,w,S,s,h,o,C);else{switch(d){case 99:if(ii(T,3)===110)break;case 108:if(ii(T,2)===97)break;default:u=0;case 100:case 109:case 115:}u?Ha(e,w,w,n&&va(Mp(e,w,w,0,0,i,o,v,i,S=[],h,C),C),i,C,h,o,n?S:C):Ha(T,w,w,w,[""],C,0,o,C)}}c=u=f=0,m=y=1,v=T="",h=a;break;case 58:h=1+wr(T),f=g;default:if(m<1){if(k==123)--m;else if(k==125&&m++==0&&AP()==125)continue}switch(T+=Yh(k),k*m){case 38:y=u>0?1:(T+="\f",-1);break;case 44:o[c++]=(wr(T)-1)*y,y=1;break;case 64:Qr()===45&&(T+=rc(pr())),d=Qr(),u=h=wr(v=T+=jP(Wa())),k++;break;case 45:g===45&&wr(T)==2&&(m=0)}}return s}function Mp(e,t,r,n,i,s,a,o,l,c,u,h){for(var d=i-1,f=i===0?s:[""],g=TP(f),m=0,b=0,y=0;m<n;++m)for(var k=0,v=vi(e,d+1,d=Zk(b=a[m])),S=e;k<g;++k)(S=Jk(b>0?f[k]+" "+v:za(v,/&\f/g,f[k])))&&(l[y++]=S);return Xh(e,t,r,i===0?Kk:o,l,c,u,h)}function DP(e,t,r,n){return Xh(e,t,r,Xk,Yh(EP()),vi(e,2,-2),0,n)}function Np(e,t,r,n,i){return Xh(e,t,r,Qk,vi(e,0,n),vi(e,n+1,-1),n,i)}function gu(e,t){for(var r="",n=0;n<e.length;n++)r+=t(e[n],n,e,t)||"";return r}function PP(e,t,r,n){switch(e.type){case SP:if(e.children.length)break;case wP:case vP:case Qk:return e.return=e.return||e.value;case Xk:return"";case CP:return e.return=e.value+"{"+gu(e.children,n)+"}";case Kk:if(!wr(e.value=e.props.join(",")))return""}return wr(r=gu(e.children,n))?e.return=e.value+"{"+r+"}":""}var RP=Ty(Object.keys,Object),FP=Object.prototype,OP=FP.hasOwnProperty;function zP(e){if(!el(e))return RP(e);var t=[];for(var r in Object(e))OP.call(e,r)&&r!="constructor"&&t.push(r);return t}var mu=Fn(Ar,"DataView"),xu=Fn(Ar,"Promise"),yu=Fn(Ar,"Set"),bu=Fn(Ar,"WeakMap"),Lp="[object Map]",WP="[object Object]",Ip="[object Promise]",$p="[object Set]",jp="[object WeakMap]",Bp="[object DataView]",HP=Rn(mu),qP=Rn(Is),UP=Rn(xu),VP=Rn(yu),GP=Rn(bu),bn=Ai;(mu&&bn(new mu(new ArrayBuffer(1)))!=Bp||Is&&bn(new Is)!=Lp||xu&&bn(xu.resolve())!=Ip||yu&&bn(new yu)!=$p||bu&&bn(new bu)!=jp)&&(bn=function(e){var t=Ai(e),r=t==WP?e.constructor:void 0,n=r?Rn(r):"";if(n)switch(n){case HP:return Bp;case qP:return Lp;case UP:return Ip;case VP:return $p;case GP:return jp}return t});var YP="[object Map]",XP="[object Set]",KP=Object.prototype,QP=KP.hasOwnProperty;function Dp(e){if(e==null)return!0;if(tl(e)&&(wo(e)||typeof e=="string"||typeof e.splice=="function"||Th(e)||Eh(e)||ko(e)))return!e.length;var t=bn(e);if(t==YP||t==XP)return!e.size;if(el(e))return!zP(e).length;for(var r in e)if(QP.call(e,r))return!1;return!0}var tw="c4",ZP=x(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),JP=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./c4Diagram-YG6GDRKO-B0VVIIvh.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:tw,diagram:e}},"loader"),e4={id:tw,detector:ZP,loader:JP},t4=e4,rw="flowchart",r4=x((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),n4=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-BYqChOSE.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:rw,diagram:e}},"loader"),i4={id:rw,detector:r4,loader:n4},s4=i4,nw="flowchart-v2",a4=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"),o4=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-BYqChOSE.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:nw,diagram:e}},"loader"),l4={id:nw,detector:a4,loader:o4},c4=l4,iw="er",u4=x(e=>/^\s*erDiagram/.test(e),"detector"),h4=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./erDiagram-Q2GNP2WA-BHsgeBpL.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:iw,diagram:e}},"loader"),d4={id:iw,detector:u4,loader:h4},f4=d4,sw="gitGraph",p4=x(e=>/^\s*gitGraph/.test(e),"detector"),g4=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./gitGraphDiagram-NY62KEGX-C5Bgrf0J.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:sw,diagram:e}},"loader"),m4={id:sw,detector:p4,loader:g4},x4=m4,aw="gantt",y4=x(e=>/^\s*gantt/.test(e),"detector"),b4=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./ganttDiagram-LVOFAZNH-CZFFSLKX.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:aw,diagram:e}},"loader"),k4={id:aw,detector:y4,loader:b4},w4=k4,ow="info",v4=x(e=>/^\s*info/.test(e),"detector"),C4=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./infoDiagram-F6ZHWCRC-C6OApgqf.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:ow,diagram:e}},"loader"),S4={id:ow,detector:v4,loader:C4},lw="pie",_4=x(e=>/^\s*pie/.test(e),"detector"),T4=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./pieDiagram-ADFJNKIX-B0mT9OgH.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:lw,diagram:e}},"loader"),E4={id:lw,detector:_4,loader:T4},cw="quadrantChart",A4=x(e=>/^\s*quadrantChart/.test(e),"detector"),M4=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./quadrantDiagram-AYHSOK5B-BWdlgO0u.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:cw,diagram:e}},"loader"),N4={id:cw,detector:A4,loader:M4},L4=N4,uw="xychart",I4=x(e=>/^\s*xychart(-beta)?/.test(e),"detector"),$4=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./xychartDiagram-PRI3JC2R-Bo9K-U2S.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:uw,diagram:e}},"loader"),j4={id:uw,detector:I4,loader:$4},B4=j4,hw="requirement",D4=x(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),P4=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./requirementDiagram-UZGBJVZJ-B-8LxsGB.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:hw,diagram:e}},"loader"),R4={id:hw,detector:D4,loader:P4},F4=R4,dw="sequence",O4=x(e=>/^\s*sequenceDiagram/.test(e),"detector"),z4=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./sequenceDiagram-WL72ISMW-Bt5twlzi.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:dw,diagram:e}},"loader"),W4={id:dw,detector:O4,loader:z4},H4=W4,fw="class",q4=x((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),U4=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./classDiagram-2ON5EDUG-BXVT6Q7h.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:fw,diagram:e}},"loader"),V4={id:fw,detector:q4,loader:U4},G4=V4,pw="classDiagram",Y4=x((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),X4=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./classDiagram-v2-WZHVMYZB-BXVT6Q7h.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:pw,diagram:e}},"loader"),K4={id:pw,detector:Y4,loader:X4},Q4=K4,gw="state",Z4=x((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),J4=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./stateDiagram-FKZM4ZOC-Dmph7TeW.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:gw,diagram:e}},"loader"),eR={id:gw,detector:Z4,loader:J4},tR=eR,mw="stateDiagram",rR=x((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),nR=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./stateDiagram-v2-4FDKWEC3-DyE8O3Kx.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:mw,diagram:e}},"loader"),iR={id:mw,detector:rR,loader:nR},sR=iR,xw="journey",aR=x(e=>/^\s*journey/.test(e),"detector"),oR=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./journeyDiagram-XKPGCS4Q--abC1RHz.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:xw,diagram:e}},"loader"),lR={id:xw,detector:aR,loader:oR},cR=lR,uR=x((e,t,r)=>{K.debug(`rendering svg for syntax error
|
|
378
|
-
`);const n=qI(t),i=n.append("g");n.attr("viewBox","0 0 2412 512"),qm(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"),yw={draw:uR},hR=yw,dR={db:{},renderer:yw,parser:{parse:x(()=>{},"parse")}},fR=dR,bw="flowchart-elk",pR=x((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),gR=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-BYqChOSE.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:bw,diagram:e}},"loader"),mR={id:bw,detector:pR,loader:gR},xR=mR,kw="timeline",yR=x(e=>/^\s*timeline/.test(e),"detector"),bR=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./timeline-definition-IT6M3QCI-CcV8nyIH.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:kw,diagram:e}},"loader"),kR={id:kw,detector:yR,loader:bR},wR=kR,ww="mindmap",vR=x(e=>/^\s*mindmap/.test(e),"detector"),CR=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./mindmap-definition-VGOIOE7T-U_T9xIUk.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:ww,diagram:e}},"loader"),SR={id:ww,detector:vR,loader:CR},_R=SR,vw="kanban",TR=x(e=>/^\s*kanban/.test(e),"detector"),ER=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./kanban-definition-3W4ZIXB7-BJeChfWu.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:vw,diagram:e}},"loader"),AR={id:vw,detector:TR,loader:ER},MR=AR,Cw="sankey",NR=x(e=>/^\s*sankey(-beta)?/.test(e),"detector"),LR=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./sankeyDiagram-TZEHDZUN-OXuxkgGA.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:Cw,diagram:e}},"loader"),IR={id:Cw,detector:NR,loader:LR},$R=IR,Sw="packet",jR=x(e=>/^\s*packet(-beta)?/.test(e),"detector"),BR=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./diagram-S2PKOQOG-D7AX72a5.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:Sw,diagram:e}},"loader"),DR={id:Sw,detector:jR,loader:BR},_w="radar",PR=x(e=>/^\s*radar-beta/.test(e),"detector"),RR=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./diagram-QEK2KX5R-BfMGeeRo.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:_w,diagram:e}},"loader"),FR={id:_w,detector:PR,loader:RR},Tw="block",OR=x(e=>/^\s*block(-beta)?/.test(e),"detector"),zR=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./blockDiagram-VD42YOAC-DFKUIZc6.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:Tw,diagram:e}},"loader"),WR={id:Tw,detector:OR,loader:zR},HR=WR,Ew="architecture",qR=x(e=>/^\s*architecture/.test(e),"detector"),UR=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./architectureDiagram-VXUJARFQ-DD1BwT1T.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:Ew,diagram:e}},"loader"),VR={id:Ew,detector:qR,loader:UR},GR=VR,Aw="treemap",YR=x(e=>/^\s*treemap/.test(e),"detector"),XR=x(async()=>{const{diagram:e}=await Oe(async()=>{const{diagram:t}=await import("./diagram-PSM6KHXK-40qGxDeg.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:Aw,diagram:e}},"loader"),KR={id:Aw,detector:YR,loader:XR},Pp=!1,dl=x(()=>{Pp||(Pp=!0,eo("error",fR,e=>e.toLowerCase().trim()==="error"),eo("---",{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("---")),Tc(xR,_R,GR),Tc(t4,MR,Q4,G4,f4,w4,S4,E4,F4,H4,c4,s4,wR,x4,sR,tR,cR,L4,$R,DR,B4,HR,FR,KR))},"addDiagrams"),QR=x(async()=>{K.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Mn).map(async([r,{detector:n,loader:i}])=>{if(i)try{Nc(r)}catch{try{const{diagram:s,id:a}=await i();eo(a,s,n)}catch(s){throw K.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Mn[r],s}}}))).filter(r=>r.status==="rejected");if(t.length>0){K.error(`Failed to load ${t.length} external diagrams`);for(const r of t)K.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),ZR="graphics-document document";function Mw(e,t){e.attr("role",ZR),t!==""&&e.attr("aria-roledescription",t)}x(Mw,"setA11yDiagramInfo");function Nw(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(Nw,"addSVGa11yTitleDescription");var Tn,ku=(Tn=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=At(),i=Qu(t,n);t=KD(t)+`
|
|
379
|
-
`;try{Nc(i)}catch{const c=kA(i);if(!c)throw new Im(`Diagram ${i} not found.`);const{id:u,diagram:h}=await c();eo(u,h)}const{db:s,parser:a,renderer:o,init:l}=Nc(i);return a.parser&&(a.parser.yy=s),s.clear?.(),l?.(n),r.title&&s.setDiagramTitle?.(r.title),await a.parse(t),new Tn(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(Tn,"Diagram"),Tn),Rp=[],JR=x(()=>{Rp.forEach(e=>{e()}),Rp=[]},"attachFunctions"),eF=x(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function Lw(e){const t=e.match(Lm);if(!t)return{text:e,metadata:{}};let r=Q$(t[1],{schema:K$})??{};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(Lw,"extractFrontMatter");var tF=x(e=>e.replace(/\r\n?/g,`
|
|
380
|
-
`).replace(/<(\w+)([^>]*)>/g,(t,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),rF=x(e=>{const{text:t,metadata:r}=Lw(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"),nF=x(e=>{const t=hr.detectInit(e)??{},r=hr.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:n})=>n==="wrap"):r?.type==="wrap"&&(t.wrap=!0),{text:PD(e),directive:t}},"processDirectives");function Kh(e){const t=tF(e),r=rF(t),n=nF(r.text),i=$h(r.config,n.directive);return e=eF(n.text),{code:e,title:r.title,config:i}}x(Kh,"preprocessDiagram");function Iw(e){const t=new TextEncoder().encode(e),r=Array.from(t,n=>String.fromCodePoint(n)).join("");return btoa(r)}x(Iw,"toBase64");var iF=5e4,sF="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",aF="sandbox",oF="loose",lF="http://www.w3.org/2000/svg",cF="http://www.w3.org/1999/xlink",uF="http://www.w3.org/1999/xhtml",hF="100%",dF="100%",fF="border:0;margin:0;",pF="margin:0",gF="allow-top-navigation-by-user-activation allow-popups",mF='The "iframe" tag is not supported by your browser.',xF=["foreignobject"],yF=["dominant-baseline"];function Qh(e){const t=Kh(e);return Za(),DA(t.config??{}),t}x(Qh,"processAndSetConfigs");async function $w(e,t){dl();try{const{code:r,config:n}=Qh(e);return{diagramType:(await Bw(r)).type,config:n}}catch(r){if(t?.suppressErrors)return!1;throw r}}x($w,"parse");var Fp=x((e,t,r=[])=>`
|
|
381
|
-
.${e} ${t} { ${r.join(" !important; ")} !important; }`,"cssImportantStyles"),bF=x((e,t=new Map)=>{let r="";if(e.themeCSS!==void 0&&(r+=`
|
|
382
|
-
${e.themeCSS}`),e.fontFamily!==void 0&&(r+=`
|
|
383
|
-
:root { --mermaid-font-family: ${e.fontFamily}}`),e.altFontFamily!==void 0&&(r+=`
|
|
384
|
-
: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=>{Dp(o.styles)||a.forEach(l=>{r+=Fp(o.id,l,o.styles)}),Dp(o.textStyles)||(r+=Fp(o.id,"tspan",(o?.textStyles||[]).map(l=>l.replace("color","fill"))))})}return r},"createCssStyles"),kF=x((e,t,r,n)=>{const i=bF(e,r),s=rM(t,i,e.themeVariables);return gu(BP(`${n}{${s}}`),PP)},"createUserStyles"),wF=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=On(n),n=n.replace(/<br>/g,"<br/>"),n},"cleanUpSvgCode"),vF=x((e="",t)=>{const r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":dF,n=Iw(`<body style="${pF}">${e}</body>`);return`<iframe style="width:${hF};height:${r};${fF}" src="data:text/html;charset=UTF-8;base64,${n}" sandbox="${gF}">
|
|
385
|
-
${mF}
|
|
386
|
-
</iframe>`},"putIntoIFrame"),Op=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",lF);return i&&a.attr("xmlns:xlink",i),a.append("g"),e},"appendDivSvgG");function wu(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}x(wu,"sandboxedIframe");var CF=x((e,t,r,n)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(n)?.remove()},"removeExistingElements"),SF=x(async function(e,t,r){dl();const n=Qh(t);t=n.code;const i=At();K.debug(i),t.length>(i?.maxTextSize??iF)&&(t=sF);const s="#"+e,a="i"+e,o="#"+a,l="d"+e,c="#"+l,u=x(()=>{const P=$e(d?o:c).node();P&&"remove"in P&&P.remove()},"removeTempElements");let h=$e("body");const d=i.securityLevel===aF,f=i.securityLevel===oF,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),d){const D=wu($e(r),a);h=$e(D.nodes()[0].contentDocument.body),h.node().style.margin=0}else h=$e(r);Op(h,e,l,`font-family: ${g}`,cF)}else{if(CF(document,e,l,a),d){const D=wu($e("body"),a);h=$e(D.nodes()[0].contentDocument.body),h.node().style.margin=0}else h=$e("body");Op(h,e,l)}let m,b;try{m=await ku.fromText(t,{title:n.title})}catch(D){if(i.suppressErrorRendering)throw u(),D;m=await ku.fromText("error"),b=D}const y=h.select(c).node(),k=m.type,v=y.firstChild,S=v.firstChild,C=m.renderer.getClasses?.(t,m),w=kF(i,k,C,s),T=document.createElement("style");T.innerHTML=w,v.insertBefore(T,S);try{await m.renderer.draw(t,e,af.version,m)}catch(D){throw i.suppressErrorRendering?u():hR.draw(t,e,af.version),D}const I=h.select(`${c} svg`),M=m.db.getAccTitle?.(),E=m.db.getAccDescription?.();Dw(k,I,M,E),h.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",uF);let N=h.select(c).node().innerHTML;if(K.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),N=wF(N,d,pt(i.arrowMarkerAbsolute)),d){const D=h.select(c+" svg").node();N=vF(N,D)}else f||(N=gi.sanitize(N,{ADD_TAGS:xF,ADD_ATTR:yF,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(JR(),b)throw b;return u(),{diagramType:k,svg:N,bindFunctions:m.db.bindFunctions}},"render");function jw(e={}){const t=dt({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),jA(t),t?.theme&&t.theme in zr?t.themeVariables=zr[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=zr.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?$A(t):Pm();Ku(r.logLevel),dl()}x(jw,"initialize");var Bw=x((e,t={})=>{const{code:r}=Kh(e);return ku.fromText(r,t)},"getDiagramFromText");function Dw(e,t,r,n){Mw(t,e),Nw(t,r,n,t.attr("id"))}x(Dw,"addA11yInfo");var Bn=Object.freeze({render:SF,parse:$w,getDiagramFromText:Bw,initialize:jw,getConfig:At,setConfig:Rm,getSiteConfig:Pm,updateSiteConfig:BA,reset:x(()=>{Za()},"reset"),globalReset:x(()=>{Za(mi)},"globalReset"),defaultConfig:mi});Ku(At().logLevel);Za(At());var _F=x((e,t,r)=>{K.warn(e),Ih(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"),Pw=x(async function(e={querySelector:".mermaid"}){try{await TF(e)}catch(t){if(Ih(t)&&K.error(t.str),Ur.parseError&&Ur.parseError(t),!e.suppressErrors)throw K.error("Use the suppressErrors option to suppress these errors"),t}},"run"),TF=x(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const n=Bn.getConfig();K.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");K.debug(`Found ${i.length} diagrams`),n?.startOnLoad!==void 0&&(K.debug("Start On Load: "+n?.startOnLoad),Bn.updateSiteConfig({startOnLoad:n?.startOnLoad}));const s=new hr.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let a;const o=[];for(const l of Array.from(i)){if(K.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const c=`mermaid-${s.next()}`;a=l.innerHTML,a=ib(hr.entityDecode(a)).trim().replace(/<br\s*\/?>/gi,"<br/>");const u=hr.detectInit(a);u&&K.debug("Detected early reinit: ",u);try{const{svg:h,bindFunctions:d}=await zw(c,a,l);l.innerHTML=h,e&&await e(c),d&&d(l)}catch(h){_F(h,o,Ur.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),Rw=x(function(e){Bn.initialize(e)},"initialize"),EF=x(async function(e,t,r){K.warn("mermaid.init is deprecated. Please use run instead."),e&&Rw(e);const n={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?n.querySelector=t:t&&(t instanceof HTMLElement?n.nodes=[t]:n.nodes=t),await Pw(n)},"init"),AF=x(async(e,{lazyLoad:t=!0}={})=>{dl(),Tc(...e),t===!1&&await QR()},"registerExternalDiagrams"),Fw=x(function(){if(Ur.startOnLoad){const{startOnLoad:e}=Bn.getConfig();e&&Ur.run().catch(t=>K.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",Fw,!1);var MF=x(function(e){Ur.parseError=e},"setParseErrorHandler"),Io=[],nc=!1,Ow=x(async()=>{if(!nc){for(nc=!0;Io.length>0;){const e=Io.shift();if(e)try{await e()}catch(t){K.error("Error executing queue",t)}}nc=!1}},"executeQueue"),NF=x(async(e,t)=>new Promise((r,n)=>{const i=x(()=>new Promise((s,a)=>{Bn.parse(e,t).then(o=>{s(o),r(o)},o=>{K.error("Error parsing",o),Ur.parseError?.(o),a(o),n(o)})}),"performCall");Io.push(i),Ow().catch(n)}),"parse"),zw=x((e,t,r)=>new Promise((n,i)=>{const s=x(()=>new Promise((a,o)=>{Bn.render(e,t,r).then(l=>{a(l),n(l)},l=>{K.error("Error parsing",l),Ur.parseError?.(l),o(l),i(l)})}),"performCall");Io.push(s),Ow().catch(i)}),"render"),LF=x(()=>Object.keys(Mn).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),Ur={startOnLoad:!0,mermaidAPI:Bn,parse:NF,render:zw,init:EF,run:Pw,registerExternalDiagrams:AF,registerLayoutLoaders:Yk,initialize:Rw,parseError:void 0,contentLoaded:Fw,setParseErrorHandler:MF,detectType:Qu,registerIconPacks:e5,getRegisteredDiagramsMetadata:LF},zp=Ur;/*! Check if previously processed *//*!
|
|
387
|
-
* Wait for document loaded before starting the execution
|
|
388
|
-
*/let IF=0;const $F=({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-${++IF}`),[l,c]=O.useState(!1),[u,h]=O.useState(!1),[d,f]=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,I=!1,M=!1)=>{try{zp.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 zp.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 P=D.getAttribute("viewBox"),$=D.getAttribute("width"),F=D.getAttribute("height");!P&&$&&F&&D.setAttribute("viewBox",`0 0 ${$} ${F}`);let L=0,R=0;const W=P||($&&F?`0 0 ${$} ${F}`:null);if(W){const X=W.split(/\s+/);X.length===4&&(L=parseFloat(X[2]),R=parseFloat(X[3]))}D.removeAttribute("width"),D.removeAttribute("height"),M?(I?(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"),I&&L&&R&&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(d&&n.current){const w=i.current,T=w?{x:w.scrollLeft,y:w.scrollTop}:null,I=g===0;y(n.current,`${o}-fullscreen`,!0,I),T&&w&&g!==0&&setTimeout(()=>{w.scrollLeft=T.x,w.scrollTop=T.y},50)}},[d,e,t,o,g]);const k=w=>{m(w)},v=()=>g===0?100:g,S=()=>{const w=v(),T=Math.min(200,w+10);console.log("放大:",{baseZoom:w,newZoom:T,zoomLevel:g}),k(T)},C=()=>{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:()=>f(!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(E1,{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(A1,{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(ag,{className:"w-4 h-4 text-green-600 dark:text-green-400"}):p.jsx(sc,{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})})})}),d&&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: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()<=50,children:p.jsx(og,{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: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()>=200,children:p.jsx(lg,{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:()=>{f(!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(En,{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"}})()})})]})})]})},bs=({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(__,{remarkPlugins:[RE],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($F,{code:String(o).replace(/\n$/,""),isDark:r}):!s&&c?p.jsx(yg,{style:Cm,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})})},jF=({text:e,maxLength:t=300})=>{const{t:r}=ve("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")})]})},BF=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}),DF=({content:e})=>{const{t}=ve("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})})]})},PF=e=>e.flatMap(t=>t.messageParts).sort((t,r)=>t.order-r.order),Ww=({taskPrompt:e,messageFlow:t,defaultExpanded:r=!1})=>{const{t:n}=ve("components"),[i,s]=O.useState(r),a=t.reduce((l,c)=>l+c.messageParts.filter(u=>u.type==="tool").length,0),o=PF(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(fi,{className:"w-4 h-4 flex-shrink-0"}):p.jsx(Ps,{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(Sa,{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(jF,{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(bs,{content:l.content,isUserMessage:!1})},l.id):l.type==="thinking"&&l.content?p.jsx(DF,{content:l.content},l.id):l.type==="tool"&&l.toolData?p.jsx("div",{children:p.jsx(Vw,{execution:BF(l)})},l.id):null)]})]})},RF=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`},FF=({result:e})=>{const{t}=ve("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(Ta,{className:"w-3 h-3"}):p.jsx(ac,{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:RF(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(Ea,{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(M1,{className:"w-3 h-3"}),p.jsxs("span",{children:[e.totalTokens.toLocaleString()," tokens"]})]})]})},OF=({execution:e})=>{const{t}=ve("components"),r=e.toolInput,n=e.toolUseResult,i=e.claudeId||e.toolData?.claudeId;console.log("🎯 [TaskTool] claudeId:",i,"isExecuting:",e.isExecuting);const s=hc(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(_a,{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(FF,{result:n}),o.length>0&&c&&p.jsx(Ww,{taskPrompt:c,messageFlow:o,defaultExpanded:e.isExecuting})]})})},zF=({execution:e})=>{const{t}=ve("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})})]})})},WF=({execution:e})=>{const{t}=ve("components"),r=e.toolInput,n=()=>{if(r.pattern)return r.pattern},i=s=>!s||!s.trim()?t("globTool.noFilesFound"):(s.trim().split(`
|
|
389
|
-
`).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)})]})]})},HF=({execution:e})=>{const{t}=ve("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")}:
|
|
390
|
-
|
|
391
|
-
${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)})]})]})},qF=({execution:e})=>{const{t}=ve("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})]})]})},UF=({execution:e})=>{const{t}=ve("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")]})]})})},VF=({execution:e})=>{const{t}=ve("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 Mr(){}Mr.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(S){return S=a.postProcess(S,i),s?(setTimeout(function(){s(S)},0),!0):S}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 d=(n=i.timeout)!==null&&n!==void 0?n:1/0,f=Date.now()+d,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(Wp(a,g[0].lastComponent,r,t,a.useLongestToken));var b=-1/0,y=1/0;function k(){for(var S=Math.max(b,-u);S<=Math.min(y,u);S+=2){var C=void 0,w=g[S-1],T=g[S+1];w&&(g[S-1]=void 0);var I=!1;if(T){var M=T.oldPos-S;I=T&&0<=M&&M<l}var E=w&&w.oldPos+1<c;if(!I&&!E){g[S]=void 0;continue}if(!E||I&&w.oldPos<T.oldPos?C=a.addToPath(T,!0,!1,0,i):C=a.addToPath(w,!1,!0,1,i),m=a.extractCommon(C,r,t,S,i),C.oldPos+1>=c&&m+1>=l)return o(Wp(a,C.lastComponent,r,t,a.useLongestToken));g[S]=C,C.oldPos+1>=c&&(y=Math.min(y,S-1)),m+1>=l&&(b=Math.max(b,S+1))}u++}if(s)(function S(){setTimeout(function(){if(u>h||Date.now()>f)return s();k()||S()},0)})();else for(;u<=h&&Date.now()<=f;){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 Wp(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 d=r.slice(c,c+h.count);d=d.map(function(f,g){var m=n[u+g];return m.length>f.length?m:f}),h.value=e.join(d)}else h.value=e.join(r.slice(c,c+h.count));c+=h.count,h.added||(u+=h.count)}}return s}function Hp(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 qp(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 vu(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 Cu(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 Ji(e,t){return vu(e,t,"")}function Ca(e,t){return Cu(e,t,"")}function Up(e,t){return t.slice(0,GF(e,t))}function GF(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 $o="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}",YF=new RegExp("[".concat($o,"]+|\\s+|[^").concat($o,"]"),"ug"),fl=new Mr;fl.equals=function(e,t,r){return r.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()};fl.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(YF)||[];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};fl.join=function(e){return e.map(function(t,r){return r==0?t:t.replace(/^\s+/,"")}).join("")};fl.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)&&Vp(r,i,n,s),r=s,n=null,i=null)}),(n||i)&&Vp(r,i,n,null),e};function Vp(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=Hp(i,a);e.value=Cu(e.value,a,l),t.value=Ji(t.value,l),r.value=Ji(r.value,l)}if(n){var c=qp(s,o);n.value=vu(n.value,o,c),t.value=Ca(t.value,c),r.value=Ca(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],d=t.value.match(/\s*$/)[0],f=Hp(u,h);t.value=Ji(t.value,f);var g=qp(Ji(u,f),d);t.value=Ca(t.value,g),n.value=vu(n.value,u,g),e.value=Cu(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=Up(b,m);t.value=Ca(t.value,y)}else if(e){var k=e.value.match(/\s*$/)[0],v=t.value.match(/^\s*/)[0],S=Up(k,v);t.value=Ji(t.value,S)}}var XF=new Mr;XF.tokenize=function(e){var t=new RegExp("(\\r?\\n)|[".concat($o,"]+|[^\\S\\n\\r]+|[^").concat($o,"]"),"ug");return e.match(t)||[]};var pl=new Mr;pl.tokenize=function(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
392
|
-
`));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};pl.equals=function(e,t,r){return r.ignoreWhitespace?((!r.newlineIsToken||!e.includes(`
|
|
393
|
-
`))&&(e=e.trim()),(!r.newlineIsToken||!t.includes(`
|
|
394
|
-
`))&&(t=t.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(e.endsWith(`
|
|
395
|
-
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
|
396
|
-
`)&&(t=t.slice(0,-1))),Mr.prototype.equals.call(this,e,t,r)};function Gp(e,t,r){return pl.diff(e,t,r)}var KF=new Mr;KF.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var QF=new Mr;QF.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function Yp(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 Xp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yp(Object(r),!0).forEach(function(n){eO(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ZF(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 JF(e){var t=ZF(e,"string");return typeof t=="symbol"?t:t+""}function Su(e){"@babel/helpers - typeof";return Su=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Su(e)}function eO(e,t,r){return t=JF(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ic(e){return tO(e)||rO(e)||nO(e)||iO()}function tO(e){if(Array.isArray(e))return _u(e)}function rO(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function nO(e,t){if(e){if(typeof e=="string")return _u(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 _u(e,t)}}function _u(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 iO(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
397
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Ds=new Mr;Ds.useLongestToken=!0;Ds.tokenize=pl.tokenize;Ds.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(Tu(e,null,null,i),i," ")};Ds.equals=function(e,t,r){return Mr.prototype.equals.call(Ds,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"),r)};function Tu(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]=Tu(e[s],t,r,n,i);return t.pop(),r.pop(),a}if(e&&e.toJSON&&(e=e.toJSON()),Su(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]=Tu(e[l],t,r,n,l);t.pop(),r.pop()}else a=e;return a}var Eu=new Mr;Eu.tokenize=function(e){return e.slice()};Eu.join=Eu.removeEmpty=function(e){return e};function sO(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;Gp(r,n,Xp(Xp({},a),{},{callback:function(h){var d=c(h);l(d)}}))}else return c(Gp(r,n,a));function c(u){if(!u)return;u.push({value:"",lines:[]});function h(I){return I.map(function(M){return" "+M})}for(var d=[],f=0,g=0,m=[],b=1,y=1,k=function(){var M=u[v],E=M.lines||aO(M.value);if(M.lines=E,M.added||M.removed){var N;if(!f){var D=u[v-1];f=b,g=y,D&&(m=a.context>0?h(D.lines.slice(-a.context)):[],f-=m.length,g-=m.length)}(N=m).push.apply(N,ic(E.map(function(R){return(M.added?"+":"-")+R}))),M.added?y+=E.length:b+=E.length}else{if(f)if(E.length<=a.context*2&&v<u.length-2){var P;(P=m).push.apply(P,ic(h(E)))}else{var $,F=Math.min(E.length,a.context);($=m).push.apply($,ic(h(E.slice(0,F))));var L={oldStart:f,oldLines:b-f+F,newStart:g,newLines:y-g+F,lines:m};d.push(L),f=0,g=0,m=[]}b+=E.length,y+=E.length}},v=0;v<u.length;v++)k();for(var S=0,C=d;S<C.length;S++)for(var w=C[S],T=0;T<w.lines.length;T++)w.lines[T].endsWith(`
|
|
398
|
-
`)?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:d}}}function aO(e){var t=e.endsWith(`
|
|
399
|
-
`),r=e.split(`
|
|
400
|
-
`).map(function(n){return n+`
|
|
401
|
-
`});return t?r.pop():r.push(r.pop().slice(0,-1)),r}const Hw=({oldText:e,newText:t,oldStartLine:r=1,newStartLine:n=1})=>{const i=sO("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,d)=>{const f=h.startsWith("+")?"add":h.startsWith("-")?"del":"context";let g="diff-line",m="",b="";switch(f){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)})]},d)})]},a)})})})},oO=({execution:e})=>{const{t}=ve("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(Hw,{oldText:r.old_string,newText:r.new_string,oldStartLine:a,newStartLine:o})})]})})},lO=({execution:e})=>{const{t}=ve("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(Hw,{oldText:s.old_string,newText:s.new_string})})]},a))})]})]})})},Kp={".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 cO(e){if(!e)return"text";const t=e.toLowerCase().match(/\.[^.]*$/)?.[0];if(t&&Kp[t])return Kp[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 uO=({content:e,filePath:t="",className:r=""})=>{const n=cO(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(yg,{language:n,style:i?FE:Cm,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})})]})},hO=({execution:e})=>{const{t}=ve("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(uO,{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})})]})]})})},dO=({execution:e})=>{const{t}=ve("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})]})})},fO=({execution:e})=>{const{t}=ve("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)+`
|
|
402
|
-
`+t("notebookEditTool.truncated"):r.new_source||"",isCode:!0})]})})},pO=({execution:e})=>{const{t}=ve("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(bl,{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(N1,{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(bl,{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(bl,{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")})]})})},gO=({execution:e})=>{const{t}=ve("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(aa,{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(aa,{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(L1,{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(I1,{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(cg,{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(aa,{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(aa,{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})})]})})},mO=({execution:e})=>{const{t}=ve("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($1,{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(j1,{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(ug,{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")})]})]})})},Pr="__TYPE_SOMETHING__",Qp=({execution:e,onSubmit:t})=>{const{t:r}=ve("components"),n=e.toolInput,i=Ke(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),d=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]),f=d&&!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,I)=>{f&&(a(M=>{const E=new Map(M),N=E.get(w)||[];if(I)if(N.includes(T))E.set(w,N.filter(D=>D!==T));else{const D=N.filter(P=>P!==Pr);E.set(w,[...D,T])}else E.set(w,[T]);return E}),T!==Pr&&u(M=>{const E=new Map(M);return E.delete(w),E}))},[f]),b=O.useCallback((w,T)=>{f&&(a(I=>{const M=new Map(I),E=M.get(w)||[];return T?E.includes(Pr)?M.set(w,E.filter(N=>N!==Pr)):M.set(w,[...E,Pr]):M.set(w,[Pr]),M}),setTimeout(()=>{const I=h.current.get(w);I&&I.focus()},100))},[f]),y=O.useCallback((w,T)=>{u(I=>{const M=new Map(I);return M.set(w,T),M})},[]),k=O.useMemo(()=>{if(!f)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(Pr)){const I=c.get(w)||"";if(T.length===1&&!I.trim())return!1}}return!0},[f,n.questions.length,s,c]),v=O.useCallback(()=>{const w=[];return n.questions.forEach((T,I)=>{const M=s.get(I)||[];if(M.length>0){const E=[];M.forEach(N=>{if(N===Pr){const D=c.get(I)||"";D.trim()&&E.push(D.trim())}else E.push(N)}),E.length>0&&(n.questions.length===1?w.push(E.join(", ")):w.push(`Q${I+1}: ${E.join(", ")}`))}}),w.join(`
|
|
403
|
-
`)},[n.questions,s,c]),S=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]),C=()=>{const w=n.questions,T=w.length,I=w[0],M=I.header||(I.question.length>30?I.question.substring(0,30)+"...":I.question);return T===1?M:`${M} (+${T-1})`};return p.jsx(Qe,{execution:e,subtitle:C(),defaultExpanded:!0,showResult:!1,hideToolName:!1,overrideToolName:r("askUserQuestionTool.title"),customIcon:p.jsx(Sa,{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 I=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=I.includes(M.label),D=f;return p.jsxs("div",{onClick:()=>m(T,M.label,w.multiSelect||!1),className:`
|
|
404
|
-
flex items-start space-x-2 p-2 rounded border transition-all
|
|
405
|
-
${D?"cursor-pointer":"cursor-default"}
|
|
406
|
-
${N?"border-blue-500 bg-blue-50 ring-1 ring-blue-500":"border-gray-100 hover:bg-gray-50"}
|
|
407
|
-
${!D&&!N?"opacity-60":""}
|
|
408
|
-
`,children:[w.multiSelect?p.jsx(Zp,{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(cd,{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=I.includes(Pr),E=f,N=c.get(T)||"",D=g&&!w.options.some(P=>P.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(ud,{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:`
|
|
409
|
-
flex items-start space-x-2 p-2 rounded border transition-all
|
|
410
|
-
${E?"cursor-pointer":"cursor-default"}
|
|
411
|
-
${M?"border-blue-500 bg-blue-50 ring-1 ring-blue-500":"border-gray-100 border-dashed hover:bg-gray-50"}
|
|
412
|
-
${!E&&!M?"opacity-60":""}
|
|
413
|
-
`,children:[w.multiSelect?p.jsx(Zp,{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(cd,{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(ud,{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&&f&&p.jsx("div",{className:"ml-6",children:p.jsx("input",{ref:P=>{h.current.set(T,P)},type:"text",value:N,onChange:P=>y(T,P.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:P=>{P.key==="Enter"&&k&&(P.preventDefault(),S())}})})]})})()]})]},T)})}),f&&p.jsx("div",{className:"flex justify-end pt-2",children:p.jsx("button",{onClick:S,disabled:!k||o,className:`
|
|
414
|
-
flex items-center space-x-2 px-4 py-2 rounded-lg text-sm font-medium transition-all
|
|
415
|
-
${k&&!o?"bg-blue-500 text-white hover:bg-blue-600 shadow-sm":"bg-gray-200 text-gray-400 cursor-not-allowed"}
|
|
416
|
-
`,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(Nu,{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(ag,{className:"w-4 h-4"}),p.jsx("span",{className:"text-sm font-medium",children:r("askUserQuestionTool.completed")})]}),e.isExecuting&&!d&&p.jsxs("div",{className:"flex items-center space-x-2 text-blue-600 py-2",children:[p.jsx(Sa,{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(Sa,{className:"w-4 h-4"}),p.jsx("span",{className:"text-sm",children:r("askUserQuestionTool.error")})]})]})})},Zp=({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"})]}),xO=({execution:e})=>{const{t}=ve("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)+`
|
|
417
|
-
`+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})]})]})},yO=({execution:e})=>{const{t}=ve("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 qw(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 bO(e){return e.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function kO(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 wO=({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}=ve("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}=ve("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}=ve("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)})]})}},vO=({result:e,isError:t})=>{const{t:r}=ve("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=kO(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(wO,{content:s},a))})]})},CO=({execution:e})=>{const{t}=ve("components"),r=qw(e.toolName);if(!r)return p.jsx(Qe,{execution:e});const{serverName:n,toolName:i}=r,s=bO(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(vO,{result:e.toolResult,isError:e.isError})]})})},SO=e=>e.filter(t=>t.kind==="text"&&!!t.text).map(t=>t.text).join(""),Jp=e=>{if(typeof e=="string")return e;if(typeof e=="object"&&e!==null)return e.response},_O=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}},Uw=({execution:e})=>{const{t}=ve(),r=e.toolInput;let n;if(e.toolResult)if(e.isError===!0)n={success:!1,error:e.toolResult};else{const P=e.toolResult;let $;const F=P.match(/\[System\] Session ID: ([a-f0-9-]+)/);F&&($=F[1]);try{const L=JSON.parse(P);typeof L=="object"&&L!==null?n={success:L.success!==!1,data:L.data||L.response||P,sessionId:L.sessionId||$,contextId:L.contextId,taskId:L.taskId,error:L.error}:n={success:!0,data:P,sessionId:$}}catch{n={success:!0,data:P,sessionId:$}}}const i=r.agentName||_O(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,P)=>D?P==="working"?{icon:p.jsx(_a,{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")}:P==="input-required"?{icon:p.jsx(ac,{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(_a,{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(_a,{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")}:P==="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")}:P==="failed"||P==="rejected"||l&&!o?{icon:p.jsx(Ta,{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")}:P==="canceled"?{icon:p.jsx(Ta,{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(Ta,{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,P)=>{let $=i;return r.useTask&&($+=` • ${t("tools.a2a.asyncTask","Async Task")}`),P?$+=` • ${P}`:D?$+=` • ${t("tools.a2a.streaming","Streaming...")}`:s?$+=` • ${t("tools.a2a.calling","Calling...")}`:a?$+=` • ${t("tools.a2a.running","Running...")}`:l&&!o?$+=` • ${t("tools.a2a.error","Failed")}`:(o||n)&&($+=` • ${t("tools.a2a.success","Success")}`),$},[h]=mg(),d=h.get("project"),[f,g]=xr.useState([]),[m]=xr.useState([]),[b,y]=xr.useState(!1),[k,v]=xr.useState(!1),[S]=xr.useState(),C=Ke(D=>D.activeA2AStreams[r.agentUrl]),w=C?.sessionId||n?.sessionId||r.sessionId;xr.useEffect(()=>{C?.isStreaming===!0?(v(!0),y(!0)):C&&C.isStreaming===!1&&v(!1)},[C?.isStreaming]),xr.useEffect(()=>{(n?.error||e.isError)&&v(!1)},[n?.error,e.isError]),xr.useEffect(()=>{if(!C?.events||C.events.length===0)return;const D=[];let P=null;const $=new Map;for(const F of C.events)if(F.type==="system")P={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(P);else if(F.type==="assistant"&&F.message?.content){P={id:`assistant-${Date.now()}-${Math.random()}`,role:"assistant",timestamp:new Date().toISOString(),messageParts:[]},D.push(P);for(const L of F.message.content)if(L.type==="text")P.messageParts.push({id:`text-${Date.now()}-${Math.random()}`,type:"text",content:L.text||"",order:P.messageParts.length});else if(L.type==="tool_use"){const R=L.id||`tool-${Date.now()}`,W={id:R,type:"tool",toolData:{id:R,toolName:L.name||"unknown",toolInput:L.input||{},toolResult:void 0,isError:!1},order:P.messageParts.length};P.messageParts.push(W),L.id&&$.set(L.id,W)}}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 R=$.get(L.tool_use_id);R&&R.toolData&&(R.toolData.toolResult=typeof L.content=="string"?L.content:JSON.stringify(L.content),R.toolData.isError=L.is_error||!1)}}D.length>0&&g(D)},[C?.events]);const{currentService:T}=q1(),{getToken:I}=f1(),M=T?I(T.id)?.token:null;xr.useEffect(()=>{if(!w||!d)return;(async()=>{try{const $=`/api/a2a/history/${encodeURIComponent(d)}/${w}`,F=await fetch($,{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(P){console.error("Error fetching A2A history:",P),y(!1),v(!1)}})()},[w,d,M]);const E=D=>{const P=[];let $=null;const F=new Map;for(const L of D)if(L.type==="system")(!$||$.role!=="assistant")&&($={id:`sys-${Date.now()}`,role:"assistant",timestamp:new Date().toISOString(),messageParts:[]},P.push($)),$.messageParts.push({id:`sys-part-${Date.now()}`,type:"text",content:`[System] Session ID: ${L.sessionId||"N/A"}`,order:$.messageParts.length});else if(L.type==="assistant"&&L.message?.content){(!$||$.role!=="assistant")&&($={id:L.sessionId||`assistant-${Date.now()}`,role:"assistant",timestamp:new Date().toISOString(),messageParts:[]},P.push($));for(const R of L.message.content)if(R.type==="text")$.messageParts.push({id:`text-${Date.now()}-${Math.random()}`,type:"text",content:R.text,order:$.messageParts.length});else if(R.type==="tool_use"){const W={id:R.id||`tool-${Date.now()}`,type:"tool",toolData:{id:R.id,toolName:R.name,toolInput:R.input,toolResult:void 0,isError:!1},order:$.messageParts.length};$.messageParts.push(W),R.id&&F.set(R.id,W)}}else if(L.type==="user"&&L.message?.content){for(const R of L.message.content)if(R.type==="tool_result"&&R.tool_use_id){const W=F.get(R.tool_use_id);W&&W.toolData&&(W.toolData.toolResult=typeof R.content=="string"?R.content:JSON.stringify(R.content),W.toolData.isError=R.is_error||!1)}}g(P)},N=c(k,S);return p.jsx(Qe,{execution:e,subtitle:u(k,S),showResult:!1,isMcpTool:!0,hideToolName:!1,customIcon:p.jsx(hd,{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?S?`${t("tools.a2a.taskState","Task state")}: ${S}`:t("tools.a2a.liveStreaming","Live streaming from external agent..."):t("tools.a2a.connected","Connected to history stream")})]}),f.length>0&&p.jsx(Ww,{taskPrompt:r.message,messageFlow:f,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(B1,{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(hg,{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:SO(D.parts)||JSON.stringify(D.parts,null,2)})]},D.artifactId))})]}),n&&!f.length&&p.jsxs(p.Fragment,{children:[Jp(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(hd,{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:Jp(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(ac,{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)]})]})]})]})})},TO=({execution:e})=>{const{t}=ve("components"),n=e.toolInput?.skill||t("skillTool.unknownSkill"),i=e.toolUseResult,s=i?.commandName,a=()=>s&&s!==n?`${n} → ${s}`:n,o=p.jsx(dd,{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(dd,{className:"w-4 h-4"}),p.jsx("span",{className:"text-sm",children:t("skillTool.launched")})]})]})})},EO={"a2a-client__call_external_agent":Uw},Vw=({execution:e,onAskUserQuestionSubmit:t})=>{const{t:r}=ve("components"),n=qw(e.toolName);if(n){if(n.serverName==="ask-user-question"&&n.toolName==="ask_user_question")return p.jsx(Qp,{execution:e,onSubmit:t});const i=`${n.serverName}__${n.toolName}`,s=EO[i];return s?p.jsx(s,{execution:e}):p.jsx(CO,{execution:e})}switch(e.toolName){case"Task":return p.jsx(OF,{execution:e});case"Bash":return p.jsx(zF,{execution:e});case"BashOutput":return p.jsx(T1,{execution:e});case"KillBash":return p.jsx(_1,{execution:e});case"Glob":return p.jsx(WF,{execution:e});case"Grep":return p.jsx(HF,{execution:e});case"LS":return p.jsx(qF,{execution:e});case"exit_plan_mode":return p.jsx(UF,{execution:e});case"Read":return p.jsx(VF,{execution:e});case"Edit":return p.jsx(oO,{execution:e});case"MultiEdit":return p.jsx(lO,{execution:e});case"Write":return p.jsx(hO,{execution:e});case"NotebookRead":return p.jsx(dO,{execution:e});case"NotebookEdit":return p.jsx(fO,{execution:e});case"ListMcpResources":return p.jsx(pO,{execution:e});case"ReadMcpResource":return p.jsx(gO,{execution:e});case"TimeMachine":return p.jsx(mO,{execution:e});case"AskUserQuestion":return p.jsx(Qp,{execution:e,onSubmit:t});case"WebFetch":return p.jsx(xO,{execution:e});case"TodoWrite":return p.jsx(S1,{execution:e});case"WebSearch":return p.jsx(yO,{execution:e});case"call_external_agent":return p.jsx(Uw,{execution:e});case"Skill":return p.jsx(TO,{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)})]})})}},AO=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}),eg=e=>{const t=AO(e);return p.jsx(Vw,{execution:t,onAskUserQuestionSubmit:e.onAskUserQuestionSubmit})},jo=({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,d]=O.useState({x:0,y:0}),[f,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,R=k.current,W=L.naturalWidth,X=L.naturalHeight,_=R.clientWidth,j=R.clientHeight-120,te=_/W,A=j/X;return Math.min(te,A,1)},S=()=>{b(!0);const L=v();a(L),l({x:0,y:0})},C=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(()=>{C&&(a(1),l({x:0,y:0}),g(0),u(!1),b(!1))},[C]),O.useEffect(()=>{if(!C)return;const L=R=>{switch(R.key){case"Escape":r();break;case"ArrowLeft":R.preventDefault(),w();break;case"ArrowRight":R.preventDefault(),T();break;case"ArrowUp":R.preventDefault(),w();break;case"ArrowDown":R.preventDefault(),T();break;case"=":case"+":(R.ctrlKey||R.metaKey)&&(R.preventDefault(),I("in"));break;case"-":(R.ctrlKey||R.metaKey)&&(R.preventDefault(),I("out"));break;case"0":(R.ctrlKey||R.metaKey)&&(R.preventDefault(),F());break;case"r":case"R":(R.ctrlKey||R.metaKey)&&(R.preventDefault(),M());break}};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[C,n,e?.length]);const I=L=>{a(R=>{const W=L==="in"?R*1.2:R/1.2;return Math.max(.1,Math.min(5,W))})},M=()=>{g(L=>(L+90)%360)},E=L=>{L.target===y.current&&(u(!0),d({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)},P=L=>{L.preventDefault();const R=L.deltaY>0?"out":"in";I(R)},$=()=>{if(C){const L=document.createElement("a");L.href=C,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:P,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:()=>I("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(og,{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:()=>I("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(lg,{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(D1,{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:$,className:"text-white hover:text-gray-300 p-2 hover:bg-white hover:bg-opacity-20 rounded transition-colors",title:"下载图片",children:p.jsx(cg,{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(dg,{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(Ps,{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(En,{className:"w-6 h-6"})}),p.jsx("img",{ref:y,src:C,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(${f}deg)`,maxHeight:"none",maxWidth:"none",opacity:m?1:0},onLoad:S,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关闭"})]})},MO=({content:e})=>{const{t}=ve("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(P1,{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(fi,{className:"w-4 h-4 text-gray-500 dark:text-gray-400"}):p.jsx(Ps,{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(bs,{content:r})})})]})},NO=({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(),d=h.indexOf(" "),f=d>0?h.substring(0,d):h,g=d>0?h.substring(d+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}),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(MO,{content:u.content})},u.id);if(u.type==="text"&&u.content)return p.jsx("div",{children:p.jsx(bs,{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(eg,{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 d=u.content;try{if(u.content.includes('"thinking":')){const f=u.content.match(/"thinking":"([^"]+)"/);f&&f[1]&&(d=f[1].replace(/\\n/g,`
|
|
418
|
-
`).replace(/\\"/g,'"'))}}catch(f){console.warn("Failed to parse thinking content:",f)}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:d})})]},u.id)}else return p.jsx("div",{children:p.jsx(bs,{content:u.content,isUserMessage:e.role==="user"})},u.id)}return null}),p.jsx(jo,{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(" "),d=h>0?u.substring(0,h):u,f=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:d}),f&&p.jsx("span",{className:"text-gray-100 text-sm",children:f})]})}else return p.jsx(bs,{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(eg,{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(jo,{images:r,initialIndex:i,onClose:l})]})},LO=O.memo(NO),IO=({messages:e,isLoadingMessages:t,isInitializingSession:r,isAiTyping:n,isStopping:i,messagesContainerRef:s,messagesEndRef:a,onAskUserQuestionSubmit:o})=>{const{t:l}=ve("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(LO,{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})]})},$O=({envVars:e,onChange:t})=>{const{t:r}=ve("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,d)=>{if(u!==h){const f={...e};delete f[u],f[h]=d,t(f)}else{const f={...e,[u]:d};t(f)}};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:d=>c(u,d.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:d=>c(u,u,d.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(R1,{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(fg,{className:"w-4 h-4"})})]})]})},Gw=({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:d=""})=>{const{t:f}=ve("components"),[g,m]=O.useState(!1),b=O.useRef(null);O.useEffect(()=>{const I=M=>{b.current&&!b.current.contains(M.target)&&m(!1)};return g&&document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[g]);const y=I=>{t(I)},k=I=>{n(I)},v=I=>{s(I)},S=o?.versions&&o.versions.length>1,C=a.length>=2,w=a.find(I=>I.id===i)?.name||i,T={default:f("agentChat.permissionMode.default"),acceptEdits:f("agentChat.permissionMode.acceptEdits"),bypassPermissions:f("agentChat.permissionMode.bypassPermissions")}[e];return p.jsxs("div",{className:`relative ${d}`,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:f("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(fi,{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(F1,{className:"w-4 h-4"}),f("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(En,{className:"w-4 h-4"})})]}),p.jsxs("div",{className:"overflow-y-auto p-4 space-y-6",children:[(C||S)&&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:f("agentChat.settings.modelAndVersion","Supplier & Model")}),p.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[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:f("agentChat.settings.claudeVersion")}),p.jsxs("div",{className:"relative",children:[p.jsxs("select",{value:r||"",onChange:I=>k(I.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?`${f("agentChat.claudeVersion.default")} (${o.versions.find(I=>I.id===o.defaultVersionId)?.name})`:f("agentChat.claudeVersion.default")}),o.versions.filter(I=>o.defaultVersionId&&I.id!==o.defaultVersionId).map(I=>p.jsx("option",{value:I.id,children:I.name},I.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(fi,{className:"w-4 h-4"})})]})]}),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:f("agentChat.settings.model")}),p.jsx("div",{className:"grid grid-cols-1 gap-2",children:a.map(I=>p.jsxs("button",{onClick:()=>v(I.id),className:`flex items-center justify-between px-3 py-2 text-sm rounded-lg border transition-all ${i===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(O1,{className:"w-4 h-4 opacity-70"}),p.jsx("span",{className:"font-medium",children:I.name})]}),I.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"})]},I.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:f("agentChat.settings.permissionMode")}),p.jsx("div",{className:"grid grid-cols-3 gap-2",children:[{value:"default",label:f("agentChat.permissionMode.default"),icon:Ea},{value:"acceptEdits",label:f("agentChat.permissionMode.acceptEdits"),icon:Ea},{value:"bypassPermissions",label:f("agentChat.permissionMode.bypassPermissions"),icon:Ea}].map(I=>p.jsxs("button",{onClick:()=>y(I.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===I.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(I.icon,{className:`w-4 h-4 ${e===I.value?"text-blue-500":"text-gray-400"}`}),p.jsx("span",{className:"leading-tight",children:I.label})]},I.value))})]}),p.jsx("div",{className:"h-px bg-gray-100 dark:bg-gray-700"}),p.jsx("div",{children:p.jsx($O,{envVars:u,onChange:h})})]})]})]})},jO=({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:d,setMcpToolsEnabled:f,permissionMode:g,setPermissionMode:m,selectedModel:b,setSelectedModel:y,selectedClaudeVersion:k,setSelectedClaudeVersion:v,availableModels:S,claudeVersionsData:C,isVersionLocked:w,agent:T,textareaRef:I,fileInputRef:M,envVars:E,setEnvVars:N,onSend:D,onStopGeneration:P,onKeyDown:$,onImageSelect:F,onPaste:L,onDragOver:R,onDragLeave:W,onDrop:X})=>{const{t:_}=ve("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:R,onDragLeave:W,onDrop:X,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(ks,{className:"w-6 h-6"}),p.jsx("span",{children:_("agentChat.dropImageHere")})]})}),p.jsx("div",{className:"p-4 pb-2",children:p.jsx("textarea",{ref:I,value:e,onChange:t,onKeyDown:$,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||d&&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(pg,{className:"w-4 h-4"})}),(l.length>0||d&&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+(d?u.filter(j=>j.startsWith("mcp__")&&j.split("__").length===3).length:0)}),p.jsx(Lu,{isOpen:a,onClose:()=>o(!1),selectedRegularTools:l,onRegularToolsChange:c,selectedMcpTools:u,onMcpToolsChange:h,mcpToolsEnabled:d,onMcpEnabledChange:f,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(ks,{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(Gw,{permissionMode:g,onPermissionModeChange:m,selectedClaudeVersion:k,onClaudeVersionChange:j=>v(j||""),selectedModel:b,onModelChange:y,availableModels:S,claudeVersionsData:C,isVersionLocked:w,isAiTyping:i,envVars:E,onEnvVarsChange:N}),i?p.jsxs("button",{onClick:P,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(gg,{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(Nu,{className:"w-4 h-4"}),p.jsx("span",{children:_("agentChatPanel.send")})]})]})]})})]})},BO=({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:d,setMcpToolsEnabled:f,permissionMode:g,setPermissionMode:m,selectedModel:b,setSelectedModel:y,selectedClaudeVersion:k,setSelectedClaudeVersion:v,availableModels:S,claudeVersionsData:C,isVersionLocked:w,envVars:T,onEnvVarsChange:I,agent:M,textareaRef:E,fileInputRef:N,onSend:D,onStopGeneration:P,onKeyDown:$,onImageSelect:F,onPaste:L,onDragOver:R,onDragLeave:W,onDrop:X})=>{const{t:_}=ve("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:R,onDragLeave:W,onDrop:X,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(ks,{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||d&&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||d&&u.length>0?_("agentChat.toolSelection")+` (${_("agentChat.selectedCount",{count:l.length+(d?u.length:0)})})`:_("agentChat.toolSelection"),disabled:i,children:p.jsx(pg,{className:"w-4 h-4"})}),(l.length>0||d&&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+(d?u.filter(j=>j.startsWith("mcp__")&&j.split("__").length===3).length:0)}),p.jsx(Lu,{isOpen:a,onClose:()=>o(!1),selectedRegularTools:l,onRegularToolsChange:c,selectedMcpTools:u,onMcpToolsChange:h,mcpToolsEnabled:d,onMcpEnabledChange:f,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(ks,{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(Gw,{permissionMode:g,onPermissionModeChange:m,selectedClaudeVersion:k,onClaudeVersionChange:j=>v(j||""),selectedModel:b,onModelChange:y,availableModels:S,claudeVersionsData:C,isVersionLocked:w,isAiTyping:i,envVars:T,onEnvVarsChange:I})]}),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:$,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(`
|
|
419
|
-
`).length,style:{minHeight:"40px",maxHeight:"120px"},disabled:i})}),i?p.jsx("button",{onClick:P,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(gg,{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(Nu,{className:"w-4 h-4"})})]})]}),p.jsx("input",{ref:N,type:"file",accept:"image/*",multiple:!0,onChange:F,style:{display:"none"}})]})},DO=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}],PO=({isOpen:e,onSelect:t,onClose:r,searchTerm:n,position:i,projectId:s,selectedIndex:a=0,onSelectedIndexChange:o})=>{const{t:l}=ve("components"),c=O.useRef(null);O.useEffect(()=>{const C=w=>{c.current&&!c.current.contains(w.target)&&r?.()};if(e)return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[e,r]);const{data:u=[]}=oc({scope:"user",search:n}),{data:h=[]}=lc({projectId:s||"",search:n}),g=[...DO(l).filter(C=>C.name.toLowerCase().includes(n.toLowerCase())||C.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 C=c.current.querySelector(`[data-index="${a}"]`);C&&C.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,S=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:`${S}px`},children:p.jsx("div",{className:"overflow-y-auto",style:{maxHeight:`${S}px`},children:g.map((C,w)=>{const T="isSystem"in C,I=w===a,M=()=>T?C.name:C.namespace?`${C.namespace}:${C.name}`:C.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 ${I?"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(C),onMouseEnter:()=>o?.(w),children:p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:`text-sm font-medium truncate ${I?"text-blue-900 dark:text-blue-300":"text-gray-900 dark:text-gray-100"}`,children:M()}),C.description&&p.jsx("div",{className:`text-xs truncate ${I?"text-blue-700 dark:text-blue-400":"text-gray-500 dark:text-gray-400"}`,children:C.description})]})},C.id)})})})},tg=({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:d,onSetAtSymbolPosition:f})=>{const{t:g}=ve("components"),m=S=>{l(S),c(`/${S.name}`),u(!1),a.current&&a.current.focus()},b=()=>{u(!1)},y=(S,C)=>{if(!a.current||i===null)return;let w=S.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),I=o.substring(i+1),M=T+"@"+w+" "+I;c(M),d(!1),f(null),setTimeout(()=>{if(a.current){const E=i+1+w.length+1;a.current.setSelectionRange(E,E),a.current.focus()}},0)},k=()=>{d(!1),f(null),setTimeout(()=>{a.current?.focus()},0)},v=()=>{if(!a.current)return{top:0,left:0};const S=a.current.getBoundingClientRect();return{top:S.top,left:S.left}};return p.jsxs(p.Fragment,{children:[p.jsx(PO,{isOpen:e,onSelect:m,onClose:b,searchTerm:r,position:v(),projectId:s,selectedIndex:n,onSelectedIndexChange:h}),t&&p.jsx(Y1,{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})]})},RO=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)},rg=({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(En,{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,ng=({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 d=new Set(n);d.has(h)?d.delete(h):d.add(h),i(d)},u=async(h,d)=>{try{await navigator.clipboard.writeText(h),a(d),setTimeout(()=>a(null),2e3)}catch(f){console.error("Failed to copy error text:",f)}};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(fd,{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(En,{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(z1,{className:"w-4 h-4 text-red-500"}):p.jsx(pd,{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,d)=>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,")"]})]},d))})]}),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,d)=>{const f=n.has(d),g=h.error&&h.error.length>50,m=s===d;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(fd,{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(d),className:"ml-auto p-1 hover:bg-red-100 dark:hover:bg-red-800/30 rounded",title:f?"收起详细错误":"展开详细错误",children:f?p.jsx(fi,{className:"w-3 h-3 text-red-500"}):p.jsx(Ps,{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:f?h.error:`${h.error.substring(0,50)}...`}),f&&p.jsx("div",{className:"flex items-center justify-between mt-2",children:p.jsxs("button",{onClick:()=>u(h.error,d),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(sc,{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})})]},d)})})]}),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?`
|
|
420
|
-
详情: `+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(sc,{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(pd,{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 服务器配置。"})})]})})},FO=e=>{const{t}=ve("components"),{inputMessage:r,selectedImages:n,isAiTyping:i,isMobile:s,showToolSelector:a,selectedRegularTools:o,selectedMcpTools:l,mcpToolsEnabled:c,showCommandSelector:u,showFileBrowser:h,commandSearch:d,selectedCommand:f,selectedCommandIndex:g,atSymbolPosition:m,commandWarning:b,permissionMode:y,selectedModel:k,selectedClaudeVersion:v,showMobileSettings:S,isVersionLocked:C,isDragOver:w,previewImage:T,showConfirmDialog:I,confirmMessage:M,showMcpStatusModal:E,availableModels:N,claudeVersionsData:D,agent:P,projectPath:$,mcpStatus:F,textareaRef:L,fileInputRef:R,onSend:W,handleKeyDown:X,handleImageSelect:_,handleImageRemove:j,handleImagePreview:te,handlePaste:A,handleDragOver:B,handleDragLeave:Y,handleDrop:U,handleStopGeneration:q,onSetInputMessage:G,onSetShowToolSelector:Q,onSetSelectedRegularTools:re,onSetSelectedMcpTools:ge,onSetMcpToolsEnabled:Se,onSetPermissionMode:Ce,onSetSelectedModel:Le,onSetSelectedClaudeVersion:ze,onSetShowMobileSettings:Je,onSetPreviewImage:ct,onSetShowMcpStatusModal:$t,onCommandSelect:vt,onSetShowCommandSelector:Ee,onSetSelectedCommandIndex:ut,onSetShowFileBrowser:gt,onSetAtSymbolPosition:We,onSetCommandWarning:Ct,onSetCommandSearch:yt,handleConfirmDialog:V,handleCancelDialog:J,isSendDisabled:xe,envVars:_e,onSetEnvVars:Ie}=e,st=O.useCallback(Be=>{const qe=Be.target.value;if(G(qe),b&&Ct(null),qe.length>0&&qe[qe.length-1]==="@"){const mt=qe.substring(0,qe.length-1);if(mt.length===0||/\s$/.test(mt)){We(qe.length-1),gt(!0),L.current?.blur();return}}if(cs(qe)){const mt=rv(qe);mt!==d&&(yt(mt),ut(0)),u||Ee(!0)}else u&&(Ee(!1),ut(0))},[b,d,u,G,We,gt,Ee,Ct,ut,yt,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(BO,{inputMessage:r,setInputMessage:st,selectedImages:n,isDragOver:w,isAiTyping:i,isSendDisabled:xe(),showToolSelector:a,setShowToolSelector:Q,selectedRegularTools:o,setSelectedRegularTools:re,selectedMcpTools:l,setSelectedMcpTools:ge,mcpToolsEnabled:c,setMcpToolsEnabled:Se,permissionMode:y,setPermissionMode:Ce,selectedModel:k,setSelectedModel:Le,selectedClaudeVersion:v,setSelectedClaudeVersion:ze,availableModels:N,claudeVersionsData:D,isVersionLocked:C,agent:P,textareaRef:L,fileInputRef:R,onSend:W,onStopGeneration:q,onKeyDown:X,onImageSelect:_,onPaste:A,onDragOver:B,onDragLeave:Y,onDrop:U,envVars:_e,onEnvVarsChange:Ie}),p.jsx(Lu,{isOpen:a,onClose:()=>Q(!1),selectedRegularTools:o,onRegularToolsChange:re,selectedMcpTools:l,onMcpToolsChange:ge,mcpToolsEnabled:c,onMcpEnabledChange:Se,presetTools:P.allowedTools})]}),S&&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:()=>Je(!1),className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:p.jsx(En,{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=>Ce(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))})]}),!C&&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=>ze(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(tg,{showCommandSelector:u,showFileBrowser:h,commandSearch:d,selectedCommand:f,selectedCommandIndex:g,atSymbolPosition:m,projectPath:$,textareaRef:L,inputMessage:r,onCommandSelect:vt,onSetInputMessage:G,onSetShowCommandSelector:Ee,onSetSelectedCommandIndex:ut,onSetShowFileBrowser:gt,onSetAtSymbolPosition:We}),p.jsx(rg,{isOpen:I,message:M,onConfirm:V,onCancel:J}),p.jsx(jo,{images:T?[T]:[],onClose:()=>ct(null)}),p.jsx(ng,{isOpen:E,onClose:()=>$t(!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:B,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(En,{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(ks,{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(jO,{inputMessage:r,setInputMessage:st,selectedImages:n,isDragOver:w,isAiTyping:i,isSendDisabled:xe(),showToolSelector:a,setShowToolSelector:Q,selectedRegularTools:o,setSelectedRegularTools:re,selectedMcpTools:l,setSelectedMcpTools:ge,mcpToolsEnabled:c,setMcpToolsEnabled:Se,permissionMode:y,setPermissionMode:Ce,selectedModel:k,setSelectedModel:Le,selectedClaudeVersion:v,setSelectedClaudeVersion:ze,availableModels:N,claudeVersionsData:D,isVersionLocked:C,agent:P,textareaRef:L,fileInputRef:R,onSend:W,onStopGeneration:q,onKeyDown:X,onImageSelect:_,onPaste:A,onDragOver:B,onDragLeave:Y,onDrop:U,envVars:_e,setEnvVars:Ie})]}),p.jsx(tg,{showCommandSelector:u,showFileBrowser:h,commandSearch:d,selectedCommand:f,selectedCommandIndex:g,atSymbolPosition:m,projectPath:$,textareaRef:L,inputMessage:r,onCommandSelect:vt,onSetInputMessage:G,onSetShowCommandSelector:Ee,onSetSelectedCommandIndex:ut,onSetShowFileBrowser:gt,onSetAtSymbolPosition:We}),p.jsx(rg,{isOpen:I,message:M,onConfirm:V,onCancel:J}),p.jsx(jo,{images:T?[T]:[],onClose:()=>ct(null)}),p.jsx(ng,{isOpen:E,onClose:()=>$t(!1),mcpStatus:F})]})},OO=({agent:e,projectPath:t,onSessionChange:r,initialMessage:n})=>{const{t:i}=ve("components"),{isCompactMode:s}=Z1(),{isMobile:a}=xg(),o=O.useRef(null),l=O.useRef(null),c=O.useRef(null),u=O.useRef(null),h=O.useRef(null),[d,f]=O.useState(""),[g,m]=O.useState(!1),[b,y]=O.useState(void 0),[k,v]=O.useState(void 0),{messages:S,isAiTyping:C,currentSessionId:w,mcpStatus:T,pendingUserQuestion:I,addMessage:M,interruptAllExecutingTools:E,setAiTyping:N,loadSessionMessages:D,setPendingUserQuestion:P}=Ke(),$=O.useRef(!1);O.useEffect(()=>{n&&!g&&(f(n),m(!0),$.current=!0)},[n,g]);const F=pv(),{showSessions:L,showConfirmDialog:R,showMobileSettings:W,showMcpStatusModal:X,confirmMessage:_,searchTerm:j,isStopping:te,isInitializingSession:A,setShowSessions:B,setShowConfirmDialog:Y,setShowMobileSettings:U,setShowMcpStatusModal:q,setConfirmMessage:G,setConfirmAction:Q,setSearchTerm:re,setIsStopping:ge,setIsInitializingSession:Se,handleConfirmDialog:Ce,handleCancelDialog:Le}=F,ze=fv({agentId:e.id,currentSessionId:w,onSessionChange:r,textareaRef:c}),{isLoadingMessages:Je,isNewSession:ct,hasSuccessfulResponse:$t,setIsLoadingMessages:vt,setIsNewSession:Ee,setHasSuccessfulResponse:ut,setCurrentSessionId:gt,handleSwitchSession:We,handleNewSession:Ct,handleRefreshMessages:yt}=ze,{selectedImages:V,previewImage:J,isDragOver:xe,handleImageSelect:_e,handleImageRemove:Ie,handleImagePreview:st,handlePaste:Be,handleDragOver:qe,handleDragLeave:mt,handleDrop:bt,clearImages:Ze,setPreviewImage:Jt}=nv({textareaRef:c,inputMessage:d,setInputMessage:f}),jt=iv({messagesContainerRef:o,messagesEndRef:l,messages:S,isAiTyping:C}),gl=sv({projectPath:t,textareaRef:c}),Wn=av({agent:e}),Hn=ov({initialModel:k||"sonnet",initialVersion:b}),{commandSearch:Qs,selectedCommand:Nr,selectedCommandIndex:Zs,commandWarning:ml,showCommandSelector:et,showFileBrowser:Lr,atSymbolPosition:Js,allCommands:hn,SYSTEM_COMMANDS:qn,userCommands:ea,projectCommands:ta,userCommandsError:Ii,projectCommandsError:Wt,setSelectedCommand:Ir,setSelectedCommandIndex:Un,setCommandWarning:dn,setShowCommandSelector:fn,setShowFileBrowser:$i,setAtSymbolPosition:er,setCommandSearch:ra,handleCommandSelect:ji,isCommandDefined:Bi,getAllAvailableCommands:Di}=gl,{selectedModel:pn,selectedClaudeVersion:he,isVersionLocked:z,claudeVersionsData:Z,availableModels:oe,setSelectedModel:Pe,setSelectedClaudeVersion:tt,setIsVersionLocked:Ge}=Hn;O.useEffect(()=>{t&&(async()=>{try{const rt=await Ua(`${qa}/projects/${encodeURIComponent(t)}`);if(rt.ok){const xt=await rt.json();console.log("🔧 Project settings loaded:",xt.project),xt.project.defaultProviderId&&(console.log("🔧 Setting provider to:",xt.project.defaultProviderId),y(xt.project.defaultProviderId),tt(xt.project.defaultProviderId)),xt.project.defaultModel&&(console.log("🔧 Setting model to:",xt.project.defaultModel),v(xt.project.defaultModel),Pe(xt.project.defaultModel))}}catch(rt){console.error("Failed to fetch project settings:",rt)}})()},[t,tt,Pe]);const{showToolSelector:St,selectedRegularTools:tr,selectedMcpTools:$r,mcpToolsEnabled:Vn,permissionMode:at,showPermissionDropdown:na,showModelDropdown:ia,showVersionDropdown:Yw,setShowToolSelector:Xw,setSelectedRegularTools:Kw,setSelectedMcpTools:Qw,setMcpToolsEnabled:Zw,setPermissionMode:Jw,setShowPermissionDropdown:Zh,setShowModelDropdown:Jh,setShowVersionDropdown:ed,envVars:td,setEnvVars:e1}=Wn,{isUserScrolling:rd,newMessagesCount:nd,scrollToBottom:id,setNewMessagesCount:t1,setIsUserScrolling:r1}=jt,[n1,i1]=O.useState("默认服务");O.useEffect(()=>{const be=p1(),rt=g1(be);rt&&i1(rt.name)},[]);const s1=b1(),{data:sd,refetch:ad}=k1(e.id,j,t),{data:jr}=w1(e.id,w,t),{data:xl}=C1();O.useEffect(()=>{L&&(console.log("📋 [Sessions] Dropdown opened, refreshing sessions list..."),ad())},[L,ad]),Q1({agentId:e.id,sessionId:w,projectPath:t,enabled:!!w,isNewSession:ct,hasSuccessfulResponse:$t}),O.useEffect(()=>vr.startSmartMonitoring(),[]),O.useEffect(()=>{if(w&&e.id)return console.log(`🎯 Setting up wakeup listener for session: ${w}`),vr.setupWakeupListener(e.id,w)},[w,e.id]);const od=Ii||Wt;O.useEffect(()=>{Un(be=>hn.length>0&&be>=hn.length?0:be)},[hn.length]);const a1=be=>{We(be),B(!1)},o1=()=>{Ct(),B(!1),re("")},l1=async()=>{if(!(!h.current||!w))try{ge(!0),console.log("🛑 Stopping generation for session:",w);try{await s1.mutateAsync(w),console.log("✅ Successfully interrupted session via API")}catch(be){console.error("❌ Failed to interrupt session:",be);const rt=be instanceof Error?be.message:"Unknown error";M({content:`${i("agentChat.stopFailed")}
|
|
421
|
-
|
|
422
|
-
${rt}`,role:"assistant"}),ge(!1);return}E(),h.current.abort(),h.current=null,N(!1),ge(!1),Se(!1),M({content:i("agentChat.generationStopped"),role:"assistant"})}catch(be){console.error("Error stopping generation:",be),ge(!1),Se(!1)}},{isSendDisabled:yl,handleSendMessage:sa}=dv({agent:e,projectPath:t,inputMessage:d,selectedImages:V,isAiTyping:C,currentSessionId:w,hasCommandsLoadError:!!od,userCommandsError:Ii||void 0,projectCommandsError:Wt||void 0,SYSTEM_COMMANDS:qn,userCommands:ea,projectCommands:ta,selectedCommand:Nr,selectedRegularTools:tr,selectedMcpTools:$r,mcpToolsEnabled:Vn,permissionMode:at,selectedModel:pn,selectedClaudeVersion:he,abortControllerRef:h,onSessionChange:r,setInputMessage:f,clearImages:Ze,setSelectedCommand:Ir,setShowCommandSelector:fn,setCommandWarning:dn,setIsInitializingSession:Se,setCurrentSessionId:gt,setIsNewSession:Ee,setAiTyping:N,setHasSuccessfulResponse:ut,setConfirmMessage:G,setConfirmAction:Q,setShowConfirmDialog:Y,handleNewSession:Ct,isCommandDefined:Bi,getAllAvailableCommands:Di,envVars:td});O.useEffect(()=>{if(!$.current||!d)return;const be=()=>!yl()&&!C?($.current=!1,sa(),!0):!1;if(be())return;const rt=setTimeout(()=>{$.current&&be()},500);return()=>clearTimeout(rt)},[d,yl,C,sa]);const c1=async(be,rt)=>{console.log("🎤 [AskUserQuestion] Submitting response for tool:",be);try{const xt=await Ua(`${qa}/agents/user-response`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolUseId:be,response:rt,sessionId:w,agentId:e.id})});if(!xt.ok){const d1=await xt.json().catch(()=>({}));throw new Error(d1.error||`HTTP ${xt.status}`)}console.log("✅ [AskUserQuestion] Response submitted successfully"),P(null)}catch(xt){console.error("🎤 [AskUserQuestion] Submit failed:",xt)}},u1=RO({showCommandSelector:et,showFileBrowser:Lr,commandSearch:Qs,selectedCommand:Nr,selectedCommandIndex:Zs,atSymbolPosition:Js,projectPath:t,textareaRef:c,inputMessage:d,allCommands:hn,onCommandSelect:ji,onSetInputMessage:f,onSetShowCommandSelector:fn,onSetSelectedCommandIndex:Un,onSetShowFileBrowser:$i,onSetAtSymbolPosition:er,onHandleKeyDown:be=>{if(be.key==="Enter"&&!be.shiftKey){if(be.preventDefault(),cs(d)){const rt=d.slice(1).split(" ")[0].toLowerCase();if(!Bi(rt)){dn(od?i("agentChat.commandsLoadErrorWarning",{command:rt,commands:qn.map(xt=>xt.content).join(", "),errorMessage:Ii?.message||Wt?.message||"Unknown error"}):i("agentChat.unknownCommandWarning",{command:rt,commands:Di()}));return}}sa();return}}}),h1=()=>{const be=c.current;be&&(be.style.height="auto",be.style.height=Math.min(be.scrollHeight,100)+"px")};return O.useEffect(()=>{h1()},[d]),O.useEffect(()=>{console.log("🔍 Session messages effect triggered:",{sessionMessagesData:jr?.messages?.length||0,currentSessionId:w,hasSessionMessagesData:!!jr,messagesLength:jr?.messages?.length,isLoadingMessages:Je}),jr?.messages&&w?(console.log("✅ Loading session messages:",jr.messages.length),D(jr.messages),Je&&setTimeout(()=>{vt(!1)},100)):w&&jr&&jr.messages?.length===0&&(console.log("🗑️ Loading empty session messages"),D([]),Je&&setTimeout(()=>{vt(!1)},100))},[jr,w,D,Je,i]),O.useEffect(()=>{const be=rt=>{rt.target.closest(".dropdown-container")||(Zh(!1),Jh(!1),ed(!1))};return document.addEventListener("mousedown",be),()=>document.removeEventListener("mousedown",be)},[]),O.useEffect(()=>{if(!w||!xl?.sessions){Ge(!1);return}const be=xl.sessions.find(rt=>rt.sessionId===w);be?(console.log(`🔒 Found active session: ${w}, version: ${be.claudeVersionId}, model: ${be.modelId}`),be.claudeVersionId?(he!==be.claudeVersionId&&(console.log(`🔄 Changing Claude version from ${he} to ${be.claudeVersionId}`),tt(be.claudeVersionId)),be.modelId&&pn!==be.modelId&&(console.log(`🔄 Restoring model from ${pn} to ${be.modelId}`),Pe(be.modelId)),Ge(!0),console.log(`🔒 Locked to Claude version: ${be.claudeVersionId}, model: ${be.modelId}`)):(Ge(!1),console.log("🔓 Session has no specific version, unlocked but keeping user selection"))):(Ge(!1),console.log(`🔓 Session ${w} not in active sessions, unlocked but keeping user selection`))},[w,xl,he,pn,Pe]),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:["[",n1,"]"]}),t&&p.jsx("span",{className:"text-sm opacity-75 font-normal truncate flex-shrink-0",title:t,children:t.split("/").pop()||t}),w&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-sm opacity-75",children:"-"}),p.jsx("span",{className:"text-sm opacity-75 truncate",children:sd?.sessions?.find(be=>be.id===w)?.title||i("agentChat.currentSession")})]})]})}),p.jsxs("div",{className:"flex space-x-1 flex-shrink-0 ml-2",children:[p.jsx("button",{onClick:o1,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:i("agentChat.newSession"),children:p.jsx(fg,{className:"w-4 h-4"})}),p.jsxs("div",{className:"relative",children:[p.jsx("button",{onClick:()=>B(!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:i("agentChat.sessionHistory"),children:p.jsx(Zr,{className:"w-4 h-4"})}),p.jsx(J1,{isOpen:L,onToggle:()=>B(!L),sessions:sd?.sessions||[],currentSessionId:w,onSwitchSession:a1,isLoading:!1,searchTerm:j,onSearchChange:re})]}),p.jsx("button",{onClick:yt,disabled:!w||Je,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:i("agentChat.refreshMessages"),children:p.jsx(ug,{className:`w-4 h-4 ${Je?"animate-spin":""}`})})]})]})}),p.jsxs("div",{className:"flex-1 relative min-h-0",children:[p.jsxs("div",{ref:o,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})}),Je?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:i("agentChat.loadingMessages")})]}):p.jsx(IO,{messages:S,isLoadingMessages:Je,isInitializingSession:A,isAiTyping:C,isStopping:te,messagesContainerRef:o,messagesEndRef:l,isUserScrolling:rd,newMessagesCount:nd,onScrollToBottom:id,onAskUserQuestionSubmit:c1}),p.jsx("div",{ref:l})]}),rd&&nd>0&&p.jsxs("button",{onClick:()=>{id(),r1(!1),t1(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:i("agentChat.scrollToLatest")}),p.jsx(fi,{className:"w-4 h-4"})]})]}),p.jsx(FO,{inputMessage:d,selectedImages:V,isAiTyping:C,isStopping:te,isMobile:a,showToolSelector:St,selectedRegularTools:tr,selectedMcpTools:$r,mcpToolsEnabled:Vn,showCommandSelector:et,showFileBrowser:Lr,commandSearch:Qs,selectedCommand:Nr,selectedCommandIndex:Zs,atSymbolPosition:Js,commandWarning:ml||"",permissionMode:at,selectedModel:pn,selectedClaudeVersion:he||"",showPermissionDropdown:na,showModelDropdown:ia,showVersionDropdown:Yw,showMobileSettings:W,isCompactMode:s,isVersionLocked:z,isDragOver:xe,previewImage:J,showConfirmDialog:R,confirmMessage:_||"",showMcpStatusModal:X,availableModels:oe,claudeVersionsData:Z,agent:e,projectPath:t,mcpStatus:T,textareaRef:c,fileInputRef:u,onSend:sa,handleKeyDown:u1,handleImageSelect:_e,handleImageRemove:Ie,handleImagePreview:st,handlePaste:Be,handleDragOver:qe,handleDragLeave:mt,handleDrop:bt,handleStopGeneration:l1,onSetInputMessage:f,onSetShowToolSelector:Xw,onSetSelectedRegularTools:Kw,onSetSelectedMcpTools:Qw,onSetMcpToolsEnabled:Zw,onSetPermissionMode:Jw,onSetSelectedModel:Pe,onSetSelectedClaudeVersion:tt,onSetShowPermissionDropdown:Zh,onSetShowModelDropdown:Jh,onSetShowVersionDropdown:ed,onSetShowMobileSettings:U,onSetPreviewImage:Jt,onSetShowConfirmDialog:Y,onSetShowMcpStatusModal:q,onCommandSelect:ji,onSetShowCommandSelector:fn,onSetSelectedCommandIndex:Un,onSetShowFileBrowser:$i,onSetAtSymbolPosition:er,onSetCommandWarning:dn,onSetCommandSearch:ra,handleConfirmDialog:Ce,handleCancelDialog:Le,isSendDisabled:()=>yl()||!!I,envVars:td,onSetEnvVars:e1})]})},ig=({isPanelVisible:e,onToggle:t,position:r,className:n=""})=>{const a=(r==="left"?e?"left":"right":e?"right":"left")==="left"?dg:Ps,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:`
|
|
423
|
-
${o()}
|
|
424
|
-
w-8 h-8 rounded-full
|
|
425
|
-
bg-gray-500/10 dark:bg-gray-400/10
|
|
426
|
-
border border-gray-500/20 dark:border-gray-400/20
|
|
427
|
-
text-gray-600 dark:text-gray-300
|
|
428
|
-
hover:bg-gray-500/20 dark:hover:bg-gray-400/20
|
|
429
|
-
hover:scale-110 hover:border-gray-500/40 dark:hover:border-gray-400/40
|
|
430
|
-
hover:text-gray-800 dark:hover:text-white
|
|
431
|
-
transition-all duration-200 ease-in-out
|
|
432
|
-
flex items-center justify-center
|
|
433
|
-
backdrop-blur-sm
|
|
434
|
-
shadow-sm hover:shadow-md
|
|
435
|
-
${n}
|
|
436
|
-
`,title:r==="left"?e?"隐藏聊天界面":"显示聊天界面":e?"隐藏可视化界面":"显示可视化界面",children:p.jsx(a,{className:"w-4 h-4"})})},zO=({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}=xg(),[d,f]=O.useState(t),[g,m]=O.useState(!1),[b,y]=O.useState("left"),k=O.useRef(null),v=w=>{c||(w.preventDefault(),m(!0))},S=O.useCallback(w=>{if(!g||!k.current||c)return;const T=k.current.getBoundingClientRect(),I=(w.clientX-T.left)/T.width*100,M=Math.min(Math.max(I,r),n);f(M)},[g,r,n,c]),C=O.useCallback(()=>{m(!1)},[]);if(O.useEffect(()=>(g&&!c?(document.addEventListener("mousemove",S),document.addEventListener("mouseup",C),document.body.style.cursor="col-resize",document.body.style.userSelect="none"):(document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",C),document.body.style.cursor="",document.body.style.userSelect=""),()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",C),document.body.style.cursor="",document.body.style.userSelect=""}),[g,S,C,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:`
|
|
437
|
-
flex flex-col relative
|
|
438
|
-
${i?"hidden":"block"}
|
|
439
|
-
`,style:{width:s?"100%":`${d}%`},children:e[0]}),!i&&!s&&p.jsx("div",{className:`
|
|
440
|
-
resize-separator relative z-10
|
|
441
|
-
${g?"w-2 bg-blue-500":"w-1.5 bg-gray-300 hover:bg-blue-400"}
|
|
442
|
-
cursor-col-resize transition-all duration-200
|
|
443
|
-
flex items-center justify-center
|
|
444
|
-
group
|
|
445
|
-
`,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:`
|
|
446
|
-
flex flex-col border-l border-gray-200 relative
|
|
447
|
-
${s?"hidden":"block"}
|
|
448
|
-
`,style:{width:i?"100%":`${100-d}%`},children:e[1]}),a&&p.jsx(ig,{isPanelVisible:!i,onToggle:a,position:"left",className:"panel-toggle-left"}),o&&p.jsx(ig,{isPanelVisible:!s,onToggle:o,position:"right",className:"panel-toggle-right"})]})},WO=({currentView:e,onViewChange:t,hasCustomComponent:r,className:n=""})=>{if(!r)return null;const i=()=>{t(e==="files"?"custom":"files")},s=e==="files"?W1:hg,a=e==="files"?"Agent 界面":"文件浏览器";return p.jsxs("button",{onClick:i,className:`
|
|
449
|
-
fixed bottom-6 right-6 z-30
|
|
450
|
-
w-12 h-12 rounded-full
|
|
451
|
-
bg-white dark:bg-gray-800
|
|
452
|
-
border border-gray-200 dark:border-gray-600
|
|
453
|
-
shadow-lg hover:shadow-xl
|
|
454
|
-
text-gray-600 dark:text-gray-300
|
|
455
|
-
hover:text-blue-600 dark:hover:text-blue-400
|
|
456
|
-
hover:bg-blue-50 dark:hover:bg-blue-900/20
|
|
457
|
-
hover:border-blue-200 dark:hover:border-blue-700
|
|
458
|
-
transition-all duration-200 ease-in-out
|
|
459
|
-
flex items-center justify-center
|
|
460
|
-
group
|
|
461
|
-
backdrop-blur-sm
|
|
462
|
-
${n}
|
|
463
|
-
`,title:`切换到${a}`,children:[p.jsx(s,{className:"w-5 h-5"}),p.jsx("div",{className:`
|
|
464
|
-
absolute bottom-full right-0 mb-2 px-2 py-1
|
|
465
|
-
bg-gray-900 dark:bg-gray-700
|
|
466
|
-
text-white text-xs rounded
|
|
467
|
-
opacity-0 group-hover:opacity-100
|
|
468
|
-
transition-opacity duration-200
|
|
469
|
-
pointer-events-none
|
|
470
|
-
whitespace-nowrap
|
|
471
|
-
`,children:a})]})},HO=({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(gd,{projectPath:t,onFileSelect:a=>{console.log("Selected file:",a)},className:"h-full"})})]}):p.jsx(gd,{projectPath:t,onFileSelect:a=>{console.log("Selected file:",a)},className:"h-full"})}),p.jsx(WO,{currentView:n,onViewChange:i,hasCustomComponent:s,className:"floating-toggle"})]})},qO=({projectPath:e})=>{const{t}=ve("agents"),{data:r,isLoading:n,error:i}=m1(e),s=Mu(),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 cc.on(uc.AI_RESPONSE_COMPLETE,c),()=>{cc.off(uc.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(x1,{ref:u=>{u?a.current[c.index]=u:delete a.current[c.index]},slide:c,totalSlides:l.length,projectPath:e},c.index))})})]})},UO={rightPanelComponent:qO,onMount:e=>{console.log(`Slides agent ${e} mounted`)},onUnmount:e=>{console.log(`Slides agent ${e} unmounted`)}},VO={onMount:e=>{console.log(`Chat agent ${e} mounted`)},onUnmount:e=>{console.log(`Chat agent ${e} unmounted`)}},GO={slides:UO,chat:VO},YO=e=>GO[e];function XO({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)},d=()=>{h(),document.title=c.current},f=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)d();else{const b=u.current;b==="working"?f(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"?f(r):e==="completed"?g(n):e==="error"?g(i):e==="idle"&&d())},[e,r,n,i]),O.useEffect(()=>()=>{h(),document.title=c.current},[])}const KO=()=>{const{t:e}=ve("pages"),{agentId:t}=U1(),[r]=mg(),n=V1(),i=r.get("project"),s=r.get("session"),a=r.get("message"),{data:o,isLoading:l,error:c}=v1(t),{setCurrentAgent:u,setCurrentSessionId:h,isAiTyping:d}=Ke(),[f,g]=O.useState(!1),[m,b]=O.useState(!1),[y,k]=O.useState(!1),[v,S]=O.useState(null),[C,w]=O.useState(!1),T=xr.useRef(!1),I=o?.agent;O.useEffect(()=>{d?(T.current=!0,w(!1)):T.current&&(document.hidden||(w(!0),T.current=!1))},[d]),O.useEffect(()=>{const W=()=>{!document.hidden&&!d&&T.current&&(w(!0),T.current=!1)};return document.addEventListener("visibilitychange",W),()=>document.removeEventListener("visibilitychange",W)},[d]);const M=O.useMemo(()=>v?"error":d?"working":!d&&T.current&&!C?"completed":"idle",[d,v,C]);XO({status:M,originalTitle:I?`${I.ui.icon} ${I.name} - AgentStudio`:"AgentStudio",workingText:e("chat.tabNotification.working"),completedText:e("chat.tabNotification.completed"),errorText:e("chat.tabNotification.error")}),O.useEffect(()=>{if(c){S(c);const W=setTimeout(()=>S(null),5e3);return()=>clearTimeout(W)}},[c]),O.useEffect(()=>{console.log("🎯 ChatPage agent/session effect:",{hasAgent:!!I,agentId:I?.id,sessionId:s,urlSessionId:r.get("session")}),I&&(console.log("🎯 Setting current agent:",I.id),u(I),s&&(console.log("🎯 Setting session ID:",s),h(s)))},[I,s,u,h]),O.useEffect(()=>{I&&!i&&g(!0)},[I,i]);const E=W=>{const X=new URLSearchParams;X.set("project",W),s&&X.set("session",s),n(`/chat/${t}?${X.toString()}`,{replace:!0}),g(!1)},N=W=>{const X=new URLSearchParams;i&&X.set("project",i),W&&X.set("session",W),n(`/chat/${t}?${X.toString()}`,{replace:!0})},D=()=>{g(!1),n("/agents")},P=O.useMemo(()=>{if(I?.ui?.componentType)return YO(I.ui.componentType)},[I]),$=P?.rightPanelComponent;if(O.useEffect(()=>{if(!(!I||!P))return P.onMount&&P.onMount(I.id),()=>{P.onUnmount&&P.onUnmount(I.id)}},[I,P]),l)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(c||!I)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(!I.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:I.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:I.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 F=()=>{const W=!m;b(W),W&&y&&k(!1)},L=()=>{const W=!y;k(W),W&&m&&b(!1)},R=()=>p.jsxs(zO,{hideLeftPanel:m,hideRightPanel:y,onToggleLeftPanel:F,onToggleRightPanel:L,mobileLayout:"tabs",children:[p.jsx(OO,{agent:I,projectPath:i||void 0,onSessionChange:N,initialMessage:a||void 0}),p.jsx(HO,{agent:I,projectPath:i||void 0,CustomComponent:$})]});return p.jsxs("div",{className:"h-screen bg-gray-100 dark:bg-gray-900",children:[R(),f&&I&&p.jsx(X1,{agent:I,onProjectSelect:E,onClose:D})]})},O6=Object.freeze(Object.defineProperty({__proto__:null,ChatPage:KO},Symbol.toStringTag,{value:"Module"}));export{T6 as $,ps as A,qE as B,hM as C,$h as D,At as E,Dm as F,WD as G,qI as H,af as I,K$ as J,TA as K,Ws as L,Sr as M,LI as N,hh as O,b6 as P,v6 as Q,Xn as R,Rf as S,Pf as T,we as U,S6 as V,C6 as W,w6 as X,x6 as Y,y6 as Z,x as _,sM as a,Gt as a$,k6 as a0,_6 as a1,xi as a2,f6 as a3,rl as a4,$D as a5,UA as a6,Zu as a7,yf as a8,BI as a9,ue as aA,j6 as aB,eP as aC,X5 as aD,Y5 as aE,r5 as aF,II as aG,d6 as aH,Xs as aI,e5 as aJ,J3 as aK,oh as aL,Kr as aM,Lf as aN,hL as aO,_s as aP,Pn as aQ,ND as aR,jy as aS,Qo as aT,tl as aU,wo as aV,Dy as aW,$y as aX,aD as aY,ce as aZ,vy as a_,Da as aa,zD as ab,JA as ac,zs as ad,se as ae,fe as af,Um as ag,E5 as ah,qk as ai,D6 as aj,Z$ as ak,pt as al,ln as am,Ch as an,mb as ao,On as ap,Wy as aq,MD as ar,wB as as,vD as at,Sh as au,Dp as av,yP as aw,B6 as ax,P6 as ay,$6 as az,iM as b,iL as b0,ah as b1,s0 as b2,qs as b3,l0 as b4,m6 as b5,HE as b6,AD as b7,wD as b8,lB as b9,LD as bA,el as bB,O6 as bC,_h as ba,rD as bb,ID as bc,Gs as bd,Ai as be,yo as bf,fD as bg,zP as bh,Vs as bi,ko as bj,oD as bk,Ey as bl,hB as bm,dB as bn,bn as bo,ip as bp,fB as bq,Th as br,uB as bs,mB as bt,Mi as bu,on as bv,Jf as bw,Eh as bx,My as by,yu as bz,Re as c,$e as d,qm as e,dt as f,oM as g,qr as h,sr as i,ij as j,Ti as k,K as l,qy as m,p6 as n,F6 as o,lM as p,cM as q,R6 as r,aM as s,Q$ as t,hr as u,U5 as v,UD as w,E6 as x,nM as y,g6 as z};
|