@pheem49/mint 1.16.0 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.lock +6 -6
- package/Cargo.toml +2 -2
- package/README.md +8 -2
- package/Release_Note.md +222 -72
- package/apps/mint-companion/src-tauri/src/compact.rs +69 -0
- package/apps/mint-companion/src-tauri/src/main.rs +218 -11
- package/apps/mint-companion/vite.config.ts +2 -1
- package/crates/mint-cli/src/agent/diff_render.rs +66 -44
- package/crates/mint-cli/src/agent/live_status.rs +64 -6
- package/crates/mint-cli/src/agent/markdown_render.rs +342 -5
- package/crates/mint-cli/src/agent.rs +202 -47
- package/crates/mint-cli/src/commands/agent.rs +223 -117
- package/crates/mint-cli/src/commands/browser.rs +114 -0
- package/crates/mint-cli/src/commands/config.rs +14 -1
- package/crates/mint-cli/src/commands/integrations.rs +3 -3
- package/crates/mint-cli/src/commands/knowledge.rs +16 -2
- package/crates/mint-cli/src/commands/mod.rs +15 -4
- package/crates/mint-cli/src/commands/tailnet_web.rs +3 -7
- package/crates/mint-cli/src/companion_navigation.rs +268 -0
- package/crates/mint-cli/src/interactive/chat_tui/dialog.rs +572 -0
- package/crates/mint-cli/src/interactive/chat_tui/mod.rs +1427 -0
- package/crates/mint-cli/src/interactive/chat_tui/render.rs +1524 -0
- package/crates/mint-cli/src/interactive/chat_tui/selection.rs +401 -0
- package/crates/mint-cli/src/interactive/chat_tui/state.rs +1833 -0
- package/crates/mint-cli/src/interactive/chat_tui/tests.rs +3414 -0
- package/crates/mint-cli/src/interactive/chat_tui/thought.rs +202 -0
- package/crates/mint-cli/src/interactive/chat_tui/transcript.rs +728 -0
- package/crates/mint-cli/src/interactive/chat_tui/watermark.rs +148 -0
- package/crates/mint-cli/src/interactive/command_ui.rs +92 -5
- package/crates/mint-cli/src/interactive/composer.rs +186 -0
- package/crates/mint-cli/src/interactive/format.rs +78 -3
- package/crates/mint-cli/src/interactive/input_box.rs +61 -1
- package/crates/mint-cli/src/interactive/resume_picker.rs +367 -25
- package/crates/mint-cli/src/interactive/slash_commands.rs +758 -373
- package/crates/mint-cli/src/interactive/tool_activity.rs +468 -56
- package/crates/mint-cli/src/interactive.rs +74 -5
- package/crates/mint-cli/src/main.rs +26 -2
- package/crates/mint-cli/src/markdown.rs +2 -37
- package/crates/mint-cli/src/onboard.rs +3897 -1321
- package/crates/mint-cli/src/setup.rs +1342 -624
- package/crates/mint-cli/src/terminal_theme.rs +159 -35
- package/crates/mint-cli/tests/library_intake.rs +1 -0
- package/crates/mint-cli/tests/mods_testing.rs +5 -1
- package/crates/mint-companion-protocol/src/lib.rs +113 -0
- package/crates/mint-core/src/agent/chat/anthropic.rs +318 -0
- package/crates/mint-core/src/agent/chat/custom.rs +149 -0
- package/crates/mint-core/src/agent/chat/gemini.rs +518 -0
- package/crates/mint-core/src/agent/chat/mod.rs +857 -0
- package/crates/mint-core/src/agent/chat/ollama.rs +321 -0
- package/crates/mint-core/src/agent/chat/openai.rs +582 -0
- package/crates/mint-core/src/agent/chat/streaming.rs +469 -0
- package/crates/mint-core/src/agent/chat/tests.rs +1479 -0
- package/crates/mint-core/src/agent/memory.rs +129 -8
- package/crates/mint-core/src/agent/safety.rs +56 -4
- package/crates/mint-core/src/agent/skill_inventory.rs +3 -1
- package/crates/mint-core/src/agent/skills.rs +1 -0
- package/crates/mint-core/src/agent/tasks.rs +2 -2
- package/crates/mint-core/src/api_server/routes/auth.rs +1 -4
- package/crates/mint-core/src/api_server/routes/chat.rs +53 -17
- package/crates/mint-core/src/api_server/routes/gemini_live.rs +14 -1
- package/crates/mint-core/src/api_server/routes/html_preview.rs +1 -8
- package/crates/mint-core/src/api_server/routes/misc.rs +116 -0
- package/crates/mint-core/src/api_server/routes/profile_oauth.rs +43 -26
- package/crates/mint-core/src/api_server/routes/sessions.rs +114 -76
- package/crates/mint-core/src/api_server/routes/skills_subagents.rs +11 -7
- package/crates/mint-core/src/api_server/routes/status_health.rs +18 -8
- package/crates/mint-core/src/api_server.rs +211 -65
- package/crates/mint-core/src/avatar_bridge.rs +5 -24
- package/crates/mint-core/src/browser/cdp.rs +92 -30
- package/crates/mint-core/src/browser/headless.rs +582 -0
- package/crates/mint-core/src/browser/input.rs +7 -62
- package/crates/mint-core/src/browser/interact.rs +0 -14
- package/crates/mint-core/src/browser/mod.rs +10 -30
- package/crates/mint-core/src/browser/navigate.rs +83 -44
- package/crates/mint-core/src/browser/runtime.rs +282 -0
- package/crates/mint-core/src/browser/session.rs +240 -400
- package/crates/mint-core/src/browser/workflow.rs +496 -0
- package/crates/mint-core/src/companion/navigation.rs +115 -0
- package/crates/mint-core/src/companion.rs +109 -1
- package/crates/mint-core/src/cron/store.rs +2 -2
- package/crates/mint-core/src/integrations/mcp.rs +6 -8
- package/crates/mint-core/src/integrations/mcp_result.rs +45 -0
- package/crates/mint-core/src/lib.rs +10 -11
- package/crates/mint-core/src/media/gemini_live.rs +636 -86
- package/crates/mint-core/src/media/image_proxy.rs +563 -0
- package/crates/mint-core/src/media/library/migration.rs +26 -0
- package/crates/mint-core/src/media/library/tests.rs +1 -1
- package/crates/mint-core/src/media/library/thumbnails.rs +8 -2
- package/crates/mint-core/src/media/pictures.rs +1 -1
- package/crates/mint-core/src/media/tool_images.rs +287 -0
- package/crates/mint-core/src/media/tts/playback.rs +609 -0
- package/crates/mint-core/src/media/tts.rs +1 -0
- package/crates/mint-core/src/media.rs +2 -0
- package/crates/mint-core/src/mods/manager.rs +101 -35
- package/crates/mint-core/src/orchestration/context_render.rs +878 -44
- package/crates/mint-core/src/orchestration/decision_parsing.rs +536 -39
- package/crates/mint-core/src/orchestration/diagnostics.rs +307 -0
- package/crates/mint-core/src/orchestration/full_skill_result_tests.rs +12 -0
- package/crates/mint-core/src/orchestration/image_regressions.rs +379 -0
- package/crates/mint-core/src/orchestration/loop_guard.rs +479 -0
- package/crates/mint-core/src/orchestration/mcp_outcome_tests.rs +864 -0
- package/crates/mint-core/src/orchestration/memory_skill.rs +88 -28
- package/crates/mint-core/src/orchestration/mod.rs +859 -4244
- package/crates/mint-core/src/orchestration/reliability.rs +581 -0
- package/crates/mint-core/src/orchestration/repeated_failures.rs +8 -0
- package/crates/mint-core/src/orchestration/review_regressions.rs +179 -28
- package/crates/mint-core/src/orchestration/tests.rs +1665 -0
- package/crates/mint-core/src/orchestration/tools/dispatch.rs +967 -0
- package/crates/mint-core/src/orchestration/tools/files.rs +32 -3
- package/crates/mint-core/src/orchestration/tools/mod.rs +5 -1
- package/crates/mint-core/src/orchestration/tools/planning.rs +102 -42
- package/crates/mint-core/src/orchestration/tools/plugins_mcp.rs +19 -4
- package/crates/mint-core/src/orchestration/tools/project.rs +1 -1
- package/crates/mint-core/src/orchestration/tools/shell.rs +157 -62
- package/crates/mint-core/src/orchestration/tools/web.rs +5 -1
- package/crates/mint-core/src/orchestration/trajectory_schema.rs +353 -0
- package/crates/mint-core/src/orchestration/truncation.rs +368 -0
- package/crates/mint-core/src/orchestration/types.rs +648 -0
- package/crates/mint-core/src/orchestration/verification.rs +36 -9
- package/crates/mint-core/src/orchestration/workspace_helpers.rs +76 -27
- package/crates/mint-core/src/prompts/agent.rs +69 -102
- package/crates/mint-core/src/prompts/tool_catalog.rs +104 -153
- package/crates/mint-core/src/search/files.rs +20 -0
- package/crates/mint-core/src/search/web_search.rs +44 -3
- package/crates/mint-core/src/slash/mod.rs +481 -55
- package/crates/mint-core/src/slash/models.rs +6 -1
- package/crates/mint-core/src/swarm/batch.rs +643 -0
- package/crates/mint-core/src/swarm/dossier.rs +152 -0
- package/crates/mint-core/src/swarm/labels.rs +100 -0
- package/crates/mint-core/src/swarm/mod.rs +158 -0
- package/crates/mint-core/src/swarm/permissions.rs +167 -0
- package/crates/mint-core/src/system/auth.rs +156 -7
- package/crates/mint-core/src/system/bg_shell.rs +78 -9
- package/crates/mint-core/src/system/config.rs +266 -35
- package/crates/mint-core/src/system/mint_web.rs +33 -12
- package/crates/mint-core/src/system/shell.rs +179 -10
- package/crates/mint-core/src/system/workspace.rs +204 -0
- package/crates/mint-core/tests/background_retention.rs +1 -1
- package/crates/mint-core/tests/memory_persistence.rs +27 -0
- package/crates/mint-mod-runtime/src/lib.rs +37 -23
- package/out/web/assets/ArtifactPreviewPanel-Cx6BVOOF.js +2 -0
- package/out/web/assets/ArtifactPreviewPanel-DAT_Y7i0.css +1 -0
- package/out/web/assets/CalculationCard-D2E74u5q.js +1 -0
- package/out/web/assets/CliSessionsView-ZbdtSjvK.css +1 -0
- package/out/web/assets/CliSessionsView-z5i6qGyb.js +1 -0
- package/out/web/assets/CodeReviewPage-BK2bOScd.css +1 -0
- package/out/web/assets/CodeReviewPage-Dp6zHuHu.js +2 -0
- package/out/web/assets/CommandPalette-DaKlzbKs.js +1 -0
- package/out/web/assets/ImageGenCard-BMCJHP9O.js +1 -0
- package/out/web/assets/ImageSearchCard-Cld_SOUg.js +1 -0
- package/out/web/assets/ImageStudioPanel-B5N7TjeB.js +1 -0
- package/out/web/assets/LibraryPage-CMB89rJ0.css +1 -0
- package/out/web/assets/LibraryPage-DbZEi4W_.js +2 -0
- package/out/web/assets/LinkedFoldersView-9B9DIPoZ.js +1 -0
- package/out/web/assets/McpRegistryPicker-DnXPlzI7.js +1 -0
- package/out/web/assets/McpServersView-CiNBNUl4.js +1 -0
- package/out/web/assets/MermaidCard-BBDNEXbY.js +2 -0
- package/out/web/assets/MintDashboard-C_UYPoNV.js +119 -0
- package/out/web/assets/MintDashboard-DTd8C_c8.css +1 -0
- package/out/web/assets/PlanCard-C2x5pajq.js +1 -0
- package/out/web/assets/PluginsView-DoTg9MVa.js +1 -0
- package/out/web/assets/RewindModal-B5oowrR0.js +1 -0
- package/out/web/assets/ScheduledTasksView-BD5DVPkZ.js +1 -0
- package/out/web/assets/SelectField-Cy6CghrU.js +1 -0
- package/out/web/assets/SelectField-lFEkkWCU.css +1 -0
- package/out/web/assets/SettingsWindow-BYl_oCFh.js +4 -0
- package/out/web/assets/SettingsWindow-Ckcgnjt8.css +1 -0
- package/out/web/assets/SkillsView-CIeWwq5z.js +2 -0
- package/out/web/assets/StockCard-DxUciKyp.js +1 -0
- package/out/web/assets/ToolSurfacePage-qBgs_VHq.css +1 -0
- package/out/web/assets/ToolSurfacePage-saVbVrkE.js +38 -0
- package/out/web/assets/UiFeatureCard-CdY0hGWy.js +1 -0
- package/out/web/assets/UiGridCard-BBK3I5hC.js +1 -0
- package/out/web/assets/UiMockupWidget-CpR9EDuc.js +1 -0
- package/out/web/assets/{VeoStudioPanel-DOj7_WR3.css → VeoStudioPanel-9kU9YLEN.css} +1 -1
- package/out/web/assets/VeoStudioPanel-Co6-wEWM.js +4 -0
- package/out/web/assets/WeatherCard-Buzi7Vfu.js +1 -0
- package/out/web/assets/WorkspacePanel-BfHKkulU.js +1 -0
- package/out/web/assets/WorkspacePdfPreview-Bi8Zzyir.js +2 -0
- package/out/web/assets/abnfDiagram-VCTEODGH-CMfR95N2.js +1 -0
- package/out/web/assets/architecture-7GRP2DOG-DhAM4HyO.js +1 -0
- package/out/web/assets/architectureDiagram-5GKGNRK7-Yk3TUJ_F.js +36 -0
- package/out/web/assets/{blockDiagram-NRAW4CY4-BrrqzHW5.js → blockDiagram-I7D4REHJ-X9fBgJik.js} +4 -4
- package/out/web/assets/c4Diagram-7LVT6UL2-Bk9x7N-8.js +38 -0
- package/out/web/assets/chunk-2Q5K7J3B-D2JLPQzF.js +1 -0
- package/out/web/assets/{chunk-TEH6E4GO-G4Cdlyrt.js → chunk-4HAMMTFA-Dx5fk1_0.js} +3 -3
- package/out/web/assets/{chunk-5VM5RSS4-BiPuE0io.js → chunk-5VM5RSS4-BZ2oBPYQ.js} +1 -1
- package/out/web/assets/chunk-75Z2AOVW-BszTQoM4.js +2 -0
- package/out/web/assets/chunk-DU6HZSFF-DK-As3rk.js +128 -0
- package/out/web/assets/chunk-F27PBJKO-LmncZZIS.js +1 -0
- package/out/web/assets/chunk-FOHPRMQF-JXEeeJ9r.js +161 -0
- package/out/web/assets/{chunk-GMAD6QVW-BuhEcgHq.js → chunk-GMAD6QVW-DSQ_sDRJ.js} +12 -12
- package/out/web/assets/chunk-GVQU2GXP-Cno3ulje.js +1 -0
- package/out/web/assets/chunk-IMKFNOWR-bIzfY9Jc.js +231 -0
- package/out/web/assets/chunk-JWPE2WC7-BeEMUFDw.js +1 -0
- package/out/web/assets/chunk-L3NEJ4N5-Dl6eOa0D.js +1 -0
- package/out/web/assets/chunk-OSK3NFVY-BaUGJ-cM.js +10 -0
- package/out/web/assets/chunk-P2QGCYS3-_066ndhH.js +1 -0
- package/out/web/assets/chunk-POPQ4Y6H-YT1AKhTv.js +1 -0
- package/out/web/assets/chunk-PWAF6VOD-CrEgDsxh.js +1 -0
- package/out/web/assets/chunk-SHT3W25Y-_KwaRLOl.js +168 -0
- package/out/web/assets/{chunk-SVP7TREG-Bu_yYb-V.js → chunk-SVP7TREG-BQ1qb32L.js} +1 -1
- package/out/web/assets/{chunk-LCL6LL3I-BhXV9zyH.js → chunk-TICWLB2K-BDyehCtg.js} +4 -4
- package/out/web/assets/chunk-XXDRQBXY-B9YlhOkE.js +1 -0
- package/out/web/assets/chunk-Y2CYZVJY-BxCWjNVG.js +1 -0
- package/out/web/assets/classDiagram-ZZMXUADV-BoSpzRCJ.js +1 -0
- package/out/web/assets/classDiagram-v2-VYDZK3BY-BoSpzRCJ.js +1 -0
- package/out/web/assets/config-2suVFPZg.css +1 -0
- package/out/web/assets/config-CkRCdkxn.js +2 -0
- package/out/web/assets/core-Mi3s5D4_.js +1 -0
- package/out/web/assets/cose-bilkent-JH36ORCC-qlna31ty.js +1 -0
- package/out/web/assets/cynefin-OW5HDTMX-Dl_31aaN.js +1 -0
- package/out/web/assets/cynefinDiagram-5FMLGOSQ-Bpir8jha.js +62 -0
- package/out/web/assets/cytoscape.esm-DWtAUG0r.js +321 -0
- package/out/web/assets/dagre-CnWJJM5f.js +1 -0
- package/out/web/assets/dagre-GXQ25YYZ-D9xu3nsq.js +4 -0
- package/out/web/assets/diagram-S7CK7UJ4-DeveoEeB.js +30 -0
- package/out/web/assets/diagram-UQ7AKVKN-p4xWRESV.js +41 -0
- package/out/web/assets/{diagram-VSXAHHWV-BJ86Ov2Y.js → diagram-VSXAHHWV-C7qz9NDF.js} +1 -1
- package/out/web/assets/diagram-VX7I27RA-DRiCa3Vd.js +24 -0
- package/out/web/assets/diagram-Z3DM3KII-Bt7zduQX.js +24 -0
- package/out/web/assets/dist-9ISJ7r-g.js +1 -0
- package/out/web/assets/dist-js-BV3mI7uw.js +1 -0
- package/out/web/assets/ebnfDiagram-PWID7BFC-DV9WpwdR.js +1 -0
- package/out/web/assets/{erDiagram-SSCWMZ5O-CzzmnZWT.js → erDiagram-RLTQ6QDP-BJ_nwG2m.js} +3 -3
- package/out/web/assets/event-D7D-EBy9.js +1 -0
- package/out/web/assets/eventmodeling-NTZA5JFV-BTBMrfVa.js +1 -0
- package/out/web/assets/flowDiagram-HODETNUW-Cdlq3cJL.js +1 -0
- package/out/web/assets/ganttDiagram-EL5Y4UJY-DQLdsXrC.js +292 -0
- package/out/web/assets/gitGraph-4MIJSDKK-CL1OEOQ_.js +1 -0
- package/out/web/assets/gitGraphDiagram-WWUBYQGX-8cSi42H7.js +106 -0
- package/out/web/assets/graphlib-Bh9gHply.js +1 -0
- package/out/web/assets/index-BocxnrDG.js +168 -0
- package/out/web/assets/index-yeh_r55a.css +1 -0
- package/out/web/assets/info-A6RAGUB7-C1zsX5sc.js +1 -0
- package/out/web/assets/infoDiagram-27XIBGKW-DsRYtIyI.js +2 -0
- package/out/web/assets/{ishikawaDiagram-5VMMS53U-s38yo28y.js → ishikawaDiagram-5VMMS53U-B2crwIXj.js} +4 -4
- package/out/web/assets/journeyDiagram-3NMN7TZE-BTH-GyVR.js +139 -0
- package/out/web/assets/jsx-runtime-DmUwWVTj.js +1 -0
- package/out/web/assets/{kanban-definition-3QL26DDD-DodjgySL.js → kanban-definition-UXKFOSKX-BeRfCnuA.js} +6 -6
- package/out/web/assets/katex-MCdQaEAD.js +257 -0
- package/out/web/assets/mermaid-parser.core-BJwgCBBc.js +7 -0
- package/out/web/assets/mermaid.core-CsDDodN8.js +44 -0
- package/out/web/assets/{mindmap-definition-FBJOCRG2-260WBDxZ.js → mindmap-definition-YA3MSWOX-B42efOQ1.js} +4 -4
- package/out/web/assets/modelManager-B3ZFMh8v.js +2 -0
- package/out/web/assets/oauthManager-Ch5Du2fF.js +1 -0
- package/out/web/assets/packet-AYTQ26CC-B6xUyE6r.js +1 -0
- package/out/web/assets/pdf-Bcahc2yC.js +56 -0
- package/out/web/assets/pdf.worker.min-Dkey6ZUl.mjs +27 -0
- package/out/web/assets/pegDiagram-XKGWAZYB-1LabVycL.js +1 -0
- package/out/web/assets/pie-WAS4IAKB-DJwo-nf_.js +1 -0
- package/out/web/assets/pieDiagram-E7YTZNPT-icmAqzy4.js +39 -0
- package/out/web/assets/{quadrantDiagram-AXDQQJYC-B8D3gU5d.js → quadrantDiagram-AXDQQJYC-CZ-wEx41.js} +4 -4
- package/out/web/assets/radar-RG4KPBEZ-D7d-Xriw.js +1 -0
- package/out/web/assets/railroad-74A4TZTK-viuhdYbs.js +1 -0
- package/out/web/assets/railroad-abnf-HS5TGJTU-DNXiCNea.js +1 -0
- package/out/web/assets/railroad-ebnf-LZEXJU2U-nkSu1-0C.js +1 -0
- package/out/web/assets/railroad-peg-WCYAUIDC-BhbMeQzz.js +1 -0
- package/out/web/assets/railroadDiagram-O6MQD6OU-CLpG1jUX.js +1 -0
- package/out/web/assets/{requirementDiagram-EFPCY7ZU-D2X-Ewik.js → requirementDiagram-BXWQKSXE-kRDrvWrc.js} +3 -3
- package/out/web/assets/rolldown-runtime-CNOWq4Kh.js +1 -0
- package/out/web/assets/rough.esm-CNnFptCR.js +1 -0
- package/out/web/assets/sankeyDiagram-P5KCCOFB-DxAwmq4x.js +40 -0
- package/out/web/assets/sequenceDiagram-WJ2MYXX4-aLgY-6Wz.js +162 -0
- package/out/web/assets/sizeCapture-INFHLROL-C8Q8DbV5.js +1 -0
- package/out/web/assets/src-CRDfRlHM.js +1 -0
- package/out/web/assets/stateDiagram-D77RDMKH-D5QWfOhp.js +1 -0
- package/out/web/assets/stateDiagram-v2-MP3YSRHH-D6OiZoAP.js +1 -0
- package/out/web/assets/studio-BBZQ_-QK.js +1 -0
- package/out/web/assets/swimlanes-42K2YHIH-CRs5UyA-.js +1 -0
- package/out/web/assets/swimlanesDiagram-VR7AAH4N-UgEXIsV0.js +8 -0
- package/out/web/assets/syntaxHighlight-C-wAGT84.js +3 -0
- package/out/web/assets/timeline-definition-24CTP7MA-Denqd9qb.js +120 -0
- package/out/web/assets/treeView-Q6P3EWNA-0my3Z3s4.js +1 -0
- package/out/web/assets/treemap-WGGIJYW6-B_EjkLYq.js +1 -0
- package/out/web/assets/vennDiagram-4TSXK5OY-DxVg3Ewr.js +34 -0
- package/out/web/assets/wardley-WFR3VGLG-CGD-Tj4p.js +1 -0
- package/out/web/assets/{wardleyDiagram-VM6X3IG4-DAdXELbQ.js → wardleyDiagram-VM6X3IG4-CmfS39Xm.js} +35 -35
- package/out/web/assets/window-CkUOP7t0.js +1 -0
- package/out/web/assets/workspaces-SYPrmbgC.js +1 -0
- package/out/web/assets/{xychartDiagram-S5SC5T6Z-IZIXf3Vo.js → xychartDiagram-S5SC5T6Z-BVM9bKis.js} +4 -4
- package/out/web/index-web.html +4 -4
- package/out/web/index.html +4 -4
- package/out/web/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/78-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/78-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Add-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Add-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
- package/out/web/pdfjs/cmaps/B5-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/B5-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/B5pc-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/B5pc-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/CNS1-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/CNS1-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/CNS2-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/CNS2-V.bcmap +3 -0
- package/out/web/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/ETenms-B5-H.bcmap +3 -0
- package/out/web/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/EUC-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/EUC-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Ext-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Ext-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/GB-H.bcmap +4 -0
- package/out/web/pdfjs/cmaps/GB-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/GBT-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/GBT-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Hankaku.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Hiragana.bcmap +0 -0
- package/out/web/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/KSC-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/KSC-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Katakana.bcmap +0 -0
- package/out/web/pdfjs/cmaps/LICENSE +36 -0
- package/out/web/pdfjs/cmaps/NWP-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/NWP-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/Roman.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
- package/out/web/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/V.bcmap +0 -0
- package/out/web/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
- package/out/web/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
- package/out/web/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
- package/out/web/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
- package/out/web/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
- package/out/web/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
- package/out/web/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
- package/out/web/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
- package/out/web/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
- package/out/web/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
- package/out/web/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
- package/out/web/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
- package/out/web/pdfjs/standard_fonts/LICENSE_LIBERATION +363 -0
- package/out/web/pdfjs/standard_fonts/LiberationSans-Bold.ttf +0 -0
- package/out/web/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
- package/out/web/pdfjs/standard_fonts/LiberationSans-Italic.ttf +0 -0
- package/out/web/pdfjs/standard_fonts/LiberationSans-Regular.ttf +0 -0
- package/out/web/pdfjs/wasm/LICENSE_JBIG2 +196 -0
- package/out/web/pdfjs/wasm/LICENSE_OPENJPEG +39 -0
- package/out/web/pdfjs/wasm/LICENSE_PDFJS_JBIG2 +13 -0
- package/out/web/pdfjs/wasm/LICENSE_PDFJS_OPENJPEG +22 -0
- package/out/web/pdfjs/wasm/LICENSE_PDFJS_QCMS +19 -0
- package/out/web/pdfjs/wasm/LICENSE_QCMS +21 -0
- package/out/web/pdfjs/wasm/jbig2.wasm +0 -0
- package/out/web/pdfjs/wasm/jbig2_nowasm_fallback.js +15 -0
- package/out/web/pdfjs/wasm/openjpeg.wasm +0 -0
- package/out/web/pdfjs/wasm/openjpeg_nowasm_fallback.js +17 -0
- package/out/web/pdfjs/wasm/qcms_bg.wasm +0 -0
- package/out/web/pdfjs/wasm/quickjs-eval.js +16 -0
- package/out/web/pdfjs/wasm/quickjs-eval.wasm +0 -0
- package/package.json +6 -4
- package/shared-modules/CODEOWNERS +3 -3
- package/shared-modules/SDL2/SDL2_mixer.json +27 -0
- package/shared-modules/appstream/README.md +13 -0
- package/shared-modules/appstream/appstream-compose.json +111 -0
- package/shared-modules/dbus-glib/dbus-glib.json +2 -2
- package/shared-modules/libportal/libportal.json +23 -0
- package/shared-modules/linux-audio/fluidsynth2-static.json +2 -2
- package/shared-modules/linux-audio/fluidsynth2.json +2 -2
- package/shared-modules/linux-audio/libinstpatch.json +2 -2
- package/shared-modules/linux-audio/liblo-static.json +3 -0
- package/shared-modules/luajit/luajit.json +2 -2
- package/shared-modules/squashfs-tools/squashfs-tools.json +0 -3
- package/slash-commands.json +14 -3
- package/src/bin/index.js +4 -1
- package/src/bin/pdfjs-assets.mjs +31 -0
- package/src/renderer/node_modules/.vite/vitest/CACHEDIR.TAG +3 -0
- package/src/renderer/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
- package/src/renderer/shared/agentProgress.ts +62 -5
- package/src/renderer/shared/components/Settings/AgentsTab.tsx +70 -6
- package/src/renderer/shared/components/Settings/AudioTab.tsx +1 -1
- package/src/renderer/shared/components/Settings/AutomationTab.tsx +32 -29
- package/src/renderer/shared/components/Settings/AvatarCropModal.tsx +32 -12
- package/src/renderer/shared/components/Settings/CustomProviderLogoPicker.test.tsx +65 -0
- package/src/renderer/shared/components/Settings/CustomProviderLogoPicker.tsx +456 -0
- package/src/renderer/shared/components/Settings/GeneralTab.tsx +65 -94
- package/src/renderer/shared/components/Settings/PluginsTab.tsx +101 -24
- package/src/renderer/shared/components/Settings/ProfileTab.tsx +1 -1
- package/src/renderer/shared/components/Settings/SettingsWindow.tsx +796 -0
- package/src/renderer/shared/components/Settings/ThemeTab.test.tsx +45 -0
- package/src/renderer/shared/components/Settings/ThemeTab.tsx +119 -4
- package/src/renderer/shared/components/activity/AgentActivityDrawer.tsx +270 -0
- package/src/renderer/shared/components/activity/AgentActivityTable.tsx +582 -0
- package/src/renderer/shared/components/activity/AskUserActivityCard.test.tsx +122 -0
- package/src/renderer/shared/components/activity/AskUserActivityCard.tsx +70 -0
- package/src/renderer/shared/components/{McpToolResults.tsx → activity/McpToolResults.tsx} +69 -13
- package/src/renderer/shared/components/{PlanChecklistWidget.tsx → activity/PlanChecklistWidget.tsx} +2 -2
- package/src/renderer/shared/components/activity/RunSummaryDashboard.test.tsx +127 -0
- package/src/renderer/shared/components/activity/RunSummaryDashboard.tsx +222 -0
- package/src/renderer/shared/components/activity/SubagentDagView.test.ts +123 -0
- package/src/renderer/shared/components/{SubagentDagView.tsx → activity/SubagentDagView.tsx} +104 -50
- package/src/renderer/shared/components/activity/SubagentStatusStrip.test.tsx +82 -0
- package/src/renderer/shared/components/activity/SubagentStatusStrip.tsx +107 -0
- package/src/renderer/shared/components/activity/ViewedImages.tsx +179 -0
- package/src/renderer/shared/components/{AuthGate.tsx → app/AuthGate.tsx} +3 -3
- package/src/renderer/shared/components/{ChunkErrorBoundary.tsx → app/ChunkErrorBoundary.tsx} +13 -13
- package/src/renderer/shared/components/{CommandPalette.tsx → app/CommandPalette.tsx} +30 -30
- package/src/renderer/shared/components/{DashboardSidebar.tsx → app/DashboardSidebar.tsx} +7 -5
- package/src/renderer/shared/components/{DesktopTitlebar.tsx → app/DesktopTitlebar.tsx} +9 -26
- package/src/renderer/shared/components/{ErrorNotice.tsx → app/ErrorNotice.tsx} +1 -1
- package/src/renderer/shared/components/{MintDashboard.tsx → app/MintDashboard.tsx} +217 -228
- package/src/renderer/shared/components/{ModalErrorBoundary.tsx → app/ModalErrorBoundary.tsx} +8 -8
- package/src/renderer/shared/components/{CalculationCard.tsx → cards/CalculationCard.tsx} +16 -30
- package/src/renderer/shared/components/{ImageGenCard.tsx → cards/ImageGenCard.tsx} +11 -24
- package/src/renderer/shared/components/{ImageSearchCard.tsx → cards/ImageSearchCard.tsx} +11 -24
- package/src/renderer/shared/components/{MermaidCard.tsx → cards/MermaidCard.tsx} +38 -22
- package/src/renderer/shared/components/cards/PlanCard.test.tsx +41 -0
- package/src/renderer/shared/components/cards/PlanCard.tsx +32 -0
- package/src/renderer/shared/components/cards/ReleaseNotesCard.test.tsx +29 -0
- package/src/renderer/shared/components/cards/ReleaseNotesCard.tsx +137 -0
- package/src/renderer/shared/components/{StockCard.tsx → cards/StockCard.tsx} +22 -38
- package/src/renderer/shared/components/cards/ToolResultCards.tsx +94 -0
- package/src/renderer/shared/components/{UiFeatureCard.tsx → cards/UiFeatureCard.tsx} +6 -6
- package/src/renderer/shared/components/{UiGridCard.tsx → cards/UiGridCard.tsx} +3 -3
- package/src/renderer/shared/components/{UiMockupWidget.tsx → cards/UiMockupWidget.tsx} +4 -4
- package/src/renderer/shared/components/{WeatherCard.tsx → cards/WeatherCard.tsx} +6 -6
- package/src/renderer/shared/components/{ApprovalCard.test.tsx → chat/ApprovalCard.test.tsx} +12 -1
- package/src/renderer/shared/components/{ApprovalCard.tsx → chat/ApprovalCard.tsx} +26 -7
- package/src/renderer/shared/components/chat/ArtifactCards.test.tsx +69 -0
- package/src/renderer/shared/components/chat/ArtifactCards.tsx +238 -0
- package/src/renderer/shared/components/chat/AttachedDocumentCard.test.tsx +39 -0
- package/src/renderer/shared/components/chat/AttachedDocumentCard.tsx +220 -0
- package/src/renderer/shared/components/chat/ChatCodeBlock.test.tsx +33 -0
- package/src/renderer/shared/components/{ChatCodeBlock.tsx → chat/ChatCodeBlock.tsx} +16 -2
- package/src/renderer/shared/components/chat/ChatMessageItem.test.tsx +183 -0
- package/src/renderer/shared/components/chat/ChatMessageItem.tsx +388 -0
- package/src/renderer/shared/components/chat/ChatModeSelector.css +227 -0
- package/src/renderer/shared/components/chat/ChatModeSelector.test.tsx +45 -0
- package/src/renderer/shared/components/chat/ChatModeSelector.tsx +198 -0
- package/src/renderer/shared/components/chat/ChatPanel.test.tsx +53 -0
- package/src/renderer/shared/components/{ChatPanel.tsx → chat/ChatPanel.tsx} +462 -537
- package/src/renderer/shared/components/{CollapsiblePasteInput.tsx → chat/CollapsiblePasteInput.tsx} +2 -2
- package/src/renderer/shared/components/{DiffReviewModal.tsx → chat/DiffReviewModal.tsx} +44 -44
- package/src/renderer/shared/components/chat/GeminiLiveOverlay.test.tsx +165 -0
- package/src/renderer/shared/components/{GeminiLiveOverlay.tsx → chat/GeminiLiveOverlay.tsx} +47 -5
- package/src/renderer/shared/components/{ModelSelectorPopover.tsx → chat/ModelSelectorPopover.tsx} +44 -16
- package/src/renderer/shared/components/chat/QueuedMessagesBanner.test.tsx +89 -0
- package/src/renderer/shared/components/chat/QueuedMessagesBanner.tsx +201 -0
- package/src/renderer/shared/components/{RewindModal.tsx → chat/RewindModal.tsx} +14 -14
- package/src/renderer/shared/components/{SlashChoicePanel.tsx → chat/SlashChoicePanel.tsx} +2 -2
- package/src/renderer/shared/components/{SlashSuggestions.test.tsx → chat/SlashSuggestions.test.tsx} +14 -0
- package/src/renderer/shared/components/{SlashSuggestions.tsx → chat/SlashSuggestions.tsx} +4 -4
- package/src/renderer/shared/components/chat/SourcesBlock.test.tsx +53 -0
- package/src/renderer/shared/components/{SourcesBlock.tsx → chat/SourcesBlock.tsx} +262 -123
- package/src/renderer/shared/components/{ThinkingBlock.tsx → chat/ThinkingBlock.tsx} +1 -1
- package/src/renderer/shared/components/chat/TurnFileChanges.test.tsx +130 -0
- package/src/renderer/shared/components/chat/TurnFileChanges.tsx +463 -0
- package/src/renderer/shared/components/{VoicePill.css → chat/VoicePill.css} +1 -1
- package/src/renderer/shared/components/{VoicePill.jsx → chat/VoicePill.jsx} +3 -2
- package/src/renderer/shared/components/{CliSessionsView.test.tsx → extensions/CliSessionsView.test.tsx} +2 -2
- package/src/renderer/shared/components/{CliSessionsView.tsx → extensions/CliSessionsView.tsx} +19 -16
- package/src/renderer/shared/components/{LinkedFoldersView.tsx → extensions/LinkedFoldersView.tsx} +3 -3
- package/src/renderer/shared/components/{McpRegistryPicker.tsx → extensions/McpRegistryPicker.tsx} +6 -6
- package/src/renderer/shared/components/{McpServersView.tsx → extensions/McpServersView.tsx} +105 -36
- package/src/renderer/shared/components/{McpToolAllowlist.tsx → extensions/McpToolAllowlist.tsx} +2 -2
- package/src/renderer/shared/components/{ModUi.test.tsx → extensions/ModUi.test.tsx} +9 -4
- package/src/renderer/shared/components/{ModsPanel.tsx → extensions/ModsPanel.tsx} +59 -7
- package/src/renderer/shared/components/{PluginsView.tsx → extensions/PluginsView.tsx} +6 -6
- package/src/renderer/shared/components/{ScheduledTasksView.tsx → extensions/ScheduledTasksView.tsx} +5 -5
- package/src/renderer/shared/components/extensions/SkillsView.test.tsx +31 -0
- package/src/renderer/shared/components/{SkillsView.tsx → extensions/SkillsView.tsx} +20 -4
- package/src/renderer/shared/components/{ImageStudioPanel.tsx → studio/ImageStudioPanel.tsx} +6 -6
- package/src/renderer/shared/components/{LibraryItemCard.tsx → studio/LibraryItemCard.tsx} +2 -2
- package/src/renderer/shared/components/{LibraryPage.tsx → studio/LibraryPage.tsx} +53 -10
- package/src/renderer/shared/components/{LibraryPreview.tsx → studio/LibraryPreview.tsx} +2 -2
- package/src/renderer/shared/components/{VeoStudioPanel.tsx → studio/VeoStudioPanel.tsx} +7 -7
- package/src/renderer/shared/components/{GlideSelect.css → ui/GlideSelect.css} +7 -6
- package/src/renderer/shared/components/ui/ProviderBrandIcon.test.tsx +67 -0
- package/src/renderer/shared/components/ui/ProviderBrandIcon.tsx +167 -0
- package/src/renderer/shared/components/ui/SelectField.tsx +506 -0
- package/src/renderer/shared/components/ui/error-recovery.css +10 -10
- package/src/renderer/shared/components/ui/error-recovery.tsx +1 -1
- package/src/renderer/shared/components/{ArtifactPreviewPanel.tsx → workspace/ArtifactPreviewPanel.tsx} +374 -118
- package/src/renderer/shared/components/workspace/BackgroundTerminals.test.tsx +63 -0
- package/src/renderer/shared/components/{BackgroundTerminals.tsx → workspace/BackgroundTerminals.tsx} +40 -9
- package/src/renderer/shared/components/workspace/CodeReviewPage.test.tsx +50 -0
- package/src/renderer/shared/components/{CodeReviewPage.tsx → workspace/CodeReviewPage.tsx} +124 -24
- package/src/renderer/shared/components/{GitBranchSelector.tsx → workspace/GitBranchSelector.tsx} +80 -24
- package/src/renderer/shared/components/workspace/SessionSources.tsx +113 -0
- package/src/renderer/shared/components/{TerminalDock.tsx → workspace/TerminalDock.tsx} +5 -2
- package/src/renderer/shared/components/workspace/ToolSurfacePage.test.tsx +81 -0
- package/src/renderer/shared/components/{ToolSurfacePage.tsx → workspace/ToolSurfacePage.tsx} +361 -90
- package/src/renderer/shared/components/{ToolsPanelToggle.tsx → workspace/ToolsPanelToggle.tsx} +1 -1
- package/src/renderer/shared/components/workspace/WorkspaceFileInfo.tsx +28 -0
- package/src/renderer/shared/components/workspace/WorkspaceMediaPreview.tsx +17 -0
- package/src/renderer/shared/components/{WorkspacePaneResizer.tsx → workspace/WorkspacePaneResizer.tsx} +1 -1
- package/src/renderer/shared/components/workspace/WorkspacePdfPreview.tsx +308 -0
- package/src/renderer/shared/components/workspace/WorkspacePreviewActions.test.tsx +101 -0
- package/src/renderer/shared/components/{WorkspacePreviewActions.tsx → workspace/WorkspacePreviewActions.tsx} +3 -3
- package/src/renderer/shared/components/{WorkspaceSelector.tsx → workspace/WorkspaceSelector.tsx} +99 -7
- package/src/renderer/shared/components/{background-terminals.css → workspace/background-terminals.css} +11 -11
- package/src/renderer/shared/components/{workspace-selector.css → workspace/workspace-selector.css} +84 -2
- package/src/renderer/shared/constants/config.ts +6 -3
- package/src/renderer/shared/constants/models.test.ts +51 -0
- package/src/renderer/shared/constants/models.ts +139 -32
- package/src/renderer/shared/conversation/coordinator.test.ts +46 -0
- package/src/renderer/shared/conversation/coordinator.ts +50 -2
- package/src/renderer/shared/conversation/lifecycle.test.ts +254 -4
- package/src/renderer/shared/conversation/lifecycle.ts +268 -12
- package/src/renderer/shared/conversation/progressiveStream.test.ts +83 -0
- package/src/renderer/shared/conversation/progressiveStream.ts +219 -0
- package/src/renderer/shared/conversation/projectNavigation.test.ts +18 -0
- package/src/renderer/shared/conversation/projectNavigation.ts +11 -0
- package/src/renderer/shared/conversation/transport.test.ts +20 -0
- package/src/renderer/shared/conversation/transport.ts +51 -9
- package/src/renderer/shared/conversation/useConversationCoordinator.ts +42 -12
- package/src/renderer/shared/css/agent-observability.css +205 -11
- package/src/renderer/shared/css/chat-ui-cards.css +48 -48
- package/src/renderer/shared/css/code-review.css +139 -110
- package/src/renderer/shared/css/code-sessions.css +56 -27
- package/src/renderer/shared/css/collapsed-paste.css +1 -1
- package/src/renderer/shared/css/error-notice.css +1 -1
- package/src/renderer/shared/css/file-changes.css +298 -51
- package/src/renderer/shared/css/library.css +105 -10
- package/src/renderer/shared/css/management-views.css +79 -38
- package/src/renderer/shared/css/mcp-results.css +48 -5
- package/src/renderer/shared/css/model-selector.css +18 -18
- package/src/renderer/shared/css/mods.css +7 -7
- package/src/renderer/shared/css/notification-notice.css +2 -2
- package/src/renderer/shared/css/queued-messages.css +221 -0
- package/src/renderer/shared/css/session-sources.css +12 -7
- package/src/renderer/shared/css/settings/agents.css +2 -2
- package/src/renderer/{src → shared}/css/settings/base.css +101 -107
- package/src/renderer/shared/css/settings/general.css +397 -100
- package/src/renderer/shared/css/settings/plugins.css +8 -8
- package/src/renderer/shared/css/settings/profile.css +5 -5
- package/src/renderer/shared/css/settings/theme.css +49 -37
- package/src/renderer/shared/css/slash-choice.css +2 -2
- package/src/renderer/shared/css/slash-suggestions.css +3 -3
- package/src/renderer/shared/css/sources-block.css +41 -2
- package/src/renderer/shared/css/tools-panel.css +2 -2
- package/src/renderer/shared/css/ui-tailwind.css +10 -2
- package/src/renderer/shared/css/veo-studio.css +2 -2
- package/src/renderer/shared/css/viewed-images.css +93 -4
- package/src/renderer/shared/css/workspace-file-info.css +12 -0
- package/src/renderer/shared/css/workspace-media-preview.css +13 -0
- package/src/renderer/shared/env.d.ts +9 -0
- package/src/renderer/shared/platform.test.ts +143 -0
- package/src/renderer/shared/platform.ts +12 -5
- package/src/renderer/shared/speech/player.ts +160 -0
- package/src/renderer/shared/speech/types.ts +11 -0
- package/src/renderer/shared/theme/themeManager.test.ts +37 -0
- package/src/renderer/shared/theme/themeManager.ts +24 -5
- package/src/renderer/shared/theme/themes.ts +71 -4
- package/src/renderer/shared/theme/tokens.css +452 -53
- package/src/renderer/shared/types.ts +57 -2
- package/src/renderer/shared/utils/agentActivity.test.ts +633 -8
- package/src/renderer/shared/utils/agentActivity.ts +776 -59
- package/src/renderer/shared/utils/artifactBrowser.test.ts +37 -32
- package/src/renderer/shared/utils/artifactBrowser.ts +18 -20
- package/src/renderer/shared/utils/artifacts.ts +55 -0
- package/src/renderer/shared/utils/attachedDocument.test.ts +73 -0
- package/src/renderer/shared/utils/attachedDocument.ts +49 -0
- package/src/renderer/shared/utils/contextCompaction.test.tsx +1 -1
- package/src/renderer/shared/utils/externalLinks.ts +91 -0
- package/src/renderer/shared/utils/fileIcons.test.ts +59 -0
- package/src/renderer/shared/utils/fileIcons.ts +149 -16
- package/src/renderer/shared/utils/lazyWithRetry.ts +13 -0
- package/src/renderer/shared/utils/markdown.tsx +238 -51
- package/src/renderer/shared/utils/markdown.webImages.test.tsx +140 -2
- package/src/renderer/shared/utils/mcpResults.test.tsx +53 -1
- package/src/renderer/shared/utils/pdfRange.ts +16 -0
- package/src/renderer/shared/utils/previewObjectUrls.ts +20 -0
- package/src/renderer/shared/utils/sessionSources.test.ts +41 -1
- package/src/renderer/shared/utils/sessionSources.ts +2 -0
- package/src/renderer/shared/utils/slashCommandProcessor.ts +7 -1
- package/src/renderer/shared/utils/speech.ts +18 -4
- package/src/renderer/shared/utils/syntaxHighlight.test.tsx +11 -1
- package/src/renderer/shared/utils/syntaxHighlight.tsx +51 -3
- package/src/renderer/shared/utils/useGeminiLiveVoice.ts +324 -51
- package/src/renderer/shared/utils/useNativeVoiceInput.ts +19 -5
- package/src/renderer/shared/utils/useSessionSources.ts +4 -0
- package/src/renderer/shared/utils/viewedImages.test.ts +129 -0
- package/src/renderer/shared/utils/viewedImages.ts +81 -10
- package/src/renderer/shared/utils/workspaceDrag.test.ts +153 -0
- package/src/renderer/shared/utils/workspaceDrag.ts +172 -0
- package/src/renderer/shared/utils/workspaceImage.ts +17 -0
- package/src/renderer/shared/utils/workspaceListPreferences.test.ts +64 -0
- package/src/renderer/shared/utils/workspaceListPreferences.ts +54 -0
- package/src/renderer/shared/utils/workspaceMedia.ts +49 -0
- package/src/renderer/shared/utils/workspacePreview.test.ts +147 -2
- package/src/renderer/shared/utils/workspacePreview.ts +34 -3
- package/src/renderer/shared/utils/workspaces.ts +3 -2
- package/src/renderer/src/App.tsx +20 -16
- package/src/renderer/src/agentProgress.ts +1 -0
- package/src/renderer/src/components/ChatPanel.tsx +1 -1
- package/src/renderer/src/components/DashboardSidebar.tsx +2 -2
- package/src/renderer/src/components/ImageStudioPanel.tsx +1 -1
- package/src/renderer/src/components/LiveTranslateControls.tsx +1 -1
- package/src/renderer/src/components/MintDashboard.tsx +1 -1
- package/src/renderer/src/components/ProactiveGlow.tsx +1 -1
- package/src/renderer/src/components/ScreenPicker.css +1 -1
- package/src/renderer/src/components/ScreenPicker.tsx +1 -1
- package/src/renderer/src/components/SettingsWindow.tsx +6 -830
- package/src/renderer/src/components/SpotlightWindow.tsx +4 -32
- package/src/renderer/src/components/VeoStudioPanel.tsx +1 -1
- package/src/renderer/src/components/WorkspacePanel.tsx +49 -15
- package/src/renderer/src/components/browser-suggestions-popup.css +8 -8
- package/src/renderer/src/css/app-shell.css +26 -106
- package/src/renderer/src/css/chat.css +1499 -292
- package/src/renderer/src/css/desktop-tools.css +17 -348
- package/src/renderer/src/css/sidebar-workspace.css +22 -2
- package/src/renderer/src/css/spotlight.css +2 -2
- package/src/renderer/src/css/tool-surfaces.css +335 -65
- package/src/renderer/src/css/widget.css +6 -5
- package/src/renderer/src/env.d.ts +13 -0
- package/src/renderer/src/index.css +53 -83
- package/src/renderer/src/tauri.ts +99 -13
- package/src/renderer/src/voiceInput.ts +3 -1
- package/src/renderer/src-web/App.tsx +20 -8
- package/src/renderer/src-web/agentProgress.ts +1 -0
- package/src/renderer/src-web/components/ChatPanel.tsx +1 -1
- package/src/renderer/src-web/components/DashboardSidebar.tsx +2 -2
- package/src/renderer/src-web/components/ImageStudioPanel.tsx +1 -1
- package/src/renderer/src-web/components/MintDashboard.tsx +1 -1
- package/src/renderer/src-web/components/SettingsWindow.tsx +6 -851
- package/src/renderer/src-web/components/VeoStudioPanel.tsx +1 -1
- package/src/renderer/src-web/css/app-shell.css +20 -104
- package/src/renderer/src-web/css/chat.css +1536 -261
- package/src/renderer/src-web/css/mobile.css +29 -13
- package/src/renderer/src-web/css/settings/mobile.css +2 -2
- package/src/renderer/src-web/css/sidebar-workspace.css +21 -1
- package/src/renderer/src-web/env.d.ts +14 -0
- package/src/renderer/src-web/index.css +53 -83
- package/src/renderer/src-web/tauri.ts +93 -15
- package/src/renderer/tests/browserArtifacts.browser.html +1 -0
- package/src/renderer/tests/browserArtifacts.browser.tsx +68 -0
- package/src/renderer/tests/chatEscape.browser.html +1 -0
- package/src/renderer/tests/chatEscape.browser.tsx +25 -0
- package/src/renderer/tests/chatPerformance.browser.html +1 -1
- package/src/renderer/tests/collapsedPaste.browser.html +1 -1
- package/src/renderer/tests/composerMenus.browser.html +3 -3
- package/src/renderer/tests/contextCompaction.browser.html +1 -1
- package/src/renderer/tests/errorRecovery.browser.html +1 -1
- package/src/renderer/tests/fixtures/preview.webm +0 -0
- package/src/renderer/tests/glideSelect.browser.html +1 -2
- package/src/renderer/tests/glideSelect.preview.html +1 -1
- package/src/renderer/tests/library.browser.tsx +4 -1
- package/src/renderer/tests/liveOrb.browser.html +1 -1
- package/src/renderer/tests/liveVoice.browser.html +1 -0
- package/src/renderer/tests/mediaFixtures.ts +32 -0
- package/src/renderer/tests/modInput.browser.html +1 -1
- package/src/renderer/tests/sessionSources.browser.tsx +76 -15
- package/src/renderer/tests/toolsPanel.browser.tsx +5 -5
- package/src/renderer/tests/viewedImages.browser.tsx +3 -3
- package/src/renderer/tests/voiceDictation.browser.html +101 -0
- package/src/renderer/tests/voicePill.browser.html +3 -3
- package/src/renderer/tests/voicePill.preview.html +1 -1
- package/src/renderer/tests/webSources.browser.tsx +2 -98
- package/src/renderer/tests/workspaceDrop.browser.html +1 -0
- package/src/renderer/tests/workspaceDrop.browser.tsx +183 -0
- package/src/renderer/tests/workspaceExpansion.browser.html +1 -0
- package/src/renderer/tests/workspaceExpansion.browser.tsx +66 -0
- package/src/renderer/tests/workspaceRemoval.browser.html +66 -0
- package/src/renderer/tests/workspaceUndo.browser.html +10 -2
- package/src-tauri/src/app/lifecycle.rs +45 -15
- package/src-tauri/src/background/headless.rs +14 -8
- package/src-tauri/src/commands/conversation.rs +137 -73
- package/src-tauri/src/commands/integrations.rs +7 -1
- package/src-tauri/src/commands/media.rs +7 -0
- package/src-tauri/src/commands/workspace.rs +38 -0
- package/src-tauri/src/native/mod.rs +0 -1
- package/src-tauri/src/native/system.rs +4 -47
- package/tsconfig.json +15 -1
- package/vite.config.ts +2 -1
- package/vite.config.web.ts +2 -0
- package/crates/mint-cli/src/interactive/chat_tui.rs +0 -7853
- package/crates/mint-core/src/agent/chat.rs +0 -4155
- package/crates/mint-core/src/browser/lifecycle.rs +0 -191
- package/crates/mint-core/src/browser/logging.rs +0 -20
- package/crates/mint-core/src/orchestration/tools/browser.rs +0 -31
- package/out/web/assets/CliSessionsView-CtzUJpK_.css +0 -1
- package/out/web/assets/CliSessionsView-D7hw0Mgj.js +0 -1
- package/out/web/assets/CodeReviewPage-C7bEOJfd.js +0 -4
- package/out/web/assets/CodeReviewPage-Dte9uLiL.css +0 -1
- package/out/web/assets/CommandPalette-0RrF-AOT.js +0 -1
- package/out/web/assets/ImageStudioPanel-CdxkAf_r.js +0 -1
- package/out/web/assets/LibraryPage--Qfisp6D.js +0 -2
- package/out/web/assets/LibraryPage-DAxUTAg7.css +0 -1
- package/out/web/assets/LinkedFoldersView-2nfZbDgN.js +0 -1
- package/out/web/assets/McpRegistryPicker-h9uS8_wT.js +0 -1
- package/out/web/assets/McpServersView-slfQJzNB.js +0 -1
- package/out/web/assets/MintDashboard-BSR5XpXh.js +0 -25
- package/out/web/assets/MintDashboard-CWUcCGhd.css +0 -1
- package/out/web/assets/PluginsView-l7LSm503.js +0 -1
- package/out/web/assets/ScheduledTasksView-CttmLbq1.js +0 -1
- package/out/web/assets/SettingsWindow-BCMLYvEV.js +0 -4
- package/out/web/assets/SettingsWindow-DcMVmU9u.css +0 -1
- package/out/web/assets/SkillsView-rNs1qr_U.js +0 -2
- package/out/web/assets/ToolSurfacePage-B9DzEPWN.js +0 -37
- package/out/web/assets/ToolSurfacePage-CTfgggF2.css +0 -1
- package/out/web/assets/VeoStudioPanel-DiJs_Cg2.js +0 -4
- package/out/web/assets/WorkspacePanel-CbJ1PFoZ.js +0 -1
- package/out/web/assets/WorkspaceSelector-B2xIp04D.js +0 -1
- package/out/web/assets/WorkspaceSelector-Ca8uJOsS.css +0 -1
- package/out/web/assets/abnfDiagram-VCTEODGH-CD0CjoGl.js +0 -1
- package/out/web/assets/architecture-7GRP2DOG-RKV83OeZ.js +0 -1
- package/out/web/assets/architectureDiagram-5GKGNRK7-nN_HAFct.js +0 -36
- package/out/web/assets/c4Diagram-UCG6FXSJ-DTdV8_zE.js +0 -38
- package/out/web/assets/chunk-2Q5K7J3B-Dmqrq8Tp.js +0 -1
- package/out/web/assets/chunk-75Z2AOVW-_M0z5olV.js +0 -2
- package/out/web/assets/chunk-CKBBP62Z-BpQEgeHF.js +0 -2
- package/out/web/assets/chunk-CLGD4ZFX-D54yGvGS.js +0 -1
- package/out/web/assets/chunk-CacB07dV.js +0 -1
- package/out/web/assets/chunk-DSNCTWBM-C-gvT2ru.js +0 -2
- package/out/web/assets/chunk-DU6HZSFF-CnFngIhW.js +0 -128
- package/out/web/assets/chunk-F27PBJKO-BqtWrnEO.js +0 -1
- package/out/web/assets/chunk-FOHPRMQF-BaVC1uA7.js +0 -161
- package/out/web/assets/chunk-G27WJ6UU-Ckoq5mi2.js +0 -231
- package/out/web/assets/chunk-JQ64N6SF-CF8T7GiZ.js +0 -1
- package/out/web/assets/chunk-JWPE2WC7-BwtYOHqU.js +0 -1
- package/out/web/assets/chunk-LNGE3PJU-AdBoOWw2.js +0 -34
- package/out/web/assets/chunk-OBVCFTLP-CRIkunUB.js +0 -1
- package/out/web/assets/chunk-P2QGCYS3-UFEU6BxZ.js +0 -1
- package/out/web/assets/chunk-POPQ4Y6H-CQcrNbjr.js +0 -1
- package/out/web/assets/chunk-PWAF6VOD-Cc2uVDsG.js +0 -1
- package/out/web/assets/chunk-R7TYR2AO-DiCxzdAY.js +0 -10
- package/out/web/assets/chunk-RHFEMEQ7-b7hnPmrR.js +0 -168
- package/out/web/assets/chunk-XXDRQBXY-DnJkbUaw.js +0 -1
- package/out/web/assets/chunk-Y2CYZVJY-C9o-s6OY.js +0 -1
- package/out/web/assets/classDiagram-DTDB5LWJ-RnC2mYO4.js +0 -1
- package/out/web/assets/classDiagram-v2-JRS7N3AN-RnC2mYO4.js +0 -1
- package/out/web/assets/config-CnvCChUM.js +0 -2
- package/out/web/assets/config-DM6oIVO3.css +0 -1
- package/out/web/assets/core-DsKkQ7ig.js +0 -1
- package/out/web/assets/cose-bilkent-JH36ORCC--UN4aw5-.js +0 -1
- package/out/web/assets/cynefin-OW5HDTMX-CnzQfOGp.js +0 -1
- package/out/web/assets/cynefinDiagram-5FMLGOSQ-DVtQnfpm.js +0 -62
- package/out/web/assets/cytoscape.esm-Df1UN4Y1.js +0 -321
- package/out/web/assets/dagre-3AP2YEHR-DG76_k5_.js +0 -4
- package/out/web/assets/dagre-BWadQu2F.js +0 -1
- package/out/web/assets/diagram-S7CK7UJ4-CaouUoze.js +0 -30
- package/out/web/assets/diagram-UQ7AKVKN-B4bEc26B.js +0 -41
- package/out/web/assets/diagram-VX7I27RA-7hH5IPYf.js +0 -24
- package/out/web/assets/diagram-Z3DM3KII-CCM4clo8.js +0 -24
- package/out/web/assets/dist-BoTOASLF.js +0 -1
- package/out/web/assets/dist-js-BkYNznHX.js +0 -1
- package/out/web/assets/ebnfDiagram-PWID7BFC-Da7WAM3k.js +0 -1
- package/out/web/assets/event-Cdt7Byyj.js +0 -1
- package/out/web/assets/eventmodeling-NTZA5JFV-xcfsA0XD.js +0 -1
- package/out/web/assets/flowDiagram-A5DVABFB-JdtH1673.js +0 -1
- package/out/web/assets/ganttDiagram-EL5Y4UJY-B3ClFGmL.js +0 -292
- package/out/web/assets/gitGraph-4MIJSDKK-BZ_y_cDU.js +0 -1
- package/out/web/assets/gitGraphDiagram-WWUBYQGX-drhRSYm3.js +0 -106
- package/out/web/assets/graphlib-CTR5ZhLf.js +0 -1
- package/out/web/assets/index-BZ9xgmMP.css +0 -1
- package/out/web/assets/index-Ca8cCS4h.js +0 -168
- package/out/web/assets/info-A6RAGUB7-B7I3K0F1.js +0 -1
- package/out/web/assets/infoDiagram-RXCK75RN-deX_1MPh.js +0 -2
- package/out/web/assets/journeyDiagram-EYS64GPL-CZn2kB8b.js +0 -139
- package/out/web/assets/jsx-runtime-DN4NhQUK.js +0 -1
- package/out/web/assets/katex-O3jvqgnU.js +0 -257
- package/out/web/assets/markdown-CMhYIcWB.js +0 -39
- package/out/web/assets/mermaid-parser.core-Whu2rlJC.js +0 -7
- package/out/web/assets/mermaid.core-CKyPo8VH.js +0 -11
- package/out/web/assets/modelManager-CUaGWMWu.js +0 -2
- package/out/web/assets/oauthManager-DlNhXJr6.js +0 -1
- package/out/web/assets/packet-AYTQ26CC-CEeIRKRG.js +0 -1
- package/out/web/assets/pegDiagram-XKGWAZYB-BYadI-KO.js +0 -1
- package/out/web/assets/pie-WAS4IAKB-D8uf4dh5.js +0 -1
- package/out/web/assets/pieDiagram-E7YTZNPT-CjSDy4hO.js +0 -39
- package/out/web/assets/radar-RG4KPBEZ-DZJxnokY.js +0 -1
- package/out/web/assets/railroad-74A4TZTK-DBysUiUi.js +0 -1
- package/out/web/assets/railroad-abnf-HS5TGJTU-CHWxoJYg.js +0 -1
- package/out/web/assets/railroad-ebnf-LZEXJU2U-DDv7X6bY.js +0 -1
- package/out/web/assets/railroad-peg-WCYAUIDC-DpfcYYNJ.js +0 -1
- package/out/web/assets/railroadDiagram-O6MQD6OU-CYtyv0t3.js +0 -1
- package/out/web/assets/rough.esm-DFbTUy8a.js +0 -1
- package/out/web/assets/sankeyDiagram-P5KCCOFB-Bn2x6C4Y.js +0 -40
- package/out/web/assets/sequenceDiagram-WJ2MYXX4-BvFLKtPd.js +0 -162
- package/out/web/assets/sizeCapture-X5ZJPWSS-DKeOCaN2.js +0 -1
- package/out/web/assets/src-DnfeXQPr.js +0 -1
- package/out/web/assets/stateDiagram-HBIQ2CUA-Bx0GWeaY.js +0 -1
- package/out/web/assets/stateDiagram-v2-4QOOHH4V--hol1yg_.js +0 -1
- package/out/web/assets/studio-B1mk40wD.js +0 -1
- package/out/web/assets/swimlanes-XN3QIQJK-CCma0T7L.js +0 -1
- package/out/web/assets/swimlanesDiagram-VK2B7HYN-BkohoVsU.js +0 -8
- package/out/web/assets/timeline-definition-24CTP7MA-iCRhhJ7C.js +0 -120
- package/out/web/assets/treeView-Q6P3EWNA-DZ-y08qp.js +0 -1
- package/out/web/assets/treemap-WGGIJYW6-De0CxzMx.js +0 -1
- package/out/web/assets/vennDiagram-4TSXK5OY-w_7aZ6xe.js +0 -34
- package/out/web/assets/wardley-WFR3VGLG-DT0y0xJ4.js +0 -1
- package/out/web/assets/window-BJCVtyET.js +0 -1
- package/shared-modules/libsecret/libsecret.json +0 -23
- package/shared-modules/libusb/libusb.json +0 -27
- package/shared-modules/lzo/lzo.json +0 -27
- package/src/renderer/shared/components/AgentActivityDrawer.tsx +0 -204
- package/src/renderer/shared/components/AgentActivityTable.tsx +0 -301
- package/src/renderer/shared/components/ChatMessageItem.test.tsx +0 -68
- package/src/renderer/shared/components/ChatMessageItem.tsx +0 -326
- package/src/renderer/shared/components/ChatPanel.test.tsx +0 -21
- package/src/renderer/shared/components/FormattedMessage.tsx +0 -11
- package/src/renderer/shared/components/GeminiLiveOverlay.test.tsx +0 -24
- package/src/renderer/shared/components/GlideSelect.d.ts +0 -31
- package/src/renderer/shared/components/GlideSelect.jsx +0 -266
- package/src/renderer/shared/components/InlineThoughtNote.tsx +0 -27
- package/src/renderer/shared/components/ModSessionControls.tsx +0 -8
- package/src/renderer/shared/components/ModUi.tsx +0 -26
- package/src/renderer/shared/components/ProgressActivity.tsx +0 -17
- package/src/renderer/shared/components/ReviewHistory.tsx +0 -42
- package/src/renderer/shared/components/RunSummaryDashboard.tsx +0 -143
- package/src/renderer/shared/components/SelectField.tsx +0 -38
- package/src/renderer/shared/components/SessionSources.tsx +0 -48
- package/src/renderer/shared/components/SessionSourcesPopover.tsx +0 -61
- package/src/renderer/shared/components/ToolSurfacePage.test.tsx +0 -32
- package/src/renderer/shared/components/ViewedImages.tsx +0 -36
- package/src/renderer/shared/components/WorkspaceContextPopover.tsx +0 -138
- package/src/renderer/shared/components/WorkspacePreviewActions.test.tsx +0 -44
- package/src/renderer/shared/components/ui/demo.tsx +0 -26
- package/src/renderer/shared/css/session-sources-popover.css +0 -9
- package/src/renderer/src/components/BrowserShell.tsx +0 -108
- package/src/renderer/src/components/BrowserSuggestionsPopup.tsx +0 -91
- package/src/renderer/src/components/CalculationCard.tsx +0 -3
- package/src/renderer/src/components/ImageGenCard.tsx +0 -2
- package/src/renderer/src/components/ImageSearchCard.tsx +0 -2
- package/src/renderer/src/components/MermaidCard.tsx +0 -1
- package/src/renderer/src/components/PicturesLibrary.tsx +0 -2
- package/src/renderer/src/components/Settings/AgentsTab.tsx +0 -4
- package/src/renderer/src/components/Settings/AudioTab.tsx +0 -3
- package/src/renderer/src/components/Settings/AutomationTab.tsx +0 -3
- package/src/renderer/src/components/Settings/GeneralTab.tsx +0 -3
- package/src/renderer/src/components/Settings/MemoryTab.tsx +0 -3
- package/src/renderer/src/components/Settings/PluginsTab.tsx +0 -3
- package/src/renderer/src/components/Settings/ProfileTab.tsx +0 -3
- package/src/renderer/src/components/Settings/ShortcutsTab.tsx +0 -3
- package/src/renderer/src/components/Settings/ThemeTab.tsx +0 -3
- package/src/renderer/src/components/StockCard.tsx +0 -3
- package/src/renderer/src/components/WeatherCard.tsx +0 -3
- package/src/renderer/src/components/browser-shell.css +0 -185
- package/src/renderer/src/css/pictures.css +0 -2
- package/src/renderer/src-web/components/PicturesLibrary.tsx +0 -2
- package/src/renderer/src-web/components/Settings/AgentsTab.tsx +0 -4
- package/src/renderer/src-web/components/Settings/AudioTab.tsx +0 -3
- package/src/renderer/src-web/components/Settings/AutomationTab.tsx +0 -3
- package/src/renderer/src-web/components/Settings/GeneralTab.tsx +0 -3
- package/src/renderer/src-web/components/Settings/MemoryTab.tsx +0 -3
- package/src/renderer/src-web/components/Settings/PluginsTab.tsx +0 -3
- package/src/renderer/src-web/components/Settings/ProfileTab.tsx +0 -3
- package/src/renderer/src-web/components/Settings/ShortcutsTab.tsx +0 -3
- package/src/renderer/src-web/components/Settings/ThemeTab.tsx +0 -3
- package/src/renderer/src-web/css/pictures.css +0 -2
- package/src/renderer/src-web/css/settings/base.css +0 -1266
- package/src/renderer/src-web/css/spotlight.css +0 -102
- package/src/renderer/src-web/css/widget.css +0 -213
- package/src-tauri/src/native/browser.rs +0 -252
- /package/src/renderer/shared/components/{ContextCompactionStatus.tsx → chat/ContextCompactionStatus.tsx} +0 -0
- /package/src/renderer/shared/components/{GeminiLiveOverlay.css → chat/GeminiLiveOverlay.css} +0 -0
- /package/src/renderer/shared/components/{VirtualChatHistory.tsx → chat/VirtualChatHistory.tsx} +0 -0
- /package/src/renderer/shared/components/{VoicePill.d.ts → chat/VoicePill.d.ts} +0 -0
- /package/src/renderer/shared/components/{VoicePill.test.tsx → chat/VoicePill.test.tsx} +0 -0
- /package/src/renderer/shared/components/{ScreenCaptureDialog.css → studio/ScreenCaptureDialog.css} +0 -0
- /package/src/renderer/shared/components/{ScreenCaptureDialog.tsx → studio/ScreenCaptureDialog.tsx} +0 -0
- /package/src/renderer/shared/components/{SelectField.test.tsx → ui/SelectField.test.tsx} +0 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/WeatherCard-Buzi7Vfu.js","assets/rolldown-runtime-CNOWq4Kh.js","assets/jsx-runtime-DmUwWVTj.js","assets/index-BocxnrDG.js","assets/index-yeh_r55a.css","assets/StockCard-DxUciKyp.js","assets/CalculationCard-D2E74u5q.js","assets/ImageSearchCard-Cld_SOUg.js","assets/ImageGenCard-BMCJHP9O.js","assets/MermaidCard-BBDNEXbY.js","assets/UiGridCard-BBK3I5hC.js","assets/UiFeatureCard-CdY0hGWy.js","assets/UiMockupWidget-CpR9EDuc.js","assets/PlanCard-C2x5pajq.js","assets/ArtifactPreviewPanel-Cx6BVOOF.js","assets/ArtifactPreviewPanel-DAT_Y7i0.css","assets/RewindModal-B5oowrR0.js","assets/SelectField-Cy6CghrU.js","assets/config-CkRCdkxn.js","assets/config-2suVFPZg.css","assets/SelectField-lFEkkWCU.css","assets/CodeReviewPage-Dp6zHuHu.js","assets/syntaxHighlight-C-wAGT84.js","assets/CodeReviewPage-BK2bOScd.css","assets/window-CkUOP7t0.js","assets/core-Mi3s5D4_.js","assets/event-D7D-EBy9.js","assets/WorkspacePanel-BfHKkulU.js","assets/ToolSurfacePage-saVbVrkE.js","assets/ToolSurfacePage-qBgs_VHq.css","assets/SkillsView-CIeWwq5z.js","assets/ScheduledTasksView-BD5DVPkZ.js","assets/LinkedFoldersView-9B9DIPoZ.js","assets/McpServersView-CiNBNUl4.js","assets/McpRegistryPicker-DnXPlzI7.js","assets/PluginsView-DoTg9MVa.js","assets/oauthManager-Ch5Du2fF.js","assets/CliSessionsView-z5i6qGyb.js","assets/workspaces-SYPrmbgC.js","assets/CliSessionsView-ZbdtSjvK.css","assets/LibraryPage-DbZEi4W_.js","assets/LibraryPage-CMB89rJ0.css","assets/ImageStudioPanel-B5N7TjeB.js","assets/studio-BBZQ_-QK.js","assets/ImageStudioPanel-D0lnhQV5.css","assets/VeoStudioPanel-Co6-wEWM.js","assets/modelManager-B3ZFMh8v.js","assets/VeoStudioPanel-9kU9YLEN.css","assets/CommandPalette-DaKlzbKs.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e,n as t,r as n,t as r}from"./rolldown-runtime-CNOWq4Kh.js";import{n as i,t as a}from"./jsx-runtime-DmUwWVTj.js";import{Ar as o,At as s,B as c,Bn as l,Br as u,C as d,D as f,En as p,Er as m,Et as h,F as g,H as _,Hn as v,Hr as y,Ht as b,I as x,In as S,It as C,J as w,Jn as T,Jr as E,K as D,Kn as O,Kt as k,L as A,M as ee,Mr as te,N as j,O as ne,On as re,Or as M,Ot as ie,P as N,Pr as ae,Qn as oe,Qr as se,Rn as ce,Rr as le,Rt as ue,S as de,Sn as fe,St as pe,T as me,Wn as he,Wr as ge,Wt as _e,Xn as ve,_ as ye,ei as be,en as xe,et as Se,f as Ce,fn as we,ft as Te,g as Ee,gr as De,h as P,it as Oe,j as ke,k as Ae,m as je,mn as Me,ni as Ne,nn as Pe,or as Fe,p as Ie,un as Le,ut as Re,v as ze,w as Be,wr as Ve}from"./index-BocxnrDG.js";import{n as He,r as Ue,t as We}from"./syntaxHighlight-C-wAGT84.js";import{$ as Ge,A as Ke,B as qe,C as Je,D as Ye,Dt as Xe,Et as Ze,F as Qe,G as $e,H as et,I as tt,J as nt,K as rt,M as it,P as at,S as ot,St as st,T as ct,U as lt,V as ut,Y as dt,Z as ft,_ as pt,_t as mt,a as ht,at as gt,b as _t,bt as vt,c as yt,ct as bt,d as xt,dt as St,et as Ct,f as wt,ft as Tt,g as Et,gt as Dt,h as Ot,ht as kt,j as At,l as jt,lt as Mt,m as Nt,mt as Pt,n as Ft,nt as It,o as Lt,p as Rt,pt as zt,q as Bt,r as Vt,rt as Ht,s as Ut,st as Wt,t as Gt,u as Kt,ut as qt,v as Jt,w as Yt,x as Xt,y as Zt,z as Qt}from"./config-CkRCdkxn.js";import{n as $t,r as en,t as tn}from"./workspaces-SYPrmbgC.js";var nn=t((()=>{}));function rn(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var an=t((()=>{}));function on(e,t){return((t||ln).jsx?cn:sn).test(e)}var sn,cn,ln,un=t((()=>{sn=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cn=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ln={}})),dn=t((()=>{un()}));function fn(e){return typeof e==`object`?e.type===`text`&&pn(e.value):pn(e)}function pn(e){return e.replace(mn,``)===``}var mn,hn=t((()=>{mn=/[ \t\n\f\r]/g})),gn=t((()=>{hn()})),_n,vn=t((()=>{_n=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}},_n.prototype.normal={},_n.prototype.property={},_n.prototype.space=void 0}));function yn(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new _n(n,r,t)}var bn=t((()=>{vn()}));function xn(e){return e.toLowerCase()}var Sn=t((()=>{})),Cn,wn=t((()=>{Cn=class{constructor(e,t){this.attribute=t,this.property=e}},Cn.prototype.attribute=``,Cn.prototype.booleanish=!1,Cn.prototype.boolean=!1,Cn.prototype.commaOrSpaceSeparated=!1,Cn.prototype.commaSeparated=!1,Cn.prototype.defined=!1,Cn.prototype.mustUseProperty=!1,Cn.prototype.number=!1,Cn.prototype.overloadedBoolean=!1,Cn.prototype.property=``,Cn.prototype.spaceSeparated=!1,Cn.prototype.space=void 0})),Tn=n({boolean:()=>F,booleanish:()=>On,commaOrSpaceSeparated:()=>Mn,commaSeparated:()=>jn,number:()=>I,overloadedBoolean:()=>kn,spaceSeparated:()=>An});function En(){return 2**++Dn}var Dn,F,On,kn,I,An,jn,Mn,Nn=t((()=>{Dn=0,F=En(),On=En(),kn=En(),I=En(),An=En(),jn=En(),Mn=En()}));function Pn(e,t,n){n&&(e[t]=n)}var Fn,In,Ln=t((()=>{wn(),Nn(),Fn=Object.keys(Tn),In=class extends Cn{constructor(e,t,n,r){let i=-1;if(super(e,t),Pn(this,`space`,r),typeof n==`number`)for(;++i<Fn.length;){let e=Fn[i];Pn(this,Fn[i],(n&Tn[e])===Tn[e])}}},In.prototype.defined=!0}));function Rn(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new In(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[xn(r)]=r,n[xn(a.attribute)]=r}return new _n(t,n,e.space)}var zn=t((()=>{Sn(),Ln(),vn()})),Bn,Vn=t((()=>{zn(),Nn(),Bn=Rn({properties:{ariaActiveDescendant:null,ariaAtomic:On,ariaAutoComplete:null,ariaBusy:On,ariaChecked:On,ariaColCount:I,ariaColIndex:I,ariaColSpan:I,ariaControls:An,ariaCurrent:null,ariaDescribedBy:An,ariaDetails:null,ariaDisabled:On,ariaDropEffect:An,ariaErrorMessage:null,ariaExpanded:On,ariaFlowTo:An,ariaGrabbed:On,ariaHasPopup:null,ariaHidden:On,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:An,ariaLevel:I,ariaLive:null,ariaModal:On,ariaMultiLine:On,ariaMultiSelectable:On,ariaOrientation:null,ariaOwns:An,ariaPlaceholder:null,ariaPosInSet:I,ariaPressed:On,ariaReadOnly:On,ariaRelevant:null,ariaRequired:On,ariaRoleDescription:An,ariaRowCount:I,ariaRowIndex:I,ariaRowSpan:I,ariaSelected:On,ariaSetSize:I,ariaSort:null,ariaValueMax:I,ariaValueMin:I,ariaValueNow:I,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}})}));function Hn(e,t){return t in e?e[t]:t}var Un=t((()=>{}));function Wn(e,t){return Hn(e,t.toLowerCase())}var Gn=t((()=>{Un()})),Kn,qn=t((()=>{Gn(),zn(),Nn(),Kn=Rn({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:jn,acceptCharset:An,accessKey:An,action:null,allow:null,allowFullScreen:F,allowPaymentRequest:F,allowUserMedia:F,alpha:F,alt:null,as:null,async:F,autoCapitalize:null,autoComplete:An,autoFocus:F,autoPlay:F,blocking:An,capture:null,charSet:null,checked:F,cite:null,className:An,closedBy:null,colorSpace:null,cols:I,colSpan:I,command:null,commandFor:null,content:null,contentEditable:On,controls:F,controlsList:An,coords:I|jn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:F,defer:F,dir:null,dirName:null,disabled:F,download:kn,draggable:On,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:F,formTarget:null,headers:An,height:I,hidden:kn,high:I,href:null,hrefLang:null,htmlFor:An,httpEquiv:An,id:null,imageSizes:null,imageSrcSet:null,inert:F,inputMode:null,integrity:null,is:null,isMap:F,itemId:null,itemProp:An,itemRef:An,itemScope:F,itemType:An,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:F,low:I,manifest:null,max:null,maxLength:I,media:null,method:null,min:null,minLength:I,multiple:F,muted:F,name:null,nonce:null,noModule:F,noValidate:F,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:F,optimum:I,pattern:null,ping:An,placeholder:null,playsInline:F,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:F,referrerPolicy:null,rel:An,required:F,reversed:F,rows:I,rowSpan:I,sandbox:An,scope:null,scoped:F,seamless:F,selected:F,shadowRootClonable:F,shadowRootCustomElementRegistry:F,shadowRootDelegatesFocus:F,shadowRootMode:null,shadowRootSerializable:F,shape:null,size:I,sizes:null,slot:null,span:I,spellCheck:On,src:null,srcDoc:null,srcLang:null,srcSet:null,start:I,step:null,style:null,tabIndex:I,target:null,title:null,translate:null,type:null,typeMustMatch:F,useMap:null,value:On,width:I,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:An,axis:null,background:null,bgColor:null,border:I,borderColor:null,bottomMargin:I,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:F,declare:F,event:null,face:null,frame:null,frameBorder:null,hSpace:I,leftMargin:I,link:null,longDesc:null,lowSrc:null,marginHeight:I,marginWidth:I,noResize:F,noHref:F,noShade:F,noWrap:F,object:null,profile:null,prompt:null,rev:null,rightMargin:I,rules:null,scheme:null,scrolling:On,standby:null,summary:null,text:null,topMargin:I,valueType:null,version:null,vAlign:null,vLink:null,vSpace:I,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:F,disablePictureInPicture:F,disableRemotePlayback:F,exportParts:jn,part:An,prefix:null,property:null,results:I,security:null,unselectable:null},space:`html`,transform:Wn})})),Jn,Yn=t((()=>{Un(),zn(),Nn(),Jn=Rn({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Mn,accentHeight:I,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:I,amplitude:I,arabicForm:null,ascent:I,attributeName:null,attributeType:null,azimuth:I,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:I,by:null,calcMode:null,capHeight:I,className:An,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:I,diffuseConstant:I,direction:null,display:null,dur:null,divisor:I,dominantBaseline:null,download:F,dx:null,dy:null,edgeMode:null,editable:null,elevation:I,enableBackground:null,end:null,event:null,exponent:I,externalResourcesRequired:null,fill:null,fillOpacity:I,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:jn,g2:jn,glyphName:jn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:I,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:I,horizOriginX:I,horizOriginY:I,id:null,ideographic:I,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:I,k:I,k1:I,k2:I,k3:I,k4:I,kernelMatrix:Mn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:I,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:I,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:I,overlineThickness:I,paintOrder:null,panose1:null,path:null,pathLength:I,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:An,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:I,pointsAtY:I,pointsAtZ:I,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Mn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Mn,rev:Mn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Mn,requiredFeatures:Mn,requiredFonts:Mn,requiredFormats:Mn,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:I,specularExponent:I,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:I,strikethroughThickness:I,string:null,stroke:null,strokeDashArray:Mn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:I,strokeOpacity:I,strokeWidth:null,style:null,surfaceScale:I,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Mn,tabIndex:I,tableValues:null,target:null,targetX:I,targetY:I,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Mn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:I,underlineThickness:I,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:I,values:null,vAlphabetic:I,vMathematical:I,vectorEffect:null,vHanging:I,vIdeographic:I,version:null,vertAdvY:I,vertOriginX:I,vertOriginY:I,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:I,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Hn})})),Xn,Zn=t((()=>{zn(),Xn=Rn({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()}})})),Qn,$n=t((()=>{zn(),Gn(),Qn=Rn({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Wn})})),er,tr=t((()=>{zn(),er=Rn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}})})),nr,rr=t((()=>{nr={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`}}));function ir(e,t){let n=xn(t),r=t,i=Cn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&lr.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(cr,or);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!cr.test(e)){let n=e.replace(sr,ar);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=In}return new i(r,t)}function ar(e){return`-`+e.toLowerCase()}function or(e){return e.charAt(1).toUpperCase()}var sr,cr,lr,ur=t((()=>{Ln(),wn(),Sn(),sr=/[A-Z]/g,cr=/-[a-z]/g,lr=/^data[-\w.:]+$/i})),dr,fr,pr=t((()=>{bn(),Vn(),qn(),Yn(),Zn(),$n(),tr(),rr(),ur(),dr=yn([Bn,Kn,Xn,Qn,er],`html`),fr=yn([Bn,Jn,Xn,Qn,er],`svg`)}));function mr(e){return e.join(` `).trim()}var hr=t((()=>{})),gr=r(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
3
|
+
`);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),_r=r(((e,t,n)=>{var r=n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var i=r(gr());function a(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=(0,i.default)(e),a=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:i}=e;a?t(r,i,e):i&&(n||={},n[r]=i)}),n}})),vr=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),yr=r(((e,t,n)=>{var r=(n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(_r()),i=vr();function a(e,t){var n={};return!e||typeof e!=`string`||(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}a.default=a,t.exports=a}));function br(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function xr(e){let t=Cr(e),n=Sr(e);if(t&&n)return{start:t,end:n}}var Sr,Cr,wr=t((()=>{Sr=br(`end`),Cr=br(`start`)})),Tr=t((()=>{wr()}));function Er(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Or(e.position):`start`in e||`end`in e?Or(e):`line`in e||`column`in e?Dr(e):``}function Dr(e){return kr(e&&e.line)+`:`+kr(e&&e.column)}function Or(e){return Dr(e&&e.start)+`-`+Dr(e&&e.end)}function kr(e){return e&&typeof e==`number`?e:1}var Ar=t((()=>{})),jr=t((()=>{Ar()})),Mr,Nr=t((()=>{jr(),Mr=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Er(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}},Mr.prototype.file=``,Mr.prototype.name=``,Mr.prototype.reason=``,Mr.prototype.message=``,Mr.prototype.stack=``,Mr.prototype.column=void 0,Mr.prototype.line=void 0,Mr.prototype.ancestors=void 0,Mr.prototype.cause=void 0,Mr.prototype.fatal=void 0,Mr.prototype.place=void 0,Mr.prototype.ruleId=void 0,Mr.prototype.source=void 0})),Pr=t((()=>{Nr()}));function Fr(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=Kr(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Gr(n,t.jsx,t.jsxs)}let 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`?fr:dr,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Ir(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Ir(e,t,n){if(t.type===`element`)return Lr(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Rr(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Br(e,t,n);if(t.type===`mdxjsEsm`)return zr(e,t);if(t.type===`root`)return Vr(e,t,n);if(t.type===`text`)return Hr(e,t)}function Lr(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=fr,e.schema=i),e.ancestors.push(t);let a=Qr(e,t.tagName,!1),o=qr(e,t),s=Yr(e,t);return si.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!fn(e)})),Ur(e,o,a,t),Wr(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Rr(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}$r(e,t.position)}function zr(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);$r(e,t.position)}function Br(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=fr,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Qr(e,t.name,!0),o=Jr(e,t),s=Yr(e,t);return Ur(e,o,a,t),Wr(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Vr(e,t,n){let r={};return Wr(r,Yr(e,t)),e.create(t,e.Fragment,r,n)}function Hr(e,t){return t.value}function Ur(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Wr(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Gr(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function Kr(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Cr(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function qr(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&ii.call(t.properties,i)){let a=Xr(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&ci.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Jr(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else $r(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else $r(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Yr(e,t){let n=[],r=-1,i=e.passKeys?new Map:ai;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Ir(e,a,o);s!==void 0&&n.push(s)}return n}function Xr(e,t,n){let r=ir(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?rn(n):mr(n)),r.property===`style`){let t=typeof n==`object`?n:Zr(e,String(n));return e.stylePropertyNameCase===`css`&&(t=ei(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?nr[r.property]||r.property:r.attribute,n]}}function Zr(e,t){try{return(0,ri.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Mr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=li+`#cannot-parse-style-attribute`,r}}function Qr(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=on(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=on(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return ii.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);$r(e)}function $r(e,t){let n=new Mr("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=li+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function ei(e){let t={},n;for(n in e)ii.call(e,n)&&(t[ti(n)]=e[n]);return t}function ti(e){let t=e.replace(oi,ni);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function ni(e){return`-`+e.toLowerCase()}var ri,ii,ai,oi,si,ci,li,ui=t((()=>{an(),nn(),dn(),gn(),pr(),hr(),ri=e(yr(),1),Tr(),Pr(),ii={}.hasOwnProperty,ai=new Map,oi=/[A-Z]/g,si=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),ci=new Set([`td`,`th`]),li=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`})),di=t((()=>{ui()})),fi,pi=t((()=>{fi={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`]}})),mi=t((()=>{pi()}));function hi(e,t){let n=t||yi;return gi(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function gi(e,t,n){if(vi(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 _i(e.children,t,n)}return Array.isArray(e)?_i(e,t,n):``}function _i(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=gi(e[i],t,n);return r.join(``)}function vi(e){return!!(e&&typeof e==`object`)}var yi,bi=t((()=>{yi={}})),xi=t((()=>{bi()}));function Si(e){let t=`&`+e+`;`;Ci.innerHTML=t;let n=Ci.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}var Ci,wi=t((()=>{Ci=document.createElement(`i`)}));function Ti(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Ei(e,t){return e.length>0?(Ti(e,e.length,0,t),e):t}var Di=t((()=>{}));function Oi(e){let t={},n=-1;for(;++n<e.length;)ki(t,e[n]);return t}function ki(e,t){let n;for(n in t){let r=(ji.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){ji.call(r,a)||(r[a]=[]);let e=i[a];Ai(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Ai(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Ti(e,0,0,r)}var ji,Mi=t((()=>{Di(),ji={}.hasOwnProperty}));function Ni(e,t){let 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)}var Pi=t((()=>{}));function Fi(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var Ii=t((()=>{}));function Li(e){return e!==null&&(e<32||e===127)}function L(e){return e!==null&&e<-2}function Ri(e){return e!==null&&(e<0||e===32)}function zi(e){return e===-2||e===-1||e===32}function Bi(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}var Vi,Hi,Ui,Wi,Gi,Ki,qi,Ji,Yi=t((()=>{Vi=Bi(/[A-Za-z]/),Hi=Bi(/[\dA-Za-z]/),Ui=Bi(/[#-'*+\--9=?A-Z^-~]/),Wi=Bi(/\d/),Gi=Bi(/[\dA-Fa-f]/),Ki=Bi(/[!-/:-@[-`{-~]/),qi=Bi(/\p{P}|\p{S}/u),Ji=Bi(/\s/)}));function Xi(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&Hi(e.charCodeAt(n+1))&&Hi(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}var Zi=t((()=>{Yi()}));function Qi(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return zi(r)?(e.enter(n),s(r)):t(r)}function s(r){return zi(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var $i=t((()=>{Yi()}));function ea(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Qi(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return L(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var ta,na=t((()=>{$i(),Yi(),ta={tokenize:ea}}));function ra(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return Ti(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(oa,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(oa,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return L(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;Ti(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ia(e,t,n){return Qi(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}var aa,oa,sa=t((()=>{$i(),Yi(),Di(),aa={tokenize:ra},oa={tokenize:ia}}));function ca(e){if(e===null||Ri(e)||Ji(e))return 1;if(qi(e))return 2}var la=t((()=>{Yi()}));function ua(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var da=t((()=>{}));function fa(e,t){let n=-1,r,i,a,o,s,c,l,u;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;let d={...e[r][1].end},f={...e[n][1].start};ma(d,-c),ma(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Ei(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Ei(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=Ei(l,ua(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Ei(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=Ei(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,Ti(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function pa(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ca(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=ca(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function ma(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var ha,ga=t((()=>{Di(),la(),da(),ha={name:`attention`,resolveAll:fa,tokenize:pa}}));function _a(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return Vi(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Hi(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||Hi(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Li(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Ui(t)?(e.consume(t),l):n(t)}function u(e){return Hi(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||Hi(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var va,ya=t((()=>{Yi(),va={name:`autolink`,tokenize:_a}}));function ba(e,t,n){return r;function r(t){return zi(t)?Qi(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||L(e)?t(e):n(e)}}var xa,Sa=t((()=>{$i(),Yi(),xa={partial:!0,tokenize:ba}}));function Ca(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return zi(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function wa(e,t,n){let r=this;return i;function i(t){return zi(t)?Qi(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Ea,t,n)(r)}}function Ta(e){e.exit(`blockQuote`)}var Ea,Da=t((()=>{$i(),Yi(),Ea={continuation:{tokenize:wa},exit:Ta,name:`blockQuote`,tokenize:Ca}}));function Oa(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Ki(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var ka,Aa=t((()=>{Yi(),ka={name:`characterEscape`,tokenize:Oa}}));function ja(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=Hi,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Gi,u):(e.enter(`characterReferenceValue`),a=7,o=Wi,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Hi&&!Si(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var Ma,Na=t((()=>{wi(),Yi(),Ma={name:`characterReference`,tokenize:ja}}));function Pa(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),zi(t)?Qi(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||L(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Ia,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||L(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):zi(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Qi(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||L(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||L(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&zi(t)?Qi(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||L(t)?e.check(Ia,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||L(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),zi(t)?Qi(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),zi(t)?Qi(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||L(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Fa(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Ia,La,Ra=t((()=>{$i(),Yi(),Ia={partial:!0,tokenize:Fa},La={concrete:!0,name:`codeFenced`,tokenize:Pa}}));function za(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Qi(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):L(t)?e.attempt(Ha,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||L(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Ba(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):L(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Qi(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):L(e)?i(e):n(e)}}var Va,Ha,Ua=t((()=>{$i(),Yi(),Va={name:`codeIndented`,tokenize:za},Ha={partial:!0,tokenize:Ba}}));function Wa(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 Ga(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Ka(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):L(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||L(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var qa,Ja=t((()=>{Yi(),qa={name:`codeText`,previous:Ga,resolve:Wa,tokenize:Ka}}));function Ya(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}var Xa,Za=t((()=>{Xa=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Ya(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Ya(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Ya(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);Ya(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Ya(this.left,t.reverse())}}}}}));function Qa(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Xa(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,$a(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return Ti(e,0,1/0,u.slice(0)),!l}function $a(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var eo=t((()=>{Di(),Za()}));function to(e){return Qa(e),e}function no(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):L(t)?e.check(ao,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function ro(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Qi(e,a,`linePrefix`)}function a(i){if(i===null||L(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}var io,ao,oo=t((()=>{$i(),Yi(),eo(),io={resolve:to,tokenize:no},ao={partial:!0,tokenize:ro}}));function so(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Li(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||L(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||Ri(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Li(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}var co=t((()=>{Yi()}));function lo(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):L(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||L(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!zi(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}var uo=t((()=>{Yi()}));function fo(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):L(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Qi(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||L(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}var po=t((()=>{$i(),Yi()}));function mo(e,t){let n;return r;function r(i){return L(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):zi(i)?Qi(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var ho=t((()=>{$i(),Yi()}));function go(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return lo.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=Fi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return Ri(t)?mo(e,l)(t):l(t)}function l(t){return so(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(yo,d,d)(t)}function d(t){return zi(t)?Qi(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||L(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function _o(e,t,n){return r;function r(t){return Ri(t)?mo(e,i)(t):n(t)}function i(t){return fo(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return zi(t)?Qi(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||L(e)?t(e):n(e)}}var vo,yo,bo=t((()=>{co(),uo(),$i(),po(),ho(),Yi(),Ii(),vo={name:`definition`,tokenize:go},yo={partial:!0,tokenize:_o}}));function xo(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return L(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var So,Co=t((()=>{Yi(),So={name:`hardBreakEscape`,tokenize:xo}}));function wo(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},Ti(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function To(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||Ri(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||L(n)?(e.exit(`atxHeading`),t(n)):zi(n)?Qi(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||Ri(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Eo,Do=t((()=>{$i(),Yi(),Di(),Eo={name:`headingAtx`,resolve:wo,tokenize:To}})),Oo,ko,Ao=t((()=>{Oo=`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`.split(`.`),ko=[`pre`,`script`,`style`,`textarea`]}));function jo(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 Mo(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:M):Vi(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):Vi(a)?(e.consume(a),i=4,r.interrupt?t:M):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:M):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return Vi(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Ri(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&ko.includes(l)?(i=1,r.interrupt?t(s):O(s)):Oo.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||Hi(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return zi(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Vi(t)?(e.consume(t),b):zi(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||Hi(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):zi(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):zi(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||L(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||Ri(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||zi(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||L(t)?O(t):zi(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),te):t===60&&i===1?(e.consume(t),j):t===62&&i===4?(e.consume(t),ie):t===63&&i===3?(e.consume(t),M):t===93&&i===5?(e.consume(t),re):L(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Io,N,k)(t)):t===null||L(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Lo,A,N)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return t===null||L(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function te(t){return t===45?(e.consume(t),M):O(t)}function j(t){return t===47?(e.consume(t),o=``,ne):O(t)}function ne(t){if(t===62){let n=o.toLowerCase();return ko.includes(n)?(e.consume(t),ie):O(t)}return Vi(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ne):O(t)}function re(t){return t===93?(e.consume(t),M):O(t)}function M(t){return t===62?(e.consume(t),ie):t===45&&i===2?(e.consume(t),M):O(t)}function ie(t){return t===null||L(t)?(e.exit(`htmlFlowData`),N(t)):(e.consume(t),ie)}function N(n){return e.exit(`htmlFlow`),t(n)}}function No(e,t,n){let r=this;return i;function i(t){return L(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Po(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(xa,t,n)}}var Fo,Io,Lo,Ro=t((()=>{Yi(),Ao(),Sa(),Fo={concrete:!0,name:`htmlFlow`,resolveTo:jo,tokenize:Mo},Io={partial:!0,tokenize:Po},Lo={partial:!0,tokenize:No}}));function zo(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):Vi(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):Vi(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):L(t)?(o=d,j(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?te(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):L(t)?(o=h,j(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?te(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?te(t):L(t)?(o=v,j(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):L(t)?(o=y,j(t)):(e.consume(t),y)}function b(e){return e===62?te(e):y(e)}function x(t){return Vi(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Hi(t)?(e.consume(t),S):C(t)}function C(t){return L(t)?(o=C,j(t)):zi(t)?(e.consume(t),C):te(t)}function w(t){return t===45||Hi(t)?(e.consume(t),w):t===47||t===62||Ri(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),te):t===58||t===95||Vi(t)?(e.consume(t),E):L(t)?(o=T,j(t)):zi(t)?(e.consume(t),T):te(t)}function E(t){return t===45||t===46||t===58||t===95||Hi(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):L(t)?(o=D,j(t)):zi(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):L(t)?(o=O,j(t)):zi(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,ee):t===null?n(t):L(t)?(o=k,j(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Ri(t)?T(t):(e.consume(t),A)}function ee(e){return e===47||e===62||Ri(e)?T(e):n(e)}function te(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function j(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ne}function ne(t){return zi(t)?Qi(e,re,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):re(t)}function re(t){return e.enter(`htmlTextData`),o(t)}}var Bo,Vo=t((()=>{$i(),Yi(),Bo={name:`htmlText`,tokenize:zo}}));function Ho(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&Ti(e,0,e.length,n),e}function Uo(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=Ei(s,e.slice(a+1,a+r+3)),s=Ei(s,[[`enter`,u,t]]),s=Ei(s,ua(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=Ei(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=Ei(s,e.slice(o+1)),s=Ei(s,[[`exit`,c,t]]),Ti(e,a,e.length,s),e}function Wo(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(Fi(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Yo,u,o?u:d)(t):t===91?e.attempt(Xo,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Zo,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Go(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return Ri(t)?mo(e,a)(t):a(t)}function a(t){return t===41?u(t):so(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Ri(t)?mo(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?fo(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Ri(t)?mo(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Ko(e,t,n){let r=this;return i;function i(t){return lo.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(Fi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function qo(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var Jo,Yo,Xo,Zo,Qo=t((()=>{co(),uo(),po(),ho(),Yi(),Di(),Ii(),da(),Jo={name:`labelEnd`,resolveAll:Ho,resolveTo:Uo,tokenize:Wo},Yo={tokenize:Go},Xo={tokenize:Ko},Zo={tokenize:qo}}));function $o(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var es,ts=t((()=>{Qo(),es={name:`labelStartImage`,resolveAll:Jo.resolveAll,tokenize:$o}}));function ns(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var rs,is=t((()=>{Qo(),rs={name:`labelStartLink`,resolveAll:Jo.resolveAll,tokenize:ns}}));function as(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Qi(e,t,`linePrefix`)}}var os,ss=t((()=>{$i(),os={name:`lineEnding`,tokenize:as}}));function cs(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||L(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),zi(t)?Qi(e,s,`whitespace`)(t):s(t))}}var ls,us=t((()=>{$i(),Yi(),ls={name:`thematicBreak`,tokenize:cs}}));function ds(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Wi(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(ls,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Wi(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(xa,r.interrupt?n:u,e.attempt(_s,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return zi(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function fs(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(xa,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Qi(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!zi(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(vs,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Qi(e,e.attempt(gs,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function ps(e,t,n){let r=this;return Qi(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function ms(e){e.exit(this.containerState.type)}function hs(e,t,n){let r=this;return Qi(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!zi(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var gs,_s,vs,ys=t((()=>{$i(),Yi(),Sa(),us(),gs={continuation:{tokenize:fs},exit:ms,name:`list`,tokenize:ds},_s={partial:!0,tokenize:hs},vs={partial:!0,tokenize:ps}}));function bs(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function xs(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),zi(t)?Qi(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||L(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Ss,Cs=t((()=>{$i(),Yi(),Ss={name:`setextUnderline`,resolveTo:bs,tokenize:xs}})),ws=t((()=>{ga(),ya(),Sa(),Da(),Aa(),Na(),Ra(),Ua(),Ja(),oo(),bo(),Co(),Do(),Ro(),Vo(),Qo(),ts(),is(),ss(),ys(),Cs(),us()}));function Ts(e){let t=this,n=e.attempt(xa,r,e.attempt(this.parser.constructs.flowInitial,i,Qi(e,e.attempt(this.parser.constructs.flow,i,e.attempt(io,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Es,Ds=t((()=>{ws(),$i(),Es={tokenize:Ts}}));function Os(e){return{resolveAll:ks(e===`text`?As:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function ks(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):t[r]&&t[r][1].type===`data`||(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function As(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var js,Ms,Ns,Ps=t((()=>{js={resolveAll:ks()},Ms=Os(`string`),Ns=Os(`text`)})),Fs=n({attentionMarkers:()=>Us,contentInitial:()=>Ls,disable:()=>Ws,document:()=>Is,flow:()=>zs,flowInitial:()=>Rs,insideSpan:()=>Hs,string:()=>Bs,text:()=>Vs}),Is,Ls,Rs,zs,Bs,Vs,Hs,Us,Ws,Gs=t((()=>{ws(),Ps(),Is={42:gs,43:gs,45:gs,48:gs,49:gs,50:gs,51:gs,52:gs,53:gs,54:gs,55:gs,56:gs,57:gs,62:Ea},Ls={91:vo},Rs={[-2]:Va,[-1]:Va,32:Va},zs={35:Eo,42:ls,45:[Ss,ls],60:Fo,61:Ss,95:ls,96:La,126:La},Bs={38:Ma,92:ka},Vs={[-5]:os,[-4]:os,[-3]:os,33:es,38:Ma,42:ha,60:[va,Bo],91:rs,92:[So,ka],93:Jo,95:ha,96:qa},Hs={null:[ha,js]},Us={null:[42,95]},Ws={null:[]}}));function Ks(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=Ei(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=ua(a,l.events,l),l.events):[]}function f(e,t){return Js(p(e),t)}function p(e){return qs(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){L(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&Ti(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function qs(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Js(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
4
|
+
`;break;case-3:o=`\r
|
|
5
|
+
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}var Ys=t((()=>{Yi(),Di(),da()}));function Xs(e){let t={constructs:Oi([Fs,...(e||{}).extensions||[]]),content:n(ta),defined:[],document:n(aa),flow:n(Es),lazy:{},string:n(Ms),text:n(Ns)};return t;function n(e){return n;function n(n){return Ks(t,e,n)}}}var Zs=t((()=>{Mi(),na(),sa(),Ds(),Ps(),Gs(),Ys()}));function Qs(e){for(;!Qa(e););return e}var $s=t((()=>{eo()}));function ec(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(tc.lastIndex=u,c=tc.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var tc,nc=t((()=>{tc=/[\0\t\n\r]/g})),rc=t((()=>{wi(),Mi(),Zi(),Zs(),$s(),nc()}));function ic(e){return e.replace(oc,ac)}function ac(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Ni(n.slice(t?2:1),t?16:10)}return Si(n)||e}var oc,sc=t((()=>{wi(),Pi(),oc=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi}));function cc(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),lc(n)(Qs(Xs(n).document().write(ec()(e,t,!0))))}function lc(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(xe),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(_e),blockQuote:a(fe),characterEscape:T,characterReference:T,codeFenced:a(pe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(pe,o),codeText:a(me,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(he),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ge),hardBreakEscape:a(ve),hardBreakTrailing:a(ve),htmlFlow:a(ye,o),htmlFlowData:T,htmlText:a(ye,o),htmlTextData:T,image:a(be),label:o,link:a(xe),listItem:a(Ce),listItemValue:f,listOrdered:a(Se,d),listUnordered:a(Se),paragraph:a(we),reference:ae,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(_e),strong:a(Te),thematicBreak:a(De)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:de,autolinkProtocol:ue,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:ce,characterReference:le,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(ee),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(j),label:re,labelText:ne,lineEnding:D,link:c(te),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:oe,resourceDestinationString:M,resourceTitleString:ie,resource:N,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};dc(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];mc.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||pc).call(a,void 0,e[0])}for(r.position={start:uc(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:uc(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:uc(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||pc).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Er({start:e.start,end:e.end})+`): it’s not open`);n.position.end=uc(e.end)}function u(){return hi(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Fi(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&n.type===`text`||(n=Ee(),n.position={start:uc(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=uc(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=uc(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function te(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function j(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ne(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=ic(t),n.identifier=Fi(t).toLowerCase()}function re(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function M(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ie(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function N(){this.data.inReference=void 0}function ae(){this.data.referenceType=`collapsed`}function oe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Fi(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function se(e){this.data.characterReferenceType=e.type}function ce(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Ni(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Si(t);let i=this.stack[this.stack.length-1];i.value+=r}function le(e){let t=this.stack.pop();t.position.end=uc(e.end)}function ue(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function de(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function fe(){return{type:`blockquote`,children:[]}}function pe(){return{type:`code`,lang:null,meta:null,value:``}}function me(){return{type:`inlineCode`,value:``}}function he(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ge(){return{type:`emphasis`,children:[]}}function _e(){return{type:`heading`,depth:0,children:[]}}function ve(){return{type:`break`}}function ye(){return{type:`html`,value:``}}function be(){return{type:`image`,title:null,url:``,alt:null}}function xe(){return{type:`link`,title:null,url:``,children:[]}}function Se(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Ce(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function we(){return{type:`paragraph`,children:[]}}function Te(){return{type:`strong`,children:[]}}function Ee(){return{type:`text`,value:``}}function De(){return{type:`thematicBreak`}}}function uc(e){return{line:e.line,column:e.column,offset:e.offset}}function dc(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?dc(e,r):fc(e,r)}}function fc(e,t){let n;for(n in t)if(mc.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function pc(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Er({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Er({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Er({start:t.start,end:t.end})+`) is still open`)}var mc,hc=t((()=>{xi(),rc(),Pi(),sc(),Ii(),wi(),jr(),mc={}.hasOwnProperty})),gc=t((()=>{hc()}));function _c(e){let t=this;t.parser=n;function n(n){return cc(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}var vc=t((()=>{gc()})),yc=t((()=>{vc()}));function bc(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}var xc=t((()=>{}));function Sc(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
6
|
+
`}]}var Cc=t((()=>{}));function wc(e,t){let n=t.value?t.value+`
|
|
7
|
+
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}var Tc=t((()=>{}));function Ec(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Dc=t((()=>{}));function Oc(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var kc=t((()=>{}));function Ac(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=Xi(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}var jc=t((()=>{Zi()}));function Mc(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Nc=t((()=>{}));function Pc(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}var Fc=t((()=>{}));function Ic(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}var Lc=t((()=>{}));function Rc(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ic(e,t);let i={src:Xi(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}var zc=t((()=>{Zi(),Lc()}));function Bc(e,t){let n={src:Xi(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}var Vc=t((()=>{Zi()}));function Hc(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}var Uc=t((()=>{}));function Wc(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ic(e,t);let i={href:Xi(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var Gc=t((()=>{Zi(),Lc()}));function Kc(e,t){let n={href:Xi(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}var qc=t((()=>{Zi()}));function Jc(e,t,n){let r=e.all(t),i=n?Yc(n):Xc(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
8
|
+
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
9
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Yc(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=Xc(n[r])}return t}function Xc(e){return e.spread??e.children.length>1}var Zc=t((()=>{}));function Qc(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}var $c=t((()=>{}));function el(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var tl=t((()=>{}));function nl(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}var rl=t((()=>{}));function il(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var al=t((()=>{}));function ol(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=Cr(t.children[1]),o=Sr(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}var sl=t((()=>{Tr()}));function cl(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}var ll=t((()=>{}));function ul(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var dl=t((()=>{}));function fl(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(pl(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(pl(t.slice(i),i>0,!1)),a.join(``)}function pl(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===ml||t===hl;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===ml||t===hl;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}var ml,hl,gl=t((()=>{ml=9,hl=32}));function _l(e,t){let n={type:`text`,value:fl(String(t.value))};return e.patch(t,n),e.applyData(t,n)}var vl=t((()=>{gl()}));function yl(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var bl=t((()=>{}));function xl(){}var Sl,Cl=t((()=>{xc(),Cc(),Tc(),Dc(),kc(),jc(),Nc(),Fc(),zc(),Vc(),Uc(),Gc(),qc(),Zc(),$c(),tl(),rl(),al(),sl(),ll(),dl(),vl(),bl(),Sl={blockquote:bc,break:Sc,code:wc,delete:Ec,emphasis:Oc,footnoteReference:Ac,heading:Mc,html:Pc,imageReference:Rc,image:Bc,inlineCode:Hc,linkReference:Wc,link:Kc,listItem:Jc,list:Qc,paragraph:el,root:nl,strong:il,table:ol,tableCell:ul,tableRow:cl,text:_l,thematicBreak:yl,toml:xl,yaml:xl,definition:xl,footnoteDefinition:xl}})),wl=t((()=>{})),Tl,El,Dl,Ol,kl=t((()=>{wl(),Tl=typeof self==`object`?self:globalThis,El=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Tl[e](t)},Dl=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof Tl[e]==`function`?El(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(El(a,o),i)};return r},Ol=e=>Dl(new Map,e)(0)})),Al,jl,Ml,Nl,Pl,Fl,Il,Ll=t((()=>{wl(),Al=``,{toString:jl}={},{keys:Ml}=Object,Nl=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=jl.call(e).slice(8,-1);switch(n){case`Array`:return[1,Al];case`Object`:return[2,Al];case`Date`:return[3,Al];case`RegExp`:return[4,Al];case`Map`:return[5,Al];case`Set`:return[6,Al];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},Pl=([e,t])=>e===0&&(t===`function`||t===`symbol`),Fl=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=Nl(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of Ml(r))(e||!Pl(Nl(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,isNaN(r.getTime())?Al:r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(Pl(Nl(n))||Pl(Nl(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!Pl(Nl(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},Il=(e,{json:t,lossy:n}={})=>{let r=[];return Fl(!(t||n),!!t,new Map,r)(e),r}})),Rl,zl=t((()=>{kl(),Ll(),Rl=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Ol(Il(e,t)):structuredClone(e):(e,t)=>Ol(Il(e,t))}));function Bl(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function Vl(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function Hl(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Bl,r=e.options.footnoteBackLabel||Vl,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=Xi(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...Rl(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
10
|
+
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
11
|
+
`}]}}var Ul=t((()=>{zl(),Zi()}));function Wl(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Xl(e[n]);return ql(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Gl(e){let t=e;return ql(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Kl(e){return ql(t);function t(t){return t&&t.type===e}}function ql(e){return t;function t(t,n,r){return!!(Yl(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Jl(){return!0}function Yl(e){return typeof e==`object`&&!!e&&`type`in e}var Xl,Zl=t((()=>{Xl=(function(e){if(e==null)return Jl;if(typeof e==`function`)return ql(e);if(typeof e==`object`)return Array.isArray(e)?Wl(e):Gl(e);if(typeof e==`string`)return Kl(e);throw Error(`Expected function, string, or object as test`)})})),Ql=t((()=>{Zl()}));function $l(e){return e}var eu=t((()=>{}));function tu(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Xl(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+$l(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=ru,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=nu(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function nu(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?ru:[e]}var ru,iu=t((()=>{Ql(),eu(),ru=[]})),au=t((()=>{iu()}));function ou(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),tu(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var su=t((()=>{au()})),cu=t((()=>{su()}));function lu(e,t){let n=t||gu,r=new Map,i=new Map,a={all:s,applyData:du,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Sl,...n.handlers},one:o,options:n,patch:uu,wrap:pu};return ou(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(hu.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=Rl(n);return r.children=a.all(e),r}return Rl(e)}return(a.options.unknownHandler||fu)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=mu(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=mu(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function uu(e,t){e.position&&(t.position=xr(e))}function du(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,Rl(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function fu(e,t){let n=t.data||{},r=`value`in t&&!(hu.call(n,`hProperties`)||hu.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 pu(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
12
|
+
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
13
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
14
|
+
`}),n}function mu(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}var hu,gu,_u=t((()=>{zl(),cu(),Tr(),Cl(),hu={}.hasOwnProperty,gu={}}));function vu(e,t){let n=lu(e,t),r=n.one(e,void 0),i=Hl(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
15
|
+
`},i)),a}var yu=t((()=>{nn(),Ul(),_u()})),bu=t((()=>{Cl(),yu(),Ul()}));function xu(e,t){return e&&`run`in e?async function(n,r){let i=vu(n,{file:r,...t});await e.run(i,r)}:function(n,r){return vu(n,{file:r,...e||t})}}var Su=t((()=>{bu()})),Cu=t((()=>{bu(),Su()}));function wu(e){if(e)throw e}var Tu=t((()=>{})),Eu=r(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function Du(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}var Ou=t((()=>{}));function ku(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Au(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Au(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var ju=t((()=>{})),Mu=t((()=>{ju()}));function Nu(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);zu(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Pu(e){if(zu(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||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Fu(e){zu(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Iu(...e){let t=-1,n;for(;++t<e.length;)zu(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Lu(n)}function Lu(e){zu(e);let t=e.codePointAt(0)===47,n=Ru(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Ru(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function zu(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Bu,Vu=t((()=>{Bu={basename:Nu,dirname:Pu,extname:Fu,join:Iu,sep:`/`}}));function Hu(){return`/`}var Uu,Wu=t((()=>{Uu={cwd:Hu}}));function Gu(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}var Ku=t((()=>{}));function qu(e){if(typeof e==`string`)e=new URL(e);else if(!Gu(e)){let t=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:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Ju(e)}function Ju(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var Yu=t((()=>{Ku()}));function Xu(e,t){if(e&&e.includes(Bu.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Bu.sep+"`")}function Zu(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Qu(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function $u(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var ed,td,nd=t((()=>{Pr(),Vu(),Wu(),Yu(),ed=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],td=class{constructor(e){let t;t=e?Gu(e)?{path:e}:typeof e==`string`||$u(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Uu.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<ed.length;){let e=ed[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)ed.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Bu.basename(this.path):void 0}set basename(e){Zu(e,`basename`),Xu(e,`basename`),this.path=Bu.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Bu.dirname(this.path):void 0}set dirname(e){Qu(this.basename,`dirname`),this.path=Bu.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Bu.extname(this.path):void 0}set extname(e){if(Xu(e,`extname`),Qu(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=Bu.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Gu(e)&&(e=qu(e)),Zu(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Bu.basename(this.path,this.extname):void 0}set stem(e){Zu(e,`stem`),Xu(e,`stem`),this.path=Bu.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Mr(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}}})),rd=t((()=>{nd()})),id,ad=t((()=>{id=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r})}));function od(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function sd(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function cd(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ld(e){if(!Du(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function ud(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function dd(e){return fd(e)?e:new td(e)}function fd(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function pd(e){return typeof e==`string`||md(e)}function md(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var hd,gd,_d,vd,yd=t((()=>{Tu(),hd=e(Eu(),1),nn(),Ou(),Mu(),rd(),ad(),gd={}.hasOwnProperty,_d=class e extends id{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=ku()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,hd.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(cd(`data`,this.frozen),this.namespace[e]=t,this):gd.call(this.namespace,e)&&this.namespace[e]||void 0:e?(cd(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=dd(e),n=this.parser||this.Parser;return od(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),od(`process`,this.parser||this.Parser),sd(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=dd(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);pd(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),od(`processSync`,this.parser||this.Parser),sd(`processSync`,this.compiler||this.Compiler),this.process(e,r),ud(`processSync`,`process`,t),n;function r(e,r){t=!0,wu(e),n=r}}run(e,t,n){ld(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=dd(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),ud(`runSync`,`run`,n),r;function i(e,t){wu(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=dd(t),r=this.compiler||this.Compiler;return sd(`stringify`,r),ld(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(cd(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw 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(e.plugins),e.settings&&(r.settings=(0,hd.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Du(o)&&Du(r)&&(r=(0,hd.default)(!0,o,r)),n[i]=[e,r,...a]}}}},vd=new _d().freeze()})),bd=t((()=>{yd()}));function xd(e){let t=Sd(e),n=Cd(e);return wd(t.runSync(t.parse(n),n),e)}function Sd(e){let t=e.rehypePlugins||Dd,n=e.remarkPlugins||Dd,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Od}:Od;return vd().use(_c).use(n).use(xu,r).use(t)}function Cd(e){let t=e.children||``,n=new td;return typeof t==`string`?n.value=t:``+t,n}function wd(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Td;for(let e of Ad)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return ou(e,l),Fr(e,{Fragment:Ed.Fragment,components:i,ignoreInvalidStyle:!0,jsx:Ed.jsx,jsxs:Ed.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in fi)if(Object.hasOwn(fi,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=fi[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function Td(e){let 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||kd.test(e.slice(0,t))?e:``}var Ed,Dd,Od,kd,Ad,jd=t((()=>{nn(),di(),mi(),Ed=a(),i(),yc(),Cu(),bd(),cu(),rd(),Dd=[],Od={allowDangerousHtml:!0},kd=/^(https?|ircs?|mailto|xmpp)$/i,Ad=[{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`}]})),Md=t((()=>{jd()}));function Nd(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}var Pd=t((()=>{}));function Fd(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}var Id=t((()=>{}));function Ld(e,t,n){let r=Xl((n||{}).ignore||[]),i=Rd(t),a=-1;for(;++a<i.length;)tu(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Rd(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([zd(e[0]),Bd(e[1])])}return t}function zd(e){return typeof e==`string`?new RegExp(Fd(e),`g`):e}function Bd(e){return typeof e==`function`?e:function(){return e}}var Vd=t((()=>{Id(),au(),Ql()})),Hd=t((()=>{Vd()}));function Ud(){return{transforms:[Zd],enter:{literalAutolink:Gd,literalAutolinkEmail:Kd,literalAutolinkHttp:Kd,literalAutolinkWww:Kd},exit:{literalAutolink:Xd,literalAutolinkEmail:Yd,literalAutolinkHttp:qd,literalAutolinkWww:Jd}}}function Wd(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:rf,notInConstruct:af},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:rf,notInConstruct:af},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:rf,notInConstruct:af}]}}function Gd(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Kd(e){this.config.enter.autolinkProtocol.call(this,e)}function qd(e){this.config.exit.autolinkProtocol.call(this,e)}function Jd(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Yd(e){this.config.exit.autolinkEmail.call(this,e)}function Xd(e){this.exit(e)}function Zd(e){Ld(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Qd],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,$d]],{ignore:[`link`,`linkReference`]})}function Qd(e,t,n,r,i){let a=``;if(!nf(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!ef(n)))return!1;let o=tf(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function $d(e,t,n,r){return!nf(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function ef(e){let 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 tf(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=Nd(e,`(`),a=Nd(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function nf(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Ji(n)||qi(n))&&(!t||n!==47)}var rf,af,of=t((()=>{Pd(),nn(),Yi(),Hd(),rf=`phrasing`,af=[`autolink`,`link`,`image`,`label`]})),sf=t((()=>{of()}));function cf(){this.buffer()}function lf(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function uf(){this.buffer()}function df(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function ff(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Fi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function pf(e){this.exit(e)}function mf(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Fi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function hf(e){this.exit(e)}function gf(){return`[`}function _f(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function vf(){return{enter:{gfmFootnoteCallString:cf,gfmFootnoteCall:lf,gfmFootnoteDefinitionLabelString:uf,gfmFootnoteDefinition:df},exit:{gfmFootnoteCallString:ff,gfmFootnoteCall:pf,gfmFootnoteDefinitionLabelString:mf,gfmFootnoteDefinition:hf}}}function yf(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:_f},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
16
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?xf:bf))),s(),o}}function bf(e,t,n){return t===0?e:xf(e,t,n)}function xf(e,t,n){return(n?``:` `)+e}var Sf=t((()=>{nn(),Ii(),_f.peek=gf})),Cf=t((()=>{Sf()}));function wf(){return{canContainEols:[`delete`],enter:{strikethrough:Ef},exit:{strikethrough:Df}}}function Tf(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:Af}],handlers:{delete:Of}}}function Ef(e){this.enter({type:`delete`,children:[]},e)}function Df(e){this.exit(e)}function Of(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function kf(){return`~`}var Af,jf=t((()=>{Af=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],Of.peek=kf})),Mf=t((()=>{jf()}));function Nf(e){return e.length}function Pf(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Nf,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=Ff(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=If(r[d]);else{let e=If(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding===!1||n.alignDelimiters===!1&&i===``||n.delimiterStart===!1&&!d||r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
17
|
+
`)}function Ff(e){return e==null?``:String(e)}function If(e){let 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}var Lf=t((()=>{}));function Rf(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),zf);return i(),o}function zf(e,t,n){return`>`+(n?``:` `)+e}var Bf=t((()=>{}));function Vf(e,t){return Hf(e,t.inConstruct,!0)&&!Hf(e,t.notInConstruct,!1)}function Hf(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}var Uf=t((()=>{}));function Wf(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
18
|
+
`&&Vf(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
19
|
+
`}var Gf=t((()=>{Uf()}));function Kf(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}var qf=t((()=>{}));function Jf(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))}var Yf=t((()=>{}));function Xf(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}var Zf=t((()=>{}));function Qf(e,t,n,r){let i=Xf(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Jf(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,$f);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Kf(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
20
|
+
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
21
|
+
`),a&&(u+=s.move(a+`
|
|
22
|
+
`)),u+=s.move(c),l(),u}function $f(e,t,n){return(n?``:` `)+e}var ep=t((()=>{qf(),Yf(),Zf()}));function tp(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}var np=t((()=>{}));function rp(e,t,n,r){let i=tp(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
23
|
+
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}var ip=t((()=>{np()}));function ap(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}var op=t((()=>{}));function sp(e){return`&#x`+e.toString(16).toUpperCase()+`;`}var cp=t((()=>{}));function lp(e,t,n){let r=ca(e),i=ca(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}}var up=t((()=>{la()}));function dp(e,t,n,r){let i=ap(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=lp(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=sp(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=lp(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+sp(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function fp(e,t,n){return n.options.emphasis||`*`}var pp=t((()=>{op(),cp(),up(),dp.peek=fp}));function mp(e,t){let n=!1;return ou(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&hi(e)&&(t.options.setext||n))}var hp=t((()=>{cu(),xi()}));function gp(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(mp(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
24
|
+
`,after:`
|
|
25
|
+
`});return r(),t(),o+`
|
|
26
|
+
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
27
|
+
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
28
|
+
`,...a.current()});return/^[\t ]/.test(l)&&(l=sp(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}var _p=t((()=>{cp(),hp()}));function vp(e){return e.value||``}function yp(){return`<`}var bp=t((()=>{vp.peek=yp}));function xp(e,t,n,r){let i=tp(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function Sp(){return`!`}var Cp=t((()=>{np(),xp.peek=Sp}));function wp(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Tp(){return`!`}var Ep=t((()=>{wp.peek=Tp}));function Dp(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function Op(){return"`"}var kp=t((()=>{Dp.peek=Op}));function Ap(e,t){let n=hi(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))}var jp=t((()=>{xi()}));function Mp(e,t,n,r){let i=tp(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(Ap(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Np(e,t,n){return Ap(e,n)?`<`:`[`}var Pp=t((()=>{np(),jp(),Mp.peek=Np}));function Fp(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Ip(){return`[`}var Lp=t((()=>{Fp.peek=Ip}));function Rp(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}var zp=t((()=>{}));function Bp(e){let t=Rp(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}var Vp=t((()=>{zp()}));function Hp(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}var Up=t((()=>{}));function Wp(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}var Gp=t((()=>{}));function Kp(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Hp(n):Rp(n),s=e.ordered?o===`.`?`)`:`.`:Bp(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if(o!==`*`&&o!==`-`||!t||t.children&&t.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),Wp(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}var qp=t((()=>{zp(),Vp(),Up(),Gp()}));function Jp(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}var Yp=t((()=>{}));function Xp(e,t,n,r){let i=Jp(n),a=n.bulletCurrent||Rp(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}var Zp=t((()=>{zp(),Yp()}));function Qp(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var $p=t((()=>{})),em,tm=t((()=>{Ql(),em=Xl([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`])})),nm=t((()=>{tm()}));function rm(e,t,n,r){return(e.children.some(function(e){return em(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}var im=t((()=>{nm()}));function am(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}var om=t((()=>{}));function sm(e,t,n,r){let i=am(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=lp(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=sp(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=lp(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+sp(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function cm(e,t,n){return n.options.strong||`*`}var lm=t((()=>{om(),cp(),up(),sm.peek=cm}));function um(e,t,n,r){return n.safe(e.value,r)}var dm=t((()=>{}));function fm(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}var pm=t((()=>{}));function mm(e,t,n){let r=(Wp(n)+(n.options.ruleSpaces?` `:``)).repeat(fm(n));return n.options.ruleSpaces?r.slice(0,-1):r}var hm=t((()=>{pm(),Gp()})),gm,_m=t((()=>{Bf(),Gf(),ep(),ip(),pp(),_p(),bp(),Cp(),Ep(),kp(),Pp(),Lp(),qp(),Zp(),$p(),im(),lm(),dm(),hm(),gm={blockquote:Rf,break:Wf,code:Qf,definition:rp,emphasis:dp,hardBreak:Wf,heading:gp,html:vp,image:xp,imageReference:wp,inlineCode:Dp,link:Mp,linkReference:Fp,list:Kp,listItem:Xp,paragraph:Qp,root:rm,strong:sm,text:um,thematicBreak:mm}})),vm=t((()=>{_m(),hp(),sc()}));function ym(){return{enter:{table:bm,tableData:wm,tableHeader:wm,tableRow:Sm},exit:{codeText:Tm,table:xm,tableData:Cm,tableHeader:Cm,tableRow:Cm}}}function bm(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function xm(e){this.exit(e),this.data.inTable=void 0}function Sm(e){this.enter({type:`tableRow`,children:[]},e)}function Cm(e){this.exit(e)}function wm(e){this.enter({type:`tableCell`,children:[]},e)}function Tm(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Em));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Em(e,t){return t===`|`?t:e}function Dm(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
29
|
+
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
30
|
+
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Pf(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=gm.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}var Om=t((()=>{nn(),Lf(),vm()})),km=t((()=>{Om()}));function Am(){return{exit:{taskListCheckValueChecked:Mm,taskListCheckValueUnchecked:Mm,paragraph:Nm}}}function jm(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Pm}}}function Mm(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Nm(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Pm(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=gm.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}var Fm=t((()=>{nn(),vm()})),Im=t((()=>{Fm()}));function Lm(){return[Ud(),vf(),wf(),ym(),Am()]}function Rm(e){return{extensions:[Wd(),yf(e),Tf(),Dm(e),jm()]}}var zm=t((()=>{sf(),Cf(),Mf(),km(),Im()})),Bm=t((()=>{zm()}));function Vm(){return{text:lh}}function Hm(e,t,n){let r=this,i,a;return o;function o(t){return!$m(t)||!Qm.call(r,r.previous)||eh(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return $m(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(ah,u,l)(t):t===45||t===95||Hi(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&Vi(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Um(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Xm.call(r,r.previous)||eh(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(th,e.attempt(nh,e.attempt(rh,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Wm(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Zm.call(r,r.previous)&&!eh(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Vi(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Li(t)||Ri(t)||Ji(t)||qi(t)?n(t):e.attempt(nh,e.attempt(rh,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Gm(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Km(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(ih,c,s)(t):t===null||Ri(t)||Ji(t)||t!==45&&qi(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function qm(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(ih,t,a)(o):o===null||Ri(o)||Ji(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Jm(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),a):o===93?(e.consume(o),i):o===60||o===null||Ri(o)||Ji(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Ri(e)||Ji(e)?t(e):r(e)}function a(e){return Vi(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Vi(t)?(e.consume(t),o):n(t)}}function Ym(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Hi(e)?n(e):t(e)}}function Xm(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ri(e)}function Zm(e){return!Vi(e)}function Qm(e){return!(e===47||$m(e))}function $m(e){return e===43||e===45||e===46||e===95||Hi(e)}function eh(e){let t=e.length,n=!1;for(;t--;){let 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}var th,nh,rh,ih,ah,oh,sh,ch,lh,uh,dh=t((()=>{for(Yi(),th={tokenize:Gm,partial:!0},nh={tokenize:Km,partial:!0},rh={tokenize:qm,partial:!0},ih={tokenize:Jm,partial:!0},ah={tokenize:Ym,partial:!0},oh={name:`wwwAutolink`,tokenize:Um,previous:Xm},sh={name:`protocolAutolink`,tokenize:Wm,previous:Zm},ch={name:`emailAutolink`,tokenize:Hm,previous:Qm},lh={},uh=48;uh<123;)lh[uh]=ch,uh++,uh===58?uh=65:uh===91&&(uh=97);lh[43]=ch,lh[45]=ch,lh[46]=ch,lh[95]=ch,lh[72]=[ch,sh],lh[104]=[ch,sh],lh[87]=[ch,oh],lh[119]=[ch,oh]})),fh=t((()=>{dh(),Zi()}));function ph(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:_h,continuation:{tokenize:vh},exit:yh}},text:{91:{name:`gfmFootnoteCall`,tokenize:gh},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:mh,resolveTo:hh}}}}function mh(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=Fi(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function hh(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`;let 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++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function gh(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||Ri(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Fi(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Ri(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function _h(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||Ri(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Fi(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Ri(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Qi(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function vh(e,t,n){return e.check(xa,t,e.attempt(xh,t,n))}function yh(e){e.exit(`gfmFootnoteDefinition`)}function bh(e,t,n){let r=this;return Qi(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}var xh,Sh=t((()=>{ws(),$i(),Yi(),Ii(),xh={tokenize:bh,partial:!0}})),Ch=t((()=>{Sh(),Zi()}));function wh(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Ti(o,o.length,0,ua(s,e.slice(r+1,n),t)),Ti(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Ti(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=ca(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=ca(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Th=t((()=>{Di(),la(),da()})),Eh=t((()=>{Th()}));function Dh(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])}}var Oh,kh=t((()=>{Oh=class{constructor(){this.map=[]}add(e,t,n){Dh(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}}}));function Ah(e,t){let n=!1,r=[];for(;t<e.length;){let 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`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}var jh=t((()=>{}));function Mh(){return{flow:{null:{name:`table`,tokenize:Nh,resolveAll:Ph}}}}function Nh(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):L(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):zi(t)?Qi(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||Ri(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,zi(t)?Qi(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return zi(t)?Qi(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||L(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return zi(t)?Qi(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||L(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||L(n)?(e.exit(`tableRow`),t(n)):zi(n)?Qi(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Ri(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Ph(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Oh;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(Ih(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=Fh(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=Fh(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=Fh(f,t,o,i,n,d)):(o[0]=o[1],d=Fh(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&Ih(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=Ah(t.events,n))}return e}function Fh(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},Lh(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=Lh(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=Lh(t.events,n[2]),a=Lh(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Lh(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Ih(e,t,n,r,i){let a=[],o=Lh(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Lh(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Rh=t((()=>{$i(),Yi(),kh(),jh()})),zh=t((()=>{Rh()}));function Bh(){return{text:{91:Uh}}}function Vh(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return Ri(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return L(r)?t(r):zi(r)?e.check({tokenize:Hh},t,n)(r):n(r)}}function Hh(e,t,n){return Qi(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}var Uh,Wh=t((()=>{$i(),Yi(),Uh={name:`tasklistCheck`,tokenize:Vh}})),Gh=t((()=>{Wh()}));function Kh(e){return Oi([Vm(),ph(),wh(e),Mh(),Bh()])}var qh=t((()=>{Mi(),fh(),Ch(),Eh(),zh(),Gh()}));function Jh(e){let t=this,n=e||Yh,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Kh(n)),a.push(Lm()),o.push(Rm(n))}var Yh,Xh=t((()=>{Bm(),qh(),Yh={}})),Zh=t((()=>{Xh()})),Qh,$h,eg,tg=t((()=>{Qh=e(i()),We(),$h=a(),eg=(0,Qh.memo)(function({code:e,language:t}){let[n,r]=(0,Qh.useState)(!1),i=async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3)}catch(e){console.error(`Failed to copy code: `,e)}},a=()=>{try{let n=new Blob([e],{type:`text/plain;charset=utf-8`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`code.${t===`plaintext`||!t?`txt`:t.toLowerCase()}`,i.click(),URL.revokeObjectURL(r)}catch(e){console.error(`Failed to download code: `,e)}},o=(t||`plaintext`).toLowerCase().trim(),s=o===`plaintext`?`text`:o,c=(0,Qh.useMemo)(()=>e?e.split(`
|
|
31
|
+
`).length:1,[e]),l=c<=5,[u,d]=(0,Qh.useState)(null),f=u===null?!l:u,p=(0,Qh.useMemo)(()=>He(e,o,f),[e,o,f]);return(0,$h.jsxs)(`div`,{className:`chat-code-block-container`,style:{whiteSpace:`normal`},children:[(0,$h.jsxs)(`div`,{className:`chat-code-block-header`,children:[(0,$h.jsxs)(`div`,{className:`chat-code-block-meta`,children:[(0,$h.jsx)(`span`,{className:`chat-code-block-lang`,children:s}),c>3&&(0,$h.jsxs)(`span`,{className:`chat-code-block-lines`,children:[c,` lines`]})]}),(0,$h.jsxs)(`div`,{className:`chat-code-block-actions`,children:[c>5&&(0,$h.jsx)(`button`,{type:`button`,onClick:()=>d(e=>e!==null&&!e),title:f?`Hide line numbers`:`Show line numbers`,className:`chat-code-action-btn chat-code-toggle-lines-btn ${f?`is-active`:``}`,children:(0,$h.jsx)(`span`,{className:`chat-code-btn-label`,children:`#`})}),(0,$h.jsx)(`button`,{type:`button`,onClick:a,title:`Download code`,className:`chat-code-action-btn chat-code-download-btn`,children:(0,$h.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,$h.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,$h.jsx)(`polyline`,{points:`7 10 12 15 17 10`}),(0,$h.jsx)(`line`,{x1:`12`,y1:`15`,x2:`12`,y2:`3`})]})}),(0,$h.jsx)(`button`,{type:`button`,onClick:i,title:`Copy code`,className:`chat-code-action-btn chat-code-copy-btn ${n?`is-copied`:``}`,children:n?(0,$h.jsxs)($h.Fragment,{children:[(0,$h.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,$h.jsx)(`polyline`,{points:`20 6 9 17 4 12`})}),(0,$h.jsx)(`span`,{className:`chat-code-btn-label`,children:`Copied!`})]}):(0,$h.jsxs)($h.Fragment,{children:[(0,$h.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,$h.jsx)(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`,ry:`2`}),(0,$h.jsx)(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})]}),(0,$h.jsx)(`span`,{className:`chat-code-btn-label`,children:`Copy`})]})})]})]}),(0,$h.jsx)(`pre`,{className:`chat-code-block-body`,children:(0,$h.jsx)(`code`,{children:p})})]})})}));function ng(e){if(!e||!e.trim())return null;let t=e.trim(),n=e=>{try{return JSON.parse(e)}catch{try{return JSON.parse(e.replace(/,\s*([\]}])/g,`$1`))}catch{return null}}},r=n(t);if(r!==null)return r;let i=t.replace(/}\s*,\s*("(?:\\.|[^"\\])*"\s*:\s*(?:"(?:\\.|[^"\\])*"|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|true|false|null))(?=\s*[,}])/g,`, $1`);return i===t?null:n(i)}var rg=t((()=>{}));function ig({markdown:e}){let{version:t,sections:n}=(0,ag.useMemo)(()=>{let t=`Latest`,n=[],r=null,i=null;for(let a of e.split(`
|
|
32
|
+
`)){let e=a.trim();if(!e)continue;if(e.startsWith(`# `)){let n=e.match(/v\d+\.\d+(?:\.\d+)?/i);n&&(t=n[0]);continue}if(e.startsWith(`## `)){i&&r&&(r.items.push(i),i=null),r&&n.push(r),r={title:e.replace(/^##\s+/,``).trim(),items:[]};continue}let o=a.length-a.trimStart().length;if(e.startsWith(`- `)||e.startsWith(`* `)){let t=e.slice(2).trim();if(o>=2&&i){i.subItems||(i.subItems=[]),i.subItems.push(t);continue}i&&r&&r.items.push(i);let n=t.match(/^\*\*([^*]+)\*\*:\s*(.*)$/);i=n?{title:n[1],desc:n[2]}:{title:``,desc:t}}else i&&(i.desc+=` `+e)}return i&&r&&r.items.push(i),r&&n.push(r),{version:t,sections:n}},[e]);return(0,og.jsxs)(`div`,{className:`release-notes-card`,children:[(0,og.jsxs)(`div`,{className:`release-notes-header`,children:[(0,og.jsxs)(`div`,{className:`release-notes-title`,children:[(0,og.jsx)(s,{size:18,className:`release-notes-icon`}),(0,og.jsx)(`span`,{children:`Release Notes`}),(0,og.jsx)(`span`,{className:`release-notes-version-badge`,children:t})]}),(0,og.jsxs)(`span`,{className:`release-notes-count-badge`,children:[n.length,` Highlights`]})]}),(0,og.jsx)(`div`,{className:`release-notes-track`,children:(0,og.jsx)(`div`,{className:`release-notes-bar`})}),(0,og.jsx)(`div`,{className:`release-notes-body`,children:n.map((e,t)=>(0,og.jsxs)(`div`,{className:`release-notes-section`,children:[(0,og.jsxs)(`div`,{className:`release-notes-section-title`,children:[(0,og.jsx)(`span`,{className:`release-notes-bullet`,children:`●`}),(0,og.jsx)(`span`,{children:e.title})]}),(0,og.jsx)(`div`,{className:`release-notes-items`,children:e.items.map((e,t)=>(0,og.jsxs)(`div`,{className:`release-notes-item`,children:[(0,og.jsxs)(`div`,{className:`release-notes-item-header`,children:[(0,og.jsx)(`span`,{className:`release-notes-item-bullet`,children:`•`}),e.title?(0,og.jsxs)(`span`,{className:`release-notes-item-title`,children:[e.title,`:`]}):null,(0,og.jsx)(`span`,{className:`release-notes-item-desc`,children:e.desc})]}),e.subItems&&e.subItems.length>0&&(0,og.jsx)(`div`,{className:`release-notes-subitems`,children:e.subItems.map((e,t)=>(0,og.jsxs)(`div`,{className:`release-notes-subitem`,children:[(0,og.jsx)(`span`,{className:`release-notes-subitem-bullet`,children:`›`}),(0,og.jsx)(`span`,{children:e.replace(/\*\*/g,``)})]},t))})]},t))})]},t))})]})}var ag,og,sg=t((()=>{ag=e(i()),A(),og=a()})),cg,lg=t((()=>{cg=`data:image/svg+xml,%3csvg%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m6.922%203.768-.644-.536A1%201%200%200%200%205.638%203H2a1%201%200%200%200-1%201v8a1%201%200%200%200%201%201h12a1%201%200%200%200%201-1V5a1%201%200%200%200-1-1H7.562a1%201%200%200%201-.64-.232'%20fill='%2390a4ae'%20/%3e%3c/svg%3e`})),ug,dg=t((()=>{ug=`data:image/svg+xml,%3csvg%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.483%206H4.721a1%201%200%200%200-.949.684L2%2012V5h12a1%201%200%200%200-1-1H7.562a1%201%200%200%201-.64-.232l-.644-.536A1%201%200%200%200%205.638%203H2a1%201%200%200%200-1%201v8a1%201%200%200%200%201%201h11l2.403-5.606A1%201%200%200%200%2014.483%206'%20fill='%2390a4ae'%20/%3e%3c/svg%3e`})),fg,pg=t((()=>{fg=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23c0ca33'%20d='m13.844%207.536-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h24a2%202%200%200%200%202-2V10a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464'/%3e%3cpath%20fill='%23f0f4c3'%20d='M12%2020h8v8h-8zm10%200h8v8h-8zM12%2010h8v8h-8zm8.343%204L26%208.343%2031.657%2014%2026%2019.657z'/%3e%3c/svg%3e`})),mg,hg=t((()=>{mg=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23c0ca33'%20d='M28.967%2012H9.442a2%202%200%200%200-1.898%201.368L4%2024V10h24a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464l-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h22l4.805-11.212A2%202%200%200%200%2028.967%2012'/%3e%3cpath%20fill='%23f0f4c3'%20d='M12%2020h8v8h-8zm10%200h8v8h-8zM12%2010h8v8h-8zm8.343%204L26%208.343%2031.657%2014%2026%2019.657z'/%3e%3c/svg%3e`})),gg,_g=t((()=>{gg=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23e57373'%20d='m13.844%207.536-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h24a2%202%200%200%200%202-2V10a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464'/%3e%3cpath%20fill='%23ffcdd2'%20d='M30%2014h-4v-2l-2-2h-4l-2%202v2h-4a2%202%200%200%200-2%202v10a2%202%200%200%200%202%202h16a2%202%200%200%200%202-2V16a2%202%200%200%200-2-2m-10%200v-2h4v2Z'/%3e%3c/svg%3e`})),vg,yg=t((()=>{vg=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23e57373'%20d='M28.967%2012H9.442a2%202%200%200%200-1.898%201.368L4%2024V10h24a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464l-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h22l4.805-11.212A2%202%200%200%200%2028.967%2012'/%3e%3cpath%20fill='%23ffcdd2'%20d='M30%2014h-4v-2l-2-2h-4l-2%202v2h-4a2%202%200%200%200-2%202v10a2%202%200%200%200%202%202h16a2%202%200%200%200%202-2V16a2%202%200%200%200-2-2m-10%200v-2h4v2Z'/%3e%3c/svg%3e`})),bg,xg=t((()=>{bg=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%230277bd'%20d='m13.844%207.536-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h24a2%202%200%200%200%202-2V10a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464'/%3e%3cpath%20fill='%23b3e5fc'%20d='M24%2010h-7a1%201%200%200%200-1%201v16a1%201%200%200%200%201%201h12a1%201%200%200%200%201-1V16Zm0%2016h-6v-2h6Zm4-4H18v-2h10Zm-4.828-5.172V12L28%2016.828Z'/%3e%3c/svg%3e`})),Sg,Cg=t((()=>{Sg=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%230277bd'%20d='M28.967%2012H9.442a2%202%200%200%200-1.898%201.368L4%2024V10h24a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464l-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h22l4.805-11.212A2%202%200%200%200%2028.967%2012'/%3e%3cpath%20fill='%23b3e5fc'%20d='M24%2010h-7a1%201%200%200%200-1%201v16a1%201%200%200%200%201%201h12a1%201%200%200%200%201-1V16Zm0%2016h-6v-2h6Zm4-4H18v-2h10Zm-4.828-5.172V12L28%2016.828Z'/%3e%3c/svg%3e`})),wg,Tg=t((()=>{wg=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23ff7043'%20d='m13.844%207.536-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h24a2%202%200%200%200%202-2V10a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464'/%3e%3cpath%20fill='%23ffccbc'%20d='m12.593%2018.589%205.784-5.794%201.692%201.7a1.98%201.98%200%200%200%20.93%202.233v5.544a1.99%201.99%200%200%200-1%201.731%202.002%202.002%200%200%200%204.003%200A1.99%201.99%200%200%200%2023%2022.272v-4.864l2.071%202.092a1.2%201.2%200%200%200-.07.5%202.002%202.002%200%201%200%202.002-2.002%201.2%201.2%200%200%200-.5.07l-2.573-2.571a1.98%201.98%200%200%200-1.15-2.342%202.1%202.1%200%200%200-1.281-.09l-1.702-1.692.791-.78a1.975%201.975%200%200%201%202.822%200l7.996%207.996a1.975%201.975%200%200%201%200%202.822l-7.996%207.996a1.975%201.975%200%200%201-2.822%200l-7.996-7.996a1.975%201.975%200%200%201%200-2.822Z'/%3e%3c/svg%3e`})),Eg,Dg=t((()=>{Eg=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23ff7043'%20d='M28.967%2012H9.442a2%202%200%200%200-1.898%201.368L4%2024V10h24a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464l-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h22l4.805-11.212A2%202%200%200%200%2028.967%2012'/%3e%3cpath%20fill='%23ffccbc'%20d='m12.593%2018.589%205.784-5.794%201.692%201.7a1.98%201.98%200%200%200%20.93%202.233v5.544a1.99%201.99%200%200%200-1%201.731%202.002%202.002%200%200%200%204.003%200A1.99%201.99%200%200%200%2023%2022.272v-4.864l2.071%202.092a1.2%201.2%200%200%200-.07.5%202.002%202.002%200%201%200%202.002-2.002%201.2%201.2%200%200%200-.5.07l-2.573-2.571a1.98%201.98%200%200%200-1.15-2.342%202.1%202.1%200%200%200-1.281-.09l-1.702-1.692.791-.78a1.975%201.975%200%200%201%202.822%200l7.996%207.996a1.975%201.975%200%200%201%200%202.822l-7.996%207.996a1.975%201.975%200%200%201-2.822%200l-7.996-7.996a1.975%201.975%200%200%201%200-2.822Z'/%3e%3c/svg%3e`})),Og,kg=t((()=>{Og=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23546e7a'%20d='m13.844%207.536-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h24a2%202%200%200%200%202-2V10a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464'/%3e%3cpath%20fill='%23eceff1'%20d='M23%2010a9.03%209.03%200%200%200-9%209.063%209.08%209.08%200%200%200%206.157%208.609c.45.072.593-.21.593-.453v-1.532c-2.493.544-3.024-1.214-3.024-1.214a2.42%202.42%200%200%200-.998-1.333c-.82-.561.062-.544.062-.544a1.9%201.9%200%200%201%201.377.933%201.925%201.925%200%200%200%202.62.754%201.96%201.96%200%200%201%20.566-1.215c-1.998-.227-4.094-1.007-4.094-4.459a3.52%203.52%200%200%201%20.927-2.456%203.26%203.26%200%200%201%20.09-2.392s.754-.245%202.474.924a8.6%208.6%200%200%201%204.5%200c1.718-1.169%202.476-.924%202.476-.924a3.26%203.26%200%200%201%20.088%202.392%203.52%203.52%200%200%201%20.927%202.456c0%203.462-2.105%204.223-4.112%204.45a2.17%202.17%200%200%201%20.622%201.676v2.484c0%20.244.143.533.602.453A9.08%209.08%200%200%200%2023%2010'/%3e%3c/svg%3e`})),Ag,jg=t((()=>{Ag=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23546e7a'%20d='M28.967%2012H9.442a2%202%200%200%200-1.898%201.368L4%2024V10h24a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464l-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h22l4.805-11.212A2%202%200%200%200%2028.967%2012'/%3e%3cpath%20fill='%23eceff1'%20d='M23%2010a9.03%209.03%200%200%200-9%209.063%209.08%209.08%200%200%200%206.157%208.609c.45.072.593-.21.593-.453v-1.532c-2.493.544-3.024-1.214-3.024-1.214a2.42%202.42%200%200%200-.998-1.333c-.82-.561.062-.544.062-.544a1.9%201.9%200%200%201%201.377.933%201.925%201.925%200%200%200%202.62.754%201.96%201.96%200%200%201%20.566-1.215c-1.998-.227-4.094-1.007-4.094-4.459a3.52%203.52%200%200%201%20.927-2.456%203.26%203.26%200%200%201%20.09-2.392s.754-.245%202.474.924a8.6%208.6%200%200%201%204.5%200c1.718-1.169%202.476-.924%202.476-.924a3.26%203.26%200%200%201%20.088%202.392%203.52%203.52%200%200%201%20.927%202.456c0%203.462-2.105%204.223-4.112%204.45a2.17%202.17%200%200%201%20.622%201.676v2.484c0%20.244.143.533.602.453A9.08%209.08%200%200%200%2023%2010'/%3e%3c/svg%3e`})),Mg,Ng=t((()=>{Mg=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23009688'%20d='m13.844%207.536-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h24a2%202%200%200%200%202-2V10a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464'/%3e%3cpath%20fill='%23b2dfdb'%20d='M24%2010h-7a1%201%200%200%200-1%201v16a1%201%200%200%200%201%201h12a1%201%200%200%200%201-1V16Zm-4%206a2%202%200%201%201-2%202%202.01%202.01%200%200%201%202-2m8%2010H18l4-4%202%202%204-4Zm-4.828-9.172V12L28%2016.828Z'/%3e%3c/svg%3e`})),Pg,Fg=t((()=>{Pg=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23009688'%20d='M28.967%2012H9.442a2%202%200%200%200-1.898%201.368L4%2024V10h24a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464l-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h22l4.805-11.212A2%202%200%200%200%2028.967%2012'/%3e%3cpath%20fill='%23b2dfdb'%20d='M24%2010h-7a1%201%200%200%200-1%201v16a1%201%200%200%200%201%201h12a1%201%200%200%200%201-1V16Zm-4%206a2%202%200%201%201-2%202%202.01%202.01%200%200%201%202-2m8%2010H18l4-4%202%202%204-4Zm-4.828-9.172V12L28%2016.828Z'/%3e%3c/svg%3e`})),Ig,Lg=t((()=>{Ig=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23afb42b'%20d='m13.844%207.536-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h24a2%202%200%200%200%202-2V10a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464'/%3e%3cpath%20fill='%23afb42b'%20d='M20%2014h8v2h-8zm0%204h8v2h-8zm0%204h6v2h-6z'/%3e%3cpath%20fill='%23f0f4c3'%20d='M30.337%2014H17.663A1.663%201.663%200%200%200%2016%2015.663v10.674A1.663%201.663%200%200%200%2017.663%2028h12.674A1.663%201.663%200%200%200%2032%2026.337V15.663A1.663%201.663%200%200%200%2030.337%2014M26%2026h-6v-2h6Zm2-4h-8v-2h8Zm0-4h-8v-2h8Z'/%3e%3c/svg%3e`})),Rg,zg=t((()=>{Rg=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23afb42b'%20d='M28.967%2012H9.442a2%202%200%200%200-1.898%201.368L4%2024V10h24a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464l-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h22l4.805-11.212A2%202%200%200%200%2028.967%2012'/%3e%3cpath%20fill='%23f0f4c3'%20d='M30.337%2014H17.663A1.663%201.663%200%200%200%2016%2015.663v10.674A1.663%201.663%200%200%200%2017.663%2028h12.674A1.663%201.663%200%200%200%2032%2026.337V15.663A1.663%201.663%200%200%200%2030.337%2014M26%2026h-6v-2h6Zm2-4h-8v-2h8Zm0-4h-8v-2h8Z'/%3e%3c/svg%3e`})),Bg,Vg=t((()=>{Bg=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%238bc34a'%20d='m13.844%207.536-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h24a2%202%200%200%200%202-2V10a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464'/%3e%3cpath%20fill='%23dcedc8'%20d='m25%2012-7%204.072v7.854L25%2028l7-4.074v-7.854Z'/%3e%3c/svg%3e`})),Hg,Ug=t((()=>{Hg=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%238bc34a'%20d='M28.967%2012H9.442a2%202%200%200%200-1.898%201.368L4%2024V10h24a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464l-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h22l4.805-11.212A2%202%200%200%200%2028.967%2012'/%3e%3cpath%20fill='%23dcedc8'%20d='m25%2012-7%204.072v7.854L25%2028l7-4.074v-7.854Z'/%3e%3c/svg%3e`})),Wg,Gg=t((()=>{Wg=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23039be5'%20d='m13.844%207.536-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h24a2%202%200%200%200%202-2V10a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464'/%3e%3cpath%20fill='%23b3e5fc'%20d='M22%2010a10%2010%200%201%200%2010%2010%2010%2010%200%200%200-10-10m6.918%206H25.96a15.8%2015.8%200%200%200-1.342-3.54%208.04%208.04%200%200%201%204.3%203.54M22%2012a14.1%2014.1%200%200%201%201.89%204h-3.78A14.1%2014.1%200%200%201%2022%2012m-2.618.46A15.8%2015.8%200%200%200%2018.04%2016h-2.958a8.04%208.04%200%200%201%204.3-3.54M14.263%2022a7.7%207.7%200%200%201%200-4h3.407a15.5%2015.5%200%200%200%200%204Zm.82%202h2.957a15.8%2015.8%200%200%200%201.342%203.54%208.04%208.04%200%200%201-4.3-3.54ZM22%2028a14.1%2014.1%200%200%201-1.89-4h3.78A14.1%2014.1%200%200%201%2022%2028m2.31-6h-4.62a13.4%2013.4%200%200%201%200-4h4.62a13.4%2013.4%200%200%201%200%204m.308%205.54A15.8%2015.8%200%200%200%2025.96%2024h2.958a8.04%208.04%200%200%201-4.3%203.54M29.737%2022H26.33a15.5%2015.5%200%200%200%200-4h3.407a7.7%207.7%200%200%201%200%204'/%3e%3c/svg%3e`})),Kg,qg=t((()=>{Kg=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23039be5'%20d='M28.967%2012H9.442a2%202%200%200%200-1.898%201.368L4%2024V10h24a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464l-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h22l4.805-11.212A2%202%200%200%200%2028.967%2012'/%3e%3cpath%20fill='%23b3e5fc'%20d='M22%2010a10%2010%200%201%200%2010%2010%2010%2010%200%200%200-10-10m6.918%206H25.96a15.8%2015.8%200%200%200-1.342-3.54%208.04%208.04%200%200%201%204.3%203.54M22%2012a14.1%2014.1%200%200%201%201.89%204h-3.78A14.1%2014.1%200%200%201%2022%2012m-2.618.46A15.8%2015.8%200%200%200%2018.04%2016h-2.958a8.04%208.04%200%200%201%204.3-3.54M14.263%2022a7.7%207.7%200%200%201%200-4h3.407a15.5%2015.5%200%200%200%200%204Zm.82%202h2.957a15.8%2015.8%200%200%200%201.342%203.54%208.04%208.04%200%200%201-4.3-3.54ZM22%2028a14.1%2014.1%200%200%201-1.89-4h3.78A14.1%2014.1%200%200%201%2022%2028m2.31-6h-4.62a13.4%2013.4%200%200%201%200-4h4.62a13.4%2013.4%200%200%201%200%204m.308%205.54A15.8%2015.8%200%200%200%2025.96%2024h2.958a8.04%208.04%200%200%201-4.3%203.54M29.737%2022H26.33a15.5%2015.5%200%200%200%200-4h3.407a7.7%207.7%200%200%201%200%204'/%3e%3c/svg%3e`})),Jg,Yg=t((()=>{Jg=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23ff7043'%20d='m13.844%207.536-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h24a2%202%200%200%200%202-2V10a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464'/%3e%3cpath%20fill='%23ffccbc'%20d='M30%2024v1a1%201%200%200%201-2%200v-1a2%202%200%200%200-2-2%203%203%200%200%200%202.996-3.16A3.115%203.114%200%200%200%2025.83%2016H14v2h2v8h-2v2h8v-2h-2v-2h4c.82.819.297%202.308%201.179%203.37a1.89%201.89%200%200%200%201.46.63H32v-4zm-6-4h-4v-2h4a1%201%200%200%201%200%202'/%3e%3c/svg%3e`})),Xg,Zg=t((()=>{Xg=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23ff7043'%20d='M28.967%2012H9.442a2%202%200%200%200-1.898%201.368L4%2024V10h24a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464l-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h22l4.805-11.212A2%202%200%200%200%2028.967%2012'/%3e%3cpath%20fill='%23ffccbc'%20d='M30%2024v1a1%201%200%200%201-2%200v-1a2%202%200%200%200-2-2%203%203%200%200%200%202.996-3.16A3.115%203.114%200%200%200%2025.83%2016H14v2h2v8h-2v2h8v-2h-2v-2h4c.82.819.297%202.308%201.179%203.37a1.89%201.89%200%200%200%201.46.63H32v-4zm-6-4h-4v-2h4a1%201%200%200%201%200%202'/%3e%3c/svg%3e`})),Qg,$g=t((()=>{Qg=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23546e7a'%20d='m13.844%207.536-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h24a2%202%200%200%200%202-2V10a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464'/%3e%3cpath%20fill='%23cfd8dc'%20d='M28%2012h-6a4%204%200%200%200-4%204v8h2v-8h8v9.893a2.074%202.074%200%200%201-1.664%202.08A2%202%200%200%201%2024%2026h-8a4%204%200%200%200%204%204h6a4%204%200%200%200%204-4V16h2a4%204%200%200%200-4-4'/%3e%3c/svg%3e`})),e_,t_=t((()=>{e_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23546e7a'%20d='M28.967%2012H9.442a2%202%200%200%200-1.898%201.368L4%2024V10h24a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464l-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h22l4.805-11.212A2%202%200%200%200%2028.967%2012'/%3e%3cpath%20fill='%23cfd8dc'%20d='M28%2012h-6a4%204%200%200%200-4%204v8h2v-8h8v9.893a2.074%202.074%200%200%201-1.664%202.08A2%202%200%200%201%2024%2026h-8a4%204%200%200%200%204%204h6a4%204%200%200%200%204-4V16h2a4%204%200%200%200-4-4'/%3e%3c/svg%3e`})),n_,r_=t((()=>{n_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%234caf50'%20d='m13.844%207.536-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h24a2%202%200%200%200%202-2V10a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464'/%3e%3cpath%20fill='%23c8e6c9'%20d='M18.435%2030a1%201%200%200%201-.238-.028%201.137%201.137%200%200%201-.828-1.323l3.093-15.744a1.13%201.13%200%200%201%20.507-.744%201.06%201.06%200%200%201%20.8-.134%201.14%201.14%200%200%201%20.828%201.324l-3.1%2015.744a1.12%201.12%200%200%201-.505.743%201.06%201.06%200%200%201-.557.162m6.2-2h-.077a1.08%201.08%200%200%201-.762-.412%201.164%201.164%200%200%201%20.113-1.548l5.32-4.967-5.297-4.623a1.165%201.165%200%200%201-.162-1.544%201.08%201.08%200%200%201%20.754-.437%201.06%201.06%200%200%201%20.81.258l6.244%205.455a1.156%201.156%200%200%201%20.004%201.723l-6.22%205.808a1.07%201.07%200%200%201-.728.289Zm-9.31%200a1.07%201.07%200%200%201-.728-.292l-6.225-5.811a1.16%201.16%200%200%201-.01-1.692l.02-.018%206.246-5.454a1.03%201.03%200%200%201%20.8-.26%201.08%201.08%200%200%201%20.758.436%201.165%201.165%200%200%201-.16%201.547l-5.293%204.62%205.32%204.964a1.156%201.156%200%200%201%20.112%201.548%201.07%201.07%200%200%201-.762.412Z'/%3e%3c/svg%3e`})),i_,a_=t((()=>{i_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%234caf50'%20d='M28.967%2012H9.442a2%202%200%200%200-1.898%201.368L4%2024V10h24a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464l-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h22l4.805-11.212A2%202%200%200%200%2028.967%2012'/%3e%3cpath%20fill='%23c8e6c9'%20d='M18.473%2030a1%201%200%200%201-.238-.028%201.137%201.137%200%200%201-.828-1.323L20.5%2012.905a1.13%201.13%200%200%201%20.507-.744%201.06%201.06%200%200%201%20.8-.134%201.14%201.14%200%200%201%20.828%201.324l-3.101%2015.744a1.12%201.12%200%200%201-.504.743%201.06%201.06%200%200%201-.557.162m6.2-2h-.077a1.08%201.08%200%200%201-.762-.412%201.164%201.164%200%200%201%20.113-1.548l5.319-4.967-5.296-4.623a1.165%201.165%200%200%201-.162-1.544%201.08%201.08%200%200%201%20.754-.437%201.06%201.06%200%200%201%20.81.258l6.244%205.455a1.156%201.156%200%200%201%20.003%201.723l-6.218%205.808a1.07%201.07%200%200%201-.729.289Zm-9.31%200a1.07%201.07%200%200%201-.728-.292l-6.226-5.811a1.16%201.16%200%200%201-.01-1.692l.02-.018%206.246-5.454a1.03%201.03%200%200%201%20.8-.26%201.08%201.08%200%200%201%20.76.436%201.165%201.165%200%200%201-.16%201.547l-5.294%204.62%205.32%204.964a1.156%201.156%200%200%201%20.112%201.548%201.07%201.07%200%200%201-.762.412Z'/%3e%3c/svg%3e`})),o_,s_=t((()=>{o_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23455a64'%20d='m13.843%207.536-1.288-1.072A2%202%200%200%200%2011.275%206H3.999a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h24a2%202%200%200%200%202-2V10a2%202%200%200%200-2-2H15.123a2%202%200%200%201-1.28-.464'/%3e%3cpath%20fill='%23ffca28'%20d='M27.157%2016.551c0%201.319-1.43%202.143-2.573%201.483a1.7%201.7%200%200%201-.355-.271c-.934-.933-.506-2.525.768-2.867a1.716%201.716%200%200%201%202.16%201.655'/%3e%3cpath%20fill='%2326c6da'%20d='M22.556%2019.744c-.947%200-1.715.767-1.715%201.712%200%20.946.768%201.713%201.715%201.713.949%200%201.717-.767%201.717-1.713%200-.945-.768-1.712-1.717-1.712'/%3e%3cpath%20fill='%23ffca28'%20d='M28.996%2022.041a6.6%206.6%200%200%201-2.261.918%204.6%204.6%200%200%200%20.226-2.07%204.593%204.593%200%200%200%20.521-8.455%204.6%204.6%200%200%200-5.775%201.44%207.6%207.6%200%200%200-2.51.731%206.55%206.55%200%200%201%2012.798%202.191%206.54%206.54%200%200%201-2.999%205.245m-9.722-6.245%201.607.195a4.6%204.6%200%200%201%20.203-.911%206.6%206.6%200%200%200-1.81.716'%20clip-rule='evenodd'/%3e%3cpath%20fill='%2326c6da'%20d='M18.995%2015.967a6.6%206.6%200%200%201%202.276-.926%204.6%204.6%200%200%200-.257%202.079%204.6%204.6%200%200%200-2.863%203.005c-.893%202.969%201.352%205.951%204.454%205.916a4.6%204.6%200%200%200%203.687-1.914%207.7%207.7%200%200%200%202.509-.724%206.553%206.553%200%200%201-10.212%203.266c-3.617-2.742-3.41-8.24.406-10.702m9.72%206.245-.03.016z'%20clip-rule='evenodd'/%3e%3c/svg%3e`})),c_,l_=t((()=>{c_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23455a64'%20d='M28.967%2012H9.442a2%202%200%200%200-1.898%201.368L4%2024V10h24a2%202%200%200%200-2-2H15.124c-.468%200-.921-.164-1.28-.464l-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h22l4.805-11.212A2%202%200%200%200%2028.967%2012'/%3e%3cpath%20fill='%23ffca28'%20d='M27.163%2016.551c0%201.319-1.428%202.143-2.57%201.483a1.6%201.6%200%200%201-.354-.271%201.714%201.714%200%201%201%202.924-1.212'/%3e%3cpath%20fill='%2326c6da'%20d='M22.568%2019.744a1.713%201.713%200%201%200%200%203.426%201.713%201.713%200%200%200%200-3.426'/%3e%3cpath%20fill='%23ffca28'%20d='M29%2022.041a6.6%206.6%200%200%201-2.259.918%204.6%204.6%200%200%200%20.226-2.07%204.596%204.596%200%200%200%20.521-8.455%204.594%204.594%200%200%200-5.768%201.44%207.6%207.6%200%200%200-2.507.731%206.54%206.54%200%200%201%207.351-4.511A6.542%206.542%200%200%201%2029%2022.041m-9.71-6.245%201.605.195a4.7%204.7%200%200%201%20.202-.911%206.5%206.5%200%200%200-1.807.716'%20clip-rule='evenodd'/%3e%3cpath%20fill='%2326c6da'%20d='M19.011%2015.967a6.5%206.5%200%200%201%202.273-.926%204.6%204.6%200%200%200-.257%202.079%204.6%204.6%200%200%200-2.859%203.005c-.892%202.969%201.35%205.951%204.449%205.916a4.6%204.6%200%200%200%203.682-1.914%207.7%207.7%200%200%200%202.506-.724%206.54%206.54%200%200%201-10.2%203.266c-3.612-2.742-3.405-8.24.406-10.702m9.708%206.245-.03.016z'%20clip-rule='evenodd'/%3e%3c/svg%3e`})),u_,d_=t((()=>{u_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%2300bfa5'%20d='m13.844%207.536-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h24a2%202%200%200%200%202-2V10a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464'/%3e%3cpath%20fill='%23a7ffeb'%20d='M16%2012v2h2v12a4%204%200%200%200%208%200V14h2v-2Zm5%2014a1%201%200%201%201%201-1%201%201%200%200%201-1%201m2-4a1%201%200%201%201%201-1%201%201%200%200%201-1%201m1-4h-4v-4h4Z'/%3e%3c/svg%3e`})),f_,p_=t((()=>{f_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%2300bfa5'%20d='M28.967%2012H9.442a2%202%200%200%200-1.898%201.368L4%2024V10h24a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464l-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h22l4.805-11.212A2%202%200%200%200%2028.967%2012'/%3e%3cpath%20fill='%23a7ffeb'%20d='M16%2012v2h2v12a4%204%200%200%200%208%200V14h2v-2Zm5%2014a1%201%200%201%201%201-1%201%201%200%200%201-1%201m2-4a1%201%200%201%201%201-1%201%201%200%200%201-1%201m1-4h-4v-4h4Z'/%3e%3c/svg%3e`})),m_,h_=t((()=>{m_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23ab47bc'%20d='m13.844%207.536-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h24a2%202%200%200%200%202-2V10a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464'/%3e%3cpath%20fill='%23e1bee7'%20d='M16%2014h16v6H16zm0%208h6v6h-6zm8%200h8v6h-8z'/%3e%3c/svg%3e`})),g_,__=t((()=>{g_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23ab47bc'%20d='M28.967%2012H9.442a2%202%200%200%200-1.898%201.368L4%2024V10h24a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464l-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h22l4.805-11.212A2%202%200%200%200%2028.967%2012'/%3e%3cpath%20fill='%23e1bee7'%20d='M16%2014h16v6H16zm0%208h6v6h-6zm8%200h8v6h-8z'/%3e%3c/svg%3e`})),v_,y_=t((()=>{v_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%237cb342'%20d='m13.844%207.536-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h24a2%202%200%200%200%202-2V10a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464'/%3e%3cpath%20fill='%23dcedc8'%20d='M31%2012H19a1%201%200%200%200-1%201v12a1%201%200%200%200%201%201h12a1%201%200%200%200%201-1V13a1%201%200%200%200-1-1m-1%208h-4v4h-2v-4h-4v-2h4v-4h2v4h4Z'/%3e%3cpath%20fill='%23dcedc8'%20d='M16%2028V16h-2v13a1%201%200%200%200%201%201h13v-2Z'/%3e%3c/svg%3e`})),b_,x_=t((()=>{b_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%237cb342'%20d='M28.967%2012H9.442a2%202%200%200%200-1.898%201.368L4%2024V10h24a2%202%200%200%200-2-2H15.124a2%202%200%200%201-1.28-.464l-1.288-1.072A2%202%200%200%200%2011.276%206H4a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h22l4.805-11.212A2%202%200%200%200%2028.967%2012'/%3e%3cpath%20fill='%23dcedc8'%20d='M31%2012H19a1%201%200%200%200-1%201v12a1%201%200%200%200%201%201h12a1%201%200%200%200%201-1V13a1%201%200%200%200-1-1m-1%208h-4v4h-2v-4h-4v-2h4v-4h2v4h4Z'/%3e%3cpath%20fill='%23dcedc8'%20d='M16%2028V16h-2v13a1%201%200%200%200%201%201h13v-2Z'/%3e%3c/svg%3e`})),S_,C_=t((()=>{S_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23ef5350'%20d='M16%202a14%2014%200%201%200%2014%2014A14%2014%200%200%200%2016%202m6%2010h-4v8a4%204%200%201%201-4-4%203.96%203.96%200%200%201%202%20.555V8h6Z'/%3e%3c/svg%3e`})),w_,T_=t((()=>{w_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%230288d1'%20d='M19.563%2022A5.57%205.57%200%200%201%2014%2016.437v-2.873A5.57%205.57%200%200%201%2019.563%208H24V2h-4.437A11.563%2011.563%200%200%200%208%2013.563v2.873A11.564%2011.564%200%200%200%2019.563%2028H24v-6Z'/%3e%3c/svg%3e`})),E_,D_=t((()=>{E_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3e%3cpath%20fill='%23ff7043'%20d='M2%202a1%201%200%200%200-1%201v10c0%20.554.446%201%201%201h12c.554%200%201-.446%201-1V3a1%201%200%200%200-1-1zm0%203h12v8H2zm1%202%202%202-2%202%201%201%203-3-3-3zm5%203.5V12h5v-1.5z'/%3e%3c/svg%3e`})),O_,k_=t((()=>{O_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%230288d1'%20d='M28%2014v-4h-2v4h-6v-4h-2v4h-4v2h4v4h2v-4h6v4h2v-4h4v-2z'/%3e%3cpath%20fill='%230288d1'%20d='M13.563%2022A5.57%205.57%200%200%201%208%2016.437v-2.873A5.57%205.57%200%200%201%2013.563%208H18V2h-4.437A11.563%2011.563%200%200%200%202%2013.563v2.873A11.564%2011.564%200%200%200%2013.563%2028H18v-6Z'/%3e%3c/svg%3e`})),A_,j_=t((()=>{A_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%230288d1'%20d='M30%2014v-2h-2V8h-2v4h-2V8h-2v4h-2v2h2v2h-2v2h2v4h2v-4h2v4h2v-4h2v-2h-2v-2Zm-4%202h-2v-2h2Zm-12.437%206A5.57%205.57%200%200%201%208%2016.437v-2.873A5.57%205.57%200%200%201%2013.563%208H18V2h-4.437A11.563%2011.563%200%200%200%202%2013.563v2.873A11.564%2011.564%200%200%200%2013.563%2028H18v-6Z'/%3e%3c/svg%3e`})),M_,N_=t((()=>{M_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%237e57c2'%20d='M20%2018h-2v-2h-2v2c0%20.193%200%20.703%201.254%201.033A3.345%203.345%200%200%201%2020%2022h2v2h2v-2c0-.388-.562-.851-1.254-1.034C20.356%2020.34%2020%2018.84%2020%2018m-3.254%202.966C14.356%2020.34%2014%2018.84%2014%2018h-2v-2h-2v8h2v-2h4v2h2v-2c0-.388-.562-.851-1.254-1.034'/%3e%3cpath%20fill='%237e57c2'%20d='M24%204H4v20a4%204%200%200%200%204%204h16.16A3.84%203.84%200%200%200%2028%2024.16V8a4%204%200%200%200-4-4m2%2014h-2v-2h-2v2c0%20.193%200%20.703%201.254%201.033A3.345%203.345%200%200%201%2026%2022v2a2%202%200%200%201-2%202h-2a2%202%200%200%201-2-2%202%202%200%200%201-2%202h-2a2%202%200%200%201-2-2%202%202%200%200%201-2%202h-2a2%202%200%200%201-2-2v-8a2%202%200%200%201%202-2h2a2%202%200%200%201%202%202%202%202%200%200%201%202-2h2a2%202%200%200%201%202%202%202%202%200%200%201%202-2h2a2%202%200%200%201%202%202Z'/%3e%3c/svg%3e`})),P_,F_=t((()=>{P_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%234fc3f7'%20d='M16.83%202a1.3%201.3%200%200%200-.916.377l-.013.01L7.323%207.34l8.556%208.55v.005l10.283%2010.277%201.96-3.529-7.068-16.96-3.299-3.297A1.3%201.3%200%200%200%2016.828%202Z'/%3e%3cpath%20fill='%2301579b'%20d='m7.343%207.32-4.955%208.565-.01.013a1.297%201.297%200%200%200%20.004%201.835l.005.005%204.106%204.107%2016.064%206.314%203.632-2.015-.098-.098-.025.002L15.995%2015.97h-.012z'/%3e%3cpath%20fill='%2301579b'%20d='m7.321%207.324%208.753%208.755h.013L26.16%2026.156l3.835-.73L30%2014.089l-4.049-3.965a6.5%206.5%200%200%200-3.618-1.612l.002-.043L7.323%207.325Z'/%3e%3cpath%20fill='%2364b5f6'%20d='m7.332%207.335%208.758%208.75v.013l10.079%2010.071L25.436%2030H14.09l-3.967-4.048a6.5%206.5%200%200%201-1.611-3.618l-.045.004Z'/%3e%3c/svg%3e`})),I_,L_=t((()=>{I_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23ffca28'%20d='M16%2024c-5.525%200-10-.9-10-2v4c0%201.1%204.475%202%2010%202s10-.9%2010-2v-4c0%201.1-4.475%202-10%202m0-8c-5.525%200-10-.9-10-2v4c0%201.1%204.475%202%2010%202s10-.9%2010-2v-4c0%201.1-4.475%202-10%202m0-12C10.477%204%206%204.895%206%206v4c0%201.1%204.475%202%2010%202s10-.9%2010-2V6c0-1.105-4.477-2-10-2'/%3e%3c/svg%3e`})),R_,z_=t((()=>{R_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%230288d1'%20d='M21.81%2010.25c-.06-.04-.56-.43-1.64-.43-.28%200-.56.03-.84.08-.21-1.4-1.38-2.11-1.43-2.14l-.29-.17-.18.27c-.24.36-.43.77-.51%201.19-.2.8-.08%201.56.33%202.21-.49.28-1.29.35-1.46.35H2.62c-.34%200-.62.28-.62.63%200%201.15.18%202.3.58%203.38.45%201.19%201.13%202.07%202%202.61.98.6%202.59.94%204.42.94.79%200%201.61-.07%202.42-.22%201.12-.2%202.2-.59%203.19-1.16A8.3%208.3%200%200%200%2016.78%2016c1.05-1.17%201.67-2.5%202.12-3.65h.19c1.14%200%201.85-.46%202.24-.85.26-.24.45-.53.59-.87l.08-.24zm-17.96.99h1.76c.08%200%20.16-.07.16-.16V9.5c0-.08-.07-.16-.16-.16H3.85c-.09%200-.16.07-.16.16v1.58c.01.09.07.16.16.16m2.43%200h1.76c.08%200%20.16-.07.16-.16V9.5c0-.08-.07-.16-.16-.16H6.28c-.09%200-.16.07-.16.16v1.58c.01.09.07.16.16.16m2.47%200h1.75c.1%200%20.17-.07.17-.16V9.5c0-.08-.06-.16-.17-.16H8.75c-.08%200-.15.07-.15.16v1.58c0%20.09.06.16.15.16m2.44%200h1.77c.08%200%20.15-.07.15-.16V9.5c0-.08-.06-.16-.15-.16h-1.77c-.08%200-.15.07-.15.16v1.58c0%20.09.07.16.15.16M6.28%209h1.76c.08%200%20.16-.09.16-.18V7.25c0-.09-.07-.16-.16-.16H6.28c-.09%200-.16.06-.16.16v1.57c.01.09.07.18.16.18m2.47%200h1.75c.1%200%20.17-.09.17-.18V7.25c0-.09-.06-.16-.17-.16H8.75c-.08%200-.15.06-.15.16v1.57c0%20.09.06.18.15.18m2.44%200h1.77c.08%200%20.15-.09.15-.18V7.25c0-.09-.07-.16-.15-.16h-1.77c-.08%200-.15.06-.15.16v1.57c0%20.09.07.18.15.18m0-2.28h1.77c.08%200%20.15-.07.15-.16V5c0-.1-.07-.17-.15-.17h-1.77c-.08%200-.15.06-.15.17v1.56c0%20.08.07.16.15.16m2.46%204.52h1.76c.09%200%20.16-.07.16-.16V9.5c0-.08-.07-.16-.16-.16h-1.76c-.08%200-.15.07-.15.16v1.58c0%20.09.07.16.15.16'/%3e%3c/svg%3e`})),B_,V_=t((()=>{B_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M0%200h24v24H0z'/%3e%3cpath%20fill='%2342a5f5'%20d='M8%2016h8v2H8zm0-4h8v2H8zm6-10H6c-1.1%200-2%20.9-2%202v16c0%201.1.89%202%201.99%202H18c1.1%200%202-.9%202-2V8zm4%2018H6V4h7v5h5z'/%3e%3c/svg%3e`})),H_,U_=t((()=>{H_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23f44336'%20d='M24%2028h4L18%204h-4L4%2028h4l8-19.422'/%3e%3cpath%20fill='%23f44336'%20d='M8%2020h16v4H8z'/%3e%3c/svg%3e`})),W_,G_=t((()=>{W_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23e64a19'%20d='M13.172%202.828%2011.78%204.22l1.91%201.91%202%202A2.986%202.986%200%200%201%2020%2010.81a3.25%203.25%200%200%201-.31%201.31l2.06%202a2.68%202.68%200%200%201%203.37.57%202.86%202.86%200%200%201%20.88%202.117%203.02%203.02%200%200%201-.856%202.109A2.9%202.9%200%200%201%2023%2019.81a2.93%202.93%200%200%201-2.13-.87%202.694%202.694%200%200%201-.56-3.38l-2-2.06a3%203%200%200%201-.31.12V20a3%203%200%200%201%201.44%201.09%202.92%202.92%200%200%201%20.56%201.72%202.88%202.88%200%200%201-.878%202.128%202.98%202.98%200%200%201-2.048.871%202.981%202.981%200%200%201-2.514-4.719A3%203%200%200%201%2016%2020v-6.38a2.96%202.96%200%200%201-1.44-1.09%202.9%202.9%200%200%201-.56-1.72%202.9%202.9%200%200%201%20.31-1.31l-3.9-3.9-7.579%207.572a4%204%200%200%200-.001%205.658l10.342%2010.342a4%204%200%200%200%205.656%200l10.344-10.344a4%204%200%200%200%200-5.656L18.828%202.828a4%204%200%200%200-5.656%200'/%3e%3c/svg%3e`})),K_,q_=t((()=>{K_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%2300acc1'%20d='M2%2012h4v2H2zm-2%204h6v2H0zm4%204h2v2H4zm16.954-5H14v3h3.239a4.42%204.42%200%200%201-3.531%202%202.65%202.65%200%200%201-2.053-.858%202.86%202.86%200%200%201-.628-2.28A4.515%204.515%200%200%201%2015.292%2013a2.73%202.73%200%200%201%201.749.584l2.962-1.185A5.6%205.6%200%200%200%2015.292%2010a7.526%207.526%200%200%200-7.243%206.5%205.614%205.614%200%200%200%205.659%206.5%207.526%207.526%200%200%200%207.243-6.5%206.4%206.4%200%200%200%20.003-1.5'/%3e%3cpath%20fill='%2300acc1'%20d='M26.292%2010a7.526%207.526%200%200%200-7.243%206.5%205.614%205.614%200%200%200%205.659%206.5%207.526%207.526%200%200%200%207.243-6.5%205.614%205.614%200%200%200-5.659-6.5m2.681%206.137A4.515%204.515%200%200%201%2024.708%2020a2.65%202.65%200%200%201-2.053-.858%202.86%202.86%200%200%201-.628-2.28A4.515%204.515%200%200%201%2026.292%2013a2.65%202.65%200%200%201%202.053.858%202.86%202.86%200%200%201%20.628%202.28Z'/%3e%3c/svg%3e`})),J_,Y_=t((()=>{J_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23ec407a'%20d='M6%2020h20v2H6z'/%3e%3ccircle%20cx='7'%20cy='21'%20r='3'%20fill='%23ec407a'/%3e%3ccircle%20cx='16'%20cy='27'%20r='3'%20fill='%23ec407a'/%3e%3ccircle%20cx='25'%20cy='21'%20r='3'%20fill='%23ec407a'/%3e%3cpath%20fill='%23ec407a'%20d='M6%2010h20v2H6z'/%3e%3ccircle%20cx='7'%20cy='11'%20r='3'%20fill='%23ec407a'/%3e%3ccircle%20cx='16'%20cy='5'%20r='3'%20fill='%23ec407a'/%3e%3ccircle%20cx='25'%20cy='11'%20r='3'%20fill='%23ec407a'/%3e%3cpath%20fill='%23ec407a'%20d='M6%2012h2v10H6zm18-2h2v12h-2z'/%3e%3cpath%20fill='%23ec407a'%20d='m5.014%2019.41%2011.674%206.866L15.674%2028%204%2021.134z'/%3e%3cpath%20fill='%23ec407a'%20d='M26.688%2021.724%2015.014%2028.59%2014%2026.866%2025.674%2020zM5.124%2010.382l11.415-7.29%201.077%201.686L6.2%2012.068z'/%3e%3cpath%20fill='%23ec407a'%20d='m25.798%2012.067-11.415-7.29%201.077-1.685%2011.415%207.29zM6.2%2019.932l11.416%207.29-1.077%201.686-11.415-7.29z'/%3e%3cpath%20fill='%23ec407a'%20d='m26.875%2021.619-11.415%207.29-1.077-1.687%2011.415-7.289zM5.877%2022.6%2016.04%203.686l1.762.946L7.638%2023.546z'/%3e%3cpath%20fill='%23ec407a'%20d='M24.361%2023.545%2014.197%204.633l1.761-.947%2010.165%2018.913z'/%3e%3c/svg%3e`})),X_,Z_=t((()=>{X_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23e65100'%20d='m4%204%202%2022%2010%202%2010-2%202-22Zm19.72%207H11.28l.29%203h11.86l-.802%209.335L15.99%2025l-6.635-1.646L8.93%2019h3.02l.19%202%203.86.77%203.84-.77.29-4H8.84L8%208h16Z'/%3e%3c/svg%3e`})),Q_,$_=t((()=>{Q_=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3e%3cpath%20fill='%2326a69a'%20d='M8.5%206h4l-4-4zM3.875%201H9.5l4%204v8.6c0%20.773-.616%201.4-1.375%201.4h-8.25c-.76%200-1.375-.627-1.375-1.4V2.4c0-.777.612-1.4%201.375-1.4M4%2013.6h8V8l-2.625%202.8L8%209.4zm1.25-7.7c-.76%200-1.375.627-1.375%201.4s.616%201.4%201.375%201.4c.76%200%201.375-.627%201.375-1.4S6.009%205.9%205.25%205.9'/%3e%3c/svg%3e`})),ev,tv=t((()=>{ev=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23f44336'%20d='M4%2026h24v2H4zM28%204H7a1%201%200%200%200-1%201v13a4%204%200%200%200%204%204h10a4%204%200%200%200%204-4v-4h4a2%202%200%200%200%202-2V6a2%202%200%200%200-2-2m0%208h-4V6h4Z'/%3e%3c/svg%3e`})),nv,rv=t((()=>{nv=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3e%3cpath%20fill='%23ffca28'%20d='M2%202v12h12V2zm6%206h1v4a1.003%201.003%200%200%201-1%201H7a1.003%201.003%200%200%201-1-1v-1h1v1h1zm3%200h2v1h-2v1h1a1.003%201.003%200%200%201%201%201v1a1.003%201.003%200%200%201-1%201h-2v-1h2v-1h-1a1.003%201.003%200%200%201-1-1V9a1.003%201.003%200%200%201%201-1'/%3e%3c/svg%3e`})),iv,av=t((()=>{iv=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%20-960%20960%20960'%3e%3cpath%20fill='%23f9a825'%20d='M560-160v-80h120q17%200%2028.5-11.5T720-280v-80q0-38%2022-69t58-44v-14q-36-13-58-44t-22-69v-80q0-17-11.5-28.5T680-720H560v-80h120q50%200%2085%2035t35%2085v80q0%2017%2011.5%2028.5T840-560h40v160h-40q-17%200-28.5%2011.5T800-360v80q0%2050-35%2085t-85%2035zm-280%200q-50%200-85-35t-35-85v-80q0-17-11.5-28.5T120-400H80v-160h40q17%200%2028.5-11.5T160-600v-80q0-50%2035-85t85-35h120v80H280q-17%200-28.5%2011.5T240-680v80q0%2038-22%2069t-58%2044v14q36%2013%2058%2044t22%2069v80q0%2017%2011.5%2028.5T280-240h120v80z'/%3e%3c/svg%3e`})),ov,sv=t((()=>{ov=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23f57c00'%20d='M6.2%2018a22.7%2022.7%200%200%200%209.8%202%2022.7%2022.7%200%200%200%209.8-2%2010.002%2010.002%200%200%201-19.6%200m19.6-4a22.7%2022.7%200%200%200-9.8-2%2022.7%2022.7%200%200%200-9.8%202%2010.002%2010.002%200%200%201%2019.6%200'/%3e%3ccircle%20cx='27'%20cy='5'%20r='3'%20fill='%23757575'/%3e%3ccircle%20cx='5'%20cy='27'%20r='3'%20fill='%239e9e9e'/%3e%3ccircle%20cx='5'%20cy='5'%20r='3'%20fill='%23616161'/%3e%3c/svg%3e`})),cv,lv=t((()=>{cv=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%2024%2024'%3e%3cdefs%3e%3clinearGradient%20id='a'%20x1='1.725'%20x2='22.185'%20y1='22.67'%20y2='1.982'%20gradientTransform='translate(1.306%201.129)scale(.89324)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%237c4dff'/%3e%3cstop%20offset='.5'%20stop-color='%23d500f9'/%3e%3cstop%20offset='1'%20stop-color='%23ef5350'/%3e%3c/linearGradient%3e%3c/defs%3e%3cpath%20fill='url(%23a)'%20d='M2.975%202.976v18.048h18.05v-.03l-4.478-4.511-4.48-4.515%204.48-4.515%204.443-4.477z'/%3e%3c/svg%3e`})),uv,dv=t((()=>{uv=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23ffd54f'%20d='M25%2012h-3V8a6%206%200%200%200-12%200v4H7a1%201%200%200%200-1%201v16a1%201%200%200%200%201%201h18a1%201%200%200%200%201-1V13a1%201%200%200%200-1-1M14%208a2%202%200%200%201%204%200v4h-4Zm2%2017a4%204%200%201%201%204-4%204%204%200%200%201-4%204'/%3e%3c/svg%3e`})),fv,pv=t((()=>{fv=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M0%200h24v24H0z'/%3e%3cpath%20fill='%23afb42b'%20d='M19%205v9h-5v5H5V5zm0-2H5c-1.1%200-2%20.9-2%202v14c0%201.1.9%202%202%202h10l6-6V5c0-1.1-.9-2-2-2m-7%2011H7v-2h5zm5-4H7V8h10z'/%3e%3c/svg%3e`})),mv,hv=t((()=>{mv=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%2342a5f5'%20d='M30%206a3.86%203.86%200%200%201-1.167%202.833%204.024%204.024%200%200%201-5.666%200A3.86%203.86%200%200%201%2022%206a3.86%203.86%200%200%201%201.167-2.833%204.024%204.024%200%200%201%205.666%200A3.86%203.86%200%200%201%2030%206m-9.208%205.208A10.6%2010.6%200%200%200%2013%208a10.6%2010.6%200%200%200-7.792%203.208A10.6%2010.6%200%200%200%202%2019a10.6%2010.6%200%200%200%203.208%207.792A10.6%2010.6%200%200%200%2013%2030a10.6%2010.6%200%200%200%207.792-3.208A10.6%2010.6%200%200%200%2024%2019a10.6%2010.6%200%200%200-3.208-7.792m-1.959%207.625a4.024%204.024%200%200%201-5.666%200%204.024%204.024%200%200%201%200-5.666%204.024%204.024%200%200%201%205.666%200%204.024%204.024%200%200%201%200%205.666'/%3e%3c/svg%3e`})),gv,_v=t((()=>{gv=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%2342a5f5'%20d='m14%2010-4%203.5L6%2010H4v12h4v-6l2%202%202-2v6h4V10zm12%206v-6h-4v6h-4l6%208%206-8z'/%3e%3c/svg%3e`})),vv,yv=t((()=>{vv=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23e53935'%20d='M4%204v24h24V4Zm20%2020h-4V12h-4v12H8V8h16Z'/%3e%3c/svg%3e`})),bv,xv=t((()=>{bv=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%23ef5350'%20d='M13%209h5.5L13%203.5zM6%202h8l6%206v12a2%202%200%200%201-2%202H6a2%202%200%200%201-2-2V4a2%202%200%200%201%202-2m4.93%2010.44c.41.9.93%201.64%201.53%202.15l.41.32c-.87.16-2.07.44-3.34.93l-.11.04.5-1.04c.45-.87.78-1.66%201.01-2.4m6.48%203.81c.18-.18.27-.41.28-.66.03-.2-.02-.39-.12-.55-.29-.47-1.04-.69-2.28-.69l-1.29.07-.87-.58c-.63-.52-1.2-1.43-1.6-2.56l.04-.14c.33-1.33.64-2.94-.02-3.6a.85.85%200%200%200-.61-.24h-.24c-.37%200-.7.39-.79.77-.37%201.33-.15%202.06.22%203.27v.01c-.25.88-.57%201.9-1.08%202.93l-.96%201.8-.89.49c-1.2.75-1.77%201.59-1.88%202.12-.04.19-.02.36.05.54l.03.05.48.31.44.11c.81%200%201.73-.95%202.97-3.07l.18-.07c1.03-.33%202.31-.56%204.03-.75%201.03.51%202.24.74%203%20.74.44%200%20.74-.11.91-.3m-.41-.71.09.11c-.01.1-.04.11-.09.13h-.04l-.19.02c-.46%200-1.17-.19-1.9-.51.09-.1.13-.1.23-.1%201.4%200%201.8.25%201.9.35M7.83%2017c-.65%201.19-1.24%201.85-1.69%202%20.05-.38.5-1.04%201.21-1.69zm3.02-6.91c-.23-.9-.24-1.63-.07-2.05l.07-.12.15.05c.17.24.19.56.09%201.1l-.03.16-.16.82z'/%3e%3c/svg%3e`})),Sv,Cv=t((()=>{Sv=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%231e88e5'%20d='M12%2018.08c-6.63%200-12-2.72-12-6.08s5.37-6.08%2012-6.08S24%208.64%2024%2012s-5.37%206.08-12%206.08m-5.19-7.95c.54%200%20.91.1%201.09.31.18.2.22.56.13%201.03-.1.53-.29.87-.58%201.09q-.42.33-1.29.33h-.87l.53-2.76zm-3.5%205.55h1.44l.34-1.75h1.23c.54%200%20.98-.06%201.33-.17.35-.12.67-.31.96-.58.24-.22.43-.46.58-.73.15-.26.26-.56.31-.88.16-.78.05-1.39-.33-1.82-.39-.44-.99-.65-1.82-.65H4.59zm7.25-8.33-1.28%206.58h1.42l.74-3.77h1.14c.36%200%20.6.06.71.18s.13.34.07.66l-.57%202.93h1.45l.59-3.07c.13-.62.03-1.07-.27-1.36-.3-.27-.85-.4-1.65-.4h-1.27L12%207.35zM18%2010.13c.55%200%20.91.1%201.09.31.18.2.22.56.13%201.03-.1.53-.29.87-.57%201.09-.29.22-.72.33-1.3.33h-.85l.5-2.76zm-3.5%205.55h1.44l.34-1.75h1.22c.55%200%201-.06%201.35-.17.35-.12.65-.31.95-.58.24-.22.44-.46.58-.73.15-.26.26-.56.32-.88.15-.78.04-1.39-.34-1.82-.36-.44-.99-.65-1.82-.65h-2.75z'/%3e%3c/svg%3e`})),wv,Tv=t((()=>{wv=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%2303a9f4'%20d='M29.07%206H7.677A1.535%201.535%200%200%200%206.24%207.113l-4.2%2017.774A.852.852%200%200%200%202.93%2026h21.393a1.535%201.535%200%200%200%201.436-1.113L29.96%207.112A.852.852%200%200%200%2029.07%206M8.626%2023.797a1.4%201.4%200%200%201-1.814-.31l-.007-.009a1.075%201.075%200%200%201%20.315-1.599l9.6-6.061-6.102-5.852-.01-.01a1.068%201.068%200%200%201%20.084-1.625l.037-.03a1.38%201.38%200%200%201%201.8.07l7.233%206.957a1.1%201.1%200%200%201%20.236.739%201.08%201.08%200%200%201-.412.79c-.074.04-.146.119-10.951%206.935ZM24%2022.94A1.135%201.135%200%200%201%2022.803%2024h-5.634a1.061%201.061%200%201%201%20.001-2.112h5.633A1.134%201.134%200%200%201%2024%2022.938Z'/%3e%3c/svg%3e`})),Ev,Dv=t((()=>{Ev=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%230288d1'%20d='M9.86%202A2.86%202.86%200%200%200%207%204.86v1.68h4.29c.39%200%20.71.57.71.96H4.86A2.86%202.86%200%200%200%202%2010.36v3.781a2.86%202.86%200%200%200%202.86%202.86h1.18v-2.68a2.85%202.85%200%200%201%202.85-2.86h5.25c1.58%200%202.86-1.271%202.86-2.851V4.86A2.86%202.86%200%200%200%2014.14%202zm-.72%201.61c.4%200%20.72.12.72.71s-.32.891-.72.891c-.39%200-.71-.3-.71-.89s.32-.711.71-.711'/%3e%3cpath%20fill='%23fdd835'%20d='M17.959%207v2.68a2.85%202.85%200%200%201-2.85%202.859H9.86A2.85%202.85%200%200%200%207%2015.389v3.75a2.86%202.86%200%200%200%202.86%202.86h4.28A2.86%202.86%200%200%200%2017%2019.14v-1.68h-4.291c-.39%200-.709-.57-.709-.96h7.14A2.86%202.86%200%200%200%2022%2013.64V9.86A2.86%202.86%200%200%200%2019.14%207zM8.32%2011.513l-.004.004.038-.004zm6.54%207.276c.39%200%20.71.3.71.89a.71.71%200%200%201-.71.71c-.4%200-.72-.12-.72-.71s.32-.89.72-.89'/%3e%3c/svg%3e`})),Ov,kv=t((()=>{Ov=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%231976d2'%20d='M11.956%204.05c-5.694%200-10.354%203.106-10.354%206.947%200%203.396%203.686%206.212%208.531%206.813v2.205h3.53V17.82c.88-.093%201.699-.259%202.475-.497l1.43%202.692h3.996l-2.402-4.048c1.936-1.263%203.147-3.034%203.147-4.97%200-3.841-4.659-6.947-10.354-6.947m1.584%202.712c4.349%200%207.558%201.45%207.558%204.753%200%201.77-.952%203.013-2.505%203.779a1%201%200%200%201-.228-.156c-.373-.165-.994-.352-.994-.352s3.085-.227%203.085-3.302-3.23-3.127-3.23-3.127h-7.092v7.413c-2.64-.766-4.462-2.392-4.462-4.255%200-2.63%203.52-4.753%207.868-4.753m.156%204.12h2.143s.983-.05.983.974c0%201.004-.983%201.004-.983%201.004h-2.143v-1.977m-.031%204.566h.952c.186%200%20.28.052.445.207.135.103.28.3.404.476-.57.073-1.17.104-1.801.104z'/%3e%3c/svg%3e`})),Av,jv=t((()=>{Av=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%2300bcd4'%20d='M16%2012c7.444%200%2012%202.59%2012%204s-4.556%204-12%204-12-2.59-12-4%204.556-4%2012-4m0-2c-7.732%200-14%202.686-14%206s6.268%206%2014%206%2014-2.686%2014-6-6.268-6-14-6'/%3e%3cpath%20fill='%2300bcd4'%20d='M16%2014a2%202%200%201%200%202%202%202%202%200%200%200-2-2'/%3e%3cpath%20fill='%2300bcd4'%20d='M10.458%205.507c2.017%200%205.937%203.177%209.006%208.493%203.722%206.447%203.757%2011.687%202.536%2012.392a.9.9%200%200%201-.457.1c-2.017%200-5.938-3.176-9.007-8.492C8.814%2011.553%208.779%206.313%2010%205.608a.9.9%200%200%201%20.458-.1m-.001-2A2.87%202.87%200%200%200%209%203.875C6.13%205.532%206.938%2012.304%2010.804%2019c3.284%205.69%207.72%209.493%2010.74%209.493A2.87%202.87%200%200%200%2023%2028.124c2.87-1.656%202.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z'/%3e%3cpath%20fill='%2300bcd4'%20d='M21.543%205.507a.9.9%200%200%201%20.457.1c1.221.706%201.186%205.946-2.536%2012.393-3.07%205.316-6.99%208.493-9.007%208.493a.9.9%200%200%201-.457-.1C8.779%2025.686%208.814%2020.446%2012.536%2014c3.07-5.316%206.99-8.493%209.007-8.493m0-2c-3.02%200-7.455%203.804-10.74%209.493C6.939%2019.696%206.13%2026.468%209%2028.124a2.87%202.87%200%200%200%201.457.369c3.02%200%207.455-3.804%2010.74-9.493C25.061%2012.304%2025.87%205.532%2023%203.876a2.87%202.87%200%200%200-1.457-.369'/%3e%3c/svg%3e`})),Mv,Nv=t((()=>{Mv=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%230288d1'%20d='M16%2012c7.444%200%2012%202.59%2012%204s-4.556%204-12%204-12-2.59-12-4%204.556-4%2012-4m0-2c-7.732%200-14%202.686-14%206s6.268%206%2014%206%2014-2.686%2014-6-6.268-6-14-6'/%3e%3cpath%20fill='%230288d1'%20d='M16%2014a2%202%200%201%200%202%202%202%202%200%200%200-2-2'/%3e%3cpath%20fill='%230288d1'%20d='M10.458%205.507c2.017%200%205.937%203.177%209.006%208.493%203.722%206.447%203.757%2011.687%202.536%2012.392a.9.9%200%200%201-.457.1c-2.017%200-5.938-3.176-9.007-8.492C8.814%2011.553%208.779%206.313%2010%205.608a.9.9%200%200%201%20.458-.1m-.001-2A2.87%202.87%200%200%200%209%203.875C6.13%205.532%206.938%2012.304%2010.804%2019c3.284%205.69%207.72%209.493%2010.74%209.493A2.87%202.87%200%200%200%2023%2028.124c2.87-1.656%202.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z'/%3e%3cpath%20fill='%230288d1'%20d='M21.543%205.507a.9.9%200%200%201%20.457.1c1.221.706%201.186%205.946-2.536%2012.393-3.07%205.316-6.99%208.493-9.007%208.493a.9.9%200%200%201-.457-.1C8.779%2025.686%208.814%2020.446%2012.536%2014c3.07-5.316%206.99-8.493%209.007-8.493m0-2c-3.02%200-7.455%203.804-10.74%209.493C6.939%2019.696%206.13%2026.468%209%2028.124a2.87%202.87%200%200%200%201.457.369c3.02%200%207.455-3.804%2010.74-9.493C25.061%2012.304%2025.87%205.532%2023%203.876a2.87%202.87%200%200%200-1.457-.369'/%3e%3c/svg%3e`})),Pv,Fv=t((()=>{Pv=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%23f44336'%20d='M18.041%203.177c2.24.382%202.879%201.919%202.843%203.527V6.67l-1.013%2013.266-13.132.897h.008c-1.093-.044-3.518-.151-3.634-3.545l1.217-2.222%202.462%205.74%202.097-6.77-.045.009.018-.018%206.85%202.186L13.945%209.3l6.53-.409-5.144-4.212%202.71-1.51v.009M3.113%2017.252v.017zM6.916%206.874c2.63-2.622%206.033-4.168%207.34-2.844%201.297%201.306-.072%204.523-2.702%207.135-2.666%202.613-6.015%204.248-7.322%202.933-1.306-1.324.036-4.612%202.675-7.224z'/%3e%3c/svg%3e`})),Iv,Lv=t((()=>{Iv=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23ff7043'%20d='m30%2012-4-2V6h-4l-2-4-4%202-4-2-2%204H6v4l-4%202%202%204-2%204%204%202v4h4l2%204%204-2%204%202%202-4h4v-4l4-2-2-4ZM6%2016a9.9%209.9%200%200%201%20.842-4H10v8H6.842A9.9%209.9%200%200%201%206%2016m10%2010a9.98%209.98%200%200%201-7.978-4H16v-2h-2v-2h4c.819.819.297%202.308%201.179%203.37a1.89%201.89%200%200%200%201.46.63h3.34A9.98%209.98%200%200%201%2016%2026m-2-12v-2h4a1%201%200%200%201%200%202Zm11.158%206H24a2.006%202.006%200%200%201-2-2%202%202%200%200%200-2-2%203%203%200%200%200%203-3q0-.08-.004-.161A3.115%203.115%200%200%200%2019.83%2010H8.022a9.986%209.986%200%200%201%2017.136%2010'/%3e%3c/svg%3e`})),Rv,zv=t((()=>{Rv=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23ec407a'%20d='M27.837%205.673a4.33%204.33%200%200%200-2.293-2.701c-2.362-1.261-6.11-1.298-9.548-.092a26.3%2026.3%200%200%200-8.76%204.966c-2.752%202.542-3.438%204.925-3.189%206.194.523%202.668%203.274%204.539%205.485%206.042.418.284.822.559%201.175.816-1.429.76-4.261%202.444-5.088%204.248a3.88%203.88%200%200%200-.118%203.332A2.37%202.37%200%200%200%206.869%2029.8a5.6%205.6%200%200%200%201.49.2%206.35%206.35%200%200%200%205.19-2.856%206.74%206.74%200%200%200%20.864-5.382%207.3%207.3%200%200%201%202.044-.03%203.92%203.92%200%200%201%202.816%201.311%201.82%201.82%200%200%201%20.423%201.262%201.55%201.55%200%200%201-.772%201.05c-.234.14-.586.355-.504.803.036.194.198.633.894.512a2.93%202.93%200%200%200%202.145-2.651%204%204%200%200%200-1.197-2.904%205.94%205.94%200%200%200-4.396-1.626%2010.6%2010.6%200%200%200-2.672.304%2020%2020%200%200%200-2.203-1.846c-1.712-1.3-3.33-2.529-3.235-4.26.125-2.263%202.468-4.532%206.964-6.744%204.016-1.976%207.254-2.037%208.944-1.438a2%202%200%200%201%201.204.883%202.77%202.77%200%200%201-.36%202.47%209.71%209.71%200%200%201-7.425%204.304%203.86%203.86%200%200%201-3.238-.757c-.278-.302-.593-.645-1.074-.383q-.565.31-.225%201.189a3.9%203.9%200%200%200%202.407%201.92%2011.7%2011.7%200%200%200%207.128-.671c3.527-1.35%206.681-5.202%205.756-8.787M11.895%2024.475a4%204%200%200%201-.192.468%204.5%204.5%200%200%201-.753%201.081%202.83%202.83%200%200%201-2.533%201.107c-.056-.032-.078-.146-.085-.193a3.28%203.28%200%200%201%201.076-2.284%2011.3%2011.3%200%200%201%202.644-1.933%203.85%203.85%200%200%201-.157%201.754'/%3e%3c/svg%3e`})),Bv,Vv=t((()=>{Bv=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23f44336'%20d='m6.457%209.894%2012.523%205.163-.456%201.211L6%2011.105Zm7.02-3.091L26%2011.966l-.457%201.21L13.02%208.015ZM6.465%2018.885l12.524%205.163-.457%201.21L6.01%2020.097Zm7.007-3.086%2012.524%205.163-.456%201.21-12.524-5.162Z'/%3e%3cpath%20fill='%23f44336'%20d='M6%2024.07V30l19.997-3.106V20.96zM6%205.11v5.99l20-3.11V2zm0%209.96v5.03l20-3.11v-5.03z'/%3e%3c/svg%3e`})),Hv,Uv=t((()=>{Hv=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M0%200h24v24H0z'/%3e%3cpath%20fill='%2342a5f5'%20d='M19.43%2012.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46a.5.5%200%200%200-.61-.22l-2.49%201c-.52-.4-1.08-.73-1.69-.98l-.38-2.65A.49.49%200%200%200%2014%202h-4c-.25%200-.46.18-.49.42l-.38%202.65c-.61.25-1.17.59-1.69.98l-2.49-1a.6.6%200%200%200-.18-.03c-.17%200-.34.09-.43.25l-2%203.46c-.13.22-.07.49.12.64l2.11%201.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11%201.65c-.19.15-.24.42-.12.64l2%203.46a.5.5%200%200%200%20.61.22l2.49-1c.52.4%201.08.73%201.69.98l.38%202.65c.03.24.24.42.49.42h4c.25%200%20.46-.18.49-.42l.38-2.65c.61-.25%201.17-.59%201.69-.98l2.49%201q.09.03.18.03c.17%200%20.34-.09.43-.25l2-3.46c.12-.22.07-.49-.12-.64zm-1.98-1.71c.04.31.05.52.05.73s-.02.43-.05.73l-.14%201.13.89.7%201.08.84-.7%201.21-1.27-.51-1.04-.42-.9.68c-.43.32-.84.56-1.25.73l-1.06.43-.16%201.13-.2%201.35h-1.4l-.19-1.35-.16-1.13-1.06-.43c-.43-.18-.83-.41-1.23-.71l-.91-.7-1.06.43-1.27.51-.7-1.21%201.08-.84.89-.7-.14-1.13c-.03-.31-.05-.54-.05-.74s.02-.43.05-.73l.14-1.13-.89-.7-1.08-.84.7-1.21%201.27.51%201.04.42.9-.68c.43-.32.84-.56%201.25-.73l1.06-.43.16-1.13.2-1.35h1.39l.19%201.35.16%201.13%201.06.43c.43.18.83.41%201.23.71l.91.7%201.06-.43%201.27-.51.7%201.21-1.07.85-.89.7zM12%208c-2.21%200-4%201.79-4%204s1.79%204%204%204%204-1.79%204-4-1.79-4-4-4m0%206c-1.1%200-2-.9-2-2s.9-2%202-2%202%20.9%202%202-.9%202-2%202'/%3e%3c/svg%3e`})),Wv,Gv=t((()=>{Wv=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3e%3cpath%20fill='%23ff5722'%20d='M175.94%2024.328c-13.037.252-26.009%203.872-37.471%2011.174L79.912%2072.818a67.13%2067.13%200%200%200-30.355%2044.906%2070.8%2070.8%200%200%200%206.959%2045.445%2067.2%2067.2%200%200%200-10.035%2025.102%2071.54%2071.54%200%200%200%2012.236%2054.156c23.351%2033.41%2069.468%2043.311%20102.81%2022.07l58.559-37.158a67.36%2067.36%200%200%200%2030.355-44.906%2070.77%2070.77%200%200%200-6.982-45.422%2067.65%2067.65%200%200%200%2010.059-25.102%2071.63%2071.63%200%200%200-12.236-54.156v-.18c-15.324-21.925-40.453-33.727-65.342-33.246zm5.137%2028.68a46.5%2046.5%200%200%201%2036.09%2019.969%2042.98%2042.98%200%200%201%207.365%2032.557%2045%2045%200%200%201-1.393%205.455l-1.123%203.37-2.986-2.247a75.9%2075.9%200%200%200-22.902-11.45l-2.244-.651.201-2.246a13.16%2013.16%200%200%200-2.379-8.711%2013.99%2013.99%200%200%200-14.953-5.412%2012.8%2012.8%200%200%200-3.594%201.572l-58.578%2037.25a12.24%2012.24%200%200%200-5.502%208.15%2013.1%2013.1%200%200%200%202.246%209.834%2014.03%2014.03%200%200%200%2014.93%205.569%2013.5%2013.5%200%200%200%203.594-1.573l22.453-14.234a41.8%2041.8%200%200%201%2011.898-5.232%2046.48%2046.48%200%200%201%2049.914%2018.502%2043.02%2043.02%200%200%201%207.363%2032.557%2040.42%2040.42%200%200%201-18.254%2027.078l-58.58%2037.316a43%2043%200%200%201-11.898%205.23A46.545%2046.545%200%200%201%2082.81%20227.14a42.98%2042.98%200%200%201-7.341-32.557%2038%2038%200%200%201%201.39-5.41l1.102-3.37%203.008%202.246a75.9%2075.9%200%200%200%2022.836%2011.361l2.244.65-.201%202.247a13.25%2013.25%200%200%200%202.447%208.644%2014.03%2014.03%200%200%200%2015.043%205.569%2013.1%2013.1%200%200%200%203.592-1.573l58.467-37.316a12.17%2012.17%200%200%200%205.502-8.173%2012.96%2012.96%200%200%200-2.246-9.811%2014.03%2014.03%200%200%200-15.043-5.568%2012.8%2012.8%200%200%200-3.592%201.57l-22.453%2014.258a42.9%2042.9%200%200%201-11.877%205.209%2046.52%2046.52%200%200%201-49.846-18.5%2043.02%2043.02%200%200%201-7.297-32.557A40.42%2040.42%200%200%201%2096.798%2096.98l58.646-37.316a42.8%2042.8%200%200%201%2011.811-5.21%2046.5%2046.5%200%200%201%2013.822-1.444z'/%3e%3c/svg%3e`})),Kv,qv=t((()=>{Kv=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%23ff6e40'%20d='M17.087%2019.721c-2.36%201.36-5.59%201.5-8.86.1a13.8%2013.8%200%200%201-6.23-5.32c.67.55%201.46%201%202.3%201.4%203.37%201.57%206.73%201.46%209.1%200-3.37-2.59-6.24-5.96-8.37-8.71-.45-.45-.78-1.01-1.12-1.51%208.28%206.05%207.92%207.59%202.41-1.01%204.89%204.94%209.43%207.74%209.43%207.74.16.09.25.16.36.22.1-.25.19-.51.26-.78.79-2.85-.11-6.12-2.08-8.81%204.55%202.75%207.25%207.91%206.12%2012.24-.03.11-.06.22-.05.39%202.24%202.83%201.64%205.78%201.35%205.22-1.21-2.39-3.48-1.65-4.62-1.17'/%3e%3c/svg%3e`})),Jv,Yv=t((()=>{Jv=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%3e%3cpath%20fill='%23ffca28'%20d='M165.09%2099.183a20.153%2020.153%200%200%201-34.401%2014.25%2020.152%2020.152%200%201%201%2034.4-14.25z'/%3e%3cpath%20fill='%2326c6da'%20d='M111.04%20136.74c-11.13%200-20.152%209.022-20.152%2020.151%200%2011.13%209.022%2020.152%2020.152%2020.152%2011.129%200%2020.152-9.022%2020.152-20.152%200-11.129-9.023-20.15-20.152-20.15z'/%3e%3cpath%20fill='%23ffca28'%20d='M186.7%20163.76a77%2077%200%200%201-26.564%2010.81%2054.04%2054.04%200%200%200%202.657-24.366%2054.05%2054.05%200%200%200%2033.856-35.246%2054.04%2054.04%200%200%200-27.73-64.21%2054.044%2054.044%200%200%200-67.863%2016.927%2089.8%2089.8%200%200%200-29.495%208.61%2076.94%2076.94%200%200%201%2086.49-53.058%2076.94%2076.94%200%200%201%2063.888%2078.829%2076.94%2076.94%200%200%201-35.24%2061.706zM72.48%2090.298l18.869%202.29a54%2054%200%200%201%202.381-10.717%2077%2077%200%200%200-21.25%208.427'%20clip-rule='evenodd'/%3e%3cpath%20fill='%2326c6da'%20d='M69.182%2092.314a76.9%2076.9%200%200%201%2026.747-10.9%2053.95%2053.95%200%200%200-3.023%2024.457%2054.05%2054.05%200%200%200-33.64%2035.358%2054.04%2054.04%200%200%200%2052.354%2069.6%2054.04%2054.04%200%200%200%2043.298-22.52%2089.8%2089.8%200%200%200%2029.495-8.518%2076.94%2076.94%200%200%201-50.002%2050.423%2076.94%2076.94%200%200%201-69.992-11.992A76.944%2076.944%200%200%201%2069.18%2092.315zm114.22%2073.462-.366.183z'%20clip-rule='evenodd'/%3e%3c/svg%3e`})),Xv,Zv=t((()=>{Xv=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3e%3cpath%20fill='%23cfd8dc'%20d='M4%206V4h8v2H9v7H7V6z'/%3e%3cpath%20fill='%23ef5350'%20d='M4%201v1H2v12h2v1H1V1zm8%200v1h2v12h-2v1h3V1z'/%3e%3c/svg%3e`})),Qv,$v=t((()=>{Qv=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20viewBox='0%200%2016%2016'%3e%3cpath%20fill='%230288d1'%20d='M2%202v12h12V2zm4%206h3v1H8v4H7V9H6zm5%200h2v1h-2v1h1a1.003%201.003%200%200%201%201%201v1a1.003%201.003%200%200%201-1%201h-2v-1h2v-1h-1a1.003%201.003%200%200%201-1-1V9a1.003%201.003%200%200%201%201-1'/%3e%3c/svg%3e`})),ey,ty=t((()=>{ey=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23ff9800'%20d='m24%206%202%206h-4l-2-6h-3l2%206h-4l-2-6h-3l2%206H8L6%206H5a3%203%200%200%200-3%203v14a3%203%200%200%200%203%203h22a3%203%200%200%200%203-3V6Z'/%3e%3c/svg%3e`})),ny,ry=t((()=>{ny=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cpath%20fill='%23a0f'%20d='M29.313%2012h-6.664a1.427%201.427%200%200%201-1.1-2.24l4.398-6.676A.703.703%200%200%200%2025.397%202H8.428a.62.62%200%200%200-.55.289l-5.77%208.627A.703.703%200%200%200%202.658%2012h8.175a1.427%201.427%200%200%201%201.099%202.24l-4.48%206.676A.702.702%200%200%200%208%2022l6.695.002A1.34%201.34%200%200%201%2016%2023.375v5.934a.652.652%200%200%200%201.168.433l12.694-16.586a.725.725%200%200%200-.55-1.156'/%3e%3c/svg%3e`})),iy,ay=t((()=>{iy=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%2341b883'%20d='M1.791%203.851%2012%2021.471%2022.209%203.936V3.85H18.24l-6.18%2010.616L5.906%203.851z'/%3e%3cpath%20fill='%2335495e'%20d='m5.907%203.851%206.152%2010.617L18.24%203.851h-3.723L12.084%208.03%209.66%203.85z'/%3e%3c/svg%3e`})),oy,sy=t((()=>{oy=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%238bc34a'%20d='M13%209h5.5L13%203.5zM6%202h8l6%206v12a2%202%200%200%201-2%202H6a2%202%200%200%201-2-2V4c0-1.11.89-2%202-2m.12%2013.5%203.74%203.74%201.42-1.41-2.33-2.33%202.33-2.33-1.42-1.41zm11.16%200-3.74-3.74-1.42%201.41%202.33%202.33-2.33%202.33%201.42%201.41z'/%3e%3c/svg%3e`})),cy,ly=t((()=>{cy=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%23ff5252'%20d='M13%209h5.5L13%203.5zM6%202h8l6%206v12c0%201.1-.9%202-2%202H6c-1.1%200-2-.9-2-2V4c0-1.1.9-2%202-2m12%2016v-2H9v2zm-4-4v-2H6v2z'/%3e%3c/svg%3e`})),uy,dy=t((()=>{uy=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%23afb42b'%20d='M14%2017h-2v-2h-2v-2h2v2h2m0-6h-2v2h2v2h-2v-2h-2V9h2V7h-2V5h2v2h2m5-4H5c-1.11%200-2%20.89-2%202v14a2%202%200%200%200%202%202h14a2%202%200%200%200%202-2V5a2%202%200%200%200-2-2'/%3e%3c/svg%3e`}));function fy(e){let t=e.lastIndexOf(`.`);return t===-1?``:e.slice(t+1).toLowerCase()}function py(e,t){let n=hy[e]||hy[e.toLowerCase()];return n?t?n.open:n.closed:t?ug:cg}function my(e,t){let n=e.toLowerCase();return _y[n]?_y[n]:n.endsWith(`.config.ts`)||n.endsWith(`.config.js`)||n.endsWith(`.config.mjs`)?Hv:n.endsWith(`.tsx`)?Mv:n.endsWith(`.jsx`)?Av:gy[t.toLowerCase()]||`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M0%200h24v24H0z'/%3e%3cpath%20fill='%2342a5f5'%20d='M8%2016h8v2H8zm0-4h8v2H8zm6-10H6c-1.1%200-2%20.9-2%202v16c0%201.1.89%202%201.99%202H18c1.1%200%202-.9%202-2V8zm4%2018H6V4h7v5h5z'/%3e%3c/svg%3e`}var hy,gy,_y,vy=t((()=>{lg(),dg(),pg(),hg(),_g(),yg(),xg(),Cg(),Tg(),Dg(),kg(),jg(),Ng(),Fg(),Lg(),zg(),Vg(),Ug(),Gg(),qg(),Yg(),Zg(),$g(),t_(),r_(),a_(),s_(),l_(),d_(),p_(),h_(),__(),y_(),x_(),C_(),T_(),D_(),k_(),j_(),N_(),F_(),L_(),z_(),V_(),U_(),G_(),q_(),Y_(),Z_(),$_(),tv(),rv(),av(),sv(),lv(),dv(),pv(),hv(),_v(),yv(),xv(),Cv(),Tv(),Dv(),kv(),jv(),Nv(),Fv(),Lv(),zv(),Vv(),Uv(),Gv(),qv(),Yv(),Zv(),$v(),ty(),ry(),ay(),sy(),ly(),dy(),hy={".cargo_home":{closed:Jg,open:Xg},".github":{closed:Og,open:Ag},".git":{closed:wg,open:Eg},".rustup":{closed:Jg,open:Xg},".rustup_copy":{closed:Jg,open:Xg},".rustup_home":{closed:Jg,open:Xg},assets:{closed:Mg,open:Pg},components:{closed:fg,open:mg},crates:{closed:Jg,open:Xg},css:{closed:m_,open:g_},dist:{closed:gg,open:vg},docs:{closed:bg,open:Sg},logs:{closed:Ig,open:Rg},node_modules:{closed:Bg,open:Hg},out:{closed:gg,open:vg},public:{closed:Wg,open:Kg},renderer:{closed:m_,open:g_},scripts:{closed:Qg,open:e_},src:{closed:n_,open:i_},"src-tauri":{closed:o_,open:c_},tests:{closed:u_,open:f_},utils:{closed:v_,open:b_}},gy={css:M_,scss:Rv,sass:Rv,less:M_,html:X_,htm:X_,graphql:J_,gql:J_,vue:iy,svelte:Wv,js:nv,mjs:nv,cjs:nv,jsx:Av,ts:Qv,mts:Qv,cts:Qv,tsx:Mv,py:Ev,pyc:Ev,pyd:Ev,pyw:Ev,ipynb:ov,rs:Iv,c:w_,h:w_,cpp:O_,cc:O_,cxx:O_,hpp:O_,hh:O_,hxx:O_,cs:A_,go:K_,java:ev,jar:ev,kt:cv,kts:cv,php:Sv,rb:Pv,swift:Kv,scala:Bv,dart:P_,lua:mv,r:Ov,sh:E_,bash:E_,zsh:E_,fish:E_,ps1:wv,psm1:wv,bat:E_,cmd:E_,json:iv,json5:iv,jsonc:iv,yaml:cy,yml:cy,toml:Xv,xml:oy,sql:I_,db:I_,sqlite:I_,sqlite3:I_,md:gv,mdx:gv,pdf:bv,log:fv,lock:uv,png:Q_,jpg:Q_,jpeg:Q_,gif:Q_,webp:Q_,svg:Q_,ico:Q_,mp3:S_,wav:S_,ogg:S_,mp4:ey,webm:ey,mov:ey,zip:uy,tar:uy,gz:uy,tgz:uy,"7z":uy,rar:uy,woff:H_,woff2:H_,ttf:H_,otf:H_},_y={"package-lock.json":vv,"package.json":vv,"tauri.conf.json":Jv,"vite.config.ts":ny,"vite.config.web.ts":ny,"vite.config.js":ny,dockerfile:R_,containerfile:R_,"docker-compose.yml":R_,"docker-compose.yaml":R_,".gitignore":W_,".gitattributes":W_,".gitmodules":W_,".env":Hv,".env.local":Hv,".env.development":Hv,".env.production":Hv}}));function yy(e){if(!e||!e.includes(`imgs.search.brave.com`))return e;try{let t=e.match(/imgs\.search\.brave\.com\/[^\/]+\/[^\/]+\/[^\/]+\/(.+)$/);if(!t)return e;let n=t[1].replace(/\//g,``),r=(n+`=`.repeat((4-n.length%4)%4)).replace(/-/g,`+`).replace(/_/g,`/`),i=atob(r).replace(/&/g,`&`);if(i.startsWith(`http://`)||i.startsWith(`https://`))return i}catch{}return e}function by(e){return!e||!e.includes(`pbs.twimg.com/profile_banners/`)?e:e.replace(/^(https?:\/\/pbs\.twimg\.com\/profile_banners\/\d+\/\d+)\/?$/,`$1/1500x500`)}function xy(e){return e?`${typeof window<`u`&&window.location.port===`9000`?`http://localhost:3000`:typeof window<`u`?window.location.origin:``}/api/proxy-image?url=${encodeURIComponent(e)}`:``}function Sy(e){return!e||typeof e!=`string`?``:e.replace(/(^|[^\\])(!\[[^\]\r\n]*\]\((?:https?:\/\/|\/api\/|data:)[^\s\)]+)[ \t]*$/gm,`$1$2)`)}function Cy(e){if(typeof e!=`string`)return``;let t=e.trim();if(!t.startsWith(`{`))return Sy(wy(e));try{let e=JSON.parse(t);if(e?.action===`finish`&&typeof e?.input?.summary==`string`&&e.input.summary.trim())return Sy(wy(e.input.summary));if(typeof e?.finish?.summary==`string`&&e.finish.summary.trim())return Sy(wy(e.finish.summary))}catch{return Sy(wy(e))}return Sy(wy(e))}function wy(e){return!e.includes(`\\`)&&!e.includes(`$`)&&!e.includes(`arrow`)?e:e.replace(/\$\\rightarrow\$|\\\(\\rightarrow\\\)|\\rightarrow|\bightarrow\b/g,`→`).replace(/\$\\leftarrow\$|\\\(\\leftarrow\\\)|\\leftarrow|\beftarrow\b/g,`←`).replace(/\$\\Rightarrow\$|\\\(\\Rightarrow\\\)|\\Rightarrow|\begRightarrow\b/g,`⇒`).replace(/\$\\Leftarrow\$|\\\(\\Leftarrow\\\)|\\Leftarrow/g,`⇐`).replace(/\$\\leftrightarrow\$|\\\(\\leftrightarrow\\\)|\\leftrightarrow/g,`↔`).replace(/\$\\leq\$|\\\(\\leq\\\)|\\leq/g,`≤`).replace(/\$\\geq\$|\\\(\\geq\\\)|\\geq/g,`≥`).replace(/\$\\neq\$|\\\(\\neq\\\)|\\neq/g,`≠`).replace(/\$\\approx\$|\\\(\\approx\\\)/g,`≈`).replace(/\$\\times\$|\\\(\\times\\\)|\\times/g,`×`).replace(/\$\\div\$|\\\(\\div\\\)|\\div/g,`÷`).replace(/\$\\pm\$|\\\(\\pm\\\)/g,`±`).replace(/\$\\infty\$|\\\(\\infty\\\)|\\infty/g,`∞`).replace(/\$\\cdot\$|\\\(\\cdot\\\)|\\cdot/g,`·`).replace(/\$\\in\$|\\\(\\in\\\)|\\in\b/g,`∈`).replace(/\$\\subset\$|\\\(\\subset\\\)|\\subset/g,`⊂`).replace(/\$\\cup\$|\\\(\\cup\\\)|\\cup\b/g,`∪`).replace(/\$\\cap\$|\\\(\\cap\\\)|\\cap\b/g,`∩`).replace(/\$([^$\n]{1,60})\$/g,`$1`).replace(/\\\(([^)]{1,60})\\\)/g,`$1`)}function Ty(e){return e?(0,R.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{display:`block`},children:[(0,R.jsx)(`polygon`,{points:`11 5 6 9 2 9 2 15 6 15 11 19 11 5`}),(0,R.jsx)(`path`,{d:`M15.54 8.46a5 5 0 0 1 0 7.07`}),(0,R.jsx)(`path`,{d:`M19.07 4.93a10 10 0 0 1 0 14.14`})]}):(0,R.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{display:`block`},children:(0,R.jsx)(`polygon`,{points:`11 5 6 9 2 9 2 15 6 15 11 19 11 5`})})}function Ey(e){return e?(0,R.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{display:`block`,color:`var(--interactive-fg)`},children:(0,R.jsx)(`polyline`,{points:`20 6 9 17 4 12`})}):(0,R.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{display:`block`},children:[(0,R.jsx)(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`,ry:`2`}),(0,R.jsx)(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})]})}function Dy(e){return e==null||typeof e==`boolean`?``:typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(Dy).join(``):(0,Wy.isValidElement)(e)?Dy(e.props.children):``}function Oy(e,t=`m`){if(typeof e==`string`){let n=e.split(/(@[\w\-.\/]+|\[badge(?::[a-zA-Z]+)?\s+[^\]]+\])/g);return n.length<=1?e:n.map((e,n)=>{if(n%2==1){if(e.startsWith(`@`)){let r=e.slice(1),i=fy(r);if(i){let e=my(r,i);return(0,R.jsxs)(`span`,{className:`chat-mention chat-file-mention`,title:r,children:[e?(0,R.jsx)(`img`,{src:e,alt:``,width:`13`,height:`13`,style:{width:13,height:13,flexShrink:0,objectFit:`contain`},"aria-hidden":`true`,draggable:!1}):(0,R.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{flexShrink:0},"aria-hidden":`true`,children:[(0,R.jsx)(`path`,{d:`M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z`}),(0,R.jsx)(`polyline`,{points:`14 2 14 8 20 8`})]}),(0,R.jsx)(`span`,{children:r})]},`${t}-${n}`)}return(0,R.jsx)(`span`,{className:`chat-mention`,children:e},`${t}-${n}`)}let r=e.match(/^\[badge(?::([a-zA-Z]+))?\s+([^\]]+)\]$/);if(r)return(0,R.jsx)(Wy.Fragment,{children:r[2]},`${t}-${n}`)}return e?(0,R.jsx)(Wy.Fragment,{children:e},`${t}-t-${n}`):null})}return Array.isArray(e)?e.map((e,n)=>(0,R.jsx)(Wy.Fragment,{children:Oy(e,`${t}-${n}`)},`${t}-${n}`)):e}function ky(e){let t=e;return t?t.type===`text`?t.value??``:Array.isArray(t.children)?t.children.map(ky).join(``):``:``}function Ay(e){return e?.children?.find(e=>e.type===`element`&&e.tagName===`code`)}function jy(e,t){let n=0;return Wy.Children.toArray(e).filter(e=>(0,Wy.isValidElement)(e)||typeof e==`string`&&e.trim()!==``).map(e=>{if(!(0,Wy.isValidElement)(e))return e;let r=(t.start??1)+n;return n+=1,(0,Wy.cloneElement)(e,{key:e.key??r,ordered:t.ordered,index:r})})}function My(e){let t=Wy.Children.toArray(e);for(;t.length&&typeof t[0]==`string`&&t[0].trim()===``;)t.shift();for(;t.length&&typeof t[t.length-1]==`string`&&t[t.length-1].trim()===``;)t.pop();return t}function Ny(e){if(!e||!e.trim())return null;let t=e.trim();return t.startsWith("```")&&(t=t.replace(/^```[a-zA-Z0-9_-]*\s*/,``).replace(/\s*```$/,``).trim()),ng(t)}function Py(e,t,n){let r=Ny(e);return r?(0,R.jsx)(Wy.Suspense,{fallback:null,children:n(r)}):(0,R.jsx)(eg,{code:e,language:t})}function Fy(e,t){switch(e){case`weather_json`:case`weather-json`:return Py(t,e,e=>(0,R.jsx)(Gy,{data:e}));case`stock_json`:case`stock-json`:return Py(t,e,e=>(0,R.jsx)(Ky,{data:e}));case`calculation_json`:case`calculation-json`:return Py(t,e,e=>(0,R.jsx)(qy,{data:e}));case`image_search_json`:case`image-search-json`:return Py(t,e,e=>(0,R.jsx)(Jy,{data:e}));case`image_gen_json`:case`image-gen-json`:return Py(t,e,e=>(0,R.jsx)(Yy,{data:e}));case`mermaid`:return(0,R.jsx)(Wy.Suspense,{fallback:null,children:(0,R.jsx)(Xy,{code:t})});case`ui_grid`:case`ui-grid`:case`ui_grid_json`:case`ui-grid-json`:{let n=t.trim();/^ui[-_]grid(?:[-_]json)?\s*/i.test(n)&&(n=n.replace(/^ui[-_]grid(?:[-_]json)?\s*/i,``));let r=Ny(n);return r?(0,R.jsx)(Wy.Suspense,{fallback:null,children:(0,R.jsx)(Zy,{data:r})}):(0,R.jsx)(eg,{code:t,language:e})}case`ui_card`:case`ui-card`:case`ui_card_json`:case`ui-card-json`:case`ui_feature`:case`ui-feature`:{let n=t.trim();/^ui[-_](?:card|feature)(?:[-_]json)?\s*/i.test(n)&&(n=n.replace(/^ui[-_](?:card|feature)(?:[-_]json)?\s*/i,``));let r=Ny(n);return r?(0,R.jsx)(Wy.Suspense,{fallback:null,children:(0,R.jsx)(Qy,{data:r})}):(0,R.jsx)(eg,{code:t,language:e})}case`ui_mockup`:case`ui-mockup`:case`ui_mockup_json`:case`ui-mockup-json`:{let n=t.trim();/^ui[-_]mockup(?:[-_]json)?\s*/i.test(n)&&(n=n.replace(/^ui[-_]mockup(?:[-_]json)?\s*/i,``));let r=Ny(n);return r?(0,R.jsx)(Wy.Suspense,{fallback:null,children:(0,R.jsx)($y,{data:r})}):(0,R.jsx)(eg,{code:t,language:e})}default:return(0,R.jsx)(eg,{code:t,language:e})}}function Iy(e){let t=!1;function n(e){if(t||e==null)return e;if(typeof e==`string`){let n=e.match(/^\s*\[!(?:NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*(?:\r?\n)?/i);return n?(t=!0,e.slice(n[0].length)):e}if(Array.isArray(e))return e.map(n).filter(e=>e!==``&&e!=null);if((0,Wy.isValidElement)(e)){let t=e.props;if(t.children)return(0,Wy.cloneElement)(e,{},n(t.children))}return e}return n(e)}function Ly(e,t){let n={NOTE:{title:`Note`,color:`#38bdf8`,border:`#38bdf8`,bg:`rgba(56, 189, 248, 0.08)`,borderSubtle:`rgba(56, 189, 248, 0.25)`,Icon:fe},TIP:{title:`Tip`,color:`#34d399`,border:`#10b981`,bg:`rgba(16, 185, 129, 0.08)`,borderSubtle:`rgba(16, 185, 129, 0.25)`,Icon:Me},IMPORTANT:{title:`Important`,color:`#c084fc`,border:`#a855f7`,bg:`rgba(168, 85, 247, 0.08)`,borderSubtle:`rgba(168, 85, 247, 0.25)`,Icon:te},WARNING:{title:`Warning`,color:`#fbbf24`,border:`#f59e0b`,bg:`rgba(245, 158, 11, 0.08)`,borderSubtle:`rgba(245, 158, 11, 0.25)`,Icon:Oe},CAUTION:{title:`Caution`,color:`#f87171`,border:`#ef4444`,bg:`rgba(239, 68, 68, 0.08)`,borderSubtle:`rgba(239, 68, 68, 0.25)`,Icon:pe}}[e]||{title:`Note`,color:`#38bdf8`,border:`#38bdf8`,bg:`rgba(56, 189, 248, 0.08)`,borderSubtle:`rgba(56, 189, 248, 0.25)`,Icon:fe},r=n.Icon;return(0,R.jsxs)(`div`,{className:`chat-callout-card chat-callout--${e.toLowerCase()}`,style:{margin:`14px 0`,padding:`12px 16px`,borderRadius:`var(--radius-lg, 14px)`,borderLeft:`4px solid ${n.border}`,borderTop:`1px solid ${n.borderSubtle}`,borderRight:`1px solid ${n.borderSubtle}`,borderBottom:`1px solid ${n.borderSubtle}`,"--callout-tint":n.bg,"--callout-accent":n.border,boxShadow:`0 2px 10px rgba(0, 0, 0, 0.15)`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`,marginBottom:`6px`,color:n.color,fontWeight:700,fontSize:`0.86rem`,letterSpacing:`0.3px`,textTransform:`none`},children:[(0,R.jsx)(r,{size:16,strokeWidth:2.2}),(0,R.jsx)(`span`,{children:n.title})]}),(0,R.jsx)(`div`,{style:{fontSize:`0.86rem`,color:`var(--text-chat, #cbd5e1)`,lineHeight:1.5},children:t})]})}function Ry({src:e,alt:t,sourceUrl:n,initialError:r,initialStage:i}){let[a,o]=(0,Wy.useState)(i||(r?`failed`:`direct`)),s=eb(String(e||``)),c=t||`Generated Image`,l=/^https?:\/\//.test(s),u=n&&/^https?:\/\//.test(n)?n:s;if((0,Wy.useEffect)(()=>{o(i||(r?`failed`:`direct`))},[e,r,i]),a===`failed`)return(0,R.jsx)(`div`,{className:`chat-media-card chat-media-card--failed`,style:{margin:`6px 0 10px`,borderRadius:`var(--radius-lg, 14px)`,padding:`10px 14px`,border:`1px solid var(--border, rgba(255,255,255,0.12))`,background:`var(--panel-bg, #141416)`,maxWidth:`420px`},children:(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`,color:`var(--text-muted, #94a3b8)`,fontSize:`0.82rem`},children:[(0,R.jsx)(re,{size:16,style:{flexShrink:0,color:`var(--text-muted, #94a3b8)`}}),(0,R.jsxs)(`div`,{style:{flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:[(0,R.jsx)(`span`,{style:{fontWeight:500},children:c===`Generated Image`?``:`${c}: `}),(0,R.jsx)(`span`,{children:`Image failed to load`})]}),(0,R.jsx)(`a`,{href:u,target:`_blank`,rel:`noopener noreferrer`,className:`chat-link`,style:{flexShrink:0,fontSize:`0.78rem`,padding:`3px 8px`,borderRadius:`var(--radius-xs, 6px)`,background:`var(--bg-surface-soft, rgba(255,255,255,0.06))`,border:`1px solid var(--border, rgba(255,255,255,0.12))`,color:`var(--interactive-fg-hover, #38bdf8)`,textDecoration:`none`},children:`Open link`})]})});let d=()=>{o(l&&a===`direct`?`proxy`:`failed`)},f=l&&a===`proxy`?xy(s):s;return l?(0,R.jsxs)(`div`,{className:`chat-media-card chat-media-card--thumbnail`,"data-load-stage":a,style:{margin:`6px 0 10px`,borderRadius:`var(--radius-lg, 14px)`,overflow:`hidden`,border:`1px solid var(--border, rgba(255,255,255,0.12))`,background:`var(--panel-bg, #141416)`,maxWidth:`420px`},children:[(0,R.jsx)(`a`,{href:u,target:`_blank`,rel:`noopener noreferrer`,title:n?`Open source page: ${c}`:c,style:{display:`flex`,justifyContent:`center`,textDecoration:`none`},children:(0,R.jsx)(`img`,{src:f,alt:c,loading:`lazy`,referrerPolicy:`no-referrer`,style:{width:`auto`,height:`auto`,maxWidth:`100%`,maxHeight:`420px`,objectFit:`contain`,display:`block`},onError:d},f)}),(c!==`Generated Image`||n)&&(0,R.jsxs)(`div`,{style:{padding:`5px 10px`,fontSize:`0.72rem`,color:`var(--text-muted, #64748b)`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:`8px`},children:[(0,R.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:c}),n&&(0,R.jsx)(`a`,{href:s,target:`_blank`,rel:`noopener noreferrer`,style:{flexShrink:0,color:`var(--interactive-fg-hover)`},children:`View full image`})]})]}):(0,R.jsx)(`div`,{className:`chat-media-card`,style:{margin:`10px 0`,borderRadius:`var(--radius-xl, 18px)`,overflow:`hidden`,border:`1px solid var(--border, rgba(255,255,255,0.12))`,background:`var(--panel-bg, #141416)`},children:(0,R.jsx)(`img`,{src:s,alt:c,referrerPolicy:`no-referrer`,style:{width:`100%`,maxHeight:`420px`,objectFit:`contain`,display:`block`,borderRadius:`var(--radius-md, 10px)`},onError:d})})}function zy(e,t,n){return(0,R.jsx)(Ry,{src:e,alt:t,sourceUrl:n})}function By(e,t,n,r){let i=n?.children?.length===1&&n.children[0]?.tagName===`img`?n.children[0]:null;if(i){let t=String(i.properties?.src||``),n=r?.get(eb(t))||e;return zy(t,String(i.properties?.alt||``),n)}return(0,R.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,className:`chat-link`,children:Oy(t)})}function Vy(e){return e.split(`
|
|
33
|
+
`).map(e=>{let t=e.match(/^(\s*)[\(\[](\d+)[\)\]](\s+.*)$/);if(t)return`${t[1]}${t[2]}.${t[3]}`;let n=e.match(/^(\s*)[•](\s+.*)$/);return n?`${n[1]}-${n[2]}`:e}).join(`
|
|
34
|
+
`)}function Hy(e){let t=[],n=[],r=()=>{n.length>0&&(t.push({type:`text`,value:n.join(`
|
|
35
|
+
`)}),n=[])};for(let i of e.split(`
|
|
36
|
+
`)){let e=i.match(/<video[^>]*src="([^"]+)"[^>]*>/);e?(r(),t.push({type:`video`,src:e[1]})):n.push(i)}return r(),t}function Uy(e,t=[]){let n=Cy(e.replace(/\r\n?/g,`
|
|
37
|
+
`));if(!n)return null;if(n.trimStart().startsWith(`# Release Notes`))return(0,R.jsx)(`div`,{className:`chat-formatted-body`,children:(0,R.jsx)(ig,{markdown:n})});let r=Hy(n),i=new Map(t.filter(e=>e.imageUrl).map(e=>[eb(e.imageUrl),e.url])),a=t.length===0?nb:{...nb,a:({href:e,children:t,node:n})=>By(e,t,n,i),img:({src:e,alt:t})=>zy(e,t,i.get(eb(String(e||``))))};return(0,R.jsx)(`div`,{className:`chat-formatted-body`,children:r.map((e,t)=>e.type===`video`?(0,R.jsx)(`div`,{className:`chat-media-card`,style:{margin:`10px 0`,borderRadius:`var(--radius-xl, 18px)`,overflow:`hidden`,border:`1px solid var(--border, rgba(255,255,255,0.12))`,background:`#000`},children:(0,R.jsx)(`video`,{controls:!0,src:eb(e.src),style:{width:`100%`,maxHeight:`400px`,borderRadius:`var(--radius-md, 10px)`,display:`block`}})},`video-${t}`):(0,R.jsx)(xd,{remarkPlugins:[Jh],components:a,children:Vy(e.value)},`md-${t}`))})}var Wy,R,Gy,Ky,qy,Jy,Yy,Xy,Zy,Qy,$y,eb,tb,nb,rb,ib=t((()=>{Wy=e(i()),Md(),Zh(),tg(),rg(),R=a(),sg(),vy(),A(),Ee(),Gy=(0,Wy.lazy)(()=>P(()=>import(`./WeatherCard-Buzi7Vfu.js`),__vite__mapDeps([0,1,2,3,4]))),Ky=(0,Wy.lazy)(()=>P(()=>import(`./StockCard-DxUciKyp.js`),__vite__mapDeps([5,1,2,3,4]))),qy=(0,Wy.lazy)(()=>P(()=>import(`./CalculationCard-D2E74u5q.js`),__vite__mapDeps([6,1,2,3,4]))),Jy=(0,Wy.lazy)(()=>P(()=>import(`./ImageSearchCard-Cld_SOUg.js`),__vite__mapDeps([7,1,2,3,4]))),Yy=(0,Wy.lazy)(()=>P(()=>import(`./ImageGenCard-BMCJHP9O.js`),__vite__mapDeps([8,1,2,3,4]))),Xy=(0,Wy.lazy)(()=>P(()=>import(`./MermaidCard-BBDNEXbY.js`),__vite__mapDeps([9,1,2,3,4]))),Zy=(0,Wy.lazy)(()=>P(()=>import(`./UiGridCard-BBK3I5hC.js`),__vite__mapDeps([10,1,2,3,4]))),Qy=(0,Wy.lazy)(()=>P(()=>import(`./UiFeatureCard-CdY0hGWy.js`),__vite__mapDeps([11,1,2,3,4]))),$y=(0,Wy.lazy)(()=>P(()=>import(`./UiMockupWidget-CpR9EDuc.js`),__vite__mapDeps([12,1,2,3,4]))),eb=e=>{if(!e)return``;let t=yy(e);return t=by(t),t.startsWith(`data:`)||t.startsWith(`http://`)||t.startsWith(`https://`)?t:t.startsWith(`/api/`)?`${typeof window<`u`&&window.location.port===`9000`?`http://localhost:3000`:typeof window<`u`?window.location.origin:``}${t}`:t},tb=/^(?:[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]).*:$/u,nb={p({children:e}){let t=Dy(e).trim();if(tb.test(t))return(0,R.jsx)(`div`,{className:`chat-heading chat-heading-3 chat-section-title`,children:e});let n=t.match(/^\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]/i);return n?Ly(n[1].toUpperCase(),Iy(e)):(0,R.jsx)(`div`,{className:`chat-paragraph`,children:Oy(e)})},h1:({children:e})=>(0,R.jsx)(`div`,{className:`chat-heading chat-heading-1`,children:Oy(e)}),h2:({children:e})=>(0,R.jsx)(`div`,{className:`chat-heading chat-heading-2`,children:Oy(e)}),h3:({children:e})=>(0,R.jsx)(`div`,{className:`chat-heading chat-heading-3`,children:Oy(e)}),h4:({children:e})=>(0,R.jsx)(`div`,{className:`chat-heading chat-heading-3`,children:Oy(e)}),h5:({children:e})=>(0,R.jsx)(`div`,{className:`chat-heading chat-heading-3`,children:Oy(e)}),h6:({children:e})=>(0,R.jsx)(`div`,{className:`chat-heading chat-heading-3`,children:Oy(e)}),ul:({children:e})=>(0,R.jsx)(`div`,{className:`chat-list-block`,children:jy(e,{ordered:!1})}),ol:({children:e,start:t})=>(0,R.jsx)(`div`,{className:`chat-list-block`,children:jy(e,{ordered:!0,start:typeof t==`number`?t:1})}),li:({children:e,ordered:t,index:n})=>{let r=My(e);return t?(0,R.jsxs)(`div`,{className:`chat-list-item chat-ordered-item`,children:[(0,R.jsxs)(`span`,{className:`chat-list-number`,children:[n,`.`]}),(0,R.jsx)(`div`,{className:`chat-list-text`,children:Oy(r)})]}):(0,R.jsxs)(`div`,{className:`chat-list-item chat-bullet-item`,children:[(0,R.jsx)(`span`,{className:`chat-list-bullet`,children:`•`}),(0,R.jsx)(`div`,{className:`chat-list-text`,children:Oy(r)})]})},strong:({children:e})=>(0,R.jsx)(`strong`,{className:`chat-bold-highlight`,children:e}),a:({href:e,children:t,node:n})=>By(e,t,n),img:({src:e,alt:t})=>zy(e,t),code({children:e}){let t=typeof e==`string`?e:Array.isArray(e)&&e.every(e=>typeof e==`string`)?e.join(``):``;if(t){let e=t.trim().match(/^(ui[-_](?:card|grid|mockup|feature)(?:[-_]json)?)\s+([\s\S]+)$/i);if(e){let t=e[1].replace(/_/g,`-`).toLowerCase(),n=Ny(e[2].trim());if(n){if(t.startsWith(`ui-grid`))return(0,R.jsx)(Wy.Suspense,{fallback:null,children:(0,R.jsx)(Zy,{data:n})});if(t.startsWith(`ui-card`)||t.startsWith(`ui-feature`))return(0,R.jsx)(Wy.Suspense,{fallback:null,children:(0,R.jsx)(Qy,{data:n})});if(t.startsWith(`ui-mockup`))return(0,R.jsx)(Wy.Suspense,{fallback:null,children:(0,R.jsx)($y,{data:n})})}}}return(0,R.jsx)(`code`,{className:`chat-inline-code`,children:e})},pre({node:e}){let t=Ay(e),n=t?.properties?.className,r=(Array.isArray(n)?n.map(String):typeof n==`string`?n.split(/\s+/):[]).find(e=>e.startsWith(`language-`)),i=r?r.slice(9):`plaintext`,a=ky(t).replace(/\n$/,``),o=t?.data?.meta;if(typeof o==`string`&&o.trim()){let e=o.trim();a.trim()?(e.startsWith(`[`)||e.startsWith(`{`))&&(a=e+`
|
|
38
|
+
`+a):a=e}if(i.includes(`[`)||i.includes(`{`)){let e=i.search(/[\s\[\{]/);if(e>0){let t=i.slice(0,e),n=i.slice(e);i=t,a=(n+` `+a).trim()}}if(i===`plaintext`||!i){let e=a.trim().match(/^(ui[-_](?:card|grid|mockup|feature)(?:[-_]json)?)\s+([\s\S]+)$/i);e&&(i=e[1].replace(/_/g,`-`).toLowerCase(),a=e[2].trim())}return Fy(i,a)},table:({children:e})=>(0,R.jsx)(`div`,{className:`chat-table-container`,style:{overflowX:`auto`,margin:`14px 0`,width:`100%`,borderRadius:`var(--radius-md, 10px)`,border:`1px solid var(--border-light, rgba(255, 255, 255, 0.12))`,background:`var(--panel-bg)`,boxShadow:`var(--shadow-sm, 0 4px 12px rgba(0, 0, 0, 0.15))`},children:(0,R.jsx)(`table`,{className:`chat-table`,style:{width:`100%`,borderCollapse:`collapse`,fontSize:`0.86rem`,textAlign:`left`,lineHeight:`1.5`},children:e})}),thead:({children:e})=>(0,R.jsx)(`thead`,{children:Wy.Children.map(e,e=>(0,Wy.isValidElement)(e)?(0,Wy.cloneElement)(e,{style:{background:`color-mix(in srgb, var(--text-main, #e2e8f0) 5%, transparent)`,borderBottom:`2px solid var(--border-light, rgba(255, 255, 255, 0.15))`}}):e)}),tbody:({children:e})=>{let t=Wy.Children.toArray(e).filter(Wy.isValidElement),n=0;return(0,R.jsx)(`tbody`,{children:Wy.Children.toArray(e).map(e=>{if(!(0,Wy.isValidElement)(e))return e;let r=n;return n+=1,(0,Wy.cloneElement)(e,{key:e.key??r,style:{background:r%2==1?`color-mix(in srgb, var(--text-main, #e2e8f0) 2%, transparent)`:`transparent`,borderBottom:r<t.length-1?`1px solid var(--border, rgba(255, 255, 255, 0.08))`:`none`}})})})},tr:({children:e,style:t})=>(0,R.jsx)(`tr`,{style:t,children:e}),th:({children:e})=>(0,R.jsx)(`th`,{style:{padding:`12px 16px`,fontWeight:700,color:`var(--interactive-fg)`,fontFamily:`ui-sans-serif, system-ui, sans-serif`},children:Oy(e)}),td:({children:e})=>(0,R.jsx)(`td`,{style:{padding:`12px 16px`,color:`var(--text-chat, var(--text-main, #e2e8f0))`},children:Oy(e)}),blockquote:({children:e})=>{let t=Dy(e).trim().match(/^\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]/i);return t?Ly(t[1].toUpperCase(),Iy(e)):(0,R.jsx)(`blockquote`,{style:{margin:`12px 0`,padding:`8px 16px`,borderLeft:`3px solid var(--accent, #38bdf8)`,background:`var(--bg-surface-soft)`,borderRadius:`0 8px 8px 0`,color:`var(--text-muted, #94a3b8)`,fontStyle:`italic`},children:e})}},rb=(0,Wy.memo)(function({text:e,sources:t}){return Uy(e,t)})}));function ab(e){let t=null,n=!1,r=new Set,i=()=>{try{let t=JSON.parse(e.getItem(sb)||`[]`);return Array.isArray(t)?en(t.filter(e=>typeof e==`string`)):[]}catch{return t??[]}},a=()=>t??=i(),o=(i,o)=>{if(JSON.stringify(i)!==JSON.stringify(a())){if(t=i,o)try{e.setItem(sb,JSON.stringify(i)),n=!1}catch{n=!0}r.forEach(e=>e())}};return{getSnapshot:a,subscribe(e){return r.add(e),()=>{r.delete(e)}},remove(e){let t=$t(e);t&&o(en([...a(),t]),!0)},restore(e){let t=$t(e);o(a().filter(e=>e!==t),!0)},reload(){n||o(i(),!1)}}}function ob(e){let t=lb.subscribe(e);lb.reload();let n=e=>{e.key&&e.key!==sb||lb.reload()};return window.addEventListener(`storage`,n),()=>{t(),window.removeEventListener(`storage`,n)}}var sb,cb,lb,ub=t((()=>{tn(),sb=`mint:removed-workspace-paths`,cb=[],lb=ab({getItem:e=>window.localStorage.getItem(e),setItem:(e,t)=>window.localStorage.setItem(e,t)})})),db=t((()=>{}));function fb(e){return e.split(/[\\/]/).filter(Boolean).pop()||e}function pb({currentPath:e,recentPaths:t,onSelectWorkspace:n,placement:r=`above`}){let i=(0,mb.useId)(),[a,o]=(0,mb.useState)(!1),[s,c]=(0,mb.useState)(``),[l,u]=(0,mb.useState)(null),[d,f]=(0,mb.useState)(``),p=(0,mb.useSyncExternalStore)(ob,lb.getSnapshot,()=>cb),m=(0,mb.useRef)(null),h=(0,mb.useRef)(null),g=(0,mb.useRef)(null),_=(0,mb.useRef)(null),v=(0,mb.useRef)(null),y=(0,mb.useRef)(null),b=(0,mb.useMemo)(()=>{let n=s.trim().toLocaleLowerCase();return en(t,e,[],p).filter(e=>!n||e.toLocaleLowerCase().includes(n)||fb(e).toLocaleLowerCase().includes(n))},[s,t,e,p]);(0,mb.useLayoutEffect)(()=>{if(!a||!l)return;let e=()=>{let e=_.current,t=y.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=document.documentElement.clientWidth,a=Math.max(8,Math.min(n.right-r.width,i-r.width-8)),o=n.bottom+r.height+4<=window.innerHeight?n.bottom+4:Math.max(8,n.top-r.height-4);t.style.left=`${a}px`,t.style.top=`${o}px`};return e(),v.current?.focus(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[a,l]),(0,mb.useEffect)(()=>{if(!a)return;g.current?.focus();let e=()=>{let e=m.current;if(!e)return;let t=Math.min(360,document.documentElement.clientWidth-32),n=e.getBoundingClientRect().left,r=Math.max(16,Math.min(n,document.documentElement.clientWidth-t-16));e.style.setProperty(`--workspace-menu-width`,`${t}px`),e.style.setProperty(`--workspace-menu-offset`,`${r-n}px`)};e();let t=e=>{y.current?.contains(e.target)||(_.current?.contains(e.target)||u(null),m.current?.contains(e.target)||o(!1))},n=e=>{e.key!==`Escape`||e.defaultPrevented||(e.preventDefault(),o(!1),h.current?.focus())};return document.addEventListener(`mousedown`,t),window.addEventListener(`keydown`,n),window.addEventListener(`resize`,e),()=>{document.removeEventListener(`mousedown`,t),window.removeEventListener(`keydown`,n),window.removeEventListener(`resize`,e)}},[a]);let x=e=>{o(!1),c(``),h.current?.focus(),n(e)};return(0,gb.jsxs)(`div`,{className:`workspace-selector ${e?`has-workspace`:`needs-workspace`} opens-${r}`,ref:m,children:[(0,gb.jsxs)(`button`,{ref:h,type:`button`,className:`workspace-select-btn ${e?`has-workspace`:`needs-workspace`}`,onClick:()=>{c(``),u(null),f(``),o(e=>!e)},"aria-label":`${e?`Change`:`Choose`} workspace: ${e?fb(e):`Select Project`}`,"aria-haspopup":`dialog`,"aria-expanded":a,"aria-controls":i,title:e||`Choose a workspace folder`,children:[(0,gb.jsx)(`span`,{className:`workspace-select-icon`,"aria-hidden":`true`,children:(0,gb.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,gb.jsx)(`path`,{d:`M3 6h7l2 2h9v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z`})})}),(0,gb.jsx)(`span`,{className:`workspace-select-copy`,children:(0,gb.jsx)(`span`,{className:`workspace-select-name`,children:e?fb(e):`Select Project`})}),(0,gb.jsx)(`svg`,{className:`workspace-select-chevron`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,gb.jsx)(`path`,{d:`m6 9 6 6 6-6`})})]}),a&&(0,gb.jsxs)(`div`,{className:`workspace-select-menu`,id:i,role:`dialog`,"aria-label":`Choose workspace`,children:[(0,gb.jsxs)(`label`,{className:`workspace-select-search`,children:[(0,gb.jsxs)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,children:[(0,gb.jsx)(`circle`,{cx:`11`,cy:`11`,r:`7`}),(0,gb.jsx)(`path`,{d:`m20 20-4-4`})]}),(0,gb.jsx)(`input`,{ref:g,type:`search`,value:s,onChange:e=>{c(e.target.value),u(null)},placeholder:`Search workspaces`,"aria-label":`Search workspaces`})]}),(0,gb.jsx)(`div`,{className:`workspace-select-list`,role:`group`,"aria-label":`Recent workspaces`,children:b.length>0?b.map(t=>{let n=t===$t(e);return(0,gb.jsxs)(`div`,{className:`workspace-select-row`,children:[(0,gb.jsxs)(`button`,{type:`button`,className:`workspace-select-option`,onClick:()=>x(t),"aria-current":n?`true`:void 0,title:t,children:[(0,gb.jsx)(`svg`,{className:`workspace-select-option-icon`,width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,gb.jsx)(`path`,{d:`M3 6h7l2 2h9v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z`})}),(0,gb.jsxs)(`span`,{className:`workspace-select-option-copy`,children:[(0,gb.jsx)(`span`,{className:`workspace-select-option-name`,children:fb(t)}),(0,gb.jsx)(`span`,{className:`workspace-select-option-path`,children:t})]}),n&&(0,gb.jsx)(`svg`,{className:`workspace-select-current`,width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,gb.jsx)(`path`,{d:`m5 12 4 4L19 6`})})]}),(0,gb.jsx)(`button`,{type:`button`,className:`workspace-select-more`,"aria-label":`Workspace actions: ${fb(t)}`,title:`Workspace actions`,"aria-haspopup":`menu`,"aria-expanded":l===t,onClick:e=>{_.current=e.currentTarget,u(e=>e===t?null:t)},onKeyDown:e=>{e.key===`ArrowDown`&&(e.preventDefault(),_.current=e.currentTarget,u(t))},children:(0,gb.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:[(0,gb.jsx)(`circle`,{cx:`5`,cy:`12`,r:`1.8`}),(0,gb.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.8`}),(0,gb.jsx)(`circle`,{cx:`19`,cy:`12`,r:`1.8`})]})})]},t)}):(0,gb.jsx)(`div`,{className:`workspace-select-empty`,children:s.trim()?`No matching workspaces`:`No recent workspaces yet`})}),d&&(0,gb.jsx)(`p`,{className:`workspace-select-notice`,role:`status`,children:d}),(0,gb.jsx)(`div`,{className:`workspace-select-menu-footer`,children:(0,gb.jsxs)(`button`,{type:`button`,className:`workspace-select-open-folder`,onClick:()=>x(),children:[(0,gb.jsxs)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,gb.jsx)(`path`,{d:`M3 6h7l2 2h9v12H3z`}),(0,gb.jsx)(`path`,{d:`M12 10v6m-3-3h6`})]}),(0,gb.jsx)(`span`,{children:`Open folder…`})]})})]}),a&&l&&b.includes(l)&&(0,hb.createPortal)((0,gb.jsx)(`div`,{ref:y,className:`workspace-select-row-menu`,role:`menu`,"aria-label":`Workspace actions: ${fb(l)}`,onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),u(null),_.current?.focus()),(e.key===`ArrowDown`||e.key===`ArrowUp`)&&e.preventDefault()},children:(0,gb.jsxs)(`button`,{ref:v,type:`button`,role:`menuitem`,className:`workspace-select-remove`,onClick:()=>{lb.remove(l),u(null),f(`Removed from list. Use Open folder… to add it again.`),g.current?.focus()},children:[(0,gb.jsx)(`span`,{children:`Remove from list`}),(0,gb.jsx)(`small`,{children:`Does not delete files or folders.`})]})}),document.body)]})}var mb,hb,gb,_b=t((()=>{mb=e(i()),hb=Ne(),tn(),ub(),db(),gb=a()}));function vb(e){return Ob.test(e.trim())}function yb(e,t){let n=e.replace(/\\/g,`/`).trim();if(!n)return``;if(n.startsWith(`@`))return n;if(t){let e=t.replace(/\\/g,`/`).replace(/\/+$/,``);if(n===e||n.startsWith(`${e}/`)){let t=n.slice(e.length+1);if(t)return`@${t}`}}return`@${n.startsWith(`/`)?n.slice(1):n}`}function bb(e,t){let n=yb(t.path,t.root);if(n){if(e.setData(Eb,n),e.setData(`text/plain`,n),(vb(t.path)||t.url?.startsWith(`data:image/`)||t.url?.startsWith(`blob:`))&&t.kind!==`directory`){let n=t.path.split(/[\\/]/).pop()||t.path;try{e.setData(Db,JSON.stringify({path:t.path,root:t.root||``,url:t.url||``,name:n}))}catch{}}if(t.kind!==`directory`&&t.path){let r=t.root?$t(t.root):``,i=n.startsWith(`@`)?n.slice(1):t.path;try{e.setData(Tb,JSON.stringify({root:r,path:i,kind:`file`}))}catch{}}e.effectAllowed=`copy`}}async function xb(e,t,n){let r=e.trim();if(!r)return``;if(r.startsWith(`data:image/`))return r;if(r.startsWith(`blob:`)||r.startsWith(`http://`)||r.startsWith(`https://`)||r.startsWith(`/api/`)||r.startsWith(`/`)&&Ob.test(r))try{let e=await fetch(r);if(e.ok){let t=await e.blob();return await new Promise((e,n)=>{let r=new FileReader;r.onload=()=>e(r.result),r.onerror=n,r.readAsDataURL(t)})}}catch{}if(n)try{let e=await n(r,t||``);if(e&&e.startsWith(`data:image/`))return e}catch{}return``}function Sb(e){let t;try{t=JSON.parse(e)}catch{throw Error(`Drag a file from Workspace to preview it.`)}if(!t||t.kind!==`file`||typeof t.root!=`string`||typeof t.path!=`string`)throw Error(`Drag a file from Workspace to preview it.`);let n=$t(t.root),r=t.path.replace(/\\/g,`/`);if(!n||!/^(\/|[a-z]:\/)/i.test(n)||/\0/.test(n+r)||!r||/^(\/|[a-z]:)/i.test(r)||r.split(`/`).includes(`..`))throw Error(`This file is outside its source workspace.`);let i=r.split(`/`).filter(e=>e&&e!==`.`).join(`/`);if(!i)throw Error(`Choose a file to preview.`);return{root:n,path:i,kind:`file`}}function Cb(e,t){let n=Sb(JSON.stringify({root:e,path:t,kind:`file`}));return`preview:${JSON.stringify([n.root,n.path])}`}function wb(e,t){let n=Sb(JSON.stringify({root:e,path:t,kind:`file`})),r=`${n.root.replace(/\/$/,``)}/${n.path}`,i=r.split(`/`).map(e=>encodeURIComponent(e)).join(`/`);return/^[a-z]:\//i.test(r)?`file:///${r.slice(0,2)}${i.slice(i.indexOf(`/`))}`:`${r.startsWith(`//`)?`file:`:`file://`}${i}`}var Tb,Eb,Db,Ob,kb=t((()=>{tn(),Tb=`application/x-mint-workspace-file`,Eb=`application/x-mint-workspace-path`,Db=`application/x-mint-workspace-image`,Ob=/\.(png|jpe?g|gif|webp|ico|svg|bmp|avif)$/i}));function Ab(e){let t=e.toLowerCase();return t.endsWith(`.html`)||t.endsWith(`.htm`)?`html`:/\.(png|jpe?g|gif|webp|ico)$/.test(t)?`image`:t.endsWith(`.svg`)?`svg`:t.endsWith(`.md`)||t.endsWith(`.markdown`)?`markdown`:t.endsWith(`.pdf`)?`pdf`:/\.(mp3|wav|ogg|oga|opus|flac|m4a|aac|weba)$/.test(t)?`audio`:/\.(mp4|m4v|webm|ogv|mov)$/.test(t)?`video`:`code`}function jb(e){let t=e.split(`.`).pop()?.toLowerCase()||``;return{js:`javascript`,jsx:`javascript`,ts:`typescript`,tsx:`typescript`,html:`html`,htm:`html`,css:`css`,json:`json`,rs:`rust`,py:`python`,svg:`xml`,md:`markdown`}[t]||t||`plaintext`}var Mb=t((()=>{}));function Nb(e){window.dispatchEvent(new CustomEvent(Lb,{detail:e}))}function Pb(e,t=0,n){let[r,i]=(0,Fb.useState)([]),[a,o]=(0,Fb.useState)(!1),s=(0,Fb.useRef)(e),[c,l]=(0,Fb.useState)(!1),[u,d]=(0,Fb.useState)(``),f=(0,Fb.useRef)(e);f.current=e;let p=(0,Fb.useRef)(n);return p.current=n,(0,Fb.useEffect)(()=>{let t=!0,n=0;s.current!==e&&(s.current=e,i([]),d(``),l(!1));let r=async()=>{let r=++n;if(!e.trim())o(!1);else{o(!0);try{let a=await x.listWorkspaceHistory(e);t&&r===n&&i(a)}catch(e){t&&r===n&&d(e instanceof Error?e.message:String(e))}finally{t&&r===n&&o(!1)}}},a=t=>{let n=t.detail;n?.path===e&&(p.current?.(n),r())};return r(),window.addEventListener(`focus`,r),window.addEventListener(Lb,a),()=>{t=!1,window.removeEventListener(`focus`,r),window.removeEventListener(Lb,a)}},[e,t]),{entries:r,busy:c,loading:a,error:u,undo:(0,Fb.useCallback)(async n=>{if(!r.length||Ib.has(e))return!1;if(n&&r[0].id!==n)return d(`Workspace history changed; review the latest action before undoing`),!1;Ib.add(e),l(!0),d(``);try{Nb(await x.undoWorkspaceAction(e,t,n||r[0].id));let a=await x.listWorkspaceHistory(e);return f.current===e&&i(a),!0}catch(t){return f.current===e&&d(t instanceof Error?t.message:String(t)),!1}finally{Ib.delete(e),f.current===e&&l(!1)}},[r,e,t])}}var Fb,Ib,Lb,Rb=t((()=>{Fb=e(i()),ke(),Ib=new Set,Lb=`mint:workspace-history-changed`}));function zb({className:e=``,width:t=14,height:n=14}){return(0,z.jsxs)(`svg`,{className:e,width:t,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,z.jsx)(`line`,{x1:`6`,y1:`3`,x2:`6`,y2:`15`}),(0,z.jsx)(`circle`,{cx:`18`,cy:`6`,r:`3`}),(0,z.jsx)(`circle`,{cx:`6`,cy:`18`,r:`3`}),(0,z.jsx)(`path`,{d:`M18 9a9 9 0 0 1-9 9`})]})}function Bb({className:e=``,width:t=14,height:n=14}){return(0,z.jsxs)(`svg`,{className:e,width:t,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,z.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,z.jsx)(`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`}),(0,z.jsx)(`path`,{d:`M2 12h20`})]})}function Vb({className:e=``,width:t=14,height:n=14}){return(0,z.jsxs)(`svg`,{className:e,width:t,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,z.jsx)(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),(0,z.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})]})}function Hb({className:e=``,width:t=14,height:n=14}){return(0,z.jsxs)(`svg`,{className:e,width:t,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,z.jsx)(`circle`,{cx:`5`,cy:`6`,r:`3`}),(0,z.jsx)(`circle`,{cx:`5`,cy:`18`,r:`3`}),(0,z.jsx)(`line`,{x1:`5`,y1:`9`,x2:`5`,y2:`15`}),(0,z.jsx)(`circle`,{cx:`19`,cy:`9`,r:`3`}),(0,z.jsx)(`path`,{d:`M5 9c0 4 4 6 8 6h3`})]})}function Ub({className:e=``,width:t=14,height:n=14}){return(0,z.jsx)(`svg`,{className:e,width:t,height:n,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,z.jsx)(`polyline`,{points:`15 18 9 12 15 6`})})}function Wb(e){return e instanceof Error?e.message:typeof e==`string`?e:`Git could not complete that action.`}function Gb({workspacePath:e,disabled:t=!1,onBranchChanged:n}){let[r,i]=(0,Kb.useState)(null),[a,o]=(0,Kb.useState)(!1),[s,c]=(0,Kb.useState)(``),[l,u]=(0,Kb.useState)(``),[d,f]=(0,Kb.useState)(``),[p,m]=(0,Kb.useState)(`branches`),[h,g]=(0,Kb.useState)(``),[_,v]=(0,Kb.useState)([]),[y,b]=(0,Kb.useState)(!1),[S,C]=(0,Kb.useState)(`up`),[w,T]=(0,Kb.useState)(`left`),[E,D]=(0,Kb.useState)(480),O=(0,Kb.useRef)(null),k=(0,Kb.useRef)(null),A=(0,Kb.useRef)(t),ee=(0,Kb.useCallback)(async()=>{if(!e.trim())i(null);else try{let t=await x.getGitBranchInfo(e);i(t),u(``)}catch(e){i(null),u(Wb(e))}},[e]);(0,Kb.useEffect)(()=>{let t=!1;if(!e.trim())i(null),o(!1);else return x.getGitBranchInfo(e).then(e=>{t||(i(e),u(``))}).catch(e=>{t||(i(null),u(Wb(e)))}),()=>{t=!0}},[e]),(0,Kb.useEffect)(()=>{if(!a)return;let e=e=>{O.current?.contains(e.target)||o(!1)},t=e=>{e.key===`Escape`&&(o(!1),k.current?.focus())};return document.addEventListener(`mousedown`,e),window.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),window.removeEventListener(`keydown`,t)}},[a]),(0,Kb.useEffect)(()=>{let e=()=>ee();return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[ee]),(0,Kb.useEffect)(()=>{t?o(!1):A.current&&ee(),A.current=t},[t,ee]);let te=(0,Kb.useMemo)(()=>{if(!r)return[];let e=s.trim().toLocaleLowerCase();return[...e?r.branches.filter(t=>t.toLocaleLowerCase().includes(e)):r.branches].sort((e,t)=>e===r.currentBranch?-1:t===r.currentBranch?1:e.localeCompare(t))},[r,s]),j=(0,Kb.useMemo)(()=>{if(!r)return[];let e=s.trim().toLocaleLowerCase();return r.remoteBranches.filter(t=>{let n=t.split(`/`).slice(1).join(`/`);return r.branches.includes(n)?!1:!e||t.toLocaleLowerCase().includes(e)})},[r,s]);if(!r?.isRepository)return l?(0,z.jsx)(`div`,{className:`git-branch-selector is-error`,children:(0,z.jsxs)(`button`,{type:`button`,className:`git-branch-trigger`,onClick:ee,title:`${l} Select to retry.`,"aria-label":`Git branch unavailable. Retry`,children:[(0,z.jsx)(zb,{className:`git-branch-icon`,width:14,height:14}),(0,z.jsx)(`span`,{className:`git-branch-name`,children:`Git unavailable`})]})}):null;let ne=r.currentBranch||(r.detachedHead?`Detached ${r.detachedHead}`:`No branch`),re=e=>{i(e),o(!1),c(``),m(`branches`)},M=async(e,t)=>{let r=await t(!1);if(r.status===`confirmation_required`){if(!window.confirm(`This workspace has uncommitted changes. ${e} Git will stop if the changes conflict.`))return;r=await t(!0)}if(r.status===`confirmation_required`)throw Error(`Workspace confirmation was not accepted.`);re(r.info),n?.()},ie=async t=>{if(t===r.currentBranch||d)o(!1);else try{u(``),f(t),await M(`Switch from ${ne} to ${t}?`,n=>x.switchGitBranch(e,t,n))}catch(e){u(Wb(e))}finally{f(``)}},N=async t=>{if(!d)try{u(``),f(t),await M(`Check out ${t}?`,n=>x.checkoutRemoteGitBranch(e,t,n))}catch(e){u(Wb(e))}finally{f(``)}},ae=async t=>{t.preventDefault();let n=h.trim();if(n&&!d)try{u(``),f(n),await M(`Create and switch to ${n}?`,t=>x.createGitBranch(e,n,t)),g(``)}catch(e){u(Wb(e))}finally{f(``)}},oe=async()=>{try{u(``),b(!0),v(await x.getGitGraph(e))}catch(e){v([]),u(Wb(e))}finally{b(!1)}},se=(e,t=320)=>{let n=k.current?.getBoundingClientRect();if(!n)return;let r=O.current?.closest(`.conversation-panel`)?.getBoundingClientRect(),i=Math.max(16,r?.left??16),a=Math.min(window.innerWidth-16,r?.right??window.innerWidth-16),o=Math.max(0,a-n.left),s=Math.max(0,n.right-i),c=Math.min(t,window.innerWidth-32);T(o>=c||o>=s?`left`:`right`);let l=Math.max(0,n.top-16),u=Math.max(0,window.innerHeight-n.bottom-16),d=l>=e||l>=u?`up`:`down`;C(d),D(Math.max(180,d===`up`?l:u))};return(0,z.jsxs)(`div`,{className:`git-branch-selector`,ref:O,children:[(0,z.jsxs)(`button`,{ref:k,type:`button`,className:`git-branch-trigger`,onClick:()=>{o(e=>(e||se(360),!e)),c(``),u(``),m(`branches`)},disabled:t||!!d,"aria-haspopup":`dialog`,"aria-expanded":a,"aria-controls":`workspace-branch-menu`,title:`${ne}${r.isDirty?` — uncommitted changes`:``}`,children:[(0,z.jsx)(zb,{className:`git-branch-icon`,width:14,height:14}),(0,z.jsx)(`span`,{className:`git-branch-name`,children:d||ne}),r.isDirty&&(0,z.jsx)(`span`,{className:`git-branch-dirty`,"aria-label":`Uncommitted changes`}),(0,z.jsx)(`svg`,{className:`git-branch-chevron`,width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,z.jsx)(`polyline`,{points:`6 9 12 15 18 9`})})]}),a&&(0,z.jsxs)(`div`,{className:`git-branch-menu ${p===`graph`?`is-graph`:``} ${S===`down`?`opens-down`:``} ${w===`right`?`align-right`:``}`,id:`workspace-branch-menu`,role:`dialog`,style:{maxHeight:`${E}px`},"aria-label":p===`graph`?`Git graph`:p===`create`?`Create branch`:`Choose branch`,children:[p===`branches`&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`label`,{className:`git-branch-search`,children:[(0,z.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,z.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,z.jsx)(`path`,{d:`m21 21-4.3-4.3`})]}),(0,z.jsx)(`input`,{autoFocus:!0,"aria-label":`Search branches`,value:s,onChange:e=>c(e.target.value),placeholder:`Search branches`})]}),(0,z.jsx)(`div`,{className:`git-branch-menu-heading`,children:`Local branches`}),(0,z.jsx)(`div`,{className:`git-branch-list`,role:`listbox`,"aria-label":`Local branches`,children:te.map(e=>{let t=e===r.currentBranch;return(0,z.jsxs)(`button`,{type:`button`,className:`git-branch-option`,role:`option`,"aria-selected":t,disabled:!!d,onClick:()=>ie(e),children:[(0,z.jsx)(`span`,{className:`git-branch-option-icon`,"aria-hidden":`true`,children:(0,z.jsx)(zb,{width:14,height:14})}),(0,z.jsx)(`span`,{children:e}),t&&(0,z.jsx)(`span`,{className:`git-branch-option-check`,"aria-hidden":`true`,children:(0,z.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,z.jsx)(`polyline`,{points:`20 6 9 17 4 12`})})})]},e)})}),j.length>0&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`git-branch-menu-heading`,children:`Remote branches`}),(0,z.jsx)(`div`,{className:`git-branch-list is-remote`,role:`listbox`,"aria-label":`Remote branches`,children:j.map(e=>(0,z.jsxs)(`button`,{type:`button`,className:`git-branch-option`,role:`option`,"aria-selected":`false`,disabled:!!d,onClick:()=>N(e),title:`Create a local tracking branch from ${e}`,children:[(0,z.jsx)(`span`,{className:`git-branch-option-icon`,"aria-hidden":`true`,children:(0,z.jsx)(Bb,{width:14,height:14})}),(0,z.jsx)(`span`,{children:e}),(0,z.jsx)(`span`,{className:`git-branch-track-label`,children:`Track`})]},e))})]}),te.length===0&&j.length===0&&(0,z.jsx)(`div`,{className:`git-branch-empty`,children:`No matching branches`}),(0,z.jsxs)(`div`,{className:`git-branch-actions`,children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>{m(`create`),u(``)},children:[(0,z.jsx)(Vb,{width:14,height:14}),(0,z.jsx)(`span`,{children:`Create branch`})]}),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>{se(420,window.innerWidth<=1100?320:540),m(`graph`),oe()},children:[(0,z.jsx)(Hb,{width:14,height:14}),(0,z.jsx)(`span`,{children:`Git graph`})]})]})]}),p===`create`&&(0,z.jsxs)(`form`,{className:`git-branch-create`,onSubmit:ae,children:[(0,z.jsxs)(`div`,{className:`git-branch-view-header`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:()=>{m(`branches`),u(``)},"aria-label":`Back to branches`,children:(0,z.jsx)(Ub,{width:14,height:14})}),(0,z.jsx)(`strong`,{children:`Create branch`})]}),(0,z.jsx)(`label`,{htmlFor:`new-git-branch-name`,children:`Branch name`}),(0,z.jsx)(`input`,{id:`new-git-branch-name`,autoFocus:!0,value:h,onChange:e=>g(e.target.value),placeholder:`feature/branch-name`,spellCheck:`false`,autoComplete:`off`}),(0,z.jsxs)(`p`,{children:[`Creates the branch from `,(0,z.jsx)(`strong`,{children:ne}),` and switches to it.`]}),(0,z.jsx)(`button`,{className:`git-branch-create-submit`,type:`submit`,disabled:!h.trim()||!!d,children:d?`Creating…`:`Create and switch`})]}),p===`graph`&&(0,z.jsxs)(`div`,{className:`git-graph-view`,children:[(0,z.jsxs)(`div`,{className:`git-branch-view-header`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:()=>{m(`branches`),u(``)},"aria-label":`Back to branches`,children:(0,z.jsx)(Ub,{width:14,height:14})}),(0,z.jsx)(`strong`,{children:`Git graph`}),(0,z.jsx)(`button`,{type:`button`,className:`git-graph-refresh`,onClick:oe,disabled:y,children:`Refresh`})]}),y?(0,z.jsx)(`div`,{className:`git-graph-state`,children:`Reading repository history…`}):l?null:_.length>0?(0,z.jsx)(`pre`,{className:`git-graph-output`,tabIndex:0,children:_.join(`
|
|
39
|
+
`)}):(0,z.jsx)(`div`,{className:`git-graph-state`,children:`No commits yet`})]}),l&&(0,z.jsxs)(`div`,{className:`git-branch-error`,role:`alert`,children:[(0,z.jsx)(`span`,{children:l}),p===`graph`&&(0,z.jsx)(`button`,{type:`button`,onClick:oe,children:`Retry`})]})]})]})}var Kb,z,qb=t((()=>{Kb=e(i()),ke(),z=a()})),Jb=t((()=>{}));async function Yb(e,t,n){let r=Ab(t);if(r===`pdf`||r===`audio`||r===`video`){if(!n.readWorkspaceMedia)throw Error(`Direct media reading is unavailable`);return{path:t,workspacePath:e,type:r,...await n.readWorkspaceMedia(t,e)}}if(r===`image`||r===`svg`){if(!n.readWorkspaceImage)throw Error(`Direct image reading is unavailable`);return{path:t,workspacePath:e,type:r,url:await n.readWorkspaceImage(t,e)}}let i=t.replace(/\\/g,`/`).split(`/`).pop()||``,a=/\.(txt|log|csv|tsv|jsonl?|ya?ml|toml|ini|conf|cfg|env|lock|js|jsx|mjs|cjs|ts|tsx|css|scss|sass|less|xml|sql|rs|py|pyi|sh|bash|zsh|fish|ps1|bat|cmd|go|java|kt|kts|c|h|cpp|hpp|cc|cs|rb|php|swift|dart|vue|svelte|lua|r|ex|exs|erl|hs|clj|proto|graphql|gql|gitignore|gitattributes|editorconfig)$/i.test(i)||/^(Dockerfile|Containerfile|Makefile|Gemfile|Procfile|LICENSE|NOTICE|README|\.env(?:\..*)?)$/i.test(i);if(r===`code`&&!a)return{path:t,workspacePath:e,type:`file`};if(r===`markdown`||r===`code`)return{path:t,workspacePath:e,type:r,content:await n.readWorkspaceFile(t,e)};let{url:o}=await n.startHtmlPreview(e,t);return{path:t,workspacePath:e,type:r,url:o}}function Xb(e){let t=new Map;return async(n,r)=>{let i=Sb(JSON.stringify({root:n,path:r,kind:`file`})),a=Cb(i.root,i.path);if(e.selectIfOpen(a))return;let o=t.get(a);if(o){await o,e.selectIfOpen(a);return}let s=Yb(i.root,i.path,e).then(e.open);t.set(a,s);try{await s}finally{t.delete(a)}}}var Zb=t((()=>{Mb(),kb()})),Qb=t((()=>{}));function $b(e){let t=e.trim();if(t.startsWith(`<think>`)||t.includes(`</think>`))return!0;let n=t.split(`
|
|
40
|
+
`).length,r=t.length;if(t.includes(`
|
|
41
|
+
|
|
42
|
+
`)||n>2||r>180)return!0;let i=t.toLowerCase();return!!(i.startsWith(`the user `)||i.startsWith(`let's think`)||i.startsWith(`let me analyze`)||i.startsWith(`per rule`)||i.startsWith(`note the `)||i.includes(`thinking process:`))}function ex(e){return e.filter(e=>e.type===`Thought`).map(e=>e.data.thought).filter(e=>!!e&&!$b(e))}function tx(e){let t=[];for(let n of e)n.type===`ThinkingDelta`?n.data.delta?.trim()&&t.push(n.data.delta):n.type===`ExtendedThinking`?n.data.thought?.trim()&&t.push(n.data.thought):n.type===`Thought`&&n.data.thought&&$b(n.data.thought)&&t.push(n.data.thought);return t}function nx(e,t=20){if(e.length===0)return e;let n=new Set(e.filter(e=>e.type!==`Thought`&&e.type!==`ThinkingDelta`&&e.type!==`ExtendedThinking`).slice(-t));return e.filter(e=>e.type===`ToolStart`||e.type===`ToolEnd`||e.type===`ToolArtifacts`||e.type===`DeviceState`||e.type===`ToolDiscovery`||e.type===`ExecutionUpdate`||e.type===`RunCompleted`||e.type===`PlanUpdated`||e.type===`SubagentStarted`||e.type===`SubagentFinished`||e.type===`ContextCompaction`||e.type===`Thought`||e.type===`ThinkingDelta`||e.type===`ExtendedThinking`||n.has(e))}function rx(e,t){if(t.type===`DeviceState`&&t.data.update.state!==`accepted`){let n=e.findIndex(e=>e.type===`DeviceState`&&e.data.callId===t.data.callId&&e.data.update.state!==`accepted`);if(n>=0){let r=e.slice();return r[n]=t,r}}if(t.type===`ToolDiscovery`){let n=e.findIndex(e=>e.type===`ToolDiscovery`&&e.data.server===t.data.server&&e.data.tool===t.data.tool);if(n>=0){let r=e.slice();return r[n]=t,r}}if(t.type===`ToolProgress`){let n=e.findIndex(e=>e.type===`ToolProgress`&&e.data.callId===t.data.callId);if(n>=0){let r=e.slice();return r[n]=t,r}}if(t.type===`PlanUpdated`){let n=e.findIndex(e=>e.type===`PlanUpdated`);if(n>=0){let r=e.slice();return r[n]=t,r}}if(t.type===`ThinkingDelta`){let n=e.findIndex(e=>e.type===`ThinkingDelta`&&e.data.id===t.data.id);if(n<0)return nx([...e,t]);let r=e.slice(),i=r[n];return r[n]={type:`ThinkingDelta`,data:{id:t.data.id,delta:`${i.data.delta}${t.data.delta}`,elapsed_ms:t.data.elapsed_ms}},r}if(t.type===`ExtendedThinking`&&t.data.id){let n=e.findIndex(e=>e.type===`ThinkingDelta`&&e.data.id===t.data.id);if(n>=0){let r=e.slice();return r[n]=t,nx(r)}}return nx([...e,t])}function ix(e,t){return t.reduce(rx,e)}function ax(e){let t=new Set(e.filter(e=>e.type===`ExtendedThinking`).map(e=>e.data.id).filter(e=>!!e)),n=[],r=new Map,i=new Map;for(let t of e)t.type===`ToolProgress`&&i.set(t.data.callId,t),t.type===`DeviceState`&&t.data.update.state!==`accepted`&&i.set(`device:${t.data.callId}`,t),t.type===`PlanUpdated`&&i.set(`plan:active`,t);for(let a of e)if((a.type!==`ToolProgress`||i.get(a.data.callId)===a)&&(a.type!==`DeviceState`||a.data.update.state===`accepted`||i.get(`device:${a.data.callId}`)===a)&&(a.type!==`PlanUpdated`||i.get(`plan:active`)===a)){if(a.type===`ThinkingDelta`){if(!t.has(a.data.id)){let e=r.get(a.data.id);r.set(a.data.id,e?{type:`ThinkingDelta`,data:{id:a.data.id,delta:`${e.data.delta}${a.data.delta}`,elapsed_ms:a.data.elapsed_ms}}:a)}}else n.push(a)}for(let e of r.values())n.push({type:`ExtendedThinking`,data:{id:e.data.id,thought:e.data.delta,elapsed_ms:e.data.elapsed_ms}});return n}function ox(e){return e.some(e=>e.type===`ToolStart`||e.type===`ToolEnd`||e.type===`ToolArtifacts`||e.type===`DeviceState`||e.type===`ToolDiscovery`||e.type===`PlanUpdated`||e.type===`SubagentStarted`||e.type===`SubagentFinished`||e.type===`RunCompleted`||e.type===`ContextCompaction`)}function sx(e,t){let n={...e};for(let e of t){let t=String(e.id);e.agentActivity?.length&&!n[t]&&(n[t]=e.agentActivity)}return n}function cx(e){let t=fx.get(e);if(t?.length===e.length)return t.changes;let n=lx(e);return fx.set(e,{length:e.length,changes:n}),n}function lx(e){let t=new Map,n=null,r=(e,n,r,i,a)=>{let o=t.get(e);o?(o.additions+=r,o.deletions+=i,o.hunks.push(...a),n&&(o.created=!0)):t.set(e,{path:e,created:n,additions:r,deletions:i,hunks:[...a]})};for(let t of e||[])if(t.type===`ToolStart`){if(t.data.action===`apply_patch`){let e=t.data.input?.patch;if(e&&typeof e.path==`string`){let t=0,r=0,i=[],a=e.hunks,o=!1;if(Array.isArray(a)){o=a.length>0&&a.every(e=>!e?.oldText&&!!e?.newText);for(let e of a){let n=e?.oldText||``,a=e?.newText||``,o=n?n.split(`
|
|
43
|
+
`).length:0,s=a?a.split(`
|
|
44
|
+
`).length:0;r+=o,t+=s,i.push({oldText:n,newText:a})}}n={action:`apply_patch`,path:e.path,created:o&&r===0,additions:t,deletions:r,hunks:i}}}else if(t.data.action===`write_file`||t.data.action===`note_write`){let e=t.data.input||{},r=e.path||e.Path||e.name||e.title||e.filePath||``;t.data.action===`note_write`&&r&&!r.includes(`/`)&&!r.startsWith(`.config/`)&&(r=`.config/mint/notes/${r}`);let i=e.fileContent??e.file_content??e.Content??e.content??e.body??e.text??``;if(typeof r==`string`&&r.trim()){let e=i?i.split(`
|
|
45
|
+
`).length:0;n={action:t.data.action,path:r.trim(),created:!0,additions:e,deletions:0,hunks:[{oldText:``,newText:i}]}}}else if(t.data.action===`edit_file`){let e=t.data.input||{},r=e.Path||e.path||e.filePath||``,i=e.Target??e.target??``,a=e.Replacement??e.replacement??``;if(typeof r==`string`&&r.trim()){let e=i?i.split(`
|
|
46
|
+
`).length:0,t=a?a.split(`
|
|
47
|
+
`).length:0;n={action:`edit_file`,path:r.trim(),created:!1,additions:t,deletions:e,hunks:[{oldText:i,newText:a}]}}}else n=null}else if(t.type===`ToolEnd`){if(n&&(t.data.action===`apply_patch`||t.data.action===`write_file`||t.data.action===`note_write`||t.data.action===`edit_file`)&&(typeof t.data.result!=`string`||!t.data.result.startsWith(`Error:`)&&!t.data.result.startsWith(`Failed:`))){let e=typeof t.data.result==`string`&&t.data.result.match(/\+(\d+)\/-(\d+) lines/);if(e){let t=parseInt(e[1],10),r=parseInt(e[2],10);!isNaN(t)&&!isNaN(r)&&(n.additions=t,n.deletions=r)}try{let e=JSON.parse(t.data.result);if(Array.isArray(e)&&e.length>0)for(let t of e)r(t?.path||n.path,typeof t?.created==`boolean`?t.created:n.created,n.additions,n.deletions,n.hunks);else r(n.path,n.created,n.additions,n.deletions,n.hunks)}catch{r(n.path,n.created,n.additions,n.deletions,n.hunks)}}n=null}return Array.from(t.values())}function ux(e){let t=new Map;for(let n of e)for(let e of n){let n=t.get(e.path);n?(n.created=n.created||e.created,n.additions+=e.additions,n.deletions+=e.deletions,n.hunks.push(...e.hunks)):t.set(e.path,{path:e.path,created:e.created,additions:e.additions,deletions:e.deletions,hunks:[...e.hunks]})}return Array.from(t.values())}var dx,fx,px=t((()=>{dx=[],fx=new WeakMap})),mx,hx=t((()=>{mx=class{transport;changed;failed;samples;generation=0;owner=null;context=null;source=null;gain=null;timer;frame=0;settle=null;renewing=!1;localVolume=1;hostVolume=1;speaking=!1;constructor(e,t,n,r){this.transport=e,this.changed=t,this.failed=n,this.samples=r}unlock(){try{this.context??=new AudioContext;let e=this.context;return new Promise((t,n)=>{let r=setTimeout(()=>n(Error(`Use the Read button to allow audio playback.`)),1500);e.resume().then(()=>{clearTimeout(r),t()},e=>{clearTimeout(r),n(e)})})}catch(e){return Promise.reject(e)}}volume(e){this.localVolume=Math.min(1,Math.max(0,e)),this.gain&&(this.gain.gain.value=this.localVolume*this.hostVolume)}stop(){this.generation+=1;let e=this.owner;this.owner=null,clearInterval(this.timer),this.timer=void 0,cancelAnimationFrame(this.frame);let t=this.speaking;this.speaking=!1;try{this.source?.stop()}catch{}return this.source?.disconnect(),this.source=null,this.gain?.disconnect(),this.gain=null,this.settle?.(),this.settle=null,t&&typeof speechSynthesis<`u`&&speechSynthesis.cancel(),this.samples?.(null),this.changed(`idle`),e?this.transport({operation:`release`,owner:e}).then(()=>{},()=>{}):Promise.resolve()}async dispose(){let e=this.context;this.context=null,await this.stop(),await e?.close()}async renew(e){let t=await this.transport({operation:`renew`,owner:e});return t.kind===`lease`&&t.active}async play(e){let t=this.stop(),n=this.generation,r=crypto.randomUUID();this.owner=r,this.changed(`preparing`);let i=this.unlock().then(()=>null,e=>e);try{await t;let a=await i;if(a)throw a;if(n!==this.generation)return;let o;for(let t=0;t<40;t++){if(n!==this.generation)return;try{o=await this.transport({operation:`prepare`,owner:r,...e});break}catch(n){if(!e.automatic||!/Another Mint surface/.test(String(n))||t===39)throw n;await new Promise(e=>setTimeout(e,300))}}if(n!==this.generation)return;if(!o||o.kind!==`prepared`)throw Error(`Mint returned no speech plan`);if(this.hostVolume=o.volume,this.timer=setInterval(()=>{this.renewing||(this.renewing=!0,this.renew(r).then(e=>{!e&&this.owner===r&&this.stop()}).catch(()=>{this.owner===r&&this.stop()}).finally(()=>{this.renewing=!1}))},1e3),o.provider===`native`){if(e.audioOnly)throw Error(`This voice cannot stream audio to Companion`);await this.playNative(o,n)}else for(let e=0;e<o.chunks&&n===this.generation;e++){let t=await this.transport({operation:`audio`,owner:r,index:e});if(n!==this.generation)return;if(t.kind!==`audio`)throw Error(`Mint returned no speech audio`);let i=Uint8Array.from(atob(t.data),e=>e.charCodeAt(0)),a=await this.context.decodeAudioData(i.buffer);if(n!==this.generation)return;await this.playBuffer(a,o,r,n)}}catch(t){let r=t instanceof Error?t.message:String(t);n===this.generation&&!(e.automatic&&/already been read automatically|Another Mint surface|A newer message|Automatic replies are routed/.test(r))&&this.failed(r)}finally{n===this.generation?await this.stop():await this.transport({operation:`release`,owner:r}).catch(()=>{})}}async playBuffer(e,t,n,r){let i=this.context,a=i.createGain();this.gain=a,a.gain.value=t.volume*this.localVolume;let o=i.createAnalyser();o.fftSize=256,a.connect(o),o.connect(i.destination);let s=new Float32Array(o.fftSize),c=0,l=()=>{r===this.generation&&(o.getFloatTimeDomainData(s),this.samples?.(s),c=requestAnimationFrame(l),this.frame=c)};this.changed(`speaking`),this.speaking=!0,l();try{let o=0;for(;o<e.duration&&r===this.generation;){if(!await this.renew(n)||r!==this.generation)return;let s=Math.min(4*t.speed,e.duration-o);await new Promise(n=>{let r=i.createBufferSource();this.source=r,r.buffer=e,r.playbackRate.value=t.speed,r.connect(a),this.settle=n,r.onended=()=>{r.disconnect(),this.source===r&&(this.source=null,this.settle=null),n()},r.start(0,o,s)}),o+=s}}finally{cancelAnimationFrame(c),r===this.generation&&this.samples?.(null),o.disconnect(),a.disconnect(),this.gain===a&&(this.gain=null)}}async playNative(e,t){if(typeof speechSynthesis>`u`)throw Error(`System speech is unavailable`);this.changed(`speaking`),this.speaking=!0,await new Promise((n,r)=>{let i=new SpeechSynthesisUtterance(e.text);i.lang=/[\u0e00-\u0e7f]/.test(e.text)?`th-TH`:`en-US`,i.volume=e.volume*this.localVolume,i.rate=e.speed,i.pitch=e.pitch;let a=speechSynthesis.getVoices().find(e=>e.lang.toLowerCase().startsWith(i.lang.slice(0,2)));a&&(i.voice=a),this.settle=n,i.onend=()=>{this.settle===n&&(this.settle=null),n()},i.onerror=e=>{this.settle===n&&(this.settle=null),t===this.generation?r(Error(e.error)):n()},speechSynthesis.speak(i)})}}})),gx=t((()=>{}));function _x({artifact:e,chatId:t}){let[n,r]=(0,vx.useState)(``),[i,a]=(0,vx.useState)(``),o=(0,vx.useRef)(null);return(0,vx.useEffect)(()=>{if(e.kind===`link`)return;let n=!0,i=``;return j.readMcpArtifact(e.id,t).then(e=>{n?(i=e,r(e)):e.startsWith(`blob:`)&&URL.revokeObjectURL(e)}).catch(()=>{n&&a(`Attachment unavailable`)}),()=>{n=!1,i.startsWith(`blob:`)&&URL.revokeObjectURL(i)}},[e.id,e.kind,t]),e.kind===`link`?/^https?:\/\//i.test(e.uri||``)?(0,yx.jsx)(`a`,{href:e.uri,target:`_blank`,rel:`noreferrer`,children:e.name}):(0,yx.jsxs)(`span`,{children:[e.name,`: `,e.uri]}):(0,yx.jsxs)(`div`,{className:`mcp-artifact`,children:[e.kind===`image`&&n&&(0,yx.jsxs)(yx.Fragment,{children:[(0,yx.jsx)(`button`,{type:`button`,className:`mcp-image-button`,onClick:()=>o.current?.showModal(),"aria-label":`View ${e.name}`,children:(0,yx.jsx)(`img`,{src:n,alt:e.name,onError:()=>a(`Image unavailable`)})}),(0,yx.jsxs)(`dialog`,{ref:o,className:`mcp-image-dialog`,"aria-label":e.name,onClose:()=>o.current?.close(),onClick:e=>{e.target===e.currentTarget&&o.current?.close()},children:[(0,yx.jsxs)(`header`,{children:[(0,yx.jsx)(`span`,{title:e.name,children:e.name}),(0,yx.jsx)(`button`,{type:`button`,"aria-label":`Close`,onClick:()=>o.current?.close(),children:(0,yx.jsx)(c,{size:18})})]}),(0,yx.jsx)(`img`,{src:n,alt:e.name})]})]}),n?(0,yx.jsxs)(`a`,{href:n,download:e.name,children:[e.name,` · `,(e.size/1024).toFixed(1),` KB`]}):(0,yx.jsxs)(`span`,{children:[e.name,` · `,i||`Loading attachment…`]}),e.metadata?.url&&(0,yx.jsx)(`span`,{title:e.metadata.url,children:e.metadata.url}),!!e.metadata?.width&&!!e.metadata?.height&&(0,yx.jsxs)(`span`,{children:[e.metadata.width,` × `,e.metadata.height]}),e.metadata?.capturedAt&&(0,yx.jsx)(`time`,{dateTime:e.metadata.capturedAt,children:e.metadata.capturedAt}),i&&n&&(0,yx.jsx)(`span`,{role:`status`,children:i})]})}var vx,yx,bx,xx=t((()=>{vx=e(i()),A(),ke(),gx(),yx=a(),bx=(0,vx.memo)(function({progress:e,running:t=!1,interrupted:n=!1,chatId:r,mode:i=`full`}){let[,a]=(0,vx.useState)(0),o=(0,vx.useRef)(new Map),{calls:s,discovery:c,artifacts:l,warnings:u}=(0,vx.useMemo)(()=>{let t=new Map,n=new Map,r=new Map,i=new Set;for(let a of e)if(a.type===`ToolStart`&&a.data.action===`mcp_tool`&&a.data.callId){let e=a.data.callId;o.current.has(e)||o.current.set(e,Date.now()),t.set(e,{label:`${a.data.input.server}/${a.data.input.tool}`})}else if(a.type===`ToolDiscovery`)n.set(`${a.data.server}/${a.data.tool}`,a.data.message);else if(a.type===`DeviceState`){let{callId:e,server:n,tool:r,update:i}=a.data;t.set(e,{...t.get(e),label:`${n}/${r}`,device:i})}else if(a.type===`ToolProgress`){let{callId:e,server:n,tool:r,update:i}=a.data;t.set(e,{...t.get(e),label:`${n}/${r}`,update:i})}else if(a.type===`ToolEnd`&&a.data.callId&&a.data.action===`mcp_tool`){let e=t.get(a.data.callId);t.set(a.data.callId,{label:e?.label||`${a.data.input.server}/${a.data.input.tool}`,...e,status:a.data.status||(/^(Error:|Blocked|User denied)/.test(a.data.result)?`failed`:`success`)})}else if(a.type===`ToolArtifacts`){for(let e of a.data.artifacts)r.set(e.id,e);for(let e of a.data.warnings)i.add(e)}return{calls:t,discovery:n,artifacts:r,warnings:i}},[e]),d=(0,vx.useMemo)(()=>[...l.values()].filter(e=>e.server!==`view_image`),[l]),f=t&&[...s.values()].some(e=>!e.status);(0,vx.useEffect)(()=>{if(!f)return;let e=setInterval(()=>a(e=>e+1),1e3);return()=>clearInterval(e)},[f]);let p=!s.size&&!d.length&&!c.size&&u.size>0;if(i===`artifacts-only`){if(!d.length&&!u.size)return null;let e=!d.length&&u.size>0;return(0,yx.jsxs)(`section`,{className:`mcp-results${e?` mcp-results-compact`:``}`,"aria-label":`MCP results`,children:[d.length>0&&(0,yx.jsx)(`div`,{className:`mcp-artifacts`,children:d.map(e=>(0,yx.jsx)(_x,{artifact:e,chatId:r},e.id))}),[...u].map(e=>(0,yx.jsxs)(`div`,{className:`mcp-warning-banner`,role:`status`,children:[(0,yx.jsx)(fe,{size:14,className:`mcp-warning-icon`,"aria-hidden":`true`}),(0,yx.jsx)(`span`,{className:`mcp-warning-text`,children:e})]},e))]})}return!s.size&&!d.length&&!u.size&&!c.size?null:(0,yx.jsxs)(`section`,{className:`mcp-results${p?` mcp-results-compact`:``}`,"aria-label":`MCP results`,children:[[...c].map(([e,t])=>(0,yx.jsxs)(`div`,{className:`mcp-call-status`,role:`status`,children:[(0,yx.jsx)(`strong`,{children:e}),(0,yx.jsx)(`span`,{children:t})]},e)),[...s].map(([e,r])=>{let i=t&&!r.status,a=Math.max(r.update?.elapsedSecs||0,Math.floor((Date.now()-(o.current.get(e)||Date.now()))/1e3)),s=r.update?.total?Math.min(100,Math.round(r.update.progress/r.update.total*100)):void 0,c=r.device&&(i&&!n||[`verified`,`failed`,`unconfirmed`].includes(r.device.state))?{accepted:`Command accepted; awaiting device confirmation`,running:`Awaiting device completion`,verified:`Device completion verified`,failed:`Device reported failure`,unconfirmed:`Device completion unconfirmed`}[r.device.state]:void 0,l=r.status===`cancelled`||!r.status&&n?`Stopped waiting; remote work may still be running.`:r.status===`timed_out`?`Timed out; remote completion is unconfirmed.`:r.status===`skipped`?`Skipped`:r.status===`failed`?`Failed`:r.status===`success`?`Completed`:i?`Working · ${a}s`:`Interrupted; result unconfirmed`;return(0,yx.jsxs)(`div`,{className:`mcp-call-status`,role:`status`,children:[(0,yx.jsx)(`strong`,{children:r.label}),(0,yx.jsx)(`span`,{children:c||l}),r.device&&(0,yx.jsxs)(yx.Fragment,{children:[(0,yx.jsx)(`span`,{children:r.device.message}),(0,yx.jsxs)(`span`,{children:[`Target: `,JSON.stringify(r.device.target),` · Actual: `,JSON.stringify(r.device.actual)]})]}),i&&r.update?.message&&(0,yx.jsx)(`span`,{children:r.update.message}),i&&s!==void 0&&(0,yx.jsxs)(`progress`,{max:100,value:s,"aria-label":`${r.label} progress`,children:[s,`%`]})]},e)}),d.length>0&&(0,yx.jsx)(`div`,{className:`mcp-artifacts`,children:d.map(e=>(0,yx.jsx)(_x,{artifact:e,chatId:r},e.id))}),[...u].map(e=>(0,yx.jsxs)(`div`,{className:`mcp-warning-banner`,role:`status`,children:[(0,yx.jsx)(fe,{size:14,className:`mcp-warning-icon`,"aria-hidden":`true`}),(0,yx.jsx)(`span`,{className:`mcp-warning-text`,children:e})]},e))]})})}));function Sx(e){let t=e.trim().split(`
|
|
48
|
+
`,1)[0].trim();return/^data:image\/(?:png|jpeg|gif|webp|svg\+xml);base64,[A-Za-z0-9+/]+={0,2}$/.test(t)?t:null}function Cx(e){let t=new Map,n=new Map,r=new Map,i=[];e.forEach(e=>{if(e.type===`ToolArtifacts`)for(let t of e.data.artifacts)t.kind===`image`&&(r.set(t.id,t),e.data.callId&&n.set(e.data.callId,t),t.callId&&n.set(t.callId,t),t.server===`view_image`&&i.push(t))});let a=0,o=new Set,s=new Set;e.forEach(e=>{if(e.type!==`ToolEnd`||e.data.action!==`view_image`||e.data.status&&e.data.status!==`success`)return;let i=e.data.callId,c=typeof e.data.input.path==`string`?e.data.input.path:``,l=c.replaceAll(`\\`,`/`).split(`/`).at(-1)||`Image`,u=i||`view-image-${a++}`,d=Sx(e.data.result);if(d){i&&o.add(i),t.set(u,{id:u,src:d,path:c,name:l});return}let f=i?n.get(i):void 0;if(!f){let t=e.data.result.match(/artifactId:\s*([a-f0-9-]+)/i);t&&(f=r.get(t[1]))}f&&(i&&o.add(i),s.add(f.id),t.set(u,{id:u,artifactId:f.id,path:c||f.name,name:f.name||l}))});for(let e of i){if(s.has(e.id)||e.callId&&o.has(e.callId))continue;let n=e.callId||e.id;t.set(n,{id:n,artifactId:e.id,path:e.name,name:e.name||`Image`})}return[...t.values()]}var wx=t((()=>{})),Tx=t((()=>{}));function Ex({image:e,chatId:t,variant:n=`card`,onOpenArtifact:r}){let[i,a]=(0,Dx.useState)(e.src||``),[o,s]=(0,Dx.useState)(!1),[l,u]=(0,Dx.useState)(!1),d=(0,Dx.useRef)(null);(0,Dx.useEffect)(()=>{if(e.src)a(e.src),s(!1);else if(e.artifactId){let n=!0,r=``;return j.readMcpArtifact(e.artifactId,t).then(e=>{n?(r=e,a(e),s(!1)):e.startsWith(`blob:`)&&URL.revokeObjectURL(e)}).catch(()=>{n&&s(!0)}),()=>{n=!1,r.startsWith(`blob:`)&&URL.revokeObjectURL(r)}}},[e.src,e.artifactId,t]),(0,Dx.useEffect)(()=>{l&&d.current?.showModal()},[l]);let f=()=>{r&&i?r({path:e.path||e.name,url:i,type:`image`}):u(!0)};return n===`inline`?(0,Ox.jsxs)(`figure`,{className:`viewed-image-inline`,"data-activity-image":e.id,children:[o||!i?(0,Ox.jsx)(`p`,{className:`viewed-image-inline-status`,role:`status`,children:o?`Image preview unavailable`:`Loading image…`}):(0,Ox.jsxs)(`button`,{type:`button`,className:`viewed-image-inline-btn`,"aria-label":`Expand ${e.name}`,title:r?`Open full image in Tools Surface`:`Expand ${e.name}`,onClick:f,draggable:!0,onDragStart:t=>{bb(t.dataTransfer,{path:e.path||e.name,url:i})},children:[(0,Ox.jsx)(`img`,{src:i,alt:`Viewed image: ${e.name}`,loading:`lazy`,onError:()=>s(!0),draggable:!0,onDragStart:t=>{bb(t.dataTransfer,{path:e.path||e.name,url:i})}}),(0,Ox.jsx)(`span`,{className:`viewed-image-inline-overlay`,children:(0,Ox.jsx)(`span`,{className:`viewed-image-inline-badge`,children:r?`Open in Tools`:`Click to zoom`})})]}),(0,Ox.jsxs)(`dialog`,{ref:d,className:`viewed-image-dialog`,"aria-label":`Image preview: ${e.name}`,onClose:()=>u(!1),onClick:e=>{e.target===e.currentTarget&&d.current?.close()},children:[(0,Ox.jsxs)(`header`,{children:[(0,Ox.jsx)(`span`,{title:e.path,children:e.name}),(0,Ox.jsx)(`button`,{type:`button`,"aria-label":`Close image preview`,onClick:()=>d.current?.close(),children:(0,Ox.jsx)(c,{size:18})})]}),l&&i&&(0,Ox.jsx)(`img`,{src:i,alt:e.name})]})]}):(0,Ox.jsxs)(`figure`,{className:`viewed-image`,"data-viewed-image":e.id,children:[o||!i?(0,Ox.jsx)(`p`,{className:`viewed-image-error`,role:`status`,children:o?`Image preview unavailable`:`Loading image…`}):(0,Ox.jsx)(`button`,{type:`button`,className:`viewed-image-button`,"aria-label":`Expand ${e.name}`,title:r?`Open full image in Tools Surface`:`Expand ${e.name}`,onClick:f,draggable:!0,onDragStart:t=>{bb(t.dataTransfer,{path:e.path||e.name,url:i})},children:(0,Ox.jsx)(`img`,{src:i,alt:`Viewed image: ${e.name}`,loading:`lazy`,onError:()=>s(!0),draggable:!0,onDragStart:t=>{bb(t.dataTransfer,{path:e.path||e.name,url:i})}})}),(0,Ox.jsx)(`figcaption`,{title:e.path,children:e.name}),(0,Ox.jsxs)(`dialog`,{ref:d,className:`viewed-image-dialog`,"aria-label":`Image preview: ${e.name}`,onClose:()=>u(!1),onClick:e=>{e.target===e.currentTarget&&d.current?.close()},children:[(0,Ox.jsxs)(`header`,{children:[(0,Ox.jsx)(`span`,{title:e.path,children:e.name}),(0,Ox.jsx)(`button`,{type:`button`,"aria-label":`Close image preview`,onClick:()=>d.current?.close(),children:(0,Ox.jsx)(c,{size:18})})]}),l&&i&&(0,Ox.jsx)(`img`,{src:i,alt:e.name})]})]})}var Dx,Ox,kx,Ax=t((()=>{Dx=e(i()),A(),wx(),kb(),ke(),Tx(),Ox=a(),kx=(0,Dx.memo)(function({progress:e,chatId:t,onOpenArtifact:n}){let r=(0,Dx.useMemo)(()=>Cx(e),[e]);return r.length?(0,Ox.jsx)(`section`,{className:`viewed-images`,"aria-label":`Images viewed by Mint`,children:r.map(e=>(0,Ox.jsx)(Ex,{image:e,chatId:t,onOpenArtifact:n},e.id))}):null})}));function jx(e,t,n,r){let i=r.replace(/\r\n?/g,`
|
|
49
|
+
`);return{value:e.slice(0,t)+i+e.slice(n),text:i,caret:t+i.length,collapsed:i.replace(/\n$/,``).split(`
|
|
50
|
+
`).length>6}}function Mx(e){return`[Pasted Content ${Array.from(e).length} chars]`}var Nx=t((()=>{})),Px=t((()=>{}));function Fx({value:e,inputRef:t,onValueChange:n,onResizeInput:r,...i}){let[a,o]=(0,Ix.useState)(null),[s,c]=(0,Ix.useState)(!1),l=(0,Ix.useRef)(null),u=a!==null&&a.value===e&&!s;(0,Ix.useEffect)(()=>{a&&a.value!==e&&(o(null),c(!1)),u&&l.current?.focus()},[e,a,u]);let d=()=>{c(!0),setTimeout(()=>{let e=t.current;e&&(e.focus(),e.setSelectionRange(0,0),r?.(e))},0)};return(0,Lx.jsxs)(Lx.Fragment,{children:[u&&(0,Lx.jsxs)(`button`,{type:`button`,ref:l,className:`chat-pasted-content`,"aria-label":`${Mx(a.text)} — view or edit full prompt`,onClick:d,onKeyDown:e=>{e.key===`F2`&&(e.preventDefault(),d()),e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},children:[(0,Lx.jsx)(`span`,{children:Mx(a.text)}),(0,Lx.jsx)(`span`,{className:`chat-pasted-content-action`,children:`View / edit`})]}),(0,Lx.jsx)(`textarea`,{...i,ref:t,value:e,hidden:u,style:{...i.style,display:u?`none`:i.style?.display},"aria-keyshortcuts":a?`F2`:i[`aria-keyshortcuts`],title:a?`F2: open/collapse pasted content`:i.title,onKeyDown:t=>{t.key===`F2`&&a&&a.value===e&&!t.nativeEvent.isComposing?(t.preventDefault(),t.stopPropagation(),o({value:e,text:e}),c(!1)):i.onKeyDown?.(t)},onChange:e=>{a&&o({value:e.target.value,text:e.target.value}),i.onChange?.(e)},onPaste:t=>{if(i.onPaste?.(t),t.defaultPrevented)return;let s=t.clipboardData.getData(`text/plain`);if(!s)return;t.preventDefault(),t.stopPropagation();let l=t.currentTarget,u=jx(e,l.selectionStart,l.selectionEnd,s);o(u.collapsed?{value:u.value,text:u.text}:a?{value:u.value,text:u.value}:null),c(!u.collapsed&&a!==null),n(u.value),u.collapsed||setTimeout(()=>{l.setSelectionRange(u.caret,u.caret),r?.(l)},0)}})]})}var Ix,Lx,Rx=t((()=>{Ix=e(i()),Nx(),Px(),Lx=a()}));function zx({elapsedSeconds:e}){let[t,n]=(0,Bx.useState)(0);return(0,Bx.useEffect)(()=>{let e=Date.now(),t=setInterval(()=>n(Math.floor((Date.now()-e)/1e3)),250);return()=>clearInterval(t)},[]),(0,Vx.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:`context-compaction-status`,children:[(0,Vx.jsxs)(`div`,{className:`thinking-status`,children:[(0,Vx.jsxs)(`span`,{className:`thinking-status-label`,children:[(0,Vx.jsx)(`span`,{"aria-hidden":`true`,children:`✦ `}),`Compacting context`]}),(0,Vx.jsx)(`span`,{className:`thinking-status-meta`,children:` · ${e??t}s · Esc to cancel`})]}),(0,Vx.jsx)(`div`,{className:`thinking-status-meta`,children:`Summarizing earlier steps to continue working`})]})}var Bx,Vx,Hx=t((()=>{Bx=e(i()),Vx=a()}));function Ux(e){let t=new Map,n=0;for(let r=0;r<e.length;r++){let i=e[r];if(i.type!==`ContextCompaction`)continue;let a=i.data.subagent??``;if(i.data.status===`started`)t.size===0&&(n=r),t.set(a,{count:(t.get(a)?.count??0)+1,data:i.data});else{let e=t.get(a);e&&e.count>1?e.count--:t.delete(a)}}let r=t.values().next().value;return r?{...r.data,index:n}:null}var Wx=t((()=>{}));function Gx(e,t,n){return!t||n==null?e:e.filter(e=>e.id!==n)}var Kx=t((()=>{}));function qx(e){if(typeof e!=`string`)return!1;let t=e.trim().toLowerCase();return t===`null`||t===`undefined`||t===`none`||t===`nil`||t===`(null)`||t===`""`||t===`''`}function B(e,t){if(!e||typeof e!=`object`)return``;let n=e[t];if(typeof n==`string`){let e=n.trim();return qx(e)?``:e}return``}function Jx(e){return!e||e===`.`||e===`./`||e===`list files`?`workspace`:e.replace(/^\/home\/([^/]+)/,`~`)||`workspace`}function Yx(e,t){return[`search_code`,`semantic_search`,`knowledge_search`,`web_search`,`image_search`,`memory_recall`,`find_definition`,`find_references`].includes(e)?`search`:[`run_shell`,`verify`,`run_tests`,`run_typecheck`,`run_linter`].includes(e)?`terminal`:[`list_files`,`list_directory`,`list_dir`,`detect_project`].includes(e)?`folder`:[`read_file`,`symbols`,`read_diagnostics`,`git_diff`,`apply_patch`,`write_file`,`edit_file`,`apply_code_edits`,`note_write`,`view_image`].includes(e)?`file`:[`calculation`,`calculator`].includes(e)?`calc`:t.includes(`/`)&&!/\.[^/]+$/.test(t)?`folder`:`tool`}function Xx(e,t){let n=B(t,`path`),r=B(t,`query`)||B(t,`q`)||B(t,`keyword`)||B(t,`search`)||B(t,`prompt`)||B(t,`searchTerm`)||B(t,`search_term`),i=B(t,`command`)||B(t,`cmd`)||B(t,`script`)||B(t,`exec`)||B(t,`code`)||B(t,`bash`)||B(t,`sh`);if(!i&&t&&typeof t==`object`){if(typeof t.arguments==`object`&&t.arguments!==null){let e=t.arguments;i=B(e,`command`)||B(e,`cmd`)||B(e,`script`)||B(e,`exec`)||B(e,`code`)||B(e,`bash`)||B(e,`sh`)}else if(typeof t.arguments==`string`)try{let e=JSON.parse(t.arguments);e&&typeof e==`object`&&(i=B(e,`command`)||B(e,`cmd`)||B(e,`script`)||B(e,`exec`)||B(e,`code`)||B(e,`bash`)||B(e,`sh`))}catch{}}if(!i&&typeof t==`string`){let e=t.trim();e&&!e.startsWith(`{`)&&!qx(e)&&(i=e)}let a=B(t,`name`),o=B(t,`tool`),s=B(t,`server`),c=B(t,`symbol`)||B(t,`ticker`),l=B(t,`filter`),u=B(t,`expression`)||B(t,`expr`)||B(t,`math`),d=B(t,`city`)||B(t,`location`)||B(t,`place`),f=B(t,`url`),p=B(t,`selector`),m=``;switch(e){case`run_shell`:m=i||`(empty command)`;break;case`web_search`:case`search_code`:case`knowledge_search`:m=r||`(empty query)`;break;case`read_file`:case`write_file`:case`view_image`:m=n||`(empty path)`;break;case`find_definition`:case`find_references`:m=c||`(empty symbol)`;break;case`run_tests`:m=l||`(all tests)`;break;case`run_typecheck`:case`run_linter`:m=n||`workspace`;break;case`calculation`:case`calculator`:m=u||`(math expression)`;break;case`weather`:m=d||`(location)`;break;case`stock`:m=r||c||`(symbol)`;break;case`mcp_tool`:m=o?s?`${s}/${o}`:o:a||`mcp tool`;break;case`note_write`:m=a||n||`(note)`;break;case`exit_plan_mode`:m=`plan approval`;break;case`list_files`:case`list_directory`:case`list_dir`:{let e=n||B(t,`directory`)||B(t,`dir`)||B(t,`folder`)||B(t,`target`);m=!e||e===`.`||e===`./`||e===`list files`?`workspace`:Jx(e);break}case`create_plan`:case`update_plan`:{let e=B(t,`summary`)||B(t,`title`),n=Array.isArray(t.steps)?t.steps.length:0,r=n>0?`${n} step${n===1?``:`s`}`:``;m=e&&r?`${e} (${r})`:e||r||`task plan`;break}default:m=n||r||i||u||c||d||f||p||l||a||o||e.replaceAll(`_`,` `)}let h=m,g;if(e===`read_file`&&n){let e=typeof t.startLine==`number`?t.startLine:typeof t.start_line==`number`?t.start_line:typeof t.StartLine==`number`?t.StartLine:void 0,n=typeof t.endLine==`number`?t.endLine:typeof t.end_line==`number`?t.end_line:typeof t.EndLine==`number`?t.EndLine:void 0;e!==void 0&&n!==void 0?(g=`#L${e}-${n}`,h=`${m} ${g}`):e!==void 0&&(g=`#L${e}`,h=`${m} ${g}`)}let _;if(e===`edit_file`){let e=typeof t.Target==`string`?t.Target:typeof t.target==`string`?t.target:``,n=typeof t.Replacement==`string`?t.Replacement:typeof t.replacement==`string`?t.replacement:``,r=e?e.split(`
|
|
51
|
+
`).length:0;_={additions:n?n.split(`
|
|
52
|
+
`).length:0,deletions:r}}else if(e===`write_file`||e===`note_write`){let e=t.fileContent??t.file_content??t.Content??t.content??t.text??t.body,n=typeof e==`string`?e:``;_={additions:n?n.split(`
|
|
53
|
+
`).length:0,deletions:0}}let v;(e===`run_shell`||e===`run_command`||e===`bash`)&&(v=B(t,`toolSummary`)||B(t,`summary`)||B(t,`description`));let y=`Executed`,b;if(e===`read_file`)y=`Analyzed`;else if(e===`list_files`||e===`list_directory`||e===`list_dir`)y=`Explored`;else if(e===`edit_file`||e===`apply_patch`||e===`apply_code_edits`)y=`Edited`;else if(e===`write_file`||e===`note_write`)y=`Edited`;else if(e===`run_shell`||e===`run_command`||e===`bash`)y=`Ran`;else if(e?.includes(`search`))y=`Searched`;else if(e===`calculation`||e===`calculator`)y=`Calculated`;else if(e===`view_image`)y=`Viewed`;else if(e===`create_plan`||e===`update_plan`)y=`Planned`;else if(e===`ask_user`){y=`Asked`;let e=[],n=t?.questions;Array.isArray(n)&&n.length>0?e=n.map(e=>typeof e==`string`?{question:e.trim()}:{question:String(e.question||e.query||e.title||``).trim(),answer:typeof e.answer==`string`?e.answer.trim():void 0}).filter(e=>e.question.length>0):r&&(e=[{question:r}]),e.length>0&&(b={header:(typeof t?.header==`string`?t.header.trim():void 0)||void 0,questions:e})}return{label:e===`read_file`&&B(t,`skill_name`)?`Reading skill: ${B(t,`skill_name`)}`:e,target:Jx(h),kind:Yx(e,h),state:`active`,action:e,semanticVerb:y,intentTitle:v,lineRange:g,diffStats:_,askUserData:b}}function Zx(e){if(e==null||e<=0)return``;let t=Math.round(e);if(t<60)return`${t}s`;let n=Math.floor(t/60),r=t%60;return r===0?`${n}m`:`${n}m ${r}s`}function Qx(e,t,n){if(!n||!n.trim()||e===`run_shell`||e===`run_command`||e===`bash`)return!1;let r=(t||``).toLowerCase();return!!(r.endsWith(`.md`)||r.endsWith(`.markdown`)||r.endsWith(`.txt`)||r.includes(`skill`)||n.startsWith(`[Loaded skill:`)||e===`note_read`||e===`web_search`||/^#{1,6}\s+/m.test(n)&&(n.includes(`
|
|
54
|
+
|
|
55
|
+
`)||n.includes(`
|
|
56
|
+
- `)))}function $x(e){let t=e.trim();t=t.replace(/^\[Loaded skill:\s*([^\]]+)\][\s\n]*/i,`**Skill: $1**
|
|
57
|
+
|
|
58
|
+
`);let n=t.match(/^(\*\*Skill:[^\n]+\*\*[\s\n]*)?---\s*\n([\s\S]*?)\n---\s*\n/);if(n){let e=n[1]?n[1].trim()+`
|
|
59
|
+
|
|
60
|
+
`:``,r=n[2].match(/description:\s*([^\n]+(?:\n\s+[^\n]+)*)/),i=r?r[1].replace(/\n\s+/g,` `).trim():``,a=t.slice(n[0].length);t=i?`${e}> ${i}\n\n${a}`:`${e}${a}`}return t}function eS(e){if(e==null||isNaN(e))return``;if(e<0)return`0 B`;if(e<1024)return`${e} B`;let t=e/1024;if(t<1024)return`${Number(t.toFixed(1))} KB`;let n=t/1024;if(n<1024)return`${Number(n.toFixed(1))} MB`;let r=n/1024;return`${Number(r.toFixed(1))} GB`}function tS(e){if(!e||typeof e!=`string`)return null;let t=e.trim();if(!t.startsWith(`[`)&&t.includes(`stdout:`)){let e=t.match(/stdout:\s*\n([\s\S]*?)(?:\n\s*stderr:|$)/);e&&e[1]&&(t=e[1].trim())}if(!t.startsWith(`[`)||!t.endsWith(`]`))return null;let n;try{n=JSON.parse(t)}catch{return null}if(!Array.isArray(n))return null;if(n.length===0)return[];if(!n.every(e=>e&&typeof e==`object`&&(typeof e.name==`string`||typeof e.path==`string`)&&(`kind`in e||`size`in e)))return null;let r=n,i=[],a=[],o=[];for(let e of r){let t=(e.kind||``).toLowerCase();t===`directory`||t===`dir`||t===`folder`?i.push(e):t===`file`?a.push(e):o.push(e)}let s=e=>{if(e.name)return e.name;if(e.path){let t=e.path.split(/[/\\]/);return t[t.length-1]||e.path}return``};return i.sort((e,t)=>s(e).localeCompare(s(t),void 0,{sensitivity:`base`})),a.sort((e,t)=>s(e).localeCompare(s(t),void 0,{sensitivity:`base`})),o.sort((e,t)=>s(e).localeCompare(s(t),void 0,{sensitivity:`base`})),[...i,...o,...a]}function nS(e){let t=tS(e);if(!t)return null;if(t.length===0)return`(empty directory)`;let n=e=>{if(e.name)return e.name;if(e.path){let t=e.path.split(/[/\\]/);return t[t.length-1]||e.path}return``},r=[];for(let e of t){let t=(e.kind||``).toLowerCase(),i=n(e);if(t===`directory`||t===`dir`||t===`folder`){let e=i.endsWith(`/`)?i:`${i}/`;r.push(`📁 ${e}`)}else if(t===`symlink`){let t=eS(e.size),n=t?` (${t})`:``;r.push(`🔗 ${i}${n}`)}else{let t=eS(e.size),n=t?` (${t})`:``;r.push(`📄 ${i}${n}`)}}return r.join(`
|
|
61
|
+
`)}function rS(e){if(!e||typeof e!=`string`)return null;let t=e.trim(),n=tS(t);if(n){if(n.length===0)return`empty folder`;let e=0,t=0,r=0;for(let i of n){let n=String(i.kind||``).toLowerCase();n===`directory`||n===`dir`||n===`folder`?e++:n===`file`?t++:r++}let i=e+t+r;if(i===0)return`empty folder`;if(e>0&&t>0){let n=`${i} items (${`${e} folder${e===1?``:`s`}`}, ${`${t} file${t===1?``:`s`}`})`;return n.length<=35?n:`${i} items`}return e>0&&t===0?`${e} folder${e===1?``:`s`}`:t>0&&e===0?`${t} file${t===1?``:`s`}`:`${i} items`}if(!t.startsWith(`[`)&&(t.includes(`📁 `)||t.includes(`📄 `)||t.includes(`🔗 `))){let e=t.split(`
|
|
62
|
+
`).map(e=>e.trim()).filter(Boolean),n=e.filter(e=>e.startsWith(`📁`)).length,r=e.filter(e=>e.startsWith(`📄`)||e.startsWith(`🔗`)).length,i=n+r;if(i===0)return`empty folder`;if(n>0&&r>0){let e=`${i} items (${n} folders, ${r} files)`;return e.length<=35?e:`${i} items`}return n>0?`${n} folder${n===1?``:`s`}`:r>0?`${r} file${r===1?``:`s`}`:`${i} items`}return null}function iS(e){if(!e||typeof e!=`string`)return``;let t=e.trim();if(!t)return``;let n=nS(t);if(n)return n;let r=e.split(`
|
|
63
|
+
`);if(r.some(e=>{let t=e.trim();return t.startsWith(`mode: `)||t.startsWith(`sandboxed: `)||t.startsWith(`exit: `)&&r.some(e=>e.trim()===`stdout:`)})){let e=`meta`,t=[],n=[];for(let i of r){let r=i.trim();e===`meta`&&(r.startsWith(`exit: `)||r.startsWith(`mode: `)||r.startsWith(`sandboxed: `))||(r===`stdout:`?e=`stdout`:r===`stderr:`?e=`stderr`:e===`stdout`?t.push(i):e===`stderr`?n.push(i):t.push(i))}let i=t.join(`
|
|
64
|
+
`).trim(),a=n.join(`
|
|
65
|
+
`).trim();return i&&a?`${nS(i)||i}\n\n[stderr]\n${a}`:a||(i?nS(i)||i:`(no output)`)}let i=t.replace(/\n\s*stderr:\s*$/i,``).trim();return nS(i)||i}function aS(e,t){if(!e||e.length===0)return t&&t.some(e=>e.kind===`extendedThinking`||e.kind===`thought`)?`Thinking`:`Working`;let n=!1,r=!1,i=!1,a=!1,o=!1,s=!!(t&&t.some(e=>e.kind===`extendedThinking`));for(let t of e)t.action===`read_file`?n=!0:t.action===`write_file`||t.action===`edit_file`||t.action===`apply_patch`?r=!0:t.action===`run_shell`||t.action===`run_command`||t.action===`bash`?i=!0:t.action?.includes(`search`)?a=!0:(t.action===`list_files`||t.action===`list_directory`||t.action===`list_dir`||t.kind===`folder`)&&(o=!0);let c=[];return o&&!n&&c.push(`Explored workspace`),n&&c.push(`Explored files`),i&&c.push(`ran commands`),r&&c.push(`edited files`),a&&!n&&!o&&c.push(`searched codebase`),c.length===0?s?`Analyzed task`:`Working through task`:c.join(`, `)}function oS(e){let t=new Set,n=new Set;for(let r of e)r.kind===`file`&&t.add(r.target),r.kind===`folder`&&n.add(r.target);let r=[t.size?`${t.size} ${t.size===1?`file`:`files`}`:``,n.size?`${n.size} ${n.size===1?`folder`:`folders`}`:``].filter(Boolean);return r.length?`Exploring ${r.join(`, `)}`:`Working through task`}function sS(e){if(e.length===0)return[];let t=[],n=null;for(let r=0;r<e.length;r++){let i=e[r],a=i.action||i.label;!n||n.action!==a?(n&&t.push(cS(n)),n={id:`group-${r}-${a}`,action:a,label:i.label,kind:i.kind,title:i.target,count:1,state:i.state,items:[i]}):(n.items.push(i),n.count+=1,i.state===`active`?n.state=`active`:i.state===`error`&&n.state!==`retry`&&n.state!==`done`?n.state=`error`:i.state===`retry`&&n.state!==`done`&&(n.state=`retry`))}return n&&t.push(cS(n)),t}function cS(e){let t=e.items.length;if(t===1)return e.title=e.items[0].target,e.state=e.items[0].state,e.semanticVerb=e.items[0].semanticVerb,e;let n=e.items.some(e=>e.state===`active`),r=e.items.some(e=>e.state===`done`),i=e.items.some(e=>e.state===`error`),a=e.items.some(e=>e.state===`retry`);e.state=n?`active`:r?`done`:a?`retry`:i?`error`:`done`;let o=e.action,s=e.items.filter(e=>e.state===`done`).length;return o===`calculation`||o===`calculator`?(e.semanticVerb=`Calculated`,e.title=`${t} expressions`):o===`read_file`?(e.semanticVerb=`Analyzed`,e.title=e.state===`active`?`reading files (${s}/${t})`:`${t} files`):o===`write_file`||o===`edit_file`||o===`apply_patch`?(e.semanticVerb=`Edited`,e.title=e.state===`active`?`writing files (${s}/${t})`:`${t} files`):o===`run_shell`||o===`run_command`||o===`bash`?(e.semanticVerb=`Ran`,e.title=`${t} commands`):o===`list_files`||o===`list_directory`||o===`list_dir`?(e.semanticVerb=`Explored`,e.title=`${t} directories`):o===`search_code`||o===`semantic_search`||o===`web_search`?(e.semanticVerb=`Searched`,e.title=`${t} queries`):(e.semanticVerb=`Executed`,e.title=`${t} ${o.replaceAll(`_`,` `)}`),e}function lS(e){let t=vS.get(e);if(t?.length===e.length)return t.view;let n=uS(e);return vS.set(e,{length:e.length,view:n}),n}function uS(e){let t=[],n=[],r=null,i=0,a=()=>{if(!r)return;let e=cS(r);e.count>1?n.push({id:e.id,kind:`group`,group:e}):e.items.length===1&&n.push({id:e.id,kind:`activity`,activity:e.items[0]}),r=null};for(let o of e)if(o.type===`ToolStart`){if(o.data.subagent)continue;let e=Xx(o.data.action,o.data.input);if(e.callId=o.data.callId,t.push(e),o.data.action===`read_file`&&B(o.data.input,`skill_name`)){a(),n.push({id:`skill-${i++}`,kind:`activity`,activity:e});continue}let s=e.action||e.label;!r||r.action!==s?(a(),r={id:`timeline-group-${i++}-${s}`,action:s,label:e.label,kind:e.kind,title:e.target,count:1,state:e.state,items:[e]}):(r.items.push(e),r.count+=1,e.state===`active`&&(r.state=`active`))}else if(o.type===`ToolEnd`){if(o.data.subagent)continue;let e=Xx(o.data.action,o.data.input);for(let n=t.length-1;n>=0;--n){if(t[n].state!==`active`||o.data.callId&&t[n].callId!==o.data.callId||t[n].action!==e.action||o.data.input&&t[n].target!==e.target)continue;t[n].state=o.data.status?o.data.status===`success`?`done`:`error`:/^(Error:|Blocked|User denied)/.test(o.data.result)?`error`:`done`;let r=o.data.elapsed_ms??o.data.elapsedMs;typeof r==`number`&&(t[n].elapsedMs=r);let i=typeof o.data.result==`string`&&o.data.result.match(/\+(\d+)\/-(\d+) lines/);if(i){let e=parseInt(i[1],10),r=parseInt(i[2],10);!isNaN(e)&&!isNaN(r)&&(t[n].diffStats={additions:e,deletions:r})}let a=o.data.action===`view_image`?Sx(o.data.result):null;if(t[n].result=a?o.data.result.replace(a,`[Image displayed below]`):o.data.result,o.data.action===`read_file`){let e=o.data.result.match(/^\[Loaded skill: ([^\n]+)\]\n/);e?t[n].label=`Loaded skill: ${e[1]}`:t[n].label.startsWith(`Reading skill:`)&&(t[n].label=t[n].state===`error`?t[n].label.replace(`Reading skill:`,`Failed to read skill:`):t[n].label.replace(`Reading skill:`,`Read skill preview:`))}if(t[n].action===`ask_user`){let e;if(typeof o.data.result==`string`&&(o.data.result.startsWith(`User answered:`)?(e=o.data.result.replace(/^User answered:\s*/,``).trim(),t[n].target=`(Answered: "${e}") ${t[n].target}`):o.data.result.startsWith(`User approved`)?e=`Approved`:o.data.result.startsWith(`User declined`)&&(e=`Declined`)),e){if(!t[n].askUserData){let r=t[n].target.replace(/^\(Answered:\s*".*?"\)\s*/s,``).trim();t[n].askUserData={questions:[{question:r,answer:e}]}}else if(t[n].askUserData.questions.length>0){let r=!1;if(e.startsWith(`[`)&&e.endsWith(`]`))try{let i=JSON.parse(e);Array.isArray(i)&&i.length===t[n].askUserData.questions.length&&(i.forEach((e,r)=>{t[n].askUserData.questions[r].answer=typeof e==`string`?e:JSON.stringify(e)}),r=!0)}catch{}r||(t[n].askUserData.questions[0].answer=e)}}}break}if(r){let e=r.items.some(e=>e.state===`active`),t=r.items.some(e=>e.state===`done`),n=r.items.some(e=>e.state===`error`),i=r.items.some(e=>e.state===`retry`);r.state=e?`active`:t?`done`:i?`retry`:n?`error`:`done`}}else if(o.type===`ContextCompaction`){if(o.data.subagent)continue;o.data.status!==`started`&&(a(),n.push({id:`context-${i++}`,kind:`thought`,thought:o.data.message}))}else if(o.type===`Thought`){let e=o.data?.thought?.trim();if(e){a();let t=$b(e)?`extendedThinking`:`thought`,r=n[n.length-1];r&&`thought`in r&&r.thought===e?r.kind===`extendedThinking`&&t===`thought`&&(n[n.length-1]={id:r.id,kind:t,thought:e}):(!r||r.kind!==t||`thought`in r&&r.thought!==e)&&n.push({id:`thought-${i++}`,kind:t,thought:e})}}else if(o.type===`ThinkingDelta`){let e=o.data?.delta;e&&(a(),n.push({id:o.data.id,kind:`extendedThinking`,thought:e,streaming:!0,elapsedMs:o.data.elapsed_ms}))}else if(o.type===`ExtendedThinking`){let e=o.data?.thought?.trim();if(e){a();let t=n[n.length-1];(!t||t.kind!==`extendedThinking`||`thought`in t&&t.thought!==e)&&n.push({id:o.data.id||`ext-thought-${i++}`,kind:`extendedThinking`,thought:e,streaming:!1,elapsedMs:o.data.elapsed_ms})}}a();let o=e.some(e=>e.type===`RunCompleted`&&(e.data?.summary?.outcome===`SUCCESS`||e.data?.summary?.outcome===`success`));for(let e=0;e<t.length;e++)t[e].state===`error`&&(t.slice(e+1).some(e=>e.state===`done`||e.state===`active`)||o)&&(t[e].state=`retry`);for(let e of n)if(e.kind===`group`){let t=e.group.items.some(e=>e.state===`active`),n=e.group.items.some(e=>e.state===`done`),r=e.group.items.some(e=>e.state===`error`),i=e.group.items.some(e=>e.state===`retry`);e.group.state=t?`active`:n?`done`:i?`retry`:r?`error`:`done`}let s=Cx(e);if(s.length>0){let e=new Map,n=new Map;for(let t of s)if(t.id&&e.set(t.id,t),t.path){let e=n.get(t.path)||[];e.push(t),n.set(t.path,e)}for(let r of t)if(r.action===`view_image`&&r.state===`done`){if(r.callId&&e.has(r.callId))r.viewedImage=e.get(r.callId);else if(n.has(r.target)){let e=n.get(r.target);e.length>0&&(r.viewedImage=e.shift())}}}let c;for(let t of e)t.type===`RunCompleted`&&typeof t.data?.summary?.durationSecs==`number`&&(c=t.data.summary.durationSecs);let l=aS(t,n),u=Zx(c),d=t.slice(-50);return{summary:oS(t),naturalSummary:l,durationText:u,items:d,groups:sS(d),timeline:n.slice(-80)}}function dS(e){let t=[];for(let n of e){if(n.type!==`ToolEnd`||n.data.action!==`web_search`)continue;let e=n.data.result;if(!e||e.startsWith(`Web search error:`)||e===`No web search results found.`)continue;let r=e.split(/\n\n+/);for(let e of r){let n=e.split(`
|
|
66
|
+
`).map(e=>e.trim()).filter(Boolean),r=n.find(e=>/^\d+\.\s/.test(e)),i=n.find(e=>e.startsWith(`URL:`)),a=n.find(e=>e.startsWith(`Image:`));if(!r||!i)continue;let o=r.replace(/^\d+\.\s/,``).trim(),s=i.replace(/^URL:\s*/,``).trim(),c=a?a.replace(/^Image:\s*/,``).trim():void 0,l=n.filter(e=>e!==r&&e!==i&&e!==a).join(` `).trim();try{let{hostname:e}=new URL(s),n=e.replace(/^www\./,``),r=`https://www.google.com/s2/favicons?sz=32&domain=${e}`;t.push({title:o,url:s,snippet:l,domain:n,faviconUrl:r,imageUrl:c})}catch{}}}return t}function fS(e){if(!e)return``;let t=e.trim();return t=t.replace(/^(สวัสดีค่ะ|สวัสดีครับ|หวัดดีค่ะ|หวัดดีครับ|สวัสดี|hello|hi|hey)\s*(พี่[^\s,]+|คุณ[^\s,]+|[^\s,]+)?\s*(🌿|🍃|✨|🌱)?\s*[,—–-]?\s*/i,``),t=t.replace(/^[\s•\-\*]+\s*/,``),t.trim()||e.trim()}function pS(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.type===`PlanUpdated`)return n.data.plan}}function mS(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.type===`RunCompleted`)return n.data.summary}}function hS(e){return e.some(e=>e.type===`SubagentStarted`||e.type===`SubagentFinished`||(e.type===`ToolStart`||e.type===`ToolEnd`)&&(e.data.subagent||e.data.action===`dispatch_agents`||e.data.action===`dispatch_subagent`))}function gS(e){return e.action===`ask_user`||e.label===`ask_user`||!!e.askUserData||e.target.startsWith(`(Answered:`)}function _S(e){if(e.askUserData?.questions&&e.askUserData.questions.length>0)return e.askUserData.questions;let t=e.target.match(/^\(Answered:\s*"(.*?)"\)\s*(.*)$/s);if(t)return[{question:t[2].trim(),answer:t[1].trim()}];let n;typeof e.result==`string`&&(e.result.startsWith(`User answered:`)?n=e.result.replace(/^User answered:\s*/,``).trim():e.result.startsWith(`User approved`)?n=`Approved`:e.result.startsWith(`User declined`)&&(n=`Declined`));let r=e.target.replace(/^\(Answered:\s*".*?"\)\s*/s,``).trim();return r?[{question:r,answer:n}]:[]}var vS,yS=t((()=>{px(),wx(),vS=new WeakMap}));function bS(e){let t=(0,xS.useRef)(e);return(0,xS.useLayoutEffect)(()=>{t.current=e},[e]),(0,xS.useCallback)(((...e)=>t.current(...e)),[])}var xS,SS=t((()=>{xS=e(i())})),CS=t((()=>{}));function wS({choice:e,inputRef:t,onSelect:n,onDismiss:r}){let[i,a]=(0,TS.useState)(0),o=(0,TS.useRef)(null),s=(0,TS.useRef)([]),c=Math.min(i,Math.max(0,e.options.length-1));return(0,TS.useEffect)(()=>{a(0),t.current?.focus()},[e,t]),(0,TS.useEffect)(()=>{s.current[c]?.scrollIntoView({block:`nearest`})},[c,e]),(0,TS.useEffect)(()=>{let i=i=>{if(i.isComposing||i.shiftKey||i.altKey||i.ctrlKey||i.metaKey)return;let l=i.target,u=l===t.current,d=l!==null&&o.current?.contains(l);if((i.key===`Escape`||u||d)&&(i.key!==`Enter`||u||s.current.includes(l))){if(i.key===`Escape`)i.preventDefault(),i.stopPropagation(),r?.(),t.current?.focus();else if(e.options.length){if(i.key===`ArrowUp`||i.key===`ArrowDown`){i.preventDefault(),i.stopPropagation();let t=(c+(i.key===`ArrowDown`?1:-1)+e.options.length)%e.options.length;a(t),d&&s.current[t]?.focus()}else i.key===`Enter`&&(i.preventDefault(),i.stopPropagation(),n?.(e.options[c].value),t.current?.focus())}}};return window.addEventListener(`keydown`,i,!0),()=>window.removeEventListener(`keydown`,i,!0)},[e,t,r,n,c]),(0,ES.jsxs)(`section`,{ref:o,className:`slash-choice-panel`,"aria-label":`${e.command} choices`,children:[(0,ES.jsxs)(`header`,{className:`slash-choice-heading`,children:[(0,ES.jsxs)(`div`,{children:[(0,ES.jsx)(`span`,{className:`slash-choice-command`,children:e.command}),(0,ES.jsx)(`p`,{children:e.title})]}),(0,ES.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Dismiss choices`,children:`×`})]}),(0,ES.jsx)(`div`,{className:`slash-choice-options`,role:`group`,"aria-label":`Options`,children:e.options.map((e,r)=>(0,ES.jsxs)(`button`,{ref:e=>{s.current[r]=e},type:`button`,"aria-pressed":r===c,className:r===c?`active`:void 0,onPointerMove:()=>a(r),onFocus:()=>a(r),onClick:()=>{n?.(e.value),t.current?.focus()},children:[(0,ES.jsxs)(`span`,{children:[r+1,`.`]}),e.label]},e.value))}),(0,ES.jsx)(`span`,{className:`slash-choice-status`,role:`status`,children:e.options[c]?.label}),(0,ES.jsx)(`div`,{className:`slash-choice-hint`,children:`↑↓ select · Enter choose · Esc dismiss`})]})}var TS,ES,DS=t((()=>{TS=e(i()),CS(),ES=a()})),OS=t((()=>{})),kS,AS=t((()=>{kS=JSON.parse(`[{"token":"/mint-web","usage":"","description":"Start Mint Web in a background terminal; stop it when Mint closes","category":"system","surfaces":["cli","web","desktop"]},{"token":"/help","usage":"","description":"Show this help","category":"system","surfaces":["cli","web","desktop"]},{"token":"/mods","usage":"[list|source|validate|test|enable|disable|export|import|hot-reload]","description":"Manage workspace mods, tests and live UI panels","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/theme","usage":"","description":"Choose terminal theme with a live preview","category":"system","surfaces":["cli"]},{"token":"/onboard","usage":"","description":"Configure AI providers, search engines, media models, and bridges","category":"system","surfaces":["cli","web","desktop"]},{"token":"/init","usage":"","description":"Scan the codebase and write an AGENTS.md (build/test commands, architecture, conventions)","category":"system","surfaces":["cli","web","desktop"]},{"token":"/fast","usage":"[on|off]","description":"Toggle fast mode (hide thinking traces)","category":"system","surfaces":["cli","web","desktop"]},{"token":"/plan","usage":"[<task>|on|off]","description":"Run task in plan mode or toggle plan mode","category":"system","surfaces":["cli","web","desktop"]},{"token":"/plan list","usage":"[n]","description":"Interactively browse and view saved plans","category":"system","surfaces":["cli","web","desktop"]},{"token":"/models","usage":"[name]","description":"List providers or switch provider","category":"models","surfaces":["cli","web","desktop"]},{"token":"/thinking","usage":"[on|off|low|medium|high|extra_high|status]","description":"Toggle thinking mode or adjust thinking effort level","category":"models","surfaces":["cli","web","desktop"]},{"token":"/temperature","usage":"[<provider> [model] [temp]|<temp>|default|status]","description":"Interactive temperature picker or set/inspect per-model temperatures","category":"models","surfaces":["cli","web","desktop"]},{"token":"/clear","usage":"","description":"Clear conversation history","category":"system","surfaces":["cli","web","desktop"]},{"token":"/resume","usage":"[<id|search>]","description":"Resume and switch conversation session","category":"system","surfaces":["cli","web","desktop"]},{"token":"/edit","usage":"","description":"Edit the last prompt and resend, replacing its previous turn and response","category":"system","surfaces":["cli","web","desktop"]},{"token":"/retry","usage":"","description":"Retry or edit the last prompt, replacing its previous turn and response","category":"system","surfaces":["cli","web","desktop"]},{"token":"/branch","usage":"[<name>]","description":"Select or switch the current workspace Git branch","category":"workspace","surfaces":["cli"]},{"token":"/cd","usage":"<path>","description":"Change workspace directory","category":"workspace","surfaces":["cli","web","desktop"]},{"token":"/image","usage":"<path> [prompt]","description":"Attach image from file","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/edit-image","usage":"<prompt>","description":"Edit attached image with prompt instruction","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/paste","usage":"[prompt]","description":"Attach image from clipboard","category":"tools","surfaces":["cli","web","desktop"]},{"token":"Ctrl+V","usage":"","description":"Paste clipboard image as [Image #1]","surfaces":["cli"]},{"token":"Ctrl+T","usage":"","description":"View reasoning/thought process from last turn","surfaces":["cli"]},{"token":"/thought","usage":"","description":"View reasoning/thought process from last turn","category":"tools","surfaces":["cli","web","desktop"]},{"token":"↑ / ↓","usage":"","description":"Recall previously submitted input","surfaces":["cli"]},{"token":"/learn","usage":"<path>","description":"Import a persistent .md or .txt skill","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/skill","usage":"[list]","description":"List skills (global/workspace/taught) — see also /skill add","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/skill add","usage":"<path|github-repo|url>","description":"Install a local skill, or pull one via \`npx skills\` (GitHub repo/URL)","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/plugins","usage":"[name] [prompt]","description":"List configured plugins, or generate a skill.md for one","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/plugin enable","usage":"<name>","description":"Enable a native plugin for the agent","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/plugin disable","usage":"<name>","description":"Disable a native plugin","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/remember","usage":"[here] <text>","description":"Save a durable fact to long-term memory (\\"here\\" = this project only)","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/trajectory","usage":"[export [path]|status]","description":"Inspect or export SWE-bench compliant execution trajectory for current run","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/memory","usage":"","description":"Manage long-term memory store","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/memory list","usage":"","description":"Show recent interactions","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/memory facts","usage":"","description":"List stored long-term facts","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/memory forget","usage":"<id-or-text>","description":"Delete stored fact(s) by id or matching text","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/memory promote","usage":"<id>","description":"Lift a subagent-scoped fact into shared long-term memory","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/memory clear","usage":"","description":"Clear all interactions","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/memory get","usage":"<key>","description":"Read a profile value","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/memory set","usage":"<key> <val>","description":"Store a profile value","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/autoskill","usage":"[on|off]","description":"Toggle auto-writing a SKILL.md after hard tasks","category":"system","surfaces":["cli","web","desktop"]},{"token":"/autorecall","usage":"[on|off]","description":"Toggle full-text recall of older messages from this conversation","category":"system","surfaces":["cli","web","desktop"]},{"token":"/autofacts","usage":"[on|off]","description":"Toggle auto-extracting durable facts from your messages into long-term memory","category":"system","surfaces":["cli","web","desktop"]},{"token":"/factrecall","usage":"[on|off]","description":"Toggle relevance-ranking stored facts against your message when they overflow the budget","category":"system","surfaces":["cli","web","desktop"]},{"token":"/cron","usage":"","description":"Create/list/remove/enable/disable scheduled agent tasks","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/cron add","usage":"<name> | <sched> | <task>","description":"Create a scheduled task — walks through a wizard if you don't type more","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/link","usage":"","description":"Link a folder chat can auto-write notes into","category":"workspace","surfaces":["cli","web","desktop"]},{"token":"/link add","usage":"<name> | <path> | <desc>","description":"Link a folder chat can auto-write notes into","category":"workspace","surfaces":["cli","web","desktop"]},{"token":"/link refresh","usage":"<name>","description":"Refresh a linked folder's file index","category":"workspace","surfaces":["cli","web","desktop"]},{"token":"/link notes","usage":"<name>","description":"List saved linked-folder notes","category":"workspace","surfaces":["cli","web","desktop"]},{"token":"/link save","usage":"<name> | <text>","description":"Save text into a linked folder","category":"workspace","surfaces":["cli","web","desktop"]},{"token":"/image-provider","usage":"[name]","description":"List image gen providers or switch default provider","category":"models","surfaces":["cli","web","desktop"]},{"token":"/image-models","usage":"[model]","description":"List or switch default image generation model","category":"models","surfaces":["cli","web","desktop"]},{"token":"/generate-image","usage":"<prompt>","description":"Generate image using AI model","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/gen-image","usage":"<prompt>","description":"Generate image using AI model","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/veo","usage":"<prompt>","description":"Generate video using Google Veo","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/video-provider","usage":"[name]","description":"List video gen providers or switch default provider","category":"models","surfaces":["cli","web","desktop"]},{"token":"/video-models","usage":"[model]","description":"List or switch default video generation model","category":"models","surfaces":["cli","web","desktop"]},{"token":"/search-provider","usage":"[name]","description":"List web search providers or switch default provider","category":"models","surfaces":["cli","web","desktop"]},{"token":"/bg","usage":"<query>","description":"Run a query in the background, non-blocking","category":"tools","surfaces":["cli"]},{"token":"/jobs","usage":"[show|cancel <id>]","description":"List, inspect, or cancel background jobs","category":"tools","surfaces":["cli"]},{"token":"/preview","usage":"<relative HTML, Markdown, or image path>","description":"Serve workspace HTML, Markdown, or images locally and return its browser URL","category":"tools","surfaces":["cli","desktop","web"]},{"token":"/shells","usage":"[all|show <id>|stop [<id>]|kill <id>]","description":"List background terminals, view output, or stop all running jobs (or one by ID)","category":"tools","surfaces":["cli","desktop","web"]},{"token":"/shells stop","usage":"[<id>]","description":"Stop all running background terminals, or only the specified ID","category":"tools","surfaces":["cli","desktop","web"]},{"token":"/mcp","usage":"","description":"List configured MCP servers","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/mcp add","usage":"<name> <command> [args...]","description":"Add an MCP server","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/mcp remove","usage":"<name>","description":"Remove an MCP server","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/mcp enable","usage":"<name>","description":"Re-enable a disabled MCP server","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/mcp disable","usage":"<name>","description":"Turn an MCP server off without removing it","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/mcp edit","usage":"<name> command|args|icon|timeout <value>","description":"Change one field of a configured MCP server","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/mcp allow","usage":"<server> <tool>","description":"Allow an MCP tool","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/mcp disallow","usage":"<server> <tool>","description":"Remove a tool from a server's allowlist (* clears it)","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/mcp reauth","usage":"<server>","description":"Re-run a server's OAuth login (e.g. expired token)","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/mcp registry","usage":"","description":"Show the catalog of well-known MCP servers","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/mcp clear","usage":"","description":"Remove all configured MCP servers","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/subagent","usage":"","description":"List/create/remove subagents the agent can delegate to","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/subagent add","usage":"","description":"Create a subagent — walks through a wizard","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/release-notes","usage":"","description":"Show release notes for the current version","category":"system","surfaces":["cli","web","desktop"]},{"token":"/stats","usage":"","description":"Show session statistics","category":"system","surfaces":["cli","web","desktop"]},{"token":"/steps","usage":"[<10-200>|reset|status]","description":"Configure maximum steps per agent turn (default 40, range 10-200)","category":"system","surfaces":["cli","web","desktop"]},{"token":"/exit","usage":"","description":"Exit Mint","category":"system","surfaces":["cli"]},{"token":"/code","usage":"<task>","description":"Run in code-agent mode","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/n8n","usage":"[task]","description":"Open n8n in your browser, or trigger a workflow via the n8n MCP server","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/notebook","usage":"[task]","description":"Open SurfSense in your browser, or run a task via the surfsense MCP server","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/multi-agent","usage":"[on|off]","description":"Show or toggle Multi-Agent Collaboration system","category":"system","surfaces":["cli","web","desktop"]},{"token":"/avatar","usage":"[web|desktop|status|off]","description":"Connect agent activity to Project Avatar (real-time 3D avatar)","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/rewind","usage":"[step]","description":"Rewind workspace to a previous git checkpoint snapshot","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/history","usage":"","description":"Show saved workspace file actions and backups","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/undo","usage":"","description":"Undo the latest workspace file action, with conflict checks","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/palette","usage":"","description":"Open interactive command palette and action menu","category":"system","surfaces":["cli","web","desktop"]},{"token":"/browser","usage":"[on|off|headless|headed|status]","description":"Configure browser automation tools (on/off) or mode (headless/headed)","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/browser status","usage":"","description":"Show current browser automation configuration and detected binary","category":"tools","surfaces":["cli","web","desktop"]},{"token":"/voice","usage":"[send|stop]","description":"Record voice input from your microphone or start live voice mode","category":"tools","surfaces":["cli","web","desktop"]},{"token":"F8","usage":"","description":"Toggle microphone voice dictation in the TUI composer","surfaces":["cli"]}]`)})),jS,MS=t((()=>{AS(),jS=kS.filter(e=>e.surfaces.some(e=>e===`web`||e===`desktop`)).map(e=>({command:e.token,description:e.description,usage:e.usage||void 0,category:e.category}))})),NS,PS,FS,IS,LS,RS,zS=t((()=>{NS=e(i()),A(),OS(),MS(),ke(),PS=a(),FS=[`system`,`models`,`workspace`,`tools`],IS={system:`System`,models:`Models`,workspace:`Workspace`,tools:`Tools`},LS=[{label:`@workspace`,desc:`Include workspace path & context`,kind:`context`},{label:`@file`,desc:`Reference workspace file`,kind:`context`},{label:`@docs`,desc:`Include documentation context`,kind:`context`},{label:`@memory`,desc:`Include long-term memory store`,kind:`context`}],RS=(0,NS.forwardRef)(function({message:e,onComplete:t,workspacePath:n,mcpServers:r,anchorRef:i,suppressed:a=!1},o){let[s,c]=(0,NS.useState)([]),[l,u]=(0,NS.useState)(0),[d,f]=(0,NS.useState)(null),p=(0,NS.useRef)(null),m=(0,NS.useRef)(null),h=e.replace(/^\s+/,``),g=h.startsWith(`/`)?`slash`:h.startsWith(`$`)?`skill`:/@[\w\-./]*$/.test(e)?`at`:null;(0,NS.useEffect)(()=>{if(g!==`skill`)return;let e=!0;return ne.listLearnedSkills(n).then(t=>{e&&Array.isArray(t)&&c(t)}).catch(()=>{}),()=>{e=!1}},[g,n]);let v=(0,NS.useMemo)(()=>{if(g!==`slash`)return[];let e=h.toLowerCase(),t=jS.some(t=>e.startsWith(t.command.toLowerCase()+` `)),n=e.slice(1).trim().split(/\s+/).filter(Boolean),r=jS.filter(r=>r.command.toLowerCase().startsWith(e)||!t&&!/\s/.test(e)&&n.every(e=>`${r.command} ${r.description}`.toLowerCase().includes(e))),i=e=>FS.flatMap(t=>e.filter(e=>(e.category??`tools`)===t));return[...i(r.filter(t=>t.command.toLowerCase().startsWith(e))),...i(r.filter(t=>!t.command.toLowerCase().startsWith(e)))]},[g,h]),y=(0,NS.useMemo)(()=>{if(g!==`slash`)return;let e=h.toLowerCase();return[...jS].sort((e,t)=>t.command.length-e.command.length).find(t=>e===t.command.toLowerCase()||e.startsWith(t.command.toLowerCase()+` `))},[g,h]),b=(0,NS.useMemo)(()=>{if(g!==`skill`)return[];let e=h.slice(1).split(/\s+/)[0].toLowerCase();return s.filter(t=>t.name.toLowerCase().startsWith(e))},[g,h,s]),x=(0,NS.useMemo)(()=>{if(g!==`at`)return[];let t=(e.match(/@([\w\-./]*)$/)?.[1]??``).toLowerCase();return[...Object.entries(r??{}).filter(([,e])=>e?.disabled!==!0).map(([e])=>({label:`@${e}`,desc:`Restrict this message to this MCP server / plugin`,kind:`plugin`})),...LS].filter(e=>e.label.toLowerCase().includes(t))},[g,e,r]),S=g===`slash`?v:g===`skill`?b:g===`at`?x:[],C=g===`slash`&&S.length===0&&h.trim().length>1,w=!a&&g!==null&&d!==e&&(S.length>0||C);(0,NS.useEffect)(()=>{u(0)},[e]),(0,NS.useEffect)(()=>{w&&m.current&&m.current.querySelector(`[data-idx="${l}"]`)?.scrollIntoView({block:`nearest`})},[l,w]),(0,NS.useEffect)(()=>{if(!w)return;let t=t=>{let n=t.target;p.current?.contains(n)||i.current?.contains(n)||f(e)};return document.addEventListener(`mousedown`,t),()=>document.removeEventListener(`mousedown`,t)},[w,e,i]);let T=t=>g===`slash`?`${t.command} `:g===`skill`?`$${t.name} `:e.replace(/@[\w\-./]*$/,`${t.label} `),D=e=>{let n=T(e);f(n),u(0),t(n)};if((0,NS.useImperativeHandle)(o,()=>({handleKeyDown(t){if(a||g===null)return!1;let n=(t.key===`ArrowUp`||t.key===`ArrowDown`)&&!t.shiftKey&&!t.altKey&&!t.metaKey&&!t.ctrlKey&&!t.nativeEvent.isComposing;if(n&&!w&&S.length>0)return f(null),u(t.key===`ArrowDown`?0:S.length-1),t.preventDefault(),!0;if(!w)return!1;if(n&&S.length>0)return u(e=>t.key===`ArrowDown`?(e+1)%S.length:(e-1+S.length)%S.length),t.preventDefault(),!0;if((t.key===`Enter`||t.key===`Tab`)&&!t.shiftKey&&!t.nativeEvent.isComposing){if(t.key===`Enter`&&g===`slash`&&S.some(e=>e.command.toLowerCase()===h.trim().toLowerCase()))return!1;let e=S[l]??S[0];return e?(D(e),t.preventDefault(),!0):!1}return t.key===`Escape`&&(f(e),t.preventDefault(),!0)}})),!w)return null;let O=S.length===0?`No matches`:g===`slash`?`${S.length} command${S.length===1?``:`s`}`:g===`skill`?`${S.length} skill${S.length===1?``:`s`}`:`${S.length} mention${S.length===1?``:`s`}`,k=(e,t,n,r,i,a)=>(0,PS.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t===l,"data-idx":t,className:`slash-suggestion-item ${t===l?`active`:``}`,title:[n,a,r].filter(Boolean).join(` · `),onMouseDown:e=>e.preventDefault(),onClick:()=>D(e),onPointerMove:()=>u(t),children:[(0,PS.jsx)(`span`,{className:`slash-cmd-icon`,"aria-hidden":`true`,children:g===`skill`?(0,PS.jsx)(E,{size:15}):g===`at`?(0,PS.jsx)(se,{size:15}):e.category===`models`?(0,PS.jsx)(ge,{size:15}):e.category===`workspace`?(0,PS.jsx)(ce,{size:15}):e.category===`tools`?(0,PS.jsx)(_,{size:15}):(0,PS.jsx)(Te,{size:15})}),(0,PS.jsx)(`span`,{className:`slash-cmd-name`,children:n}),(0,PS.jsx)(`span`,{className:`slash-cmd-body`,children:(0,PS.jsx)(`span`,{className:`slash-cmd-desc`,children:r})}),i&&(0,PS.jsx)(`span`,{className:`skill-badge`,children:i})]},n);return(0,PS.jsxs)(`div`,{className:`slash-suggestions-popup`,ref:p,children:[(0,PS.jsxs)(`div`,{className:`slash-suggestions-header`,children:[g===`slash`?`Slash Commands`:g===`skill`?`Learned Skills`:`Context Mentions`,(0,PS.jsx)(`span`,{className:`slash-suggestions-count`,children:O})]}),(0,PS.jsxs)(`div`,{className:`slash-suggestions-list`,ref:m,role:`listbox`,"aria-label":g===`slash`?`Slash commands`:g===`skill`?`Skills`:`Context mentions`,children:[g===`slash`&&(S.length>0?[...new Set(v.map(e=>e.category??`tools`))].map(e=>{let t=v.filter(t=>(t.category??`tools`)===e);return t.length?(0,PS.jsxs)(`div`,{className:`slash-suggestions-group`,children:[(0,PS.jsx)(`div`,{className:`slash-suggestions-group-label`,children:IS[e]}),t.map(e=>k(e,v.indexOf(e),e.command,e.description,void 0,e.usage))]},e):null}):(0,PS.jsx)(`div`,{className:`slash-suggestions-empty`,children:y?(0,PS.jsxs)(PS.Fragment,{children:[(0,PS.jsx)(`span`,{className:`slash-cmd-name`,children:y.command}),(0,PS.jsx)(`span`,{className:`slash-cmd-usage`,children:y.usage||`No further arguments`})]}):(0,PS.jsxs)(`span`,{children:[`No command matches `,(0,PS.jsx)(`code`,{children:h.trim()})]})})),g===`skill`&&b.map((e,t)=>k(e,t,`$${e.name}`,e.description||e.content?.slice(0,60)||``,`[Skill]`)),g===`at`&&x.map((e,t)=>k(e,t,e.label,e.desc,e.kind===`plugin`?`[Plugin]`:`[Context]`))]}),(0,PS.jsx)(`div`,{className:`slash-suggestions-hint`,children:`↑↓ select · Tab complete · Enter send · Esc close`})]})})}));function BS(e){return!!e?.SkillWrite}function VS(e){if(!e)return``;let t=0,n=0,r=e.split(`
|
|
67
|
+
`);for(let e of r)e.startsWith(`+++ `)||e.startsWith(`--- `)||(e.startsWith(`+`)?t++:e.startsWith(`-`)&&n++);return`(+${t} -${n})`}function HS(e){if(!e)return{title:`Action Pending Approval`,body:`No action details available.`,isDangerous:!1};if(e.WriteFile){let t=VS(e.WriteFile.diff);return{title:`Write File`,body:`Path: ${e.WriteFile.path}${t?` ${t}`:``}`,reason:e.WriteFile.diff?`Diff:\n${e.WriteFile.diff}`:`Writing new file content.`,isDangerous:!1}}if(e.ApplyPatch){let t=VS(e.ApplyPatch.diff);return{title:`Apply Patch`,body:`Path: ${e.ApplyPatch.path}${t?` ${t}`:``}`,reason:e.ApplyPatch.diff?`Diff:\n${e.ApplyPatch.diff}`:`Applying code patch.`,isDangerous:!1}}if(e.RunShell)return{title:`Run Shell Command`,body:e.RunShell.command,reason:`Executing shell commands can modify your system.`,isDangerous:!0};if(e.NoteWrite)return{title:`Write Note`,body:`Path: ${e.NoteWrite.path}`,reason:`Creating or updating workspace notes.`,isDangerous:!1};if(e.RunPlugin)return{title:`Run Plugin: ${e.RunPlugin.name}`,body:e.RunPlugin.instruction,reason:`Executing a native plugin action.`,isDangerous:!1};if(e.McpTool){let{server:t,tool:n,arguments:r}=e.McpTool;return{title:`Run MCP Tool: ${t}/${n}`,body:typeof r==`string`?r:JSON.stringify(r,null,2),reason:`Running external MCP tool.`,isDangerous:!1}}if(e.SkillWrite)return{title:`Save Skill`,body:`Path: ${e.SkillWrite.path}`,reason:`This changes instructions used in future tasks. Review the proposed changes before saving.`,isDangerous:!1};if(e.UserApproval)return{title:e.UserApproval.title,body:e.UserApproval.prompt,reason:`The agent requested explicit approval.`,isDangerous:!1};if(e.AskUser){let t=Array.isArray(e.AskUser.options)&&e.AskUser.options.length>0,n=e.AskUser.multiSelect?`Pick one or more choices below, or type your own answer and submit.`:`Pick a choice below, or type your own answer and submit.`;return{title:`Question From Agent`,body:e.AskUser.question,reason:t?n:`Type your answer below and submit to respond to the agent.`,isDangerous:!1}}return e.ExitPlanMode?{title:`Review Plan`,body:e.ExitPlanMode.plan,reason:`Approve to allow file edits and shell commands. Reject to keep the agent investigating.`,isDangerous:!1}:{title:`Unknown Action`,body:JSON.stringify(e,null,2),reason:`Requires approval to proceed.`,isDangerous:!1}}function US(e){let t=e.trim();if(!t.startsWith(`@@`))return null;let n=t.split(`@@`);if(n.length<3)return null;let r=n[1].trim(),i=1,a=1;for(let e of r.split(/\s+/))if(e.startsWith(`-`)){let t=e.slice(1).split(`,`)[0],n=parseInt(t,10);isNaN(n)||(i=n)}else if(e.startsWith(`+`)){let t=e.slice(1).split(`,`)[0],n=parseInt(t,10);isNaN(n)||(a=n)}return{oldStart:i,newStart:a}}function WS(e){if(!e)return null;let t=e.split(`
|
|
68
|
+
`),n=1,r=1;return(0,GS.jsx)(`div`,{style:{background:`var(--input-bg, #0a0a0b)`,borderRadius:`var(--radius-sm, 6px)`,padding:`8px`,border:`1px solid var(--border)`,overflowX:`auto`,maxHeight:`400px`,fontFamily:`'Fira Code', 'Courier New', Courier, monospace`,fontSize:`0.74rem`,lineHeight:`1.45`},children:t.map((e,t)=>{if(e.startsWith(`@@`)){let i=US(e);return i&&(n=i.oldStart,r=i.newStart),(0,GS.jsx)(`div`,{style:{color:`var(--text-muted)`,fontWeight:`bold`,padding:`2px 6px`},children:` `+e},t)}if(e.startsWith(`---`)||e.startsWith(`+++`))return(0,GS.jsx)(`div`,{style:{color:`var(--text-muted)`,fontWeight:`bold`,padding:`2px 6px`},children:` `+e},t);let i=``,a={whiteSpace:`pre-wrap`,padding:`2px 6px`,display:`flex`,alignItems:`center`},o=``,s=``,c=e;return e.startsWith(`+`)?(i=String(r),r++,a={...a,background:`color-mix(in srgb, var(--accent) 10%, transparent)`,borderLeft:`3px solid var(--accent)`,color:`var(--text-chat, var(--text-main))`},o=`+`,s=`var(--accent)`,c=e.slice(1)):e.startsWith(`-`)?(i=String(n),n++,a={...a,background:`color-mix(in srgb, var(--status-error, #ef4444) 10%, transparent)`,borderLeft:`3px solid var(--status-error, #ef4444)`,color:`var(--text-chat, var(--text-main))`},o=`-`,s=`var(--status-error, #ef4444)`,c=e.slice(1)):(i=String(r),n++,r++,a={...a,color:`var(--text-chat, var(--text-main))`}),(0,GS.jsxs)(`div`,{style:a,children:[(0,GS.jsx)(`span`,{style:{color:`var(--text-muted)`,marginRight:`12px`,userSelect:`none`,display:`inline-block`,width:`36px`,textAlign:`right`,flexShrink:0},children:i}),o&&(0,GS.jsx)(`span`,{style:{color:s,marginRight:`4px`,userSelect:`none`,fontWeight:600},children:o}),(0,GS.jsx)(`span`,{children:c})]},t)})})}var GS,KS=t((()=>{i(),GS=a()})),qS=t((()=>{KS()}));function JS(e){let t=e.trim();if(!t.startsWith(`@@`))return null;let n=t.split(`@@`);if(n.length<3)return null;let r=n[1].trim(),i=1,a=1;for(let e of r.split(/\s+/))if(e.startsWith(`-`)){let t=e.slice(1).split(`,`)[0],n=parseInt(t,10);isNaN(n)||(i=n)}else if(e.startsWith(`+`)){let t=e.slice(1).split(`,`)[0],n=parseInt(t,10);isNaN(n)||(a=n)}return{oldStart:i,newStart:a}}function YS(e){let t=e.split(`
|
|
69
|
+
`),n=[],r=[],i=0,a=0,o=1,s=1,c=[],l=[],u=()=>{let e=Math.max(c.length,l.length);for(let t=0;t<e;t++){let e=c[t],n=l[t];r.push({type:`line`,left:e?{lineNum:e.lineNum,content:e.content,isDel:!0}:void 0,right:n?{lineNum:n.lineNum,content:n.content,isAdd:!0}:void 0})}c=[],l=[]};for(let e of t)if(e.startsWith(`@@`)){u();let t=JS(e);t&&(o=t.oldStart,s=t.newStart),n.push({type:`hunk`,content:e}),r.push({type:`hunk`,hunkHeader:e})}else if(e.startsWith(`---`)||e.startsWith(`+++`))u(),n.push({type:`meta`,content:e});else if(e.startsWith(`+`)){i++;let t=e.slice(1);n.push({type:`add`,newNum:s,content:t}),l.push({lineNum:s,content:t}),s++}else if(e.startsWith(`-`)){a++;let t=e.slice(1);n.push({type:`del`,oldNum:o,content:t}),c.push({lineNum:o,content:t}),o++}else{u();let t=e.startsWith(` `)?e.slice(1):e;n.push({type:`normal`,oldNum:o,newNum:s,content:t}),r.push({type:`line`,left:{lineNum:o,content:t,isDel:!1},right:{lineNum:s,content:t,isAdd:!1}}),o++,s++}return u(),{unifiedLines:n,splitRows:r,additions:i,deletions:a}}var XS,ZS,QS,$S=t((()=>{XS=e(i()),dt(),ZS=a(),QS=({isOpen:e,onClose:t,filePath:n,diffText:r,onApprove:i,onReject:a,isDangerous:o})=>{let[s,c]=(0,XS.useState)(`split`),[l,u]=(0,XS.useState)(!1),{unifiedLines:d,splitRows:f,additions:p,deletions:m}=(0,XS.useMemo)(()=>YS(r||``),[r]);return(0,XS.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`?t():e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&i()};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t,i]),e?(0,ZS.jsx)(`div`,{className:`management-modal-overlay`,onClick:t,style:{zIndex:10001},children:(0,ZS.jsxs)(`div`,{className:`management-modal diff-review-modal`,onClick:e=>e.stopPropagation(),style:{maxWidth:`92vw`,width:`1100px`,maxHeight:`90vh`,display:`flex`,flexDirection:`column`},children:[(0,ZS.jsxs)(`div`,{className:`management-modal-header`,style:{padding:`16px 20px`,gap:12},children:[(0,ZS.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,minWidth:0,flex:1},children:[(0,ZS.jsx)(`div`,{className:`management-card-icon`,style:{width:34,height:34,fontSize:`0.72rem`,fontWeight:700,flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`color-mix(in srgb, var(--accent) 15%, transparent)`,color:`var(--interactive-fg)`,borderRadius:`var(--radius-sm, 8px)`},children:`DIFF`}),(0,ZS.jsxs)(`div`,{style:{minWidth:0,flex:1},children:[(0,ZS.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,ZS.jsx)(`h3`,{className:`management-card-title`,style:{fontSize:`1rem`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},title:n,children:n}),(0,ZS.jsx)(`button`,{type:`button`,onClick:()=>{navigator?.clipboard?.writeText&&(navigator.clipboard.writeText(n),u(!0),setTimeout(()=>u(!1),2e3))},className:`management-action-btn`,style:{padding:`2px 6px`,fontSize:`0.72rem`},title:`Copy file path`,children:l?`Copied`:`Copy`})]}),(0,ZS.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginTop:3},children:[(0,ZS.jsxs)(`span`,{style:{fontSize:`0.75rem`,fontWeight:700,color:`var(--interactive-fg)`,background:`color-mix(in srgb, var(--accent) 15%, transparent)`,padding:`1px 6px`,borderRadius:`var(--radius-xs, 6px)`},children:[`+`,p]}),(0,ZS.jsxs)(`span`,{style:{fontSize:`0.75rem`,fontWeight:700,color:`var(--status-error-fg)`,background:`var(--status-error-bg)`,padding:`1px 6px`,borderRadius:`var(--radius-xs, 6px)`},children:[`-`,m]}),o&&(0,ZS.jsx)(`span`,{style:{fontSize:`0.72rem`,fontWeight:700,color:`var(--status-warning-fg)`,background:`var(--status-warning-bg)`,padding:`1px 6px`,borderRadius:`var(--radius-xs, 6px)`,textTransform:`none`},children:`Review carefully`})]})]})]}),(0,ZS.jsxs)(`div`,{className:`management-filter-pills`,style:{display:`flex`,gap:2,padding:3,flexShrink:0},children:[(0,ZS.jsx)(`button`,{type:`button`,className:`management-pill-btn ${s===`split`?`active`:``}`,onClick:()=>c(`split`),style:{padding:`5px 10px`,fontSize:`0.78rem`},children:`Side-by-Side`}),(0,ZS.jsx)(`button`,{type:`button`,className:`management-pill-btn ${s===`unified`?`active`:``}`,onClick:()=>c(`unified`),style:{padding:`5px 10px`,fontSize:`0.78rem`},children:`Unified`})]}),(0,ZS.jsx)(`button`,{type:`button`,className:`management-modal-close`,onClick:t,title:`Close`,children:(0,ZS.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,ZS.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,ZS.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]}),(0,ZS.jsx)(`div`,{className:`management-modal-body`,style:{padding:0,overflowY:`auto`,flex:1,background:`var(--bg-canvas)`,fontFamily:`Consolas, Monaco, "JetBrains Mono", monospace`,fontSize:`0.8rem`,lineHeight:1.5},children:s===`split`?(0,ZS.jsxs)(`div`,{className:`diff-split-container`,style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,minWidth:`700px`},children:[(0,ZS.jsx)(`div`,{style:{position:`sticky`,top:0,zIndex:2,background:`var(--bg-surface-raised)`,padding:`6px 12px`,borderBottom:`1px solid var(--border-subtle)`,borderRight:`1px solid var(--border-subtle)`,color:`var(--text-muted)`,fontWeight:600,fontSize:`0.75rem`},children:`Original (Before)`}),(0,ZS.jsx)(`div`,{style:{position:`sticky`,top:0,zIndex:2,background:`var(--bg-surface-raised)`,padding:`6px 12px`,borderBottom:`1px solid var(--border-subtle)`,color:`var(--text-muted)`,fontWeight:600,fontSize:`0.75rem`},children:`Proposed (After)`}),f.map((e,t)=>{if(e.type===`hunk`)return(0,ZS.jsx)(`div`,{style:{gridColumn:`1 / -1`,background:`var(--status-info-bg)`,color:`var(--status-info-fg)`,padding:`4px 12px`,fontSize:`0.72rem`,fontWeight:600,borderTop:`1px solid var(--status-info-border)`,borderBottom:`1px solid var(--status-info-border)`},children:e.hunkHeader},t);let n=e.left,r=e.right;return(0,ZS.jsxs)(XS.Fragment,{children:[(0,ZS.jsxs)(`div`,{style:{display:`flex`,borderRight:`1px solid var(--border)`,background:n?.isDel?`var(--diff-del-bg)`:`transparent`,borderLeft:n?.isDel?`3px solid var(--diff-del-border)`:`3px solid transparent`,minHeight:`22px`},children:[(0,ZS.jsx)(`span`,{style:{width:`44px`,textAlign:`right`,paddingRight:`10px`,color:n?.isDel?`var(--diff-del-gutter)`:`var(--text-muted)`,userSelect:`none`,flexShrink:0},children:n?n.lineNum:``}),(0,ZS.jsx)(`span`,{style:{whiteSpace:`pre-wrap`,wordBreak:`break-all`,paddingRight:`8px`,color:n?.isDel?`var(--diff-del-text)`:`var(--text-chat, var(--text-main))`},children:n?n.content:``})]}),(0,ZS.jsxs)(`div`,{style:{display:`flex`,background:r?.isAdd?`var(--diff-add-bg)`:`transparent`,borderLeft:r?.isAdd?`3px solid var(--diff-add-border)`:`3px solid transparent`,minHeight:`22px`},children:[(0,ZS.jsx)(`span`,{style:{width:`44px`,textAlign:`right`,paddingRight:`10px`,color:r?.isAdd?`var(--diff-add-gutter)`:`var(--text-muted)`,userSelect:`none`,flexShrink:0},children:r?r.lineNum:``}),(0,ZS.jsx)(`span`,{style:{whiteSpace:`pre-wrap`,wordBreak:`break-all`,paddingRight:`8px`,color:r?.isAdd?`var(--diff-add-text)`:`var(--text-chat, var(--text-main))`},children:r?r.content:``})]})]},t)})]}):(0,ZS.jsx)(`div`,{style:{minWidth:`500px`},children:d.map((e,t)=>{if(e.type===`hunk`)return(0,ZS.jsx)(`div`,{style:{background:`var(--status-info-bg)`,color:`var(--status-info-fg)`,padding:`4px 12px`,fontSize:`0.72rem`,fontWeight:600,borderTop:`1px solid var(--status-info-border)`,borderBottom:`1px solid var(--status-info-border)`},children:e.content},t);if(e.type===`meta`)return(0,ZS.jsx)(`div`,{style:{color:`var(--text-muted)`,padding:`2px 12px`,fontWeight:600},children:e.content},t);let n=`transparent`,r=`3px solid transparent`,i=`var(--text-chat, var(--text-main))`,a=` `;return e.type===`add`?(n=`var(--diff-add-bg)`,r=`3px solid var(--diff-add-border)`,i=`var(--diff-add-text)`,a=`+`):e.type===`del`&&(n=`var(--diff-del-bg)`,r=`3px solid var(--diff-del-border)`,i=`var(--diff-del-text)`,a=`-`),(0,ZS.jsxs)(`div`,{style:{display:`flex`,background:n,borderLeft:r,padding:`1px 0`},children:[(0,ZS.jsx)(`span`,{style:{width:`42px`,textAlign:`right`,color:`var(--text-muted)`,paddingRight:`8px`,userSelect:`none`,flexShrink:0},children:e.oldNum||``}),(0,ZS.jsx)(`span`,{style:{width:`42px`,textAlign:`right`,color:`var(--text-muted)`,paddingRight:`8px`,userSelect:`none`,flexShrink:0},children:e.newNum||``}),(0,ZS.jsx)(`span`,{style:{width:`16px`,color:e.type===`add`?`var(--diff-add-gutter)`:e.type===`del`?`var(--diff-del-gutter)`:`var(--text-muted)`,userSelect:`none`},children:a}),(0,ZS.jsx)(`span`,{style:{whiteSpace:`pre-wrap`,wordBreak:`break-all`,color:i},children:e.content})]},t)})})}),(0,ZS.jsxs)(`div`,{className:`management-modal-footer`,style:{padding:`14px 20px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,ZS.jsxs)(`div`,{style:{fontSize:`0.8rem`,color:`var(--text-muted)`},children:[(0,ZS.jsx)(`span`,{children:`Shortcut: `}),(0,ZS.jsx)(`kbd`,{style:{background:`var(--bg-surface-soft)`,border:`1px solid var(--border-subtle)`,padding:`2px 5px`,borderRadius:`var(--radius-xs, 6px)`,fontSize:`0.72rem`},children:`Esc`}),` Cancel`,(0,ZS.jsx)(`span`,{style:{margin:`0 8px`},children:`•`}),(0,ZS.jsx)(`kbd`,{style:{background:`var(--bg-surface-soft)`,border:`1px solid var(--border-subtle)`,padding:`2px 5px`,borderRadius:`var(--radius-xs, 6px)`,fontSize:`0.72rem`},children:`Cmd/Ctrl+Enter`}),` Approve`]}),(0,ZS.jsxs)(`div`,{style:{display:`flex`,gap:10},children:[(0,ZS.jsx)(`button`,{type:`button`,className:`management-action-btn danger`,onClick:a,style:{padding:`8px 16px`,fontSize:`0.88rem`},children:`Reject Change`}),(0,ZS.jsx)(`button`,{type:`button`,className:`management-primary-btn`,onClick:i,style:{padding:`8px 20px`,fontSize:`0.88rem`},children:`Approve & Apply`})]})]})]})}):null}}));function eC({pendingApproval:e,onApproval:t}){let[n,r]=(0,tC.useState)(``),[i,a]=(0,tC.useState)(new Set),[o,s]=(0,tC.useState)(!1),c=HS(e.approval),l=e.approval?.WriteFile,u=e.approval?.ApplyPatch,d=e.approval?.SkillWrite,f=e.approval?.RunShell,p=d?.path||l?.path||u?.path||`Code Change`,m=d?.diff||l?.diff||u?.diff,h=!!e.approval?.AskUser,g=!!e.approval?.ExitPlanMode,_=!!e.approval?.EnterPlanMode,v=e.approval?.McpTool,y=Array.isArray(e.approval?.AskUser?.options)?e.approval.AskUser.options:[],b=!!e.approval?.AskUser?.multiSelect,x=e.approval?.AskUser?.header||void 0,S=()=>{let e=Array.from(i).join(`, `),t=n.trim();return t?e?`${e} — ${t}`:t:e},C=e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},w=g?{badge:`Plan Review`,badgeClass:`plan`}:_?{badge:`Plan Mode`,badgeClass:`plan`}:d?{badge:`Skill Change`,badgeClass:`edit`}:f?{badge:`Run Command`,badgeClass:c.isDangerous?`dangerous`:`command`}:l||u?{badge:`File Edit`,badgeClass:`edit`}:v?{badge:`MCP: ${v.server}`,badgeClass:`mcp`}:h?{badge:x||`Question`,badgeClass:`question`}:{badge:`Action Approval`,badgeClass:c.isDangerous?`dangerous`:`default`},T=d?[{key:`1`,title:`Allow once`,variant:`approve`,action:()=>t(!0,!1)},{key:`2`,title:`Reject`,variant:`cancel`,action:()=>t(!1)}]:v?[{key:`1`,title:`Allow once`,variant:`approve`,action:()=>t(!0,!1)},{key:`2`,title:`Always allow for "${v.server}"`,variant:`session`,action:()=>t(!0,!1,`__mcp_allow_all__`)},{key:`3`,title:`Reject`,variant:`cancel`,action:()=>t(!1)}]:g?[{key:`1`,title:`Approve and proceed`,variant:`approve`,action:()=>t(!0,!1)},{key:`2`,title:`Deny (keep planning)`,variant:`cancel`,action:()=>t(!1)}]:_?[{key:`1`,title:`Enter plan mode`,variant:`approve`,action:()=>t(!0,!1)},{key:`2`,title:`Cancel`,variant:`cancel`,action:()=>t(!1)}]:[{key:`1`,title:`Allow once`,variant:`approve`,action:()=>t(!0,!1)},{key:`2`,title:`Always allow for this session`,variant:`session`,action:()=>t(!0,!0)},{key:`3`,title:`Reject`,variant:`cancel`,action:()=>t(!1)}];return(0,tC.useEffect)(()=>{let e=e=>{let n=document.activeElement;if(!n||n.tagName!==`INPUT`&&n.tagName!==`TEXTAREA`&&!n.isContentEditable){if(!h){let t=parseInt(e.key,10);!isNaN(t)&&t>=1&&t<=T.length&&(e.preventDefault(),T[t-1].action())}else if(!b&&y.length>0){let n=parseInt(e.key,10);!isNaN(n)&&n>=1&&n<=y.length&&(e.preventDefault(),t(!0,!1,y[n-1].label))}}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h,b,y,T]),(0,nC.jsxs)(`div`,{className:`message ai-message`,style:{width:`100%`},children:[(0,nC.jsx)(`div`,{className:`bubble-wrapper`,style:{width:`100%`},children:(0,nC.jsxs)(`div`,{className:`action-card approval-card`,"data-tier":c.isDangerous?`dangerous`:void 0,style:{width:`100%`,alignItems:`stretch`,textAlign:`left`},children:[(0,nC.jsxs)(`div`,{className:`approval-card-header`,style:{width:`100%`,textAlign:`left`},children:[(0,nC.jsx)(`div`,{className:`approval-title-group`,style:{textAlign:`left`},children:(0,nC.jsx)(`div`,{className:`approval-title-text`,style:{textAlign:`left`},children:c.title})}),(0,nC.jsx)(`span`,{className:`approval-badge-chip ${w.badgeClass}`,children:w.badge})]}),m?(0,nC.jsxs)(`div`,{className:`approval-card-diff-container`,style:{width:`100%`},children:[(0,nC.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:`8px`},children:[(0,nC.jsxs)(`span`,{style:{fontSize:`0.82rem`,fontWeight:600,color:`var(--text-soft, #a1a1aa)`},children:[`Diff: `,(0,nC.jsx)(`code`,{style:{color:`var(--text-main, #f4f4f5)`},children:p})]}),(0,nC.jsx)(`button`,{type:`button`,className:`management-action-btn`,onClick:()=>s(!0),style:{display:`inline-flex`,alignItems:`center`,gap:6,padding:`4px 10px`,fontSize:`0.75rem`,borderRadius:`var(--radius-sm, 8px)`,background:`var(--accent-subtle)`,border:`1px solid var(--accent-border)`,color:`var(--interactive-fg)`,cursor:`pointer`},children:`Review Side-by-Side`})]}),WS(m)]}):g?(0,nC.jsx)(`div`,{className:`approval-content-box plan-review-content`,style:{maxHeight:`360px`,overflowY:`auto`},children:(0,nC.jsx)(rb,{text:c.body})}):(0,nC.jsx)(`div`,{className:`approval-content-box ${h?`question-text`:``}`,children:c.body}),c.reason&&!m&&(0,nC.jsx)(`div`,{className:`approval-reason-text`,children:c.reason}),h?(0,nC.jsxs)(`div`,{className:`claude-choice-stack`,children:[y.length>0&&(0,nC.jsx)(`div`,{className:`claude-choice-options`,children:y.map((e,n)=>{let r=b&&i.has(e.label);return(0,nC.jsxs)(`button`,{type:`button`,className:`claude-choice-card ${r?`selected`:``}`,onClick:()=>b?C(e.label):t(!0,!1,e.label),children:[(0,nC.jsxs)(`div`,{className:`claude-choice-left`,children:[(0,nC.jsx)(`span`,{className:`claude-choice-key`,children:n+1}),(0,nC.jsxs)(`div`,{className:`claude-choice-text`,children:[(0,nC.jsx)(`span`,{className:`claude-choice-title`,children:e.label}),e.description&&(0,nC.jsx)(`span`,{className:`claude-choice-desc`,children:e.description})]})]}),(0,nC.jsx)(`div`,{className:`claude-choice-right`,children:b?(0,nC.jsx)(`span`,{style:{fontSize:`1.1rem`,color:r?`var(--interactive-fg)`:`var(--text-muted)`},children:r?`☑`:`☐`}):(0,nC.jsx)(`span`,{style:{fontSize:`1rem`,opacity:.6},children:`›`})})]},n)})}),(0,nC.jsx)(`div`,{className:`claude-choice-custom-box`,children:(0,nC.jsxs)(`div`,{style:{display:`flex`,gap:8,alignItems:`center`,width:`100%`},children:[(0,nC.jsx)(`input`,{type:`text`,className:`claude-choice-input`,placeholder:y.length>0?`Or type custom response (press Enter to submit)...`:`Type your response (press Enter to submit)...`,value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),b?t(!0,!1,S()):n.trim()&&t(!0,!1,n.trim()))}}),(b||n.trim())&&(0,nC.jsx)(`button`,{type:`button`,className:`approval-btn approval-btn-approve`,style:{whiteSpace:`nowrap`,padding:`9px 16px`,borderRadius:`var(--radius-sm, 8px)`},disabled:b?i.size===0&&!n.trim():!n.trim(),onClick:()=>t(!0,!1,b?S():n.trim()),children:`Submit`})]})}),(0,nC.jsxs)(`button`,{type:`button`,className:`claude-choice-card variant-cancel`,onClick:()=>t(!1),style:{marginTop:2},children:[(0,nC.jsxs)(`div`,{className:`claude-choice-left`,children:[(0,nC.jsx)(`span`,{className:`claude-choice-key`,children:`✕`}),(0,nC.jsx)(`div`,{className:`claude-choice-text`,children:(0,nC.jsx)(`span`,{className:`claude-choice-title`,children:`Decline / Skip`})})]}),(0,nC.jsx)(`div`,{className:`claude-choice-right`,children:`›`})]})]}):(0,nC.jsx)(`div`,{className:`claude-choice-stack`,children:T.map(e=>(0,nC.jsxs)(`button`,{type:`button`,className:`claude-choice-card variant-${e.variant}`,onClick:e.action,children:[(0,nC.jsxs)(`div`,{className:`claude-choice-left`,children:[(0,nC.jsx)(`span`,{className:`claude-choice-key`,children:e.key}),(0,nC.jsx)(`div`,{className:`claude-choice-text`,children:(0,nC.jsx)(`span`,{className:`claude-choice-title`,children:e.title})})]}),(0,nC.jsx)(`div`,{className:`claude-choice-right`,children:`›`})]},e.key))})]})}),o&&m&&(0,nC.jsx)(QS,{isOpen:o,onClose:()=>s(!1),filePath:p,diffText:m,isDangerous:c.isDangerous,onApprove:()=>{s(!1),t(!0)},onReject:()=>{s(!1),t(!1)}})]})}var tC,nC,rC=t((()=>{tC=e(i()),qS(),ib(),$S(),nC=a()}));function iC({thoughts:e,isLive:t=!1,blockKey:n,expanded:r,onExpandedChange:i,showEmptyHint:a=!1,variant:o=`default`}){let s=(0,aC.useRef)(null),c=r!==void 0&&!!i,[l,u]=(0,aC.useState)(t),d=c?!!r:l,f=e=>{c&&i?i(n,e):u(e)};return(0,aC.useEffect)(()=>{t&&!c&&u(!0)},[t,c]),(0,aC.useEffect)(()=>{t&&d&&s.current&&(s.current.scrollTop=s.current.scrollHeight)},[e,t,d]),e.length===0&&!a?null:e.length===0?(0,oC.jsx)(`div`,{className:`thinking-block thinking-block-empty-state`,"data-live":t?`true`:`false`,children:(0,oC.jsx)(`span`,{className:`thinking-block-empty`,children:sC.emptyHint})}):(0,oC.jsxs)(`div`,{className:`thinking-block${t?` is-live`:``}${d?` is-expanded`:``}${o===`extended`?` is-extended`:``}`,children:[(0,oC.jsxs)(`button`,{type:`button`,className:`thinking-block-header`,onClick:()=>f(!d),"aria-expanded":d,children:[(0,oC.jsx)(ge,{size:14,className:`thinking-block-icon`,style:{flexShrink:0}}),(0,oC.jsx)(`span`,{className:`thinking-block-label`,children:o===`extended`?t?sC.extendedLive:sC.extendedCompleted:t?sC.live:sC.completed}),t&&(0,oC.jsx)(`span`,{className:`thinking-block-live-dot`,"aria-hidden":`true`}),(0,oC.jsx)(`span`,{className:`thinking-block-chevron${d?` is-open`:``}`,"aria-hidden":`true`,children:(0,oC.jsx)(ae,{size:13,strokeWidth:2.2})})]}),d&&(0,oC.jsx)(`div`,{className:`thinking-block-body`,children:(0,oC.jsx)(`div`,{className:`thinking-block-content`,ref:s,children:e.map((e,t)=>(0,oC.jsx)(`div`,{className:`thinking-block-step`,children:(0,oC.jsx)(`div`,{className:`thinking-block-step-body`,children:Uy(e)})},`${n}-${t}`))})})]})}var aC,oC,sC,cC=t((()=>{aC=e(i()),A(),ib(),oC=a(),sC={live:`Thinking…`,completed:`Thinking process`,extendedLive:`Thinking…`,extendedCompleted:`Thought`,emptyHint:`No thoughts recorded`}})),lC,uC,dC,fC=t((()=>{lC=e(i()),ib(),uC=a(),dC=(0,lC.memo)(function({questions:e,header:t,className:n}){if(!e||e.length===0)return null;let r=e.length,i=r===1?`1 question`:`${r} questions`,a=t?`${i} · ${t}`:i;return(0,uC.jsxs)(`div`,{className:`modern-ask-user-card ${n||``}`.trim(),"data-testid":`ask-user-activity-card`,children:[(0,uC.jsxs)(`div`,{className:`modern-ask-user-header`,children:[(0,uC.jsx)(`span`,{className:`modern-ask-user-header-icon`,"aria-hidden":`true`,children:(0,uC.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`modern-ask-user-icon`,children:[(0,uC.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`4`}),(0,uC.jsx)(`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`}),(0,uC.jsx)(`line`,{x1:`12`,y1:`17`,x2:`12.01`,y2:`17`,strokeWidth:`2.5`})]})}),(0,uC.jsx)(`span`,{className:`modern-ask-user-header-text`,children:a})]}),(0,uC.jsx)(`div`,{className:`modern-ask-user-items`,children:e.map((e,t)=>(0,uC.jsxs)(`div`,{className:`modern-ask-user-item`,children:[(0,uC.jsx)(`div`,{className:`modern-ask-user-question`,children:Uy(e.question)??e.question}),e.answer&&(0,uC.jsx)(`div`,{className:`modern-ask-user-answer`,children:Uy(e.answer)??e.answer})]},t))})]})})}));function pC({thought:e}){let t=fS(e);return t?(0,V.jsx)(`div`,{className:`inline-thought-note`,children:(0,V.jsx)(`div`,{className:`inline-thought-note-text`,children:Uy(t)??t})}):null}function mC(e){let t=e.split(` #`)[0].trim().split(`/`);return t[t.length-1]}function hC(e,t,n){if(e===`file`||n===`read_file`||n===`write_file`||n===`edit_file`||n===`apply_patch`||n===`apply_code_edits`){let e=mC(t),n=my(e,fy(e));return n?(0,V.jsx)(`img`,{src:n,alt:``,draggable:!1,className:`agent-activity-icon-img`}):(0,V.jsx)(ve,{size:16,className:`agent-activity-kind-icon`})}if(e===`folder`||n===`list_files`||n===`list_directory`||n===`list_dir`){let e=py(mC(t),!1);return e?(0,V.jsx)(`img`,{src:e,alt:``,draggable:!1,className:`agent-activity-icon-img`}):(0,V.jsx)(ce,{size:16,className:`agent-activity-kind-icon`})}return e===`calc`||n===`calculation`?(0,V.jsx)(y,{size:16,className:`agent-activity-kind-icon`}):e===`search`?(0,V.jsx)(h,{size:16,className:`agent-activity-kind-icon`}):e===`terminal`?(0,V.jsx)(Te,{size:16,className:`agent-activity-kind-icon`}):(0,V.jsx)(_,{size:16,className:`agent-activity-kind-icon`})}function gC(e,t){if(!t||!t.trim()||e===`view_image`||e===`read_file`||e===`write_file`||e===`edit_file`||e===`apply_patch`)return null;if(e===`list_files`||e===`list_directory`||e===`list_dir`){let e=rS(t);if(e)return`→ ${e}`}let n=iS(t).trim().split(`
|
|
70
|
+
`)[0].trim();if(n.startsWith(`[`)||n.startsWith(`{`)||n.startsWith(`Error:`)||n===`(no output)`)return null;if(e===`calculation`){let e=n.indexOf(`=`);if(e!==-1){let t=n.slice(e+1).trim();if(t.length>0&&t.length<30)return`→ ${t}`}}return n.length>0&&n.length<=35?`→ ${n}`:null}function _C(e){return e===`active`?(0,V.jsx)(Le,{size:13,className:`agent-activity-status-spin`}):e===`retry`?(0,V.jsx)(`span`,{className:`agent-activity-badge retry`,title:`Encountered an error but agent retried`,children:`Retried`}):e===`error`?(0,V.jsx)(`span`,{className:`agent-activity-badge error`,title:`Action failed`,children:`Failed`}):(0,V.jsx)(u,{size:13,className:`agent-activity-status-check`})}function vC({entries:e,workspacePath:t,onReferenceFile:n}){if(e.length===0)return(0,V.jsx)(`div`,{className:`modern-directory-empty`,children:`(empty directory)`});let r=e=>{if(e.name)return e.name;if(e.path){let t=e.path.split(/[/\\]/);return t[t.length-1]||e.path}return``};return(0,V.jsx)(`div`,{className:`modern-directory-listing`,role:`list`,children:e.map((e,i)=>{let a=r(e),o=(e.kind||``).toLowerCase(),s=o===`directory`||o===`dir`||o===`folder`,c=s?``:fy(a),l=null;l=s?py(a,!1):my(a,c);let u=s?``:eS(e.size),d=e.path||a;return(0,V.jsxs)(`div`,{className:`modern-directory-item ${s?`is-directory`:`is-file`}`,role:`listitem`,title:d,children:[(0,V.jsx)(`span`,{className:`modern-directory-item-icon`,"aria-hidden":`true`,children:l?(0,V.jsx)(`img`,{src:l,alt:``,draggable:!1,className:`agent-activity-icon-img`}):s?(0,V.jsx)(ce,{size:15,className:`agent-activity-kind-icon`}):(0,V.jsx)(ve,{size:15,className:`agent-activity-kind-icon`})}),(0,V.jsxs)(`span`,{className:`modern-directory-item-name`,draggable:!s,onDragStart:s?void 0:e=>{e.stopPropagation(),bb(e.dataTransfer,{path:d,root:t,kind:`file`})},children:[a,s?`/`:``]}),u&&(0,V.jsx)(`span`,{className:`modern-directory-item-size`,children:u}),n&&!s&&(0,V.jsx)(`button`,{type:`button`,className:`agent-activity-mention-btn modern-dir-mention-btn`,onClick:e=>{e.stopPropagation(),n(d)},title:`Reference in chat: ${a}`,"aria-label":`Reference ${a} in chat`,children:`@`})]},`${a}-${i}`)})})}function yC({activityView:e,progress:t,chatId:n,workspacePath:r,onReferenceFile:i,onOpenArtifact:a}){let o=e.groups||sS(e.items),[s,c]=(0,bC.useState)({}),[l,u]=(0,bC.useState)({}),d=e=>{c(t=>({...t,[e]:!t[e]}))},f=(e,t=!1)=>{u(n=>({...n,[e]:!(n[e]??t)}))},p=(e,t)=>{if(gS(e)&&(e.state===`done`||e.askUserData?.questions.some(e=>!!e.answer)||e.target.startsWith(`(Answered:`)||e.result?.startsWith(`User answered:`))){let n=_S(e);if(n.length>0)return(0,V.jsx)(dC,{questions:n,header:e.askUserData?.header},t)}let o=!!l[t],s=e.result?.trim(),c=gC(e.action,s),u=e.kind===`file`||e.action===`write_file`||e.action===`edit_file`||e.action===`read_file`,d=e.kind===`folder`||e.action===`list_files`||e.action===`list_directory`||e.action===`list_dir`,p=u||d,m=e.action===`run_shell`||e.action===`run_command`||e.action===`bash`||e.kind===`terminal`,h=e.target?e.target.split(` #`)[0].trim():``,g=mC(h),_=e.semanticVerb||(m?`Ran`:d?`Explored`:u?e.action===`read_file`?`Analyzed`:`Edited`:e.label||e.action||`Executed`);return(0,V.jsxs)(bC.Fragment,{children:[(0,V.jsxs)(`div`,{className:`agent-activity-item modern-timeline-row ${o?`is-expanded`:``}`,"data-kind":e.kind,"data-state":e.state,style:{cursor:s?`pointer`:`default`},onClick:()=>s&&f(t),children:[(0,V.jsx)(`span`,{className:`modern-timeline-verb`,children:_}),p&&(0,V.jsx)(`span`,{className:`modern-timeline-icon-wrap`,"aria-hidden":`true`,children:hC(e.kind,h,e.action)}),(0,V.jsxs)(`span`,{className:`agent-activity-text modern-timeline-target ${u?`is-file-target`:``}`,title:u?`Drag file to chat or click @ to reference: ${h}`:e.target,children:[(0,V.jsx)(`span`,{className:`agent-activity-target-text ${u?`is-file-target`:``}`,draggable:u,onDragStart:u?e=>{e.stopPropagation(),bb(e.dataTransfer,{path:h,root:r,kind:`file`})}:void 0,children:u?g:e.intentTitle||e.target}),e.lineRange&&(0,V.jsx)(`span`,{className:`modern-timeline-line-range`,children:e.lineRange}),e.diffStats&&(e.diffStats.additions>0||e.diffStats.deletions>0)&&(0,V.jsxs)(`span`,{className:`modern-timeline-diff-stats`,children:[e.diffStats.additions>0&&(0,V.jsxs)(`span`,{className:`diff-stat-add`,children:[`+`,e.diffStats.additions]}),e.diffStats.deletions>0&&(0,V.jsxs)(`span`,{className:`diff-stat-del`,children:[`-`,e.diffStats.deletions]})]}),c&&(0,V.jsx)(`span`,{className:`agent-activity-inline-result`,children:c})]}),(0,V.jsxs)(`span`,{className:`agent-activity-status-col modern-timeline-status-col`,children:[i&&u&&h&&(0,V.jsx)(`button`,{type:`button`,className:`agent-activity-mention-btn`,onClick:e=>{e.stopPropagation(),i(h)},title:`Reference in chat: ${g}`,"aria-label":`Reference ${g} in chat`,children:`@`}),_C(e.state),s&&(0,V.jsx)(ae,{size:12,className:`modern-timeline-chevron${o?` is-open`:``}`,"aria-hidden":`true`})]})]}),e.viewedImage&&(0,V.jsx)(`div`,{className:`agent-activity-inline-preview`,children:(0,V.jsx)(Ex,{image:e.viewedImage,chatId:n,variant:`inline`,onOpenArtifact:a})}),o&&s&&(Qx(e.action,e.target,s)?(0,V.jsx)(`div`,{className:`agent-activity-thought-body modern-thought-body modern-timeline-prose`,children:Uy($x(s))??s}):(0,V.jsx)(`div`,{className:`agent-activity-output modern-timeline-output`,children:(()=>{let t=e.action===`list_files`||e.action===`list_directory`||e.action===`list_dir`||e.kind===`folder`?tS(s):null;return t?(0,V.jsx)(vC,{entries:t,workspacePath:r,onReferenceFile:i}):s.includes(`[Self-Correction Guidance]`)?(0,V.jsxs)(V.Fragment,{children:[s.split(`[Self-Correction Guidance]`)[0]?.trim()&&(0,V.jsx)(`pre`,{children:iS(s.split(`[Self-Correction Guidance]`)[0]?.trim())}),(0,V.jsxs)(`div`,{className:`diagnostic-guidance-card`,children:[(0,V.jsx)(`div`,{className:`diagnostic-guidance-header`,children:(0,V.jsx)(`span`,{children:`💡 Self-Correction Guidance`})}),(0,V.jsx)(`pre`,{children:s.split(`[Self-Correction Guidance]`)[1]?.trim()})]})]}):(0,V.jsx)(`pre`,{children:iS(s)})})()}))]},t)},m=e=>{if(e.action===`ask_user`&&(e.state===`done`||e.items.some(e=>!!e.askUserData?.questions.some(e=>!!e.answer)||e.target.startsWith(`(Answered:`)||!!e.result?.startsWith(`User answered:`)))){let t=e.items.flatMap(_S);if(t.length>0)return(0,V.jsx)(dC,{questions:t},e.id)}let r=!!s[e.id],i=e.semanticVerb||(e.action?.includes(`shell`)||e.action?.includes(`command`)?`Ran`:e.label||e.action||`Executed`);return(0,V.jsxs)(`div`,{className:`agent-activity-group modern-timeline-group`,children:[(0,V.jsxs)(`div`,{className:`agent-activity-group-header modern-timeline-row modern-group-row${r?` is-expanded`:``}`,"data-state":e.state,onClick:()=>d(e.id),children:[(0,V.jsx)(`span`,{className:`modern-timeline-verb`,children:i}),(0,V.jsx)(`span`,{className:`agent-activity-group-title modern-timeline-target`,children:e.title}),(0,V.jsxs)(`span`,{className:`modern-timeline-status-col`,children:[(0,V.jsx)(`span`,{className:`modern-timeline-count-badge`,children:e.count}),_C(e.state),(0,V.jsx)(ae,{size:12,className:`modern-timeline-chevron${r?` is-open`:``}`,"aria-hidden":`true`})]})]}),r&&(0,V.jsxs)(`div`,{className:`agent-activity-group-subitems modern-group-subitems`,children:[e.items.map((t,n)=>{let r=`${e.id}-${n}-${t.target}`;return p(t,r)}),e.action===`mcp_tool`&&t&&(0,V.jsx)(`div`,{className:`agent-activity-mcp-details`,style:{padding:`4px 12px 10px 24px`},children:(0,V.jsx)(bx,{progress:t,chatId:n,mode:`artifacts-only`})})]})]},e.id)};return(0,V.jsx)(`div`,{className:`agent-activity-list modern-activity-list`,children:e.timeline&&e.timeline.length>0?e.timeline.map((e,t)=>{if(e.kind===`thought`)return(0,V.jsx)(pC,{thought:e.thought},e.id||`thought-${t}`);if(e.kind===`extendedThinking`){let n=e.id||`ext-thought-${t}`,r=l[n]??!!e.streaming,i=e.elapsedMs?`${Math.max(1,Math.round(e.elapsedMs/1e3))}s`:``,a=e.streaming?`Thinking…`:i?`Thought for ${i}`:`Thought`;return(0,V.jsxs)(`div`,{className:`agent-activity-thought-step modern-timeline-thought-item`,children:[(0,V.jsx)(`div`,{className:`agent-activity-thought-header modern-timeline-row modern-thought-row${r?` is-expanded`:``}`,onClick:()=>f(n,!!e.streaming),children:(0,V.jsxs)(`span`,{className:`modern-timeline-thought-label`,children:[a,(0,V.jsx)(ae,{size:12,className:`modern-timeline-chevron inline-chevron${r?` is-open`:``}`,"aria-hidden":`true`})]})}),r&&(0,V.jsx)(`div`,{className:`agent-activity-thought-body modern-thought-body`,children:e.streaming?(0,V.jsxs)(V.Fragment,{children:[e.thought,(0,V.jsx)(`span`,{className:`agent-activity-thought-cursor`,children:`▍`})]}):Uy(e.thought)??e.thought})]},n)}return e.kind===`activity`?p(e.activity,e.id||`act-${t}`):e.kind===`group`?m(e.group):null}):o.map((e,t)=>{if(e.count<=1){let n=e.items[0],r=`${t}-0-${n.label}-${n.target}`;return p(n,r)}return m(e)})})}var bC,V,xC=t((()=>{bC=e(i()),yS(),vy(),ib(),Ax(),fC(),xx(),kb(),V=a(),A()}));function SC(e){let t=new Map,n=!1;for(let r of e||[])if(r.type===`Thinking`)n=!0;else if(r.type===`SubagentStarted`){n=!0;let{subagent:e,task:i}=r.data,a=t.get(e);a?(a.status=`running`,i&&(a.taskSnippet=i.length>80?`${i.slice(0,77)}...`:i)):(a={name:e,taskSnippet:i&&i.length>80?`${i.slice(0,77)}...`:i,status:`running`,tools:[]},t.set(e,a))}else if(r.type===`SubagentFinished`){let{subagent:e,status:n,elapsedMs:i,elapsed_ms:a,summaryPreview:o,summary_preview:s}=r.data,c=t.get(e);c&&(c.status=n===`completed`?`completed`:`failed`,c.currentTool=void 0,c.elapsedMs=i??a,c.summaryPreview=o??s)}else if(r.type===`ToolStart`){n=!0;let e=r.data.action,i=r.data.subagent;if(e===`dispatch_agents`){let e=r.data.input?.tasks||[];for(let n of e){let e=n.role&&typeof n.role==`string`&&n.role.toLowerCase()!==`null`,r=n.base&&typeof n.base==`string`&&n.base.toLowerCase()!==`null`,i=e?n.role:r?n.base:`agent`,a=typeof n.instruction==`string`?n.instruction.trim():``,o=a&&a.toLowerCase()!==`null`?a:`Working on task...`;t.has(i)||t.set(i,{name:i,taskSnippet:o.length>80?`${o.slice(0,77)}...`:o,status:`running`,tools:[]})}}else if(e===`dispatch_subagent`){let e=r.data.input?.name,n=typeof e==`string`&&e.toLowerCase()!==`null`&&e.trim()?e.trim():`subagent`,i=r.data.input?.instruction,a=typeof i==`string`&&i.toLowerCase()!==`null`&&i.trim()?i.trim():`Working on task...`;t.has(n)||t.set(n,{name:n,taskSnippet:a.length>80?`${a.slice(0,77)}...`:a,status:`running`,tools:[]})}if(i){let n=t.get(i);n||(n={name:i,status:`running`,tools:[]},t.set(i,n)),n.status=`running`,n.currentTool=e,n.tools.push({action:e,input:r.data.input})}}else if(r.type===`ToolEnd`){let e=r.data.action,n=r.data.subagent,i=r.data.result||``,a=i.startsWith(`Error:`);if(e===`dispatch_subagent`){let e=r.data.input?.name||`subagent`,n=t.get(e);n&&(n.status=a?`failed`:`completed`,n.currentTool=void 0)}if(n){let r=t.get(n);if(r){let t=r.tools[r.tools.length-1];t&&t.action===e&&(t.result=i,t.isError=a),r.currentTool=void 0}}}let r=Array.from(t.values());if(!(e||[]).some(e=>e.type===`SubagentStarted`||e.type===`SubagentFinished`))for(let e of r)!e.currentTool&&e.status===`running`&&(e.status=`completed`);return{orchestratorStatus:n?`running`:`completed`,subagents:r}}function CC({progress:e,isLive:t=!1}){let[n,r]=(0,wC.useState)(null),i=(0,wC.useMemo)(()=>SC(e),[e]),a=(0,wC.useMemo)(()=>n&&i.subagents.find(e=>e.name===n)||null,[i.subagents,n]);return i.subagents.length===0?(0,TC.jsxs)(`div`,{style:{padding:`24px`,textAlign:`center`,color:`var(--text-muted, #9ca3af)`,fontSize:`0.85rem`},children:[(0,TC.jsx)(`p`,{style:{margin:0,fontWeight:500},children:`No subagents dispatched in this turn`}),(0,TC.jsxs)(`p`,{style:{margin:`6px 0 0 0`,opacity:.7,fontSize:`0.78rem`},children:[`Subagents will appear here in an interactive DAG tree when the Main Agent invokes them via `,(0,TC.jsx)(`code`,{children:`dispatch_subagent`}),`.`]})]}):(0,TC.jsxs)(`div`,{className:`subagent-dag-container`,style:{display:`flex`,flexDirection:`column`,gap:`16px`,padding:`16px`},children:[(0,TC.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,gap:`28px`,position:`relative`,padding:`12px`},children:[(0,TC.jsxs)(`div`,{style:{display:`inline-flex`,alignItems:`center`,gap:`10px`,padding:`10px 18px`,borderRadius:`var(--radius-xl, 18px)`,background:`linear-gradient(135deg, var(--accent-subtle), color-mix(in srgb, var(--status-info, #3b82f6) 15%, transparent))`,border:`1px solid var(--accent-border)`,boxShadow:`var(--shadow-md)`,zIndex:2},children:[(0,TC.jsx)(`div`,{style:{width:`32px`,height:`32px`,borderRadius:`var(--radius-sm, 8px)`,background:`var(--accent)`,color:`var(--text-on-accent)`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:`0.75rem`,fontWeight:700},children:`M`}),(0,TC.jsxs)(`div`,{children:[(0,TC.jsx)(`div`,{style:{fontWeight:600,fontSize:`0.88rem`,color:`var(--text-primary)`},children:`Main orchestrator`}),(0,TC.jsxs)(`div`,{style:{fontSize:`0.72rem`,color:t?`var(--interactive-fg)`:`var(--text-muted)`,display:`flex`,alignItems:`center`,gap:`4px`},children:[(0,TC.jsx)(`span`,{style:{width:`6px`,height:`6px`,borderRadius:`50%`,background:t?`var(--interactive-fg)`:`var(--text-muted)`,display:`inline-block`}}),t?`Active Session`:`Completed`]})]})]}),(0,TC.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,justifyContent:`center`,gap:`16px`,width:`100%`,position:`relative`,zIndex:2},children:i.subagents.map(e=>{let t=n===e.name,i=e.status===`running`?`var(--status-info, #3b82f6)`:e.status===`failed`?`var(--status-error, #ef4444)`:`var(--interactive-fg)`;return(0,TC.jsxs)(`div`,{onClick:()=>r(t?null:e.name),style:{display:`flex`,flexDirection:`column`,width:`260px`,padding:`12px`,borderRadius:`var(--radius-lg, 14px)`,background:t?`var(--bg-surface-raised)`:`var(--bg-surface)`,border:`1px solid ${t?i:`var(--border-default)`}`,cursor:`pointer`,boxShadow:t?`var(--shadow-md)`:`var(--shadow-sm)`,transition:`all 0.2s ease`},children:[(0,TC.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:`8px`},children:[(0,TC.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,TC.jsx)(`span`,{style:{width:`8px`,height:`8px`,borderRadius:`50%`,background:i,display:`inline-block`}}),(0,TC.jsx)(`span`,{style:{fontWeight:600,fontSize:`0.84rem`,color:`var(--text-primary)`},children:e.name})]}),(0,TC.jsx)(`span`,{style:{fontSize:`0.68rem`,fontWeight:600,padding:`2px 6px`,borderRadius:`var(--radius-2xs, 4px)`,textTransform:`none`,background:`color-mix(in srgb, ${i} 15%, transparent)`,color:i,border:`1px solid color-mix(in srgb, ${i} 30%, transparent)`},children:e.status===`running`&&e.currentTool?e.currentTool:e.status})]}),e.taskSnippet&&(0,TC.jsx)(`p`,{style:{margin:`0 0 8px 0`,fontSize:`0.74rem`,color:`var(--text-secondary)`,lineHeight:1.4},children:e.taskSnippet}),(0,TC.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,fontSize:`0.72rem`,color:`var(--text-muted)`,paddingTop:`6px`,borderTop:`1px solid var(--border-subtle)`},children:[(0,TC.jsxs)(`span`,{children:[e.tools.length,` tool `,e.tools.length===1?`call`:`calls`]}),(0,TC.jsx)(`span`,{style:{color:t?i:`var(--text-muted)`},children:t?`Hide Details ▲`:`View Logs ▼`})]})]},e.name)})})]}),a&&(0,TC.jsxs)(`div`,{style:{background:`var(--bg-surface-raised)`,border:`1px solid var(--border-default)`,borderRadius:`var(--radius-lg, 14px)`,padding:`14px`,marginTop:`8px`},children:[(0,TC.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:`12px`},children:[(0,TC.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,TC.jsxs)(`span`,{style:{fontWeight:600,fontSize:`0.86rem`,color:`var(--interactive-fg)`},children:[`Subagent Activity: `,a.name]}),(0,TC.jsxs)(`span`,{style:{fontSize:`0.75rem`,color:`var(--text-muted)`},children:[`(`,a.tools.length,`)`]})]}),(0,TC.jsx)(`button`,{type:`button`,onClick:()=>r(null),style:{background:`transparent`,border:`none`,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`0.8rem`},children:`Close`})]}),(0,TC.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`8px`,maxHeight:`300px`,overflowY:`auto`},children:a.tools.map((e,t)=>(0,TC.jsxs)(`div`,{style:{background:`var(--bg-surface-soft)`,border:`1px solid var(--border-subtle)`,borderRadius:`var(--radius-xs, 6px)`,padding:`8px 10px`,fontSize:`0.76rem`},children:[(0,TC.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:`4px`},children:[(0,TC.jsx)(`span`,{style:{fontWeight:600,color:`var(--status-info, #38bdf8)`},children:e.action}),e.isError&&(0,TC.jsx)(`span`,{style:{color:`var(--status-error, #f87171)`,fontWeight:600},children:`Failed`})]}),e.input&&(0,TC.jsx)(`pre`,{style:{margin:`4px 0`,padding:`4px 6px`,background:`var(--bg-canvas)`,border:`1px solid var(--border-subtle)`,borderRadius:`var(--radius-2xs, 4px)`,color:`var(--text-secondary)`,fontSize:`0.72rem`,overflowX:`auto`},children:JSON.stringify(e.input,null,2)}),e.result&&(0,TC.jsxs)(`div`,{style:{marginTop:`4px`,color:`var(--text-muted)`,fontSize:`0.72rem`,maxHeight:`100px`,overflowY:`auto`},children:[(0,TC.jsx)(`strong`,{children:`Result:`}),` `,e.result.slice(0,200),e.result.length>200?`...`:``]})]},t))})]})]})}var wC,TC,EC=t((()=>{wC=e(i()),TC=a()}));function DC({plan:e,className:t=``}){if(!e||!e.tasks||e.tasks.length===0)return null;let n=e.tasks.filter(e=>e.status===`completed`).length,r=e.tasks.length,i=Math.round(n/r*100);return(0,OC.jsxs)(`div`,{className:`plan-checklist-card ${t}`,children:[(0,OC.jsxs)(`div`,{className:`plan-checklist-header`,children:[(0,OC.jsxs)(`div`,{className:`plan-checklist-title`,children:[(0,OC.jsx)(we,{style:{width:`15px`,height:`15px`,color:`var(--interactive-fg)`}}),(0,OC.jsx)(`span`,{children:e.objective||`Task Plan`})]}),(0,OC.jsxs)(`span`,{className:`plan-checklist-count`,children:[n,`/`,r,` (`,i,`%)`]})]}),(0,OC.jsx)(`div`,{className:`plan-progress-track`,children:(0,OC.jsx)(`div`,{className:`plan-progress-bar`,style:{width:`${i}%`}})}),(0,OC.jsx)(`div`,{className:`plan-tasks-list`,children:e.tasks.map((e,t)=>{let n=e.status===`completed`,r=e.status===`in_progress`,i=e.status===`failed`;return(0,OC.jsxs)(`div`,{className:`plan-task-item ${r?`in-progress`:n?`completed`:i?`failed`:``}`,children:[(0,OC.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,flexShrink:0},children:[n&&(0,OC.jsx)(o,{style:{width:`14px`,height:`14px`,color:`var(--status-speaking, #22c55e)`}}),r&&(0,OC.jsx)(Le,{style:{width:`14px`,height:`14px`,color:`var(--status-listening, #7dd3fc)`,animation:`spin 1s linear infinite`}}),i&&(0,OC.jsx)(M,{style:{width:`14px`,height:`14px`,color:`var(--status-error, #ef4444)`}}),!n&&!r&&!i&&(0,OC.jsx)(m,{style:{width:`14px`,height:`14px`,color:`var(--text-muted)`}})]}),(0,OC.jsx)(`span`,{className:`plan-task-text`,children:e.title})]},e.id||t)})})]})}var OC,kC=t((()=>{i(),A(),OC=a()}));function AC(e){if(e<60)return{value:`${e.toFixed(1)}s`};let t=Math.floor(e/60),n=e%60,r=n<10?`0${n.toFixed(1)}`:n.toFixed(1);return t>=60?{value:`${Math.floor(t/60)}h ${t%60}m`,subtext:`${e.toFixed(1)}s`}:{value:`${t}m ${r}s`,subtext:`${e.toFixed(1)}s`}}function jC({summary:e,className:t=``}){let[n,r]=(0,MC.useState)(!1),i=(0,MC.useCallback)(()=>{try{let t=e.trajectory||{schemaVersion:`1.0`,runId:e.runId,chatId:`default`,task:e.task||`Agent Run`,model:`unknown`,provider:`unknown`,startedAt:new Date(Date.now()-e.durationSecs*1e3).toISOString(),completedAt:new Date().toISOString(),outcome:e.outcome,totalSteps:e.toolCallsCount,totalTokens:e.totalTokens,durationSecs:e.durationSecs,filesCreated:e.filesCreated||[],filesModified:(e.filesChanged||[]).filter(t=>!(e.filesCreated||[]).includes(t)),trajectory:(e.toolTimeline||[]).map((e,t)=>({step:e.step||t+1,timestamp:new Date().toISOString(),thought:``,action:e.action,input:{target:e.target},observation:e.success?`Success`:`Failed`,status:e.success?`success`:`failed`,durationMs:0,tokens:{inputTokens:0,generatedTokens:0}}))},n=JSON.stringify(t,null,2);if(typeof window<`u`&&typeof document<`u`){let t=new Blob([n],{type:`application/json`}),r=URL.createObjectURL(t),i=document.createElement(`a`);i.href=r,i.download=`${e.runId}-trajectory.json`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)}typeof navigator<`u`&&navigator.clipboard&&navigator.clipboard.writeText(n).catch(()=>{}),r(!0),setTimeout(()=>r(!1),2e3)}catch(e){console.error(`Failed to export trajectory:`,e)}},[e]),a=e.outcome===`SUCCESS`||e.outcome===`VERIFIED`,s=e.outcome===`PARTIAL`||e.outcome===`COMPLETED`,c=e.outcome===`ROLLED_BACK`,l=e.outcome===`UNVERIFIED`;e.outcome;let d=e.totalTokens>=1e3?`${(e.totalTokens/1e3).toFixed(1)}k`:e.totalTokens.toString(),f=AC(e.durationSecs),p=a||s?`run-summary-badge success`:c||l?`run-summary-badge rollback`:`run-summary-badge failure`,m=a?e.outcome===`VERIFIED`?`Verified`:`Success`:s?`Completed`:c?`Rolled Back`:l?`Unverified`:`Failure`;return(0,H.jsxs)(`div`,{className:`run-summary-card ${t}`,children:[(0,H.jsxs)(`div`,{className:`run-summary-header`,children:[(0,H.jsxs)(`div`,{className:`run-summary-title`,children:[(0,H.jsx)(be,{size:16,"aria-hidden":`true`}),(0,H.jsxs)(`span`,{className:`run-summary-heading`,children:[(0,H.jsx)(`strong`,{children:`Run summary`}),(0,H.jsxs)(`small`,{title:`Run ${e.runId}`,children:[`#`,e.runId]})]})]}),(0,H.jsxs)(`div`,{className:`run-summary-actions`,children:[(0,H.jsxs)(`button`,{type:`button`,className:`run-summary-export-btn`,onClick:i,title:`Export SWE-bench / Agent Protocol compliant trajectory JSON`,"aria-label":`Export trajectory`,children:[n?(0,H.jsx)(u,{style:{width:`12px`,height:`12px`}}):(0,H.jsx)(Fe,{style:{width:`12px`,height:`12px`}}),(0,H.jsx)(`span`,{children:n?`Exported!`:`Export Trajectory`})]}),(0,H.jsxs)(`span`,{className:p,children:[(a||s)&&(0,H.jsx)(o,{style:{width:`12px`,height:`12px`}}),(c||l)&&(0,H.jsx)(ie,{style:{width:`12px`,height:`12px`}}),!a&&!s&&!c&&!l&&(0,H.jsx)(M,{style:{width:`12px`,height:`12px`}}),(0,H.jsx)(`span`,{children:m})]})]})]}),(0,H.jsxs)(`div`,{className:`run-kpi-grid`,children:[(0,H.jsxs)(`div`,{className:`run-kpi-box`,children:[(0,H.jsxs)(`div`,{className:`run-kpi-label`,children:[(0,H.jsx)(Ve,{style:{width:`12px`,height:`12px`}}),(0,H.jsx)(`span`,{children:`Duration`})]}),(0,H.jsxs)(`div`,{className:`run-kpi-value`,title:`${e.durationSecs.toFixed(1)}s`,children:[f.value,f.subtext&&(0,H.jsxs)(`span`,{className:`run-kpi-subtext`,children:[` · `,f.subtext]})]})]}),(0,H.jsxs)(`div`,{className:`run-kpi-box`,children:[(0,H.jsxs)(`div`,{className:`run-kpi-label`,children:[(0,H.jsx)(De,{style:{width:`12px`,height:`12px`}}),(0,H.jsx)(`span`,{children:`Tokens`})]}),(0,H.jsx)(`div`,{className:`run-kpi-value`,children:d})]}),(0,H.jsxs)(`div`,{className:`run-kpi-box`,children:[(0,H.jsxs)(`div`,{className:`run-kpi-label`,children:[(0,H.jsx)(_,{style:{width:`12px`,height:`12px`}}),(0,H.jsx)(`span`,{children:`Tools`})]}),(0,H.jsxs)(`div`,{className:`run-kpi-value`,children:[e.toolCallsCount,e.retriesCount>0&&(0,H.jsxs)(`span`,{className:`run-kpi-subtext`,children:[` · `,e.retriesCount,` retried`]})]})]}),(0,H.jsxs)(`div`,{className:`run-kpi-box`,children:[(0,H.jsxs)(`div`,{className:`run-kpi-label`,children:[(0,H.jsx)(oe,{style:{width:`12px`,height:`12px`}}),(0,H.jsx)(`span`,{children:`Files`})]}),(0,H.jsx)(`div`,{className:`run-kpi-value`,children:e.filesCreated&&e.filesCreated.length>0&&e.filesChanged.length-e.filesCreated.length>0?(0,H.jsxs)(H.Fragment,{children:[e.filesCreated.length,` `,(0,H.jsx)(`span`,{className:`run-kpi-subtext`,children:`created`}),`, `,e.filesChanged.length-e.filesCreated.length,` `,(0,H.jsx)(`span`,{className:`run-kpi-subtext`,children:`modified`})]}):e.filesCreated&&e.filesCreated.length>0?(0,H.jsxs)(H.Fragment,{children:[e.filesCreated.length,` `,(0,H.jsx)(`span`,{className:`run-kpi-subtext`,children:`created`})]}):e.filesChanged.length>0?(0,H.jsxs)(H.Fragment,{children:[e.filesChanged.length,` `,(0,H.jsx)(`span`,{className:`run-kpi-subtext`,children:`modified`})]}):(0,H.jsxs)(H.Fragment,{children:[`0 `,(0,H.jsx)(`span`,{className:`run-kpi-subtext`,children:`files`})]})})]})]})]})}var MC,H,NC=t((()=>{MC=e(i()),A(),H=a()})),PC,FC,IC,LC=t((()=>{PC=e(i()),A(),yS(),xC(),EC(),kC(),NC(),FC=a(),IC=(0,PC.memo)(function({progress:e,activityView:t,rawProgress:n,id:r=``,isOpen:i,defaultOpen:a=!1,onToggle:o,historical:s,isHistorical:c,pendingApproval:l=!1,chatId:u,workspacePath:d,onReferenceFile:f,onOpenArtifact:p}){let m=e??n??[],h=s??c??!1,[g,_]=(0,PC.useState)(a),v=i===void 0?g:i,y=(0,PC.useCallback)(()=>{o?o(r):_(e=>!e)},[r,o]),[b,x]=(0,PC.useState)(`list`),S=(0,PC.useMemo)(()=>t??lS(m),[t,m]),C=(0,PC.useMemo)(()=>pS(m),[m]),w=(0,PC.useMemo)(()=>mS(m),[m]),T=(0,PC.useMemo)(()=>hS(m),[m]);if(S.items.length===0&&(!S.timeline||S.timeline.length===0)&&!C&&!w)return null;let E=()=>(0,FC.jsxs)(FC.Fragment,{children:[w&&(0,FC.jsx)(`div`,{style:{marginBottom:`12px`},children:(0,FC.jsx)(jC,{summary:w})}),C&&(0,FC.jsx)(`div`,{style:{marginBottom:`12px`},children:(0,FC.jsx)(DC,{plan:C})}),T&&(0,FC.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`flex-start`,gap:`8px`,marginBottom:`10px`,paddingBottom:`8px`,borderBottom:`1px solid var(--border)`},children:(0,FC.jsxs)(`div`,{style:{display:`inline-flex`,padding:`2px`,background:`var(--surface-strong)`,borderRadius:`var(--radius-xs, 6px)`,border:`1px solid var(--border)`},children:[(0,FC.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),x(`list`)},style:{background:b===`list`?`var(--accent)`:`transparent`,color:b===`list`?`var(--text-on-accent)`:`var(--text-muted)`,border:`none`,borderRadius:`var(--radius-2xs, 4px)`,padding:`3px 8px`,fontSize:`0.74rem`,fontWeight:500,cursor:`pointer`},children:`Activity List`}),(0,FC.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),x(`dag`)},style:{background:b===`dag`?`var(--accent)`:`transparent`,color:b===`dag`?`var(--text-on-accent)`:`var(--text-muted)`,border:`none`,borderRadius:`var(--radius-2xs, 4px)`,padding:`3px 8px`,fontSize:`0.74rem`,fontWeight:500,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:`4px`},children:[(0,FC.jsx)(`span`,{children:`Subagent DAG`}),(0,FC.jsx)(`span`,{style:{width:`6px`,height:`6px`,borderRadius:`50%`,background:`var(--status-listening, #38bdf8)`,display:`inline-block`}})]})]})}),b===`dag`&&T?(0,FC.jsx)(CC,{progress:m,isLive:!h}):S.items.length>0||S.timeline&&S.timeline.length>0?(0,FC.jsx)(yC,{activityView:S,progress:m,chatId:u,workspacePath:d,onReferenceFile:f,onOpenArtifact:p}):null]}),D=C?.objective||S.naturalSummary||S.summary||(w?`Run telemetry (${w.outcome})`:`Working through task`),O=S.durationText||(w?.durationSecs?`${Math.round(w.durationSecs)}s`:``),k=O?`Worked for ${O}`:h||w?`Worked`:`Working`;return h?(0,FC.jsxs)(`div`,{className:`agent-activity-history modern-activity-history`,children:[(0,FC.jsxs)(`button`,{type:`button`,className:`agent-activity-toggle modern-activity-toggle`,"aria-expanded":v,onClick:y,children:[(0,FC.jsxs)(`div`,{className:`modern-activity-header-left`,children:[(0,FC.jsx)(`span`,{className:`modern-activity-duration`,children:k}),(0,FC.jsx)(le,{size:13,className:`agent-activity-toggle-chevron${v?` is-open`:``}`,"aria-hidden":`true`})]}),(0,FC.jsx)(`span`,{className:`modern-activity-natural-summary`,children:D})]}),v&&(0,FC.jsx)(`div`,{className:`agent-activity-card modern-activity-card agent-activity-card-history`,children:E()})]}):(0,FC.jsx)(`div`,{className:`message ai-message agent-activity-message modern-activity-message`,children:(0,FC.jsxs)(`div`,{className:`agent-activity-card modern-activity-card`,children:[(0,FC.jsxs)(`div`,{className:`agent-activity-header modern-activity-header`,style:{cursor:`pointer`},onClick:y,children:[(0,FC.jsxs)(`div`,{className:`modern-activity-header-left`,children:[(0,FC.jsx)(`span`,{className:`modern-activity-duration`,children:k}),(0,FC.jsx)(le,{size:13,className:`agent-activity-toggle-chevron${v?` is-open`:``}`,"aria-hidden":`true`})]}),(0,FC.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:(0,FC.jsx)(`span`,{className:`agent-activity-status`,"data-state":l?`approval`:w?`done`:`active`,children:l?`Waiting for approval`:w?`Completed`:`Working`})})]}),(0,FC.jsxs)(`div`,{className:`modern-activity-subheader`,style:{cursor:`pointer`},onClick:y,children:[(0,FC.jsx)(`span`,{children:D}),(0,FC.jsx)(le,{size:12,className:`modern-activity-subchevron${v?` is-open`:``}`,"aria-hidden":`true`})]}),v&&(0,FC.jsx)(`div`,{className:`modern-activity-content`,children:E()})]})})})})),RC=t((()=>{}));function zC(e){let t=new Map;for(let n of e){let e=n.domain.toLowerCase().trim();if(t.has(e))t.get(e).items.push(n);else{let r=e;/^[^.]+\.com$/i.test(r)?r=r.replace(/\.com$/i,``):/^[^.]+\.org$/i.test(r)?r=r.replace(/\.org$/i,``):/^[^.]+\.net$/i.test(r)&&(r=r.replace(/\.net$/i,``)),t.set(e,{domain:n.domain,displayDomain:r,faviconUrl:n.faviconUrl,items:[n]})}}return Array.from(t.values())}var BC,VC,HC,UC,WC=t((()=>{BC=e(i()),VC=Ne(),ib(),ke(),RC(),HC=a(),UC=BC.memo(function({sources:e}){let[t,n]=(0,BC.useState)(!1),[r,i]=(0,BC.useState)(null),[a,o]=(0,BC.useState)({top:0,left:0,width:280,maxHeight:320}),s=(0,BC.useRef)(new Map),c=(0,BC.useRef)(null),l=(0,BC.useMemo)(()=>[...zC(e)].sort((e,t)=>{let n=+!!e.items[0]?.imageUrl;return+!!t.items[0]?.imageUrl-n}),[e]),u=e=>{let t=s.current.get(e);if(!t)return;let n=t.getBoundingClientRect();if(n.bottom<0||n.top>window.innerHeight){i(null);return}let r=Math.min(280,window.innerWidth-32),a=Math.max(0,window.innerHeight-n.bottom-12),c=Math.max(0,n.top-12),l=a<240&&c>a,u=Math.min(320,l?c:a),d=n.left;d+r>window.innerWidth-16&&(d=Math.max(16,n.right-r)),d=Math.max(16,Math.min(d,window.innerWidth-r-16));let f=l?Math.max(8,n.top-6-u):n.bottom+6;o({top:f,left:d,width:r,maxHeight:u})},d=e=>{r===e?i(null):(u(e),i(e))};if((0,BC.useLayoutEffect)(()=>{if(!r)return;u(r);let e=e=>{c.current?.contains(e.target)||u(r)};return window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[r]),(0,BC.useEffect)(()=>{if(!r)return;let e=e=>{let t=e.target,n=s.current.get(r);!c.current||c.current.contains(t)||n&&n.contains(t)||i(null)},t=e=>{e.key===`Escape`&&i(null)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[r]),!e||e.length===0)return null;let f=t?l:l.slice(0,3),p=l.slice(0,3).reduce((e,t)=>e+t.items.length,0),m=e.length-p,h=l.slice(3),_=r?l.find(e=>e.domain===r):null;return(0,HC.jsxs)(`div`,{className:`sources-block`,style:{display:`flex`,flexDirection:`column`,gap:`10px`,marginBottom:`12px`,marginTop:`4px`,position:r?`relative`:void 0,zIndex:r?30:void 0},children:[(0,HC.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,HC.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{color:`var(--text-muted)`},children:(0,HC.jsx)(`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20`})}),(0,HC.jsx)(`span`,{style:{fontSize:`0.85rem`,fontWeight:600,color:`var(--text-primary)`,letterSpacing:`0.01em`},children:`Sources`})]}),(0,HC.jsxs)(`div`,{className:`sources-cards`,style:{display:`flex`,flexWrap:`wrap`,gap:`8px`},children:[f.map((e,t)=>{let n=e.items[0],i=e.items.length-1,a=r===e.domain;return r&&l.find(e=>e.domain===r),(0,HC.jsx)(`div`,{ref:t=>{t?s.current.set(e.domain,t):s.current.delete(e.domain)},className:`source-card-group${a?` is-open`:``}`,style:{zIndex:a?50:void 0},children:(0,HC.jsxs)(`div`,{className:`source-card`,style:{justifyContent:`space-between`,borderRadius:`var(--radius-xl, 18px)`,background:`var(--bg-surface-soft)`,border:`1px solid var(--border-subtle)`,transition:`all 0.15s ease`,cursor:`pointer`,minHeight:`68px`,boxSizing:`border-box`,overflow:`hidden`},onClick:t=>{let r=t.target;i>0&&r.closest(`.extra-badge-btn`)?(t.stopPropagation(),d(e.domain)):g.openExternal(n.url).catch(e=>{console.error(`Failed to open source URL:`,e),window.open(n.url,`_blank`,`noopener,noreferrer`)})},onMouseEnter:e=>{let t=e.currentTarget;t.style.background=`var(--bg-surface-hover)`,t.style.borderColor=`var(--border-strong)`,t.style.transform=`translateY(-1px)`},onMouseLeave:e=>{let t=e.currentTarget;t.style.background=`var(--bg-surface-soft)`,t.style.borderColor=`var(--border-subtle)`,t.style.transform=`translateY(0)`},children:[n.imageUrl&&(0,HC.jsx)(`div`,{className:`source-card-thumbnail`,style:{overflow:`hidden`,background:`var(--bg-surface-raised)`,flexShrink:0},children:(0,HC.jsx)(`img`,{src:eb(n.imageUrl),alt:n.title,loading:`lazy`,referrerPolicy:`no-referrer`,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`},onError:e=>{e.currentTarget.parentElement.style.display=`none`}})}),(0,HC.jsxs)(`div`,{className:`source-card-content`,style:{display:`flex`,flexDirection:`column`,flex:1,padding:`10px 12px`},children:[(0,HC.jsx)(`div`,{title:n.title,style:{fontSize:`0.8rem`,fontWeight:500,color:`var(--text-primary)`,lineHeight:`1.3`,display:`-webkit-box`,WebkitLineClamp:2,WebkitBoxOrient:`vertical`,overflow:`hidden`,marginBottom:`8px`,wordBreak:`break-word`},children:n.title}),(0,HC.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginTop:`auto`,paddingTop:`2px`},children:[(0,HC.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`6px`,overflow:`hidden`,marginRight:`6px`},children:[(0,HC.jsx)(`img`,{src:e.faviconUrl,alt:``,width:14,height:14,style:{borderRadius:`var(--radius-xs, 6px)`,flexShrink:0},onError:e=>{e.currentTarget.style.display=`none`}}),(0,HC.jsx)(`span`,{style:{fontSize:`0.73rem`,color:`var(--text-muted)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.displayDomain})]}),i>0?(0,HC.jsxs)(`button`,{type:`button`,className:`extra-badge-btn`,title:`${i} extra page${i>1?`s`:``} from ${e.domain} — click to view`,style:{fontSize:`0.68rem`,fontWeight:600,color:`var(--interactive-fg)`,background:`var(--accent-subtle)`,border:`1px solid var(--accent-border)`,padding:`1px 6px`,borderRadius:`var(--radius-xs, 6px)`,flexShrink:0,cursor:`pointer`,display:`flex`,alignItems:`center`,gap:`2px`},onClick:t=>{t.stopPropagation(),d(e.domain)},children:[`+`,i]}):(0,HC.jsxs)(`span`,{style:{fontSize:`0.7rem`,color:`var(--text-muted)`,fontWeight:500,flexShrink:0},children:[`•`,t+1]})]})]})]})},e.domain)}),!t&&m>0&&(0,HC.jsxs)(`button`,{type:`button`,className:`sources-more-button`,"aria-expanded":!1,onClick:()=>n(!0),style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`10px 14px`,borderRadius:`var(--radius-xl, 18px)`,background:`var(--bg-surface-soft)`,border:`1px solid var(--border-subtle)`,cursor:`pointer`,transition:`all 0.15s ease`,boxSizing:`border-box`},onMouseEnter:e=>{let t=e.currentTarget;t.style.background=`var(--bg-surface-hover)`,t.style.borderColor=`var(--border-strong)`,t.style.transform=`translateY(-1px)`},onMouseLeave:e=>{let t=e.currentTarget;t.style.background=`var(--bg-surface-soft)`,t.style.borderColor=`var(--border-subtle)`,t.style.transform=`translateY(0)`},children:[(0,HC.jsx)(`div`,{style:{display:`flex`,alignItems:`center`},children:h.slice(0,3).map((e,t)=>(0,HC.jsx)(`img`,{src:e.faviconUrl,alt:``,width:18,height:18,style:{borderRadius:`50%`,border:`1.5px solid var(--bg-surface)`,marginLeft:t===0?0:`-6px`,background:`var(--bg-surface-raised)`,objectFit:`cover`},onError:e=>{e.currentTarget.style.display=`none`}},t))}),(0,HC.jsxs)(`span`,{style:{fontSize:`0.78rem`,fontWeight:500,color:`var(--text-secondary)`,marginLeft:`8px`},children:[`View `,m,` more`]})]})]}),t&&l.length>3&&(0,HC.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-start`,marginTop:`4px`},children:(0,HC.jsx)(`button`,{type:`button`,onClick:()=>{n(!1),i(null)},style:{background:`var(--bg-surface-soft)`,border:`1px solid var(--border-subtle)`,borderRadius:`var(--radius-sm, 8px)`,padding:`4px 10px`,color:`var(--text-secondary)`,fontSize:`0.73rem`,fontWeight:500,cursor:`pointer`,transition:`background 0.15s`},onMouseEnter:e=>{e.currentTarget.style.background=`var(--bg-surface-hover)`},onMouseLeave:e=>{e.currentTarget.style.background=`var(--bg-surface-soft)`},children:`Show less`})}),_&&typeof document<`u`&&(0,VC.createPortal)((0,HC.jsxs)(`div`,{ref:c,className:`source-links-popover`,style:{position:`fixed`,top:a.top,left:a.left,width:a.width,maxHeight:a.maxHeight,background:`var(--bg-overlay)`,border:`1px solid var(--border-default)`,borderRadius:`var(--radius-lg, 14px)`,boxShadow:`0 16px 36px rgba(0, 0, 0, 0.55), 0 4px 12px rgba(0, 0, 0, 0.4)`,zIndex:1e4,padding:`6px`,display:`flex`,flexDirection:`column`,gap:`4px`,boxSizing:`border-box`,overflow:`hidden`},onClick:e=>e.stopPropagation(),children:[(0,HC.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`4px 6px`,borderBottom:`1px solid var(--border-subtle)`,flexShrink:0},children:[(0,HC.jsxs)(`span`,{style:{fontSize:`0.72rem`,fontWeight:600,color:`var(--text-muted)`},children:[`All links from `,_.domain,` (`,_.items.length,`)`]}),(0,HC.jsx)(`button`,{type:`button`,style:{background:`none`,border:`none`,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`0.85rem`,padding:`0 4px`,lineHeight:1,borderRadius:`var(--radius-xs, 6px)`},onClick:()=>i(null),"aria-label":`Close`,children:`✕`})]}),(0,HC.jsx)(`div`,{className:`source-links-popover-list`,style:{flex:1,overflowY:`auto`,display:`flex`,flexDirection:`column`,gap:`4px`,paddingRight:`2px`,overscrollBehavior:`contain`},children:_.items.map((e,t)=>(0,HC.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,style:{display:`flex`,flexDirection:`column`,gap:`2px`,padding:`6px 8px`,borderRadius:`var(--radius-sm, 8px)`,color:`var(--text-primary)`,textDecoration:`none`,fontSize:`0.75rem`,background:`var(--bg-surface-soft)`,transition:`background 0.15s`,flexShrink:0},onClick:t=>{t.preventDefault(),g.openExternal(e.url).catch(t=>{console.error(`Failed to open source URL:`,t),window.open(e.url,`_blank`,`noopener,noreferrer`)})},onMouseEnter:e=>{e.currentTarget.style.background=`var(--bg-surface-hover)`},onMouseLeave:e=>{e.currentTarget.style.background=`var(--bg-surface-soft)`},children:[(0,HC.jsxs)(`div`,{style:{fontWeight:500,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:[t+1,`. `,e.title]}),(0,HC.jsx)(`div`,{style:{fontSize:`0.68rem`,color:`var(--text-muted)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.url})]},t))})]}),document.body)]})})}));function GC(e){if(e.length===0)return``;let t=e.map(e=>{let t=e.replace(/\\/g,`/`),n=t.lastIndexOf(`/`);return n===-1?``:t.substring(0,n)});if(t.length===1)return t[0];if(t.some(e=>!e))return``;let n=t[0].split(`/`),r=[];for(let e=0;e<n.length;e++){let i=n[e];if(t.every(t=>t.split(`/`)[e]===i))r.push(i);else break}return r.join(`/`)}var KC,U,qC,JC,YC=t((()=>{KC=e(i()),A(),px(),ke(),Mb(),kb(),vy(),We(),U=a(),{listGitCheckpoints:qC}=Ae,JC=(0,KC.memo)(function({progress:e,changes:t,interaction:n,isLive:r=!1,defaultOpen:i=!1,workspacePath:a,onOpenArtifact:o,onOpenReview:s,onRewindRequest:c,onRewindError:l,onReferenceFile:u}){let d=(0,KC.useMemo)(()=>t??cx(e??dx),[t,e]),[f,p]=(0,KC.useState)(i),[m,h]=(0,KC.useState)(!1),[g,_]=(0,KC.useState)({}),v=(0,KC.useMemo)(()=>GC(d.map(e=>e.path)),[d]);if(d.length===0)return null;let y=d.reduce((e,t)=>e+t.additions,0),b=d.reduce((e,t)=>e+t.deletions,0),x=d.filter(e=>e.created).length,S=d.length-x,C=``;C=x>0&&S===0?`${x} ${x===1?`file created`:`files created`}`:`${d.length} ${d.length===1?`file changed`:`files changed`}`;let w=m?d:d.slice(0,3);return(0,U.jsx)(`div`,{className:`file-changes-summary-container ${r?`is-live`:``}`,children:(0,U.jsxs)(`div`,{className:`agent-activity-card file-changes-card`,children:[(0,U.jsxs)(`div`,{className:`file-changes-summary-row ${f?`is-open`:``}`,onClick:()=>p(e=>!e),role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),p(e=>!e))},children:[(0,U.jsxs)(`div`,{className:`file-changes-summary-toggle`,children:[(0,U.jsx)(`span`,{className:`file-changes-summary-label`,children:C}),(0,U.jsxs)(`span`,{className:`file-changes-summary-counts`,children:[y>0&&(0,U.jsxs)(`span`,{className:`file-changes-count-add`,children:[`+`,y]}),b>0&&(0,U.jsxs)(`span`,{className:`file-changes-count-del`,children:[`-`,b]})]}),(0,U.jsx)(ae,{size:13,className:`file-changes-chevron ${f?`is-open`:``}`,"aria-hidden":`true`})]}),(0,U.jsxs)(`div`,{className:`file-changes-summary-actions`,onClick:e=>e.stopPropagation(),children:[c&&(0,U.jsxs)(`button`,{type:`button`,className:`file-changes-rewind-btn`,onClick:async e=>{if(e.stopPropagation(),!n||!c)return;let t=n.chatId||`cli`;try{let e=await qC(t);if(!e||e.length===0){l?.(`No git checkpoints recorded for this session.`);return}let r=new Set(d.map(e=>e.path.trim().toLowerCase())),i=e.filter(e=>{if(!e.targetPath)return!1;let t=e.targetPath.trim().toLowerCase();return r.has(t)||Array.from(r).some(e=>t.endsWith(e)||e.endsWith(t))}),a=null;if(i.length>0)a=i.reduce((e,t)=>t.step<e.step?t:e,i[0]);else{let t=n.createdAt?new Date(n.createdAt).getTime()/1e3:0;if(t>0){let n=e.filter(e=>e.timestamp>=t-10);n.length>0&&(a=n[0])}a||=e[e.length-1]}c({interaction:n,changes:d,checkpoints:e,targetCheckpoint:a})}catch(e){l?.(`Failed to load checkpoints: ${e?.message||String(e)}`)}},title:`Rewind workspace to before these file edits (Git Checkpoint)`,children:[(0,U.jsx)(ie,{size:12,"aria-hidden":`true`}),(0,U.jsx)(`span`,{children:`Undo`})]}),s&&(0,U.jsxs)(`button`,{type:`button`,className:`file-changes-review-btn`,title:`Review changed code`,onClick:e=>{e.stopPropagation(),s()},children:[(0,U.jsx)(O,{size:13,"aria-hidden":`true`}),(0,U.jsx)(`span`,{children:`Review`})]})]})]}),f&&(0,U.jsx)(`div`,{className:`file-changes-list-container`,children:(0,U.jsxs)(`div`,{className:`file-changes-list`,style:{display:`flex`,flexDirection:`column`,gap:`6px`},children:[v&&(0,U.jsxs)(`div`,{className:`file-changes-common-dir`,title:v,children:[(0,U.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{d:`M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z`})}),(0,U.jsx)(`span`,{className:`file-changes-common-dir-text`,children:v})]}),w.map(e=>{let t=!!g[e.path],n=e.path.split(`/`).pop()||e.path,r=``,i=``;if(v&&e.path.startsWith(v)){let t=e.path.slice(v.length).replace(/^\//,``).split(`/`);t.length>1&&(r=t.slice(0,t.length-1).join(`/`))}else{let t=e.path.lastIndexOf(`/`);t!==-1&&(i=e.path.substring(0,t))}return(0,U.jsxs)(`div`,{className:`file-changes-item`,draggable:`true`,"data-path":e.path,onDragStart:t=>{bb(t.dataTransfer,{path:e.path,kind:`file`})},children:[(0,U.jsxs)(`div`,{className:`file-changes-item-header`,onClick:()=>_(t=>({...t,[e.path]:!t[e.path]})),children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`,minWidth:0},children:[my(n,fy(n))?(0,U.jsx)(`img`,{src:my(n,fy(n)),alt:``,width:`14`,height:`14`,style:{width:14,height:14,flexShrink:0,objectFit:`contain`},"aria-hidden":`true`,draggable:!1}):(0,U.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{color:`var(--text-muted)`,flexShrink:0},"aria-hidden":`true`,children:[(0,U.jsx)(`path`,{d:`M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z`}),(0,U.jsx)(`polyline`,{points:`14 2 14 8 20 8`})]}),(0,U.jsxs)(`span`,{className:`file-changes-filename ${e.created?`is-new`:``}`,children:[(0,U.jsx)(`span`,{className:`file-changes-name`,children:n}),r&&(0,U.jsxs)(`span`,{className:`file-changes-subdir`,children:[r,`/`]}),i&&(0,U.jsx)(`span`,{className:`file-changes-dirpath`,children:i}),e.created&&(0,U.jsx)(`span`,{className:`file-changes-chip-new`,children:`New file`})]})]}),(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`6px`,fontSize:`0.76rem`,flexShrink:0},children:[e.created?(0,U.jsxs)(`span`,{className:`file-changes-count-add`,children:[`+`,e.additions,` `,e.additions===1?`line`:`lines`]}):(0,U.jsxs)(U.Fragment,{children:[e.additions>0&&(0,U.jsxs)(`span`,{className:`file-changes-count-add`,children:[`+`,e.additions]}),e.deletions>0&&(0,U.jsxs)(`span`,{className:`file-changes-count-del`,children:[`-`,e.deletions]})]}),u&&(0,U.jsx)(`button`,{type:`button`,className:`file-changes-mention-btn`,title:`Reference ${e.path} in chat composer`,"aria-label":`Reference ${n} in chat composer`,onClick:t=>{t.stopPropagation(),u(e.path)},children:`@ Reference in chat`}),o&&(0,U.jsx)(`button`,{type:`button`,className:`file-changes-preview-btn`,title:`Preview ${n}`,onClick:t=>{t.stopPropagation();let n=/^(\/|[a-zA-Z]:[/\\])/.test(e.path)?e.path:a?`${a.replace(/[/\\]+$/,``)}/${e.path.replace(/^[/\\]+/,``)}`:e.path;o({path:n,workspacePath:a||void 0,type:Ab(n)})},children:`Preview`}),(0,U.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{color:`var(--text-muted)`,transform:t?`rotate(90deg)`:`none`,display:`inline-block`,transition:`transform 0.15s ease`},"aria-hidden":`true`,children:(0,U.jsx)(`polyline`,{points:`9 18 15 12 9 6`})})]})]}),t&&(0,U.jsx)(`div`,{className:`file-changes-diff-box`,children:e.hunks.map((t,n)=>{let r=fy(e.path);return(0,U.jsxs)(`div`,{className:`file-changes-diff-hunk`,style:{marginBottom:n<e.hunks.length-1?`10px`:0},children:[t.oldText&&(0,U.jsx)(`div`,{className:`file-changes-diff-del-block`,children:t.oldText.split(`
|
|
71
|
+
`).map((e,t)=>{let n=Ue(e,r);return(0,U.jsx)(`div`,{className:`file-changes-diff-line file-changes-diff-line-del`,children:(0,U.jsx)(`span`,{className:`file-changes-diff-line-content`,children:n.length===0?`\xA0`:n.map((e,t)=>(0,U.jsx)(`span`,{className:e.type,children:e.text},t))})},t)})}),t.newText&&(0,U.jsx)(`div`,{className:`file-changes-diff-add-block`,children:t.newText.split(`
|
|
72
|
+
`).map((e,t)=>{let n=Ue(e,r);return(0,U.jsx)(`div`,{className:`file-changes-diff-line file-changes-diff-line-add`,children:(0,U.jsx)(`span`,{className:`file-changes-diff-line-content`,children:n.length===0?`\xA0`:n.map((e,t)=>(0,U.jsx)(`span`,{className:e.type,children:e.text},t))})},t)})})]},n)})})]},e.path)}),d.length>3&&(0,U.jsxs)(`button`,{type:`button`,className:`file-changes-show-more`,"aria-expanded":m,onClick:()=>h(e=>!e),children:[(0,U.jsx)(`span`,{children:m?`Show fewer files`:`Show ${d.length-3} more ${d.length-3==1?`file`:`files`}`}),(0,U.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,U.jsx)(`polyline`,{points:`6 9 12 15 18 9`})})]})]})})]})})})}));function XC(e,t){let n=typeof e==`string`&&e.match(t);if(n&&n[1])try{return JSON.parse(n[1])}catch{}return null}function ZC(e,t){let n=!!(t&&(t.includes("```weather_json")||t.includes("```weather-json"))),r=!!(t&&(t.includes("```stock_json")||t.includes("```stock-json"))),i=!!(t&&(t.includes("```calculation_json")||t.includes("```calculation-json"))),a=!!(t&&(t.includes("```image_search_json")||t.includes("```image-search-json"))),o=!!(t&&(t.includes("```image_gen_json")||t.includes("```image-gen-json"))),s=null,c=null,l=null,u=null,d=null,f=null;for(let t of e||[]){if(t.type!==`ToolEnd`)continue;let e=t.data?.action||t.data?.name||``,p=t.data?.result||t.data?.output||``;if(!n&&!s&&e===`weather`)s=XC(p,ow);else if(!r&&!c&&e===`stock`)c=XC(p,sw);else if(!i&&!l&&e===`calculation`)l=XC(p,cw);else if(!a&&!u&&e===`image_search`)u=XC(p,lw);else if(!o&&!d&&dw.has(e))d=XC(p,uw);else if(!f&&e===`exit_plan_mode`){let e=t.data?.input?.plan||t.data?.plan;typeof e==`string`&&e.trim()&&(f=e.trim())}}return{weatherData:s,stockData:c,calcData:l,imageSearchData:u,imageGenData:d,planData:f}}var QC,$C,ew,tw,nw,rw,iw,aw,ow,sw,cw,lw,uw,dw,fw,pw=t((()=>{QC=e(i()),$C=a(),Ee(),ew=(0,QC.lazy)(()=>P(()=>import(`./WeatherCard-Buzi7Vfu.js`),__vite__mapDeps([0,1,2,3,4]))),tw=(0,QC.lazy)(()=>P(()=>import(`./StockCard-DxUciKyp.js`),__vite__mapDeps([5,1,2,3,4]))),nw=(0,QC.lazy)(()=>P(()=>import(`./CalculationCard-D2E74u5q.js`),__vite__mapDeps([6,1,2,3,4]))),rw=(0,QC.lazy)(()=>P(()=>import(`./ImageSearchCard-Cld_SOUg.js`),__vite__mapDeps([7,1,2,3,4]))),iw=(0,QC.lazy)(()=>P(()=>import(`./ImageGenCard-BMCJHP9O.js`),__vite__mapDeps([8,1,2,3,4]))),aw=(0,QC.lazy)(()=>P(()=>import(`./PlanCard-C2x5pajq.js`),__vite__mapDeps([13,1,2]))),ow=/```weather_json\s*([\s\S]*?)\s*```/,sw=/```stock_json\s*([\s\S]*?)\s*```/,cw=/```calculation_json\s*([\s\S]*?)\s*```/,lw=/```image_search_json\s*([\s\S]*?)\s*```/,uw=/```image_gen_json\s*([\s\S]*?)\s*```/,dw=new Set([`generate_image`,`image_studio.generate`,`image_generate`]),fw=(0,QC.memo)(function({progress:e,aiText:t}){let{weatherData:n,stockData:r,calcData:i,imageSearchData:a,imageGenData:o,planData:s}=(0,QC.useMemo)(()=>ZC(e,t),[e,t]);return!n&&!r&&!i&&!a&&!o&&!s?null:(0,$C.jsxs)(QC.Suspense,{fallback:null,children:[s&&(0,$C.jsx)(aw,{plan:s}),n&&(0,$C.jsx)(ew,{data:n}),r&&(0,$C.jsx)(tw,{data:r}),i&&(0,$C.jsx)(nw,{data:i}),a&&(0,$C.jsx)(rw,{data:a}),o&&(0,$C.jsx)(iw,{data:o})]})})}));function mw(e,t,n){let r=new Map,i=n?n.replace(/\\/g,`/`).replace(/\/+$/,``):``,a=(e,t)=>{let n=e.trim();if(n=n.replace(/^[`"'(<[]+|[`"')>\].,;:]+$/g,``).trim(),!n||!_w.test(n)||/^https?:\/\//i.test(n)||(n.startsWith(`file://`)&&(n=n.slice(7)),n.includes(`*`)||n.includes(`?`)||n.length<4))return;n=n.replace(/\\/g,`/`);let a=n.split(`/`).pop()||n,o=a.split(`.`).pop()?.toLowerCase()||``;if([`pdf`,`pptx`].includes(o)){let e=n;i?n.startsWith(`/`)&&(e=n===i||n.startsWith(i+`/`)?n.slice(i.length+1):a):n.startsWith(`/`)&&(e=a);let s=a.toLowerCase(),c=r.get(s);c?e.includes(`/`)&&!c.path.includes(`/`)&&r.set(s,{path:e,name:a,type:c.type,source:t}):r.set(s,{path:e,name:a,type:o===`pdf`?`pdf`:`presentation`,source:t})}};if(t){let e=t.match(/(?:file:\/\/)?(?:\/[^\s"'`<>]+|[^\s"'`<>]+)\.(?:pdf|pptx)/gi);if(e)for(let t of e)a(t,`ai_text`)}return Array.from(r.values())}var hw,gw,_w,vw,yw=t((()=>{hw=e(i()),Mb(),kb(),gw=a(),_w=/\.(pdf|pptx)$/i,vw=(0,hw.memo)(function({progress:e,aiText:t,workspacePath:n,onOpenArtifact:r}){let i=(0,hw.useMemo)(()=>mw(e,t,n),[e,t,n]);return i.length===0?null:(0,gw.jsx)(`div`,{className:`chat-artifact-cards`,style:{display:`flex`,flexDirection:`column`,gap:`8px`,margin:`8px 0 12px`,width:`100%`,boxSizing:`border-box`},children:i.map(e=>{let t=e.name.toLowerCase().endsWith(`.pdf`),i=t?`PDF`:`PPTX`,a=t?`#ef4444`:`#f97316`,o=t?`rgba(239, 68, 68, 0.15)`:`rgba(249, 115, 22, 0.15)`;return(0,gw.jsxs)(`div`,{className:`chat-artifact-card`,draggable:!0,onDragStart:t=>{bb(t.dataTransfer,{path:e.path,root:n})},title:`${e.path} (Drag to chat)`,style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`10px 14px`,borderRadius:`var(--radius-sm, 8px)`,background:`color-mix(in srgb, var(--surface-bg, #1e1e20) 70%, rgba(255, 255, 255, 0.02))`,border:`1px solid color-mix(in srgb, var(--border) 60%, transparent)`,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.15)`,gap:`12px`,cursor:`grab`,width:`100%`,boxSizing:`border-box`},children:[(0,gw.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`10px`,minWidth:0},children:[(0,gw.jsx)(`div`,{style:{width:`36px`,height:`32px`,borderRadius:`var(--radius-xs, 6px)`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:o,color:a,flexShrink:0,fontSize:`11px`,fontWeight:700,textTransform:`uppercase`,letterSpacing:`0.5px`},children:i}),(0,gw.jsxs)(`div`,{style:{minWidth:0,display:`flex`,flexDirection:`column`},children:[(0,gw.jsx)(`span`,{style:{fontWeight:600,fontSize:`0.85rem`,color:`var(--text-main, #f4f4f5)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},title:e.path,children:e.name}),(0,gw.jsxs)(`span`,{style:{fontSize:`0.72rem`,color:`var(--text-muted, #a1a1aa)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:[t?`PDF Presentation / Document`:`PowerPoint Presentation`,` • `,e.path]})]})]}),r&&(0,gw.jsxs)(`button`,{type:`button`,className:`chat-artifact-open-btn`,onClick:()=>r({path:e.path,workspacePath:n,type:Ab(e.path)}),style:{display:`inline-flex`,alignItems:`center`,gap:`6px`,padding:`5px 11px`,borderRadius:`var(--radius-xs, 6px)`,background:`color-mix(in srgb, var(--text-main, #ffffff) 6%, transparent)`,color:`var(--text-main, #f4f4f5)`,fontWeight:500,fontSize:`0.76rem`,border:`1px solid var(--border, rgba(255, 255, 255, 0.12))`,cursor:`pointer`,flexShrink:0,transition:`background 0.15s ease, border-color 0.15s ease`},children:[(0,gw.jsx)(`span`,{children:`Open in Side Panel`}),(0,gw.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,gw.jsx)(`path`,{d:`M5 12h14`}),(0,gw.jsx)(`path`,{d:`m12 5 7 7-7 7`})]})]})]},e.path)})})})})),bw,xw,Sw,Cw=t((()=>{bw=e(i()),vy(),xw=a(),Sw=(0,bw.memo)(function({document:e,defaultOpen:t=!1}){let[n,r]=(0,bw.useState)(t),[i,a]=(0,bw.useState)(!1),o=fy(e.filename),s=my(e.filename,o),c=t=>{t.stopPropagation(),e.content&&navigator.clipboard.writeText(e.content).then(()=>{a(!0),setTimeout(()=>a(!1),1500)}).catch(()=>{})},l=`${e.lineCount} ${e.lineCount===1?`line`:`lines`}`;return(0,xw.jsxs)(`div`,{className:`chat-attached-document-card`,style:{marginTop:`8px`,borderRadius:`var(--radius-md, 8px)`,border:`1px solid color-mix(in srgb, var(--border, rgba(255, 255, 255, 0.15)) 80%, transparent)`,background:`color-mix(in srgb, var(--surface-bg, #18181b) 75%, rgba(0, 0, 0, 0.25))`,overflow:`hidden`,boxSizing:`border-box`,width:`100%`,maxWidth:`100%`,transition:`border-color 0.15s ease`},children:[(0,xw.jsxs)(`div`,{className:`chat-attached-document-header`,onClick:()=>r(e=>!e),role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r(e=>!e))},style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`7px 12px`,cursor:`pointer`,userSelect:`none`,gap:`10px`},children:[(0,xw.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`,minWidth:0,flex:1},children:[s?(0,xw.jsx)(`img`,{src:s,alt:``,width:`14`,height:`14`,style:{width:14,height:14,flexShrink:0,objectFit:`contain`},"aria-hidden":`true`,draggable:!1}):(0,xw.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{color:`var(--text-muted, #a1a1aa)`,flexShrink:0},"aria-hidden":`true`,children:[(0,xw.jsx)(`path`,{d:`M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z`}),(0,xw.jsx)(`polyline`,{points:`14 2 14 8 20 8`})]}),(0,xw.jsx)(`span`,{className:`chat-attached-document-filename`,title:e.filename,style:{fontWeight:600,fontSize:`0.82rem`,color:`var(--text-main, #f4f4f5)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.filename}),(0,xw.jsxs)(`span`,{className:`chat-attached-document-meta`,style:{fontSize:`0.72rem`,color:`var(--text-muted, #a1a1aa)`,flexShrink:0},children:[`• `,l]})]}),(0,xw.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`6px`,flexShrink:0},children:[(0,xw.jsx)(`button`,{type:`button`,className:`chat-attached-document-copy-btn`,onClick:c,title:i?`Copied!`:`Copy document content`,"aria-label":i?`Copied`:`Copy document`,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:`24px`,height:`24px`,padding:0,border:0,borderRadius:`var(--radius-xs, 4px)`,background:`transparent`,color:i?`var(--status-success, #22c55e)`:`var(--text-muted, #a1a1aa)`,cursor:`pointer`,transition:`color 0.15s ease`},children:i?(0,xw.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,xw.jsx)(`polyline`,{points:`20 6 9 17 4 12`})}):(0,xw.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,xw.jsx)(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`,ry:`2`}),(0,xw.jsx)(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})]})}),(0,xw.jsxs)(`span`,{className:`chat-attached-document-toggle-action`,style:{display:`inline-flex`,alignItems:`center`,gap:`4px`,fontSize:`0.74rem`,fontWeight:500,color:`var(--interactive-fg-hover, #60a5fa)`},children:[(0,xw.jsx)(`span`,{children:n?`Hide content`:`View content`}),(0,xw.jsx)(`svg`,{width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{transform:n?`rotate(180deg)`:`none`,transition:`transform 0.18s ease`},"aria-hidden":`true`,children:(0,xw.jsx)(`polyline`,{points:`6 9 12 15 18 9`})})]})]})]}),n&&(0,xw.jsx)(`div`,{className:`chat-attached-document-body`,style:{borderTop:`1px solid color-mix(in srgb, var(--border, rgba(255, 255, 255, 0.1)) 60%, transparent)`,background:`rgba(0, 0, 0, 0.22)`,padding:`8px 12px`,maxHeight:`260px`,overflowY:`auto`},children:(0,xw.jsx)(`pre`,{style:{margin:0,fontFamily:`var(--font-mono, monospace)`,fontSize:`0.78rem`,lineHeight:1.45,whiteSpace:`pre-wrap`,wordBreak:`break-word`,color:`var(--text-main, #e4e4e7)`},children:e.content})})]})})}));function ww(e){if(!e||typeof e!=`string`)return{userText:``};let t=e.match(Tw);if(!t||t.index===void 0)return{userText:e};let n=e.slice(0,t.index).trim(),r=t[1].trim(),i=t[2];return{userText:n,attachedDocument:{filename:r,content:i,lineCount:i?i.split(`
|
|
73
|
+
`).length:0,charCount:i?i.length:0}}}var Tw,Ew=t((()=>{Tw=/(?:^|\n\n)Attached document: ([^\n]+)\nUse the extracted document text below when answering[^\n]*\n\n--- Extracted document text ---\n([\s\S]*?)\n--- End extracted document text ---$/})),Dw,Ow=t((()=>{Dw=`data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGroq%3c/title%3e%3cpath%20d='M12.036%202c-3.853-.035-7%203-7.036%206.781-.035%203.782%203.055%206.872%206.908%206.907h2.42v-2.566h-2.292c-2.407.028-4.38-1.866-4.408-4.23-.029-2.362%201.901-4.298%204.308-4.326h.1c2.407%200%204.358%201.915%204.365%204.278v6.305c0%202.342-1.944%204.25-4.323%204.279a4.375%204.375%200%2001-3.033-1.252l-1.851%201.818A7%207%200%200012.029%2022h.092c3.803-.056%206.858-3.083%206.879-6.816v-6.5C18.907%204.963%2015.817%202%2012.036%202z'%3e%3c/path%3e%3c/svg%3e`})),kw,Aw=t((()=>{kw=`data:image/svg+xml,%3csvg%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eMistral%3c/title%3e%3cpath%20d='M3.428%203.4h3.429v3.428H3.428V3.4zm13.714%200h3.43v3.428h-3.43V3.4z'%20fill='gold'%3e%3c/path%3e%3cpath%20d='M3.428%206.828h6.857v3.429H3.429V6.828zm10.286%200h6.857v3.429h-6.857V6.828z'%20fill='%23FFAF00'%3e%3c/path%3e%3cpath%20d='M3.428%2010.258h17.144v3.428H3.428v-3.428z'%20fill='%23FF8205'%3e%3c/path%3e%3cpath%20d='M3.428%2013.686h3.429v3.428H3.428v-3.428zm6.858%200h3.429v3.428h-3.429v-3.428zm6.856%200h3.43v3.428h-3.43v-3.428z'%20fill='%23FA500F'%3e%3c/path%3e%3cpath%20d='M0%2017.114h10.286v3.429H0v-3.429zm13.714%200H24v3.429H13.714v-3.429z'%20fill='%23E10500'%3e%3c/path%3e%3c/svg%3e`})),jw,Mw=t((()=>{jw=`data:image/svg+xml,%3csvg%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3ePerplexity%3c/title%3e%3cpath%20d='M19.785%200v7.272H22.5V17.62h-2.935V24l-7.037-6.194v6.145h-1.091v-6.152L4.392%2024v-6.465H1.5V7.188h2.884V0l7.053%206.494V.19h1.09v6.49L19.786%200zm-7.257%209.044v7.319l5.946%205.234V14.44l-5.946-5.397zm-1.099-.08l-5.946%205.398v7.235l5.946-5.234V8.965zm8.136%207.58h1.844V8.349H13.46l6.105%205.54v2.655zm-8.982-8.28H2.59v8.195h1.8v-2.576l6.192-5.62zM5.475%202.476v4.71h5.115l-5.115-4.71zm13.219%200l-5.115%204.71h5.115v-4.71z'%20fill='%2322B8CD'%20fill-rule='nonzero'%3e%3c/path%3e%3c/svg%3e`})),Nw,Pw=t((()=>{Nw=`data:image/svg+xml,%3csvg%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eQwen%3c/title%3e%3cpath%20d='M12.604%201.34c.393.69.784%201.382%201.174%202.075a.18.18%200%2000.157.091h5.552c.174%200%20.322.11.446.327l1.454%202.57c.19.337.24.478.024.837-.26.43-.513.864-.76%201.3l-.367.658c-.106.196-.223.28-.04.512l2.652%204.637c.172.301.111.494-.043.77-.437.785-.882%201.564-1.335%202.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099%200%2000-.081.05%20575.097%20575.097%200%2001-2.705%204.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537%200%2001-.465-.271l-1.335-2.323a.09.09%200%2000-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543%200%2001-.002-.54l1.207-2.12a.198.198%200%20000-.197%20550.951%20550.951%200%2001-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625%201.387-2.436.132-.234.304-.334.584-.335a338.3%20338.3%200%20012.589-.001.124.124%200%2000.107-.063l2.806-4.895a.488.488%200%2001.422-.246c.524-.001%201.053%200%201.583-.006L11.704%201c.341-.003.724.032.9.34zm-3.432.403a.06.06%200%2000-.052.03L6.254%206.788a.157.157%200%2001-.135.078H3.253c-.056%200-.07.025-.041.074l5.81%2010.156c.025.042.013.062-.034.063l-2.795.015a.218.218%200%2000-.2.116l-1.32%202.31c-.044.078-.021.118.068.118l5.716.008c.046%200%20.08.02.104.061l1.403%202.454c.046.081.092.082.139%200l5.006-8.76.783-1.382a.055.055%200%2001.096%200l1.424%202.53a.122.122%200%2000.107.062l2.763-.02a.04.04%200%2000.035-.02.041.041%200%20000-.04l-2.9-5.086a.108.108%200%20010-.113l.293-.507%201.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059%200-.073-.026-.043-.077l1.434-2.505a.107.107%200%20000-.114L9.225%201.774a.06.06%200%2000-.053-.031zm6.29%208.02c.046%200%20.058.02.034.06l-.832%201.465-2.613%204.585a.056.056%200%2001-.05.029.058.058%200%2001-.05-.029L8.498%209.841c-.02-.034-.01-.052.028-.054l.216-.012%206.722-.012z'%20fill='url(%23lobe-icons-qwen-_R_0_)'%20fill-rule='nonzero'%3e%3c/path%3e%3cdefs%3e%3clinearGradient%20id='lobe-icons-qwen-_R_0_'%20x1='0%25'%20x2='100%25'%20y1='0%25'%20y2='0%25'%3e%3cstop%20offset='0%25'%20stop-color='%236336E7'%20stop-opacity='.84'%3e%3c/stop%3e%3cstop%20offset='100%25'%20stop-color='%236F69F7'%20stop-opacity='.84'%3e%3c/stop%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e`})),Fw,Iw=t((()=>{Fw=`data:image/svg+xml,%3csvg%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3etogether.ai%3c/title%3e%3cpath%20d='M23.197%204.503A6%206%200%200015%202.307a5.973%205.973%200%2000-2.995%204.933l5.996.008v.515h-5.996c.039.937.298%201.87.8%202.74a6%206%200%201010.39-6z'%20fill='%23EF2CC1'%3e%3c/path%3e%3cpath%20d='M.805%204.5A6%206%200%20003%2012.697a5.972%205.972%200%20005.77.127L5.779%207.627l.446-.257%202.997%205.192A6%206%200%2010.804%204.5z'%20fill='%23CAAEF5'%3e%3c/path%3e%3cpath%20d='M12%2023.894a6%206%200%20005.999-6c0-2.13-1.1-3.996-2.775-5.06l-3.005%205.189-.444-.258%202.997-5.192A6%206%200%201012%2023.894z'%20fill='%23FC4C02'%3e%3c/path%3e%3c/svg%3e`}));function Lw(e=``,t=``){let n=`${e.toLowerCase().trim()} ${t.toLowerCase().trim()}`;return n.includes(`deepseek`)?`deepseek`:n.includes(`gemini`)||n.includes(`google`)?`gemini`:n.includes(`claude`)||n.includes(`anthropic`)?`anthropic`:n.includes(`openai`)||n.includes(`gpt`)?`openai`:n.includes(`groq`)?`groq`:n.includes(`openrouter`)?`openrouter`:n.includes(`ollama`)?`ollama`:n.includes(`mistral`)?`mistral`:n.includes(`perplexity`)?`perplexity`:n.includes(`qwen`)?`qwen`:n.includes(`together`)?`together`:n.includes(`lmstudio`)||n.includes(`local_openai`)?`local_openai`:n.includes(`huggingface`)||n.includes(`hf`)?`huggingface`:null}function Rw({provider:e=``,model:t=``,customLogo:n,customProviders:r,size:i=13,className:a=``}){let o=n;if(!o&&r&&e){let t=e.toLowerCase().replace(/^custom:/,``),n=r.find(e=>e.id.toLowerCase()===t||e.displayName&&e.displayName.toLowerCase()===t);n?.logoDataUrl&&(o=n.logoDataUrl)}if(o)return o.startsWith(`data:`)||o.startsWith(`http://`)||o.startsWith(`https://`)||o.startsWith(`/`)?(0,zw.jsx)(`span`,{className:`provider-chip-logo ${a}`,style:{width:`${i}px`,height:`${i}px`},"aria-hidden":`true`,children:(0,zw.jsx)(`img`,{src:o,alt:``})}):(0,zw.jsx)(`span`,{className:`provider-chip-logo provider-chip-emoji ${a}`,style:{width:`${i}px`,height:`${i}px`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,fontSize:`${Math.max(10,i-1)}px`,lineHeight:1},"aria-hidden":`true`,children:o});let s=Lw(e,t),c=s?Bw[s]:null;return c?c.color?(0,zw.jsx)(`span`,{className:`provider-chip-logo is-monochrome ${a}`,style:{width:`${i}px`,height:`${i}px`,"--provider-brand-color":c.color,maskImage:`url("${c.src}")`,WebkitMaskImage:`url("${c.src}")`},"aria-hidden":`true`}):(0,zw.jsx)(`span`,{className:`provider-chip-logo ${a}`,style:{width:`${i}px`,height:`${i}px`},"aria-hidden":`true`,children:(0,zw.jsx)(`img`,{src:c.src,alt:``})}):(0,zw.jsx)(`span`,{className:`provider-chip-dot ${a}`,"aria-hidden":`true`})}var zw,Bw,Vw=t((()=>{i(),Je(),Xt(),Zt(),Ow(),pt(),Nt(),Aw(),wt(),Kt(),yt(),Mw(),Pw(),Iw(),zw=a(),Bw={anthropic:{src:ot,color:`#d97757`},claude:{src:ot,color:`#d97757`},deepseek:{src:_t},gemini:{src:Jt},google:{src:Jt},groq:{src:Dw,color:`#f97316`},huggingface:{src:Et},hf:{src:Et},local_openai:{src:Ot,color:`#8b5cf6`},lmstudio:{src:Ot,color:`#8b5cf6`},mistral:{src:kw},ollama:{src:Rt,color:`#e2e8f0`},openai:{src:xt,color:`#10a37f`},gpt:{src:xt,color:`#10a37f`},openrouter:{src:jt},perplexity:{src:jw},qwen:{src:Nw},together:{src:Fw}}})),Hw,W,Uw,Ww=t((()=>{Hw=e(i()),ib(),ct(),xx(),Ax(),Tt(),yS(),px(),LC(),cC(),WC(),YC(),pw(),yw(),Cw(),Ew(),Vw(),W=a(),Uw=Hw.memo(function(e){let{interaction:t,copiedId:n,onEditMessage:r,onResendFrom:i,speakingText:a,agentActivitySnapshots:o,openActivityIds:s,thinkingExpanded:c,onThinkingExpandedChange:l,handleCopyMessage:u,speak:d,toggleActivity:f,onOpenArtifact:p,onOpenReview:m,onRewindRequest:h,onRewindError:g}=e,[_,v]=(0,Hw.useState)(!1),[y,b]=(0,Hw.useState)(t.userText||``),x=(0,Hw.useRef)(null),S=(0,Hw.useMemo)(()=>ww(t.userText),[t.userText]);(0,Hw.useEffect)(()=>{b(S.userText||``)},[S.userText]);let C=(0,Hw.useCallback)(e=>{e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,400)}px`},[]),w=(0,Hw.useCallback)(()=>{v(!0),b(S.userText||``),requestAnimationFrame(()=>{if(x.current){x.current.focus();let e=x.current.value.length;x.current.setSelectionRange(e,e),C(x.current)}})},[S.userText,C]),T=(0,Hw.useCallback)(()=>{v(!1),b(S.userText||``)},[S.userText]),E=(0,Hw.useCallback)(()=>{let e=y.trim();e&&(v(!1),i?i(Number(t.id),e):r&&r(e))},[y,t.id,i,r]),D=t.provider===`system`&&t.model===`provider_change`,O=(0,Hw.useMemo)(()=>{if(!t.userText)return null;let{userText:e,attachedDocument:n}=S;return(0,W.jsxs)(W.Fragment,{children:[e&&(0,W.jsx)(rb,{text:e}),n&&(0,W.jsx)(Sw,{document:n})]})},[t.userText,S]),k=o[String(t.id)]??t.agentActivity??dx,A=(0,Hw.useMemo)(()=>ox(k),[k]),ee=(0,Hw.useMemo)(()=>A?[]:tx(k),[A,k]),te=(0,Hw.useMemo)(()=>A||ee.length>0?[]:ex(k),[A,ee.length,k]),j=(0,Hw.useMemo)(()=>dS(k),[k]),ne=(0,Hw.useMemo)(()=>t.aiText?(0,W.jsx)(rb,{text:t.aiText,sources:j}):null,[t.aiText,j]);if(D){let e=(t.userText||``).replace(/^Changed model to\s*/i,``).trim();return(0,W.jsxs)(`div`,{className:`system-event-divider`,children:[(0,W.jsx)(`div`,{className:`system-event-line`}),(0,W.jsxs)(`div`,{className:`system-event-pill`,children:[(0,W.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,children:(0,W.jsx)(`path`,{d:`m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z`})}),(0,W.jsx)(`span`,{children:e})]}),(0,W.jsx)(`div`,{className:`system-event-line`})]},t.id)}let re=n===`user-${t.id}`,M=n===t.id,ie=a===t.aiText;return(0,W.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`8px`,marginBottom:`16px`},children:[t.userText&&(0,W.jsx)(`div`,{className:`message user-message`,children:(0,W.jsx)(`div`,{className:`bubble-wrapper`,children:_?(0,W.jsxs)(`div`,{className:`inline-edit-container`,children:[(0,W.jsx)(`textarea`,{ref:x,className:`inline-edit-textarea`,value:y,onChange:e=>{b(e.target.value),C(e.currentTarget)},onKeyDown:e=>{e.key===`Escape`?(e.preventDefault(),T()):(e.ctrlKey||e.metaKey)&&e.key===`Enter`&&(e.preventDefault(),E())},rows:2,placeholder:`Edit message...`}),(0,W.jsxs)(`div`,{className:`inline-edit-footer`,children:[(0,W.jsx)(`span`,{className:`inline-edit-hint`,children:`Esc to cancel · Ctrl+Enter to save`}),(0,W.jsxs)(`div`,{className:`inline-edit-actions`,children:[(0,W.jsx)(`button`,{type:`button`,className:`inline-edit-btn cancel`,onClick:T,children:`Cancel`}),(0,W.jsx)(`button`,{type:`button`,className:`inline-edit-btn submit`,onClick:E,disabled:!y.trim(),children:`Save & Resend`})]})]})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`message-bubble`,children:O}),(0,W.jsxs)(`div`,{className:`message-time`,style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,W.jsx)(`span`,{children:zt(t.createdAt).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}),(0,W.jsx)(`button`,{type:`button`,className:`msg-action-btn copy-btn ${re?`is-copied`:``}`,onClick:()=>u(`user-${t.id}`,S.userText||t.userText),title:re?`Copied!`:`Copy`,children:Ey(re)}),(i||r)&&t.provider!==`system`&&(0,W.jsx)(`button`,{type:`button`,className:`msg-action-btn edit-btn`,onClick:w,title:`Edit & resend`,children:(0,W.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`path`,{d:`M12 20h9`}),(0,W.jsx)(`path`,{d:`M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z`})]})})]})]})})}),(0,W.jsx)(`div`,{className:`message ai-message`,children:(0,W.jsxs)(`div`,{className:`bubble-wrapper`,children:[t.status!==`queued`&&A&&(0,W.jsx)(IC,{progress:k,id:String(t.id),historical:t.status!==`running`,defaultOpen:t.status===`running`,isOpen:s?.[String(t.id)]??t.status===`running`,onToggle:f,chatId:e.chatId||t.chatId,workspacePath:e.workspacePath,onReferenceFile:e.onReferenceFile,onOpenArtifact:p}),t.status!==`queued`&&!A&&ee.length>0&&(0,W.jsx)(iC,{blockKey:`extended-${t.id}`,thoughts:ee,isLive:t.status===`running`,variant:`extended`,expanded:c?.[`extended-${t.id}`],onExpandedChange:l}),t.status!==`queued`&&!A&&te.length>0&&(0,W.jsx)(iC,{blockKey:String(t.id),thoughts:te,isLive:t.status===`running`,expanded:c?.[String(t.id)],onExpandedChange:l}),t.status!==`queued`&&t.status!==`running`&&(0,W.jsx)(JC,{progress:k,interaction:t,workspacePath:e.workspacePath,onReferenceFile:e.onReferenceFile,onOpenArtifact:p,onOpenReview:m,onRewindRequest:h,onRewindError:g}),(0,W.jsxs)(`div`,{className:`message-bubble`,children:[t.status===`queued`&&(0,W.jsx)(`span`,{children:`Queued for this session…`}),t.status===`running`&&(0,W.jsx)(`span`,{children:`Mint is responding…`}),t.status===`failed`&&(0,W.jsx)(`span`,{children:`This turn failed. Send the prompt again to retry.`}),t.status===`interrupted`&&(0,W.jsx)(`span`,{children:`This turn was interrupted. Send the prompt again to retry.`}),(0,W.jsx)(bx,{progress:k,running:t.status===`running`,interrupted:t.status===`interrupted`,chatId:e.chatId||t.chatId,mode:`artifacts-only`}),(0,W.jsx)(kx,{progress:k,chatId:e.chatId||t.chatId,onOpenArtifact:p}),(0,W.jsx)(fw,{progress:k,aiText:t.aiText}),(0,W.jsx)(vw,{progress:k,aiText:t.aiText,workspacePath:t.workspace||void 0,onOpenArtifact:p}),ne]}),j.length>0&&(0,W.jsx)(UC,{sources:j}),(0,W.jsxs)(`div`,{className:`message-time`,style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[t.status===`completed`&&(0,W.jsxs)(`span`,{className:`provider-model-chip`,"data-provider":(t.provider||``).toLowerCase(),title:`${t.provider} • ${t.model}`,children:[(0,W.jsx)(Rw,{provider:t.provider,model:t.model,customProviders:e.customProviders,size:13}),(0,W.jsx)(`span`,{className:`provider-chip-name`,children:t.provider}),(0,W.jsx)(`span`,{className:`provider-chip-divider`,children:`/`}),(0,W.jsx)(`span`,{className:`provider-chip-model`,children:t.model})]}),Yt(t)&&(0,W.jsx)(`span`,{className:`provider-fallback-notice`,children:Yt(t)}),(0,W.jsx)(`span`,{className:`message-timestamp`,children:zt(t.createdAt).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}),t.status===`completed`&&(0,W.jsxs)(`div`,{className:`message-action-buttons`,style:{display:`flex`,alignItems:`center`,gap:`4px`,marginLeft:`auto`},children:[(0,W.jsx)(`button`,{type:`button`,className:`msg-action-btn copy-btn ${M?`is-copied`:``}`,onClick:()=>u(t.id,t.aiText),title:M?`Copied!`:`Copy message`,children:Ey(M)}),(0,W.jsx)(`button`,{type:`button`,className:`msg-action-btn tts-btn ${ie?`is-speaking`:``}`,onClick:()=>d(t.aiText),title:ie?`Stop reading`:`Read aloud`,children:Ty(ie)})]})]})]})})]},t.id)},(e,t)=>{if(e.onEditMessage!==t.onEditMessage||e.onResendFrom!==t.onResendFrom||e.handleCopyMessage!==t.handleCopyMessage||e.speak!==t.speak||e.toggleActivity!==t.toggleActivity||e.onOpenArtifact!==t.onOpenArtifact||e.onOpenReview!==t.onOpenReview||e.onRewindRequest!==t.onRewindRequest||e.onRewindError!==t.onRewindError)return!1;let n=e.interaction,r=t.interaction;return n.id===r.id&&n.aiText===r.aiText&&n.userText===r.userText&&n.createdAt===r.createdAt&&n.status===r.status&&n.agentActivity===r.agentActivity&&n.provider===r.provider&&n.model===r.model&&n.fallbackProvider===r.fallbackProvider&&n.fallbackReason===r.fallbackReason&&n.chatId===r.chatId&&e.copiedId===`user-${n.id}`==(t.copiedId===`user-${r.id}`)&&e.copiedId===n.id==(t.copiedId===r.id)&&e.speakingText===n.aiText==(t.speakingText===r.aiText)&&(e.openActivityIds?.[String(n.id)]??!1)===(t.openActivityIds?.[String(r.id)]??!1)&&e.agentActivitySnapshots[String(n.id)]===t.agentActivitySnapshots[String(r.id)]})}));function Gw({progress:e,onOpenDetails:t}){let{subagents:n}=(0,Kw.useMemo)(()=>SC(e),[e]);if(!n||n.length===0)return null;let r=n.filter(e=>e.status===`running`).length,i=n.filter(e=>e.status===`completed`).length,a=n.filter(e=>e.status===`failed`).length,o=r>0,s=o?`Running Subagents (${i}/${n.length} completed)`:a>0?`Subagents (${i} completed, ${a} failed)`:`Subagents (${i} completed)`;return(0,qw.jsxs)(`div`,{className:`subagent-status-strip`,"data-testid":`subagent-status-strip`,onClick:t,role:t?`button`:void 0,tabIndex:t?0:void 0,onKeyDown:e=>{t&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},title:t?`Click to inspect subagent activity`:void 0,children:[(0,qw.jsxs)(`div`,{className:`subagent-status-strip-header`,children:[(0,qw.jsxs)(`div`,{className:`subagent-status-strip-header-left`,children:[o?(0,qw.jsx)(`span`,{className:`subagent-status-spinner`,"aria-hidden":`true`}):a>0?(0,qw.jsx)(`span`,{className:`subagent-status-icon-alert`,"aria-hidden":`true`,children:`⚠`}):(0,qw.jsx)(`span`,{className:`subagent-status-icon-check`,"aria-hidden":`true`,children:`✓`}),(0,qw.jsx)(`span`,{className:`subagent-status-strip-title`,children:s})]}),t&&(0,qw.jsx)(`span`,{className:`subagent-status-strip-hint`,children:`Details ›`})]}),(0,qw.jsx)(`div`,{className:`subagent-status-strip-list`,children:n.map(e=>{let t=e.status===`running`,n=e.status===`completed`,r=e.status===`failed`,i=e.taskSnippet&&e.taskSnippet.toLowerCase()!==`null`?e.taskSnippet:`Working on task...`;(n||r)&&e.summaryPreview&&e.summaryPreview.toLowerCase()!==`null`?i=e.summaryPreview:t&&e.currentTool&&(i=`Running ${e.currentTool.replace(`_`,` `)}`);let a=``;return a=n?`done ${Math.max(1,Math.round((e.elapsedMs??0)/1e3))}s`:r?`failed ${Math.max(1,Math.round((e.elapsedMs??0)/1e3))}s`:`running`,(0,qw.jsxs)(`div`,{className:`subagent-status-strip-row ${e.status}`,"data-testid":`subagent-status-row-${e.name}`,children:[(0,qw.jsxs)(`div`,{className:`subagent-status-strip-row-main`,children:[t?(0,qw.jsx)(`span`,{className:`subagent-status-row-spinner`,"aria-hidden":`true`}):n?(0,qw.jsx)(`span`,{className:`subagent-status-row-check`,"aria-hidden":`true`,children:`✓`}):(0,qw.jsx)(`span`,{className:`subagent-status-row-cross`,"aria-hidden":`true`,children:`✗`}),(0,qw.jsxs)(`span`,{className:`subagent-status-strip-tag`,children:[`[`,e.name,`]`]}),(0,qw.jsx)(`span`,{className:`subagent-status-strip-desc`,children:i})]}),(0,qw.jsx)(`span`,{className:`subagent-status-strip-timing`,children:a})]},e.name)})})]})}var Kw,qw,Jw=t((()=>{Kw=e(i()),EC(),qw=a()}));function Yw(e){return typeof e==`object`?e.key:e}function Xw(e,t){let n=e.length;return new Proxy(e,{get(e,r,i){if(typeof r==`string`){let i=r.charCodeAt(0);if(i>=48&&i<=57){let i=+r;if(Number.isInteger(i)&&i>=0&&i<n){let n=e[i];if(typeof n!=`object`){let r=t[i*2];n=e[i]={index:i,key:n,start:r,size:t[i*2+1],end:r+t[i*2+1],lane:0}}return n}}if(r===`length`)return n}return Reflect.get(e,r,i)}})}var Zw=t((()=>{}));function Qw(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return(o.length!==r.length||o.some((e,t)=>r[t]!==e))&&(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1),i}return o.updateDeps=e=>{r=e},o}function $w(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var eT,tT,nT=t((()=>{eT=(e,t)=>Math.abs(e-t)<1.01,tT=(e,t,n)=>{let r;return Object.assign(function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)},{cancel:()=>{e.clearTimeout(r)}})}}));function rT(e,t,n,r){if(t===0)return!1;let i=r(0),a=new Set,o=0;for(;o<e;){let e=n(o);if(e===i)break;a.add(e),o++}let s=e-o;if(s===0||s>=t)return!1;for(let e=0;e<s;e++)if(r(e)!==n(o+e))return!1;for(let e=s;e<t;e++)if(a.has(r(e)))return!1;return!0}function iT(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function aT(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=iT(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=bT(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var oT,sT,cT,lT,uT,dT,fT,pT,mT,hT,gT,_T,vT,yT,bT,xT=t((()=>{Zw(),nT(),sT=()=>{if(oT!==void 0)return oT;if(typeof navigator>`u`)return oT=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return oT=!0;let e=navigator.maxTouchPoints;return oT=navigator.platform===`MacIntel`&&e!==void 0&&e>0},cT=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},lT=e=>e,uT=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},dT=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(cT(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(cT(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},fT={passive:!0},pT=typeof window>`u`||`onscrollend`in window,mT=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&pT,o=0,s=a?null:tT(i,()=>t(n(r),!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,fT),a&&r.addEventListener(`scrollend`,u,fT),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u),s?.cancel()}},hT=(e,t)=>mT(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),gT=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},_T=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},vT=_T,yT=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(t.isConnected)this.isIndexInRange(n)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this));else{this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}}};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:lT,rangeExtractor:uT,onChange:()=>{},measureElement:gT,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=this._singleLaneMeasurements?.items??s,l=e=>Yw(c[e]),u=e>0?l(0):null,d=e>0?l(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==u||t.getItemKey(o-1)!==d)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>0&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==d)&&(o>e||rT(e,o,l,t.getItemKey))&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:a,getItemKey:c}=this.options,l=0;for(;l<a&&c(l)!==e;)l++;if(l<a){let e=n[l];if(e){let n=Math.max(0,e.start+t);!i&&n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=Qw(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.targetWindow=this.scrollElement&&`ownerDocument`in this.scrollElement?this.scrollElement.ownerDocument.defaultView:this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&this._intendedScrollOffset===null&&e===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5?e=this._intendedScrollOffset:this.scrollState?.index!=null&&this.scrollState.hasReachedTarget&&!eT(e,this.scrollState.lastTargetOffset)&&!eT(e,this.getScrollStateTarget(this.scrollState))&&(this._clampedAdjustment===null||Math.abs(e-this._clampedAdjustment.maxAtWrite)>=1.5)&&(this.scrollState=null),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(e-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;let n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,sT()&&this.targetWindow!=null&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,fT),e.addEventListener(`touchend`,n,fT),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(sT()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this.scrollState?.behavior===`smooth`&&!eT(this.getScrollOffset()-i,this.scrollState.lastTargetOffset)||this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;let{target:e,maxAtWrite:t}=this._clampedAdjustment,n=this.getMaxScrollOffset();n>t+.5&&(this._clampedAdjustment=e>n+.5?{target:e,maxAtWrite:n}:null,this._scrollToOffset(e,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;if(this._iosDeferredAdjustment<0&&e>=t-1){this._iosDeferredAdjustment=0;return}let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Qw(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.isIndexInRange=e=>e>=0&&e<this.options.count,this.getMeasurements=Qw(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._singleLaneMeasurements?.flat;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e}let o=u===0?Array(e):this._singleLaneMeasurements.items.slice(),c;if(u===0)c=t+n;else{let e=u-1;c=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t);o[t]=e;let n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=c,a[t*2+1]=i,c+=i+s}this._singleLaneMeasurements={flat:a,items:o};let d=Xw(o,a);return this.measurementsCache=d,d}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Qw(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=aT(e,t,n,r,r===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Qw(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e);if(!this.isIndexInRange(t))return;let n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),e.isConnected&&(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(!this.isIndexInRange(e))return;let n,r,i,a=this._singleLaneMeasurements?.flat;if(this.options.lanes===1&&a!=null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=this.itemSizeCache.get(i)??n,s=t-o;if(s!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,c=a?this.getTotalSize():0,l=this.getScrollOffset()+this.scrollAdjustments,u=this.itemSizeCache.has(i)?r+o<=l&&this.scrollDirection!==`backward`:r<l,d=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?u:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},s,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++;let f=!1;a?f=this.applyScrollAdjustment(this.getTotalSize()-c):d&&(f=this.applyScrollAdjustment(s)),this.notify(f),this._retryClampedAdjustment()}},this.getVirtualItems=Qw(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._singleLaneMeasurements?.flat,r=this.options.lanes===1&&n!=null;return $w(t[bT(0,t.length-1,r?e=>n[e*2]:e=>$w(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`){if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t]}if(t===`end`&&e===this.options.count-1){let e=this.getMaxScrollOffset(),n=e-this.options.paddingEnd+this.options.scrollPaddingEnd;return[Math.max(Math.min(n,e),0),t]}let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0;let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0,hasReachedTarget:!1},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0,e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0,hasReachedTarget:eT(i,this.getScrollOffset())},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0,hasReachedTarget:!1},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this._iosDeferredAdjustment=0;let t=Math.max(this.getMaxScrollOffset(),0);this.scrollState={index:this.options.count-1,align:`end`,behavior:e,toEnd:!0,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,hasReachedTarget:eT(t,this.getScrollOffset())},this._scrollToOffset(t,{adjustments:void 0,behavior:e}),this.scheduleScrollReconcile()}else this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.cancelScroll=()=>{this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._singleLaneMeasurements?.flat;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){if(e===0)return!1;if(sT()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=e,!1;{let n=this.getScrollOffset()+this.scrollAdjustments+e,r=this.scrollElement,i=r!==null&&(`scrollHeight`in r||`document`in r)?this.getMaxScrollOffset():null;return this._clampedAdjustment=i!==null&&n>i+.5?{target:n,maxAtWrite:i}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){this.targetWindow?this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}):this.scrollState=null}getScrollStateTarget(e){let t=e.toEnd?[Math.max(this.getMaxScrollOffset(),0)]:e.index==null?void 0:this.getOffsetForIndex(e.index,e.align);return t?t[0]:e.lastTargetOffset}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.getScrollStateTarget(this.scrollState),t=this.scrollState.index==null?1:this.options.useAnimationFrameWithResizeObserver?3:2,n=e!==this.scrollState.lastTargetOffset;if(!n&&eT(e,this.getScrollOffset())){if(this.scrollState.hasReachedTarget=!0,this.scrollState.stableFrames++,this.scrollState.stableFrames>=t){this.getScrollOffset()!==e&&this._scrollToOffset(e,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let t=this.getSize()||600,n=Math.abs(e-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>t;this.scrollState.lastTargetOffset=e,r?this.scrollState.hasReachedTarget=!1:this.scrollState.behavior=`auto`,this._scrollToOffset(e,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},bT=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0}}));function ST({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=wT.useReducer(e=>e+1,0)[1],a=wT.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=wT.useRef(!1),s=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}},c=(e,t,n)=>{let r=a.current,i=!!e.options.horizontal,o=t.start-e.options.scrollMargin;r.lastPositions.get(n)!==o&&(r.lastPositions.set(n,o),r.mode===`transform`?n.style.transform=i?`translate3d(${o}px, 0, 0)`:`translate3d(0, ${o}px, 0)`:n.style[i?`left`:`top`]=`${o}px`)},l=e=>{let t=a.current;if(t.enabled&&t.container){s(e);for(let t of e.getVirtualItems()){let n=e.elementsCache.get(t.key);n&&c(e,t,n)}}},u={...r,onChange:(t,n)=>{var s;let c=a.current,u=!0;if(c.enabled){l(t);let e=t.range,n=c.prevRange;u=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,u&&(c.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}u&&(e&&n&&!o.current?(0,TT.flushSync)(i):i()),(s=r.onChange)==null||s.call(r,t,n)}},[d]=wT.useState(()=>{let e=new yT(u),t=e.measureElement;return e.measureElement=n=>{o.current=!0;try{t(n)}finally{o.current=!1}let r=a.current;if(n!==null&&r.enabled&&r.container){let t=e.measurementsCache[e.indexFromElement(n)];t&&c(e,t,n)}},Object.assign(e,{containerRef:t=>{let n=a.current;n.container=t,n.lastSize=null,t!==null&&l(e)}})});return d.setOptions(u),ET(()=>d._didMount(),[]),ET(()=>(s(d),d._willUpdate())),ET(()=>{l(d)}),d}function CT(e){return ST({observeElementRect:dT,observeElementOffset:hT,scrollToFn:vT,...e})}var wT,TT,ET,DT=t((()=>{wT=e(i(),1),TT=Ne(),xT(),xT(),ET=typeof document<`u`?wT.useLayoutEffect:wT.useEffect})),OT,kT,AT,jT=t((()=>{OT=e(i()),DT(),kT=a(),AT=(0,OT.memo)((0,OT.forwardRef)(function({items:e,scrollRef:t,renderRow:n,tail:r,hasOlder:i},a){let o=(0,OT.useRef)(null),[s,c]=(0,OT.useState)(0),l=(0,OT.useRef)(null),[u,d]=(0,OT.useState)(null);(0,OT.useEffect)(()=>{d(t.current)},[t]);let f=(0,OT.useCallback)(t=>t<e.length?`turn:${e[t].id}`:`live-turn`,[e]),p=!!r,m=(0,OT.useCallback)(t=>{let n=uT(t);return p&&!n.includes(e.length)&&n.push(e.length),n},[e.length,p]),h=CT({count:e.length+ +!!r,getScrollElement:()=>u,getItemKey:f,rangeExtractor:m,estimateSize:()=>320,overscan:4,gap:10,scrollMargin:s,anchorTo:`end`,followOnAppend:!0,scrollEndThreshold:240,useAnimationFrameWithResizeObserver:!0});return(0,OT.useImperativeHandle)(a,()=>({scrollToEnd:()=>h.scrollToEnd()}),[h]),(0,OT.useLayoutEffect)(()=>{let e=u,t=o.current;if(!e||!t)return;let n=()=>{let n=t.getBoundingClientRect().top-e.getBoundingClientRect().top-e.clientTop+e.scrollTop,r=l.current;l.current=n,c(n),r!==null&&r!==n&&e.scrollTop>Math.min(r,n)&&h.scrollToOffset(e.scrollTop+n-r)};n();let r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[u,i,h]),(0,OT.useLayoutEffect)(()=>{u&&h.scrollToEnd()},[h,u]),(0,kT.jsx)(`div`,{ref:o,className:`virtual-chat-history`,style:{position:`relative`,width:`100%`,height:h.getTotalSize(),flexShrink:0,overflowAnchor:`none`},children:h.getVirtualItems().map(t=>(0,kT.jsx)(`div`,{"data-index":t.index,ref:h.measureElement,className:`virtual-chat-row`,style:{position:`absolute`,top:0,left:0,width:`100%`,display:`flow-root`,transform:`translateY(${t.start-s}px)`},children:t.index<e.length?n(t.index):r},t.key))})}))}));function MT({chatId:e,language:t,message:n,sending:r,isSpeaking:i,onSendVoiceMessage:a,onSetMessage:o}){let[s,c]=(0,NT.useState)(!1),[l,u]=(0,NT.useState)(!1),[d,f]=(0,NT.useState)(``),[p,m]=(0,NT.useState)(!1),h=(0,NT.useRef)(null),g=(0,NT.useRef)(null),_=(0,NT.useRef)(null),v=(0,NT.useRef)(null),y=(0,NT.useRef)(!1),b=(0,NT.useRef)(!1),x=(0,NT.useRef)(!1),S=(0,NT.useRef)(!1),C=(0,NT.useRef)(n),w=(0,NT.useRef)(e),T=(0,NT.useRef)(e);w.current=e,(0,NT.useEffect)(()=>{y.current=l,l||(E(),f(``))},[l]),(0,NT.useEffect)(()=>{b.current=r},[r]),(0,NT.useEffect)(()=>{x.current=p},[p]),(0,NT.useEffect)(()=>{S.current=i},[i]),(0,NT.useEffect)(()=>{C.current=n},[n]);let E=()=>{v.current!==null&&(window.clearTimeout(v.current),v.current=null)},D=()=>{_.current!==null&&(window.clearTimeout(_.current),_.current=null)},O=()=>{E(),D(),h.current?.stop(),c(!1),u(!1)},k=()=>{E(),D();let e=h.current;if(h.current=null,g.current?.(!1),g.current=null,e){e.onstart=e.onresult=e.onend=e.onerror=null;try{e.abort()}catch{}}y.current=!1,u(!1),c(!1),f(``)};(0,NT.useEffect)(()=>{T.current!==e&&(T.current=e,k())},[e]);let A=(e=350)=>{E(),!(!y.current||b.current||x.current||S.current)&&(v.current=window.setTimeout(()=>{v.current=null,ee(!0)},e))},ee=(n=!1)=>{if(h.current||b.current||x.current||S.current)return Promise.resolve(!1);let r=window.SpeechRecognition||window.webkitSpeechRecognition;if(!r)return f(``),y.current=!1,u(!1),window.alert(`Speech recognition is unavailable in this browser. Use Chrome or Edge.`),Promise.resolve(!1);let i=``,s=new Promise(e=>{g.current=e});D();try{let l=new r;l.continuous=!0,l.interimResults=!0,l.lang=t===`en`?`en-US`:`th-TH`;let d=()=>{D(),n&&(_.current=window.setTimeout(()=>{l.stop()},2e3))};return l.onstart=()=>{h.current===l&&(c(!0),u(!0),g.current?.(!0),g.current=null)},l.onresult=e=>{if(h.current!==l)return;let t=``,n=``;for(let r=0;r<e.results.length;r+=1){let i=e.results[r]?.[0]?.transcript??``;e.results[r]?.isFinal?n+=i:t+=i}let r=(n||t).trim();r&&f(r),n.trim()&&(i=n.trim()),r&&d()},l.onerror=e=>{h.current===l&&(g.current?.(!1),g.current=null,f(e.error===`not-allowed`?`Microphone permission denied`:`Speech recognition error: ${e.error}`),y.current=!1,u(!1),c(!1),D())},l.onend=()=>{if(h.current!==l||w.current!==e)return;g.current?.(!1),g.current=null,h.current=null,n||(y.current=!1,u(!1)),c(!1),D();let t=i.trim();t?n?(x.current=!0,m(!0),a(t).catch(e=>console.error(`Voice message failed`,e)).finally(()=>{x.current=!1,m(!1),A()})):o(C.current.trim()?`${C.current.trimEnd()} ${t}`:t):n&&y.current&&A()},h.current=l,l.start(),s}catch(e){return g.current?.(!1),g.current=null,f(e instanceof Error?e.message:String(e)),h.current=null,c(!1),D(),Promise.resolve(!1)}};return(0,NT.useEffect)(()=>{!l||r||p||i||s||h.current||A()},[l,r,p,i,s]),(0,NT.useEffect)(()=>()=>{if(E(),D(),g.current?.(!1),g.current=null,h.current)try{let e=h.current;e.onstart=e.onresult=e.onend=e.onerror=null,e.abort()}catch{}},[]),{isRecording:s,voiceMode:l,setVoiceMode:u,voiceTranscript:d,setVoiceTranscript:f,voiceAwaitingResponse:p,voiceAwaitingResponseRef:x,voiceModeRef:y,startRecognition:ee,stopRecognition:O,cancelRecognition:k,scheduleVoiceListen:A,clearRestartTimer:E}}var NT,PT=t((()=>{NT=e(i())})),FT=t((()=>{PT()})),IT=t((()=>{}));function LT({accentColor:e=`var(--text-primary)`,iconColor:t=`var(--text-muted)`,background:n=`var(--bg-surface-soft)`,size:r=28,shape:i=`pill`,reach:a=8,showTime:o=!0,waveform:s=!0,slideToCancel:c=!0,cancelDistance:l=64,attack:u=40,release:d=240,sensitivity:f=1,floor:p=.1,openDuration:m=200,pressScale:h=.95,mode:g=`auto`,holdAfter:_=300,reactive:v=`simulated`,disabled:y=!1,ariaLabel:b=`Dictate`,onStart:x,onStop:S,className:C=``,active:w,id:T,title:E}){let[D,O]=(0,RT.useState)(!!w),[k,A]=(0,RT.useState)(!1),[ee,te]=(0,RT.useState)(!1),[j,ne]=(0,RT.useState)(`pointer`),re=(0,RT.useRef)(null),M=(0,RT.useRef)(null),ie=(0,RT.useRef)(null),N=(0,RT.useRef)({listening:!!w,pointerId:null,ownPress:!1,downX:0,sliding:!1,hist:[],tick:0,acc:0,downAt:0,startedAt:0,raf:0,last:0,env:0,t0:0,audio:null,generation:0}),ae=(0,RT.useRef)({});ae.current={attack:u,release:d,sensitivity:f,floor:p,mode:g,holdAfter:_,reactive:v,showTime:o,waveform:s,slideToCancel:c,cancelDistance:l,accentColor:e,onStart:x,onStop:S,active:w,disabled:y};let oe=e=>{let t=N.current,n=ae.current,r=Math.min((e-t.last)/1e3,WT);t.last=e;let i=0;t.listening&&(t.audio?.analyser?i=JT(t.audio.analyser,t.audio.buf):n.reactive!==`mic`&&(i=qT((e-t.t0)/1e3))),i=Math.min(1,i*n.sensitivity);let a=Math.max(1,i>t.env?n.attack:n.release)/1e3;if(t.env+=(i-t.env)*(1-Math.exp(-r/a)),t.listening&&n.showTime&&re.current){let n=XT(e-t.startedAt);re.current.textContent!==n&&(re.current.textContent=n)}t.listening&&n.waveform&&ie.current&&YT(t,ie.current,t.env,n.accentColor,n.floor),t.raf=t.listening?requestAnimationFrame(oe):0},se=e=>{let t=N.current,n=ae.current;if(t.listening||n.disabled)return;t.listening=!0,t.generation++;let r=t.generation;t.hist=[],t.tick=0,t.acc=0,t.env=0,t.startedAt=performance.now(),t.t0=t.startedAt,t.last=t.startedAt,re.current&&(re.current.textContent=`0:00`),O(n.active===void 0),A(n.active!==void 0),ne(e),t.raf||=requestAnimationFrame(oe);try{let e=n.onStart?.({source:n.reactive});Promise.resolve(e).then(e=>{t.generation===r&&(A(!1),e===!1&&ce(`start-failed`,!1))}).catch(()=>{t.generation===r&&ce(`start-failed`,!1)})}catch{ce(`start-failed`,!1)}n.reactive===`mic`&&ZT(t,r).catch(()=>{t.generation===r&&ce(`mic-denied`)})},ce=(e,t=!0)=>{let n=N.current,r=ae.current;n.listening&&(n.listening=!1,n.generation++,QT(n),cancelAnimationFrame(n.raf),n.raf=0,O(!1),A(!1),ne(e===`key`||e===`escape`?`key`:`pointer`),t&&r.onStop?.({reason:e,duration:Math.round(performance.now()-n.startedAt)}))},le=()=>{N.current.sliding=!1;let e=M.current;e&&(delete e.dataset.sliding,e.style.setProperty(`--vp-slide`,`0px`),e.style.setProperty(`--vp-cancel`,`0`))},ue=e=>{let t=N.current,n=ae.current,r=M.current;if(!r||t.pointerId!==e.pointerId||!n.slideToCancel||!t.listening||!t.ownPress)return;let i=e.clientX-t.downX;if(!t.sliding&&i>-4)return;t.sliding=!0,r.dataset.sliding=``;let a=Math.min(n.cancelDistance+24,Math.max(0,-i));r.style.setProperty(`--vp-slide`,`${-a}px`);let o=Math.min(1,a/n.cancelDistance);r.style.setProperty(`--vp-cancel`,o.toFixed(3)),o>=1&&(le(),ce(`cancel`))},de=e=>{let t=N.current;if(!y&&e.button===0&&e.isPrimary&&t.pointerId===null){e.preventDefault(),e.currentTarget.focus({preventScroll:!0}),t.pointerId=e.pointerId,t.downX=e.clientX,t.downAt=performance.now();try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}te(!0),t.ownPress=!t.listening,t.listening||se(`pointer`)}},fe=e=>{let t=N.current;if(e.pointerId!==t.pointerId)return!1;t.pointerId=null,te(!1),t.sliding&&le();try{e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)}catch{}return!0},pe=e=>{let t=N.current,n=ae.current;if(!fe(e)||!t.listening)return;let r=performance.now()-t.downAt,i=n.mode===`hold`||n.mode===`auto`&&r>=n.holdAfter;t.ownPress?i&&ce(`release`):ce(r<n.holdAfter?`tap`:`release`)},me=e=>{fe(e)&&ce(`cancel`)},he=e=>{e.key===`Escape`&&N.current.listening?(e.preventDefault(),e.stopPropagation(),le(),ce(`escape`)):e.key!==` `&&e.key!==`Enter`||e.repeat||(e.preventDefault(),N.current.listening?ce(`key`):se(`key`))},ge=e=>{e.detail===0&&N.current.pointerId===null&&!e.nativeEvent.pointerType&&(N.current.listening?ce(`key`):se(`key`))};(0,RT.useEffect)(()=>{if(w===void 0)return;let e=N.current;w?(e.listening||(e.listening=!0,e.generation++,e.hist=[],e.env=0),e.startedAt=performance.now(),e.t0=e.startedAt,e.last=e.startedAt,O(!0),A(!1),e.raf||=requestAnimationFrame(oe)):e.listening&&ce(`external`,!1)},[w]),(0,RT.useEffect)(()=>{if(!D&&!k)return;let e=()=>{le(),N.current.pointerId=null,te(!1),ce(`blur`)},t=()=>{document.hidden&&e()};return window.addEventListener(`blur`,e),document.addEventListener(`visibilitychange`,t),()=>{window.removeEventListener(`blur`,e),document.removeEventListener(`visibilitychange`,t)}},[D,k]),(0,RT.useEffect)(()=>{y&&(le(),N.current.pointerId=null,te(!1),ce(`disabled`))},[y]),(0,RT.useEffect)(()=>{let e=N.current;return()=>{e.listening&&(e.listening=!1,e.generation++,ae.current.onStop?.({reason:`unmount`,duration:Math.round(performance.now()-e.startedAt)})),QT(e),cancelAnimationFrame(e.raf),e.raf=0,e.audio?.ctx.close()}},[]);let _e=i===`rounded`?Math.round(r*.29):r/2,ve=Math.max(0,Math.min(10,(44-r)/2)),ye=Math.max(10,Math.round(r*.36)),be=o?Math.round(ye*2.5)+4:0,xe=s?Math.round(r*1.9):0,Se=be+xe;return(0,zT.jsxs)(`button`,{id:T,title:E,type:`button`,disabled:y,"aria-label":b,"aria-pressed":D,"aria-busy":k||void 0,className:`voice-pill${C?` ${C}`:``}`,"data-state":D?`listening`:`idle`,"data-pending":k?``:void 0,"data-pressed":ee?``:void 0,"data-input":j,"data-time":o?``:void 0,ref:M,onPointerDown:de,onPointerMove:ue,onPointerUp:pe,onPointerCancel:me,onLostPointerCapture:me,onKeyDown:he,onClick:ge,onContextMenu:e=>e.preventDefault(),style:{"--vp-accent":e,"--vp-icon":t,"--vp-bg":n,"--vp-size":`${r}px`,"--vp-radius":`${_e}px`,"--vp-reach":`${a}px`,"--vp-extra":`${Se}px`,"--vp-clock-w":`${be}px`,"--vp-wave-w":`${xe}px`,"--vp-stop":`${Math.round(r*.32)}px`,"--vp-icon-size":`${Math.round(r*.54)}px`,"--vp-time-size":`${ye}px`,"--vp-open":`${m}ms`,"--vp-press":h,"--vp-hit":`${ve}px`},children:[(0,zT.jsx)(`span`,{className:`voice-pill__capsule`,"aria-hidden":`true`}),s?(0,zT.jsx)(`canvas`,{ref:ie,className:`voice-pill__wave`,"aria-hidden":`true`}):null,c?(0,zT.jsxs)(`span`,{className:`voice-pill__cancel`,"aria-hidden":`true`,children:[(0,zT.jsx)(Xe,{icon:st,size:12,strokeWidth:2.2}),(0,zT.jsx)(`span`,{children:`Cancel`})]}):null,o?(0,zT.jsx)(`span`,{ref:re,className:`voice-pill__time`,"aria-hidden":`true`,children:`0:00`}):null,(0,zT.jsxs)(`span`,{className:`voice-pill__glyph`,"aria-hidden":`true`,children:[(0,zT.jsx)(`span`,{className:`voice-pill__mic`,children:(0,zT.jsx)(Xe,{icon:vt,size:Math.round(r*.54),strokeWidth:2})}),(0,zT.jsx)(`span`,{className:`voice-pill__stop`})]})]})}var RT,zT,BT,VT,HT,UT,WT,GT,KT,qT,JT,YT,XT,ZT,QT,$T=t((()=>{RT=e(i()),Ze(),mt(),IT(),zT=a(),BT=4.8,VT=[[.1,.16,.9],[.3,.12,.7],[.5,.2,1],[.95,.14,.8],[1.15,.1,.6],[1.3,.22,.95],[1.9,.16,.85],[2.12,.12,.7],[2.3,.18,.9],[2.55,.1,.5],[3.05,.24,1],[3.4,.12,.75],[3.6,.16,.9]],HT=[[1,4],[4,11],[11,33]],UT=2.2,WT=.05,GT=4,KT=80,qT=e=>{let t=e%BT,n=.06;for(let[e,r,i]of VT){let a=(t-e)/r;a>=0&&a<=1&&(n=Math.max(n,i*.5*(1-Math.cos(2*Math.PI*a))))}return n*(.7+.3*Math.abs(Math.sin(2*Math.PI*7.1*t)))},JT=(e,t)=>{e.getByteFrequencyData(t);let n=0;for(let[e,r]of HT){let i=0;for(let n=e;n<r;n++)i+=t[n];n+=i/((r-e)*255)}return n/HT.length*UT},YT=(e,t,n,r,i)=>{let a=Math.min(2,window.devicePixelRatio||1),o=t.getBoundingClientRect(),s=Math.max(1,Math.round(o.width*a)),c=Math.max(1,Math.round(o.height*a));(t.width!==s||t.height!==c)&&(t.width=s,t.height=c);let l=t.getContext(`2d`);if(!l)return;e.acc=Math.max(e.acc,n),e.tick=(e.tick+1)%GT,e.tick===0&&(e.hist.push(e.acc),e.acc=0,e.hist.length>KT&&e.hist.shift());let u=2*a,d=3*a,f=e.tick/GT*d,p=typeof r==`string`&&r.startsWith(`var(`)?getComputedStyle(t).color||`#f5f5f5`:r;l.clearRect(0,0,s,c),l.fillStyle=p;for(let t=0;t<e.hist.length;t++){let n=e.hist[e.hist.length-1-t],r=s-(t+1)*d-f;if(r+u<0)break;let a=Math.max(u,(i+(1-i)*n)*c),o=Math.min(1,Math.max(0,(r+u/2)/(s*.55))),p=o*o*(3-2*o);l.globalAlpha=(.35+.65*n)*p,l.beginPath(),l.roundRect(r,(c-a)/2,u,a,u/2),l.fill()}l.globalAlpha=1},XT=e=>{let t=Math.floor(e/1e3);return`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`},ZT=async(e,t)=>{let n=window.AudioContext||window.webkitAudioContext;if(!n||!navigator.mediaDevices?.getUserMedia)throw Error(`unsupported`);e.audio??={ctx:new n};let r=e.audio;r.ctx.state===`suspended`&&await r.ctx.resume();let i=await navigator.mediaDevices.getUserMedia({audio:!0});!e.listening||e.generation!==t?i.getTracks().forEach(e=>e.stop()):(r.stream=i,r.src=r.ctx.createMediaStreamSource(i),r.analyser=r.ctx.createAnalyser(),r.analyser.fftSize=256,r.analyser.smoothingTimeConstant=0,r.src.connect(r.analyser),r.buf=new Uint8Array(r.analyser.frequencyBinCount))},QT=e=>{let t=e.audio;t?.stream&&(t.stream.getTracks().forEach(e=>e.stop()),t.src?.disconnect(),t.stream=null,t.src=null,t.analyser=null,t.buf=null)}}));function eE(e,t){switch(e.type){case`turnComplete`:case`interrupted`:case`closed`:t.onTurnSaved?.();break;case`toolStatus`:t.onToolActivity?.();break;case`approvalRequested`:t.onApprovalRequested?.({token:e.token,approval:e.approval})}}function tE(e,t,n,r){for(let t of e)try{t.stop(),t.disconnect()}catch{}e.clear(),t.current=0,r(!1),n.current!==null&&typeof window<`u`&&(window.clearTimeout(n.current),n.current=null)}function nE(e){let t=Math.max(-1,Math.min(1,e));return t<0?Math.max(-32768,Math.round(t*32768)):Math.min(32767,Math.round(t*32768))}function rE(e,t,n=sE){if(e.length===0||t<=0||n<=0)return new Int16Array;if(t===n){let t=new Int16Array(e.length);for(let n=0;n<e.length;n+=1)t[n]=nE(e[n]);return t}let r=t/n,i=Math.floor(e.length/r),a=new Int16Array(i);for(let t=0;t<i;t+=1){let n=t*r,i=(t+1)*r,o=Math.floor(n),s=Math.floor(i),c=0;if(o===s)c=e[o]??0;else{let t=0,r=0,a=o+1-n;t+=(e[o]??0)*a,r+=a;let l=Math.min(s,e.length);for(let n=o+1;n<l;n+=1)t+=e[n],r+=1;if(s<e.length&&i>s){let n=i-s;t+=e[s]*n,r+=n}c=r>0?t/r:0}a[t]=nE(c)}return a}function iE(e){let t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),n=``;for(let e=0;e<t.length;e+=1)n+=String.fromCharCode(t[e]);return btoa(n)}function aE({workspacePath:e,chatId:t,startSession:n,sendAudioChunk:r,stopSession:i,onTurnSaved:a,onToolActivity:o,onApprovalRequested:s}){let[c,l]=(0,oE.useState)(!1),[u,d]=(0,oE.useState)(!1),[f,p]=(0,oE.useState)(``),[m,h]=(0,oE.useState)(``),[g,_]=(0,oE.useState)(!1),[v,y]=(0,oE.useState)(!1),[b,x]=(0,oE.useState)(!1),[S,C]=(0,oE.useState)(``),w=(0,oE.useRef)(!1),T=(0,oE.useRef)(!1),E=(0,oE.useRef)(!1),D=(0,oE.useRef)(null),O=(0,oE.useRef)(null),k=(0,oE.useRef)(null),A=(0,oE.useRef)(0),ee=(0,oE.useRef)(new Set),te=(0,oE.useRef)(()=>{}),j=(0,oE.useRef)({onTurnSaved:a,onToolActivity:o,onApprovalRequested:s});j.current={onTurnSaved:a,onToolActivity:o,onApprovalRequested:s};let ne=(0,oE.useRef)(null),re=(0,oE.useRef)(null),M=(0,oE.useRef)(0),ie=(0,oE.useRef)(null),N=(0,oE.useRef)(!0),ae=(0,oE.useRef)(!0);(0,oE.useEffect)(()=>{w.current=u},[u]),(0,oE.useEffect)(()=>{T.current=g},[g]);let oe=(0,oE.useCallback)(()=>(O.current&&O.current.state!==`closed`||(O.current=new AudioContext,k.current=O.current.createAnalyser(),k.current.fftSize=512,k.current.smoothingTimeConstant=.3,k.current.minDecibels=-90,k.current.maxDecibels=-10),O.current),[]),se=(0,oE.useCallback)(e=>{let t=oe(),n=atob(e),r=new Uint8Array(n.length);for(let e=0;e<n.length;e+=1)r[e]=n.charCodeAt(e);let i=new Int16Array(r.buffer,r.byteOffset,Math.floor(r.length/2)),a=t.createBuffer(1,i.length,cE),o=a.getChannelData(0);for(let e=0;e<i.length;e+=1)o[e]=i[e]/32768;let s=t.createBufferSource();s.buffer=a,s.connect(t.destination),k.current&&s.connect(k.current),ee.current.add(s),s.onended=()=>{ee.current.delete(s),s.disconnect()};let c=Math.max(t.currentTime,M.current);s.start(c),M.current=c+a.duration,x(!0),ie.current!==null&&window.clearTimeout(ie.current);let l=Math.max(0,(c+a.duration-t.currentTime)*1e3)+500;ie.current=window.setTimeout(()=>x(!1),l)},[oe]),ce=(0,oE.useCallback)(()=>{tE(ee.current,M,ie,x)},[]),le=(0,oE.useCallback)(e=>{switch(e.type){case`audioChunk`:_(!1),se(e.data);break;case`transcript`:if(e.role===`user`){let t=N.current;N.current=!1,p(n=>t?e.text:n+e.text)}else{let t=ae.current;ae.current=!1,h(n=>t?e.text:n+e.text)}break;case`turnComplete`:N.current=!0,ae.current=!0;break;case`interrupted`:ce(),N.current=!0,ae.current=!0;break;case`toolStatus`:ae.current=!0,h(e.error?`${e.action} failed: ${e.error}`:`Running ${e.action}...`);break;case`approvalRequested`:break;case`error`:console.error(`Gemini Live session error`,e.message),N.current=!0,ae.current=!0,h(e.message),C(e.message);break;case`closed`:te.current(),l(!1),_(!1),x(!1),D.current=null,N.current=!0,ae.current=!0,C(`Live connection closed`)}eE(e,j.current)},[se,ce]),ue=(0,oE.useCallback)(()=>{re.current?.workletPort&&(re.current.workletPort.onmessage=null,re.current.workletPort.close?.()),re.current?.processor.disconnect(),re.current?.source.disconnect(),re.current=null,ne.current?.getTracks().forEach(e=>e.stop()),ne.current=null},[]),de=(0,oE.useCallback)(()=>{++A.current,ue(),ce(),k.current?.disconnect(),k.current=null;let e=O.current;O.current=null,e&&e.state!==`closed`&&e.close().catch(e=>console.error(`Failed to close Live audio`,e));let t=D.current;D.current=null,l(!1),_(!1),y(!1),E.current=!1,t&&i(t).then(()=>{j.current.onTurnSaved?.()}).catch(e=>console.error(`Failed to stop Gemini Live session`,e))},[ue,ce,i]);te.current=de;let fe=(0,oE.useCallback)(()=>{y(e=>{let t=!e;return E.current=t,t})},[]),pe=(0,oE.useCallback)(async()=>{let a=++A.current;try{if(C(``),N.current=!0,ae.current=!0,p(``),h(``),!navigator.mediaDevices?.getUserMedia)throw Error(`This window does not support microphone capture (navigator.mediaDevices.getUserMedia is unavailable).`);console.log(`[gemini-live] requesting microphone permission...`);let o=await navigator.mediaDevices.getUserMedia({audio:{sampleRate:sE,channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});if(a!==A.current){o.getTracks().forEach(e=>e.stop());return}console.log(`[gemini-live] microphone granted, starting session...`),ne.current=o;let s=await n(e=>{a===A.current&&le(e)},e,t);if(a!==A.current){await i(s);return}console.log(`[gemini-live] session started`,s),D.current=s;let c=oe(),u=c.createMediaStreamSource(o);if(c.state===`suspended`&&await c.resume(),a!==A.current){u.disconnect();return}let d=e=>{if(!D.current||E.current)return;let t=rE(e,c.sampleRate,sE);t.length!==0&&r(D.current,iE(t)).catch(e=>console.error(`Failed to send Gemini Live audio chunk`,e))},f=!1;if(typeof AudioWorkletNode<`u`&&c.audioWorklet&&typeof c.audioWorklet.addModule==`function`&&typeof Blob<`u`&&typeof URL<`u`&&typeof URL.createObjectURL==`function`)try{let e=new Blob([dE],{type:`application/javascript`}),t=URL.createObjectURL(e);try{await c.audioWorklet.addModule(t)}finally{URL.revokeObjectURL(t)}if(a!==A.current){u.disconnect();return}let n=new AudioWorkletNode(c,uE,{numberOfInputs:1,numberOfOutputs:0,channelCount:1});n.port.onmessage=e=>{e.data instanceof Float32Array&&d(e.data)},u.connect(n),k.current&&u.connect(k.current),re.current={source:u,processor:n,workletPort:n.port},f=!0}catch{}if(!f){let e=c.createScriptProcessor(lE,1,1);e.onaudioprocess=e=>{d(e.inputBuffer.getChannelData(0))},u.connect(e),k.current&&u.connect(k.current),e.connect(c.destination),re.current={source:u,processor:e}}l(!0),_(!0)}catch(e){if(a!==A.current)return;console.error(`Failed to start Gemini Live voice session`,e),h(`Error: ${e instanceof Error?e.message:String(e)}`),C(e instanceof Error?e.message:String(e)),de()}},[le,e,t,oe,de,n,i,r]);(0,oE.useEffect)(()=>{u?pe():de()},[u]),(0,oE.useEffect)(()=>de,[de]);let me=(0,oE.useCallback)(()=>{w.current&&(de(),pe())},[de,pe]),he=(0,oE.useCallback)(()=>{},[]);return{isRecording:c,voiceMode:u,setVoiceMode:d,userTranscript:f,assistantTranscript:m,voiceAwaitingResponse:g,voiceAwaitingResponseRef:T,voiceModeRef:w,isPaused:v,togglePause:fe,isSpeaking:b,analyserRef:k,errorMessage:S,restart:me,startRecognition:he,stopRecognition:he,scheduleVoiceListen:he,clearRestartTimer:he}}var oE,sE,cE,lE,uE,dE,fE=t((()=>{oE=e(i()),sE=16e3,cE=24e3,lE=2048,uE=`mint-gemini-live-capture`,dE=`
|
|
74
|
+
class MintGeminiLiveCaptureProcessor extends AudioWorkletProcessor {
|
|
75
|
+
constructor() {
|
|
76
|
+
super();
|
|
77
|
+
this._buffer = new Float32Array(${lE});
|
|
78
|
+
this._offset = 0;
|
|
79
|
+
}
|
|
80
|
+
process(inputs) {
|
|
81
|
+
const channel = inputs[0] && inputs[0][0];
|
|
82
|
+
if (!channel || channel.length === 0) return true;
|
|
83
|
+
let read = 0;
|
|
84
|
+
while (read < channel.length) {
|
|
85
|
+
const space = this._buffer.length - this._offset;
|
|
86
|
+
const toCopy = Math.min(space, channel.length - read);
|
|
87
|
+
this._buffer.set(channel.subarray(read, read + toCopy), this._offset);
|
|
88
|
+
this._offset += toCopy;
|
|
89
|
+
read += toCopy;
|
|
90
|
+
if (this._offset >= this._buffer.length) {
|
|
91
|
+
const chunk = this._buffer.slice(0);
|
|
92
|
+
this._offset = 0;
|
|
93
|
+
this.port.postMessage(chunk, [chunk.buffer]);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
registerProcessor('${uE}', MintGeminiLiveCaptureProcessor);
|
|
100
|
+
`})),pE=t((()=>{}));function mE(e){return e.voicePickerOpen?`close_voice_picker`:e.hasPendingApproval?`ignore`:`end_call`}function hE({status:e,userTranscript:t,assistantTranscript:n,isPaused:r,onTogglePause:i,onEndCall:a,voice:o,voices:s,onChangeVoice:c,analyserRef:l,pendingApproval:u,onApproval:d}){let[f,p]=(0,gE.useState)(!1),m=(0,gE.useRef)(null),h=(0,gE.useRef)(a);h.current=a;let g=(0,gE.useRef)(f);g.current=f;let _=(0,gE.useRef)(!!(u&&d));_.current=!!(u&&d);let v=(0,gE.useRef)(null);(0,gE.useEffect)(()=>{let e=document.activeElement,t=document.body.style.overflow;document.body.style.overflow=`hidden`;let n=m.current;n.querySelector(`[data-call-control]:not(:disabled), [aria-label="End Live conversation"]`)?.focus();let r=e=>{if(e.key===`Escape`){let t=mE({voicePickerOpen:g.current,hasPendingApproval:_.current});t===`close_voice_picker`?(e.preventDefault(),p(!1)):t===`end_call`&&(e.preventDefault(),h.current());return}if(e.key!==`Tab`)return;let t=Array.from(n.querySelectorAll(`button:not(:disabled), input:not(:disabled), textarea:not(:disabled), [tabindex="0"]`)),r=t[0],i=t[t.length-1];e.shiftKey&&(document.activeElement===r||!n.contains(document.activeElement))?(e.preventDefault(),i?.focus()):e.shiftKey||document.activeElement!==i&&n.contains(document.activeElement)||(e.preventDefault(),r?.focus())};return document.addEventListener(`keydown`,r),()=>{document.removeEventListener(`keydown`,r),document.body.style.overflow=t,e?.focus({preventScroll:!0})}},[]);let y=(0,vE.jsx)(`div`,{ref:m,className:`gemini-live-overlay live-orb-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":`Gemini Live conversation`,"data-status":e,children:(0,vE.jsxs)(`div`,{className:`gemini-live-card`,children:[(0,vE.jsxs)(`header`,{className:`live-orb-header`,children:[(0,vE.jsx)(`span`,{className:`gemini-live-badge`,children:`Gemini Live`}),(0,vE.jsx)(`h2`,{children:`Live conversation`})]}),(0,vE.jsx)(`div`,{className:`live-orb-stage`,children:(0,vE.jsx)(ye,{hue:0,animate:e!==`paused`&&e!==`error`,enableVoiceControl:e===`listening`||e===`speaking`||e===`thinking`,analyserRef:l??v})}),(0,vE.jsxs)(`div`,{className:`live-orb-state`,children:[(0,vE.jsx)(`div`,{className:`gemini-live-status`,role:`status`,children:yE[e]}),(0,vE.jsx)(`p`,{children:bE[e]})]}),(0,vE.jsx)(`div`,{className:`gemini-live-transcript`,"aria-label":`Conversation transcript`,tabIndex:0,children:t||n?(0,vE.jsxs)(vE.Fragment,{children:[t&&(0,vE.jsxs)(`p`,{className:`gemini-live-transcript-line`,children:[(0,vE.jsx)(`span`,{className:`gemini-live-transcript-speaker`,children:`You`}),t]}),n&&(0,vE.jsxs)(`p`,{className:`gemini-live-transcript-line`,children:[(0,vE.jsx)(`span`,{className:`gemini-live-transcript-speaker`,children:`Mint`}),n]})]}):(0,vE.jsx)(`p`,{className:`live-orb-empty`,children:e===`connecting`?`Your conversation will appear here.`:e===`error`?`No conversation yet.`:`Say something to get started…`})}),u&&d&&(0,vE.jsx)(`div`,{className:`gemini-live-approval`,style:{width:`100%`,textAlign:`left`},children:(0,vE.jsx)(eC,{pendingApproval:u,onApproval:d},u.id||JSON.stringify(u))}),(0,vE.jsxs)(`div`,{className:`gemini-live-voice-picker`,children:[(0,vE.jsxs)(de,{type:`button`,variant:`ghost`,className:`gemini-live-voice-btn`,"aria-label":`Change voice`,"aria-expanded":f,"aria-haspopup":`listbox`,onClick:()=>p(e=>!e),children:[(0,vE.jsx)(D,{size:16,"aria-hidden":`true`}),(0,vE.jsx)(`span`,{children:o})]}),f&&(0,vE.jsx)(`div`,{className:`gemini-live-voice-menu`,role:`listbox`,"aria-label":`Live voice`,children:s.map(e=>(0,vE.jsx)(`button`,{type:`button`,role:`option`,"aria-selected":e===o,"data-voice":e,className:`gemini-live-voice-option ${e===o?`active`:``}`,onClick:()=>{p(!1),e!==o&&c(e)},children:e},e))})]}),(0,vE.jsxs)(`div`,{className:`gemini-live-controls`,children:[(0,vE.jsxs)(de,{type:`button`,"data-call-control":!0,variant:`secondary`,size:`lg`,className:`gemini-live-btn`,onClick:i,disabled:e===`connecting`||e===`error`,"aria-label":r?`Resume microphone`:`Pause microphone`,"aria-pressed":r,children:[r?(0,vE.jsx)(xe,{size:18,"aria-hidden":`true`}):(0,vE.jsx)(Pe,{size:18,"aria-hidden":`true`}),(0,vE.jsx)(`span`,{children:r?`Resume`:`Pause mic`})]}),(0,vE.jsxs)(de,{type:`button`,variant:`destructive`,size:`lg`,className:`gemini-live-btn gemini-live-end`,onClick:a,"aria-label":`End Live conversation`,children:[(0,vE.jsx)(b,{size:18,"aria-hidden":`true`}),(0,vE.jsx)(`span`,{children:`End call`})]})]})]})});return typeof document>`u`?y:(0,_E.createPortal)(y,document.body)}var gE,_E,vE,yE,bE,xE=t((()=>{gE=e(i()),_E=Ne(),A(),ze(),d(),rC(),pE(),vE=a(),yE={connecting:`Connecting`,listening:`Listening`,speaking:`Speaking`,thinking:`Thinking`,paused:`Microphone paused`,error:`Connection unavailable`},bE={connecting:`Opening your microphone and Live session…`,listening:`Speak naturally. Mint is listening.`,speaking:`Mint is speaking. You can interrupt at any time.`,thinking:`Waiting for Mint’s response…`,paused:`Resume the microphone when you’re ready.`,error:`End this call and try again when you’re ready.`}}));function SE(e){let t=/\.([a-zA-Z0-9]+)$/.exec(e.trim())?.[1]?.toLowerCase();return!!t&&CE.includes(t)}var CE,wE,TE=t((()=>{CE=[`txt`,`md`,`pdf`,`docx`,`xlsx`,`json`,`toml`,`yaml`,`yml`,`rs`,`ts`,`tsx`,`js`,`jsx`,`py`,`html`,`css`],wE=CE.map(e=>`.${e}`).join(`,`)}));function EE(e){if(!e)return`Medium`;let t=e.toLowerCase().replace(/[- ]/g,`_`);return t===`low`?`Low`:t===`high`?`High`:t===`extra_high`||t===`extra`?`Extra High`:`Medium`}function DE({provider:e}){let t=e.toLowerCase(),n=NE[t];return n?n.color?(0,G.jsx)(`span`,{className:`provider-brand-logo is-monochrome`,"aria-hidden":`true`,style:{"--provider-brand-color":n.color,maskImage:`url("${n.src}")`,WebkitMaskImage:`url("${n.src}")`}}):(0,G.jsx)(`img`,{className:`provider-brand-logo`,src:n.src,alt:``,"aria-hidden":`true`}):(0,G.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,G.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,G.jsx)(`path`,{d:`M19.07 4.93a10 10 0 0 1 0 14.14M4.93 4.93a10 10 0 0 0 0 14.14`})]})}function OE({type:e,label:t}){return(0,G.jsxs)(`span`,{className:`model-tag-badge badge-${e}`,children:[e===`free`&&(0,G.jsxs)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,G.jsx)(`path`,{d:`M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z`}),(0,G.jsx)(`line`,{x1:`7`,y1:`7`,x2:`7.01`,y2:`7`})]}),e===`fast`&&(0,G.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,G.jsx)(`polygon`,{points:`13 2 3 14 12 14 11 22 21 10 12 10 13 2`})}),e===`reasoning`&&(0,G.jsxs)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,G.jsx)(`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`}),(0,G.jsx)(`rect`,{x:`9`,y:`9`,width:`6`,height:`6`}),(0,G.jsx)(`line`,{x1:`9`,y1:`1`,x2:`9`,y2:`4`}),(0,G.jsx)(`line`,{x1:`15`,y1:`1`,x2:`15`,y2:`4`}),(0,G.jsx)(`line`,{x1:`9`,y1:`20`,x2:`9`,y2:`23`}),(0,G.jsx)(`line`,{x1:`15`,y1:`20`,x2:`15`,y2:`23`}),(0,G.jsx)(`line`,{x1:`20`,y1:`9`,x2:`23`,y2:`9`}),(0,G.jsx)(`line`,{x1:`20`,y1:`14`,x2:`23`,y2:`14`}),(0,G.jsx)(`line`,{x1:`1`,y1:`9`,x2:`4`,y2:`9`}),(0,G.jsx)(`line`,{x1:`1`,y1:`14`,x2:`4`,y2:`14`})]}),e===`top`&&(0,G.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,G.jsx)(`polygon`,{points:`12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2`})}),e===`vision`&&(0,G.jsxs)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,G.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,G.jsx)(`path`,{d:`M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z`})]}),(0,G.jsx)(`span`,{children:t})]})}function kE(e){let t=[];nt(e)&&t.push({label:`FREE`,type:`free`});let n=e.toLowerCase();return(n.includes(`reason`)||n.includes(`thinking`)||n.includes(`r1`)||n.includes(`o1`)||n.includes(`o3`)||n.includes(`qwq`))&&t.push({label:`Reasoning`,type:`reasoning`}),(n.includes(`vision`)||n.includes(`multimodal`)||n.includes(`-vl`))&&t.push({label:`Vision`,type:`vision`}),(n.includes(`flash`)||n.includes(`haiku`)||n.includes(`mini`)||n.includes(`turbo`)||n.includes(`lite`))&&t.push({label:`Fast`,type:`fast`}),(n===`claude-sonnet-5`||n===`claude-opus-5`||n===`gemini-2.5-pro`||n===`gpt-5.6-luna`||n===`gpt-4o`||n===`deepseek-chat`||n===`deepseek-v4-pro`)&&t.push({label:`Top`,type:`top`}),t}function AE({activeProvider:e,activeModel:t,availableProviders:n,settingsConfig:r,dynamicOllamaModels:i,onSelect:a,disabled:o=!1,onUpdateSettings:s}){let[c,l]=(0,jE.useState)(!1),[u,d]=(0,jE.useState)(`models`),[f,p]=(0,jE.useState)(``),[m,h]=(0,jE.useState)(0),[g,_]=(0,jE.useState)(!1),[v,y]=(0,jE.useState)({});(0,jE.useEffect)(()=>{r?.modelThinkingConfigs&&y(r.modelThinkingConfigs)},[r?.modelThinkingConfigs]);let b=(0,jE.useRef)(null),x=(0,jE.useRef)(null),S=(0,jE.useRef)(null),C=(0,jE.useRef)(null),{models:w}=Ut(`gemini`,r?.apiKey||``),{models:T}=Ut(`anthropic`,r?.anthropicApiKey||``),{models:E}=Ut(`openai`,r?.openaiApiKey||``),{models:D}=Ut(`openrouter`,r?.openrouterApiKey||``),{models:O}=Ut(`deepseek`,r?.deepseekApiKey||``),{models:k}=Ut(`local_openai`,``,r?.localApiBaseUrl||``),[A,ee]=(0,jE.useState)([]);(0,jE.useEffect)(()=>{if(i&&i.length>0){ee(i);return}let e=!1;return(async()=>{let t=r?.ollamaHost||`http://localhost:11434`,n=t.endsWith(`/`)?t.slice(0,-1):t;try{let t=new AbortController,r=setTimeout(()=>t.abort(),2e3),i=await fetch(`${n}/api/tags`,{signal:t.signal});if(clearTimeout(r),i.ok){let t=await i.json();if(!e&&t&&Array.isArray(t.models)&&t.models.length>0){ee(t.models.map(e=>e.name));return}}}catch{}try{let t=await ne.fetchProviderModels(`ollama`,``);if(!e&&t&&t.length>0){ee(t);return}}catch{}!e&&r?.ollamaModel&&ee([r.ollamaModel])})(),()=>{e=!0}},[i,r?.ollamaHost,r?.ollamaModel]);let te=(0,jE.useMemo)(()=>{let e=[],t=(t,n,r,i,a)=>{i.length!==0&&e.push({id:t,providerId:n,name:r,icon:a?(0,G.jsx)(`img`,{className:`provider-brand-logo`,src:a,alt:``,"aria-hidden":`true`}):(0,G.jsx)(DE,{provider:n}),models:i})};if(n.includes(`gemini`)&&t(`gemini`,`gemini`,`Google Gemini`,w),n.includes(`anthropic`)&&t(`anthropic`,`anthropic`,`Anthropic Claude`,T),n.includes(`openai`)&&t(`openai`,`openai`,`OpenAI`,E),n.includes(`deepseek`)&&t(`deepseek`,`deepseek`,`DeepSeek`,O),n.includes(`openrouter`)){let e=new Set(lt),n=[];for(let e of lt)D.includes(e)&&n.push(e);let r=D.filter(t=>!e.has(t));n.length>0?(t(`openrouter-popular`,`openrouter`,`OpenRouter • Popular & Recommended`,n),r.length>0&&t(`openrouter-other`,`openrouter`,`OpenRouter • Other models (${r.length})`,r)):t(`openrouter`,`openrouter`,`OpenRouter`,D)}n.includes(`huggingface`)&&t(`huggingface`,`huggingface`,`Hugging Face`,[...tt]),n.includes(`local_openai`)&&t(`local_openai`,`local_openai`,`LM Studio / Local`,k),n.includes(`ollama`)&&t(`ollama`,`ollama`,`Ollama`,i&&i.length>0?i:A.length>0?A:r?.ollamaModel?[r.ollamaModel]:[]);let a=r?.customProviders||[];for(let e of a){let r=`custom:${e.id}`;if(n.includes(r)){let n=(e.models||[]).map(e=>e.modelId).filter(Boolean);t(r,r,e.displayName||e.id,n,e.logoDataUrl)}}return e},[n,w,T,E,O,D,k,i,A,r?.customProviders,r?.ollamaModel]),j=(0,jE.useMemo)(()=>{let e=f.trim().toLowerCase();if(!e)return te;let t=[];for(let n of te)if(n.name.toLowerCase().includes(e)||n.id.toLowerCase().includes(e)||n.providerId.toLowerCase().includes(e))t.push(n);else{let r=n.models.filter(t=>t.toLowerCase().includes(e));r.length>0&&t.push({...n,models:r})}return t},[te,f]),re=!!f.trim()||g,M=(0,jE.useMemo)(()=>{let e=[];for(let t of j)if(t.id!==`openrouter-other`||re)for(let n of t.models)e.push({providerId:t.providerId,providerName:t.name,model:n});return e},[j,re]),[ie,N]=(0,jE.useState)(null);(0,jE.useEffect)(()=>{c?t?N({providerId:e,model:t}):M.length>0&&N({providerId:M[0].providerId,model:M[0].model}):_(!1)},[c,e,t]),(0,jE.useEffect)(()=>{h(0),M.length>0&&N({providerId:M[0].providerId,model:M[0].model})},[f]);let ae=(0,jE.useCallback)((e,t)=>{let n=$e(e,t),i=rt(e,t);if(!n.supportsThinking)return{supported:!1,hasNative:!1,enabled:!1,effort:`medium`};let a=v[e];return a?{supported:!0,hasNative:i,enabled:a.enabled??!0,effort:(a.effort||`medium`).toLowerCase()}:{supported:!0,hasNative:i,enabled:i?r?.thinkingEnabled??!0:!1,effort:(r?.thinkingEffort||`medium`).toLowerCase()}},[v,r?.thinkingEnabled,r?.thinkingEffort]),oe=async(e,n,i)=>{let a={...v,[e]:{enabled:n,effort:i}};y(a);let o={...r||{},modelThinkingConfigs:a};e===t&&(o.thinkingEnabled=n,o.thinkingEffort=i),s&&s(o);let c=window.settingsApi;if(c?.saveSettings)try{await c.saveSettings(o)}catch(e){console.error(`Failed to save thinking config:`,e)}};(0,jE.useEffect)(()=>{if(!c)return;let e=e=>{let t=e.target;b.current&&!b.current.contains(t)&&x.current&&!x.current.contains(t)&&l(!1)};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[c]),(0,jE.useEffect)(()=>{c&&(p(``),d(`models`),setTimeout(()=>{window.matchMedia(`(max-width: 760px)`).matches||S.current?.focus()},50))},[c]),(0,jE.useEffect)(()=>{if(!c||!C.current)return;let e=C.current.querySelector(`[data-item-index="${m}"]`);e&&e.scrollIntoView({block:`nearest`})},[m,c]);let se=e=>{if(c&&!e.nativeEvent.isComposing){if(e.key===`Escape`)e.preventDefault(),l(!1),x.current?.focus();else if(!(u!==`models`||e.target instanceof HTMLButtonElement)){if(e.key===`ArrowDown`){if(e.preventDefault(),M.length===0)return;let t=(m+1)%M.length;h(t),N({providerId:M[t].providerId,model:M[t].model})}else if(e.key===`ArrowUp`){if(e.preventDefault(),M.length===0)return;let t=(m-1+M.length)%M.length;h(t),N({providerId:M[t].providerId,model:M[t].model})}else if(e.key===`Enter`){e.preventDefault();let t=M[m];t&&(a(t.providerId,t.model),l(!1),x.current?.focus())}}}},ce=(0,jE.useMemo)(()=>t?t.split(`/`).pop()||t:`Select Model`,[t]),le=(0,jE.useMemo)(()=>ae(t,e),[t,e,ae]),ue=ie||(t?{providerId:e,model:t}:null),de=(0,jE.useMemo)(()=>ue?$e(ue.model,ue.providerId):null,[ue]),fe=(0,jE.useMemo)(()=>ue?ae(ue.model,ue.providerId):{supported:!1,hasNative:!1,enabled:!1,effort:`medium`},[ue,ae]),pe=(0,jE.useMemo)(()=>ue?kE(ue.model):[],[ue]),me=e=>(r?.customProviders)?.find(t=>`custom:${t.id}`===e)?.logoDataUrl,he=0;return(0,G.jsxs)(`div`,{className:`model-selector-container`,children:[(0,G.jsxs)(`button`,{ref:x,type:`button`,className:`model-selector-trigger ${c?`active`:``}`,onClick:()=>l(!c),disabled:o,title:`Model: ${t||`None`} (${e})`,"aria-haspopup":`listbox`,"aria-expanded":c,children:[(0,G.jsx)(`span`,{className:`model-selector-trigger-icon`,children:me(e)?(0,G.jsx)(`img`,{className:`provider-brand-logo`,src:me(e),alt:``,"aria-hidden":`true`}):(0,G.jsx)(DE,{provider:e})}),(0,G.jsx)(`span`,{className:`model-selector-trigger-name`,children:ce}),le.enabled&&(0,G.jsx)(`span`,{className:`model-selector-trigger-effort`,children:EE(le.effort)}),(0,G.jsx)(`svg`,{className:`model-selector-trigger-chevron ${c?`open`:``}`,width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,G.jsx)(`polyline`,{points:`6 9 12 15 18 9`})})]}),c&&(0,G.jsxs)(`div`,{ref:b,className:`model-spotlight-popover mobile-pane-${u}`,onKeyDown:se,children:[(0,G.jsxs)(`div`,{className:`model-spotlight-mobile-tabs`,role:`tablist`,"aria-label":`Model selector view`,children:[(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":u===`models`,onClick:()=>d(`models`),children:`Models`}),(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":u===`options`,onClick:()=>d(`options`),children:`Options`})]}),(0,G.jsxs)(`div`,{className:`model-spotlight-left-pane`,children:[(0,G.jsxs)(`div`,{className:`model-spotlight-search-bar`,children:[(0,G.jsxs)(`svg`,{className:`search-icon`,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,G.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,G.jsx)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})]}),(0,G.jsx)(`input`,{ref:S,type:`text`,className:`model-spotlight-input`,"aria-label":`Search models`,placeholder:`Search models...`,value:f,onChange:e=>p(e.target.value)}),f&&(0,G.jsx)(`button`,{type:`button`,className:`search-clear-btn`,onClick:()=>p(``),title:`Clear search`,children:(0,G.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,G.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,G.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]}),(0,G.jsx)(`div`,{ref:C,className:`model-spotlight-list`,role:`listbox`,children:j.length===0?(0,G.jsxs)(`div`,{className:`model-spotlight-empty`,children:[(0,G.jsxs)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,G.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,G.jsx)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})]}),(0,G.jsxs)(`span`,{children:[`No models found matching "`,f,`"`]})]}):j.map(n=>{let r=n.id===`openrouter-other`,i=r&&!re;return(0,G.jsxs)(`div`,{className:`model-spotlight-group`,children:[(0,G.jsxs)(`div`,{className:`model-spotlight-group-header`,children:[(0,G.jsx)(`span`,{className:`group-header-icon`,children:n.icon}),(0,G.jsx)(`span`,{className:`group-header-title`,children:n.name})]}),i?(0,G.jsx)(`div`,{className:`model-spotlight-see-more-wrap`,children:(0,G.jsxs)(`button`,{type:`button`,className:`model-spotlight-see-more-btn`,onClick:()=>_(!0),children:[(0,G.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,G.jsx)(`polyline`,{points:`6 9 12 15 18 9`})}),(0,G.jsxs)(`span`,{children:[`Show all `,n.models.length,` other models`]})]})}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`model-spotlight-group-items`,children:n.models.map(r=>{let i=he++,o=e===n.providerId&&t===r,s=ue?.model===r&&ue?.providerId===n.providerId,c=ae(r,n.providerId);return(0,G.jsxs)(`div`,{"data-item-index":i,className:`model-spotlight-item ${o?`is-active`:``} ${s?`is-inspected`:``}`,onClick:()=>{N({providerId:n.providerId,model:r}),a(n.providerId,r),l(!1),x.current?.focus()},onMouseEnter:()=>{h(i),N({providerId:n.providerId,model:r})},role:`option`,"aria-selected":o,children:[(0,G.jsxs)(`div`,{className:`model-item-left`,children:[(0,G.jsxs)(`div`,{style:{display:`inline-flex`,alignItems:`center`,gap:`6px`},children:[(0,G.jsx)(`span`,{className:`model-item-provider-icon`,"aria-hidden":`true`,children:n.icon}),(0,G.jsx)(`span`,{className:`model-item-name`,children:r.split(`/`).pop()||r}),nt(r)&&(0,G.jsx)(`span`,{className:`model-tag-badge badge-free`,children:`Free`})]}),r.includes(`/`)&&(0,G.jsx)(`span`,{className:`model-item-repo`,children:r})]}),(0,G.jsxs)(`div`,{className:`model-item-right`,children:[c.enabled&&(0,G.jsx)(`span`,{className:`model-item-effort-pill`,children:EE(c.effort)}),o&&(0,G.jsx)(`svg`,{className:`model-item-check`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--accent, #10b981)`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,G.jsx)(`polyline`,{points:`20 6 9 17 4 12`})})]})]},r)})}),r&&!f.trim()&&(0,G.jsx)(`div`,{className:`model-spotlight-see-more-wrap`,style:{marginTop:`4px`},children:(0,G.jsxs)(`button`,{type:`button`,className:`model-spotlight-see-more-btn collapse-btn`,onClick:()=>_(!1),children:[(0,G.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,G.jsx)(`polyline`,{points:`18 15 12 9 6 15`})}),(0,G.jsx)(`span`,{children:`Collapse other models`})]})})]})]},n.id)})})]}),(0,G.jsx)(`div`,{className:`model-spotlight-right-pane`,children:ue&&de?(0,G.jsxs)(`div`,{className:`model-detail-container`,children:[(0,G.jsxs)(`div`,{className:`model-detail-header`,children:[(0,G.jsx)(`div`,{className:`model-detail-icon`,children:me(ue.providerId)?(0,G.jsx)(`img`,{className:`provider-brand-logo`,src:me(ue.providerId),alt:``,"aria-hidden":`true`}):(0,G.jsx)(DE,{provider:ue.providerId})}),(0,G.jsxs)(`div`,{className:`model-detail-title-wrap`,children:[(0,G.jsx)(`span`,{className:`model-detail-title`,children:ue.model.split(`/`).pop()||ue.model}),ue.model.includes(`/`)&&(0,G.jsx)(`span`,{className:`model-detail-subtitle`,children:ue.model})]})]}),(0,G.jsx)(`p`,{className:`model-detail-description`,children:de.description}),(0,G.jsxs)(`div`,{className:`model-detail-tags`,children:[(0,G.jsx)(`span`,{className:`model-detail-context-badge`,children:de.contextWindow}),pe.map(e=>(0,G.jsx)(OE,{type:e.type,label:e.label},e.type))]}),(0,G.jsx)(`div`,{className:`model-detail-divider`}),(0,G.jsx)(`div`,{className:`model-detail-section-title`,children:`Options`}),(0,G.jsxs)(`div`,{className:`model-detail-option-row`,children:[(0,G.jsxs)(`div`,{className:`option-row-left`,children:[(0,G.jsxs)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`option-icon`,children:[(0,G.jsx)(`path`,{d:`M12 2a7 7 0 0 1 7 7c0 2.38-1.19 4.47-3 5.74V17a2 2 0 0 1-2 2h-4a2 2 0 0 1-2-2v-2.26C6.19 13.47 5 11.38 5 9a7 7 0 0 1 7-7z`}),(0,G.jsx)(`path`,{d:`M9 21h6`})]}),(0,G.jsx)(`span`,{className:`option-label`,children:`Thinking`})]}),(0,G.jsx)(`button`,{type:`button`,role:`switch`,disabled:!fe.supported,"aria-checked":fe.enabled,className:`model-detail-switch ${fe.enabled?`checked`:``}`,style:fe.supported?void 0:{opacity:.45,cursor:`not-allowed`},onClick:()=>{fe.supported&&oe(ue.model,!fe.enabled,fe.effort)},title:fe.supported?fe.enabled?`Disable thinking`:`Enable thinking`:`Thinking is not available for non-text models`,children:(0,G.jsx)(`span`,{className:`model-detail-switch-thumb`})})]}),(0,G.jsx)(`div`,{className:`model-unsupported-note`,style:{color:fe.supported&&fe.enabled?`var(--interactive-fg)`:void 0},children:fe.supported?fe.enabled?fe.hasNative?`Native Reasoning API active`:`Prompted Chain-of-Thought (<think>) active`:fe.hasNative?`Supports Native Reasoning API`:`Supports Prompted Chain-of-Thought (<think>)`:`Non-text model (image/audio/embedding) — Thinking is not applicable`}),fe.supported&&fe.enabled&&(0,G.jsxs)(`div`,{className:`model-effort-section`,children:[(0,G.jsx)(`div`,{className:`model-detail-section-title`,children:`Effort`}),(0,G.jsx)(`div`,{className:`model-effort-list`,children:ME.map(e=>{let t=fe.effort===e.id;return(0,G.jsxs)(`button`,{type:`button`,className:`model-effort-item ${t?`is-selected`:``}`,onClick:()=>{oe(ue.model,!0,e.id)},children:[(0,G.jsx)(`span`,{className:`effort-item-label`,children:e.label}),t&&(0,G.jsx)(`svg`,{className:`effort-item-check`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--accent, #10b981)`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,G.jsx)(`polyline`,{points:`20 6 9 17 4 12`})})]},e.id)})})]})]}):(0,G.jsx)(`div`,{className:`model-detail-empty`,children:(0,G.jsx)(`span`,{children:`Select a model to view options`})})})]})]})}var jE,G,ME,NE,PE=t((()=>{jE=e(i()),Lt(),ke(),Bt(),Je(),Xt(),Zt(),pt(),Nt(),wt(),Kt(),yt(),G=a(),ME=[{id:`low`,label:`Low`},{id:`medium`,label:`Medium`},{id:`high`,label:`High`},{id:`extra_high`,label:`Extra High`}],NE={anthropic:{src:ot,color:`#d97757`},deepseek:{src:_t},gemini:{src:Jt},huggingface:{src:Et},local_openai:{src:Ot,color:`#8b5cf6`},ollama:{src:Rt,color:`#f3f4f6`},openai:{src:xt,color:`#10a37f`},openrouter:{src:jt}}})),FE=t((()=>{}));function IE({agentMode:e,onSetAgentMode:t,planMode:n,onSetPlanMode:r,disabled:i=!1}){let[a,o]=(0,LE.useState)(!1),s=(0,LE.useRef)(null),c=(0,LE.useId)(),l=n?`plan`:e?`agent`:`chat`,u=[{id:`agent`,label:`Agent mode`,shortLabel:`Agent`,title:`Agent mode: autonomous execution with tool use`,desc:`Runs tools and edits files automatically`,icon:(0,RE.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,RE.jsx)(`path`,{d:`M13 2L3 14h9l-1 8 10-12h-9l1-8z`})})},...r?[{id:`plan`,label:`Plan mode`,shortLabel:`Plan`,title:`Plan mode: investigate read-only and require plan approval before editing`,desc:`Researches read-only and requires approval for edits`,icon:(0,RE.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,RE.jsx)(`path`,{d:`M9 5H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2`}),(0,RE.jsx)(`rect`,{x:`9`,y:`3`,width:`6`,height:`4`,rx:`2`}),(0,RE.jsx)(`path`,{d:`M9 12h6m-6 4h4`})]})}]:[],{id:`chat`,label:`Chat mode`,shortLabel:`Chat`,title:`Chat mode: standard conversation without tools`,desc:`Direct conversation without autonomous changes`,icon:(0,RE.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,RE.jsx)(`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`})})}],d=u.find(e=>e.id===l)||u[0],f=e=>{i||(e===`agent`?(t(!0),r?.(!1)):e===`plan`?(t(!0),r?.(!0)):(t(!1),r?.(!1)),o(!1))};return(0,LE.useEffect)(()=>{if(!a)return;let e=e=>{s.current&&!s.current.contains(e.target)&&o(!1)};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[a]),(0,LE.useEffect)(()=>{if(!a)return;let e=e=>{e.key===`Escape`&&o(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[a]),(0,RE.jsxs)(`div`,{className:`chat-mode-selector-wrap`,ref:s,children:[(0,RE.jsxs)(`button`,{type:`button`,id:`chat-mode-btn`,className:`chat-mode-trigger is-${l} ${a?`is-active`:``}`,onClick:()=>o(e=>!e),disabled:i,"aria-haspopup":`menu`,"aria-expanded":a,"aria-controls":c,title:d.title,children:[(0,RE.jsx)(`span`,{className:`chat-mode-icon`,"aria-hidden":`true`,children:d.icon}),(0,RE.jsx)(`span`,{className:`chat-mode-label`,children:d.shortLabel}),(0,RE.jsx)(`svg`,{className:`chat-mode-chevron ${a?`is-open`:``}`,width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,RE.jsx)(`polyline`,{points:`6 9 12 15 18 9`})})]}),a&&(0,RE.jsxs)(`div`,{id:c,className:`chat-mode-popover`,role:`menu`,children:[(0,RE.jsx)(`div`,{className:`chat-mode-popover-header`,children:`Interaction Mode`}),u.map(e=>{let t=e.id===l;return(0,RE.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`chat-mode-option is-${e.id} ${t?`is-selected`:``}`,onClick:()=>f(e.id),children:[(0,RE.jsx)(`span`,{className:`chat-mode-option-icon`,"aria-hidden":`true`,children:e.icon}),(0,RE.jsxs)(`div`,{className:`chat-mode-option-text`,children:[(0,RE.jsx)(`span`,{className:`chat-mode-option-title`,children:e.label}),(0,RE.jsx)(`span`,{className:`chat-mode-option-desc`,children:e.desc})]}),t&&(0,RE.jsx)(`svg`,{className:`chat-mode-option-check`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,RE.jsx)(`polyline`,{points:`20 6 9 17 4 12`})})]},e.id)})]})]})}var LE,RE,zE=t((()=>{LE=e(i()),FE(),RE=a()})),BE=t((()=>{}));function VE({open:e,count:t=0,onToggle:n,className:r=``}){return(0,HE.jsxs)(`button`,{type:`button`,className:`tools-panel-toggle ${r}${e?` is-open`:``}`,"aria-label":e?`Close tools panel`:`Open tools panel`,"aria-expanded":e,title:e?`Close tools panel`:`Open tools panel`,onClick:n,children:[(0,HE.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,HE.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`16`,rx:`2`}),(0,HE.jsx)(`path`,{d:`M15 4v16M18 8h1M18 12h1M18 16h1`})]}),(0,HE.jsx)(`span`,{className:`tools-toggle-label`,children:`Tools`}),t>0&&(0,HE.jsx)(`span`,{className:`tools-task-count`,"aria-label":`${t} active background tasks`,children:t})]})}var HE,UE=t((()=>{BE(),HE=a()}));function WE(e,t,n,r){if(!Number.isFinite(e)||!Number.isFinite(t)||e<=24||t<1)return null;let i=Math.min(1e5,Math.floor(e-24)),a=Math.min(1e5,Math.floor(t));return{surface:n,widthPx:i,heightPx:a,columns:Math.min(1e4,Math.max(1,Math.floor(i/8))),rows:Math.min(1e4,Math.max(1,Math.floor(a/20))),sidePanelOpen:r}}var GE=t((()=>{})),KE=t((()=>{}));function qE({node:e,color:t,onAction:n}){let r=String(e.value??``),[i,a]=(0,QE.useState)(r);return(0,QE.useEffect)(()=>{a(r)},[r,e.action]),(0,K.jsxs)(`label`,{className:`mod-input${t}`,children:[e.label,(0,K.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),onKeyDown:t=>{t.key===`Enter`&&e.action&&(t.preventDefault(),n(e.action,t.currentTarget.value))}})]})}function JE({node:e,onAction:t,inheritedColor:n}){let r=e.color??n,i=[`default`,`yellow`,`cyan`,`blue`,`magenta`,`red`].includes(r??``)?` mod-color-${r}`:``;switch(e.type){case`stack`:return(0,K.jsx)(`div`,{className:`mod-stack${e.direction===`row`?` mod-stack-row`:``}${i}`,children:e.children?.map((e,n)=>(0,K.jsx)(JE,{node:e,onAction:t,inheritedColor:r},n))});case`text`:return(0,K.jsx)(`p`,{className:`mod-text${i}`,children:e.text});case`badge`:return(0,K.jsx)(`span`,{className:`mod-badge${i}`,children:e.text});case`button`:return(0,K.jsx)(`button`,{className:i.trim()||void 0,type:`button`,onClick:()=>e.action&&t(e.action),children:e.label});case`input`:return(0,K.jsx)(qE,{node:e,color:i,onAction:t});case`progress`:return(0,K.jsxs)(`label`,{className:`mod-progress${i}`,children:[e.label,(0,K.jsx)(`progress`,{"aria-label":e.label,value:Number(e.value),max:e.max})]});case`table`:return(0,K.jsx)(`div`,{className:`mod-table-scroll${i}`,children:(0,K.jsxs)(`table`,{children:[(0,K.jsx)(`thead`,{children:(0,K.jsx)(`tr`,{children:e.columns?.map((e,t)=>(0,K.jsx)(`th`,{children:e},t))})}),(0,K.jsx)(`tbody`,{children:e.rows?.map((e,t)=>(0,K.jsx)(`tr`,{children:e.map((e,t)=>(0,K.jsx)(`td`,{children:e},t))},t))})]})});default:return null}}function YE({enabled:e,busy:t,onToggle:n}){return(0,K.jsxs)(`div`,{className:`mod-session-controls`,children:[(0,K.jsxs)(`button`,{type:`button`,disabled:t,"aria-pressed":e,onClick:()=>n(!e),children:[`Hot reload: `,e?`On`:`Off`]}),(0,K.jsx)(`p`,{className:`mod-hint`,children:`Applies to this session. Mods with permissions require review for each new revision.`})]})}function XE({report:e}){return(0,K.jsxs)(`section`,{"aria-label":`Mod test results`,children:[(0,K.jsxs)(`p`,{role:`status`,children:[e.passed,` passed · `,e.failed,` failed`]}),e.tests.map((e,t)=>(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`strong`,{children:[e.passed?`✓`:`✗`,` `,e.name]}),(0,K.jsx)(`p`,{className:`mod-hint`,children:e.file}),e.error&&(0,K.jsx)(`pre`,{className:`mod-error`,children:e.error})]},t))]})}function ZE({workspacePath:e,chatId:t,panelTarget:n,onOpen:r}){let[i,a]=(0,QE.useState)({mods:[]}),o=!!n,s=(0,QE.useRef)(r);s.current=r;let[c,l]=(0,QE.useState)(`manage`),[u,d]=(0,QE.useState)(``),[f,p]=(0,QE.useState)(!1),[m,h]=(0,QE.useState)(!0),[_,v]=(0,QE.useState)({}),y=(0,QE.useRef)(null),b=(0,QE.useRef)(o);b.current=o;let x=(0,QE.useRef)(i.mods);x.current=i.mods;let S=(0,QE.useRef)(``);S.current=`${e}\0${t}`;let[w,T]=(0,QE.useState)(`chat`),E=(0,QE.useRef)(0),D=(0,QE.useRef)(null),O=(0,QE.useRef)(new Set),k=(0,QE.useRef)(null);(0,QE.useEffect)(()=>{let n=++E.current,r=!1,i;a({mods:[]}),h(!!(e&&t)),p(!1),d(``),l(`manage`),O.current.clear(),v({});async function o(){if(!e||!t||r)return;if(clearTimeout(i),document.hidden){r||(i=setTimeout(o,eD(b.current,x.current)));return}let c=x.current;try{let i=await N.operation({workspacePath:e,chatId:t,action:`list`});if(!r&&E.current===n){c=i.mods??[],a(i),h(!1);let e=i.mods?.find(e=>e.enabled&&e.snapshot?.ui.side_panel&&!O.current.has(e.id));i.mods?.filter(e=>e.enabled).forEach(e=>O.current.add(e.id)),e&&(s.current(),l(e.id))}}catch(e){!r&&E.current===n&&(d(String(e)),h(!1))}r||(i=setTimeout(o,eD(b.current,c)))}k.current=()=>{o()},o();let c=()=>{!document.hidden&&!r&&o()};return document.addEventListener(`visibilitychange`,c),()=>{r=!0,clearTimeout(i),k.current=null,document.removeEventListener(`visibilitychange`,c),e&&t&&N.operation({workspacePath:e,chatId:t,action:`close`}).catch(()=>{})}},[e,t]),(0,QE.useEffect)(()=>{o&&k.current?.()},[o]),(0,QE.useEffect)(()=>{let n=y.current;if(!n||!e||!t)return;let r=!1,i=``,a,o=g.isTauriRuntime()?`desktop`:`web`;async function s(){if(r)return;let a=n.getBoundingClientRect(),s=WE(a.width,a.height,o,b.current);if(!s)return;let c=JSON.stringify(s);if(c!==i){i=c;try{await N.operation({workspacePath:e,chatId:t,action:`viewport`,viewport:s})}catch(e){r||d(String(e))}}}let c=()=>{clearTimeout(a),a=setTimeout(()=>{s()},100)},l=typeof ResizeObserver>`u`?void 0:new ResizeObserver(c);return l?.observe(n),window.addEventListener(`resize`,c),c(),()=>{r=!0,clearTimeout(a),l?.disconnect(),window.removeEventListener(`resize`,c)}},[e,t,o]);let A=(0,QE.useCallback)(async n=>{if(!e||S.current!==`${e}\0${t}`)return;let r=E.current;p(!0),d(``);try{let i=await N.operation({...n,workspacePath:e,chatId:t});if(r!==E.current)return;if(i.testReport&&n.id&&v(e=>({...e,[n.id]:i.testReport})),i.package){let e=Uint8Array.from(atob(i.package),e=>e.charCodeAt(0)),t=URL.createObjectURL(new Blob([e],{type:`application/zip`})),n=document.createElement(`a`);n.href=t,n.download=i.filename||`mod.mintmod`,n.click(),URL.revokeObjectURL(t)}let o=await N.operation({workspacePath:e,chatId:t,action:`list`});r===E.current&&a(o)}catch(e){r===E.current&&d(String(e))}finally{r===E.current&&p(!1)}},[e,t]),ee=e=>{let t=e.manifest?.permissions||[];t.length&&!window.confirm(`Enable ${e.name}?\nRevision: ${e.hash}\nPermissions: ${t.join(`, `)}\nReview the source below before approving.`)||w!==`chat`&&!window.confirm(`Enable ${e.name} for ${w===`global`?`all workspaces as a personal copy`:`all chats in this workspace`}?`)||A({action:`enable`,id:e.id,scope:w,expectedHash:e.hash,grantPermissions:t.length>0})},te=(e,t,n)=>void A({action:`action`,id:e.id,instanceId:e.instanceId,command:t,value:n}),j=i.mods||[],ne=j.filter(e=>e.enabled),re=ne.filter(e=>e.snapshot?.ui.side_panel),M=j.find(e=>e.id===c);return(0,K.jsx)(K.Fragment,{children:(0,K.jsxs)(`div`,{className:`mint-mods`,ref:y,children:[ne.map(e=>e.snapshot?.ui.above_composer&&(0,K.jsx)(`section`,{className:`mod-band`,"aria-label":e.name,children:(0,K.jsx)(JE,{node:e.snapshot.ui.above_composer,onAction:(t,n)=>te(e,t,n)})},e.id)),n&&(0,$E.createPortal)((0,K.jsxs)(`aside`,{className:`mods-panel mint-mods`,"aria-label":`Workspace mods`,children:[(0,K.jsxs)(`header`,{className:`mods-panel-header`,children:[(0,K.jsx)(`span`,{className:`mods-panel-icon`,"aria-hidden":`true`,children:(0,K.jsx)(C,{size:18})}),(0,K.jsxs)(`div`,{className:`mods-panel-title`,children:[(0,K.jsx)(`strong`,{children:`Mods`}),(0,K.jsxs)(`p`,{children:[j.length,` installed · `,ne.length,` active`]})]})]}),re.length>0&&(0,K.jsxs)(`nav`,{"aria-label":`Mod panels`,children:[(0,K.jsx)(`button`,{type:`button`,"aria-pressed":c===`manage`,onClick:()=>l(`manage`),children:`Manage`}),re.map(e=>(0,K.jsx)(`button`,{type:`button`,"aria-pressed":c===e.id,onClick:()=>l(e.id),children:e.name},e.id))]}),u&&(0,K.jsx)(`p`,{role:`alert`,className:`mod-error`,children:u}),M?.snapshot?.ui.side_panel&&c!==`manage`?(0,K.jsx)(`section`,{className:`mod-content`,children:(0,K.jsx)(JE,{node:M.snapshot.ui.side_panel,onAction:(e,t)=>te(M,e,t)})}):(0,K.jsxs)(`div`,{className:`mod-content`,children:[(0,K.jsxs)(`div`,{className:`mods-toolbar`,children:[(0,K.jsxs)(`label`,{htmlFor:`mods-scope`,children:[`Enable for `,(0,K.jsxs)(`select`,{id:`mods-scope`,value:w,onChange:e=>T(e.target.value),children:[(0,K.jsx)(`option`,{value:`chat`,children:`This chat`}),(0,K.jsx)(`option`,{value:`workspace`,children:`This workspace`}),(0,K.jsx)(`option`,{value:`global`,children:`All workspaces`})]})]}),(0,K.jsxs)(`button`,{type:`button`,className:`mods-import`,disabled:f||!e||!t,onClick:()=>D.current?.click(),children:[(0,K.jsx)(Se,{size:14,"aria-hidden":`true`}),`Import`]})]}),(0,K.jsx)(`input`,{ref:D,type:`file`,accept:`.mintmod`,hidden:!0,onChange:async n=>{let r=n.target.files?.[0];if(n.target.value=``,!r)return;if(r.size>1048576){d(`Package exceeds 1 MiB`);return}let i=new Uint8Array(await r.arrayBuffer()),a=``;for(let e of i)a+=String.fromCharCode(e);let o=btoa(a);if(S.current===`${e}\0${t}`)try{let n=await N.operation({workspacePath:e,chatId:t,action:`inspect_package`,package:o});if(S.current!==`${e}\0${t}`||n.expectedHash&&!window.confirm(`Replace source for ${n.id}? The active revision stays unchanged until you enable the imported source.`))return;await A({action:`import`,package:o,expectedHash:n.expectedHash||void 0})}catch(n){S.current===`${e}\0${t}`&&d(String(n))}}}),m&&(0,K.jsx)(`p`,{role:`status`,className:`mods-empty`,children:`Loading mods…`}),!m&&!j.length&&(0,K.jsxs)(`div`,{className:`mods-empty`,children:[(0,K.jsx)(C,{size:22,"aria-hidden":`true`}),(0,K.jsx)(`strong`,{children:e?`No mods yet`:`Choose a workspace`}),(0,K.jsx)(`p`,{children:e?`Ask Mint to create one, or import a .mintmod package. Imported mods stay off until enabled.`:`Choose a workspace in chat to manage its mods.`})]}),j.map(e=>(0,K.jsxs)(`article`,{className:`mod-entry`,children:[(0,K.jsxs)(`div`,{className:`mod-entry-heading`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`strong`,{children:e.name}),(0,K.jsxs)(`small`,{children:[`Version `,e.manifest?.version||`unknown`]})]}),(0,K.jsx)(`span`,{className:`mod-status ${e.error?`is-error`:e.enabled?`is-active`:``}`,children:e.error?`Error`:e.enabled?`Active`:`Off`})]}),e.changed&&(0,K.jsx)(`p`,{className:`mod-hint`,children:`Source changed · active revision preserved`}),e.reloadError&&(0,K.jsxs)(`p`,{role:`alert`,className:`mod-error`,children:[`Reload: `,e.reloadError]}),(e.error||e.sourceError)&&(0,K.jsx)(`p`,{role:`alert`,className:`mod-error`,children:e.error||e.sourceError}),(0,K.jsx)(`p`,{className:`mod-hint`,children:e.manifest?.permissions?.join(`, `)||`UI, events and mod state`}),(0,K.jsxs)(`div`,{className:`mod-entry-footer`,children:[(0,K.jsx)(`button`,{type:`button`,className:`mod-primary-action ${e.enabled&&!e.changed?`is-disable`:``}`,disabled:f||!e.manifest,onClick:()=>e.enabled&&!e.changed?void A({action:`disable`,id:e.id}):ee(e),children:e.enabled&&!e.changed?`Disable`:e.changed?`Validate & reload`:`Enable`}),(0,K.jsxs)(`details`,{className:`mod-entry-more`,children:[(0,K.jsxs)(`summary`,{children:[`More options `,(0,K.jsx)(le,{size:13,"aria-hidden":`true`})]}),(0,K.jsxs)(`div`,{className:`mod-actions`,children:[(0,K.jsx)(`button`,{type:`button`,disabled:f||!e.source,onClick:()=>void A({action:`export`,id:e.id}),children:`Export`}),(0,K.jsx)(`button`,{type:`button`,disabled:f||!e.source,onClick:()=>void A({action:`test`,id:e.id}),children:`Run tests`})]}),_[e.id]&&(0,K.jsx)(XE,{report:_[e.id]}),(0,K.jsxs)(`details`,{children:[(0,K.jsx)(`summary`,{children:`Source & diagnostics`}),(0,K.jsx)(`pre`,{children:e.source}),(0,K.jsx)(`pre`,{children:e.snapshot?.logs?.join(`
|
|
101
|
+
`)||`No log messages`}),(0,K.jsxs)(`p`,{className:`mod-hint`,children:[`Active revision: `,e.activeHash||`None`]})]}),e.revisions.length>1&&(0,K.jsxs)(`label`,{className:`mod-revisions`,children:[`Restore source revision `,(0,K.jsxs)(`select`,{value:``,disabled:f,onChange:t=>{let n=t.target.value;n&&window.confirm(`Restore this source revision? Review and enable it after restoring.`)&&A({action:`rollback`,id:e.id,hash:n,expectedHash:e.hash})},children:[(0,K.jsx)(`option`,{value:``,children:`Choose revision`}),e.revisions.filter(t=>t!==e.hash).map(e=>(0,K.jsx)(`option`,{value:e,children:e.slice(0,12)},e))]})]})]})]})]},e.id)),i.toolRequests?.map(e=>(0,K.jsxs)(`article`,{className:`mod-entry`,children:[(0,K.jsxs)(`strong`,{children:[e.modId,`: `,e.action]}),(0,K.jsx)(`pre`,{children:JSON.stringify(e.input,null,2)}),(0,K.jsx)(`button`,{type:`button`,disabled:f,onClick:()=>{window.confirm(`Run ${e.action} requested by ${e.modId}?\n${JSON.stringify(e.input,null,2)}`)&&A({action:`run_request`,command:e.id,grantPermissions:!0})},children:`Review & run tool`})]},e.id)),(0,K.jsxs)(`details`,{className:`mod-session-settings`,children:[(0,K.jsxs)(`summary`,{children:[`Session settings `,(0,K.jsx)(le,{size:13,"aria-hidden":`true`})]}),(0,K.jsx)(YE,{enabled:i.session?.hotReload??!1,busy:f,onToggle:e=>void A({action:`hot_reload`,value:e})})]})]})]}),n)]})})}var QE,$E,K,eD,tD=t((()=>{QE=e(i()),$E=Ne(),A(),ke(),GE(),KE(),K=a(),eD=(e,t)=>e||t?.some(e=>e.enabled)?3e3:12e3})),nD=t((()=>{}));function rD({queuedPrompts:e,queuePaused:t,sending:n,onRemove:r,onEdit:i,onClear:a,onSteer:o,onResumeQueue:s}){let[c,l]=(0,iD.useState)(!1);return!e||e.length===0?null:(0,q.jsxs)(`div`,{className:`queued-messages-tray`,role:`region`,"aria-label":`Queued messages`,children:[(0,q.jsxs)(`div`,{className:`queued-messages-header`,children:[(0,q.jsxs)(`div`,{className:`queued-messages-title-wrap`,children:[(0,q.jsxs)(`span`,{className:`queued-messages-title`,children:[(0,q.jsxs)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,q.jsx)(`line`,{x1:`8`,y1:`6`,x2:`21`,y2:`6`}),(0,q.jsx)(`line`,{x1:`8`,y1:`12`,x2:`21`,y2:`12`}),(0,q.jsx)(`line`,{x1:`8`,y1:`18`,x2:`21`,y2:`18`}),(0,q.jsx)(`line`,{x1:`3`,y1:`6`,x2:`3.01`,y2:`6`}),(0,q.jsx)(`line`,{x1:`3`,y1:`12`,x2:`3.01`,y2:`12`}),(0,q.jsx)(`line`,{x1:`3`,y1:`18`,x2:`3.01`,y2:`18`})]}),(0,q.jsx)(`span`,{children:`Queued`}),(0,q.jsx)(`span`,{className:`queued-messages-badge`,children:e.length})]}),(0,q.jsx)(`span`,{className:`queued-messages-status ${t?`is-paused`:``}`,children:t?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,style:{display:`inline`,verticalAlign:`-1px`,marginRight:4},children:[(0,q.jsx)(`rect`,{x:`6`,y:`4`,width:`4`,height:`16`,rx:`1`}),(0,q.jsx)(`rect`,{x:`14`,y:`4`,width:`4`,height:`16`,rx:`1`})]}),`Queue paused · Click arrow to steer or resume`]}):n?`Sends automatically after current turn completes`:`Ready to send`})]}),(0,q.jsxs)(`div`,{className:`queued-messages-actions`,children:[t&&s&&(0,q.jsxs)(`button`,{type:`button`,className:`queued-messages-btn btn-resume`,onClick:s,title:`Resume queue and send first message`,"aria-label":`Resume queue`,children:[(0,q.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,q.jsx)(`polygon`,{points:`5 3 19 12 5 21 5 3`})}),(0,q.jsx)(`span`,{children:`Resume`})]}),(0,q.jsxs)(`button`,{type:`button`,className:`queued-messages-btn`,onClick:a,title:`Clear all queued messages`,"aria-label":`Clear all queued messages`,children:[(0,q.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,q.jsx)(`polyline`,{points:`3 6 5 6 21 6`}),(0,q.jsx)(`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})]}),(0,q.jsx)(`span`,{children:`Clear`})]}),(0,q.jsx)(`button`,{type:`button`,className:`queued-messages-btn`,onClick:()=>l(e=>!e),title:c?`Expand queue`:`Collapse queue`,"aria-label":c?`Expand queue`:`Collapse queue`,children:c?(0,q.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,q.jsx)(`polyline`,{points:`18 15 12 9 6 15`})}):(0,q.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,q.jsx)(`polyline`,{points:`6 9 12 15 18 9`})})})]})]}),!c&&(0,q.jsx)(`div`,{className:`queued-messages-list`,children:e.map((e,t)=>{let n=e.imageAttachments?.length||0,a=e.videoAttachments?.length||0,s=e.documentAttachment?.filename;return(0,q.jsxs)(`div`,{className:`queued-message-item`,children:[(0,q.jsxs)(`span`,{className:`queued-message-index`,children:[`#`,t+1]}),(0,q.jsxs)(`div`,{className:`queued-message-content`,children:[(0,q.jsx)(`div`,{className:`queued-message-text`,title:e.text,children:e.text||`(No text prompt)`}),(n>0||a>0||s)&&(0,q.jsxs)(`div`,{className:`queued-message-attachments`,children:[n>0&&(0,q.jsxs)(`span`,{className:`queued-attachment-pill`,children:[(0,q.jsxs)(`svg`,{width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,q.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,ry:`2`}),(0,q.jsx)(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`}),(0,q.jsx)(`polyline`,{points:`21 15 16 10 5 21`})]}),n,` `,n===1?`image`:`images`]}),a>0&&(0,q.jsxs)(`span`,{className:`queued-attachment-pill`,children:[(0,q.jsxs)(`svg`,{width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,q.jsx)(`polygon`,{points:`23 7 16 12 23 17 23 7`}),(0,q.jsx)(`rect`,{x:`1`,y:`5`,width:`15`,height:`14`,rx:`2`,ry:`2`})]}),a,` `,a===1?`video`:`videos`]}),s&&(0,q.jsxs)(`span`,{className:`queued-attachment-pill`,title:s,children:[(0,q.jsxs)(`svg`,{width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,q.jsx)(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z`}),(0,q.jsx)(`polyline`,{points:`14 2 14 8 20 8`})]}),s]})]})]}),(0,q.jsxs)(`div`,{className:`queued-item-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`queued-icon-btn btn-steer`,onClick:()=>o(e.id),title:`Send now (interrupt current turn and steer agent)`,"aria-label":`Send now`,children:(0,q.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,q.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`}),(0,q.jsx)(`polyline`,{points:`12 5 19 12 12 19`})]})}),(0,q.jsx)(`button`,{type:`button`,className:`queued-icon-btn`,onClick:()=>i(e.id),title:`Edit (restore to composer)`,"aria-label":`Edit message`,children:(0,q.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,q.jsx)(`path`,{d:`M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z`})})}),(0,q.jsx)(`button`,{type:`button`,className:`queued-icon-btn btn-delete`,onClick:()=>r(e.id),title:`Remove from queue`,"aria-label":`Remove from queue`,children:(0,q.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,q.jsx)(`polyline`,{points:`3 6 5 6 21 6`}),(0,q.jsx)(`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}),(0,q.jsx)(`line`,{x1:`10`,y1:`11`,x2:`10`,y2:`17`}),(0,q.jsx)(`line`,{x1:`14`,y1:`11`,x2:`14`,y2:`17`})]})})]})]},e.id)})})]})}var iD,q,aD=t((()=>{iD=e(i()),nD(),q=a()})),oD=t((()=>{}));function sD(e,t){return e?.activeProvider===`ollama`||!!(t?.ollamaHost||t?.ollamaModel)}function cD(){let[e,t]=(0,J.useState)(0);return(0,J.useEffect)(()=>{let e=Date.now(),n=setInterval(()=>{t(Math.round((Date.now()-e)/1e3))},1e3);return()=>clearInterval(n)},[]),(0,Y.jsx)(`span`,{className:`thinking-status-meta`,children:` · ${e}s · Esc to cancel`})}function lD(e,t){let[n,r]=(0,J.useState)(e),i=(0,J.useRef)(e),a=(0,J.useRef)(0),o=(0,J.useRef)(null);return(0,J.useEffect)(()=>{if(i.current=e,Object.is(e,n))return;let s=()=>{o.current=null,a.current=Date.now(),r(i.current)},c=t-(Date.now()-a.current);c<=0?s():o.current===null&&(o.current=window.setTimeout(s,c))},[e,n,t]),(0,J.useEffect)(()=>()=>{o.current!==null&&window.clearTimeout(o.current)},[]),n}function uD(e,t,n){let r=()=>n?n():e;return(0,J.useSyncExternalStore)(t??wD,r,r)}function dD({conversation:e,actions:t,tools:n}){let{interactions:r,sendingInteractionId:i,hasOlder:a,onLoadOlder:o,sending:s,sendingMessage:c,sendingImageCount:l,sendingVideoCount:u,streamedReply:d,streamedResponse:f,agentProgress:p,agentActivitySnapshots:m,thinkingExpanded:h,onThinkingExpandedChange:_,message:v,imageAttachments:y,videoAttachments:b,documentName:x,pendingApproval:S,agentMode:C,planMode:w,status:T,workspacePath:E,chatId:D,recentWorkspacePaths:O,chatEnd:k,welcomeInteraction:A,onSubmit:ee,onSelectImage:te,onSelectVideo:j,onSelectDocument:ne,onPasteImage:re,onAttachImage:M,onSetMessage:ie,onSendVoiceMessage:N,onRemoveImage:ae,onRemoveVideo:oe,onRemoveDocument:se,onStartWebSearch:ce,onCaptureScreen:le,onSetAgentMode:ue,onSetPlanMode:de,onSetProvider:fe,onSelectWorkspace:pe,onWorkspaceChanged:me,onApproval:he,settingsConfig:ge,onUpdateSettings:_e,onSetModel:ve,onSelectModelAndProvider:ye,onCancelMessage:be,onClearMessages:xe,onSetGeminiLiveVoice:Se,onToggleMobileSidebar:Ce,isCliSession:we,cliSessionId:Te,onBackToCode:Ee,conversationTitle:De,slashChoice:P,onOpenArtifact:Oe,onOpenReview:ke,onSelectSlashChoice:Ae,onDismissSlashChoice:je,queuedPrompts:Me=[],queuePaused:Ne=!1,onRemoveQueuedPrompt:Pe,onEditQueuedPrompt:Fe,onClearQueuedPrompts:Ie,onSteerQueuedPrompt:Le,onResumeQueue:Re,onResendFrom:ze,onSyncHistory:Be,onReceiveApproval:Ve}={...e,...t},He=uD(v,t.subscribeMessage,t.getMessage),Ue=bS(_),We=(0,J.useMemo)(()=>Gx(r,s,i),[r,s,i]),Ge=(0,J.useMemo)(()=>cx(p),[p]),Ke=(0,J.useMemo)(()=>Ge.reduce((e,t)=>e+t.additions,0),[Ge]),Je=(0,J.useMemo)(()=>Ge.reduce((e,t)=>e+t.deletions,0),[Ge]),Ye=Ge.length===1?`1 file changed`:`${Ge.length} files changed`,Xe=(0,J.useMemo)(()=>ux(r.map(e=>{let t=String(e.id);return cx(m[t]??e.agentActivity??dx)})),[m,r]),Ze=bS(()=>ux([Xe,Ge])),$e=(0,J.useMemo)(()=>{if(!E)return null;let e=E.replace(/[\\/]+$/,``).trim();if(!e)return null;let t=e.split(/[\\/]/);return t[t.length-1]||e},[E]),nt=lD(d,hD),rt=(0,J.useMemo)(()=>dS(p),[p]),ot=Yt(f),st=(0,J.useMemo)(()=>Ux(p),[p]),ct=(0,J.useMemo)(()=>ex(p),[p]),lt=(0,J.useMemo)(()=>tx(p),[p]),dt=(0,J.useMemo)(()=>[...p].reverse().find(e=>e.type===`Thinking`),[p]),ft=null,pt=null;dt&&dt.type===`Thinking`&&(ft=dt.data.agent_name||null,pt=dt.data.model_name||null);let[mt,ht]=(0,J.useState)({}),[gt,_t]=(0,J.useState)(null),[vt,yt]=(0,J.useState)(null),[bt,xt]=(0,J.useState)(!1),[Ct,wt]=(0,J.useState)(qe),Tt=(0,J.useCallback)(e=>{ht(t=>({...t,[e]:!(t[e]??e===`live`)}))},[]),Et=bS(e=>{Oe?Oe(e):yt({...e,workspacePath:e.workspacePath??E})}),Ot=bS((e,t)=>{ke?(_t(null),ke({id:`review:${Date.now()}`,kind:`review`,title:`Review`,reviewTitle:e,changes:t})):_t({title:e,changes:t})}),kt=bS(()=>{Ot(`All conversation changes`,Ze())});(0,J.useEffect)(()=>{if(!sD(T,ge))return;let e=!1;return(async()=>{let t=ge?.ollamaHost||`http://localhost:11434`,n=t.endsWith(`/`)?t.slice(0,-1):t;try{let t=new AbortController,r=setTimeout(()=>t.abort(),2e3),i=await fetch(`${n}/api/tags`,{signal:t.signal});if(clearTimeout(r),i.ok){let t=await i.json();if(!e&&t&&Array.isArray(t.models)&&t.models.length>0){wt(t.models.map(e=>e.name));return}}}catch{}try{let t=await CD(`ollama`,``);if(!e&&t&&t.length>0){wt(t);return}}catch{}e||(ge?.ollamaModel?wt([ge.ollamaModel]):wt(qe))})(),()=>{e=!0}},[T?.activeProvider,ge?.ollamaHost,ge?.ollamaModel]);let[jt,Nt]=(0,J.useState)(``),[Pt,Ft]=(0,J.useState)(null),[It,Lt]=(0,J.useState)(null),Rt=(0,J.useRef)(null),zt=(0,J.useRef)(null),[Bt,Vt]=(0,J.useState)(!1),[Ht,Ut]=(0,J.useState)(!1),Wt=(0,J.useRef)(!0),Gt=(0,J.useRef)(null),Kt=(0,J.useCallback)(()=>{let e=Rt.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<=240;Vt(!t),Wt.current=t},[]),qt=(0,J.useCallback)(()=>{Wt.current&&Gt.current===null&&(Gt.current=window.requestAnimationFrame(()=>{Gt.current=null,Rt.current&&Wt.current&&zt.current?.scrollToEnd()}))},[]);(0,J.useEffect)(()=>{qt()},[r,s,d,S,p,qt]),(0,J.useEffect)(()=>{Wt.current=!0,Vt(!1),qt()},[D,qt]),(0,J.useEffect)(()=>()=>{Gt.current!==null&&window.cancelAnimationFrame(Gt.current)},[]),(0,J.useEffect)(()=>{let e=Rt.current;e&&Wt.current&&(e.scrollTop=e.scrollHeight)},[vt]);let Jt=(0,J.useCallback)(()=>{Wt.current=!0,zt.current?.scrollToEnd()},[]),[Xt,Zt]=(0,J.useState)(()=>{try{let e=localStorage.getItem(`mint_preview_split_ratio`);if(e){let t=parseFloat(e);if(!isNaN(t)&&t>=.2&&t<=.8)return t}}catch{}return .5}),$t=(0,J.useRef)(Xt),en=(0,J.useRef)(null),tn=(0,J.useCallback)(e=>{e.preventDefault();let t=en.current;if(!t)return;t.classList.add(`is-resizing`);let n=e=>{let n=t.getBoundingClientRect(),r=n.width;if(r<=0)return;let i=n.right-e.clientX,a=Math.max(280,Math.min(r-340,i))/r;$t.current=a,t.style.setProperty(`--preview-width`,`${(a*100).toFixed(2)}%`)},r=()=>{window.removeEventListener(`mousemove`,n),window.removeEventListener(`mouseup`,r),t.classList.remove(`is-resizing`),Zt($t.current);try{localStorage.setItem(`mint_preview_split_ratio`,$t.current.toFixed(4))}catch{}};window.addEventListener(`mousemove`,n),window.addEventListener(`mouseup`,r)},[]),nn=(0,J.useCallback)(()=>{let e=.5;$t.current=e,Zt(e),en.current&&en.current.style.setProperty(`--preview-width`,`50%`);try{localStorage.setItem(`mint_preview_split_ratio`,`0.5`)}catch{}},[]),[rn,an]=(0,J.useState)({isOpen:!1,interaction:null,changes:[],checkpoints:[],targetCheckpoint:null,isLoading:!1}),[on,sn]=(0,J.useState)({visible:!1,message:``,canUndo:!1,isUndoing:!1,type:`success`});(0,J.useEffect)(()=>{if(!on.visible)return;let e=setTimeout(()=>{sn(e=>({...e,visible:!1}))},16e3);return()=>clearTimeout(e)},[on.visible,on.message]);let cn=(0,J.useCallback)(async e=>{let t=rn.interaction;if(!t)return;let n=t.chatId||`cli`;an(e=>({...e,isLoading:!0}));try{let t=await xD(n,e,E);an(e=>({...e,isOpen:!1,isLoading:!1})),t.status===`ok`?sn({visible:!0,message:t.message,canUndo:!0,isUndoing:!1,type:`success`}):sn({visible:!0,message:`Failed to rewind: ${t.message}`,canUndo:!1,isUndoing:!1,type:`error`})}catch(e){an(e=>({...e,isOpen:!1,isLoading:!1})),sn({visible:!0,message:`Error: ${e.message||String(e)}`,canUndo:!1,isUndoing:!1,type:`error`})}},[rn.interaction,E]),ln=(0,J.useCallback)(async()=>{sn(e=>({...e,isUndoing:!0}));try{let e=await SD(E);e.status===`ok`?sn({visible:!0,message:e.message,canUndo:!1,isUndoing:!1,type:`success`}):sn({visible:!0,message:`Failed to undo rewind: ${e.message}`,canUndo:!0,isUndoing:!1,type:`error`})}catch(e){sn({visible:!0,message:`Error: ${e.message||String(e)}`,canUndo:!0,isUndoing:!1,type:`error`})}},[E]),un=(0,J.useCallback)(async(e,t)=>{try{let n=Cy(t)||t;await navigator.clipboard.writeText(n),Lt(e),setTimeout(()=>{Lt(t=>t===e?null:t)},2e3)}catch(e){console.error(`Failed to copy message:`,e)}},[]),dn=(0,J.useRef)(null),fn=(0,J.useRef)(!1),pn=(0,J.useRef)(!1),mn=(0,J.useRef)(null),hn=(0,J.useRef)(null),[gn,_n]=(0,J.useState)(!1),vn=(0,J.useRef)(0),yn=(0,J.useRef)(0),bn=(0,J.useCallback)(e=>{e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,120)}px`},[]),xn=(0,J.useCallback)(e=>{let t=yb(e,E).trim();if(!t)return;let n=`${t} `,r=Gn.current;if(!r){ie(He.trim()?`${He.trimEnd()} ${n}`:n);return}let i=r.selectionStart??He.length,a=r.selectionEnd??He.length,o=He.slice(0,i),s=He.slice(a),c=o&&!o.endsWith(` `)&&!o.endsWith(`
|
|
102
|
+
`)?` `:``,l=`${o}${c}${n}${s}`;ie(l);let u=(o+c+n).length;requestAnimationFrame(()=>{r.focus(),r.setSelectionRange(u,u),bn(r)})},[He,ie,E,bn]),Sn=e=>{e.preventDefault(),e.dataTransfer?.types?.includes(`Files`)&&(vn.current++,_n(!0))},Cn=e=>{e.preventDefault(),e.dataTransfer?.types?.includes(`Files`)&&(vn.current--,vn.current===0&&_n(!1))},wn=e=>{e.preventDefault(),(e.dataTransfer?.types?.includes(`application/x-mint-workspace-path`)||e.dataTransfer?.types?.includes(`application/x-mint-workspace-file`)||e.dataTransfer?.types?.includes(`application/x-mint-workspace-image`)||e.dataTransfer?.types?.includes(`application/x-mint-workspace-path`))&&(e.dataTransfer.dropEffect=`copy`)},Tn=e=>{e.preventDefault(),e.stopPropagation(),vn.current=0,_n(!1);let t=e.dataTransfer?.getData(`application/x-mint-workspace-image`)||e.dataTransfer?.getData(`application/x-mint-workspace-path`)||e.dataTransfer?.getData(`application/x-mint-workspace-path`),n=e.dataTransfer?.getData(`text/plain`)?.trim()||``,r=e.dataTransfer?.getData(`application/x-mint-workspace-path`)||e.dataTransfer?.getData(`application/x-mint-workspace-path`)||(n.startsWith(`@`)?n:``);if(t||r){mr(e.dataTransfer).then(e=>{if(!e){let e=r||t;e&&xn(e)}});return}let i=Date.now();if(i-yn.current<250)return;yn.current=i;let a=e.dataTransfer?.files;if(a&&a.length>0){let e=a[0];if(e.type.startsWith(`image/`)){let t=document.getElementById(`vision-file-input`);if(t){let n=new DataTransfer;n.items.add(e),t.files=n.files,te({target:t})}}else if(e.type.startsWith(`video/`)){let t=document.getElementById(`video-file-input`);if(t){let n=new DataTransfer;n.items.add(e),t.files=n.files,j({target:t})}}else if(SE(e.name)){let t=document.getElementById(`document-file-input`);if(t){let n=new DataTransfer;n.items.add(e),t.files=n.files,ne({target:t})}}}},{isRecording:En,voiceMode:Dn,setVoiceMode:F,voiceTranscript:On,setVoiceTranscript:kn,voiceAwaitingResponse:I,voiceAwaitingResponseRef:An,voiceModeRef:jn,startRecognition:Mn,stopRecognition:Nn,cancelRecognition:Pn,scheduleVoiceListen:Fn,clearRestartTimer:In}=MT({chatId:D,onSendVoiceMessage:N,language:ge?.language,message:He,sending:s,isSpeaking:!!Pt,onSetMessage:ie}),Ln=ge?.voiceMode===`geminiLive`,Rn=aE({workspacePath:E,chatId:D,startSession:_D,sendAudioChunk:vD,stopSession:yD,onTurnSaved:()=>{Be?.()},onToolActivity:()=>{me?.()},onApprovalRequested:e=>{Ve?.(e)}});(0,J.useEffect)(()=>{let e=()=>{Ln?Rn.setVoiceMode(!0):(F(!0),Mn())};return window.addEventListener(`mint:trigger-voice`,e),()=>window.removeEventListener(`mint:trigger-voice`,e)},[Ln,Rn,F,Mn]);let zn=!!(He.trim()||y.length>0||b.length>0||x),Bn=Array.from({length:l},(e,t)=>`[Image #${t+1}]`).join(` `),Vn=Array.from({length:u||0},(e,t)=>`[Video #${t+1}]`).join(` `),Hn=e=>{switch(e){case`gemini`:return Qe;case`openai`:return ut;case`openrouter`:return et;case`deepseek`:return it;case`anthropic`:return At;case`huggingface`:return tt;case`local_openai`:return Qt;case`ollama`:return Ct;default:if(e.startsWith(`custom:`)){let t=e.replace(/^custom:/,``);return(ge?.customProviders??[]).find(e=>e.id===t)?.models.map(e=>e.modelId)??[]}return[]}},Un=T?.activeProvider??``;Hn(Un);let Wn=(e=>{if(!ge)return``;switch(e){case`gemini`:return ge.geminiModel;case`openai`:return ge.openaiModel;case`openrouter`:return ge.openrouterModel;case`deepseek`:return ge.deepseekModel;case`anthropic`:return ge.anthropicModel;case`huggingface`:return ge.hfModel;case`local_openai`:return ge.localModelName;case`ollama`:return ge.ollamaModel;default:if(e.startsWith(`custom:`)){let t=e.replace(/^custom:/,``),n=(ge?.customProviders??[]).find(e=>e.id===t);return(ge.customModelSelections??{})[t]??n?.models[0]?.modelId??``}return``}})(Un),Gn=(0,J.useRef)(null),Kn=(0,J.useRef)(null),qn=(0,J.useMemo)(()=>{let e=[];for(let t of r){if(t?.provider===`system`)continue;let n=typeof t?.userText==`string`?t.userText.trim():``;n&&e[e.length-1]!==n&&e.push(n)}return e},[r]),[Jn,Yn]=(0,J.useState)(null),Xn=(0,J.useRef)(``),Zn=e=>{ie(e),setTimeout(()=>{let e=Gn.current;if(!e)return;bn(e);let t=e.value.length;e.setSelectionRange(t,t),e.focus()},0)},Qn=()=>{if(qn.length===0)return!1;if(Jn===null)return Xn.current=He,Yn(0),Zn(qn[qn.length-1]),!0;if(Jn+1<qn.length){let e=Jn+1;Yn(e),Zn(qn[qn.length-1-e])}return!0},$n=bS(e=>{Yn(null),Zn(e)}),er=()=>{if(Jn===null)return!1;if(Jn===0)return Yn(null),Zn(Xn.current),!0;let e=Jn-1;return Yn(e),Zn(qn[qn.length-1-e]),!0},tr=e=>{ie(e),setTimeout(()=>{let e=Gn.current;e&&(bn(e),e.focus())},0)},nr=e=>{e.key!==`Enter`||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),e.currentTarget.form?.requestSubmit())},rr=e=>{let t=(e.key===`ArrowUp`||e.key===`ArrowDown`)&&!e.shiftKey&&!e.altKey&&!e.metaKey&&!e.ctrlKey&&!e.nativeEvent.isComposing;if(t&&Jn!==null&&e.currentTarget.selectionStart===e.currentTarget.selectionEnd&&(e.key===`ArrowUp`?Qn():er()))e.preventDefault();else if(!Kn.current?.handleKeyDown(e)){if(t){let t=e.currentTarget;if(t.selectionStart===t.selectionEnd){if(e.key===`ArrowUp`){if(!t.value.slice(0,t.selectionStart).includes(`
|
|
103
|
+
`)&&Qn()){e.preventDefault();return}}else if(!t.value.slice(t.selectionEnd).includes(`
|
|
104
|
+
`)&&er()){e.preventDefault();return}}}nr(e)}},ir=(0,J.useRef)(null),ar=(0,J.useRef)(null);ir.current||=new mx(gD,e=>{Ft(e===`idle`?null:ar.current),hn.current=e===`idle`?null:ar.current,e===`idle`&&Fn(900)},e=>Nt(e));let or=()=>{ir.current?.stop()},sr=bS((e,t,n=!1)=>{if(!n&&Pt===e){or();return}Nt(``),ar.current=e;let i=t??Number([...r].reverse().find(t=>t.aiText===e)?.id);ir.current?.play({chatId:D,text:e,turnId:Number.isFinite(i)&&i>0?i:void 0,automatic:n})});(0,J.useEffect)(()=>{or()},[D,s]),(0,J.useEffect)(()=>{fn.current=!1,pn.current=!1,mn.current=null},[D]),(0,J.useEffect)(()=>()=>{ir.current?.dispose()},[]),(0,J.useEffect)(()=>{s&&(pn.current=!0)},[s]),(0,J.useEffect)(()=>{if(r.length===0)return;let e=r[r.length-1];!fn.current&&(fn.current=!0,!pn.current)?mn.current=e?.id??null:s||e?.aiText&&e.id!==mn.current&&(!ge?.enableVoiceReply||Rn.voiceMode?(mn.current=e.id,Dn&&Fn(350)):(mn.current=e.id,sr(e.aiText,Number(e.id),!0)))},[r,s,ge?.enableVoiceReply,Rn.voiceMode,Dn]),(0,J.useEffect)(()=>{if(!bt)return;let e=e=>{dn.current?.contains(e.target)||xt(!1)};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[bt]),(0,J.useEffect)(()=>{let e=e=>{e.clipboardData&&re(e.clipboardData)&&(e.preventDefault(),e.stopPropagation())};return window.addEventListener(`paste`,e,!0),()=>window.removeEventListener(`paste`,e,!0)},[re]),(0,J.useEffect)(()=>{let e=e=>{let t=e.target instanceof Element&&e.target.closest(`.tool-surface-page`);e.key===`Escape`&&s&&!e.defaultPrevented&&!t&&be()};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[s,be]),(0,J.useEffect)(()=>{if(He)return;let e=document.getElementById(`chat-input`);e&&(e.style.height=``)},[He]);let cr=()=>{xt(!1),document.getElementById(`vision-file-input`)?.click()},lr=()=>{xt(!1),document.getElementById(`video-file-input`)?.click()},ur=()=>{xt(!1),document.getElementById(`document-file-input`)?.click()},dr=()=>{xt(!1),ce()},fr=()=>{xt(!1),C||ue(!0),ie(`Generate an image of `),Gn.current?.focus()},pr=()=>{xt(!1),C||ue(!0),ie(`Generate a video of `),Gn.current?.focus()},mr=async e=>{if(!M)return!1;let t=e.getData(Db),n=null;if(t)try{n=JSON.parse(t)}catch{}let r=n?.path||e.getData(`application/x-mint-workspace-path`)||e.getData(`application/x-mint-workspace-path`),i=e.getData(`text/plain`),a=e.getData(`text/uri-list`),o=(r||i||a||``).replace(/^@/,``).trim();if(!(n||vb(o)||o.startsWith(`blob:`)||o.startsWith(`data:image/`)||n?.url))return!1;let s=n?.name||o.split(/[\\/]/).pop()?.split(`?`)[0]||`image.png`,c=n?.root||E||``,l=n?.url||(o.startsWith(`http`)||o.startsWith(`blob:`)||o.startsWith(`data:image/`)?o:``),u=``;if(l&&(u=await xb(l,c,(e,t)=>g.readWorkspaceImage(e,t))),!u&&o&&(u=await xb(o,c,(e,t)=>g.readWorkspaceImage(e,t))),u){let e=await Mt(u).catch(()=>u);return M({dataUri:u,previewDataUri:e,name:s}),Gn.current?.focus(),!0}return!1},hr=e=>{e.preventDefault();let t=e.dataTransfer.getData(`application/x-mint-workspace-path`)||e.dataTransfer.getData(`application/x-mint-workspace-path`),n=e.dataTransfer.getData(`text/plain`),r=t||n;mr(e.dataTransfer).then(e=>{if(e||!r)return;let n=r.trim();(t||n.startsWith(`@`))&&xn(n)})},gr=r.length===0&&!s&&!S,_r=bS(e=>{an({isOpen:!0,interaction:e.interaction,changes:e.changes,checkpoints:e.checkpoints,targetCheckpoint:e.targetCheckpoint,isLoading:!1})}),vr=bS(e=>{sn({visible:!0,message:e,canUndo:!1,isUndoing:!1,type:`error`})}),yr=s||S?(0,Y.jsxs)(Y.Fragment,{children:[s&&(0,Y.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`8px`,marginBottom:`16px`},children:[(0,Y.jsx)(`div`,{className:`message user-message`,children:(0,Y.jsx)(`div`,{className:`bubble-wrapper`,children:(0,Y.jsx)(`div`,{className:`message-bubble`,children:(0,Y.jsx)(rb,{text:[c,Bn,Vn].filter(Boolean).join(` `)})})})}),C&&(0,Y.jsx)(IC,{progress:p,id:`live`,isOpen:mt.live??!0,onToggle:Tt,pendingApproval:!!S,chatId:D,workspacePath:E,onReferenceFile:xn,onOpenArtifact:Et}),(0,Y.jsx)(JC,{changes:Ge,isLive:!0,workspacePath:E,onReferenceFile:xn,onOpenArtifact:Et,onOpenReview:kt}),(0,Y.jsx)(`div`,{className:`message ai-message thinking-message`,children:(0,Y.jsxs)(`div`,{className:`bubble-wrapper`,children:[!C&<.length>0&&(0,Y.jsx)(iC,{blockKey:`live-extended`,thoughts:lt,isLive:!0,variant:`extended`,expanded:h[`live-extended`]??!0,onExpandedChange:Ue}),!C&&ct.length>0&<.length===0&&(0,Y.jsx)(iC,{blockKey:`live`,thoughts:ct,isLive:!0,expanded:h.live??!0,onExpandedChange:Ue}),(0,Y.jsxs)(`div`,{className:`message-bubble`,children:[(0,Y.jsx)(bx,{progress:p,running:!0,chatId:D,mode:`artifacts-only`}),(0,Y.jsx)(kx,{progress:p,chatId:D,onOpenArtifact:Et}),(0,Y.jsx)(`span`,{children:st?(0,Y.jsx)(zx,{},st.index):nt?(0,Y.jsx)(rb,{text:nt,sources:rt}):(0,Y.jsxs)(`div`,{className:`thinking-status`,children:[(0,Y.jsxs)(`span`,{className:`thinking-status-label`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:`✦ `}),ft&&pt?`${ft} (${pt}) is thinking...`:`Thinking`]}),(0,Y.jsx)(cD,{})]})})]}),f&&(0,Y.jsxs)(`div`,{className:`message-time`,style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,Y.jsxs)(`span`,{className:`provider-model-chip`,"data-provider":(f.provider||``).toLowerCase(),title:`${f.provider} • ${f.model}`,children:[(0,Y.jsx)(Rw,{provider:f.provider,model:f.model,customProviders:ge?.customProviders,size:13}),(0,Y.jsx)(`span`,{className:`provider-chip-name`,children:f.provider}),(0,Y.jsx)(`span`,{className:`provider-chip-divider`,children:`/`}),(0,Y.jsx)(`span`,{className:`provider-chip-model`,children:f.model})]}),ot&&(0,Y.jsx)(`span`,{className:`provider-fallback-notice`,children:ot}),nt&&(0,Y.jsxs)(`div`,{className:`message-action-buttons`,style:{display:`flex`,alignItems:`center`,gap:`4px`,marginLeft:`auto`},children:[(0,Y.jsx)(`button`,{type:`button`,className:`msg-action-btn copy-btn ${It===`live`?`is-copied`:``}`,onClick:()=>un(`live`,nt),title:It===`live`?`Copied!`:`Copy message`,children:Ey(It===`live`)}),(0,Y.jsx)(`button`,{type:`button`,className:`msg-action-btn tts-btn ${Pt===nt?`is-speaking`:``}`,disabled:s,onClick:()=>sr(nt),title:s?`Read after the reply finishes`:Pt===nt?`Stop reading`:`Read aloud`,children:Ty(Pt===nt)})]})]})]})})]}),S&&(0,Y.jsx)(eC,{pendingApproval:S,onApproval:he},S.id||JSON.stringify(S))]}):null,br=(0,Y.jsxs)(`section`,{className:`conversation-panel ${gr?`is-empty`:``}`,onDragEnter:Sn,onDragOver:wn,onDragLeave:Cn,onDrop:Tn,style:vt||gt?{flex:`0 0 calc(100% - var(--preview-width, 50%))`,width:`calc(100% - var(--preview-width, 50%))`,minWidth:`320px`,maxWidth:`none`,margin:0,position:`relative`}:void 0,children:[jt&&(0,Y.jsxs)(`p`,{role:`status`,style:{padding:`8px 16px`,fontSize:`12px`,color:`var(--text-muted)`},children:[jt,` `,(0,Y.jsx)(`button`,{type:`button`,onClick:()=>Nt(``),children:`Dismiss`})]}),gn&&(0,Y.jsxs)(`div`,{className:`drag-drop-overlay`,onDragEnter:Sn,onDragLeave:Cn,onDragOver:wn,onDrop:Tn,style:{position:`absolute`,top:0,left:0,right:0,bottom:0,background:`var(--bg-backdrop)`,backdropFilter:`blur(8px)`,border:`2px dashed var(--accent)`,borderRadius:`var(--radius-xl, 18px)`,margin:`12px`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,color:`var(--text-primary)`,zIndex:1e3,pointerEvents:`auto`},children:[(0,Y.jsx)(`div`,{style:{marginBottom:`16px`,color:`var(--interactive-fg)`},children:(0,Y.jsxs)(`svg`,{width:`48`,height:`48`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Y.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,ry:`2`}),(0,Y.jsx)(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`}),(0,Y.jsx)(`polyline`,{points:`21 15 16 10 5 21`})]})}),(0,Y.jsx)(`div`,{style:{fontSize:`1.25rem`,fontWeight:`bold`,letterSpacing:`0.5px`},children:`Drag files to attach data`}),(0,Y.jsx)(`div`,{style:{fontSize:`0.85rem`,color:`var(--text-muted)`,marginTop:`8px`},children:`Supports images (PNG, JPEG, WebP, GIF), videos (MP4, WebM, MOV, MKV), and PDF files`})]}),(0,Y.jsxs)(`div`,{className:`chat-header`,children:[Ce&&(0,Y.jsx)(`button`,{className:`mobile-menu-btn`,type:`button`,onClick:Ce,"aria-label":`Open navigation menu`,children:(0,Y.jsxs)(`svg`,{width:`22`,height:`22`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,Y.jsx)(`line`,{x1:`3`,y1:`12`,x2:`21`,y2:`12`}),(0,Y.jsx)(`line`,{x1:`3`,y1:`6`,x2:`21`,y2:`6`}),(0,Y.jsx)(`line`,{x1:`3`,y1:`18`,x2:`21`,y2:`18`})]})}),(0,Y.jsx)(`div`,{className:`chat-header-title`,children:we?(0,Y.jsxs)(`div`,{className:`chat-header-breadcrumb`,children:[Ee&&(0,Y.jsxs)(`button`,{type:`button`,className:`chat-header-back-btn`,onClick:Ee,title:`Back to Code sessions Hub`,children:[(0,Y.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,Y.jsx)(`path`,{d:`M15 18l-6-6 6-6`})}),(0,Y.jsx)(`span`,{children:`Code`})]}),(0,Y.jsx)(`span`,{className:`chat-header-sep`,children:`/`}),(0,Y.jsx)(`span`,{className:`chat-header-session-tag`,title:Te||`CLI Session`,children:(0,Y.jsx)(`span`,{children:Te?Te===`cli`?`cli`:`cli::${Te.replace(/^cli::/,``).slice(0,7)}`:`cli`})})]}):(0,Y.jsxs)(`div`,{className:`chat-header-brand-group`,children:[(0,Y.jsx)(`img`,{src:g.appIconPath(),alt:`Logo`,className:`chat-header-logo`}),(0,Y.jsx)(`span`,{className:`chat-header-title-text`,title:De&&De.trim()&&De!==`New chat`?De.trim():`Mint Agent`,children:De&&De.trim()&&De!==`New chat`?De.trim():`Mint Agent`}),$e&&(0,Y.jsxs)(`span`,{className:`chat-header-project-pill`,title:`Project: ${E}`,children:[(0,Y.jsx)(`svg`,{width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,Y.jsx)(`path`,{d:`M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z`})}),(0,Y.jsx)(`span`,{children:$e})]})]})}),(0,Y.jsxs)(`div`,{className:`chat-header-actions`,children:[n?.onToggle&&(0,Y.jsx)(VE,{open:n.open,count:n.backgroundTaskCount,onToggle:n.onToggle}),vt&&(0,Y.jsxs)(`button`,{type:`button`,className:`chat-header-pill-btn`,title:`Close Live Preview`,onClick:()=>yt(null),children:[(0,Y.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Y.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,Y.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]}),(0,Y.jsx)(`span`,{children:`Close preview`})]}),(0,Y.jsx)(`button`,{type:`button`,className:`chat-header-action-btn`,title:`Clear conversation`,onClick:xe,children:(0,Y.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Y.jsx)(`polyline`,{points:`3 6 5 6 21 6`}),(0,Y.jsx)(`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}),(0,Y.jsx)(`line`,{x1:`10`,y1:`11`,x2:`10`,y2:`17`}),(0,Y.jsx)(`line`,{x1:`14`,y1:`11`,x2:`14`,y2:`17`})]})})]})]}),(0,Y.jsxs)(`div`,{className:`chat-container`,ref:Rt,onScroll:Kt,style:{overflowAnchor:`none`},children:[a&&o&&(0,Y.jsx)(`button`,{type:`button`,className:`load-older-messages`,disabled:Ht,style:{display:`block`,margin:`0 auto 20px`,padding:`7px 14px`,borderRadius:`var(--radius-md, 10px)`,border:`1px solid var(--border-color, #3a3a3a)`,background:`var(--surface, #252525)`,color:`var(--text-secondary, #c0c0c0)`,cursor:Ht?`default`:`pointer`},onClick:async()=>{Ut(!0);try{await o()}finally{Ut(!1)}},children:Ht?`Loading earlier messages…`:`Load earlier messages`}),(0,Y.jsx)(AT,{ref:zt,items:We,scrollRef:Rt,hasOlder:a,renderRow:e=>{let t=We[e];return(0,Y.jsxs)(J.Fragment,{children:[e>0&&Dt(We[e-1].createdAt,t.createdAt)&&(0,Y.jsxs)(`div`,{className:`system-event-divider`,children:[(0,Y.jsx)(`div`,{className:`system-event-line`}),(0,Y.jsxs)(`div`,{className:`system-event-pill`,children:[(0,Y.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:[(0,Y.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,Y.jsx)(`polyline`,{points:`12 7 12 12 15.5 14`})]}),(0,Y.jsx)(`span`,{children:St(t.createdAt)})]}),(0,Y.jsx)(`div`,{className:`system-event-line`})]}),(0,Y.jsx)(Uw,{interaction:t,copiedId:It,onEditMessage:$n,onResendFrom:ze,speakingText:Pt,agentActivitySnapshots:m,openActivityIds:mt,thinkingExpanded:h,onThinkingExpandedChange:Ue,handleCopyMessage:un,speak:sr,toggleActivity:Tt,chatId:D,workspacePath:E,onReferenceFile:xn,customProviders:ge?.customProviders,onOpenArtifact:Et,onOpenReview:kt,onRewindRequest:_r,onRewindError:vr})]},t.id)},tail:yr},D),Bt&&(0,Y.jsx)(`button`,{type:`button`,className:`scroll-to-bottom-btn`,onClick:Jt,title:`Scroll to latest message`,"aria-label":`Scroll to latest message`,children:(0,Y.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.4`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Y.jsx)(`path`,{d:`M12 5v14`}),(0,Y.jsx)(`path`,{d:`M6 13l6 6 6-6`})]})}),(0,Y.jsx)(`div`,{ref:k})]}),(0,Y.jsxs)(`div`,{className:`input-area`,children:[(0,Y.jsx)(ZE,{workspacePath:E,chatId:D,panelTarget:n?.modsPanelTarget,onOpen:n?.onOpenMods??(()=>{})}),(0,Y.jsx)(Gw,{progress:p,onOpenDetails:()=>Tt(`live`)}),Ge.length>0&&(0,Y.jsxs)(`button`,{type:`button`,className:`composer-change-status ${s?`is-live`:``}`,onClick:()=>Ot(Ye,Ge),title:`Review recent agent changes`,children:[(0,Y.jsxs)(`span`,{className:`composer-change-status-copy`,children:[s&&(0,Y.jsx)(`span`,{className:`composer-change-status-spinner`,"aria-hidden":`true`}),(0,Y.jsx)(`span`,{children:s?`Editing ${Ge.length} ${Ge.length===1?`file`:`files`}…`:Ye})]}),(0,Y.jsxs)(`span`,{className:`composer-change-status-counts`,"aria-label":`${Ke} additions and ${Je} deletions`,children:[Ke>0&&(0,Y.jsxs)(`strong`,{children:[`+`,Ke]}),Je>0&&(0,Y.jsxs)(`em`,{children:[`-`,Je]})]})]}),gr&&(0,Y.jsxs)(`div`,{className:`empty-chat-prompt-wrap`,children:[(0,Y.jsx)(`div`,{className:`empty-chat-prompt`,children:`Mint Agent is ready to work`}),$e&&(0,Y.jsxs)(`div`,{className:`empty-chat-project-badge`,children:[(0,Y.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,Y.jsx)(`path`,{d:`M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z`})}),(0,Y.jsxs)(`span`,{children:[`Working in `,(0,Y.jsx)(`strong`,{children:$e})]})]})]}),pe&&(0,Y.jsxs)(`div`,{className:`project-context-row`,children:[(0,Y.jsx)(pb,{currentPath:E||``,recentPaths:O,onSelectWorkspace:pe}),E&&(0,Y.jsx)(Gb,{workspacePath:E,disabled:s,onBranchChanged:me})]}),Me&&Me.length>0&&(0,Y.jsx)(rD,{queuedPrompts:Me,queuePaused:!!Ne,sending:s,onRemove:Pe||(()=>{}),onEdit:Fe||(()=>{}),onClear:Ie||(()=>{}),onSteer:Le||(()=>{}),onResumeQueue:Re}),(0,Y.jsxs)(`form`,{id:`chat-form`,className:Ln?`has-live-btn`:``,style:{position:`relative`},onSubmit:e=>{Yn(null),Xn.current=``,ee(e)},onDragOver:e=>{(e.dataTransfer.types.includes(`application/x-mint-workspace-path`)||e.dataTransfer.types.includes(`application/x-mint-workspace-file`)||e.dataTransfer.types.includes(`application/x-mint-workspace-image`)||e.dataTransfer.types.includes(`application/x-mint-workspace-path`))&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`)},onDrop:hr,onPaste:e=>{re(e.clipboardData)&&e.preventDefault()},children:[P&&(0,Y.jsx)(wS,{choice:P,inputRef:Gn,onSelect:Ae,onDismiss:je}),(y.length>0||b.length>0||x)&&(0,Y.jsxs)(`div`,{className:`mint-attachment`,children:[y.map((e,t)=>(0,Y.jsxs)(`div`,{className:`mint-image-attachment`,children:[(0,Y.jsx)(`img`,{className:`mint-image-preview`,src:e.objectUrl||e.previewDataUri||e.dataUri,alt:e.name||`Image attachment`}),(0,Y.jsx)(`button`,{className:`mint-attachment-remove`,type:`button`,onClick:()=>ae(t),"aria-label":`Remove image`,children:(0,Y.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Y.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,Y.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]},t)),b.map((e,t)=>(0,Y.jsxs)(`div`,{className:`mint-image-attachment`,children:[(0,Y.jsx)(`video`,{className:`mint-image-preview`,src:e.dataUri,muted:!0,playsInline:!0,preload:`metadata`}),(0,Y.jsx)(`div`,{className:`mint-video-play-indicator`,style:{position:`absolute`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,pointerEvents:`none`,background:`rgba(0,0,0,0.6)`,borderRadius:`50%`,display:`flex`,alignItems:`center`,justifyContent:`center`,width:`22px`,height:`22px`,border:`1.5px solid white`},children:(0,Y.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`white`,stroke:`white`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,Y.jsx)(`polygon`,{points:`5 3 19 12 5 21 5 3`})})}),(0,Y.jsx)(`button`,{className:`mint-attachment-remove`,type:`button`,onClick:()=>oe(t),"aria-label":`Remove video`,children:(0,Y.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Y.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,Y.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]},t)),x&&(0,Y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`,minWidth:0},children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`,color:`var(--text-soft)`},children:(0,Y.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Y.jsx)(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z`}),(0,Y.jsx)(`polyline`,{points:`14 2 14 8 20 8`})]})}),(0,Y.jsx)(`span`,{style:{fontSize:`0.76rem`,color:`var(--text-soft)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,maxWidth:`220px`},children:x}),(0,Y.jsx)(`button`,{type:`button`,onClick:se,style:{background:`transparent`,border:0,color:`var(--status-error)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`},children:(0,Y.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Y.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,Y.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]})]}),Jn!==null&&qn.length>0&&(0,Y.jsxs)(`div`,{className:`chat-history-indicator`,"aria-live":`polite`,style:{position:`absolute`,top:`-9px`,right:`14px`,padding:`1px 8px`,fontSize:`0.68rem`,fontWeight:600,letterSpacing:`0.02em`,color:`var(--text-soft, #94a3b8)`,background:`var(--input-bg, #1e293b)`,border:`1px solid var(--border, rgba(148,163,184,0.25))`,borderRadius:`999px`,pointerEvents:`none`,zIndex:2},children:[`History `,Jn+1,`/`,qn.length]}),(0,Y.jsx)(Fx,{id:`chat-input`,inputRef:Gn,value:He,onValueChange:e=>{ie(e),Jn!==null&&Yn(null)},onResizeInput:bn,onChange:e=>{bn(e.currentTarget),ie(e.target.value),Jn!==null&&Yn(null)},onKeyDown:rr,onDragOver:e=>{(e.dataTransfer.types.includes(`application/x-mint-workspace-path`)||e.dataTransfer.types.includes(`application/x-mint-workspace-file`)||e.dataTransfer.types.includes(`application/x-mint-workspace-image`)||e.dataTransfer.types.includes(`application/x-mint-workspace-path`)||e.dataTransfer.types.includes(`text/plain`))&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`)},onDrop:hr,placeholder:`Ask anything, @ to mention, / for actions`,rows:1}),(0,Y.jsx)(RS,{ref:Kn,message:He,onComplete:tr,workspacePath:E,mcpServers:ge?.mcpServers,anchorRef:Gn,suppressed:Jn!==null||!!P}),(0,Y.jsxs)(`div`,{className:`chat-tool-menu-wrap`,ref:dn,children:[(0,Y.jsx)(`button`,{id:`chat-tool-btn`,type:`button`,"aria-haspopup":`menu`,"aria-expanded":bt,onClick:()=>xt(e=>!e),style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`},children:(0,Y.jsxs)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Y.jsx)(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),(0,Y.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})]})}),bt&&(0,Y.jsxs)(`div`,{className:`chat-tool-menu`,role:`menu`,children:[(0,Y.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:cr,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:(0,Y.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Y.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,ry:`2`}),(0,Y.jsx)(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`}),(0,Y.jsx)(`polyline`,{points:`21 15 16 10 5 21`})]})}),(0,Y.jsx)(`span`,{children:`Add image`})]}),(0,Y.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:lr,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:(0,Y.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Y.jsx)(`polygon`,{points:`23 7 16 12 23 17 23 7`}),(0,Y.jsx)(`rect`,{x:`1`,y:`5`,width:`15`,height:`14`,rx:`2`,ry:`2`})]})}),(0,Y.jsx)(`span`,{children:`Add video`})]}),(0,Y.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:ur,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:(0,Y.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Y.jsx)(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z`}),(0,Y.jsx)(`polyline`,{points:`14 2 14 8 20 8`})]})}),(0,Y.jsx)(`span`,{children:`Add file`})]}),(0,Y.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:dr,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:(0,Y.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Y.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,Y.jsx)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})]})}),(0,Y.jsx)(`span`,{children:`Search web`})]}),(0,Y.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:fr,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:(0,Y.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,Y.jsx)(`path`,{d:`M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83`})})}),(0,Y.jsx)(`span`,{children:`Generate image`})]}),(0,Y.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:pr,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:(0,Y.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Y.jsx)(`polygon`,{points:`23 7 16 12 23 17 23 7`}),(0,Y.jsx)(`rect`,{x:`1`,y:`5`,width:`15`,height:`14`,rx:`2`,ry:`2`})]})}),(0,Y.jsx)(`span`,{children:`Generate video`})]})]})]}),(0,Y.jsx)(`input`,{id:`vision-file-input`,type:`file`,accept:`image/png,image/jpeg,image/webp,image/gif`,onChange:te,style:{display:`none`}}),(0,Y.jsx)(`input`,{id:`video-file-input`,type:`file`,accept:`video/mp4,video/webm,video/quicktime,video/x-matroska`,onChange:j,style:{display:`none`}}),(0,Y.jsx)(`input`,{id:`document-file-input`,type:`file`,accept:wE,onChange:ne,style:{display:`none`}}),(0,Y.jsx)(`button`,{id:`screen-capture-btn`,type:`button`,onClick:le,"aria-label":`Capture screen`,children:(0,Y.jsxs)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,Y.jsx)(`rect`,{x:`2`,y:`3`,width:`20`,height:`15`,rx:`2`}),(0,Y.jsx)(`path`,{d:`M8 22h8M12 18v4M7 10h10M12 5v10`})]})}),(0,Y.jsxs)(`div`,{className:`chat-composer-pills`,children:[(0,Y.jsx)(AE,{activeProvider:T?.activeProvider??``,activeModel:Wn,availableProviders:T?.availableProviders??[],settingsConfig:ge,dynamicOllamaModels:Ct,onSelect:(e,t)=>{ye?ye(e,t):(fe(e),ve(t))},onUpdateSettings:_e}),(0,Y.jsx)(IE,{agentMode:C,onSetAgentMode:ue,planMode:w,onSetPlanMode:de,disabled:s})]}),(0,Y.jsx)(LT,{id:`voice-input-btn`,className:`composer-voice-pill`,active:En,disabled:s||I||Rn.voiceMode,ariaLabel:`Voice input`,title:En?`Stop recording · Esc or slide left to cancel`:`Tap to dictate · hold to record`,accentColor:`var(--text-primary)`,iconColor:`var(--text-muted)`,background:`var(--bg-surface-soft)`,size:28,shape:`pill`,reach:8,mode:`auto`,holdAfter:300,reactive:`simulated`,showTime:!0,waveform:!0,slideToCancel:!0,cancelDistance:64,attack:40,release:240,openDuration:200,pressScale:.95,onStart:()=>(or(),Mn()),onStop:({reason:e})=>{or(),e===`release`||e===`tap`||e===`key`?Nn():Pn()}}),Ln&&(0,Y.jsx)(`button`,{id:`gemini-live-btn`,type:`button`,onClick:()=>Rn.setVoiceMode(!0),title:`Start Gemini Live conversation`,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`},children:(0,Y.jsxs)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Y.jsx)(`circle`,{cx:`12`,cy:`12`,r:`2`}),(0,Y.jsx)(`path`,{d:`M8.5 8.5a5 5 0 0 0 0 7`}),(0,Y.jsx)(`path`,{d:`M15.5 8.5a5 5 0 0 1 0 7`}),(0,Y.jsx)(`path`,{d:`M5.5 5.5a9 9 0 0 0 0 13`}),(0,Y.jsx)(`path`,{d:`M18.5 5.5a9 9 0 0 1 0 13`})]})}),s?(0,Y.jsxs)(`div`,{style:{display:`inline-flex`,alignItems:`center`,gap:`6px`},children:[zn&&(0,Y.jsx)(`button`,{id:`queue-btn`,className:`queue-btn`,type:`submit`,title:`Add to queue (Enter)`,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`},children:(0,Y.jsxs)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Y.jsx)(`line`,{x1:`22`,y1:`2`,x2:`11`,y2:`13`}),(0,Y.jsx)(`polygon`,{points:`22 2 15 22 11 13 2 9 22 2`})]})}),(0,Y.jsx)(`button`,{id:`send-btn`,className:`stop-btn`,type:`button`,onClick:be,title:`Stop generating`,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`},children:(0,Y.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,Y.jsx)(`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,ry:`2`})})})]}):(0,Y.jsx)(`button`,{id:`send-btn`,type:`submit`,disabled:!zn,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`},children:(0,Y.jsxs)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Y.jsx)(`line`,{x1:`22`,y1:`2`,x2:`11`,y2:`13`}),(0,Y.jsx)(`polygon`,{points:`22 2 15 22 11 13 2 9 22 2`})]})})]}),Dn&&!En&&On&&(0,Y.jsx)(`p`,{className:`composer-voice-feedback`,role:`status`,children:On})]}),Rn.voiceMode&&(0,Y.jsx)(hE,{status:Rn.errorMessage?`error`:Rn.isRecording?Rn.isPaused?`paused`:Rn.isSpeaking?`speaking`:Rn.voiceAwaitingResponse?`thinking`:`listening`:`connecting`,userTranscript:Rn.userTranscript,assistantTranscript:Rn.assistantTranscript,isPaused:Rn.isPaused,analyserRef:Rn.analyserRef,onTogglePause:Rn.togglePause,onEndCall:()=>Rn.setVoiceMode(!1),voice:ge?.geminiLiveVoice||`Puck`,voices:at,pendingApproval:S,onApproval:he,onChangeVoice:async e=>{await Se(e),Rn.restart()}}),on.visible&&(0,Y.jsxs)(`div`,{className:`rewind-toast-banner ${on.type===`error`?`is-error`:`is-success`}`,children:[(0,Y.jsxs)(`div`,{className:`rewind-toast-content`,children:[on.type===`error`?(0,Y.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--status-error, #ef4444)`,strokeWidth:`2`,children:[(0,Y.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,Y.jsx)(`line`,{x1:`12`,y1:`8`,x2:`12`,y2:`12`}),(0,Y.jsx)(`line`,{x1:`12`,y1:`16`,x2:`12.01`,y2:`16`})]}):(0,Y.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--accent)`,strokeWidth:`2.2`,children:[(0,Y.jsx)(`path`,{d:`M22 11.08V12a10 10 0 1 1-5.93-9.14`}),(0,Y.jsx)(`polyline`,{points:`22 4 12 14.01 9 11.01`})]}),(0,Y.jsx)(`span`,{className:`rewind-toast-text`,children:on.message})]}),(0,Y.jsxs)(`div`,{className:`rewind-toast-actions`,children:[on.canUndo&&(0,Y.jsx)(`button`,{type:`button`,className:`rewind-toast-undo-btn`,onClick:ln,disabled:on.isUndoing,title:`Restore workspace files back from safety rescue snapshot`,children:on.isUndoing?`Undoing...`:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,children:[(0,Y.jsx)(`polyline`,{points:`9 14 4 9 9 4`}),(0,Y.jsx)(`path`,{d:`M20 20v-7a4 4 0 0 0-4-4H4`})]}),`Undo Rewind`]})}),(0,Y.jsx)(`button`,{type:`button`,className:`rewind-toast-close-btn`,onClick:()=>sn(e=>({...e,visible:!1})),"aria-label":`Close notification`,children:`✕`})]})]})]});return(0,Y.jsxs)(`div`,{ref:en,className:`chat-panel-split-wrapper ${vt||gt?`has-preview`:`no-preview`}`,style:{"--preview-width":`${(Xt*100).toFixed(2)}%`},children:[br,(vt||gt)&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`preview-split-resizer`,onMouseDown:tn,onDoubleClick:nn,title:`Drag to resize · Double-click to reset 50/50`,children:(0,Y.jsx)(`div`,{className:`preview-split-resizer-grip`})}),(0,Y.jsx)(J.Suspense,{fallback:null,children:gt?(0,Y.jsx)(mD,{title:gt.title,changes:gt.changes,workspacePath:E,onBack:()=>_t(null)}):vt?(0,Y.jsx)(fD,{artifact:vt,onClose:()=>yt(null),workspacePath:E}):null})]}),rn.isOpen&&(0,Y.jsx)(J.Suspense,{fallback:null,children:(0,Y.jsx)(pD,{isOpen:rn.isOpen,onClose:()=>an(e=>({...e,isOpen:!1})),onConfirm:cn,checkpoints:rn.checkpoints,targetCheckpoint:rn.targetCheckpoint,changes:rn.changes,workspacePath:E,isLoading:rn.isLoading})})]})}var J,Y,fD,pD,mD,hD,gD,_D,vD,yD,bD,xD,SD,CD,wD,TD=t((()=>{hx(),xx(),Ax(),Rx(),Hx(),Wx(),J=e(i()),px(),Kx(),Bt(),ct(),yS(),SS(),DS(),zS(),rC(),ib(),cC(),Ww(),Vw(),LC(),YC(),Jw(),jT(),Tt(),FT(),$T(),fE(),xE(),TE(),PE(),zE(),qb(),_b(),UE(),tD(),kb(),aD(),oD(),CS(),ke(),Y=a(),Ee(),fD=(0,J.lazy)(()=>P(()=>import(`./ArtifactPreviewPanel-Cx6BVOOF.js`).then(e=>({default:e.ArtifactPreviewPanel})),__vite__mapDeps([14,1,2,3,4,15]))),pD=(0,J.lazy)(()=>P(()=>import(`./RewindModal-B5oowrR0.js`).then(e=>({default:e.RewindModal})),__vite__mapDeps([16,1,2,17,3,4,18,19,20]))),mD=(0,J.lazy)(()=>P(()=>import(`./CodeReviewPage-Dp6zHuHu.js`),__vite__mapDeps([21,1,2,3,4,22,17,18,19,20,23]))),hD=32,{speechRequest:gD,startGeminiLiveSession:_D,sendGeminiLiveAudioChunk:vD,stopGeminiLiveSession:yD,listGitCheckpoints:bD,rollbackGitCheckpoint:xD,undoGitCheckpoint:SD}=Ae,{fetchProviderModels:CD}=ne,wD=()=>()=>{}})),ED=t((()=>{}));function DD(e,t){let n=t.getBoundingClientRect();return{x:Math.max(0,Math.min(1,(e.clientX-n.left)/n.width)),y:Math.max(0,Math.min(1,(e.clientY-n.top)/n.height))}}function OD(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),width:Math.abs(t.x-e.x),height:Math.abs(t.y-e.y)}}function kD({onClose:e,onAttach:t,capture:n,onLiveTranslate:r}){let[i,a]=(0,AD.useState)(``),[o,s]=(0,AD.useState)(!1),[c,l]=(0,AD.useState)(null),[u,d]=(0,AD.useState)(``),[f,p]=(0,AD.useState)(!1),[m,h]=(0,AD.useState)(`region`),[g,_]=(0,AD.useState)(!1),v=(0,AD.useRef)(null),y=(0,AD.useRef)(null),b=(0,AD.useRef)(null),x=(0,AD.useRef)(null);(0,AD.useEffect)(()=>{let t=document.activeElement instanceof HTMLElement?document.activeElement:null;x.current?.focus();let n=t=>{if(t.key===`Escape`&&e(),t.key!==`Tab`)return;let n=Array.from(b.current?.querySelectorAll(`button:not(:disabled)`)??[]);if(!n.length)return;let r=n[0],i=n[n.length-1];t.shiftKey&&document.activeElement===r?(t.preventDefault(),i.focus()):!t.shiftKey&&document.activeElement===i&&(t.preventDefault(),r.focus())};return window.addEventListener(`keydown`,n),()=>{window.removeEventListener(`keydown`,n),t?.focus()}},[e]);let S=async()=>{if(!f){p(!0),d(``),l(null),a(``),s(!1);try{let e=await n();if(!e.startsWith(`data:image/`))throw Error(`The screen capture returned no image.`);a(e)}catch(e){let t=e instanceof Error?e.message:String(e);d(t||`Screen capture failed. Please try again.`)}finally{p(!1)}}},C=e=>{if(m!==`region`||!i)return;let t=DD(e,e.currentTarget);v.current=t,l(null),e.currentTarget.setPointerCapture(e.pointerId)},w=e=>{v.current&&l(OD(v.current,DD(e,e.currentTarget)))},T=e=>{if(!v.current)return;let t=OD(v.current,DD(e,e.currentTarget));v.current=null,l(t.width>.003&&t.height>.003?t:null),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)};return(0,jD.jsx)(`div`,{ref:b,className:`screen-capture-dialog ${f?`is-capturing`:``}`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`screen-capture-title`,children:(0,jD.jsxs)(`div`,{className:`screen-capture-panel`,children:[(0,jD.jsxs)(`header`,{className:`screen-capture-header`,children:[(0,jD.jsxs)(`div`,{children:[(0,jD.jsx)(`p`,{className:`screen-capture-eyebrow`,children:`Mint Agent · Screen capture`}),(0,jD.jsx)(`h2`,{id:`screen-capture-title`,children:`Choose what Mint can see`}),(0,jD.jsx)(`p`,{children:`Only the image you attach will be included in your message.`})]}),(0,jD.jsx)(`button`,{ref:x,type:`button`,className:`screen-capture-close`,onClick:e,"aria-label":`Close screen capture`,children:`×`})]}),(0,jD.jsx)(`div`,{className:`screen-capture-body`,children:i?(0,jD.jsx)(`div`,{className:`screen-capture-stage`,children:(0,jD.jsxs)(`div`,{className:`screen-capture-image-wrap ${m===`region`?`is-selecting`:``}`,onPointerDown:C,onPointerMove:w,onPointerUp:T,onPointerCancel:T,children:[(0,jD.jsx)(`img`,{ref:y,src:i,alt:`Captured screen preview`,draggable:!1,onLoad:()=>s(!0),onError:()=>{a(``),d(`Unable to display the screenshot. Please capture it again.`)}}),m===`region`&&c&&(0,jD.jsx)(`div`,{className:`screen-capture-selection`,style:{left:`${c.x*100}%`,top:`${c.y*100}%`,width:`${c.width*100}%`,height:`${c.height*100}%`}})]})}):(0,jD.jsxs)(`div`,{className:`screen-capture-empty`,children:[(0,jD.jsx)(`span`,{className:`screen-capture-empty-icon`,"aria-hidden":`true`,children:`▣`}),(0,jD.jsx)(`h3`,{children:f?`Waiting for your screen…`:`Capture your screen`}),(0,jD.jsx)(`p`,{children:f?`Choose the screen or window in your system prompt.`:`You can review and crop it before attaching it to the chat.`}),!f&&(0,jD.jsx)(`button`,{type:`button`,className:`screen-capture-primary`,onClick:S,children:`Capture screen`})]})}),u&&(0,jD.jsx)(`p`,{className:`screen-capture-error`,role:`alert`,children:u}),(0,jD.jsxs)(`footer`,{className:`screen-capture-footer`,children:[(0,jD.jsxs)(`div`,{className:`screen-capture-modes`,role:`group`,"aria-label":`Capture area`,children:[(0,jD.jsx)(`button`,{type:`button`,className:m===`region`?`active`:``,onClick:()=>h(`region`),"aria-pressed":m===`region`,children:`Select area`}),(0,jD.jsx)(`button`,{type:`button`,className:m===`full`?`active`:``,onClick:()=>h(`full`),"aria-pressed":m===`full`,children:`Full screen`})]}),(0,jD.jsx)(`p`,{className:`screen-capture-instruction`,children:m===`region`?`Drag across the preview to select an area.`:`The entire captured image will be attached.`}),(0,jD.jsxs)(`div`,{className:`screen-capture-actions`,children:[r&&(0,jD.jsx)(`button`,{type:`button`,className:`screen-capture-secondary`,onClick:r,children:`Live translate`}),i&&(0,jD.jsx)(`button`,{type:`button`,className:`screen-capture-secondary`,onClick:S,disabled:f||g,children:`Retake`}),(0,jD.jsx)(`button`,{type:`button`,className:`screen-capture-secondary`,onClick:e,children:`Cancel`}),(0,jD.jsx)(`button`,{type:`button`,className:`screen-capture-primary`,onClick:()=>{if(i&&o&&!g&&(m!==`region`||c)){_(!0);try{if(m===`full`){t(i);return}let e=y.current;if(!e||!e.naturalWidth||!e.naturalHeight||!c)throw Error(`The screenshot is still loading. Please try again.`);let n=document.createElement(`canvas`),r=Math.floor(c.x*e.naturalWidth),a=Math.floor(c.y*e.naturalHeight);n.width=Math.max(1,Math.min(e.naturalWidth-r,Math.ceil(c.width*e.naturalWidth))),n.height=Math.max(1,Math.min(e.naturalHeight-a,Math.ceil(c.height*e.naturalHeight)));let o=n.getContext(`2d`);if(!o)throw Error(`Unable to prepare the selected image.`);o.drawImage(e,r,a,n.width,n.height,0,0,n.width,n.height),t(n.toDataURL(`image/png`))}catch(e){d(e instanceof Error?e.message:String(e)),_(!1)}}},disabled:!i||!o||f||g||m===`region`&&!c,children:`Attach to chat`})]})]})]})})}var AD,jD,MD=t((()=>{AD=e(i()),ED(),jD=a()}));function ND({view:e,sidebarCollapsed:t,sending:n,chatSessions:r,activeConversationId:i,onToggleSidebar:a,onSidebarResize:o,onSidebarResizeEnd:s,onClearHistory:c,onSelectConversation:d,onDeleteConversation:f,onRenameConversation:p,onSetView:m,isSearchOpen:h,onSetSearchOpen:_,showWorkspaceTab:y,promoteMediaStudios:b,activeWorkspacePath:x,recentWorkspacePaths:S,onBrowseFolder:C,onUpdateSessionWorkspace:w,onNewChatInProject:T}){let[E,D]=(0,PD.useState)(null),[O,k]=(0,PD.useState)(``),[A,ee]=(0,PD.useState)(!1),[te,j]=(0,PD.useState)(!1),[ne,re]=(0,PD.useState)(null),[M,ie]=(0,PD.useState)(null),[N,ae]=(0,PD.useState)(()=>{if(typeof window>`u`)return[];try{return JSON.parse(window.localStorage.getItem(`mint_removed_sidebar_projects`)||`[]`)}catch{return[]}}),[oe,se]=(0,PD.useState)(null),de=(0,PD.useRef)(null),fe=(0,PD.useRef)(null),pe=(0,PD.useRef)(null),he=(0,PD.useRef)(null),{user:ge,avatarUrl:ve,logout:ye}=me(),[be,xe]=(0,PD.useState)(!1),Se=(0,PD.useRef)(null);(0,PD.useEffect)(()=>{if(!be)return;let e=e=>{let t=Se.current;t&&(t.lastWidth=t.startWidth+(e.clientX-t.startX),t.frame??=requestAnimationFrame(()=>{Se.current&&(Se.current.frame=null,o?.(Se.current.lastWidth))}))},t=()=>{let e=Se.current;e?.frame!=null&&cancelAnimationFrame(e.frame),xe(!1),document.body.style.cursor=``,document.body.style.userSelect=``,e&&s?.(e.lastWidth),Se.current=null};return document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,window.addEventListener(`mousemove`,e),window.addEventListener(`mouseup`,t),()=>{window.removeEventListener(`mousemove`,e),window.removeEventListener(`mouseup`,t)}},[be,o,s]);let Ce=e=>{if(t)return;e.preventDefault();let n=he.current?.getBoundingClientRect().width??264;Se.current={startX:e.clientX,startWidth:n,lastWidth:n,frame:null},xe(!0)};(0,PD.useEffect)(()=>{function e(e){fe.current&&!fe.current.contains(e.target)&&ee(!1),pe.current&&!pe.current.contains(e.target)&&j(!1),de.current&&!de.current.contains(e.target)&&se(null),e.target.closest(`.sidebar-project-menu-popover, .sidebar-project-menu-trigger`)||re(null),e.target.closest(`.sidebar-conversation-menu-popover, .sidebar-conversation-menu-trigger`)||ie(null)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]);let we=e=>{O.trim()&&O.trim()!==r.find(t=>t.id===e)?.title&&p?.(e,O.trim()),D(null)},Te=r.filter(e=>e.kind!==`cli`&&!e.id.startsWith(`cli`)&&e.id!==`conversation-default`),Ee=r.filter(e=>e.kind===`cli`||e.id.startsWith(`cli`)),[De,P]=(0,PD.useState)(()=>{if(typeof window>`u`)return[];try{let e=localStorage.getItem(`mint_project_order`);return e?JSON.parse(e):[]}catch{return[]}}),[Oe,ke]=(0,PD.useState)(null),[Ae,je]=(0,PD.useState)(null),[Me,Ne]=(0,PD.useState)(null),Pe=(e,t)=>{e.dataTransfer.setData(`text/plain`,t),e.dataTransfer.effectAllowed=`move`,ke(t)},Fe=(e,t)=>{if(!Oe||Oe===t)return;e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=`move`;let n=e.currentTarget.getBoundingClientRect(),r=n.top+n.height/2,i=e.clientY<r?`before`:`after`;(Ae!==t||Me!==i)&&(je(t),Ne(i))},Ie=(e,t)=>{if(e.stopPropagation(),Ae===t){let t=e.relatedTarget;t&&e.currentTarget.contains(t)||(je(null),Ne(null))}},Le=(e,t)=>{if(e.preventDefault(),e.stopPropagation(),!Oe||Oe===t){ke(null),je(null),Ne(null);return}let n=Be.map(e=>e.id),r=[...De];for(let e of n)r.includes(e)||r.push(e);r=r.filter(e=>e!==Oe);let i=r.indexOf(t);if(i!==-1){let e=Me===`after`?i+1:i;r.splice(e,0,Oe)}else r.push(Oe);P(r);try{localStorage.setItem(`mint_project_order`,JSON.stringify(r))}catch(e){console.error(`Failed to save project order`,e)}ke(null),je(null),Ne(null)},ze=()=>{ke(null),je(null),Ne(null)},{projectGroups:Be,recentSessions:Ve}=(0,PD.useMemo)(()=>{let e=e=>{if(!e)return null;let t=e.replace(/[\\/]+$/,``).trim();if(!t)return null;let n=t.split(/[\\/]/);return{id:t,name:n[n.length-1]||t}},t=new Map,n=[],r=e(x);r&&!N.includes(r.id)&&t.set(r.id,{id:r.id,name:r.name,sessions:[]});for(let r of Te){let i=e(r.workspacePath||null);if(i){if(N.includes(i.id)){n.push(r);continue}t.has(i.id)||t.set(i.id,{id:i.id,name:i.name,sessions:[]}),t.get(i.id).sessions.push(r)}else n.push(r)}return{projectGroups:Array.from(t.values()).sort((e,t)=>{let n=De.indexOf(e.id),r=De.indexOf(t.id);return n!==-1&&r!==-1?n-r:n===-1?r===-1?e.name.localeCompare(t.name):1:-1}),recentSessions:n}},[Te,x,i,De,N]),He=(0,PD.useMemo)(()=>{let e=e=>{if(!e)return null;let t=e.replace(/[\\/]+$/,``).trim();if(!t)return null;let n=t.split(/[\\/]/);return{id:t,name:n[n.length-1]||t}},t=new Map;if(x&&!N.includes(x.replace(/[\\/]+$/,``).trim())){let n=e(x);n&&t.set(n.id,n.name)}for(let e of Be)N.includes(e.id)||t.set(e.id,e.name);if(S)for(let n of S){let r=e(n);r&&!N.includes(r.id)&&!t.has(r.id)&&t.set(r.id,r.name)}return Array.from(t.entries()).map(([e,t])=>({path:e,name:t}))},[Be,x,S,N]),Ue=(e,t)=>{if(e.stopPropagation(),e.preventDefault(),oe?.sessionId===t.id){se(null);return}let n=e.currentTarget.getBoundingClientRect(),r=Math.min(n.left,Math.max(10,window.innerWidth-220-10)),a=n.bottom+6;se({sessionId:t.id,currentWorkspacePath:t.workspacePath||(t.id===i&&x?x:null),top:a,left:r})},[We,Ke]=(0,PD.useState)(()=>{if(typeof window>`u`)return{};try{let e=localStorage.getItem(`mint_collapsed_projects`);return e?JSON.parse(e):{}}catch{return{}}}),[qe,Je]=(0,PD.useState)({}),Ye=e=>{Ke(t=>{let n={...t,[e]:!t[e]};try{localStorage.setItem(`mint_collapsed_projects`,JSON.stringify(n))}catch{}return n})},Xe=e=>{Je(t=>({...t,[e]:!t[e]}))},Ze=e=>{ae(t=>{let n=[...new Set([...t,e])];try{localStorage.setItem(`mint_removed_sidebar_projects`,JSON.stringify(n))}catch{}return n}),re(null)},[Qe,$e]=(0,PD.useState)(()=>typeof window<`u`?localStorage.getItem(`mint_last_cli_session_id`):null);(0,PD.useEffect)(()=>{if(i.startsWith(`cli`)||i===`cli`){$e(i);try{localStorage.setItem(`mint_last_cli_session_id`,i)}catch{}}},[i]);let et=i.startsWith(`cli`)||i===`cli`?i:Qe||Ee[0]?.id||null,tt=Ee.find(e=>e.id===et);return(0,X.jsxs)(`aside`,{className:`workspace-sidebar ${be?`is-resizing`:``}`,ref:he,children:[!t&&(0,X.jsx)(`div`,{className:`sidebar-resize-handle ${be?`is-active`:``}`,onMouseDown:Ce,title:`Drag to resize sidebar`}),(0,X.jsxs)(`div`,{className:`sidebar-brand clickable`,onClick:a,title:t?`Expand sidebar`:`Collapse sidebar`,role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&a()},children:[(0,X.jsx)(`img`,{src:g.appIconPath(),alt:`Mint Agent Logo`,className:`sidebar-logo`}),(0,X.jsx)(`span`,{className:`sidebar-brand-name`,children:`Mint Agent`})]}),(0,X.jsx)(`button`,{type:`button`,className:`sidebar-mobile-close`,"aria-label":`Close navigation menu`,onClick:a,children:(0,X.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,X.jsx)(`path`,{d:`M5 5l14 14M19 5L5 19`})})}),(0,X.jsxs)(`button`,{className:`sidebar-new-chat`,onClick:()=>c(`New chat`),title:`New chat (Ctrl+N)`,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,X.jsx)(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),(0,X.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})]})}),(0,X.jsx)(`span`,{children:`New chat`})]}),(0,X.jsxs)(`button`,{className:`sidebar-top-action sidebar-search-btn`,onClick:()=>_(!0),title:`Search chats (Ctrl+K)`,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,X.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,X.jsx)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})]})}),(0,X.jsx)(`span`,{children:`Search chats`})]}),(0,X.jsxs)(`button`,{className:`sidebar-top-action ${e===`chat`?`is-active`:``}`,onClick:()=>m(`chat`),title:`Chat`,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:(0,X.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,X.jsx)(`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`})})}),(0,X.jsx)(`span`,{children:`Chat`})]}),(0,X.jsxs)(`button`,{className:`sidebar-top-action ${e===`pictures`?`is-active`:``}`,onClick:()=>m(`pictures`),title:`Library`,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:(0,X.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,X.jsx)(`path`,{d:`M4 4v16M8 8v12M12 6v14M16 6l4 14`})})}),(0,X.jsx)(`span`,{children:`Library`})]}),b&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`button`,{className:`sidebar-top-action ${e===`imagine`?`is-active`:``}`,onClick:()=>m(`imagine`),children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:(0,X.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,X.jsx)(`polygon`,{points:`12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2`})})}),(0,X.jsx)(`span`,{children:`Image Studio`})]}),(0,X.jsxs)(`button`,{className:`sidebar-top-action ${e===`veo`?`is-active`:``}`,onClick:()=>m(`veo`),children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,X.jsx)(`rect`,{x:`2`,y:`2`,width:`20`,height:`20`,rx:`2.18`,ry:`2.18`}),(0,X.jsx)(`line`,{x1:`7`,y1:`2`,x2:`7`,y2:`22`}),(0,X.jsx)(`line`,{x1:`17`,y1:`2`,x2:`17`,y2:`22`}),(0,X.jsx)(`line`,{x1:`2`,y1:`12`,x2:`22`,y2:`12`}),(0,X.jsx)(`line`,{x1:`2`,y1:`7`,x2:`7`,y2:`7`}),(0,X.jsx)(`line`,{x1:`2`,y1:`17`,x2:`7`,y2:`17`}),(0,X.jsx)(`line`,{x1:`17`,y1:`17`,x2:`22`,y2:`17`}),(0,X.jsx)(`line`,{x1:`17`,y1:`7`,x2:`22`,y2:`7`})]})}),(0,X.jsx)(`span`,{children:`Veo Studio`})]})]}),y&&(0,X.jsxs)(`button`,{className:`sidebar-top-action ${e===`workspace`?`is-active`:``}`,onClick:()=>m(`workspace`),title:`Workspace`,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,X.jsx)(`path`,{d:`M3 6h7l2 2h9v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z`}),(0,X.jsx)(`path`,{d:`M3 6v12`})]})}),(0,X.jsx)(`span`,{children:`Workspace`})]}),(0,X.jsxs)(`div`,{className:`sidebar-more-container`,ref:fe,children:[(0,X.jsxs)(`button`,{className:`sidebar-top-action ${A||!b&&(e===`imagine`||e===`veo`)||e===`skills`||e===`mcp`||e===`plugins`||e===`cron`||e===`link`?`is-active`:``}`,onClick:()=>ee(!A),title:`More`,"aria-expanded":A,"aria-controls":`sidebar-more-menu`,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,X.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.5`}),(0,X.jsx)(`circle`,{cx:`19`,cy:`12`,r:`1.5`}),(0,X.jsx)(`circle`,{cx:`5`,cy:`12`,r:`1.5`})]})}),(0,X.jsx)(`span`,{children:`More`})]}),A&&(0,X.jsxs)(`div`,{id:`sidebar-more-menu`,className:`sidebar-more-popover`,style:{display:`flex`,flexDirection:`column`,gap:`4px`,padding:`6px`,minWidth:`160px`},children:[(0,X.jsxs)(`button`,{className:`popover-item ${e===`skills`?`active`:``}`,onClick:()=>{m(`skills`),ee(!1)},children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:gt(15)}),(0,X.jsx)(`span`,{children:`Skills`})]}),(0,X.jsxs)(`button`,{className:`popover-item ${e===`mcp`?`active`:``}`,onClick:()=>{m(`mcp`),ee(!1)},children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:Ct(15)}),(0,X.jsx)(`span`,{children:`MCP servers`})]}),(0,X.jsxs)(`button`,{className:`popover-item ${e===`plugins`?`active`:``}`,onClick:()=>{m(`plugins`),ee(!1)},children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:It(15)}),(0,X.jsx)(`span`,{children:`Plugins`})]}),(0,X.jsxs)(`button`,{className:`popover-item ${e===`cron`?`active`:``}`,onClick:()=>{m(`cron`),ee(!1)},children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:Ht(15)}),(0,X.jsx)(`span`,{children:`Scheduled tasks`})]}),(0,X.jsxs)(`button`,{className:`popover-item ${e===`link`?`active`:``}`,onClick:()=>{m(`link`),ee(!1)},children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:Ge(15)}),(0,X.jsx)(`span`,{children:`Linked folders`})]}),!b&&(0,X.jsxs)(`button`,{className:`popover-item ${e===`imagine`?`active`:``}`,onClick:()=>{m(`imagine`),ee(!1)},children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:(0,X.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,X.jsx)(`polygon`,{points:`12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2`})})}),(0,X.jsx)(`span`,{children:`Image Studio`})]}),!b&&(0,X.jsxs)(`button`,{className:`popover-item ${e===`veo`?`active`:``}`,onClick:()=>{m(`veo`),ee(!1)},children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,X.jsx)(`polygon`,{points:`23 7 16 12 23 17 23 7`}),(0,X.jsx)(`rect`,{x:`1`,y:`5`,width:`15`,height:`14`,rx:`2`,ry:`2`})]})}),(0,X.jsx)(`span`,{children:`Veo Studio`})]})]})]}),t?(0,X.jsxs)(`div`,{className:`sidebar-collapsed-sessions`,children:[(0,X.jsxs)(`button`,{type:`button`,className:`sidebar-collapsed-item ${e===`code`?`is-active`:``}`,onClick:()=>m(`code`),title:`Code sessions Hub`,"aria-label":`Code sessions Hub`,children:[(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.4`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,X.jsx)(`polyline`,{points:`4 17 10 11 4 5`}),(0,X.jsx)(`line`,{x1:`12`,y1:`19`,x2:`20`,y2:`19`})]}),e===`code`&&(0,X.jsx)(`span`,{className:`sidebar-collapsed-dot`})]}),tt&&(0,X.jsxs)(`button`,{type:`button`,className:`sidebar-collapsed-item ${tt.id===i&&e!==`code`?`is-active`:``}`,onClick:()=>d(tt.id),title:tt.title&&tt.title!==`cli`?tt.title:`Terminal Session`,"aria-label":tt.title&&tt.title!==`cli`?tt.title:`Terminal Session`,children:[(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.4`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,X.jsx)(`polyline`,{points:`4 17 10 11 4 5`}),(0,X.jsx)(`line`,{x1:`12`,y1:`19`,x2:`20`,y2:`19`})]}),tt.id===i&&e!==`code`&&(0,X.jsx)(`span`,{className:`sidebar-collapsed-dot`})]}),Te.slice(0,25).map(t=>{let n=t.id===i&&e!==`code`;return(0,X.jsxs)(`button`,{type:`button`,className:`sidebar-collapsed-item ${n?`is-active`:``}`,onClick:()=>d(t.id),title:t.title||`Chat`,"aria-label":t.title||`Chat`,children:[(0,X.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.4`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,X.jsx)(`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`})}),n&&(0,X.jsx)(`span`,{className:`sidebar-collapsed-dot`})]},t.id)})]}):(0,X.jsxs)(`div`,{className:`sidebar-section`,children:[(0,X.jsx)(`div`,{className:`sidebar-section-title`,children:`Code`}),(0,X.jsxs)(`div`,{className:`sidebar-chat-list sidebar-cli-list`,children:[(0,X.jsxs)(`button`,{className:`sidebar-project sidebar-chat-item ${e===`code`?`active`:``}`,onClick:()=>m(`code`),title:`Code sessions Hub`,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,X.jsx)(`polyline`,{points:`4 17 10 11 4 5`}),(0,X.jsx)(`line`,{x1:`12`,y1:`19`,x2:`20`,y2:`19`})]})}),(0,X.jsx)(`span`,{className:`sidebar-chat-title`,children:`Code hub`}),(0,X.jsx)(`span`,{style:{marginLeft:`auto`,fontSize:`0.72rem`,fontWeight:600,padding:`1px 6px`,borderRadius:`10px`,background:`var(--bg-surface-hover)`,color:`var(--text-muted, #94a3b8)`},children:Ee.length})]}),tt&&(0,X.jsxs)(`button`,{className:`sidebar-project sidebar-chat-item ${tt.id===i?`active`:``}`,onClick:()=>d(tt.id),title:tt.title||`Terminal Session`,style:{paddingLeft:`16px`},children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`,opacity:.85},children:(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,X.jsx)(`path`,{d:`M4 17l6-6-6-6`}),(0,X.jsx)(`path`,{d:`M12 19h8`})]})}),(0,X.jsx)(`span`,{className:`sidebar-chat-title`,children:tt.title&&tt.title!==`cli`?tt.title:tt.id===`cli`?`Terminal Session`:`cli::${tt.id.replace(/^cli::/,``).slice(0,7)}`}),tt.id===i&&n&&(0,X.jsx)(`span`,{className:`sidebar-generating-text`,children:`Thinking...`})]})]}),Be.length>0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`sidebar-section-title sidebar-subsection-title`,children:`Projects`}),(0,X.jsx)(`div`,{className:`sidebar-projects-list`,children:Be.map(e=>{let t=!!We[e.id],r=!!qe[e.id],a=e.sessions.length>3,o=r||!a?e.sessions:e.sessions.slice(0,3),s=Oe===e.id,c=Ae===e.id;return(0,X.jsxs)(`div`,{className:`sidebar-project-group ${s?`is-dragging`:``} ${c?Me===`before`?`drop-before`:`drop-after`:``}`,onDragOver:t=>Fe(t,e.id),onDragLeave:t=>Ie(t,e.id),onDrop:t=>Le(t,e.id),children:[(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,className:`sidebar-project-group-header`,onClick:()=>Ye(e.id),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),Ye(e.id))},title:`${e.name} (${e.id}) - Drag to reorder`,draggable:!0,onDragStart:t=>Pe(t,e.id),onDragEnd:ze,children:[(0,X.jsxs)(`span`,{className:`sidebar-project-group-left`,children:[(0,X.jsx)(`span`,{className:`sidebar-project-drag-grip`,title:`Drag to reorder`,"aria-hidden":`true`,children:(0,X.jsxs)(`svg`,{width:`8`,height:`12`,viewBox:`0 0 8 12`,fill:`currentColor`,children:[(0,X.jsx)(`circle`,{cx:`2`,cy:`2`,r:`1.2`}),(0,X.jsx)(`circle`,{cx:`6`,cy:`2`,r:`1.2`}),(0,X.jsx)(`circle`,{cx:`2`,cy:`6`,r:`1.2`}),(0,X.jsx)(`circle`,{cx:`6`,cy:`6`,r:`1.2`}),(0,X.jsx)(`circle`,{cx:`2`,cy:`10`,r:`1.2`}),(0,X.jsx)(`circle`,{cx:`6`,cy:`10`,r:`1.2`})]})}),(0,X.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`sidebar-project-folder-icon`,children:t?(0,X.jsx)(`path`,{d:`M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z`}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{d:`M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z`}),(0,X.jsx)(`polygon`,{points:`3 20 6 10 23 10 20 20 3 20`,fill:`currentColor`,fillOpacity:`0.15`})]})}),(0,X.jsx)(`span`,{className:`sidebar-project-group-name`,children:e.name})]}),(0,X.jsxs)(`span`,{className:`sidebar-project-group-right`,children:[(0,X.jsx)(`button`,{type:`button`,className:`sidebar-project-menu-trigger`,"aria-label":`Project actions for ${e.name}`,"aria-haspopup":`menu`,"aria-expanded":ne?.projectId===e.id,onClick:t=>{t.stopPropagation();let n=t.currentTarget.getBoundingClientRect();re(ne?.projectId===e.id?null:{projectId:e.id,top:Math.min(n.bottom+4,window.innerHeight-120),left:Math.max(8,Math.min(n.right-190,window.innerWidth-198))})},onKeyDown:e=>e.stopPropagation(),children:(0,X.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:[(0,X.jsx)(`circle`,{cx:`5`,cy:`12`,r:`1.8`}),(0,X.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.8`}),(0,X.jsx)(`circle`,{cx:`19`,cy:`12`,r:`1.8`})]})}),(0,X.jsx)(`span`,{className:`sidebar-project-group-count`,children:e.sessions.length}),(0,X.jsx)(`span`,{className:`sidebar-project-group-chevron`,style:{transform:t?`rotate(-90deg)`:`rotate(0deg)`,transition:`transform 0.18s ease`},children:(0,X.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,X.jsx)(`polyline`,{points:`6 9 12 15 18 9`})})})]})]}),ne?.projectId===e.id&&(0,X.jsxs)(`div`,{className:`sidebar-project-menu-popover`,role:`menu`,style:{top:ne.top,left:ne.left},onClick:e=>e.stopPropagation(),children:[T&&(0,X.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{Ke(t=>({...t,[e.id]:!1})),T(e.id),re(null)},children:[(0,X.jsx)(ue,{className:`sidebar-menu-icon`,size:14,"aria-hidden":`true`}),(0,X.jsx)(`span`,{children:`New chat in project`})]}),(0,X.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`is-destructive`,onClick:()=>Ze(e.id),children:[(0,X.jsx)(l,{className:`sidebar-menu-icon`,size:14,"aria-hidden":`true`}),(0,X.jsx)(`span`,{children:`Remove from sidebar`})]})]}),!t&&(0,X.jsxs)(`div`,{className:`sidebar-project-sessions`,children:[o.map(e=>(0,X.jsxs)(`button`,{className:`sidebar-project sidebar-chat-item is-indented ${e.id===i?`active`:``}`,onClick:()=>d(e.id),title:e.title,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:(0,X.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.3`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,X.jsx)(`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`})})}),E===e.id?(0,X.jsx)(`input`,{type:`text`,className:`sidebar-chat-rename-input`,value:O,onChange:e=>k(e.target.value),onBlur:()=>we(e.id),onKeyDown:t=>{t.key===`Enter`?we(e.id):t.key===`Escape`&&D(null)},autoFocus:!0,onClick:e=>e.stopPropagation()}):(0,X.jsx)(`span`,{className:`sidebar-chat-title`,children:e.title||`New chat`}),e.id===i&&n&&(0,X.jsx)(`span`,{className:`sidebar-generating-text`,children:`Thinking...`}),E!==e.id&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{role:`button`,tabIndex:0,className:`sidebar-conversation-menu-trigger`,"aria-label":`Actions for ${e.title||`conversation`}`,onClick:t=>{t.stopPropagation();let n=t.currentTarget.getBoundingClientRect();ie({sessionId:e.id,top:Math.min(n.bottom+4,window.innerHeight-120),left:Math.max(8,Math.min(n.right-190,window.innerWidth-198))})},onKeyDown:t=>{if(t.key===`Enter`||t.key===` `){t.preventDefault(),t.stopPropagation();let n=t.currentTarget.getBoundingClientRect();ie({sessionId:e.id,top:Math.min(n.bottom+4,window.innerHeight-120),left:Math.max(8,Math.min(n.right-190,window.innerWidth-198))})}},children:(0,X.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:[(0,X.jsx)(`circle`,{cx:`5`,cy:`12`,r:`1.8`}),(0,X.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.8`}),(0,X.jsx)(`circle`,{cx:`19`,cy:`12`,r:`1.8`})]})}),(0,X.jsx)(`span`,{className:`sidebar-chat-edit`,role:`button`,tabIndex:0,title:`Rename conversation`,onClick:t=>{t.stopPropagation(),D(e.id),k(e.title||``)},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),t.stopPropagation(),D(e.id),k(e.title||``))},children:(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.3`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,X.jsx)(`path`,{d:`M12 20h9`}),(0,X.jsx)(`path`,{d:`M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z`})]})}),w&&(0,X.jsx)(`span`,{className:`sidebar-chat-edit`,role:`button`,tabIndex:0,title:`Move conversation...`,onClick:t=>Ue(t,e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),Ue(t,e))},children:(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.3`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,X.jsx)(`path`,{d:`M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z`}),(0,X.jsx)(`polyline`,{points:`12 11 12 17`}),(0,X.jsx)(`polyline`,{points:`9 14 12 11 15 14`})]})}),(0,X.jsx)(`span`,{className:`sidebar-chat-delete`,role:`button`,tabIndex:0,title:`Delete conversation`,onClick:t=>{t.stopPropagation(),f(e.id)},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),t.stopPropagation(),f(e.id))},children:(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.3`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,X.jsx)(`polyline`,{points:`3 6 5 6 21 6`}),(0,X.jsx)(`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}),(0,X.jsx)(`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})]})})]})]},e.id)),a&&(0,X.jsxs)(`button`,{type:`button`,className:`sidebar-show-more-btn`,onClick:()=>Xe(e.id),children:[(0,X.jsx)(`span`,{children:r?`Show less`:`Show more (${e.sessions.length-3})`}),(0,X.jsx)(le,{className:r?`is-expanded`:``,size:13,"aria-hidden":`true`})]})]})]},e.id)})})]}),(Ve.length>0||Be.length===0)&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`sidebar-section-title sidebar-subsection-title`,children:Be.length>0?`Recents`:`Conversations`}),(0,X.jsx)(`div`,{className:`sidebar-chat-list`,children:Ve.map(e=>(0,X.jsxs)(`button`,{className:`sidebar-project sidebar-chat-item ${e.id===i?`active`:``}`,onClick:()=>d(e.id),title:e.title,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:(0,X.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,X.jsx)(`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`})})}),E===e.id?(0,X.jsx)(`input`,{type:`text`,className:`sidebar-chat-rename-input`,value:O,onChange:e=>k(e.target.value),onBlur:()=>we(e.id),onKeyDown:t=>{t.key===`Enter`?we(e.id):t.key===`Escape`&&D(null)},autoFocus:!0,onClick:e=>e.stopPropagation()}):(0,X.jsx)(`span`,{className:`sidebar-chat-title`,children:e.title||`New chat`}),e.id===i&&n&&(0,X.jsx)(`span`,{className:`sidebar-generating-text`,children:`Thinking...`}),E!==e.id&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{role:`button`,tabIndex:0,className:`sidebar-conversation-menu-trigger`,"aria-label":`Actions for ${e.title||`conversation`}`,onClick:t=>{t.stopPropagation();let n=t.currentTarget.getBoundingClientRect();ie({sessionId:e.id,top:Math.min(n.bottom+4,window.innerHeight-120),left:Math.max(8,Math.min(n.right-190,window.innerWidth-198))})},onKeyDown:t=>{if(t.key===`Enter`||t.key===` `){t.preventDefault(),t.stopPropagation();let n=t.currentTarget.getBoundingClientRect();ie({sessionId:e.id,top:Math.min(n.bottom+4,window.innerHeight-120),left:Math.max(8,Math.min(n.right-190,window.innerWidth-198))})}},children:(0,X.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:[(0,X.jsx)(`circle`,{cx:`5`,cy:`12`,r:`1.8`}),(0,X.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.8`}),(0,X.jsx)(`circle`,{cx:`19`,cy:`12`,r:`1.8`})]})}),(0,X.jsx)(`span`,{className:`sidebar-chat-edit`,role:`button`,tabIndex:0,title:`Rename conversation`,onClick:t=>{t.stopPropagation(),D(e.id),k(e.title||``)},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),t.stopPropagation(),D(e.id),k(e.title||``))},children:(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.3`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,X.jsx)(`path`,{d:`M12 20h9`}),(0,X.jsx)(`path`,{d:`M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z`})]})}),w&&(0,X.jsx)(`span`,{className:`sidebar-chat-edit`,role:`button`,tabIndex:0,title:`Move conversation...`,onClick:t=>Ue(t,e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),Ue(t,e))},children:(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.3`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,X.jsx)(`path`,{d:`M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z`}),(0,X.jsx)(`polyline`,{points:`12 11 12 17`}),(0,X.jsx)(`polyline`,{points:`9 14 12 11 15 14`})]})}),(0,X.jsx)(`span`,{className:`sidebar-chat-delete`,role:`button`,tabIndex:0,title:`Delete conversation`,onClick:t=>{t.stopPropagation(),f(e.id)},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),t.stopPropagation(),f(e.id))},children:(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.3`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,X.jsx)(`polyline`,{points:`3 6 5 6 21 6`}),(0,X.jsx)(`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}),(0,X.jsx)(`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})]})})]})]},e.id))})]})]}),ge&&(0,X.jsxs)(`div`,{className:`sidebar-account-container`,ref:pe,children:[te&&(0,X.jsxs)(`div`,{className:`sidebar-account-menu`,children:[ge.email&&(0,X.jsx)(`div`,{className:`sidebar-account-menu-header`,children:ge.email}),(0,X.jsxs)(`button`,{className:`popover-item`,onClick:()=>{window.api.openSettings(),j(!1)},children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,X.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,X.jsx)(`path`,{d:`M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z`})]})}),(0,X.jsx)(`span`,{children:`Settings`})]}),(0,X.jsxs)(`button`,{className:`popover-item ${e===`skills`?`active`:``}`,onClick:()=>{m(`skills`),j(!1)},children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:gt(15)}),(0,X.jsx)(`span`,{children:`Skills`})]}),(0,X.jsxs)(`button`,{className:`popover-item ${e===`mcp`?`active`:``}`,onClick:()=>{m(`mcp`),j(!1)},children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:Ct(15)}),(0,X.jsx)(`span`,{children:`MCP servers`})]}),(0,X.jsxs)(`button`,{className:`popover-item ${e===`plugins`?`active`:``}`,onClick:()=>{m(`plugins`),j(!1)},children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:It(15)}),(0,X.jsx)(`span`,{children:`Plugins`})]}),(0,X.jsxs)(`button`,{className:`popover-item ${e===`cron`?`active`:``}`,onClick:()=>{m(`cron`),j(!1)},children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:Ht(15)}),(0,X.jsx)(`span`,{children:`Scheduled tasks`})]}),(0,X.jsxs)(`button`,{className:`popover-item ${e===`link`?`active`:``}`,onClick:()=>{m(`link`),j(!1)},children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:Ge(15)}),(0,X.jsx)(`span`,{children:`Linked folders`})]}),(0,X.jsx)(`div`,{className:`sidebar-account-menu-divider`}),(0,X.jsxs)(`button`,{className:`popover-item`,onClick:()=>{j(!1),ye()},children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,X.jsx)(`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`}),(0,X.jsx)(`polyline`,{points:`16 17 21 12 16 7`}),(0,X.jsx)(`line`,{x1:`21`,y1:`12`,x2:`9`,y2:`12`})]})}),(0,X.jsx)(`span`,{children:`Log out`})]})]}),(0,X.jsxs)(`button`,{className:`sidebar-account`,onClick:()=>j(e=>!e),children:[(0,X.jsx)(`div`,{className:`sidebar-account-avatar`,children:ve?(0,X.jsx)(`img`,{src:ve,alt:ge.name||`User`}):(ge.name?.[0]||ge.email?.[0]||`U`).toUpperCase()}),(0,X.jsx)(`div`,{className:`sidebar-account-info`,children:(0,X.jsx)(`span`,{className:`sidebar-account-name`,children:ge.name||ge.email})}),(0,X.jsx)(`span`,{className:`sidebar-account-chevron`,"aria-hidden":`true`,children:(0,X.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,X.jsx)(`polyline`,{points:`18 15 12 9 6 15`})})})]})]}),oe&&(0,X.jsxs)(`div`,{ref:de,className:`sidebar-move-popover`,style:{position:`fixed`,top:`${oe.top}px`,left:`${oe.left}px`,zIndex:99999},onClick:e=>e.stopPropagation(),children:[(0,X.jsx)(`div`,{className:`sidebar-move-header`,children:`Move to Project`}),(0,X.jsx)(`div`,{className:`sidebar-move-list`,children:He.map(e=>{let t=oe.currentWorkspacePath===e.path;return(0,X.jsxs)(`button`,{type:`button`,className:`sidebar-move-item ${t?`is-current`:``}`,onClick:()=>{w?.(oe.sessionId,e.path),se(null)},title:e.path,children:[(0,X.jsx)(`span`,{className:`sidebar-move-item-icon`,children:(0,X.jsx)(ce,{size:14,"aria-hidden":`true`})}),(0,X.jsx)(`span`,{className:`sidebar-move-item-name`,children:e.name}),t&&(0,X.jsx)(`span`,{className:`sidebar-move-item-check`,children:(0,X.jsx)(u,{size:14,"aria-hidden":`true`})})]},e.path)})}),(0,X.jsx)(`div`,{className:`sidebar-move-divider`}),(0,X.jsxs)(`button`,{type:`button`,className:`sidebar-move-item ${oe.currentWorkspacePath?``:`is-current`}`,onClick:()=>{w?.(oe.sessionId,null),se(null)},children:[(0,X.jsx)(`span`,{className:`sidebar-move-item-icon`,children:(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.3`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,X.jsx)(`polyline`,{points:`9 14 4 9 9 4`}),(0,X.jsx)(`path`,{d:`M20 20v-7a4 4 0 0 0-4-4H4`})]})}),(0,X.jsx)(`span`,{className:`sidebar-move-item-name`,children:`Recents (No project)`}),!oe.currentWorkspacePath&&(0,X.jsx)(`span`,{className:`sidebar-move-item-check`,children:(0,X.jsx)(u,{size:14,"aria-hidden":`true`})})]}),C&&(0,X.jsxs)(`button`,{type:`button`,className:`sidebar-move-item`,onClick:async()=>{let e=await C();e&&w?.(oe.sessionId,e),se(null)},children:[(0,X.jsx)(`span`,{className:`sidebar-move-item-icon`,children:(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.3`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,X.jsx)(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),(0,X.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})]})}),(0,X.jsx)(`span`,{className:`sidebar-move-item-name`,children:`Choose folder...`})]})]}),M&&(()=>{let e=Te.find(e=>e.id===M.sessionId);return e?(0,X.jsxs)(`div`,{className:`sidebar-conversation-menu-popover`,role:`menu`,style:{top:M.top,left:M.left},onClick:e=>e.stopPropagation(),children:[(0,X.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{D(e.id),k(e.title||``),ie(null)},children:[(0,X.jsx)(_e,{className:`sidebar-menu-icon`,size:14,"aria-hidden":`true`}),(0,X.jsx)(`span`,{children:`Rename`})]}),w&&(0,X.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:t=>{ie(null),Ue(t,e)},children:[(0,X.jsx)(v,{className:`sidebar-menu-icon`,size:14,"aria-hidden":`true`}),(0,X.jsx)(`span`,{children:`Move to project`})]}),(0,X.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`is-destructive`,onClick:()=>{f(e.id),ie(null)},children:[(0,X.jsx)(Re,{className:`sidebar-menu-icon`,size:14,"aria-hidden":`true`}),(0,X.jsx)(`span`,{children:`Delete conversation`})]})]}):null})()]})}var PD,X,FD,ID=t((()=>{PD=e(i()),A(),ft(),Be(),ke(),X=a(),FD=(0,PD.memo)(ND)}));function LD({sidebarCollapsed:e,onToggleSidebar:t,onNewChat:n,onOpenWorkspace:r,onShowWorkspace:i,onOpenTerminal:a,onToggleTerminal:o,onOpenBrowser:s,toolsPanelOpen:c,backgroundTaskCount:l,onToggleToolsPanel:u,onOpenSettings:d,onCheckForUpdates:f,onShowAbout:p,workspacePath:m,workspaceActive:h,workspaceRevision:g,sending:_,onWorkspaceUndoError:v,onRefreshWorkspace:y}){let[b,x]=(0,RD.useState)(null),[S,C]=(0,RD.useState)(!1),[w,T]=(0,RD.useState)(!1),[E,D]=(0,RD.useState)(()=>Number(window.localStorage.getItem(`mint:ui-zoom`))||1),[O,k]=(0,RD.useState)(!1),[A,ee]=(0,RD.useState)(!1),te=(0,RD.useRef)(null),j=(0,RD.useRef)(null),ne=Pb(m,g,()=>y()),re=h&&!A,M=(0,RD.useRef)(v);M.current=v,(0,RD.useEffect)(()=>{ne.error&&M.current(ne.error)},[ne.error]),(0,RD.useEffect)(()=>{let e=!0;return P(async()=>{let{getCurrentWindow:e}=await import(`./window-CkUOP7t0.js`);return{getCurrentWindow:e}},__vite__mapDeps([24,1,25,26])).then(async({getCurrentWindow:t})=>{let n=t(),[r,i]=await Promise.all([n.isMaximized(),n.isFullscreen()]);e&&(C(r),T(i))}).catch(()=>{}),()=>{e=!1}},[]);let ie=()=>{P(async()=>{let{getCurrentWindow:e}=await import(`./window-CkUOP7t0.js`);return{getCurrentWindow:e}},__vite__mapDeps([24,1,25,26])).then(({getCurrentWindow:e})=>e().minimize()).catch(e=>console.error(`Failed to minimize Mint window:`,e))},N=()=>{P(async()=>{let{getCurrentWindow:e}=await import(`./window-CkUOP7t0.js`);return{getCurrentWindow:e}},__vite__mapDeps([24,1,25,26])).then(async({getCurrentWindow:e})=>{let t=e();await t.toggleMaximize(),C(await t.isMaximized())}).catch(e=>console.error(`Failed to toggle Mint window size:`,e))},ae=()=>{P(async()=>{let{getCurrentWindow:e}=await import(`./window-CkUOP7t0.js`);return{getCurrentWindow:e}},__vite__mapDeps([24,1,25,26])).then(async({getCurrentWindow:e})=>{let t=e(),n=!await t.isFullscreen();await t.setFullscreen(n),T(n)}).catch(e=>console.error(`Failed to toggle Mint fullscreen:`,e))},oe=e=>{let t=Math.min(1.5,Math.max(.8,Math.round(e*100)/100));D(t),window.localStorage.setItem(`mint:ui-zoom`,String(t))};(0,RD.useEffect)(()=>{E===1?document.documentElement.style.removeProperty(`zoom`):document.documentElement.style.setProperty(`zoom`,String(E))},[E]);let se=e=>e instanceof HTMLElement&&(e.isContentEditable||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement),ce=e=>{j.current?.isConnected&&j.current.focus(),(se(document.activeElement)||e===`copy`)&&document.execCommand(e)},le=async()=>{if(j.current?.isConnected&&j.current.focus(),se(document.activeElement))try{let e=await window.api.readClipboard();e&&document.execCommand(`insertText`,!1,e)}catch(e){console.warn(`Failed to paste clipboard text:`,e)}},ue=e=>{P(async()=>{let{getCurrentWindow:e}=await import(`./window-CkUOP7t0.js`);return{getCurrentWindow:e}},__vite__mapDeps([24,1,25,26])).then(({getCurrentWindow:t})=>t().startResizeDragging(e)).catch(e=>console.error(`Failed to start Mint window resize:`,e))};(0,RD.useEffect)(()=>{let e=e=>{e.target instanceof Node&&!te.current?.contains(e.target)&&x(null)},t=e=>{e.key===`Escape`&&x(null)};return window.addEventListener(`mousedown`,e),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`mousedown`,e),window.removeEventListener(`keydown`,t)}},[]),(0,RD.useEffect)(()=>{let e=()=>{let e=document.activeElement;if(e instanceof Node&&te.current?.contains(e))return;let t=se(e);t?j.current=e:j.current=null,ee(t)};return document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,e),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,e)}},[]),(0,RD.useEffect)(()=>{let e=e=>{let i=e.ctrlKey||e.metaKey,a=se(e.target);if(e.key===`F11`){e.preventDefault(),ae();return}if(!i||a)return;let c=e.key.toLowerCase();c===`z`&&!e.shiftKey&&h?(e.preventDefault(),!ne.busy&&!_&&ne.undo()):c===`n`?(e.preventDefault(),n()):c===`o`?(e.preventDefault(),r()):c===`b`&&e.shiftKey?(e.preventDefault(),s()):c===`b`?(e.preventDefault(),t()):c===`,`?(e.preventDefault(),d()):c===`/`?(e.preventDefault(),k(!0)):e.code===`Backquote`?(e.preventDefault(),o()):c===`+`||c===`=`?(e.preventDefault(),oe(E+.1)):c===`-`?(e.preventDefault(),oe(E-.1)):c===`0`&&(e.preventDefault(),oe(1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[E,n,r,s,d,t,o,h,ne.undo,ne.busy,_]);let de=e=>{e(),x(null)},fe={File:[{label:`New chat`,shortcut:`Ctrl+N`,action:n},{label:`Open workspace`,shortcut:`Ctrl+O`,action:r},{label:`New terminal`,shortcut:"Ctrl+Shift+`",action:a},{label:`Settings`,shortcut:`Ctrl+,`,action:d},{label:`Quit Mint`,shortcut:`Ctrl+Q`,action:()=>window.api.quitApp()}],Edit:[{label:re?ne.entries[0]?.label||`Undo workspace action`:`Undo`,shortcut:`Ctrl+Z`,disabled:re?!ne.entries.length||ne.busy||_:!A,action:async()=>{re?await ne.undo():ce(`undo`)}},{label:`Redo`,shortcut:`Ctrl+Shift+Z`,disabled:!A,action:()=>ce(`redo`)},{label:`Cut`,shortcut:`Ctrl+X`,disabled:!A,action:()=>ce(`cut`)},{label:`Copy`,shortcut:`Ctrl+C`,action:()=>ce(`copy`)},{label:`Paste`,shortcut:`Ctrl+V`,disabled:!A,action:le},{label:`Select all`,shortcut:`Ctrl+A`,disabled:!A,action:()=>ce(`selectAll`)}],View:[{label:e?`Show sidebar`:`Hide sidebar`,shortcut:`Ctrl+B`,action:t},{label:`Toggle terminal`,shortcut:"Ctrl+`",action:o},{label:`Open in default browser`,shortcut:`Ctrl+Shift+B`,action:s},{label:`Zoom in`,shortcut:`Ctrl++`,action:()=>oe(E+.1)},{label:`Zoom out`,shortcut:`Ctrl+-`,action:()=>oe(E-.1)},{label:`Reset zoom`,shortcut:`Ctrl+0`,disabled:E===1,action:()=>oe(1)},{label:w?`Exit fullscreen`:`Enter fullscreen`,shortcut:`F11`,action:ae}],Help:[{label:`Keyboard shortcuts`,shortcut:`Ctrl+/`,action:()=>k(!0)},{label:`Check for updates`,action:f},{label:`About Mint Agent`,action:p}]};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`header`,{className:`mint-titlebar`,ref:te,"aria-label":`Mint Agent window controls`,children:[(0,Z.jsxs)(`div`,{className:`mint-titlebar-left`,children:[(0,Z.jsx)(`button`,{className:`mint-titlebar-icon-button`,type:`button`,"aria-label":e?`Show sidebar`:`Hide sidebar`,title:e?`Show sidebar`:`Hide sidebar`,onClick:t,children:(0,Z.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,Z.jsx)(`rect`,{x:`3.5`,y:`4`,width:`17`,height:`16`,rx:`2`}),(0,Z.jsx)(`path`,{d:`M9 4v16`})]})}),(0,Z.jsx)(`button`,{className:`mint-titlebar-icon-button`,type:`button`,"aria-label":`Go back`,title:`Go back`,disabled:window.history.length<=1,onClick:()=>window.history.back(),children:(0,Z.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,Z.jsx)(`path`,{d:`m14.5 5-7 7 7 7M8 12h12`})})}),(0,Z.jsx)(`button`,{className:`mint-titlebar-icon-button`,type:`button`,"aria-label":`Go forward`,title:`Go forward`,onClick:()=>window.history.forward(),children:(0,Z.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,Z.jsx)(`path`,{d:`m9.5 5 7 7-7 7M16 12H4`})})}),(0,Z.jsx)(`span`,{className:`mint-titlebar-divider`,"aria-hidden":`true`}),(0,Z.jsx)(`nav`,{className:`mint-titlebar-menus`,"aria-label":`Application menu`,children:zD.map(e=>(0,Z.jsxs)(`div`,{className:`mint-titlebar-menu-wrap`,children:[(0,Z.jsx)(`button`,{type:`button`,className:`mint-titlebar-menu-button${b===e?` is-open`:``}`,"aria-haspopup":`menu`,"aria-expanded":b===e,onMouseDown:e=>e.preventDefault(),onClick:()=>x(t=>t===e?null:e),children:e}),b===e&&(0,Z.jsx)(`div`,{className:`mint-titlebar-menu`,role:`menu`,children:fe[e].map(e=>(0,Z.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:e.disabled,onMouseDown:e=>e.preventDefault(),onClick:()=>de(e.action),children:[(0,Z.jsx)(`span`,{children:e.label}),e.shortcut&&(0,Z.jsx)(`kbd`,{children:e.shortcut})]},e.label))})]},e))})]}),(0,Z.jsx)(`div`,{className:`mint-titlebar-drag-region`,"data-tauri-drag-region":!0,"aria-hidden":`true`,onDoubleClick:N}),(0,Z.jsx)(`button`,{className:`mint-titlebar-icon-button`,type:`button`,"aria-label":`Show workspace`,title:`Show workspace`,"aria-pressed":h,onClick:i,children:(0,Z.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,Z.jsx)(`path`,{d:`M4 6.5h6l1.7 2H20v9.5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z`}),(0,Z.jsx)(`path`,{d:`M4 6.5v-1a2 2 0 0 1 2-2h4l1.7 2H18a2 2 0 0 1 2 2v1`})]})}),(0,Z.jsx)(VE,{className:`mint-titlebar-icon-button mint-tools-panel-toggle`,open:c,count:l,onToggle:u}),(0,Z.jsxs)(`div`,{className:`mint-titlebar-window-controls`,children:[(0,Z.jsx)(`button`,{type:`button`,className:`mint-window-control`,"aria-label":`Minimize window`,title:`Minimize`,onClick:ie,children:(0,Z.jsx)(`svg`,{viewBox:`0 0 12 12`,"aria-hidden":`true`,children:(0,Z.jsx)(`path`,{d:`M2 6h8`})})}),(0,Z.jsx)(`button`,{type:`button`,className:`mint-window-control`,"aria-label":S?`Restore window`:`Maximize window`,title:S?`Restore`:`Maximize`,onClick:N,children:(0,Z.jsx)(`svg`,{viewBox:`0 0 12 12`,"aria-hidden":`true`,children:S?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`path`,{d:`M4 2.5h5.5V8`}),(0,Z.jsx)(`path`,{d:`M8 4H2.5v5.5H8z`})]}):(0,Z.jsx)(`rect`,{x:`2.5`,y:`2.5`,width:`7`,height:`7`,rx:`0.7`})})}),(0,Z.jsx)(`button`,{type:`button`,className:`mint-window-control is-close`,"aria-label":`Close window`,title:`Close`,onClick:()=>window.api.closeWindow(),children:(0,Z.jsx)(`svg`,{viewBox:`0 0 12 12`,"aria-hidden":`true`,children:(0,Z.jsx)(`path`,{d:`m3 3 6 6m0-6L3 9`})})})]})]}),O&&(0,Z.jsx)(`div`,{className:`mint-shortcuts-backdrop`,role:`presentation`,onMouseDown:()=>k(!1),children:(0,Z.jsxs)(`section`,{className:`mint-shortcuts-dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`mint-shortcuts-title`,onMouseDown:e=>e.stopPropagation(),children:[(0,Z.jsxs)(`header`,{children:[(0,Z.jsx)(`h2`,{id:`mint-shortcuts-title`,children:`Keyboard shortcuts`}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Close shortcuts`,onClick:()=>k(!1),children:`×`})]}),(0,Z.jsxs)(`dl`,{children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`New chat`}),(0,Z.jsx)(`dd`,{children:(0,Z.jsx)(`kbd`,{children:`Ctrl+N`})})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Open workspace`}),(0,Z.jsx)(`dd`,{children:(0,Z.jsx)(`kbd`,{children:`Ctrl+O`})})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Toggle sidebar`}),(0,Z.jsx)(`dd`,{children:(0,Z.jsx)(`kbd`,{children:`Ctrl+B`})})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Toggle terminal`}),(0,Z.jsx)(`dd`,{children:(0,Z.jsx)(`kbd`,{children:"Ctrl+`"})})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Open in default browser`}),(0,Z.jsx)(`dd`,{children:(0,Z.jsx)(`kbd`,{children:`Ctrl+Shift+B`})})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Settings`}),(0,Z.jsx)(`dd`,{children:(0,Z.jsx)(`kbd`,{children:`Ctrl+,`})})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Zoom`}),(0,Z.jsxs)(`dd`,{children:[(0,Z.jsx)(`kbd`,{children:`Ctrl++`}),` `,(0,Z.jsx)(`kbd`,{children:`Ctrl+-`}),` `,(0,Z.jsx)(`kbd`,{children:`Ctrl+0`})]})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Fullscreen`}),(0,Z.jsx)(`dd`,{children:(0,Z.jsx)(`kbd`,{children:`F11`})})]})]})]})}),(0,Z.jsx)(`div`,{className:`mint-window-resize-handles`,"aria-hidden":`true`,children:BD.map(e=>(0,Z.jsx)(`span`,{className:`mint-window-resize-handle is-${e.toLowerCase()}`,onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),ue(e)}},e))})]})}var RD,Z,zD,BD,VD=t((()=>{RD=e(i()),Rb(),UE(),Z=a(),Ee(),zD=[`File`,`Edit`,`View`,`Help`],BD=[`NorthWest`,`North`,`NorthEast`,`West`,`East`,`SouthWest`,`South`,`SouthEast`]})),HD=t((()=>{}));function UD({message:e,onDismiss:t}){let n=/HTTP\s+429\b|"code"\s*:\s*429/.test(e)?`The provider is temporarily rate-limited (HTTP 429). Wait briefly or select another model.`:e.includes(`invalid arguments for tool`)?`AI sent invalid tool arguments. Correct the arguments and try again.`:e.length>240?`${e.slice(0,240)}…`:e;return(0,WD.jsxs)(`section`,{className:`mint-error mint-error-notice`,role:`alert`,"aria-label":`Error notification`,children:[(0,WD.jsxs)(`div`,{className:`mint-error-notice-content`,children:[(0,WD.jsx)(`p`,{children:n}),n!==e&&(0,WD.jsxs)(`details`,{children:[(0,WD.jsx)(`summary`,{children:`Error details`}),(0,WD.jsxs)(`pre`,{children:[e.slice(0,12e3),e.length>12e3?`
|
|
105
|
+
… (details truncated)`:``]})]})]}),(0,WD.jsx)(`button`,{type:`button`,className:`mint-error-notice-close`,"aria-label":`Dismiss error`,onClick:t,children:(0,WD.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,WD.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,WD.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]})}var WD,GD=t((()=>{HD(),WD=a()})),KD=t((()=>{}));function qD({source:e}){let t=e.kind===`web`?e.faviconUrl:e.thumbnailDataUri,[n,r]=(0,YD.useState)(),i=e.kind===`web`?S:e.kind===`image`?p:e.kind===`video`?w:/\.(pdf|md|txt|docx?)$/i.test(e.name)?T:he;return(0,XD.jsx)(`span`,{className:`session-source-icon is-${e.kind}`,children:t&&t!==n?(0,XD.jsx)(`img`,{src:t,alt:``,loading:`lazy`,referrerPolicy:`no-referrer`,onError:()=>r(t)}):(0,XD.jsx)(i,{size:15,"aria-hidden":`true`})})}function JD({sources:e,loading:t,error:n,onRetry:r,onOpenLibrary:i,onOpenArtifact:a}){let[o,s]=(0,YD.useState)(``),[c,l]=(0,YD.useState)(null),u=[{label:`Images`,kinds:[`image`]},{label:`Files`,kinds:[`file`,`video`]},{label:`Web searches`,kinds:[`web`]}],d=o.trim().toLocaleLowerCase(),f=e.filter(e=>!d||[e.name,e.detail,e.url??``].some(e=>e.toLocaleLowerCase().includes(d))),p=async(e,t)=>{if(!(e.kind===`web`||t.button!==0||t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)){if(t.preventDefault(),e.kind===`image`&&a){if(c)return;l(e.id);try{let t=``,n=!1;if(e.libraryItemId)try{let r=await ee.readLibraryFile(e.libraryItemId,!1);t=URL.createObjectURL(r),n=!0}catch(e){console.warn(`Could not read full library file for source, falling back to thumbnail:`,e)}if(!t&&e.thumbnailDataUri&&(t=e.thumbnailDataUri,n=!1),t){a({path:`sources/${e.id}/${e.name}`,url:t,type:`image`,objectUrl:n});return}}finally{l(null)}}e.url&&i(e.url)}};return(0,XD.jsxs)(`section`,{className:`session-sources`,"aria-label":`Session sources`,children:[(0,XD.jsxs)(`header`,{className:`session-sources-heading`,children:[(0,XD.jsxs)(`span`,{children:[(0,XD.jsx)(k,{size:13,"aria-hidden":`true`}),`Sources `,(0,XD.jsx)(`small`,{children:`This session`})]}),(0,XD.jsx)(`span`,{children:e.length})]}),(e.length>8||o)&&(0,XD.jsxs)(`label`,{className:`session-sources-search`,children:[(0,XD.jsx)(h,{size:14,"aria-hidden":`true`}),(0,XD.jsx)(`input`,{type:`search`,"aria-label":`Search Sources`,placeholder:`Search Sources…`,value:o,onChange:e=>s(e.target.value)})]}),t&&(0,XD.jsx)(`p`,{className:`session-sources-empty`,role:`status`,children:`Loading session sources…`}),n&&(0,XD.jsxs)(`div`,{className:`session-sources-error`,role:`status`,children:[(0,XD.jsx)(`span`,{children:`Could not load saved sources.`}),(0,XD.jsx)(`button`,{type:`button`,onClick:r,children:`Retry`})]}),!t&&!n&&e.length===0&&(0,XD.jsx)(`p`,{className:`session-sources-empty`,children:`Images and files you send, and pages found by web search, will appear here.`}),e.length>0&&f.length===0&&(0,XD.jsx)(`p`,{className:`session-sources-empty`,role:`status`,children:`No sources match your search.`}),u.map(t=>{let n=f.filter(e=>t.kinds.includes(e.kind));return n.length?(0,XD.jsxs)(`div`,{className:`session-sources-group`,children:[(0,XD.jsxs)(`h3`,{children:[t.label,(0,XD.jsx)(`span`,{children:d?`${n.length} / ${e.filter(e=>t.kinds.includes(e.kind)).length}`:n.length})]}),(0,XD.jsx)(`ul`,{children:n.map(e=>{let t=(0,XD.jsxs)(XD.Fragment,{children:[(0,XD.jsx)(qD,{source:e}),(0,XD.jsxs)(`span`,{className:`session-source-copy`,children:[(0,XD.jsx)(`strong`,{children:e.name}),(0,XD.jsx)(`small`,{children:e.detail})]})]}),n=!!(e.url||e.kind===`image`&&a&&(e.libraryItemId||e.thumbnailDataUri)),r=c===e.id;return(0,XD.jsx)(`li`,{children:n?(0,XD.jsx)(`a`,{className:`session-source-row${r?` is-opening`:``}`,href:e.url||`#`,role:e.url?void 0:`button`,"aria-busy":r?`true`:void 0,target:e.kind===`web`?`_blank`:void 0,rel:e.kind===`web`?`noopener noreferrer`:void 0,title:e.kind===`image`&&a?`${e.name}\nOpen image preview in Tools`:`${e.name}\n${e.url||``}`,onClick:t=>void p(e,t),children:t}):(0,XD.jsx)(`div`,{className:`session-source-row`,title:e.name,children:t})},e.id)})})]},t.label):null})]})}var YD,XD,ZD=t((()=>{YD=e(i()),A(),ke(),KD(),XD=a()}));function QD(e,t=[]){let n=e.attachments.map(e=>({id:`attachment:${e.id}`,kind:e.kind,name:e.name,detail:e.trashed?`In Trash · Restore in Library`:e.availability===`missing`?`Original file missing`:e.kind===`image`?`Image`:e.kind===`video`?`Video`:e.name.split(`.`).length>1?e.name.split(`.`).at(-1).toUpperCase():`File`,url:e.libraryItemId?`/library?${new URLSearchParams({item:e.libraryItemId,...e.trashed?{trash:`1`}:{}})}`:void 0,interactionId:e.interactionId??void 0,thumbnailDataUri:e.thumbnailDataUri||void 0,libraryItemId:e.libraryItemId||void 0})),r=new Set,i=[],a=[...e.webSearchProgress,...t].filter(e=>e.type!==`ToolEnd`||!e.data.status||e.data.status===`success`);for(let e of dS(a)){let t=new URL(e.url);[`http:`,`https:`].includes(t.protocol)&&(t.hash=``,!r.has(t.href)&&(r.add(t.href),i.push({id:`web:${t.href}`,kind:`web`,name:e.title||e.domain,detail:e.domain,url:t.href,faviconUrl:e.faviconUrl})))}return[...n,...i]}var $D=t((()=>{yS()}));function eO(e,t){return e&&(t===null||t===`sources`)}function tO(e,t,n){let[r,i]=(0,nO.useState)(null),[a,o]=(0,nO.useState)(0),s=(0,nO.useCallback)(()=>o(e=>e+1),[]);(0,nO.useEffect)(()=>{if(!n)return;let t=!1,r=!1;i({chatId:e,value:null,error:``,loading:!0});let a=async()=>{if(!(r||document.hidden)){r=!0;try{let n=await Ae.getConversationSources(e);t||i({chatId:e,value:n,error:``,loading:!1})}catch(n){t||i(t=>({chatId:e,value:t?.chatId===e?t.value:null,error:String(n),loading:!1}))}finally{r=!1}}};a();let o=window.setInterval(()=>{a()},2e3);return()=>{t=!0,window.clearInterval(o)}},[n,e,a]);let c=r?.chatId===e?r:null;return{sources:(0,nO.useMemo)(()=>n?QD(c?.value??{attachments:[],webSearchProgress:[]},t):[],[n,c,t]),loading:n&&(!c||c.loading),error:c?.error||``,retry:s}}var nO,rO=t((()=>{nO=e(i()),ke(),$D()})),iO,aO=t((()=>{iO=class{revoke;urls=new Set;disposed=!1;constructor(e=e=>URL.revokeObjectURL(e)){this.revoke=e}accept(e){return!e.objectUrl||!e.url?!this.disposed:this.disposed?(this.revoke(e.url),!1):(this.urls.add(e.url),!0)}update(e){let t=new Set(e.filter(e=>e.objectUrl&&e.url).map(e=>e.url));for(let e of this.urls)t.has(e)||this.revoke(e);this.urls=t}dispose(){this.disposed=!0;for(let e of this.urls)this.revoke(e);this.urls.clear()}}}));function oO(e){let t=e.trim();if(!t.startsWith(`/`))return null;let n=t.search(/\s/);return n===-1?{command:t.toLowerCase(),rest:``}:{command:t.slice(0,n).toLowerCase(),rest:t.slice(n).trim()}}function sO(e){let t=oO(e);if(!t)return{handled:!1};let{command:n,rest:r}=t;switch(n){case`/image`:return{handled:!0,action:`open_image_picker`,payload:{pathOrPrompt:r}};case`/paste`:return{handled:!0,action:`paste_image`,payload:{prompt:r}};case`/resume`:return{handled:!0,action:`resume_session`,payload:{query:r}};case`/onboard`:return{handled:!0,action:`open_settings`};case`/voice`:return{handled:!0,action:`start_voice`,payload:{mode:r}};case`/veo`:return r?{handled:!0,action:`generate_veo`,payload:{prompt:r}}:{handled:!0,action:`system_message`,systemText:"⚠️ Usage: `/veo <prompt>`"};case`/n8n`:return{handled:!0,action:`system_message`,systemText:`🔗 **n8n** runs at http://localhost:5678 — open it in a browser tab. Wire it as an MCP server (Settings > Plugins) to drive workflows from chat.`};case`/notebook`:return{handled:!0,action:`system_message`,systemText:"📓 **SurfSense** runs at http://localhost:3929 — open it in a browser tab. Wire the `surfsense` MCP server (Settings > Plugins) to run tasks from chat."};case`/avatar`:return{handled:!0,action:`system_message`,systemText:"🧍 **Project Avatar** — use the CLI `/avatar link` to pair a Project Avatar viewer. The separate Mint Companion app connects locally to Mint for Live2D."};default:return{handled:!1}}}var cO=t((()=>{}));async function lO(){if(!navigator.mediaDevices?.getDisplayMedia)throw Error(`Screen sharing is unavailable in this browser. Use a supported desktop browser or attach an image file.`);let e=await navigator.mediaDevices.getDisplayMedia({video:!0,audio:!1});try{await new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(()=>e())));let t=document.createElement(`video`);if(t.srcObject=e,t.muted=!0,t.playsInline=!0,await new Promise((e,n)=>{let r=window.setTimeout(()=>n(Error(`The screen share did not produce a frame. Please try again.`)),8e3);t.addEventListener(`loadeddata`,()=>{window.clearTimeout(r),e()},{once:!0}),t.addEventListener(`error`,()=>{window.clearTimeout(r),n(Error(`Unable to read the shared screen.`))},{once:!0}),t.play().catch(e=>{window.clearTimeout(r),n(e)})}),!t.videoWidth||!t.videoHeight)throw Error(`The selected screen has no image.`);let n=document.createElement(`canvas`);n.width=t.videoWidth,n.height=t.videoHeight;let r=n.getContext(`2d`);if(!r)throw Error(`Unable to prepare the screenshot.`);return r.drawImage(t,0,0),n.toDataURL(`image/png`)}finally{e.getTracks().forEach(e=>e.stop())}}async function uO(){let{invoke:e}=await P(async()=>{let{invoke:e}=await import(`./core-Mi3s5D4_.js`).then(e=>(e.a(),e.i));return{invoke:e}},__vite__mapDeps([25,1]));return e(`capture_chat_screen`)}async function dO(e){return e&&navigator.userAgent.toLowerCase().includes(`linux`)?uO():lO()}var fO=t((()=>{Ee()}));function pO(e={}){return{workspacePath:``,message:``,imageAttachments:[],videoAttachments:[],documentAttachment:null,queuedPrompts:[],queuePaused:!1,sending:!1,sendingMessage:``,sendingImageCount:0,sendingVideoCount:0,streamedReply:``,streamedResponse:null,agentProgress:[],pendingApproval:null,...e}}function mO(e,t){switch(t.type){case`compose`:return{...e,message:t.message};case`workspace_selected`:return{...e,workspacePath:t.path};case`image_attached`:return e.imageAttachments.some(e=>e.name===t.image.name&&e.dataUri===t.image.dataUri)?e:{...e,imageAttachments:[...e.imageAttachments,t.image]};case`image_removed`:return{...e,imageAttachments:e.imageAttachments.filter((e,n)=>n!==t.index)};case`video_attached`:return e.videoAttachments.some(e=>e.name===t.video.name&&e.dataUri===t.video.dataUri)?e:{...e,videoAttachments:[...e.videoAttachments,t.video]};case`video_removed`:return{...e,videoAttachments:e.videoAttachments.filter((e,n)=>n!==t.index)};case`document_attached`:return{...e,documentAttachment:t.document};case`composer_cleared`:return{...e,message:``,imageAttachments:[],videoAttachments:[],documentAttachment:null};case`prompt_queued`:return{...e,message:``,imageAttachments:[],videoAttachments:[],documentAttachment:null,queuedPrompts:[...e.queuedPrompts,t.prompt],queuePaused:!1};case`queued_prompt_removed`:return{...e,queuedPrompts:e.queuedPrompts.filter(e=>e.id!==t.id)};case`queued_prompt_restored_to_composer`:return{...e,message:t.prompt.text,imageAttachments:t.prompt.imageAttachments||[],videoAttachments:t.prompt.videoAttachments||[],documentAttachment:t.prompt.documentAttachment||null,queuedPrompts:e.queuedPrompts.filter(e=>e.id!==t.prompt.id)};case`queued_prompt_dequeued`:return{...e,queuedPrompts:e.queuedPrompts.filter(e=>e.id!==t.id)};case`queued_prompts_cleared`:return{...e,queuedPrompts:[],queuePaused:!1};case`queue_paused_set`:return{...e,queuePaused:t.paused};case`queued_prompts_synced`:return{...e,queuedPrompts:t.prompts,queuePaused:t.paused};case`run_started`:return{...e,sending:!0,sendingMessage:t.message,sendingImageCount:t.imageCount,sendingVideoCount:t.videoCount,streamedReply:``,streamedResponse:null,agentProgress:[]};case`chunk_received`:return{...e,streamedReply:e.streamedReply+t.chunk};case`response_received`:return{...e,streamedResponse:t.response};case`progress_received`:return{...e,agentProgress:ix(e.agentProgress,t.progress)};case`progress_cleared`:return{...e,agentProgress:[]};case`stream_cleared`:return{...e,streamedReply:``,streamedResponse:null};case`approval_requested`:return{...e,pendingApproval:t.approval};case`approval_resolved`:return{...e,pendingApproval:null};case`run_finished`:return{...e,sending:!1,sendingMessage:``,sendingImageCount:0,sendingVideoCount:0};case`run_cancelled`:return{...e,sending:!1,sendingMessage:``,sendingImageCount:0,sendingVideoCount:0,streamedReply:``,streamedResponse:null,agentProgress:[],pendingApproval:null};case`session_switched`:return{...e,message:t.draft,imageAttachments:[],videoAttachments:[],documentAttachment:null,sending:!1,sendingMessage:``,sendingImageCount:0,sendingVideoCount:0,streamedReply:``,streamedResponse:null,agentProgress:[],pendingApproval:null}}}var hO=t((()=>{px()}));function gO(e,t){return t.some(t=>t.id===e)}function _O(e){return Date.parse(e.updatedAt)||Date.parse(e.createdAt)||0}async function vO(e,t,n=`chat`){let r=$t(e);if(!r||t.isCurrent?.()===!1)return;let i=await t.listSessions();if(t.isCurrent?.()===!1)return;let a=i.filter(e=>e.kind!==`cli`&&!e.id.startsWith(`cli`)&&e.id!==`conversation-default`&&!e.id.includes(`::subagent::`)&&$t(e.workspacePath)===r).sort((e,t)=>_O(t)-_O(e)||Date.parse(t.createdAt)-Date.parse(e.createdAt))[0];a?a.id===t.currentSessionId()?t.showCurrentView?.(n):await t.openSession(a,n):await t.newChat(r,n)}async function yO(e,t){if(t.isCurrent?.()===!1)return!1;let n=await t.listSessions();if(t.isCurrent?.()===!1)return!1;let r=n.find(t=>t.id===e);return r?(await t.openSession(r,`chat`),!0):!1}var bO=t((()=>{tn()}));function xO(e){let t=e.trim();return t.startsWith(`|`)&&t.endsWith(`|`)&&t.length>1}function SO(e){return TO.has(e.trim().toLowerCase())}function CO(e,t){if(!e)return[];let n=e.replace(/\r\n?/g,`
|
|
106
|
+
`),r=n;if(!t&&!n.endsWith(`
|
|
107
|
+
`)){let e=n.lastIndexOf(`
|
|
108
|
+
`);if(e===-1)return[];r=n.slice(0,e+1)}let i=r.endsWith(`
|
|
109
|
+
`)?r.slice(0,-1).split(`
|
|
110
|
+
`):r.split(`
|
|
111
|
+
`),a=[],o=!1,s=null,c=!1,l=[],u=[];for(let e of i){let t=e.trimStart();if(!o&&!c&&xO(t))u.push(e);else if(u.length>0&&(a.push(u.join(`
|
|
112
|
+
`)),u=[]),t.startsWith("```")){if(!o&&!c){let n=t.replace(/^`+/,``).trim();if(n.endsWith("```")&&n.length>3){a.push(e);continue}let r=n.search(/[\s[{]/),i=r>0?n.slice(0,r):n;SO(i)?(c=!0,l=[e]):(o=!0,s={fence:e,canPromote:!i||i.toLowerCase()===`plaintext`})}else c?(l.push(e),a.push(l.join(`
|
|
113
|
+
`)),l=[],c=!1):(o=!1,s?(a.push(`${s.fence}\n${e}`),s=null):a.push(e))}else if(c)l.push(e);else if(s){let{fence:n,canPromote:r}=s;s=null;let i=t.search(/[\s[{]/),u=i>0?t.slice(0,i):t;r&&SO(u)?(o=!1,c=!0,l=[n,e]):a.push(`${n}\n${e}`)}else a.push(e)}return t&&(u.length>0&&a.push(u.join(`
|
|
114
|
+
`)),s&&=(a.push(s.fence),null),l.length>0&&a.push(l.join(`
|
|
115
|
+
`))),a}function wO(e){let t=``,n=!1,r=0;return{pushDelta(e){e&&(t+=e)},finish(e){typeof e==`string`&&(t=e),n=!0},step(){let i=CO(t,n);if(r>=i.length)return null;let a=i.length-r,o=a<=12?1:Math.min(4,Math.max(1,Math.floor(a/10)));r=Math.min(i.length,r+o);let s=i.slice(0,r).join(`
|
|
116
|
+
`);return e?.(s),s},flushAll(){n=!0;let i=CO(t,!0);r=i.length;let a=i.join(`
|
|
117
|
+
`);return e?.(a),a},isDone(){if(!n)return!1;let e=CO(t,!0);return r>=e.length}}}var TO,EO=t((()=>{TO=new Set([`ui-grid`,`ui_grid`,`ui-grid-json`,`ui_grid_json`,`ui-card`,`ui_card`,`ui-card-json`,`ui_card_json`,`ui-feature`,`ui_feature`,`ui-mockup`,`ui_mockup`,`ui-mockup-json`,`ui_mockup_json`,`weather_json`,`weather-json`,`stock_json`,`stock-json`,`calculation_json`,`calculation-json`,`image_search_json`,`image-search-json`,`image_gen_json`,`image-gen-json`,`mermaid`])}));function DO(e){return e?{historyMs:1500,sessionsMs:5e3}:{historyMs:5e3,sessionsMs:15e3}}function OO(e,t,n,r={},i){let a={...pO(t),conversationId:e,interactions:[],hasOlderInteractions:!1,agentActivitySnapshots:{},chatSessions:[],streamingConversationId:null,activeTurnId:null,pendingApprovals:{},sessionAutoApproved:!1},o={chatId:e},s=null,c=0,l=0,u=0,d=null,f=new Map,p=new Map,m=new Set,h=new Map,g=new Map,_=e=>{a={...a,...e},m.forEach(e=>e())},v=e=>_(mO(a,e)),y=e=>e.session===o&&p.get(o.chatId)===e,b=e=>{e.timer!==void 0&&clearTimeout(e.timer),e.timer=void 0},x=e=>{e.streamTimer!==void 0&&clearTimeout(e.streamTimer),e.streamTimer=void 0},S=e=>{if(x(e),!y(e))return;let t=e.pacer.step();t!==null&&(_({streamedReply:t}),e.pacer.isDone()||(e.streamTimer=setTimeout(()=>S(e),18)))},C=e=>{b(e);let t=e.queuedProgress;e.queuedProgress=[],y(e)&&t.length&&v({type:`progress_received`,progress:t})},w=(e,t)=>{if(!a.pendingApprovals[e]||t&&a.pendingApprovals[e].token!==t)return;let n={...a.pendingApprovals};delete n[e],_({pendingApprovals:n})};function T(e,t){if(o.chatId===e)return;try{i?.write(o.chatId,a.message)}catch{}if(t===void 0)try{t=i?.read(e)??``}catch{t=``}let n=p.get(o.chatId);n&&(b(n),n.queuedProgress=[],n.autoApprove=!1),o={chatId:e},s=null,u++;let r=h.get(e)||[],c=g.get(e)||!1;_({...mO(a,{type:`session_switched`,draft:t}),conversationId:e,queuedPrompts:r,queuePaused:c,interactions:[],hasOlderInteractions:!1,agentActivitySnapshots:{},streamingConversationId:null,activeTurnId:null,sessionAutoApproved:!1})}async function E(){let e=o,t=++c;try{let r=await n.getConversationSnapshot(e.chatId,null,50);if(e!==o||t!==c||s!==null&&s>r.cursor)return;s=r.cursor,_({interactions:r.interactions,hasOlderInteractions:r.interactions.length>0&&r.hasOlder,agentActivitySnapshots:sx(a.agentActivitySnapshots,r.interactions)})}catch(n){if(e===o&&t===c)throw n}}async function D(){let e=++l,t=await n.listChatSessions();return e===l&&(a.chatSessions.length===t.length&&a.chatSessions.every((e,n)=>e.id===t[n]?.id&&e.updatedAt===t[n]?.updatedAt&&e.title===t[n]?.title&&e.workspacePath===t[n]?.workspacePath&&e.messageCount===t[n]?.messageCount&&e.totalBytes===t[n]?.totalBytes)||_({chatSessions:t})),t}async function O(e=()=>!0){let t=o;if(d!==t&&e()){d=t;try{if(s===null){await E();return}let r=!1;for(let i=0;i<10;i++){let i=await n.getConversationChanges(t.chatId,s,100);if(t!==o||!e()||s!==null&&s>i.cursor)return;if(s=i.cursor,i.changes.length){r=!0;let e=new Map(a.interactions.map(e=>[e.id,e])),t={...a.agentActivitySnapshots};for(let n of i.changes)n.interaction?(e.set(n.interactionId,n.interaction),Array.isArray(n.interaction.agentActivity)&&(t[String(n.interactionId)]=n.interaction.agentActivity)):(e.delete(n.interactionId),delete t[String(n.interactionId)]);let n=Array.from(e.values()).sort((e,t)=>e.id-t.id);_({interactions:n,agentActivitySnapshots:t,hasOlderInteractions:n.length>0&&a.hasOlderInteractions})}if(!i.hasMore)break}r&&t===o&&e()&&await D()}catch{}finally{d===t&&(d=null)}}}async function k(){let e=o,t=a.interactions[0]?.id;if(t==null)return;let r=s,i;try{i=await n.getConversationSnapshot(e.chatId,t,50)}catch(t){if(e===o)throw t;return}if(e!==o||r!==s)return;let c=new Map([...i.interactions,...a.interactions].map(e=>[e.id,e]));_({interactions:Array.from(c.values()).sort((e,t)=>e.id-t.id),hasOlderInteractions:i.hasOlder})}function A(e,t){p.get(e)?.autoApprove&&!BS(t.approval)?n.submitToolApproval(t.token,!0).catch(e=>r.onError?.(e)):(_({pendingApprovals:{...a.pendingApprovals,[e]:t}}),r.onApproval?.(t,e))}async function ee(e,t=!1,i){let s=o,c=a.pendingApprovals[s.chatId];if(!c)return;let l=p.get(s.chatId),u=l?.autoApprove??!1,d=t&&l&&!BS(c.approval);d&&(l.autoApprove=!0,_({sessionAutoApproved:!0}));try{await n.submitToolApproval(c.token,e,i),w(s.chatId,c.token)}catch(e){d&&p.get(s.chatId)===l&&(l.autoApprove=u,s===o&&_({sessionAutoApproved:u})),s===o&&r.onError?.(e)}}async function te(){let e=o,t=p.get(e.chatId);if(!a.sending||!t||!y(t))return;p.delete(e.chatId),b(t),x(t);let i=a.pendingApprovals[e.chatId]?.token;try{await n.cancelChatMessage(e.chatId)}catch(t){e===o&&r.onError?.(t)}finally{i&&w(e.chatId,i),g.set(e.chatId,!0),e===o&&!p.has(e.chatId)&&_({...mO(a,{type:`run_cancelled`}),queuePaused:!0,streamingConversationId:null,activeTurnId:null,sessionAutoApproved:!1})}}async function j(e,t={}){if(a.sending)return;let i=o,s={session:i,turnId:null,autoApprove:!1,progress:[],queuedProgress:[],pacer:wO()};p.set(i.chatId,s);let c=t.imageAttachments??[],l=t.videoAttachments??[],u=t.agentMode||t.forceAgentMode||e.toLowerCase().startsWith(`search web:`),d=a.workspacePath||null;_({...mO(a,{type:`run_started`,message:e,imageCount:c.length,videoCount:l.length}),streamingConversationId:i.chatId,activeTurnId:null,sessionAutoApproved:!1});let b={message:a.message,images:a.imageAttachments,videos:a.videoAttachments,document:a.documentAttachment},T=(e,t)=>`${e}:${t.length}:${t.slice(0,64)}:${t.slice(-32)}`,O=t.documentAttachment,k=[e,c.map(e=>T(e.name,e.dataUri)).join(`|`),l.map(e=>T(e.name,e.dataUri)).join(`|`),O?T(O.filename,O.dataUri):``].join(`\0`),ee=f.get(i.chatId);ee?.signature!==k&&(ee={signature:k,requestId:globalThis.crypto?.randomUUID?.()??`submission-${Date.now().toString(36)}-${Array.from(globalThis.crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,`0`)).join(``)}`},f.set(i.chatId,ee));let te={requestId:ee.requestId,imageNames:c.map(e=>e.name),videoNames:l.map(e=>e.name)},ne=()=>{f.get(i.chatId)?.requestId===te.requestId&&f.delete(i.chatId),t.clearComposer&&y(s)&&a.message===b.message&&a.imageAttachments===b.images&&a.videoAttachments===b.videos&&a.documentAttachment===b.document&&v({type:`composer_cleared`})};try{let o=await n.streamChatMessage(u?e:`/chat ${e}`,e=>{if(p.get(i.chatId)!==s||(s.pacer.pushDelta(e),!y(s)))return;let t=null;for(let e=0;e<2;e++){let e=s.pacer.step();if(e===null)break;t=e}t!==null&&(_({streamedReply:t}),s.streamTimer===void 0&&(s.streamTimer=setTimeout(()=>S(s),18)))},c.map(e=>e.dataUri).join(` `),t.audioDataUri??null,l.map(e=>e.dataUri).join(` `),t.systemInstruction??``,e=>{p.get(i.chatId)===s&&(s.progress.push(e),y(s)&&(s.queuedProgress.push(e),e.type===`ThinkingDelta`?s.timer===void 0&&(s.timer=setTimeout(()=>C(s),75)):C(s)))},t.documentAttachment??null,d,i.chatId,void 0,u?t.planMode:!1,t.pinnedMcpServer??null,e=>{p.get(i.chatId)===s&&A(i.chatId,e)},e=>{s.turnId=e,ne(),y(s)&&_({activeTurnId:e})},te);if(o.provider!==`error`&&ne(),C(s),x(s),s.pacer.finish(o.text),y(s)){let e=s.pacer.step();if(e!==null&&_({streamedReply:e,streamedResponse:o}),!(typeof globalThis.vi?.isFakeTimers==`function`&&globalThis.vi.isFakeTimers()))for(;!s.pacer.isDone()&&p.get(i.chatId)===s&&y(s)&&(await new Promise(e=>{s.streamTimer=setTimeout(()=>{s.streamTimer=void 0,e()},18)}),p.get(i.chatId)===s&&y(s));){let e=s.pacer.step();if(e!==null)_({streamedReply:e,streamedResponse:o});else break}p.get(i.chatId)===s&&y(s)&&_({streamedReply:s.pacer.flushAll(),streamedResponse:o})}await r.onReply?.(o,i.chatId);let f=ax(s.progress);if(f.length&&s.turnId!==null&&(await n.saveInteractionAgentActivity(s.turnId,f),y(s)&&(_({agentActivitySnapshots:{...a.agentActivitySnapshots,[String(s.turnId)]:f.slice()}}),r.onActivityPersisted?.(s.turnId))),y(s))try{await E()}catch(e){r.onError?.(e)}await D(),await r.onRunCompleted?.(),y(s)&&(r.onVisibleRunCompleted?.(i.chatId),v({type:`stream_cleared`}))}catch(e){y(s)&&r.onError?.(e)}finally{if(C(s),x(s),p.get(i.chatId)===s){let e=y(s);w(i.chatId),p.delete(i.chatId),e?_({...mO(a,{type:`run_finished`}),streamingConversationId:null,activeTurnId:null,sessionAutoApproved:!1}):m.forEach(e=>e());let n=g.get(i.chatId)||!1,r=h.get(i.chatId)||[];if(!n&&r.length>0){let e=r.shift();h.set(i.chatId,r),i===o&&v({type:`queued_prompt_dequeued`,id:e.id}),j(e.text,{imageAttachments:e.imageAttachments,videoAttachments:e.videoAttachments,documentAttachment:e.documentAttachment,agentMode:t.agentMode,planMode:t.planMode})}}}}async function ne(){let e=o;try{if(await n.clearChatHistory(e.chatId),e!==o)return;let t=p.get(e.chatId);t&&b(t),p.delete(e.chatId),o={chatId:e.chatId},s=null,w(e.chatId),_({...mO(a,{type:`session_switched`,draft:``}),interactions:[],hasOlderInteractions:!1,agentActivitySnapshots:{},streamingConversationId:null,activeTurnId:null,sessionAutoApproved:!1})}catch(t){if(e===o)throw t}}async function re(e){let t=o;try{a.sending&&p.has(t.chatId)&&await te();let r=a.interactions.filter(t=>t.id<e),i={...a.agentActivitySnapshots};for(let t of a.interactions)t.id>=e&&delete i[String(t.id)];_({interactions:r,agentActivitySnapshots:i,activeTurnId:null}),await n.truncateInteractionsFrom(t.chatId,e)}catch(e){if(t===o)throw e}}async function M(e,t,n={}){await re(e),await j(t,n)}async function ie(e,t,n){let i=o,a=++u,s=()=>i===o&&a===u;try{let r=await e();r&&s()&&await vO(r,{...t,listSessions:D,currentSessionId:()=>o.chatId,isCurrent:s},n)}catch(e){s()&&r.onError?.(e)}}function N(e,t){let n=!0,r=a.sending||p.size>0,i,o,s=()=>n&&e.document.visibilityState===`visible`,c=()=>{t&&s()&&O(s)},l=()=>{s()&&D().catch(()=>{})},u=()=>{c(),l()},d=()=>{if(i!==void 0&&e.window.clearInterval(i),o!==void 0&&e.window.clearInterval(o),!n)return;let a=DO(r);i=t?e.window.setInterval(c,a.historyMs):void 0,o=e.window.setInterval(l,a.sessionsMs)},f=()=>{let e=a.sending||p.size>0;e!==r&&(r=e,d(),r&&(c(),l()))};return m.add(f),c(),d(),e.window.addEventListener(`focus`,u),e.document.addEventListener(`visibilitychange`,u),()=>{n=!1,m.delete(f),i!==void 0&&e.window.clearInterval(i),o!==void 0&&e.window.clearInterval(o),e.window.removeEventListener(`focus`,u),e.document.removeEventListener(`visibilitychange`,u)}}function ae(e){let t={id:`q-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`,chatId:o.chatId,text:e.text,imageAttachments:e.imageAttachments&&e.imageAttachments.length>0?[...e.imageAttachments]:void 0,videoAttachments:e.videoAttachments&&e.videoAttachments.length>0?[...e.videoAttachments]:void 0,documentAttachment:e.documentAttachment||null,createdAt:Date.now()},n=h.get(o.chatId)||[];h.set(o.chatId,[...n,t]),g.set(o.chatId,!1),v({type:`prompt_queued`,prompt:t})}function oe(e){let t=h.get(o.chatId)||[];h.set(o.chatId,t.filter(t=>t.id!==e)),v({type:`queued_prompt_removed`,id:e})}function se(e){let t=h.get(o.chatId)||[],n=t.find(t=>t.id===e);n&&(h.set(o.chatId,t.filter(t=>t.id!==e)),v({type:`queued_prompt_restored_to_composer`,prompt:n}))}function ce(){h.delete(o.chatId),g.set(o.chatId,!1),v({type:`queued_prompts_cleared`})}function le(e){g.set(o.chatId,e),v({type:`queue_paused_set`,paused:e})}function ue(){if(le(!1),!a.sending){let e=h.get(o.chatId)||[],t=e[0];t&&(h.set(o.chatId,e.slice(1)),v({type:`queued_prompt_dequeued`,id:t.id}),j(t.text,{imageAttachments:t.imageAttachments,videoAttachments:t.videoAttachments,documentAttachment:t.documentAttachment}))}}async function de(e){let t=o,n=h.get(t.chatId)||[],r=n.find(t=>t.id===e);r&&(h.set(t.chatId,n.filter(t=>t.id!==e)),g.set(t.chatId,!1),t===o&&(v({type:`queued_prompt_dequeued`,id:e}),v({type:`queue_paused_set`,paused:!1})),a.sending&&p.has(t.chatId)&&await te(),j(r.text,{imageAttachments:r.imageAttachments,videoAttachments:r.videoAttachments,documentAttachment:r.documentAttachment}))}return{getSnapshot:()=>a,subscribe:e=>(m.add(e),()=>{m.delete(e)}),activate:T,refreshHistory:E,refreshSessions:D,syncHistory:O,loadOlder:k,sendPrompt:j,cancel:te,receiveApproval:A,resolveApproval:ee,clearHistory:ne,selectProject:ie,watch:N,truncateFrom:re,resendFromInteraction:M,queuePrompt:ae,removeQueuedPrompt:oe,editQueuedPrompt:se,clearQueuedPrompts:ce,setQueuePaused:le,resumeQueue:ue,steerQueuedPrompt:de,appendInteraction:e=>_({interactions:[...a.interactions,{chatId:o.chatId,status:`completed`,...e}]}),compose:e=>v({type:`compose`,message:e}),selectWorkspace:e=>v({type:`workspace_selected`,path:e}),attachImage:e=>v({type:`image_attached`,image:e}),removeImage:e=>v({type:`image_removed`,index:e}),attachVideo:e=>v({type:`video_attached`,video:e}),removeVideo:e=>v({type:`video_removed`,index:e}),attachDocument:e=>v({type:`document_attached`,document:e}),clearComposer:()=>v({type:`composer_cleared`})}}var kO=t((()=>{hO(),px(),qS(),bO(),EO()}));function AO(e,t,n=Ae){let r=(0,jO.useRef)(t);r.current=t;let[i]=(0,jO.useState)(()=>OO(t.conversationId,e,n,{onError:e=>r.current.onError?.(e),onApproval:(e,t)=>r.current.onApproval?.(e,t),onReply:(e,t)=>r.current.onReply?.(e,t),onActivityPersisted:e=>r.current.onActivityPersisted?.(e),onRunCompleted:()=>r.current.onRunCompleted?.(),onVisibleRunCompleted:e=>r.current.onVisibleRunCompleted?.(e)},{read:e=>window.localStorage.getItem(`${r.current.draftKeyPrefix}${e}`)||``,write:(e,t)=>{let n=`${r.current.draftKeyPrefix}${e}`;t?window.localStorage.setItem(n,t):window.localStorage.removeItem(n)}})),a=(0,jO.useRef)(null),o=()=>{let e=i.getSnapshot(),t=a.current;if(t&&t!==e){let n=t.message!==e.message;if(n){for(let r of Object.keys(e))if(r!==`message`&&t[r]!==e[r]){n=!1;break}}if(n)return t}return a.current=e,e},s=(0,jO.useSyncExternalStore)(i.subscribe,o,o);return(0,jO.useEffect)(()=>i.watch({window,document},t.historyVisible),[i,t.historyVisible,s.conversationId]),(0,jO.useEffect)(()=>{let e,t=i.subscribe(()=>{let t=i.getSnapshot();e!==void 0&&window.clearTimeout(e),e=window.setTimeout(()=>{try{let e=`${r.current.draftKeyPrefix}${t.conversationId}`;t.message?window.localStorage.setItem(e,t.message):window.localStorage.removeItem(e)}catch{}},300)});return()=>{t(),e!==void 0&&window.clearTimeout(e)}},[i]),(0,jO.useEffect)(()=>{try{s.workspacePath?window.localStorage.setItem(t.workspaceStorageKey,s.workspacePath):window.localStorage.removeItem(t.workspaceStorageKey)}catch{}},[s.workspacePath,t.workspaceStorageKey]),{conversation:s,actions:i}}var jO,MO=t((()=>{jO=e(i()),kO(),ke()})),NO=t((()=>{}));function PO({workspacePath:e,panelTarget:t,onCountChange:n}){let[r,i]=(0,FO.useState)([]),[a,o]=(0,FO.useState)({workspace:void 0,ids:new Set}),s=!!t,l=(0,FO.useRef)(s);l.current=s;let u=(0,FO.useRef)(r);u.current=r;let[d,p]=(0,FO.useState)(!1),[m,h]=(0,FO.useState)(null),[_,v]=(0,FO.useState)(null),[y,b]=(0,FO.useState)(``),[x,S]=(0,FO.useState)(``),[C,w]=(0,FO.useState)(!0),[T,E]=(0,FO.useState)(``),[D,O]=(0,FO.useState)(!0),[k,A]=(0,FO.useState)(new Set),ee=(0,FO.useRef)(null),te=(0,FO.useRef)(new Map);(0,FO.useEffect)(()=>{let t=!1,n=!1,r;w(!0);let a=e=>{t||(r!==void 0&&window.clearTimeout(r),r=window.setTimeout(()=>void s(),HO(l.current,e)))},s=async()=>{if(n||document.hidden){a(u.current);return}n=!0;let r=u.current;try{let n=await f.list();if(t)return;r=n;let a=VO(n,e),s=``;for(let e of n){let t=te.current.get(e.id);t&&(t===`running`||t===`stopping`)&&!RO(e)&&(s=`${BO(e.workspacePath)} · ${e.id}: ${e.status}${e.exitCode===null?``:` (exit ${e.exitCode})`}`),te.current.set(e.id,e.status)}s&&E(s),i(n),o({workspace:e,ids:new Set(a.map(e=>e.id))}),b(``)}catch(e){if(!t){let t=String(e);b(`Status unavailable · ${t}`),/401:|403:/.test(t)&&(r=[],i([]),v(null),te.current.clear())}}finally{n=!1,t||(w(!1),a(r))}};s();let c=()=>{document.hidden||s()};return document.addEventListener(`visibilitychange`,c),()=>{t=!0,r!==void 0&&window.clearTimeout(r),document.removeEventListener(`visibilitychange`,c)}},[e,s]),(0,FO.useEffect)(()=>{if(!s||!m){v(null);return}let e=!1,t=!1;v(null),S(``),O(!0);let n=async()=>{if(!(t||document.hidden)){t=!0;try{let t=await f.output(m);e||(v(t),S(``))}catch(t){e||S(String(t))}finally{t=!1}}};n();let r=window.setInterval(()=>void n(),1e3);return document.addEventListener(`visibilitychange`,n),()=>{e=!0,window.clearInterval(r),document.removeEventListener(`visibilitychange`,n)}},[s,m]),(0,FO.useEffect)(()=>{D&&ee.current&&(ee.current.scrollTop=ee.current.scrollHeight)},[_,D]),(0,FO.useEffect)(()=>{if(!T)return;let e=window.setTimeout(()=>E(``),6e3);return()=>window.clearTimeout(e)},[T]),(0,FO.useEffect)(()=>{h(null),p(!1)},[e]);let j=r.filter(t=>a.workspace===e&&a.ids.has(t.id)),ne=j.filter(RO).length;(0,FO.useEffect)(()=>{n(ne)},[ne,n]);let re=d?r:j,M=async e=>{S(``);try{if(g.isTauriRuntime()){let{invoke:t}=await P(async()=>{let{invoke:e}=await import(`./core-Mi3s5D4_.js`).then(e=>(e.a(),e.i));return{invoke:e}},__vite__mapDeps([25,1]));await t(`run_desktop_action`,{action:{type:`open_url`,target:e}})}else if(!window.open(e,`_blank`,`noopener,noreferrer`))throw Error(`The browser blocked the new tab`)}catch(e){S(`Could not open browser: ${String(e)}`)}},ie=async e=>{A(t=>new Set(t).add(e.id)),S(``);try{let t=await f.stop(e.id);i(n=>n.map(n=>n.id===e.id?t:n))}catch(e){S(String(e))}finally{A(t=>{let n=new Set(t);return n.delete(e.id),n})}},N=async e=>{A(t=>new Set(t).add(e.id)),S(``);try{await f.delete(e.id),i(t=>t.filter(t=>t.id!==e.id)),m===e.id&&h(null),te.current.delete(e.id)}catch(e){S(String(e))}finally{A(t=>{let n=new Set(t);return n.delete(e.id),n})}},ae=!!g.isTauriRuntime()||[`localhost`,`127.0.0.1`,`[::1]`].includes(window.location.hostname);return(0,LO.jsxs)(LO.Fragment,{children:[T&&(0,LO.jsx)(`span`,{className:`background-task-announcement`,role:`status`,children:T}),t&&(0,IO.createPortal)((0,LO.jsxs)(`section`,{className:`background-terminals background-terminal-panel`,"aria-label":`Background tasks`,children:[(0,LO.jsxs)(`header`,{className:`background-terminal-panel-header`,children:[(0,LO.jsx)(`span`,{className:`background-terminal-heading-icon`,"aria-hidden":`true`,children:`›_`}),(0,LO.jsxs)(`span`,{className:`background-terminal-panel-title`,children:[(0,LO.jsx)(`strong`,{children:`Background tasks`}),(0,LO.jsx)(`small`,{children:d?`All workspaces`:BO(e||``)||`No workspace`})]})]}),T&&(0,LO.jsx)(`p`,{children:T}),(0,LO.jsxs)(`label`,{className:`background-terminal-filter`,children:[(0,LO.jsx)(`input`,{type:`checkbox`,checked:d,onChange:e=>{p(e.target.checked),h(null)}}),` All workspaces`]}),y&&(0,LO.jsx)(`p`,{role:`status`,className:`background-terminal-error`,children:y}),x&&(0,LO.jsx)(`p`,{role:`alert`,className:`background-terminal-error`,children:x}),(0,LO.jsxs)(`div`,{className:`background-terminal-list`,children:[!re.length&&(0,LO.jsxs)(`div`,{className:`background-terminal-empty`,role:`status`,children:[(0,LO.jsx)(`span`,{"aria-hidden":`true`,children:`›_`}),(0,LO.jsx)(`strong`,{children:C?`Loading tasks…`:y?`Waiting for connection…`:`No background tasks`}),!C&&!y&&(0,LO.jsx)(`small`,{children:`Commands started in the background will appear here.`})]}),[...re].reverse().map(e=>(0,LO.jsxs)(`article`,{className:`background-terminal-job`,children:[(0,LO.jsxs)(`div`,{className:`background-terminal-job-heading`,children:[(0,LO.jsx)(`strong`,{children:e.id}),(0,LO.jsx)(`span`,{className:`background-terminal-state ${e.status}`,children:e.status}),(0,LO.jsx)(`span`,{children:zO(e.elapsedSeconds)})]}),(0,LO.jsx)(`code`,{title:e.command,children:e.command}),(0,LO.jsxs)(`small`,{children:[BO(e.workspacePath),` · `,e.cwd,e.exitCode===null?``:` · exit ${e.exitCode}`]}),e.error&&(0,LO.jsx)(`small`,{className:`background-terminal-error`,children:e.error}),(0,LO.jsxs)(`div`,{className:`background-terminal-actions`,children:[(0,LO.jsx)(`button`,{type:`button`,onClick:()=>{h(e.id),O(!0)},children:`View output`}),e.serverUrl&&(ae?(0,LO.jsx)(`button`,{type:`button`,onClick:()=>void M(e.serverUrl),children:`Open browser`}):(0,LO.jsxs)(`small`,{children:[`Backend-local address: `,e.serverUrl,` · unavailable from this device`]})),!RO(e)&&(0,LO.jsx)(`button`,{type:`button`,className:`background-terminal-delete`,"aria-label":`Remove terminal ${e.id}`,title:`Remove terminal`,disabled:k.has(e.id),onClick:()=>void N(e),children:(0,LO.jsx)(Re,{size:14,"aria-hidden":`true`})}),RO(e)&&(0,LO.jsx)(`button`,{type:`button`,className:`background-terminal-stop`,disabled:!!y||k.has(e.id)||e.status===`stopping`,onClick:()=>void ie(e),children:e.status===`stopping`||k.has(e.id)?`Stopping…`:`Stop`})]})]},e.id))]}),m&&(0,LO.jsxs)(`section`,{"aria-label":`Output for ${m}`,className:`background-terminal-output`,children:[(0,LO.jsxs)(`header`,{children:[(0,LO.jsxs)(`strong`,{children:[m,` · output`]}),(0,LO.jsxs)(`label`,{children:[(0,LO.jsx)(`input`,{type:`checkbox`,checked:D,onChange:e=>O(e.target.checked)}),` Follow`]}),(0,LO.jsx)(`button`,{type:`button`,"aria-label":`Close terminal output`,title:`Close output`,onClick:()=>h(null),children:(0,LO.jsx)(c,{size:14,"aria-hidden":`true`})})]}),_?.truncated&&(0,LO.jsx)(`small`,{children:`Older output was truncated.`}),(0,LO.jsx)(`div`,{ref:ee,className:`background-terminal-log`,onWheel:e=>{e.deltaY<0&&O(!1)},onKeyDown:e=>{[`PageUp`,`ArrowUp`,`Home`].includes(e.key)&&O(!1)},onScroll:e=>{let t=e.currentTarget;t.scrollHeight-t.scrollTop-t.clientHeight>30&&O(!1)},tabIndex:0,children:_?(0,LO.jsxs)(LO.Fragment,{children:[(0,LO.jsx)(`strong`,{children:`stdout`}),(0,LO.jsx)(`pre`,{children:_.stdout||`(empty)`}),(0,LO.jsx)(`strong`,{children:`stderr`}),(0,LO.jsx)(`pre`,{children:_.stderr||`(empty)`})]}):(0,LO.jsx)(`p`,{children:x?`Output unavailable.`:`Loading output…`})})]})]}),t)]})}var FO,IO,LO,RO,zO,BO,VO,HO,UO=t((()=>{FO=e(i()),IO=Ne(),A(),ke(),NO(),LO=a(),Ee(),RO=e=>e.status===`running`||e.status===`stopping`,zO=e=>`${Math.floor(e/60).toString().padStart(2,`0`)}:${(e%60).toString().padStart(2,`0`)}`,BO=e=>e.split(/[\\/]/).filter(Boolean).pop()||e,VO=(e,t)=>t?e.filter(e=>e.workspacePath===t):[],HO=(e,t)=>e||t.some(RO)?3e3:1e4}));function WO(e){return{proactiveSuggestion:null,dismissProactiveSuggestion:()=>{},handleProactiveAction:async e=>{}}}var GO=t((()=>{}));function KO(){if(typeof window>`u`)return[];try{let e=JSON.parse(window.localStorage.getItem(Hk)||`[]`);return Array.isArray(e)?[...new Set(e.filter(e=>typeof e==`string`&&!!e.trim()))].slice(0,Uk):[]}catch{return[]}}function qO(){if(typeof window<`u`)try{window.localStorage.setItem(Gk,Date.now().toString())}catch{}}function JO(){if(typeof window>`u`||!yk())return!1;let e=window.localStorage.getItem(Gk);if(!e)return!1;let t=parseInt(e,10);if(isNaN(t)||t<=0)return!1;let n=Date.now(),r=n-t;return r<0||r>Kk?!1:new Date(t).toDateString()===new Date(n).toDateString()}function YO(e){if(!e)return``;try{return window.localStorage.getItem(`${qk}${e}`)||``}catch{return``}}function XO(){let e=Math.random().toString(36).slice(2,10);return`conversation-${Date.now().toString(36)}-${e}`}function ZO(){if(typeof window>`u`)return null;let e=window.location.pathname||``,t=(window.location.hash||``).replace(/^#/,``),n=e||t,r=n.match(/^\/chat\/(.+)$/i)||n.match(/^\/c\/(.+)$/i);return r&&r[1]?decodeURIComponent(r[1]):new URLSearchParams(window.location.search).get(`id`)||null}function QO(){if(typeof window>`u`)return!0;let e=(window.location.pathname||``).replace(/\/+$/,``),t=(window.location.hash||``).replace(/^#\/?/,``).replace(/\/+$/,``),n=(e||t).toLowerCase();return ZO()||n.includes(`skills`)||n.includes(`mcp`)||n.includes(`plugins`)||n.includes(`picture`)||n.includes(`image-studio`)||n.includes(`imagine`)||n.includes(`veo-studio`)||n.includes(`veo`)||n.includes(`code`)||n===`/cli`||n===`cli`||n.includes(`cli-sessions`)||n.includes(`settings`)?!1:!n||n===``||n===`/chat`||n===`chat`||n===`/index.html`||n===`index.html`}function $O(){let e=ZO();if(e)return window.localStorage.setItem(Wk,e),qO(),e;if(yk()&&JO()){let e=window.localStorage.getItem(Wk);if(e)return qO(),e===`conversation-default`?`cli`:e}if(QO()){let e=XO();return qO(),e}let t=window.localStorage.getItem(Wk);if(t===`conversation-default`)return window.localStorage.setItem(Wk,`cli`),qO(),`cli`;if(t)return qO(),t;let n=XO();return qO(),n}function ek(){return(0,$.jsx)(`div`,{className:`auth-gate-loading`,style:{minHeight:160},children:`Loading panel…`})}function tk(){if(typeof window>`u`)return`chat`;let e=(window.location.hash||``).toLowerCase().replace(/^#/,``),t=(window.location.pathname||``).toLowerCase(),n=e||t;return n.includes(`skills`)?`skills`:n.includes(`mcp`)?`mcp`:n.includes(`plugins`)?`plugins`:n.includes(`picture`)||n.includes(`library`)?`pictures`:n.includes(`image-studio`)||n.includes(`imagine`)?`imagine`:n.includes(`veo-studio`)||n.includes(`veo`)?`veo`:n.includes(`code`)||n===`/cli`||n===`cli`||n.includes(`cli-sessions`)?`code`:`chat`}function nk(e,t){return e===`skills`?`/skills`:e===`mcp`?`/mcp`:e===`plugins`?`/plugins`:e===`pictures`?`/library`:e===`imagine`?`/image-studio`:e===`veo`||e===`veo_studio`?`/veo-studio`:e===`code`?`/code`:e===`settings`?`/settings`:t?`/chat/${encodeURIComponent(t)}`:`/chat`}function rk(e,t=120){let n=e.replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t)}…`:n}function ik(e){let t=Object.entries(e?.approval??{})[0],n=t?.[0],r=t?.[1];switch(n){case`WriteFile`:return`Write to ${r?.path}?`;case`ApplyPatch`:return`Edit ${r?.path}?`;case`RunShell`:return`Run: ${r?.command}`;case`NoteWrite`:return`Save note to ${r?.path}?`;case`RunPlugin`:return`Run plugin: ${r?.name}?`;case`McpTool`:return`Use ${r?.tool} on ${r?.server}?`;case`UserApproval`:return r?.title??`Approval needed`;case`AskUser`:return r?.question??`Mint has a question`;case`ExitPlanMode`:case`EnterPlanMode`:return`Plan mode change needs approval`;default:return`Mint needs your approval to continue`}}function ak(){let e=yk(),[t,n]=(0,Q.useState)(tk),[r]=(0,Q.useState)($O),{conversation:i,actions:a}=AO({workspacePath:window.localStorage.getItem(Vk)||``,message:YO(r)},{conversationId:r,draftKeyPrefix:qk,workspaceStorageKey:Vk,historyVisible:t===`chat`,onError:e=>me(qt(e)),onApproval:(e,t)=>ye(e,t),onReply:(e,t)=>{if(document.hidden||!document.hasFocus())return ve(e.text||`Mint finished your request.`,t)},onActivityPersisted:e=>{let t=String(e);xe(e=>({...e,...Se.current?{[t]:!0}:{},...we.current?{[`extended-${t}`]:!0}:{}}))},onRunCompleted:async()=>{hk().then(fe).catch(()=>{})},onVisibleRunCompleted:e=>{let t=(window.location.pathname||``).replace(/\/+$/,``),n=(window.location.hash||``).replace(/^#\/?/,``).replace(/\/+$/,``),r=(t||n).toLowerCase();r&&r!==`/chat`&&r!==`chat`&&r!==`/index.html`&&r!==`index.html`||window.history.replaceState({},``,`/chat/${encodeURIComponent(e)}`)}}),{conversationId:o,workspacePath:s,message:c,imageAttachments:l,videoAttachments:u,documentAttachment:d,queuedPrompts:f,queuePaused:p,sending:m,sendingMessage:h,sendingImageCount:_,sendingVideoCount:v,streamedReply:y,streamedResponse:b,agentProgress:S,interactions:C,hasOlderInteractions:w,streamingConversationId:T,activeTurnId:E,agentActivitySnapshots:D,pendingApprovals:O,sessionAutoApproved:k,chatSessions:A}=i,ee=e=>{a.activate(e)},[te,j]=(0,Q.useState)(!1),[ne,re]=(0,Q.useState)(!1);(0,Q.useEffect)(()=>{if(!te)return;let e=e=>{e.key===`Escape`&&j(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[te]);let[M,ie]=(0,Q.useState)(0),[N,ae]=(0,Q.useState)(KO);function oe(e){let t=en([e,...KO()]).slice(0,Uk);try{window.localStorage.setItem(Hk,JSON.stringify(t))}catch{}ae(t)}(0,Q.useEffect)(()=>{s.trim()&&oe(s)},[s]);async function se(){let e=await vk();return e&&oe(e),e}let ce=(t,r)=>{j(!1),n(n=>{let i=typeof t==`function`?t(n):t;if(i===`settings`)return window.api?.openSettings?window.api.openSettings():window.location.pathname!==`/settings`&&window.history.pushState({},``,`/settings`),n;let a=i===`veo_studio`?`veo`:i,s=!e&&a===`workspace`?`chat`:a,c=nk(s,r||o);return typeof window<`u`&&window.location.pathname!==c&&window.history.pushState({},``,c),s})},le=(0,Q.useRef)(0);(0,Q.useEffect)(()=>()=>{le.current+=1},[]);let ue=(0,Q.useRef)(async()=>{});ue.current=async e=>{let t=++le.current;try{!await yO(e,{listSessions:pk,openSession:(e,t)=>F(e.id,e,t),isCurrent:()=>le.current===t})&&le.current===t&&(me(`This conversation no longer exists. Choose another conversation.`),ce(`chat`),j(!0))}catch(e){le.current===t&&me(qt(e))}},(0,Q.useEffect)(()=>{let e=()=>{le.current+=1,(window.location.hash===`#`||window.location.hash===`#/`)&&window.history.replaceState({},``,window.location.pathname+window.location.search);let e=(window.location.pathname||``).toLowerCase(),t=(window.location.hash||``).toLowerCase();if(e.includes(`/settings`)||t.includes(`/settings`))return;let r=tk();n(r);let i=ZO();if(i&&i!==o)ue.current(i);else if(!i&&QO()){let e=XO();ee(e)}};return window.addEventListener(`popstate`,e),window.addEventListener(`hashchange`,e),()=>{window.removeEventListener(`popstate`,e),window.removeEventListener(`hashchange`,e)}},[o,s]),(0,Q.useEffect)(()=>{qO();let e=()=>qO();return window.addEventListener(`beforeunload`,e),document.addEventListener(`visibilitychange`,e),window.addEventListener(`focus`,e),()=>{window.removeEventListener(`beforeunload`,e),document.removeEventListener(`visibilitychange`,e),window.removeEventListener(`focus`,e)}},[]);let[de,fe]=(0,Q.useState)(null),[pe,me]=(0,Q.useState)(``),[he,ge]=(0,Q.useState)(null),_e=(0,Q.useRef)(F);_e.current=F;let ve=(e,t,n=`replies`)=>Ce(()=>Ke(ct.current?.notificationSettings,n,`os`)?window.api?.notifyAiResponse?.(rk(e),t):void 0,me),ye=(e,t)=>{(document.hidden||!document.hasFocus())&&ve(ik(e),t??e.chatId,`approvals`)};(0,Q.useEffect)(()=>{let e=!1,t=[],n=n=>{n?.then(n=>{typeof n==`function`&&(e?n():t.push(n))}).catch(t=>{e||me(qt(t))})},r=e=>{e&&_e.current(e).catch(e=>me(qt(e)))},i=e=>r(e.detail?.chatId);window.addEventListener(`mint:notification-click`,i);let a=async()=>{try{let t=await mk();if(!t||e)return;rt.current=!0,await ue.current(t),e||await mk(t)}catch(t){e||me(qt(t))}};yk()&&n(dk(`companion-open-chat`,()=>{a()}).then(t=>(e||a(),t))),n(dk(`notification-clicked`,e=>r(e.payload?.chatId))),n(Promise.resolve(window.api?.onProactiveNotification?.(t=>{e||je(t,document.hidden||!document.hasFocus(),e=>{Ke(ct.current?.notificationSettings,`system`,`inApp`)&&ge(e)},(e,t)=>ve(e,t,`system`)).catch(e=>me(qt(e)))})));let o=()=>{document.hidden||window.api?.clearAiNotifications?.()};return document.addEventListener(`visibilitychange`,o),()=>{e=!0,t.forEach(e=>e()),window.removeEventListener(`mint:notification-click`,i),document.removeEventListener(`visibilitychange`,o)}},[]);let[be,xe]=(0,Q.useState)({}),Se=(0,Q.useRef)(!0),we=(0,Q.useRef)(!0),[Te,Ee]=(0,Q.useState)(()=>window.localStorage.getItem(`mint:sidebar-collapsed`)===`true`),[De,P]=(0,Q.useState)([]),Oe=(0,Q.useRef)(De);Oe.current=De;let ke=(0,Q.useRef)(null),Ae=(0,Q.useRef)(new iO);(0,Q.useEffect)(()=>(Ae.current=new iO,()=>Ae.current.dispose()),[]),(0,Q.useEffect)(()=>{Ae.current.update(De.flatMap(e=>e.kind===`preview`?[e.artifact]:[]))},[De]);let[Me,Ne]=(0,Q.useState)(null),[Pe,Fe]=(0,Q.useState)(!1),Ie=tO(o,T===o?S:[],eO(Pe,Me)),[Le,Re]=(0,Q.useState)(null),[ze,Be]=(0,Q.useState)(null),[Ve,He]=(0,Q.useState)(0),[Ue,We]=(0,Q.useState)(()=>{let e=Number(window.localStorage.getItem(`mint:terminal-right-width`));return e>=280&&e<=900?e:440}),Ge=(0,Q.useRef)(null),[qe,Je]=(0,Q.useState)(()=>{let e=Number(window.localStorage.getItem(`mint:sidebar-width`));return e>=Yk&&e<=Xk?e:Jk}),[Ye,Xe]=(0,Q.useState)(()=>window.localStorage.getItem(`mint:agent-mode`)===`true`),[Ze,Qe]=(0,Q.useState)(()=>window.localStorage.getItem(`mint:plan-mode`)===`true`),[$e,et]=(0,Q.useState)(``),[tt,nt]=(0,Q.useState)(!1),rt=(0,Q.useRef)(!1);(0,Q.useEffect)(()=>{if(!tt||rt.current)return;rt.current=!0;let e=ZO();e&&ue.current(e)},[tt]);let[it,at]=(0,Q.useState)(!1),[ot,st]=(0,Q.useState)(null),ct=(0,Q.useRef)(ot);ct.current=ot,(0,Q.useEffect)(()=>{Ke(ot?.notificationSettings,`system`,`inApp`)||ge(null),(ot?.notificationSettings?.enabled===!1||ot?.notificationSettings?.os===!1)&&window.api?.clearAiNotifications?.()},[ot]);let lt=(0,Q.useMemo)(()=>en(N,s,A.map(e=>e.workspacePath)),[N,s,A]),ut=(0,Q.useRef)(null),dt=(0,Q.useRef)(0),{proactiveSuggestion:ft,dismissProactiveSuggestion:pt,handleProactiveAction:mt}=WO(e=>me(e)),gt=tt||it,_t=async(e,t)=>{let n={...ct.current||ot||Gt,[e]:t};if(ct.current=n,st(n),window.settingsApi)await window.settingsApi.saveSettings(n);else try{await Dk(`user-settings`,JSON.stringify(n))}catch(e){console.error(`Failed to save settings field:`,e)}},vt=e=>{},[yt,xt]=(0,Q.useState)(!1),[St,Ct]=(0,Q.useState)(null);(0,Q.useEffect)(()=>{function e(e){(e.ctrlKey||e.metaKey)&&e.key===`k`?(e.preventDefault(),xt(e=>!e)):e.key===`Escape`&&xt(!1)}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let wt=a.refreshHistory,Tt=(0,Q.useCallback)(async()=>{try{await a.refreshSessions()}catch(e){console.error(`Failed to refresh chat sessions:`,e)}},[a]),Et=a.loadOlder,Dt=(0,Q.useRef)(new Map),Ot=(0,Q.useCallback)(async(e,t)=>{let n=(Dt.current.get(e)??Promise.resolve()).catch(()=>{}).then(async()=>{await uk(e,t),await Tt()});Dt.current.set(e,n);try{await n}catch(e){console.error(`Failed to update session workspace:`,e),me(qt(e))}finally{Dt.current.get(e)===n&&Dt.current.delete(e)}},[Tt]),At=(0,Q.useCallback)(async()=>{try{return await _k()||null}catch{return null}},[]);(0,Q.useEffect)(()=>{Promise.allSettled([hk().then(fe),wt(),Tt(),window.settingsApi?.getSettings().then(e=>{let t=Vt(ht(e));st(t),Wt({...Gt,...t})})]).then(e=>{let t=e.find(e=>e.status===`rejected`);t?.status===`rejected`&&me(qt(t.reason)),nt(!0)});let e=window.api.onSpotlightToChat(e=>{ce(`chat`),a.compose(e)}),t=()=>{hk().then(fe).catch(()=>{}),window.settingsApi?.getSettings?.().then(e=>{if(e){let t=Vt(ht(e));st(t),Wt(t)}}).catch(()=>{}),window.api?.clearAiNotifications?.()};window.addEventListener(`focus`,t),window.api?.onSettingsChanged?.(e=>{let t=Vt(ht(e));st(t),Wt(t),hk().then(fe).catch(()=>{})});let n=dk(`tool-approval-requested`,e=>{let t=e.payload.chatId;t&&a.receiveApproval(t,e.payload)});return()=>{window.removeEventListener(`focus`,t),n?.then?.(e=>e?.()),e?.then?.(e=>e?.())}},[]),(0,Q.useEffect)(()=>{let e=window.setTimeout(()=>at(!0),1e4);return()=>window.clearTimeout(e)},[]),(0,Q.useEffect)(()=>{t===`workspace`&&!Ye&&on(!0)},[t,Ye]);let jt=e=>{et(e),setTimeout(()=>et(t=>t===e?``:t),3e3)},Nt=async(e,t=!1)=>{try{jt(`Opening in system browser...`),await g.openExternal(e)}catch(e){if(t)throw e;jt(`Could not open browser: ${String(e)}`)}},Ft=async(t,n,r=`external`)=>{if(!e&&![`localhost`,`127.0.0.1`,`[::1]`,`::1`].includes(window.location.hostname))throw Error(`HTML preview requires a browser on the same machine as the Mint backend.`);let i=e?null:window.open(`about:blank`,`_blank`);i&&(i.opener=null);try{let r=await x.startHtmlPreview(t,n);if(e)await g.openExternal(r.url);else{if(!i)throw Error(`Allow browser popups, then open the HTML file again.`);i.location.replace(r.url)}jt(`HTML preview is running. Open Tools → Background tasks to view or stop the server.`)}catch(e){throw i?.close(),e}},It=()=>{Fe(!0);let e=`terminal:${Date.now()}:${Math.random().toString(36).slice(2,7)}`;P(t=>{let n=t.filter(e=>e.kind===`terminal`).length,r=`terminal`;if(s&&s.trim()){let e=s.trim().replace(/[\\/]+$/,``).split(/[\\/]/).pop();e&&(r=e)}let i=n===0?r:`${r} (${n+1})`,a={id:e,kind:`terminal`,title:i};return Ne(e),[...t,a]})},Lt=e=>{Fe(!0),P(t=>t.some(t=>t.id===e)?t:[...t,{id:e,kind:e,title:e===`sources`?`Sources`:e===`mods`?`Mods`:`Background tasks`}]),Ne(e)},Rt=()=>{Fe(!1),requestAnimationFrame(()=>document.querySelector(`.tools-panel-toggle`)?.focus())},zt=(e=`https://www.google.com`)=>{Nt(e)},Bt=e=>{P(t=>{let n=t.find(t=>t.id===e);if(!n||n.kind===`sources`||n.kind===`mods`||n.kind===`background`)return t;let r=`${n.kind}:${Date.now()}:${Math.random().toString(36).slice(2,7)}`,i={...n,id:r,title:`${n.title} copy`};return Ne(r),[...t,i]})},Ht=e=>{let t=De.find(t=>t.id===e);if(!t)return;let n=window.prompt(`Rename tab`,t.title)?.trim();n&&P(t=>t.map(t=>t.id===e?{...t,title:n}:t))},Ut=e=>{P(t=>t.filter(t=>t.id===e)),Ne(e)},Kt=()=>{P(e=>{let t=e.find(e=>e.kind===`terminal`);if(!t){let t=`terminal:${Date.now()}:${Math.random().toString(36).slice(2,7)}`;return Ne(t),[...e,{id:t,kind:`terminal`,title:`Terminal`}]}return Ne(e=>e===t.id?null:t.id),e})},Jt=async()=>{try{let e=await window.settingsApi.checkForUpdates();jt(e?.available?`Mint ${e.version} is available.`:`Mint is up to date.`)}catch(e){jt(`Could not check for updates: ${String(e)}`)}},Yt=e=>{if(!Ae.current.accept(e))return;Fe(!0);let t=e.path.replace(/\\/g,`/`).split(`/`).pop()||e.path;e={...e,workspacePath:e.workspacePath??s};let n=`preview:${JSON.stringify([e.workspacePath,e.path])}`;P(r=>[...r.filter(e=>e.id!==n),{id:n,kind:`preview`,title:t,artifact:e}]),Ne(n)},Xt=async(e,t)=>{Fe(!0),ke.current??=Xb({readWorkspaceFile:(e,t)=>g.readWorkspaceFile(e,t),readWorkspaceImage:(e,t)=>g.readWorkspaceImage(e,t),readWorkspaceMedia:(e,t)=>g.readWorkspaceMedia(e,t),startHtmlPreview:(e,t)=>x.startHtmlPreview(e,t),selectIfOpen:e=>Oe.current.some(t=>t.id===e)?(Ne(e),!0):!1,open:Yt}),await ke.current(e,t)},Zt=e=>{Fe(!0),P(t=>[...t.filter(t=>t.id!==e.id),e]),Ne(e.id)},Qt=()=>{let e=ux([...C.map(e=>{let t=String(e.id);return cx(D[t]??e.agentActivity??[])}),cx(S)]);Fe(!0),P(t=>{let n=t.filter(e=>e.kind===`review`).length,r=`review:${Date.now()}:${Math.random().toString(36).slice(2,7)}`,i={id:r,kind:`review`,title:n===0?`Review`:`Review (${n+1})`,reviewTitle:`All conversation changes`,changes:e};return Ne(r),[...t,i]})},$t=e=>{P(t=>{let n=t.findIndex(t=>t.id===e),r=t.filter(t=>t.id!==e);return Ne(t=>t===e?r[Math.max(0,n-1)]?.id??null:t),r})},tn=()=>{P([]),Ne(null)},nn=()=>{if(window.innerWidth<=760){j(!1);return}let e=!Te;window.localStorage.setItem(`mint:sidebar-collapsed`,String(e)),Ee(e),j(!1)},rn=e=>{Je(Math.max(Zk,Math.min(Xk,e)))},an=e=>{if(e<Zk){Je(Jk),window.localStorage.setItem(`mint:sidebar-width`,String(Jk)),window.localStorage.setItem(`mint:sidebar-collapsed`,`true`),Ee(!0);return}let t=Math.max(Yk,Math.min(Xk,e));Je(t),window.localStorage.setItem(`mint:sidebar-width`,String(t))},on=e=>{window.localStorage.setItem(`mint:agent-mode`,String(e)),Xe(e)},sn=e=>{window.localStorage.setItem(`mint:plan-mode`,String(e)),Qe(e)},cn=(e,t=!0)=>{let n=e.trim();a.selectWorkspace(n);let r=a.getSnapshot().conversationId;t&&gO(r,A)&&Ot(r,n||null)},ln=a.resolveApproval,un=a.cancel;async function dn(e,t={}){a.getSnapshot().sending||(me(``),Se.current=!0,we.current=!0,xe(e=>({...e,live:!0,"live-extended":!0})),await a.sendPrompt(e,{...t,agentMode:Ye,planMode:Ze}))}async function fn(e){e.preventDefault();let t=a.getSnapshot().message.trim(),n=l,r=u,i=d,c=n.length>0||r.length>0||!!i;if(!t&&!c)return;if(m){a.queuePrompt({text:t,imageAttachments:n.map(e=>({dataUri:e.dataUri,name:e.name})),videoAttachments:r.map(e=>({dataUri:e.dataUri,name:e.name})),documentAttachment:i}),a.clearComposer();return}if(t.startsWith(`/`)){let e=null;try{e=await Fk(t,s||null,o)}catch{e=null}if(e&&e.kind!==`not_handled`){a.clearComposer(),await En(t,e);return}let n=sO(t);if(n.handled){if(a.clearComposer(),n.action===`open_image_picker`){document.getElementById(`vision-file-input`)?.click();return}if(n.action===`paste_image`){fk().then(e=>{e&&a.attachImage({dataUri:e,name:`Clipboard Image`})}).catch(()=>{});return}if(n.action===`generate_veo`){ce(`veo`);return}if(n.action===`open_settings`){window.location.hash=`#/settings`;return}if(n.action===`start_voice`){window.dispatchEvent(new CustomEvent(`mint:trigger-voice`));return}if(n.action===`resume_session`){let e=(n.payload?.query||``).trim().toLowerCase(),r=e?A.find(t=>t.id.toLowerCase()===e||t.id.toLowerCase().includes(e)||t.title.toLowerCase().includes(e)):A.find(e=>e.id!==o);if(r){ee(r.id);let e=nk(`chat`,r.id);window.history.replaceState({},``,e);let n={id:Date.now(),userText:t,aiText:`🔄 Resumed session: **${r.title}** (\`${r.id}\`)`,createdAt:new Date().toISOString(),provider:`system`,model:`mint-cli`};a.appendInteraction(n)}else{let n={id:Date.now(),userText:t,aiText:e?`⚠️ No matching session found for "${e}".`:`ℹ️ No other sessions found to resume.`,createdAt:new Date().toISOString(),provider:`system`,model:`mint-cli`};a.appendInteraction(n)}return}if(n.systemText){let e={id:Date.now(),userText:t,aiText:n.systemText,createdAt:new Date().toISOString(),provider:`system`,model:`mint-cli`};a.appendInteraction(e),lk(o,t,n.systemText||``,`system`,`mint-cli`).catch(()=>{})}return}}let f=t||(n.length>0?n.length>1?`Describe these images.`:`Describe this image.`:r.length>0?r.length>1?`Describe these videos.`:`Describe this video.`:`Summarize this document.`),p=Object.entries(ot?.mcpServers||{}).filter(([,e])=>e?.disabled!==!0).map(([e])=>e).find(e=>RegExp(`(^|\\s)@${e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}(\\s|$)`).test(t));await dn(f,{imageAttachments:n,videoAttachments:r,documentAttachment:i,clearComposer:!0,pinnedMcpServer:p,forceAgentMode:!!p})}async function pn(e,t){let n=e.trim()||`Voice message`;n&&!m&&await dn(n,{audioDataUri:t,systemInstruction:t?`The user attached a voice message. Listen to the audio and reply naturally in the same language as the user. Do not mention transcription or this instruction.`:``})}async function mn(e){let t=e.target.files?.[0];if(t)try{let e=bt(t).objectUrl,n=await kt(t),r=await Mt(n).catch(()=>n);a.attachImage({dataUri:n,previewDataUri:r,objectUrl:e,name:t.name})}catch(e){me(qt(e))}finally{e.target.value=``}}async function hn(e){let t=e.target.files?.[0];if(t)try{if(t.size>26214400){me(`Video is too large. Maximum allowed is 25 MB.`);return}let e=await new Promise((e,n)=>{let r=new FileReader;r.onload=()=>e(r.result),r.onerror=n,r.readAsDataURL(t)});a.attachVideo({dataUri:e,name:t.name})}catch(e){me(qt(e))}finally{e.target.value=``}}function gn(t){let n=null;if(t.files&&t.files.length>0)for(let e=0;e<t.files.length;e++){let r=t.files[e];if(r&&r.type.startsWith(`image/`)){n=r;break}}if(!n&&t.items&&t.items.length>0)for(let e=0;e<t.items.length;e++){let r=t.items[e];if(r&&r.type.startsWith(`image/`)){let e=r.getAsFile();if(e){n=e;break}}}if(!n){if(e){let e=Date.now();e-dt.current>100&&(dt.current=e,fk().then(e=>{e&&Mt(e).catch(()=>e).then(t=>{a.attachImage({dataUri:e,previewDataUri:t,name:`Pasted image`})})}).catch(e=>{console.warn(`Failed to read clipboard image via Tauri API:`,e)}))}return!1}return kt(n).then(e=>{let t=n.name&&n.name!==`image.png`?n.name:`Pasted image`;Mt(e).catch(()=>e).then(n=>{a.attachImage({dataUri:e,previewDataUri:n,name:t})})}).catch(e=>me(qt(e))),!0}async function _n(e){let t=e.target.files?.[0];if(t)try{if(!SE(t.name))throw Error(`Unsupported document type`);a.attachDocument({filename:t.name,dataUri:await Pt(t)})}catch(e){me(qt(e))}finally{e.target.value=``}}function vn(){on(!0);let e=a.getSnapshot().message.trim();a.compose(e?`Search web: ${e}`:`Search web: `)}async function yn(n,r=!1){let i=e&&(r||t===`workspace`)?`workspace`:`chat`;await a.selectProject(async()=>{let e=n||await vk();return e&&lb.restore(e),e},{openSession:(e,t)=>F(e.id,e,t),newChat:(e,t)=>Cn(`New chat`,e,t),showCurrentView:e=>ce(e,a.getSnapshot().conversationId)},i)}function bn(){re(!0)}async function xn(){re(!1),await new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(()=>e())));try{await window.api.startVision()}catch(e){me(qt(e))}}function Sn(e){Mt(e).catch(()=>e).then(t=>{a.attachImage({dataUri:e,previewDataUri:t,name:`Screen capture`}),re(!1)})}async function Cn(e,t,r=`chat`){try{if(e===`New chat`){let e=XO();if(ee(e),n(r),cn(t===void 0?s:t||``),typeof window<`u`){let e=(window.location.pathname||``).replace(/\/+$/,``);e!==``&&e!==`/chat`&&window.history.pushState({},``,`/chat`)}return}if(!window.confirm(`${e} will clear the current conversation history. Continue?`))return;await a.clearHistory()}catch(e){me(qt(e))}}function wn(e,t){let n={id:Date.now(),userText:e,aiText:t,createdAt:new Date().toISOString(),provider:`system`,model:`mint-cli`};a.appendInteraction(n),lk(o,e,t,`system`,`mint-cli`).catch(()=>{})}function Tn(e){switch(e){case`linked_folders`:return`link`;case`cron`:return`cron`;case`skills`:return`skills`;case`plugins`:return`plugins`;case`mcp`:return`mcp`;case`veo`:return`veo`;default:return`chat`}}async function En(e,t){switch(t.kind){case`message`:wn(e.startsWith(`/mods set `)?`/mods`:e,t.markdown),e.startsWith(`/mods set `)&&requestAnimationFrame(()=>document.getElementById(`chat-input`)?.focus());break;case`applied`:{let n=t.effects.find(e=>e.kind===`workspace_changed`);n&&cn(n.path),t.effects.some(e=>e.kind===`workspace_files_changed`)&&ie(e=>e+1);let r=t.effects.find(e=>e.kind===`plan_mode_changed`);r&&Qe(r.enabled);let i=t.effects.find(e=>e.kind===`provider_changed`);i&&a.appendInteraction({id:Date.now(),userText:i.display,aiText:``,createdAt:new Date().toISOString(),provider:`system`,model:`provider_change`}),t.effects.some(e=>e.kind===`history_cleared`)&&await a.clearHistory().catch(()=>{}),t.markdown&&wn(e,t.markdown),t.effects.some(e=>e.kind!==`history_cleared`&&e.kind!==`workspace_changed`)&&(window.settingsApi?.getSettings?.().then(e=>e&&st(e)).catch(()=>{}),hk().then(fe).catch(()=>{}));break}case`navigate`:t.markdown&&wn(e,t.markdown),ce(Tn(t.target));break;case`forward_to_agent`:t.plan_mode&&Qe(!0),t.agent_mode&&Xe(!0),await dn(t.prompt,{clearComposer:!0});break;case`needs_choice`:Ct({command:t.command,title:t.title,options:t.options})}}function Dn(e,t){e===`live`&&(Se.current=t),e===`live-extended`&&(we.current=t),xe(n=>({...n,[e]:t}))}async function F(e,t,n=`chat`){le.current+=1,window.localStorage.setItem(Wk,e),qO(),ee(e),ce(n,e);let r=t??A.find(t=>t.id===e);r&&(r.workspacePath?r.workspacePath!==s&&cn(r.workspacePath,!1):s&&cn(``,!1));try{await a.refreshHistory()}catch(e){me(qt(e))}}let On=e=>{Cn(`New chat`,e)};async function kn(e){if(e===`cli`){if(!window.confirm(`Clear history for default CLI session? This cannot be undone.`))return;try{await ok(`cli`),await wt(),await Tt(),jt(`CLI session history cleared`)}catch(e){me(qt(e))}return}let t=A.find(t=>t.id===e)?.title||`this chat`;if(window.confirm(`Delete "${t}"? This will remove the conversation and its messages.`))try{await sk(e);let t=A.filter(t=>t.id!==e&&t.kind!==`cli`&&!t.id.startsWith(`cli`)&&t.id!==`conversation-default`),n=a.getSnapshot().conversationId,r=e===n?t[0]?.id??XO():n;r!==n&&(t.length>0&&t[0]?.id?(window.localStorage.setItem(Wk,r),typeof window<`u`&&window.history.replaceState({},``,`/chat/${encodeURIComponent(r)}`)):(window.localStorage.removeItem(Wk),typeof window<`u`&&window.history.replaceState({},``,`/chat`)),ee(r),await a.refreshHistory()),await Tt()}catch(e){me(qt(e))}}async function I(e,t){if(t.trim())try{await ck(e,t.trim()),await Tt()}catch(e){me(qt(e))}}function An(e,t){let n=e;if(e===`gemini`)n=`Gemini`;else if(e===`openai`)n=`OpenAI`;else if(e===`openrouter`)n=`OpenRouter`;else if(e===`deepseek`)n=`DeepSeek`;else if(e===`anthropic`)n=`Claude`;else if(e===`huggingface`)n=`HF`;else if(e===`local_openai`)n=`Local`;else if(e===`ollama`)n=`Ollama`;else if(e.startsWith(`custom:`)){let t=e.replace(/^custom:/,``);n=(ot?.customProviders??[]).find(e=>e.id===t)?.displayName||t}return n&&n===e&&(n=n.charAt(0).toUpperCase()+n.slice(1)),[n,t].filter(Boolean).join(` • `)}function jn(e,t){switch(t){case`gemini`:return e.geminiModel||`gemini-1.5-flash`;case`openai`:return e.openaiModel||`gpt-4o`;case`openrouter`:return e.openrouterModel||`anthropic/claude-3.5-sonnet`;case`deepseek`:return e.deepseekModel||`deepseek-chat`;case`anthropic`:return e.anthropicModel||`claude-3-5-sonnet-20240620`;case`huggingface`:return e.hfModel||`meta-llama/Meta-Llama-3-8B-Instruct`;case`local_openai`:return e.localModelName||`llama3`;case`ollama`:return e.ollamaModel||`llama3:latest`;default:if(t.startsWith(`custom:`)){let n=t.replace(/^custom:/,``),r=(e.customProviders??[]).find(e=>e.id===n);return(e.customModelSelections??{})[n]??r?.models[0]?.modelId??``}return``}}async function Mn(e){try{let t=await window.settingsApi.getSettings();if(t.aiProvider===e)return;t.aiProvider=e,await window.settingsApi.saveSettings(t),st(t),fe(await hk());let n=An(e,jn(t,e));C.length>0&&(await lk(o,n,``,`system`,`provider_change`),await wt())}catch(e){me(qt(e))}}async function Nn(e){try{let t=await window.settingsApi.getSettings(),n=t.aiProvider;if(jn(t,n)===e)return;if(n===`gemini`)t.geminiModel=e;else if(n===`openai`)t.openaiModel=e;else if(n===`openrouter`)t.openrouterModel=e;else if(n===`deepseek`)t.deepseekModel=e;else if(n===`anthropic`)t.anthropicModel=e;else if(n===`huggingface`)t.hfModel=e;else if(n===`local_openai`)t.localModelName=e;else if(n===`ollama`)t.ollamaModel=e;else if(n.startsWith(`custom:`)){let r=n.replace(/^custom:/,``);t.customModelSelections={...t.customModelSelections??{},[r]:e}}await window.settingsApi.saveSettings(t),st(t),fe(await hk());let r=An(n,e);C.length>0&&(await lk(o,r,``,`system`,`provider_change`),await wt())}catch(e){me(qt(e))}}async function Pn(e,t){try{let n=await window.settingsApi.getSettings();if(n.aiProvider=e,e===`gemini`)n.geminiModel=t;else if(e===`openai`)n.openaiModel=t;else if(e===`openrouter`)n.openrouterModel=t;else if(e===`deepseek`)n.deepseekModel=t;else if(e===`anthropic`)n.anthropicModel=t;else if(e===`huggingface`)n.hfModel=t;else if(e===`local_openai`)n.localModelName=t;else if(e===`ollama`)n.ollamaModel=t;else if(e.startsWith(`custom:`)){let r=e.replace(/^custom:/,``);n.customModelSelections={...n.customModelSelections??{},[r]:t}}await window.settingsApi.saveSettings(n),st(n),fe(await hk());let r=An(e,t);C.length>0&&(await lk(o,r,``,`system`,`provider_change`),await wt())}catch(e){me(qt(e))}}async function Fn(e){try{let t=await window.settingsApi.getSettings();if(t.geminiLiveVoice===e)return;t.geminiLiveVoice=e,await window.settingsApi.saveSettings(t),st(t)}catch(e){me(qt(e))}}let In={interactions:C,hasOlder:w,sendingInteractionId:T===o?E:null,sending:m&&T===o,sendingMessage:T===o?h:``,sendingImageCount:T===o?_:0,sendingVideoCount:T===o?v:0,streamedReply:T===o?y:``,streamedResponse:T===o?b:null,agentProgress:T===o?S:[],agentActivitySnapshots:D,thinkingExpanded:be,message:c,imageAttachments:l,videoAttachments:u,documentName:d?.filename??``,pendingApproval:O[o]??null,agentMode:Ye,planMode:Ze,status:de,workspacePath:s,chatId:o,recentWorkspacePaths:lt,chatEnd:ut,welcomeInteraction:Qk,settingsConfig:ot,slashChoice:St,isCliSession:o.startsWith(`cli`)||o===`cli`,cliSessionId:o.startsWith(`cli`)?o:void 0,conversationTitle:A.find(e=>e.id===o)?.title,queuedPrompts:f??[],queuePaused:p??!1},Ln={onSelectSlashChoice:e=>{if(!St)return;let t=`${St.command} ${e}`;Ct(null),requestAnimationFrame(()=>document.getElementById(`chat-input`)?.focus()),Fk(t,s||null,o).then(e=>En(t,e)).catch(()=>{})},onDismissSlashChoice:()=>Ct(null),onLoadOlder:Et,onThinkingExpandedChange:Dn,onSubmit:fn,onSelectImage:mn,onSelectVideo:hn,onSelectDocument:_n,onPasteImage:gn,onAttachImage:e=>a.attachImage(e),onSetMessage:a.compose,subscribeMessage:a.subscribe,getMessage:()=>a.getSnapshot().message,onSendVoiceMessage:pn,onRemoveImage:a.removeImage,onRemoveVideo:a.removeVideo,onRemoveDocument:()=>a.attachDocument(null),onStartWebSearch:vn,onCaptureScreen:bn,onSetAgentMode:on,onSetPlanMode:e?sn:void 0,onSetProvider:Mn,onSelectWorkspace:yn,onWorkspaceChanged:()=>ie(e=>e+1),onApproval:ln,onUpdateSettings:e=>st(e),onSetModel:Nn,onSelectModelAndProvider:Pn,onCancelMessage:un,onClearMessages:()=>Cn(`Clear history`),onSetGeminiLiveVoice:Fn,onToggleMobileSidebar:()=>j(!te),onBackToCode:()=>ce(`code`),onOpenArtifact:Yt,onOpenReview:Zt,onRemoveQueuedPrompt:a.removeQueuedPrompt,onEditQueuedPrompt:a.editQueuedPrompt,onClearQueuedPrompts:a.clearQueuedPrompts,onSteerQueuedPrompt:a.steerQueuedPrompt,onResumeQueue:a.resumeQueue,onSyncHistory:()=>{a.syncHistory()},onReceiveApproval:e=>{a.receiveApproval(o,e)},onResendFrom:async(e,t)=>{a.getSnapshot().sending||(me(``),Se.current=!0,we.current=!0,xe(e=>({...e,live:!0,"live-extended":!0})),await a.resendFromInteraction(e,t,{agentMode:Ye,planMode:Ze}))}},Rn=bS(nn),zn=bS(rn),Bn=bS(an),Vn=bS(Cn),Hn=bS(F),Un=bS(kn),Wn=bS(I),Gn=bS(ce),Kn=bS(At),qn=bS(On);return(0,$.jsxs)(`div`,{className:`app-container ${gt?``:`is-loading`}`,children:[ne&&(0,$.jsx)(kD,{onClose:()=>re(!1),onAttach:Sn,capture:()=>dO(e),onLiveTranslate:e?()=>{xn()}:void 0}),e&&(0,$.jsx)(LD,{sidebarCollapsed:Te,onToggleSidebar:nn,onNewChat:()=>Cn(`New chat`),onOpenWorkspace:()=>yn(void 0,!0),onShowWorkspace:()=>{Fe(!1),ce(`workspace`)},onOpenTerminal:It,onToggleTerminal:Kt,onOpenBrowser:()=>zt(),toolsPanelOpen:Pe,backgroundTaskCount:Ve,onToggleToolsPanel:()=>Fe(e=>!e),onOpenSettings:()=>ce(`settings`),onCheckForUpdates:Jt,onShowAbout:()=>jt(`Mint Agent — AI workspace`),workspacePath:s,workspaceActive:t===`workspace`&&!Pe,workspaceRevision:M,sending:m,onWorkspaceUndoError:jt,onRefreshWorkspace:()=>ie(e=>e+1)}),he&&(0,$.jsxs)(`section`,{className:`mint-notification-notice`,role:`status`,"data-kind":he.type,children:[(0,$.jsx)(`span`,{children:he.message}),he.chatId&&(0,$.jsx)(`button`,{type:`button`,onClick:()=>{_e.current(he.chatId),ge(null)},children:`Open chat`}),(0,$.jsx)(`button`,{type:`button`,"aria-label":`Dismiss notification`,onClick:()=>ge(null),children:`×`})]}),pe&&(0,$.jsx)(UD,{message:pe,onDismiss:()=>me(``)},pe),(0,$.jsxs)(`div`,{className:`app-body ${Te&&window.innerWidth>760?`sidebar-collapsed`:``} ${t===`pictures`?`pictures-open`:``} ${te?`mobile-sidebar-open`:``} ${Pe?`tool-surface-active`:``}`,style:{"--sidebar-expanded-width":`${qe}px`,"--terminal-dock-size":`${Ue}px`,"--tool-surface-width":`${Ue}px`},children:[!e&&t!==`chat`&&(0,$.jsx)(`button`,{type:`button`,className:`web-mobile-nav-btn`,"aria-label":`Open navigation menu`,"aria-expanded":te,onClick:()=>j(!0),children:(0,$.jsxs)(`svg`,{width:`22`,height:`22`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,children:[(0,$.jsx)(`line`,{x1:`3`,y1:`6`,x2:`21`,y2:`6`}),(0,$.jsx)(`line`,{x1:`3`,y1:`12`,x2:`21`,y2:`12`}),(0,$.jsx)(`line`,{x1:`3`,y1:`18`,x2:`21`,y2:`18`})]})}),te&&(0,$.jsx)(`button`,{type:`button`,"aria-label":`Close navigation menu`,className:`sidebar-backdrop`,onClick:()=>j(!1),style:{position:`fixed`,top:0,left:0,right:0,bottom:0,background:`rgba(0, 0, 0, 0.5)`,backdropFilter:`blur(4px)`,zIndex:9998}}),$e&&(0,$.jsx)(`div`,{role:`status`,style:{position:`fixed`,bottom:22,right:22,zIndex:1e4,padding:`12px 18px`,borderRadius:`var(--radius-lg, 14px)`,background:`var(--bg-surface)`,color:`var(--text-main)`,border:`1px solid var(--border-color)`},children:$e}),(0,$.jsx)(FD,{view:t,sidebarCollapsed:Te,sending:m,onToggleSidebar:Rn,onSidebarResize:zn,onSidebarResizeEnd:Bn,onClearHistory:Vn,chatSessions:A,activeConversationId:o,onSelectConversation:Hn,onDeleteConversation:Un,onRenameConversation:Wn,onSetView:Gn,isSearchOpen:yt,onSetSearchOpen:xt,showWorkspaceTab:e,promoteMediaStudios:!e,activeWorkspacePath:s,recentWorkspacePaths:N,onBrowseFolder:e?Kn:void 0,onUpdateSessionWorkspace:Ot,onNewChatInProject:qn}),(0,$.jsxs)(`main`,{className:`assistant-workspace ${t===`workspace`?``:`chat-only`} ${t===`workspace`?`workspace-open`:``}`,style:t===`skills`||t===`mcp`||t===`plugins`||t===`cron`||t===`link`||t===`pictures`||t===`imagine`||t===`veo`||t===`code`?{display:`none`}:void 0,children:[ft&&(0,$.jsxs)(`div`,{className:`proactive-bar`,style:{position:`absolute`,top:0,left:0,right:0,zIndex:100},children:[(0,$.jsxs)(`div`,{className:`proactive-header`,children:[(0,$.jsx)(`span`,{className:`proactive-icon`,children:`✨`}),(0,$.jsx)(`div`,{className:`proactive-message`,children:ft.message}),(0,$.jsx)(`button`,{className:`proactive-dismiss-btn`,onClick:pt,children:`Dismiss`})]}),(0,$.jsx)(`div`,{className:`proactive-chips`,children:ft.suggestions?.map((e,t)=>(0,$.jsx)(`button`,{className:`suggestion-chip`,onClick:()=>mt(e.action),children:e.label},t))})]}),t===`workspace`&&(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(ek,{}),children:(0,$.jsx)($k,{agentMode:Ye,sending:m,workspacePath:s,onEnableAgentMode:()=>on(!0),onSetMessage:a.compose,onWorkspaceReady:cn,refreshRevision:M,onOpenHtml:Ft,onOpenPreview:Xt},s)}),(0,$.jsx)(dD,{conversation:In,actions:Ln,tools:{modsPanelTarget:Le,onOpenMods:()=>Lt(`mods`),open:Pe,backgroundTaskCount:Ve,onToggle:e?void 0:()=>Fe(e=>!e)}})]}),Pe&&(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(ek,{}),children:(0,$.jsx)(eA,{surfaces:De,activeSurfaceId:Me,workspacePath:s,desktopTools:e,onDropWorkspaceFile:e?e=>Xt(e.root,e.path):void 0,backgroundTaskCount:Ve,sourceCount:Ie.sources.length,onOpenSources:()=>Lt(`sources`),sourcesContent:(0,$.jsx)(JD,{...Ie,onRetry:Ie.retry,onOpenLibrary:e=>{window.history.pushState({},``,e),window.dispatchEvent(new PopStateEvent(`popstate`)),Fe(!1)},onOpenArtifact:Yt},o),onOpenMods:()=>Lt(`mods`),onOpenBackgroundTasks:()=>Lt(`background`),onModsPanelTarget:Re,onBackgroundPanelTarget:Be,terminalSize:Ue,onSelect:Ne,onClose:$t,onCloseAll:tn,onDuplicate:Bt,onRename:Ht,onCloseOthers:Ut,onOpenTerminal:It,onOpenBrowser:()=>zt(),onOpenReview:Qt,onOpenFiles:()=>{Ne(null),Fe(!1),ce(`workspace`)},onOpenSideChat:()=>{Ne(null),Fe(!1)},onClosePanel:Rt,onResizeTerminal:e=>{We(e),Ge.current&&clearTimeout(Ge.current),Ge.current=setTimeout(()=>{window.localStorage.setItem(`mint:terminal-right-width`,String(e))},250)},onResizePanel:e=>{We(e),Ge.current&&clearTimeout(Ge.current),Ge.current=setTimeout(()=>{window.localStorage.setItem(`mint:terminal-right-width`,String(e))},250)}})}),(0,$.jsx)(PO,{workspacePath:s,panelTarget:ze,onCountChange:He}),t===`skills`&&(0,$.jsx)(`div`,{className:`web-view-scroll`,style:{flex:1,overflowY:`auto`,background:`transparent`},children:(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(ek,{}),children:(0,$.jsx)(tA,{listSkills:xk,addSkill:Sk,deleteSkill:Ck,workspacePath:s})})}),t===`mcp`&&(0,$.jsx)(`div`,{className:`web-view-scroll`,style:{flex:1,overflowY:`auto`,background:`transparent`},children:(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(ek,{}),children:(0,$.jsx)(iA,{config:ot||Gt,updateField:_t,detectTools:wk,onReauth:Tk,listServerTools:Ek})})}),t===`plugins`&&(0,$.jsx)(`div`,{className:`web-view-scroll`,style:{flex:1,overflowY:`auto`,background:`transparent`},children:(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(ek,{}),children:(0,$.jsx)(aA,{config:ot||Gt,updateField:_t,handleConnectPlugin:vt})})}),t===`cron`&&(0,$.jsx)(`div`,{className:`web-view-scroll`,style:{flex:1,overflowY:`auto`,background:`transparent`},children:(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(ek,{}),children:(0,$.jsx)(nA,{listCronJobs:Ok,addCronJob:kk,removeCronJob:Ak,setCronJobEnabled:jk,workspacePath:s})})}),t===`link`&&(0,$.jsx)(`div`,{className:`web-view-scroll`,style:{flex:1,overflowY:`auto`,background:`transparent`},children:(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(ek,{}),children:(0,$.jsx)(rA,{listLinkedFolders:Mk,addLinkedFolder:Nk,removeLinkedFolder:Pk,linkedFolderStatus:Ik,refreshLinkedFolder:Lk,listLinkedFolderNotes:Rk,readLinkedFolderNote:zk,openLinkedFolderNote:Bk,canOpenNote:yk(),selectFolder:vk})})}),t===`code`&&(0,$.jsx)(`div`,{className:`web-view-scroll`,style:{flex:1,overflowY:`auto`,background:`transparent`},children:(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(ek,{}),children:(0,$.jsx)(oA,{chatSessions:A,activeConversationId:o,workspacePath:s,recentWorkspacePaths:lt,onSelectFolder:se,onSelectSession:e=>{F(e)},onDeleteSession:kn,onRenameSession:I,onRefreshSessions:Tt,onShowToast:jt})})}),t===`pictures`&&(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(ek,{}),children:(0,$.jsx)(sA,{chatId:o,onClose:()=>ce(`chat`),onOpenConversation:e=>{F(e)}})}),t===`imagine`&&(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(ek,{}),children:(0,$.jsx)(cA,{view:t,onSendToChat:async(e,t)=>{try{let n=await fetch(bk(e));if(!n.ok)throw Error(`Unable to load image (${n.status})`);let r=await n.blob(),i=e.split(/[\\/]/).pop()||`generated-image.png`,o=await kt(new File([r],i,{type:r.type||`image/png`})),s=await Mt(o).catch(()=>o);ce(`chat`),a.compose(t),a.attachImage({dataUri:o,previewDataUri:s,name:i})}catch(e){jt(`Could not attach image: ${qt(e)}`)}}})}),t===`veo`&&(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(ek,{}),children:(0,$.jsx)(lA,{view:t,onSendToChat:e=>{ce(`chat`),a.compose(e)}})})]}),(0,$.jsx)(`div`,{className:`startup-loading ${gt?`is-hidden`:``}`,"aria-live":`polite`,"aria-busy":!gt,children:(0,$.jsxs)(`div`,{className:`startup-loading-content`,children:[(0,$.jsxs)(`div`,{className:`startup-loading-dots`,"aria-hidden":`true`,children:[(0,$.jsx)(`span`,{}),(0,$.jsx)(`span`,{}),(0,$.jsx)(`span`,{})]}),(0,$.jsx)(`div`,{className:`startup-loading-text`,children:`Loading Mint Agent`})]})}),yt&&(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(uA,{isOpen:!0,onClose:()=>xt(!1),onSelectChat:e=>{F(e),xt(!1)},onNewChat:()=>{Cn(`New chat`),xt(!1)},onSelectWorkspace:e?yn:void 0,onOpenSettings:()=>{ce(`settings`),xt(!1)},onChangeView:e=>{ce(e),xt(!1)},onChangeModel:e=>{_t(`model`,e),et(`Switched model to ${e}`)},onChangeProvider:e=>{_t(`provider`,e),et(`Switched provider to ${e}`)},onExecuteSlash:e=>{a.compose(e+` `),xt(!1)},chatSessions:A,currentChatId:o,workspacePath:s})})]})}var Q,$,ok,sk,ck,lk,uk,dk,fk,pk,mk,hk,gk,_k,vk,yk,bk,xk,Sk,Ck,wk,Tk,Ek,Dk,Ok,kk,Ak,jk,Mk,Nk,Pk,Fk,Ik,Lk,Rk,zk,Bk,Vk,Hk,Uk,Wk,Gk,Kk,qk,Jk,Yk,Xk,Zk,Qk,$k,eA,tA,nA,rA,iA,aA,oA,sA,cA,lA,uA,dA=t((()=>{Zb(),Ye(),Ie(),Qb(),Q=e(i()),px(),ke(),$=a(),TD(),MD(),ID(),VD(),GD(),ZD(),rO(),SS(),aO(),Tt(),tn(),ub(),cO(),fO(),MO(),bO(),Ft(),UO(),TE(),GO(),Ee(),{clearChatHistory:ok,deleteChatSession:sk,renameChatSession:ck,saveSystemInteraction:lk,updateChatSessionWorkspace:uk,listen:dk,readClipboardImage:fk,listChatSessions:pk,pendingCompanionChat:mk}=Ae,{getRuntimeStatus:hk,setActiveModel:gk,selectWorkspaceDirectory:_k,selectLinkedFolderPath:vk,isTauriRuntime:yk}=g,{convertFileSrc:bk}=j,{listLearnedSkills:xk,addLearnedSkill:Sk,deleteLearnedSkill:Ck,detectSystemTools:wk,reauthMcpServer:Tk,listMcpServerTools:Ek,setProfileValue:Dk,listCronJobs:Ok,addCronJob:kk,removeCronJob:Ak,setCronJobEnabled:jk,listLinkedFolders:Mk,addLinkedFolder:Nk,removeLinkedFolder:Pk,runSlashCommand:Fk,linkedFolderStatus:Ik,refreshLinkedFolder:Lk,listLinkedFolderNotes:Rk,readLinkedFolderNote:zk,openLinkedFolderNote:Bk}=ne,Vk=`mint:last-workspace-path`,Hk=`mint:recent-workspace-paths`,Uk=8,Wk=`mint:active-conversation-id`,Gk=`mint:last-active-timestamp`,Kk=18e5,qk=`mint:draft:`,Jk=264,Yk=200,Xk=420,Zk=170,Qk={id:-1,userText:``,aiText:`Hi there! I'm Mint, your AI assistant! 🎯✨ I'm here and ready to help you with whatever you need. I've been organizing some background data to make things smoother for you. 💖
|
|
118
|
+
|
|
119
|
+
But the moment you start chatting with me, I'll put everything aside and focus on you! Is there something I can help you with today, or would you like to chat about something special? Let's do this! 🚀💪`,provider:`gemini`,model:`gemini-3-flash-preview`,createdAt:new Date().toISOString()},$k=(0,Q.lazy)(()=>P(()=>import(`./WorkspacePanel-BfHKkulU.js`),__vite__mapDeps([27,1]))),eA=(0,Q.lazy)(()=>P(()=>import(`./ToolSurfacePage-saVbVrkE.js`),__vite__mapDeps([28,1,2,3,4,25,26,29]))),tA=(0,Q.lazy)(()=>P(()=>import(`./SkillsView-CIeWwq5z.js`),__vite__mapDeps([30,1,2,18,3,4,19]))),nA=(0,Q.lazy)(()=>P(()=>import(`./ScheduledTasksView-BD5DVPkZ.js`),__vite__mapDeps([31,1,2,18,3,4,19,17,20]))),rA=(0,Q.lazy)(()=>P(()=>import(`./LinkedFoldersView-9B9DIPoZ.js`),__vite__mapDeps([32,1,2,18,3,4,19]))),iA=(0,Q.lazy)(()=>P(()=>import(`./McpServersView-CiNBNUl4.js`),__vite__mapDeps([33,1,2,3,4,18,19,17,20,34]))),aA=(0,Q.lazy)(()=>P(()=>import(`./PluginsView-DoTg9MVa.js`),__vite__mapDeps([35,1,2,18,3,4,19,36]))),oA=(0,Q.lazy)(()=>P(()=>import(`./CliSessionsView-z5i6qGyb.js`),__vite__mapDeps([37,1,2,18,3,4,19,17,20,38,39]))),sA=(0,Q.lazy)(()=>P(()=>import(`./LibraryPage-DbZEi4W_.js`),__vite__mapDeps([40,1,2,3,4,41]))),cA=(0,Q.lazy)(()=>P(()=>import(`./ImageStudioPanel-B5N7TjeB.js`),__vite__mapDeps([42,1,2,3,4,18,19,17,20,43,44]))),lA=(0,Q.lazy)(()=>P(()=>import(`./VeoStudioPanel-Co6-wEWM.js`),__vite__mapDeps([45,1,2,3,4,18,19,17,20,43,46,47]))),uA=(0,Q.lazy)(()=>P(async()=>{let{CommandPalette:e}=await import(`./CommandPalette-DaKlzbKs.js`);return{CommandPalette:e}},__vite__mapDeps([48,1,2])).then(({CommandPalette:e})=>({default:e})))})),fA=n({default:()=>ak}),pA=t((()=>{Jb(),dA()}));pA();export{dg as A,fy as C,B_ as D,py as E,lg as M,eg as N,V_ as O,tg as P,eb as S,my as T,ub as _,Rb as a,ib as b,jb as c,kb as d,ak as default,Sb as f,_b as g,pb as h,qb as i,cg as j,ug as k,Mb as l,wb as m,pA as n,Pb as o,bb as p,Gb as r,Ab as s,fA as t,Tb as u,lb as v,vy as w,Uy as x,rb as y};
|