agentstudio 0.1.18 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -505
- package/bin/agentstudio.js +305 -0
- package/bin/agentstudio.js.map +1 -0
- package/bin/serviceManager.d.ts +16 -0
- package/bin/serviceManager.d.ts.map +1 -0
- package/bin/serviceManager.js +434 -0
- package/bin/serviceManager.js.map +1 -0
- package/config/index.d.ts +74 -0
- package/config/index.d.ts.map +1 -0
- package/config/index.js +166 -0
- package/config/index.js.map +1 -0
- package/config/paths.d.ts +81 -0
- package/config/paths.d.ts.map +1 -0
- package/config/paths.js +98 -0
- package/config/paths.js.map +1 -0
- package/index.d.ts +4 -0
- package/index.d.ts.map +1 -0
- package/index.js +369 -0
- package/index.js.map +1 -0
- package/jobs/taskTimeoutMonitor.d.ts +25 -0
- package/jobs/taskTimeoutMonitor.d.ts.map +1 -0
- package/jobs/taskTimeoutMonitor.js +94 -0
- package/jobs/taskTimeoutMonitor.js.map +1 -0
- package/middleware/a2aAuth.d.ts +38 -0
- package/middleware/a2aAuth.d.ts.map +1 -0
- package/middleware/a2aAuth.js +134 -0
- package/middleware/a2aAuth.js.map +1 -0
- package/{backend/dist/middleware → middleware}/auth.d.ts +3 -1
- package/middleware/auth.d.ts.map +1 -0
- package/middleware/auth.js +35 -0
- package/middleware/auth.js.map +1 -0
- package/middleware/httpsOnly.d.ts +38 -0
- package/middleware/httpsOnly.d.ts.map +1 -0
- package/middleware/httpsOnly.js +105 -0
- package/middleware/httpsOnly.js.map +1 -0
- package/middleware/rateLimiting.d.ts +37 -0
- package/middleware/rateLimiting.d.ts.map +1 -0
- package/middleware/rateLimiting.js +118 -0
- package/middleware/rateLimiting.js.map +1 -0
- package/package.json +43 -38
- package/public/assets/AgentsPage-Nvg2xu6K.js +10 -0
- package/public/assets/Button-Co56C389.js +1 -0
- package/public/assets/ChatPage-D6sol0ad.js +442 -0
- package/public/assets/CommandForm-Bk7F_HU8.js +7 -0
- package/public/assets/CommandsPage-DZHyOdKd.js +1 -0
- package/public/assets/DashboardPage-29qC7Ev1.js +15 -0
- package/public/assets/FileBrowser-BYweUPH4.js +6 -0
- package/public/assets/FileExplorer-DNYj6Tsx.js +1 -0
- package/public/assets/GeneralSettingsPage-D9Xa7Nd8.js +1 -0
- package/public/assets/LandingPage-CjnT-cvO.js +1 -0
- package/public/assets/LoginPage-DcaGNCXH.js +16 -0
- package/public/assets/McpAdminSettingsPage-DgR3E2Bd.js +7 -0
- package/public/assets/McpPage-CtWf1CoL.js +40 -0
- package/public/assets/MemorySettingsPage-JTry4Ccp.js +1 -0
- package/public/assets/PluginsPage-D-BHjQ3P.js +1 -0
- package/public/assets/ProjectSelector-DSXOjMQC.js +1 -0
- package/public/assets/ProjectsPage-lLUk4-Xa.js +21 -0
- package/public/assets/ScheduledTasksPage-5hPbd9Vs.js +1 -0
- package/public/assets/SettingsLayout-DGJspXLp.js +1 -0
- package/public/assets/SkillsPage-DBw0m7D2.js +18 -0
- package/{backend/dist/frontend/assets/SubagentForm-DXtTTIKg.js → public/assets/SubagentForm-BdUK1U4y.js} +2 -2
- package/public/assets/SubagentsPage-Dnq70IFd.js +1 -0
- package/{backend/dist/frontend/assets/ToastTestPage-DT4wuN5C.js → public/assets/ToastTestPage-BfJQRFIm.js} +1 -1
- package/public/assets/ToolsList-Dl5F2fWk.js +1 -0
- package/public/assets/UnifiedToolSelector-CNbPsiuq.js +1 -0
- package/public/assets/VersionSettingsPage-BfoCcham.js +5 -0
- package/public/assets/_basePickBy-7C_e0Xv1.js +1 -0
- package/public/assets/_baseUniq-eGJNLBzx.js +1 -0
- package/public/assets/agents-ChrA1R0y.js +1 -0
- package/public/assets/arc-CuA752eE.js +1 -0
- package/public/assets/architectureDiagram-VXUJARFQ-BnPYh1OW.js +36 -0
- package/public/assets/blockDiagram-VD42YOAC-72nsMt_i.js +122 -0
- package/public/assets/c4Diagram-YG6GDRKO-BNJSAXcg.js +10 -0
- package/public/assets/channel-CIunGC5m.js +1 -0
- package/public/assets/chunk-4BX2VUAB-RPxkCWhH.js +1 -0
- package/public/assets/chunk-55IACEB6-3ePDt0kp.js +1 -0
- package/public/assets/chunk-B4BG7PRW-CBg_BBfl.js +165 -0
- package/public/assets/chunk-DI55MBZ5-DIh69TUJ.js +220 -0
- package/public/assets/chunk-FMBD7UC4-BbjwhyTe.js +15 -0
- package/public/assets/chunk-QN33PNHL-BpH-o_YR.js +1 -0
- package/public/assets/chunk-QZHKN3VN-DYB7rh5Q.js +1 -0
- package/public/assets/chunk-TZMSLE5B-DPCYEVb3.js +1 -0
- package/public/assets/classDiagram-2ON5EDUG-aUQHFsTA.js +1 -0
- package/public/assets/classDiagram-v2-WZHVMYZB-aUQHFsTA.js +1 -0
- package/public/assets/clone-Ckf7tA1V.js +1 -0
- package/public/assets/cose-bilkent-S5V4N54A-CnpfmL-Y.js +1 -0
- package/public/assets/cytoscape.esm-DtBltrT8.js +331 -0
- package/public/assets/dagre-6UL2VRFP-DR9x77Xf.js +4 -0
- package/{backend/dist/frontend/assets/data-structures-DLJedtzx.js → public/assets/data-structures-C0h9Oap1.js} +1 -1
- package/public/assets/defaultLocale-C4B-KCzX.js +1 -0
- package/public/assets/diagram-PSM6KHXK-SONPsQNx.js +24 -0
- package/public/assets/diagram-QEK2KX5R-BKYFSfC1.js +43 -0
- package/public/assets/diagram-S2PKOQOG-CkM0APZj.js +24 -0
- package/public/assets/erDiagram-Q2GNP2WA-BX1DpOGx.js +60 -0
- package/public/assets/flowDiagram-NV44I4VS-HAAlzNbq.js +162 -0
- package/public/assets/ganttDiagram-LVOFAZNH-BqzWexqa.js +267 -0
- package/public/assets/gitGraphDiagram-NY62KEGX-CIPmSp43.js +65 -0
- package/public/assets/graph-m515btDj.js +1 -0
- package/public/assets/index-Bn3v3S9-.js +293 -0
- package/public/assets/index-DWieeYj4.css +1 -0
- package/public/assets/infoDiagram-F6ZHWCRC-Pn4yNWrF.js +2 -0
- package/public/assets/init-Gi6I4Gst.js +1 -0
- package/public/assets/journeyDiagram-XKPGCS4Q-BfzTomS0.js +139 -0
- package/public/assets/kanban-definition-3W4ZIXB7-Cgju7b-L.js +89 -0
- package/public/assets/katex-qrhCpa0F.js +261 -0
- package/public/assets/layout-BKQfQSxJ.js +1 -0
- package/public/assets/linear-DigtLz3B.js +1 -0
- package/public/assets/mindmap-definition-VGOIOE7T-qopraVFy.js +68 -0
- package/public/assets/monaco-editor-DHKm5-VF.js +19 -0
- package/public/assets/ordinal-Cboi1Yqb.js +1 -0
- package/public/assets/pieDiagram-ADFJNKIX-BcoaAI-L.js +30 -0
- package/public/assets/quadrantDiagram-AYHSOK5B-D-DwcoSd.js +7 -0
- package/public/assets/requirementDiagram-UZGBJVZJ-DbQCpx77.js +64 -0
- package/public/assets/sankeyDiagram-TZEHDZUN-BVk8387S.js +10 -0
- package/public/assets/sequenceDiagram-WL72ISMW-BdzICjxO.js +145 -0
- package/public/assets/stateDiagram-FKZM4ZOC-CYY-uUvJ.js +1 -0
- package/public/assets/stateDiagram-v2-4FDKWEC3-Dh2Kvomq.js +1 -0
- package/{backend/dist/frontend/assets/syntax-highlighting-YWvMU4Hm.js → public/assets/syntax-highlighting-CnREyncB.js} +5 -5
- package/public/assets/tabManager-B2LQO_Ll.js +30 -0
- package/{backend/dist/frontend/assets/table-D6q1rytw.js → public/assets/table-D0L2RL5i.js} +1 -1
- package/public/assets/timeline-definition-IT6M3QCI-BAvjPYvX.js +61 -0
- package/public/assets/tools-IcPNZlPj.js +1 -0
- package/public/assets/treemap-KMMF4GRG-DtkpVA56.js +128 -0
- package/{backend/dist/frontend/assets/ui-components-Cw21Epuw.js → public/assets/ui-components-D1St49qC.js} +231 -96
- package/public/assets/useAgents-BnDTkOG8.js +2 -0
- package/public/assets/useClaudeVersions-CD59tFWM.js +1 -0
- package/public/assets/useCommands-mvMu3mMD.js +1 -0
- package/public/assets/useProjects-YXOjaOwL.js +1 -0
- package/public/assets/xychartDiagram-PRI3JC2R-ByBTDWE2.js +7 -0
- package/{backend/dist/frontend → public}/index.html +8 -8
- package/routes/__tests__/a2a.integration.test.d.ts +11 -0
- package/routes/__tests__/a2a.integration.test.d.ts.map +1 -0
- package/routes/__tests__/a2a.integration.test.js +314 -0
- package/routes/__tests__/a2a.integration.test.js.map +1 -0
- package/routes/__tests__/a2a.test.d.ts +6 -0
- package/routes/__tests__/a2a.test.d.ts.map +1 -0
- package/routes/__tests__/a2a.test.js +622 -0
- package/routes/__tests__/a2a.test.js.map +1 -0
- package/routes/__tests__/agents.test.d.ts +6 -0
- package/routes/__tests__/agents.test.d.ts.map +1 -0
- package/routes/__tests__/agents.test.js +315 -0
- package/routes/__tests__/agents.test.js.map +1 -0
- package/routes/__tests__/sessions.test.d.ts +7 -0
- package/routes/__tests__/sessions.test.d.ts.map +1 -0
- package/routes/__tests__/sessions.test.js +330 -0
- package/routes/__tests__/sessions.test.js.map +1 -0
- package/routes/a2a.d.ts +18 -0
- package/routes/a2a.d.ts.map +1 -0
- package/routes/a2a.js +649 -0
- package/routes/a2a.js.map +1 -0
- package/routes/a2a.streaming.test.d.ts +2 -0
- package/routes/a2a.streaming.test.d.ts.map +1 -0
- package/routes/a2a.streaming.test.js +167 -0
- package/routes/a2a.streaming.test.js.map +1 -0
- package/routes/a2aManagement.d.ts +21 -0
- package/routes/a2aManagement.d.ts.map +1 -0
- package/routes/a2aManagement.js +466 -0
- package/routes/a2aManagement.js.map +1 -0
- package/{backend/dist/routes → routes}/agents.d.ts.map +1 -1
- package/routes/agents.js +997 -0
- package/routes/agents.js.map +1 -0
- package/{backend/dist/routes → routes}/auth.d.ts.map +1 -1
- package/routes/auth.js +135 -0
- package/routes/auth.js.map +1 -0
- package/{backend/dist/routes → routes}/commands.d.ts.map +1 -1
- package/{backend/dist/routes → routes}/commands.js +115 -31
- package/routes/commands.js.map +1 -0
- package/routes/config.d.ts +4 -0
- package/routes/config.d.ts.map +1 -0
- package/routes/config.js +211 -0
- package/routes/config.js.map +1 -0
- package/{backend/dist/routes → routes}/files.d.ts.map +1 -1
- package/{backend/dist/routes → routes}/files.js +103 -43
- package/routes/files.js.map +1 -0
- package/routes/mcp.d.ts +27 -0
- package/routes/mcp.d.ts.map +1 -0
- package/{backend/dist/routes → routes}/mcp.js +195 -105
- package/routes/mcp.js.map +1 -0
- package/routes/mcpAdmin.d.ts +16 -0
- package/routes/mcpAdmin.d.ts.map +1 -0
- package/routes/mcpAdmin.js +308 -0
- package/routes/mcpAdmin.js.map +1 -0
- package/routes/mcpAdminManagement.d.ts +17 -0
- package/routes/mcpAdminManagement.d.ts.map +1 -0
- package/routes/mcpAdminManagement.js +345 -0
- package/routes/mcpAdminManagement.js.map +1 -0
- package/routes/media.d.ts.map +1 -0
- package/{backend/dist/routes → routes}/media.js +52 -42
- package/routes/media.js.map +1 -0
- package/routes/mediaAuth.d.ts +8 -0
- package/routes/mediaAuth.d.ts.map +1 -0
- package/routes/mediaAuth.js +136 -0
- package/routes/mediaAuth.js.map +1 -0
- package/routes/plugins.d.ts +4 -0
- package/routes/plugins.d.ts.map +1 -0
- package/routes/plugins.js +339 -0
- package/routes/plugins.js.map +1 -0
- package/{backend/dist/routes → routes}/projects.d.ts.map +1 -1
- package/routes/projects.js +884 -0
- package/routes/projects.js.map +1 -0
- package/routes/scheduledTasks.d.ts +9 -0
- package/routes/scheduledTasks.d.ts.map +1 -0
- package/routes/scheduledTasks.js +320 -0
- package/routes/scheduledTasks.js.map +1 -0
- package/{backend/dist/routes → routes}/sessions.d.ts.map +1 -1
- package/{backend/dist/routes → routes}/sessions.js +258 -39
- package/routes/sessions.js.map +1 -0
- package/{backend/dist/routes → routes}/settings.d.ts.map +1 -1
- package/{backend/dist/routes → routes}/settings.js +82 -241
- package/routes/settings.js.map +1 -0
- package/{backend/dist/routes/mcp.d.ts → routes/skills.d.ts} +1 -1
- package/routes/skills.d.ts.map +1 -0
- package/routes/skills.js +272 -0
- package/routes/skills.js.map +1 -0
- package/routes/slack.d.ts +10 -0
- package/routes/slack.d.ts.map +1 -0
- package/routes/slack.js +189 -0
- package/routes/slack.js.map +1 -0
- package/{backend/dist/routes → routes}/slides.d.ts.map +1 -1
- package/{backend/dist/routes → routes}/slides.js +29 -27
- package/routes/slides.js.map +1 -0
- package/{backend/dist/routes → routes}/subagents.js +27 -22
- package/routes/subagents.js.map +1 -0
- package/schemas/a2a.d.ts +858 -0
- package/schemas/a2a.d.ts.map +1 -0
- package/schemas/a2a.js +300 -0
- package/schemas/a2a.js.map +1 -0
- package/scripts/postinstall.js +10 -0
- package/services/__tests__/pluginInstaller.test.d.ts +5 -0
- package/services/__tests__/pluginInstaller.test.d.ts.map +1 -0
- package/services/__tests__/pluginInstaller.test.js +290 -0
- package/services/__tests__/pluginInstaller.test.js.map +1 -0
- package/services/__tests__/pluginParser.test.d.ts +5 -0
- package/services/__tests__/pluginParser.test.d.ts.map +1 -0
- package/services/__tests__/pluginParser.test.js +272 -0
- package/services/__tests__/pluginParser.test.js.map +1 -0
- package/services/__tests__/pluginPaths.test.d.ts +5 -0
- package/services/__tests__/pluginPaths.test.d.ts.map +1 -0
- package/services/__tests__/pluginPaths.test.js +221 -0
- package/services/__tests__/pluginPaths.test.js.map +1 -0
- package/services/__tests__/pluginScanner.test.d.ts +5 -0
- package/services/__tests__/pluginScanner.test.d.ts.map +1 -0
- package/services/__tests__/pluginScanner.test.js +272 -0
- package/services/__tests__/pluginScanner.test.js.map +1 -0
- package/services/__tests__/pluginSymlink.test.d.ts +5 -0
- package/services/__tests__/pluginSymlink.test.d.ts.map +1 -0
- package/services/__tests__/pluginSymlink.test.js +318 -0
- package/services/__tests__/pluginSymlink.test.js.map +1 -0
- package/services/__tests__/slackAIService.test.d.ts +5 -0
- package/services/__tests__/slackAIService.test.d.ts.map +1 -0
- package/services/__tests__/slackAIService.test.js +477 -0
- package/services/__tests__/slackAIService.test.js.map +1 -0
- package/services/__tests__/slackThreadMapper.test.d.ts +5 -0
- package/services/__tests__/slackThreadMapper.test.d.ts.map +1 -0
- package/services/__tests__/slackThreadMapper.test.js +194 -0
- package/services/__tests__/slackThreadMapper.test.js.map +1 -0
- package/services/a2a/__tests__/a2aClientTool.integration.test.d.ts +6 -0
- package/services/a2a/__tests__/a2aClientTool.integration.test.d.ts.map +1 -0
- package/services/a2a/__tests__/a2aClientTool.integration.test.js +264 -0
- package/services/a2a/__tests__/a2aClientTool.integration.test.js.map +1 -0
- package/services/a2a/__tests__/a2aClientTool.test.d.ts +6 -0
- package/services/a2a/__tests__/a2aClientTool.test.d.ts.map +1 -0
- package/services/a2a/__tests__/a2aClientTool.test.js +418 -0
- package/services/a2a/__tests__/a2aClientTool.test.js.map +1 -0
- package/services/a2a/__tests__/a2aConfigService.test.d.ts +6 -0
- package/services/a2a/__tests__/a2aConfigService.test.d.ts.map +1 -0
- package/services/a2a/__tests__/a2aConfigService.test.js +431 -0
- package/services/a2a/__tests__/a2aConfigService.test.js.map +1 -0
- package/services/a2a/__tests__/a2aConfigServicePath.test.d.ts +2 -0
- package/services/a2a/__tests__/a2aConfigServicePath.test.d.ts.map +1 -0
- package/services/a2a/__tests__/a2aConfigServicePath.test.js +49 -0
- package/services/a2a/__tests__/a2aConfigServicePath.test.js.map +1 -0
- package/services/a2a/__tests__/a2aSdkMcp.test.d.ts +10 -0
- package/services/a2a/__tests__/a2aSdkMcp.test.d.ts.map +1 -0
- package/services/a2a/__tests__/a2aSdkMcp.test.js +239 -0
- package/services/a2a/__tests__/a2aSdkMcp.test.js.map +1 -0
- package/services/a2a/__tests__/agentCardService.test.d.ts +6 -0
- package/services/a2a/__tests__/agentCardService.test.d.ts.map +1 -0
- package/services/a2a/__tests__/agentCardService.test.js +292 -0
- package/services/a2a/__tests__/agentCardService.test.js.map +1 -0
- package/services/a2a/__tests__/apiKeyService.test.d.ts +6 -0
- package/services/a2a/__tests__/apiKeyService.test.d.ts.map +1 -0
- package/services/a2a/__tests__/apiKeyService.test.js +284 -0
- package/services/a2a/__tests__/apiKeyService.test.js.map +1 -0
- package/services/a2a/__tests__/buildQueryOptionsIntegration.test.d.ts +2 -0
- package/services/a2a/__tests__/buildQueryOptionsIntegration.test.d.ts.map +1 -0
- package/services/a2a/__tests__/buildQueryOptionsIntegration.test.js +70 -0
- package/services/a2a/__tests__/buildQueryOptionsIntegration.test.js.map +1 -0
- package/services/a2a/__tests__/dynamic_config_verification.test.d.ts +2 -0
- package/services/a2a/__tests__/dynamic_config_verification.test.d.ts.map +1 -0
- package/services/a2a/__tests__/dynamic_config_verification.test.js +67 -0
- package/services/a2a/__tests__/dynamic_config_verification.test.js.map +1 -0
- package/services/a2a/__tests__/integrateA2AMcpServer.test.d.ts +2 -0
- package/services/a2a/__tests__/integrateA2AMcpServer.test.d.ts.map +1 -0
- package/services/a2a/__tests__/integrateA2AMcpServer.test.js +112 -0
- package/services/a2a/__tests__/integrateA2AMcpServer.test.js.map +1 -0
- package/services/a2a/__tests__/taskManager.integration.test.d.ts +7 -0
- package/services/a2a/__tests__/taskManager.integration.test.d.ts.map +1 -0
- package/services/a2a/__tests__/taskManager.integration.test.js +346 -0
- package/services/a2a/__tests__/taskManager.integration.test.js.map +1 -0
- package/services/a2a/__tests__/taskManager.test.d.ts +7 -0
- package/services/a2a/__tests__/taskManager.test.d.ts.map +1 -0
- package/services/a2a/__tests__/taskManager.test.js +423 -0
- package/services/a2a/__tests__/taskManager.test.js.map +1 -0
- package/services/a2a/a2aClientTool.d.ts +73 -0
- package/services/a2a/a2aClientTool.d.ts.map +1 -0
- package/services/a2a/a2aClientTool.js +572 -0
- package/services/a2a/a2aClientTool.js.map +1 -0
- package/services/a2a/a2aConfigService.d.ts +50 -0
- package/services/a2a/a2aConfigService.d.ts.map +1 -0
- package/services/a2a/a2aConfigService.js +186 -0
- package/services/a2a/a2aConfigService.js.map +1 -0
- package/services/a2a/a2aHistoryService.d.ts +32 -0
- package/services/a2a/a2aHistoryService.d.ts.map +1 -0
- package/services/a2a/a2aHistoryService.js +108 -0
- package/services/a2a/a2aHistoryService.js.map +1 -0
- package/services/a2a/a2aIntegration.d.ts +9 -0
- package/services/a2a/a2aIntegration.d.ts.map +1 -0
- package/services/a2a/a2aIntegration.js +41 -0
- package/services/a2a/a2aIntegration.js.map +1 -0
- package/services/a2a/a2aQueryService.d.ts +71 -0
- package/services/a2a/a2aQueryService.d.ts.map +1 -0
- package/services/a2a/a2aQueryService.js +166 -0
- package/services/a2a/a2aQueryService.js.map +1 -0
- package/services/a2a/a2aSdkMcp.d.ts +51 -0
- package/services/a2a/a2aSdkMcp.d.ts.map +1 -0
- package/services/a2a/a2aSdkMcp.js +185 -0
- package/services/a2a/a2aSdkMcp.js.map +1 -0
- package/services/a2a/a2aStreamEvents.d.ts +94 -0
- package/services/a2a/a2aStreamEvents.d.ts.map +1 -0
- package/services/a2a/a2aStreamEvents.js +92 -0
- package/services/a2a/a2aStreamEvents.js.map +1 -0
- package/services/a2a/agentCardService.d.ts +34 -0
- package/services/a2a/agentCardService.d.ts.map +1 -0
- package/services/a2a/agentCardService.js +228 -0
- package/services/a2a/agentCardService.js.map +1 -0
- package/services/a2a/agentMappingService.d.ts +53 -0
- package/services/a2a/agentMappingService.d.ts.map +1 -0
- package/services/a2a/agentMappingService.js +185 -0
- package/services/a2a/agentMappingService.js.map +1 -0
- package/services/a2a/apiKeyService.d.ts +101 -0
- package/services/a2a/apiKeyService.d.ts.map +1 -0
- package/services/a2a/apiKeyService.js +314 -0
- package/services/a2a/apiKeyService.js.map +1 -0
- package/services/a2a/taskCleanup.d.ts +30 -0
- package/services/a2a/taskCleanup.d.ts.map +1 -0
- package/services/a2a/taskCleanup.js +184 -0
- package/services/a2a/taskCleanup.js.map +1 -0
- package/services/a2a/taskManager.d.ts +86 -0
- package/services/a2a/taskManager.d.ts.map +1 -0
- package/services/a2a/taskManager.js +263 -0
- package/services/a2a/taskManager.js.map +1 -0
- package/services/agentStorage.d.ts +27 -0
- package/services/agentStorage.d.ts.map +1 -0
- package/services/agentStorage.js +487 -0
- package/services/agentStorage.js.map +1 -0
- package/services/askUserQuestion/askUserQuestionIntegration.d.ts +24 -0
- package/services/askUserQuestion/askUserQuestionIntegration.d.ts.map +1 -0
- package/services/askUserQuestion/askUserQuestionIntegration.js +52 -0
- package/services/askUserQuestion/askUserQuestionIntegration.js.map +1 -0
- package/services/askUserQuestion/askUserQuestionMcp.d.ts +103 -0
- package/services/askUserQuestion/askUserQuestionMcp.d.ts.map +1 -0
- package/services/askUserQuestion/askUserQuestionMcp.js +129 -0
- package/services/askUserQuestion/askUserQuestionMcp.js.map +1 -0
- package/services/askUserQuestion/index.d.ts +13 -0
- package/services/askUserQuestion/index.d.ts.map +1 -0
- package/services/askUserQuestion/index.js +35 -0
- package/services/askUserQuestion/index.js.map +1 -0
- package/services/askUserQuestion/init.d.ts +17 -0
- package/services/askUserQuestion/init.d.ts.map +1 -0
- package/services/askUserQuestion/init.js +47 -0
- package/services/askUserQuestion/init.js.map +1 -0
- package/services/askUserQuestion/notificationChannel.d.ts +97 -0
- package/services/askUserQuestion/notificationChannel.d.ts.map +1 -0
- package/services/askUserQuestion/notificationChannel.js +147 -0
- package/services/askUserQuestion/notificationChannel.js.map +1 -0
- package/services/askUserQuestion/slackNotificationChannel.d.ts +35 -0
- package/services/askUserQuestion/slackNotificationChannel.d.ts.map +1 -0
- package/services/askUserQuestion/slackNotificationChannel.js +129 -0
- package/services/askUserQuestion/slackNotificationChannel.js.map +1 -0
- package/services/askUserQuestion/sseNotificationChannel.d.ts +36 -0
- package/services/askUserQuestion/sseNotificationChannel.d.ts.map +1 -0
- package/services/askUserQuestion/sseNotificationChannel.js +88 -0
- package/services/askUserQuestion/sseNotificationChannel.js.map +1 -0
- package/services/askUserQuestion/userInputRegistry.d.ts +107 -0
- package/services/askUserQuestion/userInputRegistry.d.ts.map +1 -0
- package/services/askUserQuestion/userInputRegistry.js +253 -0
- package/services/askUserQuestion/userInputRegistry.js.map +1 -0
- package/{backend/dist/services → services}/claudeSession.d.ts +20 -5
- package/services/claudeSession.d.ts.map +1 -0
- package/{backend/dist/services → services}/claudeSession.js +123 -41
- package/services/claudeSession.js.map +1 -0
- package/services/claudeVersionStorage.d.ts +20 -0
- package/services/claudeVersionStorage.d.ts.map +1 -0
- package/services/claudeVersionStorage.js +331 -0
- package/services/claudeVersionStorage.js.map +1 -0
- package/services/mcpAdmin/__tests__/adminApiKeyService.test.d.ts +5 -0
- package/services/mcpAdmin/__tests__/adminApiKeyService.test.d.ts.map +1 -0
- package/services/mcpAdmin/__tests__/adminApiKeyService.test.js +289 -0
- package/services/mcpAdmin/__tests__/adminApiKeyService.test.js.map +1 -0
- package/services/mcpAdmin/__tests__/mcpAdminRoutes.test.d.ts +5 -0
- package/services/mcpAdmin/__tests__/mcpAdminRoutes.test.d.ts.map +1 -0
- package/services/mcpAdmin/__tests__/mcpAdminRoutes.test.js +345 -0
- package/services/mcpAdmin/__tests__/mcpAdminRoutes.test.js.map +1 -0
- package/services/mcpAdmin/__tests__/mcpAdminServer.test.d.ts +5 -0
- package/services/mcpAdmin/__tests__/mcpAdminServer.test.d.ts.map +1 -0
- package/services/mcpAdmin/__tests__/mcpAdminServer.test.js +453 -0
- package/services/mcpAdmin/__tests__/mcpAdminServer.test.js.map +1 -0
- package/services/mcpAdmin/__tests__/tools.test.d.ts +5 -0
- package/services/mcpAdmin/__tests__/tools.test.d.ts.map +1 -0
- package/services/mcpAdmin/__tests__/tools.test.js +371 -0
- package/services/mcpAdmin/__tests__/tools.test.js.map +1 -0
- package/services/mcpAdmin/adminApiKeyService.d.ts +61 -0
- package/services/mcpAdmin/adminApiKeyService.d.ts.map +1 -0
- package/services/mcpAdmin/adminApiKeyService.js +270 -0
- package/services/mcpAdmin/adminApiKeyService.js.map +1 -0
- package/services/mcpAdmin/index.d.ts +10 -0
- package/services/mcpAdmin/index.d.ts.map +1 -0
- package/services/mcpAdmin/index.js +43 -0
- package/services/mcpAdmin/index.js.map +1 -0
- package/services/mcpAdmin/mcpAdminServer.d.ts +76 -0
- package/services/mcpAdmin/mcpAdminServer.d.ts.map +1 -0
- package/services/mcpAdmin/mcpAdminServer.js +243 -0
- package/services/mcpAdmin/mcpAdminServer.js.map +1 -0
- package/services/mcpAdmin/tools/agentTools.d.ts +27 -0
- package/services/mcpAdmin/tools/agentTools.d.ts.map +1 -0
- package/services/mcpAdmin/tools/agentTools.js +359 -0
- package/services/mcpAdmin/tools/agentTools.js.map +1 -0
- package/services/mcpAdmin/tools/index.d.ts +15 -0
- package/services/mcpAdmin/tools/index.d.ts.map +1 -0
- package/services/mcpAdmin/tools/index.js +30 -0
- package/services/mcpAdmin/tools/index.js.map +1 -0
- package/services/mcpAdmin/tools/mcpServerTools.d.ts +27 -0
- package/services/mcpAdmin/tools/mcpServerTools.d.ts.map +1 -0
- package/services/mcpAdmin/tools/mcpServerTools.js +334 -0
- package/services/mcpAdmin/tools/mcpServerTools.js.map +1 -0
- package/services/mcpAdmin/tools/projectTools.d.ts +27 -0
- package/services/mcpAdmin/tools/projectTools.d.ts.map +1 -0
- package/services/mcpAdmin/tools/projectTools.js +353 -0
- package/services/mcpAdmin/tools/projectTools.js.map +1 -0
- package/services/mcpAdmin/tools/systemTools.d.ts +23 -0
- package/services/mcpAdmin/tools/systemTools.d.ts.map +1 -0
- package/services/mcpAdmin/tools/systemTools.js +241 -0
- package/services/mcpAdmin/tools/systemTools.js.map +1 -0
- package/services/mcpAdmin/types.d.ts +124 -0
- package/services/mcpAdmin/types.d.ts.map +1 -0
- package/services/mcpAdmin/types.js +18 -0
- package/services/mcpAdmin/types.js.map +1 -0
- package/{backend/dist/services → services}/messageQueue.d.ts.map +1 -1
- package/{backend/dist/services → services}/messageQueue.js +16 -3
- package/services/messageQueue.js.map +1 -0
- package/services/pluginInstaller.d.ts +58 -0
- package/services/pluginInstaller.d.ts.map +1 -0
- package/services/pluginInstaller.js +321 -0
- package/services/pluginInstaller.js.map +1 -0
- package/services/pluginParser.d.ts +45 -0
- package/services/pluginParser.d.ts.map +1 -0
- package/services/pluginParser.js +437 -0
- package/services/pluginParser.js.map +1 -0
- package/services/pluginPaths.d.ts +80 -0
- package/services/pluginPaths.d.ts.map +1 -0
- package/services/pluginPaths.js +274 -0
- package/services/pluginPaths.js.map +1 -0
- package/services/pluginScanner.d.ts +36 -0
- package/services/pluginScanner.d.ts.map +1 -0
- package/services/pluginScanner.js +251 -0
- package/services/pluginScanner.js.map +1 -0
- package/services/pluginSymlink.d.ts +54 -0
- package/services/pluginSymlink.d.ts.map +1 -0
- package/services/pluginSymlink.js +223 -0
- package/services/pluginSymlink.js.map +1 -0
- package/services/projectMetadataStorage.d.ts +114 -0
- package/services/projectMetadataStorage.d.ts.map +1 -0
- package/services/projectMetadataStorage.js +711 -0
- package/services/projectMetadataStorage.js.map +1 -0
- package/services/scheduledTaskStorage.d.ts +52 -0
- package/services/scheduledTaskStorage.d.ts.map +1 -0
- package/services/scheduledTaskStorage.js +285 -0
- package/services/scheduledTaskStorage.js.map +1 -0
- package/services/schedulerService.d.ts +81 -0
- package/services/schedulerService.d.ts.map +1 -0
- package/services/schedulerService.js +743 -0
- package/services/schedulerService.js.map +1 -0
- package/{backend/dist/services → services}/sessionManager.d.ts +6 -4
- package/services/sessionManager.d.ts.map +1 -0
- package/{backend/dist/services → services}/sessionManager.js +77 -16
- package/services/sessionManager.js.map +1 -0
- package/services/skillStorage.d.ts +60 -0
- package/services/skillStorage.d.ts.map +1 -0
- package/services/skillStorage.js +398 -0
- package/services/skillStorage.js.map +1 -0
- package/services/slackAIService.d.ts +81 -0
- package/services/slackAIService.d.ts.map +1 -0
- package/services/slackAIService.js +1091 -0
- package/services/slackAIService.js.map +1 -0
- package/services/slackClient.d.ts +46 -0
- package/services/slackClient.d.ts.map +1 -0
- package/services/slackClient.js +85 -0
- package/services/slackClient.js.map +1 -0
- package/services/slackSessionLock.d.ts +79 -0
- package/services/slackSessionLock.d.ts.map +1 -0
- package/services/slackSessionLock.js +353 -0
- package/services/slackSessionLock.js.map +1 -0
- package/services/slackThreadMapper.d.ts +57 -0
- package/services/slackThreadMapper.d.ts.map +1 -0
- package/services/slackThreadMapper.js +140 -0
- package/services/slackThreadMapper.js.map +1 -0
- package/types/a2a.d.ts +275 -0
- package/types/a2a.d.ts.map +1 -0
- package/types/a2a.js +23 -0
- package/types/a2a.js.map +1 -0
- package/types/agents.d.ts +95 -0
- package/types/agents.d.ts.map +1 -0
- package/types/agents.js +46 -0
- package/types/agents.js.map +1 -0
- package/types/claude-history.d.ts +62 -0
- package/types/claude-history.d.ts.map +1 -0
- package/types/claude-history.js +4 -0
- package/types/claude-history.js.map +1 -0
- package/types/claude-versions.d.ts +36 -0
- package/types/claude-versions.d.ts.map +1 -0
- package/types/claude-versions.js +3 -0
- package/types/claude-versions.js.map +1 -0
- package/types/commands.d.ts +50 -0
- package/types/commands.d.ts.map +1 -0
- package/types/commands.js +23 -0
- package/types/commands.js.map +1 -0
- package/types/plugins.d.ts +144 -0
- package/types/plugins.d.ts.map +1 -0
- package/types/plugins.js +8 -0
- package/types/plugins.js.map +1 -0
- package/types/projects.d.ts +42 -0
- package/types/projects.d.ts.map +1 -0
- package/types/projects.js +4 -0
- package/types/projects.js.map +1 -0
- package/types/scheduledTasks.d.ts +164 -0
- package/types/scheduledTasks.d.ts.map +1 -0
- package/types/scheduledTasks.js +17 -0
- package/types/scheduledTasks.js.map +1 -0
- package/types/skills.d.ts +91 -0
- package/types/skills.d.ts.map +1 -0
- package/types/skills.js +6 -0
- package/types/skills.js.map +1 -0
- package/types/slack.d.ts +97 -0
- package/types/slack.d.ts.map +1 -0
- package/types/slack.js +8 -0
- package/types/slack.js.map +1 -0
- package/types/streaming.d.ts +12 -0
- package/types/streaming.d.ts.map +1 -0
- package/types/streaming.js +8 -0
- package/types/streaming.js.map +1 -0
- package/types/subagents.d.ts +26 -0
- package/types/subagents.d.ts.map +1 -0
- package/types/subagents.js +3 -0
- package/types/subagents.js.map +1 -0
- package/utils/__tests__/claudeUtils.test.d.ts +5 -0
- package/utils/__tests__/claudeUtils.test.d.ts.map +1 -0
- package/utils/__tests__/claudeUtils.test.js +282 -0
- package/utils/__tests__/claudeUtils.test.js.map +1 -0
- package/utils/__tests__/sessionUtils.test.d.ts +5 -0
- package/utils/__tests__/sessionUtils.test.d.ts.map +1 -0
- package/utils/__tests__/sessionUtils.test.js +295 -0
- package/utils/__tests__/sessionUtils.test.js.map +1 -0
- package/utils/agentCardCache.d.ts +93 -0
- package/utils/agentCardCache.d.ts.map +1 -0
- package/utils/agentCardCache.js +212 -0
- package/utils/agentCardCache.js.map +1 -0
- package/utils/claudeUtils.d.ts +54 -0
- package/utils/claudeUtils.d.ts.map +1 -0
- package/utils/claudeUtils.js +387 -0
- package/utils/claudeUtils.js.map +1 -0
- package/utils/fileUtils.d.ts +2 -0
- package/utils/fileUtils.d.ts.map +1 -0
- package/utils/fileUtils.js +11 -0
- package/utils/fileUtils.js.map +1 -0
- package/utils/jwt.d.ts +30 -0
- package/utils/jwt.d.ts.map +1 -0
- package/utils/jwt.js +95 -0
- package/utils/jwt.js.map +1 -0
- package/utils/sessionUtils.d.ts +64 -0
- package/utils/sessionUtils.d.ts.map +1 -0
- package/utils/sessionUtils.js +266 -0
- package/utils/sessionUtils.js.map +1 -0
- package/README.zh-CN.md +0 -525
- package/backend/dist/bin/agentstudio.js +0 -120
- package/backend/dist/bin/agentstudio.js.map +0 -1
- package/backend/dist/frontend/assets/AgentsPage-Dqb_aqAA.js +0 -1
- package/backend/dist/frontend/assets/ChatPage-L8Paywyc.js +0 -91
- package/backend/dist/frontend/assets/CommandForm-DLl7EIMS.js +0 -7
- package/backend/dist/frontend/assets/CommandsPage-Bzavq0Ec.js +0 -1
- package/backend/dist/frontend/assets/DashboardPage-B3o4AYFT.js +0 -15
- package/backend/dist/frontend/assets/FileBrowser-DL3ayaqb.js +0 -1
- package/backend/dist/frontend/assets/GeneralSettingsPage-CBN_de-V.js +0 -1
- package/backend/dist/frontend/assets/LandingPage-Dl4ioKos.js +0 -1
- package/backend/dist/frontend/assets/LoginPage-4QqRdiSi.js +0 -12
- package/backend/dist/frontend/assets/McpPage-CY3tYiqj.js +0 -39
- package/backend/dist/frontend/assets/MemorySettingsPage-DGxrok5K.js +0 -1
- package/backend/dist/frontend/assets/ProjectSelector-hgmGYVFh.js +0 -1
- package/backend/dist/frontend/assets/ProjectsPage-D399IM0c.js +0 -14
- package/backend/dist/frontend/assets/SettingsLayout-CL_K-lzJ.js +0 -1
- package/backend/dist/frontend/assets/SubagentsPage-Chbhj8p2.js +0 -1
- package/backend/dist/frontend/assets/UnifiedToolSelector-CsM9qBvs.js +0 -1
- package/backend/dist/frontend/assets/VersionSettingsPage-74Q-LVgA.js +0 -5
- package/backend/dist/frontend/assets/agents-ClAzIJTw.js +0 -1
- package/backend/dist/frontend/assets/authFetch-BATQyPG5.js +0 -1
- package/backend/dist/frontend/assets/index-B9YHa7XT.css +0 -1
- package/backend/dist/frontend/assets/index-B_CTNvca.js +0 -268
- package/backend/dist/frontend/assets/monaco-editor-C7Z4sOhS.js +0 -19
- package/backend/dist/frontend/assets/tabManager-DV8urRBM.js +0 -30
- package/backend/dist/frontend/assets/tools-C4EPanYi.js +0 -1
- package/backend/dist/frontend/assets/useAgents-DwnOE1_k.js +0 -2
- package/backend/dist/frontend/assets/useClaudeVersions-CQdGnCqv.js +0 -1
- package/backend/dist/frontend/assets/useCommands-CCVaurbt.js +0 -1
- package/backend/dist/index.d.ts +0 -3
- package/backend/dist/index.d.ts.map +0 -1
- package/backend/dist/index.js +0 -157
- package/backend/dist/index.js.map +0 -1
- package/backend/dist/middleware/auth.d.ts.map +0 -1
- package/backend/dist/middleware/auth.js +0 -21
- package/backend/dist/middleware/auth.js.map +0 -1
- package/backend/dist/routes/agents.js +0 -803
- package/backend/dist/routes/agents.js.map +0 -1
- package/backend/dist/routes/auth.js +0 -60
- package/backend/dist/routes/auth.js.map +0 -1
- package/backend/dist/routes/commands.js.map +0 -1
- package/backend/dist/routes/files.js.map +0 -1
- package/backend/dist/routes/mcp.d.ts.map +0 -1
- package/backend/dist/routes/mcp.js.map +0 -1
- package/backend/dist/routes/media.d.ts.map +0 -1
- package/backend/dist/routes/media.js.map +0 -1
- package/backend/dist/routes/projects.js +0 -528
- package/backend/dist/routes/projects.js.map +0 -1
- package/backend/dist/routes/sessions.js.map +0 -1
- package/backend/dist/routes/settings.js.map +0 -1
- package/backend/dist/routes/slides.js.map +0 -1
- package/backend/dist/routes/subagents.js.map +0 -1
- package/backend/dist/services/claudeSession.d.ts.map +0 -1
- package/backend/dist/services/claudeSession.js.map +0 -1
- package/backend/dist/services/messageQueue.js.map +0 -1
- package/backend/dist/services/sessionManager.d.ts.map +0 -1
- package/backend/dist/services/sessionManager.js.map +0 -1
- package/backend/dist/utils/jwt.d.ts +0 -15
- package/backend/dist/utils/jwt.d.ts.map +0 -1
- package/backend/dist/utils/jwt.js +0 -28
- package/backend/dist/utils/jwt.js.map +0 -1
- /package/{backend/dist/bin → bin}/agentstudio.d.ts +0 -0
- /package/{backend/dist/bin → bin}/agentstudio.d.ts.map +0 -0
- /package/{backend/dist/frontend → public}/assets/ChatPage-BvQmXfcP.css +0 -0
- /package/{backend/dist/frontend → public}/assets/agents-DwCY2K8p.css +0 -0
- /package/{backend/dist/frontend → public}/assets/dateFormat-CXa8VnEC.js +0 -0
- /package/{backend/dist/frontend → public}/cc-studio.png +0 -0
- /package/{backend/dist/frontend → public}/vite.svg +0 -0
- /package/{backend/dist/routes → routes}/agents.d.ts +0 -0
- /package/{backend/dist/routes → routes}/auth.d.ts +0 -0
- /package/{backend/dist/routes → routes}/commands.d.ts +0 -0
- /package/{backend/dist/routes → routes}/files.d.ts +0 -0
- /package/{backend/dist/routes → routes}/media.d.ts +0 -0
- /package/{backend/dist/routes → routes}/projects.d.ts +0 -0
- /package/{backend/dist/routes → routes}/sessions.d.ts +0 -0
- /package/{backend/dist/routes → routes}/settings.d.ts +0 -0
- /package/{backend/dist/routes → routes}/slides.d.ts +0 -0
- /package/{backend/dist/routes → routes}/subagents.d.ts +0 -0
- /package/{backend/dist/routes → routes}/subagents.d.ts.map +0 -0
- /package/{backend/dist/services → services}/messageQueue.d.ts +0 -0
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import{j as l,T as za}from"./data-structures-DLJedtzx.js";import{r as v,g as Qi,W as _a}from"./monaco-editor-C7Z4sOhS.js";import{ah as Fa,ai as Oa,aj as $a,ak as Ba,al as Ha,j as kr,X as Ut,t as Va,i as Et,Z as Gi,T as Jn,am as Ji,an as Ua,l as Kn,f as Vr,o as qa,O as Ki,ao as Ur,a4 as Wa,h as Xa,ap as Ya,aq as Re,L as mn,ar as Qa,as as Ga,d as Ja,p as Ka,a6 as Za}from"./ui-components-Cw21Epuw.js";import{u as Zi,a as es}from"./useCommands-CCVaurbt.js";import{u as oe,B as Le,T as me,a as el,K as tl,b as nl}from"./tools-C4EPanYi.js";import{f as rl,c as il,b as sl,h as al,i as ll,j as ol}from"./index-B_CTNvca.js";import{d as ul,e as cl,f as dl,g as hl,h as fl}from"./useAgents-DwnOE1_k.js";import{u as ml}from"./useClaudeVersions-CQdGnCqv.js";import{t as $t,u as pl}from"./tabManager-DV8urRBM.js";import{A as It,l as gl,b as xl,e as ts,f as ns,j as yl,S as bl,D as kl,C as wl}from"./agents-ClAzIJTw.js";import{a as qt}from"./authFetch-BATQyPG5.js";import{h as Zn,c as vl}from"./syntax-highlighting-YWvMU4Hm.js";import{U as Cl}from"./UnifiedToolSelector-CsM9qBvs.js";import{P as Sl}from"./ProjectSelector-hgmGYVFh.js";import"./FileBrowser-DL3ayaqb.js";const er=({images:e,initialIndex:t=0,onClose:n})=>{const[r,i]=v.useState(()=>!e||e.length===0?0:Math.min(t,e.length-1)),[s,a]=v.useState(1),[o,c]=v.useState({x:0,y:0}),[u,h]=v.useState(!1),[d,m]=v.useState({x:0,y:0}),[f,p]=v.useState(0),[g,C]=v.useState(!1),b=v.useRef(null),E=v.useRef(null),j=()=>{if(!b.current||!E.current)return 1;const O=b.current,X=E.current,be=O.naturalWidth,Ne=O.naturalHeight,x=X.clientWidth,ge=X.clientHeight-120,De=x/be,y=ge/Ne;return Math.min(De,y,1)},T=()=>{C(!0);const O=j();a(O),c({x:0,y:0})},I=e&&e.length>0?e[r]:"",w=()=>{e&&r>0&&i(r-1)},M=()=>{e&&r<e.length-1&&i(r+1)};v.useEffect(()=>{if(e&&e.length>0){const O=Math.min(t,e.length-1);i(O)}},[e,t]),v.useEffect(()=>{I&&(a(1),c({x:0,y:0}),p(0),h(!1),C(!1))},[I]),v.useEffect(()=>{if(!I)return;const O=X=>{switch(X.key){case"Escape":n();break;case"ArrowLeft":X.preventDefault(),w();break;case"ArrowRight":X.preventDefault(),M();break;case"ArrowUp":X.preventDefault(),w();break;case"ArrowDown":X.preventDefault(),M();break;case"=":case"+":(X.ctrlKey||X.metaKey)&&(X.preventDefault(),V("in"));break;case"-":(X.ctrlKey||X.metaKey)&&(X.preventDefault(),V("out"));break;case"0":(X.ctrlKey||X.metaKey)&&(X.preventDefault(),U());break;case"r":case"R":(X.ctrlKey||X.metaKey)&&(X.preventDefault(),B());break}};return window.addEventListener("keydown",O),()=>window.removeEventListener("keydown",O)},[I,r,e?.length]);const V=O=>{a(X=>{const be=O==="in"?X*1.2:X/1.2;return Math.max(.1,Math.min(5,be))})},B=()=>{p(O=>(O+90)%360)},k=O=>{O.target===b.current&&(h(!0),m({x:O.clientX-o.x,y:O.clientY-o.y}))},F=O=>{u&&c({x:O.clientX-d.x,y:O.clientY-d.y})},R=()=>{h(!1)},$=O=>{O.preventDefault();const X=O.deltaY>0?"out":"in";V(X)},z=()=>{if(I){const O=document.createElement("a");O.href=I,O.download=`image-${r+1}.jpg`,O.click()}},U=()=>{const O=j();a(O),c({x:0,y:0}),p(0)};return!e||e.length===0?null:l.jsxs("div",{ref:E,className:"fixed inset-0 bg-black bg-opacity-90 flex items-center justify-center z-50",onClick:O=>{O.target===E.current&&n()},onMouseMove:F,onMouseUp:R,onWheel:$,children:[l.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&&l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"text-white text-sm",children:[r+1," / ",e.length]}),l.jsx("div",{className:"w-px h-6 bg-gray-500"})]}),l.jsx("button",{onClick:()=>V("out"),className:"text-white hover:text-gray-300 p-2 hover:bg-white hover:bg-opacity-20 rounded transition-colors",title:"缩小 (Ctrl + -)",children:l.jsx(Fa,{className:"w-5 h-5"})}),l.jsxs("span",{className:"text-white text-sm min-w-16 text-center",children:[Math.round(s*100),"%"]}),l.jsx("button",{onClick:()=>V("in"),className:"text-white hover:text-gray-300 p-2 hover:bg-white hover:bg-opacity-20 rounded transition-colors",title:"放大 (Ctrl + +)",children:l.jsx(Oa,{className:"w-5 h-5"})}),l.jsx("div",{className:"w-px h-6 bg-gray-500"}),l.jsx("button",{onClick:B,className:"text-white hover:text-gray-300 p-2 hover:bg-white hover:bg-opacity-20 rounded transition-colors",title:"旋转 90°",children:l.jsx($a,{className:"w-5 h-5"})}),l.jsx("button",{onClick:U,className:"text-white hover:text-gray-300 p-2 hover:bg-white hover:bg-opacity-20 rounded transition-colors text-sm",title:"适应窗口大小",children:"适应"}),l.jsx("button",{onClick:()=>{a(1),c({x:0,y:0}),p(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"}),l.jsx("button",{onClick:z,className:"text-white hover:text-gray-300 p-2 hover:bg-white hover:bg-opacity-20 rounded transition-colors",title:"下载图片",children:l.jsx(Ba,{className:"w-5 h-5"})})]}),e.length>1&&l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:w,disabled:r===0,className:`absolute left-4 top-1/2 transform -translate-y-1/2 text-white p-3 rounded-full transition-all z-10 ${r===0?"opacity-50 cursor-not-allowed":"hover:text-gray-300 hover:bg-white hover:bg-opacity-20"}`,title:"上一张 (←)",children:l.jsx(Ha,{className:"w-8 h-8"})}),l.jsx("button",{onClick:M,disabled:r===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 ${r===e.length-1?"opacity-50 cursor-not-allowed":"hover:text-gray-300 hover:bg-white hover:bg-opacity-20"}`,title:"下一张 (→)",children:l.jsx(kr,{className:"w-8 h-8"})})]}),l.jsx("button",{onClick:n,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:l.jsx(Ut,{className:"w-6 h-6"})}),l.jsx("img",{ref:b,src:I,alt:`图片预览 ${r+1}/${e.length}`,className:`max-w-none transition-transform ${u?"cursor-grabbing":"cursor-grab"}`,style:{transform:`translate(${o.x}px, ${o.y}px) scale(${s}) rotate(${f}deg)`,maxHeight:"none",maxWidth:"none",opacity:g?1:0},onLoad:T,onMouseDown:k,onDoubleClick:U,draggable:!1,onClick:O=>O.stopPropagation()}),l.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关闭"})]})},jl=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}],Nl=({isOpen:e,onSelect:t,onClose:n,searchTerm:r,position:i,projectId:s,selectedIndex:a=0,onSelectedIndexChange:o})=>{const{t:c}=oe("components"),u=v.useRef(null);v.useEffect(()=>{const I=w=>{u.current&&!u.current.contains(w.target)&&n?.()};if(e)return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[e,n]);const{data:h=[]}=Zi({scope:"user",search:r}),{data:d=[]}=es({projectId:s||"",search:r}),p=[...jl(c).filter(I=>I.name.toLowerCase().includes(r.toLowerCase())||I.description.toLowerCase().includes(r.toLowerCase())),...d,...h];if(v.useEffect(()=>{p.length>0&&a>=p.length&&o?.(0)},[p.length,a,o]),v.useEffect(()=>{if(e&&u.current){const I=u.current.querySelector(`[data-index="${a}"]`);I&&I.scrollIntoView({block:"nearest",behavior:"smooth"})}},[a,e]),!e||p.length===0)return null;const g=65,C=20,b=4,E=i.top-C-b,j=p.length*g,T=Math.min(j,E);return l.jsx("div",{ref:u,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+b,left:i.left,maxHeight:`${T}px`},children:l.jsx("div",{className:"overflow-y-auto",style:{maxHeight:`${T}px`},children:p.map((I,w)=>{const M="isSystem"in I,V=w===a,B=()=>M?I.name:I.namespace?`${I.namespace}:${I.name}`:I.name;return l.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 ${V?"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(I),onMouseEnter:()=>o?.(w),children:l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:`text-sm font-medium truncate ${V?"text-blue-900 dark:text-blue-300":"text-gray-900 dark:text-gray-100"}`,children:B()}),I.description&&l.jsx("div",{className:`text-xs truncate ${V?"text-blue-700 dark:text-blue-400":"text-gray-500 dark:text-gray-400"}`,children:I.description})]})},I.id)})})})},El=({isOpen:e,message:t,onConfirm:n,onCancel:r,confirmText:i="确认",cancelText:s="取消"})=>e?l.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[l.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-50",onClick:r}),l.jsxs("div",{className:"relative bg-white rounded-lg shadow-lg max-w-md w-full mx-4 p-6",children:[l.jsx("button",{onClick:r,className:"absolute top-4 right-4 text-gray-400 hover:text-gray-600 transition-colors",children:l.jsx(Ut,{size:20})}),l.jsxs("div",{className:"pr-8",children:[l.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"命令确认"}),l.jsx("p",{className:"text-gray-700 whitespace-pre-line mb-6",children:t})]}),l.jsxs("div",{className:"flex justify-end space-x-3",children:[l.jsx("button",{onClick:r,className:"px-4 py-2 text-gray-700 bg-gray-100 hover:bg-gray-200 rounded-lg transition-colors",children:s}),l.jsx("button",{onClick:n,className:"px-4 py-2 text-white bg-blue-600 hover:bg-blue-700 rounded-lg transition-colors",children:i})]})]})]}):null,Tl=({permissionMode:e,onPermissionModeChange:t,selectedClaudeVersion:n,onClaudeVersionChange:r,selectedModel:i,onModelChange:s,availableModels:a,claudeVersionsData:o,isVersionLocked:c,isAiTyping:u,className:h=""})=>{const{t:d}=oe("components"),[m,f]=v.useState(!1),p=v.useRef(null);v.useEffect(()=>{const T=I=>{p.current&&!p.current.contains(I.target)&&f(!1)};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[]);const g=T=>{t(T),f(!1)},C=T=>{r(T),f(!1)},b=T=>{s(T),f(!1)},E=o?.versions&&o.versions.length>1,j=a.length>=2;return l.jsxs("div",{className:`relative ${h}`,ref:p,children:[l.jsxs("button",{onClick:()=>f(!m),className:`flex items-center space-x-2 px-3 py-2 text-sm rounded-lg transition-colors ${e!=="default"||n||i!=="sonnet"?"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-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,disabled:u,title:d("agentChat.settings.title"),children:[l.jsx(Va,{className:"w-4 h-4"}),l.jsx(Et,{className:"w-3 h-3"})]}),m&&l.jsxs("div",{className:"absolute bottom-full left-0 mb-2 w-48 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50",children:[l.jsxs("div",{className:"border-b border-gray-100 dark:border-gray-700",children:[l.jsx("div",{className:"px-3 py-2 text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:d("agentChat.settings.permissionMode")}),[{value:"default",label:d("agentChat.permissionMode.default")},{value:"acceptEdits",label:d("agentChat.permissionMode.acceptEdits")},{value:"bypassPermissions",label:d("agentChat.permissionMode.bypassPermissions")}].map(T=>l.jsx("button",{onClick:()=>g(T.value),className:`w-full text-left px-3 py-2 text-sm hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors ${e===T.value?"bg-blue-50 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400":"text-gray-700 dark:text-gray-300"}`,children:l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Gi,{className:"w-4 h-4"}),l.jsx("span",{children:T.label})]})},T.value))]}),E&&l.jsxs("div",{className:"border-b border-gray-100 dark:border-gray-700",children:[l.jsx("div",{className:"px-3 py-2 text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:d("agentChat.settings.claudeVersion")}),l.jsx("button",{onClick:()=>C(void 0),disabled:c,className:`w-full text-left px-3 py-2 text-sm hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors ${n?"text-gray-700 dark:text-gray-300":"bg-green-50 dark:bg-green-900/30 text-green-600 dark:text-green-400"} ${c?"opacity-50 cursor-not-allowed":""}`,children:l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Jn,{className:"w-4 h-4"}),l.jsx("span",{children:d("agentChat.claudeVersion.default")})]})}),o.versions.filter(T=>o.defaultVersionId&&T.id!==o.defaultVersionId).map(T=>l.jsx("button",{onClick:()=>C(T.id),disabled:c,className:`w-full text-left px-3 py-2 text-sm hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors ${n===T.id?"bg-green-50 dark:bg-green-900/30 text-green-600 dark:text-green-400":"text-gray-700 dark:text-gray-300"} ${c?"opacity-50 cursor-not-allowed":""}`,children:l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Jn,{className:"w-4 h-4"}),l.jsxs("div",{className:"flex-1",children:[l.jsx("span",{children:T.name}),T.isSystem&&l.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400 ml-1",children:["(",d("agentChat.claudeVersion.system"),")"]})]})]})},T.id))]}),j&&l.jsxs("div",{children:[l.jsx("div",{className:"px-3 py-2 text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:d("agentChat.settings.model")}),a.map(T=>l.jsx("button",{onClick:()=>b(T.id),className:`w-full text-left px-3 py-2 text-sm hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors ${i===T.id?"bg-purple-50 dark:bg-purple-900/30 text-purple-600 dark:text-purple-400":"text-gray-700 dark:text-gray-300"}`,title:T.description,children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center space-x-2 flex-1 min-w-0",children:[l.jsx(Ji,{className:"w-4 h-4 flex-shrink-0"}),l.jsx("span",{className:"truncate",children:T.name})]}),T.isVision&&l.jsx("span",{className:"text-xs text-gray-400 flex-shrink-0",children:"👁️"})]})},T.id))]}),!E&&!j&&l.jsx("div",{className:"px-3 py-4 text-sm text-gray-500 dark:text-gray-400 text-center",children:d("agentChat.settings.noSettings")})]})]})},ut=rl(e=>({currentAgent:null,messages:[],isAiTyping:!1,currentSessionId:null,sidebarCollapsed:!1,setCurrentAgent:t=>e(n=>({currentAgent:t,...n.currentAgent?.id!==t?.id?{messages:[],isAiTyping:!1,currentSessionId:null}:{}})),addMessage:t=>e(n=>({messages:[...n.messages,{...t,id:`${Date.now()}_${Math.random().toString(36).substr(2,9)}`,timestamp:Date.now(),agentId:n.currentAgent?.id||"unknown",messageParts:[]}]})),updateMessage:(t,n)=>e(r=>({messages:r.messages.map(i=>i.id===t?{...i,...n}:i)})),addTextPartToMessage:(t,n)=>e(r=>({messages:r.messages.map(i=>i.id===t?{...i,messageParts:[...i.messageParts||[],{id:`${Date.now()}_${Math.random().toString(36).substr(2,9)}`,type:"text",content:n,order:(i.messageParts||[]).length}]}:i)})),addThinkingPartToMessage:(t,n)=>e(r=>({messages:r.messages.map(i=>i.id===t?{...i,messageParts:[...i.messageParts||[],{id:`${Date.now()}_${Math.random().toString(36).substr(2,9)}`,type:"thinking",content:n,order:(i.messageParts||[]).length}]}:i)})),addToolPartToMessage:(t,n)=>e(r=>({messages:r.messages.map(i=>i.id===t?{...i,messageParts:[...i.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)}`},order:(i.messageParts||[]).length}]}:i)})),updateToolPartInMessage:(t,n,r)=>e(i=>({messages:i.messages.map(s=>s.id===t?{...s,messageParts:s.messageParts?.map(a=>a.type==="tool"&&a.toolData?.id===n?{...a,toolData:a.toolData?{...a.toolData,...r}:void 0}:a)}:s)})),setAiTyping:t=>e({isAiTyping:t}),setCurrentSessionId:t=>e({currentSessionId:t}),clearMessages:()=>e({messages:[]}),loadSessionMessages:t=>e({messages:t}),setSidebarCollapsed:t=>e({sidebarCollapsed:t})})),Il=({agentId:e,sessionId:t,projectPath:n,enabled:r=!0,interval:i=3e4,shouldCheckExistence:s=!1})=>{const a=v.useRef(null),o=v.useRef(0),c=v.useRef(!0),u=v.useRef(!1),h=v.useCallback(async()=>{if(!e||!t)return!1;try{const g=`${It}/sessions/${e}/${t}/check`,C=await qt(g);if(C.ok){const b=await C.json();return console.log(`🔍 Session existence check: ${t} - ${b.exists?"exists":"not found"}`),b.exists}return!1}catch(g){return console.error("❌ Error checking session existence:",g),!1}},[e,t]),d=v.useCallback(async()=>{if(!(!e||!t||!r))try{const g=`${It}/sessions/${e}/${t}/heartbeat`,C=await qt(g,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:n,timestamp:Date.now()})});if(C.ok){const b=await C.json();o.current=b.timestamp,console.log(`💓 Session heartbeat sent successfully: ${t}`),$t.updateCurrentTabActivity(e,t)}else console.warn(`⚠️ Failed to send heartbeat for session ${t}:`,C.status)}catch(g){console.error("💔 Error sending session heartbeat:",g)}},[e,t,n,r]),m=v.useCallback(()=>{c.current=!document.hidden,c.current&&r&&t&&d()},[d,r,t]),f=v.useCallback(async()=>{if(!(!r||!t||a.current)){if(s&&!u.current){const g=await h();if(u.current=!0,!g){console.log(`⏸️ Session ${t} not found in SessionManager, heartbeat not started`);return}}console.log(`💓 Starting heartbeat for session: ${t}`),d(),a.current=setInterval(()=>{d()},i)}},[r,t,d,i,s,h]),p=v.useCallback(()=>{a.current&&(console.log(`💔 Stopping heartbeat for session: ${t}`),clearInterval(a.current),a.current=null)},[t]);return v.useEffect(()=>(u.current=!1,t&&r?f():p(),()=>{p()}),[t,r,f,p]),v.useEffect(()=>(document.addEventListener("visibilitychange",m),()=>{document.removeEventListener("visibilitychange",m)}),[m]),v.useEffect(()=>()=>{p()},[p]),{sendHeartbeat:d,startHeartbeat:f,stopHeartbeat:p,checkSessionExists:h,lastHeartbeat:o.current}},Dl=({agentId:e,sessionId:t,projectPath:n,enabled:r=!0,interval:i=3e4,isNewSession:s=!1,hasSuccessfulResponse:a=!1})=>{const o=v.useRef(null),c=v.useRef(!1),u=!t||!r?!1:s?a:!0,d=Il({agentId:e,sessionId:t,projectPath:n,enabled:u,interval:i,shouldCheckExistence:!s&&!!t});return v.useEffect(()=>{o.current!==t&&(c.current=!1,o.current=t)},[t]),v.useEffect(()=>{u&&t&&!c.current&&(c.current=!0,console.log(`🚀 Heartbeat enabled for session: ${t} (new: ${s}, hasResponse: ${a})`))},[u,t,s,a]),{...d,isHeartbeatActive:u&&c.current}},Al=()=>{const[e,t]=v.useState(!1);return v.useEffect(()=>{const n=()=>{t(window.innerWidth<640)};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),{isCompactMode:e}};function Pl(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Ll=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ml=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Rl={};function qr(e,t){return(Rl.jsx?Ml:Ll).test(e)}const zl=/[ \t\n\f\r]/g;function _l(e){return typeof e=="object"?e.type==="text"?Wr(e.value):!1:Wr(e)}function Wr(e){return e.replace(zl,"")===""}class Jt{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Jt.prototype.normal={};Jt.prototype.property={};Jt.prototype.space=void 0;function rs(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Jt(n,r,t)}function tr(e){return e.toLowerCase()}class Ue{constructor(t,n){this.attribute=n,this.property=t}}Ue.prototype.attribute="";Ue.prototype.booleanish=!1;Ue.prototype.boolean=!1;Ue.prototype.commaOrSpaceSeparated=!1;Ue.prototype.commaSeparated=!1;Ue.prototype.defined=!1;Ue.prototype.mustUseProperty=!1;Ue.prototype.number=!1;Ue.prototype.overloadedBoolean=!1;Ue.prototype.property="";Ue.prototype.spaceSeparated=!1;Ue.prototype.space=void 0;let Fl=0;const J=kt(),Ce=kt(),nr=kt(),A=kt(),fe=kt(),Tt=kt(),We=kt();function kt(){return 2**++Fl}const rr=Object.freeze(Object.defineProperty({__proto__:null,boolean:J,booleanish:Ce,commaOrSpaceSeparated:We,commaSeparated:Tt,number:A,overloadedBoolean:nr,spaceSeparated:fe},Symbol.toStringTag,{value:"Module"})),Ln=Object.keys(rr);class wr extends Ue{constructor(t,n,r,i){let s=-1;if(super(t,n),Xr(this,"space",i),typeof r=="number")for(;++s<Ln.length;){const a=Ln[s];Xr(this,Ln[s],(r&rr[a])===rr[a])}}}wr.prototype.defined=!0;function Xr(e,t,n){n&&(e[t]=n)}function At(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new wr(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[tr(r)]=r,n[tr(s.attribute)]=r}return new Jt(t,n,e.space)}const is=At({properties:{ariaActiveDescendant:null,ariaAtomic:Ce,ariaAutoComplete:null,ariaBusy:Ce,ariaChecked:Ce,ariaColCount:A,ariaColIndex:A,ariaColSpan:A,ariaControls:fe,ariaCurrent:null,ariaDescribedBy:fe,ariaDetails:null,ariaDisabled:Ce,ariaDropEffect:fe,ariaErrorMessage:null,ariaExpanded:Ce,ariaFlowTo:fe,ariaGrabbed:Ce,ariaHasPopup:null,ariaHidden:Ce,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:fe,ariaLevel:A,ariaLive:null,ariaModal:Ce,ariaMultiLine:Ce,ariaMultiSelectable:Ce,ariaOrientation:null,ariaOwns:fe,ariaPlaceholder:null,ariaPosInSet:A,ariaPressed:Ce,ariaReadOnly:Ce,ariaRelevant:null,ariaRequired:Ce,ariaRoleDescription:fe,ariaRowCount:A,ariaRowIndex:A,ariaRowSpan:A,ariaSelected:Ce,ariaSetSize:A,ariaSort:null,ariaValueMax:A,ariaValueMin:A,ariaValueNow:A,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function ss(e,t){return t in e?e[t]:t}function as(e,t){return ss(e,t.toLowerCase())}const Ol=At({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Tt,acceptCharset:fe,accessKey:fe,action:null,allow:null,allowFullScreen:J,allowPaymentRequest:J,allowUserMedia:J,alt:null,as:null,async:J,autoCapitalize:null,autoComplete:fe,autoFocus:J,autoPlay:J,blocking:fe,capture:null,charSet:null,checked:J,cite:null,className:fe,cols:A,colSpan:null,content:null,contentEditable:Ce,controls:J,controlsList:fe,coords:A|Tt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:J,defer:J,dir:null,dirName:null,disabled:J,download:nr,draggable:Ce,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:J,formTarget:null,headers:fe,height:A,hidden:nr,high:A,href:null,hrefLang:null,htmlFor:fe,httpEquiv:fe,id:null,imageSizes:null,imageSrcSet:null,inert:J,inputMode:null,integrity:null,is:null,isMap:J,itemId:null,itemProp:fe,itemRef:fe,itemScope:J,itemType:fe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:J,low:A,manifest:null,max:null,maxLength:A,media:null,method:null,min:null,minLength:A,multiple:J,muted:J,name:null,nonce:null,noModule:J,noValidate:J,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:J,optimum:A,pattern:null,ping:fe,placeholder:null,playsInline:J,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:J,referrerPolicy:null,rel:fe,required:J,reversed:J,rows:A,rowSpan:A,sandbox:fe,scope:null,scoped:J,seamless:J,selected:J,shadowRootClonable:J,shadowRootDelegatesFocus:J,shadowRootMode:null,shape:null,size:A,sizes:null,slot:null,span:A,spellCheck:Ce,src:null,srcDoc:null,srcLang:null,srcSet:null,start:A,step:null,style:null,tabIndex:A,target:null,title:null,translate:null,type:null,typeMustMatch:J,useMap:null,value:Ce,width:A,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:fe,axis:null,background:null,bgColor:null,border:A,borderColor:null,bottomMargin:A,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:J,declare:J,event:null,face:null,frame:null,frameBorder:null,hSpace:A,leftMargin:A,link:null,longDesc:null,lowSrc:null,marginHeight:A,marginWidth:A,noResize:J,noHref:J,noShade:J,noWrap:J,object:null,profile:null,prompt:null,rev:null,rightMargin:A,rules:null,scheme:null,scrolling:Ce,standby:null,summary:null,text:null,topMargin:A,valueType:null,version:null,vAlign:null,vLink:null,vSpace:A,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:J,disableRemotePlayback:J,prefix:null,property:null,results:A,security:null,unselectable:null},space:"html",transform:as}),$l=At({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:We,accentHeight:A,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:A,amplitude:A,arabicForm:null,ascent:A,attributeName:null,attributeType:null,azimuth:A,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:A,by:null,calcMode:null,capHeight:A,className:fe,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:A,diffuseConstant:A,direction:null,display:null,dur:null,divisor:A,dominantBaseline:null,download:J,dx:null,dy:null,edgeMode:null,editable:null,elevation:A,enableBackground:null,end:null,event:null,exponent:A,externalResourcesRequired:null,fill:null,fillOpacity:A,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:Tt,g2:Tt,glyphName:Tt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:A,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:A,horizOriginX:A,horizOriginY:A,id:null,ideographic:A,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:A,k:A,k1:A,k2:A,k3:A,k4:A,kernelMatrix:We,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:A,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:A,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:A,overlineThickness:A,paintOrder:null,panose1:null,path:null,pathLength:A,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:fe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:A,pointsAtY:A,pointsAtZ:A,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:We,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:We,rev:We,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:We,requiredFeatures:We,requiredFonts:We,requiredFormats:We,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:A,specularExponent:A,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:A,strikethroughThickness:A,string:null,stroke:null,strokeDashArray:We,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:A,strokeOpacity:A,strokeWidth:null,style:null,surfaceScale:A,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:We,tabIndex:A,tableValues:null,target:null,targetX:A,targetY:A,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:We,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:A,underlineThickness:A,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:A,values:null,vAlphabetic:A,vMathematical:A,vectorEffect:null,vHanging:A,vIdeographic:A,version:null,vertAdvY:A,vertOriginX:A,vertOriginY:A,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:A,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ss}),ls=At({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()}}),os=At({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:as}),us=At({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Bl={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"},Hl=/[A-Z]/g,Yr=/-[a-z]/g,Vl=/^data[-\w.:]+$/i;function Ul(e,t){const n=tr(t);let r=t,i=Ue;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Vl.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Yr,Wl);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Yr.test(s)){let a=s.replace(Hl,ql);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=wr}return new i(r,t)}function ql(e){return"-"+e.toLowerCase()}function Wl(e){return e.charAt(1).toUpperCase()}const Xl=rs([is,Ol,ls,os,us],"html"),vr=rs([is,$l,ls,os,us],"svg");function Yl(e){return e.join(" ").trim()}var Ct={},Mn,Qr;function Ql(){if(Qr)return Mn;Qr=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,o=/^\s+|\s+$/g,c=`
|
|
2
|
-
`,u="/",h="*",d="",m="comment",f="declaration";Mn=function(g,C){if(typeof g!="string")throw new TypeError("First argument must be a string");if(!g)return[];C=C||{};var b=1,E=1;function j($){var z=$.match(t);z&&(b+=z.length);var U=$.lastIndexOf(c);E=~U?$.length-U:E+$.length}function T(){var $={line:b,column:E};return function(z){return z.position=new I($),V(),z}}function I($){this.start=$,this.end={line:b,column:E},this.source=C.source}I.prototype.content=g;function w($){var z=new Error(C.source+":"+b+":"+E+": "+$);if(z.reason=$,z.filename=C.source,z.line=b,z.column=E,z.source=g,!C.silent)throw z}function M($){var z=$.exec(g);if(z){var U=z[0];return j(U),g=g.slice(U.length),z}}function V(){M(n)}function B($){var z;for($=$||[];z=k();)z!==!1&&$.push(z);return $}function k(){var $=T();if(!(u!=g.charAt(0)||h!=g.charAt(1))){for(var z=2;d!=g.charAt(z)&&(h!=g.charAt(z)||u!=g.charAt(z+1));)++z;if(z+=2,d===g.charAt(z-1))return w("End of comment missing");var U=g.slice(2,z-2);return E+=2,j(U),g=g.slice(z),E+=2,$({type:m,comment:U})}}function F(){var $=T(),z=M(r);if(z){if(k(),!M(i))return w("property missing ':'");var U=M(s),O=$({type:f,property:p(z[0].replace(e,d)),value:U?p(U[0].replace(e,d)):d});return M(a),O}}function R(){var $=[];B($);for(var z;z=F();)z!==!1&&($.push(z),B($));return $}return V(),R()};function p(g){return g?g.replace(o,d):d}return Mn}var Gr;function Gl(){if(Gr)return Ct;Gr=1;var e=Ct&&Ct.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.default=n;var t=e(Ql());function n(r,i){var s=null;if(!r||typeof r!="string")return s;var a=(0,t.default)(r),o=typeof i=="function";return a.forEach(function(c){if(c.type==="declaration"){var u=c.property,h=c.value;o?i(u,h,c):h&&(s=s||{},s[u]=h)}}),s}return Ct}var Rt={},Jr;function Jl(){if(Jr)return Rt;Jr=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(u){return!u||n.test(u)||e.test(u)},a=function(u,h){return h.toUpperCase()},o=function(u,h){return"".concat(h,"-")},c=function(u,h){return h===void 0&&(h={}),s(u)?u:(u=u.toLowerCase(),h.reactCompat?u=u.replace(i,o):u=u.replace(r,o),u.replace(t,a))};return Rt.camelCase=c,Rt}var zt,Kr;function Kl(){if(Kr)return zt;Kr=1;var e=zt&&zt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Gl()),n=Jl();function r(i,s){var a={};return!i||typeof i!="string"||(0,t.default)(i,function(o,c){o&&c&&(a[(0,n.camelCase)(o,s)]=c)}),a}return r.default=r,zt=r,zt}var Zl=Kl();const eo=Qi(Zl),cs=ds("end"),Cr=ds("start");function ds(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function to(e){const t=Cr(e),n=cs(e);if(t&&n)return{start:t,end:n}}function Bt(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Zr(e.position):"start"in e||"end"in e?Zr(e):"line"in e||"column"in e?ir(e):""}function ir(e){return ei(e&&e.line)+":"+ei(e&&e.column)}function Zr(e){return ir(e&&e.start)+"-"+ir(e&&e.end)}function ei(e){return e&&typeof e=="number"?e:1}class ze extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(a=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?s.ruleId=r:(s.source=r.slice(0,c),s.ruleId=r.slice(c+1))}if(!s.place&&s.ancestors&&s.ancestors){const c=s.ancestors[s.ancestors.length-1];c&&(s.place=c.position)}const 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=Bt(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}}ze.prototype.file="";ze.prototype.name="";ze.prototype.reason="";ze.prototype.message="";ze.prototype.stack="";ze.prototype.column=void 0;ze.prototype.line=void 0;ze.prototype.ancestors=void 0;ze.prototype.cause=void 0;ze.prototype.fatal=void 0;ze.prototype.place=void 0;ze.prototype.ruleId=void 0;ze.prototype.source=void 0;const Sr={}.hasOwnProperty,no=new Map,ro=/[A-Z]/g,io=new Set(["table","tbody","thead","tfoot","tr"]),so=new Set(["td","th"]),hs="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ao(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=po(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=mo(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?vr:Xl,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=fs(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function fs(e,t,n){if(t.type==="element")return lo(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return oo(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return co(e,t,n);if(t.type==="mdxjsEsm")return uo(e,t);if(t.type==="root")return ho(e,t,n);if(t.type==="text")return fo(e,t)}function lo(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=vr,e.schema=i),e.ancestors.push(t);const s=ps(e,t.tagName,!1),a=go(e,t);let o=Nr(e,t);return io.has(t.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!_l(c):!0})),ms(e,a,s,t),jr(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function oo(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Wt(e,t.position)}function uo(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Wt(e,t.position)}function co(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=vr,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:ps(e,t.name,!0),a=xo(e,t),o=Nr(e,t);return ms(e,a,s,t),jr(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function ho(e,t,n){const r={};return jr(r,Nr(e,t)),e.create(t,e.Fragment,r,n)}function fo(e,t){return t.value}function ms(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function jr(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function mo(e,t,n){return r;function r(i,s,a,o){const u=Array.isArray(a.children)?n:t;return o?u(s,a,o):u(s,a)}}function po(e,t){return n;function n(r,i,s,a){const o=Array.isArray(s.children),c=Cr(r);return t(i,s,a,o,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function go(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Sr.call(t.properties,i)){const s=yo(e,i,t.properties[i]);if(s){const[a,o]=s;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&so.has(t.tagName)?r=o:n[a]=o}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function xo(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Wt(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,s=e.evaluater.evaluateExpression(o.expression)}else Wt(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function Nr(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:no;for(;++r<t.children.length;){const s=t.children[r];let a;if(e.passKeys){const c=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(c){const u=i.get(c)||0;a=c+"-"+u,i.set(c,u+1)}}const o=fs(e,s,a);o!==void 0&&n.push(o)}return n}function yo(e,t,n){const r=Ul(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Pl(n):Yl(n)),r.property==="style"){let i=typeof n=="object"?n:bo(e,String(n));return e.stylePropertyNameCase==="css"&&(i=ko(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Bl[r.property]||r.property:r.attribute,n]}}function bo(e,t){try{return eo(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new ze("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=hs+"#cannot-parse-style-attribute",i}}function ps(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,a;for(;++s<i.length;){const o=qr(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}r=a}else r=qr(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Sr.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Wt(e)}function Wt(e,t){const n=new ze("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=hs+"#cannot-handle-mdx-estrees-without-createevaluater",n}function ko(e){const t={};let n;for(n in e)Sr.call(e,n)&&(t[wo(n)]=e[n]);return t}function wo(e){let t=e.replace(ro,vo);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function vo(e){return"-"+e.toLowerCase()}const Rn={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"]},Co={};function Er(e,t){const n=Co,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return gs(e,r,i)}function gs(e,t,n){if(So(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return ti(e.children,t,n)}return Array.isArray(e)?ti(e,t,n):""}function ti(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=gs(e[i],t,n);return r.join("")}function So(e){return!!(e&&typeof e=="object")}const ni=document.createElement("i");function Tr(e){const t="&"+e+";";ni.innerHTML=t;const n=ni.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Xe(e,t,n,r){const i=e.length;let s=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(t,0),e.splice(...a),s+=1e4,t+=1e4}function Je(e,t){return e.length>0?(Xe(e,e.length,0,t),e):t}const ri={}.hasOwnProperty;function xs(e){const t={};let n=-1;for(;++n<e.length;)jo(t,e[n]);return t}function jo(e,t){let n;for(n in t){const i=(ri.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let a;if(s)for(a in s){ri.call(i,a)||(i[a]=[]);const o=s[a];No(i[a],Array.isArray(o)?o:o?[o]:[])}}}function No(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Xe(e,0,0,r)}function ys(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function tt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Fe=pt(/[A-Za-z]/),Me=pt(/[\dA-Za-z]/),Eo=pt(/[#-'*+\--9=?A-Z^-~]/);function pn(e){return e!==null&&(e<32||e===127)}const sr=pt(/\d/),To=pt(/[\dA-Fa-f]/),Io=pt(/[!-/:-@[-`{-~]/);function W(e){return e!==null&&e<-2}function he(e){return e!==null&&(e<0||e===32)}function ne(e){return e===-2||e===-1||e===32}const kn=pt(new RegExp("\\p{P}|\\p{S}","u")),bt=pt(/\s/);function pt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Pt(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let a="";if(s===37&&Me(e.charCodeAt(n+1))&&Me(e.charCodeAt(n+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(n+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(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function se(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(c){return ne(c)?(e.enter(n),o(c)):t(c)}function o(c){return ne(c)&&s++<i?(e.consume(c),o):(e.exit(n),t(c))}}const Do={tokenize:Ao};function Ao(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),se(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),s(o)}function s(o){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,a(o)}function a(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return W(o)?(e.consume(o),e.exit("chunkText"),s):(e.consume(o),a)}}const Po={tokenize:Lo},ii={tokenize:Mo};function Lo(e){const t=this,n=[];let r=0,i,s,a;return o;function o(j){if(r<n.length){const T=n[r];return t.containerState=T[1],e.attempt(T[0].continuation,c,u)(j)}return u(j)}function c(j){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&E();const T=t.events.length;let I=T,w;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){w=t.events[I][1].end;break}b(r);let M=T;for(;M<t.events.length;)t.events[M][1].end={...w},M++;return Xe(t.events,I+1,0,t.events.slice(T)),t.events.length=M,u(j)}return o(j)}function u(j){if(r===n.length){if(!i)return m(j);if(i.currentConstruct&&i.currentConstruct.concrete)return p(j);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ii,h,d)(j)}function h(j){return i&&E(),b(r),m(j)}function d(j){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,p(j)}function m(j){return t.containerState={},e.attempt(ii,f,p)(j)}function f(j){return r++,n.push([t.currentConstruct,t.containerState]),m(j)}function p(j){if(j===null){i&&E(),b(0),e.consume(j);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),g(j)}function g(j){if(j===null){C(e.exit("chunkFlow"),!0),b(0),e.consume(j);return}return W(j)?(e.consume(j),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(j),g)}function C(j,T){const I=t.sliceStream(j);if(T&&I.push(null),j.previous=s,s&&(s.next=j),s=j,i.defineSkip(j.start),i.write(I),t.parser.lazy[j.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 M=t.events.length;let V=M,B,k;for(;V--;)if(t.events[V][0]==="exit"&&t.events[V][1].type==="chunkFlow"){if(B){k=t.events[V][1].end;break}B=!0}for(b(r),w=M;w<t.events.length;)t.events[w][1].end={...k},w++;Xe(t.events,V+1,0,t.events.slice(M)),t.events.length=w}}function b(j){let T=n.length;for(;T-- >j;){const I=n[T];t.containerState=I[1],I[0].exit.call(t,e)}n.length=j}function E(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Mo(e,t,n){return se(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Dt(e){if(e===null||he(e)||bt(e))return 1;if(kn(e))return 2}function wn(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const ar={name:"attention",resolveAll:Ro,tokenize:zo};function Ro(e,t){let n=-1,r,i,s,a,o,c,u,h;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},m={...e[n][1].start};si(d,-c),si(m,c),a={type:c>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},s={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[n][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Je(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Je(u,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",s,t]]),u=Je(u,wn(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Je(u,[["exit",s,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,u=Je(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,Xe(e,r-1,n-r+3,u),n=r+u.length-h-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function zo(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Dt(r);let s;return a;function a(c){return s=c,e.enter("attentionSequence"),o(c)}function o(c){if(c===s)return e.consume(c),o;const u=e.exit("attentionSequence"),h=Dt(c),d=!h||h===2&&i||n.includes(c),m=!i||i===2&&h||n.includes(r);return u._open=!!(s===42?d:d&&(i||!m)),u._close=!!(s===42?m:m&&(h||!d)),t(c)}}function si(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const _o={name:"autolink",tokenize:Fo};function Fo(e,t,n){let r=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 Fe(f)?(e.consume(f),a):f===64?n(f):u(f)}function a(f){return f===43||f===45||f===46||Me(f)?(r=1,o(f)):u(f)}function o(f){return f===58?(e.consume(f),r=0,c):(f===43||f===45||f===46||Me(f))&&r++<32?(e.consume(f),o):(r=0,u(f))}function c(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||pn(f)?n(f):(e.consume(f),c)}function u(f){return f===64?(e.consume(f),h):Eo(f)?(e.consume(f),u):n(f)}function h(f){return Me(f)?d(f):n(f)}function d(f){return f===46?(e.consume(f),r=0,h):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):m(f)}function m(f){if((f===45||Me(f))&&r++<63){const p=f===45?m:d;return e.consume(f),p}return n(f)}}const Kt={partial:!0,tokenize:Oo};function Oo(e,t,n){return r;function r(s){return ne(s)?se(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||W(s)?t(s):n(s)}}const bs={continuation:{tokenize:Bo},exit:Ho,name:"blockQuote",tokenize:$o};function $o(e,t,n){const r=this;return i;function i(a){if(a===62){const o=r.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 n(a)}function s(a){return ne(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function Bo(e,t,n){const r=this;return i;function i(a){return ne(a)?se(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return e.attempt(bs,t,n)(a)}}function Ho(e){e.exit("blockQuote")}const ks={name:"characterEscape",tokenize:Vo};function Vo(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return Io(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const ws={name:"characterReference",tokenize:Uo};function Uo(e,t,n){const r=this;let i=0,s,a;return o;function o(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),c}function c(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),s=31,a=Me,h(d))}function u(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,a=To,h):(e.enter("characterReferenceValue"),s=7,a=sr,h(d))}function h(d){if(d===59&&i){const m=e.exit("characterReferenceValue");return a===Me&&!Tr(r.sliceSerialize(m))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(d)&&i++<s?(e.consume(d),h):n(d)}}const ai={partial:!0,tokenize:Wo},li={concrete:!0,name:"codeFenced",tokenize:qo};function qo(e,t,n){const r=this,i={partial:!0,tokenize:I};let s=0,a=0,o;return c;function c(w){return u(w)}function u(w){const M=r.events[r.events.length-1];return s=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,o=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(w)}function h(w){return w===o?(a++,e.consume(w),h):a<3?n(w):(e.exit("codeFencedFenceSequence"),ne(w)?se(e,d,"whitespace")(w):d(w))}function d(w){return w===null||W(w)?(e.exit("codeFencedFence"),r.interrupt?t(w):e.check(ai,g,T)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(w))}function m(w){return w===null||W(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(w)):ne(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),se(e,f,"whitespace")(w)):w===96&&w===o?n(w):(e.consume(w),m)}function f(w){return w===null||W(w)?d(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===null||W(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(w)):w===96&&w===o?n(w):(e.consume(w),p)}function g(w){return e.attempt(i,T,C)(w)}function C(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),b}function b(w){return s>0&&ne(w)?se(e,E,"linePrefix",s+1)(w):E(w)}function E(w){return w===null||W(w)?e.check(ai,g,T)(w):(e.enter("codeFlowValue"),j(w))}function j(w){return w===null||W(w)?(e.exit("codeFlowValue"),E(w)):(e.consume(w),j)}function T(w){return e.exit("codeFenced"),t(w)}function I(w,M,V){let B=0;return k;function k(U){return w.enter("lineEnding"),w.consume(U),w.exit("lineEnding"),F}function F(U){return w.enter("codeFencedFence"),ne(U)?se(w,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):R(U)}function R(U){return U===o?(w.enter("codeFencedFenceSequence"),$(U)):V(U)}function $(U){return U===o?(B++,w.consume(U),$):B>=a?(w.exit("codeFencedFenceSequence"),ne(U)?se(w,z,"whitespace")(U):z(U)):V(U)}function z(U){return U===null||W(U)?(w.exit("codeFencedFence"),M(U)):V(U)}}}function Wo(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const zn={name:"codeIndented",tokenize:Yo},Xo={partial:!0,tokenize:Qo};function Yo(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),se(e,s,"linePrefix",5)(u)}function s(u){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?c(u):W(u)?e.attempt(Xo,a,c)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||W(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function c(u){return e.exit("codeIndented"),t(u)}}function Qo(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):W(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):se(e,s,"linePrefix",5)(a)}function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):W(a)?i(a):n(a)}}const Go={name:"codeText",previous:Ko,resolve:Jo,tokenize:Zo};function Jo(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Ko(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Zo(e,t,n){let r=0,i,s;return a;function a(d){return e.enter("codeText"),e.enter("codeTextSequence"),o(d)}function o(d){return d===96?(e.consume(d),r++,o):(e.exit("codeTextSequence"),c(d))}function c(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),c):d===96?(s=e.enter("codeTextSequence"),i=0,h(d)):W(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(d))}function u(d){return d===null||d===32||d===96||W(d)?(e.exit("codeTextData"),c(d)):(e.consume(d),u)}function h(d){return d===96?(e.consume(d),i++,h):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(s.type="codeTextData",u(d))}}class eu{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&_t(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),_t(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),_t(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);_t(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);_t(this.left,n.reverse())}}}function _t(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function vs(e){const t={};let n=-1,r,i,s,a,o,c,u;const h=new eu(e);for(;++n<h.length;){for(;n in t;)n=t[n];if(r=h.get(n),n&&r[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,s=0,s<c.length&&c[s][1].type==="lineEndingBlank"&&(s+=2),s<c.length&&c[s][1].type==="content"))for(;++s<c.length&&c[s][1].type!=="content";)c[s][1].type==="chunkText"&&(c[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,tu(h,n)),n=t[n],u=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(a=h.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...h.get(i)[1].start},o=h.slice(i,n),o.unshift(r),h.splice(i,n-i+1,o))}}return Xe(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!u}function tu(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,c=[],u={};let h,d,m=-1,f=n,p=0,g=0;const C=[g];for(;f;){for(;e.get(++i)[1]!==f;);s.push(i),f._tokenizer||(h=r.sliceStream(f),f.next||h.push(null),d&&a.defineSkip(f.start),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(h),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=n;++m<o.length;)o[m][0]==="exit"&&o[m-1][0]==="enter"&&o[m][1].type===o[m-1][1].type&&o[m][1].start.line!==o[m][1].end.line&&(g=m+1,C.push(g),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(a.events=[],f?(f._tokenizer=void 0,f.previous=void 0):C.pop(),m=C.length;m--;){const b=o.slice(C[m],C[m+1]),E=s.pop();c.push([E,E+b.length-1]),e.splice(E,2,b)}for(c.reverse(),m=-1;++m<c.length;)u[p+c[m][0]]=p+c[m][1],p+=c[m][1]-c[m][0]-1;return u}const nu={resolve:iu,tokenize:su},ru={partial:!0,tokenize:au};function iu(e){return vs(e),e}function su(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):W(o)?e.check(ru,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"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function au(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),se(e,s,"linePrefix")}function s(a){if(a===null||W(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function Cs(e,t,n,r,i,s,a,o,c){const u=c||Number.POSITIVE_INFINITY;let h=0;return d;function d(b){return b===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(b),e.exit(s),m):b===null||b===32||b===41||pn(b)?n(b):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),g(b))}function m(b){return b===62?(e.enter(s),e.consume(b),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),f(b))}function f(b){return b===62?(e.exit("chunkString"),e.exit(o),m(b)):b===null||b===60||W(b)?n(b):(e.consume(b),b===92?p:f)}function p(b){return b===60||b===62||b===92?(e.consume(b),f):f(b)}function g(b){return!h&&(b===null||b===41||he(b))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(b)):h<u&&b===40?(e.consume(b),h++,g):b===41?(e.consume(b),h--,g):b===null||b===32||b===40||pn(b)?n(b):(e.consume(b),b===92?C:g)}function C(b){return b===40||b===41||b===92?(e.consume(b),g):g(b)}}function Ss(e,t,n,r,i,s){const a=this;let o=0,c;return u;function u(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(s),h}function h(f){return o>999||f===null||f===91||f===93&&!c||f===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):f===93?(e.exit(s),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):W(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||W(f)||o++>999?(e.exit("chunkString"),h(f)):(e.consume(f),c||(c=!ne(f)),f===92?m:d)}function m(f){return f===91||f===92||f===93?(e.consume(f),o++,d):d(f)}}function js(e,t,n,r,i,s){let a;return o;function o(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),a=m===40?41:m,c):n(m)}function c(m){return m===a?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(s),u(m))}function u(m){return m===a?(e.exit(s),c(a)):m===null?n(m):W(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),se(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(m))}function h(m){return m===a||m===null||W(m)?(e.exit("chunkString"),u(m)):(e.consume(m),m===92?d:h)}function d(m){return m===a||m===92?(e.consume(m),h):h(m)}}function Ht(e,t){let n;return r;function r(i){return W(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ne(i)?se(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const lu={name:"definition",tokenize:uu},ou={partial:!0,tokenize:cu};function uu(e,t,n){const r=this;let i;return s;function s(f){return e.enter("definition"),a(f)}function a(f){return Ss.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function o(f){return i=tt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),c):n(f)}function c(f){return he(f)?Ht(e,u)(f):u(f)}function u(f){return Cs(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function h(f){return e.attempt(ou,d,d)(f)}function d(f){return ne(f)?se(e,m,"whitespace")(f):m(f)}function m(f){return f===null||W(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function cu(e,t,n){return r;function r(o){return he(o)?Ht(e,i)(o):n(o)}function i(o){return js(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return ne(o)?se(e,a,"whitespace")(o):a(o)}function a(o){return o===null||W(o)?t(o):n(o)}}const du={name:"hardBreakEscape",tokenize:hu};function hu(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return W(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const fu={name:"headingAtx",resolve:mu,tokenize:pu};function mu(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Xe(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function pu(e,t,n){let r=0;return i;function i(h){return e.enter("atxHeading"),s(h)}function s(h){return e.enter("atxHeadingSequence"),a(h)}function a(h){return h===35&&r++<6?(e.consume(h),a):h===null||he(h)?(e.exit("atxHeadingSequence"),o(h)):n(h)}function o(h){return h===35?(e.enter("atxHeadingSequence"),c(h)):h===null||W(h)?(e.exit("atxHeading"),t(h)):ne(h)?se(e,o,"whitespace")(h):(e.enter("atxHeadingText"),u(h))}function c(h){return h===35?(e.consume(h),c):(e.exit("atxHeadingSequence"),o(h))}function u(h){return h===null||h===35||he(h)?(e.exit("atxHeadingText"),o(h)):(e.consume(h),u)}}const gu=["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"],oi=["pre","script","style","textarea"],xu={concrete:!0,name:"htmlFlow",resolveTo:ku,tokenize:wu},yu={partial:!0,tokenize:Cu},bu={partial:!0,tokenize:vu};function ku(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 wu(e,t,n){const r=this;let i,s,a,o,c;return u;function u(y){return h(y)}function h(y){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(y),d}function d(y){return y===33?(e.consume(y),m):y===47?(e.consume(y),s=!0,g):y===63?(e.consume(y),i=3,r.interrupt?t:x):Fe(y)?(e.consume(y),a=String.fromCharCode(y),C):n(y)}function m(y){return y===45?(e.consume(y),i=2,f):y===91?(e.consume(y),i=5,o=0,p):Fe(y)?(e.consume(y),i=4,r.interrupt?t:x):n(y)}function f(y){return y===45?(e.consume(y),r.interrupt?t:x):n(y)}function p(y){const Ee="CDATA[";return y===Ee.charCodeAt(o++)?(e.consume(y),o===Ee.length?r.interrupt?t:R:p):n(y)}function g(y){return Fe(y)?(e.consume(y),a=String.fromCharCode(y),C):n(y)}function C(y){if(y===null||y===47||y===62||he(y)){const Ee=y===47,ye=a.toLowerCase();return!Ee&&!s&&oi.includes(ye)?(i=1,r.interrupt?t(y):R(y)):gu.includes(a.toLowerCase())?(i=6,Ee?(e.consume(y),b):r.interrupt?t(y):R(y)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(y):s?E(y):j(y))}return y===45||Me(y)?(e.consume(y),a+=String.fromCharCode(y),C):n(y)}function b(y){return y===62?(e.consume(y),r.interrupt?t:R):n(y)}function E(y){return ne(y)?(e.consume(y),E):k(y)}function j(y){return y===47?(e.consume(y),k):y===58||y===95||Fe(y)?(e.consume(y),T):ne(y)?(e.consume(y),j):k(y)}function T(y){return y===45||y===46||y===58||y===95||Me(y)?(e.consume(y),T):I(y)}function I(y){return y===61?(e.consume(y),w):ne(y)?(e.consume(y),I):j(y)}function w(y){return y===null||y===60||y===61||y===62||y===96?n(y):y===34||y===39?(e.consume(y),c=y,M):ne(y)?(e.consume(y),w):V(y)}function M(y){return y===c?(e.consume(y),c=null,B):y===null||W(y)?n(y):(e.consume(y),M)}function V(y){return y===null||y===34||y===39||y===47||y===60||y===61||y===62||y===96||he(y)?I(y):(e.consume(y),V)}function B(y){return y===47||y===62||ne(y)?j(y):n(y)}function k(y){return y===62?(e.consume(y),F):n(y)}function F(y){return y===null||W(y)?R(y):ne(y)?(e.consume(y),F):n(y)}function R(y){return y===45&&i===2?(e.consume(y),O):y===60&&i===1?(e.consume(y),X):y===62&&i===4?(e.consume(y),ge):y===63&&i===3?(e.consume(y),x):y===93&&i===5?(e.consume(y),Ne):W(y)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(yu,De,$)(y)):y===null||W(y)?(e.exit("htmlFlowData"),$(y)):(e.consume(y),R)}function $(y){return e.check(bu,z,De)(y)}function z(y){return e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),U}function U(y){return y===null||W(y)?$(y):(e.enter("htmlFlowData"),R(y))}function O(y){return y===45?(e.consume(y),x):R(y)}function X(y){return y===47?(e.consume(y),a="",be):R(y)}function be(y){if(y===62){const Ee=a.toLowerCase();return oi.includes(Ee)?(e.consume(y),ge):R(y)}return Fe(y)&&a.length<8?(e.consume(y),a+=String.fromCharCode(y),be):R(y)}function Ne(y){return y===93?(e.consume(y),x):R(y)}function x(y){return y===62?(e.consume(y),ge):y===45&&i===2?(e.consume(y),x):R(y)}function ge(y){return y===null||W(y)?(e.exit("htmlFlowData"),De(y)):(e.consume(y),ge)}function De(y){return e.exit("htmlFlow"),t(y)}}function vu(e,t,n){const r=this;return i;function i(a){return W(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function Cu(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Kt,t,n)}}const Su={name:"htmlText",tokenize:ju};function ju(e,t,n){const r=this;let i,s,a;return o;function o(x){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(x),c}function c(x){return x===33?(e.consume(x),u):x===47?(e.consume(x),I):x===63?(e.consume(x),j):Fe(x)?(e.consume(x),V):n(x)}function u(x){return x===45?(e.consume(x),h):x===91?(e.consume(x),s=0,p):Fe(x)?(e.consume(x),E):n(x)}function h(x){return x===45?(e.consume(x),f):n(x)}function d(x){return x===null?n(x):x===45?(e.consume(x),m):W(x)?(a=d,X(x)):(e.consume(x),d)}function m(x){return x===45?(e.consume(x),f):d(x)}function f(x){return x===62?O(x):x===45?m(x):d(x)}function p(x){const ge="CDATA[";return x===ge.charCodeAt(s++)?(e.consume(x),s===ge.length?g:p):n(x)}function g(x){return x===null?n(x):x===93?(e.consume(x),C):W(x)?(a=g,X(x)):(e.consume(x),g)}function C(x){return x===93?(e.consume(x),b):g(x)}function b(x){return x===62?O(x):x===93?(e.consume(x),b):g(x)}function E(x){return x===null||x===62?O(x):W(x)?(a=E,X(x)):(e.consume(x),E)}function j(x){return x===null?n(x):x===63?(e.consume(x),T):W(x)?(a=j,X(x)):(e.consume(x),j)}function T(x){return x===62?O(x):j(x)}function I(x){return Fe(x)?(e.consume(x),w):n(x)}function w(x){return x===45||Me(x)?(e.consume(x),w):M(x)}function M(x){return W(x)?(a=M,X(x)):ne(x)?(e.consume(x),M):O(x)}function V(x){return x===45||Me(x)?(e.consume(x),V):x===47||x===62||he(x)?B(x):n(x)}function B(x){return x===47?(e.consume(x),O):x===58||x===95||Fe(x)?(e.consume(x),k):W(x)?(a=B,X(x)):ne(x)?(e.consume(x),B):O(x)}function k(x){return x===45||x===46||x===58||x===95||Me(x)?(e.consume(x),k):F(x)}function F(x){return x===61?(e.consume(x),R):W(x)?(a=F,X(x)):ne(x)?(e.consume(x),F):B(x)}function R(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),i=x,$):W(x)?(a=R,X(x)):ne(x)?(e.consume(x),R):(e.consume(x),z)}function $(x){return x===i?(e.consume(x),i=void 0,U):x===null?n(x):W(x)?(a=$,X(x)):(e.consume(x),$)}function z(x){return x===null||x===34||x===39||x===60||x===61||x===96?n(x):x===47||x===62||he(x)?B(x):(e.consume(x),z)}function U(x){return x===47||x===62||he(x)?B(x):n(x)}function O(x){return x===62?(e.consume(x),e.exit("htmlTextData"),e.exit("htmlText"),t):n(x)}function X(x){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),be}function be(x){return ne(x)?se(e,Ne,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):Ne(x)}function Ne(x){return e.enter("htmlTextData"),a(x)}}const Ir={name:"labelEnd",resolveAll:Iu,resolveTo:Du,tokenize:Au},Nu={tokenize:Pu},Eu={tokenize:Lu},Tu={tokenize:Mu};function Iu(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Xe(e,0,e.length,n),e}function Du(e,t){let n=e.length,r=0,i,s,a,o;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const c={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[s][1].start},end:{...e[a][1].end}},h={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[a-2][1].start}};return o=[["enter",c,t],["enter",u,t]],o=Je(o,e.slice(s+1,s+r+3)),o=Je(o,[["enter",h,t]]),o=Je(o,wn(t.parser.constructs.insideSpan.null,e.slice(s+r+4,a-3),t)),o=Je(o,[["exit",h,t],e[a-2],e[a-1],["exit",u,t]]),o=Je(o,e.slice(a+1)),o=Je(o,[["exit",c,t]]),Xe(e,s,e.length,o),e}function Au(e,t,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return o;function o(m){return s?s._inactive?d(m):(a=r.parser.defined.includes(tt(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),c):n(m)}function c(m){return m===40?e.attempt(Nu,h,a?h:d)(m):m===91?e.attempt(Eu,h,a?u:d)(m):a?h(m):d(m)}function u(m){return e.attempt(Tu,h,d)(m)}function h(m){return t(m)}function d(m){return s._balanced=!0,n(m)}}function Pu(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return he(d)?Ht(e,s)(d):s(d)}function s(d){return d===41?h(d):Cs(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return he(d)?Ht(e,c)(d):h(d)}function o(d){return n(d)}function c(d){return d===34||d===39||d===40?js(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):h(d)}function u(d){return he(d)?Ht(e,h)(d):h(d)}function h(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function Lu(e,t,n){const r=this;return i;function i(o){return Ss.call(r,e,s,a,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(tt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function a(o){return n(o)}}function Mu(e,t,n){return r;function r(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):n(s)}}const Ru={name:"labelStartImage",resolveAll:Ir.resolveAll,tokenize:zu};function zu(e,t,n){const r=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):n(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const _u={name:"labelStartLink",resolveAll:Ir.resolveAll,tokenize:Fu};function Fu(e,t,n){const r=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 r.parser.constructs?n(a):t(a)}}const _n={name:"lineEnding",tokenize:Ou};function Ou(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),se(e,t,"linePrefix")}}const hn={name:"thematicBreak",tokenize:$u};function $u(e,t,n){let r=0,i;return s;function s(u){return e.enter("thematicBreak"),a(u)}function a(u){return i=u,o(u)}function o(u){return u===i?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||W(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===i?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),ne(u)?se(e,o,"whitespace")(u):o(u))}}const Ve={continuation:{tokenize:Uu},exit:Wu,name:"list",tokenize:Vu},Bu={partial:!0,tokenize:Xu},Hu={partial:!0,tokenize:qu};function Vu(e,t,n){const r=this,i=r.events[r.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 p=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:sr(f)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(hn,n,u)(f):u(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(f)}return n(f)}function c(f){return sr(f)&&++a<10?(e.consume(f),c):(!r.interrupt||a<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),u(f)):n(f)}function u(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Kt,r.interrupt?n:h,e.attempt(Bu,m,d))}function h(f){return r.containerState.initialBlankLine=!0,s++,m(f)}function d(f){return ne(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),m):n(f)}function m(f){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function Uu(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Kt,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,se(e,t,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!ne(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Hu,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,se(e,e.attempt(Ve,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function qu(e,t,n){const r=this;return se(e,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(s):n(s)}}function Wu(e){e.exit(this.containerState.type)}function Xu(e,t,n){const r=this;return se(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!ne(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const ui={name:"setextUnderline",resolveTo:Yu,tokenize:Qu};function Yu(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...e[r][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[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function Qu(e,t,n){const r=this;let i;return s;function s(u){let h=r.events.length,d;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){d=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===i?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),ne(u)?se(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||W(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Gu={tokenize:Ju};function Ju(e){const t=this,n=e.attempt(Kt,r,e.attempt(this.parser.constructs.flowInitial,i,se(e,e.attempt(this.parser.constructs.flow,i,e.attempt(nu,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Ku={resolveAll:Es()},Zu=Ns("string"),ec=Ns("text");function Ns(e){return{resolveAll:Es(e==="text"?tc:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,a,o);return a;function a(h){return u(h)?s(h):o(h)}function o(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),c}function c(h){return u(h)?(n.exit("data"),s(h)):(n.consume(h),c)}function u(h){if(h===null)return!0;const d=i[h];let m=-1;if(d)for(;++m<d.length;){const f=d[m];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function Es(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function tc(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,a=-1,o=0,c;for(;s--;){const u=i[s];if(typeof u=="string"){for(a=u.length;u.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(u===-2)c=!0,o++;else if(u!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const u={type:n===e.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const nc={42:Ve,43:Ve,45:Ve,48:Ve,49:Ve,50:Ve,51:Ve,52:Ve,53:Ve,54:Ve,55:Ve,56:Ve,57:Ve,62:bs},rc={91:lu},ic={[-2]:zn,[-1]:zn,32:zn},sc={35:fu,42:hn,45:[ui,hn],60:xu,61:ui,95:hn,96:li,126:li},ac={38:ws,92:ks},lc={[-5]:_n,[-4]:_n,[-3]:_n,33:Ru,38:ws,42:ar,60:[_o,Su],91:_u,92:[du,ks],93:Ir,95:ar,96:Go},oc={null:[ar,Ku]},uc={null:[42,95]},cc={null:[]},dc=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:uc,contentInitial:rc,disable:cc,document:nc,flow:sc,flowInitial:ic,insideSpan:oc,string:ac,text:lc},Symbol.toStringTag,{value:"Module"}));function hc(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],o=[];const c={attempt:M(I),check:M(w),consume:E,enter:j,exit:T,interrupt:M(w,{interrupt:!0})},u={code:null,containerState:{},defineSkip:g,events:[],now:p,parser:e,previous:null,sliceSerialize:m,sliceStream:f,write:d};let h=t.tokenize.call(u,c);return t.resolveAll&&s.push(t),u;function d(F){return a=Je(a,F),C(),a[a.length-1]!==null?[]:(V(t,0),u.events=wn(s,u.events,u),u.events)}function m(F,R){return mc(f(F),R)}function f(F){return fc(a,F)}function p(){const{_bufferIndex:F,_index:R,line:$,column:z,offset:U}=r;return{_bufferIndex:F,_index:R,line:$,column:z,offset:U}}function g(F){i[F.line]=F.column,k()}function C(){let F;for(;r._index<a.length;){const R=a[r._index];if(typeof R=="string")for(F=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===F&&r._bufferIndex<R.length;)b(R.charCodeAt(r._bufferIndex));else b(R)}}function b(F){h=h(F)}function E(F){W(F)?(r.line++,r.column=1,r.offset+=F===-3?2:1,k()):F!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=F}function j(F,R){const $=R||{};return $.type=F,$.start=p(),u.events.push(["enter",$,u]),o.push($),$}function T(F){const R=o.pop();return R.end=p(),u.events.push(["exit",R,u]),R}function I(F,R){V(F,R.from)}function w(F,R){R.restore()}function M(F,R){return $;function $(z,U,O){let X,be,Ne,x;return Array.isArray(z)?De(z):"tokenize"in z?De([z]):ge(z);function ge(pe){return Ke;function Ke(_e){const Ze=_e!==null&&pe[_e],Ye=_e!==null&&pe.null,Ae=[...Array.isArray(Ze)?Ze:Ze?[Ze]:[],...Array.isArray(Ye)?Ye:Ye?[Ye]:[]];return De(Ae)(_e)}}function De(pe){return X=pe,be=0,pe.length===0?O:y(pe[be])}function y(pe){return Ke;function Ke(_e){return x=B(),Ne=pe,pe.partial||(u.currentConstruct=pe),pe.name&&u.parser.constructs.disable.null.includes(pe.name)?ye():pe.tokenize.call(R?Object.assign(Object.create(u),R):u,c,Ee,ye)(_e)}}function Ee(pe){return F(Ne,x),U}function ye(pe){return x.restore(),++be<X.length?y(X[be]):O}}}function V(F,R){F.resolveAll&&!s.includes(F)&&s.push(F),F.resolve&&Xe(u.events,R,u.events.length-R,F.resolve(u.events.slice(R),u)),F.resolveTo&&(u.events=F.resolveTo(u.events,u))}function B(){const F=p(),R=u.previous,$=u.currentConstruct,z=u.events.length,U=Array.from(o);return{from:z,restore:O};function O(){r=F,u.previous=R,u.currentConstruct=$,u.events.length=z,o=U,k()}}function k(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function fc(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,s)];else{if(a=e.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}s>0&&a.push(e[i].slice(0,s))}return a}function mc(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
|
|
3
|
-
`;break}case-3:{a=`\r
|
|
4
|
-
`;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function pc(e){const r={constructs:xs([dc,...(e||{}).extensions||[]]),content:i(Do),defined:[],document:i(Po),flow:i(Gu),lazy:{},string:i(Zu),text:i(ec)};return r;function i(s){return a;function a(o){return hc(r,s,o)}}}function gc(e){for(;!vs(e););return e}const ci=/[\0\t\n\r]/g;function xc(){let e=1,t="",n=!0,r;return i;function i(s,a,o){const c=[];let u,h,d,m,f;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),d=0,t="",n&&(s.charCodeAt(0)===65279&&d++,n=void 0);d<s.length;){if(ci.lastIndex=d,u=ci.exec(s),m=u&&u.index!==void 0?u.index:s.length,f=s.charCodeAt(m),!u){t=s.slice(d);break}if(f===10&&d===m&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),d<m&&(c.push(s.slice(d,m)),e+=m-d),f){case 0:{c.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,c.push(-2);e++<h;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}d=m+1}return o&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const yc=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function bc(e){return e.replace(yc,kc)}function kc(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return ys(n.slice(s?2:1),s?16:10)}return Tr(n)||e}const Ts={}.hasOwnProperty;function wc(e,t,n){return typeof t!="string"&&(n=t,t=void 0),vc(n)(gc(pc(n).document().write(xc()(e,t,!0))))}function vc(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Te),autolinkProtocol:B,autolinkEmail:B,atxHeading:s(re),blockQuote:s(Ye),characterEscape:B,characterReference:B,codeFenced:s(Ae),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(Ae,a),codeText:s(dt,a),codeTextData:B,data:B,codeFlowValue:B,definition:s(D),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(H),hardBreakEscape:s(ie),hardBreakTrailing:s(ie),htmlFlow:s(Y,a),htmlFlowData:B,htmlText:s(Y,a),htmlTextData:B,image:s(Z),label:a,link:s(Te),listItem:s(Oe),listItemValue:m,listOrdered:s(st,d),listUnordered:s(st),paragraph:s(gt),reference:y,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(re),strong:s(Se),thematicBreak:s(en)},exit:{atxHeading:c(),atxHeadingSequence:I,autolink:c(),autolinkEmail:Ze,autolinkProtocol:_e,blockQuote:c(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:ye,characterReferenceMarkerNumeric:ye,characterReferenceValue:pe,characterReference:Ke,codeFenced:c(C),codeFencedFence:g,codeFencedFenceInfo:f,codeFencedFenceMeta:p,codeFlowValue:k,codeIndented:c(b),codeText:c(U),codeTextData:k,data:k,definition:c(),definitionDestinationString:T,definitionLabelString:E,definitionTitleString:j,emphasis:c(),hardBreakEscape:c(R),hardBreakTrailing:c(R),htmlFlow:c($),htmlFlowData:k,htmlText:c(z),htmlTextData:k,image:c(X),label:Ne,labelText:be,lineEnding:F,link:c(O),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Ee,resourceDestinationString:x,resourceTitleString:ge,resource:De,setextHeading:c(V),setextHeadingLineSequence:M,setextHeadingText:w,strong:c(),thematicBreak:c()}};Is(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(N){let P={type:"root",children:[]};const G={stack:[P],tokenStack:[],config:t,enter:o,exit:u,buffer:a,resume:h,data:n},te=[];let le=-1;for(;++le<N.length;)if(N[le][1].type==="listOrdered"||N[le][1].type==="listUnordered")if(N[le][0]==="enter")te.push(le);else{const $e=te.pop();le=i(N,$e,le)}for(le=-1;++le<N.length;){const $e=t[N[le][0]];Ts.call($e,N[le][1].type)&&$e[N[le][1].type].call(Object.assign({sliceSerialize:N[le][2].sliceSerialize},G),N[le][1])}if(G.tokenStack.length>0){const $e=G.tokenStack[G.tokenStack.length-1];($e[1]||di).call(G,void 0,$e[0])}for(P.position={start:ft(N.length>0?N[0][1].start:{line:1,column:1,offset:0}),end:ft(N.length>0?N[N.length-2][1].end:{line:1,column:1,offset:0})},le=-1;++le<t.transforms.length;)P=t.transforms[le](P)||P;return P}function i(N,P,G){let te=P-1,le=-1,$e=!1,Be,Qe,He,at;for(;++te<=G;){const de=N[te];switch(de[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{de[0]==="enter"?le++:le--,at=void 0;break}case"lineEndingBlank":{de[0]==="enter"&&(Be&&!at&&!le&&!He&&(He=te),at=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:at=void 0}if(!le&&de[0]==="enter"&&de[1].type==="listItemPrefix"||le===-1&&de[0]==="exit"&&(de[1].type==="listUnordered"||de[1].type==="listOrdered")){if(Be){let K=te;for(Qe=void 0;K--;){const xe=N[K];if(xe[1].type==="lineEnding"||xe[1].type==="lineEndingBlank"){if(xe[0]==="exit")continue;Qe&&(N[Qe][1].type="lineEndingBlank",$e=!0),xe[1].type="lineEnding",Qe=K}else if(!(xe[1].type==="linePrefix"||xe[1].type==="blockQuotePrefix"||xe[1].type==="blockQuotePrefixWhitespace"||xe[1].type==="blockQuoteMarker"||xe[1].type==="listItemIndent"))break}He&&(!Qe||He<Qe)&&(Be._spread=!0),Be.end=Object.assign({},Qe?N[Qe][1].start:de[1].end),N.splice(Qe||te,0,["exit",Be,de[2]]),te++,G++}if(de[1].type==="listItemPrefix"){const K={type:"listItem",_spread:!1,start:Object.assign({},de[1].start),end:void 0};Be=K,N.splice(te,0,["enter",K,de[2]]),te++,G++,He=void 0,at=!0}}}return N[P][1]._spread=$e,G}function s(N,P){return G;function G(te){o.call(this,N(te),te),P&&P.call(this,te)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(N,P,G){this.stack[this.stack.length-1].children.push(N),this.stack.push(N),this.tokenStack.push([P,G||void 0]),N.position={start:ft(P.start),end:void 0}}function c(N){return P;function P(G){N&&N.call(this,G),u.call(this,G)}}function u(N,P){const G=this.stack.pop(),te=this.tokenStack.pop();if(te)te[0].type!==N.type&&(P?P.call(this,N,te[0]):(te[1]||di).call(this,N,te[0]));else throw new Error("Cannot close `"+N.type+"` ("+Bt({start:N.start,end:N.end})+"): it’s not open");G.position.end=ft(N.end)}function h(){return Er(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function m(N){if(this.data.expectingFirstListItemValue){const P=this.stack[this.stack.length-2];P.start=Number.parseInt(this.sliceSerialize(N),10),this.data.expectingFirstListItemValue=void 0}}function f(){const N=this.resume(),P=this.stack[this.stack.length-1];P.lang=N}function p(){const N=this.resume(),P=this.stack[this.stack.length-1];P.meta=N}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const N=this.resume(),P=this.stack[this.stack.length-1];P.value=N.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const N=this.resume(),P=this.stack[this.stack.length-1];P.value=N.replace(/(\r?\n|\r)$/g,"")}function E(N){const P=this.resume(),G=this.stack[this.stack.length-1];G.label=P,G.identifier=tt(this.sliceSerialize(N)).toLowerCase()}function j(){const N=this.resume(),P=this.stack[this.stack.length-1];P.title=N}function T(){const N=this.resume(),P=this.stack[this.stack.length-1];P.url=N}function I(N){const P=this.stack[this.stack.length-1];if(!P.depth){const G=this.sliceSerialize(N).length;P.depth=G}}function w(){this.data.setextHeadingSlurpLineEnding=!0}function M(N){const P=this.stack[this.stack.length-1];P.depth=this.sliceSerialize(N).codePointAt(0)===61?1:2}function V(){this.data.setextHeadingSlurpLineEnding=void 0}function B(N){const G=this.stack[this.stack.length-1].children;let te=G[G.length-1];(!te||te.type!=="text")&&(te=xt(),te.position={start:ft(N.start),end:void 0},G.push(te)),this.stack.push(te)}function k(N){const P=this.stack.pop();P.value+=this.sliceSerialize(N),P.position.end=ft(N.end)}function F(N){const P=this.stack[this.stack.length-1];if(this.data.atHardBreak){const G=P.children[P.children.length-1];G.position.end=ft(N.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(P.type)&&(B.call(this,N),k.call(this,N))}function R(){this.data.atHardBreak=!0}function $(){const N=this.resume(),P=this.stack[this.stack.length-1];P.value=N}function z(){const N=this.resume(),P=this.stack[this.stack.length-1];P.value=N}function U(){const N=this.resume(),P=this.stack[this.stack.length-1];P.value=N}function O(){const N=this.stack[this.stack.length-1];if(this.data.inReference){const P=this.data.referenceType||"shortcut";N.type+="Reference",N.referenceType=P,delete N.url,delete N.title}else delete N.identifier,delete N.label;this.data.referenceType=void 0}function X(){const N=this.stack[this.stack.length-1];if(this.data.inReference){const P=this.data.referenceType||"shortcut";N.type+="Reference",N.referenceType=P,delete N.url,delete N.title}else delete N.identifier,delete N.label;this.data.referenceType=void 0}function be(N){const P=this.sliceSerialize(N),G=this.stack[this.stack.length-2];G.label=bc(P),G.identifier=tt(P).toLowerCase()}function Ne(){const N=this.stack[this.stack.length-1],P=this.resume(),G=this.stack[this.stack.length-1];if(this.data.inReference=!0,G.type==="link"){const te=N.children;G.children=te}else G.alt=P}function x(){const N=this.resume(),P=this.stack[this.stack.length-1];P.url=N}function ge(){const N=this.resume(),P=this.stack[this.stack.length-1];P.title=N}function De(){this.data.inReference=void 0}function y(){this.data.referenceType="collapsed"}function Ee(N){const P=this.resume(),G=this.stack[this.stack.length-1];G.label=P,G.identifier=tt(this.sliceSerialize(N)).toLowerCase(),this.data.referenceType="full"}function ye(N){this.data.characterReferenceType=N.type}function pe(N){const P=this.sliceSerialize(N),G=this.data.characterReferenceType;let te;G?(te=ys(P,G==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):te=Tr(P);const le=this.stack[this.stack.length-1];le.value+=te}function Ke(N){const P=this.stack.pop();P.position.end=ft(N.end)}function _e(N){k.call(this,N);const P=this.stack[this.stack.length-1];P.url=this.sliceSerialize(N)}function Ze(N){k.call(this,N);const P=this.stack[this.stack.length-1];P.url="mailto:"+this.sliceSerialize(N)}function Ye(){return{type:"blockquote",children:[]}}function Ae(){return{type:"code",lang:null,meta:null,value:""}}function dt(){return{type:"inlineCode",value:""}}function D(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function H(){return{type:"emphasis",children:[]}}function re(){return{type:"heading",depth:0,children:[]}}function ie(){return{type:"break"}}function Y(){return{type:"html",value:""}}function Z(){return{type:"image",title:null,url:"",alt:null}}function Te(){return{type:"link",title:null,url:"",children:[]}}function st(N){return{type:"list",ordered:N.type==="listOrdered",start:null,spread:N._spread,children:[]}}function Oe(N){return{type:"listItem",spread:N._spread,checked:null,children:[]}}function gt(){return{type:"paragraph",children:[]}}function Se(){return{type:"strong",children:[]}}function xt(){return{type:"text",value:""}}function en(){return{type:"thematicBreak"}}}function ft(e){return{line:e.line,column:e.column,offset:e.offset}}function Is(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Is(e,r):Cc(e,r)}}function Cc(e,t){let n;for(n in t)if(Ts.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function di(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Bt({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Bt({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Bt({start:t.start,end:t.end})+") is still open")}function Sc(e){const t=this;t.parser=n;function n(r){return wc(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function jc(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Nc(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
5
|
-
`}]}function Ec(e,t){const n=t.value?t.value+`
|
|
6
|
-
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};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 Tc(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ic(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Dc(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Pt(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=s+1,o+=1,e.footnoteCounts.set(r,o);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function Ac(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Pc(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Ds(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),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+=r:i.push({type:"text",value:r}),i}function Lc(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ds(e,t);const i={src:Pt(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function Mc(e,t){const n={src:Pt(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Rc(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function zc(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ds(e,t);const i={href:Pt(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function _c(e,t){const n={href:Pt(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Fc(e,t,n){const r=e.all(t),i=n?Oc(n):As(t),s={},a=[];if(typeof t.checked=="boolean"){const h=r[0];let d;h&&h.type==="element"&&h.tagName==="p"?d=h:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.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<r.length;){const h=r[o];(i||o!==0||h.type!=="element"||h.tagName!=="p")&&a.push({type:"text",value:`
|
|
7
|
-
`}),h.type==="element"&&h.tagName==="p"&&!i?a.push(...h.children):a.push(h)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&a.push({type:"text",value:`
|
|
8
|
-
`});const u={type:"element",tagName:"li",properties:s,children:a};return e.patch(t,u),e.applyData(t,u)}function Oc(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=As(n[r])}return t}function As(e){const t=e.spread;return t??e.children.length>1}function $c(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function Bc(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Hc(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Vc(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Uc(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=Cr(t.children[1]),c=cs(t.children[t.children.length-1]);o&&c&&(a.position={start:o,end:c}),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 qc(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:t.children.length;let c=-1;const u=[];for(;++c<o;){const d=t.children[c],m={},f=a?a[c]:void 0;f&&(m.align=f);let p={type:"element",tagName:s,properties:m,children:[]};d&&(p.children=e.all(d),e.patch(d,p),p=e.applyData(d,p)),u.push(p)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,h),e.applyData(t,h)}function Wc(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const hi=9,fi=32;function Xc(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(mi(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(mi(t.slice(i),i>0,!1)),s.join("")}function mi(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===hi||s===fi;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===hi||s===fi;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Yc(e,t){const n={type:"text",value:Xc(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Qc(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Gc={blockquote:jc,break:Nc,code:Ec,delete:Tc,emphasis:Ic,footnoteReference:Dc,heading:Ac,html:Pc,imageReference:Lc,image:Mc,inlineCode:Rc,linkReference:zc,link:_c,listItem:Fc,list:$c,paragraph:Bc,root:Hc,strong:Vc,table:Uc,tableCell:Wc,tableRow:qc,text:Yc,thematicBreak:Qc,toml:an,yaml:an,definition:an,footnoteDefinition:an};function an(){}const Ps=-1,vn=0,Vt=1,gn=2,Dr=3,Ar=4,Pr=5,Lr=6,Ls=7,Ms=8,pi=typeof self=="object"?self:globalThis,Jc=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,a]=t[i];switch(s){case vn:case Ps:return n(a,i);case Vt:{const o=n([],i);for(const c of a)o.push(r(c));return o}case gn:{const o=n({},i);for(const[c,u]of a)o[r(c)]=r(u);return o}case Dr:return n(new Date(a),i);case Ar:{const{source:o,flags:c}=a;return n(new RegExp(o,c),i)}case Pr:{const o=n(new Map,i);for(const[c,u]of a)o.set(r(c),r(u));return o}case Lr:{const o=n(new Set,i);for(const c of a)o.add(r(c));return o}case Ls:{const{name:o,message:c}=a;return n(new pi[o](c),i)}case Ms:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}}return n(new pi[s](a),i)};return r},gi=e=>Jc(new Map,e)(0),St="",{toString:Kc}={},{keys:Zc}=Object,Ft=e=>{const t=typeof e;if(t!=="object"||!e)return[vn,t];const n=Kc.call(e).slice(8,-1);switch(n){case"Array":return[Vt,St];case"Object":return[gn,St];case"Date":return[Dr,St];case"RegExp":return[Ar,St];case"Map":return[Pr,St];case"Set":return[Lr,St];case"DataView":return[Vt,n]}return n.includes("Array")?[Vt,n]:n.includes("Error")?[Ls,n]:[gn,n]},ln=([e,t])=>e===vn&&(t==="function"||t==="symbol"),ed=(e,t,n,r)=>{const i=(a,o)=>{const c=r.push(a)-1;return n.set(o,c),c},s=a=>{if(n.has(a))return n.get(a);let[o,c]=Ft(a);switch(o){case vn:{let h=a;switch(c){case"bigint":o=Ms,h=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);h=null;break;case"undefined":return i([Ps],a)}return i([o,h],a)}case Vt:{if(c){let m=a;return c==="DataView"?m=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(m=new Uint8Array(a)),i([c,[...m]],a)}const h=[],d=i([o,h],a);for(const m of a)h.push(s(m));return d}case gn:{if(c)switch(c){case"BigInt":return i([c,a.toString()],a);case"Boolean":case"Number":case"String":return i([c,a.valueOf()],a)}if(t&&"toJSON"in a)return s(a.toJSON());const h=[],d=i([o,h],a);for(const m of Zc(a))(e||!ln(Ft(a[m])))&&h.push([s(m),s(a[m])]);return d}case Dr:return i([o,a.toISOString()],a);case Ar:{const{source:h,flags:d}=a;return i([o,{source:h,flags:d}],a)}case Pr:{const h=[],d=i([o,h],a);for(const[m,f]of a)(e||!(ln(Ft(m))||ln(Ft(f))))&&h.push([s(m),s(f)]);return d}case Lr:{const h=[],d=i([o,h],a);for(const m of a)(e||!ln(Ft(m)))&&h.push(s(m));return d}}const{message:u}=a;return i([o,{name:c,message:u}],a)};return s},xi=(e,{json:t,lossy:n}={})=>{const r=[];return ed(!(t||n),!!t,new Map,r)(e),r},xn=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?gi(xi(e,t)):structuredClone(e):(e,t)=>gi(xi(e,t));function td(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function nd(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function rd(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||td,r=e.options.footnoteBackLabel||nd,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[c]);if(!u)continue;const h=e.all(u),d=String(u.identifier).toUpperCase(),m=Pt(d.toLowerCase());let f=0;const p=[],g=e.footnoteCounts.get(d);for(;g!==void 0&&++f<=g;){p.length>0&&p.push({type:"text",value:" "});let E=typeof n=="string"?n:n(c,f);typeof E=="string"&&(E={type:"text",value:E}),p.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,f),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const C=h[h.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const E=C.children[C.children.length-1];E&&E.type==="text"?E.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...p)}else h.push(...p);const b={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(h,!0)};e.patch(u,b),o.push(b)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...xn(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
9
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
|
|
10
|
-
`}]}}const Cn=(function(e){if(e==null)return ld;if(typeof e=="function")return Sn(e);if(typeof e=="object")return Array.isArray(e)?id(e):sd(e);if(typeof e=="string")return ad(e);throw new Error("Expected function, string, or object as test")});function id(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Cn(e[n]);return Sn(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function sd(e){const t=e;return Sn(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function ad(e){return Sn(t);function t(n){return n&&n.type===e}}function Sn(e){return t;function t(n,r,i){return!!(od(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function ld(){return!0}function od(e){return e!==null&&typeof e=="object"&&"type"in e}const Rs=[],ud=!0,lr=!1,cd="skip";function zs(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=Cn(i),a=r?-1:1;o(e,void 0,[])();function o(c,u,h){const d=c&&typeof c=="object"?c:{};if(typeof d.type=="string"){const f=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(c.type+(f?"<"+f+">":""))+")"})}return m;function m(){let f=Rs,p,g,C;if((!t||s(c,u,h[h.length-1]||void 0))&&(f=dd(n(c,h)),f[0]===lr))return f;if("children"in c&&c.children){const b=c;if(b.children&&f[0]!==cd)for(g=(r?b.children.length:-1)+a,C=h.concat(b);g>-1&&g<b.children.length;){const E=b.children[g];if(p=o(E,g,C)(),p[0]===lr)return p;g=typeof p[1]=="number"?p[1]:g+a}}return f}}}function dd(e){return Array.isArray(e)?e:typeof e=="number"?[ud,e]:e==null?Rs:[e]}function Mr(e,t,n,r){let i,s,a;typeof t=="function"&&typeof n!="function"?(s=void 0,a=t,i=n):(s=t,a=n,i=r),zs(e,s,o,i);function o(c,u){const h=u[u.length-1],d=h?h.children.indexOf(c):void 0;return a(c,d,h)}}const or={}.hasOwnProperty,hd={};function fd(e,t){const n=t||hd,r=new Map,i=new Map,s=new Map,a={...Gc,...n.handlers},o={all:u,applyData:pd,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:c,options:n,patch:md,wrap:xd};return Mr(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const d=h.type==="definition"?r:i,m=String(h.identifier).toUpperCase();d.has(m)||d.set(m,h)}}),o;function c(h,d){const m=h.type,f=o.handlers[m];if(or.call(o.handlers,m)&&f)return f(o,h,d);if(o.options.passThrough&&o.options.passThrough.includes(m)){if("children"in h){const{children:g,...C}=h,b=xn(C);return b.children=o.all(h),b}return xn(h)}return(o.options.unknownHandler||gd)(o,h,d)}function u(h){const d=[];if("children"in h){const m=h.children;let f=-1;for(;++f<m.length;){const p=o.one(m[f],h);if(p){if(f&&m[f-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=yi(p.value)),!Array.isArray(p)&&p.type==="element")){const g=p.children[0];g&&g.type==="text"&&(g.value=yi(g.value))}Array.isArray(p)?d.push(...p):d.push(p)}}}return d}}function md(e,t){e.position&&(t.position=to(e))}function pd(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&s&&Object.assign(n.properties,xn(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function gd(e,t){const n=t.data||{},r="value"in t&&!(or.call(n,"hProperties")||or.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function xd(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
11
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
12
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
13
|
-
`}),n}function yi(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function bi(e,t){const n=fd(e,t),r=n.one(e,void 0),i=rd(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
|
|
14
|
-
`},i),s}function yd(e,t){return e&&"run"in e?async function(n,r){const i=bi(n,{file:r,...t});await e.run(i,r)}:function(n,r){return bi(n,{file:r,...e||t})}}function ki(e){if(e)throw e}var Fn,wi;function bd(){if(wi)return Fn;wi=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):t.call(u)==="[object Array]"},s=function(u){if(!u||t.call(u)!=="[object Object]")return!1;var h=e.call(u,"constructor"),d=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!h&&!d)return!1;var m;for(m in u);return typeof m>"u"||e.call(u,m)},a=function(u,h){n&&h.name==="__proto__"?n(u,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):u[h.name]=h.newValue},o=function(u,h){if(h==="__proto__")if(e.call(u,h)){if(r)return r(u,h).value}else return;return u[h]};return Fn=function c(){var u,h,d,m,f,p,g=arguments[0],C=1,b=arguments.length,E=!1;for(typeof g=="boolean"&&(E=g,g=arguments[1]||{},C=2),(g==null||typeof g!="object"&&typeof g!="function")&&(g={});C<b;++C)if(u=arguments[C],u!=null)for(h in u)d=o(g,h),m=o(u,h),g!==m&&(E&&m&&(s(m)||(f=i(m)))?(f?(f=!1,p=d&&i(d)?d:[]):p=d&&s(d)?d:{},a(g,{name:h,newValue:c(E,p,m)})):typeof m<"u"&&a(g,{name:h,newValue:m}));return g},Fn}var kd=bd();const On=Qi(kd);function ur(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 wd(){const e=[],t={run:n,use:r};return t;function n(...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(c,...u){const h=e[++s];let d=-1;if(c){a(c);return}for(;++d<i.length;)(u[d]===null||u[d]===void 0)&&(u[d]=i[d]);i=u,h?vd(h,o)(...u):a(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function vd(e,t){let n;return r;function r(...a){const o=e.length>a.length;let c;o&&a.push(i);try{c=e.apply(this,a)}catch(u){const h=u;if(o&&n)throw h;return i(h)}o||(c&&c.then&&typeof c.then=="function"?c.then(s,i):c instanceof Error?i(c):s(c))}function i(a,...o){n||(n=!0,t(a,...o))}function s(a){i(null,a)}}const nt={basename:Cd,dirname:Sd,extname:jd,join:Nd,sep:"/"};function Cd(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Zt(e);let n=0,r=-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){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function Sd(e){if(Zt(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function jd(e){Zt(e);let t=e.length,n=-1,r=0,i=-1,s=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Nd(...e){let t=-1,n;for(;++t<e.length;)Zt(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Ed(n)}function Ed(e){Zt(e);const t=e.codePointAt(0)===47;let n=Td(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Td(e,t){let n="",r=0,i=-1,s=0,a=-1,o,c;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(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,s=0}else o===46&&s>-1?s++:s=-1}return n}function Zt(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Id={cwd:Dd};function Dd(){return"/"}function cr(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Ad(e){if(typeof e=="string")e=new URL(e);else if(!cr(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 Pd(e)}function Pd(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const $n=["history","path","basename","stem","extname","dirname"];class _s{constructor(t){let n;t?cr(t)?n={path:t}:typeof t=="string"||Ld(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Id.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<$n.length;){const s=$n[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)$n.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?nt.basename(this.path):void 0}set basename(t){Hn(t,"basename"),Bn(t,"basename"),this.path=nt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?nt.dirname(this.path):void 0}set dirname(t){vi(this.basename,"dirname"),this.path=nt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?nt.extname(this.path):void 0}set extname(t){if(Bn(t,"extname"),vi(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=nt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){cr(t)&&(t=Ad(t)),Hn(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?nt.basename(this.path,this.extname):void 0}set stem(t){Hn(t,"stem"),Bn(t,"stem"),this.path=nt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new ze(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Bn(e,t){if(e&&e.includes(nt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+nt.sep+"`")}function Hn(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function vi(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Ld(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Md=(function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),Rd={}.hasOwnProperty;class Rr extends Md{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=wd()}copy(){const t=new Rr;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(On(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(qn("data",this.frozen),this.namespace[t]=n,this):Rd.call(this.namespace,t)&&this.namespace[t]||void 0:t?(qn("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=on(t),r=this.parser||this.Parser;return Vn("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Vn("process",this.parser||this.Parser),Un("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const o=on(t),c=r.parse(o);r.run(c,o,function(h,d,m){if(h||!d||!m)return u(h);const f=d,p=r.stringify(f,m);Fd(p)?m.value=p:m.result=p,u(h,m)});function u(h,d){h||!d?a(h):s?s(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Vn("processSync",this.parser||this.Parser),Un("processSync",this.compiler||this.Compiler),this.process(t,i),Si("processSync","process",n),r;function i(s,a){n=!0,ki(s),r=a}}run(t,n,r){Ci(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,o){const c=on(n);i.run(t,c,u);function u(h,d,m){const f=d||t;h?o(h):a?a(f):r(void 0,f,m)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),Si("runSync","run",r),i;function s(a,o){ki(a),i=o,r=!0}}stringify(t,n){this.freeze();const r=on(n),i=this.compiler||this.Compiler;return Un("stringify",i),Ci(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(qn("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);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(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[h,...d]=u;c(h,d)}else a(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function a(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(u.plugins),u.settings&&(i.settings=On(!0,i.settings,u.settings))}function o(u){let h=-1;if(u!=null)if(Array.isArray(u))for(;++h<u.length;){const d=u[h];s(d)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,h){let d=-1,m=-1;for(;++d<r.length;)if(r[d][0]===u){m=d;break}if(m===-1)r.push([u,...h]);else if(h.length>0){let[f,...p]=h;const g=r[m][1];ur(g)&&ur(f)&&(f=On(!0,g,f)),r[m]=[u,f,...p]}}}}const zd=new Rr().freeze();function Vn(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Un(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function qn(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 Ci(e){if(!ur(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Si(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function on(e){return _d(e)?e:new _s(e)}function _d(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Fd(e){return typeof e=="string"||Od(e)}function Od(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const $d="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",ji=[],Ni={allowDangerousHtml:!0},Bd=/^(https?|ircs?|mailto|xmpp)$/i,Hd=[{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 Fs(e){const t=Vd(e),n=Ud(e);return qd(t.runSync(t.parse(n),n),e)}function Vd(e){const t=e.rehypePlugins||ji,n=e.remarkPlugins||ji,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ni}:Ni;return zd().use(Sc).use(n).use(yd,r).use(t)}function Ud(e){const t=e.children||"",n=new _s;return typeof t=="string"&&(n.value=t),n}function qd(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,a=t.skipHtml,o=t.unwrapDisallowed,c=t.urlTransform||Wd;for(const h of Hd)Object.hasOwn(t,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+$d+h.id,void 0);return Mr(e,u),ao(e,{Fragment:l.Fragment,components:i,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function u(h,d,m){if(h.type==="raw"&&m&&typeof d=="number")return a?m.children.splice(d,1):m.children[d]={type:"text",value:h.value},d;if(h.type==="element"){let f;for(f in Rn)if(Object.hasOwn(Rn,f)&&Object.hasOwn(h.properties,f)){const p=h.properties[f],g=Rn[f];(g===null||g.includes(h.tagName))&&(h.properties[f]=c(String(p||""),f,h))}}if(h.type==="element"){let f=n?!n.includes(h.tagName):s?s.includes(h.tagName):!1;if(!f&&r&&typeof d=="number"&&(f=!r(h,d,m)),f&&m&&typeof d=="number")return o&&h.children?m.children.splice(d,1,...h.children):m.children.splice(d,1),d}}}function Wd(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Bd.test(e.slice(0,t))?e:""}function Ei(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Xd(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Yd(e,t,n){const i=Cn((n||{}).ignore||[]),s=Qd(t);let a=-1;for(;++a<s.length;)zs(e,"text",o);function o(u,h){let d=-1,m;for(;++d<h.length;){const f=h[d],p=m?m.children:void 0;if(i(f,p?p.indexOf(f):void 0,m))return;m=f}if(m)return c(u,h)}function c(u,h){const d=h[h.length-1],m=s[a][0],f=s[a][1];let p=0;const C=d.children.indexOf(u);let b=!1,E=[];m.lastIndex=0;let j=m.exec(u.value);for(;j;){const T=j.index,I={index:j.index,input:j.input,stack:[...h,u]};let w=f(...j,I);if(typeof w=="string"&&(w=w.length>0?{type:"text",value:w}:void 0),w===!1?m.lastIndex=T+1:(p!==T&&E.push({type:"text",value:u.value.slice(p,T)}),Array.isArray(w)?E.push(...w):w&&E.push(w),p=T+j[0].length,b=!0),!m.global)break;j=m.exec(u.value)}return b?(p<u.value.length&&E.push({type:"text",value:u.value.slice(p)}),d.children.splice(C,1,...E)):E=[u],C+E.length}}function Qd(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([Gd(i[0]),Jd(i[1])])}return t}function Gd(e){return typeof e=="string"?new RegExp(Xd(e),"g"):e}function Jd(e){return typeof e=="function"?e:function(){return e}}const Wn="phrasing",Xn=["autolink","link","image","label"];function Kd(){return{transforms:[sh],enter:{literalAutolink:eh,literalAutolinkEmail:Yn,literalAutolinkHttp:Yn,literalAutolinkWww:Yn},exit:{literalAutolink:ih,literalAutolinkEmail:rh,literalAutolinkHttp:th,literalAutolinkWww:nh}}}function Zd(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Wn,notInConstruct:Xn},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Wn,notInConstruct:Xn},{character:":",before:"[ps]",after:"\\/",inConstruct:Wn,notInConstruct:Xn}]}}function eh(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Yn(e){this.config.enter.autolinkProtocol.call(this,e)}function th(e){this.config.exit.autolinkProtocol.call(this,e)}function nh(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 rh(e){this.config.exit.autolinkEmail.call(this,e)}function ih(e){this.exit(e)}function sh(e){Yd(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,ah],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),lh]],{ignore:["link","linkReference"]})}function ah(e,t,n,r,i){let s="";if(!Os(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!oh(n)))return!1;const a=uh(n+r);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 lh(e,t,n,r){return!Os(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function oh(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 uh(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Ei(e,"(");let s=Ei(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function Os(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||bt(n)||kn(n))&&(!t||n!==47)}$s.peek=yh;function ch(){this.buffer()}function dh(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function hh(){this.buffer()}function fh(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function mh(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=tt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ph(e){this.exit(e)}function gh(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=tt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function xh(e){this.exit(e)}function yh(){return"["}function $s(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),o(),a(),s+=i.move("]"),s}function bh(){return{enter:{gfmFootnoteCallString:ch,gfmFootnoteCall:dh,gfmFootnoteDefinitionLabelString:hh,gfmFootnoteDefinition:fh},exit:{gfmFootnoteCallString:mh,gfmFootnoteCall:ph,gfmFootnoteDefinitionLabelString:gh,gfmFootnoteDefinition:xh}}}function kh(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:$s},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,a){const o=s.createTracker(a);let c=o.move("[^");const u=s.enter("footnoteDefinition"),h=s.enter("label");return c+=o.move(s.safe(s.associationId(r),{before:c,after:"]"})),h(),c+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),c+=o.move((t?`
|
|
15
|
-
`:" ")+s.indentLines(s.containerFlow(r,o.current()),t?Bs:wh))),u(),c}}function wh(e,t,n){return t===0?e:Bs(e,t,n)}function Bs(e,t,n){return(n?"":" ")+e}const vh=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Hs.peek=Eh;function Ch(){return{canContainEols:["delete"],enter:{strikethrough:jh},exit:{strikethrough:Nh}}}function Sh(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:vh}],handlers:{delete:Hs}}}function jh(e){this.enter({type:"delete",children:[]},e)}function Nh(e){this.exit(e)}function Hs(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),s(),a}function Eh(){return"~"}function Th(e){return e.length}function Ih(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Th,s=[],a=[],o=[],c=[];let u=0,h=-1;for(;++h<e.length;){const g=[],C=[];let b=-1;for(e[h].length>u&&(u=e[h].length);++b<e[h].length;){const E=Dh(e[h][b]);if(n.alignDelimiters!==!1){const j=i(E);C[b]=j,(c[b]===void 0||j>c[b])&&(c[b]=j)}g.push(E)}a[h]=g,o[h]=C}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<u;)s[d]=Ti(r[d]);else{const g=Ti(r);for(;++d<u;)s[d]=g}d=-1;const m=[],f=[];for(;++d<u;){const g=s[d];let C="",b="";g===99?(C=":",b=":"):g===108?C=":":g===114&&(b=":");let E=n.alignDelimiters===!1?1:Math.max(1,c[d]-C.length-b.length);const j=C+"-".repeat(E)+b;n.alignDelimiters!==!1&&(E=C.length+E+b.length,E>c[d]&&(c[d]=E),f[d]=E),m[d]=j}a.splice(1,0,m),o.splice(1,0,f),h=-1;const p=[];for(;++h<a.length;){const g=a[h],C=o[h];d=-1;const b=[];for(;++d<u;){const E=g[d]||"";let j="",T="";if(n.alignDelimiters!==!1){const I=c[d]-(C[d]||0),w=s[d];w===114?j=" ".repeat(I):w===99?I%2?(j=" ".repeat(I/2+.5),T=" ".repeat(I/2-.5)):(j=" ".repeat(I/2),T=j):T=" ".repeat(I)}n.delimiterStart!==!1&&!d&&b.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&E==="")&&(n.delimiterStart!==!1||d)&&b.push(" "),n.alignDelimiters!==!1&&b.push(j),b.push(E),n.alignDelimiters!==!1&&b.push(T),n.padding!==!1&&b.push(" "),(n.delimiterEnd!==!1||d!==u-1)&&b.push("|")}p.push(n.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return p.join(`
|
|
16
|
-
`)}function Dh(e){return e==null?"":String(e)}function Ti(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 Ah(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const a=n.indentLines(n.containerFlow(e,s.current()),Ph);return i(),a}function Ph(e,t,n){return">"+(n?"":" ")+e}function Lh(e,t){return Ii(e,t.inConstruct,!0)&&!Ii(e,t.notInConstruct,!1)}function Ii(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Di(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
17
|
-
`&&Lh(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
18
|
-
`}function Mh(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>a&&(a=s):s=1,i=r+t.length,r=n.indexOf(t,i);return a}function Rh(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 zh(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 _h(e,t,n,r){const i=zh(n),s=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(Rh(e,n)){const d=n.enter("codeIndented"),m=n.indentLines(s,Fh);return d(),m}const o=n.createTracker(r),c=i.repeat(Math.max(Mh(s,i)+1,3)),u=n.enter("codeFenced");let h=o.move(c);if(e.lang){const d=n.enter(`codeFencedLang${a}`);h+=o.move(n.safe(e.lang,{before:h,after:" ",encode:["`"],...o.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${a}`);h+=o.move(" "),h+=o.move(n.safe(e.meta,{before:h,after:`
|
|
19
|
-
`,encode:["`"],...o.current()})),d()}return h+=o.move(`
|
|
20
|
-
`),s&&(h+=o.move(s+`
|
|
21
|
-
`)),h+=o.move(c),u(),h}function Fh(e,t,n){return(n?"":" ")+e}function zr(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 Oh(e,t,n,r){const i=zr(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const c=n.createTracker(r);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":`
|
|
22
|
-
`,...c.current()}))),o(),e.title&&(o=n.enter(`title${s}`),u+=c.move(" "+i),u+=c.move(n.safe(e.title,{before:u,after:i,...c.current()})),u+=c.move(i),o()),a(),u}function $h(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 Xt(e){return"&#x"+e.toString(16).toUpperCase()+";"}function yn(e,t,n){const r=Dt(e),i=Dt(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Vs.peek=Bh;function Vs(e,t,n,r){const i=$h(n),s=n.enter("emphasis"),a=n.createTracker(r),o=a.move(i);let c=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const u=c.charCodeAt(0),h=yn(r.before.charCodeAt(r.before.length-1),u,i);h.inside&&(c=Xt(u)+c.slice(1));const d=c.charCodeAt(c.length-1),m=yn(r.after.charCodeAt(0),d,i);m.inside&&(c=c.slice(0,-1)+Xt(d));const f=a.move(i);return s(),n.attentionEncodeSurroundingInfo={after:m.outside,before:h.outside},o+c+f}function Bh(e,t,n){return n.options.emphasis||"*"}function Hh(e,t){let n=!1;return Mr(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,lr}),!!((!e.depth||e.depth<3)&&Er(e)&&(t.options.setext||n))}function Vh(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(Hh(e,n)){const h=n.enter("headingSetext"),d=n.enter("phrasing"),m=n.containerPhrasing(e,{...s.current(),before:`
|
|
23
|
-
`,after:`
|
|
24
|
-
`});return d(),h(),m+`
|
|
25
|
-
`+(i===1?"=":"-").repeat(m.length-(Math.max(m.lastIndexOf("\r"),m.lastIndexOf(`
|
|
26
|
-
`))+1))}const a="#".repeat(i),o=n.enter("headingAtx"),c=n.enter("phrasing");s.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
|
|
27
|
-
`,...s.current()});return/^[\t ]/.test(u)&&(u=Xt(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),c(),o(),u}Us.peek=Uh;function Us(e){return e.value||""}function Uh(){return"<"}qs.peek=qh;function qs(e,t,n,r){const i=zr(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const c=n.createTracker(r);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),o(),e.title&&(o=n.enter(`title${s}`),u+=c.move(" "+i),u+=c.move(n.safe(e.title,{before:u,after:i,...c.current()})),u+=c.move(i),o()),u+=c.move(")"),a(),u}function qh(){return"!"}Ws.peek=Wh;function Ws(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let c=o.move("![");const u=n.safe(e.alt,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),a();const h=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return a(),n.stack=h,s(),i==="full"||!u||u!==d?c+=o.move(d+"]"):i==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function Wh(){return"!"}Xs.peek=Xh;function Xs(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const a=n.unsafe[s],o=n.compilePattern(a);let c;if(a.atBreak)for(;c=o.exec(r);){let u=c.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(c.index+1)}}return i+r+i}function Xh(){return"`"}function Ys(e,t){const n=Er(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Qs.peek=Yh;function Qs(e,t,n,r){const i=zr(n),s=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,c;if(Ys(e,n)){const h=n.stack;n.stack=[],o=n.enter("autolink");let d=a.move("<");return d+=a.move(n.containerPhrasing(e,{before:d,after:">",...a.current()})),d+=a.move(">"),o(),n.stack=h,d}o=n.enter("link"),c=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(c=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),c(),e.title&&(c=n.enter(`title${s}`),u+=a.move(" "+i),u+=a.move(n.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),c()),u+=a.move(")"),o(),u}function Yh(e,t,n){return Ys(e,n)?"<":"["}Gs.peek=Qh;function Gs(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let c=o.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),a();const h=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return a(),n.stack=h,s(),i==="full"||!u||u!==d?c+=o.move(d+"]"):i==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function Qh(){return"["}function _r(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 Gh(e){const t=_r(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Jh(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 Js(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 Kh(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let a=e.ordered?Jh(n):_r(n);const o=e.ordered?a==="."?")":".":Gh(n);let c=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&h&&(!h.children||!h.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),Js(n)===a&&h){let d=-1;for(;++d<e.children.length;){const m=e.children[d];if(m&&m.type==="listItem"&&m.children&&m.children[0]&&m.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(a=o),n.bulletCurrent=a;const u=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=s,i(),u}function Zh(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 ef(e,t,n,r){const i=Zh(n);let s=n.bulletCurrent||_r(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let a=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(s+" ".repeat(a-s.length)),o.shift(a);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,o.current()),h);return c(),u;function h(d,m,f){return m?(f?"":" ".repeat(a))+d:(f?s:s+" ".repeat(a-s.length))+d}}function tf(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(e,r);return s(),i(),a}const nf=Cn(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function rf(e,t,n,r){return(e.children.some(function(a){return nf(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function sf(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Ks.peek=af;function Ks(e,t,n,r){const i=sf(n),s=n.enter("strong"),a=n.createTracker(r),o=a.move(i+i);let c=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const u=c.charCodeAt(0),h=yn(r.before.charCodeAt(r.before.length-1),u,i);h.inside&&(c=Xt(u)+c.slice(1));const d=c.charCodeAt(c.length-1),m=yn(r.after.charCodeAt(0),d,i);m.inside&&(c=c.slice(0,-1)+Xt(d));const f=a.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:m.outside,before:h.outside},o+c+f}function af(e,t,n){return n.options.strong||"*"}function lf(e,t,n,r){return n.safe(e.value,r)}function of(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 uf(e,t,n){const r=(Js(n)+(n.options.ruleSpaces?" ":"")).repeat(of(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Zs={blockquote:Ah,break:Di,code:_h,definition:Oh,emphasis:Vs,hardBreak:Di,heading:Vh,html:Us,image:qs,imageReference:Ws,inlineCode:Xs,link:Qs,linkReference:Gs,list:Kh,listItem:ef,paragraph:tf,root:rf,strong:Ks,text:lf,thematicBreak:uf};function cf(){return{enter:{table:df,tableData:Ai,tableHeader:Ai,tableRow:ff},exit:{codeText:mf,table:hf,tableData:Qn,tableHeader:Qn,tableRow:Qn}}}function df(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function hf(e){this.exit(e),this.data.inTable=void 0}function ff(e){this.enter({type:"tableRow",children:[]},e)}function Qn(e){this.exit(e)}function Ai(e){this.enter({type:"tableCell",children:[]},e)}function mf(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,pf));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function pf(e,t){return t==="|"?t:e}function gf(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
28
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:a,tableCell:c,tableRow:o}};function a(f,p,g,C){return u(h(f,g,C),f.align)}function o(f,p,g,C){const b=d(f,g,C),E=u([b]);return E.slice(0,E.indexOf(`
|
|
29
|
-
`))}function c(f,p,g,C){const b=g.enter("tableCell"),E=g.enter("phrasing"),j=g.containerPhrasing(f,{...C,before:s,after:s});return E(),b(),j}function u(f,p){return Ih(f,{align:p,alignDelimiters:r,padding:n,stringLength:i})}function h(f,p,g){const C=f.children;let b=-1;const E=[],j=p.enter("table");for(;++b<C.length;)E[b]=d(C[b],p,g);return j(),E}function d(f,p,g){const C=f.children;let b=-1;const E=[],j=p.enter("tableRow");for(;++b<C.length;)E[b]=c(C[b],f,p,g);return j(),E}function m(f,p,g){let C=Zs.inlineCode(f,p,g);return g.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function xf(){return{exit:{taskListCheckValueChecked:Pi,taskListCheckValueUnchecked:Pi,paragraph:bf}}}function yf(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:kf}}}function Pi(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function bf(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,a;for(;++s<i.length;){const o=i[s];if(o.type==="paragraph"){a=o;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function kf(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);s&&o.move(a);let c=Zs.listItem(e,t,n,{...r,...o.current()});return s&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(h){return h+a}}function wf(){return[Kd(),bh(),Ch(),cf(),xf()]}function vf(e){return{extensions:[Zd(),kh(e),Sh(),gf(e),yf()]}}const Cf={tokenize:If,partial:!0},ea={tokenize:Df,partial:!0},ta={tokenize:Af,partial:!0},na={tokenize:Pf,partial:!0},Sf={tokenize:Lf,partial:!0},ra={name:"wwwAutolink",tokenize:Ef,previous:sa},ia={name:"protocolAutolink",tokenize:Tf,previous:aa},ct={name:"emailAutolink",tokenize:Nf,previous:la},rt={};function jf(){return{text:rt}}let yt=48;for(;yt<123;)rt[yt]=ct,yt++,yt===58?yt=65:yt===91&&(yt=97);rt[43]=ct;rt[45]=ct;rt[46]=ct;rt[95]=ct;rt[72]=[ct,ia];rt[104]=[ct,ia];rt[87]=[ct,ra];rt[119]=[ct,ra];function Nf(e,t,n){const r=this;let i,s;return a;function a(d){return!dr(d)||!la.call(r,r.previous)||Fr(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(d))}function o(d){return dr(d)?(e.consume(d),o):d===64?(e.consume(d),c):n(d)}function c(d){return d===46?e.check(Sf,h,u)(d):d===45||d===95||Me(d)?(s=!0,e.consume(d),c):h(d)}function u(d){return e.consume(d),i=!0,c}function h(d){return s&&i&&Fe(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function Ef(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!sa.call(r,r.previous)||Fr(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Cf,e.attempt(ea,e.attempt(ta,s),n),n)(a))}function s(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function Tf(e,t,n){const r=this;let i="",s=!1;return a;function a(d){return(d===72||d===104)&&aa.call(r,r.previous)&&!Fr(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),o):n(d)}function o(d){if(Fe(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),o;if(d===58){const m=i.toLowerCase();if(m==="http"||m==="https")return e.consume(d),c}return n(d)}function c(d){return d===47?(e.consume(d),s?u:(s=!0,c)):n(d)}function u(d){return d===null||pn(d)||he(d)||bt(d)||kn(d)?n(d):e.attempt(ea,e.attempt(ta,h),n)(d)}function h(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function If(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),s):n(a)}function s(a){return a===null?n(a):t(a)}}function Df(e,t,n){let r,i,s;return a;function a(u){return u===46||u===95?e.check(na,c,o)(u):u===null||he(u)||bt(u)||u!==45&&kn(u)?c(u):(s=!0,e.consume(u),a)}function o(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),a}function c(u){return i||r||!s?n(u):t(u)}}function Af(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?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(na,t,s)(a):a===null||he(a)||bt(a)?t(a):(e.consume(a),i)}function s(a){return a===41&&r++,e.consume(a),i}}function Pf(e,t,n){return r;function r(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),r):o===38?(e.consume(o),s):o===93?(e.consume(o),i):o===60||o===null||he(o)||bt(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||he(o)||bt(o)?t(o):r(o)}function s(o){return Fe(o)?a(o):n(o)}function a(o){return o===59?(e.consume(o),r):Fe(o)?(e.consume(o),a):n(o)}}function Lf(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return Me(s)?n(s):t(s)}}function sa(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||he(e)}function aa(e){return!Fe(e)}function la(e){return!(e===47||dr(e))}function dr(e){return e===43||e===45||e===46||e===95||Me(e)}function Fr(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Mf={tokenize:Hf,partial:!0};function Rf(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Of,continuation:{tokenize:$f},exit:Bf}},text:{91:{name:"gfmFootnoteCall",tokenize:Ff},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:zf,resolveTo:_f}}}}function zf(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const c=r.events[i][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!a||!a._balanced)return n(c);const u=tt(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function _f(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const 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[n+1],e[n+2],["enter",r,t],e[n+3],e[n+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",r,t]];return e.splice(n,e.length-n+1,...o),e}function Ff(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return o;function o(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),c}function c(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(d){if(s>999||d===93&&!a||d===null||d===91||he(d))return n(d);if(d===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return i.includes(tt(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return he(d)||(a=!0),s++,e.consume(d),d===92?h:u}function h(d){return d===91||d===92||d===93?(e.consume(d),s++,u):u(d)}}function Of(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,o;return c;function c(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):n(p)}function h(p){if(a>999||p===93&&!o||p===null||p===91||he(p))return n(p);if(p===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return s=tt(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return he(p)||(o=!0),a++,e.consume(p),p===92?d:h}function d(p){return p===91||p===92||p===93?(e.consume(p),a++,h):h(p)}function m(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),i.includes(s)||i.push(s),se(e,f,"gfmFootnoteDefinitionWhitespace")):n(p)}function f(p){return t(p)}}function $f(e,t,n){return e.check(Kt,t,e.attempt(Mf,t,n))}function Bf(e){e.exit("gfmFootnoteDefinition")}function Hf(e,t,n){const r=this;return se(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(s):n(s)}}function Vf(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,o){let c=-1;for(;++c<a.length;)if(a[c][0]==="enter"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._close){let u=c;for(;u--;)if(a[u][0]==="exit"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._open&&a[c][1].end.offset-a[c][1].start.offset===a[u][1].end.offset-a[u][1].start.offset){a[c][1].type="strikethroughSequence",a[u][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},a[u][1].start),end:Object.assign({},a[c][1].end)},d={type:"strikethroughText",start:Object.assign({},a[u][1].end),end:Object.assign({},a[c][1].start)},m=[["enter",h,o],["enter",a[u][1],o],["exit",a[u][1],o],["enter",d,o]],f=o.parser.constructs.insideSpan.null;f&&Xe(m,m.length,0,wn(f,a.slice(u+1,c),o)),Xe(m,m.length,0,[["exit",d,o],["enter",a[c][1],o],["exit",a[c][1],o],["exit",h,o]]),Xe(a,u-1,c-u+3,m),c=u+m.length-2;break}}for(c=-1;++c<a.length;)a[c][1].type==="strikethroughSequenceTemporary"&&(a[c][1].type="data");return a}function s(a,o,c){const u=this.previous,h=this.events;let d=0;return m;function m(p){return u===126&&h[h.length-1][1].type!=="characterEscape"?c(p):(a.enter("strikethroughSequenceTemporary"),f(p))}function f(p){const g=Dt(u);if(p===126)return d>1?c(p):(a.consume(p),d++,f);if(d<2&&!n)return c(p);const C=a.exit("strikethroughSequenceTemporary"),b=Dt(p);return C._open=!b||b===2&&!!g,C._close=!g||g===2&&!!b,o(p)}}}class Uf{constructor(){this.map=[]}add(t,n,r){qf(this,t,n,r)}consume(t){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function qf(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function Wf(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function Xf(){return{flow:{null:{name:"table",tokenize:Yf,resolveAll:Qf}}}}function Yf(e,t,n){const r=this;let i=0,s=0,a;return o;function o(k){let F=r.events.length-1;for(;F>-1;){const z=r.events[F][1].type;if(z==="lineEnding"||z==="linePrefix")F--;else break}const R=F>-1?r.events[F][1].type:null,$=R==="tableHead"||R==="tableRow"?w:c;return $===w&&r.parser.lazy[r.now().line]?n(k):$(k)}function c(k){return e.enter("tableHead"),e.enter("tableRow"),u(k)}function u(k){return k===124||(a=!0,s+=1),h(k)}function h(k){return k===null?n(k):W(k)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),f):n(k):ne(k)?se(e,h,"whitespace")(k):(s+=1,a&&(a=!1,i+=1),k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),a=!0,h):(e.enter("data"),d(k)))}function d(k){return k===null||k===124||he(k)?(e.exit("data"),h(k)):(e.consume(k),k===92?m:d)}function m(k){return k===92||k===124?(e.consume(k),d):d(k)}function f(k){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(k):(e.enter("tableDelimiterRow"),a=!1,ne(k)?se(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):p(k))}function p(k){return k===45||k===58?C(k):k===124?(a=!0,e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),g):I(k)}function g(k){return ne(k)?se(e,C,"whitespace")(k):C(k)}function C(k){return k===58?(s+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),b):k===45?(s+=1,b(k)):k===null||W(k)?T(k):I(k)}function b(k){return k===45?(e.enter("tableDelimiterFiller"),E(k)):I(k)}function E(k){return k===45?(e.consume(k),E):k===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),j):(e.exit("tableDelimiterFiller"),j(k))}function j(k){return ne(k)?se(e,T,"whitespace")(k):T(k)}function T(k){return k===124?p(k):k===null||W(k)?!a||i!==s?I(k):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(k)):I(k)}function I(k){return n(k)}function w(k){return e.enter("tableRow"),M(k)}function M(k){return k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),M):k===null||W(k)?(e.exit("tableRow"),t(k)):ne(k)?se(e,M,"whitespace")(k):(e.enter("data"),V(k))}function V(k){return k===null||k===124||he(k)?(e.exit("data"),M(k)):(e.consume(k),k===92?B:V)}function B(k){return k===92||k===124?(e.consume(k),V):V(k)}}function Qf(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],o=!1,c=0,u,h,d;const m=new Uf;for(;++n<e.length;){const f=e[n],p=f[1];f[0]==="enter"?p.type==="tableHead"?(o=!1,c!==0&&(Li(m,t,c,u,h),h=void 0,c=0),u={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},m.add(n,0,[["enter",u,t]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,d=void 0,s=[0,0,0,0],a=[0,n+1,0,0],o&&(o=!1,h={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},m.add(n,0,[["enter",h,t]])),i=p.type==="tableDelimiterRow"?2:h?3:1):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(s[1]!==0&&(a[0]=a[1],d=un(m,t,s,i,void 0,d),s=[0,0,0,0]),a[2]=n)):p.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],d=un(m,t,s,i,void 0,d)),s=a,a=[s[1],n,0,0])):p.type==="tableHead"?(o=!0,c=n):p.type==="tableRow"||p.type==="tableDelimiterRow"?(c=n,s[1]!==0?(a[0]=a[1],d=un(m,t,s,i,n,d)):a[1]!==0&&(d=un(m,t,a,i,n,d)),i=0):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(a[3]=n)}for(c!==0&&Li(m,t,c,u,h),m.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=Wf(t.events,n))}return e}function un(e,t,n,r,i,s){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(s.end=Object.assign({},Nt(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const c=Nt(t.events,n[1]);if(s={type:a,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const u=Nt(t.events,n[2]),h=Nt(t.events,n[3]),d={type:o,start:Object.assign({},u),end:Object.assign({},h)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const m=t.events[n[2]],f=t.events[n[3]];if(m[1].end=Object.assign({},f[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){const p=n[2]+1,g=n[3]-n[2]-1;e.add(p,g,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(s.end=Object.assign({},Nt(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function Li(e,t,n,r,i){const s=[],a=Nt(t.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,t])),r.end=Object.assign({},a),s.push(["exit",r,t]),e.add(n+1,0,s)}function Nt(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Gf={name:"tasklistCheck",tokenize:Kf};function Jf(){return{text:{91:Gf}}}function Kf(e,t,n){const r=this;return i;function i(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),s)}function s(c){return he(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),a):n(c)}function a(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(c)}function o(c){return W(c)?t(c):ne(c)?e.check({tokenize:Zf},t,n)(c):n(c)}}function Zf(e,t,n){return se(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function em(e){return xs([jf(),Rf(),Vf(e),Xf(),Jf()])}const tm={};function oa(e){const t=this,n=e||tm,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(em(n)),s.push(wf()),a.push(vf(n))}const hr={'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"}},fn=({content:e})=>l.jsx("div",{className:"break-words overflow-wrap-anywhere word-break-break-all",children:l.jsx(Fs,{remarkPlugins:[oa],components:{code({inline:t,className:n,children:r,...i}){const s=/language-(\w+)/.exec(n||"");return!t&&s?l.jsx(Zn,{style:hr,language:s[1],PreTag:"div",className:"rounded-md text-sm overflow-auto",wrapLines:!0,wrapLongLines:!0,...i,children:String(r).replace(/\n$/,"")}):l.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",...i,children:r})},h1:({children:t})=>l.jsx("h1",{className:"text-lg font-bold mt-4 mb-2 text-gray-900",children:t}),h2:({children:t})=>l.jsx("h2",{className:"text-base font-bold mt-3 mb-2 text-gray-900",children:t}),h3:({children:t})=>l.jsx("h3",{className:"text-sm font-bold mt-2 mb-1 text-gray-900",children:t}),p:({children:t})=>l.jsx("p",{className:"mb-2 leading-relaxed break-words overflow-wrap-anywhere text-gray-800 dark:text-gray-200",children:t}),ul:({children:t})=>l.jsx("ul",{className:"list-disc list-inside mb-2 space-y-1",children:t}),ol:({children:t})=>l.jsx("ol",{className:"list-decimal list-inside mb-2 space-y-1",children:t}),li:({children:t})=>l.jsx("li",{className:"leading-relaxed break-words overflow-wrap-anywhere text-gray-800 dark:text-gray-200",children:t}),blockquote:({children:t})=>l.jsx("blockquote",{className:"border-l-4 border-gray-300 dark:border-gray-600 pl-3 italic text-gray-600 dark:text-gray-400 mb-2",children:t}),strong:({children:t})=>l.jsx("strong",{className:"font-semibold text-gray-900",children:t}),em:({children:t})=>l.jsx("em",{className:"italic",children:t}),a:({children:t,href:n})=>l.jsx("a",{href:n,className:"text-blue-600 hover:text-blue-800 underline",target:"_blank",rel:"noopener noreferrer",children:t}),table:({children:t})=>l.jsx("table",{className:"border-collapse border border-gray-300 dark:border-gray-600 mb-2 text-sm",children:t}),th:({children:t})=>l.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 text-gray-900 dark:text-gray-100",children:t}),td:({children:t})=>l.jsx("td",{className:"border border-gray-300 dark:border-gray-600 px-2 py-1 text-gray-800 dark:text-gray-200",children:t})},children:e})}),nm=({execution:e})=>{const{t}=oe("components"),n=e.toolInput,r=()=>{if(n.description)return n.description.trim()};return l.jsx(Le,{execution:e,subtitle:r(),children:l.jsxs("div",{children:[l.jsx(me,{label:t("taskTool.taskDescriptionLabel"),value:n.description}),l.jsx(me,{label:t("taskTool.taskPromptLabel"),value:n.prompt.length>300?n.prompt.substring(0,300)+`
|
|
30
|
-
`+t("taskTool.truncated"):n.prompt,isCode:!0}),n.prompt.length>300&&l.jsx("div",{className:"text-xs text-gray-500 mt-1",children:t("taskTool.totalLength",{length:n.prompt.length})})]})})},rm=({execution:e})=>{const{t}=oe("components"),n=e.toolInput,r=()=>{if(n.command)return n.command.trim()},i=()=>e.isExecuting?t("bashTool.executing"):e.isError?e.toolResult||t("bashTool.executionError"):e.toolResult||"";return l.jsx(Le,{execution:e,subtitle:r(),showResult:!1,children:l.jsxs("div",{className:"space-y-3",children:[n.description&&l.jsx("div",{className:"text-sm text-gray-600 mb-2",children:n.description}),l.jsxs("div",{className:"bg-gray-900 rounded-lg p-4 font-mono text-sm",children:[l.jsxs("div",{className:"flex items-start",children:[l.jsx("span",{className:"text-green-400 mr-2 select-none",children:"$"}),l.jsx("span",{className:"text-white break-all flex-1",children:n.command})]}),!e.isExecuting&&e.toolResult&&l.jsx("div",{className:"mt-2",children:l.jsx("pre",{className:`whitespace-pre-wrap break-words ${e.isError?"text-red-400":"text-gray-300"}`,children:i()})}),e.isExecuting&&l.jsx("div",{className:"mt-2",children:l.jsx("span",{className:"text-yellow-400 animate-pulse",children:t("bashTool.executing")})})]}),n.timeout&&l.jsx("div",{className:"text-xs text-gray-500",children:t("bashTool.timeout",{timeout:n.timeout})})]})})},im=({execution:e})=>{const{t}=oe("components"),n=e.toolInput,r=()=>{if(n.pattern)return n.pattern},i=s=>!s||!s.trim()?t("globTool.noFilesFound"):(s.trim().split(`
|
|
31
|
-
`).filter(o=>o.trim()).length===0,s);return l.jsxs(Le,{execution:e,subtitle:r(),hideToolName:!0,showResult:!1,children:[l.jsxs("div",{children:[l.jsx(me,{label:t("globTool.patternLabel"),value:n.pattern,isCode:!0}),n.path&&l.jsx(me,{label:t("globTool.pathLabel"),value:n.path})]}),e.toolResult&&!e.isError&&l.jsxs("div",{className:"mt-3",children:[l.jsx("p",{className:"text-xs font-medium text-gray-600 mb-2",children:t("globTool.matchingResults")}),l.jsx("div",{className:"p-3 rounded-md border bg-blue-50 border-blue-200 text-sm font-mono whitespace-pre-wrap break-words text-blue-700",children:i(e.toolResult)})]})]})},sm=({execution:e})=>{const{t}=oe("components"),n=e.toolInput,r=()=>{if(n.pattern)return`"${n.pattern}"`},i=s=>{if(!s.trim())return t("grepTool.noMatchesFound");const a=n.output_mode||"files_with_matches";return a==="files_with_matches"?s:a==="count"?`${t("grepTool.matchStatistics")}:
|
|
32
|
-
|
|
33
|
-
${s}`:s};return l.jsxs(Le,{execution:e,subtitle:r(),showResult:!1,children:[l.jsxs("div",{children:[l.jsx(me,{label:t("grepTool.patternLabel"),value:n.pattern,isCode:!0}),n.path&&l.jsx(me,{label:t("grepTool.pathLabel"),value:n.path}),n.glob&&l.jsx(me,{label:t("grepTool.globLabel"),value:n.glob}),n.type&&l.jsx(me,{label:t("grepTool.typeLabel"),value:n.type}),n.output_mode&&l.jsx(me,{label:t("grepTool.outputModeLabel"),value:n.output_mode}),l.jsxs("div",{className:"flex flex-wrap gap-2 mt-2",children:[n["-i"]&&l.jsx("span",{className:"px-2 py-1 bg-gray-200 text-xs rounded",children:t("grepTool.ignoreCase")}),n["-n"]&&l.jsx("span",{className:"px-2 py-1 bg-gray-200 text-xs rounded",children:t("grepTool.showLineNumbers")}),n["-A"]&&l.jsx("span",{className:"px-2 py-1 bg-gray-200 text-xs rounded",children:t("grepTool.afterLines",{count:n["-A"]})}),n["-B"]&&l.jsx("span",{className:"px-2 py-1 bg-gray-200 text-xs rounded",children:t("grepTool.beforeLines",{count:n["-B"]})}),n["-C"]&&l.jsx("span",{className:"px-2 py-1 bg-gray-200 text-xs rounded",children:t("grepTool.contextLines",{count:n["-C"]})}),n.multiline&&l.jsx("span",{className:"px-2 py-1 bg-gray-200 text-xs rounded",children:t("grepTool.multilineMode")})]})]}),e.toolResult&&!e.isError&&l.jsxs("div",{className:"mt-3",children:[l.jsx("p",{className:"text-xs font-medium text-gray-600 mb-2",children:t("grepTool.searchResults")}),l.jsx("div",{className:"p-3 rounded-md border bg-green-50 border-green-200 text-sm font-mono whitespace-pre-wrap break-words text-green-700",children:i(e.toolResult)})]})]})},am=({execution:e})=>{const{t}=oe("components"),n=e.toolInput,r=()=>{if(!n.path)return;const i=n.path;return i.split("/").slice(-2).join("/")||i};return l.jsxs(Le,{execution:e,subtitle:r(),hideToolName:!0,children:[l.jsxs("div",{children:[l.jsx(me,{label:t("lsTool.directoryPath"),value:n.path}),n.ignore&&n.ignore.length>0&&l.jsx(me,{label:t("lsTool.ignorePatterns"),value:n.ignore.join(", ")})]}),e.toolResult&&!e.isError&&l.jsxs("div",{className:"mt-3",children:[l.jsx("p",{className:"text-xs font-medium text-gray-600 mb-2",children:t("lsTool.directoryStructure")}),l.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})]})]})},lm=({execution:e})=>{const{t}=oe("components"),n=e.toolInput;return l.jsx(Le,{execution:e,children:l.jsxs("div",{children:[l.jsxs("div",{className:"mb-3",children:[l.jsx("p",{className:"text-xs font-medium text-gray-600 mb-2",children:t("exitPlanModeTool.implementationPlan")}),l.jsx("div",{className:"p-3 rounded-md border bg-emerald-50 border-emerald-200",children:l.jsx("div",{className:"text-sm text-emerald-800 whitespace-pre-wrap break-words",children:n.plan})})]}),l.jsxs("div",{className:"text-xs text-emerald-600 bg-emerald-100 p-2 rounded",children:["📋 ",t("exitPlanModeTool.planModeExited")]})]})})},om=({execution:e})=>{const{t}=oe("components"),n=e.toolInput,r=()=>n.file_path?n.file_path.split("/").pop()||n.file_path:void 0;return l.jsx(Le,{execution:e,subtitle:r(),showResult:!1,children:l.jsxs("div",{children:[l.jsx(me,{label:t("readTool.readFile"),value:n.file_path}),n.offset&&l.jsx(me,{label:t("readTool.startLine"),value:n.offset}),n.limit&&l.jsx(me,{label:t("readTool.readLines"),value:n.limit})]})})};function it(){}it.prototype={diff:function(t,n){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=i.callback;typeof i=="function"&&(s=i,i={});var a=this;function o(T){return T=a.postProcess(T,i),s?(setTimeout(function(){s(T)},0),!0):T}t=this.castInput(t,i),n=this.castInput(n,i),t=this.removeEmpty(this.tokenize(t,i)),n=this.removeEmpty(this.tokenize(n,i));var c=n.length,u=t.length,h=1,d=c+u;i.maxEditLength!=null&&(d=Math.min(d,i.maxEditLength));var m=(r=i.timeout)!==null&&r!==void 0?r:1/0,f=Date.now()+m,p=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(p[0],n,t,0,i);if(p[0].oldPos+1>=u&&g+1>=c)return o(Mi(a,p[0].lastComponent,n,t,a.useLongestToken));var C=-1/0,b=1/0;function E(){for(var T=Math.max(C,-h);T<=Math.min(b,h);T+=2){var I=void 0,w=p[T-1],M=p[T+1];w&&(p[T-1]=void 0);var V=!1;if(M){var B=M.oldPos-T;V=M&&0<=B&&B<c}var k=w&&w.oldPos+1<u;if(!V&&!k){p[T]=void 0;continue}if(!k||V&&w.oldPos<M.oldPos?I=a.addToPath(M,!0,!1,0,i):I=a.addToPath(w,!1,!0,1,i),g=a.extractCommon(I,n,t,T,i),I.oldPos+1>=u&&g+1>=c)return o(Mi(a,I.lastComponent,n,t,a.useLongestToken));p[T]=I,I.oldPos+1>=u&&(b=Math.min(b,T-1)),g+1>=c&&(C=Math.max(C,T+1))}h++}if(s)(function T(){setTimeout(function(){if(h>d||Date.now()>f)return s();E()||T()},0)})();else for(;h<=d&&Date.now()<=f;){var j=E();if(j)return j}},addToPath:function(t,n,r,i,s){var a=t.lastComponent;return a&&!s.oneChangePerToken&&a.added===n&&a.removed===r?{oldPos:t.oldPos+i,lastComponent:{count:a.count+1,added:n,removed:r,previousComponent:a.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:a}}},extractCommon:function(t,n,r,i,s){for(var a=n.length,o=r.length,c=t.oldPos,u=c-i,h=0;u+1<a&&c+1<o&&this.equals(r[c+1],n[u+1],s);)u++,c++,h++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return h&&!s.oneChangePerToken&&(t.lastComponent={count:h,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=c,u},equals:function(t,n,r){return r.comparator?r.comparator(t,n):t===n||r.ignoreCase&&t.toLowerCase()===n.toLowerCase()},removeEmpty:function(t){for(var n=[],r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n},castInput:function(t){return t},tokenize:function(t){return Array.from(t)},join:function(t){return t.join("")},postProcess:function(t){return t}};function Mi(e,t,n,r,i){for(var s=[],a;t;)s.push(t),a=t.previousComponent,delete t.previousComponent,t=a;s.reverse();for(var o=0,c=s.length,u=0,h=0;o<c;o++){var d=s[o];if(d.removed)d.value=e.join(r.slice(h,h+d.count)),h+=d.count;else{if(!d.added&&i){var m=n.slice(u,u+d.count);m=m.map(function(f,p){var g=r[h+p];return g.length>f.length?g:f}),d.value=e.join(m)}else d.value=e.join(n.slice(u,u+d.count));u+=d.count,d.added||(h+=d.count)}}return s}function Ri(e,t){var n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function zi(e,t){var n;if(!e||!t||e[e.length-1]!=t[t.length-1])return"";for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function fr(e,t,n){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 n+e.slice(t.length)}function mr(e,t,n){if(!t)return e+n;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)+n}function Ot(e,t){return fr(e,t,"")}function cn(e,t){return mr(e,t,"")}function _i(e,t){return t.slice(0,um(e,t))}function um(e,t){var n=0;e.length>t.length&&(n=e.length-t.length);var r=t.length;e.length<t.length&&(r=e.length);var i=Array(r),s=0;i[0]=0;for(var a=1;a<r;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=n;o<e.length;o++){for(;s>0&&e[o]!=t[s];)s=i[s];e[o]==t[s]&&s++}return s}var bn="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}",cm=new RegExp("[".concat(bn,"]+|\\s+|[^").concat(bn,"]"),"ug"),jn=new it;jn.equals=function(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()};jn.tokenize=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n;if(t.intlSegmenter){if(t.intlSegmenter.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');n=Array.from(t.intlSegmenter.segment(e),function(s){return s.segment})}else n=e.match(cm)||[];var r=[],i=null;return n.forEach(function(s){/\s/.test(s)?i==null?r.push(s):r.push(r.pop()+s):/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+s):r.push(i+s):r.push(s),i=s}),r};jn.join=function(e){return e.map(function(t,n){return n==0?t:t.replace(/^\s+/,"")}).join("")};jn.postProcess=function(e,t){if(!e||t.oneChangePerToken)return e;var n=null,r=null,i=null;return e.forEach(function(s){s.added?r=s:s.removed?i=s:((r||i)&&Fi(n,i,r,s),n=s,r=null,i=null)}),(r||i)&&Fi(n,i,r,null),e};function Fi(e,t,n,r){if(t&&n){var i=t.value.match(/^\s*/)[0],s=t.value.match(/\s*$/)[0],a=n.value.match(/^\s*/)[0],o=n.value.match(/\s*$/)[0];if(e){var c=Ri(i,a);e.value=mr(e.value,a,c),t.value=Ot(t.value,c),n.value=Ot(n.value,c)}if(r){var u=zi(s,o);r.value=fr(r.value,o,u),t.value=cn(t.value,u),n.value=cn(n.value,u)}}else if(n)e&&(n.value=n.value.replace(/^\s*/,"")),r&&(r.value=r.value.replace(/^\s*/,""));else if(e&&r){var h=r.value.match(/^\s*/)[0],d=t.value.match(/^\s*/)[0],m=t.value.match(/\s*$/)[0],f=Ri(h,d);t.value=Ot(t.value,f);var p=zi(Ot(h,f),m);t.value=cn(t.value,p),r.value=fr(r.value,h,p),e.value=mr(e.value,h,h.slice(0,h.length-p.length))}else if(r){var g=r.value.match(/^\s*/)[0],C=t.value.match(/\s*$/)[0],b=_i(C,g);t.value=cn(t.value,b)}else if(e){var E=e.value.match(/\s*$/)[0],j=t.value.match(/^\s*/)[0],T=_i(E,j);t.value=Ot(t.value,T)}}var dm=new it;dm.tokenize=function(e){var t=new RegExp("(\\r?\\n)|[".concat(bn,"]+|[^\\S\\n\\r]+|[^").concat(bn,"]"),"ug");return e.match(t)||[]};var Nn=new it;Nn.tokenize=function(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
34
|
-
`));var n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(var i=0;i<r.length;i++){var s=r[i];i%2&&!t.newlineIsToken?n[n.length-1]+=s:n.push(s)}return n};Nn.equals=function(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
35
|
-
`))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
|
|
36
|
-
`))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
37
|
-
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
|
38
|
-
`)&&(t=t.slice(0,-1))),it.prototype.equals.call(this,e,t,n)};function Oi(e,t,n){return Nn.diff(e,t,n)}var hm=new it;hm.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var fm=new it;fm.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function $i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$i(Object(n),!0).forEach(function(r){gm(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$i(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mm(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pm(e){var t=mm(e,"string");return typeof t=="symbol"?t:t+""}function pr(e){"@babel/helpers - typeof";return pr=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},pr(e)}function gm(e,t,n){return t=pm(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gn(e){return xm(e)||ym(e)||bm(e)||km()}function xm(e){if(Array.isArray(e))return gr(e)}function ym(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function bm(e,t){if(e){if(typeof e=="string")return gr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gr(e,t)}}function gr(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function km(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
39
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Yt=new it;Yt.useLongestToken=!0;Yt.tokenize=Nn.tokenize;Yt.castInput=function(e,t){var n=t.undefinedReplacement,r=t.stringifyReplacer,i=r===void 0?function(s,a){return typeof a>"u"?n:a}:r;return typeof e=="string"?e:JSON.stringify(xr(e,null,null,i),i," ")};Yt.equals=function(e,t,n){return it.prototype.equals.call(Yt,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"),n)};function xr(e,t,n,r,i){t=t||[],n=n||[],r&&(e=r(i,e));var s;for(s=0;s<t.length;s+=1)if(t[s]===e)return n[s];var a;if(Object.prototype.toString.call(e)==="[object Array]"){for(t.push(e),a=new Array(e.length),n.push(a),s=0;s<e.length;s+=1)a[s]=xr(e[s],t,n,r,i);return t.pop(),n.pop(),a}if(e&&e.toJSON&&(e=e.toJSON()),pr(e)==="object"&&e!==null){t.push(e),a={},n.push(a);var o=[],c;for(c in e)Object.prototype.hasOwnProperty.call(e,c)&&o.push(c);for(o.sort(),s=0;s<o.length;s+=1)c=o[s],a[c]=xr(e[c],t,n,r,c);t.pop(),n.pop()}else a=e;return a}var yr=new it;yr.tokenize=function(e){return e.slice()};yr.join=yr.removeEmpty=function(e){return e};function wm(e,t,n,r,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,c=o.callback;Oi(n,r,Bi(Bi({},a),{},{callback:function(d){var m=u(d);c(m)}}))}else return u(Oi(n,r,a));function u(h){if(!h)return;h.push({value:"",lines:[]});function d(V){return V.map(function(B){return" "+B})}for(var m=[],f=0,p=0,g=[],C=1,b=1,E=function(){var B=h[j],k=B.lines||vm(B.value);if(B.lines=k,B.added||B.removed){var F;if(!f){var R=h[j-1];f=C,p=b,R&&(g=a.context>0?d(R.lines.slice(-a.context)):[],f-=g.length,p-=g.length)}(F=g).push.apply(F,Gn(k.map(function(X){return(B.added?"+":"-")+X}))),B.added?b+=k.length:C+=k.length}else{if(f)if(k.length<=a.context*2&&j<h.length-2){var $;($=g).push.apply($,Gn(d(k)))}else{var z,U=Math.min(k.length,a.context);(z=g).push.apply(z,Gn(d(k.slice(0,U))));var O={oldStart:f,oldLines:C-f+U,newStart:p,newLines:b-p+U,lines:g};m.push(O),f=0,p=0,g=[]}C+=k.length,b+=k.length}},j=0;j<h.length;j++)E();for(var T=0,I=m;T<I.length;T++)for(var w=I[T],M=0;M<w.lines.length;M++)w.lines[M].endsWith(`
|
|
40
|
-
`)?w.lines[M]=w.lines[M].slice(0,-1):(w.lines.splice(M+1,0,"\"),M++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:s,hunks:m}}}function vm(e){var t=e.endsWith(`
|
|
41
|
-
`),n=e.split(`
|
|
42
|
-
`).map(function(r){return r+`
|
|
43
|
-
`});return t?n.pop():n.push(n.pop().slice(0,-1)),n}const ua=({oldText:e,newText:t,oldStartLine:n=1,newStartLine:r=1})=>{const i=wm("old","new",e,t,"","",{context:3});return!i.hunks||i.hunks.length===0?l.jsx("pre",{className:"diff-container",children:l.jsx("code",{children:"No changes detected."})}):l.jsx("pre",{className:"diff-container",children:l.jsx("code",{children:i.hunks.map((s,a)=>{let o=s.oldStart+(n-1),c=s.newStart+(r-1);const u=s.oldStart+(n-1),h=s.newStart+(r-1);return l.jsxs("div",{className:"diff-hunk",children:[l.jsxs("div",{className:"hunk-header",children:[l.jsx("span",{className:"line-gutter",children:"..."}),l.jsx("span",{className:"line-content",children:`@@ -${u},${s.oldLines} +${h},${s.newLines} @@`})]}),s.lines.filter(d=>d.substring(1).trim()!=="No newline at end of file").map((d,m)=>{const f=d.startsWith("+")?"add":d.startsWith("-")?"del":"context";let p="diff-line",g="",C="";switch(f){case"add":p+=" diff-added",C=(c++).toString();break;case"del":p+=" diff-removed",g=(o++).toString();break;case"context":g=(o++).toString(),C=(c++).toString();break}return l.jsxs("div",{className:p,children:[l.jsxs("span",{className:"line-gutter",children:[g.padStart(4)," ",C.padStart(4)]}),l.jsx("span",{className:"line-prefix",children:d.charAt(0)}),l.jsx("span",{className:"line-content",children:d.substring(1)})]},m)})]},a)})})})},Cm=({execution:e})=>{const{t}=oe("components"),n=e.toolInput,r=e.toolUseResult,i=()=>n.file_path?n.file_path.split("/").pop()||n.file_path:void 0,s=()=>{if(r?.structuredPatch&&r.structuredPatch.length>0){const c=r.structuredPatch[0];return{oldStartLine:c.oldStart,newStartLine:c.newStart}}return{oldStartLine:1,newStartLine:1}},{oldStartLine:a,newStartLine:o}=s();return l.jsx(Le,{execution:e,subtitle:i(),showResult:!1,children:l.jsxs("div",{children:[l.jsx(me,{label:t("editTool.editFile"),value:n.file_path}),n.replace_all&&l.jsx(me,{label:t("editTool.replaceAll"),value:t("editTool.yes")}),l.jsx("div",{className:"mt-3",children:l.jsx(ua,{oldText:n.old_string,newText:n.new_string,oldStartLine:a,newStartLine:o})})]})})},Sm=({execution:e})=>{const{t}=oe("components"),n=e.toolInput;return l.jsx(Le,{execution:e,showResult:!1,children:l.jsxs("div",{children:[l.jsx(me,{label:t("multiEditTool.filePath"),value:n.file_path}),l.jsxs("div",{className:"mt-3",children:[l.jsx("p",{className:"text-xs font-medium text-gray-600 mb-2",children:t("multiEditTool.batchEdit",{count:n.edits.length})}),l.jsx("div",{className:"space-y-4 max-h-96 overflow-y-auto",children:n.edits.map((r,i)=>l.jsxs("div",{className:"border border-gray-200 rounded-md bg-white",children:[l.jsx("div",{className:"px-3 py-2 bg-gray-50 border-b border-gray-200 rounded-t-md",children:l.jsxs("div",{className:"text-xs font-medium text-gray-600",children:[t("multiEditTool.operation",{number:i+1}),r.replace_all&&l.jsx("span",{className:"ml-2 px-2 py-1 bg-orange-200 text-orange-800 rounded text-xs",children:t("multiEditTool.replaceAll")})]})}),l.jsx("div",{className:"p-3",children:l.jsx(ua,{oldText:r.old_string,newText:r.new_string})})]},i))})]})]})})},Hi={".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"};function jm(e){if(!e)return"text";const t=e.toLowerCase().match(/\.[^.]*$/)?.[0];if(t&&Hi[t])return Hi[t];const n=e.toLowerCase().split("/").pop()||"";return n.startsWith(".env")?"bash":n==="dockerfile"||n==="dockerfile.dev"||n==="dockerfile.prod"?"dockerfile":n==="makefile"||n==="makefile.am"?"makefile":n==="package.json"||n==="tsconfig.json"||n==="tslint.json"?"json":"text"}const Nm=({content:e,filePath:t="",className:n=""})=>{const r=jm(t);return r==="markdown"?l.jsxs("div",{className:`bg-white border border-gray-200 rounded-md p-4 ${n}`,children:[l.jsxs("div",{className:"text-xs font-medium text-gray-600 mb-3",children:["文件内容 (",r,")"]}),l.jsx("div",{className:"prose prose-sm max-w-none",children:l.jsx(Fs,{remarkPlugins:[oa],components:{code({inline:i,className:s,children:a}){const o=/language-(\w+)/.exec(s||"");return!i&&o?l.jsx(Zn,{style:hr,language:o[1],PreTag:"div",className:"rounded-md text-sm overflow-auto",wrapLines:!0,wrapLongLines:!0,children:String(a).replace(/\n$/,"")}):l.jsx("code",{className:"bg-gray-100 px-1 py-0.5 rounded text-sm font-mono",children:a})}},children:e})})]}):l.jsxs("div",{className:`bg-white border border-gray-200 rounded-md ${n}`,children:[l.jsx("div",{className:"px-4 py-2 bg-gray-50 border-b border-gray-200 rounded-t-md",children:l.jsxs("div",{className:"text-xs font-medium text-gray-600",children:["文件内容 (",r,")"]})}),l.jsx("div",{className:"p-4",children:l.jsx(Zn,{language:r,style:hr,customStyle:{margin:0,background:"transparent",fontSize:"14px"},wrapLines:!0,wrapLongLines:!0,showLineNumbers:!0,lineNumberStyle:{minWidth:"3em",paddingRight:"1em",color:"#666",borderRight:"1px solid #ddd",marginRight:"1em"},children:e})})]})},Em=({execution:e})=>{const{t}=oe("components"),n=e.toolInput,r=()=>n.file_path?n.file_path.split("/").pop()||n.file_path:void 0;return l.jsx(Le,{execution:e,subtitle:r(),showResult:!1,children:l.jsxs("div",{children:[l.jsx(me,{label:t("writeTool.filePath"),value:n.file_path}),l.jsxs("div",{className:"mt-3",children:[l.jsx(Nm,{content:n.content,filePath:n.file_path}),l.jsx("div",{className:"text-xs text-gray-500 mt-2",children:t("writeTool.fileSize",{size:n.content.length})})]})]})})},Tm=({execution:e})=>{const{t}=oe("components"),n=e.toolInput;return l.jsx(Le,{execution:e,children:l.jsxs("div",{children:[l.jsx(me,{label:t("notebookReadTool.notebookPath"),value:n.notebook_path}),n.cell_id&&l.jsx(me,{label:t("notebookReadTool.cellId"),value:n.cell_id})]})})},Im=({execution:e})=>{const{t}=oe("components"),n=e.toolInput;return l.jsx(Le,{execution:e,children:l.jsxs("div",{children:[l.jsx(me,{label:t("notebookEditTool.notebookPath"),value:n.notebook_path}),l.jsxs("div",{className:"flex flex-wrap gap-2 mt-2 mb-3",children:[n.edit_mode&&l.jsx("span",{className:`px-2 py-1 text-xs rounded ${n.edit_mode==="insert"?"bg-green-200 text-green-800":n.edit_mode==="delete"?"bg-red-200 text-red-800":"bg-blue-200 text-blue-800"}`,children:n.edit_mode==="insert"?t("notebookEditTool.insert"):n.edit_mode==="delete"?t("notebookEditTool.delete"):t("notebookEditTool.replace")}),n.cell_type&&l.jsx("span",{className:"px-2 py-1 bg-purple-200 text-purple-800 text-xs rounded",children:n.cell_type==="code"?t("notebookEditTool.code"):t("notebookEditTool.markdown")})]}),n.cell_id&&l.jsx(me,{label:t("notebookEditTool.cellId"),value:n.cell_id}),n.edit_mode!=="delete"&&l.jsx(me,{label:t("notebookEditTool.newContent"),value:n.new_source.length>300?n.new_source.substring(0,300)+`
|
|
44
|
-
`+t("notebookEditTool.truncated"):n.new_source,isCode:!0})]})})},Dm=({execution:e})=>{const{t}=oe("components"),n=e.toolInput;return l.jsxs(Le,{execution:e,hideToolName:!0,subtitle:n.url,children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[l.jsx("span",{className:"text-xs font-medium text-gray-600",children:t("webFetchTool.urlLabel")}),l.jsx("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 text-sm underline break-all",children:n.url})]}),l.jsx(me,{label:t("webFetchTool.analysisPromptLabel"),value:n.prompt.length>200?n.prompt.substring(0,200)+`
|
|
45
|
-
`+t("webFetchTool.truncated"):n.prompt,isCode:!0})]}),e.toolResult&&!e.isError&&l.jsxs("div",{className:"mt-3",children:[l.jsx("p",{className:"text-xs font-medium text-gray-600 mb-2",children:t("webFetchTool.webAnalysisResult")}),l.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})]})]})},Am=({execution:e})=>{const{t}=oe("components"),n=e.toolInput,r=()=>{if(n.query)return`${n.query}`};return l.jsxs(Le,{execution:e,subtitle:r(),showResult:!1,children:[l.jsxs("div",{children:[l.jsx(me,{label:t("webSearchTool.searchQueryLabel"),value:n.query}),(n.allowed_domains||n.blocked_domains)&&l.jsxs("div",{className:"mt-2 space-y-1",children:[n.allowed_domains&&n.allowed_domains.length>0&&l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx("span",{className:"text-xs font-medium text-green-600",children:t("webSearchTool.allowedDomains")}),n.allowed_domains.map((i,s)=>l.jsx("span",{className:"px-2 py-1 bg-green-100 text-green-700 text-xs rounded",children:i},s))]}),n.blocked_domains&&n.blocked_domains.length>0&&l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx("span",{className:"text-xs font-medium text-red-600",children:t("webSearchTool.blockedDomains")}),n.blocked_domains.map((i,s)=>l.jsx("span",{className:"px-2 py-1 bg-red-100 text-red-700 text-xs rounded",children:i},s))]})]})]}),e.toolResult&&!e.isError&&l.jsxs("div",{className:"mt-3",children:[l.jsx("p",{className:"text-xs font-medium text-gray-600 mb-2",children:t("webSearchTool.searchResults")}),l.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 ca(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 Pm(e){return e.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function Lm(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 Mm=({content:e})=>{switch(e.type){case"text":return l.jsx("div",{className:"p-3 rounded-md border bg-green-50 border-green-200",children:l.jsx("pre",{className:"text-sm font-mono text-green-700 whitespace-pre-wrap break-words",children:e.text})});case"image":{const{t:n}=oe("components"),r=e;return l.jsxs("div",{className:"p-3 rounded-md border bg-blue-50 border-blue-200",children:[l.jsx("div",{className:"text-xs font-medium text-blue-600 mb-2",children:n("mcpTool.image",{mimeType:r.mimeType})}),l.jsx("img",{src:`data:${r.mimeType};base64,${r.data}`,alt:"MCP Tool Result",className:"max-w-full h-auto rounded border shadow-sm",style:{maxHeight:"400px"}})]})}case"resource":{const{t:n}=oe("components"),r=e;return l.jsxs("div",{className:"p-3 rounded-md border bg-purple-50 border-purple-200",children:[l.jsx("div",{className:"text-xs font-medium text-purple-600 mb-2",children:n("mcpTool.resource")}),l.jsxs("div",{className:"text-sm text-purple-700 space-y-1",children:[l.jsxs("div",{children:[l.jsxs("span",{className:"font-medium",children:[n("mcpTool.uri"),":"]})," ",r.resource.uri]}),r.resource.name&&l.jsxs("div",{children:[l.jsxs("span",{className:"font-medium",children:[n("mcpTool.name"),":"]})," ",r.resource.name]}),r.resource.description&&l.jsxs("div",{children:[l.jsxs("span",{className:"font-medium",children:[n("mcpTool.description"),":"]})," ",r.resource.description]}),r.resource.mimeType&&l.jsxs("div",{children:[l.jsxs("span",{className:"font-medium",children:[n("mcpTool.type"),":"]})," ",r.resource.mimeType]})]})]})}default:const{t}=oe("components");return l.jsxs("div",{className:"p-3 rounded-md border bg-gray-50 border-gray-200",children:[l.jsx("div",{className:"text-xs font-medium text-gray-600 mb-2",children:t("mcpTool.unknownType",{type:e.type})}),l.jsx("pre",{className:"text-sm font-mono text-gray-700 whitespace-pre-wrap break-words",children:JSON.stringify(e,null,2)})]})}},Rm=({result:e,isError:t})=>{const{t:n}=oe("components");if(!e)return null;if(t)return l.jsxs("div",{className:"mt-3",children:[l.jsx("p",{className:"text-xs font-medium text-gray-600 mb-2",children:n("mcpTool.errorMessage")}),l.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 r=Lm(e);if(!r||!r.content)return l.jsxs("div",{className:"mt-3",children:[l.jsx("p",{className:"text-xs font-medium text-gray-600 mb-2",children:n("mcpTool.executionResult")}),l.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(r.content)?r.content:[r.content];return l.jsxs("div",{className:"mt-3",children:[l.jsx("p",{className:"text-xs font-medium text-gray-600 mb-2",children:n("mcpTool.executionResult")}),r._meta?.progress!==void 0&&r._meta?.progressTotal&&l.jsxs("div",{className:"mb-3 p-2 bg-blue-50 border border-blue-200 rounded text-sm",children:[l.jsx("div",{className:"text-blue-700 mb-1",children:n("mcpTool.progress",{current:r._meta.progress,total:r._meta.progressTotal})}),l.jsx("div",{className:"w-full bg-blue-200 rounded-full h-2",children:l.jsx("div",{className:"bg-blue-600 h-2 rounded-full transition-all duration-300",style:{width:`${r._meta.progress/r._meta.progressTotal*100}%`}})})]}),l.jsx("div",{className:"space-y-3",children:i.map((s,a)=>l.jsx(Mm,{content:s},a))})]})},zm=({execution:e})=>{const{t}=oe("components"),n=ca(e.toolName);if(!n)return l.jsx(Le,{execution:e});const{serverName:r,toolName:i}=n,s=Pm(i),a={...e,toolName:s},o=t("mcpTool.subtitle",{toolName:i,serverName:r});return l.jsx(Le,{execution:a,subtitle:o,showResult:!1,isMcpTool:!0,children:l.jsxs("div",{className:"space-y-3",children:[l.jsx(me,{label:t("mcpTool.parameters"),value:e.toolInput,isCode:!0}),e.toolResult&&l.jsx(Rm,{result:e.toolResult,isError:e.isError})]})})},_m=({execution:e})=>{const{t}=oe("components");if(ca(e.toolName))return l.jsx(zm,{execution:e});switch(e.toolName){case"Task":return l.jsx(nm,{execution:e});case"Bash":return l.jsx(rm,{execution:e});case"BashOutput":return l.jsx(nl,{execution:e});case"KillBash":return l.jsx(tl,{execution:e});case"Glob":return l.jsx(im,{execution:e});case"Grep":return l.jsx(sm,{execution:e});case"LS":return l.jsx(am,{execution:e});case"exit_plan_mode":return l.jsx(lm,{execution:e});case"Read":return l.jsx(om,{execution:e});case"Edit":return l.jsx(Cm,{execution:e});case"MultiEdit":return l.jsx(Sm,{execution:e});case"Write":return l.jsx(Em,{execution:e});case"NotebookRead":return l.jsx(Tm,{execution:e});case"NotebookEdit":return l.jsx(Im,{execution:e});case"WebFetch":return l.jsx(Dm,{execution:e});case"TodoWrite":return l.jsx(el,{execution:e});case"WebSearch":return l.jsx(Am,{execution:e});default:return l.jsx(Le,{execution:e,children:l.jsxs("div",{children:[l.jsx("p",{className:"text-sm text-gray-600 mb-2",children:t("toolRenderer.unknownToolType")}),l.jsx("div",{className:"text-xs text-gray-500 bg-gray-100 p-2 rounded font-mono",children:JSON.stringify(e.toolInput,null,2)})]})})}},Fm=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}),Vi=e=>{const t=Fm(e);return l.jsx(_m,{execution:t})},Om=({content:e})=>{const{t}=oe("components"),n=typeof e=="string"?e:Array.isArray(e)?e.map(s=>s.text||JSON.stringify(s)).join(""):String(e),[r,i]=v.useState(!1);return l.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg bg-gray-50 dark:bg-gray-800/50",children:[l.jsxs("button",{onClick:()=>i(!r),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:[l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Ua,{className:"w-4 h-4 text-gray-600 dark:text-gray-400"}),l.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:t("compactSummary.title")})]}),l.jsxs("div",{className:"flex items-center space-x-1",children:[l.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:t(r?"compactSummary.collapse":"compactSummary.expand")}),r?l.jsx(Et,{className:"w-4 h-4 text-gray-500 dark:text-gray-400"}):l.jsx(kr,{className:"w-4 h-4 text-gray-500 dark:text-gray-400"})]})]}),r&&l.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 p-4 bg-white dark:bg-gray-800",children:l.jsx("div",{className:"text-sm",children:l.jsx(fn,{content:n})})})]})},$m=({message:e})=>{const[t,n]=v.useState([]),[r,i]=v.useState(0),s=()=>{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},a=c=>{const u=s(),h=u.indexOf(c);n(u),i(h>=0?h:0)},o=()=>{n([]),i(0)};if(e.messageParts&&e.messageParts.length>0){const c=[...e.messageParts].sort((u,h)=>u.order-h.order);return l.jsxs("div",{className:"space-y-3",children:[c.map(u=>{if(u.type==="command"&&u.content)return l.jsx("div",{className:"inline-flex items-center px-2 py-1 bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 border border-blue-200 dark:border-blue-700 rounded-md text-sm font-mono",children:u.content},u.id);if(u.type==="compactSummary"&&u.content)return l.jsx("div",{children:l.jsx(Om,{content:u.content})},u.id);if(u.type==="text"&&u.content)return l.jsx("div",{children:e.role==="assistant"?l.jsx(fn,{content:u.content}):l.jsx("div",{className:"whitespace-pre-wrap break-words",children:u.content})},u.id);if(u.type==="thinking"&&u.content)return l.jsxs("details",{className:"my-2",children:[l.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:"💭 思考过程..."}),l.jsx("div",{className:"mt-2 pl-4 border-l-2 border-gray-200 dark:border-gray-700",children:l.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 l.jsx(Vi,{toolName:u.toolData.toolName,toolInput:u.toolData.toolInput,toolResult:u.toolData.toolResult,toolUseResult:u.toolData.toolUseResult,isError:u.toolData.isError,isExecuting:u.toolData.isExecuting},u.id);if(u.type==="image"&&u.imageData){const h=`data:${u.imageData.mediaType};base64,${u.imageData.data}`;return l.jsx("div",{className:"inline-block",children:l.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:()=>a(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 m=u.content.match(/"thinking":"([^"]+)"/);m&&m[1]&&(d=m[1].replace(/\\n/g,`
|
|
46
|
-
`).replace(/\\"/g,'"'))}}catch(m){console.warn("Failed to parse thinking content:",m)}return l.jsxs("details",{className:"my-2",children:[l.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:"💭 思考过程... (历史消息)"}),l.jsx("div",{className:"mt-2 pl-4 border-l-2 border-gray-200 dark:border-gray-700",children:l.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 l.jsx("div",{children:e.role==="assistant"?l.jsx(fn,{content:u.content}):l.jsx("div",{className:"whitespace-pre-wrap break-words",children:u.content})},u.id);return null}),l.jsx(er,{images:t,initialIndex:r,onClose:o})]})}return l.jsxs("div",{className:"space-y-2",children:[e.images&&e.images.length>0&&l.jsx("div",{className:"flex flex-wrap gap-2",children:e.images.map(c=>{const u=`data:${c.mediaType};base64,${c.data}`;return l.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:()=>a(u),title:c.filename||"Click to preview"},c.id)})}),e.content&&l.jsx("div",{children:e.role==="assistant"?l.jsx(fn,{content:e.content}):(()=>{const c=e.content.match(/<command-message>.*?<\/command-message>\s*<command-name>(.+?)<\/command-name>/);return c?l.jsx("div",{className:"inline-flex items-center px-2 py-1 bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 border border-blue-200 dark:border-blue-700 rounded-md text-sm font-mono",children:c[1]}):l.jsx("div",{className:"whitespace-pre-wrap break-words",children:e.content})})()}),e.toolUsage&&e.toolUsage.length>0&&l.jsx("div",{className:"space-y-2",children:e.toolUsage.map(c=>l.jsx(Vi,{toolName:c.toolName,toolInput:c.toolInput,toolResult:c.toolResult,toolUseResult:c.toolUseResult,isError:c.isError,isExecuting:c.isExecuting},c.id))}),l.jsx(er,{images:t,initialIndex:r,onClose:o})]})},Bm=v.memo($m),Hm=({isOpen:e,onToggle:t,sessions:n,currentSessionId:r,onSwitchSession:i,isLoading:s=!1,searchTerm:a,onSearchChange:o})=>{const{t:c}=oe("components"),u=v.useRef(null),h=v.useRef(null);v.useEffect(()=>{const m=f=>{u.current&&!u.current.contains(f.target)&&t()};return e&&document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m)}},[e,t]),v.useEffect(()=>{e&&h.current&&setTimeout(()=>h.current?.focus(),100)},[e]);const d=n;return e?l.jsxs("div",{ref:u,className:"absolute top-full right-0 mt-1 w-80 bg-white rounded-lg shadow-lg border border-gray-200 z-50",children:[l.jsx("div",{className:"flex items-center justify-between p-3 border-b border-gray-100",children:l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Kn,{className:"w-4 h-4 text-gray-600"}),l.jsx("span",{className:"text-sm font-medium text-gray-900",children:c("sessionDropdown.sessionHistory")})]})}),l.jsx("div",{className:"p-3 border-b border-gray-100",children:l.jsxs("div",{className:"relative",children:[l.jsx(Vr,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),l.jsx("input",{ref:h,type:"text",value:a,onChange:m=>o(m.target.value),placeholder:c("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"})]})}),l.jsx("div",{className:"max-h-80 overflow-y-auto",children:s?l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx("div",{className:"animate-spin rounded-full h-5 w-5 border-b-2 border-blue-600"})}):d.length>0?l.jsx("div",{className:"py-2",children:d.map(m=>l.jsxs("div",{onClick:()=>i(m.id),className:`mx-2 px-3 py-2 rounded cursor-pointer hover:bg-gray-50 transition-colors ${r===m.id?"bg-blue-50 border border-blue-200":"border border-transparent"}`,children:[l.jsx("div",{className:"text-sm font-medium text-gray-900 truncate",children:m.title}),l.jsxs("div",{className:"text-xs text-gray-500 mt-0.5",children:[c("sessionDropdown.messageCount",{count:m.messageCount})," • ",new Date(m.lastUpdated).toLocaleString("zh-CN",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})]})]},m.id))}):l.jsx("div",{className:"text-center py-8",children:a?l.jsxs("div",{children:[l.jsx(Vr,{className:"w-8 h-8 text-gray-300 mx-auto mb-2"}),l.jsx("p",{className:"text-sm text-gray-500",children:c("sessionDropdown.noMatchingSessions")})]}):l.jsxs("div",{children:[l.jsx(Kn,{className:"w-8 h-8 text-gray-300 mx-auto mb-2"}),l.jsx("p",{className:"text-sm text-gray-500",children:c("sessionDropdown.noSessionHistory")}),l.jsx("p",{className:"text-xs text-gray-400 mt-1",children:c("sessionDropdown.sessionWillAppear")})]})})})]}):null};function Vm(e,t){return t?e.replace(/@([\w.-]+(?:\/[\w.-]+)*(?:\.\w+)?)/g,(n,r)=>r.startsWith("/")?r:t+"/"+r):e}function Ui(e,t,n){let r=e.content;return t&&(r=r.replace(/\$ARGUMENTS/g,t)),r=Vm(r,n),`<command-message>${t?`${e.description} (参数: ${t})`:e.description}</command-message><command-name>${r}</command-name>`}function jt(e){return e.startsWith("/")}function Um(e){return e.startsWith("/")?e.slice(1):""}class qm{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,n){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,n)}}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:`
|
|
47
|
-
可用命令:
|
|
48
|
-
• /clear - 清空对话历史
|
|
49
|
-
• /init - 初始化项目或重置对话上下文
|
|
50
|
-
• /compact - 压缩对话历史
|
|
51
|
-
• /agents - 管理AI代理
|
|
52
|
-
• /settings - 打开设置页面
|
|
53
|
-
• /help - 显示帮助信息
|
|
54
|
-
`.trim(),action:"none"}}handleCustomCommand(t,n){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 Wm(e){return new qm(e)}class Xm{events=new Map;on(t,n){this.events.has(t)||this.events.set(t,[]),this.events.get(t).push(n)}off(t,n){const r=this.events.get(t);if(r){const i=r.indexOf(n);i>-1&&r.splice(i,1)}}emit(t,...n){const r=this.events.get(t);r&&r.forEach(i=>{try{i(...n)}catch(s){console.error(`Error in event handler for ${t}:`,s)}})}clear(){this.events.clear()}}const Qt=new Xm,Gt={AI_RESPONSE_COMPLETE:"ai_response_complete",REFRESH_AGENT_CONTENT:"refresh_agent_content"},Ym=({agent:e,projectPath:t,onSessionChange:n})=>{const{t:r}=oe("components"),{isCompactMode:i}=Al(),[s,a]=v.useState(""),[o,c]=v.useState(!1),[u,h]=v.useState(""),[d,m]=v.useState([]),[f,p]=v.useState(!1),[g,C]=v.useState([]),[b,E]=v.useState(null),[j,T]=v.useState(!1),[I,w]=v.useState(!1),[M,V]=v.useState(""),[B,k]=v.useState(null),[F,R]=v.useState(0),[$,z]=v.useState(!1),[U,O]=v.useState(""),[X,be]=v.useState(null),[Ne,x]=v.useState(!1),[ge,De]=v.useState([]),[y,Ee]=v.useState("acceptEdits"),[ye,pe]=v.useState("sonnet"),[Ke,_e]=v.useState(!1),[Ze,Ye]=v.useState(!1),[Ae,dt]=v.useState(void 0),[D,H]=v.useState(!1),[re,ie]=v.useState(null),[Y,Z]=v.useState(!1),[Te,st]=v.useState(!1),[Oe,gt]=v.useState(!1),[Se,xt]=v.useState(!1),[en,N]=v.useState(!1),[P,G]=v.useState(!1),[te,le]=v.useState("默认服务");v.useEffect(()=>{const S=gl(),Q=xl(S);Q&&le(Q.name)},[]);const $e=v.useRef(null),Be=v.useRef(null),Qe=v.useRef(null),He=v.useRef(null),{messages:at,isAiTyping:de,currentSessionId:K,addMessage:xe,addTextPartToMessage:wt,addThinkingPartToMessage:ha,addToolPartToMessage:fa,updateToolPartInMessage:En,setAiTyping:vt,setCurrentSessionId:tn,clearMessages:Tn,loadSessionMessages:In}=ut(),Lt=ts(),ma=hl(),pa=ul(),{data:Or}=cl(e.id,u,t),{data:lt,isLoading:Dn}=dl(e.id,K,t),{data:An}=pl();Dl({agentId:e.id,sessionId:K,projectPath:t,enabled:!!K,isNewSession:Te,hasSuccessfulResponse:Y}),v.useEffect(()=>$t.startSmartMonitoring(),[]),v.useEffect(()=>{if(K&&e.id)return console.log(`🎯 Setting up wakeup listener for session: ${K}`),$t.setupWakeupListener(e.id,K)},[K,e.id]);const{data:nn=[]}=Zi({scope:"user",search:M}),{data:rn=[]}=es({projectId:t||"",search:M}),{data:Ge}=ml(),ot=v.useMemo(()=>Ge?.versions?Ae?Ge.versions.find(ue=>ue.id===Ae)?.models||[]:(Ge.versions.find(Q=>Q.id===Ge.defaultVersionId)||Ge.versions[0])?.models||[]:[],[Ge,Ae]);v.useEffect(()=>{ot.length>0&&(ot.some(Q=>Q.id===ye)||pe(ot[0].id))},[ot,ye]);const Mt=[{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}],sn=S=>{const Q=Mt.find(ke=>ke.name===S),ue=rn.find(ke=>ke.name===S),ae=nn.find(ke=>ke.name===S);return!!(Q||ue||ae)},$r=()=>{if(de||!s.trim()&&g.length===0)return!0;if(jt(s)){const S=s.slice(1).split(" ")[0].toLowerCase();return!sn(S)}return!1},ht=v.useMemo(()=>[...Mt.filter(Q=>Q.name.toLowerCase().includes(M.toLowerCase())||Q.description.toLowerCase().includes(M.toLowerCase())),...rn,...nn],[nn,rn,M]),ga=v.useMemo(()=>at.map(S=>l.jsx("div",{className:"px-4",children:l.jsx("div",{className:`text-sm leading-relaxed break-words overflow-hidden ${S.role==="user"?"text-white p-3 rounded-lg":"text-gray-800 dark:text-gray-200"}`,style:S.role==="user"?{backgroundColor:"hsl(var(--primary))",color:"hsl(var(--primary-foreground))"}:{},children:l.jsx(Bm,{message:S})})},S.id)),[at]);v.useEffect(()=>{R(S=>ht.length>0&&S>=ht.length?0:S)},[ht.length]),v.useEffect(()=>{if(e?.allowedTools?.length>0){const S=e.allowedTools.filter(ae=>ae.enabled),Q=[],ue=[];S.forEach(ae=>{if(ae.name.includes(".")&&!ae.name.startsWith("mcp__")){const[ke,q]=ae.name.split("."),je=`mcp__${ke}__${q}`;ue.push(je)}else ae.name.startsWith("mcp__")?ue.push(ae.name):Q.push(ae.name)}),De(ae=>[...new Set([...ae,...Q])]),ue.length>0&&(p(!0),m(ae=>[...new Set([...ae,...ue])]))}},[e?.allowedTools]);const xa=S=>{const Q=S.target.files;if(!Q)return;Array.from(Q).filter(ae=>ae.type.startsWith("image/")&&["image/jpeg","image/png","image/gif","image/webp"].includes(ae.type)).forEach(ae=>{const ke=Date.now().toString()+Math.random().toString(36).substr(2,9),q=new FileReader;q.onload=je=>{je.target?.result&&C(Ie=>[...Ie,{id:ke,file:ae,preview:je.target.result}])},q.readAsDataURL(ae)}),S.target&&(S.target.value="")},ya=S=>{C(Q=>Q.filter(ue=>ue.id!==S))},ba=S=>{E(S)},ka=S=>{const Q=S.clipboardData?.items;if(Q)for(let ue=0;ue<Q.length;ue++){const ae=Q[ue];if(ae.type.startsWith("image/")){const ke=ae.getAsFile();if(ke){const q=Date.now().toString()+Math.random().toString(36).substr(2,9),je=new FileReader;je.onload=Ie=>{Ie.target?.result&&C(ee=>[...ee,{id:q,file:ke,preview:Ie.target.result}])},je.readAsDataURL(ke)}}}},wa=S=>{S.preventDefault(),T(!0)},va=S=>{S.preventDefault(),T(!1)},Ca=S=>{S.preventDefault(),T(!1);const Q=S.dataTransfer?.files;if(!Q)return;Array.from(Q).filter(ae=>ae.type.startsWith("image/")&&["image/jpeg","image/png","image/gif","image/webp"].includes(ae.type)).forEach(ae=>{const ke=Date.now().toString()+Math.random().toString(36).substr(2,9),q=new FileReader;q.onload=je=>{je.target?.result&&C(Ie=>[...Ie,{id:ke,file:ae,preview:je.target.result}])},q.readAsDataURL(ae)})},Sa=()=>{$e.current?.scrollIntoView({behavior:"smooth"})};v.useEffect(()=>{Sa()},[at,de]);const Pn=async()=>{if(!s.trim()&&g.length===0||de)return;let S=s.trim();const ue=[...g].map(q=>({id:q.id,data:q.preview.split(",")[1],mediaType:q.file.type,name:q.file.name}));if(jt(s)){const q=s.slice(1).split(" ")[0].toLowerCase();if(!sn(q)){ie(r("agentChat.unknownCommandWarning",{command:q,commands:Mt.map(ee=>ee.content).join(", ")}));return}ie(null);const je=Wm({agentStore:ut.getState(),onNewSession:Br,onNavigate:ee=>{il(r("agentChat.navigateToAlert",{path:ee}))},onConfirm:(ee,_)=>{O(ee),be(()=>_),z(!0)}});let Ie=B;if(Ie||(Ie=Mt.find(ee=>ee.name===q)||rn.find(ee=>ee.name===q)||nn.find(ee=>ee.name===q)||null),Ie){const ee=await je.executeCommand(Ie);if(ee.shouldSendToBackend){S=s.trim();const _=s.slice(Ie.content.length).trim()||void 0,L=Ui(Ie,_,t);xe({content:L,role:"user",images:ue})}else{const _=s.slice(Ie.content.length).trim()||void 0,L=Ui(Ie,_,t);xe({content:L,role:"user",images:ue}),a(""),C([]),k(null),w(!1),ee.message&&ee.action!=="confirm"&&xe({content:ee.message,role:"assistant"});return}}}else ie(null);a(""),C([]),k(null),w(!1),jt(s.trim())||xe({content:S||r("agentChat.sendImage"),role:"user",images:ue});const ae={};vt(!0),K||(console.log("🆕 No current session, will create new session"),N(!0));const ke=new AbortController;He.current=ke;try{let q=null;const je=S.trim()==="/compact",Ie=[...ge,...f&&d.length>0?d:[]];await ma.mutateAsync({agentId:e.id,message:S,images:ue.length>0?ue:void 0,context:ae,sessionId:K,projectPath:t,mcpTools:Ie.length>0?Ie:void 0,permissionMode:y,model:ye,claudeVersion:Ae,abortController:ke,onMessage:ee=>{console.log("Received SSE message:",ee);const _=ee;if(_.type==="error"){console.error("Claude Code SDK error:",_),vt(!1),N(!1),He.current=null;let L=`${r("agentChat.errorMessages.claudeCodeSDKError")}
|
|
55
|
-
|
|
56
|
-
`;_.error==="Claude Code SDK failed"&&_.message&&typeof _.message=="string"?_.message.includes("not valid JSON")?L+=r("agentChatPanel.errors.jsonParseError"):_.message.includes("timeout")?L+=r("agentChatPanel.errors.timeoutError"):L+=`${_.message}
|
|
57
|
-
|
|
58
|
-
**${r("agentChatPanel.errors.suggestedActions")}**
|
|
59
|
-
- ${r("agentChatPanel.errors.resendMessage")}
|
|
60
|
-
- ${r("agentChatPanel.errors.refreshPage")}`:L+=`${_.error||r("agentChatPanel.errors.unknownError")}
|
|
61
|
-
|
|
62
|
-
**${r("agentChatPanel.errors.suggestedActions")}**
|
|
63
|
-
- ${r("agentChatPanel.errors.resendMessage")}
|
|
64
|
-
- ${r("agentChatPanel.errors.refreshPage")}`,q?wt(q,`
|
|
65
|
-
|
|
66
|
-
`+L):xe({content:L,role:"assistant"});return}if(_.type==="system"&&_.subtype==="init"&&(_.sessionId||_.session_id)){const L=_.sessionId||_.session_id;console.log("Setting session ID from AI response:",L),N(!1),!K&&L&&(tn(L),st(!0),n&&n(L),Lt.invalidateQueries({queryKey:["agent-sessions",e.id]}))}else if(_.type==="session_resumed"&&_.subtype==="new_branch"){const L=_;console.log("🔄 Session resumed with new branch:",L),console.log("🔄 Updating session ID from",K,"to",L.newSessionId),N(!1),tn(L.newSessionId),st(!0),n&&(console.log("🔄 Updating URL with new session ID:",L.newSessionId),n(L.newSessionId)),xe({content:`${r("agentChat.sessionResumed")}
|
|
67
|
-
|
|
68
|
-
${L.message}
|
|
69
|
-
|
|
70
|
-
${r("agentChat.sessionIdUpdated")}`,role:"assistant"}),Lt.invalidateQueries({queryKey:["agent-sessions",e.id]}),K&&L.originalSessionId&&L.newSessionId&&($t.handleSessionResume(e.id,L.originalSessionId,L.newSessionId),$t.recordSessionResume(e.id,L.originalSessionId,L.newSessionId),console.log(`🎯 TabManager updated for session resume: ${L.originalSessionId} → ${L.newSessionId}`)),console.log("✅ Session resume handling complete")}else if(!(_.type==="system"&&_.subtype==="init")){if(_.type==="assistant"){if(!q){xe({content:"",role:"assistant"});const we=ut.getState();q=we.messages[we.messages.length-1].id,console.log("📝 Created new AI message with ID:",q)}if(_.message&&typeof _.message=="object"&&"content"in _.message&&_.message.content&&q){console.log("📝 Processing assistant message content blocks:",_.message.content.length,"aiMessageId:",q);for(const L of _.message.content)if(console.log("📝 Processing block:",{type:L.type,hasText:!!L.text,hasThinking:!!L.thinking,textLength:L.text?.length,thinkingLength:L.thinking?.length,toolName:L.name}),L.type==="text")L.text?(console.log("📝 Adding text part:",L.text.substring(0,100)+(L.text.length>100?"...":"")),je&&console.log("📦 Detected /compact command response, adding as compactSummary"),wt(q,L.text)):console.warn("📝 Text block has no text content");else if(L.type==="thinking")L.thinking?(console.log("🤔 Adding thinking part:",L.thinking.substring(0,100)+(L.thinking.length>100?"...":"")),ha(q,L.thinking)):console.warn("🤔 Thinking block has no thinking content");else if(L.type==="tool_use"){if(L.name){console.log("📝 Adding tool part:",L.name,"id:",L.id);const we={toolName:L.name,toolInput:L.input||{},isExecuting:!0,claudeId:L.id};fa(q,we)}}else console.log("📝 Unknown block type:",L.type)}else console.warn("📝 No content or aiMessageId for assistant message:",{hasMessage:!!_.message,hasContent:!!_.message?.content,aiMessageId:q})}else if(_.type==="user"&&_.message&&typeof _.message=="object"&&"content"in _.message&&_.message.content&&q){for(const L of _.message.content)if(L.type==="tool_result"&&L.tool_use_id){console.log("🔧 Processing tool_result for tool_use_id:",L.tool_use_id);const we=ut.getState();let ve=null,Pe=null;for(const ce of we.messages)if(ce.messageParts){const qe=ce.messageParts.find(et=>et.type==="tool"&&et.toolData?.claudeId===L.tool_use_id);if(qe){ve=qe,Pe=ce.id;break}}if(console.log("🔧 Found target tool:",{toolData:ve?.toolData,messageId:Pe,currentMessageId:q}),ve?.toolData&&Pe){const ce=typeof L.content=="string"?L.content:Array.isArray(L.content)?L.content.map(qe=>qe.text||String(qe)).join(""):JSON.stringify(L.content);console.log("🔧 Updating tool with result, setting isExecuting: false"),En(Pe,ve.toolData.id,{toolResult:ce,isError:L.is_error||!1,isExecuting:!1})}else{console.warn("🔧 No target tool found for tool_use_id:",L.tool_use_id);const ce=we.messages.flatMap(qe=>(qe.messageParts||[]).filter(et=>et.type==="tool").map(et=>({claudeId:et.toolData?.claudeId,toolName:et.toolData?.toolName,isExecuting:et.toolData?.isExecuting})));console.warn("🔧 Available tools:",ce)}}}}if(_.type==="assistant"&&_.message&&typeof _.message=="object"&&"content"in _.message&&_.message.content&&q){for(const L of _.message.content)if(L.type==="tool_result"&&L.tool_use_id){console.log("🔧 Processing tool_result in assistant message for tool_use_id:",L.tool_use_id);const we=ut.getState();let ve=null,Pe=null;for(const ce of we.messages)if(ce.messageParts){const qe=ce.messageParts.find(et=>et.type==="tool"&&et.toolData?.claudeId===L.tool_use_id);if(qe){ve=qe,Pe=ce.id;break}}if(console.log("🔧 Found target tool in assistant message:",{toolData:ve?.toolData,messageId:Pe,currentMessageId:q}),ve?.toolData&&Pe){const ce=typeof L.content=="string"?L.content:Array.isArray(L.content)?L.content.map(qe=>qe.text||String(qe)).join(""):JSON.stringify(L.content);console.log("🔧 Updating tool with result in assistant message, setting isExecuting: false"),En(Pe,ve.toolData.id,{toolResult:ce,isError:L.is_error||!1,isExecuting:!1})}else console.warn("🔧 No target tool found for tool_use_id in assistant message:",L.tool_use_id)}}else if(_.type==="result"){console.log("Received result event:",{subtype:_.subtype,isSideChain:_.isSideChain});const L=_.isSideChain;if(L?console.log("Side chain result received, continuing main task..."):(console.log("Main task result received, stopping AI typing..."),He.current=null,vt(!1),_.subtype==="success"&&(Z(!0),console.log("✅ Marked session as having successful response for heartbeat"),Qt.emit(Gt.AI_RESPONSE_COMPLETE,{agentId:e.id,sessionId:K,projectPath:t}),console.log("📡 Emitted AI_RESPONSE_COMPLETE event"))),!L){if(!q&&_.subtype==="success"){console.log("📝 Creating AI message from result event - no assistant messages received");const ve=_.result;if(ve&&typeof ve=="string"){xe({content:"",role:"assistant"});const ce=ut.getState();q=ce.messages[ce.messages.length-1].id,wt(q,ve),console.log("📝 Added result content to new AI message:",ve.substring(0,100))}else{console.warn("📝 Result event with no content - creating empty success message");const Pe={content:r("agentChat.taskComplete"),role:"assistant"};xe(Pe);const ce=ut.getState();q=ce.messages[ce.messages.length-1].id}}if(q){const Pe=ut.getState().messages.find(ce=>ce.id===q);Pe?.messageParts&&Pe.messageParts.forEach(ce=>{ce.type==="tool"&&ce.toolData?.isExecuting&&(console.log("Force completing tool:",ce.toolData.toolName,"claudeId:",ce.toolData.claudeId),En(q,ce.toolData.id,{isExecuting:!1,toolResult:ce.toolData.toolResult||r("agentChat.executionCompleted")}))})}let we="";_.subtype==="success"?we="":_.subtype==="error_max_turns"?(we=`
|
|
71
|
-
|
|
72
|
-
${r("agentChat.maxTurnsReached")}`,_.permission_denials&&_.permission_denials.length>0&&(we+=`
|
|
73
|
-
|
|
74
|
-
${r("agentChat.permissionDenials")}`,_.permission_denials.forEach((ve,Pe)=>{we+=`
|
|
75
|
-
${Pe+1}. ${ve.tool_name}: \`${ve.tool_input.command||ve.tool_input.description||JSON.stringify(ve.tool_input)}\``}),we+=`
|
|
76
|
-
|
|
77
|
-
${r("agentChat.permissionNote")}`)):_.subtype==="error_during_execution"?we=`
|
|
78
|
-
|
|
79
|
-
${r("agentChat.executionError")}`:_.subtype==="error"?we=`
|
|
80
|
-
|
|
81
|
-
${r("agentChat.processingError")}`:we=`
|
|
82
|
-
|
|
83
|
-
${r("agentChat.processingComplete")}`,q&&we&&wt(q,we),K&&Lt.invalidateQueries({queryKey:["agent-sessions",e.id]})}}},onError:ee=>{if(console.error("SSE error:",ee),vt(!1),N(!1),He.current=null,ee instanceof DOMException&&ee.name==="AbortError"){console.log("Request was aborted by user");return}let _=r("agentChat.genericError");ee instanceof Error&&(ee.message.includes("network")||ee.message.includes("fetch")?_=r("agentChatPanel.errors.networkError"):ee.message.includes("timeout")?_=r("agentChatPanel.errors.requestTimeout"):ee.message.includes("rate limit")||ee.message.includes("429")?_=r("agentChatPanel.errors.rateLimit"):ee.message.includes("unauthorized")||ee.message.includes("401")?_=r("agentChatPanel.errors.unauthorized"):ee.message.includes("forbidden")||ee.message.includes("403")?_=r("agentChatPanel.errors.forbidden"):ee.message.includes("500")||ee.message.includes("internal server")?_=r("agentChatPanel.errors.internalServerError"):_=`❌ **${r("agentChatPanel.errors.processingError")}**
|
|
84
|
-
|
|
85
|
-
${ee.message||r("agentChatPanel.errors.unknownErrorRetry")}`),q?wt(q,`
|
|
86
|
-
|
|
87
|
-
`+_):xe({content:_,role:"assistant"})}})}catch(q){if(console.error("Chat error:",q),vt(!1),N(!1),He.current=null,q instanceof DOMException&&q.name==="AbortError"){console.log("Request was aborted by user");return}let je=r("agentChatPanel.errors.connectionFailed");q instanceof Error&&(q.message.includes("Failed to fetch")||q.message.includes("NetworkError")?je=r("agentChatPanel.errors.networkConnectionFailed"):q.message.includes("timeout")?je=r("agentChatPanel.errors.connectionTimeout"):je=`❌ **${r("agentChatPanel.errors.connectionError")}**
|
|
88
|
-
|
|
89
|
-
${q.message||r("agentChatPanel.errors.cannotConnectRetry")}`),xe({content:je,role:"assistant"})}},ja=S=>{tn(S),c(!1),G(!0),st(!1),Z(!1),n&&n(S),Tn(),Lt.invalidateQueries({queryKey:["agent-session-messages",e.id,S]})},Br=()=>{tn(null),Tn(),c(!1),st(!0),Z(!1),n&&n(null),h("")},Na=()=>{K&&(G(!0),Tn(),Lt.invalidateQueries({queryKey:["agent-session-messages",e.id,K]}))},Ea=async()=>{if(!(!He.current||!K))try{xt(!0),console.log("🛑 Stopping generation for session:",K);try{await pa.mutateAsync(K),console.log("✅ Successfully interrupted session via API")}catch(S){console.error("❌ Failed to interrupt session:",S);const Q=S instanceof Error?S.message:"Unknown error";xe({content:`${r("agentChat.stopFailed")}
|
|
90
|
-
|
|
91
|
-
${Q}`,role:"assistant"}),xt(!1);return}He.current.abort(),He.current=null,vt(!1),xt(!1),N(!1),xe({content:r("agentChat.generationStopped"),role:"assistant"})}catch(S){console.error("Error stopping generation:",S),xt(!1),N(!1)}},Ta=S=>{if(S.key==="Enter"&&!S.shiftKey){if(S.preventDefault(),I&&ht.length>0){const Q=ht[F];Q?Hr(Q):Pn();return}if(jt(s)){const Q=s.slice(1).split(" ")[0].toLowerCase();if(!sn(Q)){ie(r("agentChat.unknownCommandWarning",{command:Q,commands:Mt.map(ue=>ue.content).join(", ")}));return}}Pn();return}if(I&&ht.length>0){if(S.key==="ArrowUp"||S.ctrlKey&&S.key==="p"){S.preventDefault(),R(Q=>Q>0?Q-1:ht.length-1);return}if(S.key==="ArrowDown"||S.ctrlKey&&S.key==="n"){S.preventDefault(),R(Q=>Q<ht.length-1?Q+1:0);return}if(S.key==="Escape"){S.preventDefault(),w(!1);return}}},Ia=v.useCallback(S=>{},[]),Da=v.useCallback(S=>{const Q=S.target.value;if(a(Q),re&&ie(null),jt(Q)){const ue=Um(Q);ue!==M&&(V(ue),R(0)),I||w(!0)}else I&&(w(!1),k(null),R(0))},[re,M,I]),Hr=S=>{k(S),a(S.content),w(!1),Be.current&&Be.current.focus()},Aa=()=>{w(!1)},Pa=()=>{X&&X(),z(!1),O(""),be(null)},La=()=>{z(!1),O(""),be(null)},Ma=()=>{if(!Be.current)return{top:0,left:0};const S=Be.current.getBoundingClientRect();return{top:S.top,left:S.left}},Ra=()=>{const S=Be.current;S&&(S.style.height="auto",S.style.height=Math.min(S.scrollHeight,100)+"px")};return v.useEffect(()=>{Ra()},[s]),v.useEffect(()=>{console.log("🔍 Session messages effect triggered:",{sessionMessagesData:lt?.messages?.length||0,currentSessionId:K,hasSessionMessagesData:!!lt,messagesLength:lt?.messages?.length,isLoadingMessages:P}),lt?.messages&&K?(console.log("✅ Loading session messages:",lt.messages.length),In(lt.messages),P&&setTimeout(()=>{G(!1)},100)):K&<&<.messages?.length===0&&(console.log("🗑️ Loading empty session messages"),In([]),P&&setTimeout(()=>{G(!1)},100))},[lt,K,In,P,r]),v.useEffect(()=>{const S=Q=>{Q.target.closest(".dropdown-container")||(_e(!1),Ye(!1),H(!1))};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[]),v.useEffect(()=>{if(!K||!An?.sessions){gt(!1);return}const S=An.sessions.find(Q=>Q.sessionId===K);S?(console.log(`🔒 Found active session: ${K}, version: ${S.claudeVersionId}`),S.claudeVersionId?(dt(S.claudeVersionId),gt(!0),console.log(`🔒 Locked to Claude version: ${S.claudeVersionId}`)):(gt(!1),console.log("🔓 Session has no specific version, unlocked"))):(gt(!1),console.log(`🔓 Session ${K} not in active sessions, unlocked`))},[K,An]),l.jsxs("div",{className:"flex flex-col h-full bg-white dark:bg-gray-900",children:[l.jsx("div",{className:"px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-100 dark:bg-gray-800",children:l.jsxs("div",{className:"flex items-center justify-between min-h-[36px]",children:[l.jsx("div",{className:"flex-1 min-w-0",children:l.jsxs("h1",{className:"text-base font-semibold flex items-center space-x-2 text-gray-900 dark:text-white",children:[l.jsx("span",{className:"text-lg flex-shrink-0",children:e.ui.icon}),l.jsxs("span",{className:"truncate",children:["[",te,"]"]}),t&&l.jsx("span",{className:"text-sm opacity-75 font-normal truncate flex-shrink-0",title:t,children:t.split("/").pop()||t}),K&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-sm opacity-75",children:"-"}),l.jsx("span",{className:"text-sm opacity-75 truncate",children:Or?.sessions?.find(S=>S.id===K)?.title||r("agentChat.currentSession")})]})]})}),l.jsxs("div",{className:"flex space-x-1 flex-shrink-0 ml-2",children:[l.jsx("button",{onClick:Br,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:r("agentChat.newSession"),children:l.jsx(qa,{className:"w-4 h-4"})}),l.jsxs("div",{className:"relative",children:[l.jsx("button",{onClick:()=>c(!o),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:r("agentChat.sessionHistory"),children:l.jsx(Kn,{className:"w-4 h-4"})}),l.jsx(Hm,{isOpen:o,onToggle:()=>c(!o),sessions:Or?.sessions||[],currentSessionId:K,onSwitchSession:ja,isLoading:!1,searchTerm:u,onSearchChange:h})]}),l.jsx("button",{onClick:Na,disabled:!K||P||Dn,className:"p-2 hover:bg-white/20 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:r("agentChat.refreshMessages"),children:l.jsx(Ki,{className:`w-5 h-5 ${P||Dn?"animate-spin":""}`})})]})]})}),l.jsxs("div",{className:"flex-1 px-5 py-5 overflow-y-auto space-y-4",children:[l.jsx("div",{className:"px-4",children:l.jsx("div",{className:"text-sm leading-relaxed break-words overflow-hidden text-gray-600 dark:text-gray-400",children:e.ui.welcomeMessage||e.description})}),P||Dn&&K?l.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-3",children:[l.jsxs("div",{className:"flex space-x-2",children:[l.jsx("div",{className:"w-3 h-3 bg-gray-400 dark:bg-gray-500 rounded-full animate-bounce"}),l.jsx("div",{className:"w-3 h-3 bg-gray-400 dark:bg-gray-500 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),l.jsx("div",{className:"w-3 h-3 bg-gray-400 dark:bg-gray-500 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]}),l.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:r("agentChat.loadingMessages")})]}):ga,(de||Se||en)&&l.jsxs("div",{className:"flex flex-col items-center py-2 space-y-2",children:[l.jsxs("div",{className:"flex space-x-1",children:[l.jsx("div",{className:"w-2 h-2 bg-gray-400 dark:bg-gray-500 rounded-full animate-bounce"}),l.jsx("div",{className:"w-2 h-2 bg-gray-400 dark:bg-gray-500 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),l.jsx("div",{className:"w-2 h-2 bg-gray-400 dark:bg-gray-500 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]}),Se&&l.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:r("agentChat.stopping")}),!Se&&en&&l.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:r("agentChat.initializingSession")})]}),l.jsx("div",{ref:$e})]}),l.jsxs("div",{className:`border-t border-gray-200 dark:border-gray-700 ${j?"bg-blue-50 dark:bg-blue-900/30 border-blue-300 dark:border-blue-700":""}`,onDragOver:wa,onDragLeave:va,onDrop:Ca,children:[g.length>0&&l.jsx("div",{className:"p-4 pb-2 border-b border-gray-100 dark:border-gray-700",children:l.jsx("div",{className:"flex flex-wrap gap-2",children:g.map(S=>l.jsxs("div",{className:"relative group",children:[l.jsx("img",{src:S.preview,alt:r("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:()=>ba(S.preview)}),l.jsx("button",{onClick:()=>ya(S.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:r("agentChat.deleteImage"),children:l.jsx(Ut,{className:"w-3 h-3"})})]},S.id))})}),j&&l.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:l.jsxs("div",{className:"text-blue-600 dark:text-blue-300 text-lg font-medium flex items-center space-x-2",children:[l.jsx(Ur,{className:"w-6 h-6"}),l.jsx("span",{children:r("agentChat.dropImageHere")})]})}),re&&l.jsx("div",{className:"px-4 pt-3 pb-2",children:l.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:[l.jsx("div",{className:"flex-shrink-0",children:l.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:l.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"})})}),l.jsx("div",{className:"flex-1",children:l.jsx("p",{className:"text-sm text-red-800 dark:text-red-300",children:re})})]})}),l.jsx("div",{className:"p-4 pb-2",children:l.jsx("textarea",{ref:Be,value:s,onChange:Da,onKeyDown:Ta,onKeyPress:Ia,onPaste:ka,placeholder:g.length>0?r("agentChat.addDescription"):r("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:de})}),l.jsx("div",{className:"px-4 pb-4 pt-2 border-t border-gray-100 dark:border-gray-700",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center space-x-1",children:[l.jsx("input",{ref:Qe,type:"file",accept:"image/jpeg,image/png,image/gif,image/webp",multiple:!0,onChange:xa,className:"hidden"}),l.jsxs("div",{className:"relative",children:[l.jsx("button",{onClick:()=>x(!Ne),className:`p-2 transition-colors rounded-lg ${Ne||ge.length>0||d.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("agentChat.toolSelection"),disabled:de,children:l.jsx(Wa,{className:"w-4 h-4"})}),(ge.length>0||f&&d.length>0)&&l.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:ge.length+(f?d.filter(S=>S.startsWith("mcp__")&&S.split("__").length===3).length:0)}),l.jsx(Cl,{isOpen:Ne,onClose:()=>x(!1),selectedRegularTools:ge,onRegularToolsChange:De,selectedMcpTools:d,onMcpToolsChange:m,mcpToolsEnabled:f,onMcpEnabledChange:p,presetTools:e.allowedTools})]}),l.jsxs("div",{className:"relative",children:[l.jsx("button",{onClick:()=>Qe.current?.click(),className:`p-2 transition-colors rounded-lg ${g.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:g.length>0?r("agentChat.imageSelection")+` (${r("agentChat.selectedCount",{count:g.length})})`:r("agentChat.imageSelection"),disabled:de,children:l.jsx(Ur,{className:"w-4 h-4"})}),g.length>0&&l.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:g.length})]})]}),l.jsxs("div",{className:"flex items-center space-x-2",children:[i?l.jsx(Tl,{permissionMode:y,onPermissionModeChange:Ee,selectedClaudeVersion:Ae,onClaudeVersionChange:dt,selectedModel:ye,onModelChange:pe,availableModels:ot,claudeVersionsData:Ge,isVersionLocked:Oe,isAiTyping:de}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"relative dropdown-container",children:[l.jsxs("button",{onClick:()=>_e(!Ke),className:`flex items-center space-x-1 px-3 py-2 text-sm rounded-lg transition-colors ${y!=="default"?"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-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,disabled:de,children:[l.jsx(Gi,{className:"w-4 h-4"}),l.jsx("span",{className:"text-xs",children:r(`agentChat.permissionMode.${y}`)}),l.jsx(Et,{className:"w-3 h-3"})]}),Ke&&l.jsx("div",{className:"absolute bottom-full left-0 mb-2 w-32 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50",children:[{value:"default",label:r("agentChat.permissionMode.default")},{value:"acceptEdits",label:r("agentChat.permissionMode.acceptEdits")},{value:"bypassPermissions",label:r("agentChat.permissionMode.bypassPermissions")}].map(S=>l.jsx("button",{onClick:()=>{Ee(S.value),_e(!1)},className:`w-full text-left px-3 py-2 text-sm hover:bg-gray-50 dark:hover:bg-gray-700 first:rounded-t-lg last:rounded-b-lg ${y===S.value?"bg-blue-50 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400":"text-gray-700 dark:text-gray-300"}`,children:S.label},S.value))})]}),Ge?.versions&&Ge.versions.length>1&&l.jsxs("div",{className:"relative dropdown-container",children:[l.jsxs("button",{onClick:()=>!Oe&&H(!D),className:`flex items-center space-x-1 px-3 py-2 text-sm rounded-lg transition-colors ${Oe?"text-gray-400 dark:text-gray-500 bg-gray-100 dark:bg-gray-800 cursor-not-allowed":Ae?"text-green-600 dark:text-green-400 bg-green-50 dark:bg-green-900/30 hover:bg-green-100 dark:hover:bg-green-900/50":"text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,disabled:de||Oe,title:r(Oe?"agentChat.claudeVersion.locked":"agentChat.claudeVersion.title"),children:[l.jsx(Jn,{className:"w-4 h-4"}),l.jsx("span",{className:"text-xs",children:Ae?Ge.versions.find(S=>S.id===Ae)?.name||r("agentChat.claudeVersion.custom"):r("agentChat.claudeVersion.default")}),l.jsx(Et,{className:"w-3 h-3"})]}),D&&l.jsxs("div",{className:"absolute bottom-full left-0 mb-2 w-32 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50",children:[l.jsx("button",{onClick:()=>{dt(void 0),H(!1)},className:`w-full text-left px-3 py-2 text-sm hover:bg-gray-50 dark:hover:bg-gray-700 first:rounded-t-lg ${Ae?"text-gray-700 dark:text-gray-300":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300"}`,children:r("agentChat.claudeVersion.default")}),Ge.versions.filter(S=>S.id!==Ge.defaultVersionId).map(S=>l.jsx("button",{onClick:()=>{dt(S.id),H(!1)},className:`w-full text-left px-3 py-2 text-sm hover:bg-gray-50 dark:hover:bg-gray-700 last:rounded-b-lg ${Ae===S.id?"bg-green-50 dark:bg-green-900/30 text-green-600 dark:text-green-400":"text-gray-700 dark:text-gray-300"}`,children:l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("span",{children:S.name}),S.isSystem&&l.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["(",r("agentChat.claudeVersion.system"),")"]})]})},S.id))]})]}),ot.length>=2&&l.jsxs("div",{className:"relative dropdown-container",children:[l.jsxs("button",{onClick:()=>Ye(!Ze),className:`flex items-center space-x-1 px-3 py-2 text-sm rounded-lg transition-colors ${ye==="opus"?"text-purple-600 dark:text-purple-400 bg-purple-50 dark:bg-purple-900/30 hover:bg-purple-100 dark:hover:bg-purple-900/50":"text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,disabled:de,children:[l.jsx(Ji,{className:"w-4 h-4"}),l.jsx("span",{className:"text-xs whitespace-nowrap overflow-hidden text-ellipsis max-w-[100px]",title:ot.find(S=>S.id===ye)?.name||r(`agentChat.model.${ye}`),children:ot.find(S=>S.id===ye)?.name||r(`agentChat.model.${ye}`)}),l.jsx(Et,{className:"w-3 h-3"})]}),Ze&&l.jsx("div",{className:"absolute bottom-full left-0 mb-2 min-w-[160px] max-w-[200px] bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50",children:ot.map(S=>l.jsx("button",{onClick:()=>{pe(S.id),Ye(!1)},className:`w-full text-left px-3 py-2 text-sm hover:bg-gray-50 dark:hover:bg-gray-700 first:rounded-t-lg last:rounded-b-lg ${ye===S.id?"bg-purple-50 dark:bg-purple-900/30 text-purple-600 dark:text-purple-400":"text-gray-700 dark:text-gray-300"}`,title:S.description,children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"whitespace-nowrap overflow-hidden text-ellipsis flex-1 pr-2",title:S.name,children:S.name}),S.isVision&&l.jsx("span",{className:"text-xs text-gray-400 flex-shrink-0",children:"👁️"})]})},S.id))})]})]}),de||Se?l.jsxs("button",{onClick:Ea,disabled:Se,className:`flex items-center space-x-2 px-4 py-2 text-white rounded-lg transition-colors text-sm font-medium shadow-sm ${Se?"bg-red-400 cursor-not-allowed":"bg-red-600 hover:bg-red-700"}`,title:r(Se?"agentChatPanel.stopping":"agentChatPanel.stopGeneration"),children:[l.jsx(Xa,{className:"w-4 h-4"}),l.jsx("span",{children:r(Se?"agentChatPanel.stopping":"agentChatPanel.stop")})]}):l.jsxs("button",{onClick:Pn,disabled:$r(),className:"flex items-center space-x-2 px-4 py-2 text-white rounded-lg hover:opacity-90 disabled:bg-gray-300 disabled:cursor-not-allowed transition-all duration-200 text-sm font-medium shadow-sm",style:{backgroundColor:$r()?void 0:"hsl(var(--primary))"},title:de?r("agentChatPanel.aiTyping"):!s.trim()&&g.length===0?r("agentChatPanel.noContentToSend"):jt(s)&&!sn(s.slice(1).split(" ")[0].toLowerCase())?r("agentChatPanel.unknownCommand"):r("agentChatPanel.sendMessage"),children:[l.jsx(Ya,{className:"w-4 h-4"}),l.jsx("span",{children:r("agentChatPanel.send")})]})]})]})})]}),l.jsx(Nl,{isOpen:I,onSelect:Hr,onClose:Aa,searchTerm:M,position:Ma(),projectId:t,selectedIndex:F,onSelectedIndexChange:R}),l.jsx(El,{isOpen:$,message:U,onConfirm:Pa,onCancel:La}),l.jsx(er,{images:b?[b]:[],onClose:()=>E(null)})]})},Qm=({children:e,defaultLeftWidth:t=35,minWidth:n=20,maxWidth:r=80,hideRightPanel:i=!1,onShowRightPanel:s,mobileLayout:a="stack"})=>{const{isMobile:o,rightPanelOpen:c,setRightPanelOpen:u}=sl(),[h,d]=v.useState(t),[m,f]=v.useState(!1),[p,g]=v.useState("left"),C=v.useRef(null),b=T=>{o||(T.preventDefault(),f(!0))},E=v.useCallback(T=>{if(!m||!C.current||o)return;const I=C.current.getBoundingClientRect(),w=(T.clientX-I.left)/I.width*100,M=Math.min(Math.max(w,n),r);d(M)},[m,n,r,o]),j=v.useCallback(()=>{f(!1)},[]);return v.useEffect(()=>(m&&!o?(document.addEventListener("mousemove",E),document.addEventListener("mouseup",j),document.body.style.cursor="col-resize",document.body.style.userSelect="none"):(document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",j),document.body.style.cursor="",document.body.style.userSelect=""),()=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",j),document.body.style.cursor="",document.body.style.userSelect=""}),[m,E,j,o]),o?a==="tabs"?l.jsxs("div",{className:"flex flex-col h-full bg-gray-100",children:[l.jsxs("div",{className:"flex border-b border-gray-200 bg-white",children:[l.jsx("button",{onClick:()=>{g("left"),u(!1)},className:`flex-1 px-4 py-3 text-sm font-medium transition-colors ${p==="left"&&!c?"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"}),l.jsx("button",{onClick:()=>{g("right"),u(!0)},className:`flex-1 px-4 py-3 text-sm font-medium transition-colors ${p==="right"||c?"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"})]}),l.jsx("div",{className:"flex-1 overflow-hidden",children:!i&&(p==="right"||c)?l.jsx("div",{className:"h-full",children:e[1]}):l.jsx("div",{className:"h-full",children:e[0]})})]}):l.jsxs("div",{className:"flex flex-col h-full bg-gray-100",children:[l.jsx("div",{className:"flex-1 overflow-hidden",children:e[0]}),!i&&c&&l.jsxs("div",{className:"fixed inset-0 z-50 lg:hidden",children:[l.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-50",onClick:()=>u(!1)}),l.jsxs("div",{className:"absolute inset-4 bg-white rounded-lg shadow-xl overflow-hidden",children:[l.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Preview"}),l.jsx("button",{onClick:()=>u(!1),className:"p-2 text-gray-500 hover:text-gray-700 rounded-md hover:bg-gray-100",children:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),l.jsx("div",{className:"h-[calc(100%-73px)]",children:e[1]})]})]}),!i&&!c&&s&&l.jsx("button",{onClick:()=>u(!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:l.jsxs("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),l.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"})]})})]}):l.jsxs("div",{ref:C,className:"flex h-full bg-gray-100",children:[l.jsx("div",{className:"flex flex-col",style:{width:i?"100%":`${h}%`},children:e[0]}),!i&&l.jsx("div",{className:`w-1 bg-gray-300 hover:bg-blue-400 cursor-col-resize transition-colors relative ${m?"bg-blue-500":""}`,onMouseDown:b,children:l.jsx("div",{className:"absolute inset-y-0 left-1/2 transform -translate-x-1/2 w-1 bg-gray-400 opacity-50 hover:opacity-100"})}),!i&&l.jsx("div",{className:"flex flex-col border-l border-gray-200",style:{width:`${100-h}%`},children:e[1]}),i&&s&&l.jsx("div",{className:"fixed top-0 right-0 h-full w-2 bg-blue-500 opacity-60 hover:opacity-90 hover:w-4 hover:bg-blue-600 transition-all duration-300 cursor-pointer z-50 group",onClick:s,title:"点击显示右侧面板",children:l.jsx("div",{className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-0.5 h-8 bg-white opacity-0 group-hover:opacity-70 transition-opacity duration-300 rounded-full"})})]})};function Gm(e){return Re({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M0 32l34.9 395.8L192 480l157.1-52.2L384 32H0zm313.1 80l-4.8 47.3L193 208.6l-.3.1h111.5l-12.8 146.6-98.2 28.7-98.8-29.2-6.4-73.9h48.9l3.2 38.3 52.6 13.3 54.7-15.4 3.7-61.6-166.3-.5v-.1l-.2.1-3.6-46.3L193.1 162l6.5-2.7H76.7L70.9 112h242.2z"},child:[]}]})(e)}function qi(e){return Re({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M0 32l34.9 395.8L191.5 480l157.6-52.2L384 32H0zm308.2 127.9H124.4l4.1 49.4h175.6l-13.6 148.4-97.9 27v.3h-1.1l-98.7-27.3-6-75.8h47.7L138 320l53.5 14.5 53.7-14.5 6-62.2H84.3L71.5 112.2h241.1l-4.4 47.7z"},child:[]}]})(e)}function Jm(e){return Re({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M277.74 312.9c9.8-6.7 23.4-12.5 23.4-12.5s-38.7 7-77.2 10.2c-47.1 3.9-97.7 4.7-123.1 1.3-60.1-8 33-30.1 33-30.1s-36.1-2.4-80.6 19c-52.5 25.4 130 37 224.5 12.1zm-85.4-32.1c-19-42.7-83.1-80.2 0-145.8C296 53.2 242.84 0 242.84 0c21.5 84.5-75.6 110.1-110.7 162.6-23.9 35.9 11.7 74.4 60.2 118.2zm114.6-176.2c.1 0-175.2 43.8-91.5 140.2 24.7 28.4-6.5 54-6.5 54s62.7-32.4 33.9-72.9c-26.9-37.8-47.5-56.6 64.1-121.3zm-6.1 270.5a12.19 12.19 0 0 1-2 2.6c128.3-33.7 81.1-118.9 19.8-97.3a17.33 17.33 0 0 0-8.2 6.3 70.45 70.45 0 0 1 11-3c31-6.5 75.5 41.5-20.6 91.4zM348 437.4s14.5 11.9-15.9 21.2c-57.9 17.5-240.8 22.8-291.6.7-18.3-7.9 16-19 26.8-21.3 11.2-2.4 17.7-2 17.7-2-20.3-14.3-131.3 28.1-56.4 40.2C232.84 509.4 401 461.3 348 437.4zM124.44 396c-78.7 22 47.9 67.4 148.1 24.5a185.89 185.89 0 0 1-28.2-13.8c-44.7 8.5-65.4 9.1-106 4.5-33.5-3.8-13.9-15.2-13.9-15.2zm179.8 97.2c-78.7 14.8-175.8 13.1-233.3 3.6 0-.1 11.8 9.7 72.4 13.6 92.2 5.9 233.8-3.3 237.1-46.9 0 0-6.4 16.5-76.2 29.7zM260.64 353c-59.2 11.4-93.5 11.1-136.8 6.6-33.5-3.5-11.6-19.7-11.6-19.7-86.8 28.8 48.2 61.4 169.5 25.9a60.37 60.37 0 0 1-21.1-12.8z"},child:[]}]})(e)}function Km(e){return Re({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM243.8 381.4c0 43.6-25.6 63.5-62.9 63.5-33.7 0-53.2-17.4-63.2-38.5l34.3-20.7c6.6 11.7 12.6 21.6 27.1 21.6 13.8 0 22.6-5.4 22.6-26.5V237.7h42.1v143.7zm99.6 63.5c-39.1 0-64.4-18.6-76.7-43l34.3-19.8c9 14.7 20.8 25.6 41.5 25.6 17.4 0 28.6-8.7 28.6-20.8 0-14.4-11.4-19.5-30.7-28l-10.5-4.5c-30.4-12.9-50.5-29.2-50.5-63.5 0-31.6 24.1-55.6 61.6-55.6 26.8 0 46 9.3 59.8 33.7L368 290c-7.2-12.9-15-18-27.1-18-12.3 0-20.1 7.8-20.1 18 0 12.6 7.8 17.7 25.9 25.6l10.5 4.5c35.8 15.3 55.9 31 55.9 66.2 0 37.8-29.8 58.6-69.7 58.6z"},child:[]}]})(e)}function Zm(e){return Re({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M593.8 59.1H46.2C20.7 59.1 0 79.8 0 105.2v301.5c0 25.5 20.7 46.2 46.2 46.2h547.7c25.5 0 46.2-20.7 46.1-46.1V105.2c0-25.4-20.7-46.1-46.2-46.1zM338.5 360.6H277v-120l-61.5 76.9-61.5-76.9v120H92.3V151.4h61.5l61.5 76.9 61.5-76.9h61.5v209.2zm135.3 3.1L381.5 256H443V151.4h61.5V256H566z"},child:[]}]})(e)}function ep(e){return Re({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z"},child:[]}]})(e)}function tp(e){return Re({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M418.2 177.2c-5.4-1.8-10.8-3.5-16.2-5.1.9-3.7 1.7-7.4 2.5-11.1 12.3-59.6 4.2-107.5-23.1-123.3-26.3-15.1-69.2.6-112.6 38.4-4.3 3.7-8.5 7.6-12.5 11.5-2.7-2.6-5.5-5.2-8.3-7.7-45.5-40.4-91.1-57.4-118.4-41.5-26.2 15.2-34 60.3-23 116.7 1.1 5.6 2.3 11.1 3.7 16.7-6.4 1.8-12.7 3.8-18.6 5.9C38.3 196.2 0 225.4 0 255.6c0 31.2 40.8 62.5 96.3 81.5 4.5 1.5 9 3 13.6 4.3-1.5 6-2.8 11.9-4 18-10.5 55.5-2.3 99.5 23.9 114.6 27 15.6 72.4-.4 116.6-39.1 3.5-3.1 7-6.3 10.5-9.7 4.4 4.3 9 8.4 13.6 12.4 42.8 36.8 85.1 51.7 111.2 36.6 27-15.6 35.8-62.9 24.4-120.5-.9-4.4-1.9-8.9-3-13.5 3.2-.9 6.3-1.9 9.4-2.9 57.7-19.1 99.5-50 99.5-81.7 0-30.3-39.4-59.7-93.8-78.4zM282.9 92.3c37.2-32.4 71.9-45.1 87.7-36 16.9 9.7 23.4 48.9 12.8 100.4-.7 3.4-1.4 6.7-2.3 10-22.2-5-44.7-8.6-67.3-10.6-13-18.6-27.2-36.4-42.6-53.1 3.9-3.7 7.7-7.2 11.7-10.7zM167.2 307.5c5.1 8.7 10.3 17.4 15.8 25.9-15.6-1.7-31.1-4.2-46.4-7.5 4.4-14.4 9.9-29.3 16.3-44.5 4.6 8.8 9.3 17.5 14.3 26.1zm-30.3-120.3c14.4-3.2 29.7-5.8 45.6-7.8-5.3 8.3-10.5 16.8-15.4 25.4-4.9 8.5-9.7 17.2-14.2 26-6.3-14.9-11.6-29.5-16-43.6zm27.4 68.9c6.6-13.8 13.8-27.3 21.4-40.6s15.8-26.2 24.4-38.9c15-1.1 30.3-1.7 45.9-1.7s31 .6 45.9 1.7c8.5 12.6 16.6 25.5 24.3 38.7s14.9 26.7 21.7 40.4c-6.7 13.8-13.9 27.4-21.6 40.8-7.6 13.3-15.7 26.2-24.2 39-14.9 1.1-30.4 1.6-46.1 1.6s-30.9-.5-45.6-1.4c-8.7-12.7-16.9-25.7-24.6-39s-14.8-26.8-21.5-40.6zm180.6 51.2c5.1-8.8 9.9-17.7 14.6-26.7 6.4 14.5 12 29.2 16.9 44.3-15.5 3.5-31.2 6.2-47 8 5.4-8.4 10.5-17 15.5-25.6zm14.4-76.5c-4.7-8.8-9.5-17.6-14.5-26.2-4.9-8.5-10-16.9-15.3-25.2 16.1 2 31.5 4.7 45.9 8-4.6 14.8-10 29.2-16.1 43.4zM256.2 118.3c10.5 11.4 20.4 23.4 29.6 35.8-19.8-.9-39.7-.9-59.5 0 9.8-12.9 19.9-24.9 29.9-35.8zM140.2 57c16.8-9.8 54.1 4.2 93.4 39 2.5 2.2 5 4.6 7.6 7-15.5 16.7-29.8 34.5-42.9 53.1-22.6 2-45 5.5-67.2 10.4-1.3-5.1-2.4-10.3-3.5-15.5-9.4-48.4-3.2-84.9 12.6-94zm-24.5 263.6c-4.2-1.2-8.3-2.5-12.4-3.9-21.3-6.7-45.5-17.3-63-31.2-10.1-7-16.9-17.8-18.8-29.9 0-18.3 31.6-41.7 77.2-57.6 5.7-2 11.5-3.8 17.3-5.5 6.8 21.7 15 43 24.5 63.6-9.6 20.9-17.9 42.5-24.8 64.5zm116.6 98c-16.5 15.1-35.6 27.1-56.4 35.3-11.1 5.3-23.9 5.8-35.3 1.3-15.9-9.2-22.5-44.5-13.5-92 1.1-5.6 2.3-11.2 3.7-16.7 22.4 4.8 45 8.1 67.9 9.8 13.2 18.7 27.7 36.6 43.2 53.4-3.2 3.1-6.4 6.1-9.6 8.9zm24.5-24.3c-10.2-11-20.4-23.2-30.3-36.3 9.6.4 19.5.6 29.5.6 10.3 0 20.4-.2 30.4-.7-9.2 12.7-19.1 24.8-29.6 36.4zm130.7 30c-.9 12.2-6.9 23.6-16.5 31.3-15.9 9.2-49.8-2.8-86.4-34.2-4.2-3.6-8.4-7.5-12.7-11.5 15.3-16.9 29.4-34.8 42.2-53.6 22.9-1.9 45.7-5.4 68.2-10.5 1 4.1 1.9 8.2 2.7 12.2 4.9 21.6 5.7 44.1 2.5 66.3zm18.2-107.5c-2.8.9-5.6 1.8-8.5 2.6-7-21.8-15.6-43.1-25.5-63.8 9.6-20.4 17.7-41.4 24.5-62.9 5.2 1.5 10.2 3.1 15 4.7 46.6 16 79.3 39.8 79.3 58 0 19.6-34.9 44.9-84.8 61.4zm-149.7-15c25.3 0 45.8-20.5 45.8-45.8s-20.5-45.8-45.8-45.8c-25.3 0-45.8 20.5-45.8 45.8s20.5 45.8 45.8 45.8z"},child:[]}]})(e)}function np(e){return Re({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M181.9 256.1c-5-16-4.9-46.9-2-46.9 8.4 0 7.6 36.9 2 46.9zm-1.7 47.2c-7.7 20.2-17.3 43.3-28.4 62.7 18.3-7 39-17.2 62.9-21.9-12.7-9.6-24.9-23.4-34.5-40.8zM86.1 428.1c0 .8 13.2-5.4 34.9-40.2-6.7 6.3-29.1 24.5-34.9 40.2zM248 160h136v328c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V24C0 10.7 10.7 0 24 0h200v136c0 13.2 10.8 24 24 24zm-8 171.8c-20-12.2-33.3-29-42.7-53.8 4.5-18.5 11.6-46.6 6.2-64.2-4.7-29.4-42.4-26.5-47.8-6.8-5 18.3-.4 44.1 8.1 77-11.6 27.6-28.7 64.6-40.8 85.8-.1 0-.1.1-.2.1-27.1 13.9-73.6 44.5-54.5 68 5.6 6.9 16 10 21.5 10 17.9 0 35.7-18 61.1-61.8 25.8-8.5 54.1-19.1 79-23.2 21.7 11.8 47.1 19.5 64 19.5 29.2 0 31.2-32 19.7-43.4-13.9-13.6-54.3-9.7-73.6-7.2zM377 105L279 7c-4.5-4.5-10.6-7-17-7h-6v128h128v-6.1c0-6.3-2.5-12.4-7-16.9zm-74.1 255.3c4.1-2.7-2.5-11.9-42.8-9 37.1 15.8 42.8 9 42.8 9z"},child:[]}]})(e)}function Wi(e){return Re({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm57.1 120H305c7.7 0 13.4 7.1 11.7 14.7l-38 168c-1.2 5.5-6.1 9.3-11.7 9.3h-38c-5.5 0-10.3-3.8-11.6-9.1-25.8-103.5-20.8-81.2-25.6-110.5h-.5c-1.1 14.3-2.4 17.4-25.6 110.5-1.3 5.3-6.1 9.1-11.6 9.1H117c-5.6 0-10.5-3.9-11.7-9.4l-37.8-168c-1.7-7.5 4-14.6 11.7-14.6h24.5c5.7 0 10.7 4 11.8 9.7 15.6 78 20.1 109.5 21 122.2 1.6-10.2 7.3-32.7 29.4-122.7 1.3-5.4 6.1-9.1 11.7-9.1h29.1c5.6 0 10.4 3.8 11.7 9.2 24 100.4 28.8 124 29.6 129.4-.2-11.2-2.6-17.8 21.6-129.2 1-5.6 5.9-9.5 11.5-9.5zM384 121.9v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"},child:[]}]})(e)}function da(e){return Re({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm160-14.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"},child:[]}]})(e)}function rp(e){return Re({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z"},child:[]}]})(e)}function ip(e){return Re({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 128H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48z"},child:[]}]})(e)}function mt(e){return Re({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"},child:[]}]})(e)}function sp(e){return Re({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4.708 5.578L2.061 8.224l2.647 2.646-.708.708-3-3V7.87l3-3 .708.708zm7-.708L11 5.578l2.647 2.646L11 10.87l.708.708 3-3V7.87l-3-3zM4.908 13l.894.448 5-10L9.908 3l-5 10z"},child:[]}]})(e)}function ap(e){return Re({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M6 2.984V2h-.09c-.313 0-.616.062-.909.185a2.33 2.33 0 0 0-.775.53 2.23 2.23 0 0 0-.493.753v.001a3.542 3.542 0 0 0-.198.83v.002a6.08 6.08 0 0 0-.024.863c.012.29.018.58.018.869 0 .203-.04.393-.117.572v.001a1.504 1.504 0 0 1-.765.787 1.376 1.376 0 0 1-.558.115H2v.984h.09c.195 0 .38.04.556.121l.001.001c.178.078.329.184.455.318l.002.002c.13.13.233.285.307.465l.001.002c.078.18.117.368.117.566 0 .29-.006.58-.018.869-.012.296-.004.585.024.87v.001c.033.283.099.558.197.824v.001c.106.273.271.524.494.753.223.23.482.407.775.53.293.123.596.185.91.185H6v-.984h-.09c-.2 0-.387-.038-.563-.115a1.613 1.613 0 0 1-.457-.32 1.659 1.659 0 0 1-.309-.467c-.074-.18-.11-.37-.11-.573 0-.228.003-.453.011-.672.008-.228.008-.45 0-.665a4.639 4.639 0 0 0-.055-.64 2.682 2.682 0 0 0-.168-.609A2.284 2.284 0 0 0 3.522 8a2.284 2.284 0 0 0 .738-.955c.08-.192.135-.393.168-.602.033-.21.051-.423.055-.64.008-.22.008-.442 0-.666-.008-.224-.012-.45-.012-.678a1.47 1.47 0 0 1 .877-1.354 1.33 1.33 0 0 1 .563-.121H6zm4 10.032V14h.09c.313 0 .616-.062.909-.185.293-.123.552-.3.775-.53.223-.23.388-.48.493-.753v-.001c.1-.266.165-.543.198-.83v-.002c.028-.28.036-.567.024-.863-.012-.29-.018-.58-.018-.869 0-.203.04-.393.117-.572v-.001a1.502 1.502 0 0 1 .765-.787 1.38 1.38 0 0 1 .558-.115H14v-.984h-.09c-.196 0-.381-.04-.557-.121l-.001-.001a1.376 1.376 0 0 1-.455-.318l-.002-.002a1.415 1.415 0 0 1-.307-.465v-.002a1.405 1.405 0 0 1-.118-.566c0-.29.006-.58.018-.869a6.174 6.174 0 0 0-.024-.87v-.001a3.537 3.537 0 0 0-.197-.824v-.001a2.23 2.23 0 0 0-.494-.753 2.331 2.331 0 0 0-.775-.53 2.325 2.325 0 0 0-.91-.185H10v.984h.09c.2 0 .387.038.562.115.174.082.326.188.457.32.127.134.23.29.309.467.074.18.11.37.11.573 0 .228-.003.452-.011.672-.008.228-.008.45 0 .665.004.222.022.435.055.64.033.214.089.416.168.609a2.285 2.285 0 0 0 .738.955 2.285 2.285 0 0 0-.738.955 2.689 2.689 0 0 0-.168.602c-.033.21-.051.423-.055.64a9.15 9.15 0 0 0 0 .666c.008.224.012.45.012.678a1.471 1.471 0 0 1-.877 1.354 1.33 1.33 0 0 1-.563.121H10z"},child:[]}]})(e)}function Xi(e){return Re({attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M1.125 0C.502 0 0 .502 0 1.125v21.75C0 23.498.502 24 1.125 24h21.75c.623 0 1.125-.502 1.125-1.125V1.125C24 .502 23.498 0 22.875 0zm17.363 9.75c.612 0 1.154.037 1.627.111a6.38 6.38 0 0 1 1.306.34v2.458a3.95 3.95 0 0 0-.643-.361 5.093 5.093 0 0 0-.717-.26 5.453 5.453 0 0 0-1.426-.2c-.3 0-.573.028-.819.086a2.1 2.1 0 0 0-.623.242c-.17.104-.3.229-.393.374a.888.888 0 0 0-.14.49c0 .196.053.373.156.529.104.156.252.304.443.444s.423.276.696.41c.273.135.582.274.926.416.47.197.892.407 1.266.628.374.222.695.473.963.753.268.279.472.598.614.957.142.359.214.776.214 1.253 0 .657-.125 1.21-.373 1.656a3.033 3.033 0 0 1-1.012 1.085 4.38 4.38 0 0 1-1.487.596c-.566.12-1.163.18-1.79.18a9.916 9.916 0 0 1-1.84-.164 5.544 5.544 0 0 1-1.512-.493v-2.63a5.033 5.033 0 0 0 3.237 1.2c.333 0 .624-.03.872-.09.249-.06.456-.144.623-.25.166-.108.29-.234.373-.38a1.023 1.023 0 0 0-.074-1.089 2.12 2.12 0 0 0-.537-.5 5.597 5.597 0 0 0-.807-.444 27.72 27.72 0 0 0-1.007-.436c-.918-.383-1.602-.852-2.053-1.405-.45-.553-.676-1.222-.676-2.005 0-.614.123-1.141.369-1.582.246-.441.58-.804 1.004-1.089a4.494 4.494 0 0 1 1.47-.629 7.536 7.536 0 0 1 1.77-.201zm-15.113.188h9.563v2.166H9.506v9.646H6.789v-9.646H3.375z"},child:[]}]})(e)}const lp=(e,t)=>ns({queryKey:["file-content",e,t],queryFn:async()=>{if(!e)throw new Error("File path is required");const n=new URLSearchParams;n.append("path",e),t&&n.append("projectPath",t);const r=await qt(`${It}/files/read?${n.toString()}`);if(!r.ok)throw r.status===403?new Error("访问被拒绝:文件在项目目录之外"):r.status===404?new Error("文件不存在"):new Error(`读取文件失败 (${r.status})`);return r.json()},enabled:!!e,staleTime:6e4,retry:!1}),op=e=>ns({queryKey:["file-tree-lazy",e],queryFn:async()=>{if(!e)throw new Error("Project path is required");const t=new URLSearchParams;t.append("path",e);const n=await qt(`${It}/files/browse?${t.toString()}`);if(!n.ok)throw new Error("Failed to browse directory");const r=await n.json(),i=[];for(const s of r.items)s.isHidden||(s.isDirectory?i.push({...s,children:[]}):i.push(s));return i},enabled:!!e,staleTime:3e4}),up=v.lazy(()=>vl(()=>import("./monaco-editor-C7Z4sOhS.js").then(e=>e.i),[])),cp=new Map([["js",l.jsx(Km,{color:"#f7df1e"},"js")],["jsx",l.jsx(tp,{color:"#61dafb"},"jsx")],["ts",l.jsx(Xi,{color:"#3178c6"},"ts")],["tsx",l.jsx(Xi,{color:"#3178c6"},"tsx")],["css",l.jsx(Gm,{color:"#1572b6"},"css")],["html",l.jsx(qi,{color:"#e34f26"},"html")],["htm",l.jsx(qi,{color:"#e34f26"},"htm")],["json",l.jsx(ap,{color:"#f9d71c"},"json")],["md",l.jsx(Zm,{color:"#083fa1"},"md")],["pdf",l.jsx(np,{color:"#d63031"},"pdf")],["ppt",l.jsx(Wi,{color:"#d63031"},"ppt")],["pptx",l.jsx(Wi,{color:"#d63031"},"pptx")],["ico",l.jsx(mt,{color:"#a9a9a9"},"ico")],["png",l.jsx(mt,{color:"#a9a9a9"},"png")],["jpg",l.jsx(mt,{color:"#a9a9a9"},"jpg")],["jpeg",l.jsx(mt,{color:"#a9a9a9"},"jpeg")],["gif",l.jsx(mt,{color:"#a9a9a9"},"gif")],["svg",l.jsx(mt,{color:"#a9a9a9"},"svg")],["webp",l.jsx(mt,{color:"#a9a9a9"},"webp")],["py",l.jsx(ep,{color:"#3776ab"},"py")],["java",l.jsx(Jm,{color:"#007396"},"java")]]),br=({node:e})=>{if(e.data.isDirectory)return e.isOpen?l.jsx(rp,{color:"#87b3d6"}):l.jsx(ip,{color:"#87b3d6"});const t=e.data.name.split(".").pop()?.toLowerCase()||"";return cp.get(t)||l.jsx(da,{color:"#6d8a9f"})},dp=(e="")=>{switch(e.split(".").pop()?.toLowerCase()||""){case"js":case"jsx":return"javascript";case"ts":case"tsx":return"typescript";case"css":return"css";case"json":return"json";case"html":case"htm":return"html";case"md":return"markdown";case"py":return"python";case"java":return"java";case"xml":return"xml";case"yaml":case"yml":return"yaml";default:return"plaintext"}},hp=({imageUrl:e,fileName:t})=>{const{t:n}=oe("components"),[r,i]=v.useState(!0),[s,a]=v.useState(!1);return l.jsx("div",{className:"flex items-center justify-center h-full p-4",children:s?l.jsxs("div",{className:"text-center text-gray-500",children:[l.jsx(mt,{className:"w-12 h-12 mx-auto mb-4 text-gray-300"}),l.jsx("p",{children:n("fileExplorer.imageLoadFailed")}),l.jsx("p",{className:"text-sm mt-2",children:t})]}):l.jsxs("div",{className:"relative max-w-full max-h-full",children:[r&&l.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:l.jsx(mn,{className:"w-8 h-8 animate-spin text-gray-400"})}),l.jsx("img",{src:e,alt:t,className:"max-w-full max-h-full object-contain bg-white rounded shadow-lg",onLoad:()=>i(!1),onError:()=>{i(!1),a(!0)},style:{display:s?"none":"block"}})]})})},fp=e=>{const t=e.split(".").pop()?.toLowerCase()||"",n=["js","jsx","ts","tsx","css","html","htm","json","md","txt","py","java","xml","yaml","yml","sh","bat","php","rb","go","rs","cpp","c","h","hpp","cs","swift","kt","scala","clj","sql","dockerfile","gitignore","env"],r=["png","jpg","jpeg","gif","svg","webp","ico","bmp","tiff"];return n.includes(t)?"text":r.includes(t)?"image":"binary"},mp=({node:e,style:t,dragHandle:n,isLoading:r=!1,onDirectoryToggle:i,onFileSelect:s})=>{const a=v.useCallback(o=>{o.preventDefault(),o.stopPropagation(),e.data.isDirectory?i?.(e):s?.(e)},[e,i,s]);return l.jsxs("div",{style:t,ref:n,className:`flex items-center cursor-pointer px-2 py-1 hover:bg-gray-100 dark:hover:bg-gray-700 ${e.isSelected?"bg-blue-100 dark:bg-blue-900/30 text-blue-900 dark:text-blue-300":"text-gray-700 dark:text-gray-300"}`,onClick:a,children:[e.data.isDirectory&&l.jsx("span",{className:"mr-1 flex items-center",children:r?l.jsx(mn,{className:"w-3 h-3 animate-spin text-gray-400"}):l.jsx(kr,{className:`w-3 h-3 transition-transform text-gray-400 ${e.isOpen?"rotate-90":""}`})}),l.jsx("span",{className:"mr-2 flex items-center",children:l.jsx(br,{node:e})}),l.jsx("span",{className:"text-sm truncate flex-1",children:e.data.name}),!e.data.isDirectory&&e.data.size&&l.jsxs("span",{className:"text-xs text-gray-400 dark:text-gray-500 ml-2",children:[(e.data.size/1024).toFixed(1),"KB"]})]})},dn=5,Yi=({projectPath:e,onFileSelect:t,className:n="",height:r="100vh"})=>{const{t:i}=oe("components"),[s,a]=v.useState([]),[o,c]=v.useState(null),[u,h]=v.useState(null),[d,m]=v.useState(600),[f,p]=v.useState(!1),g=v.useRef(null),C=v.useRef(null),b=v.useRef(null),[E,j]=v.useState(0),[T,I]=v.useState(""),[w,M]=v.useState(new Set),[V,B]=v.useState([]),[k,F]=v.useState(new Set),{data:R,isLoading:$,error:z,refetch:U}=op(e),O=v.useMemo(()=>s.find(D=>D.id===o)||null,[s,o]),{data:X,isLoading:be,error:Ne}=lp(O?O.path:void 0,e);v.useEffect(()=>{if(R){const D=ie=>ie.map(Y=>({id:Y.path,name:Y.name,path:Y.path,isDirectory:Y.isDirectory,size:Y.size,modified:Y.modified,isHidden:Y.isHidden,children:Y.children?D(Y.children):void 0})),H=(ie,Y=new Set)=>(ie.forEach(Z=>{Z.isDirectory&&Z.children&&Z.children.length>0&&(Y.add(Z.path),H(Z.children,Y))}),Y),re=H(R);M(re),B(D(R))}},[R]);const x=v.useCallback(async D=>{if(w.has(D)||k.has(D)){console.log("Directory already loaded or loading:",D);return}console.log("Starting to load directory:",D),F(H=>new Set(H).add(D));try{const H=new URLSearchParams;H.append("path",D);const re=await qt(`${It}/files/browse?${H.toString()}`);if(!re.ok)throw new Error("Failed to browse directory");const ie=await re.json(),Y=[];for(const Z of ie.items)Z.isHidden||(Z.isDirectory?Y.push({...Z,children:[]}):Y.push(Z));console.log("Loaded",Y.length,"items for directory:",D),B(Z=>{const Te=st=>st.map(Oe=>Oe.path===D?{...Oe,children:Y.map(Se=>({id:Se.path,name:Se.name,path:Se.path,isDirectory:Se.isDirectory,size:Se.size,modified:Se.modified,isHidden:Se.isHidden,children:Se.isDirectory?[]:void 0}))}:Oe.children?{...Oe,children:Te(Oe.children)}:Oe);return Te(Z)}),M(Z=>new Set(Z).add(D)),console.log("Successfully loaded directory:",D),b.current&&Y.length>0&&Y.forEach(Z=>{Z.isDirectory&&b.current?.close(Z.path)})}catch(H){throw console.error("Failed to load directory children:",H),H}finally{F(H=>{const re=new Set(H);return re.delete(D),re})}},[w,k]),ge=v.useCallback(()=>{console.log("Refreshing file tree..."),M(new Set),F(new Set),U()},[U]);v.useEffect(()=>{const D=()=>{if(g.current){const ie=g.current.getBoundingClientRect(),Y=ie.height>0?ie.height:600;m(Y)}};let H=null;g.current&&(H=new ResizeObserver(ie=>{for(const Y of ie){const{height:Z}=Y.contentRect;Z>0&&m(Z)}}),H.observe(g.current));const re=setTimeout(D,100);return window.addEventListener("resize",D),()=>{clearTimeout(re),window.removeEventListener("resize",D),H&&H.disconnect()}},[R]),v.useEffect(()=>{const D=H=>{C.current&&!C.current.contains(H.target)&&p(!1)};if(f)return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[f]),v.useEffect(()=>{const D=H=>{console.log("🔄 Received AI_RESPONSE_COMPLETE event in FileExplorer:",H),H.projectPath===e&&(console.log("🔄 Auto-refreshing file tree after AI response completion"),ge())};return Qt.on(Gt.AI_RESPONSE_COMPLETE,D),()=>{Qt.off(Gt.AI_RESPONSE_COMPLETE,D)}},[e,ge]);const De=V,y=v.useMemo(()=>{const D={},H=re=>{re.forEach(ie=>{ie.isDirectory&&(D[ie.id]=!1,ie.children&&H(ie.children))})};return V&&V.length>0&&H(V),D},[V]),Ee=v.useCallback((D,H=!1)=>({id:`tab-${D.path}`,name:D.name,path:D.path,isPinned:H,isActive:!1}),[]),ye=v.useCallback((D,H=!1)=>{a(re=>{const ie=re.findIndex(Y=>Y.path===D.path);if(ie!==-1){const Y=re.map((Z,Te)=>({...Z,isActive:Te===ie,isPinned:H||Z.isPinned}));return c(Y[ie].id),Y}else{const Y=Ee(D,H);if(!H&&u){const Z=re.map(Te=>Te.id===u?{...Y,isActive:!0}:{...Te,isActive:!1});return c(Y.id),h(Y.id),Z}else{const Z=[...re.map(Te=>({...Te,isActive:!1})),{...Y,isActive:!0}];return c(Y.id),H||h(Y.id),Z}}}),t?.(D.path)},[Ee,u,t]),pe=v.useCallback(D=>{a(H=>{const re=H.findIndex(Y=>Y.id===D);if(re===-1)return H;const ie=H.filter(Y=>Y.id!==D);if(o===D)if(ie.length>0){const Y=Math.min(re,ie.length-1),Z=ie[Y];c(Z.id),ie[Y]={...Z,isActive:!0}}else c(null);return u===D&&h(null),ie})},[o,u]),Ke=v.useCallback(D=>{a(H=>H.map(re=>({...re,isActive:re.id===D}))),c(D)},[]),[_e,Ze]=v.useState({}),Ye=v.useCallback(D=>{const H=Date.now(),re=_e[D.data.path]||0;if(H-re<300){console.log("Debounce: ignoring rapid click for",D.data.path);return}Ze(Te=>({...Te,[D.data.path]:H}));const ie=D.isOpen,Y=D.data.children&&D.data.children.length>0,Z=w.has(D.data.path);ie?D.close():!Y&&!Z?(D.open(),x(D.data.path).catch(Te=>{console.error("Failed to load directory children:",Te),D.close()})):D.open()},[_e,w,x]),Ae=v.useCallback(D=>{D.select();const H=Date.now(),re=H-E<300&&T===D.data.path;j(H),I(D.data.path),re?ye(D.data,!0):setTimeout(()=>{Date.now()-H>=300&&ye(D.data,!1)},300)},[ye,E,T]),dt=()=>{if(!O)return l.jsx("div",{className:"flex items-center justify-center h-full text-gray-500 dark:text-gray-400",children:l.jsxs("div",{className:"text-center",children:[l.jsx(da,{className:"w-12 h-12 mx-auto mb-4 text-gray-300 dark:text-gray-600"}),l.jsx("p",{children:i("fileExplorer.selectFile")})]})});if(be)return l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400",children:[l.jsx(mn,{className:"w-5 h-5 animate-spin"}),l.jsx("span",{children:i("fileExplorer.loading")})]})});if(Ne)return l.jsx("div",{className:"flex items-center justify-center h-full text-red-500 dark:text-red-400",children:l.jsxs("div",{className:"text-center",children:[l.jsx("p",{className:"font-medium",children:i("fileExplorer.loadFailed")}),l.jsx("p",{className:"text-sm mt-2 bg-red-50 dark:bg-red-900/30 px-3 py-2 rounded border border-red-200 dark:border-red-800",children:Ne.message}),l.jsx("p",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:O.path})]})});switch(fp(O.name)){case"image":const H=new URLSearchParams;H.append("path",O.path),e&&H.append("projectPath",e),H.append("binary","true");const re=`${It}/files/read?${H.toString()}`;return l.jsx(hp,{imageUrl:re,fileName:O.name});case"text":return X?l.jsx(_a.Suspense,{fallback:l.jsx("div",{className:"flex items-center justify-center h-full text-gray-500 dark:text-gray-400",children:l.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-gray-900"})}),children:l.jsx(up,{height:"100%",theme:"vs-light",language:dp(O.name),value:X.content,options:{readOnly:!0,minimap:{enabled:!1},fontSize:14,wordWrap:"on",scrollBeyondLastLine:!1}})}):l.jsx("div",{className:"flex items-center justify-center h-full text-gray-500 dark:text-gray-400",children:l.jsx("p",{children:i("fileExplorer.cannotReadFile")})});default:return l.jsx("div",{className:"flex items-center justify-center h-full text-gray-500 dark:text-gray-400",children:l.jsxs("div",{className:"text-center",children:[l.jsx(sp,{className:"w-12 h-12 mx-auto mb-4 text-gray-300 dark:text-gray-600"}),l.jsx("p",{children:i("fileExplorer.previewNotSupported")}),l.jsxs("p",{className:"text-sm mt-2",children:[i("fileExplorer.fileLabel"),": ",O.name]})]})})}};return z?l.jsx("div",{className:`flex items-center justify-center h-full text-red-500 dark:text-red-400 ${n}`,style:{height:r},children:l.jsxs("div",{className:"text-center",children:[l.jsx("p",{className:"font-medium",children:i("fileExplorer.loadFailed")}),l.jsx("p",{className:"text-sm mt-2 bg-red-50 dark:bg-red-900/30 px-3 py-2 rounded border border-red-200 dark:border-red-800",children:z.message}),l.jsxs("p",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:[i("fileExplorer.projectPath"),": ",e]}),l.jsx("button",{onClick:()=>U(),className:"mt-4 px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 transition-colors",children:i("fileExplorer.retry")})]})}):l.jsxs("div",{className:`flex h-full bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden ${n}`,children:[l.jsxs("div",{className:"w-80 border-r border-gray-200 dark:border-gray-700 flex flex-col h-full",children:[l.jsx("div",{className:"h-12 px-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900 flex items-center flex-shrink-0",children:l.jsxs("div",{className:"flex items-center justify-between w-full",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:i("fileExplorer.title")}),l.jsx("button",{onClick:ge,className:"p-1.5 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",title:i("common:actions.refresh"),disabled:$,children:l.jsx(Ki,{className:`w-4 h-4 ${$?"animate-spin":""}`})})]})}),l.jsx("div",{ref:g,className:"flex-1 min-h-0",children:$?l.jsx("div",{className:"flex items-center justify-center h-32",children:l.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400",children:[l.jsx(mn,{className:"w-4 h-4 animate-spin"}),l.jsx("span",{className:"text-sm",children:i("fileExplorer.loading")})]})}):De.length===0?l.jsx("div",{className:"flex items-center justify-center h-32 text-gray-500 dark:text-gray-400",children:l.jsx("p",{className:"text-sm",children:i("fileExplorer.emptyDirectory")})}):l.jsx(za,{data:De,width:320,height:d,indent:16,rowHeight:32,initialOpenState:y,ref:b,children:D=>l.jsx(mp,{...D,isLoading:k.has(D.node.data.path),onDirectoryToggle:Ye,onFileSelect:Ae})})})]}),l.jsxs("div",{className:"flex-1 flex flex-col h-full",children:[l.jsx("div",{className:"h-12 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900 flex items-center flex-shrink-0",children:s.length>0?l.jsxs("div",{className:"flex items-center h-full w-full",children:[l.jsx("div",{className:"flex items-center h-full flex-1",children:s.slice(0,Math.min(dn,s.length)).map(D=>l.jsxs("div",{className:`group relative flex items-center h-full px-3 border-r border-gray-200 dark:border-gray-700 cursor-pointer transition-colors ${D.isActive?"bg-white dark:bg-gray-800 text-gray-900 dark:text-white":"bg-gray-50 dark:bg-gray-900 text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700"} ${D.isPinned?"":"italic"}`,onClick:()=>Ke(D.id),title:`${D.path} ${D.isPinned?"(固定)":"(临时)"}`,style:{minWidth:"120px",maxWidth:"180px"},children:[l.jsx(br,{node:{data:{name:D.name,isDirectory:!1},isOpen:!1}}),l.jsx("span",{className:"ml-2 text-sm truncate flex-1",children:D.name}),!D.isPinned&&l.jsx("span",{className:"ml-1 text-xs text-gray-400 dark:text-gray-500 flex-shrink-0",children:"•"}),l.jsx("button",{className:"ml-2 p-0.5 rounded opacity-0 group-hover:opacity-100 hover:bg-gray-200 dark:hover:bg-gray-600 transition-opacity flex-shrink-0",onClick:H=>{H.stopPropagation(),pe(D.id)},title:i("common:actions.close"),children:l.jsx(Ut,{className:"w-3 h-3"})})]},D.id))}),s.length>dn&&l.jsxs("div",{className:"relative",ref:C,children:[l.jsxs("button",{className:"flex items-center h-full px-3 text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-gray-900 dark:hover:text-white transition-colors border-l border-gray-200 dark:border-gray-700",onClick:()=>p(!f),title:`${s.length-dn} more tabs`,children:[l.jsx(Qa,{className:"w-4 h-4"}),l.jsx(Et,{className:"w-3 h-3 ml-1"})]}),f&&l.jsx("div",{className:"absolute top-full right-0 mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50 min-w-48 max-h-64 overflow-y-auto",children:s.slice(dn).map(D=>l.jsxs("div",{className:`flex items-center px-3 py-2 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700 ${D.isActive?"bg-blue-50 dark:bg-blue-900/30 text-blue-900 dark:text-blue-300":"text-gray-700 dark:text-gray-300"} ${D.isPinned?"":"italic"}`,onClick:()=>{Ke(D.id),p(!1)},title:`${D.path} ${D.isPinned?"(固定)":"(临时)"}`,children:[l.jsx(br,{node:{data:{name:D.name,isDirectory:!1},isOpen:!1}}),l.jsx("span",{className:"ml-2 truncate flex-1",children:D.name}),!D.isPinned&&l.jsx("span",{className:"ml-1 text-xs text-gray-400 dark:text-gray-500 flex-shrink-0",children:"•"}),l.jsx("button",{className:"ml-2 p-1 rounded opacity-0 group-hover:opacity-100 hover:bg-gray-200 dark:hover:bg-gray-600 transition-opacity flex-shrink-0",onClick:H=>{H.stopPropagation(),pe(D.id)},title:i("common:actions.close"),children:l.jsx(Ut,{className:"w-3 h-3"})})]},D.id))})]})]}):l.jsx("div",{className:"flex items-center justify-center w-full h-full text-gray-500 dark:text-gray-400",children:l.jsx("span",{className:"text-sm",children:i("fileExplorer.noFiles")})})}),l.jsx("div",{className:"flex-1 bg-white dark:bg-gray-800 min-h-0",children:dt()})]})]})},pp=({agent:e,projectPath:t,CustomComponent:n,onTogglePanel:r})=>{const[i,s]=v.useState(n?"custom":"files"),[a,o]=v.useState({x:0,y:0}),[c,u]=v.useState(!1),[h,d]=v.useState({x:0,y:0}),m=v.useRef(null),f=v.useRef(null);v.useEffect(()=>{const C=setTimeout(()=>{if(m.current){const b=m.current.getBoundingClientRect();o({x:window.innerWidth-b.width-16,y:window.innerHeight-b.height-16})}},100);return()=>{clearTimeout(C)}},[]),v.useEffect(()=>{const g=()=>{if(m.current){const C=m.current.getBoundingClientRect();o(b=>{const E=window.innerWidth-C.width-16,j=window.innerHeight-C.height-16,T=Math.min(Math.max(16,b.x),E),I=Math.min(Math.max(16,b.y),j);return T!==b.x||I!==b.y?{x:T,y:I}:b})}};return window.addEventListener("resize",g),()=>{window.removeEventListener("resize",g)}},[]);const p=g=>{u(!0),d({x:g.clientX-a.x,y:g.clientY-a.y}),g.preventDefault()};return v.useEffect(()=>{const g=b=>{if(!c||!m.current)return;const E=m.current.getBoundingClientRect(),j=Math.max(16,Math.min(window.innerWidth-E.width-16,b.clientX-h.x)),T=Math.max(16,Math.min(window.innerHeight-E.height-16,b.clientY-h.y));o({x:j,y:T})},C=()=>{u(!1)};if(c)return document.addEventListener("mousemove",g),document.addEventListener("mouseup",C),()=>{document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",C)}},[c,h]),l.jsxs("div",{ref:f,className:"h-full bg-white relative",children:[l.jsxs("div",{ref:m,className:`fixed z-50 flex bg-white shadow-lg rounded-lg border border-gray-200 transition-shadow ${c?"shadow-xl":"shadow-lg"}`,style:{left:`${a.x}px`,top:`${a.y}px`,cursor:c?"grabbing":"grab"},children:[l.jsx("div",{className:"flex items-center px-1 text-gray-400 hover:text-gray-600 cursor-grab active:cursor-grabbing border-r border-gray-200",onMouseDown:p,title:"拖拽移动",children:l.jsx(Ga,{className:"w-3 h-3"})}),n?l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:()=>s("custom"),className:`p-2 transition-colors ${i==="custom"?"bg-blue-500 text-white":"text-gray-600 hover:text-gray-900 hover:bg-gray-50"}`,title:"Agent 视图",children:l.jsx(Ja,{className:"w-4 h-4"})}),l.jsx("button",{onClick:()=>s("files"),className:`p-2 rounded-r-lg transition-colors ${i==="files"?"bg-blue-500 text-white":"text-gray-600 hover:text-gray-900 hover:bg-gray-50"}`,title:"文件浏览器",children:l.jsx(Ka,{className:"w-4 h-4"})})]}):l.jsx("button",{onClick:()=>{r?.(!0)},className:"p-2 rounded-r-lg transition-colors text-gray-600 hover:text-gray-900 hover:bg-gray-50",title:"隐藏文件浏览器",children:l.jsx(Za,{className:"w-4 h-4"})})]}),l.jsx("div",{className:"h-full overflow-hidden",children:n?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:`h-full ${i==="custom"?"block":"hidden"}`,children:l.jsx(n,{agent:e,projectPath:t})}),l.jsx("div",{className:`h-full ${i==="files"?"block":"hidden"}`,children:l.jsx(Yi,{projectPath:t,onFileSelect:g=>{console.log("Selected file:",g)},className:"h-full"})})]}):l.jsx(Yi,{projectPath:t,onFileSelect:g=>{console.log("Selected file:",g)},className:"h-full"})})]})},gp=({projectPath:e})=>{const{t}=oe("agents"),{data:n,isLoading:r,error:i}=yl(e),s=ts(),a=v.useRef({}),o=()=>{s.invalidateQueries({queryKey:["slides",e]}),s.invalidateQueries({queryKey:["slide-content"]}),Object.values(a.current).forEach(u=>{u?.refreshIframe&&u.refreshIframe()})};if(v.useEffect(()=>{const u=h=>{console.log("🔄 Received AI_RESPONSE_COMPLETE event in SlidePreviewPanel:",h),h.projectPath===e&&(console.log("🔄 Auto-refreshing slides after AI response completion"),o())};return Qt.on(Gt.AI_RESPONSE_COMPLETE,u),()=>{Qt.off(Gt.AI_RESPONSE_COMPLETE,u)}},[e,s]),r)return l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx("div",{className:"text-gray-500",children:t("slidePreview.loading")})});if(i)return l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx("div",{className:"text-red-500",children:t("slidePreview.loadError")})});const c=n?.slides||[];return l.jsxs("div",{className:"flex flex-col h-full bg-gray-50 dark:bg-gray-900",children:[l.jsx("div",{className:"px-5 py-4 bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:l.jsxs("div",{className:"flex flex-col",children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsxs("div",{className:"flex items-center space-x-3",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-800 dark:text-white",children:t("slidePreview.title")}),l.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:n?.title||"Presentation"})]}),l.jsxs("button",{onClick:o,disabled:r,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:[l.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.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"})}),l.jsx("span",{children:t("slidePreview.refresh")})]})]}),l.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:t("slidePreview.slideCount",{count:c.length})})]})}),l.jsx("div",{className:"flex-1 overflow-y-auto",children:c.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500 dark:text-gray-400 p-5",children:[l.jsx("div",{className:"text-lg mb-2",children:t("slidePreview.noSlides")}),l.jsx("div",{className:"text-sm",children:t("slidePreview.createWithAI")})]}):l.jsx("div",{className:"space-y-4 p-5",children:c.map(u=>l.jsx(bl,{ref:h=>{h?a.current[u.index]=h:delete a.current[u.index]},slide:u,totalSlides:c.length,projectPath:e},u.index))})})]})},xp={rightPanelComponent:gp,onMount:e=>{console.log(`Slides agent ${e} mounted`)},onUnmount:e=>{console.log(`Slides agent ${e} unmounted`)}},yp={onMount:e=>{console.log(`Chat agent ${e} mounted`)},onUnmount:e=>{console.log(`Chat agent ${e} unmounted`)}},bp={rightPanelComponent:kl,onMount:e=>{console.log(`Documents agent ${e} mounted`)},onUnmount:e=>{console.log(`Documents agent ${e} unmounted`)}},kp={rightPanelComponent:wl,onMount:e=>{console.log(`Code agent ${e} mounted`)},onUnmount:e=>{console.log(`Code agent ${e} unmounted`)}},wp={slides:xp,chat:yp,documents:bp,code:kp},vp=e=>wp[e],Fp=()=>{const{t:e}=oe("pages"),{agentId:t}=al(),[n]=ll(),r=ol(),i=n.get("project"),s=n.get("session"),{data:a,isLoading:o,error:c}=fl(t),{setCurrentAgent:u,setCurrentSessionId:h}=ut(),[d,m]=v.useState(!1),[f,p]=v.useState(!1),g=a?.agent;v.useEffect(()=>{console.log("🎯 ChatPage agent/session effect:",{hasAgent:!!g,agentId:g?.id,sessionId:s,urlSessionId:n.get("session")}),g&&(console.log("🎯 Setting current agent:",g.id),u(g),s&&(console.log("🎯 Setting session ID:",s),h(s)))},[g,s,u,h]),v.useEffect(()=>{g&&!i&&m(!0)},[g,i]);const C=V=>{const B=new URLSearchParams;B.set("project",V),s&&B.set("session",s),r(`/chat/${t}?${B.toString()}`,{replace:!0}),m(!1)},b=V=>{const B=new URLSearchParams;i&&B.set("project",i),V&&B.set("session",V),r(`/chat/${t}?${B.toString()}`,{replace:!0})},E=()=>{m(!1),r("/agents")},j=g?vp(g.ui.componentType):void 0,T=j?.rightPanelComponent;if(v.useEffect(()=>(g&&j?.onMount&&j.onMount(g.id),()=>{g&&j?.onUnmount&&j.onUnmount(g.id)}),[g,j]),o)return l.jsx("div",{className:"min-h-screen bg-gray-100 dark:bg-gray-900 flex items-center justify-center",children:l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"}),l.jsx("div",{className:"text-gray-600 dark:text-gray-400",children:e("chat.loading")})]})});if(c||!g)return l.jsx("div",{className:"min-h-screen bg-gray-100 dark:bg-gray-900 flex items-center justify-center",children:l.jsxs("div",{className:"text-center max-w-md",children:[l.jsx("div",{className:"text-6xl mb-6",children:"❌"}),l.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white mb-4",children:e("chat.agentNotFound")}),l.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:e("chat.agentNotFoundDesc")}),l.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(!g.enabled)return l.jsx("div",{className:"min-h-screen bg-gray-100 dark:bg-gray-900 flex items-center justify-center",children:l.jsxs("div",{className:"text-center max-w-md",children:[l.jsx("div",{className:"text-6xl mb-6 opacity-50",children:g.ui.icon}),l.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white mb-4",children:e("chat.agentDisabled")}),l.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:e("chat.agentDisabledDesc",{name:g.name})}),l.jsx("div",{className:"flex space-x-4 justify-center",children:l.jsx("button",{onClick:()=>window.close(),className:"px-6 py-3 bg-gray-600 text-white rounded-lg hover:bg-gray-700 transition-colors",children:e("chat.closePage")})})]})});const I=V=>{p(V)},w=()=>{p(!1)},M=()=>l.jsxs(Qm,{hideRightPanel:f,onShowRightPanel:w,mobileLayout:"tabs",children:[l.jsx(Ym,{agent:g,projectPath:i||void 0,onSessionChange:b}),l.jsx(pp,{agent:g,projectPath:i||void 0,CustomComponent:T,onTogglePanel:I})]});return l.jsxs("div",{className:"h-screen bg-gray-100 dark:bg-gray-900",children:[M(),d&&g&&l.jsx(Sl,{agent:g,onProjectSelect:C,onClose:E})]})};export{Fp as ChatPage};
|