@pheem49/mint 1.16.0 → 1.17.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 +1 -1
- package/README.md +1 -1
- package/Release_Note.md +71 -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/live_status.rs +43 -2
- package/crates/mint-cli/src/agent.rs +178 -38
- package/crates/mint-cli/src/commands/agent.rs +225 -31
- package/crates/mint-cli/src/commands/browser.rs +127 -0
- package/crates/mint-cli/src/commands/config.rs +14 -1
- package/crates/mint-cli/src/commands/knowledge.rs +16 -2
- package/crates/mint-cli/src/commands/mod.rs +15 -1
- package/crates/mint-cli/src/commands/tailnet_web.rs +2 -7
- package/crates/mint-cli/src/companion_navigation.rs +268 -0
- package/crates/mint-cli/src/interactive/chat_tui.rs +1065 -63
- package/crates/mint-cli/src/interactive/command_ui.rs +39 -0
- package/crates/mint-cli/src/interactive/slash_commands.rs +114 -6
- package/crates/mint-cli/src/interactive/tool_activity.rs +375 -36
- package/crates/mint-cli/src/interactive.rs +37 -5
- package/crates/mint-cli/src/main.rs +23 -2
- package/crates/mint-cli/src/onboard.rs +3494 -1336
- 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.rs +240 -1
- package/crates/mint-core/src/agent/memory.rs +73 -6
- 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/api_server/routes/auth.rs +1 -4
- package/crates/mint-core/src/api_server/routes/chat.rs +29 -15
- 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 +93 -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 -2
- package/crates/mint-core/src/browser/cdp.rs +82 -26
- package/crates/mint-core/src/browser/lifecycle.rs +143 -43
- package/crates/mint-core/src/browser/mod.rs +5 -4
- package/crates/mint-core/src/browser/navigate.rs +82 -9
- package/crates/mint-core/src/browser/runtime.rs +284 -0
- package/crates/mint-core/src/browser/session.rs +263 -7
- package/crates/mint-core/src/browser/workflow.rs +386 -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/integrations/mcp_result.rs +45 -0
- package/crates/mint-core/src/lib.rs +10 -6
- package/crates/mint-core/src/media/image_proxy.rs +563 -0
- package/crates/mint-core/src/media/tool_images.rs +196 -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/orchestration/context_render.rs +450 -33
- package/crates/mint-core/src/orchestration/decision_parsing.rs +5 -23
- package/crates/mint-core/src/orchestration/diagnostics.rs +307 -0
- package/crates/mint-core/src/orchestration/image_regressions.rs +379 -0
- package/crates/mint-core/src/orchestration/loop_guard.rs +334 -0
- package/crates/mint-core/src/orchestration/mod.rs +1104 -560
- package/crates/mint-core/src/orchestration/reliability.rs +541 -0
- package/crates/mint-core/src/orchestration/repeated_failures.rs +8 -0
- package/crates/mint-core/src/orchestration/review_regressions.rs +174 -28
- package/crates/mint-core/src/orchestration/tools/files.rs +31 -3
- 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 +29 -5
- 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 +211 -0
- package/crates/mint-core/src/orchestration/verification.rs +36 -6
- package/crates/mint-core/src/orchestration/workspace_helpers.rs +54 -23
- package/crates/mint-core/src/prompts/agent.rs +31 -40
- package/crates/mint-core/src/prompts/tool_catalog.rs +134 -40
- package/crates/mint-core/src/search/web_search.rs +44 -3
- package/crates/mint-core/src/slash/mod.rs +464 -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 +77 -9
- package/crates/mint-core/src/system/config.rs +92 -3
- 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/out/web/assets/ArtifactPreviewPanel-DAT_Y7i0.css +1 -0
- package/out/web/assets/ArtifactPreviewPanel-S0dPfYFx.js +2 -0
- package/out/web/assets/CalculationCard-CRjP3E1j.js +1 -0
- package/out/web/assets/{CliSessionsView-CtzUJpK_.css → CliSessionsView-C3Br2v5Y.css} +1 -1
- package/out/web/assets/CliSessionsView-MI8kXMAb.js +1 -0
- package/out/web/assets/CodeReviewPage-CUJceQme.css +1 -0
- package/out/web/assets/CodeReviewPage-VCUgPla_.js +2 -0
- package/out/web/assets/CommandPalette-BD8SlTE5.js +1 -0
- package/out/web/assets/ImageGenCard-BCXxkVJX.js +1 -0
- package/out/web/assets/ImageSearchCard-N3yQOr8Z.js +1 -0
- package/out/web/assets/ImageStudioPanel-BP7N4rLr.js +1 -0
- package/out/web/assets/LibraryPage-WlviRdR8.js +2 -0
- package/out/web/assets/LinkedFoldersView-CKRgroWK.js +1 -0
- package/out/web/assets/McpRegistryPicker-CoS83vtc.js +1 -0
- package/out/web/assets/McpServersView-D3wHnuHg.js +1 -0
- package/out/web/assets/MermaidCard-NqrHdyJW.js +2 -0
- package/out/web/assets/MintDashboard-B2DJsDDO.css +1 -0
- package/out/web/assets/MintDashboard-COw_xol7.js +63 -0
- package/out/web/assets/PluginsView-jBYmcKh4.js +1 -0
- package/out/web/assets/RewindModal-DempuDod.js +1 -0
- package/out/web/assets/ScheduledTasksView-5uw9-V9H.js +1 -0
- package/out/web/assets/SelectField-DXBQtrUK.js +1 -0
- package/out/web/assets/SelectField-lFEkkWCU.css +1 -0
- package/out/web/assets/SettingsWindow-2YP3yj7s.js +4 -0
- package/out/web/assets/SettingsWindow-Dz8LQVgD.css +1 -0
- package/out/web/assets/SkillsView-C-gp9J7m.js +2 -0
- package/out/web/assets/StockCard-BDMCe7mx.js +1 -0
- package/out/web/assets/ToolSurfacePage-B0J_q0Jl.js +38 -0
- package/out/web/assets/ToolSurfacePage-CRIQ1owD.css +1 -0
- package/out/web/assets/UiFeatureCard-6BwxTOCe.js +1 -0
- package/out/web/assets/UiGridCard-DvZcLNxb.js +1 -0
- package/out/web/assets/UiMockupWidget-DD73QWg1.js +1 -0
- package/out/web/assets/VeoStudioPanel-DfsOJKv0.js +4 -0
- package/out/web/assets/WeatherCard-CPucIfq8.js +1 -0
- package/out/web/assets/WorkspacePanel-BfHKkulU.js +1 -0
- package/out/web/assets/WorkspacePdfPreview-Dx_lkjNu.js +2 -0
- package/out/web/assets/abnfDiagram-VCTEODGH-BOo3Ckng.js +1 -0
- package/out/web/assets/architecture-7GRP2DOG-ZOwheW3n.js +1 -0
- package/out/web/assets/architectureDiagram-5GKGNRK7-DC2FDzVd.js +36 -0
- package/out/web/assets/{blockDiagram-NRAW4CY4-BrrqzHW5.js → blockDiagram-I7D4REHJ-BrKFWdAH.js} +4 -4
- package/out/web/assets/c4Diagram-7LVT6UL2-BHTHK1Yd.js +38 -0
- package/out/web/assets/chunk-2Q5K7J3B-D2JLPQzF.js +1 -0
- package/out/web/assets/{chunk-TEH6E4GO-G4Cdlyrt.js → chunk-4HAMMTFA-BYFkZwNj.js} +3 -3
- package/out/web/assets/{chunk-5VM5RSS4-BiPuE0io.js → chunk-5VM5RSS4-BZ2oBPYQ.js} +1 -1
- package/out/web/assets/chunk-75Z2AOVW-BSKfSKSA.js +2 -0
- package/out/web/assets/chunk-DU6HZSFF-vIhsiW6n.js +128 -0
- package/out/web/assets/chunk-F27PBJKO-BlYpW9xq.js +1 -0
- package/out/web/assets/chunk-FOHPRMQF-JXEeeJ9r.js +161 -0
- package/out/web/assets/{chunk-GMAD6QVW-BuhEcgHq.js → chunk-GMAD6QVW-BIBz_Ug5.js} +12 -12
- package/out/web/assets/chunk-GVQU2GXP-NPSHxeqC.js +1 -0
- package/out/web/assets/chunk-IMKFNOWR-YlJK8_Fp.js +231 -0
- package/out/web/assets/chunk-JWPE2WC7-BeEMUFDw.js +1 -0
- package/out/web/assets/chunk-L3NEJ4N5-DMYi4-af.js +1 -0
- package/out/web/assets/chunk-OSK3NFVY-Begd3-jA.js +10 -0
- package/out/web/assets/chunk-P2QGCYS3-D1I4xFHN.js +1 -0
- package/out/web/assets/chunk-POPQ4Y6H-CafZZzNE.js +1 -0
- package/out/web/assets/chunk-PWAF6VOD-Dwh6_Lnt.js +1 -0
- package/out/web/assets/chunk-SHT3W25Y-B0XrCSEb.js +168 -0
- package/out/web/assets/{chunk-SVP7TREG-Bu_yYb-V.js → chunk-SVP7TREG-CxLsddxC.js} +1 -1
- package/out/web/assets/{chunk-LCL6LL3I-BhXV9zyH.js → chunk-TICWLB2K-y156QInb.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-BgJ5WtSp.js +1 -0
- package/out/web/assets/classDiagram-v2-VYDZK3BY-BgJ5WtSp.js +1 -0
- package/out/web/assets/config-CvIO5hkn.js +2 -0
- package/out/web/assets/config-DqXJXeZM.css +1 -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-SMVvrLf-.js +1 -0
- package/out/web/assets/cynefinDiagram-5FMLGOSQ-rZznN24T.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-BOToydFu.js +4 -0
- package/out/web/assets/diagram-S7CK7UJ4-TMVaGQEJ.js +30 -0
- package/out/web/assets/diagram-UQ7AKVKN-C2JK-GP2.js +41 -0
- package/out/web/assets/{diagram-VSXAHHWV-BJ86Ov2Y.js → diagram-VSXAHHWV-Cw8VSi2K.js} +1 -1
- package/out/web/assets/diagram-VX7I27RA-DXp4fKk9.js +24 -0
- package/out/web/assets/diagram-Z3DM3KII-CzSicYiW.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-Dqj-zqPu.js +1 -0
- package/out/web/assets/{erDiagram-SSCWMZ5O-CzzmnZWT.js → erDiagram-RLTQ6QDP-DZwFZAuD.js} +3 -3
- package/out/web/assets/event-D7D-EBy9.js +1 -0
- package/out/web/assets/eventmodeling-NTZA5JFV-C0O-Lvgp.js +1 -0
- package/out/web/assets/flowDiagram-HODETNUW-uqCHJond.js +1 -0
- package/out/web/assets/ganttDiagram-EL5Y4UJY-Da4ULXTl.js +292 -0
- package/out/web/assets/gitGraph-4MIJSDKK-B9wNFZIP.js +1 -0
- package/out/web/assets/gitGraphDiagram-WWUBYQGX-RjrhB0MP.js +106 -0
- package/out/web/assets/graphlib-Bh9gHply.js +1 -0
- package/out/web/assets/index-BmpulIkg.js +168 -0
- package/out/web/assets/index-CkvBwhX_.css +1 -0
- package/out/web/assets/info-A6RAGUB7-B3dfCpeY.js +1 -0
- package/out/web/assets/infoDiagram-27XIBGKW-QVWkLVx7.js +2 -0
- package/out/web/assets/{ishikawaDiagram-5VMMS53U-s38yo28y.js → ishikawaDiagram-5VMMS53U-CLFNIRI9.js} +4 -4
- package/out/web/assets/journeyDiagram-3NMN7TZE-fgOQadYF.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-G3Q_9g9O.js} +6 -6
- package/out/web/assets/katex-MCdQaEAD.js +257 -0
- package/out/web/assets/mermaid-parser.core-v3Jm7nco.js +7 -0
- package/out/web/assets/mermaid.core-DTEjLUA1.js +44 -0
- package/out/web/assets/{mindmap-definition-FBJOCRG2-260WBDxZ.js → mindmap-definition-YA3MSWOX-C_D42_fF.js} +4 -4
- package/out/web/assets/modelManager-BPLycQrN.js +2 -0
- package/out/web/assets/oauthManager-BUK7ic7q.js +1 -0
- package/out/web/assets/packet-AYTQ26CC-B-R-SHlF.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-Da2q_giz.js +1 -0
- package/out/web/assets/pie-WAS4IAKB-BC8F0N7-.js +1 -0
- package/out/web/assets/pieDiagram-E7YTZNPT-Iy9REJNC.js +39 -0
- package/out/web/assets/{quadrantDiagram-AXDQQJYC-B8D3gU5d.js → quadrantDiagram-AXDQQJYC-ztsiYw7h.js} +4 -4
- package/out/web/assets/radar-RG4KPBEZ-B_1P8Z_z.js +1 -0
- package/out/web/assets/railroad-74A4TZTK-DuTqczSo.js +1 -0
- package/out/web/assets/railroad-abnf-HS5TGJTU-Df29WLmp.js +1 -0
- package/out/web/assets/railroad-ebnf-LZEXJU2U-ePFMo-qp.js +1 -0
- package/out/web/assets/railroad-peg-WCYAUIDC-DYXLW4_E.js +1 -0
- package/out/web/assets/railroadDiagram-O6MQD6OU-LStnZf2S.js +1 -0
- package/out/web/assets/{requirementDiagram-EFPCY7ZU-D2X-Ewik.js → requirementDiagram-BXWQKSXE-DmzonMH-.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-B8vjmUU1.js +40 -0
- package/out/web/assets/sequenceDiagram-WJ2MYXX4-CTnplOAX.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-BFrIaLdI.js +1 -0
- package/out/web/assets/stateDiagram-v2-MP3YSRHH-uf3kdNW4.js +1 -0
- package/out/web/assets/studio-BBZQ_-QK.js +1 -0
- package/out/web/assets/swimlanes-42K2YHIH-BXGngUNU.js +1 -0
- package/out/web/assets/swimlanesDiagram-VR7AAH4N-Y8q5bQce.js +8 -0
- package/out/web/assets/timeline-definition-24CTP7MA-CegH7n43.js +120 -0
- package/out/web/assets/treeView-Q6P3EWNA-DTpJv2Tw.js +1 -0
- package/out/web/assets/treemap-WGGIJYW6-i8M9iJU6.js +1 -0
- package/out/web/assets/vennDiagram-4TSXK5OY-Dpzo1S8U.js +34 -0
- package/out/web/assets/wardley-WFR3VGLG-BrNsgtfw.js +1 -0
- package/out/web/assets/{wardleyDiagram-VM6X3IG4-DAdXELbQ.js → wardleyDiagram-VM6X3IG4-lQ92LFE1.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-BaOaEoBd.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/slash-commands.json +8 -2
- 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 +11 -2
- 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 +57 -0
- package/src/renderer/shared/components/Settings/AvatarCropModal.tsx +18 -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 +40 -82
- 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.tsx +13 -1
- package/src/renderer/shared/components/{AgentActivityDrawer.tsx → activity/AgentActivityDrawer.tsx} +77 -61
- package/src/renderer/shared/components/{AgentActivityTable.tsx → activity/AgentActivityTable.tsx} +46 -7
- package/src/renderer/shared/components/{McpToolResults.tsx → activity/McpToolResults.tsx} +32 -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} +97 -43
- 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 +140 -0
- package/src/renderer/shared/components/{AuthGate.tsx → app/AuthGate.tsx} +3 -3
- package/src/renderer/shared/components/{ChunkErrorBoundary.tsx → app/ChunkErrorBoundary.tsx} +10 -10
- package/src/renderer/shared/components/{CommandPalette.tsx → app/CommandPalette.tsx} +25 -25
- package/src/renderer/shared/components/{DashboardSidebar.tsx → app/DashboardSidebar.tsx} +7 -5
- package/src/renderer/shared/components/{DesktopTitlebar.tsx → app/DesktopTitlebar.tsx} +7 -24
- package/src/renderer/shared/components/{ErrorNotice.tsx → app/ErrorNotice.tsx} +1 -1
- package/src/renderer/shared/components/{MintDashboard.tsx → app/MintDashboard.tsx} +191 -212
- package/src/renderer/shared/components/{ModalErrorBoundary.tsx → app/ModalErrorBoundary.tsx} +5 -5
- package/src/renderer/shared/components/{CalculationCard.tsx → cards/CalculationCard.tsx} +13 -27
- package/src/renderer/shared/components/{ImageGenCard.tsx → cards/ImageGenCard.tsx} +9 -22
- package/src/renderer/shared/components/{ImageSearchCard.tsx → cards/ImageSearchCard.tsx} +9 -22
- package/src/renderer/shared/components/{MermaidCard.tsx → cards/MermaidCard.tsx} +37 -21
- package/src/renderer/shared/components/{StockCard.tsx → cards/StockCard.tsx} +15 -31
- package/src/renderer/shared/components/cards/ToolResultCards.tsx +86 -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/{WeatherCard.tsx → cards/WeatherCard.tsx} +1 -1
- package/src/renderer/shared/components/{ApprovalCard.test.tsx → chat/ApprovalCard.test.tsx} +1 -1
- package/src/renderer/shared/components/{ApprovalCard.tsx → chat/ApprovalCard.tsx} +5 -5
- package/src/renderer/shared/components/{ChatCodeBlock.tsx → chat/ChatCodeBlock.tsx} +1 -1
- package/src/renderer/shared/components/{ChatMessageItem.test.tsx → chat/ChatMessageItem.test.tsx} +92 -15
- package/src/renderer/shared/components/{ChatMessageItem.tsx → chat/ChatMessageItem.tsx} +73 -157
- package/src/renderer/shared/components/chat/ChatPanel.test.tsx +31 -0
- package/src/renderer/shared/components/{ChatPanel.tsx → chat/ChatPanel.tsx} +244 -493
- package/src/renderer/shared/components/{CollapsiblePasteInput.tsx → chat/CollapsiblePasteInput.tsx} +2 -2
- package/src/renderer/shared/components/{DiffReviewModal.tsx → chat/DiffReviewModal.tsx} +40 -40
- package/src/renderer/shared/components/{GeminiLiveOverlay.tsx → chat/GeminiLiveOverlay.tsx} +2 -2
- package/src/renderer/shared/components/{ModelSelectorPopover.tsx → chat/ModelSelectorPopover.tsx} +3 -3
- 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} +4 -4
- package/src/renderer/shared/components/{SlashChoicePanel.tsx → chat/SlashChoicePanel.tsx} +2 -2
- package/src/renderer/shared/components/{SlashSuggestions.tsx → chat/SlashSuggestions.tsx} +4 -4
- package/src/renderer/shared/components/{SourcesBlock.tsx → chat/SourcesBlock.tsx} +30 -37
- package/src/renderer/shared/components/{ThinkingBlock.tsx → chat/ThinkingBlock.tsx} +1 -1
- package/src/renderer/shared/components/chat/TurnFileChanges.test.tsx +86 -0
- package/src/renderer/shared/components/chat/TurnFileChanges.tsx +430 -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} +14 -12
- package/src/renderer/shared/components/{LinkedFoldersView.tsx → extensions/LinkedFoldersView.tsx} +3 -3
- package/src/renderer/shared/components/{McpRegistryPicker.tsx → extensions/McpRegistryPicker.tsx} +3 -3
- 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} +5 -5
- 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} +256 -112
- 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/{CodeReviewPage.tsx → workspace/CodeReviewPage.tsx} +47 -8
- package/src/renderer/shared/components/{GitBranchSelector.tsx → workspace/GitBranchSelector.tsx} +2 -2
- 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 +68 -0
- package/src/renderer/shared/components/{ToolSurfacePage.tsx → workspace/ToolSurfacePage.tsx} +322 -71
- 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 +89 -0
- package/src/renderer/shared/components/{WorkspacePreviewActions.test.tsx → workspace/WorkspacePreviewActions.test.tsx} +48 -3
- 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/{workspace-selector.css → workspace/workspace-selector.css} +84 -2
- package/src/renderer/shared/constants/config.ts +7 -0
- 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 +163 -1
- package/src/renderer/shared/conversation/lifecycle.ts +164 -7
- 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 +72 -11
- package/src/renderer/shared/css/chat-ui-cards.css +35 -35
- package/src/renderer/shared/css/code-review.css +86 -86
- package/src/renderer/shared/css/code-sessions.css +10 -10
- package/src/renderer/shared/css/file-changes.css +167 -5
- package/src/renderer/shared/css/management-views.css +78 -37
- package/src/renderer/shared/css/mcp-results.css +46 -3
- 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-web → shared}/css/settings/base.css +101 -107
- package/src/renderer/shared/css/settings/general.css +384 -92
- package/src/renderer/shared/css/settings/plugins.css +8 -8
- package/src/renderer/shared/css/settings/theme.css +44 -32
- package/src/renderer/shared/css/ui-tailwind.css +2 -2
- package/src/renderer/shared/css/viewed-images.css +89 -0
- 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 +10 -4
- 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 +20 -0
- package/src/renderer/shared/theme/themeManager.ts +3 -1
- package/src/renderer/shared/theme/themes.ts +17 -4
- package/src/renderer/shared/theme/tokens.css +448 -51
- package/src/renderer/shared/types.ts +56 -1
- package/src/renderer/shared/utils/agentActivity.test.ts +165 -6
- package/src/renderer/shared/utils/agentActivity.ts +181 -31
- package/src/renderer/shared/utils/artifactBrowser.ts +1 -1
- package/src/renderer/shared/utils/artifacts.ts +55 -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/lazyWithRetry.ts +13 -0
- package/src/renderer/shared/utils/markdown.tsx +169 -35
- package/src/renderer/shared/utils/markdown.webImages.test.tsx +124 -2
- package/src/renderer/shared/utils/mcpResults.test.tsx +24 -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 +4 -1
- package/src/renderer/shared/utils/speech.ts +18 -4
- 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.ts +30 -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 +41 -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 +6 -8
- 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.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 +45 -12
- package/src/renderer/src/components/browser-shell.css +26 -26
- package/src/renderer/src/components/browser-suggestions-popup.css +8 -8
- package/src/renderer/src/css/app-shell.css +22 -102
- package/src/renderer/src/css/chat.css +221 -34
- package/src/renderer/src/css/desktop-tools.css +6 -337
- package/src/renderer/src/css/sidebar-workspace.css +20 -0
- package/src/renderer/src/css/spotlight.css +2 -2
- package/src/renderer/src/css/tool-surfaces.css +328 -58
- package/src/renderer/src/css/widget.css +6 -5
- package/src/renderer/src/env.d.ts +13 -0
- package/src/renderer/src/index.css +15 -63
- package/src/renderer/src/tauri.ts +77 -11
- package/src/renderer/src/voiceInput.ts +3 -1
- package/src/renderer/src-web/App.tsx +6 -8
- 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 +16 -100
- package/src/renderer/src-web/css/chat.css +221 -34
- package/src/renderer/src-web/css/sidebar-workspace.css +20 -0
- package/src/renderer/src-web/env.d.ts +14 -0
- package/src/renderer/src-web/index.css +15 -63
- package/src/renderer/src-web/tauri.ts +71 -13
- 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 +1 -1
- package/src/renderer/tests/liveOrb.browser.html +1 -1
- 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 +44 -1
- package/src-tauri/src/commands/conversation.rs +99 -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/tsconfig.json +15 -1
- package/vite.config.ts +2 -1
- package/vite.config.web.ts +2 -0
- 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/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/src/renderer/shared/components/ChatPanel.test.tsx +0 -21
- package/src/renderer/shared/components/FormattedMessage.tsx +0 -11
- 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/ui/demo.tsx +0 -26
- package/src/renderer/shared/css/session-sources-popover.css +0 -9
- 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/css/pictures.css +0 -2
- package/src/renderer/src/css/settings/base.css +0 -1266
- 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/spotlight.css +0 -102
- package/src/renderer/src-web/css/widget.css +0 -213
- /package/src/renderer/shared/components/{UiMockupWidget.tsx → cards/UiMockupWidget.tsx} +0 -0
- /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/{GeminiLiveOverlay.test.tsx → chat/GeminiLiveOverlay.test.tsx} +0 -0
- /package/src/renderer/shared/components/{SlashSuggestions.test.tsx → chat/SlashSuggestions.test.tsx} +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
- /package/src/renderer/shared/components/{background-terminals.css → workspace/background-terminals.css} +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/WeatherCard-CPucIfq8.js","assets/rolldown-runtime-CNOWq4Kh.js","assets/jsx-runtime-DmUwWVTj.js","assets/index-BmpulIkg.js","assets/index-CkvBwhX_.css","assets/StockCard-BDMCe7mx.js","assets/CalculationCard-CRjP3E1j.js","assets/ImageSearchCard-N3yQOr8Z.js","assets/ImageGenCard-BCXxkVJX.js","assets/MermaidCard-NqrHdyJW.js","assets/UiGridCard-DvZcLNxb.js","assets/UiFeatureCard-6BwxTOCe.js","assets/UiMockupWidget-DD73QWg1.js","assets/ArtifactPreviewPanel-S0dPfYFx.js","assets/ArtifactPreviewPanel-DAT_Y7i0.css","assets/RewindModal-DempuDod.js","assets/SelectField-DXBQtrUK.js","assets/config-CvIO5hkn.js","assets/config-DqXJXeZM.css","assets/SelectField-lFEkkWCU.css","assets/CodeReviewPage-VCUgPla_.js","assets/CodeReviewPage-CUJceQme.css","assets/window-CkUOP7t0.js","assets/core-Mi3s5D4_.js","assets/event-D7D-EBy9.js","assets/WorkspacePanel-BfHKkulU.js","assets/ToolSurfacePage-B0J_q0Jl.js","assets/ToolSurfacePage-CRIQ1owD.css","assets/SkillsView-C-gp9J7m.js","assets/ScheduledTasksView-5uw9-V9H.js","assets/LinkedFoldersView-CKRgroWK.js","assets/McpServersView-D3wHnuHg.js","assets/McpRegistryPicker-CoS83vtc.js","assets/PluginsView-jBYmcKh4.js","assets/oauthManager-BUK7ic7q.js","assets/CliSessionsView-MI8kXMAb.js","assets/workspaces-SYPrmbgC.js","assets/CliSessionsView-C3Br2v5Y.css","assets/LibraryPage-WlviRdR8.js","assets/LibraryPage-DAxUTAg7.css","assets/ImageStudioPanel-BP7N4rLr.js","assets/studio-BBZQ_-QK.js","assets/ImageStudioPanel-D0lnhQV5.css","assets/VeoStudioPanel-DfsOJKv0.js","assets/modelManager-BPLycQrN.js","assets/VeoStudioPanel-DOj7_WR3.css","assets/CommandPalette-BD8SlTE5.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{An as o,Ar as s,B as c,Bn as l,Br as u,Bt as d,C as f,D as p,En as m,Er as h,Et as g,F as _,H as v,Hn as y,Ht as b,I as x,In as S,Ir as C,It as w,J as T,Jr as E,K as D,Kr as O,L as k,M as A,Mn as ee,Mr as te,N as j,O as M,Ot as ne,P as N,Pn as re,Pr as ie,Pt as ae,Qn as oe,Qt as se,Rn as P,S as ce,Sr as le,St as ue,T as de,Wn as fe,Wr as pe,Wt as me,_ as he,bn as ge,br as _e,cn as ve,cr as ye,en as be,et as xe,f as Se,fn as Ce,ft as we,g as Te,gr as Ee,h as De,it as Oe,j as ke,k as Ae,m as je,p as Me,un as Ne,ut as Pe,v as Fe,vr as Ie,w as Le,wn as Re,wr as ze}from"./index-BmpulIkg.js";import{$ as Be,A as Ve,B as He,C as Ue,D as We,Et as Ge,F as Ke,G as qe,H as Je,I as Ye,J as Xe,K as Ze,M as Qe,P as $e,Q as et,S as tt,T as nt,Tt as rt,U as it,V as at,X as ot,_ as st,a as ct,b as lt,c as ut,ct as dt,d as ft,dt as pt,f as mt,ft as ht,g as gt,gt as _t,h as vt,ht as yt,it as bt,j as xt,l as St,lt as Ct,m as wt,mt as Tt,n as Et,nt as Dt,o as Ot,ot as kt,p as At,pt as jt,q as Mt,r as Nt,s as Pt,st as Ft,t as It,tt as Lt,u as Rt,ut as zt,v as Bt,w as Vt,x as Ht,xt as Ut,y as Wt,yt as Gt,z as Kt}from"./config-CvIO5hkn.js";import{n as qt,r as Jt,t as Yt}from"./workspaces-SYPrmbgC.js";var Xt=t((()=>{}));function Zt(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Qt=t((()=>{}));function $t(e,t){return((t||nn).jsx?tn:en).test(e)}var en,tn,nn,rn=t((()=>{en=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,tn=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nn={}})),an=t((()=>{rn()}));function on(e){return typeof e==`object`?e.type===`text`&&sn(e.value):sn(e)}function sn(e){return e.replace(cn,``)===``}var cn,ln=t((()=>{cn=/[ \t\n\f\r]/g})),un=t((()=>{ln()})),dn,fn=t((()=>{dn=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}},dn.prototype.normal={},dn.prototype.property={},dn.prototype.space=void 0}));function pn(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new dn(n,r,t)}var mn=t((()=>{fn()}));function hn(e){return e.toLowerCase()}var gn=t((()=>{})),_n,vn=t((()=>{_n=class{constructor(e,t){this.attribute=t,this.property=e}},_n.prototype.attribute=``,_n.prototype.booleanish=!1,_n.prototype.boolean=!1,_n.prototype.commaOrSpaceSeparated=!1,_n.prototype.commaSeparated=!1,_n.prototype.defined=!1,_n.prototype.mustUseProperty=!1,_n.prototype.number=!1,_n.prototype.overloadedBoolean=!1,_n.prototype.property=``,_n.prototype.spaceSeparated=!1,_n.prototype.space=void 0})),yn=n({boolean:()=>F,booleanish:()=>Sn,commaOrSpaceSeparated:()=>En,commaSeparated:()=>Tn,number:()=>I,overloadedBoolean:()=>Cn,spaceSeparated:()=>wn});function bn(){return 2**++xn}var xn,F,Sn,Cn,I,wn,Tn,En,Dn=t((()=>{xn=0,F=bn(),Sn=bn(),Cn=bn(),I=bn(),wn=bn(),Tn=bn(),En=bn()}));function On(e,t,n){n&&(e[t]=n)}var kn,An,jn=t((()=>{vn(),Dn(),kn=Object.keys(yn),An=class extends _n{constructor(e,t,n,r){let i=-1;if(super(e,t),On(this,`space`,r),typeof n==`number`)for(;++i<kn.length;){let e=kn[i];On(this,kn[i],(n&yn[e])===yn[e])}}},An.prototype.defined=!0}));function Mn(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new An(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[hn(r)]=r,n[hn(a.attribute)]=r}return new dn(t,n,e.space)}var Nn=t((()=>{gn(),jn(),fn()})),Pn,Fn=t((()=>{Nn(),Dn(),Pn=Mn({properties:{ariaActiveDescendant:null,ariaAtomic:Sn,ariaAutoComplete:null,ariaBusy:Sn,ariaChecked:Sn,ariaColCount:I,ariaColIndex:I,ariaColSpan:I,ariaControls:wn,ariaCurrent:null,ariaDescribedBy:wn,ariaDetails:null,ariaDisabled:Sn,ariaDropEffect:wn,ariaErrorMessage:null,ariaExpanded:Sn,ariaFlowTo:wn,ariaGrabbed:Sn,ariaHasPopup:null,ariaHidden:Sn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:wn,ariaLevel:I,ariaLive:null,ariaModal:Sn,ariaMultiLine:Sn,ariaMultiSelectable:Sn,ariaOrientation:null,ariaOwns:wn,ariaPlaceholder:null,ariaPosInSet:I,ariaPressed:Sn,ariaReadOnly:Sn,ariaRelevant:null,ariaRequired:Sn,ariaRoleDescription:wn,ariaRowCount:I,ariaRowIndex:I,ariaRowSpan:I,ariaSelected:Sn,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 In(e,t){return t in e?e[t]:t}var Ln=t((()=>{}));function Rn(e,t){return In(e,t.toLowerCase())}var zn=t((()=>{Ln()})),Bn,Vn=t((()=>{zn(),Nn(),Dn(),Bn=Mn({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Tn,acceptCharset:wn,accessKey:wn,action:null,allow:null,allowFullScreen:F,allowPaymentRequest:F,allowUserMedia:F,alpha:F,alt:null,as:null,async:F,autoCapitalize:null,autoComplete:wn,autoFocus:F,autoPlay:F,blocking:wn,capture:null,charSet:null,checked:F,cite:null,className:wn,closedBy:null,colorSpace:null,cols:I,colSpan:I,command:null,commandFor:null,content:null,contentEditable:Sn,controls:F,controlsList:wn,coords:I|Tn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:F,defer:F,dir:null,dirName:null,disabled:F,download:Cn,draggable:Sn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:F,formTarget:null,headers:wn,height:I,hidden:Cn,high:I,href:null,hrefLang:null,htmlFor:wn,httpEquiv:wn,id:null,imageSizes:null,imageSrcSet:null,inert:F,inputMode:null,integrity:null,is:null,isMap:F,itemId:null,itemProp:wn,itemRef:wn,itemScope:F,itemType:wn,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:wn,placeholder:null,playsInline:F,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:F,referrerPolicy:null,rel:wn,required:F,reversed:F,rows:I,rowSpan:I,sandbox:wn,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:Sn,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:Sn,width:I,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:wn,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:Sn,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:Tn,part:wn,prefix:null,property:null,results:I,security:null,unselectable:null},space:`html`,transform:Rn})})),Hn,Un=t((()=>{Ln(),Nn(),Dn(),Hn=Mn({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:En,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:wn,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:Tn,g2:Tn,glyphName:Tn,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:En,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:wn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:I,pointsAtY:I,pointsAtZ:I,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:En,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:En,rev:En,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:En,requiredFeatures:En,requiredFonts:En,requiredFormats:En,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:En,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:En,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:En,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:In})})),Wn,Gn=t((()=>{Nn(),Wn=Mn({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()}})})),Kn,qn=t((()=>{Nn(),zn(),Kn=Mn({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Rn})})),Jn,Yn=t((()=>{Nn(),Jn=Mn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}})})),Xn,Zn=t((()=>{Xn={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 Qn(e,t){let n=hn(t),r=t,i=_n;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&rr.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(nr,er);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!nr.test(e)){let n=e.replace(tr,$n);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=An}return new i(r,t)}function $n(e){return`-`+e.toLowerCase()}function er(e){return e.charAt(1).toUpperCase()}var tr,nr,rr,ir=t((()=>{jn(),vn(),gn(),tr=/[A-Z]/g,nr=/-[a-z]/g,rr=/^data[-\w.:]+$/i})),ar,or,sr=t((()=>{mn(),Fn(),Vn(),Un(),Gn(),qn(),Yn(),Zn(),ir(),ar=pn([Pn,Bn,Wn,Kn,Jn],`html`),or=pn([Pn,Hn,Wn,Kn,Jn],`svg`)}));function cr(e){return e.join(` `).trim()}var lr=t((()=>{})),ur=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})),dr=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(ur());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}})),fr=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))}})),pr=r(((e,t,n)=>{var r=(n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(dr()),i=fr();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 mr(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 hr(e){let t=_r(e),n=gr(e);if(t&&n)return{start:t,end:n}}var gr,_r,vr=t((()=>{gr=mr(`end`),_r=mr(`start`)})),yr=t((()=>{vr()}));function br(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Sr(e.position):`start`in e||`end`in e?Sr(e):`line`in e||`column`in e?xr(e):``}function xr(e){return Cr(e&&e.line)+`:`+Cr(e&&e.column)}function Sr(e){return xr(e&&e.start)+`-`+xr(e&&e.end)}function Cr(e){return e&&typeof e==`number`?e:1}var wr=t((()=>{})),Tr=t((()=>{wr()})),Er,Dr=t((()=>{Tr(),Er=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=br(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}},Er.prototype.file=``,Er.prototype.name=``,Er.prototype.reason=``,Er.prototype.message=``,Er.prototype.stack=``,Er.prototype.column=void 0,Er.prototype.line=void 0,Er.prototype.ancestors=void 0,Er.prototype.cause=void 0,Er.prototype.fatal=void 0,Er.prototype.place=void 0,Er.prototype.ruleId=void 0,Er.prototype.source=void 0})),Or=t((()=>{Dr()}));function kr(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=Br(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=zr(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`?or:ar,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Ar(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Ar(e,t,n){if(t.type===`element`)return jr(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Mr(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Pr(e,t,n);if(t.type===`mdxjsEsm`)return Nr(e,t);if(t.type===`root`)return Fr(e,t,n);if(t.type===`text`)return Ir(e,t)}function jr(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=or,e.schema=i),e.ancestors.push(t);let a=Kr(e,t.tagName,!1),o=Vr(e,t),s=Ur(e,t);return ti.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!on(e)})),Lr(e,o,a,t),Rr(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Mr(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)}qr(e,t.position)}function Nr(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);qr(e,t.position)}function Pr(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=or,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Kr(e,t.name,!0),o=Hr(e,t),s=Ur(e,t);return Lr(e,o,a,t),Rr(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Fr(e,t,n){let r={};return Rr(r,Ur(e,t)),e.create(t,e.Fragment,r,n)}function Ir(e,t){return t.value}function Lr(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Rr(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function zr(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 Br(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=_r(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 Vr(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Qr.call(t.properties,i)){let a=Wr(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&ni.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 Hr(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 qr(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 qr(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Ur(e,t){let n=[],r=-1,i=e.passKeys?new Map:$r;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=Ar(e,a,o);s!==void 0&&n.push(s)}return n}function Wr(e,t,n){let r=Qn(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Zt(n):cr(n)),r.property===`style`){let t=typeof n==`object`?n:Gr(e,String(n));return e.stylePropertyNameCase===`css`&&(t=Jr(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Xn[r.property]||r.property:r.attribute,n]}}function Gr(e,t){try{return(0,Zr.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Er("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=ri+`#cannot-parse-style-attribute`,r}}function Kr(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=$t(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=$t(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Qr.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);qr(e)}function qr(e,t){let n=new Er("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=ri+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function Jr(e){let t={},n;for(n in e)Qr.call(e,n)&&(t[Yr(n)]=e[n]);return t}function Yr(e){let t=e.replace(ei,Xr);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Xr(e){return`-`+e.toLowerCase()}var Zr,Qr,$r,ei,ti,ni,ri,ii=t((()=>{Qt(),Xt(),an(),un(),sr(),lr(),Zr=e(pr(),1),yr(),Or(),Qr={}.hasOwnProperty,$r=new Map,ei=/[A-Z]/g,ti=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),ni=new Set([`td`,`th`]),ri=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`})),ai=t((()=>{ii()})),oi,si=t((()=>{oi={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`]}})),ci=t((()=>{si()}));function li(e,t){let n=t||pi;return ui(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function ui(e,t,n){if(fi(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 di(e.children,t,n)}return Array.isArray(e)?di(e,t,n):``}function di(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=ui(e[i],t,n);return r.join(``)}function fi(e){return!!(e&&typeof e==`object`)}var pi,mi=t((()=>{pi={}})),hi=t((()=>{mi()}));function gi(e){let t=`&`+e+`;`;_i.innerHTML=t;let n=_i.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}var _i,vi=t((()=>{_i=document.createElement(`i`)}));function yi(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 bi(e,t){return e.length>0?(yi(e,e.length,0,t),e):t}var xi=t((()=>{}));function Si(e){let t={},n=-1;for(;++n<e.length;)Ci(t,e[n]);return t}function Ci(e,t){let n;for(n in t){let r=(Ti.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Ti.call(r,a)||(r[a]=[]);let e=i[a];wi(r[a],Array.isArray(e)?e:e?[e]:[])}}}function wi(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);yi(e,0,0,r)}var Ti,Ei=t((()=>{xi(),Ti={}.hasOwnProperty}));function Di(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 Oi=t((()=>{}));function ki(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var Ai=t((()=>{}));function ji(e){return e!==null&&(e<32||e===127)}function L(e){return e!==null&&e<-2}function Mi(e){return e!==null&&(e<0||e===32)}function Ni(e){return e===-2||e===-1||e===32}function Pi(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}var Fi,Ii,Li,Ri,zi,Bi,Vi,Hi,Ui=t((()=>{Fi=Pi(/[A-Za-z]/),Ii=Pi(/[\dA-Za-z]/),Li=Pi(/[#-'*+\--9=?A-Z^-~]/),Ri=Pi(/\d/),zi=Pi(/[\dA-Fa-f]/),Bi=Pi(/[!-/:-@[-`{-~]/),Vi=Pi(/\p{P}|\p{S}/u),Hi=Pi(/\s/)}));function Wi(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&Ii(e.charCodeAt(n+1))&&Ii(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 Gi=t((()=>{Ui()}));function Ki(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Ni(r)?(e.enter(n),s(r)):t(r)}function s(r){return Ni(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var qi=t((()=>{Ui()}));function Ji(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`),Ki(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 Yi,Xi=t((()=>{qi(),Ui(),Yi={tokenize:Ji}}));function Zi(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 yi(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(ea,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(ea,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++;yi(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 Qi(e,t,n){return Ki(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}var $i,ea,ta=t((()=>{qi(),Ui(),xi(),$i={tokenize:Zi},ea={tokenize:Qi}}));function na(e){if(e===null||Mi(e)||Hi(e))return 1;if(Vi(e))return 2}var ra=t((()=>{Ui()}));function ia(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 aa=t((()=>{}));function oa(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};ca(d,-c),ca(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=bi(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=bi(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=bi(l,ia(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=bi(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=bi(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,yi(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 sa(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=na(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=na(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 ca(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var la,ua=t((()=>{xi(),ra(),aa(),la={name:`attention`,resolveAll:oa,tokenize:sa}}));function da(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 Fi(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Ii(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||Ii(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||ji(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Li(t)?(e.consume(t),l):n(t)}function u(e){return Ii(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||Ii(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var fa,pa=t((()=>{Ui(),fa={name:`autolink`,tokenize:da}}));function ma(e,t,n){return r;function r(t){return Ni(t)?Ki(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||L(e)?t(e):n(e)}}var ha,ga=t((()=>{qi(),Ui(),ha={partial:!0,tokenize:ma}}));function _a(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 Ni(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function va(e,t,n){let r=this;return i;function i(t){return Ni(t)?Ki(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(ba,t,n)(r)}}function ya(e){e.exit(`blockQuote`)}var ba,xa=t((()=>{qi(),Ui(),ba={continuation:{tokenize:va},exit:ya,name:`blockQuote`,tokenize:_a}}));function Sa(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 Bi(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Ca,wa=t((()=>{Ui(),Ca={name:`characterEscape`,tokenize:Sa}}));function Ta(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=Ii,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=zi,u):(e.enter(`characterReferenceValue`),a=7,o=Ri,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Ii&&!gi(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 Ea,Da=t((()=>{vi(),Ui(),Ea={name:`characterReference`,tokenize:Ta}}));function Oa(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`),Ni(t)?Ki(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||L(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Aa,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)):Ni(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Ki(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&&Ni(t)?Ki(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||L(t)?e.check(Aa,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`),Ni(t)?Ki(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`),Ni(t)?Ki(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||L(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function ka(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 Aa,ja,Ma=t((()=>{qi(),Ui(),Aa={partial:!0,tokenize:ka},ja={concrete:!0,name:`codeFenced`,tokenize:Oa}}));function Na(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Ki(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(Ia,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 Pa(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):Ki(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 Fa,Ia,La=t((()=>{qi(),Ui(),Fa={name:`codeIndented`,tokenize:Na},Ia={partial:!0,tokenize:Pa}}));function Ra(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 za(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Ba(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 Va,Ha=t((()=>{Ui(),Va={name:`codeText`,previous:za,resolve:Ra,tokenize:Ba}}));function Ua(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 Wa,Ga=t((()=>{Wa=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&&Ua(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),Ua(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Ua(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);Ua(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Ua(this.left,t.reverse())}}}}}));function Ka(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Wa(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,qa(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 yi(e,0,1/0,u.slice(0)),!l}function qa(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 Ja=t((()=>{xi(),Ga()}));function Ya(e){return Ka(e),e}function Xa(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($a,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 Za(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Ki(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 Qa,$a,eo=t((()=>{qi(),Ui(),Ja(),Qa={resolve:Ya,tokenize:Xa},$a={partial:!0,tokenize:Za}}));function to(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||ji(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||Mi(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||ji(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 no=t((()=>{Ui()}));function ro(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||=!Ni(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}var io=t((()=>{Ui()}));function ao(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`),Ki(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 oo=t((()=>{qi(),Ui()}));function so(e,t){let n;return r;function r(i){return L(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Ni(i)?Ki(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var co=t((()=>{qi(),Ui()}));function lo(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return ro.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=ki(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 Mi(t)?so(e,l)(t):l(t)}function l(t){return to(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(po,d,d)(t)}function d(t){return Ni(t)?Ki(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 uo(e,t,n){return r;function r(t){return Mi(t)?so(e,i)(t):n(t)}function i(t){return ao(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Ni(t)?Ki(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||L(e)?t(e):n(e)}}var fo,po,mo=t((()=>{no(),io(),qi(),oo(),co(),Ui(),Ai(),fo={name:`definition`,tokenize:lo},po={partial:!0,tokenize:uo}}));function ho(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 go,_o=t((()=>{Ui(),go={name:`hardBreakEscape`,tokenize:ho}}));function vo(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`},yi(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function yo(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||Mi(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)):Ni(n)?Ki(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||Mi(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var bo,xo=t((()=>{qi(),Ui(),xi(),bo={name:`headingAtx`,resolve:vo,tokenize:yo}})),So,Co,wo=t((()=>{So=`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(`.`),Co=[`pre`,`script`,`style`,`textarea`]}));function To(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 Eo(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:N):Fi(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):Fi(a)?(e.consume(a),i=4,r.interrupt?t:N):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:N):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 Fi(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Mi(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Co.includes(l)?(i=1,r.interrupt?t(s):O(s)):So.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||Ii(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 Ni(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Fi(t)?(e.consume(t),b):Ni(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||Ii(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Ni(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):Ni(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||Mi(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Ni(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):Ni(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),re):t===63&&i===3?(e.consume(t),N):t===93&&i===5?(e.consume(t),ne):L(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Ao,ie,k)(t)):t===null||L(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(jo,A,ie)(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),N):O(t)}function j(t){return t===47?(e.consume(t),o=``,M):O(t)}function M(t){if(t===62){let n=o.toLowerCase();return Co.includes(n)?(e.consume(t),re):O(t)}return Fi(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),M):O(t)}function ne(t){return t===93?(e.consume(t),N):O(t)}function N(t){return t===62?(e.consume(t),re):t===45&&i===2?(e.consume(t),N):O(t)}function re(t){return t===null||L(t)?(e.exit(`htmlFlowData`),ie(t)):(e.consume(t),re)}function ie(n){return e.exit(`htmlFlow`),t(n)}}function Do(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 Oo(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(ha,t,n)}}var ko,Ao,jo,Mo=t((()=>{Ui(),wo(),ga(),ko={concrete:!0,name:`htmlFlow`,resolveTo:To,tokenize:Eo},Ao={partial:!0,tokenize:Oo},jo={partial:!0,tokenize:Do}}));function No(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):Fi(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):Fi(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 Fi(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Ii(t)?(e.consume(t),S):C(t)}function C(t){return L(t)?(o=C,j(t)):Ni(t)?(e.consume(t),C):te(t)}function w(t){return t===45||Ii(t)?(e.consume(t),w):t===47||t===62||Mi(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),te):t===58||t===95||Fi(t)?(e.consume(t),E):L(t)?(o=T,j(t)):Ni(t)?(e.consume(t),T):te(t)}function E(t){return t===45||t===46||t===58||t===95||Ii(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):L(t)?(o=D,j(t)):Ni(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)):Ni(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||Mi(t)?T(t):(e.consume(t),A)}function ee(e){return e===47||e===62||Mi(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`),M}function M(t){return Ni(t)?Ki(e,ne,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ne(t)}function ne(t){return e.enter(`htmlTextData`),o(t)}}var Po,Fo=t((()=>{qi(),Ui(),Po={name:`htmlText`,tokenize:No}}));function Io(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&&yi(e,0,e.length,n),e}function Lo(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=bi(s,e.slice(a+1,a+r+3)),s=bi(s,[[`enter`,u,t]]),s=bi(s,ia(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=bi(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=bi(s,e.slice(o+1)),s=bi(s,[[`exit`,c,t]]),yi(e,a,e.length,s),e}function Ro(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(ki(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(Uo,u,o?u:d)(t):t===91?e.attempt(Wo,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Go,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function zo(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 Mi(t)?so(e,a)(t):a(t)}function a(t){return t===41?u(t):to(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Mi(t)?so(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?ao(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Mi(t)?so(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 Bo(e,t,n){let r=this;return i;function i(t){return ro.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(ki(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Vo(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 Ho,Uo,Wo,Go,Ko=t((()=>{no(),io(),oo(),co(),Ui(),xi(),Ai(),aa(),Ho={name:`labelEnd`,resolveAll:Io,resolveTo:Lo,tokenize:Ro},Uo={tokenize:zo},Wo={tokenize:Bo},Go={tokenize:Vo}}));function qo(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 Jo,Yo=t((()=>{Ko(),Jo={name:`labelStartImage`,resolveAll:Ho.resolveAll,tokenize:qo}}));function Xo(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 Zo,Qo=t((()=>{Ko(),Zo={name:`labelStartLink`,resolveAll:Ho.resolveAll,tokenize:Xo}}));function $o(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Ki(e,t,`linePrefix`)}}var es,ts=t((()=>{qi(),es={name:`lineEnding`,tokenize:$o}}));function ns(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`),Ni(t)?Ki(e,s,`whitespace`)(t):s(t))}}var rs,is=t((()=>{qi(),Ui(),rs={name:`thematicBreak`,tokenize:ns}}));function as(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:Ri(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(rs,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 Ri(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(ha,r.interrupt?n:u,e.attempt(ds,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Ni(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 os(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(ha,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ki(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Ni(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(fs,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ki(e,e.attempt(us,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function ss(e,t,n){let r=this;return Ki(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 cs(e){e.exit(this.containerState.type)}function ls(e,t,n){let r=this;return Ki(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!Ni(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var us,ds,fs,ps=t((()=>{qi(),Ui(),ga(),is(),us={continuation:{tokenize:os},exit:cs,name:`list`,tokenize:as},ds={partial:!0,tokenize:ls},fs={partial:!0,tokenize:ss}}));function ms(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 hs(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`),Ni(t)?Ki(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||L(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var gs,_s=t((()=>{qi(),Ui(),gs={name:`setextUnderline`,resolveTo:ms,tokenize:hs}})),vs=t((()=>{ua(),pa(),ga(),xa(),wa(),Da(),Ma(),La(),Ha(),eo(),mo(),_o(),xo(),Mo(),Fo(),Ko(),Yo(),Qo(),ts(),ps(),_s(),is()}));function ys(e){let t=this,n=e.attempt(ha,r,e.attempt(this.parser.constructs.flowInitial,i,Ki(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Qa,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 bs,xs=t((()=>{vs(),qi(),bs={tokenize:ys}}));function Ss(e){return{resolveAll:Cs(e===`text`?ws: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 Cs(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 ws(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 Ts,Es,Ds,Os=t((()=>{Ts={resolveAll:Cs()},Es=Ss(`string`),Ds=Ss(`text`)})),ks=n({attentionMarkers:()=>Ls,contentInitial:()=>js,disable:()=>Rs,document:()=>As,flow:()=>Ns,flowInitial:()=>Ms,insideSpan:()=>Is,string:()=>Ps,text:()=>Fs}),As,js,Ms,Ns,Ps,Fs,Is,Ls,Rs,zs=t((()=>{vs(),Os(),As={42:us,43:us,45:us,48:us,49:us,50:us,51:us,52:us,53:us,54:us,55:us,56:us,57:us,62:ba},js={91:fo},Ms={[-2]:Fa,[-1]:Fa,32:Fa},Ns={35:bo,42:rs,45:[gs,rs],60:ko,61:gs,95:rs,96:ja,126:ja},Ps={38:Ea,92:Ca},Fs={[-5]:es,[-4]:es,[-3]:es,33:Jo,38:Ea,42:la,60:[fa,Po],91:Zo,92:[go,Ca],93:Ho,95:la,96:Va},Is={null:[la,Ts]},Ls={null:[42,95]},Rs={null:[]}}));function Bs(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=bi(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=ia(a,l.events,l),l.events):[]}function f(e,t){return Hs(p(e),t)}function p(e){return Vs(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&&yi(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 Vs(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 Hs(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 Us=t((()=>{Ui(),xi(),aa()}));function Ws(e){let t={constructs:Si([ks,...(e||{}).extensions||[]]),content:n(Yi),defined:[],document:n($i),flow:n(bs),lazy:{},string:n(Es),text:n(Ds)};return t;function n(e){return n;function n(n){return Bs(t,e,n)}}}var Gs=t((()=>{Ei(),Xi(),ta(),xs(),Os(),zs(),Us()}));function Ks(e){for(;!Ka(e););return e}var qs=t((()=>{Ja()}));function Js(){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(Ys.lastIndex=u,c=Ys.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 Ys,Xs=t((()=>{Ys=/[\0\t\n\r]/g})),Zs=t((()=>{vi(),Ei(),Gi(),Gs(),qs(),Xs()}));function Qs(e){return e.replace(ec,$s)}function $s(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Di(n.slice(t?2:1),t?16:10)}return gi(n)||e}var ec,tc=t((()=>{vi(),Oi(),ec=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi}));function nc(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),rc(n)(Ks(Ws(n).document().write(Js()(e,t,!0))))}function rc(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(be),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ge),blockQuote:a(de),characterEscape:T,characterReference:T,codeFenced:a(fe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(fe,o),codeText:a(pe,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(me),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(he),hardBreakEscape:a(_e),hardBreakTrailing:a(_e),htmlFlow:a(ve,o),htmlFlowData:T,htmlText:a(ve,o),htmlTextData:T,image:a(ye),label:o,link:a(be),listItem:a(Se),listItemValue:f,listOrdered:a(xe,d),listUnordered:a(xe),paragraph:a(Ce),reference:ae,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ge),strong:a(we),thematicBreak:a(Ee)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ue,autolinkProtocol:le,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:P,characterReference:ce,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:ne,labelText:M,lineEnding:D,link:c(te),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:oe,resourceDestinationString:N,resourceTitleString:re,resource:ie,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};ac(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]];cc.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]||sc).call(a,void 0,e[0])}for(r.position={start:ic(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:ic(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:ic(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]||sc).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+br({start:e.start,end:e.end})+`): it’s not open`);n.position.end=ic(e.end)}function u(){return li(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=ki(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=Te(),n.position={start:ic(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=ic(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=ic(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 M(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Qs(t),n.identifier=ki(t).toLowerCase()}function ne(){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 N(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ie(){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=ki(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function se(e){this.data.characterReferenceType=e.type}function P(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Di(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=gi(t);let i=this.stack[this.stack.length-1];i.value+=r}function ce(e){let t=this.stack.pop();t.position.end=ic(e.end)}function le(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ue(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function de(){return{type:`blockquote`,children:[]}}function fe(){return{type:`code`,lang:null,meta:null,value:``}}function pe(){return{type:`inlineCode`,value:``}}function me(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function he(){return{type:`emphasis`,children:[]}}function ge(){return{type:`heading`,depth:0,children:[]}}function _e(){return{type:`break`}}function ve(){return{type:`html`,value:``}}function ye(){return{type:`image`,title:null,url:``,alt:null}}function be(){return{type:`link`,title:null,url:``,children:[]}}function xe(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Se(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Ce(){return{type:`paragraph`,children:[]}}function we(){return{type:`strong`,children:[]}}function Te(){return{type:`text`,value:``}}function Ee(){return{type:`thematicBreak`}}}function ic(e){return{line:e.line,column:e.column,offset:e.offset}}function ac(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?ac(e,r):oc(e,r)}}function oc(e,t){let n;for(n in t)if(cc.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 sc(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+br({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+br({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+br({start:t.start,end:t.end})+`) is still open`)}var cc,lc=t((()=>{hi(),Zs(),Oi(),tc(),Ai(),vi(),Tr(),cc={}.hasOwnProperty})),uc=t((()=>{lc()}));function dc(e){let t=this;t.parser=n;function n(n){return nc(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}var fc=t((()=>{uc()})),pc=t((()=>{fc()}));function mc(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 hc=t((()=>{}));function gc(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
6
|
+
`}]}var _c=t((()=>{}));function vc(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 yc=t((()=>{}));function bc(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var xc=t((()=>{}));function Sc(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Cc=t((()=>{}));function wc(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=Wi(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 Tc=t((()=>{Gi()}));function Ec(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 Dc=t((()=>{}));function Oc(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}var kc=t((()=>{}));function Ac(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 jc=t((()=>{}));function Mc(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ac(e,t);let i={src:Wi(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 Nc=t((()=>{Gi(),jc()}));function Pc(e,t){let n={src:Wi(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 Fc=t((()=>{Gi()}));function Ic(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 Lc=t((()=>{}));function Rc(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ac(e,t);let i={href:Wi(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 zc=t((()=>{Gi(),jc()}));function Bc(e,t){let n={href:Wi(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 Vc=t((()=>{Gi()}));function Hc(e,t,n){let r=e.all(t),i=n?Uc(n):Wc(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 Uc(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=Wc(n[r])}return t}function Wc(e){return e.spread??e.children.length>1}var Gc=t((()=>{}));function Kc(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 qc=t((()=>{}));function Jc(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Yc=t((()=>{}));function Xc(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}var Zc=t((()=>{}));function Qc(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var $c=t((()=>{}));function el(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=_r(t.children[1]),o=gr(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 tl=t((()=>{yr()}));function nl(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 rl=t((()=>{}));function il(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var al=t((()=>{}));function ol(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(sl(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(sl(t.slice(i),i>0,!1)),a.join(``)}function sl(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===cl||t===ll;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===cl||t===ll;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}var cl,ll,ul=t((()=>{cl=9,ll=32}));function dl(e,t){let n={type:`text`,value:ol(String(t.value))};return e.patch(t,n),e.applyData(t,n)}var fl=t((()=>{ul()}));function pl(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var ml=t((()=>{}));function hl(){}var gl,_l=t((()=>{hc(),_c(),yc(),xc(),Cc(),Tc(),Dc(),kc(),Nc(),Fc(),Lc(),zc(),Vc(),Gc(),qc(),Yc(),Zc(),$c(),tl(),rl(),al(),fl(),ml(),gl={blockquote:mc,break:gc,code:vc,delete:bc,emphasis:Sc,footnoteReference:wc,heading:Ec,html:Oc,imageReference:Mc,image:Pc,inlineCode:Ic,linkReference:Rc,link:Bc,listItem:Hc,list:Kc,paragraph:Jc,root:Xc,strong:Qc,table:el,tableCell:il,tableRow:nl,text:dl,thematicBreak:pl,toml:hl,yaml:hl,definition:hl,footnoteDefinition:hl}})),vl=t((()=>{})),yl,bl,xl,Sl,Cl=t((()=>{vl(),yl=typeof self==`object`?self:globalThis,bl=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new yl[e](t)},xl=(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 yl[e]==`function`?bl(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(bl(a,o),i)};return r},Sl=e=>xl(new Map,e)(0)})),wl,Tl,El,Dl,Ol,kl,Al,jl=t((()=>{vl(),wl=``,{toString:Tl}={},{keys:El}=Object,Dl=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Tl.call(e).slice(8,-1);switch(n){case`Array`:return[1,wl];case`Object`:return[2,wl];case`Date`:return[3,wl];case`RegExp`:return[4,wl];case`Map`:return[5,wl];case`Set`:return[6,wl];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},Ol=([e,t])=>e===0&&(t===`function`||t===`symbol`),kl=(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]=Dl(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 El(r))(e||!Ol(Dl(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,isNaN(r.getTime())?wl: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||!(Ol(Dl(n))||Ol(Dl(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!Ol(Dl(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},Al=(e,{json:t,lossy:n}={})=>{let r=[];return kl(!(t||n),!!t,new Map,r)(e),r}})),Ml,Nl=t((()=>{Cl(),jl(),Ml=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Sl(Al(e,t)):structuredClone(e):(e,t)=>Sl(Al(e,t))}));function Pl(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 Fl(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function Il(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Pl,r=e.options.footnoteBackLabel||Fl,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=Wi(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:{...Ml(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 Ll=t((()=>{Nl(),Gi()}));function Rl(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Wl(e[n]);return Vl(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function zl(e){let t=e;return Vl(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Bl(e){return Vl(t);function t(t){return t&&t.type===e}}function Vl(e){return t;function t(t,n,r){return!!(Ul(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Hl(){return!0}function Ul(e){return typeof e==`object`&&!!e&&`type`in e}var Wl,Gl=t((()=>{Wl=(function(e){if(e==null)return Hl;if(typeof e==`function`)return Vl(e);if(typeof e==`object`)return Array.isArray(e)?Rl(e):zl(e);if(typeof e==`string`)return Bl(e);throw Error(`Expected function, string, or object as test`)})})),Kl=t((()=>{Gl()}));function ql(e){return e}var Jl=t((()=>{}));function Yl(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Wl(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 (`+ql(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Zl,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Xl(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 Xl(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Zl:[e]}var Zl,Ql=t((()=>{Kl(),Jl(),Zl=[]})),$l=t((()=>{Ql()}));function eu(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),Yl(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 tu=t((()=>{$l()})),nu=t((()=>{tu()}));function ru(e,t){let n=t||uu,r=new Map,i=new Map,a={all:s,applyData:au,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...gl,...n.handlers},one:o,options:n,patch:iu,wrap:su};return eu(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(lu.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=Ml(n);return r.children=a.all(e),r}return Ml(e)}return(a.options.unknownHandler||ou)(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=cu(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=cu(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function iu(e,t){e.position&&(t.position=hr(e))}function au(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,Ml(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function ou(e,t){let n=t.data||{},r=`value`in t&&!(lu.call(n,`hProperties`)||lu.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 su(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 cu(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}var lu,uu,du=t((()=>{Nl(),nu(),yr(),_l(),lu={}.hasOwnProperty,uu={}}));function fu(e,t){let n=ru(e,t),r=n.one(e,void 0),i=Il(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 pu=t((()=>{Xt(),Ll(),du()})),mu=t((()=>{_l(),pu(),Ll()}));function hu(e,t){return e&&`run`in e?async function(n,r){let i=fu(n,{file:r,...t});await e.run(i,r)}:function(n,r){return fu(n,{file:r,...e||t})}}var gu=t((()=>{mu()})),_u=t((()=>{mu(),gu()}));function vu(e){if(e)throw e}var yu=t((()=>{})),bu=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 xu(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 Su=t((()=>{}));function Cu(){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?wu(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 wu(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 Tu=t((()=>{})),Eu=t((()=>{Tu()}));function Du(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Nu(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 Ou(e){if(Nu(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 ku(e){Nu(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 Au(...e){let t=-1,n;for(;++t<e.length;)Nu(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:ju(n)}function ju(e){Nu(e);let t=e.codePointAt(0)===47,n=Mu(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Mu(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 Nu(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Pu,Fu=t((()=>{Pu={basename:Du,dirname:Ou,extname:ku,join:Au,sep:`/`}}));function Iu(){return`/`}var Lu,Ru=t((()=>{Lu={cwd:Iu}}));function zu(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}var Bu=t((()=>{}));function Vu(e){if(typeof e==`string`)e=new URL(e);else if(!zu(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 Hu(e)}function Hu(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 Uu=t((()=>{Bu()}));function Wu(e,t){if(e&&e.includes(Pu.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Pu.sep+"`")}function Gu(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Ku(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function qu(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Ju,Yu,Xu=t((()=>{Or(),Fu(),Ru(),Uu(),Ju=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Yu=class{constructor(e){let t;t=e?zu(e)?{path:e}:typeof e==`string`||qu(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Lu.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Ju.length;){let e=Ju[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)Ju.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Pu.basename(this.path):void 0}set basename(e){Gu(e,`basename`),Wu(e,`basename`),this.path=Pu.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Pu.dirname(this.path):void 0}set dirname(e){Ku(this.basename,`dirname`),this.path=Pu.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Pu.extname(this.path):void 0}set extname(e){if(Wu(e,`extname`),Ku(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=Pu.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){zu(e)&&(e=Vu(e)),Gu(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Pu.basename(this.path,this.extname):void 0}set stem(e){Gu(e,`stem`),Wu(e,`stem`),this.path=Pu.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 Er(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)}}})),Zu=t((()=>{Xu()})),Qu,$u=t((()=>{Qu=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r})}));function ed(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function td(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function nd(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 rd(e){if(!xu(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function id(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function ad(e){return od(e)?e:new Yu(e)}function od(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function sd(e){return typeof e==`string`||cd(e)}function cd(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var ld,ud,dd,fd,pd=t((()=>{yu(),ld=e(bu(),1),Xt(),Su(),Eu(),Zu(),$u(),ud={}.hasOwnProperty,dd=class e extends Qu{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=Cu()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,ld.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(nd(`data`,this.frozen),this.namespace[e]=t,this):ud.call(this.namespace,e)&&this.namespace[e]||void 0:e?(nd(`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=ad(e),n=this.parser||this.Parser;return ed(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),ed(`process`,this.parser||this.Parser),td(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=ad(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);sd(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(),ed(`processSync`,this.parser||this.Parser),td(`processSync`,this.compiler||this.Compiler),this.process(e,r),id(`processSync`,`process`,t),n;function r(e,r){t=!0,vu(e),n=r}}run(e,t,n){rd(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=ad(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),id(`runSync`,`run`,n),r;function i(e,t){vu(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=ad(t),r=this.compiler||this.Compiler;return td(`stringify`,r),rd(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(nd(`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,ld.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];xu(o)&&xu(r)&&(r=(0,ld.default)(!0,o,r)),n[i]=[e,r,...a]}}}},fd=new dd().freeze()})),md=t((()=>{pd()}));function hd(e){let t=gd(e),n=_d(e);return vd(t.runSync(t.parse(n),n),e)}function gd(e){let t=e.rehypePlugins||xd,n=e.remarkPlugins||xd,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Sd}:Sd;return fd().use(dc).use(n).use(hu,r).use(t)}function _d(e){let t=e.children||``,n=new Yu;return typeof t==`string`?n.value=t:``+t,n}function vd(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||yd;for(let e of wd)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return eu(e,l),kr(e,{Fragment:bd.Fragment,components:i,ignoreInvalidStyle:!0,jsx:bd.jsx,jsxs:bd.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 oi)if(Object.hasOwn(oi,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=oi[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 yd(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||Cd.test(e.slice(0,t))?e:``}var bd,xd,Sd,Cd,wd,Td=t((()=>{Xt(),ai(),ci(),bd=a(),i(),pc(),_u(),md(),nu(),Zu(),xd=[],Sd={allowDangerousHtml:!0},Cd=/^(https?|ircs?|mailto|xmpp)$/i,wd=[{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`}]})),Ed=t((()=>{Td()}));function Dd(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 Od=t((()=>{}));function kd(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}var Ad=t((()=>{}));function jd(e,t,n){let r=Wl((n||{}).ignore||[]),i=Md(t),a=-1;for(;++a<i.length;)Yl(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 Md(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([Nd(e[0]),Pd(e[1])])}return t}function Nd(e){return typeof e==`string`?new RegExp(kd(e),`g`):e}function Pd(e){return typeof e==`function`?e:function(){return e}}var Fd=t((()=>{Ad(),$l(),Kl()})),Id=t((()=>{Fd()}));function Ld(){return{transforms:[Gd],enter:{literalAutolink:zd,literalAutolinkEmail:Bd,literalAutolinkHttp:Bd,literalAutolinkWww:Bd},exit:{literalAutolink:Wd,literalAutolinkEmail:Ud,literalAutolinkHttp:Vd,literalAutolinkWww:Hd}}}function Rd(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Zd,notInConstruct:Qd},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Zd,notInConstruct:Qd},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Zd,notInConstruct:Qd}]}}function zd(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Bd(e){this.config.enter.autolinkProtocol.call(this,e)}function Vd(e){this.config.exit.autolinkProtocol.call(this,e)}function Hd(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 Ud(e){this.config.exit.autolinkEmail.call(this,e)}function Wd(e){this.exit(e)}function Gd(e){jd(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Kd],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,qd]],{ignore:[`link`,`linkReference`]})}function Kd(e,t,n,r,i){let a=``;if(!Xd(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Jd(n)))return!1;let o=Yd(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 qd(e,t,n,r){return!Xd(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Jd(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 Yd(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=Dd(e,`(`),a=Dd(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 Xd(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Hi(n)||Vi(n))&&(!t||n!==47)}var Zd,Qd,$d=t((()=>{Od(),Xt(),Ui(),Id(),Zd=`phrasing`,Qd=[`autolink`,`link`,`image`,`label`]})),ef=t((()=>{$d()}));function tf(){this.buffer()}function nf(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function rf(){this.buffer()}function af(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function of(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ki(this.sliceSerialize(e)).toLowerCase(),n.label=t}function sf(e){this.exit(e)}function cf(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ki(this.sliceSerialize(e)).toLowerCase(),n.label=t}function lf(e){this.exit(e)}function uf(){return`[`}function df(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 ff(){return{enter:{gfmFootnoteCallString:tf,gfmFootnoteCall:nf,gfmFootnoteDefinitionLabelString:rf,gfmFootnoteDefinition:af},exit:{gfmFootnoteCallString:of,gfmFootnoteCall:sf,gfmFootnoteDefinitionLabelString:cf,gfmFootnoteDefinition:lf}}}function pf(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:df},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?hf:mf))),s(),o}}function mf(e,t,n){return t===0?e:hf(e,t,n)}function hf(e,t,n){return(n?``:` `)+e}var gf=t((()=>{Xt(),Ai(),df.peek=uf})),_f=t((()=>{gf()}));function vf(){return{canContainEols:[`delete`],enter:{strikethrough:bf},exit:{strikethrough:xf}}}function yf(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:wf}],handlers:{delete:Sf}}}function bf(e){this.enter({type:`delete`,children:[]},e)}function xf(e){this.exit(e)}function Sf(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 Cf(){return`~`}var wf,Tf=t((()=>{wf=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],Sf.peek=Cf})),Ef=t((()=>{Tf()}));function Df(e){return e.length}function Of(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Df,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=kf(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]=Af(r[d]);else{let e=Af(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 kf(e){return e==null?``:String(e)}function Af(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 jf=t((()=>{}));function Mf(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()),Nf);return i(),o}function Nf(e,t,n){return`>`+(n?``:` `)+e}var Pf=t((()=>{}));function Ff(e,t){return If(e,t.inConstruct,!0)&&!If(e,t.notInConstruct,!1)}function If(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 Lf=t((()=>{}));function Rf(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
18
|
+
`&&Ff(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
19
|
+
`}var zf=t((()=>{Lf()}));function Bf(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 Vf=t((()=>{}));function Hf(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 Uf=t((()=>{}));function Wf(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}var Gf=t((()=>{}));function Kf(e,t,n,r){let i=Wf(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Hf(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,qf);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Bf(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 qf(e,t,n){return(n?``:` `)+e}var Jf=t((()=>{Vf(),Uf(),Gf()}));function Yf(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}var Xf=t((()=>{}));function Zf(e,t,n,r){let i=Yf(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 Qf=t((()=>{Xf()}));function $f(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}var ep=t((()=>{}));function tp(e){return`&#x`+e.toString(16).toUpperCase()+`;`}var np=t((()=>{}));function rp(e,t,n){let r=na(e),i=na(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 ip=t((()=>{ra()}));function ap(e,t,n,r){let i=$f(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=rp(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=tp(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=rp(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+tp(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function op(e,t,n){return n.options.emphasis||`*`}var sp=t((()=>{ep(),np(),ip(),ap.peek=op}));function cp(e,t){let n=!1;return eu(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)&&li(e)&&(t.options.setext||n))}var lp=t((()=>{nu(),hi()}));function up(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(cp(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=tp(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}var dp=t((()=>{np(),lp()}));function fp(e){return e.value||``}function pp(){return`<`}var mp=t((()=>{fp.peek=pp}));function hp(e,t,n,r){let i=Yf(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 gp(){return`!`}var _p=t((()=>{Xf(),hp.peek=gp}));function vp(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 yp(){return`!`}var bp=t((()=>{vp.peek=yp}));function xp(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 Sp(){return"`"}var Cp=t((()=>{xp.peek=Sp}));function wp(e,t){let n=li(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 Tp=t((()=>{hi()}));function Ep(e,t,n,r){let i=Yf(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(wp(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 Dp(e,t,n){return wp(e,n)?`<`:`[`}var Op=t((()=>{Xf(),Tp(),Ep.peek=Dp}));function kp(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 Ap(){return`[`}var jp=t((()=>{kp.peek=Ap}));function Mp(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 Np=t((()=>{}));function Pp(e){let t=Mp(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 Fp=t((()=>{Np()}));function Ip(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}var Lp=t((()=>{}));function Rp(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 zp=t((()=>{}));function Bp(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Ip(n):Mp(n),s=e.ordered?o===`.`?`)`:`.`:Pp(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),Rp(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 Vp=t((()=>{Np(),Fp(),Lp(),zp()}));function Hp(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 Up=t((()=>{}));function Wp(e,t,n,r){let i=Hp(n),a=n.bulletCurrent||Mp(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 Gp=t((()=>{Np(),Up()}));function Kp(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var qp=t((()=>{})),Jp,Yp=t((()=>{Kl(),Jp=Wl([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`])})),Xp=t((()=>{Yp()}));function Zp(e,t,n,r){return(e.children.some(function(e){return Jp(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}var Qp=t((()=>{Xp()}));function $p(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}var em=t((()=>{}));function tm(e,t,n,r){let i=$p(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=rp(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=tp(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=rp(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+tp(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function nm(e,t,n){return n.options.strong||`*`}var rm=t((()=>{em(),np(),ip(),tm.peek=nm}));function im(e,t,n,r){return n.safe(e.value,r)}var am=t((()=>{}));function om(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 sm=t((()=>{}));function cm(e,t,n){let r=(Rp(n)+(n.options.ruleSpaces?` `:``)).repeat(om(n));return n.options.ruleSpaces?r.slice(0,-1):r}var lm=t((()=>{sm(),zp()})),um,dm=t((()=>{Pf(),zf(),Jf(),Qf(),sp(),dp(),mp(),_p(),bp(),Cp(),Op(),jp(),Vp(),Gp(),qp(),Qp(),rm(),am(),lm(),um={blockquote:Mf,break:Rf,code:Kf,definition:Zf,emphasis:ap,hardBreak:Rf,heading:up,html:fp,image:hp,imageReference:vp,inlineCode:xp,link:Ep,linkReference:kp,list:Bp,listItem:Wp,paragraph:Kp,root:Zp,strong:tm,text:im,thematicBreak:cm}})),fm=t((()=>{dm(),lp(),tc()}));function pm(){return{enter:{table:mm,tableData:vm,tableHeader:vm,tableRow:gm},exit:{codeText:ym,table:hm,tableData:_m,tableHeader:_m,tableRow:_m}}}function mm(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 hm(e){this.exit(e),this.data.inTable=void 0}function gm(e){this.enter({type:`tableRow`,children:[]},e)}function _m(e){this.exit(e)}function vm(e){this.enter({type:`tableCell`,children:[]},e)}function ym(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,bm));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function bm(e,t){return t===`|`?t:e}function xm(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 Of(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=um.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}var Sm=t((()=>{Xt(),jf(),fm()})),Cm=t((()=>{Sm()}));function wm(){return{exit:{taskListCheckValueChecked:Em,taskListCheckValueUnchecked:Em,paragraph:Dm}}}function Tm(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Om}}}function Em(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Dm(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 Om(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=um.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 km=t((()=>{Xt(),fm()})),Am=t((()=>{km()}));function jm(){return[Ld(),ff(),vf(),pm(),wm()]}function Mm(e){return{extensions:[Rd(),pf(e),yf(),xm(e),Tm()]}}var Nm=t((()=>{ef(),_f(),Ef(),Cm(),Am()})),Pm=t((()=>{Nm()}));function Fm(){return{text:rh}}function Im(e,t,n){let r=this,i,a;return o;function o(t){return!qm(t)||!Km.call(r,r.previous)||Jm(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return qm(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check($m,u,l)(t):t===45||t===95||Ii(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&&Fi(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Lm(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Wm.call(r,r.previous)||Jm(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Ym,e.attempt(Xm,e.attempt(Zm,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Rm(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Gm.call(r,r.previous)&&!Jm(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Fi(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||ji(t)||Mi(t)||Hi(t)||Vi(t)?n(t):e.attempt(Xm,e.attempt(Zm,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function zm(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 Bm(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Qm,c,s)(t):t===null||Mi(t)||Hi(t)||t!==45&&Vi(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 Vm(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(Qm,t,a)(o):o===null||Mi(o)||Hi(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Hm(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||Mi(o)||Hi(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Mi(e)||Hi(e)?t(e):r(e)}function a(e){return Fi(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Fi(t)?(e.consume(t),o):n(t)}}function Um(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Ii(e)?n(e):t(e)}}function Wm(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Mi(e)}function Gm(e){return!Fi(e)}function Km(e){return!(e===47||qm(e))}function qm(e){return e===43||e===45||e===46||e===95||Ii(e)}function Jm(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 Ym,Xm,Zm,Qm,$m,eh,th,nh,rh,ih,ah=t((()=>{for(Ui(),Ym={tokenize:zm,partial:!0},Xm={tokenize:Bm,partial:!0},Zm={tokenize:Vm,partial:!0},Qm={tokenize:Hm,partial:!0},$m={tokenize:Um,partial:!0},eh={name:`wwwAutolink`,tokenize:Lm,previous:Wm},th={name:`protocolAutolink`,tokenize:Rm,previous:Gm},nh={name:`emailAutolink`,tokenize:Im,previous:Km},rh={},ih=48;ih<123;)rh[ih]=nh,ih++,ih===58?ih=65:ih===91&&(ih=97);rh[43]=nh,rh[45]=nh,rh[46]=nh,rh[95]=nh,rh[72]=[nh,th],rh[104]=[nh,th],rh[87]=[nh,eh],rh[119]=[nh,eh]})),oh=t((()=>{ah(),Gi()}));function sh(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:dh,continuation:{tokenize:fh},exit:ph}},text:{91:{name:`gfmFootnoteCall`,tokenize:uh},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:ch,resolveTo:lh}}}}function ch(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=ki(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 lh(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 uh(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||Mi(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(ki(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Mi(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 dh(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||Mi(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=ki(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Mi(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),Ki(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function fh(e,t,n){return e.check(ha,t,e.attempt(hh,t,n))}function ph(e){e.exit(`gfmFootnoteDefinition`)}function mh(e,t,n){let r=this;return Ki(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 hh,gh=t((()=>{vs(),qi(),Ui(),Ai(),hh={tokenize:mh,partial:!0}})),_h=t((()=>{gh(),Gi()}));function vh(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&&yi(o,o.length,0,ia(s,e.slice(r+1,n),t)),yi(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),yi(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=na(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=na(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var yh=t((()=>{xi(),ra(),aa()})),bh=t((()=>{yh()}));function xh(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 Sh,Ch=t((()=>{Sh=class{constructor(){this.map=[]}add(e,t,n){xh(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 wh(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 Th=t((()=>{}));function Eh(){return{flow:{null:{name:`table`,tokenize:Dh,resolveAll:Oh}}}}function Dh(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):Ni(t)?Ki(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||Mi(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,Ni(t)?Ki(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 Ni(t)?Ki(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 Ni(t)?Ki(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)):Ni(n)?Ki(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Mi(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 Oh(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 Sh;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(Ah(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=kh(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=kh(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=kh(f,t,o,i,n,d)):(o[0]=o[1],d=kh(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&Ah(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=wh(t.events,n))}return e}function kh(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},jh(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=jh(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=jh(t.events,n[2]),a=jh(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({},jh(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Ah(e,t,n,r,i){let a=[],o=jh(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 jh(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Mh=t((()=>{qi(),Ui(),Ch(),Th()})),Nh=t((()=>{Mh()}));function Ph(){return{text:{91:Lh}}}function Fh(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 Mi(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):Ni(r)?e.check({tokenize:Ih},t,n)(r):n(r)}}function Ih(e,t,n){return Ki(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}var Lh,Rh=t((()=>{qi(),Ui(),Lh={name:`tasklistCheck`,tokenize:Fh}})),zh=t((()=>{Rh()}));function Bh(e){return Si([Fm(),sh(),vh(e),Eh(),Ph()])}var Vh=t((()=>{Ei(),oh(),_h(),bh(),Nh(),zh()}));function Hh(e){let t=this,n=e||Uh,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Bh(n)),a.push(jm()),o.push(Mm(n))}var Uh,Wh=t((()=>{Pm(),Vh(),Uh={}})),Gh=t((()=>{Wh()}));function Kh(e){let t=(e||``).toLowerCase().trim();return[`sh`,`bash`,`zsh`,`shell`,`terminal`,`console`,`cmd`].includes(t)?`bash`:[`js`,`jsx`,`javascript`].includes(t)?`javascript`:[`ts`,`tsx`,`typescript`].includes(t)?`typescript`:[`py`,`python`,`python3`].includes(t)?`python`:[`rs`,`rust`].includes(t)?`rust`:[`json`].includes(t)?`json`:[`sql`].includes(t)?`sql`:[`html`,`htm`,`xml`,`svg`].includes(t)?`html`:[`css`,`scss`,`sass`,`less`].includes(t)?`css`:[`yaml`,`yml`].includes(t)?`yaml`:`fallback`}function qh(e){let t=[],n=0,r=e.length,i=!0;for(;n<r;){if(e[n]===`#`){t.push({type:`token-comment`,text:e.slice(n)});break}if(/\s/.test(e[n])){let i=``;for(;n<r&&/\s/.test(e[n]);)i+=e[n],n++;t.push({type:`token-plain`,text:i});continue}if(e[n]===`"`||e[n]===`'`){let a=e[n],o=a;for(n++;n<r&&e[n]!==a;)e[n]===`\\`&&n+1<r?(o+=e[n]+e[n+1],n+=2):(o+=e[n],n++);n<r&&(o+=e[n],n++),t.push({type:`token-string`,text:o}),i=!1;continue}if([`|`,`&`,`;`,`>`,`<`].includes(e[n])){let a=e[n];n++,n<r&&[`|`,`&`,`>`,`<`].includes(e[n])&&(a+=e[n],n++),t.push({type:`token-operator`,text:a}),i=!0;continue}if(e[n]===`$`){let a=`$`;if(n++,n<r&&e[n]===`{`){for(;n<r&&e[n]!==`}`;)a+=e[n],n++;n<r&&(a+=e[n],n++)}else for(;n<r&&/[a-zA-Z0-9_?]/.test(e[n]);)a+=e[n],n++;t.push({type:`token-variable`,text:a}),i=!1;continue}if(e[n]===`-`&&n+1<r&&/[a-zA-Z0-9\-]/.test(e[n+1])){let a=`-`;for(n++;n<r&&/[a-zA-Z0-9_\-\.\/]/.test(e[n]);)a+=e[n],n++;t.push({type:`token-flag`,text:a}),i=!1;continue}let a=``;for(;n<r&&!/[\s"'|&;><#]/.test(e[n]);)a+=e[n],n++;if(i)$h.has(a)||/^[a-zA-Z0-9_\-\.\/]+$/.test(a)?t.push({type:`token-command`,text:a}):t.push({type:`token-plain`,text:a}),i=!1;else if(/^\d+(\.\d+)?$/.test(a))t.push({type:`token-number`,text:a});else if(a.includes(`=`)){let[e,...n]=a.split(`=`);t.push({type:`token-property`,text:e}),t.push({type:`token-operator`,text:`=`}),t.push({type:`token-plain`,text:n.join(`=`)})}else t.push({type:`token-plain`,text:a})}return t}function Jh(e,t){let n=[],r=0,i=e.length;for(;r<i;){if(e[r]===`/`&&e[r+1]===`/`||(t===`python`||t===`yaml`)&&e[r]===`#`||t===`sql`&&e[r]===`-`&&e[r+1]===`-`){n.push({type:`token-comment`,text:e.slice(r)});break}if(/\s/.test(e[r])){let t=``;for(;r<i&&/\s/.test(e[r]);)t+=e[r],r++;n.push({type:`token-plain`,text:t})}else if(e[r]===`"`||e[r]===`'`||e[r]==="`"){let a=e[r],o=a;for(r++;r<i&&e[r]!==a;)e[r]===`\\`&&r+1<i?(o+=e[r]+e[r+1],r+=2):(o+=e[r],r++);r<i&&(o+=e[r],r++);let s=!1;if(t===`json`){let t=r;for(;t<i&&/\s/.test(e[t]);)t++;t<i&&e[t]===`:`&&(s=!0)}n.push({type:s?`token-property`:`token-string`,text:o})}else if(/\d/.test(e[r])){let t=``;for(;r<i&&/[0-9a-fA-FxX\._]/.test(e[r]);)t+=e[r],r++;n.push({type:`token-number`,text:t})}else if(/[a-zA-Z_$]/.test(e[r])){let a=``;for(;r<i&&/[a-zA-Z0-9_$]/.test(e[r]);)a+=e[r],r++;let o=a.toLowerCase();if((t===`javascript`||t===`typescript`)&&eg.has(a))n.push({type:`token-keyword`,text:a});else if(t===`python`&&tg.has(a))n.push({type:`token-keyword`,text:a});else if(t===`rust`&&ng.has(a))n.push({type:`token-keyword`,text:a});else if(t===`sql`&&rg.has(o))n.push({type:`token-keyword`,text:a});else if([`true`,`false`,`null`,`undefined`,`None`,`True`,`False`].includes(a))n.push({type:`token-boolean`,text:a});else{let t=r;for(;t<i&&/\s/.test(e[t]);)t++;t<i&&e[t]===`(`?n.push({type:`token-function`,text:a}):/^[A-Z][a-zA-Z0-9_]*$/.test(a)?n.push({type:`token-type`,text:a}):n.push({type:`token-plain`,text:a})}}else n.push({type:`token-punctuation`,text:e[r]}),r++}return n}function Yh(e,t){let n=Kh(t);return n===`bash`?qh(e):Jh(e,n)}function Xh(e,t,n=!0){let r=`${t}:${+!!n}:${e}`,i=ig.get(r);if(i)return ig.delete(r),ig.set(r,i),i.node;let a=Zh(e,t,n);if(e.length<=5e4)for(ig.set(r,{node:a,chars:e.length}),ag+=e.length;ig.size>32||ag>1e5;){let e=ig.keys().next().value;ag-=ig.get(e).chars,ig.delete(e)}return a}function Zh(e,t,n){let r=e.split(`
|
|
31
|
+
`);return(0,Qh.jsx)(`div`,{className:`chat-code-lines`,children:r.map((e,r)=>{let i=Yh(e,t);return(0,Qh.jsxs)(`div`,{className:`chat-code-line`,children:[n&&(0,Qh.jsx)(`span`,{className:`chat-code-line-num`,"aria-hidden":`true`,children:r+1}),(0,Qh.jsx)(`span`,{className:`chat-code-line-content`,children:i.length===0?`
|
|
32
|
+
`:i.map((e,t)=>(0,Qh.jsx)(`span`,{className:e.type,children:e.text},t))})]},r)})})}var Qh,$h,eg,tg,ng,rg,ig,ag,og=t((()=>{i(),Qh=a(),$h=new Set(`ffmpeg.ffprobe.git.npm.npx.yarn.pnpm.cargo.rustc.docker.docker-compose.kubectl.curl.wget.cat.grep.egrep.sed.awk.find.ls.cd.mkdir.rm.cp.mv.touch.echo.sudo.chmod.chown.tar.unzip.zip.node.python.python3.pip.pip3.tauri.vite.export.source.sh.bash.zsh.systemctl.journalctl.ps.kill.killall.top.htop.which.head.tail.less.more.nano.vim.vi.ssh.scp.rsync.brew.apt.apt-get.dnf.pacman.mint`.split(`.`)),eg=new Set(`const.let.var.function.return.import.export.default.from.if.else.for.while.do.switch.case.break.continue.async.await.class.interface.type.new.this.try.catch.finally.throw.extends.implements.typeof.instanceof.as.in.of.yield.void.delete`.split(`.`)),tg=new Set(`def.class.import.from.as.return.if.elif.else.for.while.try.except.finally.with.yield.async.await.lambda.pass.raise.in.is.not.and.or.global.nonlocal.assert.break.continue`.split(`.`)),ng=new Set(`fn.let.mut.pub.struct.enum.impl.trait.for.loop.while.if.else.match.return.use.mod.crate.super.self.Self.where.async.await.move.ref.type.const.static.unsafe.dyn.break.continue`.split(`.`)),rg=new Set(`select.from.where.insert.into.update.delete.join.left.right.inner.outer.group.by.order.having.limit.offset.and.or.not.in.is.null.create.table.alter.drop.index.primary.key.foreign.references.default.values.as.distinct.union.all.case.when.then.end.like.between`.split(`.`)),ig=new Map,ag=0})),sg,cg,lg,ug=t((()=>{sg=e(i()),og(),cg=a(),lg=(0,sg.memo)(function({code:e,language:t}){let[n,r]=(0,sg.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,sg.useMemo)(()=>e?e.split(`
|
|
33
|
+
`).length:1,[e]),l=c>1,u=(0,sg.useMemo)(()=>Xh(e,o,l),[e,o,l]);return(0,cg.jsxs)(`div`,{className:`chat-code-block-container`,style:{whiteSpace:`normal`},children:[(0,cg.jsxs)(`div`,{className:`chat-code-block-header`,children:[(0,cg.jsxs)(`div`,{className:`chat-code-block-meta`,children:[(0,cg.jsx)(`span`,{className:`chat-code-block-lang`,children:s}),c>3&&(0,cg.jsxs)(`span`,{className:`chat-code-block-lines`,children:[c,` lines`]})]}),(0,cg.jsxs)(`div`,{className:`chat-code-block-actions`,children:[(0,cg.jsx)(`button`,{type:`button`,onClick:a,title:`Download code`,className:`chat-code-action-btn chat-code-download-btn`,children:(0,cg.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,cg.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,cg.jsx)(`polyline`,{points:`7 10 12 15 17 10`}),(0,cg.jsx)(`line`,{x1:`12`,y1:`15`,x2:`12`,y2:`3`})]})}),(0,cg.jsx)(`button`,{type:`button`,onClick:i,title:`Copy code`,className:`chat-code-action-btn chat-code-copy-btn ${n?`is-copied`:``}`,children:n?(0,cg.jsxs)(cg.Fragment,{children:[(0,cg.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,cg.jsx)(`polyline`,{points:`20 6 9 17 4 12`})}),(0,cg.jsx)(`span`,{className:`chat-code-btn-label`,children:`Copied!`})]}):(0,cg.jsxs)(cg.Fragment,{children:[(0,cg.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,cg.jsx)(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`,ry:`2`}),(0,cg.jsx)(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})]}),(0,cg.jsx)(`span`,{className:`chat-code-btn-label`,children:`Copy`})]})})]})]}),(0,cg.jsx)(`pre`,{className:`chat-code-block-body`,children:(0,cg.jsx)(`code`,{children:u})})]})})}));function dg(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 fg=t((()=>{}));function pg(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 mg(e){return!e||!e.includes(`pbs.twimg.com/profile_banners/`)?e:e.replace(/^(https?:\/\/pbs\.twimg\.com\/profile_banners\/\d+\/\d+)\/?$/,`$1/1500x500`)}function hg(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 gg(e){return!e||typeof e!=`string`?``:e.replace(/(^|[^\\])(!\[[^\]\r\n]*\]\((?:https?:\/\/|\/api\/|data:)[^\s\)]+)[ \t]*$/gm,`$1$2)`)}function _g(e){if(typeof e!=`string`)return``;let t=e.trim();if(!t.startsWith(`{`))return gg(vg(e));try{let e=JSON.parse(t);if(e?.action===`finish`&&typeof e?.input?.summary==`string`&&e.input.summary.trim())return gg(vg(e.input.summary));if(typeof e?.finish?.summary==`string`&&e.finish.summary.trim())return gg(vg(e.finish.summary))}catch{return gg(vg(e))}return gg(vg(e))}function vg(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 yg(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 bg(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 xg(e){return e==null||typeof e==`boolean`?``:typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(xg).join(``):(0,Rg.isValidElement)(e)?xg(e.props.children):``}function Sg(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(`@`))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)(Rg.Fragment,{children:r[2]},`${t}-${n}`)}return e?(0,R.jsx)(Rg.Fragment,{children:e},`${t}-t-${n}`):null})}return Array.isArray(e)?e.map((e,n)=>(0,R.jsx)(Rg.Fragment,{children:Sg(e,`${t}-${n}`)},`${t}-${n}`)):e}function Cg(e){let t=e;return t?t.type===`text`?t.value??``:Array.isArray(t.children)?t.children.map(Cg).join(``):``:``}function wg(e){return e?.children?.find(e=>e.type===`element`&&e.tagName===`code`)}function Tg(e,t){let n=0;return Rg.Children.toArray(e).map(e=>{if(!(0,Rg.isValidElement)(e))return e;let r=(t.start??1)+n;return n+=1,(0,Rg.cloneElement)(e,{key:e.key??r,ordered:t.ordered,index:r})})}function Eg(e){let t=Rg.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 Dg(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()),dg(t)}function Og(e,t,n){let r=Dg(e);return r?(0,R.jsx)(Rg.Suspense,{fallback:null,children:n(r)}):(0,R.jsx)(lg,{code:e,language:t})}function kg(e,t){switch(e){case`weather_json`:case`weather-json`:return Og(t,e,e=>(0,R.jsx)(zg,{data:e}));case`stock_json`:case`stock-json`:return Og(t,e,e=>(0,R.jsx)(Bg,{data:e}));case`calculation_json`:case`calculation-json`:return Og(t,e,e=>(0,R.jsx)(Vg,{data:e}));case`image_search_json`:case`image-search-json`:return Og(t,e,e=>(0,R.jsx)(Hg,{data:e}));case`image_gen_json`:case`image-gen-json`:return Og(t,e,e=>(0,R.jsx)(Ug,{data:e}));case`mermaid`:return(0,R.jsx)(Rg.Suspense,{fallback:null,children:(0,R.jsx)(Wg,{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=Dg(n);return r?(0,R.jsx)(Rg.Suspense,{fallback:null,children:(0,R.jsx)(Gg,{data:r})}):(0,R.jsx)(lg,{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=Dg(n);return r?(0,R.jsx)(Rg.Suspense,{fallback:null,children:(0,R.jsx)(Kg,{data:r})}):(0,R.jsx)(lg,{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=Dg(n);return r?(0,R.jsx)(Rg.Suspense,{fallback:null,children:(0,R.jsx)(qg,{data:r})}):(0,R.jsx)(lg,{code:t,language:e})}default:return(0,R.jsx)(lg,{code:t,language:e})}}function Ag(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,Rg.isValidElement)(e)){let t=e.props;if(t.children)return(0,Rg.cloneElement)(e,{},n(t.children))}return e}return n(e)}function jg(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:ge},TIP:{title:`Tip`,color:`#34d399`,border:`#10b981`,bg:`rgba(16, 185, 129, 0.08)`,borderSubtle:`rgba(16, 185, 129, 0.25)`,Icon:Ce},IMPORTANT:{title:`Important`,color:`#c084fc`,border:`#a855f7`,bg:`rgba(168, 85, 247, 0.08)`,borderSubtle:`rgba(168, 85, 247, 0.25)`,Icon:ze},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:ue}}[e]||{title:`Note`,color:`#38bdf8`,border:`#38bdf8`,bg:`rgba(56, 189, 248, 0.08)`,borderSubtle:`rgba(56, 189, 248, 0.25)`,Icon:ge},r=n.Icon;return(0,R.jsxs)(`div`,{className:`chat-callout-card chat-callout--${e.toLowerCase()}`,style:{margin:`14px 0`,padding:`12px 16px`,borderRadius:`10px`,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 Mg({src:e,alt:t,sourceUrl:n,initialError:r,initialStage:i}){let[a,o]=(0,Rg.useState)(i||(r?`failed`:`direct`)),s=Jg(String(e||``)),c=t||`Generated Image`,l=/^https?:\/\//.test(s),u=n&&/^https?:\/\//.test(n)?n:s;if((0,Rg.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:`10px`,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)(m,{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:`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`?hg(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:`10px`,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:`12px`,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:`8px`},onError:d})})}function Ng(e,t,n){return(0,R.jsx)(Mg,{src:e,alt:t,sourceUrl:n})}function Pg(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(Jg(t))||e;return Ng(t,String(i.properties?.alt||``),n)}return(0,R.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,className:`chat-link`,children:Sg(t)})}function Fg(e){return e.split(`
|
|
34
|
+
`).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(`
|
|
35
|
+
`)}function Ig(e){let t=[],n=[],r=()=>{n.length>0&&(t.push({type:`text`,value:n.join(`
|
|
36
|
+
`)}),n=[])};for(let i of e.split(`
|
|
37
|
+
`)){let e=i.match(/<video[^>]*src="([^"]+)"[^>]*>/);e?(r(),t.push({type:`video`,src:e[1]})):n.push(i)}return r(),t}function Lg(e,t=[]){let n=_g(e.replace(/\r\n?/g,`
|
|
38
|
+
`));if(!n)return null;let r=Ig(n),i=new Map(t.filter(e=>e.imageUrl).map(e=>[Jg(e.imageUrl),e.url])),a=t.length===0?Xg:{...Xg,a:({href:e,children:t,node:n})=>Pg(e,t,n,i),img:({src:e,alt:t})=>Ng(e,t,i.get(Jg(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:`12px`,overflow:`hidden`,border:`1px solid var(--border, rgba(255,255,255,0.12))`,background:`#000`},children:(0,R.jsx)(`video`,{controls:!0,src:Jg(e.src),style:{width:`100%`,maxHeight:`400px`,borderRadius:`8px`,display:`block`}})},`video-${t}`):(0,R.jsx)(hd,{remarkPlugins:[Hh],components:a,children:Fg(e.value)},`md-${t}`))})}var Rg,R,zg,Bg,Vg,Hg,Ug,Wg,Gg,Kg,qg,Jg,Yg,Xg,Zg,Qg=t((()=>{Rg=e(i()),Ed(),Gh(),ug(),fg(),R=a(),k(),Te(),zg=(0,Rg.lazy)(()=>De(()=>import(`./WeatherCard-CPucIfq8.js`),__vite__mapDeps([0,1,2,3,4]))),Bg=(0,Rg.lazy)(()=>De(()=>import(`./StockCard-BDMCe7mx.js`),__vite__mapDeps([5,1,2,3,4]))),Vg=(0,Rg.lazy)(()=>De(()=>import(`./CalculationCard-CRjP3E1j.js`),__vite__mapDeps([6,1,2,3,4]))),Hg=(0,Rg.lazy)(()=>De(()=>import(`./ImageSearchCard-N3yQOr8Z.js`),__vite__mapDeps([7,1,2,3,4]))),Ug=(0,Rg.lazy)(()=>De(()=>import(`./ImageGenCard-BCXxkVJX.js`),__vite__mapDeps([8,1,2,3,4]))),Wg=(0,Rg.lazy)(()=>De(()=>import(`./MermaidCard-NqrHdyJW.js`),__vite__mapDeps([9,1,2,3,4]))),Gg=(0,Rg.lazy)(()=>De(()=>import(`./UiGridCard-DvZcLNxb.js`),__vite__mapDeps([10,1,2,3,4]))),Kg=(0,Rg.lazy)(()=>De(()=>import(`./UiFeatureCard-6BwxTOCe.js`),__vite__mapDeps([11,1,2,3,4]))),qg=(0,Rg.lazy)(()=>De(()=>import(`./UiMockupWidget-DD73QWg1.js`),__vite__mapDeps([12,1,2,3,4]))),Jg=e=>{if(!e)return``;let t=pg(e);return t=mg(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},Yg=/^(?:[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]).*:$/u,Xg={p({children:e}){let t=xg(e).trim();if(Yg.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?jg(n[1].toUpperCase(),Ag(e)):(0,R.jsx)(`div`,{className:`chat-paragraph`,children:Sg(e)})},h1:({children:e})=>(0,R.jsx)(`div`,{className:`chat-heading chat-heading-1`,children:Sg(e)}),h2:({children:e})=>(0,R.jsx)(`div`,{className:`chat-heading chat-heading-2`,children:Sg(e)}),h3:({children:e})=>(0,R.jsx)(`div`,{className:`chat-heading chat-heading-3`,children:Sg(e)}),h4:({children:e})=>(0,R.jsx)(`div`,{className:`chat-heading chat-heading-3`,children:Sg(e)}),h5:({children:e})=>(0,R.jsx)(`div`,{className:`chat-heading chat-heading-3`,children:Sg(e)}),h6:({children:e})=>(0,R.jsx)(`div`,{className:`chat-heading chat-heading-3`,children:Sg(e)}),ul:({children:e})=>(0,R.jsx)(`div`,{className:`chat-list-block`,children:Tg(e,{ordered:!1})}),ol:({children:e,start:t})=>(0,R.jsx)(`div`,{className:`chat-list-block`,children:Tg(e,{ordered:!0,start:typeof t==`number`?t:1})}),li:({children:e,ordered:t,index:n})=>{let r=Eg(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:Sg(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:Sg(r)})]})},strong:({children:e})=>(0,R.jsx)(`strong`,{className:`chat-bold-highlight`,children:e}),a:({href:e,children:t,node:n})=>Pg(e,t,n),img:({src:e,alt:t})=>Ng(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=Dg(e[2].trim());if(n){if(t.startsWith(`ui-grid`))return(0,R.jsx)(Rg.Suspense,{fallback:null,children:(0,R.jsx)(Gg,{data:n})});if(t.startsWith(`ui-card`)||t.startsWith(`ui-feature`))return(0,R.jsx)(Rg.Suspense,{fallback:null,children:(0,R.jsx)(Kg,{data:n})});if(t.startsWith(`ui-mockup`))return(0,R.jsx)(Rg.Suspense,{fallback:null,children:(0,R.jsx)(qg,{data:n})})}}}return(0,R.jsx)(`code`,{className:`chat-inline-code`,children:e})},pre({node:e}){let t=wg(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=Cg(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+`
|
|
39
|
+
`+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 kg(i,a)},table:({children:e})=>(0,R.jsx)(`div`,{className:`chat-table-container`,style:{overflowX:`auto`,margin:`14px 0`,width:`100%`,borderRadius:`8px`,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:Rg.Children.map(e,e=>(0,Rg.isValidElement)(e)?(0,Rg.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=Rg.Children.toArray(e).filter(Rg.isValidElement),n=0;return(0,R.jsx)(`tbody`,{children:Rg.Children.toArray(e).map(e=>{if(!(0,Rg.isValidElement)(e))return e;let r=n;return n+=1,(0,Rg.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:Sg(e)}),td:({children:e})=>(0,R.jsx)(`td`,{style:{padding:`12px 16px`,color:`var(--text-chat, var(--text-main, #e2e8f0))`},children:Sg(e)}),blockquote:({children:e})=>{let t=xg(e).trim().match(/^\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]/i);return t?jg(t[1].toUpperCase(),Ag(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})}},Zg=(0,Rg.memo)(function({text:e,sources:t}){return Lg(e,t)})}));function $g(e){let t=null,n=!1,r=new Set,i=()=>{try{let t=JSON.parse(e.getItem(t_)||`[]`);return Array.isArray(t)?Jt(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(t_,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=qt(e);t&&o(Jt([...a(),t]),!0)},restore(e){let t=qt(e);o(a().filter(e=>e!==t),!0)},reload(){n||o(i(),!1)}}}function e_(e){let t=r_.subscribe(e);r_.reload();let n=e=>{e.key&&e.key!==t_||r_.reload()};return window.addEventListener(`storage`,n),()=>{t(),window.removeEventListener(`storage`,n)}}var t_,n_,r_,i_=t((()=>{Yt(),t_=`mint:removed-workspace-paths`,n_=[],r_=$g({getItem:e=>window.localStorage.getItem(e),setItem:(e,t)=>window.localStorage.setItem(e,t)})})),a_=t((()=>{}));function o_(e){return e.split(/[\\/]/).filter(Boolean).pop()||e}function s_({currentPath:e,recentPaths:t,onSelectWorkspace:n,placement:r=`above`}){let i=(0,c_.useId)(),[a,o]=(0,c_.useState)(!1),[s,c]=(0,c_.useState)(``),[l,u]=(0,c_.useState)(null),[d,f]=(0,c_.useState)(``),p=(0,c_.useSyncExternalStore)(e_,r_.getSnapshot,()=>n_),m=(0,c_.useRef)(null),h=(0,c_.useRef)(null),g=(0,c_.useRef)(null),_=(0,c_.useRef)(null),v=(0,c_.useRef)(null),y=(0,c_.useRef)(null),b=(0,c_.useMemo)(()=>{let n=s.trim().toLocaleLowerCase();return Jt(t,e,[],p).filter(e=>!n||e.toLocaleLowerCase().includes(n)||o_(e).toLocaleLowerCase().includes(n))},[s,t,e,p]);(0,c_.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,c_.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,u_.jsxs)(`div`,{className:`workspace-selector ${e?`has-workspace`:`needs-workspace`} opens-${r}`,ref:m,children:[(0,u_.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?o_(e):`Select Project`}`,"aria-haspopup":`dialog`,"aria-expanded":a,"aria-controls":i,title:e||`Choose a workspace folder`,children:[(0,u_.jsx)(`span`,{className:`workspace-select-icon`,"aria-hidden":`true`,children:(0,u_.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,u_.jsx)(`path`,{d:`M3 6h7l2 2h9v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z`})})}),(0,u_.jsx)(`span`,{className:`workspace-select-copy`,children:(0,u_.jsx)(`span`,{className:`workspace-select-name`,children:e?o_(e):`Select Project`})}),(0,u_.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,u_.jsx)(`path`,{d:`m6 9 6 6 6-6`})})]}),a&&(0,u_.jsxs)(`div`,{className:`workspace-select-menu`,id:i,role:`dialog`,"aria-label":`Choose workspace`,children:[(0,u_.jsxs)(`label`,{className:`workspace-select-search`,children:[(0,u_.jsxs)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,children:[(0,u_.jsx)(`circle`,{cx:`11`,cy:`11`,r:`7`}),(0,u_.jsx)(`path`,{d:`m20 20-4-4`})]}),(0,u_.jsx)(`input`,{ref:g,type:`search`,value:s,onChange:e=>{c(e.target.value),u(null)},placeholder:`Search workspaces`,"aria-label":`Search workspaces`})]}),(0,u_.jsx)(`div`,{className:`workspace-select-list`,role:`group`,"aria-label":`Recent workspaces`,children:b.length>0?b.map(t=>{let n=t===qt(e);return(0,u_.jsxs)(`div`,{className:`workspace-select-row`,children:[(0,u_.jsxs)(`button`,{type:`button`,className:`workspace-select-option`,onClick:()=>x(t),"aria-current":n?`true`:void 0,title:t,children:[(0,u_.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,u_.jsx)(`path`,{d:`M3 6h7l2 2h9v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z`})}),(0,u_.jsxs)(`span`,{className:`workspace-select-option-copy`,children:[(0,u_.jsx)(`span`,{className:`workspace-select-option-name`,children:o_(t)}),(0,u_.jsx)(`span`,{className:`workspace-select-option-path`,children:t})]}),n&&(0,u_.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,u_.jsx)(`path`,{d:`m5 12 4 4L19 6`})})]}),(0,u_.jsx)(`button`,{type:`button`,className:`workspace-select-more`,"aria-label":`Workspace actions: ${o_(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,u_.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:[(0,u_.jsx)(`circle`,{cx:`5`,cy:`12`,r:`1.8`}),(0,u_.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.8`}),(0,u_.jsx)(`circle`,{cx:`19`,cy:`12`,r:`1.8`})]})})]},t)}):(0,u_.jsx)(`div`,{className:`workspace-select-empty`,children:s.trim()?`No matching workspaces`:`No recent workspaces yet`})}),d&&(0,u_.jsx)(`p`,{className:`workspace-select-notice`,role:`status`,children:d}),(0,u_.jsx)(`div`,{className:`workspace-select-menu-footer`,children:(0,u_.jsxs)(`button`,{type:`button`,className:`workspace-select-open-folder`,onClick:()=>x(),children:[(0,u_.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,u_.jsx)(`path`,{d:`M3 6h7l2 2h9v12H3z`}),(0,u_.jsx)(`path`,{d:`M12 10v6m-3-3h6`})]}),(0,u_.jsx)(`span`,{children:`Open folder…`})]})})]}),a&&l&&b.includes(l)&&(0,l_.createPortal)((0,u_.jsx)(`div`,{ref:y,className:`workspace-select-row-menu`,role:`menu`,"aria-label":`Workspace actions: ${o_(l)}`,onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),u(null),_.current?.focus()),(e.key===`ArrowDown`||e.key===`ArrowUp`)&&e.preventDefault()},children:(0,u_.jsxs)(`button`,{ref:v,type:`button`,role:`menuitem`,className:`workspace-select-remove`,onClick:()=>{r_.remove(l),u(null),f(`Removed from list. Use Open folder… to add it again.`),g.current?.focus()},children:[(0,u_.jsx)(`span`,{children:`Remove from list`}),(0,u_.jsx)(`small`,{children:`Does not delete files or folders.`})]})}),document.body)]})}var c_,l_,u_,d_=t((()=>{c_=e(i()),l_=E(),Yt(),i_(),a_(),u_=a()}));function f_(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=qt(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 p_(e,t){let n=f_(JSON.stringify({root:e,path:t,kind:`file`}));return`preview:${JSON.stringify([n.root,n.path])}`}function m_(e,t){let n=f_(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 h_,g_=t((()=>{Yt(),h_=`application/x-mint-workspace-file`}));function __(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 v_(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 y_=t((()=>{}));function b_(e){window.dispatchEvent(new CustomEvent(w_,{detail:e}))}function x_(e,t=0,n){let[r,i]=(0,S_.useState)([]),[a,o]=(0,S_.useState)(!1),s=(0,S_.useRef)(e),[c,l]=(0,S_.useState)(!1),[u,d]=(0,S_.useState)(``),f=(0,S_.useRef)(e);f.current=e;let p=(0,S_.useRef)(n);return p.current=n,(0,S_.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(w_,a),()=>{t=!1,window.removeEventListener(`focus`,r),window.removeEventListener(w_,a)}},[e,t]),{entries:r,busy:c,loading:a,error:u,undo:(0,S_.useCallback)(async n=>{if(!r.length||C_.has(e))return!1;if(n&&r[0].id!==n)return d(`Workspace history changed; review the latest action before undoing`),!1;C_.add(e),l(!0),d(``);try{b_(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{C_.delete(e),f.current===e&&l(!1)}},[r,e,t])}}var S_,C_,w_,T_=t((()=>{S_=e(i()),ke(),C_=new Set,w_=`mint:workspace-history-changed`}));function E_(e){return e instanceof Error?e.message:typeof e==`string`?e:`Git could not complete that action.`}function D_({workspacePath:e,disabled:t=!1,onBranchChanged:n}){let[r,i]=(0,O_.useState)(null),[a,o]=(0,O_.useState)(!1),[s,c]=(0,O_.useState)(``),[l,u]=(0,O_.useState)(``),[d,f]=(0,O_.useState)(``),[p,m]=(0,O_.useState)(`branches`),[h,g]=(0,O_.useState)(``),[_,v]=(0,O_.useState)([]),[y,b]=(0,O_.useState)(!1),[S,C]=(0,O_.useState)(`up`),[w,T]=(0,O_.useState)(`left`),[E,D]=(0,O_.useState)(480),O=(0,O_.useRef)(null),k=(0,O_.useRef)(null),A=(0,O_.useRef)(t),ee=(0,O_.useCallback)(async()=>{if(!e.trim())i(null);else try{let t=await x.getGitBranchInfo(e);i(t),u(``)}catch(e){i(null),u(E_(e))}},[e]);(0,O_.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(E_(e)))}),()=>{t=!0}},[e]),(0,O_.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,O_.useEffect)(()=>{let e=()=>ee();return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[ee]),(0,O_.useEffect)(()=>{t?o(!1):A.current&&ee(),A.current=t},[t,ee]);let te=(0,O_.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,O_.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.jsx)(`button`,{type:`button`,className:`git-branch-trigger`,onClick:ee,title:`${l} Select to retry.`,"aria-label":`Git branch unavailable. Retry`,children:(0,z.jsx)(`span`,{className:`git-branch-name`,children:`Git unavailable`})})}):null;let M=r.currentBranch||(r.detachedHead?`Detached ${r.detachedHead}`:`No branch`),ne=e=>{i(e),o(!1),c(``),m(`branches`)},N=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.`);ne(r.info),n?.()},re=async t=>{if(t===r.currentBranch||d)o(!1);else try{u(``),f(t),await N(`Switch from ${M} to ${t}?`,n=>x.switchGitBranch(e,t,n))}catch(e){u(E_(e))}finally{f(``)}},ie=async t=>{if(!d)try{u(``),f(t),await N(`Check out ${t}?`,n=>x.checkoutRemoteGitBranch(e,t,n))}catch(e){u(E_(e))}finally{f(``)}},ae=async t=>{t.preventDefault();let n=h.trim();if(n&&!d)try{u(``),f(n),await N(`Create and switch to ${n}?`,t=>x.createGitBranch(e,n,t)),g(``)}catch(e){u(E_(e))}finally{f(``)}},oe=async()=>{try{u(``),b(!0),v(await x.getGitGraph(e))}catch(e){v([]),u(E_(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:`${M}${r.isDirty?` — uncommitted changes`:``}`,children:[(0,z.jsxs)(`svg`,{className:`git-branch-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,z.jsx)(`circle`,{cx:`6`,cy:`5`,r:`2`}),(0,z.jsx)(`circle`,{cx:`18`,cy:`6`,r:`2`}),(0,z.jsx)(`circle`,{cx:`6`,cy:`19`,r:`2`}),(0,z.jsx)(`path`,{d:`M6 7v10M8 7c2 4 8 1 8-1`})]}),(0,z.jsx)(`span`,{className:`git-branch-name`,children:d||M}),r.isDirty&&(0,z.jsx)(`span`,{className:`git-branch-dirty`,"aria-label":`Uncommitted changes`}),(0,z.jsx)(`svg`,{className:`git-branch-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,z.jsx)(`path`,{d:`m6 9 6 6 6-6`})})]}),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`,"aria-hidden":`true`,children:[(0,z.jsx)(`circle`,{cx:`11`,cy:`11`,r:`7`}),(0,z.jsx)(`path`,{d:`m20 20-4-4`})]}),(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:()=>re(e),children:[(0,z.jsx)(`span`,{className:`git-branch-option-icon`,"aria-hidden":`true`,children:`⑂`}),(0,z.jsx)(`span`,{children:e}),t&&(0,z.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,z.jsx)(`path`,{d:`m5 12 4 4L19 6`})})]},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:()=>ie(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)(`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)(`span`,{"aria-hidden":`true`,children:`+`}),`Create branch`]}),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>{se(420,window.innerWidth<=1100?320:540),m(`graph`),oe()},children:[(0,z.jsx)(`span`,{"aria-hidden":`true`,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)(`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:M}),` 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)(`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(`
|
|
40
|
+
`)}):(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 O_,z,k_=t((()=>{O_=e(i()),ke(),z=a()})),A_,j_=t((()=>{A_=`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`})),M_,N_=t((()=>{M_=`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`})),P_,F_=t((()=>{P_=`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`})),I_,L_=t((()=>{I_=`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`})),R_,z_=t((()=>{R_=`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`})),B_,V_=t((()=>{B_=`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`})),H_,U_=t((()=>{H_=`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`})),W_,G_=t((()=>{W_=`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`})),K_,q_=t((()=>{K_=`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`})),J_,Y_=t((()=>{J_=`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`})),X_,Z_=t((()=>{X_=`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`})),Q_,$_=t((()=>{Q_=`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`})),ev,tv=t((()=>{ev=`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`})),nv,rv=t((()=>{nv=`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`})),iv,av=t((()=>{iv=`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`})),ov,sv=t((()=>{ov=`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`})),cv,lv=t((()=>{cv=`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`})),uv,dv=t((()=>{uv=`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`})),fv,pv=t((()=>{fv=`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`})),mv,hv=t((()=>{mv=`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`})),gv,_v=t((()=>{gv=`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`})),vv,yv=t((()=>{vv=`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`})),bv,xv=t((()=>{bv=`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`})),Sv,Cv=t((()=>{Sv=`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`})),wv,Tv=t((()=>{wv=`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`})),Ev,Dv=t((()=>{Ev=`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`})),Ov,kv=t((()=>{Ov=`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`})),Av,jv=t((()=>{Av=`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`})),Mv,Nv=t((()=>{Mv=`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`})),Pv,Fv=t((()=>{Pv=`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`})),Iv,Lv=t((()=>{Iv=`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`})),Rv,zv=t((()=>{Rv=`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`})),Bv,Vv=t((()=>{Bv=`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`})),Hv,Uv=t((()=>{Hv=`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`})),Wv,Gv=t((()=>{Wv=`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`})),Kv,qv=t((()=>{Kv=`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`})),Jv,Yv=t((()=>{Jv=`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`})),Xv,Zv=t((()=>{Xv=`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`})),Qv,$v=t((()=>{Qv=`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`})),ey,ty=t((()=>{ey=`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`})),ny,ry=t((()=>{ny=`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`})),iy,ay=t((()=>{iy=`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`})),oy,sy=t((()=>{oy=`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`})),cy,ly=t((()=>{cy=`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`})),uy,dy=t((()=>{uy=`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`})),fy,py=t((()=>{fy=`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`})),my,hy=t((()=>{my=`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`})),gy,_y=t((()=>{gy=`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`})),vy,yy=t((()=>{vy=`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`})),by,xy=t((()=>{by=`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`})),Sy,Cy=t((()=>{Sy=`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`})),wy,Ty=t((()=>{wy=`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`})),Ey,Dy=t((()=>{Ey=`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`}));function Oy(e){let t=e.lastIndexOf(`.`);return t===-1?``:e.slice(t+1).toLowerCase()}function ky(e,t){let n=jy[e]||jy[e.toLowerCase()];return n?t?n.open:n.closed:t?M_:A_}function Ay(e,t){return e.endsWith(`.config.ts`)||e.endsWith(`.config.js`)?gy:e.endsWith(`.tsx`)?fy:e.endsWith(`.jsx`)?uy:Ny[e.toLowerCase()]||My[t]||`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 jy,My,Ny,Py=t((()=>{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(),py(),hy(),_y(),yy(),xy(),Cy(),Ty(),Dy(),jy={".cargo_home":{closed:gv,open:vv},".github":{closed:X_,open:Q_},".git":{closed:K_,open:J_},".rustup":{closed:gv,open:vv},".rustup_copy":{closed:gv,open:vv},".rustup_home":{closed:gv,open:vv},assets:{closed:ev,open:nv},components:{closed:P_,open:I_},crates:{closed:gv,open:vv},css:{closed:Iv,open:Rv},dist:{closed:R_,open:B_},docs:{closed:H_,open:W_},logs:{closed:iv,open:ov},node_modules:{closed:cv,open:uv},out:{closed:R_,open:B_},public:{closed:fv,open:mv},renderer:{closed:Iv,open:Rv},scripts:{closed:bv,open:Sv},src:{closed:wv,open:Ev},"src-tauri":{closed:Ov,open:Av},tests:{closed:Mv,open:Pv},utils:{closed:Bv,open:Hv}},My={css:Wv,html:Jv,jpeg:Xv,jpg:Xv,js:Qv,json:ey,lock:ny,log:iy,md:oy,png:Xv,rs:my,svg:Xv,toml:by,ts:Sy,tsx:fy,yaml:Ey,yml:Ey},Ny={"package-lock.json":cy,"package.json":cy,"tauri.conf.json":vy,"vite.config.ts":wy,"vite.config.web.ts":wy}})),Fy=t((()=>{}));async function Iy(e,t,n){let r=__(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 Ly(e){let t=new Map;return async(n,r)=>{let i=f_(JSON.stringify({root:n,path:r,kind:`file`})),a=p_(i.root,i.path);if(e.selectIfOpen(a))return;let o=t.get(a);if(o){await o,e.selectIfOpen(a);return}let s=Iy(i.root,i.path,e).then(e.open);t.set(a,s);try{await s}finally{t.delete(a)}}}var Ry=t((()=>{y_(),g_()})),zy=t((()=>{}));function By(e){let t=e.trim();if(t.startsWith(`<think>`)||t.includes(`</think>`))return!0;let n=t.split(`
|
|
41
|
+
`).length,r=t.length;if(t.includes(`
|
|
42
|
+
|
|
43
|
+
`)||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 Vy(e){return e.filter(e=>e.type===`Thought`).map(e=>e.data.thought).filter(e=>!!e&&!By(e))}function Hy(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&&By(n.data.thought)&&t.push(n.data.thought);return t}function Uy(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 Wy(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===`ThinkingDelta`){let n=e.findIndex(e=>e.type===`ThinkingDelta`&&e.data.id===t.data.id);if(n<0)return Uy([...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,Uy(r)}}return Uy([...e,t])}function Gy(e,t){return t.reduce(Wy,e)}function Ky(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);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)){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 qy(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 Jy(e){let t=Qy.get(e);if(t?.length===e.length)return t.changes;let n=Yy(e);return Qy.set(e,{length:e.length,changes:n}),n}function Yy(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(`
|
|
44
|
+
`).length:0,s=a?a.split(`
|
|
45
|
+
`).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.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.body??e.text??``;if(typeof r==`string`&&r.trim()){let e=i?i.split(`
|
|
46
|
+
`).length:0;n={action:t.data.action,path:r.trim(),created:!0,additions:e,deletions:0,hunks:[{oldText:``,newText:i}]}}}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`)&&(typeof t.data.result!=`string`||!t.data.result.startsWith(`Error:`)&&!t.data.result.startsWith(`Failed:`)))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 Xy(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 Zy,Qy,$y=t((()=>{Zy=[],Qy=new WeakMap})),eb,tb=t((()=>{eb=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)})}}})),nb=t((()=>{}));function rb({artifact:e,chatId:t}){let[n,r]=(0,ib.useState)(``),[i,a]=(0,ib.useState)(``),o=(0,ib.useRef)(null);return(0,ib.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,ab.jsx)(`a`,{href:e.uri,target:`_blank`,rel:`noreferrer`,children:e.name}):(0,ab.jsxs)(`span`,{children:[e.name,`: `,e.uri]}):(0,ab.jsxs)(`div`,{className:`mcp-artifact`,children:[e.kind===`image`&&n&&(0,ab.jsxs)(ab.Fragment,{children:[(0,ab.jsx)(`button`,{type:`button`,className:`mcp-image-button`,onClick:()=>o.current?.showModal(),"aria-label":`View ${e.name}`,children:(0,ab.jsx)(`img`,{src:n,alt:e.name,onError:()=>a(`Image unavailable`)})}),(0,ab.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,ab.jsxs)(`header`,{children:[(0,ab.jsx)(`span`,{title:e.name,children:e.name}),(0,ab.jsx)(`button`,{type:`button`,"aria-label":`Close`,onClick:()=>o.current?.close(),children:(0,ab.jsx)(c,{size:18})})]}),(0,ab.jsx)(`img`,{src:n,alt:e.name})]})]}),n?(0,ab.jsxs)(`a`,{href:n,download:e.name,children:[e.name,` · `,(e.size/1024).toFixed(1),` KB`]}):(0,ab.jsxs)(`span`,{children:[e.name,` · `,i||`Loading attachment…`]}),e.metadata?.url&&(0,ab.jsx)(`span`,{title:e.metadata.url,children:e.metadata.url}),!!e.metadata?.width&&!!e.metadata?.height&&(0,ab.jsxs)(`span`,{children:[e.metadata.width,` × `,e.metadata.height]}),e.metadata?.capturedAt&&(0,ab.jsx)(`time`,{dateTime:e.metadata.capturedAt,children:e.metadata.capturedAt}),i&&n&&(0,ab.jsx)(`span`,{role:`status`,children:i})]})}var ib,ab,ob,sb=t((()=>{ib=e(i()),k(),ke(),nb(),ab=a(),ob=(0,ib.memo)(function({progress:e,running:t=!1,interrupted:n=!1,chatId:r}){let[,i]=(0,ib.useState)(0),a=(0,ib.useRef)(new Map),{calls:o,discovery:s,artifacts:c,warnings:l}=(0,ib.useMemo)(()=>{let t=new Map,n=new Map,r=new Map,i=new Set;for(let o of e)if(o.type===`ToolStart`&&o.data.action===`mcp_tool`&&o.data.callId){let e=o.data.callId;a.current.has(e)||a.current.set(e,Date.now()),t.set(e,{label:`${o.data.input.server}/${o.data.input.tool}`})}else if(o.type===`ToolDiscovery`)n.set(`${o.data.server}/${o.data.tool}`,o.data.message);else if(o.type===`DeviceState`){let{callId:e,server:n,tool:r,update:i}=o.data;t.set(e,{...t.get(e),label:`${n}/${r}`,device:i})}else if(o.type===`ToolProgress`){let{callId:e,server:n,tool:r,update:i}=o.data;t.set(e,{...t.get(e),label:`${n}/${r}`,update:i})}else if(o.type===`ToolEnd`&&o.data.callId&&o.data.action===`mcp_tool`){let e=t.get(o.data.callId);t.set(o.data.callId,{label:e?.label||`${o.data.input.server}/${o.data.input.tool}`,...e,status:o.data.status||(/^(Error:|Blocked|User denied)/.test(o.data.result)?`failed`:`success`)})}else if(o.type===`ToolArtifacts`){for(let e of o.data.artifacts)r.set(e.id,e);for(let e of o.data.warnings)i.add(e)}return{calls:t,discovery:n,artifacts:r,warnings:i}},[e]),u=(0,ib.useMemo)(()=>[...c.values()].filter(e=>e.server!==`view_image`),[c]),d=t&&[...o.values()].some(e=>!e.status);if((0,ib.useEffect)(()=>{if(!d)return;let e=setInterval(()=>i(e=>e+1),1e3);return()=>clearInterval(e)},[d]),!o.size&&!u.length&&!l.size&&!s.size)return null;let f=!o.size&&!u.length&&!s.size&&l.size>0;return(0,ab.jsxs)(`section`,{className:`mcp-results${f?` mcp-results-compact`:``}`,"aria-label":`MCP results`,children:[[...s].map(([e,t])=>(0,ab.jsxs)(`div`,{className:`mcp-call-status`,role:`status`,children:[(0,ab.jsx)(`strong`,{children:e}),(0,ab.jsx)(`span`,{children:t})]},e)),[...o].map(([e,r])=>{let i=t&&!r.status,o=Math.max(r.update?.elapsedSecs||0,Math.floor((Date.now()-(a.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 · ${o}s`:`Interrupted; result unconfirmed`;return(0,ab.jsxs)(`div`,{className:`mcp-call-status`,role:`status`,children:[(0,ab.jsx)(`strong`,{children:r.label}),(0,ab.jsx)(`span`,{children:c||l}),r.device&&(0,ab.jsxs)(ab.Fragment,{children:[(0,ab.jsx)(`span`,{children:r.device.message}),(0,ab.jsxs)(`span`,{children:[`Target: `,JSON.stringify(r.device.target),` · Actual: `,JSON.stringify(r.device.actual)]})]}),i&&r.update?.message&&(0,ab.jsx)(`span`,{children:r.update.message}),i&&s!==void 0&&(0,ab.jsxs)(`progress`,{max:100,value:s,"aria-label":`${r.label} progress`,children:[s,`%`]})]},e)}),u.length>0&&(0,ab.jsx)(`div`,{className:`mcp-artifacts`,children:u.map(e=>(0,ab.jsx)(rb,{artifact:e,chatId:r},e.id))}),[...l].map(e=>(0,ab.jsxs)(`div`,{className:`mcp-warning-banner`,role:`status`,children:[(0,ab.jsx)(ge,{size:14,className:`mcp-warning-icon`,"aria-hidden":`true`}),(0,ab.jsx)(`span`,{className:`mcp-warning-text`,children:e})]},e))]})})}));function cb(e){let t=e.trim().split(`
|
|
47
|
+
`,1)[0].trim();return/^data:image\/(?:png|jpeg|gif|webp|svg\+xml);base64,[A-Za-z0-9+/]+={0,2}$/.test(t)?t:null}function lb(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=cb(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 ub=t((()=>{})),db=t((()=>{}));function fb({image:e,chatId:t,variant:n=`card`,onOpenArtifact:r}){let[i,a]=(0,pb.useState)(e.src||``),[o,s]=(0,pb.useState)(!1),[l,u]=(0,pb.useState)(!1),d=(0,pb.useRef)(null);(0,pb.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,pb.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,mb.jsxs)(`figure`,{className:`viewed-image-inline`,"data-activity-image":e.id,children:[o||!i?(0,mb.jsx)(`p`,{className:`viewed-image-inline-status`,role:`status`,children:o?`Image preview unavailable`:`Loading image…`}):(0,mb.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,children:[(0,mb.jsx)(`img`,{src:i,alt:`Viewed image: ${e.name}`,loading:`lazy`,onError:()=>s(!0)}),(0,mb.jsx)(`span`,{className:`viewed-image-inline-overlay`,children:(0,mb.jsx)(`span`,{className:`viewed-image-inline-badge`,children:r?`Open in Tools`:`Click to zoom`})})]}),(0,mb.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,mb.jsxs)(`header`,{children:[(0,mb.jsx)(`span`,{title:e.path,children:e.name}),(0,mb.jsx)(`button`,{type:`button`,"aria-label":`Close image preview`,onClick:()=>d.current?.close(),children:(0,mb.jsx)(c,{size:18})})]}),l&&i&&(0,mb.jsx)(`img`,{src:i,alt:e.name})]})]}):(0,mb.jsxs)(`figure`,{className:`viewed-image`,"data-viewed-image":e.id,children:[o||!i?(0,mb.jsx)(`p`,{className:`viewed-image-error`,role:`status`,children:o?`Image preview unavailable`:`Loading image…`}):(0,mb.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,children:(0,mb.jsx)(`img`,{src:i,alt:`Viewed image: ${e.name}`,loading:`lazy`,onError:()=>s(!0)})}),(0,mb.jsx)(`figcaption`,{title:e.path,children:e.name}),(0,mb.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,mb.jsxs)(`header`,{children:[(0,mb.jsx)(`span`,{title:e.path,children:e.name}),(0,mb.jsx)(`button`,{type:`button`,"aria-label":`Close image preview`,onClick:()=>d.current?.close(),children:(0,mb.jsx)(c,{size:18})})]}),l&&i&&(0,mb.jsx)(`img`,{src:i,alt:e.name})]})]})}var pb,mb,hb,gb=t((()=>{pb=e(i()),k(),ub(),ke(),db(),mb=a(),hb=(0,pb.memo)(function({progress:e,chatId:t,onOpenArtifact:n}){let r=(0,pb.useMemo)(()=>lb(e),[e]);return r.length?(0,mb.jsx)(`section`,{className:`viewed-images`,"aria-label":`Images viewed by Mint`,children:r.map(e=>(0,mb.jsx)(fb,{image:e,chatId:t,onOpenArtifact:n},e.id))}):null})}));function _b(e,t,n,r){let i=r.replace(/\r\n?/g,`
|
|
48
|
+
`);return{value:e.slice(0,t)+i+e.slice(n),text:i,caret:t+i.length,collapsed:i.replace(/\n$/,``).split(`
|
|
49
|
+
`).length>6}}function vb(e){return`[Pasted Content ${Array.from(e).length} chars]`}var yb=t((()=>{})),bb=t((()=>{}));function xb({value:e,inputRef:t,onValueChange:n,onResizeInput:r,...i}){let[a,o]=(0,Sb.useState)(null),[s,c]=(0,Sb.useState)(!1),l=(0,Sb.useRef)(null),u=a!==null&&a.value===e&&!s;(0,Sb.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,Cb.jsxs)(Cb.Fragment,{children:[u&&(0,Cb.jsxs)(`button`,{type:`button`,ref:l,className:`chat-pasted-content`,"aria-label":`${vb(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,Cb.jsx)(`span`,{children:vb(a.text)}),(0,Cb.jsx)(`span`,{className:`chat-pasted-content-action`,children:`View / edit`})]}),(0,Cb.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=_b(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 Sb,Cb,wb=t((()=>{Sb=e(i()),yb(),bb(),Cb=a()}));function Tb({elapsedSeconds:e}){let[t,n]=(0,Eb.useState)(0);return(0,Eb.useEffect)(()=>{let e=Date.now(),t=setInterval(()=>n(Math.floor((Date.now()-e)/1e3)),250);return()=>clearInterval(t)},[]),(0,Db.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:`context-compaction-status`,children:[(0,Db.jsxs)(`div`,{className:`thinking-status`,children:[(0,Db.jsxs)(`span`,{className:`thinking-status-label`,children:[(0,Db.jsx)(`span`,{"aria-hidden":`true`,children:`✦ `}),`Compacting context`]}),(0,Db.jsx)(`span`,{className:`thinking-status-meta`,children:` · ${e??t}s · Esc to cancel`})]}),(0,Db.jsx)(`div`,{className:`thinking-status-meta`,children:`Summarizing earlier steps to continue working`})]})}var Eb,Db,Ob=t((()=>{Eb=e(i()),Db=a()}));function kb(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 Ab=t((()=>{}));function jb(e,t,n){return!t||n==null?e:e.filter(e=>e.id!==n)}var Mb=t((()=>{}));function Nb(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 Pb(e,t){if(!e||typeof e!=`object`)return``;let n=e[t];if(typeof n==`string`){let e=n.trim();return Nb(e)?``:e}return``}function Fb(e){return e.replace(/^\/home\/([^/]+)/,`~`)||`workspace`}function Ib(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`,`detect_project`].includes(e)?`folder`:[`read_file`,`symbols`,`read_diagnostics`,`git_diff`,`apply_patch`,`write_file`,`note_write`,`view_image`].includes(e)?`file`:[`calculation`,`calculator`].includes(e)?`calc`:t.includes(`/`)&&!/\.[^/]+$/.test(t)?`folder`:`tool`}function Lb(e,t){let n=Pb(t,`path`),r=Pb(t,`query`)||Pb(t,`q`)||Pb(t,`keyword`)||Pb(t,`search`)||Pb(t,`prompt`)||Pb(t,`searchTerm`)||Pb(t,`search_term`),i=Pb(t,`command`)||Pb(t,`cmd`)||Pb(t,`script`)||Pb(t,`exec`)||Pb(t,`code`)||Pb(t,`bash`)||Pb(t,`sh`);if(!i&&t&&typeof t==`object`){if(typeof t.arguments==`object`&&t.arguments!==null){let e=t.arguments;i=Pb(e,`command`)||Pb(e,`cmd`)||Pb(e,`script`)||Pb(e,`exec`)||Pb(e,`code`)||Pb(e,`bash`)||Pb(e,`sh`)}else if(typeof t.arguments==`string`)try{let e=JSON.parse(t.arguments);e&&typeof e==`object`&&(i=Pb(e,`command`)||Pb(e,`cmd`)||Pb(e,`script`)||Pb(e,`exec`)||Pb(e,`code`)||Pb(e,`bash`)||Pb(e,`sh`))}catch{}}if(!i&&typeof t==`string`){let e=t.trim();e&&!e.startsWith(`{`)&&!Nb(e)&&(i=e)}let a=Pb(t,`name`),o=Pb(t,`tool`),s=Pb(t,`server`),c=Pb(t,`symbol`)||Pb(t,`ticker`),l=Pb(t,`filter`),u=Pb(t,`expression`)||Pb(t,`expr`)||Pb(t,`math`),d=Pb(t,`city`)||Pb(t,`location`)||Pb(t,`place`),f=Pb(t,`url`),p=Pb(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`browser_open`:case`browser_navigate`:m=f||`(url)`;break;case`browser_click`:m=p||`(element)`;break;case`mcp_tool`:m=o?s?`${s}/${o}`:o:a||`mcp tool`;break;case`note_write`:m=a||n||`(note)`;break;default:m=n||r||i||u||c||d||f||p||l||a||o||e.replaceAll(`_`,` `)}let h=m;if(e===`read_file`&&n){let e=typeof t.startLine==`number`?t.startLine:typeof t.start_line==`number`?t.start_line:void 0,n=typeof t.endLine==`number`?t.endLine:typeof t.end_line==`number`?t.end_line:void 0;e!==void 0&&n!==void 0?h=`${m} #L${e}-${n}`:e!==void 0&&(h=`${m} #L${e}`)}return{label:e===`read_file`&&Pb(t,`skill_name`)?`Reading skill: ${Pb(t,`skill_name`)}`:e,target:Fb(h),kind:Ib(e,h),state:`active`,action:e}}function Rb(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 zb(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(Bb(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(Bb(n)),t}function Bb(e){let t=e.items.length;if(t===1)return e.title=e.items[0].target,e.state=e.items[0].state,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 e.title=o===`calculation`?e.state===`active`?`Calculating expressions (${s}/${t})`:`Calculated ${t} expressions`:o===`read_file`?e.state===`active`?`Reading files (${s}/${t})`:`Read ${t} files`:o===`write_file`?e.state===`active`?`Writing files (${s}/${t})`:`Wrote ${t} files`:o===`search_code`||o===`semantic_search`?`Searched codebase (${t} queries)`:o===`web_search`?`Searched web (${t} queries)`:`Executed ${t} ${o.replaceAll(`_`,` `)}`,e}function Vb(e){let t=Jb.get(e);if(t?.length===e.length)return t.view;let n=Hb(e);return Jb.set(e,{length:e.length,view:n}),n}function Hb(e){let t=[],n=[],r=null,i=0,a=()=>{if(!r)return;let e=Bb(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=Lb(o.data.action,o.data.input);if(e.callId=o.data.callId,t.push(e),o.data.action===`read_file`&&Pb(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=Lb(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||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.action===`view_image`?cb(o.data.result):null;if(t[n].result=r?o.data.result.replace(r,`[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`&&o.data.result.startsWith(`User answered:`)){let e=o.data.result.replace(`User answered:`,``).trim();t[n].target=`(Answered: "${e}") ${t[n].target}`}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=By(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=lb(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=t.slice(-25);return{summary:Rb(t),items:c,groups:zb(c),timeline:n.slice(-60)}}function Ub(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(`
|
|
50
|
+
`).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 Wb(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 Gb(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.type===`PlanUpdated`)return n.data.plan}}function Kb(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.type===`RunCompleted`)return n.data.summary}}function qb(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`))}var Jb,Yb=t((()=>{$y(),ub(),Jb=new WeakMap}));function Xb(e){let t=(0,Zb.useRef)(e);return(0,Zb.useLayoutEffect)(()=>{t.current=e},[e]),(0,Zb.useCallback)(((...e)=>t.current(...e)),[])}var Zb,Qb=t((()=>{Zb=e(i())})),$b=t((()=>{}));function ex({choice:e,inputRef:t,onSelect:n,onDismiss:r}){let[i,a]=(0,tx.useState)(0),o=(0,tx.useRef)(null),s=(0,tx.useRef)([]),c=Math.min(i,Math.max(0,e.options.length-1));return(0,tx.useEffect)(()=>{a(0),t.current?.focus()},[e,t]),(0,tx.useEffect)(()=>{s.current[c]?.scrollIntoView({block:`nearest`})},[c,e]),(0,tx.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,nx.jsxs)(`section`,{ref:o,className:`slash-choice-panel`,"aria-label":`${e.command} choices`,children:[(0,nx.jsxs)(`header`,{className:`slash-choice-heading`,children:[(0,nx.jsxs)(`div`,{children:[(0,nx.jsx)(`span`,{className:`slash-choice-command`,children:e.command}),(0,nx.jsx)(`p`,{children:e.title})]}),(0,nx.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Dismiss choices`,children:`×`})]}),(0,nx.jsx)(`div`,{className:`slash-choice-options`,role:`group`,"aria-label":`Options`,children:e.options.map((e,r)=>(0,nx.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,nx.jsxs)(`span`,{children:[r+1,`.`]}),e.label]},e.value))}),(0,nx.jsx)(`span`,{className:`slash-choice-status`,role:`status`,children:e.options[c]?.label}),(0,nx.jsx)(`div`,{className:`slash-choice-hint`,children:`↑↓ select · Enter choose · Esc dismiss`})]})}var tx,nx,rx=t((()=>{tx=e(i()),$b(),nx=a()})),ix=t((()=>{})),ax,ox=t((()=>{ax=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|list|show <name>]","description":"Run task in plan mode, toggle plan mode, or list/show plans saved under .agents/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":"/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"]}]`)})),sx,cx=t((()=>{ox(),sx=ax.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}))})),lx,ux,dx,fx,px,mx,hx=t((()=>{lx=e(i()),k(),ix(),cx(),ke(),ux=a(),dx=[`system`,`models`,`workspace`,`tools`],fx={system:`System`,models:`Models`,workspace:`Workspace`,tools:`Tools`},px=[{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`}],mx=(0,lx.forwardRef)(function({message:e,onComplete:t,workspacePath:n,mcpServers:r,anchorRef:i,suppressed:a=!1},o){let[s,c]=(0,lx.useState)([]),[l,d]=(0,lx.useState)(0),[f,p]=(0,lx.useState)(null),m=(0,lx.useRef)(null),h=(0,lx.useRef)(null),g=e.replace(/^\s+/,``),_=g.startsWith(`/`)?`slash`:g.startsWith(`$`)?`skill`:/@[\w\-./]*$/.test(e)?`at`:null;(0,lx.useEffect)(()=>{if(_!==`skill`)return;let e=!0;return M.listLearnedSkills(n).then(t=>{e&&Array.isArray(t)&&c(t)}).catch(()=>{}),()=>{e=!1}},[_,n]);let y=(0,lx.useMemo)(()=>{if(_!==`slash`)return[];let e=g.toLowerCase(),t=sx.some(t=>e.startsWith(t.command.toLowerCase()+` `)),n=e.slice(1).trim().split(/\s+/).filter(Boolean),r=sx.filter(r=>r.command.toLowerCase().startsWith(e)||!t&&!/\s/.test(e)&&n.every(e=>`${r.command} ${r.description}`.toLowerCase().includes(e))),i=e=>dx.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]),b=(0,lx.useMemo)(()=>{if(_!==`slash`)return;let e=g.toLowerCase();return[...sx].sort((e,t)=>t.command.length-e.command.length).find(t=>e===t.command.toLowerCase()||e.startsWith(t.command.toLowerCase()+` `))},[_,g]),x=(0,lx.useMemo)(()=>{if(_!==`skill`)return[];let e=g.slice(1).split(/\s+/)[0].toLowerCase();return s.filter(t=>t.name.toLowerCase().startsWith(e))},[_,g,s]),S=(0,lx.useMemo)(()=>{if(_!==`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`})),...px].filter(e=>e.label.toLowerCase().includes(t))},[_,e,r]),w=_===`slash`?y:_===`skill`?x:_===`at`?S:[],T=_===`slash`&&w.length===0&&g.trim().length>1,E=!a&&_!==null&&f!==e&&(w.length>0||T);(0,lx.useEffect)(()=>{d(0)},[e]),(0,lx.useEffect)(()=>{E&&h.current&&h.current.querySelector(`[data-idx="${l}"]`)?.scrollIntoView({block:`nearest`})},[l,E]),(0,lx.useEffect)(()=>{if(!E)return;let t=t=>{let n=t.target;m.current?.contains(n)||i.current?.contains(n)||p(e)};return document.addEventListener(`mousedown`,t),()=>document.removeEventListener(`mousedown`,t)},[E,e,i]);let D=t=>_===`slash`?`${t.command} `:_===`skill`?`$${t.name} `:e.replace(/@[\w\-./]*$/,`${t.label} `),O=e=>{let n=D(e);p(n),d(0),t(n)};if((0,lx.useImperativeHandle)(o,()=>({handleKeyDown(t){if(a||_===null)return!1;let n=(t.key===`ArrowUp`||t.key===`ArrowDown`)&&!t.shiftKey&&!t.altKey&&!t.metaKey&&!t.ctrlKey&&!t.nativeEvent.isComposing;if(n&&!E&&w.length>0)return p(null),d(t.key===`ArrowDown`?0:w.length-1),t.preventDefault(),!0;if(!E)return!1;if(n&&w.length>0)return d(e=>t.key===`ArrowDown`?(e+1)%w.length:(e-1+w.length)%w.length),t.preventDefault(),!0;if((t.key===`Enter`||t.key===`Tab`)&&!t.shiftKey&&!t.nativeEvent.isComposing){if(t.key===`Enter`&&_===`slash`&&w.some(e=>e.command.toLowerCase()===g.trim().toLowerCase()))return!1;let e=w[l]??w[0];return e?(O(e),t.preventDefault(),!0):!1}return t.key===`Escape`&&(p(e),t.preventDefault(),!0)}})),!E)return null;let k=w.length===0?`No matches`:_===`slash`?`${w.length} command${w.length===1?``:`s`}`:_===`skill`?`${w.length} skill${w.length===1?``:`s`}`:`${w.length} mention${w.length===1?``:`s`}`,A=(e,t,n,r,i,a)=>(0,ux.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:()=>O(e),onPointerMove:()=>d(t),children:[(0,ux.jsx)(`span`,{className:`slash-cmd-icon`,"aria-hidden":`true`,children:_===`skill`?(0,ux.jsx)(u,{size:15}):_===`at`?(0,ux.jsx)(pe,{size:15}):e.category===`models`?(0,ux.jsx)(C,{size:15}):e.category===`workspace`?(0,ux.jsx)(ee,{size:15}):e.category===`tools`?(0,ux.jsx)(v,{size:15}):(0,ux.jsx)(we,{size:15})}),(0,ux.jsx)(`span`,{className:`slash-cmd-name`,children:n}),(0,ux.jsx)(`span`,{className:`slash-cmd-body`,children:(0,ux.jsx)(`span`,{className:`slash-cmd-desc`,children:r})}),i&&(0,ux.jsx)(`span`,{className:`skill-badge`,children:i})]},n);return(0,ux.jsxs)(`div`,{className:`slash-suggestions-popup`,ref:m,children:[(0,ux.jsxs)(`div`,{className:`slash-suggestions-header`,children:[_===`slash`?`Slash Commands`:_===`skill`?`Learned Skills`:`Context Mentions`,(0,ux.jsx)(`span`,{className:`slash-suggestions-count`,children:k})]}),(0,ux.jsxs)(`div`,{className:`slash-suggestions-list`,ref:h,role:`listbox`,"aria-label":_===`slash`?`Slash commands`:_===`skill`?`Skills`:`Context mentions`,children:[_===`slash`&&(w.length>0?[...new Set(y.map(e=>e.category??`tools`))].map(e=>{let t=y.filter(t=>(t.category??`tools`)===e);return t.length?(0,ux.jsxs)(`div`,{className:`slash-suggestions-group`,children:[(0,ux.jsx)(`div`,{className:`slash-suggestions-group-label`,children:fx[e]}),t.map(e=>A(e,y.indexOf(e),e.command,e.description,void 0,e.usage))]},e):null}):(0,ux.jsx)(`div`,{className:`slash-suggestions-empty`,children:b?(0,ux.jsxs)(ux.Fragment,{children:[(0,ux.jsx)(`span`,{className:`slash-cmd-name`,children:b.command}),(0,ux.jsx)(`span`,{className:`slash-cmd-usage`,children:b.usage||`No further arguments`})]}):(0,ux.jsxs)(`span`,{children:[`No command matches `,(0,ux.jsx)(`code`,{children:g.trim()})]})})),_===`skill`&&x.map((e,t)=>A(e,t,`$${e.name}`,e.description||e.content?.slice(0,60)||``,`[Skill]`)),_===`at`&&S.map((e,t)=>A(e,t,e.label,e.desc,e.kind===`plugin`?`[Plugin]`:`[Context]`))]}),(0,ux.jsx)(`div`,{className:`slash-suggestions-hint`,children:`↑↓ select · Tab complete · Enter send · Esc close`})]})})}));function gx(e){return!!e?.SkillWrite}function _x(e){if(!e)return``;let t=0,n=0,r=e.split(`
|
|
51
|
+
`);for(let e of r)e.startsWith(`+++ `)||e.startsWith(`--- `)||(e.startsWith(`+`)?t++:e.startsWith(`-`)&&n++);return`(+${t} -${n})`}function vx(e){if(!e)return{title:`Action Pending Approval`,body:`No action details available.`,isDangerous:!1};if(e.WriteFile){let t=_x(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=_x(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 yx(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 bx(e){if(!e)return null;let t=e.split(`
|
|
52
|
+
`),n=1,r=1;return(0,xx.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=yx(e);return i&&(n=i.oldStart,r=i.newStart),(0,xx.jsx)(`div`,{style:{color:`var(--text-muted)`,fontWeight:`bold`,padding:`2px 6px`},children:` `+e},t)}if(e.startsWith(`---`)||e.startsWith(`+++`))return(0,xx.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,xx.jsxs)(`div`,{style:a,children:[(0,xx.jsx)(`span`,{style:{color:`var(--text-muted)`,marginRight:`12px`,userSelect:`none`,display:`inline-block`,width:`36px`,textAlign:`right`,flexShrink:0},children:i}),o&&(0,xx.jsx)(`span`,{style:{color:s,marginRight:`4px`,userSelect:`none`,fontWeight:600},children:o}),(0,xx.jsx)(`span`,{children:c})]},t)})})}var xx,Sx=t((()=>{i(),xx=a()})),Cx=t((()=>{Sx()}));function wx(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 Tx(e){let t=e.split(`
|
|
53
|
+
`),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=wx(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 Ex,B,Dx,Ox=t((()=>{Ex=e(i()),Xe(),B=a(),Dx=({isOpen:e,onClose:t,filePath:n,diffText:r,onApprove:i,onReject:a,isDangerous:o})=>{let[s,c]=(0,Ex.useState)(`split`),[l,u]=(0,Ex.useState)(!1),{unifiedLines:d,splitRows:f,additions:p,deletions:m}=(0,Ex.useMemo)(()=>Tx(r||``),[r]);return(0,Ex.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,B.jsx)(`div`,{className:`management-modal-overlay`,onClick:t,style:{zIndex:10001},children:(0,B.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,B.jsxs)(`div`,{className:`management-modal-header`,style:{padding:`16px 20px`,gap:12},children:[(0,B.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,minWidth:0,flex:1},children:[(0,B.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:`6px`},children:`DIFF`}),(0,B.jsxs)(`div`,{style:{minWidth:0,flex:1},children:[(0,B.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,B.jsx)(`h3`,{className:`management-card-title`,style:{fontSize:`1rem`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},title:n,children:n}),(0,B.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,B.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginTop:3},children:[(0,B.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:`4px`},children:[`+`,p]}),(0,B.jsxs)(`span`,{style:{fontSize:`0.75rem`,fontWeight:700,color:`var(--status-error-fg)`,background:`var(--status-error-bg)`,padding:`1px 6px`,borderRadius:`4px`},children:[`-`,m]}),o&&(0,B.jsx)(`span`,{style:{fontSize:`0.72rem`,fontWeight:700,color:`var(--status-warning-fg)`,background:`var(--status-warning-bg)`,padding:`1px 6px`,borderRadius:`4px`,textTransform:`none`},children:`Review carefully`})]})]})]}),(0,B.jsxs)(`div`,{className:`management-filter-pills`,style:{display:`flex`,gap:2,padding:3,flexShrink:0},children:[(0,B.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,B.jsx)(`button`,{type:`button`,className:`management-pill-btn ${s===`unified`?`active`:``}`,onClick:()=>c(`unified`),style:{padding:`5px 10px`,fontSize:`0.78rem`},children:`Unified`})]}),(0,B.jsx)(`button`,{type:`button`,className:`management-modal-close`,onClick:t,title:`Close`,children:(0,B.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,B.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,B.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]}),(0,B.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,B.jsxs)(`div`,{className:`diff-split-container`,style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,minWidth:`700px`},children:[(0,B.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,B.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,B.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,B.jsxs)(Ex.Fragment,{children:[(0,B.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,B.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,B.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,B.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,B.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,B.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,B.jsx)(`div`,{style:{minWidth:`500px`},children:d.map((e,t)=>{if(e.type===`hunk`)return(0,B.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,B.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,B.jsxs)(`div`,{style:{display:`flex`,background:n,borderLeft:r,padding:`1px 0`},children:[(0,B.jsx)(`span`,{style:{width:`42px`,textAlign:`right`,color:`var(--text-muted)`,paddingRight:`8px`,userSelect:`none`,flexShrink:0},children:e.oldNum||``}),(0,B.jsx)(`span`,{style:{width:`42px`,textAlign:`right`,color:`var(--text-muted)`,paddingRight:`8px`,userSelect:`none`,flexShrink:0},children:e.newNum||``}),(0,B.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,B.jsx)(`span`,{style:{whiteSpace:`pre-wrap`,wordBreak:`break-all`,color:i},children:e.content})]},t)})})}),(0,B.jsxs)(`div`,{className:`management-modal-footer`,style:{padding:`14px 20px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,B.jsxs)(`div`,{style:{fontSize:`0.8rem`,color:`var(--text-muted)`},children:[(0,B.jsx)(`span`,{children:`Shortcut: `}),(0,B.jsx)(`kbd`,{style:{background:`var(--bg-surface-soft)`,border:`1px solid var(--border-subtle)`,padding:`2px 5px`,borderRadius:4,fontSize:`0.72rem`},children:`Esc`}),` Cancel`,(0,B.jsx)(`span`,{style:{margin:`0 8px`},children:`•`}),(0,B.jsx)(`kbd`,{style:{background:`var(--bg-surface-soft)`,border:`1px solid var(--border-subtle)`,padding:`2px 5px`,borderRadius:4,fontSize:`0.72rem`},children:`Cmd/Ctrl+Enter`}),` Approve`]}),(0,B.jsxs)(`div`,{style:{display:`flex`,gap:10},children:[(0,B.jsx)(`button`,{type:`button`,className:`management-action-btn danger`,onClick:a,style:{padding:`8px 16px`,fontSize:`0.88rem`},children:`Reject Change`}),(0,B.jsx)(`button`,{type:`button`,className:`management-primary-btn`,onClick:i,style:{padding:`8px 20px`,fontSize:`0.88rem`},children:`Approve & Apply`})]})]})]})}):null}}));function kx({pendingApproval:e,onApproval:t}){let[n,r]=(0,Ax.useState)(``),[i,a]=(0,Ax.useState)(new Set),[o,s]=(0,Ax.useState)(!1),c=vx(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?.McpTool,_=Array.isArray(e.approval?.AskUser?.options)?e.approval.AskUser.options:[],v=!!e.approval?.AskUser?.multiSelect,y=e.approval?.AskUser?.header||void 0,b=()=>{let e=Array.from(i).join(`, `),t=n.trim();return t?e?`${e} — ${t}`:t:e},x=e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},S=d?{badge:`Skill Change`,badgeClass:`edit`}:f?{badge:`Run Command`,badgeClass:c.isDangerous?`dangerous`:`command`}:l||u?{badge:`File Edit`,badgeClass:`edit`}:g?{badge:`MCP: ${g.server}`,badgeClass:`mcp`}:h?{badge:y||`Question`,badgeClass:`question`}:{badge:`Action Approval`,badgeClass:c.isDangerous?`dangerous`:`default`},C=d?[{key:`1`,title:`Allow once`,variant:`approve`,action:()=>t(!0,!1)},{key:`2`,title:`Reject`,variant:`cancel`,action:()=>t(!1)}]:g?[{key:`1`,title:`Allow once`,variant:`approve`,action:()=>t(!0,!1)},{key:`2`,title:`Always allow for "${g.server}"`,variant:`session`,action:()=>t(!0,!1,`__mcp_allow_all__`)},{key:`3`,title:`Reject`,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,Ax.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<=C.length&&(e.preventDefault(),C[t-1].action())}else if(!v&&_.length>0){let n=parseInt(e.key,10);!isNaN(n)&&n>=1&&n<=_.length&&(e.preventDefault(),t(!0,!1,_[n-1].label))}}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h,v,_,C]),(0,jx.jsxs)(`div`,{className:`message ai-message`,style:{width:`100%`},children:[(0,jx.jsx)(`div`,{className:`bubble-wrapper`,style:{width:`100%`},children:(0,jx.jsxs)(`div`,{className:`action-card approval-card`,"data-tier":c.isDangerous?`dangerous`:void 0,style:{width:`100%`,alignItems:`stretch`,textAlign:`left`},children:[(0,jx.jsxs)(`div`,{className:`approval-card-header`,style:{width:`100%`,textAlign:`left`},children:[(0,jx.jsx)(`div`,{className:`approval-title-group`,style:{textAlign:`left`},children:(0,jx.jsx)(`div`,{className:`approval-title-text`,style:{textAlign:`left`},children:c.title})}),(0,jx.jsx)(`span`,{className:`approval-badge-chip ${S.badgeClass}`,children:S.badge})]}),m?(0,jx.jsxs)(`div`,{className:`approval-card-diff-container`,style:{width:`100%`},children:[(0,jx.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:`8px`},children:[(0,jx.jsxs)(`span`,{style:{fontSize:`0.82rem`,fontWeight:600,color:`var(--text-soft, #a1a1aa)`},children:[`Diff: `,(0,jx.jsx)(`code`,{style:{color:`var(--text-main, #f4f4f5)`},children:p})]}),(0,jx.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:`8px`,background:`var(--accent-subtle)`,border:`1px solid var(--accent-border)`,color:`var(--interactive-fg)`,cursor:`pointer`},children:`Review Side-by-Side`})]}),bx(m)]}):(0,jx.jsx)(`div`,{className:`approval-content-box ${h?`question-text`:``}`,children:c.body}),c.reason&&!m&&(0,jx.jsx)(`div`,{className:`approval-reason-text`,children:c.reason}),h?(0,jx.jsxs)(`div`,{className:`claude-choice-stack`,children:[_.length>0&&(0,jx.jsx)(`div`,{className:`claude-choice-options`,children:_.map((e,n)=>{let r=v&&i.has(e.label);return(0,jx.jsxs)(`button`,{type:`button`,className:`claude-choice-card ${r?`selected`:``}`,onClick:()=>v?x(e.label):t(!0,!1,e.label),children:[(0,jx.jsxs)(`div`,{className:`claude-choice-left`,children:[(0,jx.jsx)(`span`,{className:`claude-choice-key`,children:n+1}),(0,jx.jsxs)(`div`,{className:`claude-choice-text`,children:[(0,jx.jsx)(`span`,{className:`claude-choice-title`,children:e.label}),e.description&&(0,jx.jsx)(`span`,{className:`claude-choice-desc`,children:e.description})]})]}),(0,jx.jsx)(`div`,{className:`claude-choice-right`,children:v?(0,jx.jsx)(`span`,{style:{fontSize:`1.1rem`,color:r?`var(--interactive-fg)`:`var(--text-muted)`},children:r?`☑`:`☐`}):(0,jx.jsx)(`span`,{style:{fontSize:`1rem`,opacity:.6},children:`›`})})]},n)})}),(0,jx.jsx)(`div`,{className:`claude-choice-custom-box`,children:(0,jx.jsxs)(`div`,{style:{display:`flex`,gap:8,alignItems:`center`,width:`100%`},children:[(0,jx.jsx)(`input`,{type:`text`,className:`claude-choice-input`,placeholder:_.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(),v?t(!0,!1,b()):n.trim()&&t(!0,!1,n.trim()))}}),(v||n.trim())&&(0,jx.jsx)(`button`,{type:`button`,className:`approval-btn approval-btn-approve`,style:{whiteSpace:`nowrap`,padding:`9px 16px`,borderRadius:`8px`},disabled:v?i.size===0&&!n.trim():!n.trim(),onClick:()=>t(!0,!1,v?b():n.trim()),children:`Submit`})]})}),(0,jx.jsxs)(`button`,{type:`button`,className:`claude-choice-card variant-cancel`,onClick:()=>t(!1),style:{marginTop:2},children:[(0,jx.jsxs)(`div`,{className:`claude-choice-left`,children:[(0,jx.jsx)(`span`,{className:`claude-choice-key`,children:`✕`}),(0,jx.jsx)(`div`,{className:`claude-choice-text`,children:(0,jx.jsx)(`span`,{className:`claude-choice-title`,children:`Decline / Skip`})})]}),(0,jx.jsx)(`div`,{className:`claude-choice-right`,children:`›`})]})]}):(0,jx.jsx)(`div`,{className:`claude-choice-stack`,children:C.map(e=>(0,jx.jsxs)(`button`,{type:`button`,className:`claude-choice-card variant-${e.variant}`,onClick:e.action,children:[(0,jx.jsxs)(`div`,{className:`claude-choice-left`,children:[(0,jx.jsx)(`span`,{className:`claude-choice-key`,children:e.key}),(0,jx.jsx)(`div`,{className:`claude-choice-text`,children:(0,jx.jsx)(`span`,{className:`claude-choice-title`,children:e.title})})]}),(0,jx.jsx)(`div`,{className:`claude-choice-right`,children:`›`})]},e.key))})]})}),o&&m&&(0,jx.jsx)(Dx,{isOpen:o,onClose:()=>s(!1),filePath:p,diffText:m,isDangerous:c.isDangerous,onApprove:()=>{s(!1),t(!0)},onReject:()=>{s(!1),t(!1)}})]})}var Ax,jx,Mx=t((()=>{Ax=e(i()),Cx(),Ox(),jx=a()}));function Nx({thoughts:e,isLive:t=!1,blockKey:n,expanded:r,onExpandedChange:i,showEmptyHint:a=!1,variant:o=`default`}){let s=(0,Px.useRef)(null),c=r!==void 0&&!!i,[l,u]=(0,Px.useState)(t),d=c?!!r:l,f=e=>{c&&i?i(n,e):u(e)};return(0,Px.useEffect)(()=>{t&&!c&&u(!0)},[t,c]),(0,Px.useEffect)(()=>{t&&d&&s.current&&(s.current.scrollTop=s.current.scrollHeight)},[e,t,d]),e.length===0&&!a?null:e.length===0?(0,Fx.jsx)(`div`,{className:`thinking-block thinking-block-empty-state`,"data-live":t?`true`:`false`,children:(0,Fx.jsx)(`span`,{className:`thinking-block-empty`,children:Ix.emptyHint})}):(0,Fx.jsxs)(`div`,{className:`thinking-block${t?` is-live`:``}${d?` is-expanded`:``}${o===`extended`?` is-extended`:``}`,children:[(0,Fx.jsxs)(`button`,{type:`button`,className:`thinking-block-header`,onClick:()=>f(!d),"aria-expanded":d,children:[(0,Fx.jsx)(C,{size:14,className:`thinking-block-icon`,style:{flexShrink:0}}),(0,Fx.jsx)(`span`,{className:`thinking-block-label`,children:o===`extended`?t?Ix.extendedLive:Ix.extendedCompleted:t?Ix.live:Ix.completed}),t&&(0,Fx.jsx)(`span`,{className:`thinking-block-live-dot`,"aria-hidden":`true`}),(0,Fx.jsx)(`span`,{className:`thinking-block-chevron${d?` is-open`:``}`,"aria-hidden":`true`,children:(0,Fx.jsx)(h,{size:13,strokeWidth:2.2})})]}),d&&(0,Fx.jsx)(`div`,{className:`thinking-block-body`,children:(0,Fx.jsx)(`div`,{className:`thinking-block-content`,ref:s,children:e.map((e,t)=>(0,Fx.jsx)(`div`,{className:`thinking-block-step`,children:(0,Fx.jsx)(`div`,{className:`thinking-block-step-body`,children:Lg(e)})},`${n}-${t}`))})})]})}var Px,Fx,Ix,Lx=t((()=>{Px=e(i()),k(),Qg(),Fx=a(),Ix={live:`Thinking…`,completed:`Thinking process`,extendedLive:`Thinking…`,extendedCompleted:`Thought`,emptyHint:`No thoughts recorded`}}));function Rx({thought:e}){let t=Wb(e);return t?(0,V.jsx)(`div`,{className:`inline-thought-note`,children:(0,V.jsx)(`div`,{className:`inline-thought-note-text`,children:Lg(t)??t})}):null}function zx(e){let t=e.split(` #`)[0].trim().split(`/`);return t[t.length-1]}function Bx(e,t,n){if(e===`file`){let e=zx(t),n=Ay(e,Oy(e));return n?(0,V.jsx)(`img`,{src:n,alt:``,draggable:!1,className:`agent-activity-icon-img`}):(0,V.jsx)(y,{size:14,className:`agent-activity-kind-icon`})}if(e===`folder`){let e=ky(zx(t),!1);return e?(0,V.jsx)(`img`,{src:e,alt:``,draggable:!1,className:`agent-activity-icon-img`}):(0,V.jsx)(ee,{size:14,className:`agent-activity-kind-icon`})}return e===`calc`||n===`calculation`?(0,V.jsx)(ie,{size:14,className:`agent-activity-kind-icon`}):e===`search`?(0,V.jsx)(g,{size:14,className:`agent-activity-kind-icon`}):e===`terminal`?(0,V.jsx)(we,{size:14,className:`agent-activity-kind-icon`}):(0,V.jsx)(v,{size:14,className:`agent-activity-kind-icon`})}function Vx(e,t){if(!t||!t.trim()||e===`view_image`)return null;let n=t.trim().split(`
|
|
54
|
+
`)[0].trim();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.startsWith(`Error:`)&&!n.startsWith(`{`)?`→ ${n}`:null}function Hx(e){return e===`active`?(0,V.jsx)(ve,{size:12,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)(te,{size:12,className:`agent-activity-status-check`})}function Ux({activityView:e,chatId:t,onOpenArtifact:n}){let r=e.groups||zb(e.items),[i,a]=(0,Wx.useState)({}),[o,s]=(0,Wx.useState)({}),c=e=>{a(t=>({...t,[e]:!t[e]}))},l=(e,t=!1)=>{s(n=>({...n,[e]:!(n[e]??t)}))},u=(e,r)=>{let i=!!o[r],a=e.result?.trim(),s=Vx(e.action,a);return(0,V.jsxs)(Wx.Fragment,{children:[(0,V.jsxs)(`div`,{className:`agent-activity-item`,"data-kind":e.kind,"data-state":e.state,style:{cursor:a?`pointer`:`default`},onClick:()=>a&&l(r),children:[(0,V.jsx)(`span`,{className:`agent-activity-icon-wrap`,"aria-hidden":`true`,children:Bx(e.kind,e.target,e.action)}),(0,V.jsx)(`span`,{className:`agent-activity-label`,children:(0,V.jsx)(`span`,{className:`agent-activity-tool-name`,children:e.label||e.action})}),(0,V.jsxs)(`span`,{className:`agent-activity-text`,title:e.target,style:i?{whiteSpace:`normal`,wordBreak:`break-all`,overflow:`visible`,textOverflow:`clip`}:void 0,children:[(0,V.jsx)(`span`,{className:`agent-activity-target-text`,children:e.target}),s&&(0,V.jsx)(`span`,{className:`agent-activity-inline-result`,children:s})]}),(0,V.jsxs)(`span`,{className:`agent-activity-status-col`,children:[Hx(e.state),a&&(0,V.jsx)(`span`,{className:`agent-activity-chevron${i?` is-open`:``}`,"aria-hidden":`true`,children:(0,V.jsx)(h,{size:12,strokeWidth:2.2})})]})]}),e.viewedImage&&(0,V.jsx)(`div`,{className:`agent-activity-inline-preview`,children:(0,V.jsx)(fb,{image:e.viewedImage,chatId:t,variant:`inline`,onOpenArtifact:n})}),i&&a&&(0,V.jsx)(`div`,{className:`agent-activity-output`,children:a.includes(`[Self-Correction Guidance]`)?(0,V.jsxs)(V.Fragment,{children:[a.split(`[Self-Correction Guidance]`)[0]?.trim()&&(0,V.jsx)(`pre`,{children:a.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:a.split(`[Self-Correction Guidance]`)[1]?.trim()})]})]}):(0,V.jsx)(`pre`,{children:a})})]},r)},d=e=>{let r=!!i[e.id];return(0,V.jsxs)(`div`,{className:`agent-activity-group`,children:[(0,V.jsxs)(`div`,{className:`agent-activity-group-header${r?` is-expanded`:``}`,"data-state":e.state,onClick:()=>c(e.id),children:[(0,V.jsx)(`span`,{className:`agent-activity-icon-wrap`,"aria-hidden":`true`,children:Bx(e.kind,e.items[0]?.target,e.action)}),(0,V.jsx)(`span`,{className:`agent-activity-group-title`,children:e.title}),(0,V.jsxs)(`span`,{className:`agent-activity-group-badges`,children:[(0,V.jsx)(`span`,{className:`agent-activity-count-badge`,children:e.count}),Hx(e.state),(0,V.jsx)(`span`,{className:`agent-activity-chevron${r?` is-open`:``}`,"aria-hidden":`true`,children:(0,V.jsx)(h,{size:13,strokeWidth:2.2})})]})]}),r&&(0,V.jsx)(`div`,{className:`agent-activity-group-subitems`,children:e.items.map((r,i)=>{let a=`${e.id}-${i}-${r.target}`,s=!!o[a],c=r.result?.trim(),u=Vx(r.action,c);return(0,V.jsxs)(Wx.Fragment,{children:[(0,V.jsxs)(`div`,{className:`agent-activity-subitem`,"data-state":r.state,style:{cursor:c?`pointer`:`default`},onClick:()=>c&&l(a),children:[(0,V.jsx)(`span`,{className:`agent-activity-tree-bullet`,"aria-hidden":`true`,children:i===e.items.length-1?`└─`:`├─`}),(0,V.jsx)(`span`,{className:`agent-activity-subitem-target`,title:r.target,children:r.target}),u&&(0,V.jsx)(`span`,{className:`agent-activity-inline-result`,children:u}),(0,V.jsxs)(`span`,{className:`agent-activity-subitem-status`,children:[Hx(r.state),c&&(0,V.jsx)(`span`,{className:`agent-activity-chevron${s?` is-open`:``}`,"aria-hidden":`true`,children:(0,V.jsx)(h,{size:11,strokeWidth:2.2})})]})]}),r.viewedImage&&(0,V.jsx)(`div`,{className:`agent-activity-inline-preview agent-activity-subitem-preview`,children:(0,V.jsx)(fb,{image:r.viewedImage,chatId:t,variant:`inline`,onOpenArtifact:n})}),s&&c&&(0,V.jsx)(`div`,{className:`agent-activity-output agent-activity-subitem-output`,children:(0,V.jsx)(`pre`,{children:c})})]},a)})})]},e.id)};return(0,V.jsx)(`div`,{className:`agent-activity-list`,children:e.timeline&&e.timeline.length>0?e.timeline.map((e,t)=>{if(e.kind===`thought`)return(0,V.jsx)(Rx,{thought:e.thought},e.id||`thought-${t}`);if(e.kind===`extendedThinking`){let n=e.id||`ext-thought-${t}`,r=o[n]??!!e.streaming;return(0,V.jsxs)(`div`,{className:`agent-activity-thought-step`,children:[(0,V.jsxs)(`div`,{className:`agent-activity-thought-header${r?` is-expanded`:``}`,onClick:()=>l(n,!!e.streaming),children:[(0,V.jsx)(`span`,{className:`agent-activity-icon-wrap`,"aria-hidden":`true`,children:(0,V.jsx)(C,{size:14,className:`agent-activity-kind-icon`})}),(0,V.jsxs)(`span`,{className:`agent-activity-thought-title`,children:[`Thought`,(0,V.jsx)(`span`,{className:`agent-activity-thought-meta`,children:e.streaming?` · Thinking…`:e.elapsedMs==null?``:` · ${(e.elapsedMs/1e3).toFixed(1)}s`})]}),(0,V.jsx)(`span`,{className:`agent-activity-chevron${r?` is-open`:``}`,"aria-hidden":`true`,children:(0,V.jsx)(h,{size:13,strokeWidth:2.2})})]}),r&&(0,V.jsx)(`div`,{className:`agent-activity-thought-body`,children:e.streaming?(0,V.jsxs)(V.Fragment,{children:[e.thought,(0,V.jsx)(`span`,{className:`agent-activity-thought-cursor`,children:`▍`})]}):Lg(e.thought)??e.thought})]},n)}return e.kind===`activity`?u(e.activity,e.id||`act-${t}`):e.kind===`group`?d(e.group):null}):r.map((e,t)=>{if(e.count<=1){let n=e.items[0],r=`${t}-0-${n.label}-${n.target}`;return u(n,r)}return d(e)})})}var Wx,V,Gx=t((()=>{Wx=e(i()),Yb(),Py(),Qg(),gb(),V=a(),k()}));function Kx(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 qx({progress:e,isLive:t=!1}){let[n,r]=(0,Jx.useState)(null),i=(0,Jx.useMemo)(()=>Kx(e),[e]),a=(0,Jx.useMemo)(()=>n&&i.subagents.find(e=>e.name===n)||null,[i.subagents,n]);return i.subagents.length===0?(0,Yx.jsxs)(`div`,{style:{padding:`24px`,textAlign:`center`,color:`var(--text-muted, #9ca3af)`,fontSize:`0.85rem`},children:[(0,Yx.jsx)(`p`,{style:{margin:0,fontWeight:500},children:`No subagents dispatched in this turn`}),(0,Yx.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,Yx.jsx)(`code`,{children:`dispatch_subagent`}),`.`]})]}):(0,Yx.jsxs)(`div`,{className:`subagent-dag-container`,style:{display:`flex`,flexDirection:`column`,gap:`16px`,padding:`16px`},children:[(0,Yx.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,gap:`28px`,position:`relative`,padding:`12px`},children:[(0,Yx.jsxs)(`div`,{style:{display:`inline-flex`,alignItems:`center`,gap:`10px`,padding:`10px 18px`,borderRadius:`12px`,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,Yx.jsx)(`div`,{style:{width:`32px`,height:`32px`,borderRadius:`8px`,background:`var(--accent)`,color:`var(--text-on-accent)`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:`0.75rem`,fontWeight:700},children:`M`}),(0,Yx.jsxs)(`div`,{children:[(0,Yx.jsx)(`div`,{style:{fontWeight:600,fontSize:`0.88rem`,color:`var(--text-primary)`},children:`Main orchestrator`}),(0,Yx.jsxs)(`div`,{style:{fontSize:`0.72rem`,color:t?`var(--interactive-fg)`:`var(--text-muted)`,display:`flex`,alignItems:`center`,gap:`4px`},children:[(0,Yx.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,Yx.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,Yx.jsxs)(`div`,{onClick:()=>r(t?null:e.name),style:{display:`flex`,flexDirection:`column`,width:`260px`,padding:`12px`,borderRadius:`10px`,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,Yx.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:`8px`},children:[(0,Yx.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,Yx.jsx)(`span`,{style:{width:`8px`,height:`8px`,borderRadius:`50%`,background:i,display:`inline-block`}}),(0,Yx.jsx)(`span`,{style:{fontWeight:600,fontSize:`0.84rem`,color:`var(--text-primary)`},children:e.name})]}),(0,Yx.jsx)(`span`,{style:{fontSize:`0.68rem`,fontWeight:600,padding:`2px 6px`,borderRadius:`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,Yx.jsx)(`p`,{style:{margin:`0 0 8px 0`,fontSize:`0.74rem`,color:`var(--text-secondary)`,lineHeight:1.4},children:e.taskSnippet}),(0,Yx.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,Yx.jsxs)(`span`,{children:[e.tools.length,` tool `,e.tools.length===1?`call`:`calls`]}),(0,Yx.jsx)(`span`,{style:{color:t?i:`var(--text-muted)`},children:t?`Hide Details ▲`:`View Logs ▼`})]})]},e.name)})})]}),a&&(0,Yx.jsxs)(`div`,{style:{background:`var(--bg-surface-raised)`,border:`1px solid var(--border-default)`,borderRadius:`10px`,padding:`14px`,marginTop:`8px`},children:[(0,Yx.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:`12px`},children:[(0,Yx.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,Yx.jsxs)(`span`,{style:{fontWeight:600,fontSize:`0.86rem`,color:`var(--interactive-fg)`},children:[`Subagent Activity: `,a.name]}),(0,Yx.jsxs)(`span`,{style:{fontSize:`0.75rem`,color:`var(--text-muted)`},children:[`(`,a.tools.length,`)`]})]}),(0,Yx.jsx)(`button`,{type:`button`,onClick:()=>r(null),style:{background:`transparent`,border:`none`,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`0.8rem`},children:`Close`})]}),(0,Yx.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`8px`,maxHeight:`300px`,overflowY:`auto`},children:a.tools.map((e,t)=>(0,Yx.jsxs)(`div`,{style:{background:`var(--bg-surface-soft)`,border:`1px solid var(--border-subtle)`,borderRadius:`6px`,padding:`8px 10px`,fontSize:`0.76rem`},children:[(0,Yx.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:`4px`},children:[(0,Yx.jsx)(`span`,{style:{fontWeight:600,color:`var(--status-info, #38bdf8)`},children:e.action}),e.isError&&(0,Yx.jsx)(`span`,{style:{color:`var(--status-error, #f87171)`,fontWeight:600},children:`Failed`})]}),e.input&&(0,Yx.jsx)(`pre`,{style:{margin:`4px 0`,padding:`4px 6px`,background:`var(--bg-canvas)`,border:`1px solid var(--border-subtle)`,borderRadius:`4px`,color:`var(--text-secondary)`,fontSize:`0.72rem`,overflowX:`auto`},children:JSON.stringify(e.input,null,2)}),e.result&&(0,Yx.jsxs)(`div`,{style:{marginTop:`4px`,color:`var(--text-muted)`,fontSize:`0.72rem`,maxHeight:`100px`,overflowY:`auto`},children:[(0,Yx.jsx)(`strong`,{children:`Result:`}),` `,e.result.slice(0,200),e.result.length>200?`...`:``]})]},t))})]})]})}var Jx,Yx,Xx=t((()=>{Jx=e(i()),Yx=a()}));function Zx({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,Qx.jsxs)(`div`,{className:`plan-checklist-card ${t}`,children:[(0,Qx.jsxs)(`div`,{className:`plan-checklist-header`,children:[(0,Qx.jsxs)(`div`,{className:`plan-checklist-title`,children:[(0,Qx.jsx)(Ne,{style:{width:`15px`,height:`15px`,color:`var(--interactive-fg)`}}),(0,Qx.jsx)(`span`,{children:e.objective||`Task Plan`})]}),(0,Qx.jsxs)(`span`,{className:`plan-checklist-count`,children:[n,`/`,r,` (`,i,`%)`]})]}),(0,Qx.jsx)(`div`,{className:`plan-progress-track`,children:(0,Qx.jsx)(`div`,{className:`plan-progress-bar`,style:{width:`${i}%`}})}),(0,Qx.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,Qx.jsxs)(`div`,{className:`plan-task-item ${r?`in-progress`:n?`completed`:i?`failed`:``}`,children:[(0,Qx.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,flexShrink:0},children:[n&&(0,Qx.jsx)(le,{style:{width:`14px`,height:`14px`,color:`var(--status-speaking, #22c55e)`}}),r&&(0,Qx.jsx)(ve,{style:{width:`14px`,height:`14px`,color:`var(--status-listening, #7dd3fc)`,animation:`spin 1s linear infinite`}}),i&&(0,Qx.jsx)(_e,{style:{width:`14px`,height:`14px`,color:`var(--status-error, #ef4444)`}}),!n&&!r&&!i&&(0,Qx.jsx)(Ie,{style:{width:`14px`,height:`14px`,color:`var(--text-muted)`}})]}),(0,Qx.jsx)(`span`,{className:`plan-task-text`,children:e.title})]},e.id||t)})})]})}var Qx,$x=t((()=>{i(),k(),Qx=a()}));function eS(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 tS({summary:e,className:t=``}){let[n,r]=(0,nS.useState)(!1),i=(0,nS.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`,o=e.outcome===`PARTIAL`||e.outcome===`COMPLETED`,s=e.outcome===`ROLLED_BACK`,c=e.outcome===`UNVERIFIED`;e.outcome;let l=e.totalTokens>=1e3?`${(e.totalTokens/1e3).toFixed(1)}k`:e.totalTokens.toString(),u=eS(e.durationSecs),d=a||o?`run-summary-badge success`:s||c?`run-summary-badge rollback`:`run-summary-badge failure`,f=a?e.outcome===`VERIFIED`?`Verified`:`Success`:o?`Completed`:s?`Rolled Back`:c?`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)(O,{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)(te,{style:{width:`12px`,height:`12px`}}):(0,H.jsx)(oe,{style:{width:`12px`,height:`12px`}}),(0,H.jsx)(`span`,{children:n?`Exported!`:`Export Trajectory`})]}),(0,H.jsxs)(`span`,{className:d,children:[(a||o)&&(0,H.jsx)(le,{style:{width:`12px`,height:`12px`}}),(s||c)&&(0,H.jsx)(ne,{style:{width:`12px`,height:`12px`}}),!a&&!o&&!s&&!c&&(0,H.jsx)(_e,{style:{width:`12px`,height:`12px`}}),(0,H.jsx)(`span`,{children:f})]})]})]}),(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)(Ee,{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:[u.value,u.subtext&&(0,H.jsxs)(`span`,{className:`run-kpi-subtext`,children:[` · `,u.subtext]})]})]}),(0,H.jsxs)(`div`,{className:`run-kpi-box`,children:[(0,H.jsxs)(`div`,{className:`run-kpi-label`,children:[(0,H.jsx)(ye,{style:{width:`12px`,height:`12px`}}),(0,H.jsx)(`span`,{children:`Tokens`})]}),(0,H.jsx)(`div`,{className:`run-kpi-value`,children:l})]}),(0,H.jsxs)(`div`,{className:`run-kpi-box`,children:[(0,H.jsxs)(`div`,{className:`run-kpi-label`,children:[(0,H.jsx)(v,{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)(fe,{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 nS,H,rS=t((()=>{nS=e(i()),k(),H=a()})),iS,aS,oS,sS=t((()=>{iS=e(i()),k(),Yb(),Gx(),Xx(),$x(),rS(),aS=a(),oS=(0,iS.memo)(function({progress:e,activityView:t,rawProgress:n,id:r=``,isOpen:i,defaultOpen:a=!1,onToggle:o,historical:c,isHistorical:l,pendingApproval:u=!1,chatId:d,onOpenArtifact:f}){let p=e??n??[],m=c??l??!1,[h,g]=(0,iS.useState)(a),_=i===void 0?h:i,v=(0,iS.useCallback)(()=>{o?o(r):g(e=>!e)},[r,o]),[y,b]=(0,iS.useState)(`list`),x=(0,iS.useMemo)(()=>t??Vb(p),[t,p]),S=(0,iS.useMemo)(()=>Gb(p),[p]),C=(0,iS.useMemo)(()=>Kb(p),[p]),w=(0,iS.useMemo)(()=>qb(p),[p]);if(x.items.length===0&&(!x.timeline||x.timeline.length===0)&&!S&&!C)return null;let T=()=>(0,aS.jsxs)(aS.Fragment,{children:[C&&(0,aS.jsx)(`div`,{style:{marginBottom:`12px`},children:(0,aS.jsx)(tS,{summary:C})}),S&&(0,aS.jsx)(`div`,{style:{marginBottom:`12px`},children:(0,aS.jsx)(Zx,{plan:S})}),w&&(0,aS.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`flex-start`,gap:`8px`,marginBottom:`10px`,paddingBottom:`8px`,borderBottom:`1px solid var(--border)`},children:(0,aS.jsxs)(`div`,{style:{display:`inline-flex`,padding:`2px`,background:`var(--surface-strong)`,borderRadius:`6px`,border:`1px solid var(--border)`},children:[(0,aS.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),b(`list`)},style:{background:y===`list`?`var(--accent)`:`transparent`,color:y===`list`?`var(--text-on-accent)`:`var(--text-muted)`,border:`none`,borderRadius:`4px`,padding:`3px 8px`,fontSize:`0.74rem`,fontWeight:500,cursor:`pointer`},children:`Activity List`}),(0,aS.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),b(`dag`)},style:{background:y===`dag`?`var(--accent)`:`transparent`,color:y===`dag`?`var(--text-on-accent)`:`var(--text-muted)`,border:`none`,borderRadius:`4px`,padding:`3px 8px`,fontSize:`0.74rem`,fontWeight:500,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:`4px`},children:[(0,aS.jsx)(`span`,{children:`Subagent DAG`}),(0,aS.jsx)(`span`,{style:{width:`6px`,height:`6px`,borderRadius:`50%`,background:`var(--status-listening, #38bdf8)`,display:`inline-block`}})]})]})}),y===`dag`&&w?(0,aS.jsx)(qx,{progress:p,isLive:!m}):x.items.length>0||x.timeline&&x.timeline.length>0?(0,aS.jsx)(Ux,{activityView:x,chatId:d,onOpenArtifact:f}):null]}),E=S?.objective||x.summary||(C?`Run telemetry (${C.outcome})`:`Agent Activity`);return m?(0,aS.jsxs)(`div`,{className:`agent-activity-history`,children:[(0,aS.jsxs)(`button`,{type:`button`,className:`agent-activity-toggle`,"aria-expanded":_,onClick:v,children:[(0,aS.jsx)(`span`,{children:E}),(0,aS.jsx)(s,{size:13,className:`agent-activity-toggle-chevron${_?` is-open`:``}`,"aria-hidden":`true`})]}),_&&(0,aS.jsx)(`div`,{className:`agent-activity-card agent-activity-card-history`,children:T()})]}):(0,aS.jsx)(`div`,{className:`message ai-message agent-activity-message`,children:(0,aS.jsxs)(`div`,{className:`agent-activity-card`,children:[(0,aS.jsxs)(`div`,{className:`agent-activity-header`,style:{cursor:`pointer`},onClick:v,children:[(0,aS.jsx)(`span`,{children:E}),(0,aS.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,aS.jsx)(`span`,{className:`agent-activity-status`,"data-state":u?`approval`:C?`done`:`active`,children:u?`Waiting for approval`:C?`Completed`:`Working`}),(0,aS.jsx)(s,{size:13,className:`agent-activity-toggle-chevron${_?` is-open`:``}`,"aria-hidden":`true`})]})]}),_&&(0,aS.jsx)(`div`,{style:{marginTop:`8px`},children:T()})]})})})})),cS=t((()=>{}));function lS(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 uS,dS,fS,pS=t((()=>{uS=e(i()),Qg(),ke(),cS(),dS=a(),fS=uS.memo(function({sources:e}){let[t,n]=(0,uS.useState)(!1),[r,i]=(0,uS.useState)(null),a=(0,uS.useMemo)(()=>[...lS(e)].sort((e,t)=>{let n=+!!e.items[0]?.imageUrl;return+!!t.items[0]?.imageUrl-n}),[e]);if(!e||e.length===0)return null;let o=t?a:a.slice(0,3),s=a.slice(0,3).reduce((e,t)=>e+t.items.length,0),c=e.length-s,l=a.slice(3);return(0,dS.jsxs)(`div`,{className:`sources-block`,style:{display:`flex`,flexDirection:`column`,gap:`10px`,marginBottom:`12px`,marginTop:`4px`},children:[(0,dS.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,dS.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,dS.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,dS.jsx)(`span`,{style:{fontSize:`0.85rem`,fontWeight:600,color:`var(--text-primary)`,letterSpacing:`0.01em`},children:`Sources`})]}),(0,dS.jsxs)(`div`,{className:`sources-cards`,style:{display:`flex`,flexWrap:`wrap`,gap:`8px`},children:[o.map((e,t)=>{let n=e.items[0],a=e.items.length-1,o=r===e.domain;return(0,dS.jsxs)(`div`,{className:`source-card-group`,children:[(0,dS.jsxs)(`div`,{className:`source-card`,style:{justifyContent:`space-between`,borderRadius:`16px`,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;a>0&&r.closest(`.extra-badge-btn`)?(t.stopPropagation(),i(o?null:e.domain)):_.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,dS.jsx)(`div`,{className:`source-card-thumbnail`,style:{overflow:`hidden`,background:`var(--bg-surface-raised)`,flexShrink:0},children:(0,dS.jsx)(`img`,{src:Jg(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,dS.jsxs)(`div`,{className:`source-card-content`,style:{display:`flex`,flexDirection:`column`,flex:1,padding:`10px 12px`},children:[(0,dS.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,dS.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginTop:`auto`,paddingTop:`2px`},children:[(0,dS.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`6px`,overflow:`hidden`,marginRight:`6px`},children:[(0,dS.jsx)(`img`,{src:e.faviconUrl,alt:``,width:14,height:14,style:{borderRadius:`3px`,flexShrink:0},onError:e=>{e.currentTarget.style.display=`none`}}),(0,dS.jsx)(`span`,{style:{fontSize:`0.73rem`,color:`var(--text-muted)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.displayDomain})]}),a>0?(0,dS.jsxs)(`button`,{type:`button`,className:`extra-badge-btn`,title:`${a} extra page${a>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:`4px`,flexShrink:0,cursor:`pointer`,display:`flex`,alignItems:`center`,gap:`2px`},onClick:t=>{t.stopPropagation(),i(o?null:e.domain)},children:[`+`,a]}):(0,dS.jsxs)(`span`,{style:{fontSize:`0.7rem`,color:`var(--text-muted)`,fontWeight:500,flexShrink:0},children:[`•`,t+1]})]})]})]}),o&&a>0&&(0,dS.jsxs)(`div`,{className:`source-links-popover`,style:{position:`absolute`,top:`100%`,left:0,marginTop:`6px`,background:`var(--bg-overlay)`,border:`1px solid var(--border-default)`,borderRadius:`14px`,boxShadow:`var(--shadow-lg)`,zIndex:40,padding:`6px`,display:`flex`,flexDirection:`column`,gap:`4px`},children:[(0,dS.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`4px 6px`,borderBottom:`1px solid var(--border-subtle)`},children:[(0,dS.jsxs)(`span`,{style:{fontSize:`0.7rem`,fontWeight:600,color:`var(--text-muted)`},children:[`All links from `,e.domain,` (`,e.items.length,`)`]}),(0,dS.jsx)(`button`,{type:`button`,style:{background:`none`,border:`none`,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`0.8rem`,padding:`0 2px`},onClick:()=>i(null),children:`✕`})]}),e.items.map((e,t)=>(0,dS.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,style:{display:`flex`,flexDirection:`column`,gap:`2px`,padding:`6px 8px`,borderRadius:`6px`,color:`var(--text-primary)`,textDecoration:`none`,fontSize:`0.75rem`,background:`var(--bg-surface-soft)`,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:[(0,dS.jsxs)(`div`,{style:{fontWeight:500,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:[t+1,`. `,e.title]}),(0,dS.jsx)(`div`,{style:{fontSize:`0.68rem`,color:`var(--text-muted)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.url})]},t))]})]},e.domain)}),!t&&c>0&&(0,dS.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:`16px`,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,dS.jsx)(`div`,{style:{display:`flex`,alignItems:`center`},children:l.slice(0,3).map((e,t)=>(0,dS.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,dS.jsxs)(`span`,{style:{fontSize:`0.78rem`,fontWeight:500,color:`var(--text-secondary)`,marginLeft:`8px`},children:[`View `,c,` more`]})]})]}),t&&a.length>3&&(0,dS.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-start`,marginTop:`4px`},children:(0,dS.jsx)(`button`,{type:`button`,onClick:()=>{n(!1),i(null)},style:{background:`var(--bg-surface-soft)`,border:`1px solid var(--border-subtle)`,borderRadius:`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`})})]})})}));function mS(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 hS,U,gS,_S,vS=t((()=>{hS=e(i()),$y(),ke(),U=a(),{listGitCheckpoints:gS}=Ae,_S=(0,hS.memo)(function({progress:e,changes:t,interaction:n,isLive:r=!1,defaultOpen:i=!0,onOpenArtifact:a,onOpenReview:o,onRewindRequest:s,onRewindError:c}){let l=(0,hS.useMemo)(()=>t??Jy(e??Zy),[t,e]),[u]=(0,hS.useState)(i),[d,f]=(0,hS.useState)(!1),[p,m]=(0,hS.useState)({}),h=(0,hS.useMemo)(()=>mS(l.map(e=>e.path)),[l]);if(l.length===0)return null;let g=l.reduce((e,t)=>e+t.additions,0),_=l.reduce((e,t)=>e+t.deletions,0),v=l.filter(e=>e.created).length,y=l.length-v,b=``;b=v>0&&y===0?`${v} ${v===1?`file created`:`files created`}`:v>0&&y>0?`${v} created, ${y} modified`:`${l.length} ${l.length===1?`file changed`:`files changed`}`;let x=d?l:l.slice(0,3),S=async e=>{if(e.stopPropagation(),!n||!s)return;let t=n.chatId||`cli`;try{let e=await gS(t);if(!e||e.length===0){c?.(`No git checkpoints recorded for this session.`);return}let r=new Set(l.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]}s({interaction:n,changes:l,checkpoints:e,targetCheckpoint:a})}catch(e){c?.(`Failed to load checkpoints: ${e?.message||String(e)}`)}},C=()=>(0,U.jsxs)(`div`,{className:`file-changes-list`,style:{display:`flex`,flexDirection:`column`,gap:`6px`},children:[x.map(e=>{let t=!!p[e.path],n=e.path.replace(/\\/g,`/`),r=n;h&&(n===h||n.startsWith(h+`/`))&&(r=n.slice(h.length+1));let i=r.split(`/`).pop()||r,o=r.includes(`/`)?r.substring(0,r.lastIndexOf(`/`)):``,s=!h&&e.path.includes(`/`)?e.path.substring(0,e.path.lastIndexOf(`/`)):``;return(0,U.jsxs)(`div`,{className:`file-changes-item`,children:[(0,U.jsxs)(`div`,{className:`file-changes-item-header`,onClick:()=>m(t=>({...t,[e.path]:!t[e.path]})),children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`,minWidth:0},children:[(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:i}),o&&(0,U.jsxs)(`span`,{className:`file-changes-subdir`,children:[o,`/`]}),s&&(0,U.jsx)(`span`,{className:`file-changes-dirpath`,children:s}),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]})]}),a&&(0,U.jsx)(`button`,{type:`button`,className:`file-changes-preview-btn`,onClick:t=>{t.stopPropagation();let n=e.created&&e.hunks.length>0?e.hunks.map(e=>e.newText).filter(Boolean).join(`
|
|
55
|
+
`):void 0;a({path:e.path,content:n})},title:`Open Live Preview Split View`,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)=>(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`,children:t.oldText.split(`
|
|
56
|
+
`).map((e,t)=>(0,U.jsxs)(`div`,{style:{display:`flex`},children:[(0,U.jsx)(`span`,{className:`file-changes-diff-sign-del`,children:`-`}),(0,U.jsx)(`span`,{children:e})]},t))}),t.newText&&(0,U.jsx)(`div`,{className:`file-changes-diff-add`,children:t.newText.split(`
|
|
57
|
+
`).map((e,t)=>(0,U.jsxs)(`div`,{style:{display:`flex`},children:[(0,U.jsx)(`span`,{className:`file-changes-diff-sign-add`,children:`+`}),(0,U.jsx)(`span`,{children:e})]},t))})]},n))})]},e.path)}),l.length>3&&(0,U.jsxs)(`button`,{type:`button`,className:`file-changes-show-more`,"aria-expanded":d,onClick:()=>f(e=>!e),children:[(0,U.jsx)(`span`,{children:d?`Show fewer files`:`Show ${l.length-3} more ${l.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`})})]})]});return r?(0,U.jsx)(`div`,{className:`message ai-message agent-activity-message`,style:{marginTop:`4px`,marginBottom:`8px`},children:(0,U.jsxs)(`div`,{className:`agent-activity-card file-changes-card`,children:[(0,U.jsxs)(`div`,{className:`file-changes-summary-row`,children:[(0,U.jsxs)(`div`,{className:`file-changes-summary`,children:[(0,U.jsx)(`span`,{className:`file-changes-summary-icon`,"aria-hidden":`true`,children:`✓`}),(0,U.jsxs)(`span`,{className:`file-changes-summary-copy`,children:[(0,U.jsxs)(`div`,{className:`file-changes-summary-heading`,children:[(0,U.jsx)(`span`,{className:`file-changes-summary-label`,children:b}),(0,U.jsxs)(`span`,{className:`file-changes-summary-counts`,children:[g>0&&(0,U.jsxs)(`span`,{className:`file-changes-count-add`,children:[`+`,g]}),_>0&&(0,U.jsxs)(`span`,{className:`file-changes-count-del`,children:[`-`,_]})]})]}),h&&(0,U.jsxs)(`span`,{className:`file-changes-common-dir`,title:h,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:h})]})]})]}),o&&(0,U.jsx)(`button`,{type:`button`,className:`file-changes-review-btn`,title:`Review changed code`,onClick:o,children:`Review`})]}),u&&(0,U.jsx)(`div`,{className:`file-changes-list-container`,style:{marginTop:`8px`},children:C()})]})}):(0,U.jsx)(`div`,{className:`file-changes-summary-container`,children:(0,U.jsxs)(`div`,{className:`agent-activity-card file-changes-card`,children:[(0,U.jsxs)(`div`,{className:`file-changes-summary-row`,children:[(0,U.jsxs)(`div`,{className:`file-changes-summary`,children:[(0,U.jsx)(`span`,{className:`file-changes-summary-icon`,"aria-hidden":`true`,children:`⊞`}),(0,U.jsxs)(`span`,{className:`file-changes-summary-copy`,children:[(0,U.jsxs)(`div`,{className:`file-changes-summary-heading`,children:[(0,U.jsx)(`span`,{className:`file-changes-summary-label`,children:b}),(0,U.jsxs)(`span`,{className:`file-changes-summary-counts`,children:[g>0&&(0,U.jsxs)(`span`,{className:`file-changes-count-add`,children:[`+`,g]}),_>0&&(0,U.jsxs)(`span`,{className:`file-changes-count-del`,children:[`-`,_]})]})]}),h&&(0,U.jsxs)(`span`,{className:`file-changes-common-dir`,title:h,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:h})]})]})]}),(0,U.jsxs)(`div`,{className:`file-changes-summary-actions`,children:[s&&(0,U.jsxs)(`button`,{type:`button`,className:`file-changes-rewind-btn`,onClick:S,title:`Rewind workspace to before these file edits (Git Checkpoint)`,children:[(0,U.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,U.jsx)(`polyline`,{points:`1 4 7 4 7 10`}),(0,U.jsx)(`path`,{d:`M3 9a9 9 0 1 0 2.13-5.36L1 7`})]}),`Undo`]}),o&&(0,U.jsx)(`button`,{type:`button`,className:`file-changes-review-btn`,title:`Review changed code`,onClick:o,children:`Review`})]})]}),u&&(0,U.jsx)(`div`,{className:`file-changes-list-container`,children:C()})]})})})}));function yS(e,t){let n=typeof e==`string`&&e.match(t);if(n&&n[1])try{return JSON.parse(n[1])}catch{}return null}function bS(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;for(let t of e||[]){if(t.type!==`ToolEnd`)continue;let e=t.data?.action||t.data?.name||``,f=t.data?.result||t.data?.output||``;!n&&!s&&e===`weather`?s=yS(f,OS):!r&&!c&&e===`stock`?c=yS(f,kS):!i&&!l&&e===`calculation`?l=yS(f,AS):!a&&!u&&e===`image_search`?u=yS(f,jS):!o&&!d&&NS.has(e)&&(d=yS(f,MS))}return{weatherData:s,stockData:c,calcData:l,imageSearchData:u,imageGenData:d}}var xS,SS,CS,wS,TS,ES,DS,OS,kS,AS,jS,MS,NS,PS,FS=t((()=>{xS=e(i()),SS=a(),Te(),CS=(0,xS.lazy)(()=>De(()=>import(`./WeatherCard-CPucIfq8.js`),__vite__mapDeps([0,1,2,3,4]))),wS=(0,xS.lazy)(()=>De(()=>import(`./StockCard-BDMCe7mx.js`),__vite__mapDeps([5,1,2,3,4]))),TS=(0,xS.lazy)(()=>De(()=>import(`./CalculationCard-CRjP3E1j.js`),__vite__mapDeps([6,1,2,3,4]))),ES=(0,xS.lazy)(()=>De(()=>import(`./ImageSearchCard-N3yQOr8Z.js`),__vite__mapDeps([7,1,2,3,4]))),DS=(0,xS.lazy)(()=>De(()=>import(`./ImageGenCard-BCXxkVJX.js`),__vite__mapDeps([8,1,2,3,4]))),OS=/```weather_json\s*([\s\S]*?)\s*```/,kS=/```stock_json\s*([\s\S]*?)\s*```/,AS=/```calculation_json\s*([\s\S]*?)\s*```/,jS=/```image_search_json\s*([\s\S]*?)\s*```/,MS=/```image_gen_json\s*([\s\S]*?)\s*```/,NS=new Set([`generate_image`,`image_studio.generate`,`image_generate`]),PS=(0,xS.memo)(function({progress:e,aiText:t}){let{weatherData:n,stockData:r,calcData:i,imageSearchData:a,imageGenData:o}=(0,xS.useMemo)(()=>bS(e,t),[e,t]);return!n&&!r&&!i&&!a&&!o?null:(0,SS.jsxs)(xS.Suspense,{fallback:null,children:[n&&(0,SS.jsx)(CS,{data:n}),r&&(0,SS.jsx)(wS,{data:r}),i&&(0,SS.jsx)(TS,{data:i}),a&&(0,SS.jsx)(ES,{data:a}),o&&(0,SS.jsx)(DS,{data:o})]})})})),IS,LS=t((()=>{IS=`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`})),RS,zS=t((()=>{RS=`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`})),BS,VS=t((()=>{BS=`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`})),HS,US=t((()=>{HS=`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`})),WS,GS=t((()=>{WS=`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 KS(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 qS({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,JS.jsx)(`span`,{className:`provider-chip-logo ${a}`,style:{width:`${i}px`,height:`${i}px`},"aria-hidden":`true`,children:(0,JS.jsx)(`img`,{src:o,alt:``})}):(0,JS.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=KS(e,t),c=s?YS[s]:null;return c?c.color?(0,JS.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,JS.jsx)(`span`,{className:`provider-chip-logo ${a}`,style:{width:`${i}px`,height:`${i}px`},"aria-hidden":`true`,children:(0,JS.jsx)(`img`,{src:c.src,alt:``})}):(0,JS.jsx)(`span`,{className:`provider-chip-dot ${a}`,"aria-hidden":`true`})}var JS,YS,XS=t((()=>{i(),Ue(),Ht(),Wt(),LS(),st(),wt(),zS(),mt(),Rt(),ut(),VS(),US(),GS(),JS=a(),YS={anthropic:{src:tt,color:`#d97757`},claude:{src:tt,color:`#d97757`},deepseek:{src:lt},gemini:{src:Bt},google:{src:Bt},groq:{src:IS,color:`#f97316`},huggingface:{src:gt},hf:{src:gt},local_openai:{src:vt,color:`#8b5cf6`},lmstudio:{src:vt,color:`#8b5cf6`},mistral:{src:RS},ollama:{src:At,color:`#e2e8f0`},openai:{src:ft,color:`#10a37f`},gpt:{src:ft,color:`#10a37f`},openrouter:{src:St},perplexity:{src:BS},qwen:{src:HS},together:{src:WS}}})),ZS,QS,$S,eC=t((()=>{ZS=e(i()),Qg(),nt(),sb(),gb(),pt(),Yb(),$y(),sS(),pS(),vS(),FS(),XS(),QS=a(),$S=ZS.memo(function(e){let{interaction:t,copiedId:n,onEditMessage:r,speakingText:i,agentActivitySnapshots:a,openActivityIds:o,handleCopyMessage:s,speak:c,toggleActivity:l,onOpenArtifact:u,onOpenReview:d,onRewindRequest:f,onRewindError:p}=e,m=t.provider===`system`&&t.model===`provider_change`,h=(0,ZS.useMemo)(()=>t.userText?(0,QS.jsx)(Zg,{text:t.userText}):null,[t.userText]),g=a[String(t.id)]??t.agentActivity??Zy,_=(0,ZS.useMemo)(()=>Ub(g),[g]),v=(0,ZS.useMemo)(()=>t.aiText?(0,QS.jsx)(Zg,{text:t.aiText,sources:_}):null,[t.aiText,_]);if(m){let e=(t.userText||``).replace(/^Changed model to\s*/i,``).trim();return(0,QS.jsxs)(`div`,{className:`system-event-divider`,children:[(0,QS.jsx)(`div`,{className:`system-event-line`}),(0,QS.jsxs)(`div`,{className:`system-event-pill`,children:[(0,QS.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,children:(0,QS.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,QS.jsx)(`span`,{children:e})]}),(0,QS.jsx)(`div`,{className:`system-event-line`})]},t.id)}let y=n===`user-${t.id}`,b=n===t.id,x=i===t.aiText;return(0,QS.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`8px`,marginBottom:`16px`},children:[t.userText&&(0,QS.jsx)(`div`,{className:`message user-message`,children:(0,QS.jsxs)(`div`,{className:`bubble-wrapper`,children:[(0,QS.jsx)(`div`,{className:`message-bubble`,children:h}),(0,QS.jsxs)(`div`,{className:`message-time`,style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,QS.jsx)(`span`,{children:ht(t.createdAt).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}),(0,QS.jsx)(`button`,{type:`button`,className:`msg-action-btn copy-btn ${y?`is-copied`:``}`,onClick:()=>s(`user-${t.id}`,t.userText),title:y?`คัดลอกแล้ว (Copied!)`:`คัดลอกข้อความ (Copy)`,children:bg(y)}),r&&t.provider!==`system`&&(0,QS.jsx)(`button`,{type:`button`,className:`msg-action-btn edit-btn`,onClick:()=>r(t.userText),title:`แก้ไขและส่งใหม่ (Edit & resend)`,children:(0,QS.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,QS.jsx)(`path`,{d:`M12 20h9`}),(0,QS.jsx)(`path`,{d:`M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z`})]})})]})]})}),(0,QS.jsx)(`div`,{className:`message ai-message`,children:(0,QS.jsxs)(`div`,{className:`bubble-wrapper`,children:[t.status!==`queued`&&t.status!==`running`&&(0,QS.jsx)(oS,{progress:g,id:String(t.id),historical:!0,isOpen:!!o?.[String(t.id)],onToggle:l,chatId:e.chatId||t.chatId,onOpenArtifact:u}),t.status!==`queued`&&t.status!==`running`&&(0,QS.jsx)(_S,{progress:g,interaction:t,onOpenArtifact:u,onOpenReview:d,onRewindRequest:f,onRewindError:p}),(0,QS.jsxs)(`div`,{className:`message-bubble`,children:[t.status===`queued`&&(0,QS.jsx)(`span`,{children:`Queued for this session…`}),t.status===`running`&&(0,QS.jsx)(`span`,{children:`Mint is responding…`}),t.status===`failed`&&(0,QS.jsx)(`span`,{children:`This turn failed. Send the prompt again to retry.`}),t.status===`interrupted`&&(0,QS.jsx)(`span`,{children:`This turn was interrupted. Send the prompt again to retry.`}),(0,QS.jsx)(ob,{progress:g,running:t.status===`running`,interrupted:t.status===`interrupted`,chatId:e.chatId||t.chatId}),(0,QS.jsx)(hb,{progress:g,chatId:e.chatId||t.chatId,onOpenArtifact:u}),(0,QS.jsx)(PS,{progress:g,aiText:t.aiText}),v]}),_.length>0&&(0,QS.jsx)(fS,{sources:_}),(0,QS.jsxs)(`div`,{className:`message-time`,style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[t.status===`completed`&&(0,QS.jsxs)(`span`,{className:`provider-model-chip`,"data-provider":(t.provider||``).toLowerCase(),title:`${t.provider} • ${t.model}`,children:[(0,QS.jsx)(qS,{provider:t.provider,model:t.model,customProviders:e.customProviders,size:13}),(0,QS.jsx)(`span`,{className:`provider-chip-name`,children:t.provider}),(0,QS.jsx)(`span`,{className:`provider-chip-divider`,children:`/`}),(0,QS.jsx)(`span`,{className:`provider-chip-model`,children:t.model})]}),Vt(t)&&(0,QS.jsx)(`span`,{className:`provider-fallback-notice`,children:Vt(t)}),(0,QS.jsx)(`span`,{className:`message-timestamp`,children:ht(t.createdAt).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}),t.status===`completed`&&(0,QS.jsxs)(`div`,{className:`message-action-buttons`,style:{display:`flex`,alignItems:`center`,gap:`4px`,marginLeft:`auto`},children:[(0,QS.jsx)(`button`,{type:`button`,className:`msg-action-btn copy-btn ${b?`is-copied`:``}`,onClick:()=>s(t.id,t.aiText),title:b?`คัดลอกแล้ว (Copied!)`:`คัดลอกข้อความ (Copy message)`,children:bg(b)}),(0,QS.jsx)(`button`,{type:`button`,className:`msg-action-btn tts-btn ${x?`is-speaking`:``}`,onClick:()=>c(t.aiText),title:x?`Stop reading`:`Read aloud`,children:yg(x)})]})]})]})})]},t.id)},(e,t)=>{if(e.onEditMessage!==t.onEditMessage||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 tC({progress:e,onOpenDetails:t}){let{subagents:n}=(0,nC.useMemo)(()=>Kx(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,rC.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,rC.jsxs)(`div`,{className:`subagent-status-strip-header`,children:[(0,rC.jsxs)(`div`,{className:`subagent-status-strip-header-left`,children:[o?(0,rC.jsx)(`span`,{className:`subagent-status-spinner`,"aria-hidden":`true`}):a>0?(0,rC.jsx)(`span`,{className:`subagent-status-icon-alert`,"aria-hidden":`true`,children:`⚠`}):(0,rC.jsx)(`span`,{className:`subagent-status-icon-check`,"aria-hidden":`true`,children:`✓`}),(0,rC.jsx)(`span`,{className:`subagent-status-strip-title`,children:s})]}),t&&(0,rC.jsx)(`span`,{className:`subagent-status-strip-hint`,children:`Details ›`})]}),(0,rC.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,rC.jsxs)(`div`,{className:`subagent-status-strip-row ${e.status}`,"data-testid":`subagent-status-row-${e.name}`,children:[(0,rC.jsxs)(`div`,{className:`subagent-status-strip-row-main`,children:[t?(0,rC.jsx)(`span`,{className:`subagent-status-row-spinner`,"aria-hidden":`true`}):n?(0,rC.jsx)(`span`,{className:`subagent-status-row-check`,"aria-hidden":`true`,children:`✓`}):(0,rC.jsx)(`span`,{className:`subagent-status-row-cross`,"aria-hidden":`true`,children:`✗`}),(0,rC.jsxs)(`span`,{className:`subagent-status-strip-tag`,children:[`[`,e.name,`]`]}),(0,rC.jsx)(`span`,{className:`subagent-status-strip-desc`,children:i})]}),(0,rC.jsx)(`span`,{className:`subagent-status-strip-timing`,children:a})]},e.name)})})]})}var nC,rC,iC=t((()=>{nC=e(i()),Xx(),rC=a()}));function aC(e){return typeof e==`object`?e.key:e}function oC(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 sC=t((()=>{}));function cC(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 lC(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var uC,dC,fC=t((()=>{uC=(e,t)=>Math.abs(e-t)<1.01,dC=(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 pC(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 mC(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 hC(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=mC(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=AC(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 gC,_C,vC,yC,bC,xC,SC,CC,wC,TC,EC,DC,OC,kC,AC,jC=t((()=>{sC(),fC(),_C=()=>{if(gC!==void 0)return gC;if(typeof navigator>`u`)return gC=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return gC=!0;let e=navigator.maxTouchPoints;return gC=navigator.platform===`MacIntel`&&e!==void 0&&e>0},vC=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},yC=e=>e,bC=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},xC=(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(vC(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(vC(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},SC={passive:!0},CC=typeof window>`u`||`onscrollend`in window,wC=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&CC,o=0,s=a?null:dC(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,SC),a&&r.addEventListener(`scrollend`,u,SC),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u),s?.cancel()}},TC=(e,t)=>wC(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),EC=(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`]},DC=(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})},OC=DC,kC=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:yC,rangeExtractor:bC,onChange:()=>{},measureElement:EC,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=>aC(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||pC(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=cC(()=>(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&&!uC(e,this.scrollState.lastTargetOffset)&&!uC(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,_C()&&this.targetWindow!=null&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,SC),e.addEventListener(`touchend`,n,SC),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&&(_C()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this.scrollState?.behavior===`smooth`&&!uC(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=cC(()=>[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=cC(()=>[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=oC(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=cC(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=hC(e,t,n,r,r===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=cC(()=>{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=cC(()=>[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 lC(t[AC(0,t.length-1,r?e=>n[e*2]:e=>lC(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:uC(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:uC(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(_C()&&(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&&uC(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()}},AC=(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 MC({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=PC.useReducer(e=>e+1,0)[1],a=PC.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=PC.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,FC.flushSync)(i):i()),(s=r.onChange)==null||s.call(r,t,n)}},[d]=PC.useState(()=>{let e=new kC(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),IC(()=>d._didMount(),[]),IC(()=>(s(d),d._willUpdate())),IC(()=>{l(d)}),d}function NC(e){return MC({observeElementRect:xC,observeElementOffset:TC,scrollToFn:OC,...e})}var PC,FC,IC,LC=t((()=>{PC=e(i(),1),FC=E(),jC(),jC(),IC=typeof document<`u`?PC.useLayoutEffect:PC.useEffect})),RC,zC,BC,VC=t((()=>{RC=e(i()),LC(),zC=a(),BC=(0,RC.memo)((0,RC.forwardRef)(function({items:e,scrollRef:t,renderRow:n,tail:r,hasOlder:i},a){let o=(0,RC.useRef)(null),[s,c]=(0,RC.useState)(0),l=(0,RC.useRef)(null),[u,d]=(0,RC.useState)(null);(0,RC.useEffect)(()=>{d(t.current)},[t]);let f=(0,RC.useCallback)(t=>t<e.length?`turn:${e[t].id}`:`live-turn`,[e]),p=!!r,m=(0,RC.useCallback)(t=>{let n=bC(t);return p&&!n.includes(e.length)&&n.push(e.length),n},[e.length,p]),h=NC({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,RC.useImperativeHandle)(a,()=>({scrollToEnd:()=>h.scrollToEnd()}),[h]),(0,RC.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,RC.useLayoutEffect)(()=>{u&&h.scrollToEnd()},[h,u]),(0,zC.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,zC.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 HC({chatId:e,language:t,message:n,sending:r,isSpeaking:i,onSendVoiceMessage:a,onSetMessage:o}){let[s,c]=(0,UC.useState)(!1),[l,u]=(0,UC.useState)(!1),[d,f]=(0,UC.useState)(``),[p,m]=(0,UC.useState)(!1),h=(0,UC.useRef)(null),g=(0,UC.useRef)(null),_=(0,UC.useRef)(null),v=(0,UC.useRef)(null),y=(0,UC.useRef)(!1),b=(0,UC.useRef)(!1),x=(0,UC.useRef)(!1),S=(0,UC.useRef)(!1),C=(0,UC.useRef)(n),w=(0,UC.useRef)(e),T=(0,UC.useRef)(e);w.current=e,(0,UC.useEffect)(()=>{y.current=l,l||(E(),f(``))},[l]),(0,UC.useEffect)(()=>{b.current=r},[r]),(0,UC.useEffect)(()=>{x.current=p},[p]),(0,UC.useEffect)(()=>{S.current=i},[i]),(0,UC.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,UC.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,UC.useEffect)(()=>{!l||r||p||i||s||h.current||A()},[l,r,p,i,s]),(0,UC.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 UC,WC=t((()=>{UC=e(i())})),GC=t((()=>{WC()})),KC=t((()=>{}));function qC({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,JC.useState)(!!w),[k,A]=(0,JC.useState)(!1),[ee,te]=(0,JC.useState)(!1),[j,M]=(0,JC.useState)(`pointer`),ne=(0,JC.useRef)(null),N=(0,JC.useRef)(null),re=(0,JC.useRef)(null),ie=(0,JC.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,JC.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=ie.current,n=ae.current,r=Math.min((e-t.last)/1e3,ew);t.last=e;let i=0;t.listening&&(t.audio?.analyser?i=iw(t.audio.analyser,t.audio.buf):n.reactive!==`mic`&&(i=rw((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&&ne.current){let n=ow(e-t.startedAt);ne.current.textContent!==n&&(ne.current.textContent=n)}t.listening&&n.waveform&&re.current&&aw(t,re.current,t.env,n.accentColor,n.floor),t.raf=t.listening?requestAnimationFrame(oe):0},se=e=>{let t=ie.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,ne.current&&(ne.current.textContent=`0:00`),O(n.active===void 0),A(n.active!==void 0),M(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&&P(`start-failed`,!1))}).catch(()=>{t.generation===r&&P(`start-failed`,!1)})}catch{P(`start-failed`,!1)}n.reactive===`mic`&&sw(t,r).catch(()=>{t.generation===r&&P(`mic-denied`)})},P=(e,t=!0)=>{let n=ie.current,r=ae.current;n.listening&&(n.listening=!1,n.generation++,cw(n),cancelAnimationFrame(n.raf),n.raf=0,O(!1),A(!1),M(e===`key`||e===`escape`?`key`:`pointer`),t&&r.onStop?.({reason:e,duration:Math.round(performance.now()-n.startedAt)}))},ce=()=>{ie.current.sliding=!1;let e=N.current;e&&(delete e.dataset.sliding,e.style.setProperty(`--vp-slide`,`0px`),e.style.setProperty(`--vp-cancel`,`0`))},le=e=>{let t=ie.current,n=ae.current,r=N.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&&(ce(),P(`cancel`))},ue=e=>{let t=ie.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`)}},de=e=>{let t=ie.current;if(e.pointerId!==t.pointerId)return!1;t.pointerId=null,te(!1),t.sliding&&ce();try{e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)}catch{}return!0},fe=e=>{let t=ie.current,n=ae.current;if(!de(e)||!t.listening)return;let r=performance.now()-t.downAt,i=n.mode===`hold`||n.mode===`auto`&&r>=n.holdAfter;t.ownPress?i&&P(`release`):P(r<n.holdAfter?`tap`:`release`)},pe=e=>{de(e)&&P(`cancel`)},me=e=>{e.key===`Escape`&&ie.current.listening?(e.preventDefault(),e.stopPropagation(),ce(),P(`escape`)):e.key!==` `&&e.key!==`Enter`||e.repeat||(e.preventDefault(),ie.current.listening?P(`key`):se(`key`))},he=e=>{e.detail===0&&ie.current.pointerId===null&&!e.nativeEvent.pointerType&&(ie.current.listening?P(`key`):se(`key`))};(0,JC.useEffect)(()=>{if(w===void 0)return;let e=ie.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&&P(`external`,!1)},[w]),(0,JC.useEffect)(()=>{if(!D&&!k)return;let e=()=>{ce(),ie.current.pointerId=null,te(!1),P(`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,JC.useEffect)(()=>{y&&(ce(),ie.current.pointerId=null,te(!1),P(`disabled`))},[y]),(0,JC.useEffect)(()=>{let e=ie.current;return()=>{e.listening&&(e.listening=!1,e.generation++,ae.current.onStop?.({reason:`unmount`,duration:Math.round(performance.now()-e.startedAt)})),cw(e),cancelAnimationFrame(e.raf),e.raf=0,e.audio?.ctx.close()}},[]);let ge=i===`rounded`?Math.round(r*.29):r/2,_e=Math.max(0,Math.min(10,(44-r)/2)),ve=Math.max(10,Math.round(r*.36)),ye=o?Math.round(ve*2.5)+4:0,be=s?Math.round(r*1.9):0,xe=ye+be;return(0,YC.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:N,onPointerDown:ue,onPointerMove:le,onPointerUp:fe,onPointerCancel:pe,onLostPointerCapture:pe,onKeyDown:me,onClick:he,onContextMenu:e=>e.preventDefault(),style:{"--vp-accent":e,"--vp-icon":t,"--vp-bg":n,"--vp-size":`${r}px`,"--vp-radius":`${ge}px`,"--vp-reach":`${a}px`,"--vp-extra":`${xe}px`,"--vp-clock-w":`${ye}px`,"--vp-wave-w":`${be}px`,"--vp-stop":`${Math.round(r*.32)}px`,"--vp-icon-size":`${Math.round(r*.54)}px`,"--vp-time-size":`${ve}px`,"--vp-open":`${m}ms`,"--vp-press":h,"--vp-hit":`${_e}px`},children:[(0,YC.jsx)(`span`,{className:`voice-pill__capsule`,"aria-hidden":`true`}),s?(0,YC.jsx)(`canvas`,{ref:re,className:`voice-pill__wave`,"aria-hidden":`true`}):null,c?(0,YC.jsxs)(`span`,{className:`voice-pill__cancel`,"aria-hidden":`true`,children:[(0,YC.jsx)(Ge,{icon:Ut,size:12,strokeWidth:2.2}),(0,YC.jsx)(`span`,{children:`Cancel`})]}):null,o?(0,YC.jsx)(`span`,{ref:ne,className:`voice-pill__time`,"aria-hidden":`true`,children:`0:00`}):null,(0,YC.jsxs)(`span`,{className:`voice-pill__glyph`,"aria-hidden":`true`,children:[(0,YC.jsx)(`span`,{className:`voice-pill__mic`,children:(0,YC.jsx)(Ge,{icon:Gt,size:Math.round(r*.54),strokeWidth:2})}),(0,YC.jsx)(`span`,{className:`voice-pill__stop`})]})]})}var JC,YC,XC,ZC,QC,$C,ew,tw,nw,rw,iw,aw,ow,sw,cw,lw=t((()=>{JC=e(i()),rt(),_t(),KC(),YC=a(),XC=4.8,ZC=[[.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]],QC=[[1,4],[4,11],[11,33]],$C=2.2,ew=.05,tw=4,nw=80,rw=e=>{let t=e%XC,n=.06;for(let[e,r,i]of ZC){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)))},iw=(e,t)=>{e.getByteFrequencyData(t);let n=0;for(let[e,r]of QC){let i=0;for(let n=e;n<r;n++)i+=t[n];n+=i/((r-e)*255)}return n/QC.length*$C},aw=(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)%tw,e.tick===0&&(e.hist.push(e.acc),e.acc=0,e.hist.length>nw&&e.hist.shift());let u=2*a,d=3*a,f=e.tick/tw*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},ow=e=>{let t=Math.floor(e/1e3);return`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`},sw=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))},cw=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 uw({workspacePath:e,chatId:t,startSession:n,sendAudioChunk:r,stopSession:i}){let[a,o]=(0,dw.useState)(!1),[s,c]=(0,dw.useState)(!1),[l,u]=(0,dw.useState)(``),[d,f]=(0,dw.useState)(``),[p,m]=(0,dw.useState)(!1),[h,g]=(0,dw.useState)(!1),[_,v]=(0,dw.useState)(!1),[y,b]=(0,dw.useState)(``),x=(0,dw.useRef)(!1),S=(0,dw.useRef)(!1),C=(0,dw.useRef)(!1),w=(0,dw.useRef)(null),T=(0,dw.useRef)(null),E=(0,dw.useRef)(null),D=(0,dw.useRef)(0),O=(0,dw.useRef)(new Set),k=(0,dw.useRef)(()=>{}),A=(0,dw.useRef)(null),ee=(0,dw.useRef)(null),te=(0,dw.useRef)(0),j=(0,dw.useRef)(null),M=(0,dw.useRef)(null);(0,dw.useEffect)(()=>{x.current=s},[s]),(0,dw.useEffect)(()=>{S.current=p},[p]);let ne=(0,dw.useCallback)(()=>(T.current&&T.current.state!==`closed`||(T.current=new AudioContext,E.current=T.current.createAnalyser(),E.current.fftSize=512,E.current.smoothingTimeConstant=.3,E.current.minDecibels=-90,E.current.maxDecibels=-10),T.current),[]),N=(0,dw.useCallback)(e=>{let t=ne(),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,pw),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),E.current&&s.connect(E.current),O.current.add(s),s.onended=()=>{O.current.delete(s),s.disconnect()};let c=Math.max(t.currentTime,te.current);s.start(c),te.current=c+a.duration,v(!0),j.current!==null&&window.clearTimeout(j.current);let l=Math.max(0,(c+a.duration-t.currentTime)*1e3)+500;j.current=window.setTimeout(()=>v(!1),l)},[ne]),re=(0,dw.useCallback)(e=>{switch(e.type){case`audioChunk`:m(!1),N(e.data);break;case`transcript`:(e.role===`user`?u:f)(t=>M.current===e.role?t+e.text:e.text),M.current=e.role;break;case`turnComplete`:M.current=null;break;case`toolStatus`:M.current=null,f(e.error?`${e.action} failed: ${e.error}`:`Running ${e.action}...`);break;case`error`:console.error(`Gemini Live session error`,e.message),M.current=null,f(e.message),b(e.message);break;case`closed`:k.current(),o(!1),m(!1),v(!1),w.current=null,M.current=null,b(`Live connection closed`)}},[N]),ie=(0,dw.useCallback)(()=>{ee.current?.processor.disconnect(),ee.current?.source.disconnect(),ee.current=null,A.current?.getTracks().forEach(e=>e.stop()),A.current=null},[]),ae=(0,dw.useCallback)(()=>{++D.current,ie();for(let e of O.current)try{e.stop(),e.disconnect()}catch{}O.current.clear(),E.current?.disconnect(),E.current=null;let e=T.current;T.current=null,e&&e.state!==`closed`&&e.close().catch(e=>console.error(`Failed to close Live audio`,e));let t=w.current;w.current=null,o(!1),m(!1),g(!1),C.current=!1,v(!1),j.current!==null&&(window.clearTimeout(j.current),j.current=null),te.current=0,t&&i(t).catch(e=>console.error(`Failed to stop Gemini Live session`,e))},[ie,i]);k.current=ae;let oe=(0,dw.useCallback)(()=>{g(e=>{let t=!e;return C.current=t,t})},[]),se=(0,dw.useCallback)(async()=>{let a=++D.current;try{if(b(``),M.current=null,u(``),f(``),!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 s=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});if(a!==D.current){s.getTracks().forEach(e=>e.stop());return}console.log(`[gemini-live] microphone granted, starting session...`),A.current=s;let c=await n(e=>{a===D.current&&re(e)},e,t);if(a!==D.current){await i(c);return}console.log(`[gemini-live] session started`,c),w.current=c;let l=ne(),d=l.createMediaStreamSource(s);if(l.state===`suspended`&&await l.resume(),a!==D.current){d.disconnect();return}let p=l.createScriptProcessor(mw,1,1),h=l.sampleRate/fw;p.onaudioprocess=e=>{if(!w.current||C.current)return;let t=e.inputBuffer.getChannelData(0),n=Math.floor(t.length/h),i=new Int16Array(n);for(let e=0;e<n;e+=1){let n=t[Math.floor(e*h)];i[e]=Math.max(-32768,Math.min(32767,Math.round(n*32768)))}let a=``,o=new Uint8Array(i.buffer);for(let e=0;e<o.length;e+=1)a+=String.fromCharCode(o[e]);r(w.current,btoa(a)).catch(e=>console.error(`Failed to send Gemini Live audio chunk`,e))},d.connect(p),E.current&&d.connect(E.current),p.connect(l.destination),ee.current={source:d,processor:p},o(!0),m(!0)}catch(e){if(a!==D.current)return;console.error(`Failed to start Gemini Live voice session`,e),f(`Error: ${e instanceof Error?e.message:String(e)}`),b(e instanceof Error?e.message:String(e)),ae()}},[re,e,t,ne,ae,n,i,r]);(0,dw.useEffect)(()=>{s?se():ae()},[s]),(0,dw.useEffect)(()=>ae,[ae]);let P=(0,dw.useCallback)(()=>{x.current&&(ae(),se())},[ae,se]),ce=(0,dw.useCallback)(()=>{},[]);return{isRecording:a,voiceMode:s,setVoiceMode:c,userTranscript:l,assistantTranscript:d,voiceAwaitingResponse:p,voiceAwaitingResponseRef:S,voiceModeRef:x,isPaused:h,togglePause:oe,isSpeaking:_,analyserRef:E,errorMessage:y,restart:P,startRecognition:ce,stopRecognition:ce,scheduleVoiceListen:ce,clearRestartTimer:ce}}var dw,fw,pw,mw,hw=t((()=>{dw=e(i()),fw=16e3,pw=24e3,mw=2048})),gw=t((()=>{}));function _w({status:e,userTranscript:t,assistantTranscript:n,isPaused:r,onTogglePause:i,onEndCall:a,voice:o,voices:s,onChangeVoice:c,analyserRef:l}){let[u,f]=(0,vw.useState)(!1),p=(0,vw.useRef)(null),m=(0,vw.useRef)(a);m.current=a;let h=(0,vw.useRef)(null);(0,vw.useEffect)(()=>{let e=document.activeElement,t=document.body.style.overflow;document.body.style.overflow=`hidden`;let n=p.current;n.querySelector(`[data-call-control]:not(:disabled), [aria-label="End Live conversation"]`)?.focus();let r=e=>{if(e.key===`Escape`){e.preventDefault(),m.current();return}if(e.key!==`Tab`)return;let t=Array.from(n.querySelectorAll(`button: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 g=(0,bw.jsx)(`div`,{ref:p,className:`gemini-live-overlay live-orb-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":`Gemini Live conversation`,"data-status":e,children:(0,bw.jsxs)(`div`,{className:`gemini-live-card`,children:[(0,bw.jsxs)(`header`,{className:`live-orb-header`,children:[(0,bw.jsx)(`span`,{className:`gemini-live-badge`,children:`Gemini Live`}),(0,bw.jsx)(`h2`,{children:`Live conversation`})]}),(0,bw.jsx)(`div`,{className:`live-orb-stage`,children:(0,bw.jsx)(he,{hue:0,animate:e!==`paused`&&e!==`error`,enableVoiceControl:e===`listening`||e===`speaking`||e===`thinking`,analyserRef:l??h})}),(0,bw.jsxs)(`div`,{className:`live-orb-state`,children:[(0,bw.jsx)(`div`,{className:`gemini-live-status`,role:`status`,children:xw[e]}),(0,bw.jsx)(`p`,{children:Sw[e]})]}),(0,bw.jsx)(`div`,{className:`gemini-live-transcript`,"aria-label":`Conversation transcript`,tabIndex:0,children:t||n?(0,bw.jsxs)(bw.Fragment,{children:[t&&(0,bw.jsxs)(`p`,{className:`gemini-live-transcript-line`,children:[(0,bw.jsx)(`span`,{className:`gemini-live-transcript-speaker`,children:`You`}),t]}),n&&(0,bw.jsxs)(`p`,{className:`gemini-live-transcript-line`,children:[(0,bw.jsx)(`span`,{className:`gemini-live-transcript-speaker`,children:`Mint`}),n]})]}):(0,bw.jsx)(`p`,{className:`live-orb-empty`,children:e===`connecting`?`Your conversation will appear here.`:e===`error`?`No conversation yet.`:`Say something to get started…`})}),(0,bw.jsxs)(`div`,{className:`gemini-live-voice-picker`,children:[(0,bw.jsxs)(ce,{type:`button`,variant:`ghost`,className:`gemini-live-voice-btn`,"aria-label":`Change voice`,"aria-expanded":u,"aria-haspopup":`listbox`,onClick:()=>f(e=>!e),children:[(0,bw.jsx)(D,{size:16,"aria-hidden":`true`}),(0,bw.jsx)(`span`,{children:o})]}),u&&(0,bw.jsx)(`div`,{className:`gemini-live-voice-menu`,role:`listbox`,"aria-label":`Live voice`,children:s.map(e=>(0,bw.jsx)(`button`,{type:`button`,role:`option`,"aria-selected":e===o,"data-voice":e,className:`gemini-live-voice-option ${e===o?`active`:``}`,onClick:()=>{f(!1),e!==o&&c(e)},children:e},e))})]}),(0,bw.jsxs)(`div`,{className:`gemini-live-controls`,children:[(0,bw.jsxs)(ce,{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,bw.jsx)(se,{size:18,"aria-hidden":`true`}):(0,bw.jsx)(be,{size:18,"aria-hidden":`true`}),(0,bw.jsx)(`span`,{children:r?`Resume`:`Pause mic`})]}),(0,bw.jsxs)(ce,{type:`button`,variant:`destructive`,size:`lg`,className:`gemini-live-btn gemini-live-end`,onClick:a,"aria-label":`End Live conversation`,children:[(0,bw.jsx)(d,{size:18,"aria-hidden":`true`}),(0,bw.jsx)(`span`,{children:`End call`})]})]})]})});return typeof document>`u`?g:(0,yw.createPortal)(g,document.body)}var vw,yw,bw,xw,Sw,Cw=t((()=>{vw=e(i()),yw=E(),k(),Fe(),f(),gw(),bw=a(),xw={connecting:`Connecting`,listening:`Listening`,speaking:`Speaking`,thinking:`Thinking`,paused:`Microphone paused`,error:`Connection unavailable`},Sw={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 ww(e){let t=/\.([a-zA-Z0-9]+)$/.exec(e.trim())?.[1]?.toLowerCase();return!!t&&Tw.includes(t)}var Tw,Ew,Dw=t((()=>{Tw=[`txt`,`md`,`pdf`,`docx`,`xlsx`,`json`,`toml`,`yaml`,`yml`,`rs`,`ts`,`tsx`,`js`,`jsx`,`py`,`html`,`css`],Ew=Tw.map(e=>`.${e}`).join(`,`)}));function Ow(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 kw({provider:e}){let t=e.toLowerCase(),n=Fw[t];return n?n.color?(0,W.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,W.jsx)(`img`,{className:`provider-brand-logo`,src:n.src,alt:``,"aria-hidden":`true`}):(0,W.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,W.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 Aw({type:e,label:t}){return(0,W.jsxs)(`span`,{className:`model-tag-badge badge-${e}`,children:[e===`free`&&(0,W.jsxs)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.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,W.jsx)(`line`,{x1:`7`,y1:`7`,x2:`7.01`,y2:`7`})]}),e===`fast`&&(0,W.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,W.jsx)(`polygon`,{points:`13 2 3 14 12 14 11 22 21 10 12 10 13 2`})}),e===`reasoning`&&(0,W.jsxs)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`}),(0,W.jsx)(`rect`,{x:`9`,y:`9`,width:`6`,height:`6`}),(0,W.jsx)(`line`,{x1:`9`,y1:`1`,x2:`9`,y2:`4`}),(0,W.jsx)(`line`,{x1:`15`,y1:`1`,x2:`15`,y2:`4`}),(0,W.jsx)(`line`,{x1:`9`,y1:`20`,x2:`9`,y2:`23`}),(0,W.jsx)(`line`,{x1:`15`,y1:`20`,x2:`15`,y2:`23`}),(0,W.jsx)(`line`,{x1:`20`,y1:`9`,x2:`23`,y2:`9`}),(0,W.jsx)(`line`,{x1:`20`,y1:`14`,x2:`23`,y2:`14`}),(0,W.jsx)(`line`,{x1:`1`,y1:`9`,x2:`4`,y2:`9`}),(0,W.jsx)(`line`,{x1:`1`,y1:`14`,x2:`4`,y2:`14`})]}),e===`top`&&(0,W.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,W.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,W.jsxs)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,W.jsx)(`path`,{d:`M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z`})]}),(0,W.jsx)(`span`,{children:t})]})}function jw(e){let t=[];Mt(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 Mw({activeProvider:e,activeModel:t,availableProviders:n,settingsConfig:r,dynamicOllamaModels:i,onSelect:a,disabled:o=!1,onUpdateSettings:s}){let[c,l]=(0,Nw.useState)(!1),[u,d]=(0,Nw.useState)(`models`),[f,p]=(0,Nw.useState)(``),[m,h]=(0,Nw.useState)(0),[g,_]=(0,Nw.useState)(!1),[v,y]=(0,Nw.useState)({});(0,Nw.useEffect)(()=>{r?.modelThinkingConfigs&&y(r.modelThinkingConfigs)},[r?.modelThinkingConfigs]);let b=(0,Nw.useRef)(null),x=(0,Nw.useRef)(null),S=(0,Nw.useRef)(null),C=(0,Nw.useRef)(null),{models:w}=Pt(`gemini`,r?.apiKey||``),{models:T}=Pt(`anthropic`,r?.anthropicApiKey||``),{models:E}=Pt(`openai`,r?.openaiApiKey||``),{models:D}=Pt(`openrouter`,r?.openrouterApiKey||``),{models:O}=Pt(`deepseek`,r?.deepseekApiKey||``),{models:k}=Pt(`local_openai`,``,r?.localApiBaseUrl||``),[A,ee]=(0,Nw.useState)([]);(0,Nw.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 M.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,Nw.useMemo)(()=>{let e=[],t=(t,n,r,i,a)=>{i.length!==0&&e.push({id:t,providerId:n,name:r,icon:a?(0,W.jsx)(`img`,{className:`provider-brand-logo`,src:a,alt:``,"aria-hidden":`true`}):(0,W.jsx)(kw,{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(it),n=[];for(let e of it)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`,[...Ye]),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,Nw.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]),ne=!!f.trim()||g,N=(0,Nw.useMemo)(()=>{let e=[];for(let t of j)if(t.id!==`openrouter-other`||ne)for(let n of t.models)e.push({providerId:t.providerId,providerName:t.name,model:n});return e},[j,ne]),[re,ie]=(0,Nw.useState)(null);(0,Nw.useEffect)(()=>{c?t?ie({providerId:e,model:t}):N.length>0&&ie({providerId:N[0].providerId,model:N[0].model}):_(!1)},[c,e,t]),(0,Nw.useEffect)(()=>{h(0),N.length>0&&ie({providerId:N[0].providerId,model:N[0].model})},[f]);let ae=(0,Nw.useCallback)((e,t)=>{let n=qe(e,t),i=v[e];return i?{supported:n.supportsThinking,enabled:i.enabled??!0,effort:(i.effort||`medium`).toLowerCase()}:{supported:n.supportsThinking,enabled:n.supportsThinking?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,Nw.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,Nw.useEffect)(()=>{c&&(p(``),d(`models`),setTimeout(()=>{window.matchMedia(`(max-width: 760px)`).matches||S.current?.focus()},50))},[c]),(0,Nw.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(),N.length===0)return;let t=(m+1)%N.length;h(t),ie({providerId:N[t].providerId,model:N[t].model})}else if(e.key===`ArrowUp`){if(e.preventDefault(),N.length===0)return;let t=(m-1+N.length)%N.length;h(t),ie({providerId:N[t].providerId,model:N[t].model})}else if(e.key===`Enter`){e.preventDefault();let t=N[m];t&&(a(t.providerId,t.model),l(!1),x.current?.focus())}}}},P=(0,Nw.useMemo)(()=>t?t.split(`/`).pop()||t:`Select Model`,[t]),ce=(0,Nw.useMemo)(()=>ae(t,e),[t,e,ae]),le=re||(t?{providerId:e,model:t}:null),ue=(0,Nw.useMemo)(()=>le?qe(le.model,le.providerId):null,[le]),de=(0,Nw.useMemo)(()=>le?ae(le.model,le.providerId):{supported:!1,enabled:!1,effort:`medium`},[le,ae]),fe=(0,Nw.useMemo)(()=>le?jw(le.model):[],[le]),pe=e=>(r?.customProviders)?.find(t=>`custom:${t.id}`===e)?.logoDataUrl,me=0;return(0,W.jsxs)(`div`,{className:`model-selector-container`,children:[(0,W.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,W.jsx)(`span`,{className:`model-selector-trigger-icon`,children:pe(e)?(0,W.jsx)(`img`,{className:`provider-brand-logo`,src:pe(e),alt:``,"aria-hidden":`true`}):(0,W.jsx)(kw,{provider:e})}),(0,W.jsx)(`span`,{className:`model-selector-trigger-name`,children:P}),ce.enabled&&(0,W.jsx)(`span`,{className:`model-selector-trigger-effort`,children:Ow(ce.effort)}),(0,W.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,W.jsx)(`polyline`,{points:`6 9 12 15 18 9`})})]}),c&&(0,W.jsxs)(`div`,{ref:b,className:`model-spotlight-popover mobile-pane-${u}`,onKeyDown:se,children:[(0,W.jsxs)(`div`,{className:`model-spotlight-mobile-tabs`,role:`tablist`,"aria-label":`Model selector view`,children:[(0,W.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":u===`models`,onClick:()=>d(`models`),children:`Models`}),(0,W.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":u===`options`,onClick:()=>d(`options`),children:`Options`})]}),(0,W.jsxs)(`div`,{className:`model-spotlight-left-pane`,children:[(0,W.jsxs)(`div`,{className:`model-spotlight-search-bar`,children:[(0,W.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,W.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,W.jsx)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})]}),(0,W.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,W.jsx)(`button`,{type:`button`,className:`search-clear-btn`,onClick:()=>p(``),title:`Clear search`,children:(0,W.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,W.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]}),(0,W.jsx)(`div`,{ref:C,className:`model-spotlight-list`,role:`listbox`,children:j.length===0?(0,W.jsxs)(`div`,{className:`model-spotlight-empty`,children:[(0,W.jsxs)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,W.jsx)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})]}),(0,W.jsxs)(`span`,{children:[`No models found matching "`,f,`"`]})]}):j.map(n=>{let r=n.id===`openrouter-other`,i=r&&!ne;return(0,W.jsxs)(`div`,{className:`model-spotlight-group`,children:[(0,W.jsxs)(`div`,{className:`model-spotlight-group-header`,children:[(0,W.jsx)(`span`,{className:`group-header-icon`,children:n.icon}),(0,W.jsx)(`span`,{className:`group-header-title`,children:n.name})]}),i?(0,W.jsx)(`div`,{className:`model-spotlight-see-more-wrap`,children:(0,W.jsxs)(`button`,{type:`button`,className:`model-spotlight-see-more-btn`,onClick:()=>_(!0),children:[(0,W.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,W.jsx)(`polyline`,{points:`6 9 12 15 18 9`})}),(0,W.jsxs)(`span`,{children:[`Show all `,n.models.length,` other models`]})]})}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`model-spotlight-group-items`,children:n.models.map(r=>{let i=me++,o=e===n.providerId&&t===r,s=le?.model===r&&le?.providerId===n.providerId,c=ae(r,n.providerId);return(0,W.jsxs)(`div`,{"data-item-index":i,className:`model-spotlight-item ${o?`is-active`:``} ${s?`is-inspected`:``}`,onClick:()=>{ie({providerId:n.providerId,model:r}),a(n.providerId,r),l(!1),x.current?.focus()},onMouseEnter:()=>{h(i),ie({providerId:n.providerId,model:r})},role:`option`,"aria-selected":o,children:[(0,W.jsxs)(`div`,{className:`model-item-left`,children:[(0,W.jsxs)(`div`,{style:{display:`inline-flex`,alignItems:`center`,gap:`6px`},children:[(0,W.jsx)(`span`,{className:`model-item-provider-icon`,"aria-hidden":`true`,children:n.icon}),(0,W.jsx)(`span`,{className:`model-item-name`,children:r.split(`/`).pop()||r}),Mt(r)&&(0,W.jsx)(`span`,{className:`model-tag-badge badge-free`,children:`Free`})]}),r.includes(`/`)&&(0,W.jsx)(`span`,{className:`model-item-repo`,children:r})]}),(0,W.jsxs)(`div`,{className:`model-item-right`,children:[c.enabled&&(0,W.jsx)(`span`,{className:`model-item-effort-pill`,children:Ow(c.effort)}),o&&(0,W.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,W.jsx)(`polyline`,{points:`20 6 9 17 4 12`})})]})]},r)})}),r&&!f.trim()&&(0,W.jsx)(`div`,{className:`model-spotlight-see-more-wrap`,style:{marginTop:`4px`},children:(0,W.jsxs)(`button`,{type:`button`,className:`model-spotlight-see-more-btn collapse-btn`,onClick:()=>_(!1),children:[(0,W.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,W.jsx)(`polyline`,{points:`18 15 12 9 6 15`})}),(0,W.jsx)(`span`,{children:`Collapse other models`})]})})]})]},n.id)})})]}),(0,W.jsx)(`div`,{className:`model-spotlight-right-pane`,children:le&&ue?(0,W.jsxs)(`div`,{className:`model-detail-container`,children:[(0,W.jsxs)(`div`,{className:`model-detail-header`,children:[(0,W.jsx)(`div`,{className:`model-detail-icon`,children:pe(le.providerId)?(0,W.jsx)(`img`,{className:`provider-brand-logo`,src:pe(le.providerId),alt:``,"aria-hidden":`true`}):(0,W.jsx)(kw,{provider:le.providerId})}),(0,W.jsxs)(`div`,{className:`model-detail-title-wrap`,children:[(0,W.jsx)(`span`,{className:`model-detail-title`,children:le.model.split(`/`).pop()||le.model}),le.model.includes(`/`)&&(0,W.jsx)(`span`,{className:`model-detail-subtitle`,children:le.model})]})]}),(0,W.jsx)(`p`,{className:`model-detail-description`,children:ue.description}),(0,W.jsxs)(`div`,{className:`model-detail-tags`,children:[(0,W.jsx)(`span`,{className:`model-detail-context-badge`,children:ue.contextWindow}),fe.map(e=>(0,W.jsx)(Aw,{type:e.type,label:e.label},e.type))]}),(0,W.jsx)(`div`,{className:`model-detail-divider`}),(0,W.jsx)(`div`,{className:`model-detail-section-title`,children:`Options`}),(0,W.jsxs)(`div`,{className:`model-detail-option-row`,children:[(0,W.jsxs)(`div`,{className:`option-row-left`,children:[(0,W.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,W.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,W.jsx)(`path`,{d:`M9 21h6`})]}),(0,W.jsx)(`span`,{className:`option-label`,children:`Thinking`})]}),(0,W.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":de.enabled,className:`model-detail-switch ${de.enabled?`checked`:``}`,onClick:()=>{oe(le.model,!de.enabled,de.effort)},title:de.enabled?`Disable thinking`:`Enable thinking`,children:(0,W.jsx)(`span`,{className:`model-detail-switch-thumb`})})]}),!de.supported&&(0,W.jsx)(`div`,{className:`model-unsupported-note`,style:{color:de.enabled?`var(--interactive-fg)`:void 0},children:de.enabled?`Thinking enabled (force toggle)`:`Not flagged as reasoning model by default (toggle to force enable)`}),de.enabled&&(0,W.jsxs)(`div`,{className:`model-effort-section`,children:[(0,W.jsx)(`div`,{className:`model-detail-section-title`,children:`Effort`}),(0,W.jsx)(`div`,{className:`model-effort-list`,children:Pw.map(e=>{let t=de.effort===e.id;return(0,W.jsxs)(`button`,{type:`button`,className:`model-effort-item ${t?`is-selected`:``}`,onClick:()=>{oe(le.model,!0,e.id)},children:[(0,W.jsx)(`span`,{className:`effort-item-label`,children:e.label}),t&&(0,W.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,W.jsx)(`polyline`,{points:`20 6 9 17 4 12`})})]},e.id)})})]})]}):(0,W.jsx)(`div`,{className:`model-detail-empty`,children:(0,W.jsx)(`span`,{children:`Select a model to view options`})})})]})]})}var Nw,W,Pw,Fw,Iw=t((()=>{Nw=e(i()),Ot(),ke(),Ze(),Ue(),Ht(),Wt(),st(),wt(),mt(),Rt(),ut(),W=a(),Pw=[{id:`low`,label:`Low`},{id:`medium`,label:`Medium`},{id:`high`,label:`High`},{id:`extra_high`,label:`Extra High`}],Fw={anthropic:{src:tt,color:`#d97757`},deepseek:{src:lt},gemini:{src:Bt},huggingface:{src:gt},local_openai:{src:vt,color:`#8b5cf6`},ollama:{src:At,color:`#f3f4f6`},openai:{src:ft,color:`#10a37f`},openrouter:{src:St}}})),Lw=t((()=>{}));function Rw({open:e,count:t=0,onToggle:n,className:r=``}){return(0,zw.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,zw.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,zw.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`16`,rx:`2`}),(0,zw.jsx)(`path`,{d:`M15 4v16M18 8h1M18 12h1M18 16h1`})]}),(0,zw.jsx)(`span`,{className:`tools-toggle-label`,children:`Tools`}),t>0&&(0,zw.jsx)(`span`,{className:`tools-task-count`,"aria-label":`${t} active background tasks`,children:t})]})}var zw,Bw=t((()=>{Lw(),zw=a()}));function Vw(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 Hw=t((()=>{})),Uw=t((()=>{}));function Ww({node:e,color:t,onAction:n}){let r=String(e.value??``),[i,a]=(0,Yw.useState)(r);return(0,Yw.useEffect)(()=>{a(r)},[r,e.action]),(0,G.jsxs)(`label`,{className:`mod-input${t}`,children:[e.label,(0,G.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 Gw({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,G.jsx)(`div`,{className:`mod-stack${e.direction===`row`?` mod-stack-row`:``}${i}`,children:e.children?.map((e,n)=>(0,G.jsx)(Gw,{node:e,onAction:t,inheritedColor:r},n))});case`text`:return(0,G.jsx)(`p`,{className:`mod-text${i}`,children:e.text});case`badge`:return(0,G.jsx)(`span`,{className:`mod-badge${i}`,children:e.text});case`button`:return(0,G.jsx)(`button`,{className:i.trim()||void 0,type:`button`,onClick:()=>e.action&&t(e.action),children:e.label});case`input`:return(0,G.jsx)(Ww,{node:e,color:i,onAction:t});case`progress`:return(0,G.jsxs)(`label`,{className:`mod-progress${i}`,children:[e.label,(0,G.jsx)(`progress`,{"aria-label":e.label,value:Number(e.value),max:e.max})]});case`table`:return(0,G.jsx)(`div`,{className:`mod-table-scroll${i}`,children:(0,G.jsxs)(`table`,{children:[(0,G.jsx)(`thead`,{children:(0,G.jsx)(`tr`,{children:e.columns?.map((e,t)=>(0,G.jsx)(`th`,{children:e},t))})}),(0,G.jsx)(`tbody`,{children:e.rows?.map((e,t)=>(0,G.jsx)(`tr`,{children:e.map((e,t)=>(0,G.jsx)(`td`,{children:e},t))},t))})]})});default:return null}}function Kw({enabled:e,busy:t,onToggle:n}){return(0,G.jsxs)(`div`,{className:`mod-session-controls`,children:[(0,G.jsxs)(`button`,{type:`button`,disabled:t,"aria-pressed":e,onClick:()=>n(!e),children:[`Hot reload: `,e?`On`:`Off`]}),(0,G.jsx)(`p`,{className:`mod-hint`,children:`Applies to this session. Mods with permissions require review for each new revision.`})]})}function qw({report:e}){return(0,G.jsxs)(`section`,{"aria-label":`Mod test results`,children:[(0,G.jsxs)(`p`,{role:`status`,children:[e.passed,` passed · `,e.failed,` failed`]}),e.tests.map((e,t)=>(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`strong`,{children:[e.passed?`✓`:`✗`,` `,e.name]}),(0,G.jsx)(`p`,{className:`mod-hint`,children:e.file}),e.error&&(0,G.jsx)(`pre`,{className:`mod-error`,children:e.error})]},t))]})}function Jw({workspacePath:e,chatId:t,panelTarget:n,onOpen:r}){let[i,a]=(0,Yw.useState)({mods:[]}),o=!!n,c=(0,Yw.useRef)(r);c.current=r;let[l,u]=(0,Yw.useState)(`manage`),[d,f]=(0,Yw.useState)(``),[p,m]=(0,Yw.useState)(!1),[h,g]=(0,Yw.useState)(!0),[v,y]=(0,Yw.useState)({}),b=(0,Yw.useRef)(null),x=(0,Yw.useRef)(o);x.current=o;let S=(0,Yw.useRef)(i.mods);S.current=i.mods;let C=(0,Yw.useRef)(``);C.current=`${e}\0${t}`;let[w,T]=(0,Yw.useState)(`chat`),E=(0,Yw.useRef)(0),D=(0,Yw.useRef)(null),O=(0,Yw.useRef)(new Set),k=(0,Yw.useRef)(null);(0,Yw.useEffect)(()=>{let n=++E.current,r=!1,i;a({mods:[]}),g(!!(e&&t)),m(!1),f(``),u(`manage`),O.current.clear(),y({});async function o(){if(!e||!t||r)return;if(clearTimeout(i),document.hidden){r||(i=setTimeout(o,Zw(x.current,S.current)));return}let s=S.current;try{let i=await N.operation({workspacePath:e,chatId:t,action:`list`});if(!r&&E.current===n){s=i.mods??[],a(i),g(!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&&(c.current(),u(e.id))}}catch(e){!r&&E.current===n&&(f(String(e)),g(!1))}r||(i=setTimeout(o,Zw(x.current,s)))}k.current=()=>{o()},o();let s=()=>{!document.hidden&&!r&&o()};return document.addEventListener(`visibilitychange`,s),()=>{r=!0,clearTimeout(i),k.current=null,document.removeEventListener(`visibilitychange`,s),e&&t&&N.operation({workspacePath:e,chatId:t,action:`close`}).catch(()=>{})}},[e,t]),(0,Yw.useEffect)(()=>{o&&k.current?.()},[o]),(0,Yw.useEffect)(()=>{let n=b.current;if(!n||!e||!t)return;let r=!1,i=``,a,o=_.isTauriRuntime()?`desktop`:`web`;async function s(){if(r)return;let a=n.getBoundingClientRect(),s=Vw(a.width,a.height,o,x.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||f(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,Yw.useCallback)(async n=>{if(!e||C.current!==`${e}\0${t}`)return;let r=E.current;m(!0),f(``);try{let i=await N.operation({...n,workspacePath:e,chatId:t});if(r!==E.current)return;if(i.testReport&&n.id&&y(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&&f(String(e))}finally{r===E.current&&m(!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||[],M=j.filter(e=>e.enabled),ne=M.filter(e=>e.snapshot?.ui.side_panel),re=j.find(e=>e.id===l);return(0,G.jsx)(G.Fragment,{children:(0,G.jsxs)(`div`,{className:`mint-mods`,ref:b,children:[M.map(e=>e.snapshot?.ui.above_composer&&(0,G.jsx)(`section`,{className:`mod-band`,"aria-label":e.name,children:(0,G.jsx)(Gw,{node:e.snapshot.ui.above_composer,onAction:(t,n)=>te(e,t,n)})},e.id)),n&&(0,Xw.createPortal)((0,G.jsxs)(`aside`,{className:`mods-panel mint-mods`,"aria-label":`Workspace mods`,children:[(0,G.jsxs)(`header`,{className:`mods-panel-header`,children:[(0,G.jsx)(`span`,{className:`mods-panel-icon`,"aria-hidden":`true`,children:(0,G.jsx)(ae,{size:18})}),(0,G.jsxs)(`div`,{className:`mods-panel-title`,children:[(0,G.jsx)(`strong`,{children:`Mods`}),(0,G.jsxs)(`p`,{children:[j.length,` installed · `,M.length,` active`]})]})]}),ne.length>0&&(0,G.jsxs)(`nav`,{"aria-label":`Mod panels`,children:[(0,G.jsx)(`button`,{type:`button`,"aria-pressed":l===`manage`,onClick:()=>u(`manage`),children:`Manage`}),ne.map(e=>(0,G.jsx)(`button`,{type:`button`,"aria-pressed":l===e.id,onClick:()=>u(e.id),children:e.name},e.id))]}),d&&(0,G.jsx)(`p`,{role:`alert`,className:`mod-error`,children:d}),re?.snapshot?.ui.side_panel&&l!==`manage`?(0,G.jsx)(`section`,{className:`mod-content`,children:(0,G.jsx)(Gw,{node:re.snapshot.ui.side_panel,onAction:(e,t)=>te(re,e,t)})}):(0,G.jsxs)(`div`,{className:`mod-content`,children:[(0,G.jsxs)(`div`,{className:`mods-toolbar`,children:[(0,G.jsxs)(`label`,{htmlFor:`mods-scope`,children:[`Enable for `,(0,G.jsxs)(`select`,{id:`mods-scope`,value:w,onChange:e=>T(e.target.value),children:[(0,G.jsx)(`option`,{value:`chat`,children:`This chat`}),(0,G.jsx)(`option`,{value:`workspace`,children:`This workspace`}),(0,G.jsx)(`option`,{value:`global`,children:`All workspaces`})]})]}),(0,G.jsxs)(`button`,{type:`button`,className:`mods-import`,disabled:p||!e||!t,onClick:()=>D.current?.click(),children:[(0,G.jsx)(xe,{size:14,"aria-hidden":`true`}),`Import`]})]}),(0,G.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){f(`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(C.current===`${e}\0${t}`)try{let n=await N.operation({workspacePath:e,chatId:t,action:`inspect_package`,package:o});if(C.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){C.current===`${e}\0${t}`&&f(String(n))}}}),h&&(0,G.jsx)(`p`,{role:`status`,className:`mods-empty`,children:`Loading mods…`}),!h&&!j.length&&(0,G.jsxs)(`div`,{className:`mods-empty`,children:[(0,G.jsx)(ae,{size:22,"aria-hidden":`true`}),(0,G.jsx)(`strong`,{children:e?`No mods yet`:`Choose a workspace`}),(0,G.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,G.jsxs)(`article`,{className:`mod-entry`,children:[(0,G.jsxs)(`div`,{className:`mod-entry-heading`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{children:e.name}),(0,G.jsxs)(`small`,{children:[`Version `,e.manifest?.version||`unknown`]})]}),(0,G.jsx)(`span`,{className:`mod-status ${e.error?`is-error`:e.enabled?`is-active`:``}`,children:e.error?`Error`:e.enabled?`Active`:`Off`})]}),e.changed&&(0,G.jsx)(`p`,{className:`mod-hint`,children:`Source changed · active revision preserved`}),e.reloadError&&(0,G.jsxs)(`p`,{role:`alert`,className:`mod-error`,children:[`Reload: `,e.reloadError]}),(e.error||e.sourceError)&&(0,G.jsx)(`p`,{role:`alert`,className:`mod-error`,children:e.error||e.sourceError}),(0,G.jsx)(`p`,{className:`mod-hint`,children:e.manifest?.permissions?.join(`, `)||`UI, events and mod state`}),(0,G.jsxs)(`div`,{className:`mod-entry-footer`,children:[(0,G.jsx)(`button`,{type:`button`,className:`mod-primary-action ${e.enabled&&!e.changed?`is-disable`:``}`,disabled:p||!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,G.jsxs)(`details`,{className:`mod-entry-more`,children:[(0,G.jsxs)(`summary`,{children:[`More options `,(0,G.jsx)(s,{size:13,"aria-hidden":`true`})]}),(0,G.jsxs)(`div`,{className:`mod-actions`,children:[(0,G.jsx)(`button`,{type:`button`,disabled:p||!e.source,onClick:()=>void A({action:`export`,id:e.id}),children:`Export`}),(0,G.jsx)(`button`,{type:`button`,disabled:p||!e.source,onClick:()=>void A({action:`test`,id:e.id}),children:`Run tests`})]}),v[e.id]&&(0,G.jsx)(qw,{report:v[e.id]}),(0,G.jsxs)(`details`,{children:[(0,G.jsx)(`summary`,{children:`Source & diagnostics`}),(0,G.jsx)(`pre`,{children:e.source}),(0,G.jsx)(`pre`,{children:e.snapshot?.logs?.join(`
|
|
58
|
+
`)||`No log messages`}),(0,G.jsxs)(`p`,{className:`mod-hint`,children:[`Active revision: `,e.activeHash||`None`]})]}),e.revisions.length>1&&(0,G.jsxs)(`label`,{className:`mod-revisions`,children:[`Restore source revision `,(0,G.jsxs)(`select`,{value:``,disabled:p,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,G.jsx)(`option`,{value:``,children:`Choose revision`}),e.revisions.filter(t=>t!==e.hash).map(e=>(0,G.jsx)(`option`,{value:e,children:e.slice(0,12)},e))]})]})]})]})]},e.id)),i.toolRequests?.map(e=>(0,G.jsxs)(`article`,{className:`mod-entry`,children:[(0,G.jsxs)(`strong`,{children:[e.modId,`: `,e.action]}),(0,G.jsx)(`pre`,{children:JSON.stringify(e.input,null,2)}),(0,G.jsx)(`button`,{type:`button`,disabled:p,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,G.jsxs)(`details`,{className:`mod-session-settings`,children:[(0,G.jsxs)(`summary`,{children:[`Session settings `,(0,G.jsx)(s,{size:13,"aria-hidden":`true`})]}),(0,G.jsx)(Kw,{enabled:i.session?.hotReload??!1,busy:p,onToggle:e=>void A({action:`hot_reload`,value:e})})]})]})]}),n)]})})}var Yw,Xw,G,Zw,Qw=t((()=>{Yw=e(i()),Xw=E(),k(),ke(),Hw(),Uw(),G=a(),Zw=(e,t)=>e||t?.some(e=>e.enabled)?3e3:12e3})),$w=t((()=>{}));function eT({queuedPrompts:e,queuePaused:t,sending:n,onRemove:r,onEdit:i,onClear:a,onSteer:o,onResumeQueue:s}){let[c,l]=(0,tT.useState)(!1);return!e||e.length===0?null:(0,K.jsxs)(`div`,{className:`queued-messages-tray`,role:`region`,"aria-label":`Queued messages`,children:[(0,K.jsxs)(`div`,{className:`queued-messages-header`,children:[(0,K.jsxs)(`div`,{className:`queued-messages-title-wrap`,children:[(0,K.jsxs)(`span`,{className:`queued-messages-title`,children:[(0,K.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,K.jsx)(`line`,{x1:`8`,y1:`6`,x2:`21`,y2:`6`}),(0,K.jsx)(`line`,{x1:`8`,y1:`12`,x2:`21`,y2:`12`}),(0,K.jsx)(`line`,{x1:`8`,y1:`18`,x2:`21`,y2:`18`}),(0,K.jsx)(`line`,{x1:`3`,y1:`6`,x2:`3.01`,y2:`6`}),(0,K.jsx)(`line`,{x1:`3`,y1:`12`,x2:`3.01`,y2:`12`}),(0,K.jsx)(`line`,{x1:`3`,y1:`18`,x2:`3.01`,y2:`18`})]}),(0,K.jsx)(`span`,{children:`Queued`}),(0,K.jsx)(`span`,{className:`queued-messages-badge`,children:e.length})]}),(0,K.jsx)(`span`,{className:`queued-messages-status ${t?`is-paused`:``}`,children:t?(0,K.jsxs)(K.Fragment,{children:[(0,K.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,K.jsx)(`rect`,{x:`6`,y:`4`,width:`4`,height:`16`,rx:`1`}),(0,K.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,K.jsxs)(`div`,{className:`queued-messages-actions`,children:[t&&s&&(0,K.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,K.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,K.jsx)(`polygon`,{points:`5 3 19 12 5 21 5 3`})}),(0,K.jsx)(`span`,{children:`Resume`})]}),(0,K.jsxs)(`button`,{type:`button`,className:`queued-messages-btn`,onClick:a,title:`Clear all queued messages`,"aria-label":`Clear all queued messages`,children:[(0,K.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,K.jsx)(`polyline`,{points:`3 6 5 6 21 6`}),(0,K.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,K.jsx)(`span`,{children:`Clear`})]}),(0,K.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,K.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,K.jsx)(`polyline`,{points:`18 15 12 9 6 15`})}):(0,K.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,K.jsx)(`polyline`,{points:`6 9 12 15 18 9`})})})]})]}),!c&&(0,K.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,K.jsxs)(`div`,{className:`queued-message-item`,children:[(0,K.jsxs)(`span`,{className:`queued-message-index`,children:[`#`,t+1]}),(0,K.jsxs)(`div`,{className:`queued-message-content`,children:[(0,K.jsx)(`div`,{className:`queued-message-text`,title:e.text,children:e.text||`(No text prompt)`}),(n>0||a>0||s)&&(0,K.jsxs)(`div`,{className:`queued-message-attachments`,children:[n>0&&(0,K.jsxs)(`span`,{className:`queued-attachment-pill`,children:[(0,K.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,K.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,ry:`2`}),(0,K.jsx)(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`}),(0,K.jsx)(`polyline`,{points:`21 15 16 10 5 21`})]}),n,` `,n===1?`image`:`images`]}),a>0&&(0,K.jsxs)(`span`,{className:`queued-attachment-pill`,children:[(0,K.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,K.jsx)(`polygon`,{points:`23 7 16 12 23 17 23 7`}),(0,K.jsx)(`rect`,{x:`1`,y:`5`,width:`15`,height:`14`,rx:`2`,ry:`2`})]}),a,` `,a===1?`video`:`videos`]}),s&&(0,K.jsxs)(`span`,{className:`queued-attachment-pill`,title:s,children:[(0,K.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,K.jsx)(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z`}),(0,K.jsx)(`polyline`,{points:`14 2 14 8 20 8`})]}),s]})]})]}),(0,K.jsxs)(`div`,{className:`queued-item-actions`,children:[(0,K.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,K.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,K.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`}),(0,K.jsx)(`polyline`,{points:`12 5 19 12 12 19`})]})}),(0,K.jsx)(`button`,{type:`button`,className:`queued-icon-btn`,onClick:()=>i(e.id),title:`Edit (restore to composer)`,"aria-label":`Edit message`,children:(0,K.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,K.jsx)(`path`,{d:`M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z`})})}),(0,K.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,K.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,K.jsx)(`polyline`,{points:`3 6 5 6 21 6`}),(0,K.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,K.jsx)(`line`,{x1:`10`,y1:`11`,x2:`10`,y2:`17`}),(0,K.jsx)(`line`,{x1:`14`,y1:`11`,x2:`14`,y2:`17`})]})})]})]},e.id)})})]})}var tT,K,nT=t((()=>{tT=e(i()),$w(),K=a()})),rT=t((()=>{}));function iT(e,t){return e?.activeProvider===`ollama`||!!(t?.ollamaHost||t?.ollamaModel)}function aT(){let[e,t]=(0,q.useState)(0);return(0,q.useEffect)(()=>{let e=Date.now(),n=setInterval(()=>{t(Math.round((Date.now()-e)/1e3))},1e3);return()=>clearInterval(n)},[]),(0,J.jsx)(`span`,{className:`thinking-status-meta`,children:` · ${e}s · Esc to cancel`})}function oT(e,t){let[n,r]=(0,q.useState)(e),i=(0,q.useRef)(e),a=(0,q.useRef)(0),o=(0,q.useRef)(null);return(0,q.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,q.useEffect)(()=>()=>{o.current!==null&&window.clearTimeout(o.current)},[]),n}function sT(e,t,n){let r=()=>n?n():e;return(0,q.useSyncExternalStore)(t??xT,r,r)}function cT({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:g,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:M,onPasteImage:ne,onSetMessage:N,onSendVoiceMessage:re,onRemoveImage:ie,onRemoveVideo:ae,onRemoveDocument:oe,onStartWebSearch:se,onCaptureScreen:P,onSetAgentMode:ce,onSetPlanMode:le,onSetProvider:ue,onSelectWorkspace:de,onWorkspaceChanged:fe,onApproval:pe,settingsConfig:me,onUpdateSettings:he,onSetModel:ge,onSelectModelAndProvider:_e,onCancelMessage:ve,onClearMessages:ye,onSetGeminiLiveVoice:be,onToggleMobileSidebar:xe,isCliSession:Se,cliSessionId:Ce,onBackToCode:we,conversationTitle:Te,slashChoice:Ee,onOpenArtifact:De,onOpenReview:Oe,onSelectSlashChoice:ke,onDismissSlashChoice:Ae,queuedPrompts:je=[],queuePaused:Me=!1,onRemoveQueuedPrompt:Ne,onEditQueuedPrompt:Pe,onClearQueuedPrompts:Fe,onSteerQueuedPrompt:Ie,onResumeQueue:Le}={...e,...t},Re=sT(v,t.subscribeMessage,t.getMessage),ze=Xb(g),Be=(0,q.useMemo)(()=>jb(r,s,i),[r,s,i]),Ve=(0,q.useMemo)(()=>Jy(p),[p]),Ue=(0,q.useMemo)(()=>Ve.reduce((e,t)=>e+t.additions,0),[Ve]),We=(0,q.useMemo)(()=>Ve.reduce((e,t)=>e+t.deletions,0),[Ve]),Ge=Ve.length===1?`1 file changed`:`${Ve.length} files changed`,qe=(0,q.useMemo)(()=>Xy(r.map(e=>{let t=String(e.id);return Jy(m[t]??e.agentActivity??Zy)})),[m,r]),Xe=Xb(()=>Xy([qe,Ve])),Ze=(0,q.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]),et=oT(d,fT),tt=(0,q.useMemo)(()=>Ub(p),[p]),nt=Vt(f),rt=(0,q.useMemo)(()=>kb(p),[p]),it=(0,q.useMemo)(()=>Vy(p),[p]),ot=(0,q.useMemo)(()=>Hy(p),[p]),st=(0,q.useMemo)(()=>[...p].reverse().find(e=>e.type===`Thinking`),[p]),ct=null,lt=null;st&&st.type===`Thinking`&&(ct=st.data.agent_name||null,lt=st.data.model_name||null);let[ut,dt]=(0,q.useState)({}),[ft,pt]=(0,q.useState)(null),[mt,ht]=(0,q.useState)(null),[gt,_t]=(0,q.useState)(!1),[vt,bt]=(0,q.useState)(He),St=(0,q.useCallback)(e=>{dt(t=>({...t,[e]:!(t[e]??e===`live`)}))},[]),Ct=Xb(e=>{De?De(e):ht({...e,workspacePath:e.workspacePath??E})}),wt=Xb((e,t)=>{Oe?Oe({id:`review:${Date.now()}`,kind:`review`,title:`Review`,reviewTitle:e,changes:t}):pt({title:e,changes:t})}),Tt=Xb(()=>{wt(`All conversation changes`,Xe())});(0,q.useEffect)(()=>{if(!iT(T,me))return;let e=!1;return(async()=>{let t=me?.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){bt(t.models.map(e=>e.name));return}}}catch{}try{let t=await bT(`ollama`,``);if(!e&&t&&t.length>0){bt(t);return}}catch{}e||(me?.ollamaModel?bt([me.ollamaModel]):bt(He))})(),()=>{e=!0}},[T?.activeProvider,me?.ollamaHost,me?.ollamaModel]);let[Et,Dt]=(0,q.useState)(``),[Ot,kt]=(0,q.useState)(null),[At,jt]=(0,q.useState)(null),Mt=(0,q.useRef)(null),Nt=(0,q.useRef)(null),[Pt,Ft]=(0,q.useState)(!1),[It,Lt]=(0,q.useState)(!1),Rt=(0,q.useRef)(!0),Bt=(0,q.useRef)(null),Ht=(0,q.useCallback)(()=>{let e=Mt.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<=240;Ft(!t),Rt.current=t},[]),Ut=(0,q.useCallback)(()=>{Rt.current&&Bt.current===null&&(Bt.current=window.requestAnimationFrame(()=>{Bt.current=null,Mt.current&&Rt.current&&Nt.current?.scrollToEnd()}))},[]);(0,q.useEffect)(()=>{Ut()},[r,s,d,S,p,Ut]),(0,q.useEffect)(()=>{Rt.current=!0,Ft(!1),Ut()},[D,Ut]),(0,q.useEffect)(()=>()=>{Bt.current!==null&&window.cancelAnimationFrame(Bt.current)},[]),(0,q.useEffect)(()=>{let e=Mt.current;e&&Rt.current&&(e.scrollTop=e.scrollHeight)},[mt]);let Wt=(0,q.useCallback)(()=>{Rt.current=!0,Nt.current?.scrollToEnd()},[]),[Gt,qt]=(0,q.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}),Jt=(0,q.useRef)(Gt),Yt=(0,q.useRef)(null),Xt=(0,q.useCallback)(e=>{e.preventDefault();let t=Yt.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;Jt.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`),qt(Jt.current);try{localStorage.setItem(`mint_preview_split_ratio`,Jt.current.toFixed(4))}catch{}};window.addEventListener(`mousemove`,n),window.addEventListener(`mouseup`,r)},[]),Zt=(0,q.useCallback)(()=>{let e=.5;Jt.current=e,qt(e),Yt.current&&Yt.current.style.setProperty(`--preview-width`,`50%`);try{localStorage.setItem(`mint_preview_split_ratio`,`0.5`)}catch{}},[]),[Qt,$t]=(0,q.useState)({isOpen:!1,interaction:null,changes:[],checkpoints:[],targetCheckpoint:null,isLoading:!1}),[en,tn]=(0,q.useState)({visible:!1,message:``,canUndo:!1,isUndoing:!1,type:`success`});(0,q.useEffect)(()=>{if(!en.visible)return;let e=setTimeout(()=>{tn(e=>({...e,visible:!1}))},16e3);return()=>clearTimeout(e)},[en.visible,en.message]);let nn=(0,q.useCallback)(async e=>{let t=Qt.interaction;if(!t)return;let n=t.chatId||`cli`;$t(e=>({...e,isLoading:!0}));try{let t=await vT(n,e,E);$t(e=>({...e,isOpen:!1,isLoading:!1})),t.status===`ok`?tn({visible:!0,message:t.message,canUndo:!0,isUndoing:!1,type:`success`}):tn({visible:!0,message:`Failed to rewind: ${t.message}`,canUndo:!1,isUndoing:!1,type:`error`})}catch(e){$t(e=>({...e,isOpen:!1,isLoading:!1})),tn({visible:!0,message:`Error: ${e.message||String(e)}`,canUndo:!1,isUndoing:!1,type:`error`})}},[Qt.interaction,E]),rn=(0,q.useCallback)(async()=>{tn(e=>({...e,isUndoing:!0}));try{let e=await yT(E);e.status===`ok`?tn({visible:!0,message:e.message,canUndo:!1,isUndoing:!1,type:`success`}):tn({visible:!0,message:`Failed to undo rewind: ${e.message}`,canUndo:!0,isUndoing:!1,type:`error`})}catch(e){tn({visible:!0,message:`Error: ${e.message||String(e)}`,canUndo:!0,isUndoing:!1,type:`error`})}},[E]),an=(0,q.useCallback)(async(e,t)=>{try{let n=_g(t)||t;await navigator.clipboard.writeText(n),jt(e),setTimeout(()=>{jt(t=>t===e?null:t)},2e3)}catch(e){console.error(`Failed to copy message:`,e)}},[]),on=(0,q.useRef)(null),sn=(0,q.useRef)(!1),cn=(0,q.useRef)(!1),ln=(0,q.useRef)(null),un=(0,q.useRef)(null),[dn,fn]=(0,q.useState)(!1),pn=(0,q.useRef)(0),mn=(0,q.useRef)(0),hn=e=>{e.preventDefault(),e.dataTransfer?.types?.includes(`Files`)&&(pn.current++,fn(!0))},gn=e=>{e.preventDefault(),e.dataTransfer?.types?.includes(`Files`)&&(pn.current--,pn.current===0&&fn(!1))},_n=e=>{e.preventDefault()},vn=e=>{e.preventDefault(),e.stopPropagation(),pn.current=0,fn(!1);let t=Date.now();if(t-mn.current<250)return;mn.current=t;let n=e.dataTransfer?.files;if(n&&n.length>0){let e=n[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(ww(e.name)){let t=document.getElementById(`document-file-input`);if(t){let n=new DataTransfer;n.items.add(e),t.files=n.files,M({target:t})}}}},{isRecording:yn,voiceMode:bn,setVoiceMode:xn,voiceTranscript:F,setVoiceTranscript:Sn,voiceAwaitingResponse:Cn,voiceAwaitingResponseRef:I,voiceModeRef:wn,startRecognition:Tn,stopRecognition:En,cancelRecognition:Dn,scheduleVoiceListen:On,clearRestartTimer:kn}=HC({chatId:D,onSendVoiceMessage:re,language:me?.language,message:Re,sending:s,isSpeaking:!!Ot,onSetMessage:N}),An=me?.voiceMode===`geminiLive`,jn=uw({workspacePath:E,chatId:D,startSession:mT,sendAudioChunk:hT,stopSession:gT}),Mn=!!(Re.trim()||y.length>0||b.length>0||x),Nn=Array.from({length:l},(e,t)=>`[Image #${t+1}]`).join(` `),Pn=Array.from({length:u||0},(e,t)=>`[Video #${t+1}]`).join(` `),Fn=e=>{switch(e){case`gemini`:return Ke;case`openai`:return at;case`openrouter`:return Je;case`deepseek`:return Qe;case`anthropic`:return xt;case`huggingface`:return Ye;case`local_openai`:return Kt;case`ollama`:return vt;default:if(e.startsWith(`custom:`)){let t=e.replace(/^custom:/,``);return(me?.customProviders??[]).find(e=>e.id===t)?.models.map(e=>e.modelId)??[]}return[]}},In=T?.activeProvider??``;Fn(In);let Ln=(e=>{if(!me)return``;switch(e){case`gemini`:return me.geminiModel;case`openai`:return me.openaiModel;case`openrouter`:return me.openrouterModel;case`deepseek`:return me.deepseekModel;case`anthropic`:return me.anthropicModel;case`huggingface`:return me.hfModel;case`local_openai`:return me.localModelName;case`ollama`:return me.ollamaModel;default:if(e.startsWith(`custom:`)){let t=e.replace(/^custom:/,``),n=(me?.customProviders??[]).find(e=>e.id===t);return(me.customModelSelections??{})[t]??n?.models[0]?.modelId??``}return``}})(In),Rn=(0,q.useRef)(null),zn=(0,q.useRef)(null),Bn=(0,q.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]),[Vn,Hn]=(0,q.useState)(null),Un=(0,q.useRef)(``),Wn=e=>{N(e),setTimeout(()=>{let e=Rn.current;if(!e)return;tr(e);let t=e.value.length;e.setSelectionRange(t,t),e.focus()},0)},Gn=()=>{if(Bn.length===0)return!1;if(Vn===null)return Un.current=Re,Hn(0),Wn(Bn[Bn.length-1]),!0;if(Vn+1<Bn.length){let e=Vn+1;Hn(e),Wn(Bn[Bn.length-1-e])}return!0},Kn=Xb(e=>{Hn(null),Wn(e)}),qn=()=>{if(Vn===null)return!1;if(Vn===0)return Hn(null),Wn(Un.current),!0;let e=Vn-1;return Hn(e),Wn(Bn[Bn.length-1-e]),!0},Jn=e=>{N(e),setTimeout(()=>{let e=Rn.current;e&&(tr(e),e.focus())},0)},Yn=e=>{e.key!==`Enter`||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),e.currentTarget.form?.requestSubmit())},Xn=e=>{let t=(e.key===`ArrowUp`||e.key===`ArrowDown`)&&!e.shiftKey&&!e.altKey&&!e.metaKey&&!e.ctrlKey&&!e.nativeEvent.isComposing;if(t&&Vn!==null&&e.currentTarget.selectionStart===e.currentTarget.selectionEnd&&(e.key===`ArrowUp`?Gn():qn()))e.preventDefault();else if(!zn.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(`
|
|
59
|
+
`)&&Gn()){e.preventDefault();return}}else if(!t.value.slice(t.selectionEnd).includes(`
|
|
60
|
+
`)&&qn()){e.preventDefault();return}}}Yn(e)}},Zn=(0,q.useRef)(null),Qn=(0,q.useRef)(null);Zn.current||=new eb(pT,e=>{kt(e===`idle`?null:Qn.current),un.current=e===`idle`?null:Qn.current,e===`idle`&&On(900)},e=>Dt(e));let $n=()=>{Zn.current?.stop()},er=Xb((e,t,n=!1)=>{if(!n&&Ot===e){$n();return}Dt(``),Qn.current=e;let i=t??Number([...r].reverse().find(t=>t.aiText===e)?.id);Zn.current?.play({chatId:D,text:e,turnId:Number.isFinite(i)&&i>0?i:void 0,automatic:n})});(0,q.useEffect)(()=>{$n()},[D,s]),(0,q.useEffect)(()=>{sn.current=!1,cn.current=!1,ln.current=null},[D]);let tr=e=>{e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,120)}px`};(0,q.useEffect)(()=>()=>{Zn.current?.dispose()},[]),(0,q.useEffect)(()=>{s&&(cn.current=!0)},[s]),(0,q.useEffect)(()=>{if(r.length===0)return;let e=r[r.length-1];!sn.current&&(sn.current=!0,!cn.current)?ln.current=e?.id??null:s||e?.aiText&&e.id!==ln.current&&(!me?.enableVoiceReply||jn.voiceMode?(ln.current=e.id,bn&&On(350)):(ln.current=e.id,er(e.aiText,Number(e.id),!0)))},[r,s,me?.enableVoiceReply,jn.voiceMode,bn]),(0,q.useEffect)(()=>{if(!gt)return;let e=e=>{on.current?.contains(e.target)||_t(!1)};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[gt]),(0,q.useEffect)(()=>{let e=e=>{e.clipboardData&&ne(e.clipboardData)&&(e.preventDefault(),e.stopPropagation())};return window.addEventListener(`paste`,e,!0),()=>window.removeEventListener(`paste`,e,!0)},[ne]),(0,q.useEffect)(()=>{let e=e=>{let t=e.target instanceof Element&&e.target.closest(`.tool-surface-page`);e.key===`Escape`&&s&&!e.defaultPrevented&&!t&&ve()};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[s,ve]),(0,q.useEffect)(()=>{if(Re)return;let e=document.getElementById(`chat-input`);e&&(e.style.height=``)},[Re]);let nr=()=>{_t(!1),document.getElementById(`vision-file-input`)?.click()},rr=()=>{_t(!1),document.getElementById(`video-file-input`)?.click()},ir=()=>{_t(!1),document.getElementById(`document-file-input`)?.click()},ar=()=>{_t(!1),se()},or=()=>{_t(!1),C||ce(!0),N(`Generate an image of `),Rn.current?.focus()},sr=()=>{_t(!1),C||ce(!0),N(`Generate a video of `),Rn.current?.focus()},cr=e=>{let t=e.trim();t&&N(Re.trim()?`${Re.trimEnd()} ${t} `:`${t} `)},lr=e=>{let t=e.dataTransfer.getData(`application/x-mint-workspace-path`)||e.dataTransfer.getData(`text/plain`);t.trim().startsWith(`@`)&&(e.preventDefault(),cr(t))},ur=r.length===0&&!s&&!S,dr=Xb(e=>{$t({isOpen:!0,interaction:e.interaction,changes:e.changes,checkpoints:e.checkpoints,targetCheckpoint:e.targetCheckpoint,isLoading:!1})}),fr=Xb(e=>{tn({visible:!0,message:e,canUndo:!1,isUndoing:!1,type:`error`})}),pr=s||S?(0,J.jsxs)(J.Fragment,{children:[s&&(0,J.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`8px`,marginBottom:`16px`},children:[(0,J.jsx)(`div`,{className:`message user-message`,children:(0,J.jsx)(`div`,{className:`bubble-wrapper`,children:(0,J.jsx)(`div`,{className:`message-bubble`,children:(0,J.jsx)(Zg,{text:[c,Nn,Pn].filter(Boolean).join(` `)})})})}),C&&(0,J.jsx)(oS,{progress:p,id:`live`,isOpen:ut.live??!0,onToggle:St,pendingApproval:!!S,chatId:D,onOpenArtifact:Ct}),(0,J.jsx)(_S,{changes:Ve,isLive:!0,onOpenArtifact:Ct,onOpenReview:Tt}),(0,J.jsx)(`div`,{className:`message ai-message thinking-message`,children:(0,J.jsxs)(`div`,{className:`bubble-wrapper`,children:[!C&&ot.length>0&&(0,J.jsx)(Nx,{blockKey:`live-extended`,thoughts:ot,isLive:!0,variant:`extended`,expanded:h[`live-extended`]??!0,onExpandedChange:ze}),!C&&it.length>0&&ot.length===0&&(0,J.jsx)(Nx,{blockKey:`live`,thoughts:it,isLive:!0,expanded:h.live??!0,onExpandedChange:ze}),(0,J.jsxs)(`div`,{className:`message-bubble`,children:[(0,J.jsx)(ob,{progress:p,running:!0,chatId:D}),(0,J.jsx)(hb,{progress:p,chatId:D,onOpenArtifact:Ct}),(0,J.jsx)(`span`,{children:rt?(0,J.jsx)(Tb,{},rt.index):et?(0,J.jsx)(Zg,{text:et,sources:tt}):(0,J.jsxs)(`div`,{className:`thinking-status`,children:[(0,J.jsxs)(`span`,{className:`thinking-status-label`,children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,children:`✦ `}),ct&<?`${ct} (${lt}) is thinking...`:`Thinking`]}),(0,J.jsx)(aT,{})]})})]}),f&&(0,J.jsxs)(`div`,{className:`message-time`,style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,J.jsxs)(`span`,{className:`provider-model-chip`,"data-provider":(f.provider||``).toLowerCase(),title:`${f.provider} • ${f.model}`,children:[(0,J.jsx)(qS,{provider:f.provider,model:f.model,customProviders:me?.customProviders,size:13}),(0,J.jsx)(`span`,{className:`provider-chip-name`,children:f.provider}),(0,J.jsx)(`span`,{className:`provider-chip-divider`,children:`/`}),(0,J.jsx)(`span`,{className:`provider-chip-model`,children:f.model})]}),nt&&(0,J.jsx)(`span`,{className:`provider-fallback-notice`,children:nt}),et&&(0,J.jsxs)(`div`,{className:`message-action-buttons`,style:{display:`flex`,alignItems:`center`,gap:`4px`,marginLeft:`auto`},children:[(0,J.jsx)(`button`,{type:`button`,className:`msg-action-btn copy-btn ${At===`live`?`is-copied`:``}`,onClick:()=>an(`live`,et),title:At===`live`?`คัดลอกแล้ว (Copied!)`:`คัดลอกข้อความ (Copy message)`,children:bg(At===`live`)}),(0,J.jsx)(`button`,{type:`button`,className:`msg-action-btn tts-btn ${Ot===et?`is-speaking`:``}`,disabled:s,onClick:()=>er(et),title:s?`Read after the reply finishes`:Ot===et?`Stop reading`:`Read aloud`,children:yg(Ot===et)})]})]})]})})]}),S&&(0,J.jsx)(kx,{pendingApproval:S,onApproval:pe},S.id||JSON.stringify(S))]}):null,mr=(0,J.jsxs)(`section`,{className:`conversation-panel ${ur?`is-empty`:``}`,onDragEnter:hn,onDragOver:_n,onDragLeave:gn,onDrop:vn,style:mt||ft?{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:[Et&&(0,J.jsxs)(`p`,{role:`status`,style:{padding:`8px 16px`,fontSize:`12px`,color:`var(--text-muted)`},children:[Et,` `,(0,J.jsx)(`button`,{type:`button`,onClick:()=>Dt(``),children:`Dismiss`})]}),dn&&(0,J.jsxs)(`div`,{className:`drag-drop-overlay`,onDragEnter:hn,onDragLeave:gn,onDragOver:_n,onDrop:vn,style:{position:`absolute`,top:0,left:0,right:0,bottom:0,background:`var(--bg-backdrop)`,backdropFilter:`blur(8px)`,border:`2px dashed var(--accent)`,borderRadius:`16px`,margin:`12px`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,color:`var(--text-primary)`,zIndex:1e3,pointerEvents:`auto`},children:[(0,J.jsx)(`div`,{style:{marginBottom:`16px`,color:`var(--interactive-fg)`},children:(0,J.jsxs)(`svg`,{width:`48`,height:`48`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,J.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,ry:`2`}),(0,J.jsx)(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`}),(0,J.jsx)(`polyline`,{points:`21 15 16 10 5 21`})]})}),(0,J.jsx)(`div`,{style:{fontSize:`1.25rem`,fontWeight:`bold`,letterSpacing:`0.5px`},children:`Drag files to attach data`}),(0,J.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,J.jsxs)(`div`,{className:`chat-header`,children:[xe&&(0,J.jsx)(`button`,{className:`mobile-menu-btn`,type:`button`,onClick:xe,"aria-label":`Open navigation menu`,children:(0,J.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,J.jsx)(`line`,{x1:`3`,y1:`12`,x2:`21`,y2:`12`}),(0,J.jsx)(`line`,{x1:`3`,y1:`6`,x2:`21`,y2:`6`}),(0,J.jsx)(`line`,{x1:`3`,y1:`18`,x2:`21`,y2:`18`})]})}),(0,J.jsx)(`div`,{className:`chat-header-title`,children:Se?(0,J.jsxs)(`div`,{className:`chat-header-breadcrumb`,children:[we&&(0,J.jsxs)(`button`,{type:`button`,className:`chat-header-back-btn`,onClick:we,title:`Back to Code sessions Hub`,children:[(0,J.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,J.jsx)(`path`,{d:`M15 18l-6-6 6-6`})}),(0,J.jsx)(`span`,{children:`Code`})]}),(0,J.jsx)(`span`,{className:`chat-header-sep`,children:`/`}),(0,J.jsx)(`span`,{className:`chat-header-session-tag`,title:Ce||`CLI Session`,children:(0,J.jsx)(`span`,{children:Ce?Ce===`cli`?`cli`:`cli::${Ce.replace(/^cli::/,``).slice(0,7)}`:`cli`})})]}):(0,J.jsxs)(`div`,{className:`chat-header-brand-group`,children:[(0,J.jsx)(`img`,{src:_.appIconPath(),alt:`Logo`,className:`chat-header-logo`}),(0,J.jsx)(`span`,{className:`chat-header-title-text`,title:Te&&Te.trim()&&Te!==`New chat`?Te.trim():`Mint Agent`,children:Te&&Te.trim()&&Te!==`New chat`?Te.trim():`Mint Agent`}),Ze&&(0,J.jsxs)(`span`,{className:`chat-header-project-pill`,title:`Project: ${E}`,children:[(0,J.jsx)(`svg`,{width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,J.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,J.jsx)(`span`,{children:Ze})]})]})}),(0,J.jsxs)(`div`,{className:`chat-header-actions`,children:[n?.onToggle&&(0,J.jsx)(Rw,{open:n.open,count:n.backgroundTaskCount,onToggle:n.onToggle}),mt&&(0,J.jsxs)(`button`,{type:`button`,className:`chat-header-pill-btn`,title:`Close Live Preview`,onClick:()=>ht(null),children:[(0,J.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,J.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,J.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]}),(0,J.jsx)(`span`,{children:`Close preview`})]}),(0,J.jsx)(`button`,{type:`button`,className:`chat-header-action-btn`,title:`Clear conversation`,onClick:ye,children:(0,J.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,J.jsx)(`polyline`,{points:`3 6 5 6 21 6`}),(0,J.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,J.jsx)(`line`,{x1:`10`,y1:`11`,x2:`10`,y2:`17`}),(0,J.jsx)(`line`,{x1:`14`,y1:`11`,x2:`14`,y2:`17`})]})})]})]}),(0,J.jsxs)(`div`,{className:`chat-container`,ref:Mt,onScroll:Ht,style:{overflowAnchor:`none`},children:[a&&o&&(0,J.jsx)(`button`,{type:`button`,className:`load-older-messages`,disabled:It,style:{display:`block`,margin:`0 auto 20px`,padding:`7px 14px`,borderRadius:8,border:`1px solid var(--border-color, #3a3a3a)`,background:`var(--surface, #252525)`,color:`var(--text-secondary, #c0c0c0)`,cursor:It?`default`:`pointer`},onClick:async()=>{Lt(!0);try{await o()}finally{Lt(!1)}},children:It?`Loading earlier messages…`:`Load earlier messages`}),(0,J.jsx)(BC,{ref:Nt,items:Be,scrollRef:Mt,hasOlder:a,renderRow:e=>{let t=Be[e];return(0,J.jsxs)(q.Fragment,{children:[e>0&&yt(Be[e-1].createdAt,t.createdAt)&&(0,J.jsxs)(`div`,{className:`system-event-divider`,children:[(0,J.jsx)(`div`,{className:`system-event-line`}),(0,J.jsxs)(`div`,{className:`system-event-pill`,children:[(0,J.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:[(0,J.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,J.jsx)(`polyline`,{points:`12 7 12 12 15.5 14`})]}),(0,J.jsx)(`span`,{children:zt(t.createdAt)})]}),(0,J.jsx)(`div`,{className:`system-event-line`})]}),(0,J.jsx)($S,{interaction:t,copiedId:At,onEditMessage:Kn,speakingText:Ot,agentActivitySnapshots:m,openActivityIds:ut,handleCopyMessage:an,speak:er,toggleActivity:St,chatId:D,customProviders:me?.customProviders,onOpenArtifact:Ct,onOpenReview:Tt,onRewindRequest:dr,onRewindError:fr})]},t.id)},tail:pr},D),Pt&&(0,J.jsx)(`button`,{type:`button`,className:`scroll-to-bottom-btn`,onClick:Wt,title:`Scroll to latest message`,"aria-label":`Scroll to latest message`,children:(0,J.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.4`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,J.jsx)(`path`,{d:`M12 5v14`}),(0,J.jsx)(`path`,{d:`M6 13l6 6 6-6`})]})}),(0,J.jsx)(`div`,{ref:k})]}),(0,J.jsxs)(`div`,{className:`input-area`,children:[(0,J.jsx)(Jw,{workspacePath:E,chatId:D,panelTarget:n?.modsPanelTarget,onOpen:n?.onOpenMods??(()=>{})}),(0,J.jsx)(tC,{progress:p,onOpenDetails:()=>St(`live`)}),Ve.length>0&&(0,J.jsxs)(`button`,{type:`button`,className:`composer-change-status ${s?`is-live`:``}`,onClick:()=>wt(Ge,Ve),title:`Review recent agent changes`,children:[(0,J.jsxs)(`span`,{className:`composer-change-status-copy`,children:[s&&(0,J.jsx)(`span`,{className:`composer-change-status-spinner`,"aria-hidden":`true`}),(0,J.jsx)(`span`,{children:s?`Editing ${Ve.length} ${Ve.length===1?`file`:`files`}…`:Ge})]}),(0,J.jsxs)(`span`,{className:`composer-change-status-counts`,"aria-label":`${Ue} additions and ${We} deletions`,children:[Ue>0&&(0,J.jsxs)(`strong`,{children:[`+`,Ue]}),We>0&&(0,J.jsxs)(`em`,{children:[`-`,We]})]})]}),ur&&(0,J.jsxs)(`div`,{className:`empty-chat-prompt-wrap`,children:[(0,J.jsx)(`div`,{className:`empty-chat-prompt`,children:`Mint Agent is ready to work`}),Ze&&(0,J.jsxs)(`div`,{className:`empty-chat-project-badge`,children:[(0,J.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,J.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,J.jsxs)(`span`,{children:[`Working in `,(0,J.jsx)(`strong`,{children:Ze})]})]})]}),de&&(0,J.jsxs)(`div`,{className:`project-context-row`,children:[(0,J.jsx)(s_,{currentPath:E||``,recentPaths:O,onSelectWorkspace:de}),E&&(0,J.jsx)(D_,{workspacePath:E,disabled:s,onBranchChanged:fe})]}),(0,J.jsxs)(`div`,{className:`smart-context-bar`,children:[(0,J.jsxs)(`label`,{className:`smart-context-option ${C?`is-active`:``}`,children:[(0,J.jsxs)(`span`,{className:`toggle-switch`,children:[(0,J.jsx)(`input`,{type:`checkbox`,checked:C,onChange:e=>ce(e.target.checked)}),(0,J.jsx)(`span`,{className:`slider round`})]}),(0,J.jsx)(`span`,{className:`smart-context-copy`,children:(0,J.jsx)(`span`,{className:`smart-context-title`,children:`Agent mode`})})]}),le&&(0,J.jsxs)(`label`,{className:`smart-context-option ${w?`is-active`:``}`,title:`Investigate read-only and require plan approval before editing files or running commands`,children:[(0,J.jsxs)(`span`,{className:`toggle-switch`,children:[(0,J.jsx)(`input`,{type:`checkbox`,checked:!!w,onChange:e=>le(e.target.checked)}),(0,J.jsx)(`span`,{className:`slider round`})]}),(0,J.jsx)(`span`,{className:`smart-context-copy`,children:(0,J.jsx)(`span`,{className:`smart-context-title`,children:`Plan mode`})})]})]}),je&&je.length>0&&(0,J.jsx)(eT,{queuedPrompts:je,queuePaused:!!Me,sending:s,onRemove:Ne||(()=>{}),onEdit:Pe||(()=>{}),onClear:Fe||(()=>{}),onSteer:Ie||(()=>{}),onResumeQueue:Le}),(0,J.jsxs)(`form`,{id:`chat-form`,className:An?`has-live-btn`:``,style:{position:`relative`},onSubmit:e=>{Hn(null),Un.current=``,ee(e)},onDragOver:e=>{e.dataTransfer.types.includes(`application/x-mint-workspace-path`)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`)},onDrop:lr,onPaste:e=>{ne(e.clipboardData)&&e.preventDefault()},children:[Ee&&(0,J.jsx)(ex,{choice:Ee,inputRef:Rn,onSelect:ke,onDismiss:Ae}),(y.length>0||b.length>0||x)&&(0,J.jsxs)(`div`,{className:`mint-attachment`,children:[y.map((e,t)=>(0,J.jsxs)(`div`,{className:`mint-image-attachment`,children:[(0,J.jsx)(`img`,{className:`mint-image-preview`,src:e.objectUrl||e.previewDataUri||e.dataUri,alt:e.name||`Image attachment`}),(0,J.jsx)(`button`,{className:`mint-attachment-remove`,type:`button`,onClick:()=>ie(t),"aria-label":`Remove image`,children:(0,J.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,J.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,J.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]},t)),b.map((e,t)=>(0,J.jsxs)(`div`,{className:`mint-image-attachment`,children:[(0,J.jsx)(`video`,{className:`mint-image-preview`,src:e.dataUri,muted:!0,playsInline:!0,preload:`metadata`}),(0,J.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,J.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`white`,stroke:`white`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,J.jsx)(`polygon`,{points:`5 3 19 12 5 21 5 3`})})}),(0,J.jsx)(`button`,{className:`mint-attachment-remove`,type:`button`,onClick:()=>ae(t),"aria-label":`Remove video`,children:(0,J.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,J.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,J.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]},t)),x&&(0,J.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`,minWidth:0},children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`,color:`var(--text-soft)`},children:(0,J.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,J.jsx)(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z`}),(0,J.jsx)(`polyline`,{points:`14 2 14 8 20 8`})]})}),(0,J.jsx)(`span`,{style:{fontSize:`0.76rem`,color:`var(--text-soft)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,maxWidth:`220px`},children:x}),(0,J.jsx)(`button`,{type:`button`,onClick:oe,style:{background:`transparent`,border:0,color:`var(--status-error)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`},children:(0,J.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,J.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,J.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]})]}),Vn!==null&&Bn.length>0&&(0,J.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 `,Vn+1,`/`,Bn.length]}),(0,J.jsx)(xb,{id:`chat-input`,inputRef:Rn,value:Re,onValueChange:e=>{N(e),Vn!==null&&Hn(null)},onResizeInput:tr,onChange:e=>{tr(e.currentTarget),N(e.target.value),Vn!==null&&Hn(null)},onKeyDown:Xn,onDrop:lr,placeholder:`Ask anything, @ to mention, / for actions`,rows:1}),(0,J.jsx)(mx,{ref:zn,message:Re,onComplete:Jn,workspacePath:E,mcpServers:me?.mcpServers,anchorRef:Rn,suppressed:Vn!==null||!!Ee}),(0,J.jsxs)(`div`,{className:`chat-tool-menu-wrap`,ref:on,children:[(0,J.jsx)(`button`,{id:`chat-tool-btn`,type:`button`,"aria-haspopup":`menu`,"aria-expanded":gt,onClick:()=>_t(e=>!e),style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`},children:(0,J.jsxs)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,J.jsx)(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),(0,J.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})]})}),gt&&(0,J.jsxs)(`div`,{className:`chat-tool-menu`,role:`menu`,children:[(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:nr,children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,children:(0,J.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,J.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,ry:`2`}),(0,J.jsx)(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`}),(0,J.jsx)(`polyline`,{points:`21 15 16 10 5 21`})]})}),(0,J.jsx)(`span`,{children:`Add image`})]}),(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:rr,children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,children:(0,J.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,J.jsx)(`polygon`,{points:`23 7 16 12 23 17 23 7`}),(0,J.jsx)(`rect`,{x:`1`,y:`5`,width:`15`,height:`14`,rx:`2`,ry:`2`})]})}),(0,J.jsx)(`span`,{children:`Add video`})]}),(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:ir,children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,children:(0,J.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,J.jsx)(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z`}),(0,J.jsx)(`polyline`,{points:`14 2 14 8 20 8`})]})}),(0,J.jsx)(`span`,{children:`Add file`})]}),(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:ar,children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,children:(0,J.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,J.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,J.jsx)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})]})}),(0,J.jsx)(`span`,{children:`Search web`})]}),(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:or,children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,children:(0,J.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,J.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,J.jsx)(`span`,{children:`Generate image`})]}),(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:sr,children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,children:(0,J.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,J.jsx)(`polygon`,{points:`23 7 16 12 23 17 23 7`}),(0,J.jsx)(`rect`,{x:`1`,y:`5`,width:`15`,height:`14`,rx:`2`,ry:`2`})]})}),(0,J.jsx)(`span`,{children:`Generate video`})]})]})]}),(0,J.jsx)(`input`,{id:`vision-file-input`,type:`file`,accept:`image/png,image/jpeg,image/webp,image/gif`,onChange:te,style:{display:`none`}}),(0,J.jsx)(`input`,{id:`video-file-input`,type:`file`,accept:`video/mp4,video/webm,video/quicktime,video/x-matroska`,onChange:j,style:{display:`none`}}),(0,J.jsx)(`input`,{id:`document-file-input`,type:`file`,accept:Ew,onChange:M,style:{display:`none`}}),(0,J.jsx)(`button`,{id:`screen-capture-btn`,type:`button`,onClick:P,"aria-label":`Capture screen`,children:(0,J.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,J.jsx)(`rect`,{x:`2`,y:`3`,width:`20`,height:`15`,rx:`2`}),(0,J.jsx)(`path`,{d:`M8 22h8M12 18v4M7 10h10M12 5v10`})]})}),(0,J.jsx)(Mw,{activeProvider:T?.activeProvider??``,activeModel:Ln,availableProviders:T?.availableProviders??[],settingsConfig:me,dynamicOllamaModels:vt,onSelect:(e,t)=>{_e?_e(e,t):(ue(e),ge(t))},onUpdateSettings:he}),(0,J.jsx)(qC,{id:`voice-input-btn`,className:`composer-voice-pill`,active:yn,disabled:s||Cn||jn.voiceMode,ariaLabel:`Voice input`,title:yn?`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:()=>($n(),Tn()),onStop:({reason:e})=>{$n(),e===`release`||e===`tap`||e===`key`?En():Dn()}}),An&&(0,J.jsx)(`button`,{id:`gemini-live-btn`,type:`button`,onClick:()=>jn.setVoiceMode(!0),title:`Start Gemini Live conversation`,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`},children:(0,J.jsxs)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,J.jsx)(`circle`,{cx:`12`,cy:`12`,r:`2`}),(0,J.jsx)(`path`,{d:`M8.5 8.5a5 5 0 0 0 0 7`}),(0,J.jsx)(`path`,{d:`M15.5 8.5a5 5 0 0 1 0 7`}),(0,J.jsx)(`path`,{d:`M5.5 5.5a9 9 0 0 0 0 13`}),(0,J.jsx)(`path`,{d:`M18.5 5.5a9 9 0 0 1 0 13`})]})}),s?(0,J.jsxs)(`div`,{style:{display:`inline-flex`,alignItems:`center`,gap:`6px`},children:[Mn&&(0,J.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,J.jsxs)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,J.jsx)(`line`,{x1:`22`,y1:`2`,x2:`11`,y2:`13`}),(0,J.jsx)(`polygon`,{points:`22 2 15 22 11 13 2 9 22 2`})]})}),(0,J.jsx)(`button`,{id:`send-btn`,className:`stop-btn`,type:`button`,onClick:ve,title:`Stop generating`,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`},children:(0,J.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,J.jsx)(`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,ry:`2`})})})]}):(0,J.jsx)(`button`,{id:`send-btn`,type:`submit`,disabled:!Mn,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`},children:(0,J.jsxs)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,J.jsx)(`line`,{x1:`22`,y1:`2`,x2:`11`,y2:`13`}),(0,J.jsx)(`polygon`,{points:`22 2 15 22 11 13 2 9 22 2`})]})})]}),bn&&!yn&&F&&(0,J.jsx)(`p`,{className:`composer-voice-feedback`,role:`status`,children:F})]}),jn.voiceMode&&(0,J.jsx)(_w,{status:jn.errorMessage?`error`:jn.isRecording?jn.isPaused?`paused`:jn.isSpeaking?`speaking`:jn.voiceAwaitingResponse?`thinking`:`listening`:`connecting`,userTranscript:jn.userTranscript,assistantTranscript:jn.assistantTranscript,isPaused:jn.isPaused,analyserRef:jn.analyserRef,onTogglePause:jn.togglePause,onEndCall:()=>jn.setVoiceMode(!1),voice:me?.geminiLiveVoice||`Puck`,voices:$e,onChangeVoice:async e=>{await be(e),jn.restart()}}),en.visible&&(0,J.jsxs)(`div`,{className:`rewind-toast-banner ${en.type===`error`?`is-error`:`is-success`}`,children:[(0,J.jsxs)(`div`,{className:`rewind-toast-content`,children:[en.type===`error`?(0,J.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--status-error, #ef4444)`,strokeWidth:`2`,children:[(0,J.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,J.jsx)(`line`,{x1:`12`,y1:`8`,x2:`12`,y2:`12`}),(0,J.jsx)(`line`,{x1:`12`,y1:`16`,x2:`12.01`,y2:`16`})]}):(0,J.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--accent)`,strokeWidth:`2.2`,children:[(0,J.jsx)(`path`,{d:`M22 11.08V12a10 10 0 1 1-5.93-9.14`}),(0,J.jsx)(`polyline`,{points:`22 4 12 14.01 9 11.01`})]}),(0,J.jsx)(`span`,{className:`rewind-toast-text`,children:en.message})]}),(0,J.jsxs)(`div`,{className:`rewind-toast-actions`,children:[en.canUndo&&(0,J.jsx)(`button`,{type:`button`,className:`rewind-toast-undo-btn`,onClick:rn,disabled:en.isUndoing,title:`Restore workspace files back from safety rescue snapshot`,children:en.isUndoing?`Undoing...`:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,children:[(0,J.jsx)(`polyline`,{points:`9 14 4 9 9 4`}),(0,J.jsx)(`path`,{d:`M20 20v-7a4 4 0 0 0-4-4H4`})]}),`Undo Rewind`]})}),(0,J.jsx)(`button`,{type:`button`,className:`rewind-toast-close-btn`,onClick:()=>tn(e=>({...e,visible:!1})),"aria-label":`Close notification`,children:`✕`})]})]})]});return(0,J.jsxs)(`div`,{ref:Yt,className:`chat-panel-split-wrapper ${mt||ft?`has-preview`:`no-preview`}`,style:{"--preview-width":`${(Gt*100).toFixed(2)}%`},children:[mr,(mt||ft)&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{className:`preview-split-resizer`,onMouseDown:Xt,onDoubleClick:Zt,title:`Drag to resize · Double-click to reset 50/50`,children:(0,J.jsx)(`div`,{className:`preview-split-resizer-grip`})}),(0,J.jsx)(q.Suspense,{fallback:null,children:ft?(0,J.jsx)(dT,{title:ft.title,changes:ft.changes,workspacePath:E,onBack:()=>pt(null)}):mt?(0,J.jsx)(lT,{artifact:mt,onClose:()=>ht(null),workspacePath:E}):null})]}),Qt.isOpen&&(0,J.jsx)(q.Suspense,{fallback:null,children:(0,J.jsx)(uT,{isOpen:Qt.isOpen,onClose:()=>$t(e=>({...e,isOpen:!1})),onConfirm:nn,checkpoints:Qt.checkpoints,targetCheckpoint:Qt.targetCheckpoint,changes:Qt.changes,workspacePath:E,isLoading:Qt.isLoading})})]})}var q,J,lT,uT,dT,fT,pT,mT,hT,gT,_T,vT,yT,bT,xT,ST=t((()=>{tb(),sb(),gb(),wb(),Ob(),Ab(),q=e(i()),$y(),Mb(),Ze(),nt(),Yb(),Qb(),rx(),hx(),Mx(),Qg(),Lx(),eC(),XS(),sS(),vS(),iC(),VC(),pt(),GC(),lw(),hw(),Cw(),Dw(),Iw(),k_(),d_(),Bw(),Qw(),nT(),rT(),$b(),ke(),J=a(),Te(),lT=(0,q.lazy)(()=>De(()=>import(`./ArtifactPreviewPanel-S0dPfYFx.js`).then(e=>({default:e.ArtifactPreviewPanel})),__vite__mapDeps([13,1,2,3,4,14]))),uT=(0,q.lazy)(()=>De(()=>import(`./RewindModal-DempuDod.js`).then(e=>({default:e.RewindModal})),__vite__mapDeps([15,1,2,16,3,4,17,18,19]))),dT=(0,q.lazy)(()=>De(()=>import(`./CodeReviewPage-VCUgPla_.js`),__vite__mapDeps([20,1,2,3,4,16,17,18,19,21]))),fT=120,{speechRequest:pT,startGeminiLiveSession:mT,sendGeminiLiveAudioChunk:hT,stopGeminiLiveSession:gT,listGitCheckpoints:_T,rollbackGitCheckpoint:vT,undoGitCheckpoint:yT}=Ae,{fetchProviderModels:bT}=M,xT=()=>()=>{}})),CT=t((()=>{}));function wT(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 TT(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 ET({onClose:e,onAttach:t,capture:n,onLiveTranslate:r}){let[i,a]=(0,DT.useState)(``),[o,s]=(0,DT.useState)(!1),[c,l]=(0,DT.useState)(null),[u,d]=(0,DT.useState)(``),[f,p]=(0,DT.useState)(!1),[m,h]=(0,DT.useState)(`region`),[g,_]=(0,DT.useState)(!1),v=(0,DT.useRef)(null),y=(0,DT.useRef)(null),b=(0,DT.useRef)(null),x=(0,DT.useRef)(null);(0,DT.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=wT(e,e.currentTarget);v.current=t,l(null),e.currentTarget.setPointerCapture(e.pointerId)},w=e=>{v.current&&l(TT(v.current,wT(e,e.currentTarget)))},T=e=>{if(!v.current)return;let t=TT(v.current,wT(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,OT.jsx)(`div`,{ref:b,className:`screen-capture-dialog ${f?`is-capturing`:``}`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`screen-capture-title`,children:(0,OT.jsxs)(`div`,{className:`screen-capture-panel`,children:[(0,OT.jsxs)(`header`,{className:`screen-capture-header`,children:[(0,OT.jsxs)(`div`,{children:[(0,OT.jsx)(`p`,{className:`screen-capture-eyebrow`,children:`Mint Agent · Screen capture`}),(0,OT.jsx)(`h2`,{id:`screen-capture-title`,children:`Choose what Mint can see`}),(0,OT.jsx)(`p`,{children:`Only the image you attach will be included in your message.`})]}),(0,OT.jsx)(`button`,{ref:x,type:`button`,className:`screen-capture-close`,onClick:e,"aria-label":`Close screen capture`,children:`×`})]}),(0,OT.jsx)(`div`,{className:`screen-capture-body`,children:i?(0,OT.jsx)(`div`,{className:`screen-capture-stage`,children:(0,OT.jsxs)(`div`,{className:`screen-capture-image-wrap ${m===`region`?`is-selecting`:``}`,onPointerDown:C,onPointerMove:w,onPointerUp:T,onPointerCancel:T,children:[(0,OT.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,OT.jsx)(`div`,{className:`screen-capture-selection`,style:{left:`${c.x*100}%`,top:`${c.y*100}%`,width:`${c.width*100}%`,height:`${c.height*100}%`}})]})}):(0,OT.jsxs)(`div`,{className:`screen-capture-empty`,children:[(0,OT.jsx)(`span`,{className:`screen-capture-empty-icon`,"aria-hidden":`true`,children:`▣`}),(0,OT.jsx)(`h3`,{children:f?`Waiting for your screen…`:`Capture your screen`}),(0,OT.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,OT.jsx)(`button`,{type:`button`,className:`screen-capture-primary`,onClick:S,children:`Capture screen`})]})}),u&&(0,OT.jsx)(`p`,{className:`screen-capture-error`,role:`alert`,children:u}),(0,OT.jsxs)(`footer`,{className:`screen-capture-footer`,children:[(0,OT.jsxs)(`div`,{className:`screen-capture-modes`,role:`group`,"aria-label":`Capture area`,children:[(0,OT.jsx)(`button`,{type:`button`,className:m===`region`?`active`:``,onClick:()=>h(`region`),"aria-pressed":m===`region`,children:`Select area`}),(0,OT.jsx)(`button`,{type:`button`,className:m===`full`?`active`:``,onClick:()=>h(`full`),"aria-pressed":m===`full`,children:`Full screen`})]}),(0,OT.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,OT.jsxs)(`div`,{className:`screen-capture-actions`,children:[r&&(0,OT.jsx)(`button`,{type:`button`,className:`screen-capture-secondary`,onClick:r,children:`Live translate`}),i&&(0,OT.jsx)(`button`,{type:`button`,className:`screen-capture-secondary`,onClick:S,disabled:f||g,children:`Retake`}),(0,OT.jsx)(`button`,{type:`button`,className:`screen-capture-secondary`,onClick:e,children:`Cancel`}),(0,OT.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 DT,OT,kT=t((()=>{DT=e(i()),CT(),OT=a()}));function AT({view:e,sidebarCollapsed:t,sending:n,chatSessions:r,activeConversationId:i,onToggleSidebar:a,onSidebarResize:o,onSidebarResizeEnd:c,onClearHistory:l,onSelectConversation:u,onDeleteConversation:d,onRenameConversation:f,onSetView:p,isSearchOpen:m,onSetSearchOpen:h,showWorkspaceTab:g,promoteMediaStudios:v,activeWorkspacePath:y,recentWorkspacePaths:x,onBrowseFolder:C,onUpdateSessionWorkspace:T,onNewChatInProject:E}){let[D,O]=(0,jT.useState)(null),[k,A]=(0,jT.useState)(``),[j,M]=(0,jT.useState)(!1),[ne,N]=(0,jT.useState)(!1),[ie,ae]=(0,jT.useState)(null),[oe,se]=(0,jT.useState)(null),[P,ce]=(0,jT.useState)(()=>{if(typeof window>`u`)return[];try{return JSON.parse(window.localStorage.getItem(`mint_removed_sidebar_projects`)||`[]`)}catch{return[]}}),[le,ue]=(0,jT.useState)(null),fe=(0,jT.useRef)(null),pe=(0,jT.useRef)(null),me=(0,jT.useRef)(null),he=(0,jT.useRef)(null),{user:ge,avatarUrl:_e,logout:ve}=de(),[ye,be]=(0,jT.useState)(!1),xe=(0,jT.useRef)(null);(0,jT.useEffect)(()=>{if(!ye)return;let e=e=>{let t=xe.current;t&&(t.lastWidth=t.startWidth+(e.clientX-t.startX),t.frame??=requestAnimationFrame(()=>{xe.current&&(xe.current.frame=null,o?.(xe.current.lastWidth))}))},t=()=>{let e=xe.current;e?.frame!=null&&cancelAnimationFrame(e.frame),be(!1),document.body.style.cursor=``,document.body.style.userSelect=``,e&&c?.(e.lastWidth),xe.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)}},[ye,o,c]);let Se=e=>{if(t)return;e.preventDefault();let n=he.current?.getBoundingClientRect().width??264;xe.current={startX:e.clientX,startWidth:n,lastWidth:n,frame:null},be(!0)};(0,jT.useEffect)(()=>{function e(e){pe.current&&!pe.current.contains(e.target)&&M(!1),me.current&&!me.current.contains(e.target)&&N(!1),fe.current&&!fe.current.contains(e.target)&&ue(null),e.target.closest(`.sidebar-project-menu-popover, .sidebar-project-menu-trigger`)||ae(null),e.target.closest(`.sidebar-conversation-menu-popover, .sidebar-conversation-menu-trigger`)||se(null)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]);let Ce=e=>{k.trim()&&k.trim()!==r.find(t=>t.id===e)?.title&&f?.(e,k.trim()),O(null)},we=r.filter(e=>e.kind!==`cli`&&!e.id.startsWith(`cli`)&&e.id!==`conversation-default`),Te=r.filter(e=>e.kind===`cli`||e.id.startsWith(`cli`)),[Ee,De]=(0,jT.useState)(()=>{if(typeof window>`u`)return[];try{let e=localStorage.getItem(`mint_project_order`);return e?JSON.parse(e):[]}catch{return[]}}),[Oe,ke]=(0,jT.useState)(null),[Ae,je]=(0,jT.useState)(null),[Me,Ne]=(0,jT.useState)(null),Fe=(e,t)=>{e.dataTransfer.setData(`text/plain`,t),e.dataTransfer.effectAllowed=`move`,ke(t)},Ie=(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))},Le=(e,t)=>{if(e.stopPropagation(),Ae===t){let t=e.relatedTarget;t&&e.currentTarget.contains(t)||(je(null),Ne(null))}},Re=(e,t)=>{if(e.preventDefault(),e.stopPropagation(),!Oe||Oe===t){ke(null),je(null),Ne(null);return}let n=Ve.map(e=>e.id),r=[...Ee];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);De(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:Ve,recentSessions:He}=(0,jT.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(y);r&&!P.includes(r.id)&&t.set(r.id,{id:r.id,name:r.name,sessions:[]});for(let r of we){let i=e(r.workspacePath||null);if(i){if(P.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=Ee.indexOf(e.id),r=Ee.indexOf(t.id);return n!==-1&&r!==-1?n-r:n===-1?r===-1?e.name.localeCompare(t.name):1:-1}),recentSessions:n}},[we,y,i,Ee,P]),Ue=(0,jT.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(y&&!P.includes(y.replace(/[\\/]+$/,``).trim())){let n=e(y);n&&t.set(n.id,n.name)}for(let e of Ve)P.includes(e.id)||t.set(e.id,e.name);if(x)for(let n of x){let r=e(n);r&&!P.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}))},[Ve,y,x,P]),We=(e,t)=>{if(e.stopPropagation(),e.preventDefault(),le?.sessionId===t.id){ue(null);return}let n=e.currentTarget.getBoundingClientRect(),r=Math.min(n.left,Math.max(10,window.innerWidth-220-10)),a=n.bottom+6;ue({sessionId:t.id,currentWorkspacePath:t.workspacePath||(t.id===i&&y?y:null),top:a,left:r})},[Ge,Ke]=(0,jT.useState)(()=>{if(typeof window>`u`)return{};try{let e=localStorage.getItem(`mint_collapsed_projects`);return e?JSON.parse(e):{}}catch{return{}}}),[qe,Je]=(0,jT.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=>{ce(t=>{let n=[...new Set([...t,e])];try{localStorage.setItem(`mint_removed_sidebar_projects`,JSON.stringify(n))}catch{}return n}),ae(null)},[Qe,$e]=(0,jT.useState)(()=>typeof window<`u`?localStorage.getItem(`mint_last_cli_session_id`):null);(0,jT.useEffect)(()=>{if(i.startsWith(`cli`)||i===`cli`){$e(i);try{localStorage.setItem(`mint_last_cli_session_id`,i)}catch{}}},[i]);let tt=i.startsWith(`cli`)||i===`cli`?i:Qe||Te[0]?.id||null,nt=Te.find(e=>e.id===tt);return(0,Y.jsxs)(`aside`,{className:`workspace-sidebar ${ye?`is-resizing`:``}`,ref:he,children:[!t&&(0,Y.jsx)(`div`,{className:`sidebar-resize-handle ${ye?`is-active`:``}`,onMouseDown:Se,title:`Drag to resize sidebar`}),(0,Y.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,Y.jsx)(`img`,{src:_.appIconPath(),alt:`Mint Agent Logo`,className:`sidebar-logo`}),(0,Y.jsx)(`span`,{className:`sidebar-brand-name`,children:`Mint Agent`})]}),(0,Y.jsx)(`button`,{type:`button`,className:`sidebar-mobile-close`,"aria-label":`Close navigation menu`,onClick:a,children:(0,Y.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,Y.jsx)(`path`,{d:`M5 5l14 14M19 5L5 19`})})}),(0,Y.jsxs)(`button`,{className:`sidebar-new-chat`,onClick:()=>l(`New chat`),title:`New chat (Ctrl+N)`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},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.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`})]})}),(0,Y.jsx)(`span`,{children:`New chat`})]}),(0,Y.jsxs)(`button`,{className:`sidebar-top-action sidebar-search-btn`,onClick:()=>h(!0),title:`Search chats (Ctrl+K)`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},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.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 chats`})]}),(0,Y.jsxs)(`button`,{className:`sidebar-top-action ${e===`chat`?`is-active`:``}`,onClick:()=>p(`chat`),title:`Chat`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:(0,Y.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,Y.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,Y.jsx)(`span`,{children:`Chat`})]}),(0,Y.jsxs)(`button`,{className:`sidebar-top-action ${e===`pictures`?`is-active`:``}`,onClick:()=>p(`pictures`),title:`Library`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:(0,Y.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,Y.jsx)(`path`,{d:`M4 4v16M8 8v12M12 6v14M16 6l4 14`})})}),(0,Y.jsx)(`span`,{children:`Library`})]}),v&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`button`,{className:`sidebar-top-action ${e===`imagine`?`is-active`:``}`,onClick:()=>p(`imagine`),children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:(0,Y.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,Y.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,Y.jsx)(`span`,{children:`Image Studio`})]}),(0,Y.jsxs)(`button`,{className:`sidebar-top-action ${e===`veo`?`is-active`:``}`,onClick:()=>p(`veo`),children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},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.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Y.jsx)(`rect`,{x:`2`,y:`2`,width:`20`,height:`20`,rx:`2.18`,ry:`2.18`}),(0,Y.jsx)(`line`,{x1:`7`,y1:`2`,x2:`7`,y2:`22`}),(0,Y.jsx)(`line`,{x1:`17`,y1:`2`,x2:`17`,y2:`22`}),(0,Y.jsx)(`line`,{x1:`2`,y1:`12`,x2:`22`,y2:`12`}),(0,Y.jsx)(`line`,{x1:`2`,y1:`7`,x2:`7`,y2:`7`}),(0,Y.jsx)(`line`,{x1:`2`,y1:`17`,x2:`7`,y2:`17`}),(0,Y.jsx)(`line`,{x1:`17`,y1:`17`,x2:`22`,y2:`17`}),(0,Y.jsx)(`line`,{x1:`17`,y1:`7`,x2:`22`,y2:`7`})]})}),(0,Y.jsx)(`span`,{children:`Veo Studio`})]})]}),g&&(0,Y.jsxs)(`button`,{className:`sidebar-top-action ${e===`workspace`?`is-active`:``}`,onClick:()=>p(`workspace`),title:`Workspace`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},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.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Y.jsx)(`path`,{d:`M3 6h7l2 2h9v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z`}),(0,Y.jsx)(`path`,{d:`M3 6v12`})]})}),(0,Y.jsx)(`span`,{children:`Workspace`})]}),(0,Y.jsxs)(`div`,{className:`sidebar-more-container`,ref:pe,children:[(0,Y.jsxs)(`button`,{className:`sidebar-top-action ${j||!v&&(e===`imagine`||e===`veo`)||e===`skills`||e===`mcp`||e===`plugins`||e===`cron`||e===`link`?`is-active`:``}`,onClick:()=>M(!j),title:`More`,"aria-expanded":j,"aria-controls":`sidebar-more-menu`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},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.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Y.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.5`}),(0,Y.jsx)(`circle`,{cx:`19`,cy:`12`,r:`1.5`}),(0,Y.jsx)(`circle`,{cx:`5`,cy:`12`,r:`1.5`})]})}),(0,Y.jsx)(`span`,{children:`More`})]}),j&&(0,Y.jsxs)(`div`,{id:`sidebar-more-menu`,className:`sidebar-more-popover`,style:{display:`flex`,flexDirection:`column`,gap:`4px`,padding:`6px`,minWidth:`160px`},children:[(0,Y.jsxs)(`button`,{className:`popover-item ${e===`skills`?`active`:``}`,onClick:()=>{p(`skills`),M(!1)},children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:bt(15)}),(0,Y.jsx)(`span`,{children:`Skills`})]}),(0,Y.jsxs)(`button`,{className:`popover-item ${e===`mcp`?`active`:``}`,onClick:()=>{p(`mcp`),M(!1)},children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:Be(15)}),(0,Y.jsx)(`span`,{children:`MCP servers`})]}),(0,Y.jsxs)(`button`,{className:`popover-item ${e===`plugins`?`active`:``}`,onClick:()=>{p(`plugins`),M(!1)},children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:Lt(15)}),(0,Y.jsx)(`span`,{children:`Plugins`})]}),(0,Y.jsxs)(`button`,{className:`popover-item ${e===`cron`?`active`:``}`,onClick:()=>{p(`cron`),M(!1)},children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:Dt(15)}),(0,Y.jsx)(`span`,{children:`Scheduled tasks`})]}),(0,Y.jsxs)(`button`,{className:`popover-item ${e===`link`?`active`:``}`,onClick:()=>{p(`link`),M(!1)},children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:et(15)}),(0,Y.jsx)(`span`,{children:`Linked folders`})]}),!v&&(0,Y.jsxs)(`button`,{className:`popover-item ${e===`imagine`?`active`:``}`,onClick:()=>{p(`imagine`),M(!1)},children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:(0,Y.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,Y.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,Y.jsx)(`span`,{children:`Image Studio`})]}),!v&&(0,Y.jsxs)(`button`,{className:`popover-item ${e===`veo`?`active`:``}`,onClick:()=>{p(`veo`),M(!1)},children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},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.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:`Veo Studio`})]})]})]}),t?(0,Y.jsxs)(`div`,{className:`sidebar-collapsed-sessions`,children:[(0,Y.jsxs)(`button`,{type:`button`,className:`sidebar-collapsed-item ${e===`code`?`is-active`:``}`,onClick:()=>p(`code`),title:`Code sessions Hub`,"aria-label":`Code sessions Hub`,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.4`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,Y.jsx)(`polyline`,{points:`4 17 10 11 4 5`}),(0,Y.jsx)(`line`,{x1:`12`,y1:`19`,x2:`20`,y2:`19`})]}),e===`code`&&(0,Y.jsx)(`span`,{className:`sidebar-collapsed-dot`})]}),nt&&(0,Y.jsxs)(`button`,{type:`button`,className:`sidebar-collapsed-item ${nt.id===i&&e!==`code`?`is-active`:``}`,onClick:()=>u(nt.id),title:nt.title&&nt.title!==`cli`?nt.title:`Terminal Session`,"aria-label":nt.title&&nt.title!==`cli`?nt.title:`Terminal Session`,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.4`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,Y.jsx)(`polyline`,{points:`4 17 10 11 4 5`}),(0,Y.jsx)(`line`,{x1:`12`,y1:`19`,x2:`20`,y2:`19`})]}),nt.id===i&&e!==`code`&&(0,Y.jsx)(`span`,{className:`sidebar-collapsed-dot`})]}),we.slice(0,25).map(t=>{let n=t.id===i&&e!==`code`;return(0,Y.jsxs)(`button`,{type:`button`,className:`sidebar-collapsed-item ${n?`is-active`:``}`,onClick:()=>u(t.id),title:t.title||`Chat`,"aria-label":t.title||`Chat`,children:[(0,Y.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,Y.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,Y.jsx)(`span`,{className:`sidebar-collapsed-dot`})]},t.id)})]}):(0,Y.jsxs)(`div`,{className:`sidebar-section`,children:[(0,Y.jsx)(`div`,{className:`sidebar-section-title`,children:`Code`}),(0,Y.jsxs)(`div`,{className:`sidebar-chat-list sidebar-cli-list`,children:[(0,Y.jsxs)(`button`,{className:`sidebar-project sidebar-chat-item ${e===`code`?`active`:``}`,onClick:()=>p(`code`),title:`Code sessions Hub`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},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.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Y.jsx)(`polyline`,{points:`4 17 10 11 4 5`}),(0,Y.jsx)(`line`,{x1:`12`,y1:`19`,x2:`20`,y2:`19`})]})}),(0,Y.jsx)(`span`,{className:`sidebar-chat-title`,children:`Code hub`}),(0,Y.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:Te.length})]}),nt&&(0,Y.jsxs)(`button`,{className:`sidebar-project sidebar-chat-item ${nt.id===i?`active`:``}`,onClick:()=>u(nt.id),title:nt.title||`Terminal Session`,style:{paddingLeft:`16px`},children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`,opacity:.85},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.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Y.jsx)(`path`,{d:`M4 17l6-6-6-6`}),(0,Y.jsx)(`path`,{d:`M12 19h8`})]})}),(0,Y.jsx)(`span`,{className:`sidebar-chat-title`,children:nt.title&&nt.title!==`cli`?nt.title:nt.id===`cli`?`Terminal Session`:`cli::${nt.id.replace(/^cli::/,``).slice(0,7)}`}),nt.id===i&&n&&(0,Y.jsx)(`span`,{className:`sidebar-generating-text`,children:`Thinking...`})]})]}),Ve.length>0&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`sidebar-section-title sidebar-subsection-title`,children:`Projects`}),(0,Y.jsx)(`div`,{className:`sidebar-projects-list`,children:Ve.map(e=>{let t=!!Ge[e.id],r=!!qe[e.id],a=e.sessions.length>3,o=r||!a?e.sessions:e.sessions.slice(0,3),c=Oe===e.id,l=Ae===e.id;return(0,Y.jsxs)(`div`,{className:`sidebar-project-group ${c?`is-dragging`:``} ${l?Me===`before`?`drop-before`:`drop-after`:``}`,onDragOver:t=>Ie(t,e.id),onDragLeave:t=>Le(t,e.id),onDrop:t=>Re(t,e.id),children:[(0,Y.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=>Fe(t,e.id),onDragEnd:ze,children:[(0,Y.jsxs)(`span`,{className:`sidebar-project-group-left`,children:[(0,Y.jsx)(`span`,{className:`sidebar-project-drag-grip`,title:`Drag to reorder`,"aria-hidden":`true`,children:(0,Y.jsxs)(`svg`,{width:`8`,height:`12`,viewBox:`0 0 8 12`,fill:`currentColor`,children:[(0,Y.jsx)(`circle`,{cx:`2`,cy:`2`,r:`1.2`}),(0,Y.jsx)(`circle`,{cx:`6`,cy:`2`,r:`1.2`}),(0,Y.jsx)(`circle`,{cx:`2`,cy:`6`,r:`1.2`}),(0,Y.jsx)(`circle`,{cx:`6`,cy:`6`,r:`1.2`}),(0,Y.jsx)(`circle`,{cx:`2`,cy:`10`,r:`1.2`}),(0,Y.jsx)(`circle`,{cx:`6`,cy:`10`,r:`1.2`})]})}),(0,Y.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,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)(Y.Fragment,{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)(`polygon`,{points:`3 20 6 10 23 10 20 20 3 20`,fill:`currentColor`,fillOpacity:`0.15`})]})}),(0,Y.jsx)(`span`,{className:`sidebar-project-group-name`,children:e.name})]}),(0,Y.jsxs)(`span`,{className:`sidebar-project-group-right`,children:[(0,Y.jsx)(`button`,{type:`button`,className:`sidebar-project-menu-trigger`,"aria-label":`Project actions for ${e.name}`,"aria-haspopup":`menu`,"aria-expanded":ie?.projectId===e.id,onClick:t=>{t.stopPropagation();let n=t.currentTarget.getBoundingClientRect();ae(ie?.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,Y.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:[(0,Y.jsx)(`circle`,{cx:`5`,cy:`12`,r:`1.8`}),(0,Y.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.8`}),(0,Y.jsx)(`circle`,{cx:`19`,cy:`12`,r:`1.8`})]})}),(0,Y.jsx)(`span`,{className:`sidebar-project-group-count`,children:e.sessions.length}),(0,Y.jsx)(`span`,{className:`sidebar-project-group-chevron`,style:{transform:t?`rotate(-90deg)`:`rotate(0deg)`,transition:`transform 0.18s ease`},children:(0,Y.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,Y.jsx)(`polyline`,{points:`6 9 12 15 18 9`})})})]})]}),ie?.projectId===e.id&&(0,Y.jsxs)(`div`,{className:`sidebar-project-menu-popover`,role:`menu`,style:{top:ie.top,left:ie.left},onClick:e=>e.stopPropagation(),children:[E&&(0,Y.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{Ke(t=>({...t,[e.id]:!1})),E(e.id),ae(null)},children:[(0,Y.jsx)(w,{className:`sidebar-menu-icon`,size:14,"aria-hidden":`true`}),(0,Y.jsx)(`span`,{children:`New chat in project`})]}),(0,Y.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`is-destructive`,onClick:()=>Ze(e.id),children:[(0,Y.jsx)(re,{className:`sidebar-menu-icon`,size:14,"aria-hidden":`true`}),(0,Y.jsx)(`span`,{children:`Remove from sidebar`})]})]}),!t&&(0,Y.jsxs)(`div`,{className:`sidebar-project-sessions`,children:[o.map(e=>(0,Y.jsxs)(`button`,{className:`sidebar-project sidebar-chat-item is-indented ${e.id===i?`active`:``}`,onClick:()=>u(e.id),title:e.title,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:(0,Y.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,Y.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===e.id?(0,Y.jsx)(`input`,{type:`text`,className:`sidebar-chat-rename-input`,value:k,onChange:e=>A(e.target.value),onBlur:()=>Ce(e.id),onKeyDown:t=>{t.key===`Enter`?Ce(e.id):t.key===`Escape`&&O(null)},autoFocus:!0,onClick:e=>e.stopPropagation()}):(0,Y.jsx)(`span`,{className:`sidebar-chat-title`,children:e.title||`New chat`}),e.id===i&&n&&(0,Y.jsx)(`span`,{className:`sidebar-generating-text`,children:`Thinking...`}),D!==e.id&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.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();se({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();se({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,Y.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:[(0,Y.jsx)(`circle`,{cx:`5`,cy:`12`,r:`1.8`}),(0,Y.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.8`}),(0,Y.jsx)(`circle`,{cx:`19`,cy:`12`,r:`1.8`})]})}),(0,Y.jsx)(`span`,{className:`sidebar-chat-edit`,role:`button`,tabIndex:0,title:`Rename conversation`,onClick:t=>{t.stopPropagation(),O(e.id),A(e.title||``)},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),t.stopPropagation(),O(e.id),A(e.title||``))},children:(0,Y.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,Y.jsx)(`path`,{d:`M12 20h9`}),(0,Y.jsx)(`path`,{d:`M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z`})]})}),T&&(0,Y.jsx)(`span`,{className:`sidebar-chat-edit`,role:`button`,tabIndex:0,title:`Move conversation...`,onClick:t=>We(t,e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),We(t,e))},children:(0,Y.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,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)(`polyline`,{points:`12 11 12 17`}),(0,Y.jsx)(`polyline`,{points:`9 14 12 11 15 14`})]})}),(0,Y.jsx)(`span`,{className:`sidebar-chat-delete`,role:`button`,tabIndex:0,title:`Delete conversation`,onClick:t=>{t.stopPropagation(),d(e.id)},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),t.stopPropagation(),d(e.id))},children:(0,Y.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,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-2V6`}),(0,Y.jsx)(`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})]})})]})]},e.id)),a&&(0,Y.jsxs)(`button`,{type:`button`,className:`sidebar-show-more-btn`,onClick:()=>Xe(e.id),children:[(0,Y.jsx)(`span`,{children:r?`Show less`:`Show more (${e.sessions.length-3})`}),(0,Y.jsx)(s,{className:r?`is-expanded`:``,size:13,"aria-hidden":`true`})]})]})]},e.id)})})]}),(He.length>0||Ve.length===0)&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`sidebar-section-title sidebar-subsection-title`,children:Ve.length>0?`Recents`:`Conversations`}),(0,Y.jsx)(`div`,{className:`sidebar-chat-list`,children:He.map(e=>(0,Y.jsxs)(`button`,{className:`sidebar-project sidebar-chat-item ${e.id===i?`active`:``}`,onClick:()=>u(e.id),title:e.title,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:(0,Y.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,Y.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===e.id?(0,Y.jsx)(`input`,{type:`text`,className:`sidebar-chat-rename-input`,value:k,onChange:e=>A(e.target.value),onBlur:()=>Ce(e.id),onKeyDown:t=>{t.key===`Enter`?Ce(e.id):t.key===`Escape`&&O(null)},autoFocus:!0,onClick:e=>e.stopPropagation()}):(0,Y.jsx)(`span`,{className:`sidebar-chat-title`,children:e.title||`New chat`}),e.id===i&&n&&(0,Y.jsx)(`span`,{className:`sidebar-generating-text`,children:`Thinking...`}),D!==e.id&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.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();se({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();se({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,Y.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:[(0,Y.jsx)(`circle`,{cx:`5`,cy:`12`,r:`1.8`}),(0,Y.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.8`}),(0,Y.jsx)(`circle`,{cx:`19`,cy:`12`,r:`1.8`})]})}),(0,Y.jsx)(`span`,{className:`sidebar-chat-edit`,role:`button`,tabIndex:0,title:`Rename conversation`,onClick:t=>{t.stopPropagation(),O(e.id),A(e.title||``)},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),t.stopPropagation(),O(e.id),A(e.title||``))},children:(0,Y.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,Y.jsx)(`path`,{d:`M12 20h9`}),(0,Y.jsx)(`path`,{d:`M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z`})]})}),T&&(0,Y.jsx)(`span`,{className:`sidebar-chat-edit`,role:`button`,tabIndex:0,title:`Move conversation...`,onClick:t=>We(t,e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),We(t,e))},children:(0,Y.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,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)(`polyline`,{points:`12 11 12 17`}),(0,Y.jsx)(`polyline`,{points:`9 14 12 11 15 14`})]})}),(0,Y.jsx)(`span`,{className:`sidebar-chat-delete`,role:`button`,tabIndex:0,title:`Delete conversation`,onClick:t=>{t.stopPropagation(),d(e.id)},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),t.stopPropagation(),d(e.id))},children:(0,Y.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,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-2V6`}),(0,Y.jsx)(`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})]})})]})]},e.id))})]})]}),ge&&(0,Y.jsxs)(`div`,{className:`sidebar-account-container`,ref:me,children:[ne&&(0,Y.jsxs)(`div`,{className:`sidebar-account-menu`,children:[ge.email&&(0,Y.jsx)(`div`,{className:`sidebar-account-menu-header`,children:ge.email}),(0,Y.jsxs)(`button`,{className:`popover-item`,onClick:()=>{window.api.openSettings(),N(!1)},children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:(0,Y.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,Y.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,Y.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,Y.jsx)(`span`,{children:`Settings`})]}),(0,Y.jsxs)(`button`,{className:`popover-item ${e===`skills`?`active`:``}`,onClick:()=>{p(`skills`),N(!1)},children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:bt(15)}),(0,Y.jsx)(`span`,{children:`Skills`})]}),(0,Y.jsxs)(`button`,{className:`popover-item ${e===`mcp`?`active`:``}`,onClick:()=>{p(`mcp`),N(!1)},children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:Be(15)}),(0,Y.jsx)(`span`,{children:`MCP servers`})]}),(0,Y.jsxs)(`button`,{className:`popover-item ${e===`plugins`?`active`:``}`,onClick:()=>{p(`plugins`),N(!1)},children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:Lt(15)}),(0,Y.jsx)(`span`,{children:`Plugins`})]}),(0,Y.jsxs)(`button`,{className:`popover-item ${e===`cron`?`active`:``}`,onClick:()=>{p(`cron`),N(!1)},children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:Dt(15)}),(0,Y.jsx)(`span`,{children:`Scheduled tasks`})]}),(0,Y.jsxs)(`button`,{className:`popover-item ${e===`link`?`active`:``}`,onClick:()=>{p(`link`),N(!1)},children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:et(15)}),(0,Y.jsx)(`span`,{children:`Linked folders`})]}),(0,Y.jsx)(`div`,{className:`sidebar-account-menu-divider`}),(0,Y.jsxs)(`button`,{className:`popover-item`,onClick:()=>{N(!1),ve()},children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`},children:(0,Y.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,Y.jsx)(`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`}),(0,Y.jsx)(`polyline`,{points:`16 17 21 12 16 7`}),(0,Y.jsx)(`line`,{x1:`21`,y1:`12`,x2:`9`,y2:`12`})]})}),(0,Y.jsx)(`span`,{children:`Log out`})]})]}),(0,Y.jsxs)(`button`,{className:`sidebar-account`,onClick:()=>N(e=>!e),children:[(0,Y.jsx)(`div`,{className:`sidebar-account-avatar`,children:_e?(0,Y.jsx)(`img`,{src:_e,alt:ge.name||`User`}):(ge.name?.[0]||ge.email?.[0]||`U`).toUpperCase()}),(0,Y.jsx)(`div`,{className:`sidebar-account-info`,children:(0,Y.jsx)(`span`,{className:`sidebar-account-name`,children:ge.name||ge.email})}),(0,Y.jsx)(`span`,{className:`sidebar-account-chevron`,"aria-hidden":`true`,children:(0,Y.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,Y.jsx)(`polyline`,{points:`18 15 12 9 6 15`})})})]})]}),le&&(0,Y.jsxs)(`div`,{ref:fe,className:`sidebar-move-popover`,style:{position:`fixed`,top:`${le.top}px`,left:`${le.left}px`,zIndex:99999},onClick:e=>e.stopPropagation(),children:[(0,Y.jsx)(`div`,{className:`sidebar-move-header`,children:`Move to Project`}),(0,Y.jsx)(`div`,{className:`sidebar-move-list`,children:Ue.map(e=>{let t=le.currentWorkspacePath===e.path;return(0,Y.jsxs)(`button`,{type:`button`,className:`sidebar-move-item ${t?`is-current`:``}`,onClick:()=>{T?.(le.sessionId,e.path),ue(null)},title:e.path,children:[(0,Y.jsx)(`span`,{className:`sidebar-move-item-icon`,children:(0,Y.jsx)(ee,{size:14,"aria-hidden":`true`})}),(0,Y.jsx)(`span`,{className:`sidebar-move-item-name`,children:e.name}),t&&(0,Y.jsx)(`span`,{className:`sidebar-move-item-check`,children:(0,Y.jsx)(te,{size:14,"aria-hidden":`true`})})]},e.path)})}),(0,Y.jsx)(`div`,{className:`sidebar-move-divider`}),(0,Y.jsxs)(`button`,{type:`button`,className:`sidebar-move-item ${le.currentWorkspacePath?``:`is-current`}`,onClick:()=>{T?.(le.sessionId,null),ue(null)},children:[(0,Y.jsx)(`span`,{className:`sidebar-move-item-icon`,children:(0,Y.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,Y.jsx)(`polyline`,{points:`9 14 4 9 9 4`}),(0,Y.jsx)(`path`,{d:`M20 20v-7a4 4 0 0 0-4-4H4`})]})}),(0,Y.jsx)(`span`,{className:`sidebar-move-item-name`,children:`Recents (No project)`}),!le.currentWorkspacePath&&(0,Y.jsx)(`span`,{className:`sidebar-move-item-check`,children:(0,Y.jsx)(te,{size:14,"aria-hidden":`true`})})]}),C&&(0,Y.jsxs)(`button`,{type:`button`,className:`sidebar-move-item`,onClick:async()=>{let e=await C();e&&T?.(le.sessionId,e),ue(null)},children:[(0,Y.jsx)(`span`,{className:`sidebar-move-item-icon`,children:(0,Y.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,Y.jsx)(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),(0,Y.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})]})}),(0,Y.jsx)(`span`,{className:`sidebar-move-item-name`,children:`Choose folder...`})]})]}),oe&&(()=>{let e=we.find(e=>e.id===oe.sessionId);return e?(0,Y.jsxs)(`div`,{className:`sidebar-conversation-menu-popover`,role:`menu`,style:{top:oe.top,left:oe.left},onClick:e=>e.stopPropagation(),children:[(0,Y.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{O(e.id),A(e.title||``),se(null)},children:[(0,Y.jsx)(b,{className:`sidebar-menu-icon`,size:14,"aria-hidden":`true`}),(0,Y.jsx)(`span`,{children:`Rename`})]}),T&&(0,Y.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:t=>{se(null),We(t,e)},children:[(0,Y.jsx)(S,{className:`sidebar-menu-icon`,size:14,"aria-hidden":`true`}),(0,Y.jsx)(`span`,{children:`Move to project`})]}),(0,Y.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`is-destructive`,onClick:()=>{d(e.id),se(null)},children:[(0,Y.jsx)(Pe,{className:`sidebar-menu-icon`,size:14,"aria-hidden":`true`}),(0,Y.jsx)(`span`,{children:`Delete conversation`})]})]}):null})()]})}var jT,Y,MT,NT=t((()=>{jT=e(i()),k(),ot(),Le(),ke(),Y=a(),MT=(0,jT.memo)(AT)}));function PT({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,FT.useState)(null),[S,C]=(0,FT.useState)(!1),[w,T]=(0,FT.useState)(!1),[E,D]=(0,FT.useState)(()=>Number(window.localStorage.getItem(`mint:ui-zoom`))||1),[O,k]=(0,FT.useState)(!1),[A,ee]=(0,FT.useState)(!1),te=(0,FT.useRef)(null),j=(0,FT.useRef)(null),M=x_(m,g,()=>y()),ne=h&&!A,N=(0,FT.useRef)(v);N.current=v,(0,FT.useEffect)(()=>{M.error&&N.current(M.error)},[M.error]),(0,FT.useEffect)(()=>{let e=!0;return De(async()=>{let{getCurrentWindow:e}=await import(`./window-CkUOP7t0.js`);return{getCurrentWindow:e}},__vite__mapDeps([22,1,23,24])).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 re=()=>{De(async()=>{let{getCurrentWindow:e}=await import(`./window-CkUOP7t0.js`);return{getCurrentWindow:e}},__vite__mapDeps([22,1,23,24])).then(({getCurrentWindow:e})=>e().minimize()).catch(e=>console.error(`Failed to minimize Mint window:`,e))},ie=()=>{De(async()=>{let{getCurrentWindow:e}=await import(`./window-CkUOP7t0.js`);return{getCurrentWindow:e}},__vite__mapDeps([22,1,23,24])).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=()=>{De(async()=>{let{getCurrentWindow:e}=await import(`./window-CkUOP7t0.js`);return{getCurrentWindow:e}},__vite__mapDeps([22,1,23,24])).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,FT.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),P=e=>{j.current?.isConnected&&j.current.focus(),(se(document.activeElement)||e===`copy`)&&document.execCommand(e)},ce=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)}},le=e=>{De(async()=>{let{getCurrentWindow:e}=await import(`./window-CkUOP7t0.js`);return{getCurrentWindow:e}},__vite__mapDeps([22,1,23,24])).then(({getCurrentWindow:t})=>t().startResizeDragging(e)).catch(e=>console.error(`Failed to start Mint window resize:`,e))};(0,FT.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,FT.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,FT.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(),!M.busy&&!_&&M.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,M.undo,M.busy,_]);let ue=e=>{e(),x(null)},de={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:ne?M.entries[0]?.label||`Undo workspace action`:`Undo`,shortcut:`Ctrl+Z`,disabled:ne?!M.entries.length||M.busy||_:!A,action:async()=>{ne?await M.undo():P(`undo`)}},{label:`Redo`,shortcut:`Ctrl+Shift+Z`,disabled:!A,action:()=>P(`redo`)},{label:`Cut`,shortcut:`Ctrl+X`,disabled:!A,action:()=>P(`cut`)},{label:`Copy`,shortcut:`Ctrl+C`,action:()=>P(`copy`)},{label:`Paste`,shortcut:`Ctrl+V`,disabled:!A,action:ce},{label:`Select all`,shortcut:`Ctrl+A`,disabled:!A,action:()=>P(`selectAll`)}],View:[{label:e?`Show sidebar`:`Hide sidebar`,shortcut:`Ctrl+B`,action:t},{label:`Toggle terminal`,shortcut:"Ctrl+`",action:o},{label:`Open Browser panel`,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,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`header`,{className:`mint-titlebar`,ref:te,"aria-label":`Mint Agent window controls`,children:[(0,X.jsxs)(`div`,{className:`mint-titlebar-left`,children:[(0,X.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,X.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,X.jsx)(`rect`,{x:`3.5`,y:`4`,width:`17`,height:`16`,rx:`2`}),(0,X.jsx)(`path`,{d:`M9 4v16`})]})}),(0,X.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,X.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,X.jsx)(`path`,{d:`m14.5 5-7 7 7 7M8 12h12`})})}),(0,X.jsx)(`button`,{className:`mint-titlebar-icon-button`,type:`button`,"aria-label":`Go forward`,title:`Go forward`,onClick:()=>window.history.forward(),children:(0,X.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,X.jsx)(`path`,{d:`m9.5 5 7 7-7 7M16 12H4`})})}),(0,X.jsx)(`span`,{className:`mint-titlebar-divider`,"aria-hidden":`true`}),(0,X.jsx)(`nav`,{className:`mint-titlebar-menus`,"aria-label":`Application menu`,children:IT.map(e=>(0,X.jsxs)(`div`,{className:`mint-titlebar-menu-wrap`,children:[(0,X.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,X.jsx)(`div`,{className:`mint-titlebar-menu`,role:`menu`,children:de[e].map(e=>(0,X.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:e.disabled,onMouseDown:e=>e.preventDefault(),onClick:()=>ue(e.action),children:[(0,X.jsx)(`span`,{children:e.label}),e.shortcut&&(0,X.jsx)(`kbd`,{children:e.shortcut})]},e.label))})]},e))})]}),(0,X.jsx)(`div`,{className:`mint-titlebar-drag-region`,"data-tauri-drag-region":!0,"aria-hidden":`true`,onDoubleClick:ie}),(0,X.jsx)(`button`,{className:`mint-titlebar-icon-button`,type:`button`,"aria-label":`Show workspace`,title:`Show workspace`,"aria-pressed":h,onClick:i,children:(0,X.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,X.jsx)(`path`,{d:`M4 6.5h6l1.7 2H20v9.5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z`}),(0,X.jsx)(`path`,{d:`M4 6.5v-1a2 2 0 0 1 2-2h4l1.7 2H18a2 2 0 0 1 2 2v1`})]})}),(0,X.jsx)(Rw,{className:`mint-titlebar-icon-button mint-tools-panel-toggle`,open:c,count:l,onToggle:u}),(0,X.jsxs)(`div`,{className:`mint-titlebar-window-controls`,children:[(0,X.jsx)(`button`,{type:`button`,className:`mint-window-control`,"aria-label":`Minimize window`,title:`Minimize`,onClick:re,children:(0,X.jsx)(`svg`,{viewBox:`0 0 12 12`,"aria-hidden":`true`,children:(0,X.jsx)(`path`,{d:`M2 6h8`})})}),(0,X.jsx)(`button`,{type:`button`,className:`mint-window-control`,"aria-label":S?`Restore window`:`Maximize window`,title:S?`Restore`:`Maximize`,onClick:ie,children:(0,X.jsx)(`svg`,{viewBox:`0 0 12 12`,"aria-hidden":`true`,children:S?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{d:`M4 2.5h5.5V8`}),(0,X.jsx)(`path`,{d:`M8 4H2.5v5.5H8z`})]}):(0,X.jsx)(`rect`,{x:`2.5`,y:`2.5`,width:`7`,height:`7`,rx:`0.7`})})}),(0,X.jsx)(`button`,{type:`button`,className:`mint-window-control is-close`,"aria-label":`Close window`,title:`Close`,onClick:()=>window.api.closeWindow(),children:(0,X.jsx)(`svg`,{viewBox:`0 0 12 12`,"aria-hidden":`true`,children:(0,X.jsx)(`path`,{d:`m3 3 6 6m0-6L3 9`})})})]})]}),O&&(0,X.jsx)(`div`,{className:`mint-shortcuts-backdrop`,role:`presentation`,onMouseDown:()=>k(!1),children:(0,X.jsxs)(`section`,{className:`mint-shortcuts-dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`mint-shortcuts-title`,onMouseDown:e=>e.stopPropagation(),children:[(0,X.jsxs)(`header`,{children:[(0,X.jsx)(`h2`,{id:`mint-shortcuts-title`,children:`Keyboard shortcuts`}),(0,X.jsx)(`button`,{type:`button`,"aria-label":`Close shortcuts`,onClick:()=>k(!1),children:`×`})]}),(0,X.jsxs)(`dl`,{children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`New chat`}),(0,X.jsx)(`dd`,{children:(0,X.jsx)(`kbd`,{children:`Ctrl+N`})})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Open workspace`}),(0,X.jsx)(`dd`,{children:(0,X.jsx)(`kbd`,{children:`Ctrl+O`})})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Toggle sidebar`}),(0,X.jsx)(`dd`,{children:(0,X.jsx)(`kbd`,{children:`Ctrl+B`})})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Toggle terminal`}),(0,X.jsx)(`dd`,{children:(0,X.jsx)(`kbd`,{children:"Ctrl+`"})})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Open Browser panel`}),(0,X.jsx)(`dd`,{children:(0,X.jsx)(`kbd`,{children:`Ctrl+Shift+B`})})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Settings`}),(0,X.jsx)(`dd`,{children:(0,X.jsx)(`kbd`,{children:`Ctrl+,`})})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Zoom`}),(0,X.jsxs)(`dd`,{children:[(0,X.jsx)(`kbd`,{children:`Ctrl++`}),` `,(0,X.jsx)(`kbd`,{children:`Ctrl+-`}),` `,(0,X.jsx)(`kbd`,{children:`Ctrl+0`})]})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Fullscreen`}),(0,X.jsx)(`dd`,{children:(0,X.jsx)(`kbd`,{children:`F11`})})]})]})]})}),(0,X.jsx)(`div`,{className:`mint-window-resize-handles`,"aria-hidden":`true`,children:LT.map(e=>(0,X.jsx)(`span`,{className:`mint-window-resize-handle is-${e.toLowerCase()}`,onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),le(e)}},e))})]})}var FT,X,IT,LT,RT=t((()=>{FT=e(i()),T_(),Bw(),X=a(),Te(),IT=[`File`,`Edit`,`View`,`Help`],LT=[`NorthWest`,`North`,`NorthEast`,`West`,`East`,`SouthWest`,`South`,`SouthEast`]})),zT=t((()=>{}));function BT({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,VT.jsxs)(`section`,{className:`mint-error mint-error-notice`,role:`alert`,"aria-label":`Error notification`,children:[(0,VT.jsxs)(`div`,{className:`mint-error-notice-content`,children:[(0,VT.jsx)(`p`,{children:n}),n!==e&&(0,VT.jsxs)(`details`,{children:[(0,VT.jsx)(`summary`,{children:`Error details`}),(0,VT.jsxs)(`pre`,{children:[e.slice(0,12e3),e.length>12e3?`
|
|
61
|
+
… (details truncated)`:``]})]})]}),(0,VT.jsx)(`button`,{type:`button`,className:`mint-error-notice-close`,"aria-label":`Dismiss error`,onClick:t,children:(0,VT.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,VT.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,VT.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]})}var VT,HT=t((()=>{zT(),VT=a()})),UT=t((()=>{}));function WT({source:e}){let t=e.kind===`web`?e.faviconUrl:e.thumbnailDataUri,[n,r]=(0,KT.useState)(),i=e.kind===`web`?o:e.kind===`image`?Re:e.kind===`video`?T:/\.(pdf|md|txt|docx?)$/i.test(e.name)?l:P;return(0,qT.jsx)(`span`,{className:`session-source-icon is-${e.kind}`,children:t&&t!==n?(0,qT.jsx)(`img`,{src:t,alt:``,loading:`lazy`,referrerPolicy:`no-referrer`,onError:()=>r(t)}):(0,qT.jsx)(i,{size:15,"aria-hidden":`true`})})}function GT({sources:e,loading:t,error:n,onRetry:r,onOpenLibrary:i,onOpenArtifact:a}){let[o,s]=(0,KT.useState)(``),[c,l]=(0,KT.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 A.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,qT.jsxs)(`section`,{className:`session-sources`,"aria-label":`Session sources`,children:[(0,qT.jsxs)(`header`,{className:`session-sources-heading`,children:[(0,qT.jsxs)(`span`,{children:[(0,qT.jsx)(me,{size:13,"aria-hidden":`true`}),`Sources `,(0,qT.jsx)(`small`,{children:`This session`})]}),(0,qT.jsx)(`span`,{children:e.length})]}),(e.length>8||o)&&(0,qT.jsxs)(`label`,{className:`session-sources-search`,children:[(0,qT.jsx)(g,{size:14,"aria-hidden":`true`}),(0,qT.jsx)(`input`,{type:`search`,"aria-label":`Search Sources`,placeholder:`Search Sources…`,value:o,onChange:e=>s(e.target.value)})]}),t&&(0,qT.jsx)(`p`,{className:`session-sources-empty`,role:`status`,children:`Loading session sources…`}),n&&(0,qT.jsxs)(`div`,{className:`session-sources-error`,role:`status`,children:[(0,qT.jsx)(`span`,{children:`Could not load saved sources.`}),(0,qT.jsx)(`button`,{type:`button`,onClick:r,children:`Retry`})]}),!t&&!n&&e.length===0&&(0,qT.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,qT.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,qT.jsxs)(`div`,{className:`session-sources-group`,children:[(0,qT.jsxs)(`h3`,{children:[t.label,(0,qT.jsx)(`span`,{children:d?`${n.length} / ${e.filter(e=>t.kinds.includes(e.kind)).length}`:n.length})]}),(0,qT.jsx)(`ul`,{children:n.map(e=>{let t=(0,qT.jsxs)(qT.Fragment,{children:[(0,qT.jsx)(WT,{source:e}),(0,qT.jsxs)(`span`,{className:`session-source-copy`,children:[(0,qT.jsx)(`strong`,{children:e.name}),(0,qT.jsx)(`small`,{children:e.detail})]})]}),n=!!(e.url||e.kind===`image`&&a&&(e.libraryItemId||e.thumbnailDataUri)),r=c===e.id;return(0,qT.jsx)(`li`,{children:n?(0,qT.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,qT.jsx)(`div`,{className:`session-source-row`,title:e.name,children:t})},e.id)})})]},t.label):null})]})}var KT,qT,JT=t((()=>{KT=e(i()),k(),ke(),UT(),qT=a()}));function YT(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 Ub(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 XT=t((()=>{Yb()}));function ZT(e,t){return e&&(t===null||t===`sources`)}function QT(e,t,n){let[r,i]=(0,$T.useState)(null),[a,o]=(0,$T.useState)(0),s=(0,$T.useCallback)(()=>o(e=>e+1),[]);(0,$T.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,$T.useMemo)(()=>n?YT(c?.value??{attachments:[],webSearchProgress:[]},t):[],[n,c,t]),loading:n&&(!c||c.loading),error:c?.error||``,retry:s}}var $T,eE=t((()=>{$T=e(i()),ke(),XT()})),tE,nE=t((()=>{tE=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 rE(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 iE(e){let t=rE(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`/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 aE=t((()=>{}));async function oE(){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 sE(){let{invoke:e}=await De(async()=>{let{invoke:e}=await import(`./core-Mi3s5D4_.js`).then(e=>(e.a(),e.i));return{invoke:e}},__vite__mapDeps([23,1]));return e(`capture_chat_screen`)}async function cE(e){return e&&navigator.userAgent.toLowerCase().includes(`linux`)?sE():oE()}var lE=t((()=>{Te()}));function uE(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 dE(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:Gy(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 fE=t((()=>{$y()}));function pE(e,t){return t.some(t=>t.id===e)}function mE(e){return Date.parse(e.updatedAt)||Date.parse(e.createdAt)||0}async function hE(e,t,n=`chat`){let r=qt(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::`)&&qt(e.workspacePath)===r).sort((e,t)=>mE(t)-mE(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 gE(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 _E=t((()=>{Yt()}));function vE(e){return e?{historyMs:1500,sessionsMs:5e3}:{historyMs:5e3,sessionsMs:15e3}}function yE(e,t,n,r={},i){let a={...uE(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=>_(dE(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=>{b(e);let t=e.queuedProgress;e.queuedProgress=[],y(e)&&t.length&&v({type:`progress_received`,progress:t})},S=(e,t)=>{if(!a.pendingApprovals[e]||t&&a.pendingApprovals[e].token!==t)return;let n={...a.pendingApprovals};delete n[e],_({pendingApprovals:n})};function C(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;_({...dE(a,{type:`session_switched`,draft:t}),conversationId:e,queuedPrompts:r,queuePaused:c,interactions:[],hasOlderInteractions:!1,agentActivitySnapshots:{},streamingConversationId:null,activeTurnId:null,sessionAutoApproved:!1})}async function w(){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:qy(a.agentActivitySnapshots,r.interactions)})}catch(n){if(e===o&&t===c)throw n}}async function T(){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 E(e=()=>!0){let t=o;if(d!==t&&e()){d=t;try{if(s===null){await w();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 T()}catch{}finally{d===t&&(d=null)}}}async function D(){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 O(e,t){p.get(e)?.autoApprove&&!gx(t.approval)?n.submitToolApproval(t.token,!0).catch(e=>r.onError?.(e)):(_({pendingApprovals:{...a.pendingApprovals,[e]:t}}),r.onApproval?.(t,e))}async function k(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&&!gx(c.approval);d&&(l.autoApprove=!0,_({sessionAutoApproved:!0}));try{await n.submitToolApproval(c.token,e,i),S(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 A(){let e=o,t=p.get(e.chatId);if(!a.sending||!t||!y(t))return;p.delete(e.chatId),b(t);let i=a.pendingApprovals[e.chatId]?.token;try{await n.cancelChatMessage(e.chatId)}catch(t){e===o&&r.onError?.(t)}finally{i&&S(e.chatId,i),g.set(e.chatId,!0),e===o&&!p.has(e.chatId)&&_({...dE(a,{type:`run_cancelled`}),queuePaused:!0,streamingConversationId:null,activeTurnId:null,sessionAutoApproved:!1})}}async function ee(e,t={}){if(a.sending)return;let i=o,s={session:i,turnId:null,autoApprove:!1,progress:[],queuedProgress:[]};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;_({...dE(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},C=(e,t)=>`${e}:${t.length}:${t.slice(0,64)}:${t.slice(-32)}`,E=t.documentAttachment,D=[e,c.map(e=>C(e.name,e.dataUri)).join(`|`),l.map(e=>C(e.name,e.dataUri)).join(`|`),E?C(E.filename,E.dataUri):``].join(`\0`),k=f.get(i.chatId);k?.signature!==D&&(k={signature:D,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,k));let A={requestId:k.requestId,imageNames:c.map(e=>e.name),videoNames:l.map(e=>e.name)},te=()=>{f.get(i.chatId)?.requestId===A.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}`,()=>{},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(()=>x(s),75)):x(s)))},t.documentAttachment??null,d,i.chatId,void 0,u?t.planMode:!1,t.pinnedMcpServer??null,e=>{p.get(i.chatId)===s&&O(i.chatId,e)},e=>{s.turnId=e,te(),y(s)&&_({activeTurnId:e})},A);o.provider!==`error`&&te(),x(s),y(s)&&_({streamedReply:o.text,streamedResponse:o}),await r.onReply?.(o,i.chatId);let f=Ky(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 w()}catch(e){r.onError?.(e)}await T(),await r.onRunCompleted?.(),y(s)&&(r.onVisibleRunCompleted?.(i.chatId),v({type:`stream_cleared`}))}catch(e){y(s)&&r.onError?.(e)}finally{if(x(s),p.get(i.chatId)===s){let e=y(s);S(i.chatId),p.delete(i.chatId),e?_({...dE(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}),ee(e.text,{imageAttachments:e.imageAttachments,videoAttachments:e.videoAttachments,documentAttachment:e.documentAttachment,agentMode:t.agentMode,planMode:t.planMode})}}}}async function te(){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,S(e.chatId),_({...dE(a,{type:`session_switched`,draft:``}),interactions:[],hasOlderInteractions:!1,agentActivitySnapshots:{},streamingConversationId:null,activeTurnId:null,sessionAutoApproved:!1})}catch(t){if(e===o)throw t}}async function j(e,t,n){let i=o,a=++u,s=()=>i===o&&a===u;try{let r=await e();r&&s()&&await hE(r,{...t,listSessions:T,currentSessionId:()=>o.chatId,isCurrent:s},n)}catch(e){s()&&r.onError?.(e)}}function M(e,t){let n=!0,r=a.sending||p.size>0,i,o,s=()=>n&&e.document.visibilityState===`visible`,c=()=>{t&&s()&&E(s)},l=()=>{s()&&T().catch(()=>{})},u=()=>{c(),l()},d=()=>{if(i!==void 0&&e.window.clearInterval(i),o!==void 0&&e.window.clearInterval(o),!n)return;let a=vE(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 ne(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 N(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 re(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 ie(){h.delete(o.chatId),g.set(o.chatId,!1),v({type:`queued_prompts_cleared`})}function ae(e){g.set(o.chatId,e),v({type:`queue_paused_set`,paused:e})}function oe(){if(ae(!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}),ee(t.text,{imageAttachments:t.imageAttachments,videoAttachments:t.videoAttachments,documentAttachment:t.documentAttachment}))}}async function se(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 A(),ee(r.text,{imageAttachments:r.imageAttachments,videoAttachments:r.videoAttachments,documentAttachment:r.documentAttachment}))}return{getSnapshot:()=>a,subscribe:e=>(m.add(e),()=>{m.delete(e)}),activate:C,refreshHistory:w,refreshSessions:T,syncHistory:E,loadOlder:D,sendPrompt:ee,cancel:A,receiveApproval:O,resolveApproval:k,clearHistory:te,selectProject:j,watch:M,queuePrompt:ne,removeQueuedPrompt:N,editQueuedPrompt:re,clearQueuedPrompts:ie,setQueuePaused:ae,resumeQueue:oe,steerQueuedPrompt:se,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 bE=t((()=>{fE(),$y(),Cx(),_E()}));function xE(e,t,n=Ae){let r=(0,SE.useRef)(t);r.current=t;let[i]=(0,SE.useState)(()=>yE(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,SE.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,SE.useSyncExternalStore)(i.subscribe,o,o);return(0,SE.useEffect)(()=>i.watch({window,document},t.historyVisible),[i,t.historyVisible,s.conversationId]),(0,SE.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,SE.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 SE,CE=t((()=>{SE=e(i()),bE(),ke()})),wE=t((()=>{}));function TE({workspacePath:e,panelTarget:t,onCountChange:n}){let[r,i]=(0,EE.useState)([]),[a,o]=(0,EE.useState)({workspace:void 0,ids:new Set}),s=!!t,l=(0,EE.useRef)(s);l.current=s;let u=(0,EE.useRef)(r);u.current=r;let[d,f]=(0,EE.useState)(!1),[m,h]=(0,EE.useState)(null),[g,v]=(0,EE.useState)(null),[y,b]=(0,EE.useState)(``),[x,S]=(0,EE.useState)(``),[C,w]=(0,EE.useState)(!0),[T,E]=(0,EE.useState)(``),[D,O]=(0,EE.useState)(!0),[k,A]=(0,EE.useState)(new Set),ee=(0,EE.useRef)(null),te=(0,EE.useRef)(new Map);(0,EE.useEffect)(()=>{let t=!1,n=!1,r;w(!0);let a=e=>{t||(r!==void 0&&window.clearTimeout(r),r=window.setTimeout(()=>void s(),ME(l.current,e)))},s=async()=>{if(n||document.hidden){a(u.current);return}n=!0;let r=u.current;try{let n=await p.list();if(t)return;r=n;let a=jE(n,e),s=``;for(let e of n){let t=te.current.get(e.id);t&&(t===`running`||t===`stopping`)&&!OE(e)&&(s=`${AE(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,EE.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 p.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,EE.useEffect)(()=>{D&&ee.current&&(ee.current.scrollTop=ee.current.scrollHeight)},[g,D]),(0,EE.useEffect)(()=>{if(!T)return;let e=window.setTimeout(()=>E(``),6e3);return()=>window.clearTimeout(e)},[T]),(0,EE.useEffect)(()=>{h(null),f(!1)},[e]);let j=r.filter(t=>a.workspace===e&&a.ids.has(t.id)),M=j.filter(OE).length;(0,EE.useEffect)(()=>{n(M)},[M,n]);let ne=d?r:j,N=async e=>{S(``);try{if(_.isTauriRuntime()){let{invoke:t}=await De(async()=>{let{invoke:e}=await import(`./core-Mi3s5D4_.js`).then(e=>(e.a(),e.i));return{invoke:e}},__vite__mapDeps([23,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)}`)}},re=async e=>{A(t=>new Set(t).add(e.id)),S(``);try{let t=await p.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})}},ie=async e=>{A(t=>new Set(t).add(e.id)),S(``);try{await p.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=!!_.isTauriRuntime()||[`localhost`,`127.0.0.1`,`[::1]`].includes(window.location.hostname);return(0,Z.jsxs)(Z.Fragment,{children:[T&&(0,Z.jsx)(`span`,{className:`background-task-announcement`,role:`status`,children:T}),t&&(0,DE.createPortal)((0,Z.jsxs)(`section`,{className:`background-terminals background-terminal-panel`,"aria-label":`Background tasks`,children:[(0,Z.jsxs)(`header`,{className:`background-terminal-panel-header`,children:[(0,Z.jsx)(`span`,{className:`background-terminal-heading-icon`,"aria-hidden":`true`,children:`›_`}),(0,Z.jsxs)(`span`,{className:`background-terminal-panel-title`,children:[(0,Z.jsx)(`strong`,{children:`Background tasks`}),(0,Z.jsx)(`small`,{children:d?`All workspaces`:AE(e||``)||`No workspace`})]})]}),T&&(0,Z.jsx)(`p`,{children:T}),(0,Z.jsxs)(`label`,{className:`background-terminal-filter`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,checked:d,onChange:e=>{f(e.target.checked),h(null)}}),` All workspaces`]}),y&&(0,Z.jsx)(`p`,{role:`status`,className:`background-terminal-error`,children:y}),x&&(0,Z.jsx)(`p`,{role:`alert`,className:`background-terminal-error`,children:x}),(0,Z.jsxs)(`div`,{className:`background-terminal-list`,children:[!ne.length&&(0,Z.jsxs)(`div`,{className:`background-terminal-empty`,role:`status`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`›_`}),(0,Z.jsx)(`strong`,{children:C?`Loading tasks…`:y?`Waiting for connection…`:`No background tasks`}),!C&&!y&&(0,Z.jsx)(`small`,{children:`Commands started in the background will appear here.`})]}),[...ne].reverse().map(e=>(0,Z.jsxs)(`article`,{className:`background-terminal-job`,children:[(0,Z.jsxs)(`div`,{className:`background-terminal-job-heading`,children:[(0,Z.jsx)(`strong`,{children:e.id}),(0,Z.jsx)(`span`,{className:`background-terminal-state ${e.status}`,children:e.status}),(0,Z.jsx)(`span`,{children:kE(e.elapsedSeconds)})]}),(0,Z.jsx)(`code`,{title:e.command,children:e.command}),(0,Z.jsxs)(`small`,{children:[AE(e.workspacePath),` · `,e.cwd,e.exitCode===null?``:` · exit ${e.exitCode}`]}),e.error&&(0,Z.jsx)(`small`,{className:`background-terminal-error`,children:e.error}),(0,Z.jsxs)(`div`,{className:`background-terminal-actions`,children:[(0,Z.jsx)(`button`,{type:`button`,onClick:()=>{h(e.id),O(!0)},children:`View output`}),e.serverUrl&&(ae?(0,Z.jsx)(`button`,{type:`button`,onClick:()=>void N(e.serverUrl),children:`Open browser`}):(0,Z.jsxs)(`small`,{children:[`Backend-local address: `,e.serverUrl,` · unavailable from this device`]})),!OE(e)&&(0,Z.jsx)(`button`,{type:`button`,className:`background-terminal-delete`,"aria-label":`Remove terminal ${e.id}`,title:`Remove terminal`,disabled:k.has(e.id),onClick:()=>void ie(e),children:(0,Z.jsx)(Pe,{size:14,"aria-hidden":`true`})}),OE(e)&&(0,Z.jsx)(`button`,{type:`button`,className:`background-terminal-stop`,disabled:!!y||k.has(e.id)||e.status===`stopping`,onClick:()=>void re(e),children:e.status===`stopping`||k.has(e.id)?`Stopping…`:`Stop`})]})]},e.id))]}),m&&(0,Z.jsxs)(`section`,{"aria-label":`Output for ${m}`,className:`background-terminal-output`,children:[(0,Z.jsxs)(`header`,{children:[(0,Z.jsxs)(`strong`,{children:[m,` · output`]}),(0,Z.jsxs)(`label`,{children:[(0,Z.jsx)(`input`,{type:`checkbox`,checked:D,onChange:e=>O(e.target.checked)}),` Follow`]}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Close terminal output`,title:`Close output`,onClick:()=>h(null),children:(0,Z.jsx)(c,{size:14,"aria-hidden":`true`})})]}),g?.truncated&&(0,Z.jsx)(`small`,{children:`Older output was truncated.`}),(0,Z.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:g?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`strong`,{children:`stdout`}),(0,Z.jsx)(`pre`,{children:g.stdout||`(empty)`}),(0,Z.jsx)(`strong`,{children:`stderr`}),(0,Z.jsx)(`pre`,{children:g.stderr||`(empty)`})]}):(0,Z.jsx)(`p`,{children:x?`Output unavailable.`:`Loading output…`})})]})]}),t)]})}var EE,DE,Z,OE,kE,AE,jE,ME,NE=t((()=>{EE=e(i()),DE=E(),k(),ke(),wE(),Z=a(),Te(),OE=e=>e.status===`running`||e.status===`stopping`,kE=e=>`${Math.floor(e/60).toString().padStart(2,`0`)}:${(e%60).toString().padStart(2,`0`)}`,AE=e=>e.split(/[\\/]/).filter(Boolean).pop()||e,jE=(e,t)=>t?e.filter(e=>e.workspacePath===t):[],ME=(e,t)=>e||t.some(OE)?3e3:1e4}));function PE(e){return{proactiveSuggestion:null,dismissProactiveSuggestion:()=>{},handleProactiveAction:async e=>{}}}var FE=t((()=>{}));function IE(){if(typeof window>`u`)return[];try{let e=JSON.parse(window.localStorage.getItem(MD)||`[]`);return Array.isArray(e)?[...new Set(e.filter(e=>typeof e==`string`&&!!e.trim()))].slice(0,ND):[]}catch{return[]}}function LE(){if(typeof window<`u`)try{window.localStorage.setItem(FD,Date.now().toString())}catch{}}function RE(){if(typeof window>`u`||!lD())return!1;let e=window.localStorage.getItem(FD);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>ID?!1:new Date(t).toDateString()===new Date(n).toDateString()}function zE(e){if(!e)return``;try{return window.localStorage.getItem(`${LD}${e}`)||``}catch{return``}}function BE(){let e=Math.random().toString(36).slice(2,10);return`conversation-${Date.now().toString(36)}-${e}`}function VE(){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 HE(){if(typeof window>`u`)return!0;let e=(window.location.pathname||``).replace(/\/+$/,``),t=(window.location.hash||``).replace(/^#\/?/,``).replace(/\/+$/,``),n=(e||t).toLowerCase();return VE()||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 UE(){let e=VE();if(e)return window.localStorage.setItem(PD,e),LE(),e;if(lD()&&RE()){let e=window.localStorage.getItem(PD);if(e)return LE(),e===`conversation-default`?`cli`:e}if(HE()){let e=BE();return LE(),e}let t=window.localStorage.getItem(PD);if(t===`conversation-default`)return window.localStorage.setItem(PD,`cli`),LE(),`cli`;if(t)return LE(),t;let n=BE();return LE(),n}function WE(){return(0,$.jsx)(`div`,{className:`auth-gate-loading`,style:{minHeight:160},children:`Loading panel…`})}function GE(){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 KE(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 qE(e,t=120){let n=e.replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t)}…`:n}function JE(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 YE(){let e=lD(),[t,n]=(0,Q.useState)(GE),[r]=(0,Q.useState)(UE),{conversation:i,actions:a}=xE({workspacePath:window.localStorage.getItem(jD)||``,message:zE(r)},{conversationId:r,draftKeyPrefix:LD,workspaceStorageKey:jD,historyVisible:t===`chat`,onError:e=>pe(Ct(e)),onApproval:(e,t)=>ve(e,t),onReply:(e,t)=>{if(document.hidden||!document.hasFocus())return _e(e.text||`Mint finished your request.`,t)},onActivityPersisted:e=>{let t=String(e);be(e=>({...e,...xe.current?{[t]:!0}:{},...Ce.current?{[`extended-${t}`]:!0}:{}}))},onRunCompleted:async()=>{aD().then(de).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:g,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),[M,ne]=(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[N,re]=(0,Q.useState)(0),[ie,ae]=(0,Q.useState)(IE);function oe(e){let t=Jt([e,...IE()]).slice(0,ND);try{window.localStorage.setItem(MD,JSON.stringify(t))}catch{}ae(t)}(0,Q.useEffect)(()=>{s.trim()&&oe(s)},[s]);async function se(){let e=await cD();return e&&oe(e),e}let P=(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=KE(s,r||o);return typeof window<`u`&&window.location.pathname!==c&&window.history.pushState({},``,c),s})},ce=(0,Q.useRef)(0);(0,Q.useEffect)(()=>()=>{ce.current+=1},[]);let le=(0,Q.useRef)(async()=>{});le.current=async e=>{let t=++ce.current;try{!await gE(e,{listSessions:rD,openSession:(e,t)=>Dn(e.id,e,t),isCurrent:()=>ce.current===t})&&ce.current===t&&(pe(`This conversation no longer exists. Choose another conversation.`),P(`chat`),j(!0))}catch(e){ce.current===t&&pe(Ct(e))}},(0,Q.useEffect)(()=>{let e=()=>{ce.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=GE();n(r);let i=VE();if(i&&i!==o)le.current(i);else if(!i&&HE()){let e=BE();ee(e)}};return window.addEventListener(`popstate`,e),window.addEventListener(`hashchange`,e),()=>{window.removeEventListener(`popstate`,e),window.removeEventListener(`hashchange`,e)}},[o,s]),(0,Q.useEffect)(()=>{LE();let e=()=>LE();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[ue,de]=(0,Q.useState)(null),[fe,pe]=(0,Q.useState)(``),[me,he]=(0,Q.useState)(null),ge=(0,Q.useRef)(Dn);ge.current=Dn;let _e=(e,t,n=`replies`)=>Se(()=>Ve(ut.current?.notificationSettings,n,`os`)?window.api?.notifyAiResponse?.(qE(e),t):void 0,pe),ve=(e,t)=>{(document.hidden||!document.hasFocus())&&_e(JE(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||pe(Ct(t))})},r=e=>{e&&ge.current(e).catch(e=>pe(Ct(e)))},i=e=>r(e.detail?.chatId);window.addEventListener(`mint:notification-click`,i);let a=async()=>{try{let t=await iD();if(!t||e)return;it.current=!0,await le.current(t),e||await iD(t)}catch(t){e||pe(Ct(t))}};lD()&&n(tD(`companion-open-chat`,()=>{a()}).then(t=>(e||a(),t))),n(tD(`notification-clicked`,e=>r(e.payload?.chatId))),n(Promise.resolve(window.api?.onProactiveNotification?.(t=>{e||je(t,document.hidden||!document.hasFocus(),e=>{Ve(ut.current?.notificationSettings,`system`,`inApp`)&&he(e)},(e,t)=>_e(e,t,`system`)).catch(e=>pe(Ct(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[ye,be]=(0,Q.useState)({}),xe=(0,Q.useRef)(!0),Ce=(0,Q.useRef)(!0),[we,Te]=(0,Q.useState)(()=>window.localStorage.getItem(`mint:sidebar-collapsed`)===`true`),[Ee,Oe]=(0,Q.useState)([]),ke=(0,Q.useRef)(Ee);ke.current=Ee;let Ae=(0,Q.useRef)(null),Me=(0,Q.useRef)(new tE);(0,Q.useEffect)(()=>(Me.current=new tE,()=>Me.current.dispose()),[]),(0,Q.useEffect)(()=>{Me.current.update(Ee.flatMap(e=>e.kind===`preview`?[e.artifact]:[]))},[Ee]);let[Ne,Pe]=(0,Q.useState)(null),[Fe,Ie]=(0,Q.useState)(!1),Le=QT(o,T===o?S:[],ZT(Fe,Ne)),[Re,ze]=(0,Q.useState)(null),[Be,He]=(0,Q.useState)(null),[Ue,We]=(0,Q.useState)(0),[Ge,Ke]=(0,Q.useState)(()=>{let e=Number(window.localStorage.getItem(`mint:terminal-right-width`));return e>=280&&e<=900?e:440}),qe=(0,Q.useRef)(null),[Je,Ye]=(0,Q.useState)(()=>{let e=Number(window.localStorage.getItem(`mint:sidebar-width`));return e>=zD&&e<=BD?e:RD}),[Xe,Ze]=(0,Q.useState)(()=>window.localStorage.getItem(`mint:agent-mode`)===`true`),[Qe,$e]=(0,Q.useState)(()=>window.localStorage.getItem(`mint:plan-mode`)===`true`),[et,tt]=(0,Q.useState)(``),[nt,rt]=(0,Q.useState)(!1),it=(0,Q.useRef)(!1);(0,Q.useEffect)(()=>{if(!nt||it.current)return;it.current=!0;let e=VE();e&&le.current(e)},[nt]);let[at,ot]=(0,Q.useState)(!1),[st,lt]=(0,Q.useState)(null),ut=(0,Q.useRef)(st);ut.current=st,(0,Q.useEffect)(()=>{Ve(st?.notificationSettings,`system`,`inApp`)||he(null),(st?.notificationSettings?.enabled===!1||st?.notificationSettings?.os===!1)&&window.api?.clearAiNotifications?.()},[st]);let ft=(0,Q.useMemo)(()=>Jt(ie,s,A.map(e=>e.workspacePath)),[ie,s,A]),pt=(0,Q.useRef)(null),mt=(0,Q.useRef)(0),{proactiveSuggestion:ht,dismissProactiveSuggestion:gt,handleProactiveAction:_t}=PE(e=>pe(e)),vt=nt||at,yt=async(e,t)=>{let n={...ut.current||st||It,[e]:t};if(ut.current=n,lt(n),window.settingsApi)await window.settingsApi.saveSettings(n);else try{await _D(`user-settings`,JSON.stringify(n))}catch(e){console.error(`Failed to save settings field:`,e)}},bt=e=>{},[xt,St]=(0,Q.useState)(!1),[wt,Et]=(0,Q.useState)(null);(0,Q.useEffect)(()=>{function e(e){(e.ctrlKey||e.metaKey)&&e.key===`k`?(e.preventDefault(),St(e=>!e)):e.key===`Escape`&&St(!1)}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let Dt=a.refreshHistory,Ot=(0,Q.useCallback)(async()=>{try{await a.refreshSessions()}catch(e){console.error(`Failed to refresh chat sessions:`,e)}},[a]),At=a.loadOlder,Mt=(0,Q.useRef)(new Map),Pt=(0,Q.useCallback)(async(e,t)=>{let n=(Mt.current.get(e)??Promise.resolve()).catch(()=>{}).then(async()=>{await eD(e,t),await Ot()});Mt.current.set(e,n);try{await n}catch(e){console.error(`Failed to update session workspace:`,e),pe(Ct(e))}finally{Mt.current.get(e)===n&&Mt.current.delete(e)}},[Ot]),Lt=(0,Q.useCallback)(async()=>{try{return await sD()||null}catch{return null}},[]);(0,Q.useEffect)(()=>{Promise.allSettled([aD().then(de),Dt(),Ot(),window.settingsApi?.getSettings().then(e=>{let t=Nt(ct(e));lt(t),kt({...It,...t})})]).then(e=>{let t=e.find(e=>e.status===`rejected`);t?.status===`rejected`&&pe(Ct(t.reason)),rt(!0)});let e=window.api.onSpotlightToChat(e=>{P(`chat`),a.compose(e)}),t=()=>{aD().then(de).catch(()=>{}),window.settingsApi?.getSettings?.().then(e=>{if(e){let t=Nt(ct(e));lt(t),kt(t)}}).catch(()=>{}),window.api?.clearAiNotifications?.()};window.addEventListener(`focus`,t),window.api?.onSettingsChanged?.(e=>{let t=Nt(ct(e));lt(t),kt(t),aD().then(de).catch(()=>{})});let n=tD(`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(()=>ot(!0),1e4);return()=>window.clearTimeout(e)},[]),(0,Q.useEffect)(()=>{t===`workspace`&&!Xe&&sn(!0)},[t,Xe]);let Rt=e=>{tt(e),setTimeout(()=>tt(t=>t===e?``:t),3e3)},zt=async(t,n=!1)=>{if(!e)window.open(t,`_blank`,`noopener,noreferrer`);else try{Rt(`Opening Co-browsing browser (Mint Auto)...`);let{invoke:e}=await De(async()=>{let{invoke:e}=await import(`./core-Mi3s5D4_.js`).then(e=>(e.a(),e.i));return{invoke:e}},__vite__mapDeps([23,1]));await e(`open_mint_browser`,{url:t})}catch(e){if(n)throw e;Rt(`Could not open browser: ${String(e)}`)}},Bt=async(t,n,r)=>{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&&r===`external`?window.open(`about:blank`,`_blank`):null;i&&(i.opener=null);try{let a=await x.startHtmlPreview(t,n,!e&&r===`mint`);if(r===`mint`)e&&await zt(a.url,!0);else if(e){let{invoke:e}=await De(async()=>{let{invoke:e}=await import(`./core-Mi3s5D4_.js`).then(e=>(e.a(),e.i));return{invoke:e}},__vite__mapDeps([23,1]));await e(`run_desktop_action`,{action:{type:`open_url`,target:a.url}})}else{if(!i)throw Error(`Allow browser popups, then open the HTML file again.`);i.location.replace(a.url)}Rt(`HTML preview is running. Open Tools → Background tasks to view or stop the server.`)}catch(e){throw i?.close(),e}},Vt=()=>{Ie(!0);let e=`terminal:${Date.now()}:${Math.random().toString(36).slice(2,7)}`;Oe(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 Pe(e),[...t,a]})},Ht=e=>{Ie(!0),Oe(t=>t.some(t=>t.id===e)?t:[...t,{id:e,kind:e,title:e===`sources`?`Sources`:e===`mods`?`Mods`:`Background tasks`}]),Pe(e)},Ut=()=>{Ie(!1),requestAnimationFrame(()=>document.querySelector(`.tools-panel-toggle`)?.focus())},Wt=(e=`https://www.google.com`)=>{zt(e)},Gt=e=>{Oe(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 Pe(r),[...t,i]})},Kt=e=>{let t=Ee.find(t=>t.id===e);if(!t)return;let n=window.prompt(`Rename tab`,t.title)?.trim();n&&Oe(t=>t.map(t=>t.id===e?{...t,title:n}:t))},qt=e=>{Oe(t=>t.filter(t=>t.id===e)),Pe(e)},Yt=()=>{Oe(e=>{let t=e.find(e=>e.kind===`terminal`);if(!t){let t=`terminal:${Date.now()}:${Math.random().toString(36).slice(2,7)}`;return Pe(t),[...e,{id:t,kind:`terminal`,title:`Terminal`}]}return Pe(e=>e===t.id?null:t.id),e})},Xt=async()=>{try{let e=await window.settingsApi.checkForUpdates();Rt(e?.available?`Mint ${e.version} is available.`:`Mint is up to date.`)}catch(e){Rt(`Could not check for updates: ${String(e)}`)}},Zt=e=>{if(!Me.current.accept(e))return;Ie(!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])}`;Oe(r=>[...r.filter(e=>e.id!==n),{id:n,kind:`preview`,title:t,artifact:e}]),Pe(n)},Qt=async(e,t)=>{Ie(!0),Ae.current??=Ly({readWorkspaceFile:(e,t)=>_.readWorkspaceFile(e,t),readWorkspaceImage:(e,t)=>_.readWorkspaceImage(e,t),readWorkspaceMedia:(e,t)=>_.readWorkspaceMedia(e,t),startHtmlPreview:(e,t)=>x.startHtmlPreview(e,t),selectIfOpen:e=>ke.current.some(t=>t.id===e)?(Pe(e),!0):!1,open:Zt}),await Ae.current(e,t)},$t=e=>{Ie(!0),Oe(t=>[...t.filter(t=>t.id!==e.id),e]),Pe(e.id)},en=()=>{let e=Xy([...C.map(e=>{let t=String(e.id);return Jy(D[t]??e.agentActivity??[])}),Jy(S)]);Ie(!0),Oe(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 Pe(r),[...t,i]})},tn=e=>{Oe(t=>{let n=t.findIndex(t=>t.id===e),r=t.filter(t=>t.id!==e);return Pe(t=>t===e?r[Math.max(0,n-1)]?.id??null:t),r})},nn=()=>{Oe([]),Pe(null)},rn=()=>{if(window.innerWidth<=760){j(!1);return}let e=!we;window.localStorage.setItem(`mint:sidebar-collapsed`,String(e)),Te(e),j(!1)},an=e=>{Ye(Math.max(VD,Math.min(BD,e)))},on=e=>{if(e<VD){Ye(RD),window.localStorage.setItem(`mint:sidebar-width`,String(RD)),window.localStorage.setItem(`mint:sidebar-collapsed`,`true`),Te(!0);return}let t=Math.max(zD,Math.min(BD,e));Ye(t),window.localStorage.setItem(`mint:sidebar-width`,String(t))},sn=e=>{window.localStorage.setItem(`mint:agent-mode`,String(e)),Ze(e)},cn=e=>{window.localStorage.setItem(`mint:plan-mode`,String(e)),$e(e)},ln=(e,t=!0)=>{let n=e.trim();a.selectWorkspace(n);let r=a.getSnapshot().conversationId;t&&pE(r,A)&&Pt(r,n||null)},un=a.resolveApproval,dn=a.cancel;async function fn(e,t={}){a.getSnapshot().sending||(pe(``),xe.current=!0,Ce.current=!0,be(e=>({...e,live:!0,"live-extended":!0})),await a.sendPrompt(e,{...t,agentMode:Xe,planMode:Qe}))}async function pn(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 TD(t,s||null,o)}catch{e=null}if(e&&e.kind!==`not_handled`){a.clearComposer(),await Tn(t,e);return}let n=iE(t);if(n.handled){if(a.clearComposer(),n.action===`open_image_picker`){document.getElementById(`vision-file-input`)?.click();return}if(n.action===`paste_image`){nD().then(e=>{e&&a.attachImage({dataUri:e,name:`Clipboard Image`})}).catch(()=>{});return}if(n.action===`generate_veo`){P(`veo`);return}if(n.action===`open_settings`){window.location.hash=`#/settings`;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=KE(`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),$E(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(st?.mcpServers||{}).filter(([,e])=>e?.disabled!==!0).map(([e])=>e).find(e=>RegExp(`(^|\\s)@${e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}(\\s|$)`).test(t));await fn(f,{imageAttachments:n,videoAttachments:r,documentAttachment:i,clearComposer:!0,pinnedMcpServer:p,forceAgentMode:!!p})}async function mn(e,t){let n=e.trim()||`Voice message`;n&&!m&&await fn(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 hn(e){let t=e.target.files?.[0];if(t)try{let e=Ft(t).objectUrl,n=await Tt(t),r=await dt(n).catch(()=>n);a.attachImage({dataUri:n,previewDataUri:r,objectUrl:e,name:t.name})}catch(e){pe(Ct(e))}finally{e.target.value=``}}async function gn(e){let t=e.target.files?.[0];if(t)try{if(t.size>26214400){pe(`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){pe(Ct(e))}finally{e.target.value=``}}function _n(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-mt.current>100&&(mt.current=e,nD().then(e=>{e&&dt(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 Tt(n).then(e=>{let t=n.name&&n.name!==`image.png`?n.name:`Pasted image`;dt(e).catch(()=>e).then(n=>{a.attachImage({dataUri:e,previewDataUri:n,name:t})})}).catch(e=>pe(Ct(e))),!0}async function vn(e){let t=e.target.files?.[0];if(t)try{if(!ww(t.name))throw Error(`Unsupported document type`);a.attachDocument({filename:t.name,dataUri:await jt(t)})}catch(e){pe(Ct(e))}finally{e.target.value=``}}function yn(){sn(!0);let e=a.getSnapshot().message.trim();a.compose(e?`Search web: ${e}`:`Search web: `)}async function bn(n,r=!1){let i=e&&(r||t===`workspace`)?`workspace`:`chat`;await a.selectProject(async()=>{let e=n||await cD();return e&&r_.restore(e),e},{openSession:(e,t)=>Dn(e.id,e,t),newChat:(e,t)=>Cn(`New chat`,e,t),showCurrentView:e=>P(e,a.getSnapshot().conversationId)},i)}function xn(){ne(!0)}async function F(){ne(!1),await new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(()=>e())));try{await window.api.startVision()}catch(e){pe(Ct(e))}}function Sn(e){dt(e).catch(()=>e).then(t=>{a.attachImage({dataUri:e,previewDataUri:t,name:`Screen capture`}),ne(!1)})}async function Cn(e,t,r=`chat`){try{if(e===`New chat`){let e=BE();if(ee(e),n(r),ln(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){pe(Ct(e))}}function I(e,t){let n={id:Date.now(),userText:e,aiText:t,createdAt:new Date().toISOString(),provider:`system`,model:`mint-cli`};a.appendInteraction(n),$E(o,e,t,`system`,`mint-cli`).catch(()=>{})}function wn(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 Tn(e,t){switch(t.kind){case`message`:I(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&&ln(n.path),t.effects.some(e=>e.kind===`workspace_files_changed`)&&re(e=>e+1);let r=t.effects.find(e=>e.kind===`plan_mode_changed`);r&&$e(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&&I(e,t.markdown),t.effects.some(e=>e.kind!==`history_cleared`&&e.kind!==`workspace_changed`)&&(window.settingsApi?.getSettings?.().then(e=>e&<(e)).catch(()=>{}),aD().then(de).catch(()=>{}));break}case`navigate`:t.markdown&&I(e,t.markdown),P(wn(t.target));break;case`forward_to_agent`:t.plan_mode&&$e(!0),t.agent_mode&&Ze(!0),await fn(t.prompt,{clearComposer:!0});break;case`needs_choice`:Et({command:t.command,title:t.title,options:t.options})}}function En(e,t){e===`live`&&(xe.current=t),e===`live-extended`&&(Ce.current=t),be(n=>({...n,[e]:t}))}async function Dn(e,t,n=`chat`){ce.current+=1,window.localStorage.setItem(PD,e),LE(),ee(e),P(n,e);let r=t??A.find(t=>t.id===e);r&&(r.workspacePath?r.workspacePath!==s&&ln(r.workspacePath,!1):s&&ln(``,!1));try{await a.refreshHistory()}catch(e){pe(Ct(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 XE(`cli`),await Dt(),await Ot(),Rt(`CLI session history cleared`)}catch(e){pe(Ct(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 ZE(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??BE():n;r!==n&&(t.length>0&&t[0]?.id?(window.localStorage.setItem(PD,r),typeof window<`u`&&window.history.replaceState({},``,`/chat/${encodeURIComponent(r)}`)):(window.localStorage.removeItem(PD),typeof window<`u`&&window.history.replaceState({},``,`/chat`)),ee(r),await a.refreshHistory()),await Ot()}catch(e){pe(Ct(e))}}async function An(e,t){if(t.trim())try{await QE(e,t.trim()),await Ot()}catch(e){pe(Ct(e))}}function jn(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=(st?.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 Mn(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 Nn(e){try{let t=await window.settingsApi.getSettings();if(t.aiProvider===e)return;t.aiProvider=e,await window.settingsApi.saveSettings(t),lt(t),de(await aD());let n=jn(e,Mn(t,e));C.length>0&&(await $E(o,n,``,`system`,`provider_change`),await Dt())}catch(e){pe(Ct(e))}}async function Pn(e){try{let t=await window.settingsApi.getSettings(),n=t.aiProvider;if(Mn(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),lt(t),de(await aD());let r=jn(n,e);C.length>0&&(await $E(o,r,``,`system`,`provider_change`),await Dt())}catch(e){pe(Ct(e))}}async function Fn(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),lt(n),de(await aD());let r=jn(e,t);C.length>0&&(await $E(o,r,``,`system`,`provider_change`),await Dt())}catch(e){pe(Ct(e))}}async function In(e){try{let t=await window.settingsApi.getSettings();if(t.geminiLiveVoice===e)return;t.geminiLiveVoice=e,await window.settingsApi.saveSettings(t),lt(t)}catch(e){pe(Ct(e))}}let Ln={interactions:C,hasOlder:w,sendingInteractionId:T===o?E:null,sending:m&&T===o,sendingMessage:T===o?h:``,sendingImageCount:T===o?g:0,sendingVideoCount:T===o?v:0,streamedReply:T===o?y:``,streamedResponse:T===o?b:null,agentProgress:T===o?S:[],agentActivitySnapshots:D,thinkingExpanded:ye,message:c,imageAttachments:l,videoAttachments:u,documentName:d?.filename??``,pendingApproval:O[o]??null,agentMode:Xe,planMode:Qe,status:ue,workspacePath:s,chatId:o,recentWorkspacePaths:ft,chatEnd:pt,welcomeInteraction:HD,settingsConfig:st,slashChoice:wt,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},Rn={onSelectSlashChoice:e=>{if(!wt)return;let t=`${wt.command} ${e}`;Et(null),requestAnimationFrame(()=>document.getElementById(`chat-input`)?.focus()),TD(t,s||null,o).then(e=>Tn(t,e)).catch(()=>{})},onDismissSlashChoice:()=>Et(null),onLoadOlder:At,onThinkingExpandedChange:En,onSubmit:pn,onSelectImage:hn,onSelectVideo:gn,onSelectDocument:vn,onPasteImage:_n,onSetMessage:a.compose,subscribeMessage:a.subscribe,getMessage:()=>a.getSnapshot().message,onSendVoiceMessage:mn,onRemoveImage:a.removeImage,onRemoveVideo:a.removeVideo,onRemoveDocument:()=>a.attachDocument(null),onStartWebSearch:yn,onCaptureScreen:xn,onSetAgentMode:sn,onSetPlanMode:e?cn:void 0,onSetProvider:Nn,onSelectWorkspace:bn,onWorkspaceChanged:()=>re(e=>e+1),onApproval:un,onUpdateSettings:e=>lt(e),onSetModel:Pn,onSelectModelAndProvider:Fn,onCancelMessage:dn,onClearMessages:()=>Cn(`Clear history`),onSetGeminiLiveVoice:In,onToggleMobileSidebar:()=>j(!te),onBackToCode:()=>P(`code`),onOpenArtifact:Zt,onOpenReview:e?$t:void 0,onRemoveQueuedPrompt:a.removeQueuedPrompt,onEditQueuedPrompt:a.editQueuedPrompt,onClearQueuedPrompts:a.clearQueuedPrompts,onSteerQueuedPrompt:a.steerQueuedPrompt,onResumeQueue:a.resumeQueue},zn=Xb(rn),Bn=Xb(an),Vn=Xb(on),Hn=Xb(Cn),Un=Xb(Dn),Wn=Xb(kn),Gn=Xb(An),Kn=Xb(P),qn=Xb(Lt),Jn=Xb(On);return(0,$.jsxs)(`div`,{className:`app-container ${vt?``:`is-loading`}`,children:[M&&(0,$.jsx)(ET,{onClose:()=>ne(!1),onAttach:Sn,capture:()=>cE(e),onLiveTranslate:e?()=>{F()}:void 0}),e&&(0,$.jsx)(PT,{sidebarCollapsed:we,onToggleSidebar:rn,onNewChat:()=>Cn(`New chat`),onOpenWorkspace:()=>bn(void 0,!0),onShowWorkspace:()=>{Ie(!1),P(`workspace`)},onOpenTerminal:Vt,onToggleTerminal:Yt,onOpenBrowser:()=>Wt(),toolsPanelOpen:Fe,backgroundTaskCount:Ue,onToggleToolsPanel:()=>Ie(e=>!e),onOpenSettings:()=>P(`settings`),onCheckForUpdates:Xt,onShowAbout:()=>Rt(`Mint Agent — AI workspace`),workspacePath:s,workspaceActive:t===`workspace`&&!Fe,workspaceRevision:N,sending:m,onWorkspaceUndoError:Rt,onRefreshWorkspace:()=>re(e=>e+1)}),me&&(0,$.jsxs)(`section`,{className:`mint-notification-notice`,role:`status`,"data-kind":me.type,children:[(0,$.jsx)(`span`,{children:me.message}),me.chatId&&(0,$.jsx)(`button`,{type:`button`,onClick:()=>{ge.current(me.chatId),he(null)},children:`Open chat`}),(0,$.jsx)(`button`,{type:`button`,"aria-label":`Dismiss notification`,onClick:()=>he(null),children:`×`})]}),fe&&(0,$.jsx)(BT,{message:fe,onDismiss:()=>pe(``)},fe),(0,$.jsxs)(`div`,{className:`app-body ${we&&window.innerWidth>760?`sidebar-collapsed`:``} ${t===`pictures`?`pictures-open`:``} ${te?`mobile-sidebar-open`:``} ${Fe?`tool-surface-active`:``}`,style:{"--sidebar-expanded-width":`${Je}px`,"--terminal-dock-size":`${Ge}px`,"--tool-surface-width":`${Ge}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}}),et&&(0,$.jsx)(`div`,{role:`status`,style:{position:`fixed`,bottom:22,right:22,zIndex:1e4,padding:`12px 18px`,borderRadius:10,background:`var(--bg-surface)`,color:`var(--text-main)`,border:`1px solid var(--border-color)`},children:et}),(0,$.jsx)(MT,{view:t,sidebarCollapsed:we,sending:m,onToggleSidebar:zn,onSidebarResize:Bn,onSidebarResizeEnd:Vn,onClearHistory:Hn,chatSessions:A,activeConversationId:o,onSelectConversation:Un,onDeleteConversation:Wn,onRenameConversation:Gn,onSetView:Kn,isSearchOpen:xt,onSetSearchOpen:St,showWorkspaceTab:e,promoteMediaStudios:!e,activeWorkspacePath:s,recentWorkspacePaths:ie,onBrowseFolder:e?qn:void 0,onUpdateSessionWorkspace:Pt,onNewChatInProject:Jn}),(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:[ht&&(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:ht.message}),(0,$.jsx)(`button`,{className:`proactive-dismiss-btn`,onClick:gt,children:`Dismiss`})]}),(0,$.jsx)(`div`,{className:`proactive-chips`,children:ht.suggestions?.map((e,t)=>(0,$.jsx)(`button`,{className:`suggestion-chip`,onClick:()=>_t(e.action),children:e.label},t))})]}),t===`workspace`&&(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(WE,{}),children:(0,$.jsx)(UD,{agentMode:Xe,sending:m,workspacePath:s,onEnableAgentMode:()=>sn(!0),onSetMessage:a.compose,onWorkspaceReady:ln,refreshRevision:N,onOpenHtml:Bt,onOpenPreview:Qt},s)}),(0,$.jsx)(cT,{conversation:Ln,actions:Rn,tools:{modsPanelTarget:Re,onOpenMods:()=>Ht(`mods`),open:Fe,backgroundTaskCount:Ue,onToggle:e?void 0:()=>Ie(e=>!e)}})]}),Fe&&(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(WE,{}),children:(0,$.jsx)(WD,{surfaces:Ee,activeSurfaceId:Ne,workspacePath:s,desktopTools:e,onDropWorkspaceFile:e?e=>Qt(e.root,e.path):void 0,backgroundTaskCount:Ue,sourceCount:Le.sources.length,onOpenSources:()=>Ht(`sources`),sourcesContent:(0,$.jsx)(GT,{...Le,onRetry:Le.retry,onOpenLibrary:e=>{window.history.pushState({},``,e),window.dispatchEvent(new PopStateEvent(`popstate`)),Ie(!1)},onOpenArtifact:Zt},o),onOpenMods:()=>Ht(`mods`),onOpenBackgroundTasks:()=>Ht(`background`),onModsPanelTarget:ze,onBackgroundPanelTarget:He,terminalSize:Ge,onSelect:Pe,onClose:tn,onCloseAll:nn,onDuplicate:Gt,onRename:Kt,onCloseOthers:qt,onOpenTerminal:Vt,onOpenBrowser:()=>Wt(),onOpenReview:en,onOpenFiles:()=>{Pe(null),Ie(!1),P(`workspace`)},onOpenSideChat:()=>{Pe(null),Ie(!1)},onClosePanel:Ut,onResizeTerminal:e=>{Ke(e),qe.current&&clearTimeout(qe.current),qe.current=setTimeout(()=>{window.localStorage.setItem(`mint:terminal-right-width`,String(e))},250)},onResizePanel:e=>{Ke(e),qe.current&&clearTimeout(qe.current),qe.current=setTimeout(()=>{window.localStorage.setItem(`mint:terminal-right-width`,String(e))},250)}})}),(0,$.jsx)(TE,{workspacePath:s,panelTarget:Be,onCountChange:We}),t===`skills`&&(0,$.jsx)(`div`,{className:`web-view-scroll`,style:{flex:1,overflowY:`auto`,background:`transparent`},children:(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(WE,{}),children:(0,$.jsx)(GD,{listSkills:dD,addSkill:fD,deleteSkill:pD,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)(WE,{}),children:(0,$.jsx)(JD,{config:st||It,updateField:yt,detectTools:mD,onReauth:hD,listServerTools:gD})})}),t===`plugins`&&(0,$.jsx)(`div`,{className:`web-view-scroll`,style:{flex:1,overflowY:`auto`,background:`transparent`},children:(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(WE,{}),children:(0,$.jsx)(YD,{config:st||It,updateField:yt,handleConnectPlugin:bt})})}),t===`cron`&&(0,$.jsx)(`div`,{className:`web-view-scroll`,style:{flex:1,overflowY:`auto`,background:`transparent`},children:(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(WE,{}),children:(0,$.jsx)(KD,{listCronJobs:vD,addCronJob:yD,removeCronJob:bD,setCronJobEnabled:xD,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)(WE,{}),children:(0,$.jsx)(qD,{listLinkedFolders:SD,addLinkedFolder:CD,removeLinkedFolder:wD,linkedFolderStatus:ED,refreshLinkedFolder:DD,listLinkedFolderNotes:OD,readLinkedFolderNote:kD,openLinkedFolderNote:AD,canOpenNote:lD(),selectFolder:cD})})}),t===`code`&&(0,$.jsx)(`div`,{className:`web-view-scroll`,style:{flex:1,overflowY:`auto`,background:`transparent`},children:(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(WE,{}),children:(0,$.jsx)(XD,{chatSessions:A,activeConversationId:o,workspacePath:s,recentWorkspacePaths:ft,onSelectFolder:se,onSelectSession:e=>{Dn(e)},onDeleteSession:kn,onRenameSession:An,onRefreshSessions:Ot,onShowToast:Rt})})}),t===`pictures`&&(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(WE,{}),children:(0,$.jsx)(ZD,{chatId:o,onClose:()=>P(`chat`),onOpenConversation:e=>{Dn(e)}})}),t===`imagine`&&(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(WE,{}),children:(0,$.jsx)(QD,{view:t,onSendToChat:async(e,t)=>{try{let n=await fetch(uD(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 Tt(new File([r],i,{type:r.type||`image/png`})),s=await dt(o).catch(()=>o);P(`chat`),a.compose(t),a.attachImage({dataUri:o,previewDataUri:s,name:i})}catch(e){Rt(`Could not attach image: ${Ct(e)}`)}}})}),t===`veo`&&(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(WE,{}),children:(0,$.jsx)($D,{view:t,onSendToChat:e=>{P(`chat`),a.compose(e)}})})]}),(0,$.jsx)(`div`,{className:`startup-loading ${vt?`is-hidden`:``}`,"aria-live":`polite`,"aria-busy":!vt,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`})]})}),xt&&(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(eO,{isOpen:!0,onClose:()=>St(!1),onSelectChat:e=>{Dn(e),St(!1)},onNewChat:()=>{Cn(`New chat`),St(!1)},onSelectWorkspace:e?bn:void 0,onOpenSettings:()=>{P(`settings`),St(!1)},onChangeView:e=>{P(e),St(!1)},onChangeModel:e=>{yt(`model`,e),tt(`Switched model to ${e}`)},onChangeProvider:e=>{yt(`provider`,e),tt(`Switched provider to ${e}`)},onExecuteSlash:e=>{a.compose(e+` `),St(!1)},chatSessions:A,currentChatId:o,workspacePath:s})})]})}var Q,$,XE,ZE,QE,$E,eD,tD,nD,rD,iD,aD,oD,sD,cD,lD,uD,dD,fD,pD,mD,hD,gD,_D,vD,yD,bD,xD,SD,CD,wD,TD,ED,DD,OD,kD,AD,jD,MD,ND,PD,FD,ID,LD,RD,zD,BD,VD,HD,UD,WD,GD,KD,qD,JD,YD,XD,ZD,QD,$D,eO,tO=t((()=>{Ry(),We(),Me(),zy(),Q=e(i()),$y(),ke(),$=a(),ST(),kT(),NT(),RT(),HT(),JT(),eE(),Qb(),nE(),pt(),Yt(),i_(),aE(),lE(),CE(),_E(),Et(),NE(),Dw(),FE(),Te(),{clearChatHistory:XE,deleteChatSession:ZE,renameChatSession:QE,saveSystemInteraction:$E,updateChatSessionWorkspace:eD,listen:tD,readClipboardImage:nD,listChatSessions:rD,pendingCompanionChat:iD}=Ae,{getRuntimeStatus:aD,setActiveModel:oD,selectWorkspaceDirectory:sD,selectLinkedFolderPath:cD,isTauriRuntime:lD}=_,{convertFileSrc:uD}=j,{listLearnedSkills:dD,addLearnedSkill:fD,deleteLearnedSkill:pD,detectSystemTools:mD,reauthMcpServer:hD,listMcpServerTools:gD,setProfileValue:_D,listCronJobs:vD,addCronJob:yD,removeCronJob:bD,setCronJobEnabled:xD,listLinkedFolders:SD,addLinkedFolder:CD,removeLinkedFolder:wD,runSlashCommand:TD,linkedFolderStatus:ED,refreshLinkedFolder:DD,listLinkedFolderNotes:OD,readLinkedFolderNote:kD,openLinkedFolderNote:AD}=M,jD=`mint:last-workspace-path`,MD=`mint:recent-workspace-paths`,ND=8,PD=`mint:active-conversation-id`,FD=`mint:last-active-timestamp`,ID=18e5,LD=`mint:draft:`,RD=264,zD=200,BD=420,VD=170,HD={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. 💖
|
|
62
|
+
|
|
63
|
+
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()},UD=(0,Q.lazy)(()=>De(()=>import(`./WorkspacePanel-BfHKkulU.js`),__vite__mapDeps([25,1]))),WD=(0,Q.lazy)(()=>De(()=>import(`./ToolSurfacePage-B0J_q0Jl.js`),__vite__mapDeps([26,1,2,3,4,23,24,27]))),GD=(0,Q.lazy)(()=>De(()=>import(`./SkillsView-C-gp9J7m.js`),__vite__mapDeps([28,1,2,17,3,4,18]))),KD=(0,Q.lazy)(()=>De(()=>import(`./ScheduledTasksView-5uw9-V9H.js`),__vite__mapDeps([29,1,2,17,3,4,18,16,19]))),qD=(0,Q.lazy)(()=>De(()=>import(`./LinkedFoldersView-CKRgroWK.js`),__vite__mapDeps([30,1,2,17,3,4,18]))),JD=(0,Q.lazy)(()=>De(()=>import(`./McpServersView-D3wHnuHg.js`),__vite__mapDeps([31,1,2,3,4,17,18,16,19,32]))),YD=(0,Q.lazy)(()=>De(()=>import(`./PluginsView-jBYmcKh4.js`),__vite__mapDeps([33,1,2,17,3,4,18,34]))),XD=(0,Q.lazy)(()=>De(()=>import(`./CliSessionsView-MI8kXMAb.js`),__vite__mapDeps([35,1,2,17,3,4,18,16,19,36,37]))),ZD=(0,Q.lazy)(()=>De(()=>import(`./LibraryPage-WlviRdR8.js`),__vite__mapDeps([38,1,2,3,4,39]))),QD=(0,Q.lazy)(()=>De(()=>import(`./ImageStudioPanel-BP7N4rLr.js`),__vite__mapDeps([40,1,2,3,4,17,18,16,19,41,42]))),$D=(0,Q.lazy)(()=>De(()=>import(`./VeoStudioPanel-DfsOJKv0.js`),__vite__mapDeps([43,1,2,3,4,17,18,16,19,41,44,45]))),eO=(0,Q.lazy)(()=>De(async()=>{let{CommandPalette:e}=await import(`./CommandPalette-BD8SlTE5.js`);return{CommandPalette:e}},__vite__mapDeps([46,1,2])).then(({CommandPalette:e})=>({default:e})))})),nO=n({default:()=>YE}),rO=t((()=>{Fy(),tO()}));rO();export{Jg as A,m_ as C,r_ as D,i_ as E,ug as M,Qg as O,f_ as S,d_ as T,__ as _,Ay as a,h_ as b,qv as c,A_ as d,YE as default,j_ as f,x_ as g,T_ as h,Py as i,lg as j,Lg as k,M_ as l,k_ as m,rO as n,ky as o,D_ as p,Oy as r,Kv as s,nO as t,N_ as u,v_ as v,s_ as w,g_ as x,y_ as y};
|