@xopcai/xopc 0.0.324 → 0.0.329
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/README.zh-CN.md +4 -3
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-B-Gczr_A.js → agent-avatar-dicebear-Bs1qnnhD.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DHJyAT7t.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-DLKj_iIh.js +1 -0
- package/dist/gateway/static/root/assets/agents-SXZ5O0g4.js +70 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BwWdVRlb.js → app-management-settings-panel-BrIji9B5.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-EoXNDO1j.js → appearance-settings-Uts-MQ7K.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-DcclVdxW.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-B_T0uMvL.js → archive-plugin-_EzRfBuI.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-D9DDwxd2.js → attachment-load-CHg7_XFl.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-jI9vNr2r.js → automations-page-CGMErk_w.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-Cc4yqiF6.js +7 -0
- package/dist/gateway/static/root/assets/{binary-plugins-Dzsxh9OL.js → binary-plugins-D3WB-tVn.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CWUUgWWk.js → block-editor-Cm1W-14I.js} +53 -53
- package/dist/gateway/static/root/assets/box-DvYoGszj.js +1 -0
- package/dist/gateway/static/root/assets/braces-Cfmtagno.js +1 -0
- package/dist/gateway/static/root/assets/{browser-automation-inputs-DSWXq9lI.js → browser-automation-inputs-VnvK-GQP.js} +1 -1
- package/dist/gateway/static/root/assets/browser-automations-page-CZYCvSSU.js +3 -0
- package/dist/gateway/static/root/assets/browser-settings-page-DDz9PE6m.js +3 -0
- package/dist/gateway/static/root/assets/calendar-clock-D-quYVPe.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-page-DH3aDk53.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-C8jMZAJl.js +8 -0
- package/dist/gateway/static/root/assets/capability-discover-page-CgGvsf3t.js +1 -0
- package/dist/gateway/static/root/assets/capability-header-actions-C3chJDQu.js +1 -0
- package/dist/gateway/static/root/assets/capability-icon-BYm2-nS-.js +1 -0
- package/dist/gateway/static/root/assets/channels-CuVS_KsY.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-WXZrEB3K.js → chat-terminal-dock-ClbmjCL2.js} +2 -2
- package/dist/gateway/static/root/assets/chevron-left-DqFhpbvK.js +1 -0
- package/dist/gateway/static/root/assets/clock-3-DnrAnuyZ.js +1 -0
- package/dist/gateway/static/root/assets/computer-settings-page-BfZaf516.js +1 -0
- package/dist/gateway/static/root/assets/connector-service-page-F-fYNIx8.js +1 -0
- package/dist/gateway/static/root/assets/connectors-page-B4SLpvSL.js +2 -0
- package/dist/gateway/static/root/assets/date-picker-DXQTsUJn.js +1 -0
- package/dist/gateway/static/root/assets/dependency-picker-B_z3zihW.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-DPVPqFlh.js → desktop-pet-C1TZzKS3.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-B5JGIfqn.js +1 -0
- package/dist/gateway/static/root/assets/device-pairing-wizard-DFYK_Ywf.js +1 -0
- package/dist/gateway/static/root/assets/directory-picker-path-field-BfxaNwMB.js +1 -0
- package/dist/gateway/static/root/assets/ellipsis-0k4rZLoy.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-cuG5Lnwf.js → extension-debug-page-Bs8_FYCm.js} +1 -1
- package/dist/gateway/static/root/assets/extension-marketplace-api-DqV4YRYs.js +1 -0
- package/dist/gateway/static/root/assets/{extension-page-BCTAXdyE.js → extension-page-DH5vFbBw.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-kadW_icu.js → extension-settings-page-hGKovxxC.js} +1 -1
- package/dist/gateway/static/root/assets/external-link-DjqjBmc3.js +1 -0
- package/dist/gateway/static/root/assets/eye-CABVeTq0.js +1 -0
- package/dist/gateway/static/root/assets/folder-open-CyzJ19I9.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-swr-CoQVulMd.js → gateway-config-swr-BYMrbKZE.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-BIsiP-JI.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-B5GJ-CQV.js → gateway-startup-retry-DMqYXHAn.js} +1 -1
- package/dist/gateway/static/root/assets/gauge-C78eD2BA.js +1 -0
- package/dist/gateway/static/root/assets/git-branch-Dh9uxTot.js +1 -0
- package/dist/gateway/static/root/assets/globe-DSSGFWFn.js +1 -0
- package/dist/gateway/static/root/assets/home-page-CoBivEvx.js +1 -0
- package/dist/gateway/static/root/assets/image-Cwyalflz.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-DvWDkbk1.js → image-generation-api-D1sQGaJz.js} +1 -1
- package/dist/gateway/static/root/assets/imports-page-rssb4rjP.js +1 -0
- package/dist/gateway/static/root/assets/inbox-DNoSz682.js +1 -0
- package/dist/gateway/static/root/assets/index-C4QN4gCi.css +1 -0
- package/dist/gateway/static/root/assets/index-Cr4SINLG.js +121 -0
- package/dist/gateway/static/root/assets/is-masked-secret-DOkL5b_X.js +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-C1fKIjz4.js → keyboard-shortcuts-settings-CMitbles.js} +1 -1
- package/dist/gateway/static/root/assets/layout-grid-CEVZdVFU.js +1 -0
- package/dist/gateway/static/root/assets/link-2-D_ZKYUW7.js +1 -0
- package/dist/gateway/static/root/assets/list-BBGUdmkF.js +1 -0
- package/dist/gateway/static/root/assets/loader-circle-CifKLtgG.js +1 -0
- package/dist/gateway/static/root/assets/local-app-workbench-page-Di82Oacm.js +1 -0
- package/dist/gateway/static/root/assets/local-apps-page-CCvA9d9L.js +1 -0
- package/dist/gateway/static/root/assets/{locale-store-BPZR8x9b.js → locale-store-BSkKhYkc.js} +1 -1
- package/dist/gateway/static/root/assets/lock-keyhole-DEK5kH0u.js +1 -0
- package/dist/gateway/static/root/assets/logs-page-BK8ol1q0.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-CebXkEtB.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-Dft8ASFD.js → markdown-view-DXubGEic.js} +2 -2
- package/dist/gateway/static/root/assets/{media-plugins-Cjj-fidX.js → media-plugins-DLJrmU9J.js} +1 -1
- package/dist/gateway/static/root/assets/message-circle-Badhj-4D.js +1 -0
- package/dist/gateway/static/root/assets/message-square-fVE7Ghj1.js +1 -0
- package/dist/gateway/static/root/assets/message-square-plus-XP0tGdlV.js +1 -0
- package/dist/gateway/static/root/assets/messages-D0G_sZvA.js +3 -0
- package/dist/gateway/static/root/assets/minimize-2-DtOGrlpo.js +1 -0
- package/dist/gateway/static/root/assets/models-hub-cache-B0EUPwTv.js +1 -0
- package/dist/gateway/static/root/assets/network-BUQLY1BV.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-panel-xsKDIJdK.js +5 -0
- package/dist/gateway/static/root/assets/note-image-lightbox-1qg2v-9j.js +1 -0
- package/dist/gateway/static/root/assets/notes-page-BFm7XnWH.js +8 -0
- package/dist/gateway/static/root/assets/page-context-capture-button-C3JiQEKD.js +1 -0
- package/dist/gateway/static/root/assets/paperclip-f1HujQY1.js +1 -0
- package/dist/gateway/static/root/assets/pencil-DmIY3Oa-.js +1 -0
- package/dist/gateway/static/root/assets/power-ZI-pBczI.js +1 -0
- package/dist/gateway/static/root/assets/preview-open-alternatives-buk_gdip.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-DlpCi5zT.js → product-open-page-DwEEO0Ak.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-CRQGCRSU.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DcqylysA.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-DWWO6ajd.js → registry-api-tx8XCHOs.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-Cq5MaiRW.js +1 -0
- package/dist/gateway/static/root/assets/rotate-cw-LIg3Am9S.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BT_ANpaT.js → runtime-tools-settings-panel-De7HmmBu.js} +2 -2
- package/dist/gateway/static/root/assets/scenes-page-GXJ-b3dO.js +2 -0
- package/dist/gateway/static/root/assets/{schema-form-BcqsqSsV.js → schema-form-DPMEuj5D.js} +1 -1
- package/dist/gateway/static/root/assets/search-DA7gz22f.js +1 -0
- package/dist/gateway/static/root/assets/server-BlHCBjiE.js +1 -0
- package/dist/gateway/static/root/assets/sessions-page-C6FwYIRA.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BEyQiZs0.js +1 -0
- package/dist/gateway/static/root/assets/settings-form-section-DM0D-BQ_.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-B65vii9U.js → settings-page-CWS9yOH3.js} +1 -1
- package/dist/gateway/static/root/assets/settings-page-layout-X1x-2Cp9.js +1 -0
- package/dist/gateway/static/root/assets/setup-status-panel-BhGKiTPf.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-BS8o58NJ.js → share-preview-page-CcRi2yGy.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-DNmcCBfX.js +1 -0
- package/dist/gateway/static/root/assets/skill-api-BCAV_F1P.js +1 -0
- package/dist/gateway/static/root/assets/skill-card-icon-BrrpZ3Mw.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-BEV2WXGk.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-C8zOGpKw.js +2 -0
- package/dist/gateway/static/root/assets/star-BUWJqJ5c.js +1 -0
- package/dist/gateway/static/root/assets/stethoscope-DRqTAtjD.js +1 -0
- package/dist/gateway/static/root/assets/store-SzD1Jvgm.js +1 -0
- package/dist/gateway/static/root/assets/system-settings-panel-C_lajq9u.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-Dk8Bmlhw.js +1 -0
- package/dist/gateway/static/root/assets/tunnel-api-CYvKiE_f.js +1 -0
- package/dist/gateway/static/root/assets/upload-rrb46c3c.js +1 -0
- package/dist/gateway/static/root/assets/use-autosave-ZTHe1zCM.js +1 -0
- package/dist/gateway/static/root/assets/user-model-page-C_SPNZbP.js +2 -0
- package/dist/gateway/static/root/assets/user-round-C9jxPhMR.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-DJV-qERt.js → voice-api-key-field-C8Kpkct-.js} +1 -1
- package/dist/gateway/static/root/assets/voice-config-api-BvzxINUk.js +1 -0
- package/dist/gateway/static/root/assets/wand-sparkles-DWuJz5ya.js +1 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-DcHhy54L.js → work-discovery-overlay-ClB6T-dm.js} +1 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-X0Cyh2AR.js +3 -0
- package/dist/gateway/static/root/assets/workflows-page-BrL6dzf0.js +6 -0
- package/dist/gateway/static/root/connector-icons/SOURCES.md +1 -0
- package/dist/gateway/static/root/connector-icons/wecom.svg +9 -0
- package/dist/gateway/static/root/index.html +26 -8
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-instance-gateway.d.ts +2 -2
- package/dist/src/agent/agent-manager.d.ts +4 -2
- package/dist/src/agent/agent-manager.js +58 -19
- package/dist/src/agent/background-review/coordinator.d.ts +2 -7
- package/dist/src/agent/background-review/coordinator.js +17 -34
- package/dist/src/agent/background-review/prompts.d.ts +13 -5
- package/dist/src/agent/background-review/prompts.js +17 -12
- package/dist/src/agent/background-review/run-background-review.d.ts +3 -3
- package/dist/src/agent/background-review/run-background-review.js +58 -43
- package/dist/src/agent/context/execution-context.js +5 -2
- package/dist/src/agent/mcp/index.js +1 -1
- package/dist/src/agent/mcp/mcp-transport.js +2 -2
- package/dist/src/agent/mcp/oauth/index.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +2 -2
- package/dist/src/agent/mcp/oauth/mcp-oauth-provider.js +1 -1
- package/dist/src/agent/orchestration/agent-orchestrator.js +1 -1
- package/dist/src/agent/prompt/sections/tooling.js +3 -0
- package/dist/src/agent/service/direct-turn-helpers.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.d.ts +12 -0
- package/dist/src/agent/tools/user-context-tool.js +29 -4
- package/dist/src/automations/domain/types.d.ts +7 -1
- package/dist/src/automations/service/action-executor.d.ts +2 -2
- package/dist/src/automations/service/action-executor.js +36 -13
- package/dist/src/automations/service/automation-service.js +2 -1
- package/dist/src/browser/automations/index.js +2 -2
- package/dist/src/browser/automations/service.d.ts +11 -2
- package/dist/src/browser/automations/service.js +19 -5
- package/dist/src/capabilities/readiness/from-config.d.ts +0 -1
- package/dist/src/capabilities/readiness/from-config.js +2 -4
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/extension-agent-plugin.js +2 -1
- package/dist/src/config/schema.js +4 -4
- package/dist/src/connectors/china-catalog.js +5 -1
- package/dist/src/connectors/connected-source-ingestion.js +6 -1
- package/dist/src/connectors/connected-source-observations.d.ts +10 -0
- package/dist/src/connectors/connected-source-observations.js +80 -0
- package/dist/src/connectors/connected-source-understanding.js +198 -8
- package/dist/src/connectors/learning-coordinator.js +63 -26
- package/dist/src/connectors/learning-recipes.js +19 -2
- package/dist/src/discussions/audio-repair.d.ts +1 -1
- package/dist/src/discussions/live-worker.js +1 -3
- package/dist/src/discussions/recording.js +2 -2
- package/dist/src/discussions/sealer.js +2 -2
- package/dist/src/extensions/agent-plugins/auth.d.ts +2 -2
- package/dist/src/extensions/agent-plugins/auth.js +6 -35
- package/dist/src/extensions/agent-plugins/credentials.d.ts +2 -0
- package/dist/src/extensions/agent-plugins/credentials.js +37 -0
- package/dist/src/extensions/agent-plugins/plugin-oauth-scope.d.ts +1 -0
- package/dist/src/extensions/agent-plugins/plugin-oauth-scope.js +8 -0
- package/dist/src/extensions/marketplace.d.ts +4 -0
- package/dist/src/extensions/marketplace.js +4 -0
- package/dist/src/gateway/file-space-service.d.ts +9 -2
- package/dist/src/gateway/hono/routes/agent-plugins.js +2 -1
- package/dist/src/gateway/hono/routes/config.js +0 -3
- package/dist/src/gateway/hono/routes/connectors.js +3 -10
- package/dist/src/gateway/hono/routes/context-sources.d.ts +0 -1
- package/dist/src/gateway/hono/routes/context-sources.js +12 -15
- package/dist/src/gateway/hono/routes/status.js +0 -1
- package/dist/src/gateway/hono/routes/user-model.js +21 -3
- package/dist/src/gateway/hono/routes/voice.js +0 -67
- package/dist/src/gateway/service.js +6 -4
- package/dist/src/media-understanding/types.d.ts +1 -1
- package/dist/src/memory-maintenance/service.d.ts +1 -0
- package/dist/src/memory-maintenance/service.js +13 -0
- package/dist/src/migrations/retired-local-stt.d.ts +2 -0
- package/dist/src/migrations/retired-local-stt.js +52 -0
- package/dist/src/migrations/runner.js +2 -1
- package/dist/src/session/turn-outcome-projector.js +1 -1
- package/dist/src/storage/sqlite/connection.js +1 -0
- package/dist/src/storage/sqlite/migrations/207_user_model_policy_contract.sql +121 -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/sql-assets.d.ts +1 -0
- package/dist/src/storage/sqlite/sql-assets.js +7 -4
- package/dist/src/tasks/index.js +2 -2
- package/dist/src/tasks/task-application-service.d.ts +1 -0
- package/dist/src/tasks/task-application-service.js +4 -2
- package/dist/src/tasks/task-context-assembler.js +10 -1
- package/dist/src/tasks/task-run-dispatcher.d.ts +1 -0
- package/dist/src/tasks/task-run-dispatcher.js +15 -2
- package/dist/src/user-context/sources/consent-repository.d.ts +7 -0
- package/dist/src/user-context/sources/consent-repository.js +81 -0
- package/dist/src/user-context/sources/index.d.ts +1 -0
- package/dist/src/user-context/sources/index.js +2 -1
- package/dist/src/user-context/sources/repository.js +73 -1
- package/dist/src/user-context/sources/types.d.ts +16 -0
- package/dist/src/user-model/action-rule-suggestions.d.ts +11 -0
- package/dist/src/user-model/action-rule-suggestions.js +29 -0
- package/dist/src/user-model/bootstrap.js +1 -1
- package/dist/src/user-model/capture/executor.js +83 -7
- package/dist/src/user-model/capture/semantic.d.ts +5 -2
- package/dist/src/user-model/capture/semantic.js +27 -11
- package/dist/src/user-model/domain.d.ts +26 -0
- package/dist/src/user-model/domain.js +40 -2
- package/dist/src/user-model/index.d.ts +2 -0
- package/dist/src/user-model/index.js +6 -4
- package/dist/src/user-model/maintenance-policy.d.ts +1 -0
- package/dist/src/user-model/maintenance-policy.js +13 -0
- package/dist/src/user-model/observation-repository.d.ts +48 -0
- package/dist/src/user-model/observation-repository.js +100 -0
- package/dist/src/user-model/repository.d.ts +5 -0
- package/dist/src/user-model/repository.js +121 -10
- package/dist/src/user-model/usage-policy.d.ts +5 -2
- package/dist/src/user-model/usage-policy.js +2 -2
- package/dist/src/voice/audio/normalize.d.ts +1 -1
- package/dist/src/voice/audio/normalize.js +1 -1
- package/dist/src/voice/{local → audio}/wav.js +1 -1
- package/dist/src/voice/language-profile.js +10 -16
- package/dist/src/voice/metadata/builtin.js +0 -46
- package/dist/src/voice/stt/providers/index.d.ts +0 -1
- package/dist/src/voice/stt/providers/index.js +1 -2
- package/dist/src/voice/stt/types.js +3 -4
- package/dist/src/voice/tts/merge-config.js +1 -1
- package/dist/src/voice/tts/speech-registry.d.ts +1 -1
- package/dist/src/voice/tts/types.d.ts +1 -1
- package/dist/src/work-discovery/analyzer.js +6 -5
- package/dist/src/work-discovery/service.js +2 -2
- package/dist/src/work-discovery/types.d.ts +1 -1
- package/dist/src/workflows/context/workflow-context.js +5 -1
- package/dist/src/workflows/index.js +2 -2
- package/dist/src/workflows/service/workflow-run-service.d.ts +1 -0
- package/dist/src/workflows/service/workflow-run-service.js +13 -4
- package/package.json +13 -17
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CxcIHW_Z.js +0 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-CNuqJcHQ.js +0 -1
- package/dist/gateway/static/root/assets/agents-CPpmkx7O.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-6xEgLDv8.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-rztQnZDk.js +0 -7
- package/dist/gateway/static/root/assets/browser-automations-page-D96o3bDY.js +0 -3
- package/dist/gateway/static/root/assets/browser-settings-page-DUQzQ3ic.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CKWtXof8.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-C8ducWB7.js +0 -1
- package/dist/gateway/static/root/assets/computer-settings-page-uy9YDwxJ.js +0 -1
- package/dist/gateway/static/root/assets/connector-service-page-BpF0SjB9.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-eZTfIMWI.js +0 -2
- package/dist/gateway/static/root/assets/date-picker-Do1dl0La.js +0 -1
- package/dist/gateway/static/root/assets/dependency-picker-BhS8s080.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-Dv3vG9HZ.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-DdvO1O6W.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-CLZyN-u9.js +0 -1
- package/dist/gateway/static/root/assets/home-page-BSqg-JE9.js +0 -1
- package/dist/gateway/static/root/assets/imports-page-_pddpuej.js +0 -1
- package/dist/gateway/static/root/assets/index-BKL5tg2f.css +0 -1
- package/dist/gateway/static/root/assets/index-CJuypaNt.js +0 -121
- package/dist/gateway/static/root/assets/local-app-workbench-page-DXFnYiA0.js +0 -1
- package/dist/gateway/static/root/assets/local-apps-page-CkXKS5xe.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-C33z-ife.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-8eDZb0uS.js +0 -1
- package/dist/gateway/static/root/assets/messages-kFWhF6_t.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-C95RtLuL.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-kFxknjMR.js +0 -8
- package/dist/gateway/static/root/assets/page-context-capture-button-OUL3fEYh.js +0 -1
- package/dist/gateway/static/root/assets/page-tabs-CVbY7_N5.js +0 -1
- package/dist/gateway/static/root/assets/preview-open-alternatives-CKiIby0r.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-LPAxUszX.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-Cbyb4hyy.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BtDFZc6g.js +0 -1
- package/dist/gateway/static/root/assets/scenes-page-CJlc-mg1.js +0 -2
- package/dist/gateway/static/root/assets/sessions-page-CUo6-iV2.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-XeSxPjP7.js +0 -1
- package/dist/gateway/static/root/assets/settings-form-section-Dol9j_pF.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-layout-eqTUTW2L.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BCt__prc.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BsjSqEnw.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-evN7gs0S.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-BifYwEhe.js +0 -2
- package/dist/gateway/static/root/assets/skills-page.utils-DOk-iOvN.js +0 -1
- package/dist/gateway/static/root/assets/system-settings-panel-CcSvoHfY.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-pCRG7Jb3.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-DDGMf44u.js +0 -1
- package/dist/gateway/static/root/assets/use-autosave-DiIkxIq7.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-CvYeM0Ml.js +0 -2
- package/dist/gateway/static/root/assets/voice-config-api-BaxITrwZ.js +0 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-DbVtLh0R.js +0 -3
- package/dist/gateway/static/root/assets/workflows-page-CT8ouKcB.js +0 -6
- package/dist/src/voice/local/model-files.d.ts +0 -14
- package/dist/src/voice/local/model-files.js +0 -92
- package/dist/src/voice/local/model-manager.d.ts +0 -18
- package/dist/src/voice/local/model-manager.js +0 -133
- package/dist/src/voice/local/models.d.ts +0 -28
- package/dist/src/voice/local/models.js +0 -99
- package/dist/src/voice/local/provider-switch.d.ts +0 -4
- package/dist/src/voice/local/provider-switch.js +0 -36
- package/dist/src/voice/local/runtime-client.d.ts +0 -28
- package/dist/src/voice/local/runtime-client.js +0 -183
- package/dist/src/voice/local/runtime-worker.d.ts +0 -1
- package/dist/src/voice/local/runtime-worker.js +0 -271
- package/dist/src/voice/stt/providers/local-transcription.d.ts +0 -2
- package/dist/src/voice/stt/providers/local-transcription.js +0 -53
- /package/dist/src/voice/{local → audio}/wav.d.ts +0 -0
|
@@ -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"./cn-JdwAhgNB.js";import{n as a}from"./locale-store-BPZR8x9b.js";import{t as o}from"./messages-kFWhF6_t.js";import{n as s}from"./electron-env-Dit0bHgy.js";import{Ci as c,Di as l,Ei as u,F as d,Oi as f,Si as p,Ti as m,dn as h,wi as g}from"./index-CJuypaNt.js";import{n as _,r as v}from"./settings-page-layout-eqTUTW2L.js";var y=n(),b=e(t(),1),x=r(),S=m(),C=S?`⌘`:`Ctrl`;function w(e){let t=(0,y.c)(54),{title:n,description:r,shortcut:s,otherShortcut:c,defaultShortcut:d,setShortcut:f,legacyRecordingEvent:p,notice:m}=e,g=a(E),_;t[0]===g?_=t[1]:(_=o(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]!==p||t[3]!==C?(k=()=>{let e={active:C};return window.dispatchEvent(new CustomEvent(h,{detail:e})),p&&window.dispatchEvent(new CustomEvent(p,{detail:e})),()=>{let e={active:!1};window.dispatchEvent(new CustomEvent(h,{detail:e})),p&&window.dispatchEvent(new CustomEvent(p,{detail:e}))}},A=[p,C],t[2]=p,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]!==f?(j=e=>{if(!C)return;if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){w(!1);return}let t=l(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}f(t),O(null),w(!1)},t[6]=v.quickCaptureShortcutConflict,t[7]=c,t[8]=C,t[9]=f,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=u(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=i(`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]!==d||t[31]!==f?(H=()=>{f(d()),O(null)},t[30]=d,t[31]=f,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]===m?q=t[47]:(q=m?(0,x.jsx)(`div`,{className:`mt-3 rounded-lg bg-surface-base/55 p-3`,children:m}):null,t[46]=m,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=a(j),n;e[0]===t?n=e[1]:(n=o(t),e[0]=t,e[1]=n);let r=n.keyboardShortcutsSettings,i=f(A),s=f(k),l=c(O),u;return e[2]!==r.quickCaptureShortcutDescription||e[3]!==r.quickCaptureShortcutTitle||e[4]!==s||e[5]!==i||e[6]!==l?(u=(0,x.jsx)(w,{title:r.quickCaptureShortcutTitle,description:r.quickCaptureShortcutDescription,shortcut:i,otherShortcut:l,defaultShortcut:g,setShortcut:s,legacyRecordingEvent:`quick-capture-shortcut-recording`}),e[2]=r.quickCaptureShortcutDescription,e[3]=r.quickCaptureShortcutTitle,e[4]=s,e[5]=i,e[6]=l,e[7]=u):u=e[7],u}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=a(I),n;e[0]===t?n=e[1]:(n=o(t),e[0]=t,e[1]=n);let r=n.keyboardShortcutsSettings,i=c(F),s=c(P),l=f(N),u;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,x.jsx)(L,{}),e[2]=u):u=e[2];let d;return e[3]!==r.voiceInputShortcutDescription||e[4]!==r.voiceInputShortcutTitle||e[5]!==l||e[6]!==s||e[7]!==i?(d=(0,x.jsx)(w,{title:r.voiceInputShortcutTitle,description:r.voiceInputShortcutDescription,shortcut:i,otherShortcut:l,defaultShortcut:p,setShortcut:s,notice:u}),e[3]=r.voiceInputShortcutDescription,e[4]=r.voiceInputShortcutTitle,e[5]=l,e[6]=s,e[7]=i,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=o(a(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:i(`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,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=i(`rounded-xl bg-surface-hover/20 px-4 sm:px-5`),t[0]=a):a=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:a,"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=a(q),n;e[0]===t?n=e[1]:(n=o(t),e[0]=t,e[1]=n);let r=n.keyboardShortcutsSettings,i=f(K),l=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]!==i||e[29]!==l){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 a;e[45]===r.globalNewChat?a=e[46]:(a={keys:n,label:r.globalNewChat},e[45]=r.globalNewChat,e[46]=a);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 f;e[50]===i?f=e[51]:(f=u(i),e[50]=i,e[51]=f);let m;e[52]!==r.navQuickCapture||e[53]!==f?(m={keys:f,label:r.navQuickCapture},e[52]=r.navQuickCapture,e[53]=f,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]!==a||e[67]!==c||e[68]!==m||e[69]!==h||e[70]!==g?(b=[a,c,m,...h,...g,..._,y],e[64]=_,e[65]=y,e[66]=a,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]===l?A=e[85]:(A=u(l),e[84]=l,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]=i,e[29]=l,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};
|
|
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-D0G_sZvA.js";import{t as a}from"./cn-JdwAhgNB.js";import{n as o}from"./locale-store-BSkKhYkc.js";import{n as s}from"./electron-env-Dit0bHgy.js";import{Ai as c,F as l,Fi as u,Mi as d,Ni as f,Pi as p,ji as m,ki as h,un as g}from"./index-Cr4SINLG.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:c,defaultShortcut:l,setShortcut:u,legacyRecordingEvent:d,notice:m}=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]!==d||t[3]!==C?(k=()=>{let e={active:C};return window.dispatchEvent(new CustomEvent(g,{detail:e})),d&&window.dispatchEvent(new CustomEvent(d,{detail:e})),()=>{let e={active:!1};window.dispatchEvent(new CustomEvent(g,{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=p(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]===m?q=t[47]:(q=m?(0,x.jsx)(`div`,{className:`mt-3 rounded-lg bg-surface-base/55 p-3`,children:m}):null,t[46]=m,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=u(A),s=u(k),l=c(O),d;return e[2]!==r.quickCaptureShortcutDescription||e[3]!==r.quickCaptureShortcutTitle||e[4]!==s||e[5]!==a||e[6]!==l?(d=(0,x.jsx)(w,{title:r.quickCaptureShortcutTitle,description:r.quickCaptureShortcutDescription,shortcut:a,otherShortcut:l,defaultShortcut:m,setShortcut:s,legacyRecordingEvent:`quick-capture-shortcut-recording`}),e[2]=r.quickCaptureShortcutDescription,e[3]=r.quickCaptureShortcutTitle,e[4]=s,e[5]=a,e[6]=l,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),l=u(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]!==l||e[6]!==s||e[7]!==a?(f=(0,x.jsx)(w,{title:r.voiceInputShortcutTitle,description:r.voiceInputShortcutDescription,shortcut:a,otherShortcut:l,defaultShortcut:h,setShortcut:s,notice:d}),e[3]=r.voiceInputShortcutDescription,e[4]=r.voiceInputShortcutTitle,e[5]=l,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=u(K),d=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]!==d){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 u;e[50]===a?u=e[51]:(u=f(a),e[50]=a,e[51]=u);let m;e[52]!==r.navQuickCapture||e[53]!==u?(m={keys:u,label:r.navQuickCapture},e[52]=r.navQuickCapture,e[53]=u,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]===d?A=e[85]:(A=f(d),e[84]=d,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=l(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]=d,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{t as e}from"./createLucideIcon-DPHK1VkS.js";var t=e(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-DPHK1VkS.js";var t=e(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-DPHK1VkS.js";var t=e(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-DPHK1VkS.js";var t=e(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]);export{t};
|
|
@@ -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"./createLucideIcon-DPHK1VkS.js";import{t as c}from"./check-DUBLcKHA.js";import{t as ee}from"./circle-check-C23XjkUj.js";import{t as l}from"./clock-3-DnrAnuyZ.js";import{t as te}from"./external-link-DjqjBmc3.js";import{t as u}from"./loader-circle-CifKLtgG.js";import{t as d}from"./power-ZI-pBczI.js";import{t as f}from"./x-B_N4OPjy.js";import{n as p,r as m}from"./locale-store-BSkKhYkc.js";import{a as h,i as g,n as _,o as v,r as y,s as b,t as x}from"./dist-BGTk37IG.js";import{a as S}from"./local-apps-Bpja8nC6.js";import{a as C,i as ne}from"./vendor-swr-BIWyz7Rc.js";import{t as w}from"./button-CS04eWY9.js";import{t as re}from"./skeleton-BwbyijEw.js";import{$l as ie,Ar as ae,Bc as oe,Cr as se,Dc as ce,Eo as le,Er as ue,Ic as de,Il as fe,Kc as pe,Mr as me,Oc as he,Or as ge,Sl as _e,Sr as ve,Tr as ye,br as be,go as xe,hi as Se,jr as Ce,kr as we,lo as Te,nl as Ee,qc as De,vl as Oe,wr as ke,xr as Ae}from"./index-Cr4SINLG.js";import{t as je}from"./page-context-capture-button-C3JiQEKD.js";import{n as Me,t as Ne}from"./tab-completion-input-D64VNmiA.js";import{t as Pe}from"./tab-completion-input.utils-BP3NH_du.js";var Fe=s(`file-diff`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]),T=s(`message-square-code`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`m10 8-3 3 3 3`,key:`fp6dz7`}],[`path`,{d:`m14 14 3-3-3-3`,key:`1yrceu`}]]),Ie=s(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),E=e(t(),1),D=`build-xopc-local-app`;function Le(e){return(e.routing?.agentId??e.agentId??``).trim().toLowerCase()}function Re(e){return e.find(e=>Le(e)===`coder`)??null}function ze(e,t){let n=new URLSearchParams({skill:D}),r=t?.trim();return r&&n.set(`draft`,r),`/chat/${encodeURIComponent(e)}?${n.toString()}`}var Be=n(),O=r();function Ve(e){let t=(0,Be.c)(36),{scenarios:n,results:r,runningTarget:i,zh:a,onRunAll:o,onRunScenario:s,onAskCoder:c}=e;if(!n.length)return null;let te=a?`产品场景`:`Product scenarios`,d;t[0]===te?d=t[1]:(d=(0,O.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:te}),t[0]=te,t[1]=d);let f=a?`${n.length} 个关键用户路径`:`${n.length} critical user journey${n.length===1?``:`s`}`,p;t[2]===f?p=t[3]:(p=(0,O.jsx)(`p`,{className:`mt-0.5 text-[11px] text-fg-subtle`,children:f}),t[2]=f,t[3]=p);let m;t[4]!==d||t[5]!==p?(m=(0,O.jsxs)(`div`,{children:[d,p]}),t[4]=d,t[5]=p,t[6]=m):m=t[6];let h=i!==null,g;t[7]===i?g=t[8]:(g=i===`all`?(0,O.jsx)(u,{className:`size-3 animate-spin`}):(0,O.jsx)(De,{className:`size-3`}),t[7]=i,t[8]=g);let _=a?`全部重跑`:`Run all`,v;t[9]!==o||t[10]!==h||t[11]!==g||t[12]!==_?(v=(0,O.jsxs)(w,{variant:`ghost`,className:`h-7 rounded-lg px-2 text-[11px]`,onClick:o,disabled:h,children:[g,_]}),t[9]=o,t[10]=h,t[11]=g,t[12]=_,t[13]=v):v=t[13];let y;t[14]!==m||t[15]!==v?(y=(0,O.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[m,v]}),t[14]=m,t[15]=v,t[16]=y):y=t[16];let b=a?`产品场景验收结果`:`Product scenario acceptance results`,x;if(t[17]!==c||t[18]!==s||t[19]!==r||t[20]!==i||t[21]!==n||t[22]!==a){let e;t[24]!==c||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,O.jsx)(`li`,{className:`py-2.5 first:pt-1`,children:(0,O.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,O.jsx)(`span`,{className:`mt-0.5 shrink-0`,"aria-hidden":!0,children:n===`running`?(0,O.jsx)(u,{className:`size-3.5 animate-spin text-accent`}):n===`passed`?(0,O.jsx)(ee,{className:`size-3.5 text-success`}):n===`failed`?(0,O.jsx)(fe,{className:`size-3.5 text-danger`}):(0,O.jsx)(l,{className:`size-3.5 text-fg-subtle`})}),(0,O.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,O.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,O.jsxs)(`div`,{className:`min-w-0`,children:[(0,O.jsx)(`p`,{className:`truncate text-[11px] font-medium text-fg`,children:e.name}),(0,O.jsx)(`p`,{className:`mt-0.5 text-[10px] text-fg-subtle`,children:a?`${e.stepCount} 个步骤`:`${e.stepCount} step${e.stepCount===1?``:`s`}`})]}),(0,O.jsx)(w,{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,O.jsx)(De,{className:`size-3`})})]}),n===`running`?(0,O.jsx)(`p`,{className:`mt-1 text-[11px] leading-4 text-fg-muted`,children:a?`正在隔离预览中执行…`:`Running in an isolated preview…`}):t?.status===`failed`?(0,O.jsxs)(`div`,{className:`mt-1.5`,children:[(0,O.jsx)(`p`,{className:`text-[11px] leading-4 text-danger`,children:t.message}),(0,O.jsxs)(w,{variant:`ghost`,className:`mt-1 h-7 rounded-lg px-2 text-[11px] text-danger hover:text-danger`,onClick:()=>c(e,t),children:[(0,O.jsx)(T,{className:`size-3`}),a?`让 Coder 修复`:`Ask Coder to fix`]})]}):t?.status===`passed`?(0,O.jsx)(`p`,{className:`mt-1 text-[11px] leading-4 text-fg-muted`,children:a?`场景已通过`:`Scenario passed`}):(0,O.jsx)(`p`,{className:`mt-1 text-[11px] leading-4 text-fg-muted`,children:a?`等待运行`:`Waiting to run`})]})]})},e.id)},t[24]=c,t[25]=s,t[26]=r,t[27]=i,t[28]=a,t[29]=e):e=t[29],x=n.map(e),t[17]=c,t[18]=s,t[19]=r,t[20]=i,t[21]=n,t[22]=a,t[23]=x}else x=t[23];let S;t[30]!==b||t[31]!==x?(S=(0,O.jsx)(`ul`,{className:`mt-2 divide-y divide-edge-subtle`,"aria-label":b,children:x}),t[30]=b,t[31]=x,t[32]=S):S=t[32];let C;return t[33]!==y||t[34]!==S?(C=(0,O.jsxs)(`div`,{className:`mt-3 border-t border-edge-subtle pt-3`,children:[y,S]}),t[33]=y,t[34]=S,t[35]=C):C=t[35],C}var He=`allow-scripts allow-forms`;function Ue(e,t){return Se(e,t)}function We(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 Ge(){let{appId:e}=a(),t=e===`new`,n=p(e=>e.language)===`zh`,r=p(e=>e.language),s=i(),{mutate:l}=C(),fe=le(e=>e.setPageHeader),Se=le(e=>e.clearPageHeader),{data:D,isLoading:Le,error:Be,mutate:Ge}=ne(!t&&e?[`local-app`,e]:null,()=>ke(e)),{data:k,isLoading:Ke,mutate:qe}=ne(!t&&e?[`local-app-validation`,e]:null,()=>me(e)),[Je,Ye]=(0,E.useState)(``),[Xe,Ze]=(0,E.useState)(``),[A,j]=(0,E.useState)(!1),[Qe,M]=(0,E.useState)(null),[$e,et]=(0,E.useState)(!1),[tt,nt]=(0,E.useState)(!1),[N,rt]=(0,E.useState)(0),[it,at]=(0,E.useState)(``),[P,ot]=(0,E.useState)(!1),[F,st]=(0,E.useState)(!1),[I,L]=(0,E.useState)(`booting`),[R,ct]=(0,E.useState)(null),[z,lt]=(0,E.useState)(null),[B,ut]=(0,E.useState)({}),[V,dt]=(0,E.useState)(`all`),[H,U]=(0,E.useState)(0),[ft,pt]=(0,E.useState)(0),[mt,ht]=(0,E.useState)(null),[W,gt]=(0,E.useState)(null),[_t,vt]=(0,E.useState)([]),[G,yt]=(0,E.useState)(!1),bt=(0,E.useRef)(new Set),K=(0,E.useRef)(null),xt=(0,E.useRef)(null),St=(0,E.useRef)(null),q=(0,E.useRef)(null),J=(0,E.useRef)(``),Y=k?.acceptanceScenarios??[],X=(0,E.useMemo)(()=>{if(!Y.length)return null;let e=Y.map(e=>B[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,B]),Z=(0,E.useMemo)(()=>{if(!z)return null;if(!k?.acceptanceScenarioCount)return z;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=[...z.checks,t];return{status:n.some(e=>e.status===`failed`)?`failed`:`passed`,checks:n,interactiveCount:z.interactiveCount}},[z,X,k?.acceptanceScenarioCount]),Ct=(0,E.useCallback)(async(e,t)=>{let n=Re(await xe(e.projectId))??await Te(e.projectId,`coder`);bt.current.add(n.key),s(ze(n.key,t))},[s]),wt=(0,E.useCallback)(async(e=!0)=>{if(!D)return null;st(!0);try{let t=await me(D.id);return await qe(t,{revalidate:!1}),e&&(q.current=t.sourceHash??null,dt(`all`),U(0),rt(e=>e+1)),t}catch(e){return M(e instanceof Error?e.message:String(e)),null}finally{st(!1)}},[D,qe]);(0,E.useEffect)(()=>{if(!D)return;let e=!1;xe(D.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)}},[D,wt]),(0,E.useEffect)(()=>{vt(D?.acceptanceRuns??[])},[D?.acceptanceRuns]),(0,E.useEffect)(()=>{q.current=null},[D?.id]),(0,E.useEffect)(()=>{!k?.sourceHash||q.current===k.sourceHash||(q.current=k.sourceHash,dt(`all`),U(0),rt(e=>e+1))},[D?.id,k?.sourceHash]),(0,E.useLayoutEffect)(()=>{if(!D)return;L(`booting`),ct(null),lt(null),gt(null),yt(!1),J.current=``;let e=window.setTimeout(()=>L(e=>e===`failed`?e:`timeout`),7e3),t=xt.current?ve(xt.current,t=>{let n=S(t);if(n){if(n.type===`ready`){L(e=>e===`failed`?e:`healthy`);return}if(n.type===`acceptance`){window.clearTimeout(e),lt(n.detail),gt(q.current);return}n.type!==`criteria`&&(window.clearTimeout(e),ct(n.detail),L(`failed`))}}):()=>{};return()=>{window.clearTimeout(e),t()}},[D,N]),(0,E.useLayoutEffect)(()=>{if(!D||k?.status!==`healthy`||!Y.length){ht(null);return}let e=V===`all`?Y[H]:Y.find(e=>e.id===V),t=e?[e]:[];if(!t.length)return;ht(V),ut(e=>{if(V===`all`&&H===0)return{};let t={...e};return delete t[V],t});let r=!1,i=e=>{ut(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}),ht(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?ve(St.current,e=>{let t=S(e);t&&(t.type===`ready`?r=!0:t.type===`criteria`?(window.clearTimeout(a),ut(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}),V===`all`&&H+1<Y.length?(U(e=>e+1),pt(e=>e+1)):ht(null)):t.type===`error`&&(window.clearTimeout(a),i(be(t.detail))))}):()=>{};return()=>{window.clearTimeout(a),o()}},[Y,D,ft,V,H,N,k?.status,n]),(0,E.useEffect)(()=>{if(!D||!Z||!W||W!==k?.sourceHash)return;let e=`${D.id}:${W}:${JSON.stringify(Z)}`;J.current!==e&&(J.current=e,yt(!0),ge(D.id,W,Z).then(t=>{J.current===e&&vt(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),M(t instanceof Error?t.message:String(t)))}).finally(()=>{J.current===e&&yt(!1)}))},[Z,W,D,k?.sourceHash]);let Q=(0,E.useCallback)(async e=>{if(D){ot(!0),M(null);try{await Ct(D,e)}catch(e){M(e instanceof Error?e.message:String(e)),ot(!1)}}},[D,Ct]);(0,E.useLayoutEffect)(()=>(fe({startExtra:(0,O.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 local apps`,children:(0,O.jsx)(ie,{className:`size-4`})}),main:(0,O.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:D?.name||(n?`创建本地应用`:`Create local app`)}),end:D?(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,O.jsx)(je,{resource:{kind:`local_app`,id:D.id,revision:k?.sourceHash??``},disabled:A||P||F||!k?.sourceHash}),(0,O.jsx)(w,{asChild:!0,variant:`ghost`,className:`h-9`,children:(0,O.jsxs)(o,{to:`/projects/${encodeURIComponent(D.projectId)}`,children:[(0,O.jsx)(_e,{className:`size-4`}),`Project`]})}),(0,O.jsxs)(w,{className:`h-9`,onClick:()=>void Q(),disabled:P,children:[P?(0,O.jsx)(u,{className:`size-4 animate-spin`}):(0,O.jsx)(T,{className:`size-4`}),n?`继续开发`:`Continue building`]})]}):null}),()=>Se()),[D,A,P,F,k?.sourceHash,Se,Q,fe,n]);async function Tt(e){e.preventDefault(),j(!0),M(null);try{let e=await se({name:Je,idea:Xe});await l(`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{s(`/local-apps/${encodeURIComponent(e.id)}`,{replace:!0})}}catch(e){M(e instanceof Error?e.message:String(e))}finally{j(!1)}}async function Et(){if(D){j(!0),M(null);try{await Ge(await ue(D.id),{revalidate:!1}),await qe(),await Promise.all([l(`local-apps-list`),l(`gateway-extensions-list`)]),et(!1)}catch(e){M(e instanceof Error?e.message:String(e))}finally{j(!1)}}}async function Dt(e){j(!0),M(null);try{return await Ge(await e(),{revalidate:!1}),await qe(),await Promise.all([l(`local-apps-list`),l(`gateway-extensions-list`)]),!0}catch(e){return M(e instanceof Error?e.message:String(e)),!1}finally{j(!1)}}async function Ot(e){D&&await Dt(()=>ae(D.id,e))}async function kt(e){D&&await Dt(()=>we(D.id,e))}async function At(){D&&await Dt(()=>Ce(D.id))&&nt(!1)}async function jt(e){if(!(!D||!e.length)){M(null);try{await Q((await ye(D.id,{sourceHash:k?.sourceHash,locale:n?`zh`:`en`,diagnostics:e})).prompt)}catch(e){M(e instanceof Error?e.message:String(e))}}}function Mt(){jt([...k?.issues.map(e=>({phase:`build`,code:e.code,message:e.message}))??[],...R?[{phase:`runtime`,code:R.kind,message:be(R)}]:[],...Z?.checks.filter(e=>e.status===`failed`&&e.id!==`criteria`).map(e=>({phase:`acceptance`,code:e.id,message:e.message}))??[],...Object.values(B).filter(e=>e.status===`failed`).map(e=>({phase:e.failureKind===`runner`?`runner`:`acceptance`,code:e.id,message:`${e.name}: ${e.message}`})),...I===`timeout`?[{phase:`boot`,code:`boot_timeout`,message:`Preview did not report ready within 7 seconds.`}]:[]])}function Nt(){dt(`all`),U(0),pt(e=>e+1)}function Pt(e){dt(e),U(0),pt(e=>e+1)}function Ft(e,t){jt([{phase:t.failureKind===`runner`?`runner`:`acceptance`,code:e.id,message:`${e.name}: ${t.message}`}])}let It=_t.findIndex(e=>We(e,W,Z)),$=It>=0?_t[It]:null,Lt=It>=0?_t[It+1]??null:_t[0]??null,Rt=Ae(Z),zt=Lt?Lt.checks.filter(e=>e.status===`failed`).map(e=>e.message):[],Bt=k?.status===`failed`||I===`failed`||I===`timeout`||Z?.status===`failed`||Object.values(B).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!==W){q.current=e.sourceHash??null,U(0),rt(e=>e+1);return}e?.status===`healthy`&&I===`healthy`&&Z?.status===`passed`&&$&&$.sourceHash===e.sourceHash&&et(!0)}return t?(0,O.jsx)(`div`,{className:`flex min-h-0 flex-1 bg-surface-panel p-3 sm:p-5 xl:p-6`,children:(0,O.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,O.jsxs)(`form`,{onSubmit:Tt,className:`flex flex-col border-b border-edge-subtle p-5 lg:border-b-0 lg:border-r`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.14em] text-accent`,children:[(0,O.jsx)(de,{className:`size-4`}),n?`告诉 Coder 你的想法`:`Tell Coder your idea`]}),(0,O.jsx)(`h2`,{className:`mt-4 text-xl font-semibold tracking-tight text-fg`,children:n?`你想创建什么?`:`What do you want to create?`}),(0,O.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,O.jsxs)(`label`,{className:`mt-6 text-xs font-medium text-fg-muted`,children:[n?`应用名称`:`App name`,(0,O.jsx)(Ne,{value:Je,onChange:e=>Ye(e.target.value),suggestion:Pe(n?`例如:阅读清单`:`e.g. Reading list`),onAcceptSuggestion:Ye,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,O.jsxs)(`label`,{className:`mt-4 text-xs font-medium text-fg-muted`,children:[n?`描述你的想法`:`Describe your idea`,(0,O.jsx)(Me,{value:Xe,onChange:e=>Ze(e.target.value),suggestion:Pe(n?`我想要一个可以记录待读文章、标记进度并按主题筛选的小工具…`:`I want a small tool that tracks articles, reading progress, and topics…`),onAcceptSuggestion:Ze,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…`})]}),Qe?(0,O.jsx)(`p`,{className:`mt-3 text-sm text-danger`,role:`alert`,children:Qe}):null,(0,O.jsxs)(w,{type:`submit`,variant:`primary`,className:`mt-5 h-10`,disabled:A||!Je.trim()||!Xe.trim(),children:[A?(0,O.jsx)(u,{className:`size-4 animate-spin`}):(0,O.jsx)(T,{className:`size-4`}),n?`进入 Coder 对话`:`Continue with Coder`]})]}),(0,O.jsx)(`div`,{className:`hidden min-h-[620px] place-items-center bg-surface-panel p-8 lg:grid`,children:(0,O.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,O.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,O.jsx)(Ee,{className:`size-7`})}),(0,O.jsx)(`h3`,{className:`mt-5 text-base font-semibold text-fg`,children:n?`创建后,这里就是实时预览`:`Your live preview appears here`}),(0,O.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.`})]})})]})}):Le?(0,O.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,O.jsx)(re,{className:`rounded-xl`}),(0,O.jsx)(re,{className:`rounded-xl`}),(0,O.jsx)(re,{className:`rounded-xl`})]}):Be||!D?(0,O.jsx)(`div`,{className:`m-6 rounded-xl border border-danger/30 bg-danger-soft p-4 text-sm text-danger`,children:Be instanceof Error?Be.message:n?`找不到应用`:`App not found`}):(0,O.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,O.jsxs)(`aside`,{className:`min-h-0 overflow-y-auto rounded-xl border border-edge-subtle bg-surface-base p-4 shadow-surface`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.12em] text-accent`,children:[(0,O.jsx)(de,{className:`size-4`}),n?`创作对话`:`Build conversation`]}),(0,O.jsx)(`div`,{className:`mt-4 rounded-xl bg-surface-panel p-3 text-sm leading-6 text-fg`,children:D.idea}),(0,O.jsxs)(`div`,{className:`mt-4 rounded-xl bg-accent-soft p-3`,children:[(0,O.jsxs)(`p`,{className:`flex items-center gap-2 text-sm font-medium text-accent-fg`,children:[(0,O.jsx)(ee,{className:`size-4`}),n?`草稿已准备好`:`Draft is ready`]}),(0,O.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,O.jsxs)(`form`,{className:`mt-5`,onSubmit:e=>{e.preventDefault(),Q(it)},children:[(0,O.jsx)(`label`,{className:`text-xs font-medium text-fg-muted`,htmlFor:`local-app-change-request`,children:n?`下一步想改什么?`:`What should change next?`}),(0,O.jsx)(Me,{id:`local-app-change-request`,value:it,onChange:e=>at(e.target.value),suggestion:Pe(n?`例如:增加月视图,并支持按标签筛选`:`e.g. Add a monthly view and tag filters`),onAcceptSuggestion:at,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,O.jsxs)(w,{type:`submit`,className:`mt-2 w-full`,disabled:P||!it.trim(),children:[P?(0,O.jsx)(u,{className:`size-4 animate-spin`}):(0,O.jsx)(T,{className:`size-4`}),n?`让 Coder 修改`:`Ask Coder to update`]})]}),(0,O.jsxs)(w,{variant:`ghost`,className:`mt-2 w-full`,onClick:()=>void Q(),disabled:P,children:[(0,O.jsx)(_e,{className:`size-4`}),n?`打开已有开发对话`:`Open development chat`]})]}),(0,O.jsxs)(`section`,{className:`flex min-h-0 flex-col overflow-hidden rounded-xl border border-edge-subtle bg-surface-base shadow-surface`,children:[(0,O.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center justify-between border-b border-edge-subtle px-3`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-medium text-fg-muted`,children:[(0,O.jsx)(`span`,{className:`size-2 rounded-full ${k?.status===`failed`||I===`failed`||I===`timeout`||Z?.status===`failed`?`bg-danger`:k?.status===`healthy`&&I===`healthy`&&Z?.status===`passed`&&$?.sourceHash===k.sourceHash&&!G?`bg-success`:`bg-fg-subtle`}`}),I===`failed`||I===`timeout`?n?`预览运行异常`:`Preview runtime issue`:k?.status===`failed`||Z?.status===`failed`?n?`自动验收未通过`:`Acceptance needs attention`:I===`booting`||!Z?n?`自动验收中`:`Running acceptance`:G||$?.sourceHash!==k?.sourceHash?n?`正在保存验收快照`:`Saving acceptance snapshot`:n?`草稿已通过验收`:`Draft accepted`]}),(0,O.jsxs)(w,{variant:`ghost`,className:`h-8 px-2`,onClick:()=>void wt(!0),disabled:F,children:[F?(0,O.jsx)(u,{className:`size-3.5 animate-spin`}):(0,O.jsx)(De,{className:`size-3.5`}),n?`重新验收`:`Run again`]})]}),(0,O.jsx)(`iframe`,{ref:xt,title:`${D.name} preview`,src:m(D.draftPreviewUrl),sandbox:He,className:`min-h-0 w-full flex-1 bg-white`,onError:()=>{ct({kind:`script_error`,message:`Preview document failed to load`}),L(`failed`)}},N),k?.status===`healthy`&&k.acceptanceScenarioCount>0?(0,O.jsx)(`iframe`,{ref:St,title:`${D.name} acceptance runner`,src:`${m(D.draftPreviewUrl)}?xopcAcceptance=1&xopcScenario=${encodeURIComponent(V===`all`?Y[H]?.id??``:V)}`,sandbox:He,"aria-hidden":`true`,tabIndex:-1,className:`pointer-events-none fixed left-[-200vw] top-0 h-[720px] w-[1024px] opacity-0`},`criteria-${N}-${ft}-${H}`):null]}),(0,O.jsxs)(`aside`,{className:`min-h-0 overflow-y-auto rounded-xl border border-edge-subtle bg-surface-base p-4 shadow-surface`,children:[(0,O.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n?`发布状态`:`Release status`}),(0,O.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:D.installationState===`not_installed`?n?`尚未安装`:`Not installed`:D.enabled?n?`版本 ${D.activeVersion} 正在使用`:`Version ${D.activeVersion} is active`:n?`已禁用,版本仍保留`:`Disabled, release retained`})]}),(0,O.jsx)(`span`,{className:`mt-1 size-2.5 rounded-full ${D.enabled?`bg-success`:`bg-fg-subtle`}`,"aria-hidden":!0})]}),(0,O.jsxs)(`dl`,{className:`mt-4 grid grid-cols-2 gap-3 text-xs`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`当前草稿`:`Draft`}),(0,O.jsxs)(`dd`,{className:`mt-1 font-medium text-fg`,children:[`v`,D.draftVersion]})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`已安装`:`Installed`}),(0,O.jsx)(`dd`,{className:`mt-1 font-medium text-fg`,children:D.activeVersion?`v${D.activeVersion}`:`—`})]})]}),(0,O.jsxs)(`div`,{className:`mt-5 border-t border-edge-subtle pt-4`,children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,O.jsxs)(`h3`,{className:`flex items-center gap-2 text-xs font-semibold text-fg`,children:[(0,O.jsx)(Fe,{className:`size-4 text-accent`}),n?`草稿检查`:`Draft checks`]}),Ke||F?(0,O.jsx)(u,{className:`size-3.5 animate-spin text-fg-muted`}):k?.status===`healthy`?(0,O.jsx)(ee,{className:`size-4 text-success`}):(0,O.jsx)(ce,{className:`size-4 text-danger`})]}),k?(0,O.jsxs)(`div`,{className:`mt-2`,children:[(0,O.jsx)(`p`,{className:`text-xs leading-5 ${k.status===`healthy`?`text-fg-muted`:`text-danger`}`,children:k.status===`healthy`?k.hasDraftChanges?n?`${k.changedFileCount} 个文件有改动,可以安装新版本。`:`${k.changedFileCount} changed files are ready for a new release.`:n?`草稿与当前安装版本一致。`:`Draft matches the installed release.`:k.issues[0]?.message}),k.changedFiles.length?(0,O.jsx)(`ul`,{className:`mt-2 space-y-1`,children:k.changedFiles.slice(0,4).map(e=>(0,O.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2 text-[11px] text-fg-muted`,children:[(0,O.jsx)(`span`,{className:`w-4 shrink-0 font-medium text-fg-subtle`,children:e.status===`added`?`+`:e.status===`deleted`?`−`:`•`}),(0,O.jsx)(`span`,{className:`truncate font-mono`,children:e.path})]},e.path))}):null,k.changedFileCount>4?(0,O.jsx)(`p`,{className:`mt-1 text-[10px] text-fg-subtle`,children:n?`还有 ${k.changedFileCount-4} 个文件`:`${k.changedFileCount-4} more files`}):null,(0,O.jsxs)(`div`,{className:`mt-3 border-t border-edge-subtle pt-3`,children:[(0,O.jsxs)(`p`,{className:`flex items-center gap-2 text-xs font-medium text-fg`,children:[(0,O.jsx)(`span`,{className:`size-2 rounded-full ${I===`healthy`?`bg-success`:I===`booting`?`bg-fg-subtle`:`bg-danger`}`}),n?`预览运行`:`Preview runtime`]}),(0,O.jsx)(`p`,{className:`mt-1 text-xs leading-5 ${I===`failed`||I===`timeout`?`text-danger`:`text-fg-muted`}`,children:R?be(R):I===`healthy`?n?`已成功启动,未发现未捕获异常。`:`Started successfully with no uncaught errors.`:I===`timeout`?n?`7 秒内未完成启动,可能出现白屏或阻塞。`:`Did not finish booting within 7 seconds.`:n?`正在等待应用启动。`:`Waiting for the app to start.`})]}),(0,O.jsxs)(`div`,{className:`mt-3 border-t border-edge-subtle pt-3`,children:[(0,O.jsxs)(`p`,{className:`flex items-center gap-2 text-xs font-medium text-fg`,children:[(0,O.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,O.jsx)(`ul`,{className:`mt-2 space-y-1.5`,children:Z.checks.map(e=>(0,O.jsxs)(`li`,{className:`flex items-start gap-2 text-[11px] leading-4 ${e.status===`failed`?`text-danger`:`text-fg-muted`}`,children:[(0,O.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,O.jsx)(`span`,{children:e.message})]},e.id))}):(0,O.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:k?.acceptanceScenarioCount?n?`正在检查页面基础质量和 ${k.acceptanceScenarioCount} 个产品场景。`:`Checking page quality and ${k.acceptanceScenarioCount} product scenario(s).`:n?`正在检查页面内容和基础交互。`:`Checking rendered content and basic interaction.`}),G?(0,O.jsxs)(`p`,{className:`mt-2 flex items-center gap-2 text-[11px] text-fg-muted`,children:[(0,O.jsx)(u,{className:`size-3 animate-spin`}),n?`正在保存当前源码对应的验收快照…`:`Saving the acceptance snapshot for this source…`]}):$?(0,O.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,O.jsx)(Ve,{scenarios:Y,results:B,runningTarget:mt,zh:n,onRunAll:Nt,onRunScenario:Pt,onAskCoder:Ft})]}),Bt?(0,O.jsxs)(w,{className:`mt-3 w-full`,onClick:Mt,disabled:P,children:[(0,O.jsx)(T,{className:`size-4`}),n?`让 Coder 修复`:`Ask Coder to fix`]}):null]}):(0,O.jsx)(re,{className:`mt-2 h-12 rounded-lg`})]}),(0,O.jsxs)(`div`,{className:`mt-5 border-t border-edge-subtle pt-4`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold text-fg`,children:[(0,O.jsx)(oe,{className:`size-4 text-accent`}),n?`权限`:`Permissions`]}),(0,O.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:(k?.permissions??D.permissions).map(e=>(0,O.jsx)(`span`,{className:`rounded-md bg-surface-hover px-2 py-1 text-[11px] text-fg-muted`,children:e},e))})]}),(0,O.jsx)(w,{variant:`primary`,className:`mt-5 w-full`,onClick:()=>void Ht(),disabled:A||Ke||F||G||k?.status===`failed`||I!==`healthy`||Z?.status!==`passed`||!$||$.sourceHash!==k?.sourceHash||D.installationState===`installed`&&k?.hasDraftChanges===!1,children:D.installationState===`installed`?n?`安装当前更新`:`Install current update`:n?`添加到左侧导航`:`Add to sidebar`}),D.installationState===`installed`?(0,O.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,O.jsxs)(w,{className:`min-w-0 flex-1`,onClick:()=>void Ot(!D.enabled),disabled:A,children:[D.enabled?(0,O.jsx)(Ie,{className:`size-4`}):(0,O.jsx)(d,{className:`size-4`}),D.enabled?n?`禁用`:`Disable`:n?`启用`:`Enable`]}),(0,O.jsx)(w,{variant:`ghost`,className:`text-danger hover:text-danger`,onClick:()=>nt(!0),disabled:A,"aria-label":n?`卸载应用`:`Uninstall app`,children:(0,O.jsx)(he,{className:`size-4`})})]}):null,(0,O.jsxs)(`div`,{className:`mt-6 border-t border-edge-subtle pt-4`,children:[(0,O.jsxs)(`h3`,{className:`flex items-center gap-2 text-xs font-semibold text-fg`,children:[(0,O.jsx)(Oe,{className:`size-4`}),n?`版本历史`:`Release history`]}),D.releases.length?(0,O.jsx)(`ul`,{className:`mt-2 divide-y divide-edge-subtle`,children:D.releases.map(e=>(0,O.jsxs)(`li`,{className:`flex items-center justify-between gap-3 py-2.5`,children:[(0,O.jsxs)(`div`,{className:`min-w-0`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium text-fg`,children:[`v`,e.version,e.isActive?(0,O.jsx)(`span`,{className:`rounded-full bg-success-soft px-1.5 py-0.5 text-[10px] text-success`,children:n?`当前`:`Active`}):null]}),(0,O.jsx)(`p`,{className:`mt-0.5 truncate text-[10px] text-fg-subtle`,children:Ue(e.createdAt,r)})]}),e.isActive?null:(0,O.jsxs)(w,{variant:`ghost`,className:`h-7 px-2 text-xs`,onClick:()=>void kt(e.id),disabled:A,children:[(0,O.jsx)(pe,{className:`size-3.5`}),n?`恢复`:`Restore`]})]},e.id))}):(0,O.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:n?`安装首个版本后,可以从这里恢复。`:`Install the first version to enable recovery.`})]}),Qe?(0,O.jsx)(`p`,{className:`mt-3 text-xs leading-5 text-danger`,role:`alert`,children:Qe}):null]}),(0,O.jsx)(x,{open:$e,onOpenChange:et,children:(0,O.jsxs)(v,{children:[(0,O.jsx)(h,{className:`xopc-dialog-overlay fixed inset-0 z-50 bg-scrim backdrop-blur-[2px]`}),(0,O.jsxs)(y,{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,O.jsxs)(`div`,{className:`flex items-start justify-between border-b border-edge-subtle p-5`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(b,{className:`text-base font-semibold text-fg`,children:n?`确认安装到 XOPC`:`Confirm installation`}),(0,O.jsx)(g,{className:`mt-1 text-sm text-fg-muted`,children:n?`当前草稿会成为左侧导航中的可用版本。`:`The current draft will become the version available in the sidebar.`})]}),(0,O.jsx)(_,{className:`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover`,children:(0,O.jsx)(f,{className:`size-4`})})]}),(0,O.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[(0,O.jsxs)(`div`,{className:`rounded-xl border border-edge-subtle bg-surface-panel p-4`,children:[(0,O.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:D.name}),(0,O.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:D.extensionId})]}),(0,O.jsx)(`h4`,{className:`mt-5 text-xs font-semibold text-fg`,children:n?`本次迭代`:`This iteration`}),(0,O.jsxs)(`dl`,{className:`mt-2 grid grid-cols-2 gap-3 text-xs`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`文件变化`:`Changed files`}),(0,O.jsx)(`dd`,{className:`mt-1 font-medium text-fg`,children:k?.changedFileCount??0})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`自动验收`:`Acceptance`}),(0,O.jsxs)(`dd`,{className:`mt-1 flex items-center gap-1.5 font-medium text-success`,children:[(0,O.jsx)(ee,{className:`size-3.5`}),n?`已通过并保存`:`Passed and saved`]})]})]}),k?.changedFiles.length?(0,O.jsx)(`ul`,{className:`mt-3 space-y-1`,children:k.changedFiles.slice(0,5).map(e=>(0,O.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2 text-[11px] text-fg-muted`,children:[(0,O.jsx)(`span`,{className:`w-4 shrink-0 font-medium text-fg-subtle`,children:e.status===`added`?`+`:e.status===`deleted`?`−`:`•`}),(0,O.jsx)(`span`,{className:`truncate font-mono`,children:e.path})]},e.path))}):null,(0,O.jsx)(`h4`,{className:`mt-5 text-xs font-semibold text-fg`,children:n?`请求权限`:`Requested permissions`}),(0,O.jsx)(`ul`,{className:`mt-2 space-y-2`,children:(k?.permissions??D.permissions).map(e=>(0,O.jsxs)(`li`,{className:`flex items-center gap-2 text-sm text-fg`,children:[(0,O.jsx)(c,{className:`size-4 text-success`}),e,D.installationState===`installed`&&k?.permissionDelta.added.includes(e)?(0,O.jsx)(`span`,{className:`rounded-full bg-warning-soft px-2 py-0.5 text-[10px] text-warning`,children:n?`新增`:`New`}):null]},e))}),D.installationState===`installed`&&k?.permissionDelta.added.length?(0,O.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,O.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,O.jsxs)(`div`,{className:`flex justify-end gap-2 border-t border-edge-subtle p-4`,children:[(0,O.jsx)(_,{asChild:!0,children:(0,O.jsx)(w,{children:n?`取消`:`Cancel`})}),(0,O.jsxs)(w,{variant:`primary`,onClick:()=>void Et(),disabled:A,children:[A?(0,O.jsx)(u,{className:`size-4 animate-spin`}):(0,O.jsx)(te,{className:`size-4`}),n?`确认安装`:`Install`]})]})]})]})}),(0,O.jsx)(x,{open:tt,onOpenChange:nt,children:(0,O.jsxs)(v,{children:[(0,O.jsx)(h,{className:`xopc-dialog-overlay fixed inset-0 z-50 bg-scrim backdrop-blur-[2px]`}),(0,O.jsxs)(y,{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,O.jsxs)(`div`,{className:`flex items-start justify-between border-b border-edge-subtle p-5`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(b,{className:`text-base font-semibold text-fg`,children:n?`卸载当前应用?`:`Uninstall this app?`}),(0,O.jsx)(g,{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,O.jsx)(_,{className:`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover`,children:(0,O.jsx)(f,{className:`size-4`})})]}),(0,O.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:(0,O.jsxs)(`div`,{className:`rounded-xl bg-surface-panel p-4`,children:[(0,O.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:D.name}),(0,O.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n?`之后可从任意保留版本重新安装。`:`You can reinstall any retained release later.`})]})}),(0,O.jsxs)(`div`,{className:`flex justify-end gap-2 border-t border-edge-subtle p-4`,children:[(0,O.jsx)(_,{asChild:!0,children:(0,O.jsx)(w,{children:n?`取消`:`Cancel`})}),(0,O.jsxs)(w,{variant:`ghost`,className:`text-danger hover:bg-danger-soft hover:text-danger`,onClick:()=>void At(),disabled:A,children:[A?(0,O.jsx)(u,{className:`size-4 animate-spin`}):(0,O.jsx)(he,{className:`size-4`}),n?`卸载但保留 Project`:`Uninstall and keep Project`]})]})]})]})})]})}export{Ge as LocalAppWorkbenchPage};
|
|
@@ -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{t as i}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as a}from"./box-DvYoGszj.js";import{t as o}from"./plus-Q2yW6OE7.js";import{n as s}from"./locale-store-BSkKhYkc.js";import{i as c}from"./vendor-swr-BIWyz7Rc.js";import{t as l}from"./button-CS04eWY9.js";import{t as u}from"./skeleton-BwbyijEw.js";import{Dr as d,Eo as f,Ql as p}from"./index-Cr4SINLG.js";var m=n(),h=e(t(),1),g=r();function _(){let e=(0,m.c)(20),t=s(x)===`zh`,n=f(b),r=f(y),{data:u,isLoading:_,error:S}=c(`local-apps-list`,d),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 Workshop`}),end:(0,g.jsx)(l,{asChild:!0,variant:`primary`,className:`h-9`,children:(0,g.jsxs)(i,{to:`/local-apps/new`,children:[(0,g.jsx)(o,{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`:`Put your own tools inside 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?`每个应用都会自动创建一个由 Coder 负责的 Project,可预览、安装到侧栏,并持续迭代。`:`Every app gets a Coder-owned Project for previewing, installing in the sidebar, and ongoing iteration.`,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]!==u||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)}):u?.length?(0,g.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:u.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)(a,{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?`打开工作台`:`Open workbench`,(0,g.jsx)(p,{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)(a,{className:`mx-auto size-8 text-fg-subtle`}),(0,g.jsx)(`h3`,{className:`mt-4 text-sm font-semibold text-fg`,children:t?`还没有本地应用`:`No local 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)(l,{asChild:!0,variant:`primary`,className:`mt-5`,children:(0,g.jsxs)(i,{to:`/local-apps/new`,children:[(0,g.jsx)(o,{className:`size-4`}),t?`创建第一个应用`:`Create your first app`]})})]}),e[12]=u,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 py-8 sm:px-5 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)(u,{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};
|
package/dist/gateway/static/root/assets/{locale-store-BPZR8x9b.js → locale-store-BSkKhYkc.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./messages-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./messages-D0G_sZvA.js";var r=e(t(),1),i=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},a=(e=>e?i(e):i),o=e=>e;function s(e,t=o){let n=r.useSyncExternalStore(e.subscribe,r.useCallback(()=>t(e.getState()),[e,t]),r.useCallback(()=>t(e.getInitialState()),[e,t]));return r.useDebugValue(n),n}var c=e=>{let t=a(e),n=e=>s(t,e);return Object.assign(n,t),n},l=(e=>e?c(e):c);function u(e){let t=(e??``).trim().toLowerCase().replace(/_/g,`-`);return t&&(t===`zh`||t.startsWith(`zh-`))?`zh`:`en`}function d(){if(typeof navigator>`u`)return`en`;let e=(navigator.language||navigator.languages?.[0]||``).trim();return e?u(e):`en`}function f(e){return e===`zh`?`zh-CN`:`en`}function p(e){document.documentElement.setAttribute(`lang`,f(e)),document.title=n(e).appTitle}function m(){return K.getState().language}function h(e,t,n){let r=e.trim().toLowerCase();return!!(!r||r===`http ${t}`||n&&r===n.trim().toLowerCase()||t===429&&(r===`rate_limited`||r===`too many requests`||r===`too many authentication attempts`)||t===500&&r===`internal server error`)}function g(e,t,r){let i=r?.trim()??``;if(i&&!h(i,e,t))return i;let a=n(m()).api;return e>=500?e===502?a.errorBadGateway:e===503?a.errorServiceUnavailable:e===504?a.errorGatewayTimeout:e===500?a.errorInternal:a.errorServer.replace(`{{status}}`,String(e)):e===404?a.errorNotFound:e===403?a.errorForbidden:e===429?a.errorRateLimited:a.errorRequest.replace(`{{status}}`,String(e))}var _=`xopc.token`,v=`xopc.language`;function y(){try{return localStorage.getItem(_)||``}catch{return``}}function b(){try{localStorage.removeItem(_)}catch{}}function x(){return S()||d()}function S(){try{let e=localStorage.getItem(v);return e===`en`||e===`zh`?e:null}catch{return null}}function C(e){try{localStorage.setItem(v,e)}catch(e){console.error(`Failed to save language:`,e)}}var w=l(e=>({baseUrl:typeof window<`u`?window.location.origin:``,conversationId:void 0,tokenDialogOpen:!1,tokenExpired:!1,setBrowserSession:t=>{b(),e({conversationId:t,tokenDialogOpen:!1,tokenExpired:!1}),window.dispatchEvent(new CustomEvent(`gateway-authenticated`))},clearBrowserSession:()=>{fetch(`/api/browser-session`,{method:`DELETE`,credentials:`same-origin`,redirect:`error`,signal:AbortSignal.timeout(8e3)}).catch(()=>{}),e({conversationId:void 0})},openTokenDialog:()=>e({tokenDialogOpen:!0}),closeTokenDialog:()=>e({tokenDialogOpen:!1}),onUnauthorized:()=>{e({conversationId:void 0,tokenDialogOpen:!1,tokenExpired:!0}),window.dispatchEvent(new CustomEvent(`gateway-auth-expired`))}}));async function T(e){return fetch(`/api/browser-session`,{method:`POST`,credentials:`same-origin`,redirect:`error`,signal:AbortSignal.timeout(8e3),headers:{Authorization:`Bearer ${e}`}})}async function E(){try{let e=await fetch(`/api/browser-session`,{credentials:`same-origin`,redirect:`error`,signal:AbortSignal.timeout(8e3)});if(e.ok){let t=await e.json();if(t.conversationId){w.getState().setBrowserSession(t.conversationId);return}}if(e.status!==401)return;let t=window.electronAPI?.gateway?.getCredential,n=typeof t==`function`?await t():y();if(!n)return;let r=await T(n);if(!r.ok)return;let i=await r.json();i.conversationId&&w.getState().setBrowserSession(i.conversationId)}catch{}}var D=null,O=null;function k(){D||=new Promise(e=>{O=e})}function A(){D&&(O?.(),D=null,O=null)}typeof window<`u`&&window.addEventListener(`gateway-authenticated`,A);async function j(e,t){D&&await D;let n=new Headers(t?.headers),r=t?.body,i=typeof FormData<`u`&&r instanceof FormData;!n.has(`Content-Type`)&&!i&&n.set(`Content-Type`,`application/json`);let a=await fetch(e,{...t,credentials:`same-origin`,redirect:`error`,headers:n});return a.status===401&&(k(),w.getState().onUnauthorized()),a}async function M(e,t){let n=await j(e,t);if(!n.ok){let e=await n.json().catch(()=>({})),t=typeof e.error==`string`?e.error:e.error?.message,r=g(n.status,n.statusText,t),i=n.headers.get(`Retry-After`),a=i==null?NaN:Number(i);throw Object.assign(Error(r),{status:n.status,body:e,...Number.isFinite(a)&&a>=0?{retryAfterMs:a*1e3}:{}})}return n.json()}function N(){return window.location.origin}function P(e){let t=e.startsWith(`/`)?e:`/${e}`;return`${N()}${t}`}var F,I,L,R;function z(e){return e===`en`||e===`zh`}function B(e){C(e),p(e)}function V(e){window.electronAPI?.locale?.setLanguage(e).catch(()=>{})}function H(e,t){return e?.token===t.token&&e.language===t.language}async function U(){for(;I;){let e=I;I=void 0,F=e,(await Promise.allSettled([M(P(`/api/voice/language`),{method:`POST`,body:JSON.stringify({language:e.language})}),M(P(`/api/user-model/assertions`),{method:`POST`,body:JSON.stringify({scope:{type:`global`},subject:{type:`user`,id:`self`},predicate:`preference.locale`,cardinality:`single`,kind:`preference`,value:e.language===`zh`?`zh-CN`:`en`,statement:e.language===`zh`?`The user prefers Chinese.`:`The user prefers English.`,volatility:`slow`,declaredImportance:.8})})])).every(e=>e.status===`fulfilled`)&&(L=e),F=void 0}}function W(){R||=U().finally(()=>{R=void 0,I&&W()})}function G(e){let t=w.getState().conversationId;if(!t)return;let n={token:t,language:e};if(H(F,n)){I=void 0;return}H(I,n)||!F&&H(L,n)||(I=n,W())}var K=l(e=>({language:x(),setLanguage:t=>{B(t),e({language:t}),V(t),G(t)}}));function q(){G(K.getState().language);let e=w.subscribe((e,t)=>{e.conversationId&&e.conversationId!==t.conversationId&&G(K.getState().language)}),t=window.electronAPI?.locale;if(!t)return e;let n=!1,r=S();r?V(r):t.getLanguage().then(e=>{n||!z(e)||(B(e),K.setState({language:e}),G(e))});let i=t.onChanged(e=>{n||!z(e)||(B(e),K.setState({language:e}),G(e))});return()=>{n=!0,i(),e()}}export{M as a,w as c,p as d,f,j as i,x as l,K as n,T as o,l as p,P as r,E as s,q as t,g as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-DPHK1VkS.js";var t=e(`lock-keyhole`,[[`circle`,{cx:`12`,cy:`16`,r:`1`,key:`1au0dj`}],[`rect`,{x:`3`,y:`10`,width:`18`,height:`12`,rx:`2`,key:`6s8ecr`}],[`path`,{d:`M7 10V7a5 5 0 0 1 10 0v3`,key:`1pqi11`}]]);export{t};
|
|
@@ -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{t as a}from"./createLucideIcon-DPHK1VkS.js";import{n as o,r as s}from"./popover-select-DcsFzD_i.js";import{t as c}from"./download-Dk-ZjtO6.js";import{t as l}from"./gauge-C78eD2BA.js";import{t as u}from"./search-DA7gz22f.js";import{t as d}from"./x-B_N4OPjy.js";import{t as f}from"./messages-D0G_sZvA.js";import{t as p}from"./cn-JdwAhgNB.js";import{a as m,c as h,n as g,r as _}from"./locale-store-BSkKhYkc.js";import{a as v,n as y,o as b,r as x,s as S,t as C}from"./dist-BGTk37IG.js";import{t as w}from"./copy-to-clipboard-HOJ79TWv.js";import{t as T}from"./button-CS04eWY9.js";import{a as E,i as D,o as O,r as k}from"./dist-3h6cXXhT.js";import{t as A}from"./skeleton-BwbyijEw.js";import{i as j,o as M,s as N}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{Ia as P,Kt as F,Oa as I,Pl as L,Qo as R,Tl as z,Wl as B,Xo as ee,bl as V,jc as H,no as U,qc as W}from"./index-Cr4SINLG.js";import{r as te}from"./settings-page-layout-X1x-2Cp9.js";var G=a(`list-filter`,[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]),K=e(t(),1),q=n();function J(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 Y(e){return m(_(`/api/logs${J(e)}`))}async function X(){return(await m(_(`/api/logs/files`))).files??[]}async function Z(){return(await m(_(`/api/logs/modules`))).modules??[]}async function Q(){let e=await m(_(`/api/logs/stats`));return{byLevel:e.byLevel??{},runtime:e.runtime}}async function ne(){return(await m(_(`/api/logs/dir`))).dir??``}async function re(){return(await m(_(`/api/logs/level`))).level??`info`}async function ie(e,t){return m(_(`/api/logs/level`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({level:e,...t==null?{}:{duration:String(t)}})})}async function ae(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 m(_(`/api/logs/errors/summary${n?`?${n}`:``}`))).items??[]}var oe=500,se=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=P(`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 ce(e,t){let n=`${t.timestamp}-${t.requestId??``}-${t.message}`;return[t,...e.filter(e=>`${e.timestamp}-${e.requestId??``}-${e.message}`!==n)].slice(0,oe)}var le=[`trace`,`debug`,`info`,`warn`,`error`,`fatal`];function ue(e){let t=new Date(String(e.timestamp)).getTime();return Number.isFinite(t)?t:0}function de(e){return e.toSorted((e,t)=>ue(t)-ue(e))}var fe=new Set(le),pe=[`error`,`fatal`],me=[`warn`,`error`,`fatal`],he=[`info`,`warn`,`error`,`fatal`];function ge(e){if(!e)return new Set;let t=new Set;for(let n of e.split(`,`)){let e=n.trim();fe.has(e)&&t.add(e)}return t}function _e(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function ve(e,t){return e.size===t.length?t.every(t=>e.has(t)):!1}function ye(e){return e.size===0?`all`:ve(e,pe)?`errors`:ve(e,me)?`warnPlus`:ve(e,he)?`infoPlus`:e.size===le.length&&le.every(t=>e.has(t))?`verbose`:`custom`}function be(e){let t=ye(e);return t===`custom`?`other`:t}function xe(e){switch(e){case`all`:return new Set;case`errors`:return new Set(pe);case`warnPlus`:return new Set(me);case`infoPlus`:return new Set(he);case`verbose`:return new Set(le)}}function Se(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>String(t[n]??``))}function Ce(e){return String(e.module||e.service||e.extension||`—`)}function we(e){if(typeof e.message==`string`&&e.message)return e.message;try{return JSON.stringify(e)}catch{return``}}function Te(e){try{return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}catch{return e}}function Ee(e){try{return new Date(e).toLocaleString()}catch{return e}}function De(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Oe(e){let t=e.trim();return t.length<=10?t:`${t.slice(0,8)}…`}function ke(e){return String(e).toLowerCase()}function Ae(e){let t=e.phase??e.meta?.phase;return typeof t==`string`&&t.trim()?t:`—`}function je(e){return`${e.timestamp}-${e.requestId??``}-${e.message}`}function Me(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 Ne(e,t){if(t.selectedLevels.size>0&&!t.selectedLevels.has(e.level)||t.moduleFilter&&Ce(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,Ce(e),Ae(e),e.requestId,e.conversationId,e.transcriptId,Me(e)?.message,Me(e)?.stack].filter(Boolean).map(String).join(` `).toLowerCase().includes(n))return!1}return!0}function Pe(e,t){let n=[];for(let r of le){let i=e[r]??0;i>0&&n.push(`${t[r]} ${i}`)}return n.join(` · `)}function Fe(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 _e(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&&_e(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 Ie={logs:[],loading:!1,error:null,hasMore:!1,modules:[],files:[],stats:null,logDir:null};function Le(e,t){switch(t.type){case`queryStart`:return{...e,loading:!0,error:null,logs:[]};case`querySuccess`:return{...e,loading:!1,logs:de(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:de([...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:de(t.logs),hasMore:t.hasMore,stats:t.stats};case`appendLiveEntry`:return{...e,logs:de(ce(e.logs,t.entry))};case`updateStats`:return{...e,stats:t.stats};case`refreshAllSuccess`:return{...e,loading:!1,logs:de(t.logs),hasMore:t.hasMore,stats:t.stats,files:t.files}}}function Re(e){let t=f(e).logs,n=h(e=>e.conversationId),r=!!n,[a,o]=i(),s=(0,K.useRef)(a),[c,l]=(0,K.useReducer)(Fe,void 0,()=>{let e=s.current,t=e.get(`q`)??``;return{searchInput:t,debouncedSearch:t.trim(),selectedLevels:ge(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`}}),[u,d]=(0,K.useReducer)(Le,Ie),[p,m]=(0,K.useState)(null),[g,_]=(0,K.useState)(!1),[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(null),[S,C]=(0,K.useState)([]),[w,T]=(0,K.useState)(!1),{searchInput:E,debouncedSearch:D,selectedLevels:O,moduleFilter:k,requestIdFilter:A,transcriptIdFilter:j,dateFrom:M,dateTo:N,autoRefresh:P}=c,{logs:F,loading:I,error:L,hasMore:R,modules:z,files:B,stats:ee,logDir:V}=u,H=(0,K.useCallback)(e=>l({type:`setSearchInput`,value:e}),[]),W=(0,K.useCallback)(e=>l({type:`setLevels`,value:e}),[]),te=(0,K.useCallback)(e=>l({type:`setModule`,value:e}),[]),G=(0,K.useCallback)(e=>l({type:`setRequestIdFilter`,value:e}),[]),q=(0,K.useCallback)(e=>l({type:`setTranscriptIdFilter`,value:e}),[]),J=(0,K.useCallback)(e=>l({type:`setDateFrom`,value:e}),[]),re=(0,K.useCallback)(e=>l({type:`setDateTo`,value:e}),[]),ie=(0,K.useCallback)(e=>l({type:`setAutoRefresh`,value:e}),[]),oe=(0,K.useMemo)(()=>be(O),[O]),ce=e=>{if(e===`other`){y(!0);return}l({type:`setLevels`,value:xe(e)})},le=D.length>0||O.size>0||!!k||!!A||!!j||!!M||!!N,ue=+(D.length>0)+ +(O.size>0)+ +!!k+ +!!A+ +!!j+(M||N?1:0);(0,K.useEffect)(()=>{let e=setTimeout(()=>l({type:`setDebouncedSearch`,value:E.trim()}),300);return()=>clearTimeout(e)},[E]),(0,K.useEffect)(()=>{let e=a.get(`q`)??``;l({type:`syncFromUrl`,payload:{searchInput:e,debouncedSearch:e.trim(),selectedLevels:ge(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,K.useEffect)(()=>{let e=new URLSearchParams(a),t=D.trim();t?e.set(`q`,t):e.delete(`q`),O.size>0?e.set(`level`,Array.from(O).sort().join(`,`)):e.delete(`level`),k?e.set(`module`,k):e.delete(`module`),A?e.set(`requestId`,A):e.delete(`requestId`),j?e.set(`transcriptId`,j):e.delete(`transcriptId`),M?e.set(`from`,M):e.delete(`from`),N?e.set(`to`,N):e.delete(`to`),P?e.set(`live`,`1`):e.delete(`live`),e.toString()!==a.toString()&&o(e,{replace:!0})},[P,M,N,D,k,A,j,a,O,o]);let de=(0,K.useMemo)(()=>({q:D||void 0,level:O.size>0?Array.from(O):void 0,module:k||void 0,requestId:A||void 0,transcriptId:j||void 0,from:M||void 0,to:N||void 0,limit:50}),[D,O,k,A,j,M,N]),fe=(0,K.useMemo)(()=>({debouncedSearch:D,selectedLevels:O,moduleFilter:k,requestIdFilter:A,transcriptIdFilter:j,dateFrom:M,dateTo:N}),[D,O,k,A,j,M,N]),pe=(0,K.useRef)(fe);return pe.current=fe,(0,K.useEffect)(()=>{if(!r)return;let e=!1;return T(!0),ae({from:M||void 0,to:N||void 0,limit:12}).then(t=>{e||C(t)}).catch(()=>{e||C([])}).finally(()=>{e||T(!1)}),()=>{e=!0}},[r,M,N]),(0,K.useEffect)(()=>{if(!r)return;let e=!1;return d({type:`queryStart`}),(async()=>{try{let t=await Y({...de,offset:0});if(e)return;d({type:`querySuccess`,logs:t.logs,hasMore:t.logs.length===50})}catch(n){e||d({type:`queryError`,message:n instanceof Error?n.message:t.loadError,resetLogs:!0})}})(),()=>{e=!0}},[r,de,t.loadError]),(0,K.useEffect)(()=>{if(!r)return;let e=!1;return(async()=>{try{let[t,n,r]=await Promise.all([Z(),Q(),X()]);e||d({type:`metaSuccess`,modules:t,stats:n,files:r})}catch{}})(),()=>{e=!0}},[r]),(0,K.useEffect)(()=>{if(!r||!g)return;let e=!1;return(async()=>{try{let[t,n]=await Promise.all([X(),ne()]);e||d({type:`filesSuccess`,files:t,logDir:n})}catch{e||d({type:`filesClear`})}})(),()=>{e=!0}},[r,g]),(0,K.useEffect)(()=>{if(!P||!r)return;let e=new se({onConnected:()=>{},onEntry:e=>{Ne(e,pe.current)&&d({type:`appendLiveEntry`,entry:e})},onError:()=>{}});e.connect(O.size>0?Array.from(O):void 0,k||void 0);let t=window.setInterval(()=>{Q().then(e=>{d({type:`updateStats`,stats:e})}).catch(()=>{})},3e4);return()=>{e.disconnect(),clearInterval(t)}},[P,r,n,O,k]),(0,K.useEffect)(()=>{if(!b)return;let e=window.setTimeout(()=>x(null),2e3);return()=>clearTimeout(e)},[b]),{L:t,hasToken:r,logs:F,loading:I,error:L,hasMore:R,searchInput:E,setSearchInput:H,selectedLevels:O,setSelectedLevels:W,moduleFilter:k,setModuleFilter:te,requestIdFilter:A,transcriptIdFilter:j,dateFrom:M,setDateFrom:J,dateTo:N,setDateTo:re,modules:z,files:B,stats:ee,selectedLog:p,setSelectedLog:m,filesOpen:g,setFilesOpen:_,filtersOpen:v,setFiltersOpen:y,logDir:V,autoRefresh:P,setAutoRefresh:ie,copiedDetail:b,setCopiedDetail:x,hasActiveFilters:le,activeFilterCount:ue,clearFilters:()=>l({type:`clearAll`}),toggleDialogLevel:e=>l({type:`toggleLevel`,level:e}),handleLoadMore:()=>{I||!R||(async()=>{d({type:`queryStart`});try{let e=await Y({...de,offset:F.length});d({type:`appendSuccess`,logs:e.logs,hasMore:e.logs.length===50})}catch(e){d({type:`queryError`,message:e instanceof Error?e.message:t.loadError})}})()},refreshAll:()=>{(async()=>{d({type:`queryStart`});try{let e=await Y({...de,offset:0}),[t,n]=await Promise.all([Q(),X()]);d({type:`refreshAllSuccess`,logs:e.logs,hasMore:e.logs.length===50,stats:t,files:n})}catch(e){d({type:`queryError`,message:e instanceof Error?e.message:t.loadError})}})()},levelSegment:oe,handleLevelSegment:ce,filterByRequestId:(0,K.useCallback)(e=>{m(null),G(e)},[G]),filterByTranscriptId:(0,K.useCallback)(e=>{m(null),q(e)},[q]),filterByErrorSummary:(0,K.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:xe(`errors`)})},[]),openChatForSession:(0,K.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&&U({transcriptId:n}).then(e=>{window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{conversationId:e.conversationId}}))}).catch(()=>{})},[]),errorSummary:S,errorSummaryLoading:w}}var $=r();function ze(e){let t=(0,q.c)(36),{L:n,items:r,loading:i,onSelectItem:a}=e,[o,s]=(0,K.useState)(!1);if(!i&&r.length===0)return null;let c;t[0]===r?c=t[1]:(c=r.reduce(Ve,0),t[0]=r,t[1]=c);let l=c,u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>s(Be),t[2]=u):u=t[2];let d;t[3]===n.errorSummaryTitle?d=t[4]:(d=(0,$.jsx)(`h2`,{className:`text-sm font-semibold tracking-tight text-fg`,children:n.errorSummaryTitle}),t[3]=n.errorSummaryTitle,t[4]=d);let f;t[5]===n.errorSummaryHint?f=t[6]:(f=(0,$.jsx)(`p`,{className:`mt-0.5 text-xs leading-5 text-fg-muted`,children:n.errorSummaryHint}),t[5]=n.errorSummaryHint,t[6]=f);let m;t[7]!==d||t[8]!==f?(m=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[d,f]}),t[7]=d,t[8]=f,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)(A,{className:`h-5 w-8 rounded-md`}),(0,$.jsx)(A,{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]:(_=p(`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:p(`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,`: `,Te(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 Be(e){return!e}function Ve(e,t){return e+t.count}function He(e){let t=(0,q.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:``,d;t[0]===n?d=t[1]:(d=Ae(n),t[0]=n,t[1]=d);let f=d,m;t[2]===n?m=t[3]:(m=Me(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=p(`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 w;t[17]===r.time?w=t[18]:(w=(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.time}),t[17]=r.time,t[18]=w);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=p(`text-fg`,O),t[23]=O,t[24]=k);let A;t[25]===s?A=t[26]:(A=ke(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=Ce(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]!==f?(F=f===`—`?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:f})]}),t[36]=r.phase,t[37]=f,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)(T,{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)(T,{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)(T,{type:`button`,variant:`secondary`,className:`h-7 px-2 text-[11px]`,onClick:()=>a(u),children:r.filterByTranscriptId}):null,o?(0,$.jsx)(T,{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]!==w||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:[w,E,D,j,M,P,F,I,L,R]}),t[56]=w,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 Ue(e){let t=(0,q.c)(50),{L:n,log:r,onClose:i,copiedDetail:a,onCopiedMessage:o,onCopiedJson:s,onFilterByRequestId:c,onFilterByTranscriptId:l,onOpenChat:u}=e,f=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)(v,{className:p(`xopc-dialog-overlay fixed inset-0 bg-scrim`,M)}),t[2]=h):h=t[2];let g;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(g=p(`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`,j,`dark:border-edge`),t[3]=g):g=t[3];let _;t[4]===n.details?_=t[5]:(_=(0,$.jsx)(S,{className:`text-base font-semibold tracking-tight text-fg`,children:n.details}),t[4]=n.details,t[5]=_);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)(T,{type:`button`,variant:`ghost`,className:`h-9 shrink-0 gap-1 px-2 text-xs`,onClick:()=>{w(typeof r.message==`string`?r.message:``).then(e=>{e&&o()})},children:[(0,$.jsx)(L,{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)(T,{type:`button`,variant:`ghost`,className:`h-9 shrink-0 gap-1 px-2 text-xs`,onClick:()=>{w(JSON.stringify(r,null,2)).then(e=>{e&&s()})},children:[(0,$.jsx)(L,{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)(d,{className:`size-5`,strokeWidth:1.75}),t[14]=D):D=t[14];let O;t[15]===n.close?O=t[16]:(O=(0,$.jsx)(y,{asChild:!0,children:(0,$.jsx)(T,{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[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:[_,k]}),t[20]=_,t[21]=k,t[22]=A):A=t[22];let N;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]!==l||t[39]!==u?(N=r?(0,$.jsx)(He,{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:l,onOpenChat:u}):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]=l,t[39]=u,t[40]=N):N=t[40];let P;t[41]===N?P=t[42]:(P=(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-4 font-mono text-sm leading-relaxed`,children:N}),t[41]=N,t[42]=P);let F;t[43]!==A||t[44]!==P?(F=(0,$.jsxs)(b,{children:[h,(0,$.jsxs)(x,{className:g,"aria-describedby":void 0,children:[A,P]})]}),t[43]=A,t[44]=P,t[45]=F):F=t[45];let I;return t[46]!==f||t[47]!==F||t[48]!==m?(I=(0,$.jsx)(C,{open:f,onOpenChange:m,children:F}),t[46]=f,t[47]=F,t[48]=m,t[49]=I):I=t[49],I}function We(e){let t=(0,q.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)(v,{className:p(`xopc-dialog-overlay fixed inset-0 bg-scrim`,M)}),t[0]=s):s=t[0];let c;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=p(`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`,j,`dark:border-edge`),t[1]=c):c=t[1];let l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(V,{className:`size-4 text-fg-muted`,strokeWidth:1.75}),t[2]=l):l=t[2];let u;t[3]===n.logFiles?u=t[4]:(u=(0,$.jsxs)(S,{className:`flex items-center gap-2 text-base font-semibold tracking-tight text-fg`,children:[l,n.logFiles]}),t[3]=n.logFiles,t[4]=u);let f;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(d,{className:`size-5`,strokeWidth:1.75}),t[5]=f):f=t[5];let m;t[6]===n.close?m=t[7]:(m=(0,$.jsx)(y,{asChild:!0,children:(0,$.jsx)(T,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":n.close,children:f})}),t[6]=n.close,t[7]=m);let h;t[8]!==u||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:[u,m]}),t[8]=u,t[9]=m,t[10]=h):h=t[10];let g;t[11]!==n.filesEmpty||t[12]!==a?(g=(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(Ge)})}),t[11]=n.filesEmpty,t[12]=a,t[13]=g):g=t[13];let _;t[14]!==n.logDir||t[15]!==o?(_=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]=_):_=t[16];let w;t[17]!==h||t[18]!==g||t[19]!==_?(w=(0,$.jsxs)(b,{children:[s,(0,$.jsxs)(x,{className:c,children:[h,g,_]})]}),t[17]=h,t[18]=g,t[19]=_,t[20]=w):w=t[20];let E;return t[21]!==i||t[22]!==r||t[23]!==w?(E=(0,$.jsx)(C,{open:r,onOpenChange:i,children:w}),t[21]=i,t[22]=r,t[23]=w,t[24]=E):E=t[24],E}function Ge(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:De(e.size)}),(0,$.jsx)(`span`,{children:Ee(e.modified)})]})]},e.name)}function Ke(e){let t=(0,q.c)(68),{L:n,open:r,onOpenChange:i,dateFrom:a,onDateFromChange:o,dateTo:s,onDateToChange:c,selectedLevels:l,onToggleLevel:u}=e,f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(v,{className:p(`xopc-dialog-overlay fixed inset-0 bg-scrim`,M)}),t[0]=f):f=t[0];let m;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(m=p(`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`,j,`dark:border-edge`),t[1]=m):m=t[1];let h;t[2]===n.filtersDialogTitle?h=t[3]:(h=(0,$.jsx)(S,{className:`text-base font-semibold tracking-tight text-fg`,children:n.filtersDialogTitle}),t[2]=n.filtersDialogTitle,t[3]=h);let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(d,{className:`size-5`,strokeWidth:1.75}),t[4]=g):g=t[4];let _;t[5]===n.close?_=t[6]:(_=(0,$.jsx)(y,{asChild:!0,children:(0,$.jsx)(T,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":n.close,children:g})}),t[5]=n.close,t[6]=_);let w;t[7]!==h||t[8]!==_?(w=(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,_]}),t[7]=h,t[8]=_,t[9]=w):w=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 N;t[21]!==A||t[22]!==O?(N=(0,$.jsxs)(`div`,{children:[O,A]}),t[21]=A,t[22]=O,t[23]=N):N=t[23];let P;t[24]===n.to?P=t[25]:(P=(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]=P);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]!==P||t[32]!==I?(L=(0,$.jsxs)(`div`,{children:[P,I]}),t[31]=P,t[32]=I,t[33]=L):L=t[33];let R;t[34]!==N||t[35]!==L?(R=(0,$.jsxs)(`div`,{className:`mt-2 flex flex-col gap-3`,children:[N,L]}),t[34]=N,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,V;t[41]!==n.levelNames||t[42]!==u||t[43]!==l?(V=le.map(e=>(0,$.jsx)(`button`,{type:`button`,className:p(`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`,l.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:()=>u(e),children:n.levelNames[e]},e)),t[41]=n.levelNames,t[42]=u,t[43]=l,t[44]=V):V=t[44];let H;t[45]!==n.level||t[46]!==V?(H=(0,$.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,role:`group`,"aria-label":ee,children:V}),t[45]=n.level,t[46]=V,t[47]=H):H=t[47];let U;t[48]!==R||t[49]!==z||t[50]!==B||t[51]!==H||t[52]!==D?(U=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-4`,children:[D,R,z,B,H]}),t[48]=R,t[49]=z,t[50]=B,t[51]=H,t[52]=D,t[53]=U):U=t[53];let W;t[54]===i?W=t[55]:(W=()=>i(!1),t[54]=i,t[55]=W);let te;t[56]!==n.filtersDone||t[57]!==W?(te=(0,$.jsx)(`div`,{className:`shrink-0 border-t border-edge-subtle px-4 py-3 dark:border-edge`,children:(0,$.jsx)(T,{type:`button`,className:`w-full rounded-xl`,onClick:W,children:n.filtersDone})}),t[56]=n.filtersDone,t[57]=W,t[58]=te):te=t[58];let G;t[59]!==U||t[60]!==te||t[61]!==w||t[62]!==E?(G=(0,$.jsxs)(b,{children:[f,(0,$.jsxs)(x,{className:m,"aria-describedby":`log-filters-desc`,children:[w,E,U,te]})]}),t[59]=U,t[60]=te,t[61]=w,t[62]=E,t[63]=G):G=t[63];let K;return t[64]!==i||t[65]!==r||t[66]!==G?(K=(0,$.jsx)(C,{open:r,onOpenChange:i,children:G}),t[64]=i,t[65]=r,t[66]=G,t[67]=K):K=t[67],K}var qe=1;function Je(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 Ye=`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`,Xe=`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 Ze({value:e,onChange:t,options:n,"aria-label":r,className:i,buttonClassName:a}){let o=(0,K.useRef)(null),s=(0,K.useRef)([]),[c,l]=(0,K.useState)({x:0,y:0,w:0,h:0}),[u,d]=(0,K.useState)(!1),[f,m]=(0,K.useState)(!1),h=(0,K.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=qe,c=t.getBoundingClientRect(),u=i.getBoundingClientRect(),f=Je(i,t),p,m;if(f)p=f.x,m=f.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)}),d(!0)},[n,e]),g=(0,K.useRef)(h);return g.current=h,(0,K.useLayoutEffect)(()=>{let e=requestAnimationFrame(()=>h());return()=>cancelAnimationFrame(e)},[h]),(0,K.useEffect)(()=>{let e=requestAnimationFrame(()=>{requestAnimationFrame(()=>m(!0))});return()=>cancelAnimationFrame(e)},[]),(0,K.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:p(F,`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:p(Ye,`motion-reduce:!transition-none motion-reduce:!duration-0`,f&&`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:p(Xe,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 Qe(e){let t=(0,q.c)(76),{L:n,levelSegment:r,onLevelSegment:i,searchInput:a,onSearchInputChange:c,moduleFilter:l,onModuleFilterChange:f,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 w;t[6]===n.presetInfoPlus?w=t[7]:(w={value:`infoPlus`,label:n.presetInfoPlus},t[6]=n.presetInfoPlus,t[7]=w);let E;t[8]===n.presetVerbose?E=t[9]:(E={value:`verbose`,label:n.presetVerbose},t[8]=n.presetVerbose,t[9]=E);let D;t[10]===n.presetOther?D=t[11]:(D={value:`other`,label:n.presetOther},t[10]=n.presetOther,t[11]=D);let O;t[12]!==x||t[13]!==S||t[14]!==C||t[15]!==w||t[16]!==E||t[17]!==D?(O=[x,S,C,w,E,D],t[12]=x,t[13]=S,t[14]=C,t[15]=w,t[16]=E,t[17]=D,t[18]=O):O=t[18];let k;t[19]!==n.levelPresetAria||t[20]!==r||t[21]!==i||t[22]!==O?(k=(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)(Ze,{"aria-label":n.levelPresetAria,value:r,onChange:i,options:O,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]=O,t[23]=k):k=t[23];let A;t[24]===n.searchPlaceholder?A=t[25]:(A=(0,$.jsx)(`span`,{className:`sr-only`,children:n.searchPlaceholder}),t[24]=n.searchPlaceholder,t[25]=A);let j;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(u,{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]=j):j=t[26];let M;t[27]===c?M=t[28]:(M=e=>c(e.target.value),t[27]=c,t[28]=M);let N=n.searchPlaceholder,P;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(P=p(`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`,ee),t[29]=P):P=t[29];let F;t[30]!==n.searchPlaceholder||t[31]!==a||t[32]!==M?(F=(0,$.jsx)(`input`,{type:`search`,value:a,onChange:M,placeholder:N,autoComplete:`off`,spellCheck:!1,className:P}),t[30]=n.searchPlaceholder,t[31]=a,t[32]=M,t[33]=F):F=t[33];let I;t[34]!==A||t[35]!==F?(I=(0,$.jsxs)(`label`,{className:`relative min-w-0 flex-1 sm:min-w-[12rem]`,children:[A,j,F]}),t[34]=A,t[35]=F,t[36]=I):I=t[36];let L;t[37]===f?L=t[38]:(L=e=>f(e.target.value),t[37]=f,t[38]=L);let z=n.module,B=n.module,V;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(V=p(R,`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)(s,{value:``,children:n.allModules}),t[40]=n.allModules,t[41]=H);let U;t[42]===m?U=t[43]:(U=m.map($e),t[42]=m,t[43]=U);let W;t[44]!==n.module||t[45]!==l||t[46]!==L||t[47]!==H||t[48]!==U?(W=(0,$.jsxs)(o,{id:`log-module`,value:l,onChange:L,"aria-label":z,title:B,className:V,children:[H,U]}),t[44]=n.module,t[45]=l,t[46]=L,t[47]=H,t[48]=U,t[49]=W):W=t[49];let te;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,$.jsx)(G,{className:`size-4`,strokeWidth:1.75}),t[50]=te):te=t[50];let K;t[51]===g?K=t[52]:(K=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]=K);let J;t[53]!==n.filtersMore||t[54]!==h||t[55]!==K?(J=(0,$.jsxs)(T,{type:`button`,variant:`secondary`,className:`h-10 min-h-[44px] gap-2 rounded-md sm:min-h-10`,onClick:h,children:[te,n.filtersMore,K]}),t[53]=n.filtersMore,t[54]=h,t[55]=K,t[56]=J):J=t[56];let Y;t[57]!==n.clear||t[58]!==_||t[59]!==v?(Y=_?(0,$.jsxs)(T,{type:`button`,variant:`ghost`,className:`h-10 min-h-[44px] gap-1 sm:min-h-10`,onClick:v,children:[(0,$.jsx)(d,{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]!==I||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:[I,W,X]}),t[64]=I,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]!==k?(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:[k,Z,Q]}),t[71]=n.filters,t[72]=Z,t[73]=Q,t[74]=k,t[75]=ne):ne=t[75],ne}function $e(e){return(0,$.jsx)(s,{value:e,children:e},e)}function et(e){let t=(0,q.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(tt)}):null,t[0]=i,t[1]=r.length,t[2]=u):u=t[2];let d;t[3]!==n||t[4]!==i||t[5]!==r.length||t[6]!==c?(d=!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)(z,{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)(T,{type:`button`,variant:`secondary`,className:`mt-4 gap-2`,onClick:c,children:[(0,$.jsx)(W,{className:`size-4`,strokeWidth:1.75}),n.refresh]})]}):null,t[3]=n,t[4]=i,t[5]=r.length,t[6]=c,t[7]=d):d=t[7];let f;t[8]!==n||t[9]!==a||t[10]!==i||t[11]!==r||t[12]!==l||t[13]!==s||t[14]!==o?(f=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:[Se(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=Ae(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:p(`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:Te(e.timestamp)}),(0,$.jsx)(`span`,{className:p(`w-[4.5rem] shrink-0 truncate`,a?`font-medium text-red-600 dark:text-red-400`:`text-fg-muted`),title:t,children:ke(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:Oe(r)}):(0,$.jsx)(`span`,{className:`text-fg-subtle`,title:`${n.requestId}: ${r}`,children:Oe(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:Ce(e),children:Ce(e)}),(0,$.jsx)(`span`,{className:p(`min-w-0 flex-1 truncate`,`text-fg`),children:we(e)})]})},je(e))})})]}),a?(0,$.jsx)(`div`,{className:`flex justify-center pt-1`,children:(0,$.jsxs)(T,{type:`button`,variant:`secondary`,className:`gap-2`,disabled:i,onClick:s,children:[i?(0,$.jsx)(W,{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]=f):f=t[15];let m;return t[16]!==u||t[17]!==d||t[18]!==f?(m=(0,$.jsxs)($.Fragment,{children:[u,d,f]}),t[16]=u,t[17]=d,t[18]=f,t[19]=m):m=t[19],m}function tt(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 nt(e){let t=(0,q.c)(8),{L:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(H,{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 rt(e){return/[",\n\r]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function it(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=>rt(String(e))).join(`,`)});return[t.join(`,`),...n].join(`
|
|
2
|
+
`)}function at(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 ot(e,t){let n=new Date().toISOString().replace(/[:.]/g,`-`);if(t===`json`){at(JSON.stringify(e,null,2),`xopc-logs-${n}.json`,`application/json`);return}at(it(e),`xopc-logs-${n}.csv`,`text/csv;charset=utf-8`)}function st(e){let t=(0,q.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)(c,{className:`size-4`,strokeWidth:1.75}),t[0]=o):o=t[0];let s;t[1]===n.exportLogs?s=t[2]:(s=(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:n.exportLogs}),t[1]=n.exportLogs,t[2]=s);let l;t[3]!==n.exportLogs||t[4]!==a||t[5]!==s?(l=(0,$.jsx)(O,{asChild:!0,children:(0,$.jsxs)(T,{type:`button`,variant:`secondary`,className:`h-9 gap-2 whitespace-nowrap px-3 text-xs`,disabled:a,title:n.exportLogs,children:[o,s]})}),t[3]=n.exportLogs,t[4]=a,t[5]=s,t[6]=l):l=t[6];let u;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(u=p(`w-52 rounded-xl border border-edge bg-surface-panel p-2 shadow-popover outline-none`,N,`dark:border-edge`),t[7]=u):u=t[7];let d;t[8]===n.exportLogs?d=t[9]:(d=(0,$.jsx)(`p`,{className:`px-2 py-1 text-xs font-medium text-fg`,children:n.exportLogs}),t[8]=n.exportLogs,t[9]=d);let f;t[10]===n.exportHint?f=t[11]:(f=(0,$.jsx)(`p`,{className:`px-2 pb-2 text-xs leading-5 text-fg-muted`,children:n.exportHint}),t[10]=n.exportHint,t[11]=f);let m;t[12]===r?m=t[13]:(m=()=>ot(r,`json`),t[12]=r,t[13]=m);let h;t[14]!==n.exportJson||t[15]!==m?(h=(0,$.jsx)(T,{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=()=>ot(r,`csv`),t[17]=r,t[18]=g);let _;t[19]!==n.exportCsv||t[20]!==g?(_=(0,$.jsx)(T,{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]!==d||t[27]!==f?(y=(0,$.jsx)(D,{children:(0,$.jsxs)(k,{side:`bottom`,align:`end`,sideOffset:6,className:u,children:[d,f,v]})}),t[25]=v,t[26]=d,t[27]=f,t[28]=y):y=t[28];let b;return t[29]!==y||t[30]!==l?(b=(0,$.jsxs)(E,{children:[l,y]}),t[29]=y,t[30]=l,t[31]=b):b=t[31],b}function ct(e){let t=(0,q.c)(38),{L:n}=e,[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(`info`),[s,c]=(0,K.useState)(!1),[u,d]=(0,K.useState)(null),f,m;t[0]!==n.logLevelLoadError||t[1]!==r?(f=()=>{if(!r)return;let e=!1;return re().then(t=>{e||o(t)}).catch(t=>{e||d(t instanceof Error?t.message:n.logLevelLoadError)}),()=>{e=!0}},m=[r,n.logLevelLoadError],t[0]=n.logLevelLoadError,t[1]=r,t[2]=f,t[3]=m):(f=t[2],m=t[3]),(0,K.useEffect)(f,m);let h;t[4]===n.logLevelSaveError?h=t[5]:(h=e=>{c(!0),d(null),ie(e).then(e=>{o(e.current),i(!1)}).catch(e=>{d(e instanceof Error?e.message:n.logLevelSaveError)}).finally(()=>c(!1))},t[4]=n.logLevelSaveError,t[5]=h);let g=h,_;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(l,{className:`size-4`,strokeWidth:1.75}),t[6]=_):_=t[6];let v;t[7]===n.logLevelTitle?v=t[8]:(v=(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:n.logLevelTitle}),t[7]=n.logLevelTitle,t[8]=v);let y;t[9]===a?y=t[10]:(y=(0,$.jsx)(`span`,{className:`tabular-nums text-fg-muted`,children:a}),t[9]=a,t[10]=y);let b;t[11]!==n.logLevelTitle||t[12]!==v||t[13]!==y?(b=(0,$.jsx)(O,{asChild:!0,children:(0,$.jsxs)(T,{type:`button`,variant:`secondary`,className:`h-9 gap-2 whitespace-nowrap px-3 text-xs`,title:n.logLevelTitle,children:[_,v,y]})}),t[11]=n.logLevelTitle,t[12]=v,t[13]=y,t[14]=b):b=t[14];let x;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(x=p(`w-56 rounded-xl border border-edge bg-surface-panel p-3 shadow-popover outline-none`,N,`dark:border-edge`),t[15]=x):x=t[15];let S;t[16]===n.logLevelTitle?S=t[17]:(S=(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:n.logLevelTitle}),t[16]=n.logLevelTitle,t[17]=S);let C;t[18]===n.logLevelHint?C=t[19]:(C=(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n.logLevelHint}),t[18]=n.logLevelHint,t[19]=C);let w;t[20]!==n.levelNames||t[21]!==g||t[22]!==a||t[23]!==s?(w=le.map(e=>(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,disabled:s,onClick:()=>g(e),className:p(`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]=g,t[22]=a,t[23]=s,t[24]=w):w=t[24];let A;t[25]===w?A=t[26]:(A=(0,$.jsx)(`ul`,{className:`mt-3 flex flex-col gap-1`,children:w}),t[25]=w,t[26]=A);let j;t[27]===u?j=t[28]:(j=u?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-red-600 dark:text-red-400`,children:u}):null,t[27]=u,t[28]=j);let M;t[29]!==C||t[30]!==A||t[31]!==j||t[32]!==S?(M=(0,$.jsx)(D,{children:(0,$.jsxs)(k,{side:`bottom`,align:`end`,sideOffset:6,className:x,children:[S,C,A,j]})}),t[29]=C,t[30]=A,t[31]=j,t[32]=S,t[33]=M):M=t[33];let P;return t[34]!==r||t[35]!==M||t[36]!==b?(P=(0,$.jsxs)(E,{open:r,onOpenChange:i,children:[b,M]}),t[34]=r,t[35]=M,t[36]=b,t[37]=P):P=t[37],P}function lt(e){let t=(0,q.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)(Ze,{"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)(ct,{L:n}),t[21]=n,t[22]=y);let b;t[23]!==n||t[24]!==s||t[25]!==l?(b=(0,$.jsx)(st,{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)(V,{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)(T,{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 w;t[34]!==n.refresh||t[35]!==s||t[36]!==c?(w=(0,$.jsx)(I,{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]=w):w=t[37];let E;t[38]!==y||t[39]!==b||t[40]!==C||t[41]!==w?(E=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center justify-end gap-1 sm:self-center`,children:[y,b,C,w]}),t[38]=y,t[39]=b,t[40]=C,t[41]=w,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 ut(e){let t=(0,q.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=Pe(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 d;t[12]!==c||t[13]!==l||t[14]!==u?(d=(0,$.jsx)(O,{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]=d):d=t[15];let f;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(f=p(`w-[min(calc(100vw-2rem),20rem)] rounded-xl border border-edge bg-surface-panel p-3 shadow-popover outline-none`,N,`dark:border-edge`),t[16]=f):f=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=le.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)(D,{children:(0,$.jsxs)(k,{side:`bottom`,align:`start`,sideOffset:6,className:f,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]!==d?(y=(0,$.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,$.jsxs)(E,{children:[d,v]})}),t[30]=v,t[31]=d,t[32]=y):y=t[32],y}function dt(){let e=(0,q.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:m,setDateTo:h,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:V,errorSummary:H,errorSummaryLoading:U}=Re(g(ft));if(!n){let n;return e[0]===t?n=e[1]:(n=(0,$.jsx)(nt,{L:t}),e[0]=t,e[1]=n),n}let W;e[2]===C?W=e[3]:(W=()=>C(!0),e[2]=C,e[3]=W);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]!==W?(G=(0,$.jsx)(lt,{L:t,autoRefresh:D,onAutoRefreshChange:O,fileCount:v.length,onOpenFiles:W,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]=W,e[12]=G):G=e[12];let K;e[13]===a?K=e[14]:(K=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]=K);let J;e[15]!==t||e[16]!==y?(J=y?(0,$.jsx)(ut,{L:t,stats:y}):null,e[15]=t,e[16]=y,e[17]=J):J=e[17];let Y;e[18]!==t||e[19]!==H||e[20]!==U||e[21]!==ee?(Y=(0,$.jsx)(ze,{L:t,items:H,loading:U,onSelectItem:ee}),e[18]=t,e[19]=H,e[20]=U,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)(Qe,{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)(et,{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]!==m||e[51]!==w||e[52]!==l||e[53]!==p||e[54]!==h||e[55]!==T||e[56]!==P?(ne=(0,$.jsx)(Ke,{L:t,open:w,onOpenChange:T,dateFrom:f,onDateFromChange:p,dateTo:m,onDateToChange:h,selectedLevels:l,onToggleLevel:P}),e[48]=t,e[49]=f,e[50]=m,e[51]=w,e[52]=l,e[53]=p,e[54]=h,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]!==V||e[68]!==b||e[69]!==ie||e[70]!==ae||e[71]!==re?(oe=(0,$.jsx)(Ue,{L:t,log:b,onClose:re,copiedDetail:k,onCopiedMessage:ie,onCopiedJson:ae,onFilterByRequestId:z,onFilterByTranscriptId:B,onOpenChat:V}),e[63]=t,e[64]=k,e[65]=z,e[66]=B,e[67]=V,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)(We,{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]!==K||e[83]!==J||e[84]!==Y||e[85]!==Z||e[86]!==Q||e[87]!==ne?(ce=(0,$.jsxs)(te,{gap:`gap-6`,children:[G,K,J,Y,Z,Q,ne,oe,se]}),e[79]=G,e[80]=oe,e[81]=se,e[82]=K,e[83]=J,e[84]=Y,e[85]=Z,e[86]=Q,e[87]=ne,e[88]=ce):ce=e[88],ce}function ft(e){return e.language}export{dt 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"./createLucideIcon-DPHK1VkS.js";import{t as o}from"./chevron-left-DqFhpbvK.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-D0G_sZvA.js";import{t as d}from"./cn-JdwAhgNB.js";import{i as f,n as te,r as p}from"./locale-store-BSkKhYkc.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 S,o as ne}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{Lc as C,Oa as w,Ul as T,ao as E,cl as D,ka as O,ml as k,tu as A,zo as j}from"./index-Cr4SINLG.js";import{n as M,r as N,t as P}from"./settings-page-layout-X1x-2Cp9.js";import{t as F}from"./device-pairing-wizard-DFYK_Ywf.js";import{n as I}from"./settings-loading-skeleton-CAmWMaOT.js";var re=a(`shield-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`,key:`1jlk70`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`,key:`18rp1v`}]]),L=e(t(),1),R=n(),z=720*60*60*1e3;function B(e){let t=[e.access,e.principal].filter(e=>e!==null);return t.length>0&&t.every(e=>e.revokedAt!==void 0)}function V(e){return B(e)?`revoked`:e.endpoints.length>0?`online`:`offline`}function ie(e){return new Set(e.endpoints.flatMap(e=>e.tools.map(({descriptor:e})=>e.name))).size}function ae(e,t=Date.now()){return V(e)===`offline`?(e.lastSeenAt??e.createdAt)<t-z:!1}function oe(e,t,n=Date.now()){let r=t.query.trim().toLocaleLowerCase();return e.filter(e=>{let i=V(e),a=t.status===`all`||(t.status===`active`?i!==`revoked`:t.status===`stale`?ae(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 se(e){return e.length>8?e.slice(-8):e}var H=r();function ce(e){let t=(0,R.c)(59),{device:n,busy:r,onClose:i,onRevoke:a}=e,o=te(U),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?V(n):`offline`,t[4]=n,t[5]=b);let C=b,w=n!==null,T;t[6]===i?T=t[7]:(T=e=>!e&&i(),t[6]=i,t[7]=T);let E;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,H.jsx)(m,{className:d(`xopc-dialog-overlay fixed inset-0 bg-scrim`,ne)}),t[8]=E):E=t[8];let D;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(D=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`,S),t[9]=D):D=t[9];let O=n?.displayName??c.deviceDetails,k;t[10]===O?k=t[11]:(k=(0,H.jsx)(v,{className:`truncate text-base font-semibold text-fg`,children:O}),t[10]=O,t[11]=k);let A;t[12]===n?A=t[13]:(A=n?(0,H.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[n.kind,` · `,n.platform,` · `,se(n.id)]}):null,t[12]=n,t[13]=A);let j;t[14]!==k||t[15]!==A?(j=(0,H.jsxs)(`div`,{className:`min-w-0`,children:[k,A]}),t[14]=k,t[15]=A,t[16]=j):j=t[16];let M;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,H.jsx)(u,{className:`size-5`,"aria-hidden":!0}),t[17]=M):M=t[17];let N;t[18]===c.close?N=t[19]:(N=(0,H.jsx)(h,{asChild:!0,children:(0,H.jsx)(x,{variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":c.close,children:M})}),t[18]=c.close,t[19]=N);let P;t[20]!==j||t[21]!==N?(P=(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-b border-edge px-4 py-3`,children:[j,N]}),t[20]=j,t[21]=N,t[22]=P):P=t[22];let F;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?(F=n?(0,H.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto p-4`,children:[(0,H.jsxs)(`dl`,{className:`grid grid-cols-2 gap-3 rounded-xl bg-surface-hover/40 p-4`,children:[(0,H.jsx)(W,{label:c.statusLabel,value:c.status[C]}),(0,H.jsx)(W,{label:c.lastSeen,value:n.lastSeenAt?p.format(n.lastSeenAt):c.never}),(0,H.jsx)(W,{label:c.endpointCount,value:String(n.endpoints.length)}),(0,H.jsx)(W,{label:c.toolCount,value:String(ie(n))})]}),(0,H.jsxs)(`section`,{children:[(0,H.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:c.accessTitle}),(0,H.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,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`p`,{children:n.access.revokedAt?c.accessRevoked:c.accessActive}),(0,H.jsxs)(`p`,{className:`mt-1 break-words`,children:[c.permissions,`: `,n.access.scopes.join(`, `)||c.noPermissions]})]}):(0,H.jsx)(`p`,{children:c.noAccessIdentity})})]}),(0,H.jsxs)(`section`,{children:[(0,H.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:c.endpointsTitle}),(0,H.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[n.endpoints.length===0?(0,H.jsx)(`p`,{className:`text-sm text-fg-muted`,children:c.noOnlineEndpoints}):null,n.endpoints.map(e=>(0,H.jsxs)(`article`,{className:`rounded-xl border border-edge-subtle bg-surface-base p-3`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,H.jsx)(`p`,{className:`min-w-0 break-all text-xs font-medium text-fg`,children:e.endpointId}),(0,H.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[c.status[e.availability],` · v`,e.appVersion]})]}),(0,H.jsx)(`div`,{className:`mt-3 space-y-2`,children:e.tools.map(e=>{let{descriptor:t}=e;return(0,H.jsxs)(`div`,{className:`rounded-lg bg-surface-hover/50 px-3 py-2`,children:[(0,H.jsx)(`p`,{className:`break-all text-xs font-medium text-fg`,children:t.name}),(0,H.jsx)(`p`,{className:`mt-0.5 break-words text-xs text-fg-subtle`,children:t.requiredPermissions.join(`, `)||c.noPermissions})]},t.name)})})]},e.connectionId))]})]}),(0,H.jsxs)(`section`,{children:[(0,H.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:c.identityTitle}),(0,H.jsxs)(`dl`,{className:`mt-2 rounded-xl border border-edge-subtle bg-surface-base p-3 text-xs`,children:[(0,H.jsx)(W,{label:c.identityId,value:n.id,breakAll:!0}),(0,H.jsx)(`div`,{className:`mt-3`,children:(0,H.jsx)(W,{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]=F):F=t[43];let I;t[44]!==r||t[45]!==c.removeDevice||t[46]!==c.revoking||t[47]!==n||t[48]!==a||t[49]!==C?(I=n&&C!==`revoked`?(0,H.jsx)(`div`,{className:`shrink-0 border-t border-edge px-4 py-3`,children:(0,H.jsxs)(x,{variant:`secondary`,className:`w-full text-danger`,disabled:r,onClick:()=>a(n),children:[(0,H.jsx)(re,{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]=I):I=t[50];let L;t[51]!==P||t[52]!==F||t[53]!==I?(L=(0,H.jsxs)(g,{children:[E,(0,H.jsxs)(_,{className:D,"aria-describedby":void 0,children:[P,F,I]})]}),t[51]=P,t[52]=F,t[53]=I,t[54]=L):L=t[54];let z;return t[55]!==L||t[56]!==w||t[57]!==T?(z=(0,H.jsx)(y,{open:w,onOpenChange:T,children:L}),t[55]=L,t[56]=w,t[57]=T,t[58]=z):z=t[58],z}function U(e){return e.language}function W(e){let t=(0,R.c)(10),{label:n,value:r,breakAll:i}=e,a=i===void 0?!1:i,o;t[0]===n?o=t[1]:(o=(0,H.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,H.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,H.jsxs)(`div`,{className:`min-w-0`,children:[o,l]}),t[7]=o,t[8]=l,t[9]=u):u=t[9],u}function le(e){let t=(0,R.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,L.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(ue,{replace:!0}))},m=[r,a],t[3]=r,t[4]=a,t[5]=p,t[6]=m):(p=t[5],m=t[6]),(0,L.useEffect)(p,m);let h,g;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>f({open:!0}),g=(0,H.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,H.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,H.jsx)(F,{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,H.jsxs)(H.Fragment,{children:[_,y]}),t[16]=_,t[17]=y,t[18]=b):b=t[18],b}function ue(e){let t=new URLSearchParams(e);return t.delete(`startDevicePairing`),t}function de(e){return e.language}async function G(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 G(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 G(await f(p(`/api/endpoint-tools/devices/revoke`),{method:`POST`,body:JSON.stringify({ids:e})}))}))}async function ge(e){return G(await f(pe(e)))}var _e=5e3,K=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,R.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,H.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(),a=n.get(`view`)===`activity`?`activity`:`devices`,[c,u]=(0,L.useState)(null),[f,p]=(0,L.useState)([]),[m,h]=(0,L.useState)(!1),[g,_]=(0,L.useState)(!1),[v,y]=(0,L.useState)(``),[S,ne]=(0,L.useState)(`active`),[F,R]=(0,L.useState)(``),[z,B]=(0,L.useState)(1),[U,W]=(0,L.useState)(()=>new Set),[ue,de]=(0,L.useState)(``),[G]=E(ue,250),[ye,xe]=(0,L.useState)(``),[Se,Ce]=(0,L.useState)(``),[we,Te]=(0,L.useState)(``),[Ee,q]=(0,L.useState)(1),De={page:Ee,pageSize:ve,query:G,principalId:ye,status:Se,effect:we},J=b(fe(),me,{refreshInterval:_e}),Y=b(a===`activity`?pe(De):null,()=>ge(De),{refreshInterval:_e,keepPreviousData:!0}),Oe=(0,L.useMemo)(()=>new Intl.DateTimeFormat(e===`zh`?`zh-CN`:`en`,{dateStyle:`medium`,timeStyle:`short`}),[e]);if(J.isLoading&&!J.data)return(0,H.jsx)(N,{children:(0,H.jsx)(I,{sections:2})});let X=J.data??[],ke=Y.data?.items??[],Ae=X.filter(e=>V(e)===`online`).length,je=X.filter(e=>V(e)!==`revoked`).length,Me=X.filter(e=>ae(e)).length,Ne=[...new Set(X.map(e=>e.platform))].toSorted(),Z=oe(X,{query:v,status:S,platform:F}),Pe=Math.max(1,Math.ceil(Z.length/K)),Q=Math.min(z,Pe),Fe=Z.slice((Q-1)*K,Q*K),$=Fe.reduce((e,t)=>(V(t)!==`revoked`&&e.push(t.id),e),[]),Ie=$.length>0&&$.every(e=>U.has(e)),Le=e=>{r(t=>{let n=new URLSearchParams(t);return e===`devices`?n.delete(`view`):n.set(`view`,e),n},{replace:!0})},Re=async()=>{await Promise.all([J.mutate(),a===`activity`?Y.mutate():Promise.resolve()])},ze=async()=>{if(!(f.length===0||m)){h(!0),_(!1);try{await he(f.map(e=>e.id)),p([]),W(new Set),await J.mutate()}catch{_(!0)}finally{h(!1)}}},Be=e=>{e(),B(1),W(new Set)};return(0,H.jsxs)(N,{children:[(0,H.jsx)(M,{title:t.title,subtitle:t.subtitle,actions:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(w,{className:`size-9 shrink-0 p-0`,label:t.refresh,onClick:Re}),(0,H.jsx)(le,{onPaired:()=>void J.mutate()})]})}),J.error||Y.error?(0,H.jsx)(`div`,{className:`rounded-xl bg-danger-soft px-4 py-3 text-sm text-danger`,children:t.loadError}):null,(0,H.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[{label:t.activeDevices,value:je,filter:`active`},{label:t.onlineDevices,value:Ae,filter:`online`},{label:t.staleDevices,value:Me,filter:`stale`}].map(({label:e,value:t,filter:n})=>(0,H.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:()=>{Be(()=>ne(n)),Le(`devices`)},children:[(0,H.jsx)(`span`,{className:`text-xs text-fg-muted`,children:e}),(0,H.jsx)(`span`,{className:`mt-1 block text-2xl font-semibold text-fg`,children:t})]},n))}),(0,H.jsx)(j,{items:[{id:`devices`,label:t.devicesTab,icon:D,count:je},{id:`activity`,label:t.activityTab,icon:A,count:Y.data?.total}],activeTab:a,onChange:Le,ariaLabel:t.viewsAria,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`}),(0,H.jsxs)(P,{id:`devices`,activeTab:a,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`,title:t.devicesTitle,hint:t.devicesHint,children:[(0,H.jsxs)(`div`,{className:`mb-4 grid gap-2 sm:grid-cols-[minmax(0,1fr)_11rem_11rem]`,children:[(0,H.jsxs)(`label`,{className:`relative block`,children:[(0,H.jsx)(`span`,{className:`sr-only`,children:t.searchDevices}),(0,H.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,H.jsx)(`input`,{type:`search`,"aria-label":t.searchDevices,value:v,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=>Be(()=>y(e.target.value))})]}),(0,H.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=>Be(()=>ne(e))}),(0,H.jsx)(s,{value:F,options:Ne.map(e=>({value:e,label:e})),placeholder:t.allPlatforms,emptyLabel:t.allPlatforms,ariaLabel:t.platformLabel,onChange:e=>Be(()=>R(e))})]}),U.size>0?(0,H.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,H.jsx)(`p`,{className:`text-sm font-medium text-accent-fg`,children:t.selectedCount.replace(`{{count}}`,String(U.size))}),(0,H.jsxs)(x,{variant:`secondary`,className:`text-danger`,onClick:()=>{_(!1),p(X.filter(e=>U.has(e.id)))},children:[(0,H.jsx)(re,{className:`size-4`,"aria-hidden":!0}),t.removeSelected]})]}):null,X.length===0?(0,H.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noDevices}):Z.length===0?(0,H.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noMatchingDevices}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`flex min-h-10 items-center gap-3 border-b border-edge-subtle px-1`,children:(0,H.jsxs)(`label`,{className:d(`touch-target flex items-center gap-2 text-xs text-fg-muted`,$.length>0?`cursor-pointer`:`cursor-not-allowed opacity-50`),children:[(0,H.jsx)(`input`,{type:`checkbox`,"aria-label":t.selectPage,checked:Ie,disabled:$.length===0,className:`size-4 accent-accent`,onChange:e=>{W(t=>{let n=new Set(t);for(let t of $)e.target.checked?n.add(t):n.delete(t);return n})}}),t.selectPage]})}),(0,H.jsx)(`ul`,{className:`divide-y divide-edge-subtle`,children:Fe.map(e=>{let n=V(e),r=e.kind===`mobile`?C:k;return(0,H.jsxs)(`li`,{className:`flex items-center gap-3`,children:[(0,H.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,H.jsx)(`input`,{type:`checkbox`,checked:U.has(e.id),disabled:n===`revoked`,"aria-label":t.selectDevice.replace(`{{name}}`,e.displayName),className:`size-4 accent-accent`,onChange:t=>{W(n=>{let r=new Set(n);return t.target.checked?r.add(e.id):r.delete(e.id),r})}})}),(0,H.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:()=>u(e),children:[(0,H.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-surface-inset text-fg-muted`,children:(0,H.jsx)(r,{className:`size-4`,"aria-hidden":!0})}),(0,H.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:e.displayName}),(0,H.jsx)(be,{status:n,label:t.status[n]})]}),(0,H.jsxs)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:[e.platform,` · `,se(e.id),` · `,t.lastSeen,`: `,e.lastSeenAt?Oe.format(e.lastSeenAt):t.never]})]}),(0,H.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(ie(e)))}),(0,H.jsx)(T,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0})]})]},e.id)})}),(0,H.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3 border-t border-edge-subtle pt-3`,children:[(0,H.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.paginationSummary.replace(`{{from}}`,String((Q-1)*K+1)).replace(`{{to}}`,String(Math.min(Q*K,Z.length))).replace(`{{total}}`,String(Z.length))}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(x,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.previousPage,disabled:Q<=1,onClick:()=>B(e=>Math.max(1,e-1)),children:(0,H.jsx)(o,{className:`size-4`,"aria-hidden":!0})}),(0,H.jsx)(x,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.nextPage,disabled:Q>=Pe,onClick:()=>B(e=>Math.min(Pe,e+1)),children:(0,H.jsx)(T,{className:`size-4`,"aria-hidden":!0})})]})]})]})]}),(0,H.jsxs)(P,{id:`activity`,activeTab:a,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`,title:t.callsTitle,hint:t.callsHint,children:[(0,H.jsxs)(`div`,{className:`mb-4 grid gap-2 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,H.jsxs)(`label`,{className:`relative block sm:col-span-2 lg:col-span-1`,children:[(0,H.jsx)(`span`,{className:`sr-only`,children:t.searchActivity}),(0,H.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,H.jsx)(`input`,{type:`search`,"aria-label":t.searchActivity,value:ue,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=>{de(e.target.value),q(1)}})]}),(0,H.jsx)(s,{value:ye,options:X.map(e=>({value:e.id,label:`${e.displayName} · ${se(e.id)}`})),placeholder:t.allDevices,emptyLabel:t.allDevices,ariaLabel:t.deviceLabel,onChange:e=>{xe(e),q(1)}}),(0,H.jsx)(s,{value:Se,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=>{Ce(e),q(1)}}),(0,H.jsx)(s,{value:we,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=>{Te(e),q(1)}})]}),Y.isLoading&&!Y.data?(0,H.jsx)(I,{sections:1}):null,ke.length===0&&!Y.isLoading?(0,H.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noMatchingCalls}):null,(0,H.jsx)(`div`,{className:`space-y-2`,children:ke.map(e=>(0,H.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,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`p`,{className:`break-all text-sm font-medium text-fg`,children:e.toolName}),(0,H.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[Oe.format(e.startedAt),` · `,t.effects[e.effect],` · `,e.endpointId]}),e.errorMessage?(0,H.jsx)(`p`,{className:`mt-1 text-xs text-danger`,children:e.errorMessage}):null]}),(0,H.jsx)(be,{status:e.status,label:t.status[e.status]})]},e.id))}),Y.data&&Y.data.total>0?(0,H.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3 border-t border-edge-subtle pt-3`,children:[(0,H.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.paginationSummary.replace(`{{from}}`,String((Y.data.page-1)*Y.data.pageSize+1)).replace(`{{to}}`,String(Math.min(Y.data.page*Y.data.pageSize,Y.data.total))).replace(`{{total}}`,String(Y.data.total))}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(x,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.previousPage,disabled:Y.data.page<=1,onClick:()=>q(e=>Math.max(1,e-1)),children:(0,H.jsx)(o,{className:`size-4`,"aria-hidden":!0})}),(0,H.jsx)(x,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.nextPage,disabled:Y.data.page>=Y.data.totalPages,onClick:()=>q(e=>Math.min(Y.data.totalPages,e+1)),children:(0,H.jsx)(T,{className:`size-4`,"aria-hidden":!0})})]})]}):null]}),(0,H.jsx)(ce,{device:c,busy:m,onClose:()=>u(null),onRevoke:e=>{u(null),_(!1),p([e])}}),(0,H.jsx)(O,{open:f.length>0,title:f.length>1?t.removeManyTitle:t.removeTitle,description:`${f.length>1?t.removeManyDescription.replace(`{{count}}`,String(f.length)):t.removeDescription.replace(`{{name}}`,f[0]?.displayName??``)}${g?`\n\n${t.revokeError}`:``}`,confirmLabel:m?t.revoking:t.removeDevice,cancelLabel:t.cancel,destructive:!0,onConfirm:()=>void ze(),onCancel:()=>{m||p([])}})]})}export{xe as EndpointToolsManagementSettings};
|