@xopcai/xopc 0.0.353 → 0.0.355
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/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/activity-YogQEteU.js +1 -0
- package/dist/gateway/static/root/assets/activity-store-X7CG9pzB.js +1 -0
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BVIuZcCP.js → agent-avatar-dicebear-DiEBNuSv.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DpBmB3QX.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-DlojWUY_.js +1 -0
- package/dist/gateway/static/root/assets/agents-CeSCdUHP.js +66 -0
- package/dist/gateway/static/root/assets/app-chrome-BeB4KgOf.js +1 -0
- package/dist/gateway/static/root/assets/app-management-settings-panel-MkSa6isi.js +1 -0
- package/dist/gateway/static/root/assets/appearance-settings-B7hCkaT_.js +1 -0
- package/dist/gateway/static/root/assets/apps-page-D_CduJuC.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BZXXJvpX.js → archive-plugin-QfOaQPL_.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-C7VKkDb5.js → automations-page-uEnQawd7.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-pdiSK3Qk.js +7 -0
- package/dist/gateway/static/root/assets/{binary-plugins-DoT3g5SP.js → binary-plugins-BF2lVwR9.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-sqqrCafh.js → block-editor-r4mKGacz.js} +39 -39
- package/dist/gateway/static/root/assets/bot-DjLkhyZL.js +1 -0
- package/dist/gateway/static/root/assets/{browser-automation-inputs-CZOKsAaa.js → browser-automation-inputs-FW3bYZ-z.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-TEeTmkGP.js → browser-automations-page-Blrxyy_h.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-DGuwrO7j.js +3 -0
- package/dist/gateway/static/root/assets/{capabilities-BOrLei_L.js → capabilities-BCF_160Z.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-CF4-mrIa.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-page-DUIA2K--.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CwPNQsJS.js +8 -0
- package/dist/gateway/static/root/assets/capability-header-actions-CyvI2F5x.js +1 -0
- package/dist/gateway/static/root/assets/channels-DBxDJV8I.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-Q99iKyiO.js → chat-terminal-dock-YdxhecE7.js} +2 -2
- package/dist/gateway/static/root/assets/chevron-right-BweFrslA.js +1 -0
- package/dist/gateway/static/root/assets/circle-alert-BEjgurr2.js +1 -0
- package/dist/gateway/static/root/assets/circle-dashed-8qMD7gHf.js +1 -0
- package/dist/gateway/static/root/assets/circle-dot-BAseJTrF.js +1 -0
- package/dist/gateway/static/root/assets/circle-pause-CN9jYH2s.js +1 -0
- package/dist/gateway/static/root/assets/clock-3-DnrAnuyZ.js +1 -0
- package/dist/gateway/static/root/assets/cloud-C4-yfnnk.js +1 -0
- package/dist/gateway/static/root/assets/computer-settings-page-BuCrA8yD.js +1 -0
- package/dist/gateway/static/root/assets/connector-service-page-BiB2GYkp.js +1 -0
- package/dist/gateway/static/root/assets/connectors-page-nQAgZk-5.js +2 -0
- package/dist/gateway/static/root/assets/copy-text-row-BHDs3cBa.js +1 -0
- package/dist/gateway/static/root/assets/date-picker-BJtADyRQ.js +1 -0
- package/dist/gateway/static/root/assets/{dependency-picker-BjH8XrKb.js → dependency-picker-D-Ko0G40.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DyGxNAVW.js → desktop-pet-CVPWcWwC.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-BcN_I-7y.js +1 -0
- package/dist/gateway/static/root/assets/device-pairing-wizard-CoKKoUlt.js +1 -0
- package/dist/gateway/static/root/assets/directory-picker-path-field-m0CubGEP.js +1 -0
- package/dist/gateway/static/root/assets/dist-3h6cXXhT.js +1 -0
- package/dist/gateway/static/root/assets/dist-Che_jiQF.js +1 -0
- package/dist/gateway/static/root/assets/extension-debug-page-BrGWLJg9.js +1 -0
- package/dist/gateway/static/root/assets/extension-page-Dd88ynHj.js +1 -0
- package/dist/gateway/static/root/assets/extension-provider-CUpbXB2k.js +1 -0
- package/dist/gateway/static/root/assets/extension-settings-page-Dq1MXh6D.js +1 -0
- package/dist/gateway/static/root/assets/form-field-width-DJw_jULe.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-C_bTRQeE.js +1 -0
- package/dist/gateway/static/root/assets/git-branch-Dh9uxTot.js +1 -0
- package/dist/gateway/static/root/assets/home-page-xbqSikkK.js +1 -0
- package/dist/gateway/static/root/assets/imports-page-Cd4tcbLU.js +1 -0
- package/dist/gateway/static/root/assets/index-BuzC93X-.css +1 -0
- package/dist/gateway/static/root/assets/index-CYeGnj-L.js +106 -0
- package/dist/gateway/static/root/assets/index.module-Cd9ENXfk.js +1 -0
- package/dist/gateway/static/root/assets/interaction-BdhHBbYa.js +1 -0
- package/dist/gateway/static/root/assets/is-masked-secret-DOkL5b_X.js +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CoYdyBRh.js → keyboard-shortcuts-settings-CmalfzgQ.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-BquHHLj6.js +1 -0
- package/dist/gateway/static/root/assets/{local-apps-page-CeBhXeoX.js → local-apps-page-RPLHMvYs.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-7NMGltSw.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-zwFewbhp.js +1 -0
- package/dist/gateway/static/root/assets/markdown-view-7tzqIp_G.js +201 -0
- package/dist/gateway/static/root/assets/{media-plugins-C9ya5rUH.js → media-plugins-cjgrKnne.js} +1 -1
- package/dist/gateway/static/root/assets/message-square-fVE7Ghj1.js +1 -0
- package/dist/gateway/static/root/assets/mic-CuUb7zc-.js +1 -0
- package/dist/gateway/static/root/assets/model-display-name-DXhO9rcM.js +1 -0
- package/dist/gateway/static/root/assets/models-hub-cache-HGrORbzR.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-panel-CwMg9cvF.js +5 -0
- package/dist/gateway/static/root/assets/notes-api-J0yhflxC.js +1 -0
- package/dist/gateway/static/root/assets/notes-page-CWJwrvo7.js +8 -0
- package/dist/gateway/static/root/assets/oauth-api-CYe61zfD.js +1 -0
- package/dist/gateway/static/root/assets/page-context-capture-button-DqmAq4Ov.js +1 -0
- package/dist/gateway/static/root/assets/page-tabs-D2xpUV26.js +1 -0
- package/dist/gateway/static/root/assets/pause-DuPxgSxk.js +1 -0
- package/dist/gateway/static/root/assets/personal-page-Bbgx_dgV.js +1 -0
- package/dist/gateway/static/root/assets/play-kxZvpBg8.js +1 -0
- package/dist/gateway/static/root/assets/popover-select-DcsFzD_i.js +1 -0
- package/dist/gateway/static/root/assets/preview-open-alternatives-Dvey7GwU.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-DUPsiVP9.js → product-open-page-SsG2sljT.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-wp5cFhM7.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-Brfi519S.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-BdtF8Cvk.js +1 -0
- package/dist/gateway/static/root/assets/rotate-ccw-JM1TBLpp.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-C25xEYTK.js → runtime-tools-settings-panel-CT6HKczq.js} +2 -2
- package/dist/gateway/static/root/assets/scenes-page-BmlI42OR.js +2 -0
- package/dist/gateway/static/root/assets/schema-form-DEcsbgne.js +1 -0
- package/dist/gateway/static/root/assets/secret-input-DPl3VYM8.js +1 -0
- package/dist/gateway/static/root/assets/send-session-input-C7Nqy0sK.js +1 -0
- package/dist/gateway/static/root/assets/sessions-page-C_G8fZwV.js +1 -0
- package/dist/gateway/static/root/assets/settings-2-D-csvaET.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CDxdzwDs.js +1 -0
- package/dist/gateway/static/root/assets/settings-form-draft-Dy10ldo8.js +1 -0
- package/dist/gateway/static/root/assets/settings-form-section-exRhP9xn.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-DqCJHcdG.js → settings-page-P50kLPUz.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DtnwH0wN.js +1 -0
- package/dist/gateway/static/root/assets/share-link-dialog-COlX10Dc.js +1 -0
- package/dist/gateway/static/root/assets/share-preview-page-NtRLUieq.js +2 -0
- package/dist/gateway/static/root/assets/shares-api-DICV5EKH.js +1 -0
- package/dist/gateway/static/root/assets/shares-settings-7Ak_MsJg.js +1 -0
- package/dist/gateway/static/root/assets/skill-api-CcdHQhxd.js +1 -0
- package/dist/gateway/static/root/assets/skill-api-utils-C7V4JVXM.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-CWH3Fmx4.js +1 -0
- package/dist/gateway/static/root/assets/skill-wire-pattern-BPpeIcCi.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-ChjXDxdX.js +2 -0
- package/dist/gateway/static/root/assets/sparkles-DHlfQFAF.js +1 -0
- package/dist/gateway/static/root/assets/system-settings-panel-DAR0w3Xi.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-DEx0kXDV.js +1 -0
- package/dist/gateway/static/root/assets/tasks-Buv1mgPF.js +1 -0
- package/dist/gateway/static/root/assets/theme-store-BKgBPLH4.js +1 -0
- package/dist/gateway/static/root/assets/tunnel-api-CBy97LfF.js +1 -0
- package/dist/gateway/static/root/assets/usage-page-BdX6VPQC.js +1 -0
- package/dist/gateway/static/root/assets/use-async-resource-GrnWNwMZ.js +1 -0
- package/dist/gateway/static/root/assets/use-autosave-Cn6hqqyM.js +1 -0
- package/dist/gateway/static/root/assets/use-composer-attachments-DL61XeSu.js +2 -0
- package/dist/gateway/static/root/assets/use-file-preview-expanded-Cl9mU32w.js +2 -0
- package/dist/gateway/static/root/assets/user-model-page-CRxiQnWG.js +2 -0
- package/dist/gateway/static/root/assets/voice-api-key-field-Bw05QB_V.js +1 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BnfD6w0k.js → work-discovery-overlay-DvwmD9Ma.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DSy57rBr.js → workflow-run-setup-panel-BQ3fmhM-.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-Bl8rd4fM.js +6 -0
- package/dist/gateway/static/root/assets/workspace-api-BbBT75Kg.js +2 -0
- package/dist/gateway/static/root/index.html +61 -19
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/tasks.js +19 -2
- package/dist/src/agent/agent-manager.js +4 -4
- package/dist/src/agent/embedded/run-for-session.d.ts +1 -0
- package/dist/src/agent/embedded/run-for-session.js +2 -1
- package/dist/src/agent/embedded/run-turn.js +30 -2
- package/dist/src/agent/embedded/types.d.ts +1 -0
- package/dist/src/agent/prompt/sections/messaging-runtime.js +2 -1
- package/dist/src/agent/service/direct-turn-helpers.d.ts +1 -0
- package/dist/src/agent/service/direct-turn-helpers.js +1 -0
- package/dist/src/agent/service/process-direct-streaming.js +1 -0
- package/dist/src/agent/service.js +4 -1
- package/dist/src/agent/session/session-config-service.js +27 -1
- package/dist/src/agent/session/session-hydrator.js +1 -1
- package/dist/src/agent/tools/factory.js +21 -14
- package/dist/src/agent/tools/personal-preference-tool.d.ts +10 -0
- package/dist/src/agent/tools/personal-preference-tool.js +44 -0
- package/dist/src/agent/tools/personal-task-tool.d.ts +29 -0
- package/dist/src/agent/tools/personal-task-tool.js +184 -0
- package/dist/src/agent/tools/xopc-use-tool.js +3 -2
- package/dist/src/agent-catalog/service.d.ts +1 -1
- package/dist/src/agent-catalog/service.js +2 -1
- package/dist/src/agent-config/index.js +2 -2
- package/dist/src/agent-config/schema.d.ts +153 -1
- package/dist/src/agent-config/schema.js +42 -3
- package/dist/src/chat-commands/builtins/thinking.js +12 -2
- package/dist/src/chat-commands/context.js +7 -1
- package/dist/src/cli/commands/auth.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/models.js +2 -2
- package/dist/src/cli/commands/onboard/model.js +1 -1
- package/dist/src/cli/commands/providers.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -0
- package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/personal-agent.d.ts +3 -0
- package/dist/src/gateway/hono/routes/personal-agent.js +122 -0
- package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
- package/dist/src/gateway/hono/routes/sessions.js +5 -0
- package/dist/src/gateway/hono/routes/side-chats.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +64 -1
- package/dist/src/gateway/hono/routes/voice.js +8 -0
- package/dist/src/gateway/service/agent-runner.js +41 -0
- package/dist/src/gateway/service/run-gateway-agent.js +2 -1
- package/dist/src/gateway/service/session-command-service.js +7 -1
- package/dist/src/gateway/service/sessions-api.js +11 -1
- package/dist/src/gateway/service.js +10 -10
- package/dist/src/gateway/session-reset-service.js +5 -0
- package/dist/src/gateway/xopc-cloud-capability-setup.d.ts +9 -0
- package/dist/src/gateway/xopc-cloud-capability-setup.js +42 -2
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/personal-agent/policy.d.ts +1 -0
- package/dist/src/personal-agent/policy.js +13 -0
- package/dist/src/personal-agent/repository.d.ts +25 -0
- package/dist/src/personal-agent/repository.js +68 -0
- package/dist/src/personal-agent/service.d.ts +49 -0
- package/dist/src/personal-agent/service.js +234 -0
- package/dist/src/session/resolve-session.js +4 -2
- package/dist/src/storage/sqlite/migrations/229_task_criterion_reviews.sql +12 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/schema.sql +13 -0
- package/dist/src/storage/sqlite/session-repository.js +6 -2
- package/dist/src/storage/sqlite/transcript-repository.js +2 -1
- package/dist/src/tasks/capabilities/read.js +3 -0
- package/dist/src/tasks/task-application-service.js +6 -1
- package/dist/src/tasks/task-criterion-review-repository.d.ts +22 -0
- package/dist/src/tasks/task-criterion-review-repository.js +74 -0
- package/dist/src/tasks/task-main-update-decision-service.js +6 -0
- package/dist/src/tasks/task-main-update-delivery.js +5 -2
- package/dist/src/tasks/task-origin-repository.d.ts +4 -1
- package/dist/src/tasks/task-origin-repository.js +3 -3
- package/dist/src/tasks/task-run-coordinator.d.ts +1 -0
- package/dist/src/tasks/task-run-coordinator.js +13 -7
- package/dist/src/tasks/task-run-dispatcher.d.ts +1 -1
- package/dist/src/tasks/task-run-dispatcher.js +6 -4
- package/package.json +4 -4
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CcTnphqy.js +0 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-CdCzMPhC.js +0 -1
- package/dist/gateway/static/root/assets/agents-BiNKpndr.js +0 -66
- package/dist/gateway/static/root/assets/app-management-settings-panel-BvGDN5J6.js +0 -1
- package/dist/gateway/static/root/assets/appearance-settings-BhQYkuQj.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-BQZJuM-C.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-y4qcvlg8.js +0 -7
- package/dist/gateway/static/root/assets/browser-settings-page--N4P7V0l.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-page-F7OAv-iz.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CaiIo1S1.js +0 -8
- package/dist/gateway/static/root/assets/capability-header-actions-CR_O9_Vr.js +0 -1
- package/dist/gateway/static/root/assets/channels-Bb-8c4wl.js +0 -1
- package/dist/gateway/static/root/assets/computer-settings-page-QuXZBfky.js +0 -1
- package/dist/gateway/static/root/assets/connector-service-page-BIqzVqCO.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-CZ24DSBJ.js +0 -2
- package/dist/gateway/static/root/assets/date-picker-Ck-FmYEL.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-C1rKgB-S.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-UrPcOU6Q.js +0 -1
- package/dist/gateway/static/root/assets/directory-picker-path-field-BYxUgMZb.js +0 -1
- package/dist/gateway/static/root/assets/dist-CKkafhaS.js +0 -1
- package/dist/gateway/static/root/assets/dist-io9jFpN72.js +0 -1
- package/dist/gateway/static/root/assets/extension-debug-page-CGL0jpQA.js +0 -1
- package/dist/gateway/static/root/assets/extension-page-DPWf-tYg.js +0 -1
- package/dist/gateway/static/root/assets/extension-settings-page-DZWBY39d.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-D5w5aYXK.js +0 -1
- package/dist/gateway/static/root/assets/home-page-DPQwxBGy.js +0 -1
- package/dist/gateway/static/root/assets/imports-page-CnRWDtGz.js +0 -1
- package/dist/gateway/static/root/assets/index-B-w6Rk9Z.css +0 -1
- package/dist/gateway/static/root/assets/index-DU5Eb1V8.js +0 -106
- package/dist/gateway/static/root/assets/local-app-workbench-page-hjFeYlIq.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-CzpZDjkA.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-Beu_R_Rc.js +0 -1
- package/dist/gateway/static/root/assets/markdown-view-BlzX7Ze5.js +0 -201
- package/dist/gateway/static/root/assets/note-detail-panel-D8bpTGwP.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-OmgXowUG.js +0 -8
- package/dist/gateway/static/root/assets/page-context-capture-button-BjjjuLkz.js +0 -1
- package/dist/gateway/static/root/assets/page-tabs-_DiuzxyD.js +0 -1
- package/dist/gateway/static/root/assets/popover-select-0p9PIHRy.js +0 -1
- package/dist/gateway/static/root/assets/preview-open-alternatives-BKvUadws.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-CWlCg2x5.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-NbVNo0tP.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CD8HrqGC.js +0 -1
- package/dist/gateway/static/root/assets/scenes-page-DbWaemwR.js +0 -2
- package/dist/gateway/static/root/assets/schema-form-_3LQ4hyB.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-B7ZUdXlb.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CpKzZMft.js +0 -1
- package/dist/gateway/static/root/assets/settings-form-section-DS80hVSY.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-De-kC3yJ.js +0 -1
- package/dist/gateway/static/root/assets/share-preview-page-T-0g_rwr.js +0 -2
- package/dist/gateway/static/root/assets/shares-settings-Dz33T3du.js +0 -1
- package/dist/gateway/static/root/assets/skill-api-Cx6GGpSY.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DyJ-Duem.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-B2iyN-kP.js +0 -2
- package/dist/gateway/static/root/assets/system-settings-panel-By3SZQR_.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-4yHUTs4_.js +0 -1
- package/dist/gateway/static/root/assets/tasks-BH8_WMUF.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-BoH0LBkw.js +0 -1
- package/dist/gateway/static/root/assets/usage-page-dKU5X9zT.js +0 -1
- package/dist/gateway/static/root/assets/use-autosave-YKCwQvqT.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-Uht32LPP.js +0 -2
- package/dist/gateway/static/root/assets/voice-api-key-field-DiqHIA8l.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-Cq3vRUbc.js +0 -6
- /package/dist/gateway/static/root/assets/{dist-CI_fqRk-2.js → dist-CI_fqRk-.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t}from"./vendor-react-BOUWij0V.js";var n=e(t());function r(e,t,r,i){var a=this,o=(0,n.useRef)(null),s=(0,n.useRef)(0),c=(0,n.useRef)(0),l=(0,n.useRef)(null),u=(0,n.useRef)([]),d=(0,n.useRef)(),f=(0,n.useRef)(),p=(0,n.useRef)(e),m=(0,n.useRef)(!0),h=(0,n.useRef)(),g=(0,n.useRef)();p.current=e;var _=typeof window<`u`,v=!t&&t!==0&&_;if(typeof e!=`function`)throw TypeError(`Expected a function`);t=+t||0;var y=!!(r||={}).leading,b=!(`trailing`in r)||!!r.trailing,x=!!r.flushOnExit&&b,S=`maxWait`in r,C=`debounceOnServer`in r&&!!r.debounceOnServer,w=S?Math.max(+r.maxWait||0,t):null,T=(0,n.useMemo)(function(){var e=function(e){var t=u.current,n=d.current;return u.current=d.current=null,s.current=e,c.current=c.current||e,f.current=p.current.apply(n,t)},n=function(e,t){v&&cancelAnimationFrame(l.current),l.current=v?requestAnimationFrame(e):setTimeout(e,t)},r=function(e){if(!m.current)return!1;var n=e-o.current;return!o.current||n>=t||n<0||S&&e-s.current>=w},T=function(t){return l.current=null,b&&u.current?e(t):(u.current=d.current=null,f.current)},E=function e(){var i=Date.now();if(y&&c.current===s.current&&D(),r(i))return T(i);if(m.current){var a=t-(i-o.current);n(e,S?Math.min(a,w-(i-s.current)):a)}},D=function(){i&&i({})},O=function(){if(_||C){var i,c=Date.now(),p=r(c);if(u.current=[].slice.call(arguments),d.current=a,o.current=c,x&&!h.current&&(h.current=function(){globalThis.document?.visibilityState===`hidden`&&g.current.flush()},(i=globalThis.document)==null||i.addEventListener==null||i.addEventListener(`visibilitychange`,h.current)),p){if(!l.current&&m.current)return s.current=o.current,n(E,t),y?e(o.current):f.current;if(S)return n(E,t),e(o.current)}return l.current||n(E,t),f.current}};return O.cancel=function(){var e=l.current;e&&(v?cancelAnimationFrame(l.current):clearTimeout(l.current)),s.current=0,u.current=o.current=d.current=l.current=null,e&&i&&i({})},O.isPending=function(){return!!l.current},O.flush=function(){return l.current?T(Date.now()):f.current},O},[y,S,t,w,b,x,v,_,C,i]);return g.current=T,(0,n.useEffect)(function(){return m.current=!0,function(){var e;x&&g.current.flush(),h.current&&=((e=globalThis.document)==null||e.removeEventListener==null||e.removeEventListener(`visibilitychange`,h.current),null),m.current=!1}},[x]),T}function i(e,t){return e===t}function a(e,t,a){var o=a&&a.equalityFn||i,s=(0,n.useRef)(e),c=(0,n.useState)({})[1],l=r((0,n.useCallback)(function(e){s.current=e,c({})},[c]),t,a,c),u=(0,n.useRef)(e);return o(u.current,e)||(l(e),u.current=e),[s.current,l]}export{a as n,r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={transition:`transition-colors duration-150 ease-out`,press:`transition-transform duration-150 ease-out active:scale-95 motion-reduce:transition-none motion-reduce:active:scale-100`,pressCard:`transition-transform duration-150 ease-out active:scale-[0.98] motion-reduce:transition-none motion-reduce:active:scale-100`,focusRingPanel:`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,focusRingBase:`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-base`,disabled:`disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none`},t=`touch-target rounded-lg p-2 text-fg-muted transition-colors transition-transform duration-150 ease-out hover:bg-surface-hover hover:text-fg active:scale-95 motion-reduce:transition-none motion-reduce:active:scale-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`;export{e as n,t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return e===`***`||e===`••••••••••••`||/^•+$/.test(e)}function t(e){return e>0?`•`.repeat(e):``}export{e as n,t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./messages-DPw2X06D.js";import{t as a}from"./cn-JdwAhgNB.js";import{n as o}from"./locale-store-Y1aBayM_.js";import{n as s}from"./electron-env-Dit0bHgy.js";import{Ai as c,Di as l,Ei as u,Oi as d,P as f,Ti as p,gn as m,ji as h,ki as g}from"./index-DU5Eb1V8.js";import{n as _,r as v}from"./settings-page-layout-X1x-2Cp9.js";var y=n(),b=e(t(),1),x=r(),S=d(),C=S?`⌘`:`Ctrl`;function w(e){let t=(0,y.c)(54),{title:n,description:r,shortcut:s,otherShortcut:l,defaultShortcut:u,setShortcut:d,legacyRecordingEvent:f,notice:p}=e,h=o(E),_;t[0]===h?_=t[1]:(_=i(h),t[0]=h,t[1]=_);let v=_.keyboardShortcutsSettings,[C,w]=(0,b.useState)(!1),[D,O]=(0,b.useState)(null),k,A;t[2]!==f||t[3]!==C?(k=()=>{let e={active:C};return window.dispatchEvent(new CustomEvent(m,{detail:e})),f&&window.dispatchEvent(new CustomEvent(f,{detail:e})),()=>{let e={active:!1};window.dispatchEvent(new CustomEvent(m,{detail:e})),f&&window.dispatchEvent(new CustomEvent(f,{detail:e}))}},A=[f,C],t[2]=f,t[3]=C,t[4]=k,t[5]=A):(k=t[4],A=t[5]),(0,b.useEffect)(k,A);let j;t[6]!==v.quickCaptureShortcutConflict||t[7]!==l||t[8]!==C||t[9]!==d?(j=e=>{if(!C)return;if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){w(!1);return}let t=c(e.nativeEvent);if(!t)return;let n=S?`meta`:`control`;if(new Set([`${n}+k`,`${n}+n`,`${n}+b`,`${n}+,`]).has(t)||t===l){O(v.quickCaptureShortcutConflict);return}d(t),O(null),w(!1)},t[6]=v.quickCaptureShortcutConflict,t[7]=l,t[8]=C,t[9]=d,t[10]=j):j=t[10];let M=j,N;t[11]===n?N=t[12]:(N=(0,x.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n}),t[11]=n,t[12]=N);let P;t[13]===r?P=t[14]:(P=(0,x.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:r}),t[13]=r,t[14]=P);let F;t[15]!==N||t[16]!==P?(F=(0,x.jsxs)(`div`,{className:`min-w-0`,children:[N,P]}),t[15]=N,t[16]=P,t[17]=F):F=t[17];let I;t[18]===s?I=t[19]:(I=g(s).map(T),t[18]=s,t[19]=I);let L;t[20]===I?L=t[21]:(L=(0,x.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:I}),t[20]=I,t[21]=L);let R;t[22]!==F||t[23]!==L?(R=(0,x.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[F,L]}),t[22]=F,t[23]=L,t[24]=R):R=t[24];let z,B;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(z=a(`rounded-lg bg-accent px-3 py-1.5 text-sm font-medium text-on-accent transition-colors hover:bg-accent-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-base`),B=()=>{O(null),w(!0)},t[25]=z,t[26]=B):(z=t[25],B=t[26]);let V;t[27]!==v.quickCaptureShortcutChange||t[28]!==M?(V=(0,x.jsx)(`button`,{type:`button`,className:z,onClick:B,onKeyDown:M,children:v.quickCaptureShortcutChange}),t[27]=v.quickCaptureShortcutChange,t[28]=M,t[29]=V):V=t[29];let H;t[30]!==u||t[31]!==d?(H=()=>{d(u()),O(null)},t[30]=u,t[31]=d,t[32]=H):H=t[32];let U;t[33]!==v.quickCaptureShortcutReset||t[34]!==H?(U=(0,x.jsx)(`button`,{type:`button`,className:`rounded-lg px-3 py-1.5 text-sm font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:H,children:v.quickCaptureShortcutReset}),t[33]=v.quickCaptureShortcutReset,t[34]=H,t[35]=U):U=t[35];let W;t[36]!==v.quickCaptureShortcutRecording||t[37]!==M||t[38]!==C?(W=C?(0,x.jsx)(`button`,{type:`button`,className:`rounded-lg bg-accent-soft px-3 py-1.5 text-sm font-medium text-accent-fg outline-none focus-visible:ring-2 focus-visible:ring-accent`,onKeyDown:M,onClick:()=>w(!1),children:v.quickCaptureShortcutRecording}):null,t[36]=v.quickCaptureShortcutRecording,t[37]=M,t[38]=C,t[39]=W):W=t[39];let G;t[40]!==V||t[41]!==U||t[42]!==W?(G=(0,x.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[V,U,W]}),t[40]=V,t[41]=U,t[42]=W,t[43]=G):G=t[43];let K;t[44]===D?K=t[45]:(K=D?(0,x.jsx)(`p`,{className:`mt-2 text-sm text-danger-fg`,children:D}):null,t[44]=D,t[45]=K);let q;t[46]===p?q=t[47]:(q=p?(0,x.jsx)(`div`,{className:`mt-3 rounded-lg bg-surface-base/55 p-3`,children:p}):null,t[46]=p,t[47]=q);let J;return t[48]!==R||t[49]!==G||t[50]!==K||t[51]!==q||t[52]!==n?(J=(0,x.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 px-4 py-3.5 sm:px-5 sm:py-4`,"aria-label":n,children:[R,G,K,q]}),t[48]=R,t[49]=G,t[50]=K,t[51]=q,t[52]=n,t[53]=J):J=t[53],J}function T(e,t){return(0,x.jsx)(R,{children:e},`${e}-${String(t)}`)}function E(e){return e.language}function D(){let e=(0,y.c)(8),t=o(j),n;e[0]===t?n=e[1]:(n=i(t),e[0]=t,e[1]=n);let r=n.keyboardShortcutsSettings,a=h(A),s=h(k),c=u(O),d;return e[2]!==r.quickCaptureShortcutDescription||e[3]!==r.quickCaptureShortcutTitle||e[4]!==s||e[5]!==a||e[6]!==c?(d=(0,x.jsx)(w,{title:r.quickCaptureShortcutTitle,description:r.quickCaptureShortcutDescription,shortcut:a,otherShortcut:c,defaultShortcut:l,setShortcut:s,legacyRecordingEvent:`quick-capture-shortcut-recording`}),e[2]=r.quickCaptureShortcutDescription,e[3]=r.quickCaptureShortcutTitle,e[4]=s,e[5]=a,e[6]=c,e[7]=d):d=e[7],d}function O(e){return e.shortcut}function k(e){return e.setShortcut}function A(e){return e.shortcut}function j(e){return e.language}function M(){let e=(0,y.c)(9),t=o(I),n;e[0]===t?n=e[1]:(n=i(t),e[0]=t,e[1]=n);let r=n.keyboardShortcutsSettings,a=u(F),s=u(P),c=h(N),l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,x.jsx)(L,{}),e[2]=l):l=e[2];let d;return e[3]!==r.voiceInputShortcutDescription||e[4]!==r.voiceInputShortcutTitle||e[5]!==c||e[6]!==s||e[7]!==a?(d=(0,x.jsx)(w,{title:r.voiceInputShortcutTitle,description:r.voiceInputShortcutDescription,shortcut:a,otherShortcut:c,defaultShortcut:p,setShortcut:s,notice:l}),e[3]=r.voiceInputShortcutDescription,e[4]=r.voiceInputShortcutTitle,e[5]=c,e[6]=s,e[7]=a,e[8]=d):d=e[8],d}function N(e){return e.shortcut}function P(e){return e.setShortcut}function F(e){return e.shortcut}function I(e){return e.language}function L(){let e=i(o(e=>e.language)).keyboardShortcutsSettings,t=window.electronAPI?.system,n=s()&&window.electronAPI?.platform===`darwin`,[r,c]=(0,b.useState)(!1),[l,u]=(0,b.useState)(!1);return(0,b.useEffect)(()=>{if(!n||!t)return;let e=!0,r=()=>{t.getPermissions().then(t=>{e&&c(t.accessibility===`granted`)}).catch(()=>void 0)};return r(),window.addEventListener(`focus`,r),()=>{e=!1,window.removeEventListener(`focus`,r)}},[n,t]),!n||!t?null:(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,x.jsx)(`p`,{className:`max-w-[65ch] text-xs text-fg-muted`,children:r?e.voiceInputAccessibilityGranted:e.voiceInputAccessibilityDescription}),r?null:(0,x.jsx)(`button`,{type:`button`,disabled:l,className:a(`rounded-lg bg-surface-base/70 px-3 py-1.5 text-xs font-medium text-fg transition-colors hover:bg-surface-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:cursor-not-allowed disabled:text-fg-disabled`),onClick:async()=>{u(!0);try{c((await t.requestAccessibility()).status===`granted`)}finally{u(!1)}},children:l?e.voiceInputAccessibilityRequesting:e.voiceInputAccessibilityEnable})]})}function R(e){let t=(0,y.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,x.jsx)(`kbd`,{className:`inline-flex min-w-[1.5rem] items-center justify-center rounded-md bg-surface-hover/70 px-1.5 py-0.5 font-mono text-xs font-medium text-fg-muted shadow-sm`,children:n}),t[0]=n,t[1]=r),r}function z(e){let t=(0,y.c)(14),{keys:n,label:r,note:i}=e,a;t[0]===r?a=t[1]:(a=(0,x.jsx)(`span`,{className:`text-sm text-fg`,children:r}),t[0]=r,t[1]=a);let o;t[2]===i?o=t[3]:(o=i&&(0,x.jsxs)(`span`,{className:`ml-1.5 text-xs text-fg-muted`,children:[`(`,i,`)`]}),t[2]=i,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,x.jsxs)(`div`,{className:`min-w-0`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;t[7]===n?c=t[8]:(c=n.map(B),t[7]=n,t[8]=c);let l;t[9]===c?l=t[10]:(l=(0,x.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:c}),t[9]=c,t[10]=l);let u;return t[11]!==s||t[12]!==l?(u=(0,x.jsxs)(`div`,{className:`flex items-center justify-between gap-4 py-2.5`,children:[s,l]}),t[11]=s,t[12]=l,t[13]=u):u=t[13],u}function B(e){return(0,x.jsx)(R,{children:e},e)}function V(e){let t=(0,y.c)(11),{title:n,shortcuts:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=a(`rounded-xl bg-surface-hover/20 px-4 sm:px-5`),t[0]=i):i=t[0];let o;t[1]===n?o=t[2]:(o=(0,x.jsx)(`h2`,{className:`pb-1 pt-3.5 text-sm font-semibold text-fg sm:pt-4`,children:n}),t[1]=n,t[2]=o);let s;t[3]===r?s=t[4]:(s=r.map(H),t[3]=r,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,x.jsx)(`div`,{className:`grid gap-1 pb-3 sm:pb-4`,children:s}),t[5]=s,t[6]=c);let l;return t[7]!==o||t[8]!==c||t[9]!==n?(l=(0,x.jsxs)(`section`,{className:i,"aria-label":n,children:[o,c]}),t[7]=o,t[8]=c,t[9]=n,t[10]=l):l=t[10],l}function H(e){return(0,x.jsx)(z,{...e},e.label)}function U(){let e=(0,y.c)(139),t=o(q),n;e[0]===t?n=e[1]:(n=i(t),e[0]=t,e[1]=n);let r=n.keyboardShortcutsSettings,a=h(K),c=u(G),l;if(e[2]!==r.categoryChat||e[3]!==r.categoryEditor||e[4]!==r.categoryGlobal||e[5]!==r.categoryNavigation||e[6]!==r.chatForceSend||e[7]!==r.chatNewLine||e[8]!==r.chatSend||e[9]!==r.chatToggleSideChat||e[10]!==r.chatVoiceInput||e[11]!==r.editorBulletList||e[12]!==r.editorHeading1||e[13]!==r.editorHeading2||e[14]!==r.editorHeading3||e[15]!==r.editorOrderedList||e[16]!==r.editorTaskList||e[17]!==r.globalNewChat||e[18]!==r.globalOpenSettings||e[19]!==r.globalToggleWindow||e[20]!==r.globalVoiceInput||e[21]!==r.globalVoiceInputMacNote||e[22]!==r.globalVoiceInputWindowsNote||e[23]!==r.navCloseDialog||e[24]!==r.navCommandPalette||e[25]!==r.navQuickCapture||e[26]!==r.navToggleFullscreen||e[27]!==r.navToggleSidebar||e[28]!==a||e[29]!==c){if(l=[],s()){let t=window.electronAPI?.platform===`darwin`?`Fn`:`Alt`,n=window.electronAPI?.platform===`darwin`?r.globalVoiceInputMacNote:r.globalVoiceInputWindowsNote,i;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(i=[C,`Shift`,`Space`],e[31]=i):i=e[31];let a;e[32]===r.globalToggleWindow?a=e[33]:(a={keys:i,label:r.globalToggleWindow},e[32]=r.globalToggleWindow,e[33]=a);let o;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(o=[t],e[34]=o):o=e[34];let s;e[35]!==r.globalVoiceInput||e[36]!==n?(s={keys:o,label:r.globalVoiceInput,note:n},e[35]=r.globalVoiceInput,e[36]=n,e[37]=s):s=e[37];let c;e[38]!==a||e[39]!==s?(c=[a,s],e[38]=a,e[39]=s,e[40]=c):c=e[40];let u;e[41]!==r.categoryGlobal||e[42]!==c?(u={title:r.categoryGlobal,shortcuts:c},e[41]=r.categoryGlobal,e[42]=c,e[43]=u):u=e[43],l.push(u)}let t=r.categoryNavigation,n;e[44]===Symbol.for(`react.memo_cache_sentinel`)?(n=[C,`N`],e[44]=n):n=e[44];let i;e[45]===r.globalNewChat?i=e[46]:(i={keys:n,label:r.globalNewChat},e[45]=r.globalNewChat,e[46]=i);let o;e[47]===Symbol.for(`react.memo_cache_sentinel`)?(o=[C,`K`],e[47]=o):o=e[47];let u;e[48]===r.navCommandPalette?u=e[49]:(u={keys:o,label:r.navCommandPalette},e[48]=r.navCommandPalette,e[49]=u);let d;e[50]===a?d=e[51]:(d=g(a),e[50]=a,e[51]=d);let p;e[52]!==r.navQuickCapture||e[53]!==d?(p={keys:d,label:r.navQuickCapture},e[52]=r.navQuickCapture,e[53]=d,e[54]=p):p=e[54];let m;e[55]===r.navToggleSidebar?m=e[56]:(m=s()?[{keys:[C,`B`],label:r.navToggleSidebar}]:[],e[55]=r.navToggleSidebar,e[56]=m);let h;e[57]===r.navToggleFullscreen?h=e[58]:(h=s()?[{keys:[`F11`],label:r.navToggleFullscreen}]:[],e[57]=r.navToggleFullscreen,e[58]=h);let _;e[59]===r.globalOpenSettings?_=e[60]:(_=s()?[{keys:[C,`,`],label:r.globalOpenSettings}]:[],e[59]=r.globalOpenSettings,e[60]=_);let v;e[61]===Symbol.for(`react.memo_cache_sentinel`)?(v=[`Esc`],e[61]=v):v=e[61];let y;e[62]===r.navCloseDialog?y=e[63]:(y={keys:v,label:r.navCloseDialog},e[62]=r.navCloseDialog,e[63]=y);let b;e[64]!==_||e[65]!==y||e[66]!==i||e[67]!==u||e[68]!==p||e[69]!==m||e[70]!==h?(b=[i,u,p,...m,...h,..._,y],e[64]=_,e[65]=y,e[66]=i,e[67]=u,e[68]=p,e[69]=m,e[70]=h,e[71]=b):b=e[71];let x;e[72]!==r.categoryNavigation||e[73]!==b?(x={title:t,shortcuts:b},e[72]=r.categoryNavigation,e[73]=b,e[74]=x):x=e[74],l.push(x);let S=r.categoryChat,w;e[75]===Symbol.for(`react.memo_cache_sentinel`)?(w=[`Enter`],e[75]=w):w=e[75];let T;e[76]===r.chatSend?T=e[77]:(T={keys:w,label:r.chatSend},e[76]=r.chatSend,e[77]=T);let E;e[78]===Symbol.for(`react.memo_cache_sentinel`)?(E=[`Shift`,`Enter`],e[78]=E):E=e[78];let D;e[79]===r.chatNewLine?D=e[80]:(D={keys:E,label:r.chatNewLine},e[79]=r.chatNewLine,e[80]=D);let O;e[81]===Symbol.for(`react.memo_cache_sentinel`)?(O=[C,`Enter`],e[81]=O):O=e[81];let k;e[82]===r.chatForceSend?k=e[83]:(k={keys:O,label:r.chatForceSend},e[82]=r.chatForceSend,e[83]=k);let A;e[84]===c?A=e[85]:(A=g(c),e[84]=c,e[85]=A);let j;e[86]!==r.chatVoiceInput||e[87]!==A?(j={keys:A,label:r.chatVoiceInput},e[86]=r.chatVoiceInput,e[87]=A,e[88]=j):j=e[88];let M;e[89]===Symbol.for(`react.memo_cache_sentinel`)?(M=f(window.electronAPI?.platform),e[89]=M):M=e[89];let N;e[90]===r.chatToggleSideChat?N=e[91]:(N={keys:M,label:r.chatToggleSideChat},e[90]=r.chatToggleSideChat,e[91]=N);let P;e[92]!==T||e[93]!==D||e[94]!==k||e[95]!==j||e[96]!==N?(P=[T,D,k,j,N],e[92]=T,e[93]=D,e[94]=k,e[95]=j,e[96]=N,e[97]=P):P=e[97];let F;e[98]!==r.categoryChat||e[99]!==P?(F={title:S,shortcuts:P},e[98]=r.categoryChat,e[99]=P,e[100]=F):F=e[100],l.push(F);let I;e[101]===Symbol.for(`react.memo_cache_sentinel`)?(I=[C,`Shift`,`1`],e[101]=I):I=e[101];let L;e[102]===r.editorHeading1?L=e[103]:(L={keys:I,label:r.editorHeading1},e[102]=r.editorHeading1,e[103]=L);let R;e[104]===Symbol.for(`react.memo_cache_sentinel`)?(R=[C,`Shift`,`2`],e[104]=R):R=e[104];let z;e[105]===r.editorHeading2?z=e[106]:(z={keys:R,label:r.editorHeading2},e[105]=r.editorHeading2,e[106]=z);let B;e[107]===Symbol.for(`react.memo_cache_sentinel`)?(B=[C,`Shift`,`3`],e[107]=B):B=e[107];let V;e[108]===r.editorHeading3?V=e[109]:(V={keys:B,label:r.editorHeading3},e[108]=r.editorHeading3,e[109]=V);let H;e[110]===Symbol.for(`react.memo_cache_sentinel`)?(H=[C,`Shift`,`8`],e[110]=H):H=e[110];let U;e[111]===r.editorBulletList?U=e[112]:(U={keys:H,label:r.editorBulletList},e[111]=r.editorBulletList,e[112]=U);let W;e[113]===Symbol.for(`react.memo_cache_sentinel`)?(W=[C,`Shift`,`9`],e[113]=W):W=e[113];let G;e[114]===r.editorOrderedList?G=e[115]:(G={keys:W,label:r.editorOrderedList},e[114]=r.editorOrderedList,e[115]=G);let K;e[116]===Symbol.for(`react.memo_cache_sentinel`)?(K=[C,`Shift`,`0`],e[116]=K):K=e[116];let q;e[117]===r.editorTaskList?q=e[118]:(q={keys:K,label:r.editorTaskList},e[117]=r.editorTaskList,e[118]=q);let J;e[119]!==L||e[120]!==z||e[121]!==V||e[122]!==U||e[123]!==G||e[124]!==q?(J=[L,z,V,U,G,q],e[119]=L,e[120]=z,e[121]=V,e[122]=U,e[123]=G,e[124]=q,e[125]=J):J=e[125];let Y;e[126]!==r.categoryEditor||e[127]!==J?(Y={title:r.categoryEditor,shortcuts:J},e[126]=r.categoryEditor,e[127]=J,e[128]=Y):Y=e[128],l.push(Y),e[2]=r.categoryChat,e[3]=r.categoryEditor,e[4]=r.categoryGlobal,e[5]=r.categoryNavigation,e[6]=r.chatForceSend,e[7]=r.chatNewLine,e[8]=r.chatSend,e[9]=r.chatToggleSideChat,e[10]=r.chatVoiceInput,e[11]=r.editorBulletList,e[12]=r.editorHeading1,e[13]=r.editorHeading2,e[14]=r.editorHeading3,e[15]=r.editorOrderedList,e[16]=r.editorTaskList,e[17]=r.globalNewChat,e[18]=r.globalOpenSettings,e[19]=r.globalToggleWindow,e[20]=r.globalVoiceInput,e[21]=r.globalVoiceInputMacNote,e[22]=r.globalVoiceInputWindowsNote,e[23]=r.navCloseDialog,e[24]=r.navCommandPalette,e[25]=r.navQuickCapture,e[26]=r.navToggleFullscreen,e[27]=r.navToggleSidebar,e[28]=a,e[29]=c,e[30]=l}else l=e[30];let d;e[129]!==r.pageTitle||e[130]!==r.subtitle?(d=(0,x.jsx)(_,{title:r.pageTitle,subtitle:r.subtitle}),e[129]=r.pageTitle,e[130]=r.subtitle,e[131]=d):d=e[131];let p,m;e[132]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,x.jsx)(D,{}),m=(0,x.jsx)(M,{}),e[132]=p,e[133]=m):(p=e[132],m=e[133]);let b;e[134]===l?b=e[135]:(b=l.map(W),e[134]=l,e[135]=b);let S;return e[136]!==d||e[137]!==b?(S=(0,x.jsxs)(v,{gap:`gap-6`,children:[d,p,m,b]}),e[136]=d,e[137]=b,e[138]=S):S=e[138],S}function W(e){return(0,x.jsx)(V,{...e},e.title)}function G(e){return e.shortcut}function K(e){return e.shortcut}function q(e){return e.language}export{U as KeyboardShortcutsSettingsPanel};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./messages-DPw2X06D.js";import{t as a}from"./cn-JdwAhgNB.js";import{n as o}from"./locale-store-Y1aBayM_.js";import{n as s}from"./electron-env-Dit0bHgy.js";import{Br as c,Gr as l,Hr as u,P as d,Ur as f,Vr as p,Wr as m,sn as h,zr as g}from"./index-CYeGnj-L.js";import{n as _,r as v}from"./settings-page-layout-X1x-2Cp9.js";var y=n(),b=e(t(),1),x=r(),S=u(),C=S?`⌘`:`Ctrl`;function w(e){let t=(0,y.c)(54),{title:n,description:r,shortcut:s,otherShortcut:c,defaultShortcut:l,setShortcut:u,legacyRecordingEvent:d,notice:p}=e,g=o(E),_;t[0]===g?_=t[1]:(_=i(g),t[0]=g,t[1]=_);let v=_.keyboardShortcutsSettings,[C,w]=(0,b.useState)(!1),[D,O]=(0,b.useState)(null),k,A;t[2]!==d||t[3]!==C?(k=()=>{let e={active:C};return window.dispatchEvent(new CustomEvent(h,{detail:e})),d&&window.dispatchEvent(new CustomEvent(d,{detail:e})),()=>{let e={active:!1};window.dispatchEvent(new CustomEvent(h,{detail:e})),d&&window.dispatchEvent(new CustomEvent(d,{detail:e}))}},A=[d,C],t[2]=d,t[3]=C,t[4]=k,t[5]=A):(k=t[4],A=t[5]),(0,b.useEffect)(k,A);let j;t[6]!==v.quickCaptureShortcutConflict||t[7]!==c||t[8]!==C||t[9]!==u?(j=e=>{if(!C)return;if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){w(!1);return}let t=m(e.nativeEvent);if(!t)return;let n=S?`meta`:`control`;if(new Set([`${n}+k`,`${n}+n`,`${n}+b`,`${n}+,`]).has(t)||t===c){O(v.quickCaptureShortcutConflict);return}u(t),O(null),w(!1)},t[6]=v.quickCaptureShortcutConflict,t[7]=c,t[8]=C,t[9]=u,t[10]=j):j=t[10];let M=j,N;t[11]===n?N=t[12]:(N=(0,x.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n}),t[11]=n,t[12]=N);let P;t[13]===r?P=t[14]:(P=(0,x.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:r}),t[13]=r,t[14]=P);let F;t[15]!==N||t[16]!==P?(F=(0,x.jsxs)(`div`,{className:`min-w-0`,children:[N,P]}),t[15]=N,t[16]=P,t[17]=F):F=t[17];let I;t[18]===s?I=t[19]:(I=f(s).map(T),t[18]=s,t[19]=I);let L;t[20]===I?L=t[21]:(L=(0,x.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:I}),t[20]=I,t[21]=L);let R;t[22]!==F||t[23]!==L?(R=(0,x.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[F,L]}),t[22]=F,t[23]=L,t[24]=R):R=t[24];let z,B;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(z=a(`rounded-lg bg-accent px-3 py-1.5 text-sm font-medium text-on-accent transition-colors hover:bg-accent-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-base`),B=()=>{O(null),w(!0)},t[25]=z,t[26]=B):(z=t[25],B=t[26]);let V;t[27]!==v.quickCaptureShortcutChange||t[28]!==M?(V=(0,x.jsx)(`button`,{type:`button`,className:z,onClick:B,onKeyDown:M,children:v.quickCaptureShortcutChange}),t[27]=v.quickCaptureShortcutChange,t[28]=M,t[29]=V):V=t[29];let H;t[30]!==l||t[31]!==u?(H=()=>{u(l()),O(null)},t[30]=l,t[31]=u,t[32]=H):H=t[32];let U;t[33]!==v.quickCaptureShortcutReset||t[34]!==H?(U=(0,x.jsx)(`button`,{type:`button`,className:`rounded-lg px-3 py-1.5 text-sm font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:H,children:v.quickCaptureShortcutReset}),t[33]=v.quickCaptureShortcutReset,t[34]=H,t[35]=U):U=t[35];let W;t[36]!==v.quickCaptureShortcutRecording||t[37]!==M||t[38]!==C?(W=C?(0,x.jsx)(`button`,{type:`button`,className:`rounded-lg bg-accent-soft px-3 py-1.5 text-sm font-medium text-accent-fg outline-none focus-visible:ring-2 focus-visible:ring-accent`,onKeyDown:M,onClick:()=>w(!1),children:v.quickCaptureShortcutRecording}):null,t[36]=v.quickCaptureShortcutRecording,t[37]=M,t[38]=C,t[39]=W):W=t[39];let G;t[40]!==V||t[41]!==U||t[42]!==W?(G=(0,x.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[V,U,W]}),t[40]=V,t[41]=U,t[42]=W,t[43]=G):G=t[43];let K;t[44]===D?K=t[45]:(K=D?(0,x.jsx)(`p`,{className:`mt-2 text-sm text-danger-fg`,children:D}):null,t[44]=D,t[45]=K);let q;t[46]===p?q=t[47]:(q=p?(0,x.jsx)(`div`,{className:`mt-3 rounded-lg bg-surface-base/55 p-3`,children:p}):null,t[46]=p,t[47]=q);let J;return t[48]!==R||t[49]!==G||t[50]!==K||t[51]!==q||t[52]!==n?(J=(0,x.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 px-4 py-3.5 sm:px-5 sm:py-4`,"aria-label":n,children:[R,G,K,q]}),t[48]=R,t[49]=G,t[50]=K,t[51]=q,t[52]=n,t[53]=J):J=t[53],J}function T(e,t){return(0,x.jsx)(R,{children:e},`${e}-${String(t)}`)}function E(e){return e.language}function D(){let e=(0,y.c)(8),t=o(j),n;e[0]===t?n=e[1]:(n=i(t),e[0]=t,e[1]=n);let r=n.keyboardShortcutsSettings,a=l(A),s=l(k),u=c(O),d;return e[2]!==r.quickCaptureShortcutDescription||e[3]!==r.quickCaptureShortcutTitle||e[4]!==s||e[5]!==a||e[6]!==u?(d=(0,x.jsx)(w,{title:r.quickCaptureShortcutTitle,description:r.quickCaptureShortcutDescription,shortcut:a,otherShortcut:u,defaultShortcut:p,setShortcut:s,legacyRecordingEvent:`quick-capture-shortcut-recording`}),e[2]=r.quickCaptureShortcutDescription,e[3]=r.quickCaptureShortcutTitle,e[4]=s,e[5]=a,e[6]=u,e[7]=d):d=e[7],d}function O(e){return e.shortcut}function k(e){return e.setShortcut}function A(e){return e.shortcut}function j(e){return e.language}function M(){let e=(0,y.c)(9),t=o(I),n;e[0]===t?n=e[1]:(n=i(t),e[0]=t,e[1]=n);let r=n.keyboardShortcutsSettings,a=c(F),s=c(P),u=l(N),d;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,x.jsx)(L,{}),e[2]=d):d=e[2];let f;return e[3]!==r.voiceInputShortcutDescription||e[4]!==r.voiceInputShortcutTitle||e[5]!==u||e[6]!==s||e[7]!==a?(f=(0,x.jsx)(w,{title:r.voiceInputShortcutTitle,description:r.voiceInputShortcutDescription,shortcut:a,otherShortcut:u,defaultShortcut:g,setShortcut:s,notice:d}),e[3]=r.voiceInputShortcutDescription,e[4]=r.voiceInputShortcutTitle,e[5]=u,e[6]=s,e[7]=a,e[8]=f):f=e[8],f}function N(e){return e.shortcut}function P(e){return e.setShortcut}function F(e){return e.shortcut}function I(e){return e.language}function L(){let e=i(o(e=>e.language)).keyboardShortcutsSettings,t=window.electronAPI?.system,n=s()&&window.electronAPI?.platform===`darwin`,[r,c]=(0,b.useState)(!1),[l,u]=(0,b.useState)(!1);return(0,b.useEffect)(()=>{if(!n||!t)return;let e=!0,r=()=>{t.getPermissions().then(t=>{e&&c(t.accessibility===`granted`)}).catch(()=>void 0)};return r(),window.addEventListener(`focus`,r),()=>{e=!1,window.removeEventListener(`focus`,r)}},[n,t]),!n||!t?null:(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,x.jsx)(`p`,{className:`max-w-[65ch] text-xs text-fg-muted`,children:r?e.voiceInputAccessibilityGranted:e.voiceInputAccessibilityDescription}),r?null:(0,x.jsx)(`button`,{type:`button`,disabled:l,className:a(`rounded-lg bg-surface-base/70 px-3 py-1.5 text-xs font-medium text-fg transition-colors hover:bg-surface-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:cursor-not-allowed disabled:text-fg-disabled`),onClick:async()=>{u(!0);try{c((await t.requestAccessibility()).status===`granted`)}finally{u(!1)}},children:l?e.voiceInputAccessibilityRequesting:e.voiceInputAccessibilityEnable})]})}function R(e){let t=(0,y.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,x.jsx)(`kbd`,{className:`inline-flex min-w-[1.5rem] items-center justify-center rounded-md bg-surface-hover/70 px-1.5 py-0.5 font-mono text-xs font-medium text-fg-muted shadow-sm`,children:n}),t[0]=n,t[1]=r),r}function z(e){let t=(0,y.c)(14),{keys:n,label:r,note:i}=e,a;t[0]===r?a=t[1]:(a=(0,x.jsx)(`span`,{className:`text-sm text-fg`,children:r}),t[0]=r,t[1]=a);let o;t[2]===i?o=t[3]:(o=i&&(0,x.jsxs)(`span`,{className:`ml-1.5 text-xs text-fg-muted`,children:[`(`,i,`)`]}),t[2]=i,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,x.jsxs)(`div`,{className:`min-w-0`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;t[7]===n?c=t[8]:(c=n.map(B),t[7]=n,t[8]=c);let l;t[9]===c?l=t[10]:(l=(0,x.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:c}),t[9]=c,t[10]=l);let u;return t[11]!==s||t[12]!==l?(u=(0,x.jsxs)(`div`,{className:`flex items-center justify-between gap-4 py-2.5`,children:[s,l]}),t[11]=s,t[12]=l,t[13]=u):u=t[13],u}function B(e){return(0,x.jsx)(R,{children:e},e)}function V(e){let t=(0,y.c)(11),{title:n,shortcuts:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=a(`rounded-xl bg-surface-hover/20 px-4 sm:px-5`),t[0]=i):i=t[0];let o;t[1]===n?o=t[2]:(o=(0,x.jsx)(`h2`,{className:`pb-1 pt-3.5 text-sm font-semibold text-fg sm:pt-4`,children:n}),t[1]=n,t[2]=o);let s;t[3]===r?s=t[4]:(s=r.map(H),t[3]=r,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,x.jsx)(`div`,{className:`grid gap-1 pb-3 sm:pb-4`,children:s}),t[5]=s,t[6]=c);let l;return t[7]!==o||t[8]!==c||t[9]!==n?(l=(0,x.jsxs)(`section`,{className:i,"aria-label":n,children:[o,c]}),t[7]=o,t[8]=c,t[9]=n,t[10]=l):l=t[10],l}function H(e){return(0,x.jsx)(z,{...e},e.label)}function U(){let e=(0,y.c)(139),t=o(q),n;e[0]===t?n=e[1]:(n=i(t),e[0]=t,e[1]=n);let r=n.keyboardShortcutsSettings,a=l(K),u=c(G),p;if(e[2]!==r.categoryChat||e[3]!==r.categoryEditor||e[4]!==r.categoryGlobal||e[5]!==r.categoryNavigation||e[6]!==r.chatForceSend||e[7]!==r.chatNewLine||e[8]!==r.chatSend||e[9]!==r.chatToggleSideChat||e[10]!==r.chatVoiceInput||e[11]!==r.editorBulletList||e[12]!==r.editorHeading1||e[13]!==r.editorHeading2||e[14]!==r.editorHeading3||e[15]!==r.editorOrderedList||e[16]!==r.editorTaskList||e[17]!==r.globalNewChat||e[18]!==r.globalOpenSettings||e[19]!==r.globalToggleWindow||e[20]!==r.globalVoiceInput||e[21]!==r.globalVoiceInputMacNote||e[22]!==r.globalVoiceInputWindowsNote||e[23]!==r.navCloseDialog||e[24]!==r.navCommandPalette||e[25]!==r.navQuickCapture||e[26]!==r.navToggleFullscreen||e[27]!==r.navToggleSidebar||e[28]!==a||e[29]!==u){if(p=[],s()){let t=window.electronAPI?.platform===`darwin`?`Fn`:`Alt`,n=window.electronAPI?.platform===`darwin`?r.globalVoiceInputMacNote:r.globalVoiceInputWindowsNote,i;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(i=[C,`Shift`,`Space`],e[31]=i):i=e[31];let a;e[32]===r.globalToggleWindow?a=e[33]:(a={keys:i,label:r.globalToggleWindow},e[32]=r.globalToggleWindow,e[33]=a);let o;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(o=[t],e[34]=o):o=e[34];let s;e[35]!==r.globalVoiceInput||e[36]!==n?(s={keys:o,label:r.globalVoiceInput,note:n},e[35]=r.globalVoiceInput,e[36]=n,e[37]=s):s=e[37];let c;e[38]!==a||e[39]!==s?(c=[a,s],e[38]=a,e[39]=s,e[40]=c):c=e[40];let l;e[41]!==r.categoryGlobal||e[42]!==c?(l={title:r.categoryGlobal,shortcuts:c},e[41]=r.categoryGlobal,e[42]=c,e[43]=l):l=e[43],p.push(l)}let t=r.categoryNavigation,n;e[44]===Symbol.for(`react.memo_cache_sentinel`)?(n=[C,`N`],e[44]=n):n=e[44];let i;e[45]===r.globalNewChat?i=e[46]:(i={keys:n,label:r.globalNewChat},e[45]=r.globalNewChat,e[46]=i);let o;e[47]===Symbol.for(`react.memo_cache_sentinel`)?(o=[C,`K`],e[47]=o):o=e[47];let c;e[48]===r.navCommandPalette?c=e[49]:(c={keys:o,label:r.navCommandPalette},e[48]=r.navCommandPalette,e[49]=c);let l;e[50]===a?l=e[51]:(l=f(a),e[50]=a,e[51]=l);let m;e[52]!==r.navQuickCapture||e[53]!==l?(m={keys:l,label:r.navQuickCapture},e[52]=r.navQuickCapture,e[53]=l,e[54]=m):m=e[54];let h;e[55]===r.navToggleSidebar?h=e[56]:(h=s()?[{keys:[C,`B`],label:r.navToggleSidebar}]:[],e[55]=r.navToggleSidebar,e[56]=h);let g;e[57]===r.navToggleFullscreen?g=e[58]:(g=s()?[{keys:[`F11`],label:r.navToggleFullscreen}]:[],e[57]=r.navToggleFullscreen,e[58]=g);let _;e[59]===r.globalOpenSettings?_=e[60]:(_=s()?[{keys:[C,`,`],label:r.globalOpenSettings}]:[],e[59]=r.globalOpenSettings,e[60]=_);let v;e[61]===Symbol.for(`react.memo_cache_sentinel`)?(v=[`Esc`],e[61]=v):v=e[61];let y;e[62]===r.navCloseDialog?y=e[63]:(y={keys:v,label:r.navCloseDialog},e[62]=r.navCloseDialog,e[63]=y);let b;e[64]!==_||e[65]!==y||e[66]!==i||e[67]!==c||e[68]!==m||e[69]!==h||e[70]!==g?(b=[i,c,m,...h,...g,..._,y],e[64]=_,e[65]=y,e[66]=i,e[67]=c,e[68]=m,e[69]=h,e[70]=g,e[71]=b):b=e[71];let x;e[72]!==r.categoryNavigation||e[73]!==b?(x={title:t,shortcuts:b},e[72]=r.categoryNavigation,e[73]=b,e[74]=x):x=e[74],p.push(x);let S=r.categoryChat,w;e[75]===Symbol.for(`react.memo_cache_sentinel`)?(w=[`Enter`],e[75]=w):w=e[75];let T;e[76]===r.chatSend?T=e[77]:(T={keys:w,label:r.chatSend},e[76]=r.chatSend,e[77]=T);let E;e[78]===Symbol.for(`react.memo_cache_sentinel`)?(E=[`Shift`,`Enter`],e[78]=E):E=e[78];let D;e[79]===r.chatNewLine?D=e[80]:(D={keys:E,label:r.chatNewLine},e[79]=r.chatNewLine,e[80]=D);let O;e[81]===Symbol.for(`react.memo_cache_sentinel`)?(O=[C,`Enter`],e[81]=O):O=e[81];let k;e[82]===r.chatForceSend?k=e[83]:(k={keys:O,label:r.chatForceSend},e[82]=r.chatForceSend,e[83]=k);let A;e[84]===u?A=e[85]:(A=f(u),e[84]=u,e[85]=A);let j;e[86]!==r.chatVoiceInput||e[87]!==A?(j={keys:A,label:r.chatVoiceInput},e[86]=r.chatVoiceInput,e[87]=A,e[88]=j):j=e[88];let M;e[89]===Symbol.for(`react.memo_cache_sentinel`)?(M=d(window.electronAPI?.platform),e[89]=M):M=e[89];let N;e[90]===r.chatToggleSideChat?N=e[91]:(N={keys:M,label:r.chatToggleSideChat},e[90]=r.chatToggleSideChat,e[91]=N);let P;e[92]!==T||e[93]!==D||e[94]!==k||e[95]!==j||e[96]!==N?(P=[T,D,k,j,N],e[92]=T,e[93]=D,e[94]=k,e[95]=j,e[96]=N,e[97]=P):P=e[97];let F;e[98]!==r.categoryChat||e[99]!==P?(F={title:S,shortcuts:P},e[98]=r.categoryChat,e[99]=P,e[100]=F):F=e[100],p.push(F);let I;e[101]===Symbol.for(`react.memo_cache_sentinel`)?(I=[C,`Shift`,`1`],e[101]=I):I=e[101];let L;e[102]===r.editorHeading1?L=e[103]:(L={keys:I,label:r.editorHeading1},e[102]=r.editorHeading1,e[103]=L);let R;e[104]===Symbol.for(`react.memo_cache_sentinel`)?(R=[C,`Shift`,`2`],e[104]=R):R=e[104];let z;e[105]===r.editorHeading2?z=e[106]:(z={keys:R,label:r.editorHeading2},e[105]=r.editorHeading2,e[106]=z);let B;e[107]===Symbol.for(`react.memo_cache_sentinel`)?(B=[C,`Shift`,`3`],e[107]=B):B=e[107];let V;e[108]===r.editorHeading3?V=e[109]:(V={keys:B,label:r.editorHeading3},e[108]=r.editorHeading3,e[109]=V);let H;e[110]===Symbol.for(`react.memo_cache_sentinel`)?(H=[C,`Shift`,`8`],e[110]=H):H=e[110];let U;e[111]===r.editorBulletList?U=e[112]:(U={keys:H,label:r.editorBulletList},e[111]=r.editorBulletList,e[112]=U);let W;e[113]===Symbol.for(`react.memo_cache_sentinel`)?(W=[C,`Shift`,`9`],e[113]=W):W=e[113];let G;e[114]===r.editorOrderedList?G=e[115]:(G={keys:W,label:r.editorOrderedList},e[114]=r.editorOrderedList,e[115]=G);let K;e[116]===Symbol.for(`react.memo_cache_sentinel`)?(K=[C,`Shift`,`0`],e[116]=K):K=e[116];let q;e[117]===r.editorTaskList?q=e[118]:(q={keys:K,label:r.editorTaskList},e[117]=r.editorTaskList,e[118]=q);let J;e[119]!==L||e[120]!==z||e[121]!==V||e[122]!==U||e[123]!==G||e[124]!==q?(J=[L,z,V,U,G,q],e[119]=L,e[120]=z,e[121]=V,e[122]=U,e[123]=G,e[124]=q,e[125]=J):J=e[125];let Y;e[126]!==r.categoryEditor||e[127]!==J?(Y={title:r.categoryEditor,shortcuts:J},e[126]=r.categoryEditor,e[127]=J,e[128]=Y):Y=e[128],p.push(Y),e[2]=r.categoryChat,e[3]=r.categoryEditor,e[4]=r.categoryGlobal,e[5]=r.categoryNavigation,e[6]=r.chatForceSend,e[7]=r.chatNewLine,e[8]=r.chatSend,e[9]=r.chatToggleSideChat,e[10]=r.chatVoiceInput,e[11]=r.editorBulletList,e[12]=r.editorHeading1,e[13]=r.editorHeading2,e[14]=r.editorHeading3,e[15]=r.editorOrderedList,e[16]=r.editorTaskList,e[17]=r.globalNewChat,e[18]=r.globalOpenSettings,e[19]=r.globalToggleWindow,e[20]=r.globalVoiceInput,e[21]=r.globalVoiceInputMacNote,e[22]=r.globalVoiceInputWindowsNote,e[23]=r.navCloseDialog,e[24]=r.navCommandPalette,e[25]=r.navQuickCapture,e[26]=r.navToggleFullscreen,e[27]=r.navToggleSidebar,e[28]=a,e[29]=u,e[30]=p}else p=e[30];let m;e[129]!==r.pageTitle||e[130]!==r.subtitle?(m=(0,x.jsx)(_,{title:r.pageTitle,subtitle:r.subtitle}),e[129]=r.pageTitle,e[130]=r.subtitle,e[131]=m):m=e[131];let h,g;e[132]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,x.jsx)(D,{}),g=(0,x.jsx)(M,{}),e[132]=h,e[133]=g):(h=e[132],g=e[133]);let b;e[134]===p?b=e[135]:(b=p.map(W),e[134]=p,e[135]=b);let S;return e[136]!==m||e[137]!==b?(S=(0,x.jsxs)(v,{gap:`gap-6`,children:[m,h,g,b]}),e[136]=m,e[137]=b,e[138]=S):S=e[138],S}function W(e){return(0,x.jsx)(V,{...e},e.title)}function G(e){return e.shortcut}function K(e){return e.shortcut}function q(e){return e.language}export{U as KeyboardShortcutsSettingsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{f as i,m as a,t as o}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as s}from"./check-DUBLcKHA.js";import{t as ee}from"./circle-check-C23XjkUj.js";import{t as c}from"./clock-3-DnrAnuyZ.js";import{t as l}from"./external-link-DjqjBmc3.js";import{t as u}from"./loader-circle-CifKLtgG.js";import{t as d}from"./rotate-ccw-JM1TBLpp.js";import{t as f}from"./sparkles-DHlfQFAF.js";import{t as p}from"./x-B_N4OPjy.js";import{n as m,r as h}from"./locale-store-Y1aBayM_.js";import{a as g,i as _,n as v,o as y,r as b,s as x,t as S}from"./dist-BGTk37IG.js";import{a as C}from"./local-apps-yys1VChX.js";import{a as w,i as te}from"./vendor-swr-BIWyz7Rc.js";import{t as T}from"./button-CS04eWY9.js";import{t as ne}from"./skeleton-BwbyijEw.js";import{Ar as E,Bn as re,Bo as ie,Ci as ae,Do as oe,Fo as se,Gn as ce,Hn as le,Hs as ue,Jn as de,Ki as fe,Kn as pe,Ks as me,Ln as he,Nc as ge,Ns as _e,Rn as ve,Un as ye,Vn as be,Vo as xe,Xo as Se,Yn as Ce,as as D,co as we,fc as Te,qn as Ee,so as De,zn as Oe}from"./index-CYeGnj-L.js";import{t as ke}from"./page-context-capture-button-DqmAq4Ov.js";import{n as Ae,t as je}from"./tab-completion-input-D64VNmiA.js";import{t as Me}from"./tab-completion-input.utils-BP3NH_du.js";var O=e(t(),1),Ne=`build-xopc-local-app`;function k(e){return(e.routing?.agentId??e.agentId??``).trim().toLowerCase()}function Pe(e){return e.find(e=>k(e)===`coder`)??null}function Fe(e,t){let n=new URLSearchParams({skill:Ne}),r=t?.trim();return r&&n.set(`draft`,r),`/chat/${encodeURIComponent(e)}?${n.toString()}`}var Ie=/^Promoted from chat preview \S+ at revision \S+$/;function Le(e,t){return Ie.test(e.trim())?t:e}var Re=n(),A=r();function ze(e){let t=(0,Re.c)(36),{scenarios:n,results:r,runningTarget:i,zh:a,onRunAll:o,onRunScenario:s,onAskCoder:l}=e;if(!n.length)return null;let d=a?`产品场景`:`Product scenarios`,f;t[0]===d?f=t[1]:(f=(0,A.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:d}),t[0]=d,t[1]=f);let p=a?`${n.length} 个关键用户路径`:`${n.length} critical user journey${n.length===1?``:`s`}`,m;t[2]===p?m=t[3]:(m=(0,A.jsx)(`p`,{className:`mt-0.5 text-[11px] text-fg-subtle`,children:p}),t[2]=p,t[3]=m);let h;t[4]!==f||t[5]!==m?(h=(0,A.jsxs)(`div`,{children:[f,m]}),t[4]=f,t[5]=m,t[6]=h):h=t[6];let g=i!==null,_;t[7]===i?_=t[8]:(_=i===`all`?(0,A.jsx)(u,{className:`size-3 animate-spin`}):(0,A.jsx)(se,{className:`size-3`}),t[7]=i,t[8]=_);let v=a?`全部重跑`:`Run all`,y;t[9]!==o||t[10]!==g||t[11]!==_||t[12]!==v?(y=(0,A.jsxs)(T,{variant:`ghost`,className:`h-7 rounded-lg px-2 text-[11px]`,onClick:o,disabled:g,children:[_,v]}),t[9]=o,t[10]=g,t[11]=_,t[12]=v,t[13]=y):y=t[13];let b;t[14]!==h||t[15]!==y?(b=(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[h,y]}),t[14]=h,t[15]=y,t[16]=b):b=t[16];let x=a?`产品场景验收结果`:`Product scenario acceptance results`,S;if(t[17]!==l||t[18]!==s||t[19]!==r||t[20]!==i||t[21]!==n||t[22]!==a){let e;t[24]!==l||t[25]!==s||t[26]!==r||t[27]!==i||t[28]!==a?(e=e=>{let t=r[e.id],n=i===`all`||i===e.id?`running`:t?.status??`pending`;return(0,A.jsx)(`li`,{className:`py-2.5 first:pt-1`,children:(0,A.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,A.jsx)(`span`,{className:`mt-0.5 shrink-0`,"aria-hidden":!0,children:n===`running`?(0,A.jsx)(u,{className:`size-3.5 animate-spin text-accent`}):n===`passed`?(0,A.jsx)(ee,{className:`size-3.5 text-success`}):n===`failed`?(0,A.jsx)(Te,{className:`size-3.5 text-danger`}):(0,A.jsx)(c,{className:`size-3.5 text-fg-subtle`})}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`p`,{className:`truncate text-[11px] font-medium text-fg`,children:e.name}),(0,A.jsx)(`p`,{className:`mt-0.5 text-[10px] text-fg-subtle`,children:a?`${e.stepCount} 个步骤`:`${e.stepCount} step${e.stepCount===1?``:`s`}`})]}),(0,A.jsx)(T,{variant:`ghost`,className:`size-7 shrink-0 rounded-lg p-0`,onClick:()=>s(e.id),disabled:i!==null,"aria-label":a?`重跑${e.name}`:`Rerun ${e.name}`,title:a?`单独重跑`:`Rerun scenario`,children:(0,A.jsx)(se,{className:`size-3`})})]}),n===`running`?(0,A.jsx)(`p`,{className:`mt-1 text-[11px] leading-4 text-fg-muted`,children:a?`正在隔离预览中执行…`:`Running in an isolated preview…`}):t?.status===`failed`?(0,A.jsxs)(`div`,{className:`mt-1.5`,children:[(0,A.jsx)(`p`,{className:`text-[11px] leading-4 text-danger`,children:t.message}),(0,A.jsxs)(T,{variant:`ghost`,className:`mt-1 h-7 rounded-lg px-2 text-[11px] text-danger hover:text-danger`,onClick:()=>l(e,t),children:[(0,A.jsx)(D,{className:`size-3`}),a?`让 Coder 修复`:`Ask Coder to fix`]})]}):t?.status===`passed`?(0,A.jsx)(`p`,{className:`mt-1 text-[11px] leading-4 text-fg-muted`,children:a?`场景已通过`:`Scenario passed`}):(0,A.jsx)(`p`,{className:`mt-1 text-[11px] leading-4 text-fg-muted`,children:a?`等待运行`:`Waiting to run`})]})]})},e.id)},t[24]=l,t[25]=s,t[26]=r,t[27]=i,t[28]=a,t[29]=e):e=t[29],S=n.map(e),t[17]=l,t[18]=s,t[19]=r,t[20]=i,t[21]=n,t[22]=a,t[23]=S}else S=t[23];let C;t[30]!==x||t[31]!==S?(C=(0,A.jsx)(`ul`,{className:`mt-2 divide-y divide-edge-subtle`,"aria-label":x,children:S}),t[30]=x,t[31]=S,t[32]=C):C=t[32];let w;return t[33]!==b||t[34]!==C?(w=(0,A.jsxs)(`div`,{className:`mt-3 border-t border-edge-subtle pt-3`,children:[b,C]}),t[33]=b,t[34]=C,t[35]=w):w=t[35],w}var Be=`allow-scripts allow-forms`;function Ve(e,t){return E(e,t)}function He(e,t,n){return!!(t&&n&&e.sourceHash===t&&e.status===n.status&&e.interactiveCount===n.interactiveCount&&JSON.stringify(e.checks)===JSON.stringify(n.checks))}function Ue(){let{appId:e}=a(),t=e===`new`,n=m(e=>e.language)===`zh`,r=m(e=>e.language),c=i(),{mutate:E}=w(),Te=fe(e=>e.setPageHeader),Ne=fe(e=>e.clearPageHeader),{data:k,isLoading:Ie,error:Re,mutate:Ue}=te(!t&&e?[`local-app`,e]:null,()=>be(e)),{data:j,isLoading:We,mutate:Ge}=te(!t&&e?[`local-app-validation`,e]:null,()=>Ce(e)),[Ke,qe]=(0,O.useState)(``),[Je,Ye]=(0,O.useState)(``),[M,N]=(0,O.useState)(!1),[Xe,P]=(0,O.useState)(null),[Ze,Qe]=(0,O.useState)(!1),[$e,et]=(0,O.useState)(!1),[tt,nt]=(0,O.useState)(0),[rt,it]=(0,O.useState)(``),[F,at]=(0,O.useState)(!1),[I,ot]=(0,O.useState)(!1),[L,R]=(0,O.useState)(`booting`),[z,st]=(0,O.useState)(null),[B,ct]=(0,O.useState)(null),[V,lt]=(0,O.useState)({}),[H,ut]=(0,O.useState)(`all`),[U,W]=(0,O.useState)(0),[dt,ft]=(0,O.useState)(0),[pt,mt]=(0,O.useState)(null),[G,ht]=(0,O.useState)(null),[gt,_t]=(0,O.useState)([]),[vt,yt]=(0,O.useState)(!1),bt=(0,O.useRef)(new Set),K=(0,O.useRef)(null),xt=(0,O.useRef)(null),St=(0,O.useRef)(null),q=(0,O.useRef)(null),J=(0,O.useRef)(``),Y=j?.acceptanceScenarios??[],X=(0,O.useMemo)(()=>{if(!Y.length)return null;let e=Y.map(e=>V[e.id]).filter(e=>!!e);return e.length===Y.length?{status:e.some(e=>e.status===`failed`)?`failed`:`passed`,scenarioCount:Y.length,scenarios:e}:null},[Y,V]),Z=(0,O.useMemo)(()=>{if(!B)return null;if(!j?.acceptanceScenarioCount)return B;if(!X)return null;let e=X.scenarios.find(e=>e.status===`failed`),t={id:`criteria`,status:X.status,message:e?`${e.name}: ${e.message}`:`${X.scenarioCount} product scenario(s) passed`},n=[...B.checks,t];return{status:n.some(e=>e.status===`failed`)?`failed`:`passed`,checks:n,interactiveCount:B.interactiveCount}},[B,X,j?.acceptanceScenarioCount]),Ct=(0,O.useCallback)(async(e,t)=>{let n=Pe(await ae(e.projectId));if(!n){c(`/chat/new?${new URLSearchParams({projectId:e.projectId,...t?{draft:t}:{}})}`,{state:{agentId:`coder`,forceNewChat:!0}});return}bt.current.add(n.key),c(Fe(n.key,t))},[c]),wt=(0,O.useCallback)(async(e=!0)=>{if(!k)return null;ot(!0);try{let t=await Ce(k.id);return await Ge(t,{revalidate:!1}),e&&(q.current=t.sourceHash??null,ut(`all`),W(0),nt(e=>e+1)),t}catch(e){return P(e instanceof Error?e.message:String(e)),null}finally{ot(!1)}},[k,Ge]);(0,O.useEffect)(()=>{if(!k)return;let e=!1;ae(k.projectId).then(t=>{e||(bt.current=new Set(t.filter(e=>(e.routing?.agentId??e.agentId)?.toLowerCase()===`coder`).map(e=>e.key)))}).catch(()=>{});let t=e=>{let t=e.detail?.key;!t||!bt.current.has(t)||(K.current!==null&&window.clearTimeout(K.current),K.current=window.setTimeout(()=>{K.current=null,wt(!0)},750))};return window.addEventListener(`session-transcript-updated`,t),()=>{e=!0,window.removeEventListener(`session-transcript-updated`,t),K.current!==null&&window.clearTimeout(K.current)}},[k,wt]),(0,O.useEffect)(()=>{_t(k?.acceptanceRuns??[])},[k?.acceptanceRuns]),(0,O.useEffect)(()=>{q.current=null},[k?.id]),(0,O.useEffect)(()=>{!j?.sourceHash||q.current===j.sourceHash||(q.current=j.sourceHash,ut(`all`),W(0),nt(e=>e+1))},[k?.id,j?.sourceHash]),(0,O.useLayoutEffect)(()=>{if(!k)return;R(`booting`),st(null),ct(null),ht(null),yt(!1),J.current=``;let e=window.setTimeout(()=>R(e=>e===`failed`?e:`timeout`),7e3),t=xt.current?Oe(xt.current,t=>{let n=C(t);if(n){if(n.type===`ready`){R(e=>e===`failed`?e:`healthy`);return}if(n.type===`acceptance`){window.clearTimeout(e),ct(n.detail),ht(q.current);return}n.type!==`criteria`&&(window.clearTimeout(e),st(n.detail),R(`failed`))}}):()=>{};return()=>{window.clearTimeout(e),t()}},[k,tt]),(0,O.useLayoutEffect)(()=>{if(!k||j?.status!==`healthy`||!Y.length){mt(null);return}let e=H===`all`?Y[U]:Y.find(e=>e.id===H),t=e?[e]:[];if(!t.length)return;mt(H),lt(e=>{if(H===`all`&&U===0)return{};let t={...e};return delete t[H],t});let r=!1,i=e=>{lt(n=>{let r={...n};for(let n of t)r[n.id]={id:n.id,name:n.name,status:`failed`,message:e,failureKind:`runner`};return r}),mt(null)},a=window.setTimeout(()=>i(r?n?`场景在 10 秒内未完成。`:`Scenario did not finish within 10 seconds.`:n?`验收执行器未能连接,请重新验收。`:`The acceptance runner did not connect. Run acceptance again.`),1e4),o=St.current?Oe(St.current,e=>{let t=C(e);t&&(t.type===`ready`?r=!0:t.type===`criteria`?(window.clearTimeout(a),lt(e=>{let n={...e};for(let e of t.detail.scenarios)(n[e.id]?.status!==`failed`||e.status===`failed`)&&(n[e.id]=e);return n}),H===`all`&&U+1<Y.length?(W(e=>e+1),ft(e=>e+1)):mt(null)):t.type===`error`&&(window.clearTimeout(a),i(he(t.detail))))}):()=>{};return()=>{window.clearTimeout(a),o()}},[Y,k,dt,H,U,tt,j?.status,n]),(0,O.useEffect)(()=>{if(!k||!Z||!G||G!==j?.sourceHash)return;let e=`${k.id}:${G}:${JSON.stringify(Z)}`;J.current!==e&&(J.current=e,yt(!0),ce(k.id,G,Z).then(t=>{J.current===e&&_t(e=>[t,...e.filter(e=>e.id!==t.id)].toSorted((e,t)=>t.createdAt-e.createdAt).slice(0,20))}).catch(t=>{J.current===e&&(J.current=``,yt(!1),P(t instanceof Error?t.message:String(t)))}).finally(()=>{J.current===e&&yt(!1)}))},[Z,G,k,j?.sourceHash]);let Q=(0,O.useCallback)(async e=>{if(k){at(!0),P(null);try{await Ct(k,e)}catch(e){P(e instanceof Error?e.message:String(e)),at(!1)}}},[k,Ct]);(0,O.useLayoutEffect)(()=>(Te({startExtra:(0,A.jsx)(o,{to:`/local-apps`,className:`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":n?`返回应用工坊`:`Back to App Studio`,children:(0,A.jsx)(ge,{className:`size-4`})}),main:(0,A.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:k?.name||(n?`创建应用`:`Create app`)}),end:k?(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsx)(ke,{resource:{kind:`local_app`,id:k.id,revision:j?.sourceHash??``},disabled:M||F||I||!j?.sourceHash}),(0,A.jsx)(T,{asChild:!0,variant:`ghost`,className:`h-9`,children:(0,A.jsxs)(o,{to:`/projects/${encodeURIComponent(k.projectId)}`,children:[(0,A.jsx)(ue,{className:`size-4`}),`Project`]})}),(0,A.jsxs)(T,{className:`h-9`,onClick:()=>void Q(),disabled:F,children:[F?(0,A.jsx)(u,{className:`size-4 animate-spin`}):(0,A.jsx)(D,{className:`size-4`}),n?`继续开发`:`Continue building`]})]}):null}),()=>Ne()),[k,M,F,I,j?.sourceHash,Ne,Q,Te,n]);async function Tt(e){e.preventDefault(),N(!0),P(null);try{let e=await re({name:Ke,idea:Je});await E(`local-apps-list`);let t=n?`请基于 APP_BRIEF.md 完成这个本地应用的首版。先检查现有草稿,再实现最小可用版本并运行校验;完成后告诉我可以如何预览。`:`Build the first usable version of this local app from APP_BRIEF.md. Inspect the existing draft, implement the smallest useful version, run validation, and tell me how to preview it.`;try{await Ct(e,t)}catch{c(`/local-apps/${encodeURIComponent(e.id)}`,{replace:!0})}}catch(e){P(e instanceof Error?e.message:String(e))}finally{N(!1)}}async function Et(){if(k){N(!0),P(null);try{await Ue(await ye(k.id),{revalidate:!1}),await Ge(),await Promise.all([E(`local-apps-list`),E(`gateway-extensions-list`)]),Qe(!1)}catch(e){P(e instanceof Error?e.message:String(e))}finally{N(!1)}}}async function Dt(e){N(!0),P(null);try{return await Ue(await e(),{revalidate:!1}),await Ge(),await Promise.all([E(`local-apps-list`),E(`gateway-extensions-list`)]),!0}catch(e){return P(e instanceof Error?e.message:String(e)),!1}finally{N(!1)}}async function Ot(e){k&&await Dt(()=>Ee(k.id,e))}async function kt(e){k&&await Dt(()=>pe(k.id,e))}async function At(){k&&await Dt(()=>de(k.id))&&et(!1)}async function jt(e){if(!(!k||!e.length)){P(null);try{await Q((await le(k.id,{sourceHash:j?.sourceHash,locale:n?`zh`:`en`,diagnostics:e})).prompt)}catch(e){P(e instanceof Error?e.message:String(e))}}}function Mt(){jt([...j?.issues.map(e=>({phase:`build`,code:e.code,message:e.message}))??[],...z?[{phase:`runtime`,code:z.kind,message:he(z)}]:[],...Z?.checks.filter(e=>e.status===`failed`&&e.id!==`criteria`).map(e=>({phase:`acceptance`,code:e.id,message:e.message}))??[],...Object.values(V).filter(e=>e.status===`failed`).map(e=>({phase:e.failureKind===`runner`?`runner`:`acceptance`,code:e.id,message:`${e.name}: ${e.message}`})),...L===`timeout`?[{phase:`boot`,code:`boot_timeout`,message:`Preview did not report ready within 7 seconds.`}]:[]])}function Nt(){ut(`all`),W(0),ft(e=>e+1)}function Pt(e){ut(e),W(0),ft(e=>e+1)}function Ft(e,t){jt([{phase:t.failureKind===`runner`?`runner`:`acceptance`,code:e.id,message:`${e.name}: ${t.message}`}])}let It=gt.findIndex(e=>He(e,G,Z)),$=It>=0?gt[It]:null,Lt=It>=0?gt[It+1]??null:gt[0]??null,Rt=ve(Z),zt=Lt?Lt.checks.filter(e=>e.status===`failed`).map(e=>e.message):[],Bt=j?.status===`failed`||L===`failed`||L===`timeout`||Z?.status===`failed`||Object.values(V).some(e=>e.status===`failed`),Vt=zt.filter(e=>!Rt.includes(e)).length;async function Ht(){let e=await wt(!1);if(e?.status===`healthy`&&e.sourceHash!==G){q.current=e.sourceHash??null,W(0),nt(e=>e+1);return}e?.status===`healthy`&&L===`healthy`&&Z?.status===`passed`&&$&&$.sourceHash===e.sourceHash&&Qe(!0)}return t?(0,A.jsx)(`div`,{className:`flex min-h-0 flex-1 bg-surface-panel p-3 sm:p-5 xl:p-6`,children:(0,A.jsxs)(`div`,{className:`mx-auto grid w-full max-w-6xl overflow-hidden rounded-2xl border border-edge-subtle bg-surface-base shadow-surface lg:grid-cols-[minmax(280px,0.8fr)_minmax(0,1.5fr)]`,children:[(0,A.jsxs)(`form`,{onSubmit:Tt,className:`flex flex-col border-b border-edge-subtle p-5 lg:border-b-0 lg:border-r`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.14em] text-accent`,children:[(0,A.jsx)(f,{className:`size-4`}),n?`告诉 Coder 你的想法`:`Tell Coder your idea`]}),(0,A.jsx)(`h2`,{className:`mt-4 text-xl font-semibold tracking-tight text-fg`,children:n?`你想创建什么?`:`What do you want to create?`}),(0,A.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:n?`我们会建立一个 Coder Project,并把应用上下文和开发 Skill 带入对话。`:`We will create a Coder Project and carry the app context and development skill into chat.`}),(0,A.jsxs)(`label`,{className:`mt-6 text-xs font-medium text-fg-muted`,children:[n?`应用名称`:`App name`,(0,A.jsx)(je,{value:Ke,onChange:e=>qe(e.target.value),suggestion:Me(n?`例如:阅读清单`:`e.g. Reading list`),onAcceptSuggestion:qe,required:!0,className:`mt-2 w-full rounded-xl border border-edge bg-surface-panel px-3 py-2.5 text-sm text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,placeholder:n?`例如:阅读清单`:`e.g. Reading list`})]}),(0,A.jsxs)(`label`,{className:`mt-4 text-xs font-medium text-fg-muted`,children:[n?`描述你的想法`:`Describe your idea`,(0,A.jsx)(Ae,{value:Je,onChange:e=>Ye(e.target.value),suggestion:Me(n?`我想要一个可以记录待读文章、标记进度并按主题筛选的小工具…`:`I want a small tool that tracks articles, reading progress, and topics…`),onAcceptSuggestion:Ye,required:!0,rows:7,className:`mt-2 w-full resize-none rounded-xl border border-edge bg-surface-panel px-3 py-2.5 text-sm leading-6 text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,placeholder:n?`我想要一个可以记录待读文章、标记进度并按主题筛选的小工具…`:`I want a small tool that tracks articles, reading progress, and topics…`})]}),Xe?(0,A.jsx)(`p`,{className:`mt-3 text-sm text-danger`,role:`alert`,children:Xe}):null,(0,A.jsxs)(T,{type:`submit`,variant:`primary`,className:`mt-5 h-10`,disabled:M||!Ke.trim()||!Je.trim(),children:[M?(0,A.jsx)(u,{className:`size-4 animate-spin`}):(0,A.jsx)(D,{className:`size-4`}),n?`进入 Coder 对话`:`Continue with Coder`]})]}),(0,A.jsx)(`div`,{className:`hidden min-h-[620px] place-items-center bg-surface-panel p-8 lg:grid`,children:(0,A.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,A.jsx)(`div`,{className:`mx-auto flex size-16 items-center justify-center rounded-2xl border border-edge bg-surface-base text-accent shadow-surface`,children:(0,A.jsx)(Se,{className:`size-7`})}),(0,A.jsx)(`h3`,{className:`mt-5 text-base font-semibold text-fg`,children:n?`创建后,这里就是实时预览`:`Your live preview appears here`}),(0,A.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:n?`你可以先体验草稿,再决定是否把它添加到左侧导航。`:`Try the draft first, then decide whether to add it to the sidebar.`})]})})]})}):Ie?(0,A.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-3 bg-surface-panel p-3 lg:grid-cols-[280px_minmax(0,1fr)_260px]`,children:[(0,A.jsx)(ne,{className:`rounded-xl`}),(0,A.jsx)(ne,{className:`rounded-xl`}),(0,A.jsx)(ne,{className:`rounded-xl`})]}):Re||!k?(0,A.jsx)(`div`,{className:`m-6 rounded-xl border border-danger/30 bg-danger-soft p-4 text-sm text-danger`,children:Re instanceof Error?Re.message:n?`找不到应用`:`App not found`}):(0,A.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-3 overflow-hidden bg-surface-panel p-3 lg:grid-cols-[280px_minmax(0,1fr)_300px]`,children:[(0,A.jsxs)(`aside`,{className:`min-h-0 min-w-0 overflow-y-auto rounded-xl border border-edge-subtle bg-surface-base p-4 shadow-surface`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.12em] text-accent`,children:[(0,A.jsx)(f,{className:`size-4`}),n?`创作对话`:`Build conversation`]}),(0,A.jsx)(`div`,{className:`mt-4 min-w-0 rounded-xl bg-surface-panel p-3 text-sm leading-6 text-fg [overflow-wrap:anywhere]`,children:Le(k.idea,k.name)}),(0,A.jsxs)(`div`,{className:`mt-4 rounded-xl bg-accent-soft p-3`,children:[(0,A.jsxs)(`p`,{className:`flex items-center gap-2 text-sm font-medium text-accent-fg`,children:[(0,A.jsx)(ee,{className:`size-4`}),n?`草稿已准备好`:`Draft is ready`]}),(0,A.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n?`继续迭代会进入对应 Project,由 Coder 读取应用上下文和专属 skill。`:`Continue in the Project where Coder has the app context and dedicated skill.`})]}),(0,A.jsxs)(`form`,{className:`mt-5`,onSubmit:e=>{e.preventDefault(),Q(rt)},children:[(0,A.jsx)(`label`,{className:`text-xs font-medium text-fg-muted`,htmlFor:`local-app-change-request`,children:n?`下一步想改什么?`:`What should change next?`}),(0,A.jsx)(Ae,{id:`local-app-change-request`,value:rt,onChange:e=>it(e.target.value),suggestion:Me(n?`例如:增加月视图,并支持按标签筛选`:`e.g. Add a monthly view and tag filters`),onAcceptSuggestion:it,rows:4,className:`mt-2 w-full resize-none rounded-xl border border-edge bg-surface-panel px-3 py-2.5 text-sm leading-6 text-fg outline-none focus-visible:ring-2 focus-visible:ring-accent`,placeholder:n?`例如:增加月视图,并支持按标签筛选`:`e.g. Add a monthly view and tag filters`}),(0,A.jsxs)(T,{type:`submit`,className:`mt-2 w-full`,disabled:F||!rt.trim(),children:[F?(0,A.jsx)(u,{className:`size-4 animate-spin`}):(0,A.jsx)(D,{className:`size-4`}),n?`让 Coder 修改`:`Ask Coder to update`]})]}),(0,A.jsxs)(T,{variant:`ghost`,className:`mt-2 w-full`,onClick:()=>void Q(),disabled:F,children:[(0,A.jsx)(ue,{className:`size-4`}),n?`打开已有开发对话`:`Open development chat`]})]}),(0,A.jsxs)(`section`,{className:`flex min-h-0 flex-col overflow-hidden rounded-xl border border-edge-subtle bg-surface-base shadow-surface`,children:[(0,A.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center justify-between border-b border-edge-subtle px-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-medium text-fg-muted`,children:[(0,A.jsx)(`span`,{className:`size-2 rounded-full ${j?.status===`failed`||L===`failed`||L===`timeout`||Z?.status===`failed`?`bg-danger`:j?.status===`healthy`&&L===`healthy`&&Z?.status===`passed`&&$?.sourceHash===j.sourceHash&&!vt?`bg-success`:`bg-fg-subtle`}`}),L===`failed`||L===`timeout`?n?`预览运行异常`:`Preview runtime issue`:j?.status===`failed`||Z?.status===`failed`?n?`自动验收未通过`:`Acceptance needs attention`:L===`booting`||!Z?n?`自动验收中`:`Running acceptance`:vt||$?.sourceHash!==j?.sourceHash?n?`正在保存验收快照`:`Saving acceptance snapshot`:n?`草稿已通过验收`:`Draft accepted`]}),(0,A.jsxs)(T,{variant:`ghost`,className:`h-8 px-2`,onClick:()=>void wt(!0),disabled:I,children:[I?(0,A.jsx)(u,{className:`size-3.5 animate-spin`}):(0,A.jsx)(se,{className:`size-3.5`}),n?`重新验收`:`Run again`]})]}),(0,A.jsx)(`iframe`,{ref:xt,title:`${k.name} preview`,src:h(k.draftPreviewUrl),sandbox:Be,className:`min-h-0 w-full flex-1 bg-white`,onError:()=>{st({kind:`script_error`,message:`Preview document failed to load`}),R(`failed`)}},tt),j?.status===`healthy`&&j.acceptanceScenarioCount>0?(0,A.jsx)(`iframe`,{ref:St,title:`${k.name} acceptance runner`,src:`${h(k.draftPreviewUrl)}?xopcAcceptance=1&xopcScenario=${encodeURIComponent(H===`all`?Y[U]?.id??``:H)}`,sandbox:Be,"aria-hidden":`true`,tabIndex:-1,className:`pointer-events-none fixed left-[-200vw] top-0 h-[720px] w-[1024px] opacity-0`},`criteria-${tt}-${dt}-${U}`):null]}),(0,A.jsxs)(`aside`,{className:`min-h-0 overflow-y-auto rounded-xl border border-edge-subtle bg-surface-base p-4 shadow-surface`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n?`发布状态`:`Release status`}),(0,A.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:k.installationState===`not_installed`?n?`尚未安装`:`Not installed`:k.enabled?n?`版本 ${k.activeVersion} 正在使用`:`Version ${k.activeVersion} is active`:n?`已禁用,版本仍保留`:`Disabled, release retained`})]}),(0,A.jsx)(`span`,{className:`mt-1 size-2.5 rounded-full ${k.enabled?`bg-success`:`bg-fg-subtle`}`,"aria-hidden":!0})]}),(0,A.jsxs)(`dl`,{className:`mt-4 grid grid-cols-2 gap-3 text-xs`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`当前草稿`:`Draft`}),(0,A.jsxs)(`dd`,{className:`mt-1 font-medium text-fg`,children:[`v`,k.draftVersion]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`已安装`:`Installed`}),(0,A.jsx)(`dd`,{className:`mt-1 font-medium text-fg`,children:k.activeVersion?`v${k.activeVersion}`:`—`})]})]}),(0,A.jsxs)(`div`,{className:`mt-5 border-t border-edge-subtle pt-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,A.jsxs)(`h3`,{className:`flex items-center gap-2 text-xs font-semibold text-fg`,children:[(0,A.jsx)(me,{className:`size-4 text-accent`}),n?`草稿检查`:`Draft checks`]}),We||I?(0,A.jsx)(u,{className:`size-3.5 animate-spin text-fg-muted`}):j?.status===`healthy`?(0,A.jsx)(ee,{className:`size-4 text-success`}):(0,A.jsx)(De,{className:`size-4 text-danger`})]}),j?(0,A.jsxs)(`div`,{className:`mt-2`,children:[(0,A.jsx)(`p`,{className:`text-xs leading-5 ${j.status===`healthy`?`text-fg-muted`:`text-danger`}`,children:j.status===`healthy`?j.hasDraftChanges?n?`${j.changedFileCount} 个文件有改动,可以安装新版本。`:`${j.changedFileCount} changed files are ready for a new release.`:n?`草稿与当前安装版本一致。`:`Draft matches the installed release.`:j.issues[0]?.message}),j.changedFiles.length?(0,A.jsx)(`ul`,{className:`mt-2 space-y-1`,children:j.changedFiles.slice(0,4).map(e=>(0,A.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2 text-[11px] text-fg-muted`,children:[(0,A.jsx)(`span`,{className:`w-4 shrink-0 font-medium text-fg-subtle`,children:e.status===`added`?`+`:e.status===`deleted`?`−`:`•`}),(0,A.jsx)(`span`,{className:`truncate font-mono`,children:e.path})]},e.path))}):null,j.changedFileCount>4?(0,A.jsx)(`p`,{className:`mt-1 text-[10px] text-fg-subtle`,children:n?`还有 ${j.changedFileCount-4} 个文件`:`${j.changedFileCount-4} more files`}):null,(0,A.jsxs)(`div`,{className:`mt-3 border-t border-edge-subtle pt-3`,children:[(0,A.jsxs)(`p`,{className:`flex items-center gap-2 text-xs font-medium text-fg`,children:[(0,A.jsx)(`span`,{className:`size-2 rounded-full ${L===`healthy`?`bg-success`:L===`booting`?`bg-fg-subtle`:`bg-danger`}`}),n?`预览运行`:`Preview runtime`]}),(0,A.jsx)(`p`,{className:`mt-1 text-xs leading-5 ${L===`failed`||L===`timeout`?`text-danger`:`text-fg-muted`}`,children:z?he(z):L===`healthy`?n?`已成功启动,未发现未捕获异常。`:`Started successfully with no uncaught errors.`:L===`timeout`?n?`7 秒内未完成启动,可能出现白屏或阻塞。`:`Did not finish booting within 7 seconds.`:n?`正在等待应用启动。`:`Waiting for the app to start.`})]}),(0,A.jsxs)(`div`,{className:`mt-3 border-t border-edge-subtle pt-3`,children:[(0,A.jsxs)(`p`,{className:`flex items-center gap-2 text-xs font-medium text-fg`,children:[(0,A.jsx)(`span`,{className:`size-2 rounded-full ${Z?.status===`passed`?`bg-success`:Z?.status===`failed`?`bg-danger`:`bg-fg-subtle`}`}),n?`自动验收`:`Automatic acceptance`]}),Z?(0,A.jsx)(`ul`,{className:`mt-2 space-y-1.5`,children:Z.checks.map(e=>(0,A.jsxs)(`li`,{className:`flex items-start gap-2 text-[11px] leading-4 ${e.status===`failed`?`text-danger`:`text-fg-muted`}`,children:[(0,A.jsx)(`span`,{className:`mt-1 size-1.5 shrink-0 rounded-full ${e.status===`failed`?`bg-danger`:e.status===`passed`?`bg-success`:`bg-fg-subtle`}`}),(0,A.jsx)(`span`,{children:e.message})]},e.id))}):(0,A.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:j?.acceptanceScenarioCount?n?`正在检查页面基础质量和 ${j.acceptanceScenarioCount} 个产品场景。`:`Checking page quality and ${j.acceptanceScenarioCount} product scenario(s).`:n?`正在检查页面内容和基础交互。`:`Checking rendered content and basic interaction.`}),vt?(0,A.jsxs)(`p`,{className:`mt-2 flex items-center gap-2 text-[11px] text-fg-muted`,children:[(0,A.jsx)(u,{className:`size-3 animate-spin`}),n?`正在保存当前源码对应的验收快照…`:`Saving the acceptance snapshot for this source…`]}):$?(0,A.jsx)(`p`,{className:`mt-2 text-[11px] leading-4 text-fg-muted`,children:Lt?n?`相比上次:已修复 ${Vt} 项,仍有 ${Rt.length} 项。`:`Since the previous run: ${Vt} fixed, ${Rt.length} remaining.`:n?`首个验收快照已保存。`:`First acceptance snapshot saved.`}):null,(0,A.jsx)(ze,{scenarios:Y,results:V,runningTarget:pt,zh:n,onRunAll:Nt,onRunScenario:Pt,onAskCoder:Ft})]}),Bt?(0,A.jsxs)(T,{className:`mt-3 w-full`,onClick:Mt,disabled:F,children:[(0,A.jsx)(D,{className:`size-4`}),n?`让 Coder 修复`:`Ask Coder to fix`]}):null]}):(0,A.jsx)(ne,{className:`mt-2 h-12 rounded-lg`})]}),(0,A.jsxs)(`div`,{className:`mt-5 border-t border-edge-subtle pt-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold text-fg`,children:[(0,A.jsx)(oe,{className:`size-4 text-accent`}),n?`权限`:`Permissions`]}),(0,A.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:(j?.permissions??k.permissions).map(e=>(0,A.jsx)(`span`,{className:`rounded-md bg-surface-hover px-2 py-1 text-[11px] text-fg-muted`,children:e},e))})]}),(0,A.jsx)(T,{variant:`primary`,className:`mt-5 w-full`,onClick:()=>void Ht(),disabled:M||We||I||vt||j?.status===`failed`||L!==`healthy`||Z?.status!==`passed`||!$||$.sourceHash!==j?.sourceHash||k.installationState===`installed`&&j?.hasDraftChanges===!1,children:k.installationState===`installed`?n?`安装当前更新`:`Install current update`:n?`添加到左侧导航`:`Add to sidebar`}),k.installationState===`installed`?(0,A.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,A.jsxs)(T,{className:`min-w-0 flex-1`,onClick:()=>void Ot(!k.enabled),disabled:M,children:[k.enabled?(0,A.jsx)(xe,{className:`size-4`}):(0,A.jsx)(ie,{className:`size-4`}),k.enabled?n?`禁用`:`Disable`:n?`启用`:`Enable`]}),(0,A.jsx)(T,{variant:`ghost`,className:`text-danger hover:text-danger`,onClick:()=>et(!0),disabled:M,"aria-label":n?`卸载应用`:`Uninstall app`,children:(0,A.jsx)(we,{className:`size-4`})})]}):null,(0,A.jsxs)(`div`,{className:`mt-6 border-t border-edge-subtle pt-4`,children:[(0,A.jsxs)(`h3`,{className:`flex items-center gap-2 text-xs font-semibold text-fg`,children:[(0,A.jsx)(_e,{className:`size-4`}),n?`版本历史`:`Release history`]}),k.releases.length?(0,A.jsx)(`ul`,{className:`mt-2 divide-y divide-edge-subtle`,children:k.releases.map(e=>(0,A.jsxs)(`li`,{className:`flex items-center justify-between gap-3 py-2.5`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium text-fg`,children:[`v`,e.version,e.isActive?(0,A.jsx)(`span`,{className:`rounded-full bg-success-soft px-1.5 py-0.5 text-[10px] text-success`,children:n?`当前`:`Active`}):null]}),(0,A.jsx)(`p`,{className:`mt-0.5 truncate text-[10px] text-fg-subtle`,children:Ve(e.createdAt,r)})]}),e.isActive?null:(0,A.jsxs)(T,{variant:`ghost`,className:`h-7 px-2 text-xs`,onClick:()=>void kt(e.id),disabled:M,children:[(0,A.jsx)(d,{className:`size-3.5`}),n?`恢复`:`Restore`]})]},e.id))}):(0,A.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:n?`安装首个版本后,可以从这里恢复。`:`Install the first version to enable recovery.`})]}),Xe?(0,A.jsx)(`p`,{className:`mt-3 text-xs leading-5 text-danger`,role:`alert`,children:Xe}):null]}),(0,A.jsx)(S,{open:Ze,onOpenChange:Qe,children:(0,A.jsxs)(y,{children:[(0,A.jsx)(g,{className:`xopc-dialog-overlay fixed inset-0 z-50 bg-scrim backdrop-blur-[2px]`}),(0,A.jsxs)(b,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-50 flex h-[min(560px,calc(100vh-32px))] w-[min(520px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-2xl focus:outline-none`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between border-b border-edge-subtle p-5`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(x,{className:`text-base font-semibold text-fg`,children:n?`确认安装到 XOPC`:`Confirm installation`}),(0,A.jsx)(_,{className:`mt-1 text-sm text-fg-muted`,children:n?`当前草稿会成为左侧导航中的可用版本。`:`The current draft will become the version available in the sidebar.`})]}),(0,A.jsx)(v,{className:`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover`,children:(0,A.jsx)(p,{className:`size-4`})})]}),(0,A.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[(0,A.jsxs)(`div`,{className:`rounded-xl border border-edge-subtle bg-surface-panel p-4`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:k.name}),(0,A.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:k.extensionId})]}),(0,A.jsx)(`h4`,{className:`mt-5 text-xs font-semibold text-fg`,children:n?`本次迭代`:`This iteration`}),(0,A.jsxs)(`dl`,{className:`mt-2 grid grid-cols-2 gap-3 text-xs`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`文件变化`:`Changed files`}),(0,A.jsx)(`dd`,{className:`mt-1 font-medium text-fg`,children:j?.changedFileCount??0})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`自动验收`:`Acceptance`}),(0,A.jsxs)(`dd`,{className:`mt-1 flex items-center gap-1.5 font-medium text-success`,children:[(0,A.jsx)(ee,{className:`size-3.5`}),n?`已通过并保存`:`Passed and saved`]})]})]}),j?.changedFiles.length?(0,A.jsx)(`ul`,{className:`mt-3 space-y-1`,children:j.changedFiles.slice(0,5).map(e=>(0,A.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2 text-[11px] text-fg-muted`,children:[(0,A.jsx)(`span`,{className:`w-4 shrink-0 font-medium text-fg-subtle`,children:e.status===`added`?`+`:e.status===`deleted`?`−`:`•`}),(0,A.jsx)(`span`,{className:`truncate font-mono`,children:e.path})]},e.path))}):null,(0,A.jsx)(`h4`,{className:`mt-5 text-xs font-semibold text-fg`,children:n?`请求权限`:`Requested permissions`}),(0,A.jsx)(`ul`,{className:`mt-2 space-y-2`,children:(j?.permissions??k.permissions).map(e=>(0,A.jsxs)(`li`,{className:`flex items-center gap-2 text-sm text-fg`,children:[(0,A.jsx)(s,{className:`size-4 text-success`}),e,k.installationState===`installed`&&j?.permissionDelta.added.includes(e)?(0,A.jsx)(`span`,{className:`rounded-full bg-warning-soft px-2 py-0.5 text-[10px] text-warning`,children:n?`新增`:`New`}):null]},e))}),k.installationState===`installed`&&j?.permissionDelta.added.length?(0,A.jsx)(`p`,{className:`mt-4 rounded-xl bg-warning-soft p-3 text-xs leading-5 text-warning`,children:n?`此更新增加了权限,请确认这些能力符合你的修改意图。`:`This update adds permissions. Confirm they match the change you requested.`}):null,(0,A.jsx)(`p`,{className:`mt-5 rounded-xl bg-accent-soft p-3 text-xs leading-5 text-accent-fg`,children:n?`Phase 1 应用只能使用界面主题和本地存储,不能访问网络或运行系统命令。`:`Phase 1 apps can use theme and local storage only. They cannot access the network or run system commands.`})]}),(0,A.jsxs)(`div`,{className:`flex justify-end gap-2 border-t border-edge-subtle p-4`,children:[(0,A.jsx)(v,{asChild:!0,children:(0,A.jsx)(T,{children:n?`取消`:`Cancel`})}),(0,A.jsxs)(T,{variant:`primary`,onClick:()=>void Et(),disabled:M,children:[M?(0,A.jsx)(u,{className:`size-4 animate-spin`}):(0,A.jsx)(l,{className:`size-4`}),n?`确认安装`:`Install`]})]})]})]})}),(0,A.jsx)(S,{open:$e,onOpenChange:et,children:(0,A.jsxs)(y,{children:[(0,A.jsx)(g,{className:`xopc-dialog-overlay fixed inset-0 z-50 bg-scrim backdrop-blur-[2px]`}),(0,A.jsxs)(b,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-50 flex h-[min(420px,calc(100vh-32px))] w-[min(500px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-2xl focus:outline-none`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between border-b border-edge-subtle p-5`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(x,{className:`text-base font-semibold text-fg`,children:n?`卸载当前应用?`:`Uninstall this app?`}),(0,A.jsx)(_,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:n?`应用会从侧栏移除,但 Project、源码、版本历史和本地数据都会保留。`:`The app leaves the sidebar, while its Project, source, release history, and local data remain.`})]}),(0,A.jsx)(v,{className:`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover`,children:(0,A.jsx)(p,{className:`size-4`})})]}),(0,A.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:(0,A.jsxs)(`div`,{className:`rounded-xl bg-surface-panel p-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:k.name}),(0,A.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n?`之后可从任意保留版本重新安装。`:`You can reinstall any retained release later.`})]})}),(0,A.jsxs)(`div`,{className:`flex justify-end gap-2 border-t border-edge-subtle p-4`,children:[(0,A.jsx)(v,{asChild:!0,children:(0,A.jsx)(T,{children:n?`取消`:`Cancel`})}),(0,A.jsxs)(T,{variant:`ghost`,className:`text-danger hover:bg-danger-soft hover:text-danger`,onClick:()=>void At(),disabled:M,children:[M?(0,A.jsx)(u,{className:`size-4 animate-spin`}):(0,A.jsx)(we,{className:`size-4`}),n?`卸载但保留 Project`:`Uninstall and keep Project`]})]})]})]})})]})}export{Ue as LocalAppWorkbenchPage};
|
package/dist/gateway/static/root/assets/{local-apps-page-CeBhXeoX.js → local-apps-page-RPLHMvYs.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as a}from"./plus-Q2yW6OE7.js";import{n as o}from"./locale-store-Y1aBayM_.js";import{i as s}from"./vendor-swr-BIWyz7Rc.js";import{t as c}from"./button-CS04eWY9.js";import{t as l}from"./skeleton-BwbyijEw.js";import{
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as a}from"./plus-Q2yW6OE7.js";import{n as o}from"./locale-store-Y1aBayM_.js";import{i as s}from"./vendor-swr-BIWyz7Rc.js";import{t as c}from"./button-CS04eWY9.js";import{t as l}from"./skeleton-BwbyijEw.js";import{Cc as u,Ki as d,Mc as f,Wn as p}from"./index-CYeGnj-L.js";var m=n(),h=e(t(),1),g=r();function _(){let e=(0,m.c)(20),t=o(x)===`zh`,n=d(b),r=d(y),{data:l,isLoading:_,error:S}=s(`local-apps-list`,p),C,w;e[0]!==r||e[1]!==n||e[2]!==t?(C=()=>(n({startExtra:null,main:(0,g.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:t?`应用工坊`:`App Studio`}),end:(0,g.jsx)(c,{asChild:!0,variant:`primary`,className:`h-9`,children:(0,g.jsxs)(i,{to:`/local-apps/new`,children:[(0,g.jsx)(a,{className:`size-4`}),t?`创建应用`:`Create app`]})})}),()=>r()),w=[r,n,t],e[0]=r,e[1]=n,e[2]=t,e[3]=C,e[4]=w):(C=e[3],w=e[4]),(0,h.useLayoutEffect)(C,w);let T=t?`创建属于你的 XOPC 应用`:`Build your own apps for XOPC`,E;e[5]===T?E=e[6]:(E=(0,g.jsx)(`h2`,{className:`text-2xl font-semibold tracking-tight text-fg`,children:T}),e[5]=T,e[6]=E);let D=t?`创建、预览并持续改进自己的工具,需要时可以添加到侧栏。`:`Create, preview, and improve your own tools, then add them to the sidebar when they are ready.`,O;e[7]===D?O=e[8]:(O=(0,g.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:D}),e[7]=D,e[8]=O);let k;e[9]!==E||e[10]!==O?(k=(0,g.jsxs)(`div`,{className:`mb-7 max-w-2xl`,children:[E,O]}),e[9]=E,e[10]=O,e[11]=k):k=e[11];let A;e[12]!==l||e[13]!==S||e[14]!==_||e[15]!==t?(A=_?(0,g.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:Array.from({length:3}).map(v)}):S?(0,g.jsx)(`p`,{className:`rounded-xl border border-danger/30 bg-danger-soft p-4 text-sm text-danger`,children:S instanceof Error?S.message:String(S)}):l?.length?(0,g.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:l.map(e=>(0,g.jsxs)(i,{to:`/local-apps/${encodeURIComponent(e.id)}`,className:`group flex min-h-44 flex-col rounded-xl border border-edge-subtle bg-surface-base p-4 shadow-surface transition-colors hover:bg-surface-hover/45 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,g.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,g.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-xl bg-accent-soft text-accent-fg`,children:(0,g.jsx)(u,{className:`size-5`})}),(0,g.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-1 text-[11px] font-medium text-fg-muted`,children:e.installationState===`not_installed`?t?`草稿`:`Draft`:e.enabled?t?`已在侧栏`:`In sidebar`:t?`已禁用`:`Disabled`})]}),(0,g.jsx)(`h3`,{className:`mt-4 truncate text-sm font-semibold text-fg`,children:e.name}),(0,g.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs leading-5 text-fg-muted`,children:e.description||e.idea}),(0,g.jsxs)(`div`,{className:`mt-auto flex items-center justify-end pt-3 text-xs font-medium text-accent`,children:[t?`编辑应用`:`Edit app`,(0,g.jsx)(f,{className:`ml-1 size-3.5 transition-transform group-hover:translate-x-0.5`})]})]},e.id))}):(0,g.jsxs)(`div`,{className:`px-6 py-16 text-center`,children:[(0,g.jsx)(u,{className:`mx-auto size-8 text-fg-subtle`}),(0,g.jsx)(`h3`,{className:`mt-4 text-sm font-semibold text-fg`,children:t?`还没有应用`:`No apps yet`}),(0,g.jsx)(`p`,{className:`mx-auto mt-2 max-w-md text-sm text-fg-muted`,children:t?`描述你想解决的问题,XOPC 会创建应用骨架和可持续开发的 Project。`:`Describe the problem and XOPC will create an app scaffold and an ongoing Project.`}),(0,g.jsx)(c,{asChild:!0,variant:`primary`,className:`mt-5`,children:(0,g.jsxs)(i,{to:`/local-apps/new`,children:[(0,g.jsx)(a,{className:`size-4`}),t?`创建第一个应用`:`Create your first app`]})})]}),e[12]=l,e[13]=S,e[14]=_,e[15]=t,e[16]=A):A=e[16];let j;return e[17]!==k||e[18]!==A?(j=(0,g.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto bg-surface-panel px-3 pb-8 pt-3 sm:px-5 lg:pt-4 xl:px-6`,children:(0,g.jsxs)(`div`,{className:`mx-auto max-w-6xl`,children:[k,A]})}),e[17]=k,e[18]=A,e[19]=j):j=e[19],j}function v(e,t){return(0,g.jsx)(l,{className:`h-44 rounded-xl`},t)}function y(e){return e.clearPageHeader}function b(e){return e.setPageHeader}function x(e){return e.language}export{_ as LocalAppsPage};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{g as i}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{n as a,r as o}from"./popover-select-DcsFzD_i.js";import{t as s}from"./download-Dk-ZjtO6.js";import{t as c}from"./search-DA7gz22f.js";import{t as l}from"./x-B_N4OPjy.js";import{t as u}from"./messages-DPw2X06D.js";import{t as d}from"./cn-JdwAhgNB.js";import{a as f,c as p,n as m,r as h}from"./locale-store-Y1aBayM_.js";import{a as g,n as _,o as v,r as y,s as b,t as x}from"./dist-BGTk37IG.js";import{u as S}from"./session-api-CTN4qwiN.js";import{t as C}from"./copy-to-clipboard-HOJ79TWv.js";import{t as w}from"./button-CS04eWY9.js";import{a as T}from"./gateway-realtime-D6ffOiPe.js";import{o as E,t as D}from"./form-field-width-DJw_jULe.js";import{a as O,i as k,o as A,r as j}from"./dist-3h6cXXhT.js";import{t as M}from"./skeleton-BwbyijEw.js";import{i as N,o as P,s as F}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{Bs as I,Fo as L,Gs as R,Ut as z,_c as B,fo as ee,hs as te,ii as V,uc as H,zs as U}from"./index-CYeGnj-L.js";import{r as W}from"./settings-page-layout-X1x-2Cp9.js";var G=e(t(),1),K=n();function q(e){let t=new URLSearchParams;if(!e)return``;e.level?.length&&t.set(`level`,e.level.join(`,`)),e.from&&t.set(`from`,e.from),e.to&&t.set(`to`,e.to),e.q&&t.set(`q`,e.q),e.module&&t.set(`module`,e.module),e.requestId&&t.set(`requestId`,e.requestId),e.conversationId&&t.set(`conversationId`,e.conversationId),e.transcriptId&&t.set(`transcriptId`,e.transcriptId),e.limit!=null&&t.set(`limit`,String(e.limit)),e.offset!=null&&t.set(`offset`,String(e.offset));let n=t.toString();return n?`?${n}`:``}async function J(e){return f(h(`/api/logs${q(e)}`))}async function Y(){return(await f(h(`/api/logs/files`))).files??[]}async function X(){return(await f(h(`/api/logs/modules`))).modules??[]}async function Z(){let e=await f(h(`/api/logs/stats`));return{byLevel:e.byLevel??{},runtime:e.runtime}}async function Q(){return(await f(h(`/api/logs/dir`))).dir??``}async function ne(){return(await f(h(`/api/logs/level`))).level??`info`}async function re(e,t){return f(h(`/api/logs/level`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({level:e,...t==null?{}:{duration:String(t)}})})}async function ie(e){let t=new URLSearchParams;e?.from&&t.set(`from`,e.from),e?.to&&t.set(`to`,e.to),e?.limit!=null&&t.set(`limit`,String(e.limit));let n=t.toString();return(await f(h(`/api/logs/errors/summary${n?`?${n}`:``}`))).items??[]}var ae=500,oe=class{_callbacks;_cleanup;constructor(e){this._callbacks=e}connect(e,t){this.disconnect();let n=new Set(e?.length?e:[`trace`,`debug`,`info`,`warn`,`error`,`fatal`]);this._cleanup=T(`logs`,{onEvent:e=>{if(e.event!==`log.entry`||!e.data||typeof e.data!=`object`)return;let r=e.data;!n.has(r.level)||t&&r.module!==t||this._callbacks.onEntry(r)},onGap:()=>this._callbacks.onError(`Live log replay gap; refresh the log query`)}),this._callbacks.onConnected()}disconnect(){this._cleanup?.(),this._cleanup=void 0}};function se(e,t){let n=`${t.timestamp}-${t.requestId??``}-${t.message}`;return[t,...e.filter(e=>`${e.timestamp}-${e.requestId??``}-${e.message}`!==n)].slice(0,ae)}var ce=[`trace`,`debug`,`info`,`warn`,`error`,`fatal`];function le(e){let t=new Date(String(e.timestamp)).getTime();return Number.isFinite(t)?t:0}function ue(e){return e.toSorted((e,t)=>le(t)-le(e))}var de=new Set(ce),fe=[`error`,`fatal`],pe=[`warn`,`error`,`fatal`],me=[`info`,`warn`,`error`,`fatal`];function he(e){if(!e)return new Set;let t=new Set;for(let n of e.split(`,`)){let e=n.trim();de.has(e)&&t.add(e)}return t}function ge(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function _e(e,t){return e.size===t.length?t.every(t=>e.has(t)):!1}function ve(e){return e.size===0?`all`:_e(e,fe)?`errors`:_e(e,pe)?`warnPlus`:_e(e,me)?`infoPlus`:e.size===ce.length&&ce.every(t=>e.has(t))?`verbose`:`custom`}function ye(e){let t=ve(e);return t===`custom`?`other`:t}function be(e){switch(e){case`all`:return new Set;case`errors`:return new Set(fe);case`warnPlus`:return new Set(pe);case`infoPlus`:return new Set(me);case`verbose`:return new Set(ce)}}function xe(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>String(t[n]??``))}function Se(e){return String(e.module||e.service||e.extension||`—`)}function Ce(e){if(typeof e.message==`string`&&e.message)return e.message;try{return JSON.stringify(e)}catch{return``}}function we(e){try{return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}catch{return e}}function Te(e){try{return new Date(e).toLocaleString()}catch{return e}}function Ee(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function De(e){let t=e.trim();return t.length<=10?t:`${t.slice(0,8)}…`}function Oe(e){return String(e).toLowerCase()}function ke(e){let t=e.phase??e.meta?.phase;return typeof t==`string`&&t.trim()?t:`—`}function Ae(e){return`${e.timestamp}-${e.requestId??``}-${e.message}`}function je(e){let t=e.err??e.meta?.err;if(!t||typeof t!=`object`)return null;let n=t;return{name:typeof n.name==`string`?n.name:void 0,message:typeof n.message==`string`?n.message:void 0,stack:typeof n.stack==`string`?n.stack:void 0}}function Me(e,t){if(t.selectedLevels.size>0&&!t.selectedLevels.has(e.level)||t.moduleFilter&&Se(e)!==t.moduleFilter||t.requestIdFilter&&e.requestId!==t.requestIdFilter||t.transcriptIdFilter&&e.transcriptId!==t.transcriptIdFilter&&e.conversationId!==t.transcriptIdFilter)return!1;if(t.dateFrom){let n=new Date(t.dateFrom).getTime(),r=new Date(String(e.timestamp)).getTime();if(Number.isFinite(n)&&Number.isFinite(r)&&r<n)return!1}if(t.dateTo){let n=new Date(t.dateTo).getTime(),r=new Date(String(e.timestamp)).getTime();if(Number.isFinite(n)&&Number.isFinite(r)&&r>n)return!1}if(t.debouncedSearch){let n=t.debouncedSearch.toLowerCase();if(![e.message,Se(e),ke(e),e.requestId,e.conversationId,e.transcriptId,je(e)?.message,je(e)?.stack].filter(Boolean).map(String).join(` `).toLowerCase().includes(n))return!1}return!0}function Ne(e,t){let n=[];for(let r of ce){let i=e[r]??0;i>0&&n.push(`${t[r]} ${i}`)}return n.join(` · `)}function Pe(e,t){switch(t.type){case`setSearchInput`:return e.searchInput===t.value?e:{...e,searchInput:t.value};case`setDebouncedSearch`:return e.debouncedSearch===t.value?e:{...e,debouncedSearch:t.value};case`setLevels`:return ge(e.selectedLevels,t.value)?e:{...e,selectedLevels:t.value};case`toggleLevel`:{let n=new Set(e.selectedLevels);return n.has(t.level)?n.delete(t.level):n.add(t.level),{...e,selectedLevels:n}}case`setModule`:return e.moduleFilter===t.value?e:{...e,moduleFilter:t.value};case`setRequestIdFilter`:return e.requestIdFilter===t.value?e:{...e,requestIdFilter:t.value};case`setTranscriptIdFilter`:return e.transcriptIdFilter===t.value?e:{...e,transcriptIdFilter:t.value};case`setDateFrom`:return e.dateFrom===t.value?e:{...e,dateFrom:t.value};case`setDateTo`:return e.dateTo===t.value?e:{...e,dateTo:t.value};case`setAutoRefresh`:return e.autoRefresh===t.value?e:{...e,autoRefresh:t.value};case`syncFromUrl`:{let n=t.payload;return e.searchInput===n.searchInput&&e.debouncedSearch===n.debouncedSearch&&ge(e.selectedLevels,n.selectedLevels)&&e.moduleFilter===n.moduleFilter&&e.requestIdFilter===n.requestIdFilter&&e.transcriptIdFilter===n.transcriptIdFilter&&e.dateFrom===n.dateFrom&&e.dateTo===n.dateTo&&e.autoRefresh===n.autoRefresh?e:{...e,...n}}case`clearAll`:return{searchInput:``,debouncedSearch:``,selectedLevels:new Set,moduleFilter:``,requestIdFilter:``,transcriptIdFilter:``,dateFrom:``,dateTo:``,autoRefresh:e.autoRefresh}}}var Fe={logs:[],loading:!1,error:null,hasMore:!1,modules:[],files:[],stats:null,logDir:null};function Ie(e,t){switch(t.type){case`queryStart`:return{...e,loading:!0,error:null,logs:[]};case`querySuccess`:return{...e,loading:!1,logs:ue(t.logs),hasMore:t.hasMore};case`queryError`:return t.resetLogs?{...e,loading:!1,error:t.message,logs:[],hasMore:!1}:{...e,loading:!1,error:t.message};case`appendSuccess`:return{...e,loading:!1,logs:ue([...e.logs,...t.logs]),hasMore:t.hasMore};case`metaSuccess`:return{...e,modules:t.modules,stats:t.stats,files:t.files};case`filesSuccess`:return{...e,files:t.files,logDir:t.logDir};case`filesClear`:return{...e,files:[]};case`liveTick`:return{...e,logs:ue(t.logs),hasMore:t.hasMore,stats:t.stats};case`appendLiveEntry`:return{...e,logs:ue(se(e.logs,t.entry))};case`updateStats`:return{...e,stats:t.stats};case`refreshAllSuccess`:return{...e,loading:!1,logs:ue(t.logs),hasMore:t.hasMore,stats:t.stats,files:t.files}}}function Le(e){let t=u(e).logs,n=p(e=>e.conversationId),r=!!n,[a,o]=i(),s=(0,G.useRef)(a),[c,l]=(0,G.useReducer)(Pe,void 0,()=>{let e=s.current,t=e.get(`q`)??``;return{searchInput:t,debouncedSearch:t.trim(),selectedLevels:he(e.get(`level`)),moduleFilter:e.get(`module`)??``,requestIdFilter:e.get(`requestId`)??``,transcriptIdFilter:e.get(`transcriptId`)??``,dateFrom:e.get(`from`)??``,dateTo:e.get(`to`)??``,autoRefresh:e.get(`live`)===`1`}}),[d,f]=(0,G.useReducer)(Ie,Fe),[m,h]=(0,G.useState)(null),[g,_]=(0,G.useState)(!1),[v,y]=(0,G.useState)(!1),[b,x]=(0,G.useState)(null),[C,w]=(0,G.useState)([]),[T,E]=(0,G.useState)(!1),{searchInput:D,debouncedSearch:O,selectedLevels:k,moduleFilter:A,requestIdFilter:j,transcriptIdFilter:M,dateFrom:N,dateTo:P,autoRefresh:F}=c,{logs:I,loading:L,error:R,hasMore:z,modules:B,files:ee,stats:te,logDir:V}=d,H=(0,G.useCallback)(e=>l({type:`setSearchInput`,value:e}),[]),U=(0,G.useCallback)(e=>l({type:`setLevels`,value:e}),[]),W=(0,G.useCallback)(e=>l({type:`setModule`,value:e}),[]),K=(0,G.useCallback)(e=>l({type:`setRequestIdFilter`,value:e}),[]),q=(0,G.useCallback)(e=>l({type:`setTranscriptIdFilter`,value:e}),[]),ne=(0,G.useCallback)(e=>l({type:`setDateFrom`,value:e}),[]),re=(0,G.useCallback)(e=>l({type:`setDateTo`,value:e}),[]),ae=(0,G.useCallback)(e=>l({type:`setAutoRefresh`,value:e}),[]),se=(0,G.useMemo)(()=>ye(k),[k]),ce=e=>{if(e===`other`){y(!0);return}l({type:`setLevels`,value:be(e)})},le=O.length>0||k.size>0||!!A||!!j||!!M||!!N||!!P,ue=+(O.length>0)+ +(k.size>0)+ +!!A+ +!!j+ +!!M+(N||P?1:0);(0,G.useEffect)(()=>{let e=setTimeout(()=>l({type:`setDebouncedSearch`,value:D.trim()}),300);return()=>clearTimeout(e)},[D]),(0,G.useEffect)(()=>{let e=a.get(`q`)??``;l({type:`syncFromUrl`,payload:{searchInput:e,debouncedSearch:e.trim(),selectedLevels:he(a.get(`level`)),moduleFilter:a.get(`module`)??``,requestIdFilter:a.get(`requestId`)??``,transcriptIdFilter:a.get(`transcriptId`)??``,dateFrom:a.get(`from`)??``,dateTo:a.get(`to`)??``,autoRefresh:a.get(`live`)===`1`}})},[a]),(0,G.useEffect)(()=>{let e=new URLSearchParams(a),t=O.trim();t?e.set(`q`,t):e.delete(`q`),k.size>0?e.set(`level`,Array.from(k).sort().join(`,`)):e.delete(`level`),A?e.set(`module`,A):e.delete(`module`),j?e.set(`requestId`,j):e.delete(`requestId`),M?e.set(`transcriptId`,M):e.delete(`transcriptId`),N?e.set(`from`,N):e.delete(`from`),P?e.set(`to`,P):e.delete(`to`),F?e.set(`live`,`1`):e.delete(`live`),e.toString()!==a.toString()&&o(e,{replace:!0})},[F,N,P,O,A,j,M,a,k,o]);let de=(0,G.useMemo)(()=>({q:O||void 0,level:k.size>0?Array.from(k):void 0,module:A||void 0,requestId:j||void 0,transcriptId:M||void 0,from:N||void 0,to:P||void 0,limit:50}),[O,k,A,j,M,N,P]),fe=(0,G.useMemo)(()=>({debouncedSearch:O,selectedLevels:k,moduleFilter:A,requestIdFilter:j,transcriptIdFilter:M,dateFrom:N,dateTo:P}),[O,k,A,j,M,N,P]),pe=(0,G.useRef)(fe);return pe.current=fe,(0,G.useEffect)(()=>{if(!r)return;let e=!1;return E(!0),ie({from:N||void 0,to:P||void 0,limit:12}).then(t=>{e||w(t)}).catch(()=>{e||w([])}).finally(()=>{e||E(!1)}),()=>{e=!0}},[r,N,P]),(0,G.useEffect)(()=>{if(!r)return;let e=!1;return f({type:`queryStart`}),(async()=>{try{let t=await J({...de,offset:0});if(e)return;f({type:`querySuccess`,logs:t.logs,hasMore:t.logs.length===50})}catch(n){e||f({type:`queryError`,message:n instanceof Error?n.message:t.loadError,resetLogs:!0})}})(),()=>{e=!0}},[r,de,t.loadError]),(0,G.useEffect)(()=>{if(!r)return;let e=!1;return(async()=>{try{let[t,n,r]=await Promise.all([X(),Z(),Y()]);e||f({type:`metaSuccess`,modules:t,stats:n,files:r})}catch{}})(),()=>{e=!0}},[r]),(0,G.useEffect)(()=>{if(!r||!g)return;let e=!1;return(async()=>{try{let[t,n]=await Promise.all([Y(),Q()]);e||f({type:`filesSuccess`,files:t,logDir:n})}catch{e||f({type:`filesClear`})}})(),()=>{e=!0}},[r,g]),(0,G.useEffect)(()=>{if(!F||!r)return;let e=new oe({onConnected:()=>{},onEntry:e=>{Me(e,pe.current)&&f({type:`appendLiveEntry`,entry:e})},onError:()=>{}});e.connect(k.size>0?Array.from(k):void 0,A||void 0);let t=window.setInterval(()=>{Z().then(e=>{f({type:`updateStats`,stats:e})}).catch(()=>{})},3e4);return()=>{e.disconnect(),clearInterval(t)}},[F,r,n,k,A]),(0,G.useEffect)(()=>{if(!b)return;let e=window.setTimeout(()=>x(null),2e3);return()=>clearTimeout(e)},[b]),{L:t,hasToken:r,logs:I,loading:L,error:R,hasMore:z,searchInput:D,setSearchInput:H,selectedLevels:k,setSelectedLevels:U,moduleFilter:A,setModuleFilter:W,requestIdFilter:j,transcriptIdFilter:M,dateFrom:N,setDateFrom:ne,dateTo:P,setDateTo:re,modules:B,files:ee,stats:te,selectedLog:m,setSelectedLog:h,filesOpen:g,setFilesOpen:_,filtersOpen:v,setFiltersOpen:y,logDir:V,autoRefresh:F,setAutoRefresh:ae,copiedDetail:b,setCopiedDetail:x,hasActiveFilters:le,activeFilterCount:ue,clearFilters:()=>l({type:`clearAll`}),toggleDialogLevel:e=>l({type:`toggleLevel`,level:e}),handleLoadMore:()=>{L||!z||(async()=>{f({type:`queryStart`});try{let e=await J({...de,offset:I.length});f({type:`appendSuccess`,logs:e.logs,hasMore:e.logs.length===50})}catch(e){f({type:`queryError`,message:e instanceof Error?e.message:t.loadError})}})()},refreshAll:()=>{(async()=>{f({type:`queryStart`});try{let e=await J({...de,offset:0}),[t,n]=await Promise.all([Z(),Y()]);f({type:`refreshAllSuccess`,logs:e.logs,hasMore:e.logs.length===50,stats:t,files:n})}catch(e){f({type:`queryError`,message:e instanceof Error?e.message:t.loadError})}})()},levelSegment:se,handleLevelSegment:ce,filterByRequestId:(0,G.useCallback)(e=>{h(null),K(e)},[K]),filterByTranscriptId:(0,G.useCallback)(e=>{h(null),q(e)},[q]),filterByErrorSummary:(0,G.useCallback)(e=>{l({type:`setSearchInput`,value:e.errName}),l({type:`setDebouncedSearch`,value:e.errName}),e.module&&l({type:`setModule`,value:e.module}),l({type:`setLevels`,value:be(`errors`)})},[]),openChatForSession:(0,G.useCallback)(e=>{let t=e.conversationId?.trim();if(t){window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{conversationId:t}}));return}let n=e.transcriptId?.trim();n&&S({transcriptId:n}).then(e=>{window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{conversationId:e.conversationId}}))}).catch(()=>{})},[]),errorSummary:C,errorSummaryLoading:T}}var $=r();function Re(e){let t=(0,K.c)(36),{L:n,items:r,loading:i,onSelectItem:a}=e,[o,s]=(0,G.useState)(!1);if(!i&&r.length===0)return null;let c;t[0]===r?c=t[1]:(c=r.reduce(Be,0),t[0]=r,t[1]=c);let l=c,u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>s(ze),t[2]=u):u=t[2];let f;t[3]===n.errorSummaryTitle?f=t[4]:(f=(0,$.jsx)(`h2`,{className:`text-sm font-semibold tracking-tight text-fg`,children:n.errorSummaryTitle}),t[3]=n.errorSummaryTitle,t[4]=f);let p;t[5]===n.errorSummaryHint?p=t[6]:(p=(0,$.jsx)(`p`,{className:`mt-0.5 text-xs leading-5 text-fg-muted`,children:n.errorSummaryHint}),t[5]=n.errorSummaryHint,t[6]=p);let m;t[7]!==f||t[8]!==p?(m=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[f,p]}),t[7]=f,t[8]=p,t[9]=m):m=t[9];let h;t[10]!==r.length||t[11]!==i||t[12]!==l?(h=i?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(M,{className:`h-5 w-8 rounded-md`}),(0,$.jsx)(M,{className:`h-5 w-10 rounded-md`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`rounded-md bg-red-500/10 px-2 py-0.5 text-xs tabular-nums text-red-600 dark:text-red-400`,children:r.length}),(0,$.jsxs)(`span`,{className:`rounded-md bg-surface-hover px-2 py-0.5 text-xs tabular-nums text-fg-muted`,children:[`×`,l]})]}),t[10]=r.length,t[11]=i,t[12]=l,t[13]=h):h=t[13];let g=o&&`rotate-180`,_;t[14]===g?_=t[15]:(_=d(`size-4 text-fg-muted transition-transform duration-150 ease-out motion-reduce:transition-none`,g),t[14]=g,t[15]=_);let v;t[16]===_?v=t[17]:(v=(0,$.jsx)(B,{className:_,strokeWidth:1.75,"aria-hidden":!0}),t[16]=_,t[17]=v);let y;t[18]!==h||t[19]!==v?(y=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 pt-0.5`,children:[h,v]}),t[18]=h,t[19]=v,t[20]=y):y=t[20];let b;t[21]!==o||t[22]!==y||t[23]!==m?(b=(0,$.jsxs)(`button`,{type:`button`,onClick:u,"aria-expanded":o,className:`flex w-full items-start justify-between gap-3 px-4 py-4 text-left transition-colors hover:bg-surface-hover/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-inset sm:px-5`,children:[m,y]}),t[21]=o,t[22]=y,t[23]=m,t[24]=b):b=t[24];let x;t[25]!==n.module||t[26]!==n.phase||t[27]!==n.time||t[28]!==o||t[29]!==r||t[30]!==i||t[31]!==a?(x=o&&!i&&r.length>0?(0,$.jsx)(`ul`,{className:`mx-1 mb-1 flex flex-col gap-1 rounded-lg bg-surface-base/45 p-1 [&>li]:rounded-lg`,children:r.map(e=>(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>a?.(e),className:d(`flex w-full flex-col gap-1 px-4 py-2.5 text-left transition-colors hover:bg-surface-hover`,a&&`cursor-pointer`),children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-fg`,children:e.errName}),(0,$.jsxs)(`span`,{className:`shrink-0 rounded-md bg-red-500/10 px-2 py-0.5 text-xs tabular-nums text-red-600 dark:text-red-400`,children:[`×`,e.count]})]}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-x-3 gap-y-1 text-xs text-fg-muted`,children:[e.phase?(0,$.jsxs)(`span`,{children:[n.phase,`: `,e.phase]}):null,e.module?(0,$.jsxs)(`span`,{children:[n.module,`: `,e.module]}):null,(0,$.jsxs)(`span`,{children:[n.time,`: `,we(e.lastSeen)]})]}),(0,$.jsx)(`p`,{className:`truncate text-xs text-fg-subtle`,children:e.sampleMessage})]})},e.key))}):null,t[25]=n.module,t[26]=n.phase,t[27]=n.time,t[28]=o,t[29]=r,t[30]=i,t[31]=a,t[32]=x):x=t[32];let S;return t[33]!==b||t[34]!==x?(S=(0,$.jsxs)(`section`,{className:`overflow-hidden rounded-xl bg-surface-hover/20`,children:[b,x]}),t[33]=b,t[34]=x,t[35]=S):S=t[35],S}function ze(e){return!e}function Be(e,t){return e+t.count}function Ve(e){let t=(0,K.c)(75),{log:n,labels:r,onFilterByRequestId:i,onFilterByTranscriptId:a,onOpenChat:o}=e,s=n.level??`info`,c=typeof n.requestId==`string`?n.requestId:``,l=typeof n.conversationId==`string`?n.conversationId:``,u=typeof n.transcriptId==`string`?n.transcriptId:``,f;t[0]===n?f=t[1]:(f=ke(n),t[0]=n,t[1]=f);let p=f,m;t[2]===n?m=t[3]:(m=je(n),t[2]=n,t[3]=m);let h=m,g=s===`error`||s===`fatal`,_;t[4]===r.message?_=t[5]:(_=(0,$.jsx)(`span`,{className:`text-xs font-sans font-medium text-fg-muted`,children:r.message}),t[4]=r.message,t[5]=_);let v=g&&`border-red-500/40`,y;t[6]===v?y=t[7]:(y=d(`mt-2 whitespace-pre-wrap break-words border border-edge bg-surface-base p-3 text-xs leading-relaxed text-fg dark:border-edge`,v),t[6]=v,t[7]=y);let b=n.message||`—`,x;t[8]!==y||t[9]!==b?(x=(0,$.jsx)(`pre`,{className:y,children:b}),t[8]=y,t[9]=b,t[10]=x):x=t[10];let S;t[11]!==_||t[12]!==x?(S=(0,$.jsxs)(`div`,{children:[_,x]}),t[11]=_,t[12]=x,t[13]=S):S=t[13];let C;t[14]!==h||t[15]!==r.stackTrace?(C=h?.stack?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{className:`text-xs font-sans font-medium text-fg-muted`,children:r.stackTrace}),h.name?(0,$.jsx)(`p`,{className:`mt-1 text-xs text-red-600 dark:text-red-400`,children:h.name}):null,(0,$.jsx)(`pre`,{className:`mt-2 overflow-x-auto whitespace-pre-wrap break-words border border-red-500/30 bg-surface-base p-3 text-xs leading-relaxed text-fg dark:border-red-500/30`,children:h.stack})]}):null,t[14]=h,t[15]=r.stackTrace,t[16]=C):C=t[16];let T;t[17]===r.time?T=t[18]:(T=(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.time}),t[17]=r.time,t[18]=T);let E;t[19]===n.timestamp?E=t[20]:(E=(0,$.jsx)(`code`,{className:`break-all text-fg`,children:n.timestamp}),t[19]=n.timestamp,t[20]=E);let D;t[21]===r.level?D=t[22]:(D=(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.level}),t[21]=r.level,t[22]=D);let O=g&&`font-medium text-red-600 dark:text-red-400`,k;t[23]===O?k=t[24]:(k=d(`text-fg`,O),t[23]=O,t[24]=k);let A;t[25]===s?A=t[26]:(A=Oe(s),t[25]=s,t[26]=A);let j;t[27]!==k||t[28]!==A?(j=(0,$.jsx)(`span`,{className:k,children:A}),t[27]=k,t[28]=A,t[29]=j):j=t[29];let M;t[30]===r.module?M=t[31]:(M=(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.module}),t[30]=r.module,t[31]=M);let N;t[32]===n?N=t[33]:(N=Se(n),t[32]=n,t[33]=N);let P;t[34]===N?P=t[35]:(P=(0,$.jsx)(`code`,{className:`break-all text-fg`,children:N}),t[34]=N,t[35]=P);let F;t[36]!==r.phase||t[37]!==p?(F=p===`—`?null:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.phase}),(0,$.jsx)(`code`,{className:`break-all text-fg`,children:p})]}),t[36]=r.phase,t[37]=p,t[38]=F):F=t[38];let I;t[39]!==r.filterByRequestId||t[40]!==r.requestId||t[41]!==i||t[42]!==c?(I=c?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.requestId}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,$.jsx)(`code`,{className:`break-all text-fg`,children:c}),i?(0,$.jsx)(w,{type:`button`,variant:`secondary`,className:`h-7 px-2 text-[11px]`,onClick:()=>i(c),children:r.filterByRequestId}):null]})]}):null,t[39]=r.filterByRequestId,t[40]=r.requestId,t[41]=i,t[42]=c,t[43]=I):I=t[43];let L;t[44]!==r.conversationId||t[45]!==r.openChat||t[46]!==o||t[47]!==l?(L=l?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.conversationId}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,$.jsx)(`code`,{className:`break-all text-fg`,children:l}),o?(0,$.jsx)(w,{type:`button`,variant:`secondary`,className:`h-7 px-2 text-[11px]`,onClick:()=>o({conversationId:l}),children:r.openChat}):null]})]}):null,t[44]=r.conversationId,t[45]=r.openChat,t[46]=o,t[47]=l,t[48]=L):L=t[48];let R;t[49]!==r.filterByTranscriptId||t[50]!==r.openChat||t[51]!==r.transcriptId||t[52]!==a||t[53]!==o||t[54]!==u?(R=u?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.transcriptId}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,$.jsx)(`code`,{className:`break-all text-fg`,children:u}),a?(0,$.jsx)(w,{type:`button`,variant:`secondary`,className:`h-7 px-2 text-[11px]`,onClick:()=>a(u),children:r.filterByTranscriptId}):null,o?(0,$.jsx)(w,{type:`button`,variant:`secondary`,className:`h-7 px-2 text-[11px]`,onClick:()=>o({transcriptId:u}),children:r.openChat}):null]})]}):null,t[49]=r.filterByTranscriptId,t[50]=r.openChat,t[51]=r.transcriptId,t[52]=a,t[53]=o,t[54]=u,t[55]=R):R=t[55];let z;t[56]!==T||t[57]!==E||t[58]!==D||t[59]!==j||t[60]!==M||t[61]!==P||t[62]!==F||t[63]!==I||t[64]!==L||t[65]!==R?(z=(0,$.jsxs)(`div`,{className:`grid grid-cols-[5.5rem_1fr] gap-x-3 gap-y-2 text-xs`,children:[T,E,D,j,M,P,F,I,L,R]}),t[56]=T,t[57]=E,t[58]=D,t[59]=j,t[60]=M,t[61]=P,t[62]=F,t[63]=I,t[64]=L,t[65]=R,t[66]=z):z=t[66];let B;t[67]!==r.metadata||t[68]!==n.meta?(B=n.meta&&Object.keys(n.meta).length>0?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{className:`text-xs font-sans font-medium text-fg-muted`,children:r.metadata}),(0,$.jsx)(`pre`,{className:`mt-2 overflow-x-auto whitespace-pre-wrap break-words border border-edge bg-surface-base p-3 text-xs leading-relaxed text-fg dark:border-edge`,children:JSON.stringify(n.meta,null,2)})]}):null,t[67]=r.metadata,t[68]=n.meta,t[69]=B):B=t[69];let ee;return t[70]!==z||t[71]!==B||t[72]!==S||t[73]!==C?(ee=(0,$.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[S,C,z,B]}),t[70]=z,t[71]=B,t[72]=S,t[73]=C,t[74]=ee):ee=t[74],ee}function He(e){let t=(0,K.c)(50),{L:n,log:r,onClose:i,copiedDetail:a,onCopiedMessage:o,onCopiedJson:s,onFilterByRequestId:c,onFilterByTranscriptId:u,onOpenChat:f}=e,p=r!==null,m;t[0]===i?m=t[1]:(m=e=>!e&&i(),t[0]=i,t[1]=m);let h;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(g,{className:d(`xopc-dialog-overlay fixed inset-0 bg-scrim`,P)}),t[2]=h):h=t[2];let S;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(S=d(`xopc-drawer-right fixed right-0 top-0 flex size-full max-w-lg flex-col border-l border-edge bg-surface-overlay shadow-popover outline-none`,N,`dark:border-edge`),t[3]=S):S=t[3];let T;t[4]===n.details?T=t[5]:(T=(0,$.jsx)(b,{className:`text-base font-semibold tracking-tight text-fg`,children:n.details}),t[4]=n.details,t[5]=T);let E;t[6]!==n.copied||t[7]!==n.copyJson||t[8]!==n.copyMessage||t[9]!==a||t[10]!==r||t[11]!==s||t[12]!==o?(E=r?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(w,{type:`button`,variant:`ghost`,className:`h-9 shrink-0 gap-1 px-2 text-xs`,onClick:()=>{C(typeof r.message==`string`?r.message:``).then(e=>{e&&o()})},children:[(0,$.jsx)(H,{className:`size-3.5 shrink-0`,strokeWidth:1.75}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:a===`message`?n.copied:n.copyMessage})]}),(0,$.jsxs)(w,{type:`button`,variant:`ghost`,className:`h-9 shrink-0 gap-1 px-2 text-xs`,onClick:()=>{C(JSON.stringify(r,null,2)).then(e=>{e&&s()})},children:[(0,$.jsx)(H,{className:`size-3.5 shrink-0`,strokeWidth:1.75}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:a===`json`?n.copied:n.copyJson})]})]}):null,t[6]=n.copied,t[7]=n.copyJson,t[8]=n.copyMessage,t[9]=a,t[10]=r,t[11]=s,t[12]=o,t[13]=E):E=t[13];let D;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(l,{className:`size-5`,strokeWidth:1.75}),t[14]=D):D=t[14];let O;t[15]===n.close?O=t[16]:(O=(0,$.jsx)(_,{asChild:!0,children:(0,$.jsx)(w,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":n.close,children:D})}),t[15]=n.close,t[16]=O);let k;t[17]!==E||t[18]!==O?(k=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[E,O]}),t[17]=E,t[18]=O,t[19]=k):k=t[19];let A;t[20]!==T||t[21]!==k?(A=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3 dark:border-edge`,children:[T,k]}),t[20]=T,t[21]=k,t[22]=A):A=t[22];let j;t[23]!==n.conversationId||t[24]!==n.filterByRequestId||t[25]!==n.filterByTranscriptId||t[26]!==n.level||t[27]!==n.message||t[28]!==n.metadata||t[29]!==n.module||t[30]!==n.openChat||t[31]!==n.phase||t[32]!==n.requestId||t[33]!==n.stackTrace||t[34]!==n.time||t[35]!==n.transcriptId||t[36]!==r||t[37]!==c||t[38]!==u||t[39]!==f?(j=r?(0,$.jsx)(Ve,{log:r,labels:{time:n.time,level:n.level,module:n.module,message:n.message,metadata:n.metadata,requestId:n.requestId,conversationId:n.conversationId,transcriptId:n.transcriptId,phase:n.phase,stackTrace:n.stackTrace,filterByRequestId:n.filterByRequestId,filterByTranscriptId:n.filterByTranscriptId,openChat:n.openChat},onFilterByRequestId:c,onFilterByTranscriptId:u,onOpenChat:f}):null,t[23]=n.conversationId,t[24]=n.filterByRequestId,t[25]=n.filterByTranscriptId,t[26]=n.level,t[27]=n.message,t[28]=n.metadata,t[29]=n.module,t[30]=n.openChat,t[31]=n.phase,t[32]=n.requestId,t[33]=n.stackTrace,t[34]=n.time,t[35]=n.transcriptId,t[36]=r,t[37]=c,t[38]=u,t[39]=f,t[40]=j):j=t[40];let M;t[41]===j?M=t[42]:(M=(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-4 font-mono text-sm leading-relaxed`,children:j}),t[41]=j,t[42]=M);let F;t[43]!==A||t[44]!==M?(F=(0,$.jsxs)(v,{children:[h,(0,$.jsxs)(y,{className:S,"aria-describedby":void 0,children:[A,M]})]}),t[43]=A,t[44]=M,t[45]=F):F=t[45];let I;return t[46]!==p||t[47]!==F||t[48]!==m?(I=(0,$.jsx)(x,{open:p,onOpenChange:m,children:F}),t[46]=p,t[47]=F,t[48]=m,t[49]=I):I=t[49],I}function Ue(e){let t=(0,K.c)(25),{L:n,open:r,onOpenChange:i,files:a,logDir:o}=e,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(g,{className:d(`xopc-dialog-overlay fixed inset-0 bg-scrim`,P)}),t[0]=s):s=t[0];let c;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=d(`xopc-dialog-content fixed left-1/2 top-1/2 flex max-h-[min(32rem,85vh)] w-[min(100%-2rem,24rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl border border-edge bg-surface-overlay shadow-popover outline-none`,N,`dark:border-edge`),t[1]=c):c=t[1];let u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(I,{className:`size-4 text-fg-muted`,strokeWidth:1.75}),t[2]=u):u=t[2];let f;t[3]===n.logFiles?f=t[4]:(f=(0,$.jsxs)(b,{className:`flex items-center gap-2 text-base font-semibold tracking-tight text-fg`,children:[u,n.logFiles]}),t[3]=n.logFiles,t[4]=f);let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(l,{className:`size-5`,strokeWidth:1.75}),t[5]=p):p=t[5];let m;t[6]===n.close?m=t[7]:(m=(0,$.jsx)(_,{asChild:!0,children:(0,$.jsx)(w,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":n.close,children:p})}),t[6]=n.close,t[7]=m);let h;t[8]!==f||t[9]!==m?(h=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3 dark:border-edge`,children:[f,m]}),t[8]=f,t[9]=m,t[10]=h):h=t[10];let S;t[11]!==n.filesEmpty||t[12]!==a?(S=(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:a.length===0?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.filesEmpty}):(0,$.jsx)(`ul`,{className:`flex flex-col gap-2`,children:a.map(We)})}),t[11]=n.filesEmpty,t[12]=a,t[13]=S):S=t[13];let C;t[14]!==n.logDir||t[15]!==o?(C=o?(0,$.jsxs)(`div`,{className:`shrink-0 border-t border-edge-subtle px-4 py-2 text-xs text-fg-subtle dark:border-edge`,children:[(0,$.jsxs)(`span`,{className:`font-medium text-fg-muted`,children:[n.logDir,`: `]}),(0,$.jsx)(`code`,{className:`break-all text-fg-subtle`,children:o})]}):null,t[14]=n.logDir,t[15]=o,t[16]=C):C=t[16];let T;t[17]!==h||t[18]!==S||t[19]!==C?(T=(0,$.jsxs)(v,{children:[s,(0,$.jsxs)(y,{className:c,children:[h,S,C]})]}),t[17]=h,t[18]=S,t[19]=C,t[20]=T):T=t[20];let E;return t[21]!==i||t[22]!==r||t[23]!==T?(E=(0,$.jsx)(x,{open:r,onOpenChange:i,children:T}),t[21]=i,t[22]=r,t[23]=T,t[24]=E):E=t[24],E}function We(e){return(0,$.jsxs)(`li`,{className:`flex flex-col gap-1 rounded-lg border border-edge-subtle bg-surface-base px-3 py-2 dark:border-edge`,children:[(0,$.jsx)(`span`,{className:`break-all font-mono text-xs text-fg`,children:e.name}),(0,$.jsxs)(`span`,{className:`flex flex-wrap gap-x-2 text-xs text-fg-subtle`,children:[(0,$.jsx)(`span`,{children:Ee(e.size)}),(0,$.jsx)(`span`,{children:Te(e.modified)})]})]},e.name)}function Ge(e){let t=(0,K.c)(68),{L:n,open:r,onOpenChange:i,dateFrom:a,onDateFromChange:o,dateTo:s,onDateToChange:c,selectedLevels:u,onToggleLevel:f}=e,p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(g,{className:d(`xopc-dialog-overlay fixed inset-0 bg-scrim`,P)}),t[0]=p):p=t[0];let m;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(m=d(`xopc-dialog-content fixed left-1/2 top-1/2 flex max-h-[min(32rem,90vh)] w-[min(100%-2rem,22rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl border border-edge bg-surface-overlay shadow-popover outline-none`,N,`dark:border-edge`),t[1]=m):m=t[1];let h;t[2]===n.filtersDialogTitle?h=t[3]:(h=(0,$.jsx)(b,{className:`text-base font-semibold tracking-tight text-fg`,children:n.filtersDialogTitle}),t[2]=n.filtersDialogTitle,t[3]=h);let S;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(l,{className:`size-5`,strokeWidth:1.75}),t[4]=S):S=t[4];let C;t[5]===n.close?C=t[6]:(C=(0,$.jsx)(_,{asChild:!0,children:(0,$.jsx)(w,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":n.close,children:S})}),t[5]=n.close,t[6]=C);let T;t[7]!==h||t[8]!==C?(T=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3 dark:border-edge`,children:[h,C]}),t[7]=h,t[8]=C,t[9]=T):T=t[9];let E;t[10]===n.filtersDialogDesc?E=t[11]:(E=(0,$.jsx)(`div`,{id:`log-filters-desc`,className:`sr-only`,children:n.filtersDialogDesc}),t[10]=n.filtersDialogDesc,t[11]=E);let D;t[12]===n.timeRange?D=t[13]:(D=(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:n.timeRange}),t[12]=n.timeRange,t[13]=D);let O;t[14]===n.from?O=t[15]:(O=(0,$.jsx)(`label`,{htmlFor:`log-from-d`,className:`mb-1 block text-xs text-fg-muted`,children:n.from}),t[14]=n.from,t[15]=O);let k;t[16]===o?k=t[17]:(k=e=>o(e.target.value),t[16]=o,t[17]=k);let A;t[18]!==a||t[19]!==k?(A=(0,$.jsx)(`input`,{id:`log-from-d`,type:`datetime-local`,value:a,onChange:k,className:`w-full rounded-xl border border-edge bg-surface-base p-2 text-sm text-fg dark:border-edge`}),t[18]=a,t[19]=k,t[20]=A):A=t[20];let j;t[21]!==A||t[22]!==O?(j=(0,$.jsxs)(`div`,{children:[O,A]}),t[21]=A,t[22]=O,t[23]=j):j=t[23];let M;t[24]===n.to?M=t[25]:(M=(0,$.jsx)(`label`,{htmlFor:`log-to-d`,className:`mb-1 block text-xs text-fg-muted`,children:n.to}),t[24]=n.to,t[25]=M);let F;t[26]===c?F=t[27]:(F=e=>c(e.target.value),t[26]=c,t[27]=F);let I;t[28]!==s||t[29]!==F?(I=(0,$.jsx)(`input`,{id:`log-to-d`,type:`datetime-local`,value:s,onChange:F,className:`w-full rounded-xl border border-edge bg-surface-base p-2 text-sm text-fg dark:border-edge`}),t[28]=s,t[29]=F,t[30]=I):I=t[30];let L;t[31]!==M||t[32]!==I?(L=(0,$.jsxs)(`div`,{children:[M,I]}),t[31]=M,t[32]=I,t[33]=L):L=t[33];let R;t[34]!==j||t[35]!==L?(R=(0,$.jsxs)(`div`,{className:`mt-2 flex flex-col gap-3`,children:[j,L]}),t[34]=j,t[35]=L,t[36]=R):R=t[36];let z;t[37]===n.levelCustom?z=t[38]:(z=(0,$.jsx)(`p`,{className:`mt-6 text-xs font-medium text-fg-muted`,children:n.levelCustom}),t[37]=n.levelCustom,t[38]=z);let B;t[39]===n.levelCustomHint?B=t[40]:(B=(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-subtle`,children:n.levelCustomHint}),t[39]=n.levelCustomHint,t[40]=B);let ee=n.level,te;t[41]!==n.levelNames||t[42]!==f||t[43]!==u?(te=ce.map(e=>(0,$.jsx)(`button`,{type:`button`,className:d(`rounded-full border px-3 py-1.5 text-xs font-medium capitalize transition-[color,background-color,border-color] duration-150 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,u.has(e)?`border-edge bg-surface-active text-fg dark:border-edge`:`border-edge-subtle bg-surface-base text-fg-muted hover:bg-surface-hover dark:border-edge`),onClick:()=>f(e),children:n.levelNames[e]},e)),t[41]=n.levelNames,t[42]=f,t[43]=u,t[44]=te):te=t[44];let V;t[45]!==n.level||t[46]!==te?(V=(0,$.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,role:`group`,"aria-label":ee,children:te}),t[45]=n.level,t[46]=te,t[47]=V):V=t[47];let H;t[48]!==R||t[49]!==z||t[50]!==B||t[51]!==V||t[52]!==D?(H=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-4`,children:[D,R,z,B,V]}),t[48]=R,t[49]=z,t[50]=B,t[51]=V,t[52]=D,t[53]=H):H=t[53];let U;t[54]===i?U=t[55]:(U=()=>i(!1),t[54]=i,t[55]=U);let W;t[56]!==n.filtersDone||t[57]!==U?(W=(0,$.jsx)(`div`,{className:`shrink-0 border-t border-edge-subtle px-4 py-3 dark:border-edge`,children:(0,$.jsx)(w,{type:`button`,className:`w-full rounded-xl`,onClick:U,children:n.filtersDone})}),t[56]=n.filtersDone,t[57]=U,t[58]=W):W=t[58];let G;t[59]!==H||t[60]!==W||t[61]!==T||t[62]!==E?(G=(0,$.jsxs)(v,{children:[p,(0,$.jsxs)(y,{className:m,"aria-describedby":`log-filters-desc`,children:[T,E,H,W]})]}),t[59]=H,t[60]=W,t[61]=T,t[62]=E,t[63]=G):G=t[63];let q;return t[64]!==i||t[65]!==r||t[66]!==G?(q=(0,$.jsx)(x,{open:r,onOpenChange:i,children:G}),t[64]=i,t[65]=r,t[66]=G,t[67]=q):q=t[67],q}var Ke=1;function qe(e,t){let n=0,r=0,i=e;for(;i&&i!==t;)n+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;return i===t?{x:n,y:r}:null}var Je=`pointer-events-none absolute left-0 top-0 z-[1] rounded-pill bg-surface-panel shadow-sm will-change-transform [backface-visibility:hidden] dark:bg-surface-panel dark:shadow-sm dark:ring-1 dark:ring-edge-strong/40`,Ye=`touch-target relative z-[2] box-border flex h-6 flex-1 cursor-pointer items-center justify-center gap-1 rounded-pill border-0 bg-transparent px-2 py-0 text-center text-xs font-medium leading-none outline-none transition-[color,background-color,box-shadow] duration-150 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel active:scale-100 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`;function Xe({value:e,onChange:t,options:n,"aria-label":r,className:i,buttonClassName:a}){let o=(0,G.useRef)(null),s=(0,G.useRef)([]),[c,l]=(0,G.useState)({x:0,y:0,w:0,h:0}),[u,f]=(0,G.useState)(!1),[p,m]=(0,G.useState)(!1),h=(0,G.useCallback)(()=>{let t=o.current;if(!t)return;let r=n.findIndex(t=>t.value===e);if(r<0)return;let i=s.current[r];if(!i)return;let a=Ke,c=t.getBoundingClientRect(),u=i.getBoundingClientRect(),d=qe(i,t),p,m;if(d)p=d.x,m=d.y;else{let e=getComputedStyle(t),n=parseFloat(e.borderLeftWidth)||0,r=parseFloat(e.borderTopWidth)||0;p=u.left-c.left-n,m=u.top-c.top-r}l({x:p+a,y:m+a,w:Math.max(0,u.width-a*2),h:Math.max(0,u.height-a*2)}),f(!0)},[n,e]),g=(0,G.useRef)(h);return g.current=h,(0,G.useLayoutEffect)(()=>{let e=requestAnimationFrame(()=>h());return()=>cancelAnimationFrame(e)},[h]),(0,G.useEffect)(()=>{let e=requestAnimationFrame(()=>{requestAnimationFrame(()=>m(!0))});return()=>cancelAnimationFrame(e)},[]),(0,G.useEffect)(()=>{let e=o.current;if(!e)return;let t=()=>{requestAnimationFrame(()=>g.current())},n=new ResizeObserver(t);return n.observe(e),window.addEventListener(`resize`,t),()=>{n.disconnect(),window.removeEventListener(`resize`,t)}},[]),(0,$.jsxs)(`div`,{ref:o,className:d(z,`relative isolate flex w-full max-w-full flex-row items-center`,i),role:`group`,"aria-label":r,children:[(0,$.jsx)(`div`,{"aria-hidden":!0,className:d(Je,`motion-reduce:!transition-none motion-reduce:!duration-0`,p&&`transition-[transform,width,height] duration-300 [transition-timing-function:cubic-bezier(0.32,0.72,0,1)]`),style:{width:c.w,height:c.h,transform:`translate3d(${c.x}px, ${c.y}px, 0)`,opacity:u&&c.w>0?1:0}}),n.map((n,r)=>{let i=n.icon,o=e===n.value;return(0,$.jsxs)(`button`,{ref:e=>{s.current[r]=e},type:`button`,"aria-pressed":o,title:n.title??n.label,onClick:()=>t(n.value),className:d(Ye,o?`text-fg`:`text-fg-subtle`,a),children:[i?(0,$.jsx)(i,{className:`block size-3 shrink-0 opacity-80`,strokeWidth:1.75,"aria-hidden":!0}):null,(0,$.jsx)(`span`,{className:`min-w-0 shrink truncate leading-none`,children:n.label})]},n.value)})]})}function Ze(e){let t=(0,K.c)(76),{L:n,levelSegment:r,onLevelSegment:i,searchInput:s,onSearchInputChange:u,moduleFilter:f,onModuleFilterChange:p,modules:m,onOpenFilters:h,activeFilterCount:g,hasActiveFilters:_,onClearFilters:v,autoRefresh:y}=e,b=n.filters,x;t[0]===n.presetAll?x=t[1]:(x={value:`all`,label:n.presetAll},t[0]=n.presetAll,t[1]=x);let S;t[2]===n.presetErrors?S=t[3]:(S={value:`errors`,label:n.presetErrors},t[2]=n.presetErrors,t[3]=S);let C;t[4]===n.presetWarnPlus?C=t[5]:(C={value:`warnPlus`,label:n.presetWarnPlus},t[4]=n.presetWarnPlus,t[5]=C);let T;t[6]===n.presetInfoPlus?T=t[7]:(T={value:`infoPlus`,label:n.presetInfoPlus},t[6]=n.presetInfoPlus,t[7]=T);let O;t[8]===n.presetVerbose?O=t[9]:(O={value:`verbose`,label:n.presetVerbose},t[8]=n.presetVerbose,t[9]=O);let k;t[10]===n.presetOther?k=t[11]:(k={value:`other`,label:n.presetOther},t[10]=n.presetOther,t[11]=k);let A;t[12]!==x||t[13]!==S||t[14]!==C||t[15]!==T||t[16]!==O||t[17]!==k?(A=[x,S,C,T,O,k],t[12]=x,t[13]=S,t[14]=C,t[15]=T,t[16]=O,t[17]=k,t[18]=A):A=t[18];let j;t[19]!==n.levelPresetAria||t[20]!==r||t[21]!==i||t[22]!==A?(j=(0,$.jsx)(`div`,{className:`overflow-x-auto pb-1 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,children:(0,$.jsx)(`div`,{className:`min-w-[min(100%,36rem)]`,children:(0,$.jsx)(Xe,{"aria-label":n.levelPresetAria,value:r,onChange:i,options:A,buttonClassName:`h-8 px-1.5 text-[11px] sm:px-2 sm:text-xs`})})}),t[19]=n.levelPresetAria,t[20]=r,t[21]=i,t[22]=A,t[23]=j):j=t[23];let M;t[24]===n.searchPlaceholder?M=t[25]:(M=(0,$.jsx)(`span`,{className:`sr-only`,children:n.searchPlaceholder}),t[24]=n.searchPlaceholder,t[25]=M);let N;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(c,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,strokeWidth:1.75,"aria-hidden":!0}),t[26]=N):N=t[26];let P;t[27]===u?P=t[28]:(P=e=>u(e.target.value),t[27]=u,t[28]=P);let F=n.searchPlaceholder,I;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(I=d(`h-10 w-full rounded-md border border-edge bg-surface-panel py-0 pl-10 pr-3 text-sm leading-5 text-fg placeholder:text-fg-subtle dark:border-edge`,D),t[29]=I):I=t[29];let L;t[30]!==n.searchPlaceholder||t[31]!==s||t[32]!==P?(L=(0,$.jsx)(`input`,{type:`search`,value:s,onChange:P,placeholder:F,autoComplete:`off`,spellCheck:!1,className:I}),t[30]=n.searchPlaceholder,t[31]=s,t[32]=P,t[33]=L):L=t[33];let R;t[34]!==M||t[35]!==L?(R=(0,$.jsxs)(`label`,{className:`relative min-w-0 flex-1 sm:min-w-[12rem]`,children:[M,N,L]}),t[34]=M,t[35]=L,t[36]=R):R=t[36];let z;t[37]===p?z=t[38]:(z=e=>p(e.target.value),t[37]=p,t[38]=z);let B=n.module,ee=n.module,V;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(V=d(E,`h-10 w-full min-w-0 rounded-md py-0`),t[39]=V):V=t[39];let H;t[40]===n.allModules?H=t[41]:(H=(0,$.jsx)(o,{value:``,children:n.allModules}),t[40]=n.allModules,t[41]=H);let U;t[42]===m?U=t[43]:(U=m.map(Qe),t[42]=m,t[43]=U);let W;t[44]!==n.module||t[45]!==f||t[46]!==z||t[47]!==H||t[48]!==U?(W=(0,$.jsxs)(a,{id:`log-module`,value:f,onChange:z,"aria-label":B,title:ee,className:V,children:[H,U]}),t[44]=n.module,t[45]=f,t[46]=z,t[47]=H,t[48]=U,t[49]=W):W=t[49];let G;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,$.jsx)(te,{className:`size-4`,strokeWidth:1.75}),t[50]=G):G=t[50];let q;t[51]===g?q=t[52]:(q=g>0?(0,$.jsx)(`span`,{className:`rounded-md bg-surface-hover px-1.5 text-xs tabular-nums text-fg-muted`,children:g}):null,t[51]=g,t[52]=q);let J;t[53]!==n.filtersMore||t[54]!==h||t[55]!==q?(J=(0,$.jsxs)(w,{type:`button`,variant:`secondary`,className:`h-10 min-h-[44px] gap-2 rounded-md sm:min-h-10`,onClick:h,children:[G,n.filtersMore,q]}),t[53]=n.filtersMore,t[54]=h,t[55]=q,t[56]=J):J=t[56];let Y;t[57]!==n.clear||t[58]!==_||t[59]!==v?(Y=_?(0,$.jsxs)(w,{type:`button`,variant:`ghost`,className:`h-10 min-h-[44px] gap-1 sm:min-h-10`,onClick:v,children:[(0,$.jsx)(l,{className:`size-4`,strokeWidth:1.75}),n.clear]}):null,t[57]=n.clear,t[58]=_,t[59]=v,t[60]=Y):Y=t[60];let X;t[61]!==J||t[62]!==Y?(X=(0,$.jsxs)(`div`,{className:`flex min-w-0 shrink-0 items-center justify-end gap-2`,children:[J,Y]}),t[61]=J,t[62]=Y,t[63]=X):X=t[63];let Z;t[64]!==R||t[65]!==W||t[66]!==X?(Z=(0,$.jsxs)(`div`,{className:`grid gap-2 lg:grid-cols-[minmax(16rem,1fr)_minmax(12rem,16rem)_auto] lg:items-center`,children:[R,W,X]}),t[64]=R,t[65]=W,t[66]=X,t[67]=Z):Z=t[67];let Q;t[68]!==n.liveHint||t[69]!==y?(Q=y?(0,$.jsx)(`p`,{className:`text-xs leading-5 text-fg-subtle`,children:n.liveHint}):null,t[68]=n.liveHint,t[69]=y,t[70]=Q):Q=t[70];let ne;return t[71]!==n.filters||t[72]!==Z||t[73]!==Q||t[74]!==j?(ne=(0,$.jsxs)(`section`,{className:`flex flex-col gap-4 rounded-xl bg-surface-hover/20 p-4 sm:p-5`,"aria-label":b,children:[j,Z,Q]}),t[71]=n.filters,t[72]=Z,t[73]=Q,t[74]=j,t[75]=ne):ne=t[75],ne}function Qe(e){return(0,$.jsx)(o,{value:e,children:e},e)}function $e(e){let t=(0,K.c)(20),{L:n,logs:r,loading:i,hasMore:a,onSelectLog:o,onLoadMore:s,onRefreshAll:c,onFilterByRequestId:l}=e,u;t[0]!==i||t[1]!==r.length?(u=i&&r.length===0?(0,$.jsx)(`div`,{className:`overflow-hidden rounded-xl bg-surface-hover/20`,"aria-busy":`true`,children:Array.from({length:8}).map(et)}):null,t[0]=i,t[1]=r.length,t[2]=u):u=t[2];let f;t[3]!==n||t[4]!==i||t[5]!==r.length||t[6]!==c?(f=!i&&r.length===0?(0,$.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 rounded-xl bg-surface-hover/20 py-16 text-center`,children:[(0,$.jsx)(R,{className:`size-12 text-fg-subtle`,strokeWidth:1.5,"aria-hidden":!0}),(0,$.jsx)(`h2`,{className:`text-base font-semibold tracking-tight text-fg`,children:n.noLogs}),(0,$.jsx)(`p`,{className:`max-w-sm text-sm leading-relaxed text-fg-muted`,children:n.noLogsDescription}),(0,$.jsxs)(w,{type:`button`,variant:`secondary`,className:`mt-4 gap-2`,onClick:c,children:[(0,$.jsx)(L,{className:`size-4`,strokeWidth:1.75}),n.refresh]})]}):null,t[3]=n,t[4]=i,t[5]=r.length,t[6]=c,t[7]=f):f=t[7];let p;t[8]!==n||t[9]!==a||t[10]!==i||t[11]!==r||t[12]!==l||t[13]!==s||t[14]!==o?(p=r.length>0?(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsxs)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:[xe(n.showingCount,{count:String(r.length)}),a?(0,$.jsxs)(`span`,{className:`text-fg-subtle`,children:[` · `,n.moreAvailable]}):null]}),(0,$.jsxs)(`div`,{className:`overflow-hidden rounded-xl bg-surface-hover/20 p-1 text-sm leading-6`,children:[(0,$.jsxs)(`div`,{className:`hidden items-center gap-3 px-3 py-2 text-xs font-medium text-fg-subtle md:flex`,"aria-hidden":!0,children:[(0,$.jsx)(`span`,{className:`w-[5.25rem] shrink-0`,children:n.time}),(0,$.jsx)(`span`,{className:`w-[4.5rem] shrink-0`,children:n.level}),(0,$.jsx)(`span`,{className:`w-[4.5rem] shrink-0 sm:w-[5.25rem]`,children:n.requestId}),(0,$.jsx)(`span`,{className:`hidden max-w-[6rem] shrink-0 xl:block`,children:n.phase}),(0,$.jsx)(`span`,{className:`hidden max-w-[7rem] shrink-0 lg:block`,children:n.module}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1`,children:n.message})]}),(0,$.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:r.map(e=>{let t=e.level??`info`,r=typeof e.requestId==`string`?e.requestId.trim():``,i=ke(e),a=t===`error`||t===`fatal`;return(0,$.jsx)(`li`,{className:`rounded-lg bg-surface-base/45`,children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>o(e),className:d(`flex w-full min-w-0 items-center gap-3 px-3 py-2.5 text-left transition-colors duration-150 ease-out`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,a&&`bg-red-500/5`),children:[(0,$.jsx)(`span`,{className:`w-[4.75rem] shrink-0 font-mono text-xs tabular-nums text-fg-subtle sm:w-[5.25rem] sm:text-sm`,children:we(e.timestamp)}),(0,$.jsx)(`span`,{className:d(`w-[4.5rem] shrink-0 truncate`,a?`font-medium text-red-600 dark:text-red-400`:`text-fg-muted`),title:t,children:Oe(t)}),(0,$.jsx)(`span`,{className:`hidden w-[4.5rem] shrink-0 truncate font-mono sm:block sm:w-[5.25rem]`,children:r?l?(0,$.jsx)(`span`,{role:`link`,tabIndex:0,className:`cursor-pointer text-accent hover:underline`,title:`${n.requestId}: ${r}`,onClick:e=>{e.stopPropagation(),l(r)},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),l(r))},children:De(r)}):(0,$.jsx)(`span`,{className:`text-fg-subtle`,title:`${n.requestId}: ${r}`,children:De(r)}):(0,$.jsx)(`span`,{className:`text-fg-subtle`,children:`—`})}),(0,$.jsx)(`span`,{className:`hidden max-w-[6rem] shrink-0 truncate text-fg-subtle xl:inline`,title:i===`—`?void 0:i,children:i===`—`?`—`:i}),(0,$.jsx)(`span`,{className:`hidden max-w-[7rem] shrink-0 truncate text-fg-muted lg:inline`,title:Se(e),children:Se(e)}),(0,$.jsx)(`span`,{className:d(`min-w-0 flex-1 truncate`,`text-fg`),children:Ce(e)})]})},Ae(e))})})]}),a?(0,$.jsx)(`div`,{className:`flex justify-center pt-1`,children:(0,$.jsxs)(w,{type:`button`,variant:`secondary`,className:`gap-2`,disabled:i,onClick:s,children:[i?(0,$.jsx)(L,{className:`size-4 animate-spin motion-reduce:animate-none`,strokeWidth:1.75}):(0,$.jsx)(B,{className:`size-4`,strokeWidth:1.75}),n.loadMore]})}):null]}):null,t[8]=n,t[9]=a,t[10]=i,t[11]=r,t[12]=l,t[13]=s,t[14]=o,t[15]=p):p=t[15];let m;return t[16]!==u||t[17]!==f||t[18]!==p?(m=(0,$.jsxs)($.Fragment,{children:[u,f,p]}),t[16]=u,t[17]=f,t[18]=p,t[19]=m):m=t[19],m}function et(e,t){return(0,$.jsxs)(`div`,{className:`flex gap-3 px-3 py-2.5`,children:[(0,$.jsx)(`div`,{className:`h-4 w-16 shrink-0 bg-surface-hover motion-reduce:animate-none animate-pulse`}),(0,$.jsx)(`div`,{className:`h-4 w-12 shrink-0 bg-surface-hover motion-reduce:animate-none animate-pulse`}),(0,$.jsx)(`div`,{className:`h-4 w-20 shrink-0 bg-surface-hover motion-reduce:animate-none animate-pulse`}),(0,$.jsx)(`div`,{className:`h-4 min-w-0 flex-1 bg-surface-hover motion-reduce:animate-none animate-pulse`})]},t)}function tt(e){let t=(0,K.c)(8),{L:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(ee,{className:`mt-0.5 size-5 shrink-0 text-fg-subtle`,strokeWidth:1.75,"aria-hidden":!0}),t[0]=r):r=t[0];let i;t[1]===n.title?i=t[2]:(i=(0,$.jsx)(`h1`,{className:`text-base font-semibold tracking-tight text-fg`,children:n.title}),t[1]=n.title,t[2]=i);let a;t[3]===n.needToken?a=t[4]:(a=(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg-muted`,children:n.needToken}),t[3]=n.needToken,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,$.jsx)(`div`,{className:`flex w-full flex-col gap-3 px-3 py-10 sm:px-5 xl:px-6`,children:(0,$.jsxs)(`div`,{className:`flex items-start gap-3 rounded-2xl bg-surface-base p-6`,children:[r,(0,$.jsxs)(`div`,{children:[i,a]})]})}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function nt(e){return/[",\n\r]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function rt(e){let t=[`timestamp`,`level`,`module`,`phase`,`requestId`,`transcriptId`,`message`],n=e.map(e=>{let t=String(e.module||``),n=String(e.phase??e.meta?.phase??``);return[e.timestamp,e.level,t,n,e.requestId??``,e.transcriptId??``,e.message??``].map(e=>nt(String(e))).join(`,`)});return[t.join(`,`),...n].join(`
|
|
2
|
+
`)}function it(e,t,n){let r=new Blob([e],{type:n}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=t,a.click(),URL.revokeObjectURL(i)}function at(e,t){let n=new Date().toISOString().replace(/[:.]/g,`-`);if(t===`json`){it(JSON.stringify(e,null,2),`xopc-logs-${n}.json`,`application/json`);return}it(rt(e),`xopc-logs-${n}.csv`,`text/csv;charset=utf-8`)}function ot(e){let t=(0,K.c)(32),{L:n,logs:r,disabled:i}=e,a=i||r.length===0,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(s,{className:`size-4`,strokeWidth:1.75}),t[0]=o):o=t[0];let c;t[1]===n.exportLogs?c=t[2]:(c=(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:n.exportLogs}),t[1]=n.exportLogs,t[2]=c);let l;t[3]!==n.exportLogs||t[4]!==a||t[5]!==c?(l=(0,$.jsx)(A,{asChild:!0,children:(0,$.jsxs)(w,{type:`button`,variant:`secondary`,className:`h-9 gap-2 whitespace-nowrap px-3 text-xs`,disabled:a,title:n.exportLogs,children:[o,c]})}),t[3]=n.exportLogs,t[4]=a,t[5]=c,t[6]=l):l=t[6];let u;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(u=d(`w-52 rounded-xl border border-edge bg-surface-panel p-2 shadow-popover outline-none`,F,`dark:border-edge`),t[7]=u):u=t[7];let f;t[8]===n.exportLogs?f=t[9]:(f=(0,$.jsx)(`p`,{className:`px-2 py-1 text-xs font-medium text-fg`,children:n.exportLogs}),t[8]=n.exportLogs,t[9]=f);let p;t[10]===n.exportHint?p=t[11]:(p=(0,$.jsx)(`p`,{className:`px-2 pb-2 text-xs leading-5 text-fg-muted`,children:n.exportHint}),t[10]=n.exportHint,t[11]=p);let m;t[12]===r?m=t[13]:(m=()=>at(r,`json`),t[12]=r,t[13]=m);let h;t[14]!==n.exportJson||t[15]!==m?(h=(0,$.jsx)(w,{type:`button`,variant:`ghost`,className:`h-8 justify-start px-2 text-xs`,onClick:m,children:n.exportJson}),t[14]=n.exportJson,t[15]=m,t[16]=h):h=t[16];let g;t[17]===r?g=t[18]:(g=()=>at(r,`csv`),t[17]=r,t[18]=g);let _;t[19]!==n.exportCsv||t[20]!==g?(_=(0,$.jsx)(w,{type:`button`,variant:`ghost`,className:`h-8 justify-start px-2 text-xs`,onClick:g,children:n.exportCsv}),t[19]=n.exportCsv,t[20]=g,t[21]=_):_=t[21];let v;t[22]!==_||t[23]!==h?(v=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[h,_]}),t[22]=_,t[23]=h,t[24]=v):v=t[24];let y;t[25]!==v||t[26]!==f||t[27]!==p?(y=(0,$.jsx)(k,{children:(0,$.jsxs)(j,{side:`bottom`,align:`end`,sideOffset:6,className:u,children:[f,p,v]})}),t[25]=v,t[26]=f,t[27]=p,t[28]=y):y=t[28];let b;return t[29]!==y||t[30]!==l?(b=(0,$.jsxs)(O,{children:[l,y]}),t[29]=y,t[30]=l,t[31]=b):b=t[31],b}function st(e){let t=(0,K.c)(38),{L:n}=e,[r,i]=(0,G.useState)(!1),[a,o]=(0,G.useState)(`info`),[s,c]=(0,G.useState)(!1),[l,u]=(0,G.useState)(null),f,p;t[0]!==n.logLevelLoadError||t[1]!==r?(f=()=>{if(!r)return;let e=!1;return ne().then(t=>{e||o(t)}).catch(t=>{e||u(t instanceof Error?t.message:n.logLevelLoadError)}),()=>{e=!0}},p=[r,n.logLevelLoadError],t[0]=n.logLevelLoadError,t[1]=r,t[2]=f,t[3]=p):(f=t[2],p=t[3]),(0,G.useEffect)(f,p);let m;t[4]===n.logLevelSaveError?m=t[5]:(m=e=>{c(!0),u(null),re(e).then(e=>{o(e.current),i(!1)}).catch(e=>{u(e instanceof Error?e.message:n.logLevelSaveError)}).finally(()=>c(!1))},t[4]=n.logLevelSaveError,t[5]=m);let h=m,g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(U,{className:`size-4`,strokeWidth:1.75}),t[6]=g):g=t[6];let _;t[7]===n.logLevelTitle?_=t[8]:(_=(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:n.logLevelTitle}),t[7]=n.logLevelTitle,t[8]=_);let v;t[9]===a?v=t[10]:(v=(0,$.jsx)(`span`,{className:`tabular-nums text-fg-muted`,children:a}),t[9]=a,t[10]=v);let y;t[11]!==n.logLevelTitle||t[12]!==_||t[13]!==v?(y=(0,$.jsx)(A,{asChild:!0,children:(0,$.jsxs)(w,{type:`button`,variant:`secondary`,className:`h-9 gap-2 whitespace-nowrap px-3 text-xs`,title:n.logLevelTitle,children:[g,_,v]})}),t[11]=n.logLevelTitle,t[12]=_,t[13]=v,t[14]=y):y=t[14];let b;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(b=d(`w-56 rounded-xl border border-edge bg-surface-panel p-3 shadow-popover outline-none`,F,`dark:border-edge`),t[15]=b):b=t[15];let x;t[16]===n.logLevelTitle?x=t[17]:(x=(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:n.logLevelTitle}),t[16]=n.logLevelTitle,t[17]=x);let S;t[18]===n.logLevelHint?S=t[19]:(S=(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n.logLevelHint}),t[18]=n.logLevelHint,t[19]=S);let C;t[20]!==n.levelNames||t[21]!==h||t[22]!==a||t[23]!==s?(C=ce.map(e=>(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,disabled:s,onClick:()=>h(e),className:d(`flex w-full items-center justify-between rounded-md px-2 py-1.5 text-left text-xs transition-colors`,a===e?`bg-accent/10 font-medium text-accent`:`text-fg hover:bg-surface-hover`),children:[(0,$.jsx)(`span`,{children:n.levelNames[e]}),(0,$.jsx)(`span`,{className:`font-mono text-[10px] uppercase text-fg-subtle`,children:e})]})},e)),t[20]=n.levelNames,t[21]=h,t[22]=a,t[23]=s,t[24]=C):C=t[24];let T;t[25]===C?T=t[26]:(T=(0,$.jsx)(`ul`,{className:`mt-3 flex flex-col gap-1`,children:C}),t[25]=C,t[26]=T);let E;t[27]===l?E=t[28]:(E=l?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-red-600 dark:text-red-400`,children:l}):null,t[27]=l,t[28]=E);let D;t[29]!==S||t[30]!==T||t[31]!==E||t[32]!==x?(D=(0,$.jsx)(k,{children:(0,$.jsxs)(j,{side:`bottom`,align:`end`,sideOffset:6,className:b,children:[x,S,T,E]})}),t[29]=S,t[30]=T,t[31]=E,t[32]=x,t[33]=D):D=t[33];let M;return t[34]!==r||t[35]!==D||t[36]!==y?(M=(0,$.jsxs)(O,{open:r,onOpenChange:i,children:[y,D]}),t[34]=r,t[35]=D,t[36]=y,t[37]=M):M=t[37],M}function ct(e){let t=(0,K.c)(49),{L:n,autoRefresh:r,onAutoRefreshChange:i,fileCount:a,onOpenFiles:o,loading:s,onRefreshAll:c,logs:l}=e,u;t[0]===n.title?u=t[1]:(u=(0,$.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-fg sm:text-lg`,children:n.title}),t[0]=n.title,t[1]=u);let d;t[2]===n.subtitle?d=t[3]:(d=(0,$.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-fg-muted sm:mt-1`,children:n.subtitle}),t[2]=n.subtitle,t[3]=d);let f;t[4]!==u||t[5]!==d?(f=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[u,d]}),t[4]=u,t[5]=d,t[6]=f):f=t[6];let p=r?`live`:`paused`,m;t[7]===i?m=t[8]:(m=e=>i(e===`live`),t[7]=i,t[8]=m);let h;t[9]===n.refreshManual?h=t[10]:(h={value:`paused`,label:n.refreshManual},t[9]=n.refreshManual,t[10]=h);let g;t[11]===n.refreshLive?g=t[12]:(g={value:`live`,label:n.refreshLive},t[11]=n.refreshLive,t[12]=g);let _;t[13]!==h||t[14]!==g?(_=[h,g],t[13]=h,t[14]=g,t[15]=_):_=t[15];let v;t[16]!==n.refreshModeAria||t[17]!==p||t[18]!==m||t[19]!==_?(v=(0,$.jsx)(`div`,{className:`w-full sm:w-52`,children:(0,$.jsx)(Xe,{"aria-label":n.refreshModeAria,value:p,onChange:m,options:_,buttonClassName:`h-8`})}),t[16]=n.refreshModeAria,t[17]=p,t[18]=m,t[19]=_,t[20]=v):v=t[20];let y;t[21]===n?y=t[22]:(y=(0,$.jsx)(st,{L:n}),t[21]=n,t[22]=y);let b;t[23]!==n||t[24]!==s||t[25]!==l?(b=(0,$.jsx)(ot,{L:n,logs:l,disabled:s}),t[23]=n,t[24]=s,t[25]=l,t[26]=b):b=t[26];let x;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(I,{className:`size-4`,strokeWidth:1.75}),t[27]=x):x=t[27];let S;t[28]===a?S=t[29]:(S=a>0?(0,$.jsx)(`span`,{className:`rounded-full bg-surface-hover px-1.5 text-xs text-fg-muted`,children:a}):null,t[28]=a,t[29]=S);let C;t[30]!==n.logFiles||t[31]!==o||t[32]!==S?(C=(0,$.jsxs)(w,{type:`button`,variant:`ghost`,className:`h-9 min-h-[44px] min-w-[44px] px-2 sm:min-h-9 sm:min-w-0`,title:n.logFiles,"aria-label":n.logFiles,onClick:o,children:[x,S]}),t[30]=n.logFiles,t[31]=o,t[32]=S,t[33]=C):C=t[33];let T;t[34]!==n.refresh||t[35]!==s||t[36]!==c?(T=(0,$.jsx)(V,{className:`h-9 min-h-[44px] min-w-[44px] px-2 sm:min-h-9 sm:min-w-0`,loading:s,label:n.refresh,onClick:c}),t[34]=n.refresh,t[35]=s,t[36]=c,t[37]=T):T=t[37];let E;t[38]!==y||t[39]!==b||t[40]!==C||t[41]!==T?(E=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center justify-end gap-1 sm:self-center`,children:[y,b,C,T]}),t[38]=y,t[39]=b,t[40]=C,t[41]=T,t[42]=E):E=t[42];let D;t[43]!==E||t[44]!==v?(D=(0,$.jsxs)(`div`,{className:`flex w-full shrink-0 flex-col gap-2 rounded-xl bg-surface-hover/20 p-2 sm:flex-row sm:items-center sm:justify-between`,children:[v,E]}),t[43]=E,t[44]=v,t[45]=D):D=t[45];let O;return t[46]!==D||t[47]!==f?(O=(0,$.jsxs)(`header`,{className:`flex flex-col gap-4`,children:[f,D]}),t[46]=D,t[47]=f,t[48]=O):O=t[48],O}function lt(e){let t=(0,K.c)(33),{L:n,stats:r}=e,i;t[0]===r.byLevel?i=t[1]:(i=r.byLevel??{},t[0]=r.byLevel,t[1]=i);let a;t[2]!==n.levelNames||t[3]!==i?(a=Ne(i,n.levelNames),t[2]=n.levelNames,t[3]=i,t[4]=a):a=t[4];let o=a,s=r.runtime?.errorsLast24h;if(!o&&s==null)return null;let c;t[5]===n.statsRegion?c=t[6]:(c=(0,$.jsx)(`span`,{className:`font-medium text-fg-muted`,children:n.statsRegion}),t[5]=n.statsRegion,t[6]=c);let l;t[7]===o?l=t[8]:(l=o?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`mx-1.5 text-fg-subtle`,children:`·`}),(0,$.jsx)(`span`,{className:`tabular-nums`,children:o})]}):null,t[7]=o,t[8]=l);let u;t[9]!==n.runtimeErrors||t[10]!==s?(u=s!=null&&s>0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`mx-1.5 text-fg-subtle`,children:`·`}),(0,$.jsxs)(`span`,{className:`tabular-nums text-red-600 dark:text-red-400`,children:[n.runtimeErrors,` `,s]})]}):null,t[9]=n.runtimeErrors,t[10]=s,t[11]=u):u=t[11];let f;t[12]!==c||t[13]!==l||t[14]!==u?(f=(0,$.jsx)(A,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,className:`max-w-full truncate rounded-lg border border-transparent px-1 py-0.5 text-left text-xs leading-5 text-fg-subtle transition-colors duration-150 ease-out hover:border-edge-subtle hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel dark:hover:border-edge`,children:[c,l,u]})}),t[12]=c,t[13]=l,t[14]=u,t[15]=f):f=t[15];let p;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(p=d(`w-[min(calc(100vw-2rem),20rem)] rounded-xl border border-edge bg-surface-panel p-3 shadow-popover outline-none`,F,`dark:border-edge`),t[16]=p):p=t[16];let m;t[17]===n.statsDetailTitle?m=t[18]:(m=(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:n.statsDetailTitle}),t[17]=n.statsDetailTitle,t[18]=m);let h;t[19]===n.statsHint?h=t[20]:(h=(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n.statsHint}),t[19]=n.statsHint,t[20]=h);let g;t[21]!==n.levelNames||t[22]!==r.byLevel?(g=ce.map(e=>{let t=r.byLevel?.[e]??0;return t===0?null:(0,$.jsxs)(`li`,{className:`flex items-center justify-between gap-2 rounded-md border border-edge-subtle bg-surface-base px-2 py-1 text-xs dark:border-edge`,children:[(0,$.jsx)(`span`,{className:`font-medium capitalize text-fg`,children:n.levelNames[e]}),(0,$.jsx)(`span`,{className:`tabular-nums text-fg-muted`,children:t})]},e)}),t[21]=n.levelNames,t[22]=r.byLevel,t[23]=g):g=t[23];let _;t[24]===g?_=t[25]:(_=(0,$.jsx)(`ul`,{className:`mt-3 flex flex-col gap-1.5`,children:g}),t[24]=g,t[25]=_);let v;t[26]!==_||t[27]!==m||t[28]!==h?(v=(0,$.jsx)(k,{children:(0,$.jsxs)(j,{side:`bottom`,align:`start`,sideOffset:6,className:p,children:[m,h,_]})}),t[26]=_,t[27]=m,t[28]=h,t[29]=v):v=t[29];let y;return t[30]!==v||t[31]!==f?(y=(0,$.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,$.jsxs)(O,{children:[f,v]})}),t[30]=v,t[31]=f,t[32]=y):y=t[32],y}function ut(){let e=(0,K.c)(89),{L:t,hasToken:n,logs:r,loading:i,error:a,hasMore:o,searchInput:s,setSearchInput:c,selectedLevels:l,moduleFilter:u,setModuleFilter:d,dateFrom:f,setDateFrom:p,dateTo:h,setDateTo:g,modules:_,files:v,stats:y,selectedLog:b,setSelectedLog:x,filesOpen:S,setFilesOpen:C,filtersOpen:w,setFiltersOpen:T,logDir:E,autoRefresh:D,setAutoRefresh:O,copiedDetail:k,setCopiedDetail:A,hasActiveFilters:j,activeFilterCount:M,clearFilters:N,toggleDialogLevel:P,handleLoadMore:F,refreshAll:I,levelSegment:L,handleLevelSegment:R,filterByRequestId:z,filterByTranscriptId:B,filterByErrorSummary:ee,openChatForSession:te,errorSummary:V,errorSummaryLoading:H}=Le(m(dt));if(!n){let n;return e[0]===t?n=e[1]:(n=(0,$.jsx)(tt,{L:t}),e[0]=t,e[1]=n),n}let U;e[2]===C?U=e[3]:(U=()=>C(!0),e[2]=C,e[3]=U);let G;e[4]!==t||e[5]!==D||e[6]!==v.length||e[7]!==i||e[8]!==r||e[9]!==I||e[10]!==O||e[11]!==U?(G=(0,$.jsx)(ct,{L:t,autoRefresh:D,onAutoRefreshChange:O,fileCount:v.length,onOpenFiles:U,loading:i,onRefreshAll:I,logs:r}),e[4]=t,e[5]=D,e[6]=v.length,e[7]=i,e[8]=r,e[9]=I,e[10]=O,e[11]=U,e[12]=G):G=e[12];let q;e[13]===a?q=e[14]:(q=a?(0,$.jsx)(`div`,{className:`rounded-xl bg-danger-soft px-3 py-2 text-sm text-danger`,role:`alert`,children:a}):null,e[13]=a,e[14]=q);let J;e[15]!==t||e[16]!==y?(J=y?(0,$.jsx)(lt,{L:t,stats:y}):null,e[15]=t,e[16]=y,e[17]=J):J=e[17];let Y;e[18]!==t||e[19]!==V||e[20]!==H||e[21]!==ee?(Y=(0,$.jsx)(Re,{L:t,items:V,loading:H,onSelectItem:ee}),e[18]=t,e[19]=V,e[20]=H,e[21]=ee,e[22]=Y):Y=e[22];let X;e[23]===T?X=e[24]:(X=()=>T(!0),e[23]=T,e[24]=X);let Z;e[25]!==t||e[26]!==M||e[27]!==D||e[28]!==N||e[29]!==R||e[30]!==j||e[31]!==L||e[32]!==u||e[33]!==_||e[34]!==s||e[35]!==d||e[36]!==c||e[37]!==X?(Z=(0,$.jsx)(Ze,{L:t,levelSegment:L,onLevelSegment:R,searchInput:s,onSearchInputChange:c,moduleFilter:u,onModuleFilterChange:d,modules:_,onOpenFilters:X,activeFilterCount:M,hasActiveFilters:j,onClearFilters:N,autoRefresh:D}),e[25]=t,e[26]=M,e[27]=D,e[28]=N,e[29]=R,e[30]=j,e[31]=L,e[32]=u,e[33]=_,e[34]=s,e[35]=d,e[36]=c,e[37]=X,e[38]=Z):Z=e[38];let Q;e[39]!==t||e[40]!==z||e[41]!==F||e[42]!==o||e[43]!==i||e[44]!==r||e[45]!==I||e[46]!==x?(Q=(0,$.jsx)($e,{L:t,logs:r,loading:i,hasMore:o,onSelectLog:x,onLoadMore:F,onRefreshAll:I,onFilterByRequestId:z}),e[39]=t,e[40]=z,e[41]=F,e[42]=o,e[43]=i,e[44]=r,e[45]=I,e[46]=x,e[47]=Q):Q=e[47];let ne;e[48]!==t||e[49]!==f||e[50]!==h||e[51]!==w||e[52]!==l||e[53]!==p||e[54]!==g||e[55]!==T||e[56]!==P?(ne=(0,$.jsx)(Ge,{L:t,open:w,onOpenChange:T,dateFrom:f,onDateFromChange:p,dateTo:h,onDateToChange:g,selectedLevels:l,onToggleLevel:P}),e[48]=t,e[49]=f,e[50]=h,e[51]=w,e[52]=l,e[53]=p,e[54]=g,e[55]=T,e[56]=P,e[57]=ne):ne=e[57];let re;e[58]===x?re=e[59]:(re=()=>x(null),e[58]=x,e[59]=re);let ie,ae;e[60]===A?(ie=e[61],ae=e[62]):(ie=()=>A(`message`),ae=()=>A(`json`),e[60]=A,e[61]=ie,e[62]=ae);let oe;e[63]!==t||e[64]!==k||e[65]!==z||e[66]!==B||e[67]!==te||e[68]!==b||e[69]!==ie||e[70]!==ae||e[71]!==re?(oe=(0,$.jsx)(He,{L:t,log:b,onClose:re,copiedDetail:k,onCopiedMessage:ie,onCopiedJson:ae,onFilterByRequestId:z,onFilterByTranscriptId:B,onOpenChat:te}),e[63]=t,e[64]=k,e[65]=z,e[66]=B,e[67]=te,e[68]=b,e[69]=ie,e[70]=ae,e[71]=re,e[72]=oe):oe=e[72];let se;e[73]!==t||e[74]!==v||e[75]!==S||e[76]!==E||e[77]!==C?(se=(0,$.jsx)(Ue,{L:t,open:S,onOpenChange:C,files:v,logDir:E}),e[73]=t,e[74]=v,e[75]=S,e[76]=E,e[77]=C,e[78]=se):se=e[78];let ce;return e[79]!==G||e[80]!==oe||e[81]!==se||e[82]!==q||e[83]!==J||e[84]!==Y||e[85]!==Z||e[86]!==Q||e[87]!==ne?(ce=(0,$.jsxs)(W,{gap:`gap-6`,children:[G,q,J,Y,Z,Q,ne,oe,se]}),e[79]=G,e[80]=oe,e[81]=se,e[82]=q,e[83]=J,e[84]=Y,e[85]=Z,e[86]=Q,e[87]=ne,e[88]=ce):ce=e[88],ce}function dt(e){return e.language}export{ut as LogsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{g as i}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as a}from"./activity-YogQEteU.js";import{t as o}from"./chevron-right-BweFrslA.js";import{t as s}from"./popover-select-DcsFzD_i.js";import{t as c}from"./plus-Q2yW6OE7.js";import{t as l}from"./search-DA7gz22f.js";import{t as u}from"./x-B_N4OPjy.js";import{t as ee}from"./messages-DPw2X06D.js";import{t as d}from"./cn-JdwAhgNB.js";import{i as f,n as te,r as p}from"./locale-store-Y1aBayM_.js";import{a as m,n as h,o as g,r as _,s as v,t as y}from"./dist-BGTk37IG.js";import{i as b}from"./vendor-swr-BIWyz7Rc.js";import{t as x}from"./button-CS04eWY9.js";import{i as ne,o as S}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{n as C}from"./index.module-Cd9ENXfk.js";import{Co as re,Eo as ie,ai as w,gc as T,ii as E,is as D,ws as O}from"./index-CYeGnj-L.js";import{t as k}from"./page-tabs-D2xpUV26.js";import{n as A,r as j,t as M}from"./settings-page-layout-X1x-2Cp9.js";import{t as N}from"./device-pairing-wizard-CoKKoUlt.js";import{n as P}from"./settings-loading-skeleton-CAmWMaOT.js";var F=e(t(),1),I=n(),L=720*60*60*1e3;function R(e){let t=[e.access,e.principal].filter(e=>e!==null);return t.length>0&&t.every(e=>e.revokedAt!==void 0)}function z(e){return R(e)?`revoked`:e.endpoints.length>0?`online`:`offline`}function ae(e){return new Set(e.endpoints.flatMap(e=>e.tools.map(({descriptor:e})=>e.name))).size}function oe(e,t=Date.now()){return z(e)===`offline`?(e.lastSeenAt??e.createdAt)<t-L:!1}function se(e,t,n=Date.now()){let r=t.query.trim().toLocaleLowerCase();return e.filter(e=>{let i=z(e),a=t.status===`all`||(t.status===`active`?i!==`revoked`:t.status===`stale`?oe(e,n):i===t.status),o=!t.platform||e.platform===t.platform,s=!r||[e.displayName,e.id,e.kind,e.platform].some(e=>e.toLocaleLowerCase().includes(r));return a&&o&&s})}function ce(e){return e.length>8?e.slice(-8):e}var B=r();function le(e){let t=(0,I.c)(59),{device:n,busy:r,onClose:i,onRevoke:a}=e,o=te(V),s;t[0]===o?s=t[1]:(s=ee(o),t[0]=o,t[1]=s);let c=s.endpointToolsSettings,l=o===`zh`?`zh-CN`:`en`,f;t[2]===l?f=t[3]:(f=new Intl.DateTimeFormat(l,{dateStyle:`medium`,timeStyle:`short`}),t[2]=l,t[3]=f);let p=f,b;t[4]===n?b=t[5]:(b=n?z(n):`offline`,t[4]=n,t[5]=b);let C=b,re=n!==null,w;t[6]===i?w=t[7]:(w=e=>!e&&i(),t[6]=i,t[7]=w);let T;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,B.jsx)(m,{className:d(`xopc-dialog-overlay fixed inset-0 bg-scrim`,S)}),t[8]=T):T=t[8];let E;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(E=d(`xopc-drawer-right fixed right-0 top-0 flex size-full max-w-lg flex-col border-l border-edge bg-surface-overlay shadow-popover outline-none`,ne),t[9]=E):E=t[9];let D=n?.displayName??c.deviceDetails,O;t[10]===D?O=t[11]:(O=(0,B.jsx)(v,{className:`truncate text-base font-semibold text-fg`,children:D}),t[10]=D,t[11]=O);let k;t[12]===n?k=t[13]:(k=n?(0,B.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[n.kind,` · `,n.platform,` · `,ce(n.id)]}):null,t[12]=n,t[13]=k);let A;t[14]!==O||t[15]!==k?(A=(0,B.jsxs)(`div`,{className:`min-w-0`,children:[O,k]}),t[14]=O,t[15]=k,t[16]=A):A=t[16];let j;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,B.jsx)(u,{className:`size-5`,"aria-hidden":!0}),t[17]=j):j=t[17];let M;t[18]===c.close?M=t[19]:(M=(0,B.jsx)(h,{asChild:!0,children:(0,B.jsx)(x,{variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":c.close,children:j})}),t[18]=c.close,t[19]=M);let N;t[20]!==A||t[21]!==M?(N=(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-b border-edge px-4 py-3`,children:[A,M]}),t[20]=A,t[21]=M,t[22]=N):N=t[22];let P;t[23]!==c.accessActive||t[24]!==c.accessRevoked||t[25]!==c.accessTitle||t[26]!==c.createdAt||t[27]!==c.endpointCount||t[28]!==c.endpointsTitle||t[29]!==c.identityId||t[30]!==c.identityTitle||t[31]!==c.lastSeen||t[32]!==c.never||t[33]!==c.noAccessIdentity||t[34]!==c.noOnlineEndpoints||t[35]!==c.noPermissions||t[36]!==c.permissions||t[37]!==c.status||t[38]!==c.statusLabel||t[39]!==c.toolCount||t[40]!==n||t[41]!==p||t[42]!==C?(P=n?(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto p-4`,children:[(0,B.jsxs)(`dl`,{className:`grid grid-cols-2 gap-3 rounded-xl bg-surface-hover/40 p-4`,children:[(0,B.jsx)(H,{label:c.statusLabel,value:c.status[C]}),(0,B.jsx)(H,{label:c.lastSeen,value:n.lastSeenAt?p.format(n.lastSeenAt):c.never}),(0,B.jsx)(H,{label:c.endpointCount,value:String(n.endpoints.length)}),(0,B.jsx)(H,{label:c.toolCount,value:String(ae(n))})]}),(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:c.accessTitle}),(0,B.jsx)(`div`,{className:`mt-2 rounded-xl border border-edge-subtle bg-surface-base p-3 text-xs text-fg-muted`,children:n.access?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{children:n.access.revokedAt?c.accessRevoked:c.accessActive}),(0,B.jsxs)(`p`,{className:`mt-1 break-words`,children:[c.permissions,`: `,n.access.scopes.join(`, `)||c.noPermissions]})]}):(0,B.jsx)(`p`,{children:c.noAccessIdentity})})]}),(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:c.endpointsTitle}),(0,B.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[n.endpoints.length===0?(0,B.jsx)(`p`,{className:`text-sm text-fg-muted`,children:c.noOnlineEndpoints}):null,n.endpoints.map(e=>(0,B.jsxs)(`article`,{className:`rounded-xl border border-edge-subtle bg-surface-base p-3`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,B.jsx)(`p`,{className:`min-w-0 break-all text-xs font-medium text-fg`,children:e.endpointId}),(0,B.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[c.status[e.availability],` · v`,e.appVersion]})]}),(0,B.jsx)(`div`,{className:`mt-3 space-y-2`,children:e.tools.map(e=>{let{descriptor:t}=e;return(0,B.jsxs)(`div`,{className:`rounded-lg bg-surface-hover/50 px-3 py-2`,children:[(0,B.jsx)(`p`,{className:`break-all text-xs font-medium text-fg`,children:t.name}),(0,B.jsx)(`p`,{className:`mt-0.5 break-words text-xs text-fg-subtle`,children:t.requiredPermissions.join(`, `)||c.noPermissions})]},t.name)})})]},e.connectionId))]})]}),(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:c.identityTitle}),(0,B.jsxs)(`dl`,{className:`mt-2 rounded-xl border border-edge-subtle bg-surface-base p-3 text-xs`,children:[(0,B.jsx)(H,{label:c.identityId,value:n.id,breakAll:!0}),(0,B.jsx)(`div`,{className:`mt-3`,children:(0,B.jsx)(H,{label:c.createdAt,value:p.format(n.createdAt)})})]})]})]}):null,t[23]=c.accessActive,t[24]=c.accessRevoked,t[25]=c.accessTitle,t[26]=c.createdAt,t[27]=c.endpointCount,t[28]=c.endpointsTitle,t[29]=c.identityId,t[30]=c.identityTitle,t[31]=c.lastSeen,t[32]=c.never,t[33]=c.noAccessIdentity,t[34]=c.noOnlineEndpoints,t[35]=c.noPermissions,t[36]=c.permissions,t[37]=c.status,t[38]=c.statusLabel,t[39]=c.toolCount,t[40]=n,t[41]=p,t[42]=C,t[43]=P):P=t[43];let F;t[44]!==r||t[45]!==c.removeDevice||t[46]!==c.revoking||t[47]!==n||t[48]!==a||t[49]!==C?(F=n&&C!==`revoked`?(0,B.jsx)(`div`,{className:`shrink-0 border-t border-edge px-4 py-3`,children:(0,B.jsxs)(x,{variant:`secondary`,className:`w-full text-danger`,disabled:r,onClick:()=>a(n),children:[(0,B.jsx)(ie,{className:`size-4`,"aria-hidden":!0}),r?c.revoking:c.removeDevice]})}):null,t[44]=r,t[45]=c.removeDevice,t[46]=c.revoking,t[47]=n,t[48]=a,t[49]=C,t[50]=F):F=t[50];let L;t[51]!==N||t[52]!==P||t[53]!==F?(L=(0,B.jsxs)(g,{children:[T,(0,B.jsxs)(_,{className:E,"aria-describedby":void 0,children:[N,P,F]})]}),t[51]=N,t[52]=P,t[53]=F,t[54]=L):L=t[54];let R;return t[55]!==L||t[56]!==re||t[57]!==w?(R=(0,B.jsx)(y,{open:re,onOpenChange:w,children:L}),t[55]=L,t[56]=re,t[57]=w,t[58]=R):R=t[58],R}function V(e){return e.language}function H(e){let t=(0,I.c)(10),{label:n,value:r,breakAll:i}=e,a=i===void 0?!1:i,o;t[0]===n?o=t[1]:(o=(0,B.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:n}),t[0]=n,t[1]=o);let s=a&&`break-all font-mono text-xs`,c;t[2]===s?c=t[3]:(c=d(`mt-1 text-sm text-fg`,s),t[2]=s,t[3]=c);let l;t[4]!==c||t[5]!==r?(l=(0,B.jsx)(`dd`,{className:c,children:r}),t[4]=c,t[5]=r,t[6]=l):l=t[6];let u;return t[7]!==o||t[8]!==l?(u=(0,B.jsxs)(`div`,{className:`min-w-0`,children:[o,l]}),t[7]=o,t[8]=l,t[9]=u):u=t[9],u}function ue(e){let t=(0,I.c)(19),{onPaired:n}=e,[r,a]=i(),o=te(de),s;t[0]===o?s=t[1]:(s=ee(o),t[0]=o,t[1]=s);let l=s.endpointToolsSettings.deviceAccess,u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u={open:!1},t[2]=u):u=t[2];let[d,f]=(0,F.useState)(u),p,m;t[3]!==r||t[4]!==a?(p=()=>{let e=r.get(`startDevicePairing`);e!==`mobile`&&e!==`browser`||(f({open:!0,target:e}),a(U,{replace:!0}))},m=[r,a],t[3]=r,t[4]=a,t[5]=p,t[6]=m):(p=t[5],m=t[6]),(0,F.useEffect)(p,m);let h,g;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>f({open:!0}),g=(0,B.jsx)(c,{className:`size-4`,"aria-hidden":!0}),t[7]=h,t[8]=g):(h=t[7],g=t[8]);let _;t[9]===l.addDevice?_=t[10]:(_=(0,B.jsxs)(x,{variant:`primary`,onClick:h,children:[g,l.addDevice]}),t[9]=l.addDevice,t[10]=_);let v;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(v=e=>f(t=>({...t,open:e})),t[11]=v):v=t[11];let y;t[12]!==d.open||t[13]!==d.target||t[14]!==n?(y=(0,B.jsx)(N,{open:d.open,onOpenChange:v,onPaired:n,targetKind:d.target}),t[12]=d.open,t[13]=d.target,t[14]=n,t[15]=y):y=t[15];let b;return t[16]!==_||t[17]!==y?(b=(0,B.jsxs)(B.Fragment,{children:[_,y]}),t[16]=_,t[17]=y,t[18]=b):b=t[18],b}function U(e){let t=new URLSearchParams(e);return t.delete(`startDevicePairing`),t}function de(e){return e.language}async function W(e){let t=await e.json().catch(()=>null);if(!e.ok||t?.payload===void 0)throw Error(t?.error?.message??`Endpoint management request failed: ${e.status}`);return t.payload}function fe(){return p(`/api/endpoint-tools/devices`)}function pe(e){let t=new URLSearchParams({page:String(e.page),pageSize:String(e.pageSize)});return e.query.trim()&&t.set(`query`,e.query.trim()),e.principalId&&t.set(`principalId`,e.principalId),e.status&&t.set(`status`,e.status),e.effect&&t.set(`effect`,e.effect),p(`/api/endpoint-tools/invocations?${t}`)}async function me(){return W(await f(fe()))}async function he(e){let t=Array.from({length:Math.ceil(e.length/100)},(t,n)=>e.slice(n*100,(n+1)*100));await Promise.all(t.map(async e=>{await W(await f(p(`/api/endpoint-tools/devices/revoke`),{method:`POST`,body:JSON.stringify({ids:e})}))}))}async function ge(e){return W(await f(pe(e)))}var _e=5e3,G=20,ve=20;function ye(e){return e===`online`||e===`succeeded`?`bg-success-soft text-success`:e===`running`?`bg-accent-soft text-accent-fg`:e===`failed`||e===`revoked`?`bg-danger-soft text-danger`:`bg-surface-hover text-fg-muted`}function be(e){let t=(0,I.c)(5),{status:n,label:r}=e,i;t[0]===n?i=t[1]:(i=d(`rounded-full px-2 py-0.5 text-xs font-medium`,ye(n)),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,B.jsx)(`span`,{className:i,children:r}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function xe(){let e=te(e=>e.language),t=ee(e).endpointToolsSettings,[n,r]=i(),c=n.get(`view`)===`activity`?`activity`:`devices`,[u,f]=(0,F.useState)(null),[p,m]=(0,F.useState)([]),[h,g]=(0,F.useState)(!1),[_,v]=(0,F.useState)(!1),[y,ne]=(0,F.useState)(``),[S,N]=(0,F.useState)(`active`),[I,L]=(0,F.useState)(``),[R,V]=(0,F.useState)(1),[H,U]=(0,F.useState)(()=>new Set),[de,W]=(0,F.useState)(``),[ye]=C(de,250),[xe,Se]=(0,F.useState)(``),[Ce,we]=(0,F.useState)(``),[Te,Ee]=(0,F.useState)(``),[De,K]=(0,F.useState)(1),Oe={page:De,pageSize:ve,query:ye,principalId:xe,status:Ce,effect:Te},q=b(fe(),me,{refreshInterval:_e}),J=b(c===`activity`?pe(Oe):null,()=>ge(Oe),{refreshInterval:_e,keepPreviousData:!0}),ke=(0,F.useMemo)(()=>new Intl.DateTimeFormat(e===`zh`?`zh-CN`:`en`,{dateStyle:`medium`,timeStyle:`short`}),[e]);if(q.isLoading&&!q.data)return(0,B.jsx)(j,{children:(0,B.jsx)(P,{sections:2})});let Y=q.data??[],Ae=J.data?.items??[],je=Y.filter(e=>z(e)===`online`).length,Me=Y.filter(e=>z(e)!==`revoked`).length,Ne=Y.filter(e=>oe(e)).length,Pe=[...new Set(Y.map(e=>e.platform))].toSorted(),X=se(Y,{query:y,status:S,platform:I}),Fe=Math.max(1,Math.ceil(X.length/G)),Z=Math.min(R,Fe),Ie=X.slice((Z-1)*G,Z*G),Q=Ie.reduce((e,t)=>(z(t)!==`revoked`&&e.push(t.id),e),[]),Le=Q.length>0&&Q.every(e=>H.has(e)),Re=e=>{r(t=>{let n=new URLSearchParams(t);return e===`devices`?n.delete(`view`):n.set(`view`,e),n},{replace:!0})},ze=async()=>{await Promise.all([q.mutate(),c===`activity`?J.mutate():Promise.resolve()])},Be=async()=>{if(!(p.length===0||h)){g(!0),v(!1);try{await he(p.map(e=>e.id)),m([]),U(new Set),await q.mutate()}catch{v(!0)}finally{g(!1)}}},$=e=>{e(),V(1),U(new Set)};return(0,B.jsxs)(j,{children:[(0,B.jsx)(A,{title:t.title,subtitle:t.subtitle,actions:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(E,{className:`size-9 shrink-0 p-0`,label:t.refresh,onClick:ze}),(0,B.jsx)(ue,{onPaired:()=>void q.mutate()})]})}),q.error||J.error?(0,B.jsx)(`div`,{className:`rounded-xl bg-danger-soft px-4 py-3 text-sm text-danger`,children:t.loadError}):null,(0,B.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[{label:t.activeDevices,value:Me,filter:`active`},{label:t.onlineDevices,value:je,filter:`online`},{label:t.staleDevices,value:Ne,filter:`stale`}].map(({label:e,value:t,filter:n})=>(0,B.jsxs)(`button`,{type:`button`,className:d(`touch-target rounded-xl px-4 py-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,S===n?`bg-surface-active`:`bg-surface-hover/20 hover:bg-surface-hover/50`),"aria-pressed":S===n,onClick:()=>{$(()=>N(n)),Re(`devices`)},children:[(0,B.jsx)(`span`,{className:`text-xs text-fg-muted`,children:e}),(0,B.jsx)(`span`,{className:`mt-1 block text-2xl font-semibold text-fg`,children:t})]},n))}),(0,B.jsx)(k,{items:[{id:`devices`,label:t.devicesTab,icon:D,count:Me},{id:`activity`,label:t.activityTab,icon:a,count:J.data?.total}],activeTab:c,onChange:Re,ariaLabel:t.viewsAria,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`}),(0,B.jsxs)(M,{id:`devices`,activeTab:c,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`,title:t.devicesTitle,hint:t.devicesHint,children:[(0,B.jsxs)(`div`,{className:`mb-4 grid gap-2 sm:grid-cols-[minmax(0,1fr)_11rem_11rem]`,children:[(0,B.jsxs)(`label`,{className:`relative block`,children:[(0,B.jsx)(`span`,{className:`sr-only`,children:t.searchDevices}),(0,B.jsx)(l,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),(0,B.jsx)(`input`,{type:`search`,"aria-label":t.searchDevices,value:y,placeholder:t.searchDevices,className:`h-10 w-full rounded-lg border border-edge bg-surface-inset pl-9 pr-3 text-base text-fg placeholder:text-fg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent sm:text-sm`,onChange:e=>$(()=>ne(e.target.value))})]}),(0,B.jsx)(s,{value:S,options:[{value:`active`,label:t.filterActive},{value:`online`,label:t.status.online},{value:`offline`,label:t.status.offline},{value:`stale`,label:t.filterStale},{value:`revoked`,label:t.status.revoked},{value:`all`,label:t.filterAll}],placeholder:t.statusLabel,allowEmpty:!1,ariaLabel:t.statusLabel,onChange:e=>$(()=>N(e))}),(0,B.jsx)(s,{value:I,options:Pe.map(e=>({value:e,label:e})),placeholder:t.allPlatforms,emptyLabel:t.allPlatforms,ariaLabel:t.platformLabel,onChange:e=>$(()=>L(e))})]}),H.size>0?(0,B.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3 rounded-xl bg-accent-soft px-3 py-2`,children:[(0,B.jsx)(`p`,{className:`text-sm font-medium text-accent-fg`,children:t.selectedCount.replace(`{{count}}`,String(H.size))}),(0,B.jsxs)(x,{variant:`secondary`,className:`text-danger`,onClick:()=>{v(!1),m(Y.filter(e=>H.has(e.id)))},children:[(0,B.jsx)(ie,{className:`size-4`,"aria-hidden":!0}),t.removeSelected]})]}):null,Y.length===0?(0,B.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noDevices}):X.length===0?(0,B.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noMatchingDevices}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`flex min-h-10 items-center gap-3 border-b border-edge-subtle px-1`,children:(0,B.jsxs)(`label`,{className:d(`touch-target flex items-center gap-2 text-xs text-fg-muted`,Q.length>0?`cursor-pointer`:`cursor-not-allowed opacity-50`),children:[(0,B.jsx)(`input`,{type:`checkbox`,"aria-label":t.selectPage,checked:Le,disabled:Q.length===0,className:`size-4 accent-accent`,onChange:e=>{U(t=>{let n=new Set(t);for(let t of Q)e.target.checked?n.add(t):n.delete(t);return n})}}),t.selectPage]})}),(0,B.jsx)(`ul`,{className:`divide-y divide-edge-subtle`,children:Ie.map(e=>{let n=z(e),r=e.kind===`mobile`?re:O;return(0,B.jsxs)(`li`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(`label`,{className:d(`touch-target flex size-10 shrink-0 items-center justify-center`,n===`revoked`?`cursor-not-allowed opacity-40`:`cursor-pointer`),children:(0,B.jsx)(`input`,{type:`checkbox`,checked:H.has(e.id),disabled:n===`revoked`,"aria-label":t.selectDevice.replace(`{{name}}`,e.displayName),className:`size-4 accent-accent`,onChange:t=>{U(n=>{let r=new Set(n);return t.target.checked?r.add(e.id):r.delete(e.id),r})}})}),(0,B.jsxs)(`button`,{type:`button`,className:`touch-target flex min-w-0 flex-1 items-center gap-3 py-3 text-left hover:bg-surface-hover/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>f(e),children:[(0,B.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-surface-inset text-fg-muted`,children:(0,B.jsx)(r,{className:`size-4`,"aria-hidden":!0})}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:e.displayName}),(0,B.jsx)(be,{status:n,label:t.status[n]})]}),(0,B.jsxs)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:[e.platform,` · `,ce(e.id),` · `,t.lastSeen,`: `,e.lastSeenAt?ke.format(e.lastSeenAt):t.never]})]}),(0,B.jsx)(`span`,{className:`hidden shrink-0 text-right text-xs text-fg-muted sm:block`,children:t.endpointSummary.replace(`{{endpoints}}`,String(e.endpoints.length)).replace(`{{tools}}`,String(ae(e)))}),(0,B.jsx)(o,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0})]})]},e.id)})}),(0,B.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3 border-t border-edge-subtle pt-3`,children:[(0,B.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.paginationSummary.replace(`{{from}}`,String((Z-1)*G+1)).replace(`{{to}}`,String(Math.min(Z*G,X.length))).replace(`{{total}}`,String(X.length))}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(x,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.previousPage,disabled:Z<=1,onClick:()=>V(e=>Math.max(1,e-1)),children:(0,B.jsx)(T,{className:`size-4`,"aria-hidden":!0})}),(0,B.jsx)(x,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.nextPage,disabled:Z>=Fe,onClick:()=>V(e=>Math.min(Fe,e+1)),children:(0,B.jsx)(o,{className:`size-4`,"aria-hidden":!0})})]})]})]})]}),(0,B.jsxs)(M,{id:`activity`,activeTab:c,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`,title:t.callsTitle,hint:t.callsHint,children:[(0,B.jsxs)(`div`,{className:`mb-4 grid gap-2 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,B.jsxs)(`label`,{className:`relative block sm:col-span-2 lg:col-span-1`,children:[(0,B.jsx)(`span`,{className:`sr-only`,children:t.searchActivity}),(0,B.jsx)(l,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),(0,B.jsx)(`input`,{type:`search`,"aria-label":t.searchActivity,value:de,placeholder:t.searchActivity,className:`h-10 w-full rounded-lg border border-edge bg-surface-inset pl-9 pr-3 text-base text-fg placeholder:text-fg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent sm:text-sm`,onChange:e=>{W(e.target.value),K(1)}})]}),(0,B.jsx)(s,{value:xe,options:Y.map(e=>({value:e.id,label:`${e.displayName} · ${ce(e.id)}`})),placeholder:t.allDevices,emptyLabel:t.allDevices,ariaLabel:t.deviceLabel,onChange:e=>{Se(e),K(1)}}),(0,B.jsx)(s,{value:Ce,options:[{value:`running`,label:t.status.running},{value:`succeeded`,label:t.status.succeeded},{value:`failed`,label:t.status.failed}],placeholder:t.allStatuses,emptyLabel:t.allStatuses,ariaLabel:t.statusLabel,onChange:e=>{we(e),K(1)}}),(0,B.jsx)(s,{value:Te,options:[{value:`read`,label:t.effects.read},{value:`write`,label:t.effects.write},{value:`destructive`,label:t.effects.destructive}],placeholder:t.allEffects,emptyLabel:t.allEffects,ariaLabel:t.effectLabel,onChange:e=>{Ee(e),K(1)}})]}),J.isLoading&&!J.data?(0,B.jsx)(P,{sections:1}):null,Ae.length===0&&!J.isLoading?(0,B.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noMatchingCalls}):null,(0,B.jsx)(`div`,{className:`space-y-2`,children:Ae.map(e=>(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-lg bg-surface-base/55 px-3 py-2.5`,children:[(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`p`,{className:`break-all text-sm font-medium text-fg`,children:e.toolName}),(0,B.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[ke.format(e.startedAt),` · `,t.effects[e.effect],` · `,e.endpointId]}),e.errorMessage?(0,B.jsx)(`p`,{className:`mt-1 text-xs text-danger`,children:e.errorMessage}):null]}),(0,B.jsx)(be,{status:e.status,label:t.status[e.status]})]},e.id))}),J.data&&J.data.total>0?(0,B.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3 border-t border-edge-subtle pt-3`,children:[(0,B.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.paginationSummary.replace(`{{from}}`,String((J.data.page-1)*J.data.pageSize+1)).replace(`{{to}}`,String(Math.min(J.data.page*J.data.pageSize,J.data.total))).replace(`{{total}}`,String(J.data.total))}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(x,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.previousPage,disabled:J.data.page<=1,onClick:()=>K(e=>Math.max(1,e-1)),children:(0,B.jsx)(T,{className:`size-4`,"aria-hidden":!0})}),(0,B.jsx)(x,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.nextPage,disabled:J.data.page>=J.data.totalPages,onClick:()=>K(e=>Math.min(J.data.totalPages,e+1)),children:(0,B.jsx)(o,{className:`size-4`,"aria-hidden":!0})})]})]}):null]}),(0,B.jsx)(le,{device:u,busy:h,onClose:()=>f(null),onRevoke:e=>{f(null),v(!1),m([e])}}),(0,B.jsx)(w,{open:p.length>0,title:p.length>1?t.removeManyTitle:t.removeTitle,description:`${p.length>1?t.removeManyDescription.replace(`{{count}}`,String(p.length)):t.removeDescription.replace(`{{name}}`,p[0]?.displayName??``)}${_?`\n\n${t.revokeError}`:``}`,confirmLabel:h?t.revoking:t.removeDevice,cancelLabel:t.cancel,destructive:!0,onConfirm:()=>void Be(),onCancel:()=>{h||m([])}})]})}export{xe as EndpointToolsManagementSettings};
|