@xopcai/xopc 0.0.378 → 0.0.381
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-Xnu0H9yx.js → activity-store-D2oKh5ik.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-sKMpwYNC.js → agent-avatar-dicebear-BnMiU8HX.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-Ddv61pUQ.js +1 -0
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-CxZeGEuL.js → agent-plugin-dialog-C7z3r3Z3.js} +1 -1
- package/dist/gateway/static/root/assets/agents-BstMN5nH.js +66 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-DFBVz3bV.js → agents-admin-api-D-DNV0ms.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-CWqbEntC.js → app-management-settings-panel-D2boumUX.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-QznCLnam.js → appearance-settings-Cwf53Rqo.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-wbVq-6PP.js → apps-page-CwWCU5Ib.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-BclI5H7-.js → archive-plugin-DivP9LfK.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CTKIwPAS.js → automations-page-DztgYZdC.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-SVRa19EF.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-D9FwadCs.js → binary-plugins-f-JnMRA1.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-Dqqtybdf.js → block-editor-CEnzVIbk.js} +39 -39
- package/dist/gateway/static/root/assets/{browser-automation-inputs-FGALoJY8.js → browser-automation-inputs-DD-SUHmv.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-hQbQFWl-.js → browser-automations-page-m-9ETOOE.js} +2 -2
- package/dist/gateway/static/root/assets/{browser-settings-page-DQvfXaeq.js → browser-settings-page-DN37CRLL.js} +2 -2
- package/dist/gateway/static/root/assets/{cn-JdwAhgNB.js → bundle-mjs-rHxsej31.js} +1 -1
- package/dist/gateway/static/root/assets/{button-CS04eWY9.js → button-aIC072nz.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-CQuaJBPv.js → capabilities-BOJYAeEJ.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-ClI4hof_.js → capabilities-Bf6NYuvT.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-D1MJHORS.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DmwDOIlV.js +8 -0
- package/dist/gateway/static/root/assets/{capability-header-actions-XMz78V4c.js → capability-header-actions-DG-feQV0.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-icon-BYm2-nS-.js → capability-icon-DVoZxEgW.js} +1 -1
- package/dist/gateway/static/root/assets/channels-Bl6g4Dg9.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-Dr3rujcs.js → chat-terminal-dock-CE3tIjLW.js} +2 -2
- package/dist/gateway/static/root/assets/cn-0WouolD0.js +1 -0
- package/dist/gateway/static/root/assets/{computer-settings-page-G2lMB7CR.js → computer-settings-page-UMzIyZN5.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-Cne5MBuz.js → connector-service-page-P6yEnQ6H.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-DXhBTvqp.js +1 -0
- package/dist/gateway/static/root/assets/{copy-text-row-C1gaJwlZ.js → copy-text-row-C7egVuKr.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-yGmnkoC5.js → date-picker-eg-Uf9Wx.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-CdKC_TNa.js → dependency-picker-BEn7eZXu.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-C4d305Me.js → desktop-pet-DPAFil05.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-hCS9Mddt.js → desktop-pet-settings-DK38Nevi.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-sprite-DTqXSpqf.js → desktop-pet-sprite-BP6iMVw1.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-C6qeCyfO.js → device-pairing-wizard-DaRk9VLg.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-kYdBIm8m.js → directory-picker-path-field-Dm7jp0Y9.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-odpIjn1q.js → extension-debug-page-DJ1wFpMs.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-C6Jn5baO.js → extension-page-tPkDLwrG.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-DB4M3dc8.js → extension-provider-Dnz8j6Q_.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-Clx81lZy.js → extension-settings-page-Vp9FPajP.js} +1 -1
- package/dist/gateway/static/root/assets/{fallback-models-pBVU4PxA.js → fallback-models-DirZnl7x.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-ArYo4YFd.js → gateway-config-swr-f-4qw3AG.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-BaE0shFY.js → gateway-realtime-BGhPOSfz.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-BYe-jWB1.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-CRbb12ar.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-BRCCiCBH.js → gateway-startup-retry-90pvxKox.js} +1 -1
- package/dist/gateway/static/root/assets/highlight-code-BH65IIbJ.js +1 -0
- package/dist/gateway/static/root/assets/highlighted-body-KQOG7T2V-DdDvTjik.js +1 -0
- package/dist/gateway/static/root/assets/home-page-BeIZyioN.js +2 -0
- package/dist/gateway/static/root/assets/{image-generation-api-B5FwRmo9.js → image-generation-api-CtDjTXwX.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-7s8jzc2G.js → imports-page-KIeykeaL.js} +1 -1
- package/dist/gateway/static/root/assets/index-DxydK_AA.js +255 -0
- package/dist/gateway/static/root/assets/index-_xgO2IDa.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CyFSxteg.js → keyboard-shortcuts-settings-5Df9Rng_.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-B-hYeH8P.js → local-app-workbench-page-BSuq_SAr.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-CFt8G-ae.js → local-apps-page-D5-69OHu.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-CLR702g5.js → local-session-drafts-CrD74S6k.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-CeoW7A5a.js → locale-store-pmT2B_By.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-BQ9AzAj9.js → logs-page-DHYqPwJ3.js} +2 -2
- package/dist/gateway/static/root/assets/{management-settings-BDuuXJ5t.js → management-settings-uIgzZZ_J.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-DSjfHfaW.css → markdown-view-ByJbFign.css} +1 -1
- package/dist/gateway/static/root/assets/markdown-view-CZlvyzow.js +66 -0
- package/dist/gateway/static/root/assets/{media-plugins-hqKbHVyi.js → media-plugins-BtFqN13D.js} +1 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-DOTWm1iy.js +1 -0
- package/dist/gateway/static/root/assets/mermaid-render-604gISVe.js +134 -0
- package/dist/gateway/static/root/assets/{messages-BpEhZm54.js → messages-Ib6DaUTo.js} +2 -2
- package/dist/gateway/static/root/assets/models-hub-cache-3slk24cw.js +1 -0
- package/dist/gateway/static/root/assets/{note-detail-panel-G_6LpTik.js → note-detail-panel-sujG9ZmW.js} +3 -3
- package/dist/gateway/static/root/assets/{note-image-lightbox-1qg2v-9j.js → note-image-lightbox-BYNLO2pt.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-api-B0QQSN4M.js → notes-api-D-VLGhjV.js} +1 -1
- package/dist/gateway/static/root/assets/notes-page-C_4Ib15d.js +8 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-Dp1RoS6x.js → page-context-capture-button-DErqGBBe.js} +1 -1
- package/dist/gateway/static/root/assets/{page-tabs-D2xpUV26.js → page-tabs-BLGO2VIm.js} +1 -1
- package/dist/gateway/static/root/assets/personal-page-CC3W2EZ0.js +1 -0
- package/dist/gateway/static/root/assets/{popover-select-BgSdSbCL.js → popover-select-DHC7J4lG.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-Dvey7GwU.js → preview-open-alternatives-BJU2fmPn.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-DZyCQVVW.js → product-open-page-B3qxtYyi.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-CrfIfrVJ.js → product-preview-content-NOhtxfkq.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-7BFqLZj4.js +1 -0
- package/dist/gateway/static/root/assets/{projects-page-DZ98gcjB.js → projects-page-qhnc7oNj.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-Dzl61MkW.js → registry-api-Bi4muyaZ.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CS-zmmtV.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-api-Cg9dqJon.js → runtime-tools-api-9bk1payF.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-oEdBs0He.js → runtime-tools-settings-panel-B55OozGG.js} +1 -1
- package/dist/gateway/static/root/assets/{scenes-page-CVlz-PiN.js → scenes-page-BJZqRz8a.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-DIC8IlM1.js → schema-form-BND8Hs4C.js} +1 -1
- package/dist/gateway/static/root/assets/{secret-input-D93UrW4C.js → secret-input-BxWHx6J6.js} +1 -1
- package/dist/gateway/static/root/assets/send-session-input-BtF5UWGp.js +1 -0
- package/dist/gateway/static/root/assets/{session-api-CVHFZq_A.js → session-api-D2J6VacQ.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-64DD1cxN.js +16 -0
- package/dist/gateway/static/root/assets/sessions-page-U5k3iucx.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-D8dOvd8T.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-exRhP9xn.js → settings-form-section-num14vSv.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-CAmWMaOT.js → settings-loading-skeleton-BTqvr_Fw.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-CN0_Np6E.js → settings-page-DOMl-bv4.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-X1x-2Cp9.js → settings-page-layout-Dx5S-Msc.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-Dgpd7bk0.js +1 -0
- package/dist/gateway/static/root/assets/{share-link-dialog-C0gKFt8r.js → share-link-dialog-BnqkFFBZ.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-DxQ6yfYv.js → share-preview-page-aGjIkYmH.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-tR66Fdly.js → shares-api-cGtd3rjc.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-C_ZOqMjz.js → shares-settings-DmFLUeqg.js} +1 -1
- package/dist/gateway/static/root/assets/{skeleton-BwbyijEw.js → skeleton-BI5TyibZ.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-BFhU0NNu.js → skill-api-C9AYuE_b.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-D_04Mpcb.js → skill-reload-api-VT8F0enn.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-4-d-lfhq.js → skills-page-CJIhQfG2.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-DHhaFWty.js → system-settings-panel-Cg0qUX2j.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-CHBEI5uz.js → task-detail-page-C-VbndI4.js} +2 -2
- package/dist/gateway/static/root/assets/{task-expandable-content-AGJtkFIu.js → task-expandable-content-UI-0Elqy.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-DezB9Sal.js → theme-store-D7m5Eng5.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-BEHmd2wL.js → tracing-settings-page-CawYzT24.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-Bbb_6pV4.js → tunnel-api-B8bvJesa.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-BEiWznDq.js → usage-page-DdA0F-qo.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-BtTE5X_M.js → use-autosave-jrZBPSWn.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-BBHrVqB7.js → use-composer-attachments-hTgxke6e.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-CQmLEkdj.js → use-file-preview-expanded-tMUDUWVH.js} +2 -2
- package/dist/gateway/static/root/assets/user-model-page-Bs6hUk15.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-tQsUdQnu.js → voice-api-key-field-Bp8brswu.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-69Yqf0QM.js → voice-config-api-415pyWx8.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-Cvf8u31v.js → work-discovery-overlay-CcIDsZWn.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-CqYp6zjF.js → workflow-run-setup-panel-YP4TJpWE.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-CYqVuquq.js +6 -0
- package/dist/gateway/static/root/assets/{workspace-api-Bu6Csrxf.js → workspace-api-C01xjDt2.js} +2 -2
- package/dist/gateway/static/root/assets/xml-_d7dTN2Q.js +3 -0
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-D3Cyk8pp.js → xopc-cloud-account-card-Cspd770Z.js} +1 -1
- package/dist/gateway/static/root/index.html +38 -35
- package/dist/package.js +1 -1
- package/dist/packages/realtime-protocol/src/voice-catalog.js +7 -2
- package/dist/src/agent/embedded/run-turn.js +38 -0
- package/dist/src/agent/embedded/session-runner.js +21 -3
- package/dist/src/agent/embedded/tool-metadata.d.ts +2 -1
- package/dist/src/agent/external-tools/index.js +6 -3
- package/dist/src/agent/external-tools/tool-registry.d.ts +2 -1
- package/dist/src/agent/prompt/response-language.js +9 -1
- package/dist/src/agent/session/session-config-service.js +0 -13
- package/dist/src/agent/tasks/task-judge-service.d.ts +2 -2
- package/dist/src/agent/tasks/task-judge-service.js +16 -9
- package/dist/src/agent/tools/xopc-use-tool.js +6 -2
- package/dist/src/browser/native-messaging-host.js +1 -1
- package/dist/src/browser/providers/browser-ext-install.js +2 -2
- package/dist/src/cli/bin.js +2 -2
- package/dist/src/cli/commands/agent.js +2 -2
- package/dist/src/cli/commands/auth.js +1 -1
- package/dist/src/cli/commands/extension-agent-plugin.js +1 -1
- package/dist/src/cli/commands/extension-dev.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +1 -1
- package/dist/src/cli/commands/extension.js +1 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/gateway-ssh-tunnel.js +1 -1
- package/dist/src/cli/commands/import.js +1 -1
- package/dist/src/cli/commands/mcp.js +2 -2
- package/dist/src/cli/commands/models.js +2 -2
- package/dist/src/cli/commands/onboard/model.js +2 -2
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/platform.js +1 -1
- package/dist/src/cli/commands/profile.js +1 -1
- package/dist/src/cli/commands/tunnel.js +1 -1
- package/dist/src/cli/commands/update.js +1 -1
- package/dist/src/cli/extension-cli-register.js +1 -1
- package/dist/src/config/index.js +1 -1
- package/dist/src/endpoint-tools/registry.d.ts +4 -1
- package/dist/src/endpoint-tools/registry.js +14 -0
- package/dist/src/gateway/chat-stream/mapper.d.ts +2 -0
- package/dist/src/gateway/chat-stream/mapper.js +4 -1
- package/dist/src/gateway/chat-stream/protocol.d.ts +4 -1
- package/dist/src/gateway/hono/app.js +1 -1
- package/dist/src/gateway/hono/routes/browser-install.js +1 -1
- package/dist/src/gateway/hono/routes/chat-model-config.d.ts +0 -4
- package/dist/src/gateway/hono/routes/chat-model-config.js +0 -6
- package/dist/src/gateway/hono/routes/devices.js +1 -0
- package/dist/src/gateway/hono/routes/endpoint-tools.js +1 -0
- package/dist/src/gateway/hono/routes/personal-agent.js +4 -2
- package/dist/src/gateway/hono/routes/voice.js +12 -4
- package/dist/src/gateway/rate-limit/buckets.d.ts +1 -1
- package/dist/src/gateway/rate-limit/buckets.js +2 -2
- package/dist/src/gateway/run-loop.js +1 -1
- package/dist/src/gateway/server.js +1 -1
- package/dist/src/gateway/service/run-gateway-agent.js +8 -3
- package/dist/src/gateway/side-chat/manager.js +1 -1
- package/dist/src/personal-agent/communication.d.ts +2 -1
- package/dist/src/personal-agent/communication.js +4 -3
- package/dist/src/personal-agent/prompts.d.ts +1 -0
- package/dist/src/personal-agent/prompts.js +29 -5
- package/dist/src/personal-agent/reply-composer.js +19 -4
- package/dist/src/personal-agent/reply-style.d.ts +4 -2
- package/dist/src/personal-agent/reply-style.js +57 -5
- package/dist/src/storage/sqlite/device-pairing-approval.js +1 -1
- package/dist/src/tasks/capabilities/write.js +10 -1
- package/dist/src/tasks/task-application-service.js +5 -4
- package/dist/src/tasks/task-context-assembler.js +1 -0
- package/dist/src/tasks/task-contract-definition.d.ts +1 -1
- package/dist/src/tasks/task-contract-definition.js +2 -2
- package/dist/src/tasks/task-contract-planner.d.ts +1 -0
- package/dist/src/tasks/task-contract-planner.js +2 -1
- package/dist/src/tasks/task-language.d.ts +7 -0
- package/dist/src/tasks/task-language.js +15 -0
- package/dist/src/tasks/task-read-model-projector.js +3 -2
- package/dist/src/tasks/task-result-delivery-service.js +2 -1
- package/dist/src/tasks/task-run-coordinator.js +22 -8
- package/dist/src/tasks/task-run-dispatcher.js +8 -6
- package/dist/src/voice/platform-catalog.d.ts +1 -0
- package/dist/src/voice/platform-settings.d.ts +1 -1
- package/dist/src/voice/platform-settings.js +6 -2
- package/dist/src/voice/platform-streams.js +4 -1
- package/dist/src/voice/realtime/agentEngine.js +51 -2
- package/dist/src/voice/realtime/engine.d.ts +4 -0
- package/dist/src/voice/realtime/omniRoute.d.ts +1 -1
- package/dist/src/voice/realtime/omniRoute.js +4 -1
- package/dist/src/voice/realtime/runtime.js +3 -3
- package/dist/src/voice/tts/providers/xopc-cloud-speech.js +6 -2
- package/dist/src/voice/tts/speech-provider-types.d.ts +1 -0
- package/package.json +6 -6
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DLrGOiCS.js +0 -1
- package/dist/gateway/static/root/assets/agents-CUnG8q3J.js +0 -66
- package/dist/gateway/static/root/assets/automations-workspace-BblZP4ft.js +0 -6
- package/dist/gateway/static/root/assets/capabilities-page-CbPvaNJF.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CjApEiV4.js +0 -8
- package/dist/gateway/static/root/assets/channels-CJUz97Cw.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-CbxL6ENI.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-CHAa_VNb.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-BcSr6MzW.js +0 -1
- package/dist/gateway/static/root/assets/home-page-CKeRXki2.js +0 -2
- package/dist/gateway/static/root/assets/index-B3BVcMQj.js +0 -106
- package/dist/gateway/static/root/assets/index-BU0KqtLI.css +0 -1
- package/dist/gateway/static/root/assets/markdown-view-CdqdeQqI.js +0 -201
- package/dist/gateway/static/root/assets/models-hub-cache-D0yA-nf6.js +0 -1
- package/dist/gateway/static/root/assets/notes-page-kBo3rUvj.js +0 -8
- package/dist/gateway/static/root/assets/personal-page-Bf07rfSd.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-C3wJ8U07.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BvhaF5Pi.js +0 -1
- package/dist/gateway/static/root/assets/send-session-input-C449pdoe.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-CKFTwYtq.js +0 -16
- package/dist/gateway/static/root/assets/sessions-page-DtB119_G.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-2ciK8mPP.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-VtNv07PN.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-B4Gwo5T7.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-DMzGl3CE.js +0 -6
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{g as i}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{n as a,r as o}from"./popover-select-BgSdSbCL.js";import{t as s}from"./download-Dk-ZjtO6.js";import{t as c}from"./search-DA7gz22f.js";import{t as l}from"./x-B_N4OPjy.js";import{t as u}from"./messages-BpEhZm54.js";import{t as d}from"./cn-JdwAhgNB.js";import{a as f,c as p,n as m,r as h}from"./locale-store-CeoW7A5a.js";import{a as g,n as _,o as v,r as y,s as b,t as x}from"./dist-BGTk37IG.js";import{u as S}from"./session-api-CVHFZq_A.js";import{t as C}from"./copy-to-clipboard-HOJ79TWv.js";import{t as w}from"./button-CS04eWY9.js";import{a as T}from"./gateway-realtime-BaE0shFY.js";import{o as E,t as D}from"./form-field-width-DJw_jULe.js";import{a as O,i as k,o as A,s as j}from"./dist-C3DSFZCi.js";import{t as M}from"./skeleton-BwbyijEw.js";import{i as N,o as P,s as F}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{Js as I,Tc as L,Wo as R,Ys as z,ec as B,li as ee,qt as V,ws as te,xo as H,yc as U}from"./index-B3BVcMQj.js";import{r as W}from"./settings-page-layout-X1x-2Cp9.js";var G=e(t(),1),K=n();function q(e){let t=new URLSearchParams;if(!e)return``;e.level?.length&&t.set(`level`,e.level.join(`,`)),e.from&&t.set(`from`,e.from),e.to&&t.set(`to`,e.to),e.q&&t.set(`q`,e.q),e.module&&t.set(`module`,e.module),e.requestId&&t.set(`requestId`,e.requestId),e.conversationId&&t.set(`conversationId`,e.conversationId),e.transcriptId&&t.set(`transcriptId`,e.transcriptId),e.limit!=null&&t.set(`limit`,String(e.limit)),e.offset!=null&&t.set(`offset`,String(e.offset));let n=t.toString();return n?`?${n}`:``}async function J(e){return f(h(`/api/logs${q(e)}`))}async function Y(){return(await f(h(`/api/logs/files`))).files??[]}async function X(){return(await f(h(`/api/logs/modules`))).modules??[]}async function Z(){let e=await f(h(`/api/logs/stats`));return{byLevel:e.byLevel??{},runtime:e.runtime}}async function Q(){return(await f(h(`/api/logs/dir`))).dir??``}async function ne(){return(await f(h(`/api/logs/level`))).level??`info`}async function re(e,t){return f(h(`/api/logs/level`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({level:e,...t==null?{}:{duration:String(t)}})})}async function ie(e){let t=new URLSearchParams;e?.from&&t.set(`from`,e.from),e?.to&&t.set(`to`,e.to),e?.limit!=null&&t.set(`limit`,String(e.limit));let n=t.toString();return(await f(h(`/api/logs/errors/summary${n?`?${n}`:``}`))).items??[]}var ae=500,oe=class{_callbacks;_cleanup;constructor(e){this._callbacks=e}connect(e,t){this.disconnect();let n=new Set(e?.length?e:[`trace`,`debug`,`info`,`warn`,`error`,`fatal`]);this._cleanup=T(`logs`,{onEvent:e=>{if(e.event!==`log.entry`||!e.data||typeof e.data!=`object`)return;let r=e.data;!n.has(r.level)||t&&r.module!==t||this._callbacks.onEntry(r)},onGap:()=>this._callbacks.onError(`Live log replay gap; refresh the log query`)}),this._callbacks.onConnected()}disconnect(){this._cleanup?.(),this._cleanup=void 0}};function se(e,t){let n=`${t.timestamp}-${t.requestId??``}-${t.message}`;return[t,...e.filter(e=>`${e.timestamp}-${e.requestId??``}-${e.message}`!==n)].slice(0,ae)}var ce=[`trace`,`debug`,`info`,`warn`,`error`,`fatal`];function le(e){let t=new Date(String(e.timestamp)).getTime();return Number.isFinite(t)?t:0}function ue(e){return e.toSorted((e,t)=>le(t)-le(e))}var de=new Set(ce),fe=[`error`,`fatal`],pe=[`warn`,`error`,`fatal`],me=[`info`,`warn`,`error`,`fatal`];function he(e){if(!e)return new Set;let t=new Set;for(let n of e.split(`,`)){let e=n.trim();de.has(e)&&t.add(e)}return t}function ge(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function _e(e,t){return e.size===t.length?t.every(t=>e.has(t)):!1}function ve(e){return e.size===0?`all`:_e(e,fe)?`errors`:_e(e,pe)?`warnPlus`:_e(e,me)?`infoPlus`:e.size===ce.length&&ce.every(t=>e.has(t))?`verbose`:`custom`}function ye(e){let t=ve(e);return t===`custom`?`other`:t}function be(e){switch(e){case`all`:return new Set;case`errors`:return new Set(fe);case`warnPlus`:return new Set(pe);case`infoPlus`:return new Set(me);case`verbose`:return new Set(ce)}}function xe(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>String(t[n]??``))}function Se(e){return String(e.module||e.service||e.extension||`—`)}function Ce(e){if(typeof e.message==`string`&&e.message)return e.message;try{return JSON.stringify(e)}catch{return``}}function we(e){try{return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}catch{return e}}function Te(e){try{return new Date(e).toLocaleString()}catch{return e}}function Ee(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function De(e){let t=e.trim();return t.length<=10?t:`${t.slice(0,8)}…`}function Oe(e){return String(e).toLowerCase()}function ke(e){let t=e.phase??e.meta?.phase;return typeof t==`string`&&t.trim()?t:`—`}function Ae(e){return`${e.timestamp}-${e.requestId??``}-${e.message}`}function je(e){let t=e.err??e.meta?.err;if(!t||typeof t!=`object`)return null;let n=t;return{name:typeof n.name==`string`?n.name:void 0,message:typeof n.message==`string`?n.message:void 0,stack:typeof n.stack==`string`?n.stack:void 0}}function Me(e,t){if(t.selectedLevels.size>0&&!t.selectedLevels.has(e.level)||t.moduleFilter&&Se(e)!==t.moduleFilter||t.requestIdFilter&&e.requestId!==t.requestIdFilter||t.transcriptIdFilter&&e.transcriptId!==t.transcriptIdFilter&&e.conversationId!==t.transcriptIdFilter)return!1;if(t.dateFrom){let n=new Date(t.dateFrom).getTime(),r=new Date(String(e.timestamp)).getTime();if(Number.isFinite(n)&&Number.isFinite(r)&&r<n)return!1}if(t.dateTo){let n=new Date(t.dateTo).getTime(),r=new Date(String(e.timestamp)).getTime();if(Number.isFinite(n)&&Number.isFinite(r)&&r>n)return!1}if(t.debouncedSearch){let n=t.debouncedSearch.toLowerCase();if(![e.message,Se(e),ke(e),e.requestId,e.conversationId,e.transcriptId,je(e)?.message,je(e)?.stack].filter(Boolean).map(String).join(` `).toLowerCase().includes(n))return!1}return!0}function Ne(e,t){let n=[];for(let r of ce){let i=e[r]??0;i>0&&n.push(`${t[r]} ${i}`)}return n.join(` · `)}function Pe(e,t){switch(t.type){case`setSearchInput`:return e.searchInput===t.value?e:{...e,searchInput:t.value};case`setDebouncedSearch`:return e.debouncedSearch===t.value?e:{...e,debouncedSearch:t.value};case`setLevels`:return ge(e.selectedLevels,t.value)?e:{...e,selectedLevels:t.value};case`toggleLevel`:{let n=new Set(e.selectedLevels);return n.has(t.level)?n.delete(t.level):n.add(t.level),{...e,selectedLevels:n}}case`setModule`:return e.moduleFilter===t.value?e:{...e,moduleFilter:t.value};case`setRequestIdFilter`:return e.requestIdFilter===t.value?e:{...e,requestIdFilter:t.value};case`setTranscriptIdFilter`:return e.transcriptIdFilter===t.value?e:{...e,transcriptIdFilter:t.value};case`setDateFrom`:return e.dateFrom===t.value?e:{...e,dateFrom:t.value};case`setDateTo`:return e.dateTo===t.value?e:{...e,dateTo:t.value};case`setAutoRefresh`:return e.autoRefresh===t.value?e:{...e,autoRefresh:t.value};case`syncFromUrl`:{let n=t.payload;return e.searchInput===n.searchInput&&e.debouncedSearch===n.debouncedSearch&&ge(e.selectedLevels,n.selectedLevels)&&e.moduleFilter===n.moduleFilter&&e.requestIdFilter===n.requestIdFilter&&e.transcriptIdFilter===n.transcriptIdFilter&&e.dateFrom===n.dateFrom&&e.dateTo===n.dateTo&&e.autoRefresh===n.autoRefresh?e:{...e,...n}}case`clearAll`:return{searchInput:``,debouncedSearch:``,selectedLevels:new Set,moduleFilter:``,requestIdFilter:``,transcriptIdFilter:``,dateFrom:``,dateTo:``,autoRefresh:e.autoRefresh}}}var Fe={logs:[],loading:!1,error:null,hasMore:!1,modules:[],files:[],stats:null,logDir:null};function Ie(e,t){switch(t.type){case`queryStart`:return{...e,loading:!0,error:null,logs:[]};case`querySuccess`:return{...e,loading:!1,logs:ue(t.logs),hasMore:t.hasMore};case`queryError`:return t.resetLogs?{...e,loading:!1,error:t.message,logs:[],hasMore:!1}:{...e,loading:!1,error:t.message};case`appendSuccess`:return{...e,loading:!1,logs:ue([...e.logs,...t.logs]),hasMore:t.hasMore};case`metaSuccess`:return{...e,modules:t.modules,stats:t.stats,files:t.files};case`filesSuccess`:return{...e,files:t.files,logDir:t.logDir};case`filesClear`:return{...e,files:[]};case`liveTick`:return{...e,logs:ue(t.logs),hasMore:t.hasMore,stats:t.stats};case`appendLiveEntry`:return{...e,logs:ue(se(e.logs,t.entry))};case`updateStats`:return{...e,stats:t.stats};case`refreshAllSuccess`:return{...e,loading:!1,logs:ue(t.logs),hasMore:t.hasMore,stats:t.stats,files:t.files}}}function Le(e){let t=u(e).logs,n=p(e=>e.conversationId),r=!!n,[a,o]=i(),s=(0,G.useRef)(a),[c,l]=(0,G.useReducer)(Pe,void 0,()=>{let e=s.current,t=e.get(`q`)??``;return{searchInput:t,debouncedSearch:t.trim(),selectedLevels:he(e.get(`level`)),moduleFilter:e.get(`module`)??``,requestIdFilter:e.get(`requestId`)??``,transcriptIdFilter:e.get(`transcriptId`)??``,dateFrom:e.get(`from`)??``,dateTo:e.get(`to`)??``,autoRefresh:e.get(`live`)===`1`}}),[d,f]=(0,G.useReducer)(Ie,Fe),[m,h]=(0,G.useState)(null),[g,_]=(0,G.useState)(!1),[v,y]=(0,G.useState)(!1),[b,x]=(0,G.useState)(null),[C,w]=(0,G.useState)([]),[T,E]=(0,G.useState)(!1),{searchInput:D,debouncedSearch:O,selectedLevels:k,moduleFilter:A,requestIdFilter:j,transcriptIdFilter:M,dateFrom:N,dateTo:P,autoRefresh:F}=c,{logs:I,loading:L,error:R,hasMore:z,modules:B,files:ee,stats:V,logDir:te}=d,H=(0,G.useCallback)(e=>l({type:`setSearchInput`,value:e}),[]),U=(0,G.useCallback)(e=>l({type:`setLevels`,value:e}),[]),W=(0,G.useCallback)(e=>l({type:`setModule`,value:e}),[]),K=(0,G.useCallback)(e=>l({type:`setRequestIdFilter`,value:e}),[]),q=(0,G.useCallback)(e=>l({type:`setTranscriptIdFilter`,value:e}),[]),ne=(0,G.useCallback)(e=>l({type:`setDateFrom`,value:e}),[]),re=(0,G.useCallback)(e=>l({type:`setDateTo`,value:e}),[]),ae=(0,G.useCallback)(e=>l({type:`setAutoRefresh`,value:e}),[]),se=(0,G.useMemo)(()=>ye(k),[k]),ce=e=>{if(e===`other`){y(!0);return}l({type:`setLevels`,value:be(e)})},le=O.length>0||k.size>0||!!A||!!j||!!M||!!N||!!P,ue=+(O.length>0)+ +(k.size>0)+ +!!A+ +!!j+ +!!M+(N||P?1:0);(0,G.useEffect)(()=>{let e=setTimeout(()=>l({type:`setDebouncedSearch`,value:D.trim()}),300);return()=>clearTimeout(e)},[D]),(0,G.useEffect)(()=>{let e=a.get(`q`)??``;l({type:`syncFromUrl`,payload:{searchInput:e,debouncedSearch:e.trim(),selectedLevels:he(a.get(`level`)),moduleFilter:a.get(`module`)??``,requestIdFilter:a.get(`requestId`)??``,transcriptIdFilter:a.get(`transcriptId`)??``,dateFrom:a.get(`from`)??``,dateTo:a.get(`to`)??``,autoRefresh:a.get(`live`)===`1`}})},[a]),(0,G.useEffect)(()=>{let e=new URLSearchParams(a),t=O.trim();t?e.set(`q`,t):e.delete(`q`),k.size>0?e.set(`level`,Array.from(k).sort().join(`,`)):e.delete(`level`),A?e.set(`module`,A):e.delete(`module`),j?e.set(`requestId`,j):e.delete(`requestId`),M?e.set(`transcriptId`,M):e.delete(`transcriptId`),N?e.set(`from`,N):e.delete(`from`),P?e.set(`to`,P):e.delete(`to`),F?e.set(`live`,`1`):e.delete(`live`),e.toString()!==a.toString()&&o(e,{replace:!0})},[F,N,P,O,A,j,M,a,k,o]);let de=(0,G.useMemo)(()=>({q:O||void 0,level:k.size>0?Array.from(k):void 0,module:A||void 0,requestId:j||void 0,transcriptId:M||void 0,from:N||void 0,to:P||void 0,limit:50}),[O,k,A,j,M,N,P]),fe=(0,G.useMemo)(()=>({debouncedSearch:O,selectedLevels:k,moduleFilter:A,requestIdFilter:j,transcriptIdFilter:M,dateFrom:N,dateTo:P}),[O,k,A,j,M,N,P]),pe=(0,G.useRef)(fe);return pe.current=fe,(0,G.useEffect)(()=>{if(!r)return;let e=!1;return E(!0),ie({from:N||void 0,to:P||void 0,limit:12}).then(t=>{e||w(t)}).catch(()=>{e||w([])}).finally(()=>{e||E(!1)}),()=>{e=!0}},[r,N,P]),(0,G.useEffect)(()=>{if(!r)return;let e=!1;return f({type:`queryStart`}),(async()=>{try{let t=await J({...de,offset:0});if(e)return;f({type:`querySuccess`,logs:t.logs,hasMore:t.logs.length===50})}catch(n){e||f({type:`queryError`,message:n instanceof Error?n.message:t.loadError,resetLogs:!0})}})(),()=>{e=!0}},[r,de,t.loadError]),(0,G.useEffect)(()=>{if(!r)return;let e=!1;return(async()=>{try{let[t,n,r]=await Promise.all([X(),Z(),Y()]);e||f({type:`metaSuccess`,modules:t,stats:n,files:r})}catch{}})(),()=>{e=!0}},[r]),(0,G.useEffect)(()=>{if(!r||!g)return;let e=!1;return(async()=>{try{let[t,n]=await Promise.all([Y(),Q()]);e||f({type:`filesSuccess`,files:t,logDir:n})}catch{e||f({type:`filesClear`})}})(),()=>{e=!0}},[r,g]),(0,G.useEffect)(()=>{if(!F||!r)return;let e=new oe({onConnected:()=>{},onEntry:e=>{Me(e,pe.current)&&f({type:`appendLiveEntry`,entry:e})},onError:()=>{}});e.connect(k.size>0?Array.from(k):void 0,A||void 0);let t=window.setInterval(()=>{Z().then(e=>{f({type:`updateStats`,stats:e})}).catch(()=>{})},3e4);return()=>{e.disconnect(),clearInterval(t)}},[F,r,n,k,A]),(0,G.useEffect)(()=>{if(!b)return;let e=window.setTimeout(()=>x(null),2e3);return()=>clearTimeout(e)},[b]),{L:t,hasToken:r,logs:I,loading:L,error:R,hasMore:z,searchInput:D,setSearchInput:H,selectedLevels:k,setSelectedLevels:U,moduleFilter:A,setModuleFilter:W,requestIdFilter:j,transcriptIdFilter:M,dateFrom:N,setDateFrom:ne,dateTo:P,setDateTo:re,modules:B,files:ee,stats:V,selectedLog:m,setSelectedLog:h,filesOpen:g,setFilesOpen:_,filtersOpen:v,setFiltersOpen:y,logDir:te,autoRefresh:F,setAutoRefresh:ae,copiedDetail:b,setCopiedDetail:x,hasActiveFilters:le,activeFilterCount:ue,clearFilters:()=>l({type:`clearAll`}),toggleDialogLevel:e=>l({type:`toggleLevel`,level:e}),handleLoadMore:()=>{L||!z||(async()=>{f({type:`queryStart`});try{let e=await J({...de,offset:I.length});f({type:`appendSuccess`,logs:e.logs,hasMore:e.logs.length===50})}catch(e){f({type:`queryError`,message:e instanceof Error?e.message:t.loadError})}})()},refreshAll:()=>{(async()=>{f({type:`queryStart`});try{let e=await J({...de,offset:0}),[t,n]=await Promise.all([Z(),Y()]);f({type:`refreshAllSuccess`,logs:e.logs,hasMore:e.logs.length===50,stats:t,files:n})}catch(e){f({type:`queryError`,message:e instanceof Error?e.message:t.loadError})}})()},levelSegment:se,handleLevelSegment:ce,filterByRequestId:(0,G.useCallback)(e=>{h(null),K(e)},[K]),filterByTranscriptId:(0,G.useCallback)(e=>{h(null),q(e)},[q]),filterByErrorSummary:(0,G.useCallback)(e=>{l({type:`setSearchInput`,value:e.errName}),l({type:`setDebouncedSearch`,value:e.errName}),e.module&&l({type:`setModule`,value:e.module}),l({type:`setLevels`,value:be(`errors`)})},[]),openChatForSession:(0,G.useCallback)(e=>{let t=e.conversationId?.trim();if(t){window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{conversationId:t}}));return}let n=e.transcriptId?.trim();n&&S({transcriptId:n}).then(e=>{window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{conversationId:e.conversationId}}))}).catch(()=>{})},[]),errorSummary:C,errorSummaryLoading:T}}var $=r();function Re(e){let t=(0,K.c)(36),{L:n,items:r,loading:i,onSelectItem:a}=e,[o,s]=(0,G.useState)(!1);if(!i&&r.length===0)return null;let c;t[0]===r?c=t[1]:(c=r.reduce(Be,0),t[0]=r,t[1]=c);let l=c,u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>s(ze),t[2]=u):u=t[2];let f;t[3]===n.errorSummaryTitle?f=t[4]:(f=(0,$.jsx)(`h2`,{className:`text-sm font-semibold tracking-tight text-fg`,children:n.errorSummaryTitle}),t[3]=n.errorSummaryTitle,t[4]=f);let p;t[5]===n.errorSummaryHint?p=t[6]:(p=(0,$.jsx)(`p`,{className:`mt-0.5 text-xs leading-5 text-fg-muted`,children:n.errorSummaryHint}),t[5]=n.errorSummaryHint,t[6]=p);let m;t[7]!==f||t[8]!==p?(m=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[f,p]}),t[7]=f,t[8]=p,t[9]=m):m=t[9];let h;t[10]!==r.length||t[11]!==i||t[12]!==l?(h=i?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(M,{className:`h-5 w-8 rounded-md`}),(0,$.jsx)(M,{className:`h-5 w-10 rounded-md`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`rounded-md bg-red-500/10 px-2 py-0.5 text-xs tabular-nums text-red-600 dark:text-red-400`,children:r.length}),(0,$.jsxs)(`span`,{className:`rounded-md bg-surface-hover px-2 py-0.5 text-xs tabular-nums text-fg-muted`,children:[`×`,l]})]}),t[10]=r.length,t[11]=i,t[12]=l,t[13]=h):h=t[13];let g=o&&`rotate-180`,_;t[14]===g?_=t[15]:(_=d(`size-4 text-fg-muted transition-transform duration-150 ease-out motion-reduce:transition-none`,g),t[14]=g,t[15]=_);let v;t[16]===_?v=t[17]:(v=(0,$.jsx)(L,{className:_,strokeWidth:1.75,"aria-hidden":!0}),t[16]=_,t[17]=v);let y;t[18]!==h||t[19]!==v?(y=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 pt-0.5`,children:[h,v]}),t[18]=h,t[19]=v,t[20]=y):y=t[20];let b;t[21]!==o||t[22]!==y||t[23]!==m?(b=(0,$.jsxs)(`button`,{type:`button`,onClick:u,"aria-expanded":o,className:`flex w-full items-start justify-between gap-3 px-4 py-4 text-left transition-colors hover:bg-surface-hover/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-inset sm:px-5`,children:[m,y]}),t[21]=o,t[22]=y,t[23]=m,t[24]=b):b=t[24];let x;t[25]!==n.module||t[26]!==n.phase||t[27]!==n.time||t[28]!==o||t[29]!==r||t[30]!==i||t[31]!==a?(x=o&&!i&&r.length>0?(0,$.jsx)(`ul`,{className:`mx-1 mb-1 flex flex-col gap-1 rounded-lg bg-surface-base/45 p-1 [&>li]:rounded-lg`,children:r.map(e=>(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>a?.(e),className:d(`flex w-full flex-col gap-1 px-4 py-2.5 text-left transition-colors hover:bg-surface-hover`,a&&`cursor-pointer`),children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-fg`,children:e.errName}),(0,$.jsxs)(`span`,{className:`shrink-0 rounded-md bg-red-500/10 px-2 py-0.5 text-xs tabular-nums text-red-600 dark:text-red-400`,children:[`×`,e.count]})]}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-x-3 gap-y-1 text-xs text-fg-muted`,children:[e.phase?(0,$.jsxs)(`span`,{children:[n.phase,`: `,e.phase]}):null,e.module?(0,$.jsxs)(`span`,{children:[n.module,`: `,e.module]}):null,(0,$.jsxs)(`span`,{children:[n.time,`: `,we(e.lastSeen)]})]}),(0,$.jsx)(`p`,{className:`truncate text-xs text-fg-subtle`,children:e.sampleMessage})]})},e.key))}):null,t[25]=n.module,t[26]=n.phase,t[27]=n.time,t[28]=o,t[29]=r,t[30]=i,t[31]=a,t[32]=x):x=t[32];let S;return t[33]!==b||t[34]!==x?(S=(0,$.jsxs)(`section`,{className:`overflow-hidden rounded-xl bg-surface-hover/20`,children:[b,x]}),t[33]=b,t[34]=x,t[35]=S):S=t[35],S}function ze(e){return!e}function Be(e,t){return e+t.count}function Ve(e){let t=(0,K.c)(75),{log:n,labels:r,onFilterByRequestId:i,onFilterByTranscriptId:a,onOpenChat:o}=e,s=n.level??`info`,c=typeof n.requestId==`string`?n.requestId:``,l=typeof n.conversationId==`string`?n.conversationId:``,u=typeof n.transcriptId==`string`?n.transcriptId:``,f;t[0]===n?f=t[1]:(f=ke(n),t[0]=n,t[1]=f);let p=f,m;t[2]===n?m=t[3]:(m=je(n),t[2]=n,t[3]=m);let h=m,g=s===`error`||s===`fatal`,_;t[4]===r.message?_=t[5]:(_=(0,$.jsx)(`span`,{className:`text-xs font-sans font-medium text-fg-muted`,children:r.message}),t[4]=r.message,t[5]=_);let v=g&&`border-red-500/40`,y;t[6]===v?y=t[7]:(y=d(`mt-2 whitespace-pre-wrap break-words border border-edge bg-surface-base p-3 text-xs leading-relaxed text-fg dark:border-edge`,v),t[6]=v,t[7]=y);let b=n.message||`—`,x;t[8]!==y||t[9]!==b?(x=(0,$.jsx)(`pre`,{className:y,children:b}),t[8]=y,t[9]=b,t[10]=x):x=t[10];let S;t[11]!==_||t[12]!==x?(S=(0,$.jsxs)(`div`,{children:[_,x]}),t[11]=_,t[12]=x,t[13]=S):S=t[13];let C;t[14]!==h||t[15]!==r.stackTrace?(C=h?.stack?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{className:`text-xs font-sans font-medium text-fg-muted`,children:r.stackTrace}),h.name?(0,$.jsx)(`p`,{className:`mt-1 text-xs text-red-600 dark:text-red-400`,children:h.name}):null,(0,$.jsx)(`pre`,{className:`mt-2 overflow-x-auto whitespace-pre-wrap break-words border border-red-500/30 bg-surface-base p-3 text-xs leading-relaxed text-fg dark:border-red-500/30`,children:h.stack})]}):null,t[14]=h,t[15]=r.stackTrace,t[16]=C):C=t[16];let T;t[17]===r.time?T=t[18]:(T=(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.time}),t[17]=r.time,t[18]=T);let E;t[19]===n.timestamp?E=t[20]:(E=(0,$.jsx)(`code`,{className:`break-all text-fg`,children:n.timestamp}),t[19]=n.timestamp,t[20]=E);let D;t[21]===r.level?D=t[22]:(D=(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.level}),t[21]=r.level,t[22]=D);let O=g&&`font-medium text-red-600 dark:text-red-400`,k;t[23]===O?k=t[24]:(k=d(`text-fg`,O),t[23]=O,t[24]=k);let A;t[25]===s?A=t[26]:(A=Oe(s),t[25]=s,t[26]=A);let j;t[27]!==k||t[28]!==A?(j=(0,$.jsx)(`span`,{className:k,children:A}),t[27]=k,t[28]=A,t[29]=j):j=t[29];let M;t[30]===r.module?M=t[31]:(M=(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.module}),t[30]=r.module,t[31]=M);let N;t[32]===n?N=t[33]:(N=Se(n),t[32]=n,t[33]=N);let P;t[34]===N?P=t[35]:(P=(0,$.jsx)(`code`,{className:`break-all text-fg`,children:N}),t[34]=N,t[35]=P);let F;t[36]!==r.phase||t[37]!==p?(F=p===`—`?null:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.phase}),(0,$.jsx)(`code`,{className:`break-all text-fg`,children:p})]}),t[36]=r.phase,t[37]=p,t[38]=F):F=t[38];let I;t[39]!==r.filterByRequestId||t[40]!==r.requestId||t[41]!==i||t[42]!==c?(I=c?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.requestId}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,$.jsx)(`code`,{className:`break-all text-fg`,children:c}),i?(0,$.jsx)(w,{type:`button`,variant:`secondary`,className:`h-7 px-2 text-[11px]`,onClick:()=>i(c),children:r.filterByRequestId}):null]})]}):null,t[39]=r.filterByRequestId,t[40]=r.requestId,t[41]=i,t[42]=c,t[43]=I):I=t[43];let L;t[44]!==r.conversationId||t[45]!==r.openChat||t[46]!==o||t[47]!==l?(L=l?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.conversationId}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,$.jsx)(`code`,{className:`break-all text-fg`,children:l}),o?(0,$.jsx)(w,{type:`button`,variant:`secondary`,className:`h-7 px-2 text-[11px]`,onClick:()=>o({conversationId:l}),children:r.openChat}):null]})]}):null,t[44]=r.conversationId,t[45]=r.openChat,t[46]=o,t[47]=l,t[48]=L):L=t[48];let R;t[49]!==r.filterByTranscriptId||t[50]!==r.openChat||t[51]!==r.transcriptId||t[52]!==a||t[53]!==o||t[54]!==u?(R=u?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.transcriptId}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,$.jsx)(`code`,{className:`break-all text-fg`,children:u}),a?(0,$.jsx)(w,{type:`button`,variant:`secondary`,className:`h-7 px-2 text-[11px]`,onClick:()=>a(u),children:r.filterByTranscriptId}):null,o?(0,$.jsx)(w,{type:`button`,variant:`secondary`,className:`h-7 px-2 text-[11px]`,onClick:()=>o({transcriptId:u}),children:r.openChat}):null]})]}):null,t[49]=r.filterByTranscriptId,t[50]=r.openChat,t[51]=r.transcriptId,t[52]=a,t[53]=o,t[54]=u,t[55]=R):R=t[55];let z;t[56]!==T||t[57]!==E||t[58]!==D||t[59]!==j||t[60]!==M||t[61]!==P||t[62]!==F||t[63]!==I||t[64]!==L||t[65]!==R?(z=(0,$.jsxs)(`div`,{className:`grid grid-cols-[5.5rem_1fr] gap-x-3 gap-y-2 text-xs`,children:[T,E,D,j,M,P,F,I,L,R]}),t[56]=T,t[57]=E,t[58]=D,t[59]=j,t[60]=M,t[61]=P,t[62]=F,t[63]=I,t[64]=L,t[65]=R,t[66]=z):z=t[66];let B;t[67]!==r.metadata||t[68]!==n.meta?(B=n.meta&&Object.keys(n.meta).length>0?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{className:`text-xs font-sans font-medium text-fg-muted`,children:r.metadata}),(0,$.jsx)(`pre`,{className:`mt-2 overflow-x-auto whitespace-pre-wrap break-words border border-edge bg-surface-base p-3 text-xs leading-relaxed text-fg dark:border-edge`,children:JSON.stringify(n.meta,null,2)})]}):null,t[67]=r.metadata,t[68]=n.meta,t[69]=B):B=t[69];let ee;return t[70]!==z||t[71]!==B||t[72]!==S||t[73]!==C?(ee=(0,$.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[S,C,z,B]}),t[70]=z,t[71]=B,t[72]=S,t[73]=C,t[74]=ee):ee=t[74],ee}function He(e){let t=(0,K.c)(50),{L:n,log:r,onClose:i,copiedDetail:a,onCopiedMessage:o,onCopiedJson:s,onFilterByRequestId:c,onFilterByTranscriptId:u,onOpenChat:f}=e,p=r!==null,m;t[0]===i?m=t[1]:(m=e=>!e&&i(),t[0]=i,t[1]=m);let h;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(g,{className:d(`xopc-dialog-overlay fixed inset-0 bg-scrim`,P)}),t[2]=h):h=t[2];let S;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(S=d(`xopc-drawer-right fixed right-0 top-0 flex size-full max-w-lg flex-col border-l border-edge bg-surface-overlay shadow-popover outline-none`,N,`dark:border-edge`),t[3]=S):S=t[3];let T;t[4]===n.details?T=t[5]:(T=(0,$.jsx)(b,{className:`text-base font-semibold tracking-tight text-fg`,children:n.details}),t[4]=n.details,t[5]=T);let E;t[6]!==n.copied||t[7]!==n.copyJson||t[8]!==n.copyMessage||t[9]!==a||t[10]!==r||t[11]!==s||t[12]!==o?(E=r?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(w,{type:`button`,variant:`ghost`,className:`h-9 shrink-0 gap-1 px-2 text-xs`,onClick:()=>{C(typeof r.message==`string`?r.message:``).then(e=>{e&&o()})},children:[(0,$.jsx)(U,{className:`size-3.5 shrink-0`,strokeWidth:1.75}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:a===`message`?n.copied:n.copyMessage})]}),(0,$.jsxs)(w,{type:`button`,variant:`ghost`,className:`h-9 shrink-0 gap-1 px-2 text-xs`,onClick:()=>{C(JSON.stringify(r,null,2)).then(e=>{e&&s()})},children:[(0,$.jsx)(U,{className:`size-3.5 shrink-0`,strokeWidth:1.75}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:a===`json`?n.copied:n.copyJson})]})]}):null,t[6]=n.copied,t[7]=n.copyJson,t[8]=n.copyMessage,t[9]=a,t[10]=r,t[11]=s,t[12]=o,t[13]=E):E=t[13];let D;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(l,{className:`size-5`,strokeWidth:1.75}),t[14]=D):D=t[14];let O;t[15]===n.close?O=t[16]:(O=(0,$.jsx)(_,{asChild:!0,children:(0,$.jsx)(w,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":n.close,children:D})}),t[15]=n.close,t[16]=O);let k;t[17]!==E||t[18]!==O?(k=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[E,O]}),t[17]=E,t[18]=O,t[19]=k):k=t[19];let A;t[20]!==T||t[21]!==k?(A=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3 dark:border-edge`,children:[T,k]}),t[20]=T,t[21]=k,t[22]=A):A=t[22];let j;t[23]!==n.conversationId||t[24]!==n.filterByRequestId||t[25]!==n.filterByTranscriptId||t[26]!==n.level||t[27]!==n.message||t[28]!==n.metadata||t[29]!==n.module||t[30]!==n.openChat||t[31]!==n.phase||t[32]!==n.requestId||t[33]!==n.stackTrace||t[34]!==n.time||t[35]!==n.transcriptId||t[36]!==r||t[37]!==c||t[38]!==u||t[39]!==f?(j=r?(0,$.jsx)(Ve,{log:r,labels:{time:n.time,level:n.level,module:n.module,message:n.message,metadata:n.metadata,requestId:n.requestId,conversationId:n.conversationId,transcriptId:n.transcriptId,phase:n.phase,stackTrace:n.stackTrace,filterByRequestId:n.filterByRequestId,filterByTranscriptId:n.filterByTranscriptId,openChat:n.openChat},onFilterByRequestId:c,onFilterByTranscriptId:u,onOpenChat:f}):null,t[23]=n.conversationId,t[24]=n.filterByRequestId,t[25]=n.filterByTranscriptId,t[26]=n.level,t[27]=n.message,t[28]=n.metadata,t[29]=n.module,t[30]=n.openChat,t[31]=n.phase,t[32]=n.requestId,t[33]=n.stackTrace,t[34]=n.time,t[35]=n.transcriptId,t[36]=r,t[37]=c,t[38]=u,t[39]=f,t[40]=j):j=t[40];let M;t[41]===j?M=t[42]:(M=(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-4 font-mono text-sm leading-relaxed`,children:j}),t[41]=j,t[42]=M);let F;t[43]!==A||t[44]!==M?(F=(0,$.jsxs)(v,{children:[h,(0,$.jsxs)(y,{className:S,"aria-describedby":void 0,children:[A,M]})]}),t[43]=A,t[44]=M,t[45]=F):F=t[45];let I;return t[46]!==p||t[47]!==F||t[48]!==m?(I=(0,$.jsx)(x,{open:p,onOpenChange:m,children:F}),t[46]=p,t[47]=F,t[48]=m,t[49]=I):I=t[49],I}function Ue(e){let t=(0,K.c)(25),{L:n,open:r,onOpenChange:i,files:a,logDir:o}=e,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(g,{className:d(`xopc-dialog-overlay fixed inset-0 bg-scrim`,P)}),t[0]=s):s=t[0];let c;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=d(`xopc-dialog-content fixed left-1/2 top-1/2 flex max-h-[min(32rem,85vh)] w-[min(100%-2rem,24rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl border border-edge bg-surface-overlay shadow-popover outline-none`,N,`dark:border-edge`),t[1]=c):c=t[1];let u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(z,{className:`size-4 text-fg-muted`,strokeWidth:1.75}),t[2]=u):u=t[2];let f;t[3]===n.logFiles?f=t[4]:(f=(0,$.jsxs)(b,{className:`flex items-center gap-2 text-base font-semibold tracking-tight text-fg`,children:[u,n.logFiles]}),t[3]=n.logFiles,t[4]=f);let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(l,{className:`size-5`,strokeWidth:1.75}),t[5]=p):p=t[5];let m;t[6]===n.close?m=t[7]:(m=(0,$.jsx)(_,{asChild:!0,children:(0,$.jsx)(w,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":n.close,children:p})}),t[6]=n.close,t[7]=m);let h;t[8]!==f||t[9]!==m?(h=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3 dark:border-edge`,children:[f,m]}),t[8]=f,t[9]=m,t[10]=h):h=t[10];let S;t[11]!==n.filesEmpty||t[12]!==a?(S=(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:a.length===0?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.filesEmpty}):(0,$.jsx)(`ul`,{className:`flex flex-col gap-2`,children:a.map(We)})}),t[11]=n.filesEmpty,t[12]=a,t[13]=S):S=t[13];let C;t[14]!==n.logDir||t[15]!==o?(C=o?(0,$.jsxs)(`div`,{className:`shrink-0 border-t border-edge-subtle px-4 py-2 text-xs text-fg-subtle dark:border-edge`,children:[(0,$.jsxs)(`span`,{className:`font-medium text-fg-muted`,children:[n.logDir,`: `]}),(0,$.jsx)(`code`,{className:`break-all text-fg-subtle`,children:o})]}):null,t[14]=n.logDir,t[15]=o,t[16]=C):C=t[16];let T;t[17]!==h||t[18]!==S||t[19]!==C?(T=(0,$.jsxs)(v,{children:[s,(0,$.jsxs)(y,{className:c,children:[h,S,C]})]}),t[17]=h,t[18]=S,t[19]=C,t[20]=T):T=t[20];let E;return t[21]!==i||t[22]!==r||t[23]!==T?(E=(0,$.jsx)(x,{open:r,onOpenChange:i,children:T}),t[21]=i,t[22]=r,t[23]=T,t[24]=E):E=t[24],E}function We(e){return(0,$.jsxs)(`li`,{className:`flex flex-col gap-1 rounded-lg border border-edge-subtle bg-surface-base px-3 py-2 dark:border-edge`,children:[(0,$.jsx)(`span`,{className:`break-all font-mono text-xs text-fg`,children:e.name}),(0,$.jsxs)(`span`,{className:`flex flex-wrap gap-x-2 text-xs text-fg-subtle`,children:[(0,$.jsx)(`span`,{children:Ee(e.size)}),(0,$.jsx)(`span`,{children:Te(e.modified)})]})]},e.name)}function Ge(e){let t=(0,K.c)(68),{L:n,open:r,onOpenChange:i,dateFrom:a,onDateFromChange:o,dateTo:s,onDateToChange:c,selectedLevels:u,onToggleLevel:f}=e,p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(g,{className:d(`xopc-dialog-overlay fixed inset-0 bg-scrim`,P)}),t[0]=p):p=t[0];let m;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(m=d(`xopc-dialog-content fixed left-1/2 top-1/2 flex max-h-[min(32rem,90vh)] w-[min(100%-2rem,22rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl border border-edge bg-surface-overlay shadow-popover outline-none`,N,`dark:border-edge`),t[1]=m):m=t[1];let h;t[2]===n.filtersDialogTitle?h=t[3]:(h=(0,$.jsx)(b,{className:`text-base font-semibold tracking-tight text-fg`,children:n.filtersDialogTitle}),t[2]=n.filtersDialogTitle,t[3]=h);let S;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(l,{className:`size-5`,strokeWidth:1.75}),t[4]=S):S=t[4];let C;t[5]===n.close?C=t[6]:(C=(0,$.jsx)(_,{asChild:!0,children:(0,$.jsx)(w,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":n.close,children:S})}),t[5]=n.close,t[6]=C);let T;t[7]!==h||t[8]!==C?(T=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3 dark:border-edge`,children:[h,C]}),t[7]=h,t[8]=C,t[9]=T):T=t[9];let E;t[10]===n.filtersDialogDesc?E=t[11]:(E=(0,$.jsx)(`div`,{id:`log-filters-desc`,className:`sr-only`,children:n.filtersDialogDesc}),t[10]=n.filtersDialogDesc,t[11]=E);let D;t[12]===n.timeRange?D=t[13]:(D=(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:n.timeRange}),t[12]=n.timeRange,t[13]=D);let O;t[14]===n.from?O=t[15]:(O=(0,$.jsx)(`label`,{htmlFor:`log-from-d`,className:`mb-1 block text-xs text-fg-muted`,children:n.from}),t[14]=n.from,t[15]=O);let k;t[16]===o?k=t[17]:(k=e=>o(e.target.value),t[16]=o,t[17]=k);let A;t[18]!==a||t[19]!==k?(A=(0,$.jsx)(`input`,{id:`log-from-d`,type:`datetime-local`,value:a,onChange:k,className:`w-full rounded-xl border border-edge bg-surface-base p-2 text-sm text-fg dark:border-edge`}),t[18]=a,t[19]=k,t[20]=A):A=t[20];let j;t[21]!==A||t[22]!==O?(j=(0,$.jsxs)(`div`,{children:[O,A]}),t[21]=A,t[22]=O,t[23]=j):j=t[23];let M;t[24]===n.to?M=t[25]:(M=(0,$.jsx)(`label`,{htmlFor:`log-to-d`,className:`mb-1 block text-xs text-fg-muted`,children:n.to}),t[24]=n.to,t[25]=M);let F;t[26]===c?F=t[27]:(F=e=>c(e.target.value),t[26]=c,t[27]=F);let I;t[28]!==s||t[29]!==F?(I=(0,$.jsx)(`input`,{id:`log-to-d`,type:`datetime-local`,value:s,onChange:F,className:`w-full rounded-xl border border-edge bg-surface-base p-2 text-sm text-fg dark:border-edge`}),t[28]=s,t[29]=F,t[30]=I):I=t[30];let L;t[31]!==M||t[32]!==I?(L=(0,$.jsxs)(`div`,{children:[M,I]}),t[31]=M,t[32]=I,t[33]=L):L=t[33];let R;t[34]!==j||t[35]!==L?(R=(0,$.jsxs)(`div`,{className:`mt-2 flex flex-col gap-3`,children:[j,L]}),t[34]=j,t[35]=L,t[36]=R):R=t[36];let z;t[37]===n.levelCustom?z=t[38]:(z=(0,$.jsx)(`p`,{className:`mt-6 text-xs font-medium text-fg-muted`,children:n.levelCustom}),t[37]=n.levelCustom,t[38]=z);let B;t[39]===n.levelCustomHint?B=t[40]:(B=(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-subtle`,children:n.levelCustomHint}),t[39]=n.levelCustomHint,t[40]=B);let ee=n.level,V;t[41]!==n.levelNames||t[42]!==f||t[43]!==u?(V=ce.map(e=>(0,$.jsx)(`button`,{type:`button`,className:d(`rounded-full border px-3 py-1.5 text-xs font-medium capitalize transition-[color,background-color,border-color] duration-150 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,u.has(e)?`border-edge bg-surface-active text-fg dark:border-edge`:`border-edge-subtle bg-surface-base text-fg-muted hover:bg-surface-hover dark:border-edge`),onClick:()=>f(e),children:n.levelNames[e]},e)),t[41]=n.levelNames,t[42]=f,t[43]=u,t[44]=V):V=t[44];let te;t[45]!==n.level||t[46]!==V?(te=(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]=te):te=t[47];let H;t[48]!==R||t[49]!==z||t[50]!==B||t[51]!==te||t[52]!==D?(H=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-4`,children:[D,R,z,B,te]}),t[48]=R,t[49]=z,t[50]=B,t[51]=te,t[52]=D,t[53]=H):H=t[53];let U;t[54]===i?U=t[55]:(U=()=>i(!1),t[54]=i,t[55]=U);let W;t[56]!==n.filtersDone||t[57]!==U?(W=(0,$.jsx)(`div`,{className:`shrink-0 border-t border-edge-subtle px-4 py-3 dark:border-edge`,children:(0,$.jsx)(w,{type:`button`,className:`w-full rounded-xl`,onClick:U,children:n.filtersDone})}),t[56]=n.filtersDone,t[57]=U,t[58]=W):W=t[58];let G;t[59]!==H||t[60]!==W||t[61]!==T||t[62]!==E?(G=(0,$.jsxs)(v,{children:[p,(0,$.jsxs)(y,{className:m,"aria-describedby":`log-filters-desc`,children:[T,E,H,W]})]}),t[59]=H,t[60]=W,t[61]=T,t[62]=E,t[63]=G):G=t[63];let q;return t[64]!==i||t[65]!==r||t[66]!==G?(q=(0,$.jsx)(x,{open:r,onOpenChange:i,children:G}),t[64]=i,t[65]=r,t[66]=G,t[67]=q):q=t[67],q}var Ke=1;function qe(e,t){let n=0,r=0,i=e;for(;i&&i!==t;)n+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;return i===t?{x:n,y:r}:null}var Je=`pointer-events-none absolute left-0 top-0 z-[1] rounded-pill bg-surface-panel shadow-sm will-change-transform [backface-visibility:hidden] dark:bg-surface-panel dark:shadow-sm dark:ring-1 dark:ring-edge-strong/40`,Ye=`touch-target relative z-[2] box-border flex h-6 flex-1 cursor-pointer items-center justify-center gap-1 rounded-pill border-0 bg-transparent px-2 py-0 text-center text-xs font-medium leading-none outline-none transition-[color,background-color,box-shadow] duration-150 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel active:scale-100 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`;function Xe({value:e,onChange:t,options:n,"aria-label":r,className:i,buttonClassName:a}){let o=(0,G.useRef)(null),s=(0,G.useRef)([]),[c,l]=(0,G.useState)({x:0,y:0,w:0,h:0}),[u,f]=(0,G.useState)(!1),[p,m]=(0,G.useState)(!1),h=(0,G.useCallback)(()=>{let t=o.current;if(!t)return;let r=n.findIndex(t=>t.value===e);if(r<0)return;let i=s.current[r];if(!i)return;let a=Ke,c=t.getBoundingClientRect(),u=i.getBoundingClientRect(),d=qe(i,t),p,m;if(d)p=d.x,m=d.y;else{let e=getComputedStyle(t),n=parseFloat(e.borderLeftWidth)||0,r=parseFloat(e.borderTopWidth)||0;p=u.left-c.left-n,m=u.top-c.top-r}l({x:p+a,y:m+a,w:Math.max(0,u.width-a*2),h:Math.max(0,u.height-a*2)}),f(!0)},[n,e]),g=(0,G.useRef)(h);return g.current=h,(0,G.useLayoutEffect)(()=>{let e=requestAnimationFrame(()=>h());return()=>cancelAnimationFrame(e)},[h]),(0,G.useEffect)(()=>{let e=requestAnimationFrame(()=>{requestAnimationFrame(()=>m(!0))});return()=>cancelAnimationFrame(e)},[]),(0,G.useEffect)(()=>{let e=o.current;if(!e)return;let t=()=>{requestAnimationFrame(()=>g.current())},n=new ResizeObserver(t);return n.observe(e),window.addEventListener(`resize`,t),()=>{n.disconnect(),window.removeEventListener(`resize`,t)}},[]),(0,$.jsxs)(`div`,{ref:o,className:d(V,`relative isolate flex w-full max-w-full flex-row items-center`,i),role:`group`,"aria-label":r,children:[(0,$.jsx)(`div`,{"aria-hidden":!0,className:d(Je,`motion-reduce:!transition-none motion-reduce:!duration-0`,p&&`transition-[transform,width,height] duration-300 [transition-timing-function:cubic-bezier(0.32,0.72,0,1)]`),style:{width:c.w,height:c.h,transform:`translate3d(${c.x}px, ${c.y}px, 0)`,opacity:u&&c.w>0?1:0}}),n.map((n,r)=>{let i=n.icon,o=e===n.value;return(0,$.jsxs)(`button`,{ref:e=>{s.current[r]=e},type:`button`,"aria-pressed":o,title:n.title??n.label,onClick:()=>t(n.value),className:d(Ye,o?`text-fg`:`text-fg-subtle`,a),children:[i?(0,$.jsx)(i,{className:`block size-3 shrink-0 opacity-80`,strokeWidth:1.75,"aria-hidden":!0}):null,(0,$.jsx)(`span`,{className:`min-w-0 shrink truncate leading-none`,children:n.label})]},n.value)})]})}function Ze(e){let t=(0,K.c)(76),{L:n,levelSegment:r,onLevelSegment:i,searchInput:s,onSearchInputChange:u,moduleFilter:f,onModuleFilterChange:p,modules:m,onOpenFilters:h,activeFilterCount:g,hasActiveFilters:_,onClearFilters:v,autoRefresh:y}=e,b=n.filters,x;t[0]===n.presetAll?x=t[1]:(x={value:`all`,label:n.presetAll},t[0]=n.presetAll,t[1]=x);let S;t[2]===n.presetErrors?S=t[3]:(S={value:`errors`,label:n.presetErrors},t[2]=n.presetErrors,t[3]=S);let C;t[4]===n.presetWarnPlus?C=t[5]:(C={value:`warnPlus`,label:n.presetWarnPlus},t[4]=n.presetWarnPlus,t[5]=C);let T;t[6]===n.presetInfoPlus?T=t[7]:(T={value:`infoPlus`,label:n.presetInfoPlus},t[6]=n.presetInfoPlus,t[7]=T);let O;t[8]===n.presetVerbose?O=t[9]:(O={value:`verbose`,label:n.presetVerbose},t[8]=n.presetVerbose,t[9]=O);let k;t[10]===n.presetOther?k=t[11]:(k={value:`other`,label:n.presetOther},t[10]=n.presetOther,t[11]=k);let A;t[12]!==x||t[13]!==S||t[14]!==C||t[15]!==T||t[16]!==O||t[17]!==k?(A=[x,S,C,T,O,k],t[12]=x,t[13]=S,t[14]=C,t[15]=T,t[16]=O,t[17]=k,t[18]=A):A=t[18];let j;t[19]!==n.levelPresetAria||t[20]!==r||t[21]!==i||t[22]!==A?(j=(0,$.jsx)(`div`,{className:`overflow-x-auto pb-1 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,children:(0,$.jsx)(`div`,{className:`min-w-[min(100%,36rem)]`,children:(0,$.jsx)(Xe,{"aria-label":n.levelPresetAria,value:r,onChange:i,options:A,buttonClassName:`h-8 px-1.5 text-[11px] sm:px-2 sm:text-xs`})})}),t[19]=n.levelPresetAria,t[20]=r,t[21]=i,t[22]=A,t[23]=j):j=t[23];let M;t[24]===n.searchPlaceholder?M=t[25]:(M=(0,$.jsx)(`span`,{className:`sr-only`,children:n.searchPlaceholder}),t[24]=n.searchPlaceholder,t[25]=M);let N;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(c,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,strokeWidth:1.75,"aria-hidden":!0}),t[26]=N):N=t[26];let P;t[27]===u?P=t[28]:(P=e=>u(e.target.value),t[27]=u,t[28]=P);let F=n.searchPlaceholder,I;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(I=d(`h-10 w-full rounded-md border border-edge bg-surface-panel py-0 pl-10 pr-3 text-sm leading-5 text-fg placeholder:text-fg-subtle dark:border-edge`,D),t[29]=I):I=t[29];let L;t[30]!==n.searchPlaceholder||t[31]!==s||t[32]!==P?(L=(0,$.jsx)(`input`,{type:`search`,value:s,onChange:P,placeholder:F,autoComplete:`off`,spellCheck:!1,className:I}),t[30]=n.searchPlaceholder,t[31]=s,t[32]=P,t[33]=L):L=t[33];let R;t[34]!==M||t[35]!==L?(R=(0,$.jsxs)(`label`,{className:`relative min-w-0 flex-1 sm:min-w-[12rem]`,children:[M,N,L]}),t[34]=M,t[35]=L,t[36]=R):R=t[36];let z;t[37]===p?z=t[38]:(z=e=>p(e.target.value),t[37]=p,t[38]=z);let B=n.module,ee=n.module,V;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(V=d(E,`h-10 w-full min-w-0 rounded-md py-0`),t[39]=V):V=t[39];let H;t[40]===n.allModules?H=t[41]:(H=(0,$.jsx)(o,{value:``,children:n.allModules}),t[40]=n.allModules,t[41]=H);let U;t[42]===m?U=t[43]:(U=m.map(Qe),t[42]=m,t[43]=U);let W;t[44]!==n.module||t[45]!==f||t[46]!==z||t[47]!==H||t[48]!==U?(W=(0,$.jsxs)(a,{id:`log-module`,value:f,onChange:z,"aria-label":B,title:ee,className:V,children:[H,U]}),t[44]=n.module,t[45]=f,t[46]=z,t[47]=H,t[48]=U,t[49]=W):W=t[49];let G;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,$.jsx)(te,{className:`size-4`,strokeWidth:1.75}),t[50]=G):G=t[50];let q;t[51]===g?q=t[52]:(q=g>0?(0,$.jsx)(`span`,{className:`rounded-md bg-surface-hover px-1.5 text-xs tabular-nums text-fg-muted`,children:g}):null,t[51]=g,t[52]=q);let J;t[53]!==n.filtersMore||t[54]!==h||t[55]!==q?(J=(0,$.jsxs)(w,{type:`button`,variant:`secondary`,className:`h-10 min-h-[44px] gap-2 rounded-md sm:min-h-10`,onClick:h,children:[G,n.filtersMore,q]}),t[53]=n.filtersMore,t[54]=h,t[55]=q,t[56]=J):J=t[56];let Y;t[57]!==n.clear||t[58]!==_||t[59]!==v?(Y=_?(0,$.jsxs)(w,{type:`button`,variant:`ghost`,className:`h-10 min-h-[44px] gap-1 sm:min-h-10`,onClick:v,children:[(0,$.jsx)(l,{className:`size-4`,strokeWidth:1.75}),n.clear]}):null,t[57]=n.clear,t[58]=_,t[59]=v,t[60]=Y):Y=t[60];let X;t[61]!==J||t[62]!==Y?(X=(0,$.jsxs)(`div`,{className:`flex min-w-0 shrink-0 items-center justify-end gap-2`,children:[J,Y]}),t[61]=J,t[62]=Y,t[63]=X):X=t[63];let Z;t[64]!==R||t[65]!==W||t[66]!==X?(Z=(0,$.jsxs)(`div`,{className:`grid gap-2 lg:grid-cols-[minmax(16rem,1fr)_minmax(12rem,16rem)_auto] lg:items-center`,children:[R,W,X]}),t[64]=R,t[65]=W,t[66]=X,t[67]=Z):Z=t[67];let Q;t[68]!==n.liveHint||t[69]!==y?(Q=y?(0,$.jsx)(`p`,{className:`text-xs leading-5 text-fg-subtle`,children:n.liveHint}):null,t[68]=n.liveHint,t[69]=y,t[70]=Q):Q=t[70];let ne;return t[71]!==n.filters||t[72]!==Z||t[73]!==Q||t[74]!==j?(ne=(0,$.jsxs)(`section`,{className:`flex flex-col gap-4 rounded-xl bg-surface-hover/20 p-4 sm:p-5`,"aria-label":b,children:[j,Z,Q]}),t[71]=n.filters,t[72]=Z,t[73]=Q,t[74]=j,t[75]=ne):ne=t[75],ne}function Qe(e){return(0,$.jsx)(o,{value:e,children:e},e)}function $e(e){let t=(0,K.c)(20),{L:n,logs:r,loading:i,hasMore:a,onSelectLog:o,onLoadMore:s,onRefreshAll:c,onFilterByRequestId:l}=e,u;t[0]!==i||t[1]!==r.length?(u=i&&r.length===0?(0,$.jsx)(`div`,{className:`overflow-hidden rounded-xl bg-surface-hover/20`,"aria-busy":`true`,children:Array.from({length:8}).map(et)}):null,t[0]=i,t[1]=r.length,t[2]=u):u=t[2];let f;t[3]!==n||t[4]!==i||t[5]!==r.length||t[6]!==c?(f=!i&&r.length===0?(0,$.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 rounded-xl bg-surface-hover/20 py-16 text-center`,children:[(0,$.jsx)(B,{className:`size-12 text-fg-subtle`,strokeWidth:1.5,"aria-hidden":!0}),(0,$.jsx)(`h2`,{className:`text-base font-semibold tracking-tight text-fg`,children:n.noLogs}),(0,$.jsx)(`p`,{className:`max-w-sm text-sm leading-relaxed text-fg-muted`,children:n.noLogsDescription}),(0,$.jsxs)(w,{type:`button`,variant:`secondary`,className:`mt-4 gap-2`,onClick:c,children:[(0,$.jsx)(R,{className:`size-4`,strokeWidth:1.75}),n.refresh]})]}):null,t[3]=n,t[4]=i,t[5]=r.length,t[6]=c,t[7]=f):f=t[7];let p;t[8]!==n||t[9]!==a||t[10]!==i||t[11]!==r||t[12]!==l||t[13]!==s||t[14]!==o?(p=r.length>0?(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsxs)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:[xe(n.showingCount,{count:String(r.length)}),a?(0,$.jsxs)(`span`,{className:`text-fg-subtle`,children:[` · `,n.moreAvailable]}):null]}),(0,$.jsxs)(`div`,{className:`overflow-hidden rounded-xl bg-surface-hover/20 p-1 text-sm leading-6`,children:[(0,$.jsxs)(`div`,{className:`hidden items-center gap-3 px-3 py-2 text-xs font-medium text-fg-subtle md:flex`,"aria-hidden":!0,children:[(0,$.jsx)(`span`,{className:`w-[5.25rem] shrink-0`,children:n.time}),(0,$.jsx)(`span`,{className:`w-[4.5rem] shrink-0`,children:n.level}),(0,$.jsx)(`span`,{className:`w-[4.5rem] shrink-0 sm:w-[5.25rem]`,children:n.requestId}),(0,$.jsx)(`span`,{className:`hidden max-w-[6rem] shrink-0 xl:block`,children:n.phase}),(0,$.jsx)(`span`,{className:`hidden max-w-[7rem] shrink-0 lg:block`,children:n.module}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1`,children:n.message})]}),(0,$.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:r.map(e=>{let t=e.level??`info`,r=typeof e.requestId==`string`?e.requestId.trim():``,i=ke(e),a=t===`error`||t===`fatal`;return(0,$.jsx)(`li`,{className:`rounded-lg bg-surface-base/45`,children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>o(e),className:d(`flex w-full min-w-0 items-center gap-3 px-3 py-2.5 text-left transition-colors duration-150 ease-out`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,a&&`bg-red-500/5`),children:[(0,$.jsx)(`span`,{className:`w-[4.75rem] shrink-0 font-mono text-xs tabular-nums text-fg-subtle sm:w-[5.25rem] sm:text-sm`,children:we(e.timestamp)}),(0,$.jsx)(`span`,{className:d(`w-[4.5rem] shrink-0 truncate`,a?`font-medium text-red-600 dark:text-red-400`:`text-fg-muted`),title:t,children:Oe(t)}),(0,$.jsx)(`span`,{className:`hidden w-[4.5rem] shrink-0 truncate font-mono sm:block sm:w-[5.25rem]`,children:r?l?(0,$.jsx)(`span`,{role:`link`,tabIndex:0,className:`cursor-pointer text-accent hover:underline`,title:`${n.requestId}: ${r}`,onClick:e=>{e.stopPropagation(),l(r)},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),l(r))},children:De(r)}):(0,$.jsx)(`span`,{className:`text-fg-subtle`,title:`${n.requestId}: ${r}`,children:De(r)}):(0,$.jsx)(`span`,{className:`text-fg-subtle`,children:`—`})}),(0,$.jsx)(`span`,{className:`hidden max-w-[6rem] shrink-0 truncate text-fg-subtle xl:inline`,title:i===`—`?void 0:i,children:i===`—`?`—`:i}),(0,$.jsx)(`span`,{className:`hidden max-w-[7rem] shrink-0 truncate text-fg-muted lg:inline`,title:Se(e),children:Se(e)}),(0,$.jsx)(`span`,{className:d(`min-w-0 flex-1 truncate`,`text-fg`),children:Ce(e)})]})},Ae(e))})})]}),a?(0,$.jsx)(`div`,{className:`flex justify-center pt-1`,children:(0,$.jsxs)(w,{type:`button`,variant:`secondary`,className:`gap-2`,disabled:i,onClick:s,children:[i?(0,$.jsx)(R,{className:`size-4 animate-spin motion-reduce:animate-none`,strokeWidth:1.75}):(0,$.jsx)(L,{className:`size-4`,strokeWidth:1.75}),n.loadMore]})}):null]}):null,t[8]=n,t[9]=a,t[10]=i,t[11]=r,t[12]=l,t[13]=s,t[14]=o,t[15]=p):p=t[15];let m;return t[16]!==u||t[17]!==f||t[18]!==p?(m=(0,$.jsxs)($.Fragment,{children:[u,f,p]}),t[16]=u,t[17]=f,t[18]=p,t[19]=m):m=t[19],m}function et(e,t){return(0,$.jsxs)(`div`,{className:`flex gap-3 px-3 py-2.5`,children:[(0,$.jsx)(`div`,{className:`h-4 w-16 shrink-0 bg-surface-hover motion-reduce:animate-none animate-pulse`}),(0,$.jsx)(`div`,{className:`h-4 w-12 shrink-0 bg-surface-hover motion-reduce:animate-none animate-pulse`}),(0,$.jsx)(`div`,{className:`h-4 w-20 shrink-0 bg-surface-hover motion-reduce:animate-none animate-pulse`}),(0,$.jsx)(`div`,{className:`h-4 min-w-0 flex-1 bg-surface-hover motion-reduce:animate-none animate-pulse`})]},t)}function tt(e){let t=(0,K.c)(8),{L:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(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 nt(e){return/[",\n\r]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function rt(e){let t=[`timestamp`,`level`,`module`,`phase`,`requestId`,`transcriptId`,`message`],n=e.map(e=>{let t=String(e.module||``),n=String(e.phase??e.meta?.phase??``);return[e.timestamp,e.level,t,n,e.requestId??``,e.transcriptId??``,e.message??``].map(e=>nt(String(e))).join(`,`)});return[t.join(`,`),...n].join(`
|
|
2
|
-
`)}function it(e,t,n){let r=new Blob([e],{type:n}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=t,a.click(),URL.revokeObjectURL(i)}function at(e,t){let n=new Date().toISOString().replace(/[:.]/g,`-`);if(t===`json`){it(JSON.stringify(e,null,2),`xopc-logs-${n}.json`,`application/json`);return}it(rt(e),`xopc-logs-${n}.csv`,`text/csv;charset=utf-8`)}function ot(e){let t=(0,K.c)(32),{L:n,logs:r,disabled:i}=e,a=i||r.length===0,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(s,{className:`size-4`,strokeWidth:1.75}),t[0]=o):o=t[0];let c;t[1]===n.exportLogs?c=t[2]:(c=(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:n.exportLogs}),t[1]=n.exportLogs,t[2]=c);let l;t[3]!==n.exportLogs||t[4]!==a||t[5]!==c?(l=(0,$.jsx)(j,{asChild:!0,children:(0,$.jsxs)(w,{type:`button`,variant:`secondary`,className:`h-9 gap-2 whitespace-nowrap px-3 text-xs`,disabled:a,title:n.exportLogs,children:[o,c]})}),t[3]=n.exportLogs,t[4]=a,t[5]=c,t[6]=l):l=t[6];let u;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(u=d(`w-52 rounded-xl border border-edge bg-surface-panel p-2 shadow-popover outline-none`,F,`dark:border-edge`),t[7]=u):u=t[7];let f;t[8]===n.exportLogs?f=t[9]:(f=(0,$.jsx)(`p`,{className:`px-2 py-1 text-xs font-medium text-fg`,children:n.exportLogs}),t[8]=n.exportLogs,t[9]=f);let p;t[10]===n.exportHint?p=t[11]:(p=(0,$.jsx)(`p`,{className:`px-2 pb-2 text-xs leading-5 text-fg-muted`,children:n.exportHint}),t[10]=n.exportHint,t[11]=p);let m;t[12]===r?m=t[13]:(m=()=>at(r,`json`),t[12]=r,t[13]=m);let h;t[14]!==n.exportJson||t[15]!==m?(h=(0,$.jsx)(w,{type:`button`,variant:`ghost`,className:`h-8 justify-start px-2 text-xs`,onClick:m,children:n.exportJson}),t[14]=n.exportJson,t[15]=m,t[16]=h):h=t[16];let g;t[17]===r?g=t[18]:(g=()=>at(r,`csv`),t[17]=r,t[18]=g);let _;t[19]!==n.exportCsv||t[20]!==g?(_=(0,$.jsx)(w,{type:`button`,variant:`ghost`,className:`h-8 justify-start px-2 text-xs`,onClick:g,children:n.exportCsv}),t[19]=n.exportCsv,t[20]=g,t[21]=_):_=t[21];let v;t[22]!==_||t[23]!==h?(v=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[h,_]}),t[22]=_,t[23]=h,t[24]=v):v=t[24];let y;t[25]!==v||t[26]!==f||t[27]!==p?(y=(0,$.jsx)(O,{children:(0,$.jsxs)(k,{side:`bottom`,align:`end`,sideOffset:6,className:u,children:[f,p,v]})}),t[25]=v,t[26]=f,t[27]=p,t[28]=y):y=t[28];let b;return t[29]!==y||t[30]!==l?(b=(0,$.jsxs)(A,{children:[l,y]}),t[29]=y,t[30]=l,t[31]=b):b=t[31],b}function st(e){let t=(0,K.c)(38),{L:n}=e,[r,i]=(0,G.useState)(!1),[a,o]=(0,G.useState)(`info`),[s,c]=(0,G.useState)(!1),[l,u]=(0,G.useState)(null),f,p;t[0]!==n.logLevelLoadError||t[1]!==r?(f=()=>{if(!r)return;let e=!1;return ne().then(t=>{e||o(t)}).catch(t=>{e||u(t instanceof Error?t.message:n.logLevelLoadError)}),()=>{e=!0}},p=[r,n.logLevelLoadError],t[0]=n.logLevelLoadError,t[1]=r,t[2]=f,t[3]=p):(f=t[2],p=t[3]),(0,G.useEffect)(f,p);let m;t[4]===n.logLevelSaveError?m=t[5]:(m=e=>{c(!0),u(null),re(e).then(e=>{o(e.current),i(!1)}).catch(e=>{u(e instanceof Error?e.message:n.logLevelSaveError)}).finally(()=>c(!1))},t[4]=n.logLevelSaveError,t[5]=m);let h=m,g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(I,{className:`size-4`,strokeWidth:1.75}),t[6]=g):g=t[6];let _;t[7]===n.logLevelTitle?_=t[8]:(_=(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:n.logLevelTitle}),t[7]=n.logLevelTitle,t[8]=_);let v;t[9]===a?v=t[10]:(v=(0,$.jsx)(`span`,{className:`tabular-nums text-fg-muted`,children:a}),t[9]=a,t[10]=v);let y;t[11]!==n.logLevelTitle||t[12]!==_||t[13]!==v?(y=(0,$.jsx)(j,{asChild:!0,children:(0,$.jsxs)(w,{type:`button`,variant:`secondary`,className:`h-9 gap-2 whitespace-nowrap px-3 text-xs`,title:n.logLevelTitle,children:[g,_,v]})}),t[11]=n.logLevelTitle,t[12]=_,t[13]=v,t[14]=y):y=t[14];let b;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(b=d(`w-56 rounded-xl border border-edge bg-surface-panel p-3 shadow-popover outline-none`,F,`dark:border-edge`),t[15]=b):b=t[15];let x;t[16]===n.logLevelTitle?x=t[17]:(x=(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:n.logLevelTitle}),t[16]=n.logLevelTitle,t[17]=x);let S;t[18]===n.logLevelHint?S=t[19]:(S=(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n.logLevelHint}),t[18]=n.logLevelHint,t[19]=S);let C;t[20]!==n.levelNames||t[21]!==h||t[22]!==a||t[23]!==s?(C=ce.map(e=>(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,disabled:s,onClick:()=>h(e),className:d(`flex w-full items-center justify-between rounded-md px-2 py-1.5 text-left text-xs transition-colors`,a===e?`bg-accent/10 font-medium text-accent`:`text-fg hover:bg-surface-hover`),children:[(0,$.jsx)(`span`,{children:n.levelNames[e]}),(0,$.jsx)(`span`,{className:`font-mono text-[10px] uppercase text-fg-subtle`,children:e})]})},e)),t[20]=n.levelNames,t[21]=h,t[22]=a,t[23]=s,t[24]=C):C=t[24];let T;t[25]===C?T=t[26]:(T=(0,$.jsx)(`ul`,{className:`mt-3 flex flex-col gap-1`,children:C}),t[25]=C,t[26]=T);let E;t[27]===l?E=t[28]:(E=l?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-red-600 dark:text-red-400`,children:l}):null,t[27]=l,t[28]=E);let D;t[29]!==S||t[30]!==T||t[31]!==E||t[32]!==x?(D=(0,$.jsx)(O,{children:(0,$.jsxs)(k,{side:`bottom`,align:`end`,sideOffset:6,className:b,children:[x,S,T,E]})}),t[29]=S,t[30]=T,t[31]=E,t[32]=x,t[33]=D):D=t[33];let M;return t[34]!==r||t[35]!==D||t[36]!==y?(M=(0,$.jsxs)(A,{open:r,onOpenChange:i,children:[y,D]}),t[34]=r,t[35]=D,t[36]=y,t[37]=M):M=t[37],M}function ct(e){let t=(0,K.c)(49),{L:n,autoRefresh:r,onAutoRefreshChange:i,fileCount:a,onOpenFiles:o,loading:s,onRefreshAll:c,logs:l}=e,u;t[0]===n.title?u=t[1]:(u=(0,$.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-fg sm:text-lg`,children:n.title}),t[0]=n.title,t[1]=u);let d;t[2]===n.subtitle?d=t[3]:(d=(0,$.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-fg-muted sm:mt-1`,children:n.subtitle}),t[2]=n.subtitle,t[3]=d);let f;t[4]!==u||t[5]!==d?(f=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[u,d]}),t[4]=u,t[5]=d,t[6]=f):f=t[6];let p=r?`live`:`paused`,m;t[7]===i?m=t[8]:(m=e=>i(e===`live`),t[7]=i,t[8]=m);let h;t[9]===n.refreshManual?h=t[10]:(h={value:`paused`,label:n.refreshManual},t[9]=n.refreshManual,t[10]=h);let g;t[11]===n.refreshLive?g=t[12]:(g={value:`live`,label:n.refreshLive},t[11]=n.refreshLive,t[12]=g);let _;t[13]!==h||t[14]!==g?(_=[h,g],t[13]=h,t[14]=g,t[15]=_):_=t[15];let v;t[16]!==n.refreshModeAria||t[17]!==p||t[18]!==m||t[19]!==_?(v=(0,$.jsx)(`div`,{className:`w-full sm:w-52`,children:(0,$.jsx)(Xe,{"aria-label":n.refreshModeAria,value:p,onChange:m,options:_,buttonClassName:`h-8`})}),t[16]=n.refreshModeAria,t[17]=p,t[18]=m,t[19]=_,t[20]=v):v=t[20];let y;t[21]===n?y=t[22]:(y=(0,$.jsx)(st,{L:n}),t[21]=n,t[22]=y);let b;t[23]!==n||t[24]!==s||t[25]!==l?(b=(0,$.jsx)(ot,{L:n,logs:l,disabled:s}),t[23]=n,t[24]=s,t[25]=l,t[26]=b):b=t[26];let x;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(z,{className:`size-4`,strokeWidth:1.75}),t[27]=x):x=t[27];let S;t[28]===a?S=t[29]:(S=a>0?(0,$.jsx)(`span`,{className:`rounded-full bg-surface-hover px-1.5 text-xs text-fg-muted`,children:a}):null,t[28]=a,t[29]=S);let C;t[30]!==n.logFiles||t[31]!==o||t[32]!==S?(C=(0,$.jsxs)(w,{type:`button`,variant:`ghost`,className:`h-9 min-h-[44px] min-w-[44px] px-2 sm:min-h-9 sm:min-w-0`,title:n.logFiles,"aria-label":n.logFiles,onClick:o,children:[x,S]}),t[30]=n.logFiles,t[31]=o,t[32]=S,t[33]=C):C=t[33];let T;t[34]!==n.refresh||t[35]!==s||t[36]!==c?(T=(0,$.jsx)(ee,{className:`h-9 min-h-[44px] min-w-[44px] px-2 sm:min-h-9 sm:min-w-0`,loading:s,label:n.refresh,onClick:c}),t[34]=n.refresh,t[35]=s,t[36]=c,t[37]=T):T=t[37];let E;t[38]!==y||t[39]!==b||t[40]!==C||t[41]!==T?(E=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center justify-end gap-1 sm:self-center`,children:[y,b,C,T]}),t[38]=y,t[39]=b,t[40]=C,t[41]=T,t[42]=E):E=t[42];let D;t[43]!==E||t[44]!==v?(D=(0,$.jsxs)(`div`,{className:`flex w-full shrink-0 flex-col gap-2 rounded-xl bg-surface-hover/20 p-2 sm:flex-row sm:items-center sm:justify-between`,children:[v,E]}),t[43]=E,t[44]=v,t[45]=D):D=t[45];let O;return t[46]!==D||t[47]!==f?(O=(0,$.jsxs)(`header`,{className:`flex flex-col gap-4`,children:[f,D]}),t[46]=D,t[47]=f,t[48]=O):O=t[48],O}function lt(e){let t=(0,K.c)(33),{L:n,stats:r}=e,i;t[0]===r.byLevel?i=t[1]:(i=r.byLevel??{},t[0]=r.byLevel,t[1]=i);let a;t[2]!==n.levelNames||t[3]!==i?(a=Ne(i,n.levelNames),t[2]=n.levelNames,t[3]=i,t[4]=a):a=t[4];let o=a,s=r.runtime?.errorsLast24h;if(!o&&s==null)return null;let c;t[5]===n.statsRegion?c=t[6]:(c=(0,$.jsx)(`span`,{className:`font-medium text-fg-muted`,children:n.statsRegion}),t[5]=n.statsRegion,t[6]=c);let l;t[7]===o?l=t[8]:(l=o?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`mx-1.5 text-fg-subtle`,children:`·`}),(0,$.jsx)(`span`,{className:`tabular-nums`,children:o})]}):null,t[7]=o,t[8]=l);let u;t[9]!==n.runtimeErrors||t[10]!==s?(u=s!=null&&s>0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`mx-1.5 text-fg-subtle`,children:`·`}),(0,$.jsxs)(`span`,{className:`tabular-nums text-red-600 dark:text-red-400`,children:[n.runtimeErrors,` `,s]})]}):null,t[9]=n.runtimeErrors,t[10]=s,t[11]=u):u=t[11];let f;t[12]!==c||t[13]!==l||t[14]!==u?(f=(0,$.jsx)(j,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,className:`max-w-full truncate rounded-lg border border-transparent px-1 py-0.5 text-left text-xs leading-5 text-fg-subtle transition-colors duration-150 ease-out hover:border-edge-subtle hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel dark:hover:border-edge`,children:[c,l,u]})}),t[12]=c,t[13]=l,t[14]=u,t[15]=f):f=t[15];let p;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(p=d(`w-[min(calc(100vw-2rem),20rem)] rounded-xl border border-edge bg-surface-panel p-3 shadow-popover outline-none`,F,`dark:border-edge`),t[16]=p):p=t[16];let m;t[17]===n.statsDetailTitle?m=t[18]:(m=(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:n.statsDetailTitle}),t[17]=n.statsDetailTitle,t[18]=m);let h;t[19]===n.statsHint?h=t[20]:(h=(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n.statsHint}),t[19]=n.statsHint,t[20]=h);let g;t[21]!==n.levelNames||t[22]!==r.byLevel?(g=ce.map(e=>{let t=r.byLevel?.[e]??0;return t===0?null:(0,$.jsxs)(`li`,{className:`flex items-center justify-between gap-2 rounded-md border border-edge-subtle bg-surface-base px-2 py-1 text-xs dark:border-edge`,children:[(0,$.jsx)(`span`,{className:`font-medium capitalize text-fg`,children:n.levelNames[e]}),(0,$.jsx)(`span`,{className:`tabular-nums text-fg-muted`,children:t})]},e)}),t[21]=n.levelNames,t[22]=r.byLevel,t[23]=g):g=t[23];let _;t[24]===g?_=t[25]:(_=(0,$.jsx)(`ul`,{className:`mt-3 flex flex-col gap-1.5`,children:g}),t[24]=g,t[25]=_);let v;t[26]!==_||t[27]!==m||t[28]!==h?(v=(0,$.jsx)(O,{children:(0,$.jsxs)(k,{side:`bottom`,align:`start`,sideOffset:6,className:p,children:[m,h,_]})}),t[26]=_,t[27]=m,t[28]=h,t[29]=v):v=t[29];let y;return t[30]!==v||t[31]!==f?(y=(0,$.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,$.jsxs)(A,{children:[f,v]})}),t[30]=v,t[31]=f,t[32]=y):y=t[32],y}function ut(){let e=(0,K.c)(89),{L:t,hasToken:n,logs:r,loading:i,error:a,hasMore:o,searchInput:s,setSearchInput:c,selectedLevels:l,moduleFilter:u,setModuleFilter:d,dateFrom:f,setDateFrom:p,dateTo:h,setDateTo:g,modules:_,files:v,stats:y,selectedLog:b,setSelectedLog:x,filesOpen:S,setFilesOpen:C,filtersOpen:w,setFiltersOpen:T,logDir:E,autoRefresh:D,setAutoRefresh:O,copiedDetail:k,setCopiedDetail:A,hasActiveFilters:j,activeFilterCount:M,clearFilters:N,toggleDialogLevel:P,handleLoadMore:F,refreshAll:I,levelSegment:L,handleLevelSegment:R,filterByRequestId:z,filterByTranscriptId:B,filterByErrorSummary:ee,openChatForSession:V,errorSummary:te,errorSummaryLoading:H}=Le(m(dt));if(!n){let n;return e[0]===t?n=e[1]:(n=(0,$.jsx)(tt,{L:t}),e[0]=t,e[1]=n),n}let U;e[2]===C?U=e[3]:(U=()=>C(!0),e[2]=C,e[3]=U);let G;e[4]!==t||e[5]!==D||e[6]!==v.length||e[7]!==i||e[8]!==r||e[9]!==I||e[10]!==O||e[11]!==U?(G=(0,$.jsx)(ct,{L:t,autoRefresh:D,onAutoRefreshChange:O,fileCount:v.length,onOpenFiles:U,loading:i,onRefreshAll:I,logs:r}),e[4]=t,e[5]=D,e[6]=v.length,e[7]=i,e[8]=r,e[9]=I,e[10]=O,e[11]=U,e[12]=G):G=e[12];let q;e[13]===a?q=e[14]:(q=a?(0,$.jsx)(`div`,{className:`rounded-xl bg-danger-soft px-3 py-2 text-sm text-danger`,role:`alert`,children:a}):null,e[13]=a,e[14]=q);let J;e[15]!==t||e[16]!==y?(J=y?(0,$.jsx)(lt,{L:t,stats:y}):null,e[15]=t,e[16]=y,e[17]=J):J=e[17];let Y;e[18]!==t||e[19]!==te||e[20]!==H||e[21]!==ee?(Y=(0,$.jsx)(Re,{L:t,items:te,loading:H,onSelectItem:ee}),e[18]=t,e[19]=te,e[20]=H,e[21]=ee,e[22]=Y):Y=e[22];let X;e[23]===T?X=e[24]:(X=()=>T(!0),e[23]=T,e[24]=X);let Z;e[25]!==t||e[26]!==M||e[27]!==D||e[28]!==N||e[29]!==R||e[30]!==j||e[31]!==L||e[32]!==u||e[33]!==_||e[34]!==s||e[35]!==d||e[36]!==c||e[37]!==X?(Z=(0,$.jsx)(Ze,{L:t,levelSegment:L,onLevelSegment:R,searchInput:s,onSearchInputChange:c,moduleFilter:u,onModuleFilterChange:d,modules:_,onOpenFilters:X,activeFilterCount:M,hasActiveFilters:j,onClearFilters:N,autoRefresh:D}),e[25]=t,e[26]=M,e[27]=D,e[28]=N,e[29]=R,e[30]=j,e[31]=L,e[32]=u,e[33]=_,e[34]=s,e[35]=d,e[36]=c,e[37]=X,e[38]=Z):Z=e[38];let Q;e[39]!==t||e[40]!==z||e[41]!==F||e[42]!==o||e[43]!==i||e[44]!==r||e[45]!==I||e[46]!==x?(Q=(0,$.jsx)($e,{L:t,logs:r,loading:i,hasMore:o,onSelectLog:x,onLoadMore:F,onRefreshAll:I,onFilterByRequestId:z}),e[39]=t,e[40]=z,e[41]=F,e[42]=o,e[43]=i,e[44]=r,e[45]=I,e[46]=x,e[47]=Q):Q=e[47];let ne;e[48]!==t||e[49]!==f||e[50]!==h||e[51]!==w||e[52]!==l||e[53]!==p||e[54]!==g||e[55]!==T||e[56]!==P?(ne=(0,$.jsx)(Ge,{L:t,open:w,onOpenChange:T,dateFrom:f,onDateFromChange:p,dateTo:h,onDateToChange:g,selectedLevels:l,onToggleLevel:P}),e[48]=t,e[49]=f,e[50]=h,e[51]=w,e[52]=l,e[53]=p,e[54]=g,e[55]=T,e[56]=P,e[57]=ne):ne=e[57];let re;e[58]===x?re=e[59]:(re=()=>x(null),e[58]=x,e[59]=re);let ie,ae;e[60]===A?(ie=e[61],ae=e[62]):(ie=()=>A(`message`),ae=()=>A(`json`),e[60]=A,e[61]=ie,e[62]=ae);let oe;e[63]!==t||e[64]!==k||e[65]!==z||e[66]!==B||e[67]!==V||e[68]!==b||e[69]!==ie||e[70]!==ae||e[71]!==re?(oe=(0,$.jsx)(He,{L:t,log:b,onClose:re,copiedDetail:k,onCopiedMessage:ie,onCopiedJson:ae,onFilterByRequestId:z,onFilterByTranscriptId:B,onOpenChat: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)(Ue,{L:t,open:S,onOpenChange:C,files:v,logDir:E}),e[73]=t,e[74]=v,e[75]=S,e[76]=E,e[77]=C,e[78]=se):se=e[78];let ce;return e[79]!==G||e[80]!==oe||e[81]!==se||e[82]!==q||e[83]!==J||e[84]!==Y||e[85]!==Z||e[86]!==Q||e[87]!==ne?(ce=(0,$.jsxs)(W,{gap:`gap-6`,children:[G,q,J,Y,Z,Q,ne,oe,se]}),e[79]=G,e[80]=oe,e[81]=se,e[82]=q,e[83]=J,e[84]=Y,e[85]=Z,e[86]=Q,e[87]=ne,e[88]=ce):ce=e[88],ce}function dt(e){return e.language}export{ut as LogsPage};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{g as i}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{n as a,r as o}from"./popover-select-DHC7J4lG.js";import{t as s}from"./download-Dk-ZjtO6.js";import{t as c}from"./search-DA7gz22f.js";import{t as l}from"./x-B_N4OPjy.js";import{t as u}from"./messages-Ib6DaUTo.js";import{t as d}from"./cn-0WouolD0.js";import{a as f,c as p,n as m,r as h}from"./locale-store-pmT2B_By.js";import{a as g,n as _,o as v,r as y,s as b,t as x}from"./dist-BGTk37IG.js";import{u as S}from"./session-api-D2J6VacQ.js";import{t as C}from"./copy-to-clipboard-HOJ79TWv.js";import{t as w}from"./button-aIC072nz.js";import{a as T}from"./gateway-realtime-BGhPOSfz.js";import{o as E,t as D}from"./form-field-width-DJw_jULe.js";import{a as O,i as k,o as A,s as j}from"./dist-C3DSFZCi.js";import{t as M}from"./skeleton-BI5TyibZ.js";import{i as N,o as P,s as F}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{$s as I,Ac as L,Eo as R,Yo as z,ac as B,ec as ee,ks as te,li as V,qt as H,wc as U}from"./index-DxydK_AA.js";import{r as W}from"./settings-page-layout-Dx5S-Msc.js";var G=e(t(),1),K=n();function q(e){let t=new URLSearchParams;if(!e)return``;e.level?.length&&t.set(`level`,e.level.join(`,`)),e.from&&t.set(`from`,e.from),e.to&&t.set(`to`,e.to),e.q&&t.set(`q`,e.q),e.module&&t.set(`module`,e.module),e.requestId&&t.set(`requestId`,e.requestId),e.conversationId&&t.set(`conversationId`,e.conversationId),e.transcriptId&&t.set(`transcriptId`,e.transcriptId),e.limit!=null&&t.set(`limit`,String(e.limit)),e.offset!=null&&t.set(`offset`,String(e.offset));let n=t.toString();return n?`?${n}`:``}async function J(e){return f(h(`/api/logs${q(e)}`))}async function Y(){return(await f(h(`/api/logs/files`))).files??[]}async function X(){return(await f(h(`/api/logs/modules`))).modules??[]}async function Z(){let e=await f(h(`/api/logs/stats`));return{byLevel:e.byLevel??{},runtime:e.runtime}}async function Q(){return(await f(h(`/api/logs/dir`))).dir??``}async function ne(){return(await f(h(`/api/logs/level`))).level??`info`}async function re(e,t){return f(h(`/api/logs/level`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({level:e,...t==null?{}:{duration:String(t)}})})}async function ie(e){let t=new URLSearchParams;e?.from&&t.set(`from`,e.from),e?.to&&t.set(`to`,e.to),e?.limit!=null&&t.set(`limit`,String(e.limit));let n=t.toString();return(await f(h(`/api/logs/errors/summary${n?`?${n}`:``}`))).items??[]}var ae=500,oe=class{_callbacks;_cleanup;constructor(e){this._callbacks=e}connect(e,t){this.disconnect();let n=new Set(e?.length?e:[`trace`,`debug`,`info`,`warn`,`error`,`fatal`]);this._cleanup=T(`logs`,{onEvent:e=>{if(e.event!==`log.entry`||!e.data||typeof e.data!=`object`)return;let r=e.data;!n.has(r.level)||t&&r.module!==t||this._callbacks.onEntry(r)},onGap:()=>this._callbacks.onError(`Live log replay gap; refresh the log query`)}),this._callbacks.onConnected()}disconnect(){this._cleanup?.(),this._cleanup=void 0}};function se(e,t){let n=`${t.timestamp}-${t.requestId??``}-${t.message}`;return[t,...e.filter(e=>`${e.timestamp}-${e.requestId??``}-${e.message}`!==n)].slice(0,ae)}var ce=[`trace`,`debug`,`info`,`warn`,`error`,`fatal`];function le(e){let t=new Date(String(e.timestamp)).getTime();return Number.isFinite(t)?t:0}function ue(e){return e.toSorted((e,t)=>le(t)-le(e))}var de=new Set(ce),fe=[`error`,`fatal`],pe=[`warn`,`error`,`fatal`],me=[`info`,`warn`,`error`,`fatal`];function he(e){if(!e)return new Set;let t=new Set;for(let n of e.split(`,`)){let e=n.trim();de.has(e)&&t.add(e)}return t}function ge(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function _e(e,t){return e.size===t.length?t.every(t=>e.has(t)):!1}function ve(e){return e.size===0?`all`:_e(e,fe)?`errors`:_e(e,pe)?`warnPlus`:_e(e,me)?`infoPlus`:e.size===ce.length&&ce.every(t=>e.has(t))?`verbose`:`custom`}function ye(e){let t=ve(e);return t===`custom`?`other`:t}function be(e){switch(e){case`all`:return new Set;case`errors`:return new Set(fe);case`warnPlus`:return new Set(pe);case`infoPlus`:return new Set(me);case`verbose`:return new Set(ce)}}function xe(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>String(t[n]??``))}function Se(e){return String(e.module||e.service||e.extension||`—`)}function Ce(e){if(typeof e.message==`string`&&e.message)return e.message;try{return JSON.stringify(e)}catch{return``}}function we(e){try{return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}catch{return e}}function Te(e){try{return new Date(e).toLocaleString()}catch{return e}}function Ee(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function De(e){let t=e.trim();return t.length<=10?t:`${t.slice(0,8)}…`}function Oe(e){return String(e).toLowerCase()}function ke(e){let t=e.phase??e.meta?.phase;return typeof t==`string`&&t.trim()?t:`—`}function Ae(e){return`${e.timestamp}-${e.requestId??``}-${e.message}`}function je(e){let t=e.err??e.meta?.err;if(!t||typeof t!=`object`)return null;let n=t;return{name:typeof n.name==`string`?n.name:void 0,message:typeof n.message==`string`?n.message:void 0,stack:typeof n.stack==`string`?n.stack:void 0}}function Me(e,t){if(t.selectedLevels.size>0&&!t.selectedLevels.has(e.level)||t.moduleFilter&&Se(e)!==t.moduleFilter||t.requestIdFilter&&e.requestId!==t.requestIdFilter||t.transcriptIdFilter&&e.transcriptId!==t.transcriptIdFilter&&e.conversationId!==t.transcriptIdFilter)return!1;if(t.dateFrom){let n=new Date(t.dateFrom).getTime(),r=new Date(String(e.timestamp)).getTime();if(Number.isFinite(n)&&Number.isFinite(r)&&r<n)return!1}if(t.dateTo){let n=new Date(t.dateTo).getTime(),r=new Date(String(e.timestamp)).getTime();if(Number.isFinite(n)&&Number.isFinite(r)&&r>n)return!1}if(t.debouncedSearch){let n=t.debouncedSearch.toLowerCase();if(![e.message,Se(e),ke(e),e.requestId,e.conversationId,e.transcriptId,je(e)?.message,je(e)?.stack].filter(Boolean).map(String).join(` `).toLowerCase().includes(n))return!1}return!0}function Ne(e,t){let n=[];for(let r of ce){let i=e[r]??0;i>0&&n.push(`${t[r]} ${i}`)}return n.join(` · `)}function Pe(e,t){switch(t.type){case`setSearchInput`:return e.searchInput===t.value?e:{...e,searchInput:t.value};case`setDebouncedSearch`:return e.debouncedSearch===t.value?e:{...e,debouncedSearch:t.value};case`setLevels`:return ge(e.selectedLevels,t.value)?e:{...e,selectedLevels:t.value};case`toggleLevel`:{let n=new Set(e.selectedLevels);return n.has(t.level)?n.delete(t.level):n.add(t.level),{...e,selectedLevels:n}}case`setModule`:return e.moduleFilter===t.value?e:{...e,moduleFilter:t.value};case`setRequestIdFilter`:return e.requestIdFilter===t.value?e:{...e,requestIdFilter:t.value};case`setTranscriptIdFilter`:return e.transcriptIdFilter===t.value?e:{...e,transcriptIdFilter:t.value};case`setDateFrom`:return e.dateFrom===t.value?e:{...e,dateFrom:t.value};case`setDateTo`:return e.dateTo===t.value?e:{...e,dateTo:t.value};case`setAutoRefresh`:return e.autoRefresh===t.value?e:{...e,autoRefresh:t.value};case`syncFromUrl`:{let n=t.payload;return e.searchInput===n.searchInput&&e.debouncedSearch===n.debouncedSearch&&ge(e.selectedLevels,n.selectedLevels)&&e.moduleFilter===n.moduleFilter&&e.requestIdFilter===n.requestIdFilter&&e.transcriptIdFilter===n.transcriptIdFilter&&e.dateFrom===n.dateFrom&&e.dateTo===n.dateTo&&e.autoRefresh===n.autoRefresh?e:{...e,...n}}case`clearAll`:return{searchInput:``,debouncedSearch:``,selectedLevels:new Set,moduleFilter:``,requestIdFilter:``,transcriptIdFilter:``,dateFrom:``,dateTo:``,autoRefresh:e.autoRefresh}}}var Fe={logs:[],loading:!1,error:null,hasMore:!1,modules:[],files:[],stats:null,logDir:null};function Ie(e,t){switch(t.type){case`queryStart`:return{...e,loading:!0,error:null,logs:[]};case`querySuccess`:return{...e,loading:!1,logs:ue(t.logs),hasMore:t.hasMore};case`queryError`:return t.resetLogs?{...e,loading:!1,error:t.message,logs:[],hasMore:!1}:{...e,loading:!1,error:t.message};case`appendSuccess`:return{...e,loading:!1,logs:ue([...e.logs,...t.logs]),hasMore:t.hasMore};case`metaSuccess`:return{...e,modules:t.modules,stats:t.stats,files:t.files};case`filesSuccess`:return{...e,files:t.files,logDir:t.logDir};case`filesClear`:return{...e,files:[]};case`liveTick`:return{...e,logs:ue(t.logs),hasMore:t.hasMore,stats:t.stats};case`appendLiveEntry`:return{...e,logs:ue(se(e.logs,t.entry))};case`updateStats`:return{...e,stats:t.stats};case`refreshAllSuccess`:return{...e,loading:!1,logs:ue(t.logs),hasMore:t.hasMore,stats:t.stats,files:t.files}}}function Le(e){let t=u(e).logs,n=p(e=>e.conversationId),r=!!n,[a,o]=i(),s=(0,G.useRef)(a),[c,l]=(0,G.useReducer)(Pe,void 0,()=>{let e=s.current,t=e.get(`q`)??``;return{searchInput:t,debouncedSearch:t.trim(),selectedLevels:he(e.get(`level`)),moduleFilter:e.get(`module`)??``,requestIdFilter:e.get(`requestId`)??``,transcriptIdFilter:e.get(`transcriptId`)??``,dateFrom:e.get(`from`)??``,dateTo:e.get(`to`)??``,autoRefresh:e.get(`live`)===`1`}}),[d,f]=(0,G.useReducer)(Ie,Fe),[m,h]=(0,G.useState)(null),[g,_]=(0,G.useState)(!1),[v,y]=(0,G.useState)(!1),[b,x]=(0,G.useState)(null),[C,w]=(0,G.useState)([]),[T,E]=(0,G.useState)(!1),{searchInput:D,debouncedSearch:O,selectedLevels:k,moduleFilter:A,requestIdFilter:j,transcriptIdFilter:M,dateFrom:N,dateTo:P,autoRefresh:F}=c,{logs:I,loading:L,error:R,hasMore:z,modules:B,files:ee,stats:te,logDir:V}=d,H=(0,G.useCallback)(e=>l({type:`setSearchInput`,value:e}),[]),U=(0,G.useCallback)(e=>l({type:`setLevels`,value:e}),[]),W=(0,G.useCallback)(e=>l({type:`setModule`,value:e}),[]),K=(0,G.useCallback)(e=>l({type:`setRequestIdFilter`,value:e}),[]),q=(0,G.useCallback)(e=>l({type:`setTranscriptIdFilter`,value:e}),[]),ne=(0,G.useCallback)(e=>l({type:`setDateFrom`,value:e}),[]),re=(0,G.useCallback)(e=>l({type:`setDateTo`,value:e}),[]),ae=(0,G.useCallback)(e=>l({type:`setAutoRefresh`,value:e}),[]),se=(0,G.useMemo)(()=>ye(k),[k]),ce=e=>{if(e===`other`){y(!0);return}l({type:`setLevels`,value:be(e)})},le=O.length>0||k.size>0||!!A||!!j||!!M||!!N||!!P,ue=+(O.length>0)+ +(k.size>0)+ +!!A+ +!!j+ +!!M+(N||P?1:0);(0,G.useEffect)(()=>{let e=setTimeout(()=>l({type:`setDebouncedSearch`,value:D.trim()}),300);return()=>clearTimeout(e)},[D]),(0,G.useEffect)(()=>{let e=a.get(`q`)??``;l({type:`syncFromUrl`,payload:{searchInput:e,debouncedSearch:e.trim(),selectedLevels:he(a.get(`level`)),moduleFilter:a.get(`module`)??``,requestIdFilter:a.get(`requestId`)??``,transcriptIdFilter:a.get(`transcriptId`)??``,dateFrom:a.get(`from`)??``,dateTo:a.get(`to`)??``,autoRefresh:a.get(`live`)===`1`}})},[a]),(0,G.useEffect)(()=>{let e=new URLSearchParams(a),t=O.trim();t?e.set(`q`,t):e.delete(`q`),k.size>0?e.set(`level`,Array.from(k).sort().join(`,`)):e.delete(`level`),A?e.set(`module`,A):e.delete(`module`),j?e.set(`requestId`,j):e.delete(`requestId`),M?e.set(`transcriptId`,M):e.delete(`transcriptId`),N?e.set(`from`,N):e.delete(`from`),P?e.set(`to`,P):e.delete(`to`),F?e.set(`live`,`1`):e.delete(`live`),e.toString()!==a.toString()&&o(e,{replace:!0})},[F,N,P,O,A,j,M,a,k,o]);let de=(0,G.useMemo)(()=>({q:O||void 0,level:k.size>0?Array.from(k):void 0,module:A||void 0,requestId:j||void 0,transcriptId:M||void 0,from:N||void 0,to:P||void 0,limit:50}),[O,k,A,j,M,N,P]),fe=(0,G.useMemo)(()=>({debouncedSearch:O,selectedLevels:k,moduleFilter:A,requestIdFilter:j,transcriptIdFilter:M,dateFrom:N,dateTo:P}),[O,k,A,j,M,N,P]),pe=(0,G.useRef)(fe);return pe.current=fe,(0,G.useEffect)(()=>{if(!r)return;let e=!1;return E(!0),ie({from:N||void 0,to:P||void 0,limit:12}).then(t=>{e||w(t)}).catch(()=>{e||w([])}).finally(()=>{e||E(!1)}),()=>{e=!0}},[r,N,P]),(0,G.useEffect)(()=>{if(!r)return;let e=!1;return f({type:`queryStart`}),(async()=>{try{let t=await J({...de,offset:0});if(e)return;f({type:`querySuccess`,logs:t.logs,hasMore:t.logs.length===50})}catch(n){e||f({type:`queryError`,message:n instanceof Error?n.message:t.loadError,resetLogs:!0})}})(),()=>{e=!0}},[r,de,t.loadError]),(0,G.useEffect)(()=>{if(!r)return;let e=!1;return(async()=>{try{let[t,n,r]=await Promise.all([X(),Z(),Y()]);e||f({type:`metaSuccess`,modules:t,stats:n,files:r})}catch{}})(),()=>{e=!0}},[r]),(0,G.useEffect)(()=>{if(!r||!g)return;let e=!1;return(async()=>{try{let[t,n]=await Promise.all([Y(),Q()]);e||f({type:`filesSuccess`,files:t,logDir:n})}catch{e||f({type:`filesClear`})}})(),()=>{e=!0}},[r,g]),(0,G.useEffect)(()=>{if(!F||!r)return;let e=new oe({onConnected:()=>{},onEntry:e=>{Me(e,pe.current)&&f({type:`appendLiveEntry`,entry:e})},onError:()=>{}});e.connect(k.size>0?Array.from(k):void 0,A||void 0);let t=window.setInterval(()=>{Z().then(e=>{f({type:`updateStats`,stats:e})}).catch(()=>{})},3e4);return()=>{e.disconnect(),clearInterval(t)}},[F,r,n,k,A]),(0,G.useEffect)(()=>{if(!b)return;let e=window.setTimeout(()=>x(null),2e3);return()=>clearTimeout(e)},[b]),{L:t,hasToken:r,logs:I,loading:L,error:R,hasMore:z,searchInput:D,setSearchInput:H,selectedLevels:k,setSelectedLevels:U,moduleFilter:A,setModuleFilter:W,requestIdFilter:j,transcriptIdFilter:M,dateFrom:N,setDateFrom:ne,dateTo:P,setDateTo:re,modules:B,files:ee,stats:te,selectedLog:m,setSelectedLog:h,filesOpen:g,setFilesOpen:_,filtersOpen:v,setFiltersOpen:y,logDir:V,autoRefresh:F,setAutoRefresh:ae,copiedDetail:b,setCopiedDetail:x,hasActiveFilters:le,activeFilterCount:ue,clearFilters:()=>l({type:`clearAll`}),toggleDialogLevel:e=>l({type:`toggleLevel`,level:e}),handleLoadMore:()=>{L||!z||(async()=>{f({type:`queryStart`});try{let e=await J({...de,offset:I.length});f({type:`appendSuccess`,logs:e.logs,hasMore:e.logs.length===50})}catch(e){f({type:`queryError`,message:e instanceof Error?e.message:t.loadError})}})()},refreshAll:()=>{(async()=>{f({type:`queryStart`});try{let e=await J({...de,offset:0}),[t,n]=await Promise.all([Z(),Y()]);f({type:`refreshAllSuccess`,logs:e.logs,hasMore:e.logs.length===50,stats:t,files:n})}catch(e){f({type:`queryError`,message:e instanceof Error?e.message:t.loadError})}})()},levelSegment:se,handleLevelSegment:ce,filterByRequestId:(0,G.useCallback)(e=>{h(null),K(e)},[K]),filterByTranscriptId:(0,G.useCallback)(e=>{h(null),q(e)},[q]),filterByErrorSummary:(0,G.useCallback)(e=>{l({type:`setSearchInput`,value:e.errName}),l({type:`setDebouncedSearch`,value:e.errName}),e.module&&l({type:`setModule`,value:e.module}),l({type:`setLevels`,value:be(`errors`)})},[]),openChatForSession:(0,G.useCallback)(e=>{let t=e.conversationId?.trim();if(t){window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{conversationId:t}}));return}let n=e.transcriptId?.trim();n&&S({transcriptId:n}).then(e=>{window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{conversationId:e.conversationId}}))}).catch(()=>{})},[]),errorSummary:C,errorSummaryLoading:T}}var $=r();function Re(e){let t=(0,K.c)(36),{L:n,items:r,loading:i,onSelectItem:a}=e,[o,s]=(0,G.useState)(!1);if(!i&&r.length===0)return null;let c;t[0]===r?c=t[1]:(c=r.reduce(Be,0),t[0]=r,t[1]=c);let l=c,u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>s(ze),t[2]=u):u=t[2];let f;t[3]===n.errorSummaryTitle?f=t[4]:(f=(0,$.jsx)(`h2`,{className:`text-sm font-semibold tracking-tight text-fg`,children:n.errorSummaryTitle}),t[3]=n.errorSummaryTitle,t[4]=f);let p;t[5]===n.errorSummaryHint?p=t[6]:(p=(0,$.jsx)(`p`,{className:`mt-0.5 text-xs leading-5 text-fg-muted`,children:n.errorSummaryHint}),t[5]=n.errorSummaryHint,t[6]=p);let m;t[7]!==f||t[8]!==p?(m=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[f,p]}),t[7]=f,t[8]=p,t[9]=m):m=t[9];let h;t[10]!==r.length||t[11]!==i||t[12]!==l?(h=i?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(M,{className:`h-5 w-8 rounded-md`}),(0,$.jsx)(M,{className:`h-5 w-10 rounded-md`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`rounded-md bg-red-500/10 px-2 py-0.5 text-xs tabular-nums text-red-600 dark:text-red-400`,children:r.length}),(0,$.jsxs)(`span`,{className:`rounded-md bg-surface-hover px-2 py-0.5 text-xs tabular-nums text-fg-muted`,children:[`×`,l]})]}),t[10]=r.length,t[11]=i,t[12]=l,t[13]=h):h=t[13];let g=o&&`rotate-180`,_;t[14]===g?_=t[15]:(_=d(`size-4 text-fg-muted transition-transform duration-150 ease-out motion-reduce:transition-none`,g),t[14]=g,t[15]=_);let v;t[16]===_?v=t[17]:(v=(0,$.jsx)(L,{className:_,strokeWidth:1.75,"aria-hidden":!0}),t[16]=_,t[17]=v);let y;t[18]!==h||t[19]!==v?(y=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 pt-0.5`,children:[h,v]}),t[18]=h,t[19]=v,t[20]=y):y=t[20];let b;t[21]!==o||t[22]!==y||t[23]!==m?(b=(0,$.jsxs)(`button`,{type:`button`,onClick:u,"aria-expanded":o,className:`flex w-full items-start justify-between gap-3 px-4 py-4 text-left transition-colors hover:bg-surface-hover/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-inset sm:px-5`,children:[m,y]}),t[21]=o,t[22]=y,t[23]=m,t[24]=b):b=t[24];let x;t[25]!==n.module||t[26]!==n.phase||t[27]!==n.time||t[28]!==o||t[29]!==r||t[30]!==i||t[31]!==a?(x=o&&!i&&r.length>0?(0,$.jsx)(`ul`,{className:`mx-1 mb-1 flex flex-col gap-1 rounded-lg bg-surface-base/45 p-1 [&>li]:rounded-lg`,children:r.map(e=>(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>a?.(e),className:d(`flex w-full flex-col gap-1 px-4 py-2.5 text-left transition-colors hover:bg-surface-hover`,a&&`cursor-pointer`),children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-fg`,children:e.errName}),(0,$.jsxs)(`span`,{className:`shrink-0 rounded-md bg-red-500/10 px-2 py-0.5 text-xs tabular-nums text-red-600 dark:text-red-400`,children:[`×`,e.count]})]}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-x-3 gap-y-1 text-xs text-fg-muted`,children:[e.phase?(0,$.jsxs)(`span`,{children:[n.phase,`: `,e.phase]}):null,e.module?(0,$.jsxs)(`span`,{children:[n.module,`: `,e.module]}):null,(0,$.jsxs)(`span`,{children:[n.time,`: `,we(e.lastSeen)]})]}),(0,$.jsx)(`p`,{className:`truncate text-xs text-fg-subtle`,children:e.sampleMessage})]})},e.key))}):null,t[25]=n.module,t[26]=n.phase,t[27]=n.time,t[28]=o,t[29]=r,t[30]=i,t[31]=a,t[32]=x):x=t[32];let S;return t[33]!==b||t[34]!==x?(S=(0,$.jsxs)(`section`,{className:`overflow-hidden rounded-xl bg-surface-hover/20`,children:[b,x]}),t[33]=b,t[34]=x,t[35]=S):S=t[35],S}function ze(e){return!e}function Be(e,t){return e+t.count}function Ve(e){let t=(0,K.c)(75),{log:n,labels:r,onFilterByRequestId:i,onFilterByTranscriptId:a,onOpenChat:o}=e,s=n.level??`info`,c=typeof n.requestId==`string`?n.requestId:``,l=typeof n.conversationId==`string`?n.conversationId:``,u=typeof n.transcriptId==`string`?n.transcriptId:``,f;t[0]===n?f=t[1]:(f=ke(n),t[0]=n,t[1]=f);let p=f,m;t[2]===n?m=t[3]:(m=je(n),t[2]=n,t[3]=m);let h=m,g=s===`error`||s===`fatal`,_;t[4]===r.message?_=t[5]:(_=(0,$.jsx)(`span`,{className:`text-xs font-sans font-medium text-fg-muted`,children:r.message}),t[4]=r.message,t[5]=_);let v=g&&`border-red-500/40`,y;t[6]===v?y=t[7]:(y=d(`mt-2 whitespace-pre-wrap break-words border border-edge bg-surface-base p-3 text-xs leading-relaxed text-fg dark:border-edge`,v),t[6]=v,t[7]=y);let b=n.message||`—`,x;t[8]!==y||t[9]!==b?(x=(0,$.jsx)(`pre`,{className:y,children:b}),t[8]=y,t[9]=b,t[10]=x):x=t[10];let S;t[11]!==_||t[12]!==x?(S=(0,$.jsxs)(`div`,{children:[_,x]}),t[11]=_,t[12]=x,t[13]=S):S=t[13];let C;t[14]!==h||t[15]!==r.stackTrace?(C=h?.stack?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{className:`text-xs font-sans font-medium text-fg-muted`,children:r.stackTrace}),h.name?(0,$.jsx)(`p`,{className:`mt-1 text-xs text-red-600 dark:text-red-400`,children:h.name}):null,(0,$.jsx)(`pre`,{className:`mt-2 overflow-x-auto whitespace-pre-wrap break-words border border-red-500/30 bg-surface-base p-3 text-xs leading-relaxed text-fg dark:border-red-500/30`,children:h.stack})]}):null,t[14]=h,t[15]=r.stackTrace,t[16]=C):C=t[16];let T;t[17]===r.time?T=t[18]:(T=(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.time}),t[17]=r.time,t[18]=T);let E;t[19]===n.timestamp?E=t[20]:(E=(0,$.jsx)(`code`,{className:`break-all text-fg`,children:n.timestamp}),t[19]=n.timestamp,t[20]=E);let D;t[21]===r.level?D=t[22]:(D=(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.level}),t[21]=r.level,t[22]=D);let O=g&&`font-medium text-red-600 dark:text-red-400`,k;t[23]===O?k=t[24]:(k=d(`text-fg`,O),t[23]=O,t[24]=k);let A;t[25]===s?A=t[26]:(A=Oe(s),t[25]=s,t[26]=A);let j;t[27]!==k||t[28]!==A?(j=(0,$.jsx)(`span`,{className:k,children:A}),t[27]=k,t[28]=A,t[29]=j):j=t[29];let M;t[30]===r.module?M=t[31]:(M=(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.module}),t[30]=r.module,t[31]=M);let N;t[32]===n?N=t[33]:(N=Se(n),t[32]=n,t[33]=N);let P;t[34]===N?P=t[35]:(P=(0,$.jsx)(`code`,{className:`break-all text-fg`,children:N}),t[34]=N,t[35]=P);let F;t[36]!==r.phase||t[37]!==p?(F=p===`—`?null:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.phase}),(0,$.jsx)(`code`,{className:`break-all text-fg`,children:p})]}),t[36]=r.phase,t[37]=p,t[38]=F):F=t[38];let I;t[39]!==r.filterByRequestId||t[40]!==r.requestId||t[41]!==i||t[42]!==c?(I=c?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.requestId}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,$.jsx)(`code`,{className:`break-all text-fg`,children:c}),i?(0,$.jsx)(w,{type:`button`,variant:`secondary`,className:`h-7 px-2 text-[11px]`,onClick:()=>i(c),children:r.filterByRequestId}):null]})]}):null,t[39]=r.filterByRequestId,t[40]=r.requestId,t[41]=i,t[42]=c,t[43]=I):I=t[43];let L;t[44]!==r.conversationId||t[45]!==r.openChat||t[46]!==o||t[47]!==l?(L=l?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.conversationId}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,$.jsx)(`code`,{className:`break-all text-fg`,children:l}),o?(0,$.jsx)(w,{type:`button`,variant:`secondary`,className:`h-7 px-2 text-[11px]`,onClick:()=>o({conversationId:l}),children:r.openChat}):null]})]}):null,t[44]=r.conversationId,t[45]=r.openChat,t[46]=o,t[47]=l,t[48]=L):L=t[48];let R;t[49]!==r.filterByTranscriptId||t[50]!==r.openChat||t[51]!==r.transcriptId||t[52]!==a||t[53]!==o||t[54]!==u?(R=u?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.transcriptId}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,$.jsx)(`code`,{className:`break-all text-fg`,children:u}),a?(0,$.jsx)(w,{type:`button`,variant:`secondary`,className:`h-7 px-2 text-[11px]`,onClick:()=>a(u),children:r.filterByTranscriptId}):null,o?(0,$.jsx)(w,{type:`button`,variant:`secondary`,className:`h-7 px-2 text-[11px]`,onClick:()=>o({transcriptId:u}),children:r.openChat}):null]})]}):null,t[49]=r.filterByTranscriptId,t[50]=r.openChat,t[51]=r.transcriptId,t[52]=a,t[53]=o,t[54]=u,t[55]=R):R=t[55];let z;t[56]!==T||t[57]!==E||t[58]!==D||t[59]!==j||t[60]!==M||t[61]!==P||t[62]!==F||t[63]!==I||t[64]!==L||t[65]!==R?(z=(0,$.jsxs)(`div`,{className:`grid grid-cols-[5.5rem_1fr] gap-x-3 gap-y-2 text-xs`,children:[T,E,D,j,M,P,F,I,L,R]}),t[56]=T,t[57]=E,t[58]=D,t[59]=j,t[60]=M,t[61]=P,t[62]=F,t[63]=I,t[64]=L,t[65]=R,t[66]=z):z=t[66];let B;t[67]!==r.metadata||t[68]!==n.meta?(B=n.meta&&Object.keys(n.meta).length>0?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{className:`text-xs font-sans font-medium text-fg-muted`,children:r.metadata}),(0,$.jsx)(`pre`,{className:`mt-2 overflow-x-auto whitespace-pre-wrap break-words border border-edge bg-surface-base p-3 text-xs leading-relaxed text-fg dark:border-edge`,children:JSON.stringify(n.meta,null,2)})]}):null,t[67]=r.metadata,t[68]=n.meta,t[69]=B):B=t[69];let ee;return t[70]!==z||t[71]!==B||t[72]!==S||t[73]!==C?(ee=(0,$.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[S,C,z,B]}),t[70]=z,t[71]=B,t[72]=S,t[73]=C,t[74]=ee):ee=t[74],ee}function He(e){let t=(0,K.c)(50),{L:n,log:r,onClose:i,copiedDetail:a,onCopiedMessage:o,onCopiedJson:s,onFilterByRequestId:c,onFilterByTranscriptId:u,onOpenChat:f}=e,p=r!==null,m;t[0]===i?m=t[1]:(m=e=>!e&&i(),t[0]=i,t[1]=m);let h;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(g,{className:d(`xopc-dialog-overlay fixed inset-0 bg-scrim`,P)}),t[2]=h):h=t[2];let S;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(S=d(`xopc-drawer-right fixed right-0 top-0 flex size-full max-w-lg flex-col border-l border-edge bg-surface-overlay shadow-popover outline-none`,N,`dark:border-edge`),t[3]=S):S=t[3];let T;t[4]===n.details?T=t[5]:(T=(0,$.jsx)(b,{className:`text-base font-semibold tracking-tight text-fg`,children:n.details}),t[4]=n.details,t[5]=T);let E;t[6]!==n.copied||t[7]!==n.copyJson||t[8]!==n.copyMessage||t[9]!==a||t[10]!==r||t[11]!==s||t[12]!==o?(E=r?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(w,{type:`button`,variant:`ghost`,className:`h-9 shrink-0 gap-1 px-2 text-xs`,onClick:()=>{C(typeof r.message==`string`?r.message:``).then(e=>{e&&o()})},children:[(0,$.jsx)(U,{className:`size-3.5 shrink-0`,strokeWidth:1.75}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:a===`message`?n.copied:n.copyMessage})]}),(0,$.jsxs)(w,{type:`button`,variant:`ghost`,className:`h-9 shrink-0 gap-1 px-2 text-xs`,onClick:()=>{C(JSON.stringify(r,null,2)).then(e=>{e&&s()})},children:[(0,$.jsx)(U,{className:`size-3.5 shrink-0`,strokeWidth:1.75}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:a===`json`?n.copied:n.copyJson})]})]}):null,t[6]=n.copied,t[7]=n.copyJson,t[8]=n.copyMessage,t[9]=a,t[10]=r,t[11]=s,t[12]=o,t[13]=E):E=t[13];let D;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(l,{className:`size-5`,strokeWidth:1.75}),t[14]=D):D=t[14];let O;t[15]===n.close?O=t[16]:(O=(0,$.jsx)(_,{asChild:!0,children:(0,$.jsx)(w,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":n.close,children:D})}),t[15]=n.close,t[16]=O);let k;t[17]!==E||t[18]!==O?(k=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[E,O]}),t[17]=E,t[18]=O,t[19]=k):k=t[19];let A;t[20]!==T||t[21]!==k?(A=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3 dark:border-edge`,children:[T,k]}),t[20]=T,t[21]=k,t[22]=A):A=t[22];let j;t[23]!==n.conversationId||t[24]!==n.filterByRequestId||t[25]!==n.filterByTranscriptId||t[26]!==n.level||t[27]!==n.message||t[28]!==n.metadata||t[29]!==n.module||t[30]!==n.openChat||t[31]!==n.phase||t[32]!==n.requestId||t[33]!==n.stackTrace||t[34]!==n.time||t[35]!==n.transcriptId||t[36]!==r||t[37]!==c||t[38]!==u||t[39]!==f?(j=r?(0,$.jsx)(Ve,{log:r,labels:{time:n.time,level:n.level,module:n.module,message:n.message,metadata:n.metadata,requestId:n.requestId,conversationId:n.conversationId,transcriptId:n.transcriptId,phase:n.phase,stackTrace:n.stackTrace,filterByRequestId:n.filterByRequestId,filterByTranscriptId:n.filterByTranscriptId,openChat:n.openChat},onFilterByRequestId:c,onFilterByTranscriptId:u,onOpenChat:f}):null,t[23]=n.conversationId,t[24]=n.filterByRequestId,t[25]=n.filterByTranscriptId,t[26]=n.level,t[27]=n.message,t[28]=n.metadata,t[29]=n.module,t[30]=n.openChat,t[31]=n.phase,t[32]=n.requestId,t[33]=n.stackTrace,t[34]=n.time,t[35]=n.transcriptId,t[36]=r,t[37]=c,t[38]=u,t[39]=f,t[40]=j):j=t[40];let M;t[41]===j?M=t[42]:(M=(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-4 font-mono text-sm leading-relaxed`,children:j}),t[41]=j,t[42]=M);let F;t[43]!==A||t[44]!==M?(F=(0,$.jsxs)(v,{children:[h,(0,$.jsxs)(y,{className:S,"aria-describedby":void 0,children:[A,M]})]}),t[43]=A,t[44]=M,t[45]=F):F=t[45];let I;return t[46]!==p||t[47]!==F||t[48]!==m?(I=(0,$.jsx)(x,{open:p,onOpenChange:m,children:F}),t[46]=p,t[47]=F,t[48]=m,t[49]=I):I=t[49],I}function Ue(e){let t=(0,K.c)(25),{L:n,open:r,onOpenChange:i,files:a,logDir:o}=e,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(g,{className:d(`xopc-dialog-overlay fixed inset-0 bg-scrim`,P)}),t[0]=s):s=t[0];let c;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=d(`xopc-dialog-content fixed left-1/2 top-1/2 flex max-h-[min(32rem,85vh)] w-[min(100%-2rem,24rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl border border-edge bg-surface-overlay shadow-popover outline-none`,N,`dark:border-edge`),t[1]=c):c=t[1];let u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(ee,{className:`size-4 text-fg-muted`,strokeWidth:1.75}),t[2]=u):u=t[2];let f;t[3]===n.logFiles?f=t[4]:(f=(0,$.jsxs)(b,{className:`flex items-center gap-2 text-base font-semibold tracking-tight text-fg`,children:[u,n.logFiles]}),t[3]=n.logFiles,t[4]=f);let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(l,{className:`size-5`,strokeWidth:1.75}),t[5]=p):p=t[5];let m;t[6]===n.close?m=t[7]:(m=(0,$.jsx)(_,{asChild:!0,children:(0,$.jsx)(w,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":n.close,children:p})}),t[6]=n.close,t[7]=m);let h;t[8]!==f||t[9]!==m?(h=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3 dark:border-edge`,children:[f,m]}),t[8]=f,t[9]=m,t[10]=h):h=t[10];let S;t[11]!==n.filesEmpty||t[12]!==a?(S=(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:a.length===0?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.filesEmpty}):(0,$.jsx)(`ul`,{className:`flex flex-col gap-2`,children:a.map(We)})}),t[11]=n.filesEmpty,t[12]=a,t[13]=S):S=t[13];let C;t[14]!==n.logDir||t[15]!==o?(C=o?(0,$.jsxs)(`div`,{className:`shrink-0 border-t border-edge-subtle px-4 py-2 text-xs text-fg-subtle dark:border-edge`,children:[(0,$.jsxs)(`span`,{className:`font-medium text-fg-muted`,children:[n.logDir,`: `]}),(0,$.jsx)(`code`,{className:`break-all text-fg-subtle`,children:o})]}):null,t[14]=n.logDir,t[15]=o,t[16]=C):C=t[16];let T;t[17]!==h||t[18]!==S||t[19]!==C?(T=(0,$.jsxs)(v,{children:[s,(0,$.jsxs)(y,{className:c,children:[h,S,C]})]}),t[17]=h,t[18]=S,t[19]=C,t[20]=T):T=t[20];let E;return t[21]!==i||t[22]!==r||t[23]!==T?(E=(0,$.jsx)(x,{open:r,onOpenChange:i,children:T}),t[21]=i,t[22]=r,t[23]=T,t[24]=E):E=t[24],E}function We(e){return(0,$.jsxs)(`li`,{className:`flex flex-col gap-1 rounded-lg border border-edge-subtle bg-surface-base px-3 py-2 dark:border-edge`,children:[(0,$.jsx)(`span`,{className:`break-all font-mono text-xs text-fg`,children:e.name}),(0,$.jsxs)(`span`,{className:`flex flex-wrap gap-x-2 text-xs text-fg-subtle`,children:[(0,$.jsx)(`span`,{children:Ee(e.size)}),(0,$.jsx)(`span`,{children:Te(e.modified)})]})]},e.name)}function Ge(e){let t=(0,K.c)(68),{L:n,open:r,onOpenChange:i,dateFrom:a,onDateFromChange:o,dateTo:s,onDateToChange:c,selectedLevels:u,onToggleLevel:f}=e,p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(g,{className:d(`xopc-dialog-overlay fixed inset-0 bg-scrim`,P)}),t[0]=p):p=t[0];let m;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(m=d(`xopc-dialog-content fixed left-1/2 top-1/2 flex max-h-[min(32rem,90vh)] w-[min(100%-2rem,22rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl border border-edge bg-surface-overlay shadow-popover outline-none`,N,`dark:border-edge`),t[1]=m):m=t[1];let h;t[2]===n.filtersDialogTitle?h=t[3]:(h=(0,$.jsx)(b,{className:`text-base font-semibold tracking-tight text-fg`,children:n.filtersDialogTitle}),t[2]=n.filtersDialogTitle,t[3]=h);let S;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(l,{className:`size-5`,strokeWidth:1.75}),t[4]=S):S=t[4];let C;t[5]===n.close?C=t[6]:(C=(0,$.jsx)(_,{asChild:!0,children:(0,$.jsx)(w,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":n.close,children:S})}),t[5]=n.close,t[6]=C);let T;t[7]!==h||t[8]!==C?(T=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3 dark:border-edge`,children:[h,C]}),t[7]=h,t[8]=C,t[9]=T):T=t[9];let E;t[10]===n.filtersDialogDesc?E=t[11]:(E=(0,$.jsx)(`div`,{id:`log-filters-desc`,className:`sr-only`,children:n.filtersDialogDesc}),t[10]=n.filtersDialogDesc,t[11]=E);let D;t[12]===n.timeRange?D=t[13]:(D=(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:n.timeRange}),t[12]=n.timeRange,t[13]=D);let O;t[14]===n.from?O=t[15]:(O=(0,$.jsx)(`label`,{htmlFor:`log-from-d`,className:`mb-1 block text-xs text-fg-muted`,children:n.from}),t[14]=n.from,t[15]=O);let k;t[16]===o?k=t[17]:(k=e=>o(e.target.value),t[16]=o,t[17]=k);let A;t[18]!==a||t[19]!==k?(A=(0,$.jsx)(`input`,{id:`log-from-d`,type:`datetime-local`,value:a,onChange:k,className:`w-full rounded-xl border border-edge bg-surface-base p-2 text-sm text-fg dark:border-edge`}),t[18]=a,t[19]=k,t[20]=A):A=t[20];let j;t[21]!==A||t[22]!==O?(j=(0,$.jsxs)(`div`,{children:[O,A]}),t[21]=A,t[22]=O,t[23]=j):j=t[23];let M;t[24]===n.to?M=t[25]:(M=(0,$.jsx)(`label`,{htmlFor:`log-to-d`,className:`mb-1 block text-xs text-fg-muted`,children:n.to}),t[24]=n.to,t[25]=M);let F;t[26]===c?F=t[27]:(F=e=>c(e.target.value),t[26]=c,t[27]=F);let I;t[28]!==s||t[29]!==F?(I=(0,$.jsx)(`input`,{id:`log-to-d`,type:`datetime-local`,value:s,onChange:F,className:`w-full rounded-xl border border-edge bg-surface-base p-2 text-sm text-fg dark:border-edge`}),t[28]=s,t[29]=F,t[30]=I):I=t[30];let L;t[31]!==M||t[32]!==I?(L=(0,$.jsxs)(`div`,{children:[M,I]}),t[31]=M,t[32]=I,t[33]=L):L=t[33];let R;t[34]!==j||t[35]!==L?(R=(0,$.jsxs)(`div`,{className:`mt-2 flex flex-col gap-3`,children:[j,L]}),t[34]=j,t[35]=L,t[36]=R):R=t[36];let z;t[37]===n.levelCustom?z=t[38]:(z=(0,$.jsx)(`p`,{className:`mt-6 text-xs font-medium text-fg-muted`,children:n.levelCustom}),t[37]=n.levelCustom,t[38]=z);let B;t[39]===n.levelCustomHint?B=t[40]:(B=(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-subtle`,children:n.levelCustomHint}),t[39]=n.levelCustomHint,t[40]=B);let ee=n.level,te;t[41]!==n.levelNames||t[42]!==f||t[43]!==u?(te=ce.map(e=>(0,$.jsx)(`button`,{type:`button`,className:d(`rounded-full border px-3 py-1.5 text-xs font-medium capitalize transition-[color,background-color,border-color] duration-150 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,u.has(e)?`border-edge bg-surface-active text-fg dark:border-edge`:`border-edge-subtle bg-surface-base text-fg-muted hover:bg-surface-hover dark:border-edge`),onClick:()=>f(e),children:n.levelNames[e]},e)),t[41]=n.levelNames,t[42]=f,t[43]=u,t[44]=te):te=t[44];let V;t[45]!==n.level||t[46]!==te?(V=(0,$.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,role:`group`,"aria-label":ee,children:te}),t[45]=n.level,t[46]=te,t[47]=V):V=t[47];let H;t[48]!==R||t[49]!==z||t[50]!==B||t[51]!==V||t[52]!==D?(H=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-4`,children:[D,R,z,B,V]}),t[48]=R,t[49]=z,t[50]=B,t[51]=V,t[52]=D,t[53]=H):H=t[53];let U;t[54]===i?U=t[55]:(U=()=>i(!1),t[54]=i,t[55]=U);let W;t[56]!==n.filtersDone||t[57]!==U?(W=(0,$.jsx)(`div`,{className:`shrink-0 border-t border-edge-subtle px-4 py-3 dark:border-edge`,children:(0,$.jsx)(w,{type:`button`,className:`w-full rounded-xl`,onClick:U,children:n.filtersDone})}),t[56]=n.filtersDone,t[57]=U,t[58]=W):W=t[58];let G;t[59]!==H||t[60]!==W||t[61]!==T||t[62]!==E?(G=(0,$.jsxs)(v,{children:[p,(0,$.jsxs)(y,{className:m,"aria-describedby":`log-filters-desc`,children:[T,E,H,W]})]}),t[59]=H,t[60]=W,t[61]=T,t[62]=E,t[63]=G):G=t[63];let q;return t[64]!==i||t[65]!==r||t[66]!==G?(q=(0,$.jsx)(x,{open:r,onOpenChange:i,children:G}),t[64]=i,t[65]=r,t[66]=G,t[67]=q):q=t[67],q}var Ke=1;function qe(e,t){let n=0,r=0,i=e;for(;i&&i!==t;)n+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;return i===t?{x:n,y:r}:null}var Je=`pointer-events-none absolute left-0 top-0 z-[1] rounded-pill bg-surface-panel shadow-sm will-change-transform [backface-visibility:hidden] dark:bg-surface-panel dark:shadow-sm dark:ring-1 dark:ring-edge-strong/40`,Ye=`touch-target relative z-[2] box-border flex h-6 flex-1 cursor-pointer items-center justify-center gap-1 rounded-pill border-0 bg-transparent px-2 py-0 text-center text-xs font-medium leading-none outline-none transition-[color,background-color,box-shadow] duration-150 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel active:scale-100 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`;function Xe({value:e,onChange:t,options:n,"aria-label":r,className:i,buttonClassName:a}){let o=(0,G.useRef)(null),s=(0,G.useRef)([]),[c,l]=(0,G.useState)({x:0,y:0,w:0,h:0}),[u,f]=(0,G.useState)(!1),[p,m]=(0,G.useState)(!1),h=(0,G.useCallback)(()=>{let t=o.current;if(!t)return;let r=n.findIndex(t=>t.value===e);if(r<0)return;let i=s.current[r];if(!i)return;let a=Ke,c=t.getBoundingClientRect(),u=i.getBoundingClientRect(),d=qe(i,t),p,m;if(d)p=d.x,m=d.y;else{let e=getComputedStyle(t),n=parseFloat(e.borderLeftWidth)||0,r=parseFloat(e.borderTopWidth)||0;p=u.left-c.left-n,m=u.top-c.top-r}l({x:p+a,y:m+a,w:Math.max(0,u.width-a*2),h:Math.max(0,u.height-a*2)}),f(!0)},[n,e]),g=(0,G.useRef)(h);return g.current=h,(0,G.useLayoutEffect)(()=>{let e=requestAnimationFrame(()=>h());return()=>cancelAnimationFrame(e)},[h]),(0,G.useEffect)(()=>{let e=requestAnimationFrame(()=>{requestAnimationFrame(()=>m(!0))});return()=>cancelAnimationFrame(e)},[]),(0,G.useEffect)(()=>{let e=o.current;if(!e)return;let t=()=>{requestAnimationFrame(()=>g.current())},n=new ResizeObserver(t);return n.observe(e),window.addEventListener(`resize`,t),()=>{n.disconnect(),window.removeEventListener(`resize`,t)}},[]),(0,$.jsxs)(`div`,{ref:o,className:d(H,`relative isolate flex w-full max-w-full flex-row items-center`,i),role:`group`,"aria-label":r,children:[(0,$.jsx)(`div`,{"aria-hidden":!0,className:d(Je,`motion-reduce:!transition-none motion-reduce:!duration-0`,p&&`transition-[transform,width,height] duration-300 [transition-timing-function:cubic-bezier(0.32,0.72,0,1)]`),style:{width:c.w,height:c.h,transform:`translate3d(${c.x}px, ${c.y}px, 0)`,opacity:u&&c.w>0?1:0}}),n.map((n,r)=>{let i=n.icon,o=e===n.value;return(0,$.jsxs)(`button`,{ref:e=>{s.current[r]=e},type:`button`,"aria-pressed":o,title:n.title??n.label,onClick:()=>t(n.value),className:d(Ye,o?`text-fg`:`text-fg-subtle`,a),children:[i?(0,$.jsx)(i,{className:`block size-3 shrink-0 opacity-80`,strokeWidth:1.75,"aria-hidden":!0}):null,(0,$.jsx)(`span`,{className:`min-w-0 shrink truncate leading-none`,children:n.label})]},n.value)})]})}function Ze(e){let t=(0,K.c)(76),{L:n,levelSegment:r,onLevelSegment:i,searchInput:s,onSearchInputChange:u,moduleFilter:f,onModuleFilterChange:p,modules:m,onOpenFilters:h,activeFilterCount:g,hasActiveFilters:_,onClearFilters:v,autoRefresh:y}=e,b=n.filters,x;t[0]===n.presetAll?x=t[1]:(x={value:`all`,label:n.presetAll},t[0]=n.presetAll,t[1]=x);let S;t[2]===n.presetErrors?S=t[3]:(S={value:`errors`,label:n.presetErrors},t[2]=n.presetErrors,t[3]=S);let C;t[4]===n.presetWarnPlus?C=t[5]:(C={value:`warnPlus`,label:n.presetWarnPlus},t[4]=n.presetWarnPlus,t[5]=C);let T;t[6]===n.presetInfoPlus?T=t[7]:(T={value:`infoPlus`,label:n.presetInfoPlus},t[6]=n.presetInfoPlus,t[7]=T);let O;t[8]===n.presetVerbose?O=t[9]:(O={value:`verbose`,label:n.presetVerbose},t[8]=n.presetVerbose,t[9]=O);let k;t[10]===n.presetOther?k=t[11]:(k={value:`other`,label:n.presetOther},t[10]=n.presetOther,t[11]=k);let A;t[12]!==x||t[13]!==S||t[14]!==C||t[15]!==T||t[16]!==O||t[17]!==k?(A=[x,S,C,T,O,k],t[12]=x,t[13]=S,t[14]=C,t[15]=T,t[16]=O,t[17]=k,t[18]=A):A=t[18];let j;t[19]!==n.levelPresetAria||t[20]!==r||t[21]!==i||t[22]!==A?(j=(0,$.jsx)(`div`,{className:`overflow-x-auto pb-1 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,children:(0,$.jsx)(`div`,{className:`min-w-[min(100%,36rem)]`,children:(0,$.jsx)(Xe,{"aria-label":n.levelPresetAria,value:r,onChange:i,options:A,buttonClassName:`h-8 px-1.5 text-[11px] sm:px-2 sm:text-xs`})})}),t[19]=n.levelPresetAria,t[20]=r,t[21]=i,t[22]=A,t[23]=j):j=t[23];let M;t[24]===n.searchPlaceholder?M=t[25]:(M=(0,$.jsx)(`span`,{className:`sr-only`,children:n.searchPlaceholder}),t[24]=n.searchPlaceholder,t[25]=M);let N;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(c,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,strokeWidth:1.75,"aria-hidden":!0}),t[26]=N):N=t[26];let P;t[27]===u?P=t[28]:(P=e=>u(e.target.value),t[27]=u,t[28]=P);let F=n.searchPlaceholder,I;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(I=d(`h-10 w-full rounded-md border border-edge bg-surface-panel py-0 pl-10 pr-3 text-sm leading-5 text-fg placeholder:text-fg-subtle dark:border-edge`,D),t[29]=I):I=t[29];let L;t[30]!==n.searchPlaceholder||t[31]!==s||t[32]!==P?(L=(0,$.jsx)(`input`,{type:`search`,value:s,onChange:P,placeholder:F,autoComplete:`off`,spellCheck:!1,className:I}),t[30]=n.searchPlaceholder,t[31]=s,t[32]=P,t[33]=L):L=t[33];let R;t[34]!==M||t[35]!==L?(R=(0,$.jsxs)(`label`,{className:`relative min-w-0 flex-1 sm:min-w-[12rem]`,children:[M,N,L]}),t[34]=M,t[35]=L,t[36]=R):R=t[36];let z;t[37]===p?z=t[38]:(z=e=>p(e.target.value),t[37]=p,t[38]=z);let B=n.module,ee=n.module,V;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(V=d(E,`h-10 w-full min-w-0 rounded-md py-0`),t[39]=V):V=t[39];let H;t[40]===n.allModules?H=t[41]:(H=(0,$.jsx)(o,{value:``,children:n.allModules}),t[40]=n.allModules,t[41]=H);let U;t[42]===m?U=t[43]:(U=m.map(Qe),t[42]=m,t[43]=U);let W;t[44]!==n.module||t[45]!==f||t[46]!==z||t[47]!==H||t[48]!==U?(W=(0,$.jsxs)(a,{id:`log-module`,value:f,onChange:z,"aria-label":B,title:ee,className:V,children:[H,U]}),t[44]=n.module,t[45]=f,t[46]=z,t[47]=H,t[48]=U,t[49]=W):W=t[49];let G;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,$.jsx)(te,{className:`size-4`,strokeWidth:1.75}),t[50]=G):G=t[50];let q;t[51]===g?q=t[52]:(q=g>0?(0,$.jsx)(`span`,{className:`rounded-md bg-surface-hover px-1.5 text-xs tabular-nums text-fg-muted`,children:g}):null,t[51]=g,t[52]=q);let J;t[53]!==n.filtersMore||t[54]!==h||t[55]!==q?(J=(0,$.jsxs)(w,{type:`button`,variant:`secondary`,className:`h-10 min-h-[44px] gap-2 rounded-md sm:min-h-10`,onClick:h,children:[G,n.filtersMore,q]}),t[53]=n.filtersMore,t[54]=h,t[55]=q,t[56]=J):J=t[56];let Y;t[57]!==n.clear||t[58]!==_||t[59]!==v?(Y=_?(0,$.jsxs)(w,{type:`button`,variant:`ghost`,className:`h-10 min-h-[44px] gap-1 sm:min-h-10`,onClick:v,children:[(0,$.jsx)(l,{className:`size-4`,strokeWidth:1.75}),n.clear]}):null,t[57]=n.clear,t[58]=_,t[59]=v,t[60]=Y):Y=t[60];let X;t[61]!==J||t[62]!==Y?(X=(0,$.jsxs)(`div`,{className:`flex min-w-0 shrink-0 items-center justify-end gap-2`,children:[J,Y]}),t[61]=J,t[62]=Y,t[63]=X):X=t[63];let Z;t[64]!==R||t[65]!==W||t[66]!==X?(Z=(0,$.jsxs)(`div`,{className:`grid gap-2 lg:grid-cols-[minmax(16rem,1fr)_minmax(12rem,16rem)_auto] lg:items-center`,children:[R,W,X]}),t[64]=R,t[65]=W,t[66]=X,t[67]=Z):Z=t[67];let Q;t[68]!==n.liveHint||t[69]!==y?(Q=y?(0,$.jsx)(`p`,{className:`text-xs leading-5 text-fg-subtle`,children:n.liveHint}):null,t[68]=n.liveHint,t[69]=y,t[70]=Q):Q=t[70];let ne;return t[71]!==n.filters||t[72]!==Z||t[73]!==Q||t[74]!==j?(ne=(0,$.jsxs)(`section`,{className:`flex flex-col gap-4 rounded-xl bg-surface-hover/20 p-4 sm:p-5`,"aria-label":b,children:[j,Z,Q]}),t[71]=n.filters,t[72]=Z,t[73]=Q,t[74]=j,t[75]=ne):ne=t[75],ne}function Qe(e){return(0,$.jsx)(o,{value:e,children:e},e)}function $e(e){let t=(0,K.c)(20),{L:n,logs:r,loading:i,hasMore:a,onSelectLog:o,onLoadMore:s,onRefreshAll:c,onFilterByRequestId:l}=e,u;t[0]!==i||t[1]!==r.length?(u=i&&r.length===0?(0,$.jsx)(`div`,{className:`overflow-hidden rounded-xl bg-surface-hover/20`,"aria-busy":`true`,children:Array.from({length:8}).map(et)}):null,t[0]=i,t[1]=r.length,t[2]=u):u=t[2];let f;t[3]!==n||t[4]!==i||t[5]!==r.length||t[6]!==c?(f=!i&&r.length===0?(0,$.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 rounded-xl bg-surface-hover/20 py-16 text-center`,children:[(0,$.jsx)(B,{className:`size-12 text-fg-subtle`,strokeWidth:1.5,"aria-hidden":!0}),(0,$.jsx)(`h2`,{className:`text-base font-semibold tracking-tight text-fg`,children:n.noLogs}),(0,$.jsx)(`p`,{className:`max-w-sm text-sm leading-relaxed text-fg-muted`,children:n.noLogsDescription}),(0,$.jsxs)(w,{type:`button`,variant:`secondary`,className:`mt-4 gap-2`,onClick:c,children:[(0,$.jsx)(z,{className:`size-4`,strokeWidth:1.75}),n.refresh]})]}):null,t[3]=n,t[4]=i,t[5]=r.length,t[6]=c,t[7]=f):f=t[7];let p;t[8]!==n||t[9]!==a||t[10]!==i||t[11]!==r||t[12]!==l||t[13]!==s||t[14]!==o?(p=r.length>0?(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsxs)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:[xe(n.showingCount,{count:String(r.length)}),a?(0,$.jsxs)(`span`,{className:`text-fg-subtle`,children:[` · `,n.moreAvailable]}):null]}),(0,$.jsxs)(`div`,{className:`overflow-hidden rounded-xl bg-surface-hover/20 p-1 text-sm leading-6`,children:[(0,$.jsxs)(`div`,{className:`hidden items-center gap-3 px-3 py-2 text-xs font-medium text-fg-subtle md:flex`,"aria-hidden":!0,children:[(0,$.jsx)(`span`,{className:`w-[5.25rem] shrink-0`,children:n.time}),(0,$.jsx)(`span`,{className:`w-[4.5rem] shrink-0`,children:n.level}),(0,$.jsx)(`span`,{className:`w-[4.5rem] shrink-0 sm:w-[5.25rem]`,children:n.requestId}),(0,$.jsx)(`span`,{className:`hidden max-w-[6rem] shrink-0 xl:block`,children:n.phase}),(0,$.jsx)(`span`,{className:`hidden max-w-[7rem] shrink-0 lg:block`,children:n.module}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1`,children:n.message})]}),(0,$.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:r.map(e=>{let t=e.level??`info`,r=typeof e.requestId==`string`?e.requestId.trim():``,i=ke(e),a=t===`error`||t===`fatal`;return(0,$.jsx)(`li`,{className:`rounded-lg bg-surface-base/45`,children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>o(e),className:d(`flex w-full min-w-0 items-center gap-3 px-3 py-2.5 text-left transition-colors duration-150 ease-out`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,a&&`bg-red-500/5`),children:[(0,$.jsx)(`span`,{className:`w-[4.75rem] shrink-0 font-mono text-xs tabular-nums text-fg-subtle sm:w-[5.25rem] sm:text-sm`,children:we(e.timestamp)}),(0,$.jsx)(`span`,{className:d(`w-[4.5rem] shrink-0 truncate`,a?`font-medium text-red-600 dark:text-red-400`:`text-fg-muted`),title:t,children:Oe(t)}),(0,$.jsx)(`span`,{className:`hidden w-[4.5rem] shrink-0 truncate font-mono sm:block sm:w-[5.25rem]`,children:r?l?(0,$.jsx)(`span`,{role:`link`,tabIndex:0,className:`cursor-pointer text-accent hover:underline`,title:`${n.requestId}: ${r}`,onClick:e=>{e.stopPropagation(),l(r)},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),l(r))},children:De(r)}):(0,$.jsx)(`span`,{className:`text-fg-subtle`,title:`${n.requestId}: ${r}`,children:De(r)}):(0,$.jsx)(`span`,{className:`text-fg-subtle`,children:`—`})}),(0,$.jsx)(`span`,{className:`hidden max-w-[6rem] shrink-0 truncate text-fg-subtle xl:inline`,title:i===`—`?void 0:i,children:i===`—`?`—`:i}),(0,$.jsx)(`span`,{className:`hidden max-w-[7rem] shrink-0 truncate text-fg-muted lg:inline`,title:Se(e),children:Se(e)}),(0,$.jsx)(`span`,{className:d(`min-w-0 flex-1 truncate`,`text-fg`),children:Ce(e)})]})},Ae(e))})})]}),a?(0,$.jsx)(`div`,{className:`flex justify-center pt-1`,children:(0,$.jsxs)(w,{type:`button`,variant:`secondary`,className:`gap-2`,disabled:i,onClick:s,children:[i?(0,$.jsx)(z,{className:`size-4 animate-spin motion-reduce:animate-none`,strokeWidth:1.75}):(0,$.jsx)(L,{className:`size-4`,strokeWidth:1.75}),n.loadMore]})}):null]}):null,t[8]=n,t[9]=a,t[10]=i,t[11]=r,t[12]=l,t[13]=s,t[14]=o,t[15]=p):p=t[15];let m;return t[16]!==u||t[17]!==f||t[18]!==p?(m=(0,$.jsxs)($.Fragment,{children:[u,f,p]}),t[16]=u,t[17]=f,t[18]=p,t[19]=m):m=t[19],m}function et(e,t){return(0,$.jsxs)(`div`,{className:`flex gap-3 px-3 py-2.5`,children:[(0,$.jsx)(`div`,{className:`h-4 w-16 shrink-0 bg-surface-hover motion-reduce:animate-none animate-pulse`}),(0,$.jsx)(`div`,{className:`h-4 w-12 shrink-0 bg-surface-hover motion-reduce:animate-none animate-pulse`}),(0,$.jsx)(`div`,{className:`h-4 w-20 shrink-0 bg-surface-hover motion-reduce:animate-none animate-pulse`}),(0,$.jsx)(`div`,{className:`h-4 min-w-0 flex-1 bg-surface-hover motion-reduce:animate-none animate-pulse`})]},t)}function tt(e){let t=(0,K.c)(8),{L:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(R,{className:`mt-0.5 size-5 shrink-0 text-fg-subtle`,strokeWidth:1.75,"aria-hidden":!0}),t[0]=r):r=t[0];let i;t[1]===n.title?i=t[2]:(i=(0,$.jsx)(`h1`,{className:`text-base font-semibold tracking-tight text-fg`,children:n.title}),t[1]=n.title,t[2]=i);let a;t[3]===n.needToken?a=t[4]:(a=(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg-muted`,children:n.needToken}),t[3]=n.needToken,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,$.jsx)(`div`,{className:`flex w-full flex-col gap-3 px-3 py-10 sm:px-5 xl:px-6`,children:(0,$.jsxs)(`div`,{className:`flex items-start gap-3 rounded-2xl bg-surface-base p-6`,children:[r,(0,$.jsxs)(`div`,{children:[i,a]})]})}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function nt(e){return/[",\n\r]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function rt(e){let t=[`timestamp`,`level`,`module`,`phase`,`requestId`,`transcriptId`,`message`],n=e.map(e=>{let t=String(e.module||``),n=String(e.phase??e.meta?.phase??``);return[e.timestamp,e.level,t,n,e.requestId??``,e.transcriptId??``,e.message??``].map(e=>nt(String(e))).join(`,`)});return[t.join(`,`),...n].join(`
|
|
2
|
+
`)}function it(e,t,n){let r=new Blob([e],{type:n}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=t,a.click(),URL.revokeObjectURL(i)}function at(e,t){let n=new Date().toISOString().replace(/[:.]/g,`-`);if(t===`json`){it(JSON.stringify(e,null,2),`xopc-logs-${n}.json`,`application/json`);return}it(rt(e),`xopc-logs-${n}.csv`,`text/csv;charset=utf-8`)}function ot(e){let t=(0,K.c)(32),{L:n,logs:r,disabled:i}=e,a=i||r.length===0,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(s,{className:`size-4`,strokeWidth:1.75}),t[0]=o):o=t[0];let c;t[1]===n.exportLogs?c=t[2]:(c=(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:n.exportLogs}),t[1]=n.exportLogs,t[2]=c);let l;t[3]!==n.exportLogs||t[4]!==a||t[5]!==c?(l=(0,$.jsx)(j,{asChild:!0,children:(0,$.jsxs)(w,{type:`button`,variant:`secondary`,className:`h-9 gap-2 whitespace-nowrap px-3 text-xs`,disabled:a,title:n.exportLogs,children:[o,c]})}),t[3]=n.exportLogs,t[4]=a,t[5]=c,t[6]=l):l=t[6];let u;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(u=d(`w-52 rounded-xl border border-edge bg-surface-panel p-2 shadow-popover outline-none`,F,`dark:border-edge`),t[7]=u):u=t[7];let f;t[8]===n.exportLogs?f=t[9]:(f=(0,$.jsx)(`p`,{className:`px-2 py-1 text-xs font-medium text-fg`,children:n.exportLogs}),t[8]=n.exportLogs,t[9]=f);let p;t[10]===n.exportHint?p=t[11]:(p=(0,$.jsx)(`p`,{className:`px-2 pb-2 text-xs leading-5 text-fg-muted`,children:n.exportHint}),t[10]=n.exportHint,t[11]=p);let m;t[12]===r?m=t[13]:(m=()=>at(r,`json`),t[12]=r,t[13]=m);let h;t[14]!==n.exportJson||t[15]!==m?(h=(0,$.jsx)(w,{type:`button`,variant:`ghost`,className:`h-8 justify-start px-2 text-xs`,onClick:m,children:n.exportJson}),t[14]=n.exportJson,t[15]=m,t[16]=h):h=t[16];let g;t[17]===r?g=t[18]:(g=()=>at(r,`csv`),t[17]=r,t[18]=g);let _;t[19]!==n.exportCsv||t[20]!==g?(_=(0,$.jsx)(w,{type:`button`,variant:`ghost`,className:`h-8 justify-start px-2 text-xs`,onClick:g,children:n.exportCsv}),t[19]=n.exportCsv,t[20]=g,t[21]=_):_=t[21];let v;t[22]!==_||t[23]!==h?(v=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[h,_]}),t[22]=_,t[23]=h,t[24]=v):v=t[24];let y;t[25]!==v||t[26]!==f||t[27]!==p?(y=(0,$.jsx)(O,{children:(0,$.jsxs)(k,{side:`bottom`,align:`end`,sideOffset:6,className:u,children:[f,p,v]})}),t[25]=v,t[26]=f,t[27]=p,t[28]=y):y=t[28];let b;return t[29]!==y||t[30]!==l?(b=(0,$.jsxs)(A,{children:[l,y]}),t[29]=y,t[30]=l,t[31]=b):b=t[31],b}function st(e){let t=(0,K.c)(38),{L:n}=e,[r,i]=(0,G.useState)(!1),[a,o]=(0,G.useState)(`info`),[s,c]=(0,G.useState)(!1),[l,u]=(0,G.useState)(null),f,p;t[0]!==n.logLevelLoadError||t[1]!==r?(f=()=>{if(!r)return;let e=!1;return ne().then(t=>{e||o(t)}).catch(t=>{e||u(t instanceof Error?t.message:n.logLevelLoadError)}),()=>{e=!0}},p=[r,n.logLevelLoadError],t[0]=n.logLevelLoadError,t[1]=r,t[2]=f,t[3]=p):(f=t[2],p=t[3]),(0,G.useEffect)(f,p);let m;t[4]===n.logLevelSaveError?m=t[5]:(m=e=>{c(!0),u(null),re(e).then(e=>{o(e.current),i(!1)}).catch(e=>{u(e instanceof Error?e.message:n.logLevelSaveError)}).finally(()=>c(!1))},t[4]=n.logLevelSaveError,t[5]=m);let h=m,g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(I,{className:`size-4`,strokeWidth:1.75}),t[6]=g):g=t[6];let _;t[7]===n.logLevelTitle?_=t[8]:(_=(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:n.logLevelTitle}),t[7]=n.logLevelTitle,t[8]=_);let v;t[9]===a?v=t[10]:(v=(0,$.jsx)(`span`,{className:`tabular-nums text-fg-muted`,children:a}),t[9]=a,t[10]=v);let y;t[11]!==n.logLevelTitle||t[12]!==_||t[13]!==v?(y=(0,$.jsx)(j,{asChild:!0,children:(0,$.jsxs)(w,{type:`button`,variant:`secondary`,className:`h-9 gap-2 whitespace-nowrap px-3 text-xs`,title:n.logLevelTitle,children:[g,_,v]})}),t[11]=n.logLevelTitle,t[12]=_,t[13]=v,t[14]=y):y=t[14];let b;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(b=d(`w-56 rounded-xl border border-edge bg-surface-panel p-3 shadow-popover outline-none`,F,`dark:border-edge`),t[15]=b):b=t[15];let x;t[16]===n.logLevelTitle?x=t[17]:(x=(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:n.logLevelTitle}),t[16]=n.logLevelTitle,t[17]=x);let S;t[18]===n.logLevelHint?S=t[19]:(S=(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n.logLevelHint}),t[18]=n.logLevelHint,t[19]=S);let C;t[20]!==n.levelNames||t[21]!==h||t[22]!==a||t[23]!==s?(C=ce.map(e=>(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,disabled:s,onClick:()=>h(e),className:d(`flex w-full items-center justify-between rounded-md px-2 py-1.5 text-left text-xs transition-colors`,a===e?`bg-accent/10 font-medium text-accent`:`text-fg hover:bg-surface-hover`),children:[(0,$.jsx)(`span`,{children:n.levelNames[e]}),(0,$.jsx)(`span`,{className:`font-mono text-[10px] uppercase text-fg-subtle`,children:e})]})},e)),t[20]=n.levelNames,t[21]=h,t[22]=a,t[23]=s,t[24]=C):C=t[24];let T;t[25]===C?T=t[26]:(T=(0,$.jsx)(`ul`,{className:`mt-3 flex flex-col gap-1`,children:C}),t[25]=C,t[26]=T);let E;t[27]===l?E=t[28]:(E=l?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-red-600 dark:text-red-400`,children:l}):null,t[27]=l,t[28]=E);let D;t[29]!==S||t[30]!==T||t[31]!==E||t[32]!==x?(D=(0,$.jsx)(O,{children:(0,$.jsxs)(k,{side:`bottom`,align:`end`,sideOffset:6,className:b,children:[x,S,T,E]})}),t[29]=S,t[30]=T,t[31]=E,t[32]=x,t[33]=D):D=t[33];let M;return t[34]!==r||t[35]!==D||t[36]!==y?(M=(0,$.jsxs)(A,{open:r,onOpenChange:i,children:[y,D]}),t[34]=r,t[35]=D,t[36]=y,t[37]=M):M=t[37],M}function ct(e){let t=(0,K.c)(49),{L:n,autoRefresh:r,onAutoRefreshChange:i,fileCount:a,onOpenFiles:o,loading:s,onRefreshAll:c,logs:l}=e,u;t[0]===n.title?u=t[1]:(u=(0,$.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-fg sm:text-lg`,children:n.title}),t[0]=n.title,t[1]=u);let d;t[2]===n.subtitle?d=t[3]:(d=(0,$.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-fg-muted sm:mt-1`,children:n.subtitle}),t[2]=n.subtitle,t[3]=d);let f;t[4]!==u||t[5]!==d?(f=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[u,d]}),t[4]=u,t[5]=d,t[6]=f):f=t[6];let p=r?`live`:`paused`,m;t[7]===i?m=t[8]:(m=e=>i(e===`live`),t[7]=i,t[8]=m);let h;t[9]===n.refreshManual?h=t[10]:(h={value:`paused`,label:n.refreshManual},t[9]=n.refreshManual,t[10]=h);let g;t[11]===n.refreshLive?g=t[12]:(g={value:`live`,label:n.refreshLive},t[11]=n.refreshLive,t[12]=g);let _;t[13]!==h||t[14]!==g?(_=[h,g],t[13]=h,t[14]=g,t[15]=_):_=t[15];let v;t[16]!==n.refreshModeAria||t[17]!==p||t[18]!==m||t[19]!==_?(v=(0,$.jsx)(`div`,{className:`w-full sm:w-52`,children:(0,$.jsx)(Xe,{"aria-label":n.refreshModeAria,value:p,onChange:m,options:_,buttonClassName:`h-8`})}),t[16]=n.refreshModeAria,t[17]=p,t[18]=m,t[19]=_,t[20]=v):v=t[20];let y;t[21]===n?y=t[22]:(y=(0,$.jsx)(st,{L:n}),t[21]=n,t[22]=y);let b;t[23]!==n||t[24]!==s||t[25]!==l?(b=(0,$.jsx)(ot,{L:n,logs:l,disabled:s}),t[23]=n,t[24]=s,t[25]=l,t[26]=b):b=t[26];let x;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(ee,{className:`size-4`,strokeWidth:1.75}),t[27]=x):x=t[27];let S;t[28]===a?S=t[29]:(S=a>0?(0,$.jsx)(`span`,{className:`rounded-full bg-surface-hover px-1.5 text-xs text-fg-muted`,children:a}):null,t[28]=a,t[29]=S);let C;t[30]!==n.logFiles||t[31]!==o||t[32]!==S?(C=(0,$.jsxs)(w,{type:`button`,variant:`ghost`,className:`h-9 min-h-[44px] min-w-[44px] px-2 sm:min-h-9 sm:min-w-0`,title:n.logFiles,"aria-label":n.logFiles,onClick:o,children:[x,S]}),t[30]=n.logFiles,t[31]=o,t[32]=S,t[33]=C):C=t[33];let T;t[34]!==n.refresh||t[35]!==s||t[36]!==c?(T=(0,$.jsx)(V,{className:`h-9 min-h-[44px] min-w-[44px] px-2 sm:min-h-9 sm:min-w-0`,loading:s,label:n.refresh,onClick:c}),t[34]=n.refresh,t[35]=s,t[36]=c,t[37]=T):T=t[37];let E;t[38]!==y||t[39]!==b||t[40]!==C||t[41]!==T?(E=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center justify-end gap-1 sm:self-center`,children:[y,b,C,T]}),t[38]=y,t[39]=b,t[40]=C,t[41]=T,t[42]=E):E=t[42];let D;t[43]!==E||t[44]!==v?(D=(0,$.jsxs)(`div`,{className:`flex w-full shrink-0 flex-col gap-2 rounded-xl bg-surface-hover/20 p-2 sm:flex-row sm:items-center sm:justify-between`,children:[v,E]}),t[43]=E,t[44]=v,t[45]=D):D=t[45];let O;return t[46]!==D||t[47]!==f?(O=(0,$.jsxs)(`header`,{className:`flex flex-col gap-4`,children:[f,D]}),t[46]=D,t[47]=f,t[48]=O):O=t[48],O}function lt(e){let t=(0,K.c)(33),{L:n,stats:r}=e,i;t[0]===r.byLevel?i=t[1]:(i=r.byLevel??{},t[0]=r.byLevel,t[1]=i);let a;t[2]!==n.levelNames||t[3]!==i?(a=Ne(i,n.levelNames),t[2]=n.levelNames,t[3]=i,t[4]=a):a=t[4];let o=a,s=r.runtime?.errorsLast24h;if(!o&&s==null)return null;let c;t[5]===n.statsRegion?c=t[6]:(c=(0,$.jsx)(`span`,{className:`font-medium text-fg-muted`,children:n.statsRegion}),t[5]=n.statsRegion,t[6]=c);let l;t[7]===o?l=t[8]:(l=o?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`mx-1.5 text-fg-subtle`,children:`·`}),(0,$.jsx)(`span`,{className:`tabular-nums`,children:o})]}):null,t[7]=o,t[8]=l);let u;t[9]!==n.runtimeErrors||t[10]!==s?(u=s!=null&&s>0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`mx-1.5 text-fg-subtle`,children:`·`}),(0,$.jsxs)(`span`,{className:`tabular-nums text-red-600 dark:text-red-400`,children:[n.runtimeErrors,` `,s]})]}):null,t[9]=n.runtimeErrors,t[10]=s,t[11]=u):u=t[11];let f;t[12]!==c||t[13]!==l||t[14]!==u?(f=(0,$.jsx)(j,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,className:`max-w-full truncate rounded-lg border border-transparent px-1 py-0.5 text-left text-xs leading-5 text-fg-subtle transition-colors duration-150 ease-out hover:border-edge-subtle hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel dark:hover:border-edge`,children:[c,l,u]})}),t[12]=c,t[13]=l,t[14]=u,t[15]=f):f=t[15];let p;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(p=d(`w-[min(calc(100vw-2rem),20rem)] rounded-xl border border-edge bg-surface-panel p-3 shadow-popover outline-none`,F,`dark:border-edge`),t[16]=p):p=t[16];let m;t[17]===n.statsDetailTitle?m=t[18]:(m=(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:n.statsDetailTitle}),t[17]=n.statsDetailTitle,t[18]=m);let h;t[19]===n.statsHint?h=t[20]:(h=(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n.statsHint}),t[19]=n.statsHint,t[20]=h);let g;t[21]!==n.levelNames||t[22]!==r.byLevel?(g=ce.map(e=>{let t=r.byLevel?.[e]??0;return t===0?null:(0,$.jsxs)(`li`,{className:`flex items-center justify-between gap-2 rounded-md border border-edge-subtle bg-surface-base px-2 py-1 text-xs dark:border-edge`,children:[(0,$.jsx)(`span`,{className:`font-medium capitalize text-fg`,children:n.levelNames[e]}),(0,$.jsx)(`span`,{className:`tabular-nums text-fg-muted`,children:t})]},e)}),t[21]=n.levelNames,t[22]=r.byLevel,t[23]=g):g=t[23];let _;t[24]===g?_=t[25]:(_=(0,$.jsx)(`ul`,{className:`mt-3 flex flex-col gap-1.5`,children:g}),t[24]=g,t[25]=_);let v;t[26]!==_||t[27]!==m||t[28]!==h?(v=(0,$.jsx)(O,{children:(0,$.jsxs)(k,{side:`bottom`,align:`start`,sideOffset:6,className:p,children:[m,h,_]})}),t[26]=_,t[27]=m,t[28]=h,t[29]=v):v=t[29];let y;return t[30]!==v||t[31]!==f?(y=(0,$.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,$.jsxs)(A,{children:[f,v]})}),t[30]=v,t[31]=f,t[32]=y):y=t[32],y}function ut(){let e=(0,K.c)(89),{L:t,hasToken:n,logs:r,loading:i,error:a,hasMore:o,searchInput:s,setSearchInput:c,selectedLevels:l,moduleFilter:u,setModuleFilter:d,dateFrom:f,setDateFrom:p,dateTo:h,setDateTo:g,modules:_,files:v,stats:y,selectedLog:b,setSelectedLog:x,filesOpen:S,setFilesOpen:C,filtersOpen:w,setFiltersOpen:T,logDir:E,autoRefresh:D,setAutoRefresh:O,copiedDetail:k,setCopiedDetail:A,hasActiveFilters:j,activeFilterCount:M,clearFilters:N,toggleDialogLevel:P,handleLoadMore:F,refreshAll:I,levelSegment:L,handleLevelSegment:R,filterByRequestId:z,filterByTranscriptId:B,filterByErrorSummary:ee,openChatForSession:te,errorSummary:V,errorSummaryLoading:H}=Le(m(dt));if(!n){let n;return e[0]===t?n=e[1]:(n=(0,$.jsx)(tt,{L:t}),e[0]=t,e[1]=n),n}let U;e[2]===C?U=e[3]:(U=()=>C(!0),e[2]=C,e[3]=U);let G;e[4]!==t||e[5]!==D||e[6]!==v.length||e[7]!==i||e[8]!==r||e[9]!==I||e[10]!==O||e[11]!==U?(G=(0,$.jsx)(ct,{L:t,autoRefresh:D,onAutoRefreshChange:O,fileCount:v.length,onOpenFiles:U,loading:i,onRefreshAll:I,logs:r}),e[4]=t,e[5]=D,e[6]=v.length,e[7]=i,e[8]=r,e[9]=I,e[10]=O,e[11]=U,e[12]=G):G=e[12];let q;e[13]===a?q=e[14]:(q=a?(0,$.jsx)(`div`,{className:`rounded-xl bg-danger-soft px-3 py-2 text-sm text-danger`,role:`alert`,children:a}):null,e[13]=a,e[14]=q);let J;e[15]!==t||e[16]!==y?(J=y?(0,$.jsx)(lt,{L:t,stats:y}):null,e[15]=t,e[16]=y,e[17]=J):J=e[17];let Y;e[18]!==t||e[19]!==V||e[20]!==H||e[21]!==ee?(Y=(0,$.jsx)(Re,{L:t,items:V,loading:H,onSelectItem:ee}),e[18]=t,e[19]=V,e[20]=H,e[21]=ee,e[22]=Y):Y=e[22];let X;e[23]===T?X=e[24]:(X=()=>T(!0),e[23]=T,e[24]=X);let Z;e[25]!==t||e[26]!==M||e[27]!==D||e[28]!==N||e[29]!==R||e[30]!==j||e[31]!==L||e[32]!==u||e[33]!==_||e[34]!==s||e[35]!==d||e[36]!==c||e[37]!==X?(Z=(0,$.jsx)(Ze,{L:t,levelSegment:L,onLevelSegment:R,searchInput:s,onSearchInputChange:c,moduleFilter:u,onModuleFilterChange:d,modules:_,onOpenFilters:X,activeFilterCount:M,hasActiveFilters:j,onClearFilters:N,autoRefresh:D}),e[25]=t,e[26]=M,e[27]=D,e[28]=N,e[29]=R,e[30]=j,e[31]=L,e[32]=u,e[33]=_,e[34]=s,e[35]=d,e[36]=c,e[37]=X,e[38]=Z):Z=e[38];let Q;e[39]!==t||e[40]!==z||e[41]!==F||e[42]!==o||e[43]!==i||e[44]!==r||e[45]!==I||e[46]!==x?(Q=(0,$.jsx)($e,{L:t,logs:r,loading:i,hasMore:o,onSelectLog:x,onLoadMore:F,onRefreshAll:I,onFilterByRequestId:z}),e[39]=t,e[40]=z,e[41]=F,e[42]=o,e[43]=i,e[44]=r,e[45]=I,e[46]=x,e[47]=Q):Q=e[47];let ne;e[48]!==t||e[49]!==f||e[50]!==h||e[51]!==w||e[52]!==l||e[53]!==p||e[54]!==g||e[55]!==T||e[56]!==P?(ne=(0,$.jsx)(Ge,{L:t,open:w,onOpenChange:T,dateFrom:f,onDateFromChange:p,dateTo:h,onDateToChange:g,selectedLevels:l,onToggleLevel:P}),e[48]=t,e[49]=f,e[50]=h,e[51]=w,e[52]=l,e[53]=p,e[54]=g,e[55]=T,e[56]=P,e[57]=ne):ne=e[57];let re;e[58]===x?re=e[59]:(re=()=>x(null),e[58]=x,e[59]=re);let ie,ae;e[60]===A?(ie=e[61],ae=e[62]):(ie=()=>A(`message`),ae=()=>A(`json`),e[60]=A,e[61]=ie,e[62]=ae);let oe;e[63]!==t||e[64]!==k||e[65]!==z||e[66]!==B||e[67]!==te||e[68]!==b||e[69]!==ie||e[70]!==ae||e[71]!==re?(oe=(0,$.jsx)(He,{L:t,log:b,onClose:re,copiedDetail:k,onCopiedMessage:ie,onCopiedJson:ae,onFilterByRequestId:z,onFilterByTranscriptId:B,onOpenChat:te}),e[63]=t,e[64]=k,e[65]=z,e[66]=B,e[67]=te,e[68]=b,e[69]=ie,e[70]=ae,e[71]=re,e[72]=oe):oe=e[72];let se;e[73]!==t||e[74]!==v||e[75]!==S||e[76]!==E||e[77]!==C?(se=(0,$.jsx)(Ue,{L:t,open:S,onOpenChange:C,files:v,logDir:E}),e[73]=t,e[74]=v,e[75]=S,e[76]=E,e[77]=C,e[78]=se):se=e[78];let ce;return e[79]!==G||e[80]!==oe||e[81]!==se||e[82]!==q||e[83]!==J||e[84]!==Y||e[85]!==Z||e[86]!==Q||e[87]!==ne?(ce=(0,$.jsxs)(W,{gap:`gap-6`,children:[G,q,J,Y,Z,Q,ne,oe,se]}),e[79]=G,e[80]=oe,e[81]=se,e[82]=q,e[83]=J,e[84]=Y,e[85]=Z,e[86]=Q,e[87]=ne,e[88]=ce):ce=e[88],ce}function dt(e){return e.language}export{ut as LogsPage};
|
|
@@ -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{g as i}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as a}from"./activity-YogQEteU.js";import{t as o}from"./chevron-left-DqFhpbvK.js";import{t as s}from"./chevron-right-BweFrslA.js";import{t as c}from"./popover-select-BgSdSbCL.js";import{t as l}from"./plus-Q2yW6OE7.js";import{t as u}from"./search-DA7gz22f.js";import{t as d}from"./x-B_N4OPjy.js";import{t as ee}from"./messages-BpEhZm54.js";import{t as f}from"./cn-JdwAhgNB.js";import{i as p,n as m,r as h}from"./locale-store-CeoW7A5a.js";import{a as g,n as _,o as v,r as y,s as b,t as x}from"./dist-BGTk37IG.js";import{s as S}from"./session-api-CVHFZq_A.js";import{i as C}from"./vendor-swr-BIWyz7Rc.js";import{t as w}from"./button-CS04eWY9.js";import{t as T}from"./skeleton-BwbyijEw.js";import{i as te,o as ne}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{n as E}from"./index.module-Cd9ENXfk.js";import{Fo as re,Mo as D,Ns as O,li as ie,ps as k,ui as A}from"./index-B3BVcMQj.js";import{t as j}from"./page-tabs-D2xpUV26.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-C6qeCyfO.js";import{n as I}from"./settings-loading-skeleton-CAmWMaOT.js";var L=n(),R=e(t(),1),z=r();async function B(e=`GET`,t,n){let r=await p(h(`/api/endpoint-tools/target-authorizations`+(n?`/`+encodeURIComponent(n):``)),{method:e,...t?{body:JSON.stringify(t)}:{}});if(!r.ok)throw Error(r.status===403?`owner`:`unavailable`);return(await r.json()).payload}function ae({devices:e,zh:t}){let n=C(`device-single-call-grants`,()=>B(),{refreshInterval:5e3,shouldRetryOnError:!1}),r=C(n.error?null:`device-grant-conversations`,()=>S({limit:100}),{shouldRetryOnError:!1}),[i,a]=(0,R.useState)(``),[o,s]=(0,R.useState)(``),[l,u]=(0,R.useState)(``),[d,ee]=(0,R.useState)(`weather`),[f,p]=(0,R.useState)(`approximate`),[m,h]=(0,R.useState)(`restaurant`),[g,_]=(0,R.useState)(!1),[v,y]=(0,R.useState)(!1);if(n.error)return null;let b=e.flatMap(e=>e.endpoints.map(t=>({...t,label:e.displayName+` · `+e.platform+` · `+e.id.slice(-8)}))),x=b.find(e=>e.endpointId===l)?.tools.find(e=>e.descriptor.name.endsWith(`.device.get_location`))?.descriptor.name,te=async()=>{if(!(!x||!i||!o)){_(!0),y(!1);try{await B(`POST`,{conversationId:i,requestorPrincipalId:o,targetEndpointId:l,toolName:x,arguments:{purpose:d,precision:f,...d===`nearby`?{category:m}:{}}}),await n.mutate()}catch{y(!0)}finally{_(!1)}}};return(0,z.jsxs)(`section`,{className:`mb-5 rounded-xl border border-edge bg-surface-base p-4`,children:[(0,z.jsx)(`h3`,{className:`font-semibold text-fg`,children:t?`跨设备单次授权`:`Single-call device authorization`}),(0,z.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t?`为指定会话和来源设备授权一次定位查询,60 秒后失效。目标设备仍需确认;授权后请在来源设备继续请求。`:`Authorize one location query for a conversation and source device. Expires in 60 seconds; target-device consent is still required. Continue the request from the source device.`}),n.isLoading||r.isLoading?(0,z.jsx)(T,{className:`mt-3 h-28`}):(0,z.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-2`,children:[(0,z.jsx)(c,{value:i,onChange:a,placeholder:t?`选择会话`:`Conversation`,ariaLabel:t?`会话`:`Conversation`,options:(r.data?.items??[]).map(e=>({value:e.key,label:e.name||e.key}))}),(0,z.jsx)(c,{value:o,onChange:s,placeholder:t?`消息来源设备`:`Source device`,ariaLabel:t?`消息来源设备`:`Source device`,options:e.filter(e=>e.endpoints.length>0).map(e=>({value:e.id,label:e.displayName+` · `+e.platform+` · `+e.id.slice(-8)}))}),(0,z.jsx)(c,{value:l,onChange:u,placeholder:t?`使用哪台设备的位置`:`Location device`,ariaLabel:t?`目标设备`:`Target device`,options:b.filter(e=>e.tools.some(e=>e.descriptor.name.endsWith(`.device.get_location`))).map(e=>({value:e.endpointId,label:e.label}))}),(0,z.jsx)(c,{placeholder:t?`用途`:`Purpose`,value:d,onChange:e=>ee(e),ariaLabel:t?`用途`:`Purpose`,options:[{value:`weather`,label:t?`查询天气`:`Weather`},{value:`nearby`,label:t?`附近地点`:`Nearby places`}],allowEmpty:!1}),(0,z.jsx)(c,{placeholder:t?`精度`:`Precision`,value:f,onChange:e=>p(e),ariaLabel:t?`精度`:`Precision`,options:[{value:`approximate`,label:t?`大致位置`:`Approximate`},{value:`precise`,label:t?`精确位置`:`Precise`}],allowEmpty:!1}),d===`nearby`?(0,z.jsx)(c,{placeholder:t?`地点类型`:`Category`,value:m,onChange:h,ariaLabel:t?`附近地点类型`:`Place category`,options:[`restaurant`,`cafe`,`pharmacy`,`park`].map((e,n)=>({value:e,label:t?[`餐厅`,`咖啡馆`,`药店`,`公园`][n]:e})),allowEmpty:!1}):null,(0,z.jsx)(w,{variant:`primary`,disabled:g||!i||!o||!x,onClick:()=>void te(),children:t?`允许一次`:`Allow once`})]}),v?(0,z.jsx)(`p`,{role:`alert`,className:`mt-2 text-sm text-fg-muted`,children:t?`授权失败,请检查设备连接后重试。`:`Authorization failed. Check the device connection.`}):null,(0,z.jsx)(`div`,{className:`mt-3 space-y-2`,children:n.data?.map(r=>(0,z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-sm text-fg-muted`,children:[(0,z.jsxs)(`span`,{children:[e.find(e=>e.endpoints.some(e=>e.endpointId===r.targetEndpointId))?.displayName??(t?`设备`:`Device`),` · `,r.state===`running`?t?`执行中`:`Running`:t?`等待本次调用`:`Awaiting one call`]}),(0,z.jsx)(w,{disabled:g,onClick:()=>{_(!0),B(`DELETE`,void 0,r.id).then(()=>n.mutate()).catch(()=>y(!0)).finally(()=>_(!1))},children:t?`撤销`:`Revoke`})]},r.id))})]})}var V=720*60*60*1e3;function H(e){let t=[e.access,e.principal].filter(e=>e!==null);return t.length>0&&t.every(e=>e.revokedAt!==void 0)}function U(e){return H(e)?`revoked`:e.endpoints.length>0?`online`:`offline`}function oe(e){return new Set(e.endpoints.flatMap(e=>e.tools.map(({descriptor:e})=>e.name))).size}function se(e,t=Date.now()){return U(e)===`offline`?(e.lastSeenAt??e.createdAt)<t-V:!1}function ce(e,t,n=Date.now()){let r=t.query.trim().toLocaleLowerCase();return e.filter(e=>{let i=U(e),a=t.status===`all`||(t.status===`active`?i!==`revoked`:t.status===`stale`?se(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 le(e){return e.length>8?e.slice(-8):e}function ue(e){let t=(0,L.c)(61),{device:n,busy:r,onClose:i,onRevoke:a,onRename:o}=e,s=m(de),c;t[0]===s?c=t[1]:(c=ee(s),t[0]=s,t[1]=c);let l=c.endpointToolsSettings,u=s===`zh`?`zh-CN`:`en`,p;t[2]===u?p=t[3]:(p=new Intl.DateTimeFormat(u,{dateStyle:`medium`,timeStyle:`short`}),t[2]=u,t[3]=p);let h=p,S;t[4]===n?S=t[5]:(S=n?U(n):`offline`,t[4]=n,t[5]=S);let C=S,T=n!==null,E;t[6]===i?E=t[7]:(E=e=>!e&&i(),t[6]=i,t[7]=E);let D;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,z.jsx)(g,{className:f(`xopc-dialog-overlay fixed inset-0 bg-scrim`,ne)}),t[8]=D):D=t[8];let O;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(O=f(`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`,te),t[9]=O):O=t[9];let ie=n?.displayName??l.deviceDetails,k;t[10]===ie?k=t[11]:(k=(0,z.jsx)(b,{className:`truncate text-base font-semibold text-fg`,children:ie}),t[10]=ie,t[11]=k);let A;t[12]===n?A=t[13]:(A=n?(0,z.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[n.kind,` · `,n.platform,` · `,le(n.id)]}):null,t[12]=n,t[13]=A);let j;t[14]!==k||t[15]!==A?(j=(0,z.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,z.jsx)(d,{className:`size-5`,"aria-hidden":!0}),t[17]=M):M=t[17];let N;t[18]===l.close?N=t[19]:(N=(0,z.jsx)(_,{asChild:!0,children:(0,z.jsx)(w,{variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":l.close,children:M})}),t[18]=l.close,t[19]=N);let P;t[20]!==j||t[21]!==N?(P=(0,z.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]!==l.accessActive||t[24]!==l.accessRevoked||t[25]!==l.accessTitle||t[26]!==l.createdAt||t[27]!==l.endpointCount||t[28]!==l.endpointsTitle||t[29]!==l.identityId||t[30]!==l.identityTitle||t[31]!==l.lastSeen||t[32]!==l.never||t[33]!==l.noAccessIdentity||t[34]!==l.noOnlineEndpoints||t[35]!==l.noPermissions||t[36]!==l.permissions||t[37]!==l.status||t[38]!==l.statusLabel||t[39]!==l.toolCount||t[40]!==n||t[41]!==h||t[42]!==s||t[43]!==o||t[44]!==C?(F=n?(0,z.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto p-4`,children:[n.principal&&C!==`revoked`&&o?(0,z.jsx)(fe,{device:n,zh:s===`zh`,onRename:o},`${n.id}:${n.settingsRevision??0}`):null,(0,z.jsxs)(`dl`,{className:`grid grid-cols-2 gap-3 rounded-xl bg-surface-hover/40 p-4`,children:[(0,z.jsx)(W,{label:l.statusLabel,value:l.status[C]}),(0,z.jsx)(W,{label:l.lastSeen,value:n.lastSeenAt?h.format(n.lastSeenAt):l.never}),(0,z.jsx)(W,{label:l.endpointCount,value:String(n.endpoints.length)}),(0,z.jsx)(W,{label:l.toolCount,value:String(oe(n))})]}),(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:l.accessTitle}),(0,z.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,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{children:n.access.revokedAt?l.accessRevoked:l.accessActive}),(0,z.jsx)(`p`,{className:`mt-1`,children:n.access.requestProofVersion===1?s===`zh`?`设备请求签名已启用`:`Device request signing enabled`:s===`zh`?`旧版兼容:尚未启用请求签名`:`Legacy compatibility: request signing not enabled`}),(0,z.jsxs)(`p`,{className:`mt-1 break-words`,children:[l.permissions,`: `,n.access.scopes.join(`, `)||l.noPermissions]})]}):(0,z.jsx)(`p`,{children:l.noAccessIdentity})})]}),(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:l.endpointsTitle}),(0,z.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[n.endpoints.length===0?(0,z.jsx)(`p`,{className:`text-sm text-fg-muted`,children:l.noOnlineEndpoints}):null,n.endpoints.map(e=>(0,z.jsxs)(`article`,{className:`rounded-xl border border-edge-subtle bg-surface-base p-3`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,z.jsx)(`p`,{className:`min-w-0 break-all text-xs font-medium text-fg`,children:e.endpointId}),(0,z.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[l.status[e.availability],` · v`,e.appVersion]})]}),(0,z.jsx)(`div`,{className:`mt-3 space-y-2`,children:e.tools.map(e=>{let{descriptor:t}=e;return(0,z.jsxs)(`div`,{className:`rounded-lg bg-surface-hover/50 px-3 py-2`,children:[(0,z.jsx)(`p`,{className:`break-all text-xs font-medium text-fg`,children:t.title}),(0,z.jsxs)(`p`,{className:`mt-0.5 break-words text-xs text-fg-subtle`,children:[t.requiresForeground?s===`zh`?`需要设备在前台 · `:`Requires foreground · `:``,t.confirmation===`always`?s===`zh`?`每次确认`:`Confirm each time`:s===`zh`?`按已授权范围调用`:`Uses the authorized scope`]})]},t.name)})})]},e.connectionId))]})]}),(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:l.identityTitle}),n.principal&&C!==`revoked`&&o?(0,z.jsx)(fe,{device:n,zh:s===`zh`,onRename:o},`${n.id}:${n.settingsRevision??0}`):null,(0,z.jsxs)(`dl`,{className:`mt-2 rounded-xl border border-edge-subtle bg-surface-base p-3 text-xs`,children:[(0,z.jsx)(W,{label:l.identityId,value:n.id,breakAll:!0}),(0,z.jsx)(`div`,{className:`mt-3`,children:(0,z.jsx)(W,{label:l.createdAt,value:h.format(n.createdAt)})})]})]})]}):null,t[23]=l.accessActive,t[24]=l.accessRevoked,t[25]=l.accessTitle,t[26]=l.createdAt,t[27]=l.endpointCount,t[28]=l.endpointsTitle,t[29]=l.identityId,t[30]=l.identityTitle,t[31]=l.lastSeen,t[32]=l.never,t[33]=l.noAccessIdentity,t[34]=l.noOnlineEndpoints,t[35]=l.noPermissions,t[36]=l.permissions,t[37]=l.status,t[38]=l.statusLabel,t[39]=l.toolCount,t[40]=n,t[41]=h,t[42]=s,t[43]=o,t[44]=C,t[45]=F):F=t[45];let I;t[46]!==r||t[47]!==l.removeDevice||t[48]!==l.revoking||t[49]!==n||t[50]!==a||t[51]!==C?(I=n&&C!==`revoked`?(0,z.jsx)(`div`,{className:`shrink-0 border-t border-edge px-4 py-3`,children:(0,z.jsxs)(w,{variant:`secondary`,className:`w-full text-danger`,disabled:r,onClick:()=>a(n),children:[(0,z.jsx)(re,{className:`size-4`,"aria-hidden":!0}),r?l.revoking:l.removeDevice]})}):null,t[46]=r,t[47]=l.removeDevice,t[48]=l.revoking,t[49]=n,t[50]=a,t[51]=C,t[52]=I):I=t[52];let R;t[53]!==P||t[54]!==F||t[55]!==I?(R=(0,z.jsxs)(v,{children:[D,(0,z.jsxs)(y,{className:O,"aria-describedby":void 0,children:[P,F,I]})]}),t[53]=P,t[54]=F,t[55]=I,t[56]=R):R=t[56];let B;return t[57]!==R||t[58]!==T||t[59]!==E?(B=(0,z.jsx)(x,{open:T,onOpenChange:E,children:R}),t[57]=R,t[58]=T,t[59]=E,t[60]=B):B=t[60],B}function de(e){return e.language}function W(e){let t=(0,L.c)(10),{label:n,value:r,breakAll:i}=e,a=i===void 0?!1:i,o;t[0]===n?o=t[1]:(o=(0,z.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=f(`mt-1 text-sm text-fg`,s),t[2]=s,t[3]=c);let l;t[4]!==c||t[5]!==r?(l=(0,z.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,z.jsxs)(`div`,{className:`min-w-0`,children:[o,l]}),t[7]=o,t[8]=l,t[9]=u):u=t[9],u}function fe({device:e,zh:t,onRename:n}){let[r,i]=(0,R.useState)(e.displayName),[a,o]=(0,R.useState)(!1),[s,c]=(0,R.useState)(!1);return(0,z.jsxs)(`form`,{className:`space-y-2`,onSubmit:async t=>{if(t.preventDefault(),!(a||!r.trim())){o(!0),c(!1);try{await n(e,r.trim())}catch{c(!0)}finally{o(!1)}}},children:[(0,z.jsxs)(`label`,{className:`block text-sm text-fg`,children:[t?`设备名称`:`Device name`,(0,z.jsx)(`input`,{value:r,maxLength:80,onChange:e=>i(e.target.value),className:`mt-2 h-10 w-full rounded-lg border border-edge bg-surface-inset px-3 text-fg`})]}),(0,z.jsx)(w,{type:`submit`,variant:`secondary`,disabled:a||!r.trim()||r.trim()===e.displayName,children:a?t?`保存中…`:`Saving…`:t?`保存名称`:`Save name`}),s?(0,z.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:t?`保存失败,请刷新设备信息后重试。`:`Unable to save. Refresh device information and retry.`}):null]})}function pe(e){let t=(0,L.c)(19),{onPaired:n}=e,[r,a]=i(),o=m(he),s;t[0]===o?s=t[1]:(s=ee(o),t[0]=o,t[1]=s);let c=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,R.useState)(u),p,h;t[3]!==r||t[4]!==a?(p=()=>{let e=r.get(`startDevicePairing`);e!==`mobile`&&e!==`browser`||(f({open:!0,target:e}),a(me,{replace:!0}))},h=[r,a],t[3]=r,t[4]=a,t[5]=p,t[6]=h):(p=t[5],h=t[6]),(0,R.useEffect)(p,h);let g,_;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>f({open:!0}),_=(0,z.jsx)(l,{className:`size-4`,"aria-hidden":!0}),t[7]=g,t[8]=_):(g=t[7],_=t[8]);let v;t[9]===c.addDevice?v=t[10]:(v=(0,z.jsxs)(w,{variant:`primary`,onClick:g,children:[_,c.addDevice]}),t[9]=c.addDevice,t[10]=v);let y;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>f(t=>({...t,open:e})),t[11]=y):y=t[11];let b;t[12]!==d.open||t[13]!==d.target||t[14]!==n?(b=(0,z.jsx)(F,{open:d.open,onOpenChange:y,onPaired:n,targetKind:d.target}),t[12]=d.open,t[13]=d.target,t[14]=n,t[15]=b):b=t[15];let x;return t[16]!==v||t[17]!==b?(x=(0,z.jsxs)(z.Fragment,{children:[v,b]}),t[16]=v,t[17]=b,t[18]=x):x=t[18],x}function me(e){let t=new URLSearchParams(e);return t.delete(`startDevicePairing`),t}function he(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 ge(){return h(`/api/endpoint-tools/devices`)}function _e(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),h(`/api/endpoint-tools/invocations?${t}`)}async function ve(){return G(await p(ge()))}async function ye(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 p(h(`/api/endpoint-tools/devices/revoke`),{method:`POST`,body:JSON.stringify({ids:e})}))}))}async function be(e){return G(await p(_e(e)))}async function xe(e,t,n){await G(await p(h(`/api/endpoint-tools/devices/${encodeURIComponent(e)}`),{method:`PATCH`,body:JSON.stringify({nickname:t,expectedRevision:n})}))}var Se=5e3,K=20,Ce=20;function we(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 Te(e){let t=(0,L.c)(5),{status:n,label:r}=e,i;t[0]===n?i=t[1]:(i=f(`rounded-full px-2 py-0.5 text-xs font-medium`,we(n)),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,z.jsx)(`span`,{className:i,children:r}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function Ee(){let e=m(e=>e.language),t=ee(e).endpointToolsSettings,[n,r]=i(),l=n.get(`view`)===`activity`?`activity`:`devices`,[d,p]=(0,R.useState)(null),[h,g]=(0,R.useState)([]),[_,v]=(0,R.useState)(!1),[y,b]=(0,R.useState)(!1),[x,S]=(0,R.useState)(``),[T,te]=(0,R.useState)(`active`),[ne,F]=(0,R.useState)(``),[L,B]=(0,R.useState)(1),[V,H]=(0,R.useState)(()=>new Set),[de,W]=(0,R.useState)(``),[fe]=E(de,250),[me,he]=(0,R.useState)(``),[G,we]=(0,R.useState)(``),[Ee,De]=(0,R.useState)(``),[Oe,q]=(0,R.useState)(1),ke={page:Oe,pageSize:Ce,query:fe,principalId:me,status:G,effect:Ee},J=C(ge(),ve,{refreshInterval:Se}),Y=C(l===`activity`?_e(ke):null,()=>be(ke),{refreshInterval:Se,keepPreviousData:!0}),Ae=(0,R.useMemo)(()=>new Intl.DateTimeFormat(e===`zh`?`zh-CN`:`en`,{dateStyle:`medium`,timeStyle:`short`}),[e]);if(J.isLoading&&!J.data)return(0,z.jsx)(N,{children:(0,z.jsx)(I,{sections:2})});let X=J.data??[],je=Y.data?.items??[],Me=X.filter(e=>U(e)===`online`).length,Ne=X.filter(e=>U(e)!==`revoked`).length,Pe=X.filter(e=>se(e)).length,Fe=[...new Set(X.map(e=>e.platform))].toSorted(),Z=ce(X,{query:x,status:T,platform:ne}),Ie=Math.max(1,Math.ceil(Z.length/K)),Q=Math.min(L,Ie),Le=Z.slice((Q-1)*K,Q*K),$=Le.reduce((e,t)=>(U(t)!==`revoked`&&e.push(t.id),e),[]),Re=$.length>0&&$.every(e=>V.has(e)),ze=e=>{r(t=>{let n=new URLSearchParams(t);return e===`devices`?n.delete(`view`):n.set(`view`,e),n},{replace:!0})},Be=async()=>{await Promise.all([J.mutate(),l===`activity`?Y.mutate():Promise.resolve()])},Ve=async()=>{if(!(h.length===0||_)){v(!0),b(!1);try{await ye(h.map(e=>e.id)),g([]),H(new Set),await J.mutate()}catch{b(!0)}finally{v(!1)}}},He=e=>{e(),B(1),H(new Set)};return(0,z.jsxs)(N,{children:[(0,z.jsx)(M,{title:t.title,subtitle:t.subtitle,actions:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(ie,{className:`size-9 shrink-0 p-0`,label:t.refresh,onClick:Be}),(0,z.jsx)(pe,{onPaired:()=>void J.mutate()})]})}),J.error||Y.error?(0,z.jsx)(`div`,{className:`rounded-xl bg-danger-soft px-4 py-3 text-sm text-danger`,children:t.loadError}):null,(0,z.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[{label:t.activeDevices,value:Ne,filter:`active`},{label:t.onlineDevices,value:Me,filter:`online`},{label:t.staleDevices,value:Pe,filter:`stale`}].map(({label:e,value:t,filter:n})=>(0,z.jsxs)(`button`,{type:`button`,className:f(`touch-target rounded-xl px-4 py-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,T===n?`bg-surface-active`:`bg-surface-hover/20 hover:bg-surface-hover/50`),"aria-pressed":T===n,onClick:()=>{He(()=>te(n)),ze(`devices`)},children:[(0,z.jsx)(`span`,{className:`text-xs text-fg-muted`,children:e}),(0,z.jsx)(`span`,{className:`mt-1 block text-2xl font-semibold text-fg`,children:t})]},n))}),(0,z.jsx)(j,{items:[{id:`devices`,label:t.devicesTab,icon:k,count:Ne},{id:`activity`,label:t.activityTab,icon:a,count:Y.data?.total}],activeTab:l,onChange:ze,ariaLabel:t.viewsAria,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`}),(0,z.jsxs)(P,{id:`devices`,activeTab:l,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`,title:t.devicesTitle,hint:t.devicesHint,children:[(0,z.jsx)(ae,{devices:X,zh:e===`zh`}),(0,z.jsxs)(`div`,{className:`mb-4 grid gap-2 sm:grid-cols-[minmax(0,1fr)_11rem_11rem]`,children:[(0,z.jsxs)(`label`,{className:`relative block`,children:[(0,z.jsx)(`span`,{className:`sr-only`,children:t.searchDevices}),(0,z.jsx)(u,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),(0,z.jsx)(`input`,{type:`search`,"aria-label":t.searchDevices,value:x,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=>He(()=>S(e.target.value))})]}),(0,z.jsx)(c,{value:T,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=>He(()=>te(e))}),(0,z.jsx)(c,{value:ne,options:Fe.map(e=>({value:e,label:e})),placeholder:t.allPlatforms,emptyLabel:t.allPlatforms,ariaLabel:t.platformLabel,onChange:e=>He(()=>F(e))})]}),V.size>0?(0,z.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,z.jsx)(`p`,{className:`text-sm font-medium text-accent-fg`,children:t.selectedCount.replace(`{{count}}`,String(V.size))}),(0,z.jsxs)(w,{variant:`secondary`,className:`text-danger`,onClick:()=>{b(!1),g(X.filter(e=>V.has(e.id)))},children:[(0,z.jsx)(re,{className:`size-4`,"aria-hidden":!0}),t.removeSelected]})]}):null,X.length===0?(0,z.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noDevices}):Z.length===0?(0,z.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noMatchingDevices}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`flex min-h-10 items-center gap-3 border-b border-edge-subtle px-1`,children:(0,z.jsxs)(`label`,{className:f(`touch-target flex items-center gap-2 text-xs text-fg-muted`,$.length>0?`cursor-pointer`:`cursor-not-allowed opacity-50`),children:[(0,z.jsx)(`input`,{type:`checkbox`,"aria-label":t.selectPage,checked:Re,disabled:$.length===0,className:`size-4 accent-accent`,onChange:e=>{H(t=>{let n=new Set(t);for(let t of $)e.target.checked?n.add(t):n.delete(t);return n})}}),t.selectPage]})}),(0,z.jsx)(`ul`,{className:`divide-y divide-edge-subtle`,children:Le.map(e=>{let n=U(e),r=e.kind===`mobile`?D:O;return(0,z.jsxs)(`li`,{className:`flex items-center gap-3`,children:[(0,z.jsx)(`label`,{className:f(`touch-target flex size-10 shrink-0 items-center justify-center`,n===`revoked`?`cursor-not-allowed opacity-40`:`cursor-pointer`),children:(0,z.jsx)(`input`,{type:`checkbox`,checked:V.has(e.id),disabled:n===`revoked`,"aria-label":t.selectDevice.replace(`{{name}}`,e.displayName),className:`size-4 accent-accent`,onChange:t=>{H(n=>{let r=new Set(n);return t.target.checked?r.add(e.id):r.delete(e.id),r})}})}),(0,z.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:()=>p(e),children:[(0,z.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-surface-inset text-fg-muted`,children:(0,z.jsx)(r,{className:`size-4`,"aria-hidden":!0})}),(0,z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,z.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,z.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:e.displayName}),(0,z.jsx)(Te,{status:n,label:t.status[n]})]}),(0,z.jsxs)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:[e.platform,` · `,le(e.id),` · `,t.lastSeen,`: `,e.lastSeenAt?Ae.format(e.lastSeenAt):t.never]})]}),(0,z.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(oe(e)))}),(0,z.jsx)(s,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0})]})]},e.id)})}),(0,z.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3 border-t border-edge-subtle pt-3`,children:[(0,z.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,z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,z.jsx)(w,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.previousPage,disabled:Q<=1,onClick:()=>B(e=>Math.max(1,e-1)),children:(0,z.jsx)(o,{className:`size-4`,"aria-hidden":!0})}),(0,z.jsx)(w,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.nextPage,disabled:Q>=Ie,onClick:()=>B(e=>Math.min(Ie,e+1)),children:(0,z.jsx)(s,{className:`size-4`,"aria-hidden":!0})})]})]})]})]}),(0,z.jsxs)(P,{id:`activity`,activeTab:l,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`,title:t.callsTitle,hint:t.callsHint,children:[(0,z.jsxs)(`div`,{className:`mb-4 grid gap-2 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,z.jsxs)(`label`,{className:`relative block sm:col-span-2 lg:col-span-1`,children:[(0,z.jsx)(`span`,{className:`sr-only`,children:t.searchActivity}),(0,z.jsx)(u,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),(0,z.jsx)(`input`,{type:`search`,"aria-label":t.searchActivity,value:de,placeholder:t.searchActivity,className:`h-10 w-full rounded-lg border border-edge bg-surface-inset pl-9 pr-3 text-base text-fg placeholder:text-fg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent sm:text-sm`,onChange:e=>{W(e.target.value),q(1)}})]}),(0,z.jsx)(c,{value:me,options:X.map(e=>({value:e.id,label:`${e.displayName} · ${le(e.id)}`})),placeholder:t.allDevices,emptyLabel:t.allDevices,ariaLabel:t.deviceLabel,onChange:e=>{he(e),q(1)}}),(0,z.jsx)(c,{value:G,options:[{value:`running`,label:t.status.running},{value:`succeeded`,label:t.status.succeeded},{value:`failed`,label:t.status.failed}],placeholder:t.allStatuses,emptyLabel:t.allStatuses,ariaLabel:t.statusLabel,onChange:e=>{we(e),q(1)}}),(0,z.jsx)(c,{value:Ee,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=>{De(e),q(1)}})]}),Y.isLoading&&!Y.data?(0,z.jsx)(I,{sections:1}):null,je.length===0&&!Y.isLoading?(0,z.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noMatchingCalls}):null,(0,z.jsx)(`div`,{className:`space-y-2`,children:je.map(e=>(0,z.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,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsx)(`p`,{className:`break-all text-sm font-medium text-fg`,children:e.toolName}),(0,z.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[Ae.format(e.startedAt),` · `,t.effects[e.effect],` · `,e.endpointId]}),e.errorMessage?(0,z.jsx)(`p`,{className:`mt-1 text-xs text-danger`,children:e.errorMessage}):null]}),(0,z.jsx)(Te,{status:e.status,label:t.status[e.status]})]},e.id))}),Y.data&&Y.data.total>0?(0,z.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3 border-t border-edge-subtle pt-3`,children:[(0,z.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,z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,z.jsx)(w,{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,z.jsx)(o,{className:`size-4`,"aria-hidden":!0})}),(0,z.jsx)(w,{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,z.jsx)(s,{className:`size-4`,"aria-hidden":!0})})]})]}):null]}),(0,z.jsx)(ue,{device:d,busy:_,onRename:async(e,t)=>{await xe(e.id,t,e.settingsRevision??0),p((await J.mutate())?.find(t=>t.id===e.id)??null)},onClose:()=>p(null),onRevoke:e=>{p(null),b(!1),g([e])}}),(0,z.jsx)(A,{open:h.length>0,title:h.length>1?t.removeManyTitle:t.removeTitle,description:`${h.length>1?t.removeManyDescription.replace(`{{count}}`,String(h.length)):t.removeDescription.replace(`{{name}}`,h[0]?.displayName??``)}${y?`\n\n${t.revokeError}`:``}`,confirmLabel:_?t.revoking:t.removeDevice,cancelLabel:t.cancel,destructive:!0,onConfirm:()=>void Ve(),onCancel:()=>{_||g([])}})]})}export{Ee as EndpointToolsManagementSettings};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{g as i}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as a}from"./activity-YogQEteU.js";import{t as o}from"./chevron-left-DqFhpbvK.js";import{t as s}from"./chevron-right-BweFrslA.js";import{t as c}from"./popover-select-DHC7J4lG.js";import{t as l}from"./plus-Q2yW6OE7.js";import{t as u}from"./search-DA7gz22f.js";import{t as d}from"./x-B_N4OPjy.js";import{t as ee}from"./messages-Ib6DaUTo.js";import{t as f}from"./cn-0WouolD0.js";import{i as p,n as m,r as h}from"./locale-store-pmT2B_By.js";import{a as g,n as _,o as v,r as y,s as b,t as x}from"./dist-BGTk37IG.js";import{s as S}from"./session-api-D2J6VacQ.js";import{i as C}from"./vendor-swr-BIWyz7Rc.js";import{t as w}from"./button-aIC072nz.js";import{t as T}from"./skeleton-BI5TyibZ.js";import{i as te,o as ne}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{n as E}from"./index.module-Cd9ENXfk.js";import{Bo as re,Lo as D,Rs as O,li as ie,ui as k,vs as A}from"./index-DxydK_AA.js";import{t as j}from"./page-tabs-BLGO2VIm.js";import{n as M,r as N,t as P}from"./settings-page-layout-Dx5S-Msc.js";import{t as F}from"./device-pairing-wizard-DaRk9VLg.js";import{n as I}from"./settings-loading-skeleton-BTqvr_Fw.js";var L=n(),R=e(t(),1),z=r();async function B(e=`GET`,t,n){let r=await p(h(`/api/endpoint-tools/target-authorizations`+(n?`/`+encodeURIComponent(n):``)),{method:e,...t?{body:JSON.stringify(t)}:{}});if(!r.ok)throw Error(r.status===403?`owner`:`unavailable`);return(await r.json()).payload}function ae({devices:e,zh:t}){let n=C(`device-single-call-grants`,()=>B(),{refreshInterval:5e3,shouldRetryOnError:!1}),r=C(n.error?null:`device-grant-conversations`,()=>S({limit:100}),{shouldRetryOnError:!1}),[i,a]=(0,R.useState)(``),[o,s]=(0,R.useState)(``),[l,u]=(0,R.useState)(``),[d,ee]=(0,R.useState)(`weather`),[f,p]=(0,R.useState)(`approximate`),[m,h]=(0,R.useState)(`restaurant`),[g,_]=(0,R.useState)(!1),[v,y]=(0,R.useState)(!1);if(n.error)return null;let b=e.flatMap(e=>e.endpoints.map(t=>({...t,label:e.displayName+` · `+e.platform+` · `+e.id.slice(-8)}))),x=b.find(e=>e.endpointId===l)?.tools.find(e=>e.descriptor.name.endsWith(`.device.get_location`))?.descriptor.name,te=async()=>{if(!(!x||!i||!o)){_(!0),y(!1);try{await B(`POST`,{conversationId:i,requestorPrincipalId:o,targetEndpointId:l,toolName:x,arguments:{purpose:d,precision:f,...d===`nearby`?{category:m}:{}}}),await n.mutate()}catch{y(!0)}finally{_(!1)}}};return(0,z.jsxs)(`section`,{className:`mb-5 rounded-xl border border-edge bg-surface-base p-4`,children:[(0,z.jsx)(`h3`,{className:`font-semibold text-fg`,children:t?`跨设备单次授权`:`Single-call device authorization`}),(0,z.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t?`为指定会话和来源设备授权一次定位查询,60 秒后失效。目标设备仍需确认;授权后请在来源设备继续请求。`:`Authorize one location query for a conversation and source device. Expires in 60 seconds; target-device consent is still required. Continue the request from the source device.`}),n.isLoading||r.isLoading?(0,z.jsx)(T,{className:`mt-3 h-28`}):(0,z.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-2`,children:[(0,z.jsx)(c,{value:i,onChange:a,placeholder:t?`选择会话`:`Conversation`,ariaLabel:t?`会话`:`Conversation`,options:(r.data?.items??[]).map(e=>({value:e.key,label:e.name||e.key}))}),(0,z.jsx)(c,{value:o,onChange:s,placeholder:t?`消息来源设备`:`Source device`,ariaLabel:t?`消息来源设备`:`Source device`,options:e.filter(e=>e.endpoints.length>0).map(e=>({value:e.id,label:e.displayName+` · `+e.platform+` · `+e.id.slice(-8)}))}),(0,z.jsx)(c,{value:l,onChange:u,placeholder:t?`使用哪台设备的位置`:`Location device`,ariaLabel:t?`目标设备`:`Target device`,options:b.filter(e=>e.tools.some(e=>e.descriptor.name.endsWith(`.device.get_location`))).map(e=>({value:e.endpointId,label:e.label}))}),(0,z.jsx)(c,{placeholder:t?`用途`:`Purpose`,value:d,onChange:e=>ee(e),ariaLabel:t?`用途`:`Purpose`,options:[{value:`weather`,label:t?`查询天气`:`Weather`},{value:`nearby`,label:t?`附近地点`:`Nearby places`}],allowEmpty:!1}),(0,z.jsx)(c,{placeholder:t?`精度`:`Precision`,value:f,onChange:e=>p(e),ariaLabel:t?`精度`:`Precision`,options:[{value:`approximate`,label:t?`大致位置`:`Approximate`},{value:`precise`,label:t?`精确位置`:`Precise`}],allowEmpty:!1}),d===`nearby`?(0,z.jsx)(c,{placeholder:t?`地点类型`:`Category`,value:m,onChange:h,ariaLabel:t?`附近地点类型`:`Place category`,options:[`restaurant`,`cafe`,`pharmacy`,`park`].map((e,n)=>({value:e,label:t?[`餐厅`,`咖啡馆`,`药店`,`公园`][n]:e})),allowEmpty:!1}):null,(0,z.jsx)(w,{variant:`primary`,disabled:g||!i||!o||!x,onClick:()=>void te(),children:t?`允许一次`:`Allow once`})]}),v?(0,z.jsx)(`p`,{role:`alert`,className:`mt-2 text-sm text-fg-muted`,children:t?`授权失败,请检查设备连接后重试。`:`Authorization failed. Check the device connection.`}):null,(0,z.jsx)(`div`,{className:`mt-3 space-y-2`,children:n.data?.map(r=>(0,z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-sm text-fg-muted`,children:[(0,z.jsxs)(`span`,{children:[e.find(e=>e.endpoints.some(e=>e.endpointId===r.targetEndpointId))?.displayName??(t?`设备`:`Device`),` · `,r.state===`running`?t?`执行中`:`Running`:t?`等待本次调用`:`Awaiting one call`]}),(0,z.jsx)(w,{disabled:g,onClick:()=>{_(!0),B(`DELETE`,void 0,r.id).then(()=>n.mutate()).catch(()=>y(!0)).finally(()=>_(!1))},children:t?`撤销`:`Revoke`})]},r.id))})]})}var V=720*60*60*1e3;function H(e){let t=[e.access,e.principal].filter(e=>e!==null);return t.length>0&&t.every(e=>e.revokedAt!==void 0)}function U(e){return H(e)?`revoked`:e.endpoints.length>0?`online`:`offline`}function oe(e){return new Set(e.endpoints.flatMap(e=>e.tools.map(({descriptor:e})=>e.name))).size}function se(e,t=Date.now()){return U(e)===`offline`?(e.lastSeenAt??e.createdAt)<t-V:!1}function ce(e,t,n=Date.now()){let r=t.query.trim().toLocaleLowerCase();return e.filter(e=>{let i=U(e),a=t.status===`all`||(t.status===`active`?i!==`revoked`:t.status===`stale`?se(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 le(e){return e.length>8?e.slice(-8):e}function ue(e){let t=(0,L.c)(61),{device:n,busy:r,onClose:i,onRevoke:a,onRename:o}=e,s=m(de),c;t[0]===s?c=t[1]:(c=ee(s),t[0]=s,t[1]=c);let l=c.endpointToolsSettings,u=s===`zh`?`zh-CN`:`en`,p;t[2]===u?p=t[3]:(p=new Intl.DateTimeFormat(u,{dateStyle:`medium`,timeStyle:`short`}),t[2]=u,t[3]=p);let h=p,S;t[4]===n?S=t[5]:(S=n?U(n):`offline`,t[4]=n,t[5]=S);let C=S,T=n!==null,E;t[6]===i?E=t[7]:(E=e=>!e&&i(),t[6]=i,t[7]=E);let D;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,z.jsx)(g,{className:f(`xopc-dialog-overlay fixed inset-0 bg-scrim`,ne)}),t[8]=D):D=t[8];let O;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(O=f(`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`,te),t[9]=O):O=t[9];let ie=n?.displayName??l.deviceDetails,k;t[10]===ie?k=t[11]:(k=(0,z.jsx)(b,{className:`truncate text-base font-semibold text-fg`,children:ie}),t[10]=ie,t[11]=k);let A;t[12]===n?A=t[13]:(A=n?(0,z.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[n.kind,` · `,n.platform,` · `,le(n.id)]}):null,t[12]=n,t[13]=A);let j;t[14]!==k||t[15]!==A?(j=(0,z.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,z.jsx)(d,{className:`size-5`,"aria-hidden":!0}),t[17]=M):M=t[17];let N;t[18]===l.close?N=t[19]:(N=(0,z.jsx)(_,{asChild:!0,children:(0,z.jsx)(w,{variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":l.close,children:M})}),t[18]=l.close,t[19]=N);let P;t[20]!==j||t[21]!==N?(P=(0,z.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]!==l.accessActive||t[24]!==l.accessRevoked||t[25]!==l.accessTitle||t[26]!==l.createdAt||t[27]!==l.endpointCount||t[28]!==l.endpointsTitle||t[29]!==l.identityId||t[30]!==l.identityTitle||t[31]!==l.lastSeen||t[32]!==l.never||t[33]!==l.noAccessIdentity||t[34]!==l.noOnlineEndpoints||t[35]!==l.noPermissions||t[36]!==l.permissions||t[37]!==l.status||t[38]!==l.statusLabel||t[39]!==l.toolCount||t[40]!==n||t[41]!==h||t[42]!==s||t[43]!==o||t[44]!==C?(F=n?(0,z.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto p-4`,children:[n.principal&&C!==`revoked`&&o?(0,z.jsx)(fe,{device:n,zh:s===`zh`,onRename:o},`${n.id}:${n.settingsRevision??0}`):null,(0,z.jsxs)(`dl`,{className:`grid grid-cols-2 gap-3 rounded-xl bg-surface-hover/40 p-4`,children:[(0,z.jsx)(W,{label:l.statusLabel,value:l.status[C]}),(0,z.jsx)(W,{label:l.lastSeen,value:n.lastSeenAt?h.format(n.lastSeenAt):l.never}),(0,z.jsx)(W,{label:l.endpointCount,value:String(n.endpoints.length)}),(0,z.jsx)(W,{label:l.toolCount,value:String(oe(n))})]}),(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:l.accessTitle}),(0,z.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,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{children:n.access.revokedAt?l.accessRevoked:l.accessActive}),(0,z.jsx)(`p`,{className:`mt-1`,children:n.access.requestProofVersion===1?s===`zh`?`设备请求签名已启用`:`Device request signing enabled`:s===`zh`?`旧版兼容:尚未启用请求签名`:`Legacy compatibility: request signing not enabled`}),(0,z.jsxs)(`p`,{className:`mt-1 break-words`,children:[l.permissions,`: `,n.access.scopes.join(`, `)||l.noPermissions]})]}):(0,z.jsx)(`p`,{children:l.noAccessIdentity})})]}),(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:l.endpointsTitle}),(0,z.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[n.endpoints.length===0?(0,z.jsx)(`p`,{className:`text-sm text-fg-muted`,children:l.noOnlineEndpoints}):null,n.endpoints.map(e=>(0,z.jsxs)(`article`,{className:`rounded-xl border border-edge-subtle bg-surface-base p-3`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,z.jsx)(`p`,{className:`min-w-0 break-all text-xs font-medium text-fg`,children:e.endpointId}),(0,z.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[l.status[e.availability],` · v`,e.appVersion]})]}),(0,z.jsx)(`div`,{className:`mt-3 space-y-2`,children:e.tools.map(e=>{let{descriptor:t}=e;return(0,z.jsxs)(`div`,{className:`rounded-lg bg-surface-hover/50 px-3 py-2`,children:[(0,z.jsx)(`p`,{className:`break-all text-xs font-medium text-fg`,children:t.title}),(0,z.jsxs)(`p`,{className:`mt-0.5 break-words text-xs text-fg-subtle`,children:[t.requiresForeground?s===`zh`?`需要设备在前台 · `:`Requires foreground · `:``,t.confirmation===`always`?s===`zh`?`每次确认`:`Confirm each time`:s===`zh`?`按已授权范围调用`:`Uses the authorized scope`]})]},t.name)})})]},e.connectionId))]})]}),(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:l.identityTitle}),n.principal&&C!==`revoked`&&o?(0,z.jsx)(fe,{device:n,zh:s===`zh`,onRename:o},`${n.id}:${n.settingsRevision??0}`):null,(0,z.jsxs)(`dl`,{className:`mt-2 rounded-xl border border-edge-subtle bg-surface-base p-3 text-xs`,children:[(0,z.jsx)(W,{label:l.identityId,value:n.id,breakAll:!0}),(0,z.jsx)(`div`,{className:`mt-3`,children:(0,z.jsx)(W,{label:l.createdAt,value:h.format(n.createdAt)})})]})]})]}):null,t[23]=l.accessActive,t[24]=l.accessRevoked,t[25]=l.accessTitle,t[26]=l.createdAt,t[27]=l.endpointCount,t[28]=l.endpointsTitle,t[29]=l.identityId,t[30]=l.identityTitle,t[31]=l.lastSeen,t[32]=l.never,t[33]=l.noAccessIdentity,t[34]=l.noOnlineEndpoints,t[35]=l.noPermissions,t[36]=l.permissions,t[37]=l.status,t[38]=l.statusLabel,t[39]=l.toolCount,t[40]=n,t[41]=h,t[42]=s,t[43]=o,t[44]=C,t[45]=F):F=t[45];let I;t[46]!==r||t[47]!==l.removeDevice||t[48]!==l.revoking||t[49]!==n||t[50]!==a||t[51]!==C?(I=n&&C!==`revoked`?(0,z.jsx)(`div`,{className:`shrink-0 border-t border-edge px-4 py-3`,children:(0,z.jsxs)(w,{variant:`secondary`,className:`w-full text-danger`,disabled:r,onClick:()=>a(n),children:[(0,z.jsx)(re,{className:`size-4`,"aria-hidden":!0}),r?l.revoking:l.removeDevice]})}):null,t[46]=r,t[47]=l.removeDevice,t[48]=l.revoking,t[49]=n,t[50]=a,t[51]=C,t[52]=I):I=t[52];let R;t[53]!==P||t[54]!==F||t[55]!==I?(R=(0,z.jsxs)(v,{children:[D,(0,z.jsxs)(y,{className:O,"aria-describedby":void 0,children:[P,F,I]})]}),t[53]=P,t[54]=F,t[55]=I,t[56]=R):R=t[56];let B;return t[57]!==R||t[58]!==T||t[59]!==E?(B=(0,z.jsx)(x,{open:T,onOpenChange:E,children:R}),t[57]=R,t[58]=T,t[59]=E,t[60]=B):B=t[60],B}function de(e){return e.language}function W(e){let t=(0,L.c)(10),{label:n,value:r,breakAll:i}=e,a=i===void 0?!1:i,o;t[0]===n?o=t[1]:(o=(0,z.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=f(`mt-1 text-sm text-fg`,s),t[2]=s,t[3]=c);let l;t[4]!==c||t[5]!==r?(l=(0,z.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,z.jsxs)(`div`,{className:`min-w-0`,children:[o,l]}),t[7]=o,t[8]=l,t[9]=u):u=t[9],u}function fe({device:e,zh:t,onRename:n}){let[r,i]=(0,R.useState)(e.displayName),[a,o]=(0,R.useState)(!1),[s,c]=(0,R.useState)(!1);return(0,z.jsxs)(`form`,{className:`space-y-2`,onSubmit:async t=>{if(t.preventDefault(),!(a||!r.trim())){o(!0),c(!1);try{await n(e,r.trim())}catch{c(!0)}finally{o(!1)}}},children:[(0,z.jsxs)(`label`,{className:`block text-sm text-fg`,children:[t?`设备名称`:`Device name`,(0,z.jsx)(`input`,{value:r,maxLength:80,onChange:e=>i(e.target.value),className:`mt-2 h-10 w-full rounded-lg border border-edge bg-surface-inset px-3 text-fg`})]}),(0,z.jsx)(w,{type:`submit`,variant:`secondary`,disabled:a||!r.trim()||r.trim()===e.displayName,children:a?t?`保存中…`:`Saving…`:t?`保存名称`:`Save name`}),s?(0,z.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:t?`保存失败,请刷新设备信息后重试。`:`Unable to save. Refresh device information and retry.`}):null]})}function pe(e){let t=(0,L.c)(19),{onPaired:n}=e,[r,a]=i(),o=m(he),s;t[0]===o?s=t[1]:(s=ee(o),t[0]=o,t[1]=s);let c=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,R.useState)(u),p,h;t[3]!==r||t[4]!==a?(p=()=>{let e=r.get(`startDevicePairing`);e!==`mobile`&&e!==`browser`||(f({open:!0,target:e}),a(me,{replace:!0}))},h=[r,a],t[3]=r,t[4]=a,t[5]=p,t[6]=h):(p=t[5],h=t[6]),(0,R.useEffect)(p,h);let g,_;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>f({open:!0}),_=(0,z.jsx)(l,{className:`size-4`,"aria-hidden":!0}),t[7]=g,t[8]=_):(g=t[7],_=t[8]);let v;t[9]===c.addDevice?v=t[10]:(v=(0,z.jsxs)(w,{variant:`primary`,onClick:g,children:[_,c.addDevice]}),t[9]=c.addDevice,t[10]=v);let y;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>f(t=>({...t,open:e})),t[11]=y):y=t[11];let b;t[12]!==d.open||t[13]!==d.target||t[14]!==n?(b=(0,z.jsx)(F,{open:d.open,onOpenChange:y,onPaired:n,targetKind:d.target}),t[12]=d.open,t[13]=d.target,t[14]=n,t[15]=b):b=t[15];let x;return t[16]!==v||t[17]!==b?(x=(0,z.jsxs)(z.Fragment,{children:[v,b]}),t[16]=v,t[17]=b,t[18]=x):x=t[18],x}function me(e){let t=new URLSearchParams(e);return t.delete(`startDevicePairing`),t}function he(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 ge(){return h(`/api/endpoint-tools/devices`)}function _e(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),h(`/api/endpoint-tools/invocations?${t}`)}async function ve(){return G(await p(ge()))}async function ye(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 p(h(`/api/endpoint-tools/devices/revoke`),{method:`POST`,body:JSON.stringify({ids:e})}))}))}async function be(e){return G(await p(_e(e)))}async function xe(e,t,n){await G(await p(h(`/api/endpoint-tools/devices/${encodeURIComponent(e)}`),{method:`PATCH`,body:JSON.stringify({nickname:t,expectedRevision:n})}))}var Se=5e3,K=20,Ce=20;function we(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 Te(e){let t=(0,L.c)(5),{status:n,label:r}=e,i;t[0]===n?i=t[1]:(i=f(`rounded-full px-2 py-0.5 text-xs font-medium`,we(n)),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,z.jsx)(`span`,{className:i,children:r}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function Ee(){let e=m(e=>e.language),t=ee(e).endpointToolsSettings,[n,r]=i(),l=n.get(`view`)===`activity`?`activity`:`devices`,[d,p]=(0,R.useState)(null),[h,g]=(0,R.useState)([]),[_,v]=(0,R.useState)(!1),[y,b]=(0,R.useState)(!1),[x,S]=(0,R.useState)(``),[T,te]=(0,R.useState)(`active`),[ne,F]=(0,R.useState)(``),[L,B]=(0,R.useState)(1),[V,H]=(0,R.useState)(()=>new Set),[de,W]=(0,R.useState)(``),[fe]=E(de,250),[me,he]=(0,R.useState)(``),[G,we]=(0,R.useState)(``),[Ee,De]=(0,R.useState)(``),[Oe,q]=(0,R.useState)(1),ke={page:Oe,pageSize:Ce,query:fe,principalId:me,status:G,effect:Ee},J=C(ge(),ve,{refreshInterval:Se}),Y=C(l===`activity`?_e(ke):null,()=>be(ke),{refreshInterval:Se,keepPreviousData:!0}),Ae=(0,R.useMemo)(()=>new Intl.DateTimeFormat(e===`zh`?`zh-CN`:`en`,{dateStyle:`medium`,timeStyle:`short`}),[e]);if(J.isLoading&&!J.data)return(0,z.jsx)(N,{children:(0,z.jsx)(I,{sections:2})});let X=J.data??[],je=Y.data?.items??[],Me=X.filter(e=>U(e)===`online`).length,Ne=X.filter(e=>U(e)!==`revoked`).length,Pe=X.filter(e=>se(e)).length,Fe=[...new Set(X.map(e=>e.platform))].toSorted(),Z=ce(X,{query:x,status:T,platform:ne}),Ie=Math.max(1,Math.ceil(Z.length/K)),Q=Math.min(L,Ie),Le=Z.slice((Q-1)*K,Q*K),$=Le.reduce((e,t)=>(U(t)!==`revoked`&&e.push(t.id),e),[]),Re=$.length>0&&$.every(e=>V.has(e)),ze=e=>{r(t=>{let n=new URLSearchParams(t);return e===`devices`?n.delete(`view`):n.set(`view`,e),n},{replace:!0})},Be=async()=>{await Promise.all([J.mutate(),l===`activity`?Y.mutate():Promise.resolve()])},Ve=async()=>{if(!(h.length===0||_)){v(!0),b(!1);try{await ye(h.map(e=>e.id)),g([]),H(new Set),await J.mutate()}catch{b(!0)}finally{v(!1)}}},He=e=>{e(),B(1),H(new Set)};return(0,z.jsxs)(N,{children:[(0,z.jsx)(M,{title:t.title,subtitle:t.subtitle,actions:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(ie,{className:`size-9 shrink-0 p-0`,label:t.refresh,onClick:Be}),(0,z.jsx)(pe,{onPaired:()=>void J.mutate()})]})}),J.error||Y.error?(0,z.jsx)(`div`,{className:`rounded-xl bg-danger-soft px-4 py-3 text-sm text-danger`,children:t.loadError}):null,(0,z.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[{label:t.activeDevices,value:Ne,filter:`active`},{label:t.onlineDevices,value:Me,filter:`online`},{label:t.staleDevices,value:Pe,filter:`stale`}].map(({label:e,value:t,filter:n})=>(0,z.jsxs)(`button`,{type:`button`,className:f(`touch-target rounded-xl px-4 py-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,T===n?`bg-surface-active`:`bg-surface-hover/20 hover:bg-surface-hover/50`),"aria-pressed":T===n,onClick:()=>{He(()=>te(n)),ze(`devices`)},children:[(0,z.jsx)(`span`,{className:`text-xs text-fg-muted`,children:e}),(0,z.jsx)(`span`,{className:`mt-1 block text-2xl font-semibold text-fg`,children:t})]},n))}),(0,z.jsx)(j,{items:[{id:`devices`,label:t.devicesTab,icon:A,count:Ne},{id:`activity`,label:t.activityTab,icon:a,count:Y.data?.total}],activeTab:l,onChange:ze,ariaLabel:t.viewsAria,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`}),(0,z.jsxs)(P,{id:`devices`,activeTab:l,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`,title:t.devicesTitle,hint:t.devicesHint,children:[(0,z.jsx)(ae,{devices:X,zh:e===`zh`}),(0,z.jsxs)(`div`,{className:`mb-4 grid gap-2 sm:grid-cols-[minmax(0,1fr)_11rem_11rem]`,children:[(0,z.jsxs)(`label`,{className:`relative block`,children:[(0,z.jsx)(`span`,{className:`sr-only`,children:t.searchDevices}),(0,z.jsx)(u,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),(0,z.jsx)(`input`,{type:`search`,"aria-label":t.searchDevices,value:x,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=>He(()=>S(e.target.value))})]}),(0,z.jsx)(c,{value:T,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=>He(()=>te(e))}),(0,z.jsx)(c,{value:ne,options:Fe.map(e=>({value:e,label:e})),placeholder:t.allPlatforms,emptyLabel:t.allPlatforms,ariaLabel:t.platformLabel,onChange:e=>He(()=>F(e))})]}),V.size>0?(0,z.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,z.jsx)(`p`,{className:`text-sm font-medium text-accent-fg`,children:t.selectedCount.replace(`{{count}}`,String(V.size))}),(0,z.jsxs)(w,{variant:`secondary`,className:`text-danger`,onClick:()=>{b(!1),g(X.filter(e=>V.has(e.id)))},children:[(0,z.jsx)(re,{className:`size-4`,"aria-hidden":!0}),t.removeSelected]})]}):null,X.length===0?(0,z.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noDevices}):Z.length===0?(0,z.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noMatchingDevices}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`flex min-h-10 items-center gap-3 border-b border-edge-subtle px-1`,children:(0,z.jsxs)(`label`,{className:f(`touch-target flex items-center gap-2 text-xs text-fg-muted`,$.length>0?`cursor-pointer`:`cursor-not-allowed opacity-50`),children:[(0,z.jsx)(`input`,{type:`checkbox`,"aria-label":t.selectPage,checked:Re,disabled:$.length===0,className:`size-4 accent-accent`,onChange:e=>{H(t=>{let n=new Set(t);for(let t of $)e.target.checked?n.add(t):n.delete(t);return n})}}),t.selectPage]})}),(0,z.jsx)(`ul`,{className:`divide-y divide-edge-subtle`,children:Le.map(e=>{let n=U(e),r=e.kind===`mobile`?D:O;return(0,z.jsxs)(`li`,{className:`flex items-center gap-3`,children:[(0,z.jsx)(`label`,{className:f(`touch-target flex size-10 shrink-0 items-center justify-center`,n===`revoked`?`cursor-not-allowed opacity-40`:`cursor-pointer`),children:(0,z.jsx)(`input`,{type:`checkbox`,checked:V.has(e.id),disabled:n===`revoked`,"aria-label":t.selectDevice.replace(`{{name}}`,e.displayName),className:`size-4 accent-accent`,onChange:t=>{H(n=>{let r=new Set(n);return t.target.checked?r.add(e.id):r.delete(e.id),r})}})}),(0,z.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:()=>p(e),children:[(0,z.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-surface-inset text-fg-muted`,children:(0,z.jsx)(r,{className:`size-4`,"aria-hidden":!0})}),(0,z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,z.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,z.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:e.displayName}),(0,z.jsx)(Te,{status:n,label:t.status[n]})]}),(0,z.jsxs)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:[e.platform,` · `,le(e.id),` · `,t.lastSeen,`: `,e.lastSeenAt?Ae.format(e.lastSeenAt):t.never]})]}),(0,z.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(oe(e)))}),(0,z.jsx)(s,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0})]})]},e.id)})}),(0,z.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3 border-t border-edge-subtle pt-3`,children:[(0,z.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,z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,z.jsx)(w,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.previousPage,disabled:Q<=1,onClick:()=>B(e=>Math.max(1,e-1)),children:(0,z.jsx)(o,{className:`size-4`,"aria-hidden":!0})}),(0,z.jsx)(w,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.nextPage,disabled:Q>=Ie,onClick:()=>B(e=>Math.min(Ie,e+1)),children:(0,z.jsx)(s,{className:`size-4`,"aria-hidden":!0})})]})]})]})]}),(0,z.jsxs)(P,{id:`activity`,activeTab:l,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`,title:t.callsTitle,hint:t.callsHint,children:[(0,z.jsxs)(`div`,{className:`mb-4 grid gap-2 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,z.jsxs)(`label`,{className:`relative block sm:col-span-2 lg:col-span-1`,children:[(0,z.jsx)(`span`,{className:`sr-only`,children:t.searchActivity}),(0,z.jsx)(u,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),(0,z.jsx)(`input`,{type:`search`,"aria-label":t.searchActivity,value:de,placeholder:t.searchActivity,className:`h-10 w-full rounded-lg border border-edge bg-surface-inset pl-9 pr-3 text-base text-fg placeholder:text-fg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent sm:text-sm`,onChange:e=>{W(e.target.value),q(1)}})]}),(0,z.jsx)(c,{value:me,options:X.map(e=>({value:e.id,label:`${e.displayName} · ${le(e.id)}`})),placeholder:t.allDevices,emptyLabel:t.allDevices,ariaLabel:t.deviceLabel,onChange:e=>{he(e),q(1)}}),(0,z.jsx)(c,{value:G,options:[{value:`running`,label:t.status.running},{value:`succeeded`,label:t.status.succeeded},{value:`failed`,label:t.status.failed}],placeholder:t.allStatuses,emptyLabel:t.allStatuses,ariaLabel:t.statusLabel,onChange:e=>{we(e),q(1)}}),(0,z.jsx)(c,{value:Ee,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=>{De(e),q(1)}})]}),Y.isLoading&&!Y.data?(0,z.jsx)(I,{sections:1}):null,je.length===0&&!Y.isLoading?(0,z.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noMatchingCalls}):null,(0,z.jsx)(`div`,{className:`space-y-2`,children:je.map(e=>(0,z.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,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsx)(`p`,{className:`break-all text-sm font-medium text-fg`,children:e.toolName}),(0,z.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[Ae.format(e.startedAt),` · `,t.effects[e.effect],` · `,e.endpointId]}),e.errorMessage?(0,z.jsx)(`p`,{className:`mt-1 text-xs text-danger`,children:e.errorMessage}):null]}),(0,z.jsx)(Te,{status:e.status,label:t.status[e.status]})]},e.id))}),Y.data&&Y.data.total>0?(0,z.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3 border-t border-edge-subtle pt-3`,children:[(0,z.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,z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,z.jsx)(w,{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,z.jsx)(o,{className:`size-4`,"aria-hidden":!0})}),(0,z.jsx)(w,{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,z.jsx)(s,{className:`size-4`,"aria-hidden":!0})})]})]}):null]}),(0,z.jsx)(ue,{device:d,busy:_,onRename:async(e,t)=>{await xe(e.id,t,e.settingsRevision??0),p((await J.mutate())?.find(t=>t.id===e.id)??null)},onClose:()=>p(null),onRevoke:e=>{p(null),b(!1),g([e])}}),(0,z.jsx)(k,{open:h.length>0,title:h.length>1?t.removeManyTitle:t.removeTitle,description:`${h.length>1?t.removeManyDescription.replace(`{{count}}`,String(h.length)):t.removeDescription.replace(`{{name}}`,h[0]?.displayName??``)}${y?`\n\n${t.revokeError}`:``}`,confirmLabel:_?t.revoking:t.removeDevice,cancelLabel:t.cancel,destructive:!0,onConfirm:()=>void Ve(),onCancel:()=>{_||g([])}})]})}export{Ee as EndpointToolsManagementSettings};
|
package/dist/gateway/static/root/assets/{markdown-view-DSjfHfaW.css → markdown-view-ByJbFign.css}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
pre code.hljs{padding:1em;display:block;overflow-x:auto}code.hljs{padding:3px 5px}.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#005cc5}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-comment,.hljs-code,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}.markdown-render-boundary{isolation:isolate;contain:layout paint;overflow-wrap:anywhere;min-width:0}.markdown-body{letter-spacing:-.011em;color:inherit;font-size:.9375rem;line-height:1.5}.assistant-markdown-content .markdown-body,.chat-user-message .markdown-body{font-size:inherit;line-height:inherit}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{letter-spacing:-.022em;color:var(--color-fg);margin-top:1.35em;margin-bottom:.45em;font-weight:600;line-height:1.25}.markdown-body h1{border-bottom:1px solid var(--color-edge);padding-bottom:.3em;font-size:1.5em}.markdown-body h2{border-bottom:1px solid var(--color-edge);padding-bottom:.3em;font-size:1.3em}.markdown-body h3{font-size:1.1em}.markdown-body ul,.markdown-body ol{margin-bottom:1em;padding-left:2em}.markdown-body li{margin-bottom:.35em}.markdown-body code{font-family:var(--font-mono);background:color-mix(in srgb, var(--color-fg) 8%, transparent);color:var(--color-fg-muted);border-radius:.4rem;padding:.15em .4em;font-size:.875em}.markdown-body pre{background:var(--color-surface-hover);border-radius:var(--radius-xl);border:1px solid var(--color-edge);margin-bottom:1em;padding:1em;overflow-x:auto}.markdown-code-block{border:1px solid var(--color-edge);border-radius:var(--radius-xl);background:var(--color-surface-hover);margin:0 0 1em;overflow:visible}.markdown-code-block-header{z-index:3;border-bottom:1px solid var(--color-edge);border-radius:var(--radius-xl) var(--radius-xl) 0 0;background:var(--color-surface-active);justify-content:space-between;align-items:center;gap:.75rem;min-height:2.25rem;padding:.35rem .65rem .35rem .85rem;display:flex;position:sticky;top:0}.markdown-code-block-lang{min-width:0;font-family:var(--font-mono);letter-spacing:.02em;color:var(--color-fg-muted);text-transform:lowercase;-webkit-user-select:none;user-select:none;flex:auto;font-size:.75rem;font-weight:500;line-height:1.35}.markdown-code-copy-btn{border-radius:var(--radius-md);background:var(--color-surface-active);color:var(--color-fg-muted);cursor:pointer;border:none;flex:none;justify-content:center;align-items:center;gap:.35rem;margin:0;padding:.25rem .45rem;font-size:.75rem;font-weight:500;line-height:1.25;transition:color .15s,background-color .15s,transform .12s;display:inline-flex}.markdown-code-copy-btn:hover{color:var(--color-fg);background:var(--color-surface-panel)}.markdown-code-copy-btn:active{transform:scale(.97)}.markdown-code-copy-btn:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}.markdown-code-copy-inner{flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.markdown-code-copy-btn svg{pointer-events:none}.markdown-code-copy-label{white-space:nowrap}.markdown-body .markdown-code-block>pre{border-radius:0 0 var(--radius-xl) var(--radius-xl);background:var(--color-surface-hover);border:none;margin:0}html:not(.dark) .assistant-markdown-content .markdown-code-block,html:not(.dark) .assistant-markdown-content .markdown-body .markdown-code-block>pre{background:color-mix(in srgb, var(--color-fg) 4%, var(--color-surface-panel))}html:not(.dark) .assistant-markdown-content .markdown-code-block-header{background:color-mix(in srgb, var(--color-fg) 7%, var(--color-surface-panel))}html.dark .markdown-code-block{border-color:var(--color-edge);background:#0d1117}html.dark .markdown-code-block-header{border-bottom-color:var(--color-edge);background:#06080b}html.dark .markdown-code-block-lang{color:var(--color-fg-muted)}html.dark .markdown-body .markdown-code-block>pre{background:#0d1117}html.dark .markdown-code-copy-btn{color:var(--color-fg-subtle);background:#06080b}html.dark .markdown-code-copy-btn:hover{color:var(--color-fg);background:#121820}.chat-messages .markdown-code-block-header{top:-1rem}.chat-messages.chat-messages--compact-welcome .markdown-code-block-header{top:-1.25rem}.markdown-body pre code{color:inherit;background:0 0;padding:0;font-size:.8125rem}.markdown-body blockquote{border-left:2px solid var(--color-edge-strong);color:var(--color-fg-muted);background:0 0;border-radius:0;margin:0 0 1em;padding:.1em 0 .1em 1em}.markdown-body a[href]{color:var(--color-accent-fg);text-decoration:none}.markdown-body a[href]:hover{text-decoration:underline}.markdown-body a[href]:focus-visible{outline:2px solid var(--color-accent);outline-offset:3px;border-radius:var(--radius-sm)}.markdown-body hr{background:var(--color-edge);border:none;height:1px;margin:1.5em 0}.markdown-body table{border-collapse:collapse;border:1px solid var(--color-edge);border-radius:var(--radius-lg);width:100%;margin:0 0 1em;font-size:.875rem;line-height:1.5;overflow:hidden}.markdown-body th,.markdown-body td{border:1px solid var(--color-edge-subtle);text-align:left;vertical-align:top;padding:.5rem .75rem}.markdown-body th{background:var(--color-surface-hover);color:var(--color-fg);font-weight:600}.markdown-body tbody tr:hover td{background:var(--color-surface-hover)}.markdown-body p{margin:0 0 .75em}.markdown-body.workflow-result-markdown{color:var(--color-fg-muted);font-size:1rem;line-height:1.7}.markdown-body.workflow-result-markdown>:first-child{margin-top:0}.markdown-body.workflow-result-markdown>:last-child{margin-bottom:0}.markdown-body.workflow-result-markdown h1,.markdown-body.workflow-result-markdown h2,.markdown-body.workflow-result-markdown h3{color:var(--color-fg)}.markdown-body.workflow-result-markdown table{display:block;overflow-x:auto}.markdown-body.workflow-status-markdown{color:var(--color-fg-muted);font-size:.8125rem;line-height:1.55}.markdown-body.workflow-status-markdown>:first-child{margin-top:0}.markdown-body.workflow-status-markdown h1,.markdown-body.workflow-status-markdown h2,.markdown-body.workflow-status-markdown h3{border-bottom:0;padding-bottom:0;font-size:.875rem}.markdown-body.workflow-status-markdown table{font-size:.75rem;display:block;overflow-x:auto}.markdown-body.markdown-note{font-size:.9375rem;line-height:1.45}.markdown-body.markdown-note p{margin-bottom:.65em}.markdown-body strong{font-weight:600}.markdown-body em{font-style:italic}.markdown-body.markdown-compact h1,.markdown-body.markdown-compact h2,.markdown-body.markdown-compact h3{border-bottom:0;margin-top:1.25em;margin-bottom:.4em;padding-bottom:0}.markdown-body.markdown-compact p{margin:0 0 .8em}.markdown-body.markdown-compact>:first-child{margin-top:0}.markdown-body.markdown-compact:not(.markdown-stream-block)>:last-child,.markdown-body.markdown-compact.markdown-stream-tail>:last-child{margin-bottom:0}.markdown-stream-tail:empty{display:none}.markdown-body.markdown-compact pre,.markdown-body.markdown-compact .markdown-code-block{margin-bottom:.75em}.markdown-body.markdown-compact .markdown-code-block>pre{margin-bottom:0}.markdown-mermaid{border:1px solid var(--color-edge);border-radius:var(--radius-xl);background:var(--color-surface-hover);text-align:center;margin:0 0 1em;padding:1em;overflow-x:auto}.markdown-mermaid svg{max-width:100%;height:auto;display:inline-block}.markdown-mermaid-interactive{position:relative}.markdown-mermaid-interactive>svg{cursor:zoom-in}.markdown-mermaid-actions{z-index:1;border:1px solid var(--color-edge);border-radius:var(--radius-lg);background:color-mix(in srgb, var(--color-surface-panel) 92%, transparent);box-shadow:var(--shadow-popover);opacity:0;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);gap:.25rem;padding:.25rem;transition:opacity .15s,transform .15s;display:flex;position:absolute;top:.5rem;right:.5rem;transform:translateY(-.25rem)}.markdown-mermaid-interactive:hover .markdown-mermaid-actions,.markdown-mermaid-interactive:focus-within .markdown-mermaid-actions{opacity:1;transform:translateY(0)}.markdown-mermaid-action-button,.mermaid-preview-toolbar-button{border-radius:var(--radius-md);width:2rem;height:2rem;color:var(--color-fg-muted);background:0 0;border:0;justify-content:center;align-items:center;transition:color .15s,background-color .15s,transform .15s;display:inline-flex}.markdown-mermaid-action-button:hover,.mermaid-preview-toolbar-button:hover{background:var(--color-surface-hover);color:var(--color-fg)}.markdown-mermaid-action-button:active,.mermaid-preview-toolbar-button:active{transform:scale(.95)}.markdown-mermaid-action-button:focus-visible,.mermaid-preview-toolbar-button:focus-visible{outline:2px solid var(--color-accent);outline-offset:1px}.markdown-mermaid-action-button:disabled,.mermaid-preview-toolbar-button:disabled{cursor:wait;opacity:.5}@media (hover:none){.markdown-mermaid-actions{opacity:1;transform:translateY(0)}}@media (max-width:640px){.mermaid-preview-secondary-action{display:none}}.markdown-mermaid-error{justify-content:center;align-items:center;min-height:6rem;display:flex}.markdown-mermaid-error-message{color:var(--color-danger);font-size:.875rem;font-weight:500}.markdown-body.markdown-compact .markdown-mermaid{margin-bottom:.75em}html.dark .markdown-mermaid{background:var(--color-surface-panel)}html.dark .markdown-body pre code.hljs{padding:1em;display:block;overflow-x:auto}html.dark .markdown-body code.hljs{padding:3px 5px}html.dark .markdown-body .hljs{color:#c9d1d9;background:var(--color-surface-panel)}html.dark .markdown-body .hljs-doctag,html.dark .markdown-body .hljs-keyword,html.dark .markdown-body .hljs-meta .hljs-keyword,html.dark .markdown-body .hljs-template-tag,html.dark .markdown-body .hljs-template-variable,html.dark .markdown-body .hljs-type,html.dark .markdown-body .hljs-variable.language_{color:#ff7b72}html.dark .markdown-body .hljs-title,html.dark .markdown-body .hljs-title.class_,html.dark .markdown-body .hljs-title.class_.inherited__,html.dark .markdown-body .hljs-title.function_{color:#d2a8ff}html.dark .markdown-body .hljs-attr,html.dark .markdown-body .hljs-attribute,html.dark .markdown-body .hljs-literal,html.dark .markdown-body .hljs-meta,html.dark .markdown-body .hljs-number,html.dark .markdown-body .hljs-operator,html.dark .markdown-body .hljs-variable,html.dark .markdown-body .hljs-selector-attr,html.dark .markdown-body .hljs-selector-class,html.dark .markdown-body .hljs-selector-id{color:#79c0ff}html.dark .markdown-body .hljs-regexp,html.dark .markdown-body .hljs-string,html.dark .markdown-body .hljs-meta .hljs-string{color:#a5d6ff}html.dark .markdown-body .hljs-built_in,html.dark .markdown-body .hljs-symbol{color:#ffa657}html.dark .markdown-body .hljs-comment,html.dark .markdown-body .hljs-code,html.dark .markdown-body .hljs-formula{color:#8b949e}html.dark .markdown-body .hljs-name,html.dark .markdown-body .hljs-quote,html.dark .markdown-body .hljs-selector-tag,html.dark .markdown-body .hljs-selector-pseudo{color:#7ee787}html.dark .markdown-body .hljs-subst{color:#c9d1d9}html.dark .markdown-body .hljs-section{color:#1f6feb;font-weight:700}html.dark .markdown-body .hljs-bullet{color:#f2cc60}html.dark .markdown-body .hljs-emphasis{color:#c9d1d9;font-style:italic}html.dark .markdown-body .hljs-strong{color:#c9d1d9;font-weight:700}html.dark .markdown-body .hljs-addition{color:#aff5b4;background-color:#033a16}html.dark .markdown-body .hljs-deletion{color:#ffdcd7;background-color:#67060c}
|
|
1
|
+
pre code.hljs{padding:1em;display:block;overflow-x:auto}code.hljs{padding:3px 5px}.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#005cc5}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-comment,.hljs-code,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}.markdown-render-boundary{isolation:isolate;contain:layout paint;overflow-wrap:anywhere;min-width:0}.markdown-body{letter-spacing:-.011em;color:inherit;font-size:.9375rem;line-height:1.5}.assistant-markdown-content .markdown-body,.chat-user-message .markdown-body{font-size:inherit;line-height:inherit}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{letter-spacing:-.022em;color:var(--color-fg);margin-top:1.35em;margin-bottom:.45em;font-weight:600;line-height:1.25}.markdown-body h1{border-bottom:1px solid var(--color-edge);padding-bottom:.3em;font-size:1.5em}.markdown-body h2{border-bottom:1px solid var(--color-edge);padding-bottom:.3em;font-size:1.3em}.markdown-body h3{font-size:1.1em}.markdown-body ul,.markdown-body ol{margin-bottom:1em;padding-left:2em}.markdown-body li{margin-bottom:.35em}.markdown-body code{font-family:var(--font-mono);background:color-mix(in srgb, var(--color-fg) 8%, transparent);color:var(--color-fg-muted);border-radius:.4rem;padding:.15em .4em;font-size:.875em}.markdown-body pre{background:var(--color-surface-hover);border-radius:var(--radius-xl);border:1px solid var(--color-edge);margin-bottom:1em;padding:1em;overflow-x:auto}.markdown-code-block{border:1px solid var(--color-edge);border-radius:var(--radius-xl);background:var(--color-surface-hover);margin:0 0 1em;overflow:visible}.markdown-code-block-header{z-index:3;border-bottom:1px solid var(--color-edge);border-radius:var(--radius-xl) var(--radius-xl) 0 0;background:var(--color-surface-active);justify-content:space-between;align-items:center;gap:.75rem;min-height:2.25rem;padding:.35rem .65rem .35rem .85rem;display:flex;position:sticky;top:0}.markdown-code-block-lang{min-width:0;font-family:var(--font-mono);letter-spacing:.02em;color:var(--color-fg-muted);text-transform:lowercase;-webkit-user-select:none;user-select:none;flex:auto;font-size:.75rem;font-weight:500;line-height:1.35}.markdown-code-copy-btn{border-radius:var(--radius-md);background:var(--color-surface-active);color:var(--color-fg-muted);cursor:pointer;border:none;flex:none;justify-content:center;align-items:center;gap:.35rem;margin:0;padding:.25rem .45rem;font-size:.75rem;font-weight:500;line-height:1.25;transition:color .15s,background-color .15s,transform .12s;display:inline-flex}.markdown-code-copy-btn:hover{color:var(--color-fg);background:var(--color-surface-panel)}.markdown-code-copy-btn:active{transform:scale(.97)}.markdown-code-copy-btn:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}.markdown-code-copy-inner{flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.markdown-code-copy-btn svg{pointer-events:none}.markdown-code-copy-label{white-space:nowrap}.markdown-body .markdown-code-block>pre{border-radius:0 0 var(--radius-xl) var(--radius-xl);background:var(--color-surface-hover);border:none;margin:0}html:not(.dark) .assistant-markdown-content .markdown-code-block,html:not(.dark) .assistant-markdown-content .markdown-body .markdown-code-block>pre{background:color-mix(in srgb, var(--color-fg) 4%, var(--color-surface-panel))}html:not(.dark) .assistant-markdown-content .markdown-code-block-header{background:color-mix(in srgb, var(--color-fg) 7%, var(--color-surface-panel))}html.dark .markdown-code-block{border-color:var(--color-edge);background:#0d1117}html.dark .markdown-code-block-header{border-bottom-color:var(--color-edge);background:#06080b}html.dark .markdown-code-block-lang{color:var(--color-fg-muted)}html.dark .markdown-body .markdown-code-block>pre{background:#0d1117}html.dark .markdown-code-copy-btn{color:var(--color-fg-subtle);background:#06080b}html.dark .markdown-code-copy-btn:hover{color:var(--color-fg);background:#121820}.chat-messages .markdown-code-block-header{top:-1rem}.chat-messages.chat-messages--compact-welcome .markdown-code-block-header{top:-1.25rem}.markdown-body pre code{color:inherit;background:0 0;padding:0;font-size:.8125rem}.markdown-body blockquote{border-left:2px solid var(--color-edge-strong);color:var(--color-fg-muted);background:0 0;border-radius:0;margin:0 0 1em;padding:.1em 0 .1em 1em}.markdown-body a[href]{color:var(--color-accent-fg);text-decoration:none}.markdown-body a[href]:hover{text-decoration:underline}.markdown-body a[href]:focus-visible{outline:2px solid var(--color-accent);outline-offset:3px;border-radius:var(--radius-sm)}.markdown-body hr{background:var(--color-edge);border:none;height:1px;margin:1.5em 0}.markdown-body table{border-collapse:collapse;border:1px solid var(--color-edge);border-radius:var(--radius-lg);width:100%;margin:0 0 1em;font-size:.875rem;line-height:1.5;overflow:hidden}.markdown-body th,.markdown-body td{border:1px solid var(--color-edge-subtle);text-align:left;vertical-align:top;padding:.5rem .75rem}.markdown-body th{background:var(--color-surface-hover);color:var(--color-fg);font-weight:600}.markdown-body tbody tr:hover td{background:var(--color-surface-hover)}.markdown-body p{margin:0 0 .75em}.markdown-body.workflow-result-markdown{color:var(--color-fg-muted);font-size:1rem;line-height:1.7}.markdown-body.workflow-result-markdown>:first-child{margin-top:0}.markdown-body.workflow-result-markdown>:last-child{margin-bottom:0}.markdown-body.workflow-result-markdown h1,.markdown-body.workflow-result-markdown h2,.markdown-body.workflow-result-markdown h3{color:var(--color-fg)}.markdown-body.workflow-result-markdown table{display:block;overflow-x:auto}.markdown-body.workflow-status-markdown{color:var(--color-fg-muted);font-size:.8125rem;line-height:1.55}.markdown-body.workflow-status-markdown>:first-child{margin-top:0}.markdown-body.workflow-status-markdown h1,.markdown-body.workflow-status-markdown h2,.markdown-body.workflow-status-markdown h3{border-bottom:0;padding-bottom:0;font-size:.875rem}.markdown-body.workflow-status-markdown table{font-size:.75rem;display:block;overflow-x:auto}.markdown-body.markdown-note{font-size:.9375rem;line-height:1.45}.markdown-body.markdown-note p{margin-bottom:.65em}.markdown-body strong{font-weight:600}.markdown-body em{font-style:italic}.markdown-body.markdown-compact h1,.markdown-body.markdown-compact h2,.markdown-body.markdown-compact h3{border-bottom:0;margin-top:1.25em;margin-bottom:.4em;padding-bottom:0}.markdown-body.markdown-compact p{margin:0 0 .8em}.markdown-body.markdown-compact>:first-child{margin-top:0}.markdown-body.markdown-compact:not(.markdown-stream-block)>:last-child,.xopc-chat-markdown>.markdown-stream-block:last-child>:last-child{margin-bottom:0}.xopc-chat-markdown>.markdown-stream-block{margin-block:0}.xopc-chat-markdown>.markdown-stream-block:first-child>:first-child{margin-top:0}.xopc-chat-markdown>.markdown-stream-block:last-child>:has(+[data-xopc-watermark]){margin-bottom:0}.xopc-chat-markdown>.markdown-stream-block:last-child{margin-bottom:0}.xopc-chat-markdown .markdown-code-block>pre{max-height:28rem;overflow:auto}.xopc-chat-markdown .markdown-table-scroll{border-radius:var(--radius-lg);max-width:100%;margin-bottom:1em;overflow:auto}.markdown-body.xopc-chat-markdown .markdown-table-scroll>table{table-layout:fixed;margin-bottom:0;display:table}.xopc-chat-markdown th,.xopc-chat-markdown td[data-markdown-align=right]{white-space:nowrap;word-break:normal;overflow-wrap:normal}.xopc-chat-markdown .markdown-mermaid svg{max-width:100%}.markdown-body.markdown-compact pre,.markdown-body.markdown-compact .markdown-code-block{margin-bottom:.75em}.markdown-body.markdown-compact .markdown-code-block>pre{margin-bottom:0}.markdown-mermaid{border:1px solid var(--color-edge);border-radius:var(--radius-xl);background:var(--color-surface-hover);text-align:center;margin:0 0 1em;padding:1em;overflow-x:auto}.markdown-mermaid svg{max-width:100%;height:auto;display:inline-block}.markdown-mermaid-interactive{position:relative}.markdown-mermaid-interactive>svg{cursor:zoom-in}.markdown-mermaid-actions{z-index:1;border:1px solid var(--color-edge);border-radius:var(--radius-lg);background:color-mix(in srgb, var(--color-surface-panel) 92%, transparent);box-shadow:var(--shadow-popover);opacity:0;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);gap:.25rem;padding:.25rem;transition:opacity .15s,transform .15s;display:flex;position:absolute;top:.5rem;right:.5rem;transform:translateY(-.25rem)}.markdown-mermaid-interactive:hover .markdown-mermaid-actions,.markdown-mermaid-interactive:focus-within .markdown-mermaid-actions{opacity:1;transform:translateY(0)}.markdown-mermaid-action-button,.mermaid-preview-toolbar-button{border-radius:var(--radius-md);width:2rem;height:2rem;color:var(--color-fg-muted);background:0 0;border:0;justify-content:center;align-items:center;transition:color .15s,background-color .15s,transform .15s;display:inline-flex}.markdown-mermaid-action-button:hover,.mermaid-preview-toolbar-button:hover{background:var(--color-surface-hover);color:var(--color-fg)}.markdown-mermaid-action-button:active,.mermaid-preview-toolbar-button:active{transform:scale(.95)}.markdown-mermaid-action-button:focus-visible,.mermaid-preview-toolbar-button:focus-visible{outline:2px solid var(--color-accent);outline-offset:1px}.markdown-mermaid-action-button:disabled,.mermaid-preview-toolbar-button:disabled{cursor:wait;opacity:.5}@media (hover:none){.markdown-mermaid-actions{opacity:1;transform:translateY(0)}}@media (max-width:640px){.mermaid-preview-secondary-action{display:none}}.markdown-mermaid-error{justify-content:center;align-items:center;min-height:6rem;display:flex}.markdown-mermaid-error-message{color:var(--color-danger);font-size:.875rem;font-weight:500}.markdown-body.markdown-compact .markdown-mermaid{margin-bottom:.75em}html.dark .markdown-mermaid{background:var(--color-surface-panel)}html.dark .markdown-body pre code.hljs{padding:1em;display:block;overflow-x:auto}html.dark .markdown-body code.hljs{padding:3px 5px}html.dark .markdown-body .hljs{color:#c9d1d9;background:var(--color-surface-panel)}html.dark .markdown-body .hljs-doctag,html.dark .markdown-body .hljs-keyword,html.dark .markdown-body .hljs-meta .hljs-keyword,html.dark .markdown-body .hljs-template-tag,html.dark .markdown-body .hljs-template-variable,html.dark .markdown-body .hljs-type,html.dark .markdown-body .hljs-variable.language_{color:#ff7b72}html.dark .markdown-body .hljs-title,html.dark .markdown-body .hljs-title.class_,html.dark .markdown-body .hljs-title.class_.inherited__,html.dark .markdown-body .hljs-title.function_{color:#d2a8ff}html.dark .markdown-body .hljs-attr,html.dark .markdown-body .hljs-attribute,html.dark .markdown-body .hljs-literal,html.dark .markdown-body .hljs-meta,html.dark .markdown-body .hljs-number,html.dark .markdown-body .hljs-operator,html.dark .markdown-body .hljs-variable,html.dark .markdown-body .hljs-selector-attr,html.dark .markdown-body .hljs-selector-class,html.dark .markdown-body .hljs-selector-id{color:#79c0ff}html.dark .markdown-body .hljs-regexp,html.dark .markdown-body .hljs-string,html.dark .markdown-body .hljs-meta .hljs-string{color:#a5d6ff}html.dark .markdown-body .hljs-built_in,html.dark .markdown-body .hljs-symbol{color:#ffa657}html.dark .markdown-body .hljs-comment,html.dark .markdown-body .hljs-code,html.dark .markdown-body .hljs-formula{color:#8b949e}html.dark .markdown-body .hljs-name,html.dark .markdown-body .hljs-quote,html.dark .markdown-body .hljs-selector-tag,html.dark .markdown-body .hljs-selector-pseudo{color:#7ee787}html.dark .markdown-body .hljs-subst{color:#c9d1d9}html.dark .markdown-body .hljs-section{color:#1f6feb;font-weight:700}html.dark .markdown-body .hljs-bullet{color:#f2cc60}html.dark .markdown-body .hljs-emphasis{color:#c9d1d9;font-style:italic}html.dark .markdown-body .hljs-strong{color:#c9d1d9;font-weight:700}html.dark .markdown-body .hljs-addition{color:#aff5b4;background-color:#033a16}html.dark .markdown-body .hljs-deletion{color:#ffdcd7;background-color:#67060c}.xopc-chat-markdown ul{list-style-type:disc}.xopc-chat-markdown ol{list-style-type:decimal}.xopc-chat-markdown ul ul{list-style-type:circle}.xopc-chat-markdown ul ul ul{list-style-type:square}.xopc-chat-markdown li>ul,.xopc-chat-markdown li>ol{margin-top:.35em;margin-bottom:0}.xopc-chat-markdown li.task-list-item{list-style-type:none}.xopc-chat-markdown li.task-list-item>input[type=checkbox]{margin-right:.4em}.markdown-body.xopc-chat-markdown .markdown-code-block>pre>code.hljs{background:0 0;padding:0;display:block;overflow:visible}
|