@xopcai/xopc 0.0.196 → 0.0.199
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-BwmdJ5pv.js → activity-store-DYVN1hRp.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-B1oxPli_.js → agent-avatar-dicebear-Bt70bZjv.js} +1 -1
- package/dist/gateway/static/root/assets/agents-D19uNmJf.js +68 -0
- package/dist/gateway/static/root/assets/{api-BM1hNzjw.js → api-B8mzbAle.js} +1 -1
- package/dist/gateway/static/root/assets/app-management-settings-panel-B4x7JfL8.js +1 -0
- package/dist/gateway/static/root/assets/appearance-settings-Dwdagf-Q.js +1 -0
- package/dist/gateway/static/root/assets/apps-page-DkTiesxe.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BdE4Mati.js → archive-plugin-Cv0VXKLm.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CTzaQcLV.js → attachment-load-CgidKrXn.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-BR6qMOVr.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-B25zTNxl.js → binary-plugins-DN3CQgIq.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-Cdrf2awF.js → block-editor-BwkSl1F_.js} +46 -46
- package/dist/gateway/static/root/assets/browser-settings-page-CDFQWAxI.js +8 -0
- package/dist/gateway/static/root/assets/browser-workflow-inputs-_ndaecsf.js +1 -0
- package/dist/gateway/static/root/assets/{browser-workflows-page-Wx9FrbK-.js → browser-workflows-page-C_I31wLm.js} +2 -2
- package/dist/gateway/static/root/assets/button-CSEbl4zT.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-D41mssOq.js +7 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-BoOzFotX.js → capability-presets-api-Dy1jZJKs.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-BXgCyuu2.js +3 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-_8IiTxRB.js → channel-recipient-api-D-9qiuio.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-DV5BhAeu.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-B4Rbh3bM.js +1 -0
- package/dist/gateway/static/root/assets/connectors-api-5FEBYguL.js +1 -0
- package/dist/gateway/static/root/assets/connectors-page-C_qkEN0T.js +2 -0
- package/dist/gateway/static/root/assets/copy-Dv6d4Dvw.js +1 -0
- package/dist/gateway/static/root/assets/cron-expression-SEFx5rnr.js +2 -0
- package/dist/gateway/static/root/assets/date-picker-D4zCUQJL.js +1 -0
- package/dist/gateway/static/root/assets/dependency-picker-DpQAxS2k.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-BOb8sEhN.js → desktop-pet-B_5G3lQl.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-ClEyoUJe.js +1 -0
- package/dist/gateway/static/root/assets/directory-picker-path-field-AsFWmOjG.js +1 -0
- package/dist/gateway/static/root/assets/dist-BPoKqzeH.js +1 -0
- package/dist/gateway/static/root/assets/dist-DY4Af0fY.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-p83TmZFd.js → extension-debug-page-C22Y2o5l.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DMQ3ovxA.js → extension-page-C61Ikawk.js} +1 -1
- package/dist/gateway/static/root/assets/extension-settings-page-WlWWcDFr.js +1 -0
- package/dist/gateway/static/root/assets/external-link-DjqjBmc3.js +1 -0
- package/dist/gateway/static/root/assets/form-field-width-DJw_jULe.js +1 -0
- package/dist/gateway/static/root/assets/gateway-config-api-ByIOMQdc.js +1 -0
- package/dist/gateway/static/root/assets/gateway-config-swr-jB0hAhWO.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-CzzS9A17.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry--2njcDpC.js → gateway-startup-retry-C-fRlHCL.js} +1 -1
- package/dist/gateway/static/root/assets/globe-DSSGFWFn.js +1 -0
- package/dist/gateway/static/root/assets/heartbeat-settings-B4A_CXUL.js +1 -0
- package/dist/gateway/static/root/assets/home-page-FVGYYPWo.js +3 -0
- package/dist/gateway/static/root/assets/index-CGbKTCST.js +152 -0
- package/dist/gateway/static/root/assets/index-CR233S0Q.css +1 -0
- package/dist/gateway/static/root/assets/interaction-BmQogeqz.js +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BQb06_jl.js → keyboard-shortcuts-settings-BD_TFz0_.js} +1 -1
- package/dist/gateway/static/root/assets/loader-circle-CifKLtgG.js +1 -0
- package/dist/gateway/static/root/assets/local-app-workbench-page-BNpkigNb.js +2 -0
- package/dist/gateway/static/root/assets/local-apps-page-BwbUeLfm.js +1 -0
- package/dist/gateway/static/root/assets/{locale-store-Bjvw7jtg.js → locale-store-xULEcFVs.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-DXP9OQQt.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-CW2VpqtT.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-split-Db-KrpOQ.js → markdown-split-B1M9KO16.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CHN66qs0.js → media-plugins-B_QlNdqZ.js} +1 -1
- package/dist/gateway/static/root/assets/messages-3qRsLZuX.js +3 -0
- package/dist/gateway/static/root/assets/{notes-page-CJtKZM0P.js → notes-page-BTbD4GmH.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-JRiq7QDW.js +4 -0
- package/dist/gateway/static/root/assets/page-tabs-BaEQMYm_.js +1 -0
- package/dist/gateway/static/root/assets/popover-select-BzdnTy3h.js +1 -0
- package/dist/gateway/static/root/assets/preview-open-alternatives-CeqtArlZ.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page--RnCc9bb.js → product-open-page-DnalBZZs.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-CjWA13aE.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-jsCkScbG.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-CGPJTEkM.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-Bg1W2__k.js → runtime-tools-settings-panel-cGkBEfg4.js} +4 -4
- package/dist/gateway/static/root/assets/schema-form-CmsrLlxu.js +1 -0
- package/dist/gateway/static/root/assets/sessions-page-BBHzziMd.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-2cGg8-9h.js +1 -0
- package/dist/gateway/static/root/assets/settings-form-draft-Dy10ldo8.js +1 -0
- package/dist/gateway/static/root/assets/settings-form-section-DUWCbaMJ.js +1 -0
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-BS36Mjzz.js → settings-loading-skeleton-Bvy5rdMY.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-BDSd7F9Y.js → settings-page-cZSAwsRR.js} +1 -1
- package/dist/gateway/static/root/assets/settings-page-layout-BRQNel6r.js +1 -0
- package/dist/gateway/static/root/assets/settings-shell-dialog-layer-BU3UuiJr.js +1 -0
- package/dist/gateway/static/root/assets/setup-status-panel-Cf06b66-.js +1 -0
- package/dist/gateway/static/root/assets/share-preview-page-BzA2NCAH.js +2 -0
- package/dist/gateway/static/root/assets/shares-settings-xlNKydYY.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-C5Xu93c_.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-Bvde7_i5.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-CnbJncdL.js → skills-page.utils-vXSqHR7g.js} +1 -1
- package/dist/gateway/static/root/assets/system-settings-panel-9cQGOGCK.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-Bkno4tTe.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-DtxpMC5S.js → theme-store-CHQRiuCF.js} +1 -1
- package/dist/gateway/static/root/assets/tool-activity-R8V9l6nk.js +1 -0
- package/dist/gateway/static/root/assets/typed-models-lib-q5-Vfqd8.js +1 -0
- package/dist/gateway/static/root/assets/use-autosave-7XfKULPI.js +1 -0
- package/dist/gateway/static/root/assets/user-context-page-CZ9m9aC_.js +1 -0
- package/dist/gateway/static/root/assets/voice-api-key-field-DXr21v-3.js +1 -0
- package/dist/gateway/static/root/assets/work-discovery-overlay-CeG7g_DZ.js +1 -0
- package/dist/gateway/static/root/assets/work-discovery-page-CQWZD03N.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BEmugHfL.js → workflow-run-setup-panel-DSQQZP9T.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-Cs-MXFJ1.js +5 -0
- package/dist/gateway/static/root/assets/working-directory-picker-modal-D-IgcHPp.js +1 -0
- package/dist/gateway/static/root/index.html +23 -8
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/tasks.js +54 -2
- package/dist/src/agent/agent-manager.d.ts +1 -0
- package/dist/src/agent/agent-manager.js +1 -0
- package/dist/src/agent/embedded/execution-context.d.ts +2 -0
- package/dist/src/agent/embedded/execution-context.js +11 -0
- package/dist/src/agent/embedded/index.d.ts +3 -1
- package/dist/src/agent/embedded/index.js +5 -3
- package/dist/src/agent/embedded/run-turn.js +15 -9
- package/dist/src/agent/embedded/session-runner.d.ts +6 -11
- package/dist/src/agent/embedded/session-runner.js +25 -36
- package/dist/src/agent/embedded/transcript-runtime.d.ts +35 -0
- package/dist/src/agent/embedded/transcript-runtime.js +66 -0
- package/dist/src/agent/embedded/types.d.ts +3 -1
- package/dist/src/agent/service.d.ts +15 -0
- package/dist/src/agent/service.js +31 -0
- package/dist/src/agent/service.types.d.ts +1 -0
- package/dist/src/agent/tools/factory.d.ts +2 -0
- package/dist/src/agent/tools/factory.js +2 -1
- package/dist/src/agent/tools/xopc-use-tool.d.ts +1 -0
- package/dist/src/agent/tools/xopc-use-tool.js +56 -6
- package/dist/src/automations/domain/validation.d.ts +40 -0
- package/dist/src/automations/draft/automation-draft-validator.d.ts +4 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/rules.js +2 -2
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/hono/app.d.ts +2 -0
- package/dist/src/gateway/hono/app.js +10 -3
- package/dist/src/gateway/hono/middleware/strict-rate-limit.d.ts +4 -0
- package/dist/src/gateway/hono/middleware/strict-rate-limit.js +8 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -1
- package/dist/src/gateway/hono/routes/config.js +9 -0
- package/dist/src/gateway/hono/routes/deps.d.ts +1 -0
- package/dist/src/gateway/hono/routes/home.d.ts +1 -1
- package/dist/src/gateway/hono/routes/home.js +2 -2
- package/dist/src/gateway/hono/routes/index.js +2 -0
- package/dist/src/gateway/hono/routes/projects.js +67 -1
- package/dist/src/gateway/hono/routes/side-chats.d.ts +3 -0
- package/dist/src/gateway/hono/routes/side-chats.js +173 -0
- package/dist/src/gateway/hono/routes/tasks.js +112 -19
- package/dist/src/gateway/host.d.ts +9 -1
- package/dist/src/gateway/host.js +22 -5
- package/dist/src/gateway/rate-limit/buckets.d.ts +3 -0
- package/dist/src/gateway/rate-limit/buckets.js +12 -0
- package/dist/src/gateway/runtime-config.js +6 -5
- package/dist/src/gateway/security/audit.js +0 -7
- package/dist/src/gateway/server.js +4 -1
- package/dist/src/gateway/service/agent-runner.d.ts +4 -0
- package/dist/src/gateway/service/agent-runner.js +15 -1
- package/dist/src/gateway/service/run-gateway-agent.js +1 -1
- package/dist/src/gateway/service.d.ts +5 -0
- package/dist/src/gateway/service.js +38 -8
- package/dist/src/gateway/side-chat/context-snapshot.d.ts +11 -0
- package/dist/src/gateway/side-chat/context-snapshot.js +108 -0
- package/dist/src/gateway/side-chat/index.d.ts +5 -0
- package/dist/src/gateway/side-chat/index.js +4 -0
- package/dist/src/gateway/side-chat/manager.d.ts +45 -0
- package/dist/src/gateway/side-chat/manager.js +198 -0
- package/dist/src/gateway/side-chat/run-service.d.ts +22 -0
- package/dist/src/gateway/side-chat/run-service.js +110 -0
- package/dist/src/gateway/side-chat/types.d.ts +61 -0
- package/dist/src/gateway/side-chat/types.js +1 -0
- package/dist/src/proactive/actions/service.d.ts +2 -0
- package/dist/src/proactive/actions/service.js +80 -0
- package/dist/src/proactive/execution/insight.js +20 -0
- package/dist/src/proactive/execution/repository.js +8 -2
- package/dist/src/proactive/execution/types.d.ts +14 -0
- package/dist/src/proactive/inbox/repository.js +59 -9
- package/dist/src/proactive/inbox/service.d.ts +2 -2
- package/dist/src/proactive/inbox/service.js +7 -2
- package/dist/src/proactive/inbox/types.d.ts +14 -0
- package/dist/src/proactive/inbox/worker.js +2 -0
- package/dist/src/proactive/scenarios/prompt-composer.js +2 -2
- package/dist/src/routing/session-key-utils.d.ts +0 -1
- package/dist/src/routing/session-key-utils.js +1 -6
- package/dist/src/routing/session-key.js +2 -2
- package/dist/src/storage/sqlite/migrations/118_task_board_rank.sql +6 -0
- package/dist/src/storage/sqlite/migrations/119_proactive_disposition.sql +13 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/tasks/home-query-service.d.ts +29 -0
- package/dist/src/tasks/home-query-service.js +291 -7
- package/dist/src/tasks/index.d.ts +1 -0
- package/dist/src/tasks/index.js +5 -4
- package/dist/src/tasks/project-monitoring-service.d.ts +9 -0
- package/dist/src/tasks/project-monitoring-service.js +41 -3
- package/dist/src/tasks/project-operating-view-service.d.ts +2 -2
- package/dist/src/tasks/project-operating-view-service.js +47 -21
- package/dist/src/tasks/task-application-service.js +99 -6
- package/dist/src/tasks/task-change-events.d.ts +13 -0
- package/dist/src/tasks/task-change-events.js +29 -0
- package/dist/src/tasks/task-read-model-projector.js +2 -1
- package/dist/src/tasks/task-repository.d.ts +7 -0
- package/dist/src/tasks/task-repository.js +29 -6
- package/dist/src/tunnel/enable-lan-pairing.js +15 -26
- package/dist/src/tunnel/pair-context.js +1 -1
- package/dist/src/tunnel/pair-url.js +1 -1
- package/dist/src/tunnel/tunnel-qr.d.ts +0 -7
- package/dist/src/tunnel/tunnel-qr.js +2 -19
- package/package.json +4 -2
- package/dist/gateway/static/root/assets/agents-VoFNMGL3.js +0 -68
- package/dist/gateway/static/root/assets/app-management-settings-panel-vmuJ_Z6i.js +0 -1
- package/dist/gateway/static/root/assets/appearance-settings-BMlEoe-G.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-CsNB6mv_.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-CW1YWgiX.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-BMTmGMM6.js +0 -8
- package/dist/gateway/static/root/assets/browser-workflow-inputs-BsmHy0ks.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-C5l85__e.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-9T2KXAs1.js +0 -3
- package/dist/gateway/static/root/assets/channels-settings-DquD4BPQ.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-DPaJSYX_.js +0 -1
- package/dist/gateway/static/root/assets/connectors-api-BC-4ftOM.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-7zUxVHQg.js +0 -2
- package/dist/gateway/static/root/assets/cron-expression-BycQlU8Q.js +0 -2
- package/dist/gateway/static/root/assets/dependency-picker-BvYqHRz0.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-DStgPb82.js +0 -1
- package/dist/gateway/static/root/assets/directory-picker-path-field-DUUr9sq0.js +0 -1
- package/dist/gateway/static/root/assets/extension-settings-page-BcSKEU8s.js +0 -1
- package/dist/gateway/static/root/assets/gateway-config-api-C-MmtCc7.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-CuaRDWbg.js +0 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-Dm8TrfGa.js +0 -1
- package/dist/gateway/static/root/assets/home-page-BYhDbUvI.js +0 -3
- package/dist/gateway/static/root/assets/index-BzPwnXho.js +0 -150
- package/dist/gateway/static/root/assets/index-CFFYvilx.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CHk4x0kR.js +0 -2
- package/dist/gateway/static/root/assets/local-apps-page-DQtsxjGs.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-CDqIY72S.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-D7itDEHl.js +0 -1
- package/dist/gateway/static/root/assets/messages-DQ5X6cXp.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-epHGeKd5.js +0 -4
- package/dist/gateway/static/root/assets/page-tabs-HXweXqYE.js +0 -1
- package/dist/gateway/static/root/assets/preview-open-alternatives-Dob6Oe2l.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-BxOD5-zj.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-D-9AhrH5.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CSUNXLKM.js +0 -1
- package/dist/gateway/static/root/assets/schema-form-BI4rVt3u.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-BxOUBMca.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DAvTIbgw.js +0 -1
- package/dist/gateway/static/root/assets/settings-form-section-C7rzhi7x.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-layout-CTMmZcwj.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-D1v-2Ci-.js +0 -1
- package/dist/gateway/static/root/assets/share-preview-page-BeCxg6eb.js +0 -2
- package/dist/gateway/static/root/assets/shares-settings-CXL1EldF.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-BxwkKgVw.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-CyfjEM4D.js +0 -2
- package/dist/gateway/static/root/assets/system-settings-panel-CAv0Yk0Y.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-DGTVJs_N.js +0 -1
- package/dist/gateway/static/root/assets/typed-models-lib-DomX3Szl.js +0 -1
- package/dist/gateway/static/root/assets/use-autosave-BLc4gfG0.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-C2kQENTK.js +0 -1
- package/dist/gateway/static/root/assets/voice-api-key-field-BijmpPjb.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-overlay-D7w2JFFq.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-XtoPgPUS.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-D_K2xOWq.js +0 -5
- package/dist/src/gateway/ensure-network-cors.d.ts +0 -3
- package/dist/src/gateway/ensure-network-cors.js +0 -23
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{d as i,f as a,l as o,t as s}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{t as c}from"./cn-JdwAhgNB.js";import{t as l}from"./messages-DQ5X6cXp.js";import{l as u,n as d}from"./locale-store-Bjvw7jtg.js";import{i as f}from"./theme-store-DtxpMC5S.js";import{i as p}from"./vendor-swr-BIWyz7Rc.js";import{$c as m,$i as h,$o as g,Ar as _,Au as v,Bo as y,Bs as b,Cl as x,Cr as S,Cs as C,D as w,Dr as T,Ds as E,En as D,Er as O,Eu as k,Fo as A,Ft as j,Go as M,Ha as N,Hc as P,Il as F,Io as I,Is as L,Ll as R,Lo as z,Ls as ee,Na as B,Ns as te,Nt as V,O as ne,Oc as re,Ol as ie,Or as H,Os as ae,Pl as U,Qo as W,Qs as G,Ro as oe,Sc as se,Si as K,Sr as ce,Ss as le,Ta as ue,Ti as de,Tn as fe,Tr as pe,Ua as me,Vo as he,Vs as ge,Zo as _e,_i as ve,_r as ye,_s as be,aa as xe,as as Se,bi as Ce,br as we,cc as Te,cs as Ee,dc as De,ea as Oe,ec as q,el as ke,gi as Ae,gr as je,gu as Me,hc as Ne,hu as Pe,ia as Fe,is as Ie,jr as Le,kr as Re,ls as ze,n as Be,na as Ve,nc as He,oa as J,ol as Ue,qo as We,r as Ge,ra as Ke,rs as qe,sa as Je,ss as Ye,ta as Xe,us as Ze,vi as Y,vr as Qe,vs as $e,wr as et,ws as X,xi as tt,xo as nt,xr as rt,xu as it,yc as at,yi as ot,yr as st,yu as ct,zo as lt}from"./index-BzPwnXho.js";import{t as ut}from"./markdown-editor-TWGaF7Xa.js";import{n as dt,r as ft}from"./settings-page-layout-CTMmZcwj.js";import{r as pt,t as mt}from"./settings-loading-skeleton-BS36Mjzz.js";import{n as ht,t as gt}from"./use-autosave-BLc4gfG0.js";import{n as _t,t as vt}from"./settings-form-section-C7rzhi7x.js";import{t as yt}from"./page-tabs-HXweXqYE.js";import{n as bt}from"./agent-avatar-dicebear-B1oxPli_.js";import{c as xt,i as St,s as Ct}from"./capability-presets-api-BoOzFotX.js";import{a as wt,i as Tt,n as Et,o as Dt,s as Ot,t as kt}from"./typed-models-lib-DomX3Szl.js";import{n as At,r as jt,t as Mt}from"./channel-recipient-api-_8IiTxRB.js";import{t as Nt}from"./directory-picker-path-field-DUUr9sq0.js";var Z=n(),Q=r();function Pt(e){let t=(0,Z.c)(40),{open:n,onOpenChange:r,busy:i,deletePurge:a,deleteTarget:o,deleteConfirmText:s,onDeleteConfirmTextChange:l,onConfirm:u,onCancel:d,a:f}=e,p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(lt,{className:`fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),t[0]=p):p=t[0];let m;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(m=c(`fixed left-1/2 top-1/2 z-[81] w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2 rounded-xl border border-edge bg-surface-panel p-4 shadow-popover`,`dark:border-edge`),t[1]=m):m=t[1];let h=a?f.purgeDisk:f.removeFromConfig,g;t[2]===h?g=t[3]:(g=(0,Q.jsx)(he,{className:`text-base font-semibold text-fg`,children:h}),t[2]=h,t[3]=g);let _=a?f.confirmDeletePurge:f.confirmDelete,v;t[4]===_?v=t[5]:(v=(0,Q.jsx)(oe,{className:`mt-2 whitespace-pre-wrap text-sm leading-relaxed text-fg-muted`,children:_}),t[4]=_,t[5]=v);let b;t[6]!==f.purgeConfirmHint||t[7]!==f.purgeConfirmLabel||t[8]!==f.purgeConfirmPlaceholder||t[9]!==s||t[10]!==a||t[11]!==o||t[12]!==l?(b=a&&o?(0,Q.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,Q.jsx)(`label`,{className:`mb-2 block text-sm font-medium text-fg`,htmlFor:`agent-delete-confirm`,children:f.purgeConfirmLabel}),(0,Q.jsx)(`input`,{id:`agent-delete-confirm`,type:`text`,autoComplete:`off`,spellCheck:!1,className:c(`w-full rounded-md border border-edge bg-surface-panel px-3 py-1.5 font-mono text-xs text-fg`,`placeholder:text-fg-subtle`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`dark:border-edge`),placeholder:f.purgeConfirmPlaceholder.replace(`{{agentId}}`,o.id),value:s,onChange:e=>l(e.target.value)}),(0,Q.jsx)(`p`,{className:`pt-0.5 text-xs text-fg-muted`,children:f.purgeConfirmHint.replace(`{{agentId}}`,o.id)})]}):null,t[6]=f.purgeConfirmHint,t[7]=f.purgeConfirmLabel,t[8]=f.purgeConfirmPlaceholder,t[9]=s,t[10]=a,t[11]=o,t[12]=l,t[13]=b):b=t[13];let x;t[14]!==f.createModalCancel||t[15]!==i||t[16]!==d?(x=(0,Q.jsx)(X,{type:`button`,variant:`ghost`,disabled:i,onClick:d,children:f.createModalCancel}),t[14]=f.createModalCancel,t[15]=i,t[16]=d,t[17]=x):x=t[17];let S=a?`border-red-200 text-red-700 hover:bg-red-50 dark:border-red-900/60 dark:text-red-300 dark:hover:bg-red-950/40`:void 0,C;t[18]!==i||t[19]!==s||t[20]!==a||t[21]!==o?(C=i||!o||a&&s.trim().toLowerCase()!==o.id.toLowerCase(),t[18]=i,t[19]=s,t[20]=a,t[21]=o,t[22]=C):C=t[22];let w=a?f.purgeDisk:f.removeFromConfig,T;t[23]!==u||t[24]!==C||t[25]!==w||t[26]!==S?(T=(0,Q.jsx)(X,{type:`button`,variant:`secondary`,className:S,disabled:C,onClick:u,children:w}),t[23]=u,t[24]=C,t[25]=w,t[26]=S,t[27]=T):T=t[27];let E;t[28]!==T||t[29]!==x?(E=(0,Q.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-end gap-2 border-t border-edge-subtle/60 pt-3`,children:[x,T]}),t[28]=T,t[29]=x,t[30]=E):E=t[30];let D;t[31]!==E||t[32]!==g||t[33]!==v||t[34]!==b?(D=(0,Q.jsxs)(y,{children:[p,(0,Q.jsxs)(z,{className:m,onOpenAutoFocus:Ft,children:[g,v,b,E]})]}),t[31]=E,t[32]=g,t[33]=v,t[34]=b,t[35]=D):D=t[35];let O;return t[36]!==r||t[37]!==n||t[38]!==D?(O=(0,Q.jsx)(A,{open:n,onOpenChange:r,children:D}),t[36]=r,t[37]=n,t[38]=D,t[39]=O):O=t[39],O}function Ft(e){return e.preventDefault()}var $=e(t(),1),It=[{id:`overview`,labelKey:`navOverview`,icon:x},{id:`profile`,labelKey:`navProfile`,icon:q},{id:`capabilities`,labelKey:`navCapabilities`,icon:ct},{id:`runtime`,labelKey:`navRuntime`,icon:Te},{id:`connections`,labelKey:`navConnections`,icon:Pe},{id:`advanced`,labelKey:`navAdvanced`,icon:He},{id:`dangerZone`,labelKey:`navDangerZone`,icon:b}];function Lt(e){let t=(0,Z.c)(11),{a:n,panel:r,onPanelChange:i}=e,a;t[0]!==i||t[1]!==r?(a=(e,t,n)=>(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>i(e),className:c(`flex w-auto shrink-0 items-center gap-2.5 rounded-lg px-3 py-2 text-left text-sm font-medium transition-colors sm:w-full`,$e.press,r===e?`bg-accent-soft text-accent-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`),children:[(0,Q.jsx)(n,{className:`size-4 shrink-0 opacity-90`,strokeWidth:2,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`min-w-0 truncate`,children:t})]},e),t[0]=i,t[1]=r,t[2]=a):a=t[2];let o=a,s=n.editorNavAria,l;t[3]!==n||t[4]!==o?(l=It.map(e=>{let{id:t,labelKey:r,icon:i}=e;return o(t,n[r],i)}),t[3]=n,t[4]=o,t[5]=l):l=t[5];let u;t[6]===l?u=t[7]:(u=(0,Q.jsx)(`div`,{className:`flex gap-1 pb-1 sm:flex-col sm:gap-0.5 sm:pb-0`,children:l}),t[6]=l,t[7]=u);let d;return t[8]!==n.editorNavAria||t[9]!==u?(d=(0,Q.jsx)(`nav`,{className:`w-full overflow-x-auto sm:overflow-visible`,"aria-label":s,children:u}),t[8]=n.editorNavAria,t[9]=u,t[10]=d):d=t[10],d}function Rt(e){let t=(0,Z.c)(33),{open:n,onOpenChange:r,a:i,title:a,subtitle:o,panel:s,onPanelChange:l,children:u}=e,[d,f]=(0,$.useState)(null),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(lt,{className:c(`xopc-dialog-overlay fixed inset-0 bg-scrim`,Ie)}),t[0]=p):p=t[0];let m;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(m=c(`xopc-dialog-content fixed flex flex-col overflow-hidden rounded-xl border border-edge bg-surface-panel shadow-popover dark:border-edge`,qe,`inset-4 h-[calc(100dvh-2rem)] max-h-[calc(100dvh-2rem)] min-h-0`,`sm:inset-auto sm:left-1/2 sm:top-1/2 sm:h-[min(88vh,48rem)] sm:max-h-[min(88vh,48rem)] sm:min-h-[32rem] sm:w-[min(100%-2rem,58rem)] sm:-translate-x-1/2 sm:-translate-y-1/2`),t[1]=m):m=t[1];let h;t[2]===a?h=t[3]:(h=(0,Q.jsx)(he,{className:`text-base font-semibold leading-snug text-fg`,children:a}),t[2]=a,t[3]=h);let _;t[4]===o?_=t[5]:(_=(0,Q.jsx)(oe,{className:`mt-1 font-mono text-xs text-fg-muted`,children:o}),t[4]=o,t[5]=_);let v;t[6]!==h||t[7]!==_?(v=(0,Q.jsxs)(`div`,{className:`min-w-0 pr-2`,children:[h,_]}),t[6]=h,t[7]=_,t[8]=v):v=t[8];let b;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(b=c(be,`shrink-0 p-1.5 hover:bg-surface-base`),t[9]=b):b=t[9];let x;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Q.jsx)(E,{className:`size-4`,"aria-hidden":!0}),t[10]=x):x=t[10];let S;t[11]===i.closeDialogAria?S=t[12]:(S=(0,Q.jsx)(I,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,className:b,"aria-label":i.closeDialogAria,children:x})}),t[11]=i.closeDialogAria,t[12]=S);let C;t[13]!==v||t[14]!==S?(C=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-2 border-b border-edge-subtle px-4 pb-3 pt-4 dark:border-edge`,children:[v,S]}),t[13]=v,t[14]=S,t[15]=C):C=t[15];let w;t[16]!==i||t[17]!==l||t[18]!==s?(w=(0,Q.jsx)(`div`,{className:`shrink-0 border-b border-edge-subtle px-4 py-3 dark:border-edge sm:flex sm:w-56 sm:shrink-0 sm:flex-col sm:overflow-y-auto sm:border-b-0 sm:border-r sm:px-0 sm:py-4 sm:pl-4 sm:pr-3`,children:(0,Q.jsx)(Lt,{a:i,panel:s,onPanelChange:l})}),t[16]=i,t[17]=l,t[18]=s,t[19]=w):w=t[19];let T;t[20]===u?T=t[21]:(T=(0,Q.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden p-4 sm:pl-2 sm:pr-5`,children:u})}),t[20]=u,t[21]=T);let D;t[22]!==T||t[23]!==w?(D=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col sm:flex-row sm:overflow-hidden`,children:[w,T]}),t[22]=T,t[23]=w,t[24]=D):D=t[24];let O;t[25]!==d||t[26]!==D||t[27]!==C?(O=(0,Q.jsxs)(y,{children:[p,(0,Q.jsx)(z,{ref:f,className:m,onOpenAutoFocus:zt,children:(0,Q.jsxs)(g,{layer:`modal`,portalContainer:d,children:[C,D]})})]}),t[25]=d,t[26]=D,t[27]=C,t[28]=O):O=t[28];let k;return t[29]!==r||t[30]!==n||t[31]!==O?(k=(0,Q.jsx)(A,{open:n,onOpenChange:r,children:O}),t[29]=r,t[30]=n,t[31]=O,t[32]=k):k=t[32],k}function zt(e){return e.preventDefault()}function Bt(e){let t=(0,Z.c)(28),{label:n,mode:r,value:i,inheritedFrom:a,inheritLabel:o,overrideLabel:s,onClick:l}=e,u;t[0]===n?u=t[1]:(u=(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-fg-subtle`,children:n}),t[0]=n,t[1]=u);let d=i||`—`,f;t[2]===d?f=t[3]:(f=(0,Q.jsx)(`p`,{className:`mt-1 truncate text-sm font-medium text-fg`,children:d}),t[2]=d,t[3]=f);let p;t[4]!==a||t[5]!==r?(p=r===`inherit`&&a?(0,Q.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-fg-muted`,children:a}):null,t[4]=a,t[5]=r,t[6]=p):p=t[6];let m;t[7]!==u||t[8]!==f||t[9]!==p?(m=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[u,f,p]}),t[7]=u,t[8]=f,t[9]=p,t[10]=m):m=t[10];let h=r===`inherit`?`bg-surface-hover text-fg-muted`:`bg-accent-soft text-accent-fg`,g;t[11]===h?g=t[12]:(g=c(`mt-2 inline-flex shrink-0 self-start rounded-full px-2.5 py-0.5 text-xs font-medium sm:mt-0`,h),t[11]=h,t[12]=g);let _=r===`inherit`?o:s,v;t[13]!==g||t[14]!==_?(v=(0,Q.jsx)(`span`,{className:g,children:_}),t[13]=g,t[14]=_,t[15]=v):v=t[15];let y;t[16]!==m||t[17]!==v?(y=(0,Q.jsxs)(Q.Fragment,{children:[m,v]}),t[16]=m,t[17]=v,t[18]=y):y=t[18];let b=y,x=l?`w-full text-left transition-colors hover:bg-surface-hover/45 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40 active:scale-[0.995] motion-reduce:active:scale-100`:void 0,S;t[19]===x?S=t[20]:(S=c(`flex flex-col gap-1 rounded-xl bg-surface-panel/80 px-4 py-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,x),t[19]=x,t[20]=S);let C=S;if(l){let e;return t[21]!==C||t[22]!==b||t[23]!==l?(e=(0,Q.jsx)(`button`,{type:`button`,className:C,onClick:l,children:b}),t[21]=C,t[22]=b,t[23]=l,t[24]=e):e=t[24],e}let w;return t[25]!==C||t[26]!==b?(w=(0,Q.jsx)(`div`,{className:C,children:b}),t[25]=C,t[26]=b,t[27]=w):w=t[27],w}function Vt(e){let t=(0,Z.c)(38),{a:n,defaultModel:r,defaultWorkspace:i,agentModel:a,agentWorkspace:o,onEditModelStrategy:s,onEditWorkspace:c}=e,l=n.inheritance,u;t[0]===a?u=t[1]:(u=a.trim(),t[0]=a,t[1]=u);let d=!u,f;t[2]!==o||t[3]!==i?(f=!o.trim()||i.trim().length>0&&o.trim()===i.trim(),t[2]=o,t[3]=i,t[4]=f):f=t[4];let p=f,m=d?r||l.unset:a,h=p?i||l.unset:o,g;t[5]!==l.subtitle||t[6]!==l.title?(g=(0,Q.jsx)(_t,{icon:ke,title:l.title,subtitle:l.subtitle}),t[5]=l.subtitle,t[6]=l.title,t[7]=g):g=t[7];let _=d?`inherit`:`override`,v;t[8]!==r||t[9]!==l.inheritsValue||t[10]!==d?(v=d&&r?l.inheritsValue.replace(`{{value}}`,r):void 0,t[8]=r,t[9]=l.inheritsValue,t[10]=d,t[11]=v):v=t[11];let y;t[12]!==m||t[13]!==l.badgeInherit||t[14]!==l.badgeOverride||t[15]!==l.modelLabel||t[16]!==s||t[17]!==_||t[18]!==v?(y=(0,Q.jsx)(Bt,{label:l.modelLabel,mode:_,value:m,inheritedFrom:v,inheritLabel:l.badgeInherit,overrideLabel:l.badgeOverride,onClick:s}),t[12]=m,t[13]=l.badgeInherit,t[14]=l.badgeOverride,t[15]=l.modelLabel,t[16]=s,t[17]=_,t[18]=v,t[19]=y):y=t[19];let b=p?`inherit`:`override`,x;t[20]!==i||t[21]!==l.inheritsValue||t[22]!==p?(x=p&&i?l.inheritsValue.replace(`{{value}}`,i):void 0,t[20]=i,t[21]=l.inheritsValue,t[22]=p,t[23]=x):x=t[23];let S;t[24]!==h||t[25]!==l.badgeInherit||t[26]!==l.badgeOverride||t[27]!==l.workspaceLabel||t[28]!==c||t[29]!==b||t[30]!==x?(S=(0,Q.jsx)(Bt,{label:l.workspaceLabel,mode:b,value:h,inheritedFrom:x,inheritLabel:l.badgeInherit,overrideLabel:l.badgeOverride,onClick:c}),t[24]=h,t[25]=l.badgeInherit,t[26]=l.badgeOverride,t[27]=l.workspaceLabel,t[28]=c,t[29]=b,t[30]=x,t[31]=S):S=t[31];let C;t[32]!==y||t[33]!==S?(C=(0,Q.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[y,S]}),t[32]=y,t[33]=S,t[34]=C):C=t[34];let w;return t[35]!==g||t[36]!==C?(w=(0,Q.jsxs)(vt,{children:[g,C]}),t[35]=g,t[36]=C,t[37]=w):w=t[37],w}function Ht(e,t){for(let n of t){let t=e[n];if(t)return t}return`default`}function Ut(e){let t=(0,Z.c)(5),{source:n}=e,r;if(t[0]!==n){let e=n.startsWith(`preset:`),i=n.startsWith(`agent:`);r=c(`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium`,e&&`bg-accent/10 text-accent`,i&&`bg-surface-base text-fg-muted`,!e&&!i&&`bg-surface-panel text-fg-subtle`),t[0]=n,t[1]=r}else r=t[1];let i;return t[2]!==n||t[3]!==r?(i=(0,Q.jsx)(`span`,{className:r,children:n}),t[2]=n,t[3]=r,t[4]=i):i=t[4],i}function Wt(e){let t=(0,Z.c)(13),n;t[0]===e.name?n=t[1]:(n=(0,Q.jsx)(`div`,{className:`min-w-0 truncate font-mono text-xs font-medium text-fg`,children:e.name}),t[0]=e.name,t[1]=n);let r=e.monoValue&&`font-mono text-xs`,i;t[2]===r?i=t[3]:(i=c(`min-w-0 truncate text-sm text-fg`,r),t[2]=r,t[3]=i);let a;t[4]!==e.value||t[5]!==i?(a=(0,Q.jsx)(`div`,{className:i,children:e.value}),t[4]=e.value,t[5]=i,t[6]=a):a=t[6];let o;t[7]===e.source?o=t[8]:(o=(0,Q.jsx)(Ut,{source:e.source}),t[7]=e.source,t[8]=o);let s;return t[9]!==n||t[10]!==a||t[11]!==o?(s=(0,Q.jsxs)(`div`,{className:`grid gap-2 rounded-lg bg-surface-panel/80 px-3 py-2 shadow-surface sm:grid-cols-[minmax(0,10rem)_minmax(0,1fr)_auto] sm:items-center`,children:[n,a,o]}),t[9]=n,t[10]=a,t[11]=o,t[12]=s):s=t[12],s}function Gt(e,t){return e&&e.length>0?e.join(`, `):t}function Kt(e){let t=(0,Z.c)(39),{a:n,selected:r}=e,i;t[0]===r.id?i=t[1]:(i=r.id?[`agent-effective-manifest`,r.id]:null,t[0]=r.id,t[1]=i);let a;t[2]===r.id?a=t[3]:(a=()=>S(r.id),t[2]=r.id,t[3]=a);let o;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(o={revalidateOnFocus:!1},t[4]=o):o=t[4];let{data:s,error:c,isLoading:l}=p(i,a,o),u=s?.manifest,d;t[5]!==s?.presetChain||t[6]!==u?.extends?(d=s?.presetChain??u?.extends??[],t[5]=s?.presetChain,t[6]=u?.extends,t[7]=d):d=t[7];let f=d,h;if(t[8]!==n.effectiveBoundariesTitle||t[9]!==n.effectiveEmpty||t[10]!==n.effectiveError||t[11]!==n.effectiveHint||t[12]!==n.effectiveLoading||t[13]!==n.effectiveLocksTitle||t[14]!==n.effectiveModelsTitle||t[15]!==n.effectiveNoLocks||t[16]!==n.effectiveNoOverrides||t[17]!==n.effectiveNoPresets||t[18]!==n.effectiveNoToolPolicies||t[19]!==n.effectiveOverridesTitle||t[20]!==n.effectivePresetChain||t[21]!==n.effectiveSkillsTitle||t[22]!==n.effectiveTitle||t[23]!==n.effectiveToolsTitle||t[24]!==s?.locks||t[25]!==s?.overrides||t[26]!==s?.sources||t[27]!==c||t[28]!==l||t[29]!==u||t[30]!==f){let e=s?.sources??{},r=Object.entries(u?.models?.roles??{}).sort(Xt),i=Object.entries(u?.tools?.builtin??{}).sort(Yt),a=u?.skills,o=u?.boundaries,d;t[32]===s?.overrides?d=t[33]:(d=s?.overrides??[],t[32]=s?.overrides,t[33]=d);let p=d,g;t[34]===s?.locks?g=t[35]:(g=s?.locks??[],t[34]=s?.locks,t[35]=g);let _=g,v;t[36]!==n.effectiveHint||t[37]!==n.effectiveTitle?(v=(0,Q.jsx)(_t,{icon:m,title:n.effectiveTitle,subtitle:n.effectiveHint}),t[36]=n.effectiveHint,t[37]=n.effectiveTitle,t[38]=v):v=t[38],h=(0,Q.jsxs)(vt,{children:[v,l?(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.effectiveLoading}):c?(0,Q.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:c instanceof Error?c.message:n.effectiveError}):u?(0,Q.jsx)(`div`,{children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:n.effectivePresetChain}),(0,Q.jsx)(`div`,{className:`rounded-lg bg-surface-panel/80 px-3 py-2 text-sm text-fg shadow-surface`,children:f.length?f.join(` -> `):n.effectiveNoPresets})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:n.effectiveOverridesTitle}),p.length>0?(0,Q.jsx)(`div`,{className:`flex flex-col gap-2`,children:p.map(Jt)}):(0,Q.jsx)(`p`,{className:`rounded-lg bg-surface-panel/60 px-3 py-2 text-sm text-fg-muted shadow-surface`,children:n.effectiveNoOverrides})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:n.effectiveLocksTitle}),_.length>0?(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:_.map(qt)}):(0,Q.jsx)(`p`,{className:`rounded-lg bg-surface-panel/60 px-3 py-2 text-sm text-fg-muted shadow-surface`,children:n.effectiveNoLocks})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:n.effectiveModelsTitle}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(Wt,{name:`defaultRole`,value:u.models?.defaultRole??`—`,source:Ht(e,[`models.defaultRole`])}),r.map(t=>{let[n,r]=t;return(0,Q.jsx)(Wt,{name:n,value:r.model,monoValue:!0,source:Ht(e,[`models.roles.${n}.model`,`models.roles.${n}`])},n)})]})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:n.effectiveToolsTitle}),i.length>0?(0,Q.jsx)(`div`,{className:`flex flex-col gap-2`,children:i.map(t=>{let[n,r]=t;return(0,Q.jsx)(Wt,{name:n,value:r.mode,source:Ht(e,[`tools.builtin.${n}.mode`,`tools.builtin.${n}`])},n)})}):(0,Q.jsx)(`p`,{className:`rounded-lg bg-surface-panel/60 px-3 py-2 text-sm text-fg-muted shadow-surface`,children:n.effectiveNoToolPolicies})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:n.effectiveSkillsTitle}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(Wt,{name:`mode`,value:a?.mode??`all`,source:Ht(e,[`skills.mode`,`skills`])}),a?.mode===`allowlist`?(0,Q.jsx)(Wt,{name:`allow`,value:Gt(a.allow,`—`),source:Ht(e,[`skills.allow`,`skills`])}):null,a?.mode===`denylist`?(0,Q.jsx)(Wt,{name:`deny`,value:Gt(a.deny,`—`),source:Ht(e,[`skills.deny`,`skills`])}):null]})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:n.effectiveBoundariesTitle}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(Wt,{name:`requiresConfirmation`,value:Gt(o?.requiresConfirmation,`—`),source:Ht(e,[`boundaries.requiresConfirmation`,`boundaries`])}),(0,Q.jsx)(Wt,{name:`forbidden`,value:Gt(o?.forbidden,`—`),source:Ht(e,[`boundaries.forbidden`,`boundaries`])}),(0,Q.jsx)(Wt,{name:`escalation`,value:Gt(o?.escalation,`—`),source:Ht(e,[`boundaries.escalation`,`boundaries`])})]})]})]})}):(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.effectiveEmpty})]}),t[8]=n.effectiveBoundariesTitle,t[9]=n.effectiveEmpty,t[10]=n.effectiveError,t[11]=n.effectiveHint,t[12]=n.effectiveLoading,t[13]=n.effectiveLocksTitle,t[14]=n.effectiveModelsTitle,t[15]=n.effectiveNoLocks,t[16]=n.effectiveNoOverrides,t[17]=n.effectiveNoPresets,t[18]=n.effectiveNoToolPolicies,t[19]=n.effectiveOverridesTitle,t[20]=n.effectivePresetChain,t[21]=n.effectiveSkillsTitle,t[22]=n.effectiveTitle,t[23]=n.effectiveToolsTitle,t[24]=s?.locks,t[25]=s?.overrides,t[26]=s?.sources,t[27]=c,t[28]=l,t[29]=u,t[30]=f,t[31]=h}else h=t[31];return h}function qt(e){return(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-panel px-2.5 py-1 font-mono text-xs text-fg-muted shadow-surface`,children:e},e)}function Jt(e,t){return(0,Q.jsxs)(`div`,{className:`grid gap-1 rounded-lg bg-surface-panel/80 px-3 py-2 text-xs shadow-surface sm:grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] sm:items-center`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`div`,{className:`truncate font-mono font-medium text-fg`,children:e.path}),(0,Q.jsx)(`div`,{className:`mt-1 truncate text-fg-muted`,children:e.from})]}),(0,Q.jsx)(`span`,{className:`text-fg-subtle`,"aria-hidden":!0,children:`→`}),(0,Q.jsx)(`div`,{className:`truncate text-fg-muted sm:text-right`,children:e.to})]},`${e.path}-${e.from}-${e.to}-${t}`)}function Yt(e,t){let[n]=e,[r]=t;return n.localeCompare(r)}function Xt(e,t){let[n]=e,[r]=t;return n.localeCompare(r)}function Zt(e){let t=(0,Z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain pr-1`,children:(0,Q.jsx)(`div`,{className:`mx-auto flex w-full max-w-3xl flex-col gap-5 pb-6`,children:n})}),t[0]=n,t[1]=r),r}function Qt(e){let t=(0,Z.c)(4),{active:n,children:r,onClick:i}=e,a=n?`rounded-md bg-accent-soft px-3 py-1.5 text-sm font-medium text-accent-fg`:`rounded-md px-3 py-1.5 text-sm font-medium text-fg-muted hover:bg-surface-hover hover:text-fg`,o;return t[0]!==r||t[1]!==i||t[2]!==a?(o=(0,Q.jsx)(`button`,{type:`button`,onClick:i,className:a,children:r}),t[0]=r,t[1]=i,t[2]=a,t[3]=o):o=t[3],o}function $t(e){let t=(0,Z.c)(41),{a:n,selected:r,busy:i,defaultModel:a,defaultWorkspace:o,agentModel:s,agentWorkspace:c,capabilityPresets:l,defaultPresetId:u,onUpdateAgentExtends:d,onOpenCapabilityPreset:f}=e,[p,m]=(0,$.useState)(`sources`),h=p===`sources`,g;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>m(`sources`),t[0]=g):g=t[0];let _;t[1]!==n.configSubtabSources||t[2]!==h?(_=(0,Q.jsx)(Qt,{active:h,onClick:g,children:n.configSubtabSources}),t[1]=n.configSubtabSources,t[2]=h,t[3]=_):_=t[3];let v=p===`shared`,y;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>m(`shared`),t[4]=y):y=t[4];let b;t[5]!==n.configSubtabShared||t[6]!==v?(b=(0,Q.jsx)(Qt,{active:v,onClick:y,children:n.configSubtabShared}),t[5]=n.configSubtabShared,t[6]=v,t[7]=b):b=t[7];let x=p===`effective`,S;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>m(`effective`),t[8]=S):S=t[8];let C;t[9]!==n.configSubtabEffective||t[10]!==x?(C=(0,Q.jsx)(Qt,{active:x,onClick:S,children:n.configSubtabEffective}),t[9]=n.configSubtabEffective,t[10]=x,t[11]=C):C=t[11];let w;t[12]!==_||t[13]!==b||t[14]!==C?(w=(0,Q.jsx)(`div`,{className:`shrink-0 rounded-lg border border-edge bg-surface-panel p-1`,children:(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[_,b,C]})}),t[12]=_,t[13]=b,t[14]=C,t[15]=w):w=t[15];let T;t[16]!==n||t[17]!==s||t[18]!==c||t[19]!==a||t[20]!==o||t[21]!==p?(T=p===`sources`?(0,Q.jsx)(en,{a:n,defaultModel:a,defaultWorkspace:o,agentModel:s,agentWorkspace:c}):null,t[16]=n,t[17]=s,t[18]=c,t[19]=a,t[20]=o,t[21]=p,t[22]=T):T=t[22];let E;t[23]!==n||t[24]!==i||t[25]!==l||t[26]!==u||t[27]!==f||t[28]!==d||t[29]!==r||t[30]!==p?(E=p===`shared`?(0,Q.jsx)(tn,{a:n,selected:r,busy:i,capabilityPresets:l,defaultPresetId:u,onUpdateAgentExtends:d,onOpenCapabilityPreset:f}):null,t[23]=n,t[24]=i,t[25]=l,t[26]=u,t[27]=f,t[28]=d,t[29]=r,t[30]=p,t[31]=E):E=t[31];let D;t[32]!==n||t[33]!==r||t[34]!==p?(D=p===`effective`?(0,Q.jsx)(an,{a:n,selected:r}):null,t[32]=n,t[33]=r,t[34]=p,t[35]=D):D=t[35];let O;return t[36]!==w||t[37]!==T||t[38]!==E||t[39]!==D?(O=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-hidden`,children:[w,T,E,D]}),t[36]=w,t[37]=T,t[38]=E,t[39]=D,t[40]=O):O=t[40],O}function en(e){let t=(0,Z.c)(7),{a:n,defaultModel:r,defaultWorkspace:i,agentModel:a,agentWorkspace:o,onEditWorkspace:s}=e,c;return t[0]!==n||t[1]!==a||t[2]!==o||t[3]!==r||t[4]!==i||t[5]!==s?(c=(0,Q.jsx)(Zt,{children:(0,Q.jsx)(Vt,{a:n,defaultModel:r,defaultWorkspace:i,agentModel:a,agentWorkspace:o,onEditWorkspace:s})}),t[0]=n,t[1]=a,t[2]=o,t[3]=r,t[4]=i,t[5]=s,t[6]=c):c=t[6],c}function tn(e){let t=(0,Z.c)(72),{a:n,selected:r,busy:i,capabilityPresets:a,defaultPresetId:o,onUpdateAgentExtends:s,onOpenCapabilityPreset:c}=e,l=o===void 0?`default`:o,u;t[0]===a?u=t[1]:(u=new Map(a.map(rn)),t[0]=a,t[1]=u);let d=u,f;t[2]!==n.capabilityPresetsGlobalDefault||t[3]!==n.capabilityPresetsGlobalDefaultHint||t[4]!==l||t[5]!==d?(f=d.get(l)??{id:l,name:n.capabilityPresetsGlobalDefault,description:n.capabilityPresetsGlobalDefaultHint},t[2]=n.capabilityPresetsGlobalDefault,t[3]=n.capabilityPresetsGlobalDefaultHint,t[4]=l,t[5]=d,t[6]=f):f=t[6];let p=f,m,h,g,_,y;if(t[7]!==n.capabilityPresetAdd||t[8]!==n.capabilityPresetMoveDown||t[9]!==n.capabilityPresetMoveUp||t[10]!==n.capabilityPresetRemove||t[11]!==n.capabilityPresetsEmptyAdditional||t[12]!==n.capabilityPresetsGlobalDefault||t[13]!==n.capabilityPresetsGlobalDefaultHint||t[14]!==n.capabilityPresetsHint||t[15]!==n.capabilityPresetsManage||t[16]!==n.capabilityPresetsTitle||t[17]!==i||t[18]!==a||t[19]!==l||t[20]!==p.description||t[21]!==p.id||t[22]!==p.name||t[23]!==c||t[24]!==s||t[25]!==d||t[26]!==r.extends){let e;t[32]===l?e=t[33]:(e=e=>e!==l,t[32]=l,t[33]=e);let o=r.extends.filter(e),u=a.map(nn).filter(e=>e!==l&&!o.includes(e)),f=u[0]??``;h=Zt,m=vt;let b;t[34]===c?b=t[35]:(b=()=>c(``),t[34]=c,t[35]=b);let x;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Q.jsx)(R,{className:`size-3.5`,"aria-hidden":!0}),t[36]=x):x=t[36];let S;t[37]!==n.capabilityPresetsManage||t[38]!==i||t[39]!==b?(S=(0,Q.jsxs)(X,{type:`button`,variant:`secondary`,className:`text-xs`,disabled:i,onClick:b,children:[x,n.capabilityPresetsManage]}),t[37]=n.capabilityPresetsManage,t[38]=i,t[39]=b,t[40]=S):S=t[40],t[41]!==n.capabilityPresetsHint||t[42]!==n.capabilityPresetsTitle||t[43]!==S?(g=(0,Q.jsx)(_t,{icon:q,title:n.capabilityPresetsTitle,subtitle:n.capabilityPresetsHint,trailing:S}),t[41]=n.capabilityPresetsHint,t[42]=n.capabilityPresetsTitle,t[43]=S,t[44]=g):g=t[44];let C;t[45]!==p.id||t[46]!==c?(C=()=>c(p.id),t[45]=p.id,t[46]=c,t[47]=C):C=t[47];let w=p.name||n.capabilityPresetsGlobalDefault,T;t[48]===w?T=t[49]:(T=(0,Q.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:w}),t[48]=w,t[49]=T);let E;t[50]===n.capabilityPresetsGlobalDefault?E=t[51]:(E=(0,Q.jsx)(`span`,{className:`shrink-0 rounded-full bg-accent/10 px-2 py-0.5 text-[11px] font-medium text-accent`,children:n.capabilityPresetsGlobalDefault}),t[50]=n.capabilityPresetsGlobalDefault,t[51]=E);let D;t[52]!==T||t[53]!==E?(D=(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[T,E]}),t[52]=T,t[53]=E,t[54]=D):D=t[54];let O;t[55]===p.id?O=t[56]:(O=(0,Q.jsx)(`div`,{className:`mt-0.5 truncate font-mono text-[11px] text-fg-muted`,children:p.id}),t[55]=p.id,t[56]=O);let A=p.description||n.capabilityPresetsGlobalDefaultHint,j;t[57]===A?j=t[58]:(j=(0,Q.jsx)(`div`,{className:`mt-1 line-clamp-2 text-xs text-fg-muted`,children:A}),t[57]=A,t[58]=j);let M;t[59]!==C||t[60]!==D||t[61]!==O||t[62]!==j?(M=(0,Q.jsx)(`div`,{className:`flex flex-col gap-2 rounded-lg bg-accent-soft/20 px-3 py-2 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:(0,Q.jsxs)(`button`,{type:`button`,className:`min-w-0 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:C,children:[D,O,j]})}),t[59]=C,t[60]=D,t[61]=O,t[62]=j,t[63]=M):M=t[63],_=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[M,o.length>0?o.map((e,t)=>{let r=d.get(e);return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg bg-surface-panel/80 px-3 py-2 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,Q.jsxs)(`button`,{type:`button`,className:`min-w-0 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>c(e),children:[(0,Q.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:r?.name??e}),(0,Q.jsx)(`div`,{className:`mt-0.5 truncate font-mono text-[11px] text-fg-muted`,children:e}),r?.description?(0,Q.jsx)(`div`,{className:`mt-1 line-clamp-2 text-xs text-fg-muted`,children:r.description}):null]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-1.5`,children:[(0,Q.jsx)(X,{type:`button`,variant:`secondary`,className:`size-8 rounded-lg p-0`,disabled:i||t===0,"aria-label":n.capabilityPresetMoveUp,onClick:()=>{let e=[...o],[n,r]=[e[t],e[t-1]];e[t-1]=n,e[t]=r,s(e)},children:(0,Q.jsx)(k,{className:`size-3.5`,"aria-hidden":!0})}),(0,Q.jsx)(X,{type:`button`,variant:`secondary`,className:`size-8 rounded-lg p-0`,disabled:i||t===o.length-1,"aria-label":n.capabilityPresetMoveDown,onClick:()=>{let e=[...o],[n,r]=[e[t+1],e[t]];e[t]=n,e[t+1]=r,s(e)},children:(0,Q.jsx)(v,{className:`size-3.5`,"aria-hidden":!0})}),(0,Q.jsx)(X,{type:`button`,variant:`secondary`,className:`size-8 rounded-lg p-0`,disabled:i,"aria-label":n.capabilityPresetRemove,onClick:()=>s(o.filter(t=>t!==e)),children:(0,Q.jsx)(ge,{className:`size-3.5`,"aria-hidden":!0})})]})]},e)}):(0,Q.jsx)(`div`,{className:`rounded-lg bg-surface-panel/60 p-3 text-sm text-fg-muted shadow-surface`,children:n.capabilityPresetsEmptyAdditional})]}),y=u.length>0?(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-col gap-2 sm:flex-row sm:items-center`,children:[(0,Q.jsx)(_e,{className:`min-w-0 flex-1 rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg focus:border-edge-strong focus:outline-none`,disabled:i,defaultValue:f,children:u.map(e=>(0,Q.jsx)(W,{value:e,children:d.get(e)?.name??e},e))}),(0,Q.jsxs)(X,{type:`button`,variant:`secondary`,disabled:i||!f,onClick:e=>{let t=e.currentTarget.parentElement?.querySelector(`select`)?.value||f;t&&s([...o,t])},children:[(0,Q.jsx)(se,{className:`size-4`,"aria-hidden":!0}),n.capabilityPresetAdd]})]}):null,t[7]=n.capabilityPresetAdd,t[8]=n.capabilityPresetMoveDown,t[9]=n.capabilityPresetMoveUp,t[10]=n.capabilityPresetRemove,t[11]=n.capabilityPresetsEmptyAdditional,t[12]=n.capabilityPresetsGlobalDefault,t[13]=n.capabilityPresetsGlobalDefaultHint,t[14]=n.capabilityPresetsHint,t[15]=n.capabilityPresetsManage,t[16]=n.capabilityPresetsTitle,t[17]=i,t[18]=a,t[19]=l,t[20]=p.description,t[21]=p.id,t[22]=p.name,t[23]=c,t[24]=s,t[25]=d,t[26]=r.extends,t[27]=m,t[28]=h,t[29]=g,t[30]=_,t[31]=y}else m=t[27],h=t[28],g=t[29],_=t[30],y=t[31];let b;t[64]!==m||t[65]!==g||t[66]!==_||t[67]!==y?(b=(0,Q.jsxs)(m,{children:[g,_,y]}),t[64]=m,t[65]=g,t[66]=_,t[67]=y,t[68]=b):b=t[68];let x;return t[69]!==h||t[70]!==b?(x=(0,Q.jsx)(h,{children:b}),t[69]=h,t[70]=b,t[71]=x):x=t[71],x}function nn(e){return e.id}function rn(e){return[e.id,e]}function an(e){let t=(0,Z.c)(3),{a:n,selected:r}=e,i;return t[0]!==n||t[1]!==r?(i=(0,Q.jsx)(Zt,{children:(0,Q.jsx)(Kt,{a:n,selected:r})}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function on(e){let t=(0,Z.c)(10),{a:n,selected:r,busy:i,onDelete:a}=e,o;return t[0]!==n.dangerZoneBody||t[1]!==n.dangerZoneHint||t[2]!==n.dangerZoneMainUnavailable||t[3]!==n.dangerZoneTitle||t[4]!==n.purgeDisk||t[5]!==n.removeFromConfig||t[6]!==i||t[7]!==a||t[8]!==r.id?(o=(0,Q.jsx)(Zt,{children:r.id===`main`?(0,Q.jsx)(vt,{children:(0,Q.jsx)(_t,{icon:b,title:n.dangerZoneTitle,subtitle:n.dangerZoneMainUnavailable})}):(0,Q.jsxs)(vt,{className:`border border-red-200/70 bg-red-50/60 dark:border-red-900/50 dark:bg-red-950/25`,children:[(0,Q.jsx)(_t,{icon:b,title:n.dangerZoneTitle,subtitle:n.dangerZoneHint}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Q.jsx)(`p`,{className:`max-w-xl text-sm text-red-800 dark:text-red-200`,children:n.dangerZoneBody}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-2`,children:[(0,Q.jsxs)(X,{type:`button`,variant:`secondary`,disabled:i,onClick:()=>void a(!1),children:[(0,Q.jsx)(ge,{className:`mr-1 size-4`,"aria-hidden":!0}),n.removeFromConfig]}),(0,Q.jsx)(X,{type:`button`,variant:`secondary`,className:`border-red-200 text-red-700 hover:bg-red-100 dark:border-red-900/60 dark:text-red-300 dark:hover:bg-red-950/50`,disabled:i,onClick:()=>void a(!0),children:n.purgeDisk})]})]})]})}),t[0]=n.dangerZoneBody,t[1]=n.dangerZoneHint,t[2]=n.dangerZoneMainUnavailable,t[3]=n.dangerZoneTitle,t[4]=n.purgeDisk,t[5]=n.removeFromConfig,t[6]=i,t[7]=a,t[8]=r.id,t[9]=o):o=t[9],o}function sn(){return c(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,`placeholder:text-fg-subtle`,C,`dark:border-edge`)}function cn(e){return[e.channel,e.accountId,e.peerKind,e.peerId].filter(e=>typeof e==`string`&&e.length>0).join(` · `)||e.channel}function ln(e,t,n,r){let i=e.trim(),a=t.trim();if(a)return{channel:i,peerId:a};if(n!=null){let e=r[n];if(!e)return{channel:i};let t={channel:i};e.accountId?.trim()&&(t.accountId=e.accountId.trim()),e.peerKind?.trim()&&(t.peerKind=e.peerKind.trim());let a=e.peerId?.trim()||e.chatId?.trim();return a&&(t.peerId=a),t}return{channel:i}}function un(e){let t=(0,Z.c)(31),{a:n,filesLoading:r,files:i,activeFile:a,setActiveFile:o,filesViewMode:s,setFilesViewMode:l,fileDraft:u,setFileDraft:d,fileSaving:p,profileFileLoading:m,profileEditorNonce:h,onTryInChat:g}=e,_=f(dn),v;t[0]!==n.missing||t[1]!==i?.files?(v=i?.files.map(e=>({id:e.name,label:e.missing?`${e.name} (${n.missing})`:e.name,title:e.name}))??[],t[0]=n.missing,t[1]=i?.files,t[2]=v):v=t[2];let y=v,b;t[3]===n.filesHint?b=t[4]:(b=(0,Q.jsx)(`p`,{className:`shrink-0 text-sm text-fg-muted`,children:n.filesHint}),t[3]=n.filesHint,t[4]=b);let x;t[5]!==n.filesAutoSaveHint||t[6]!==n.filesEmpty||t[7]!==n.filesMarkdownEdit||t[8]!==n.filesMarkdownPreview||t[9]!==n.filesNavAria||t[10]!==n.filesSavingStatus||t[11]!==n.pickFile||t[12]!==n.tryInChat||t[13]!==a||t[14]!==u||t[15]!==p||t[16]!==y||t[17]!==i||t[18]!==r||t[19]!==s||t[20]!==_||t[21]!==g||t[22]!==h||t[23]!==m||t[24]!==o||t[25]!==d||t[26]!==l?(x=r?(0,Q.jsx)(mt,{rows:3}):i?(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-hidden`,children:[(0,Q.jsx)(yt,{items:y,activeTab:a??``,onChange:o,ariaLabel:n.filesNavAria,tabIdPrefix:`agent-files-tab`,panelIdPrefix:`agent-files-panel`,className:`shrink-0 flex-wrap`,buttonClassName:`font-mono text-xs whitespace-nowrap`}),(0,Q.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-2 overflow-hidden`,children:a?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-between gap-2`,children:[(0,Q.jsxs)(`div`,{className:`inline-flex rounded-lg border border-edge bg-surface-panel p-0.5`,role:`group`,"aria-label":`${n.filesMarkdownEdit} / ${n.filesMarkdownPreview}`,children:[(0,Q.jsxs)(`button`,{type:`button`,className:c(`inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium`,$e.press,s===`edit`?`bg-accent-soft text-accent-fg`:`text-fg-muted hover:bg-surface-hover`),onClick:()=>l(`edit`),children:[(0,Q.jsx)(G,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),n.filesMarkdownEdit]}),(0,Q.jsxs)(`button`,{type:`button`,className:c(`inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium`,$e.press,s===`preview`?`bg-accent-soft text-accent-fg`:`text-fg-muted hover:bg-surface-hover`),onClick:()=>l(`preview`),children:[(0,Q.jsx)(F,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),n.filesMarkdownPreview]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-fg-muted`,children:[p?(0,Q.jsx)(`span`,{children:n.filesSavingStatus}):null,(0,Q.jsx)(`span`,{children:n.filesAutoSaveHint}),g?(0,Q.jsxs)(X,{type:`button`,variant:`secondary`,className:`ml-auto text-xs`,onClick:g,children:[(0,Q.jsx)(P,{className:`mr-1 size-3.5`,"aria-hidden":!0}),n.tryInChat]}):null]})]}),s===`edit`?(0,Q.jsx)(`div`,{className:c(sn(),`flex min-h-0 flex-1 flex-col overflow-hidden p-0`,m&&`pointer-events-none opacity-60`),children:(0,Q.jsx)(ut,{initialContent:u,onChange:d,isDark:_,className:`min-h-0 flex-1`},`${a??`file`}-${h}`)}):(0,Q.jsx)(`div`,{className:c(sn(),`min-h-0 flex-1 overflow-y-auto text-sm`,m&&`pointer-events-none opacity-60`),children:(0,Q.jsx)(de,{content:u,className:`text-sm`})})]}):(0,Q.jsx)(`p`,{className:`shrink-0 text-sm text-fg-muted`,children:n.pickFile})})]}):(0,Q.jsx)(`p`,{className:`shrink-0 text-sm text-fg-muted`,children:n.filesEmpty}),t[5]=n.filesAutoSaveHint,t[6]=n.filesEmpty,t[7]=n.filesMarkdownEdit,t[8]=n.filesMarkdownPreview,t[9]=n.filesNavAria,t[10]=n.filesSavingStatus,t[11]=n.pickFile,t[12]=n.tryInChat,t[13]=a,t[14]=u,t[15]=p,t[16]=y,t[17]=i,t[18]=r,t[19]=s,t[20]=_,t[21]=g,t[22]=h,t[23]=m,t[24]=o,t[25]=d,t[26]=l,t[27]=x):x=t[27];let S;return t[28]!==b||t[29]!==x?(S=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-hidden`,children:[b,x]}),t[28]=b,t[29]=x,t[30]=S):S=t[30],S}function dn(e){return e.resolved===`dark`}function fn(e){let t=(0,Z.c)(44),[n,r]=(0,$.useState)(`files`),{a:i}=e,a;t[0]===i.advancedHint?a=t[1]:(a=(0,Q.jsx)(`p`,{className:`mb-3 max-w-[70ch] text-sm leading-6 text-fg-muted`,children:i.advancedHint}),t[0]=i.advancedHint,t[1]=a);let o;t[2]===i.advancedFilesTab?o=t[3]:(o={id:`files`,label:i.advancedFilesTab,icon:U},t[2]=i.advancedFilesTab,t[3]=o);let s;t[4]===i.advancedConfigTab?s=t[5]:(s={id:`config`,label:i.advancedConfigTab,icon:He},t[4]=i.advancedConfigTab,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=[o,s],t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;t[9]!==i.advancedNavAria||t[10]!==n||t[11]!==c?(l=(0,Q.jsx)(yt,{items:c,activeTab:n,onChange:r,ariaLabel:i.advancedNavAria,tabIdPrefix:`agent-advanced-tab`,panelIdPrefix:`agent-advanced-panel`}),t[9]=i.advancedNavAria,t[10]=n,t[11]=c,t[12]=l):l=t[12];let u;t[13]!==a||t[14]!==l?(u=(0,Q.jsxs)(`div`,{className:`shrink-0`,children:[a,l]}),t[13]=a,t[14]=l,t[15]=u):u=t[15];let d;t[16]!==i||t[17]!==n||t[18]!==e.activeFile||t[19]!==e.agentModel||t[20]!==e.agentWorkspace||t[21]!==e.busy||t[22]!==e.capabilityPresets||t[23]!==e.defaultModel||t[24]!==e.defaultPresetId||t[25]!==e.defaultWorkspace||t[26]!==e.fileDraft||t[27]!==e.fileSaving||t[28]!==e.files||t[29]!==e.filesLoading||t[30]!==e.filesViewMode||t[31]!==e.onOpenCapabilityPreset||t[32]!==e.onTryInChat||t[33]!==e.onUpdateAgentExtends||t[34]!==e.profileEditorNonce||t[35]!==e.profileFileLoading||t[36]!==e.selected||t[37]!==e.setActiveFile||t[38]!==e.setFileDraft||t[39]!==e.setFilesViewMode?(d=n===`files`?(0,Q.jsx)(un,{a:i,filesLoading:e.filesLoading,files:e.files,activeFile:e.activeFile,setActiveFile:e.setActiveFile,filesViewMode:e.filesViewMode,setFilesViewMode:e.setFilesViewMode,fileDraft:e.fileDraft,setFileDraft:e.setFileDraft,fileSaving:e.fileSaving,profileFileLoading:e.profileFileLoading,profileEditorNonce:e.profileEditorNonce,onTryInChat:e.onTryInChat}):(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3`,children:[(0,Q.jsx)(`p`,{className:`shrink-0 rounded-lg border border-edge-subtle bg-surface-panel px-3 py-2 text-xs leading-5 text-fg-muted`,children:i.advancedRuntimeCoverageHint}),(0,Q.jsx)($t,{a:i,selected:e.selected,busy:e.busy,defaultModel:e.defaultModel,defaultWorkspace:e.defaultWorkspace,agentModel:e.agentModel,agentWorkspace:e.agentWorkspace,capabilityPresets:e.capabilityPresets,defaultPresetId:e.defaultPresetId,onUpdateAgentExtends:e.onUpdateAgentExtends,onOpenCapabilityPreset:e.onOpenCapabilityPreset})]}),t[16]=i,t[17]=n,t[18]=e.activeFile,t[19]=e.agentModel,t[20]=e.agentWorkspace,t[21]=e.busy,t[22]=e.capabilityPresets,t[23]=e.defaultModel,t[24]=e.defaultPresetId,t[25]=e.defaultWorkspace,t[26]=e.fileDraft,t[27]=e.fileSaving,t[28]=e.files,t[29]=e.filesLoading,t[30]=e.filesViewMode,t[31]=e.onOpenCapabilityPreset,t[32]=e.onTryInChat,t[33]=e.onUpdateAgentExtends,t[34]=e.profileEditorNonce,t[35]=e.profileFileLoading,t[36]=e.selected,t[37]=e.setActiveFile,t[38]=e.setFileDraft,t[39]=e.setFilesViewMode,t[40]=d):d=t[40];let f;return t[41]!==u||t[42]!==d?(f=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-hidden`,children:[u,d]}),t[41]=u,t[42]=d,t[43]=f):f=t[43],f}function pn(e){let t=(0,Z.c)(79),{a:n,selected:r,busy:i,skillsCatalogLoading:a,catalogForPick:o,skillsInherit:l,setSkillsInherit:u,skillsPick:d,setSkillsPick:f,onSaveSkills:p}=e,m,h;if(t[0]!==r.skills.entry||t[1]!==l||t[2]!==d){m=[...d].toSorted(vn);let e=[...r.skills.entry??[]].toSorted(_n);h=l!==(r.skills.entry===void 0)||!l&&JSON.stringify(m)!==JSON.stringify(e),t[0]=r.skills.entry,t[1]=l,t[2]=d,t[3]=m,t[4]=h}else m=t[3],h=t[4];let g=h,_;t[5]!==m||t[6]!==l?(_={inherit:l,skills:m},t[5]=m,t[6]=l,t[7]=_):_=t[7];let v;t[8]!==g||t[9]!==p||t[10]!==_?(v={value:_,dirty:g,onSave:p,delayMs:350},t[8]=g,t[9]=p,t[10]=_,t[11]=v):v=t[11];let y=gt(v),b;t[12]===r.skills.effectiveAllowlist?b=t[13]:(b=function(e){let t=r.skills.effectiveAllowlist;return t===void 0?!0:t.length===0?!1:t.includes(e)},t[12]=r.skills.effectiveAllowlist,t[13]=b);let x=b,S;t[14]!==o||t[15]!==r.skills.effectiveAllowlist?(S=function(){let e=r.skills.effectiveAllowlist;return e===void 0?new Set(o.map(gn)):new Set(e)},t[14]=o,t[15]=r.skills.effectiveAllowlist,t[16]=S):S=t[16];let C=S,w;t[17]!==y.error||t[18]!==y.status?(w=(0,Q.jsx)(ht,{status:y.status,error:y.error}),t[17]=y.error,t[18]=y.status,t[19]=w):w=t[19];let T;t[20]!==n.skillsHint||t[21]!==n.skillsTitle||t[22]!==w?(T=(0,Q.jsx)(_t,{className:`shrink-0`,icon:it,title:n.skillsTitle,subtitle:n.skillsHint,trailing:w}),t[20]=n.skillsHint,t[21]=n.skillsTitle,t[22]=w,t[23]=T):T=t[23];let E;t[24]!==y||t[25]!==u||t[26]!==m?(E=()=>{u(!0),y.saveNow({inherit:!0,skills:m})},t[24]=y,t[25]=u,t[26]=m,t[27]=E):E=t[27];let D;t[28]!==n.skillsInherit||t[29]!==i||t[30]!==E?(D=(0,Q.jsx)(X,{type:`button`,variant:`secondary`,disabled:i,onClick:E,children:n.skillsInherit}),t[28]=n.skillsInherit,t[29]=i,t[30]=E,t[31]=D):D=t[31];let O;t[32]!==y||t[33]!==C||t[34]!==u||t[35]!==f?(O=()=>{u(!1);let e=C();f(e),y.saveNow({inherit:!1,skills:[...e].toSorted(hn)})},t[32]=y,t[33]=C,t[34]=u,t[35]=f,t[36]=O):O=t[36];let k;t[37]!==n.skillsCustomize||t[38]!==i||t[39]!==O?(k=(0,Q.jsx)(X,{type:`button`,variant:`secondary`,disabled:i,onClick:O,children:n.skillsCustomize}),t[37]=n.skillsCustomize,t[38]=i,t[39]=O,t[40]=k):k=t[40];let A;t[41]!==k||t[42]!==D?(A=(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[D,k]}),t[41]=k,t[42]=D,t[43]=A):A=t[43];let j;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(j=We(`skills`),t[44]=j):j=t[44];let M;t[45]===n.skillsLibraryLink?M=t[46]:(M=(0,Q.jsx)(s,{to:j,className:`shrink-0 text-xs font-medium text-accent-fg hover:underline`,children:n.skillsLibraryLink}),t[45]=n.skillsLibraryLink,t[46]=M);let N;t[47]!==A||t[48]!==M?(N=(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-between gap-3`,children:[A,M]}),t[47]=A,t[48]=M,t[49]=N):N=t[49];let P;t[50]===r.skills.preset?P=t[51]:(P=r.skills.preset.length?r.skills.preset.join(`, `):`—`,t[50]=r.skills.preset,t[51]=P);let F;t[52]!==n.skillsPresetLabel||t[53]!==P?(F=(0,Q.jsxs)(`p`,{className:`mt-2 shrink-0 text-xs text-fg-muted`,children:[n.skillsPresetLabel,` `,P]}),t[52]=n.skillsPresetLabel,t[53]=P,t[54]=F):F=t[54];let I;t[55]!==n.skillsInherit||t[56]!==r.skills.effectiveAllowlist||t[57]!==l?(I=r.skills.effectiveAllowlist?.length?r.skills.effectiveAllowlist.join(`, `):l?n.skillsInherit:`—`,t[55]=n.skillsInherit,t[56]=r.skills.effectiveAllowlist,t[57]=l,t[58]=I):I=t[58];let L;t[59]!==n.skillsEffectiveLabel||t[60]!==I?(L=(0,Q.jsxs)(`p`,{className:`shrink-0 text-xs text-fg-muted`,children:[n.skillsEffectiveLabel,` `,I]}),t[59]=n.skillsEffectiveLabel,t[60]=I,t[61]=L):L=t[61];let R;t[62]!==n.skillsEmptyCatalog||t[63]!==n.skillsNoDescription||t[64]!==y||t[65]!==i||t[66]!==o||t[67]!==x||t[68]!==f||t[69]!==a||t[70]!==l||t[71]!==d?(R=a?(0,Q.jsx)(`div`,{className:`mt-3 min-h-0 flex-1 overflow-y-auto overscroll-contain pr-0.5`,children:(0,Q.jsx)(pt,{rows:4})}):o.length===0?(0,Q.jsx)(`p`,{className:`shrink-0 text-sm text-fg-muted`,children:n.skillsEmptyCatalog}):(0,Q.jsx)(`div`,{className:c(`mt-3 min-h-0 flex-1 overflow-y-auto overscroll-contain pr-0.5`,l&&`opacity-50`),children:(0,Q.jsx)(`ul`,{className:`flex flex-col gap-2.5 text-sm`,children:o.map(e=>{let t=e.name||e.directoryId,r=l?x(t):d.has(t),a=typeof e.description==`string`?e.description.trim():``,o=a||n.skillsNoDescription;return(0,Q.jsx)(`li`,{className:`h-16 shrink-0 overflow-hidden rounded-xl bg-surface-panel/70 px-3 shadow-surface`,children:(0,Q.jsxs)(`label`,{className:`flex h-full cursor-pointer items-center gap-3 text-sm`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`shrink-0 rounded border-edge`,checked:r,disabled:l||i,onChange:()=>{f(e=>{let n=new Set(e);return r?n.delete(t):n.add(t),y.saveNow({inherit:!1,skills:[...n].toSorted(mn)}),n})},"aria-label":t}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 overflow-hidden`,children:[(0,Q.jsx)(`div`,{className:`truncate font-mono text-xs font-medium text-fg`,title:t,children:t}),(0,Q.jsx)(`p`,{className:c(`mt-0.5 truncate text-xs leading-tight text-fg-muted`,!a&&`italic text-fg-subtle`),title:o,children:o})]})]})},t)})})}),t[62]=n.skillsEmptyCatalog,t[63]=n.skillsNoDescription,t[64]=y,t[65]=i,t[66]=o,t[67]=x,t[68]=f,t[69]=a,t[70]=l,t[71]=d,t[72]=R):R=t[72];let z;return t[73]!==N||t[74]!==F||t[75]!==L||t[76]!==R||t[77]!==T?(z=(0,Q.jsxs)(vt,{className:`flex min-h-0 flex-1 flex-col`,children:[T,N,F,L,R]}),t[73]=N,t[74]=F,t[75]=L,t[76]=R,t[77]=T,t[78]=z):z=t[78],z}function mn(e,t){return e.localeCompare(t)}function hn(e,t){return e.localeCompare(t)}function gn(e){return e.name||e.directoryId}function _n(e,t){return e.localeCompare(t)}function vn(e,t){return e.localeCompare(t)}var yn=[`write_file`,`apply_patch`,`exec_command`],bn=[`exec_command`,`image_generate`,`extensions`],xn=[`send_message`,`send_media`];function Sn(e){let t=(0,Z.c)(87),{mode:n,builtinToolIds:r,loading:i,disableSet:a,onDisableSetChange:o,defaultsDisableSet:s,unknownDisabledIds:l,getToolDescription:u,getGroupTitle:d,labels:f,quickActionsDisabled:p}=e,m;t[0]===l?m=t[1]:(m=l===void 0?[]:l,t[0]=l,t[1]=m);let h=m,g=p===void 0?!1:p,_;t[2]===r?_=t[3]:(_=new Set(r),t[2]=r,t[3]=_);let v=_,y;t[4]===s?y=t[5]:(y=s??new Set,t[4]=s,t[5]=y);let b=y,x;t[6]!==b||t[7]!==a||t[8]!==n||t[9]!==o?(x=(e,t)=>{if(n===`agentEntry`&&t&&b.has(e))return;let r=new Set(a);t?r.delete(e):r.add(e),o(r)},t[6]=b,t[7]=a,t[8]=n,t[9]=o,t[10]=x):x=t[10];let S=x,C;t[11]!==v||t[12]!==o?(C=e=>{let t=new Set;for(let n of e)v.has(n)&&t.add(n);o(t)},t[11]=v,t[12]=o,t[13]=C):C=t[13];let w=C,T;t[14]===o?T=t[15]:(T=()=>{o(new Set)},t[14]=o,t[15]=T);let E=T,D;t[16]!==r||t[17]!==o||t[18]!==h?(D=()=>{o(new Set([...r,...h]))},t[16]=r,t[17]=o,t[18]=h,t[19]=D):D=t[19];let O=D,k;t[20]===r?k=t[21]:(k=xt(r),t[20]=r,t[21]=k);let A=k,j;if(t[22]!==v||t[23]!==A||t[24]!==n||t[25]!==h){if(j=[],n===`defaults`&&h.length>0){let e;t[27]===h?e=t[28]:(e=h.toSorted(wn),t[27]=h,t[28]=e);let n;t[29]===e?n=t[30]:(n={key:`unknown`,ids:e},t[29]=e,t[30]=n),j.push(n)}for(let e of Ct){let t=e.toolIds.filter(e=>v.has(e));t.length>0&&j.push({key:e.key,ids:[...t]})}if(A.length>0){let e;t[31]===A?e=t[32]:(e={key:`misc`,ids:A},t[31]=A,t[32]=e),j.push(e)}t[22]=v,t[23]=A,t[24]=n,t[25]=h,t[26]=j}else j=t[26];let M=j,N=M.some(Cn),P=g||i,F;t[33]===f.quickActionsLabel?F=t[34]:(F=(0,Q.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:f.quickActionsLabel}),t[33]=f.quickActionsLabel,t[34]=F);let I=P||r.length===0&&h.length===0,L;t[35]!==E||t[36]!==f.quickEnableAll||t[37]!==I?(L=(0,Q.jsx)(X,{type:`button`,variant:`secondary`,className:Dt,disabled:I,onClick:E,children:f.quickEnableAll}),t[35]=E,t[36]=f.quickEnableAll,t[37]=I,t[38]=L):L=t[38];let R=P||r.length===0&&h.length===0,z;t[39]!==O||t[40]!==f.quickDisableAll||t[41]!==R?(z=(0,Q.jsx)(X,{type:`button`,variant:`secondary`,className:Dt,disabled:R,onClick:O,children:f.quickDisableAll}),t[39]=O,t[40]=f.quickDisableAll,t[41]=R,t[42]=z):z=t[42];let ee=P||r.length===0,B;t[43]===w?B=t[44]:(B=()=>w(yn),t[43]=w,t[44]=B);let te;t[45]!==f.quickReadOnlyWorkspace||t[46]!==ee||t[47]!==B?(te=(0,Q.jsx)(X,{type:`button`,variant:`secondary`,className:Dt,disabled:ee,onClick:B,children:f.quickReadOnlyWorkspace}),t[45]=f.quickReadOnlyWorkspace,t[46]=ee,t[47]=B,t[48]=te):te=t[48];let V=P||r.length===0,ne;t[49]===w?ne=t[50]:(ne=()=>w(bn),t[49]=w,t[50]=ne);let re;t[51]!==f.quickHighRiskOff||t[52]!==V||t[53]!==ne?(re=(0,Q.jsx)(X,{type:`button`,variant:`secondary`,className:Dt,disabled:V,onClick:ne,children:f.quickHighRiskOff}),t[51]=f.quickHighRiskOff,t[52]=V,t[53]=ne,t[54]=re):re=t[54];let ie=P||r.length===0,H;t[55]===w?H=t[56]:(H=()=>w(xn),t[55]=w,t[56]=H);let ae;t[57]!==f.quickNoOutbound||t[58]!==ie||t[59]!==H?(ae=(0,Q.jsx)(X,{type:`button`,variant:`secondary`,className:Dt,disabled:ie,onClick:H,children:f.quickNoOutbound}),t[57]=f.quickNoOutbound,t[58]=ie,t[59]=H,t[60]=ae):ae=t[60];let U;t[61]!==L||t[62]!==z||t[63]!==te||t[64]!==re||t[65]!==ae?(U=(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[L,z,te,re,ae]}),t[61]=L,t[62]=z,t[63]=te,t[64]=re,t[65]=ae,t[66]=U):U=t[66];let W;t[67]!==F||t[68]!==U?(W=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[F,U]}),t[67]=F,t[68]=U,t[69]=W):W=t[69];let G;t[70]!==b||t[71]!==a||t[72]!==d||t[73]!==u||t[74]!==M||t[75]!==N||t[76]!==f.emptyBuiltin||t[77]!==f.lockedByDefaults||t[78]!==f.notInBuiltin||t[79]!==i||t[80]!==n||t[81]!==P||t[82]!==S?(G=i?(0,Q.jsx)(pt,{rows:4}):N?(0,Q.jsx)(`div`,{className:`max-h-[min(50vh,22rem)] overflow-y-auto overscroll-contain pr-0.5`,children:(0,Q.jsx)(`div`,{className:`flex flex-col gap-5 pr-1`,children:M.map(e=>{let{key:t,ids:r}=e;return(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:d(t)}),(0,Q.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:r.map(e=>{let r=n===`defaults`&&t===`unknown`,i=n===`agentEntry`&&b.has(e),o=a.has(e),s=i?!1:!o,l=u(e);return(0,Q.jsx)(`li`,{className:c(`rounded-xl bg-surface-panel/70 px-3 py-2.5 shadow-surface`,r&&`bg-surface-panel/50`,i&&`opacity-60`),children:(0,Q.jsxs)(`label`,{className:c(`flex gap-3 text-sm`,i?`cursor-not-allowed`:`cursor-pointer`),children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`mt-1 shrink-0 rounded border-edge`,checked:s,disabled:i||P,onChange:()=>S(e,!s)}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5`,children:[(0,Q.jsx)(`span`,{className:`font-mono text-xs font-medium text-fg`,children:e}),r?(0,Q.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[`(`,f.notInBuiltin,`)`]}):null,i?(0,Q.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[`(`,f.lockedByDefaults,`)`]}):null]}),l?(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:l}):null]})]})},e)})})]},t)})})}):(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:f.emptyBuiltin}),t[70]=b,t[71]=a,t[72]=d,t[73]=u,t[74]=M,t[75]=N,t[76]=f.emptyBuiltin,t[77]=f.lockedByDefaults,t[78]=f.notInBuiltin,t[79]=i,t[80]=n,t[81]=P,t[82]=S,t[83]=G):G=t[83];let oe;return t[84]!==W||t[85]!==G?(oe=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[W,G]}),t[84]=W,t[85]=G,t[86]=oe):oe=t[86],oe}function Cn(e){return e.ids.length>0}function wn(e,t){return e.localeCompare(t)}function Tn(e){let t=(0,Z.c)(60),{a:n,data:r,selected:i,busy:a,toolEntryDisable:o,setToolEntryDisable:s,onSaveTools:c,onClearToolsEntry:u}=e,f=d(An),p;t[0]===f?p=t[1]:(p=l(f),t[0]=f,t[1]=p);let m=p.agentSettings.advanced,h;t[2]===i.tools.presetDenied?h=t[3]:(h=new Set(i.tools.presetDenied.flatMap(kn)),t[2]=i.tools.presetDenied,t[3]=h);let g=h,_;t[4]===o?_=t[5]:(_=[...o].toSorted(On),t[4]=o,t[5]=_);let v=_,y;t[6]===i.tools.entryDisable?y=t[7]:(y=[...i.tools.entryDisable].toSorted(Dn),t[6]=i.tools.entryDisable,t[7]=y);let b=y,x;t[8]===v?x=t[9]:(x=JSON.stringify(v),t[8]=v,t[9]=x);let S;t[10]===b?S=t[11]:(S=JSON.stringify(b),t[10]=b,t[11]=S);let C=x!==S,w;t[12]!==C||t[13]!==v||t[14]!==c?(w={value:v,dirty:C,onSave:c,delayMs:350},t[12]=C,t[13]=v,t[14]=c,t[15]=w):w=t[15];let T=gt(w),E;t[16]!==T||t[17]!==s?(E=e=>{s(e),T.saveNow([...e].toSorted(En))},t[16]=T,t[17]=s,t[18]=E):E=t[18];let D=E,O=n.toolsDisableGroups,k;t[19]===O?k=t[20]:(k=e=>O[e],t[19]=O,t[20]=k);let A=k,j;t[21]===n.toolDescriptions?j=t[22]:(j=e=>e in n.toolDescriptions?n.toolDescriptions[e]:``,t[21]=n.toolDescriptions,t[22]=j);let M=j,N;t[23]!==T.error||t[24]!==T.status?(N=(0,Q.jsx)(ht,{status:T.status,error:T.error}),t[23]=T.error,t[24]=T.status,t[25]=N):N=t[25];let P;t[26]!==n.toolsHint||t[27]!==n.toolsTitle||t[28]!==N?(P=(0,Q.jsx)(_t,{className:`shrink-0`,icon:ae,title:n.toolsTitle,subtitle:n.toolsHint,trailing:N}),t[26]=n.toolsHint,t[27]=n.toolsTitle,t[28]=N,t[29]=P):P=t[29];let F;t[30]!==n.toolsLockedByPreset||t[31]!==m.toolsDisableEmptyBuiltin||t[32]!==m.toolsDisableLoadingBuiltin||t[33]!==m.toolsDisableNotInBuiltin||t[34]!==m.toolsDisableQuickActionsLabel||t[35]!==m.toolsDisableQuickDisableAll||t[36]!==m.toolsDisableQuickEnableAll||t[37]!==m.toolsDisableQuickHighRiskOff||t[38]!==m.toolsDisableQuickNoOutbound||t[39]!==m.toolsDisableQuickReadOnlyWorkspace?(F={loadingBuiltin:m.toolsDisableLoadingBuiltin,emptyBuiltin:m.toolsDisableEmptyBuiltin,quickActionsLabel:m.toolsDisableQuickActionsLabel,quickEnableAll:m.toolsDisableQuickEnableAll,quickDisableAll:m.toolsDisableQuickDisableAll,quickReadOnlyWorkspace:m.toolsDisableQuickReadOnlyWorkspace,quickHighRiskOff:m.toolsDisableQuickHighRiskOff,quickNoOutbound:m.toolsDisableQuickNoOutbound,notInBuiltin:m.toolsDisableNotInBuiltin,lockedByDefaults:n.toolsLockedByPreset},t[30]=n.toolsLockedByPreset,t[31]=m.toolsDisableEmptyBuiltin,t[32]=m.toolsDisableLoadingBuiltin,t[33]=m.toolsDisableNotInBuiltin,t[34]=m.toolsDisableQuickActionsLabel,t[35]=m.toolsDisableQuickDisableAll,t[36]=m.toolsDisableQuickEnableAll,t[37]=m.toolsDisableQuickHighRiskOff,t[38]=m.toolsDisableQuickNoOutbound,t[39]=m.toolsDisableQuickReadOnlyWorkspace,t[40]=F):F=t[40];let I;t[41]!==a||t[42]!==r.builtinToolIds||t[43]!==A||t[44]!==M||t[45]!==D||t[46]!==g||t[47]!==F||t[48]!==o?(I=(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:(0,Q.jsx)(Sn,{mode:`agentEntry`,builtinToolIds:r.builtinToolIds,loading:!1,disableSet:o,onDisableSetChange:D,defaultsDisableSet:g,getToolDescription:M,getGroupTitle:A,quickActionsDisabled:a,labels:F})}),t[41]=a,t[42]=r.builtinToolIds,t[43]=A,t[44]=M,t[45]=D,t[46]=g,t[47]=F,t[48]=o,t[49]=I):I=t[49];let L;t[50]===u?L=t[51]:(L=()=>void u(),t[50]=u,t[51]=L);let R;t[52]!==n.toolsClearEntry||t[53]!==a||t[54]!==L?(R=(0,Q.jsx)(`div`,{className:`mt-4 flex shrink-0 flex-wrap gap-2`,children:(0,Q.jsx)(X,{type:`button`,variant:`secondary`,disabled:a,onClick:L,children:n.toolsClearEntry})}),t[52]=n.toolsClearEntry,t[53]=a,t[54]=L,t[55]=R):R=t[55];let z;return t[56]!==P||t[57]!==I||t[58]!==R?(z=(0,Q.jsxs)(vt,{className:`flex min-h-0 flex-1 flex-col`,children:[P,I,R]}),t[56]=P,t[57]=I,t[58]=R,t[59]=z):z=t[59],z}function En(e,t){return e.localeCompare(t)}function Dn(e,t){return e.localeCompare(t)}function On(e,t){return e.localeCompare(t)}function kn(e){let t=String(e).trim();return t?[t]:[]}function An(e){return e.language}function jn(e){let t=(0,Z.c)(36),[n,r]=(0,$.useState)(`tools`),{a:i}=e,a;t[0]===i.capabilitiesHint?a=t[1]:(a=(0,Q.jsx)(`p`,{className:`mb-3 max-w-[70ch] text-sm leading-6 text-fg-muted`,children:i.capabilitiesHint}),t[0]=i.capabilitiesHint,t[1]=a);let o;t[2]===i.capabilitiesToolsTab?o=t[3]:(o={id:`tools`,label:i.capabilitiesToolsTab,icon:ae},t[2]=i.capabilitiesToolsTab,t[3]=o);let s;t[4]===i.capabilitiesSkillsTab?s=t[5]:(s={id:`skills`,label:i.capabilitiesSkillsTab,icon:at},t[4]=i.capabilitiesSkillsTab,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=[o,s],t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;t[9]!==i.capabilitiesNavAria||t[10]!==n||t[11]!==c?(l=(0,Q.jsx)(yt,{items:c,activeTab:n,onChange:r,ariaLabel:i.capabilitiesNavAria,tabIdPrefix:`agent-capabilities-tab`,panelIdPrefix:`agent-capabilities-panel`}),t[9]=i.capabilitiesNavAria,t[10]=n,t[11]=c,t[12]=l):l=t[12];let u;t[13]!==a||t[14]!==l?(u=(0,Q.jsxs)(`div`,{className:`shrink-0`,children:[a,l]}),t[13]=a,t[14]=l,t[15]=u):u=t[15];let d;t[16]!==i||t[17]!==n||t[18]!==e.busy||t[19]!==e.catalogForPick||t[20]!==e.data||t[21]!==e.onClearToolsEntry||t[22]!==e.onSaveSkills||t[23]!==e.onSaveTools||t[24]!==e.selected||t[25]!==e.setSkillsInherit||t[26]!==e.setSkillsPick||t[27]!==e.setToolEntryDisable||t[28]!==e.skillsCatalogLoading||t[29]!==e.skillsInherit||t[30]!==e.skillsPick||t[31]!==e.toolEntryDisable?(d=n===`tools`?(0,Q.jsx)(Tn,{a:i,data:e.data,selected:e.selected,busy:e.busy,toolEntryDisable:e.toolEntryDisable,setToolEntryDisable:e.setToolEntryDisable,onSaveTools:e.onSaveTools,onClearToolsEntry:e.onClearToolsEntry}):(0,Q.jsx)(pn,{a:i,selected:e.selected,busy:e.busy,skillsCatalogLoading:e.skillsCatalogLoading,catalogForPick:e.catalogForPick,skillsInherit:e.skillsInherit,setSkillsInherit:e.setSkillsInherit,skillsPick:e.skillsPick,setSkillsPick:e.setSkillsPick,onSaveSkills:e.onSaveSkills}),t[16]=i,t[17]=n,t[18]=e.busy,t[19]=e.catalogForPick,t[20]=e.data,t[21]=e.onClearToolsEntry,t[22]=e.onSaveSkills,t[23]=e.onSaveTools,t[24]=e.selected,t[25]=e.setSkillsInherit,t[26]=e.setSkillsPick,t[27]=e.setToolEntryDisable,t[28]=e.skillsCatalogLoading,t[29]=e.skillsInherit,t[30]=e.skillsPick,t[31]=e.toolEntryDisable,t[32]=d):d=t[32];let f;return t[33]!==u||t[34]!==d?(f=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-hidden`,children:[u,d]}),t[33]=u,t[34]=d,t[35]=f):f=t[35],f}var Mn=c(le,`w-full text-xs sm:w-auto sm:min-w-[11rem] sm:max-w-[17rem] sm:shrink-0`);function Nn(e){let t=(0,Z.c)(59),{a:n,busy:r,bindingsLoading:i,agentBindings:a,onRemoveBinding:o,onAddBinding:s,channelStatuses:l,channelsStatusLoading:u,useManualChannel:d,newBindChannel:f,setNewBindChannel:p,bindSessionChats:m,sessionsLoading:h,newBindSessionIdx:g,setNewBindSessionIdx:_,newBindCustomPeer:v,setNewBindCustomPeer:y,onRefreshSessions:b,lastActiveLabels:x,selectRecipient:S}=e,C=!u&&(d||l.length>0),w;t[0]!==n.channelsHint||t[1]!==n.channelsTitle?(w=(0,Q.jsx)(_t,{className:`shrink-0`,icon:ke,title:n.channelsTitle,subtitle:n.channelsHint}),t[0]=n.channelsHint,t[1]=n.channelsTitle,t[2]=w):w=t[2];let T;t[3]!==n.channelsNone||t[4]!==n.removeBinding||t[5]!==a||t[6]!==i||t[7]!==r||t[8]!==o?(T=i?(0,Q.jsx)(`div`,{className:`flex flex-col gap-2`,"aria-busy":`true`,children:Array.from({length:2}).map(Pn)}):a.length===0?(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.channelsNone}):(0,Q.jsx)(`ul`,{className:`flex flex-col gap-2 text-sm`,children:a.map(e=>(0,Q.jsxs)(`li`,{className:`flex flex-wrap items-center justify-between gap-2 rounded-lg border border-edge bg-surface-panel px-3 py-2`,children:[(0,Q.jsx)(`span`,{className:`font-mono text-xs`,children:cn(e.match)}),(0,Q.jsx)(X,{type:`button`,variant:`secondary`,disabled:r,onClick:()=>void o(e),children:n.removeBinding})]},`${e.match.channel}-${cn(e.match)}`))}),t[3]=n.channelsNone,t[4]=n.removeBinding,t[5]=a,t[6]=i,t[7]=r,t[8]=o,t[9]=T):T=t[9];let E;t[10]!==n.channelLabel||t[11]!==n.channelsDisabledSuffix||t[12]!==n.channelsManualChannelHint||t[13]!==l||t[14]!==u||t[15]!==f||t[16]!==p||t[17]!==y||t[18]!==_||t[19]!==d?(E=u?(0,Q.jsxs)(`div`,{className:`space-y-2`,"aria-busy":`true`,children:[(0,Q.jsx)(B,{className:`h-4 w-24`}),(0,Q.jsx)(B,{className:`h-10 w-full rounded-lg`})]}):d?(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1 text-sm`,children:[(0,Q.jsx)(`span`,{className:`text-fg-muted`,children:n.channelLabel}),(0,Q.jsx)(`input`,{className:sn(),value:f,onChange:e=>p(e.target.value),placeholder:`telegram`,autoComplete:`off`}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.channelsManualChannelHint})]}):(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1 text-sm`,children:[(0,Q.jsx)(`span`,{className:`text-fg-muted`,children:n.channelLabel}),(0,Q.jsx)(_e,{className:c(sn(),`py-2`),value:f,onChange:e=>{p(e.target.value),_(null),y(``)},children:l.map(e=>(0,Q.jsxs)(W,{value:e.name,disabled:!e.enabled,children:[e.name,` `,e.enabled?``:n.channelsDisabledSuffix]},e.name))})]}),t[10]=n.channelLabel,t[11]=n.channelsDisabledSuffix,t[12]=n.channelsManualChannelHint,t[13]=l,t[14]=u,t[15]=f,t[16]=p,t[17]=y,t[18]=_,t[19]=d,t[20]=E):E=t[20];let D;t[21]!==n.channelsCustomPeerHint||t[22]!==n.channelsCustomPeerPlaceholder||t[23]!==n.channelsNoSessionsHint||t[24]!==n.channelsPeerAny||t[25]!==n.channelsPeerFromSessions||t[26]!==n.channelsRefreshSessions||t[27]!==n.channelsRefreshSessionsHint||t[28]!==n.channelsSessionLabel||t[29]!==n.peerIdLabel||t[30]!==m||t[31]!==r||t[32]!==x||t[33]!==f||t[34]!==v||t[35]!==g||t[36]!==b||t[37]!==S||t[38]!==h||t[39]!==y||t[40]!==_||t[41]!==C?(D=C&&f.trim()?(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-edge-subtle pt-3 text-sm`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-fg-muted`,children:n.channelsSessionLabel}),(0,Q.jsxs)(X,{type:`button`,variant:`ghost`,className:`h-7 gap-1 px-2 text-xs`,disabled:r||h||!f.trim(),title:n.channelsRefreshSessionsHint,onClick:()=>b(),children:[(0,Q.jsx)(Ne,{className:c(`size-3.5`,h&&`animate-spin`),strokeWidth:1.75}),n.channelsRefreshSessions]})]}),h&&m.length===0?(0,Q.jsxs)(`div`,{className:`space-y-2`,"aria-busy":`true`,children:[(0,Q.jsx)(B,{className:`h-4 w-32`}),(0,Q.jsx)(B,{className:`h-10 w-full rounded-lg`})]}):null,(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-fg-muted`,children:n.channelsPeerFromSessions}),(0,Q.jsxs)(_e,{className:c(sn(),`py-2`),value:g==null?``:String(g),disabled:r||!f.trim()||!!v.trim(),onChange:e=>{let t=e.target.value;_(t===``?null:Number(t))},children:[(0,Q.jsx)(W,{value:``,children:n.channelsPeerAny}),m.map((e,t)=>(0,Q.jsx)(W,{value:String(t),children:Mt(e,x)},`${e.channel}-${e.chatId}`))]})]}),m.length===0&&f.trim()&&!h?(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.channelsNoSessionsHint}):null,(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-fg-muted`,children:n.peerIdLabel}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-stretch sm:gap-2`,children:[(0,Q.jsx)(`input`,{type:`text`,className:c(sn(),`min-w-0 w-full sm:flex-1`),value:v,onChange:e=>{y(e.target.value),e.target.value.trim()&&_(null)},placeholder:n.channelsCustomPeerPlaceholder,autoComplete:`off`}),(0,Q.jsxs)(_e,{className:Mn,value:v,onChange:e=>{let t=e.target.value;y(t||``),_(null)},children:[(0,Q.jsx)(W,{value:``,children:S}),m.map(e=>(0,Q.jsx)(W,{value:e.chatId,children:Mt(e,x)},`${e.channel}-${e.chatId}`))]})]}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.channelsCustomPeerHint})]})]}):null,t[21]=n.channelsCustomPeerHint,t[22]=n.channelsCustomPeerPlaceholder,t[23]=n.channelsNoSessionsHint,t[24]=n.channelsPeerAny,t[25]=n.channelsPeerFromSessions,t[26]=n.channelsRefreshSessions,t[27]=n.channelsRefreshSessionsHint,t[28]=n.channelsSessionLabel,t[29]=n.peerIdLabel,t[30]=m,t[31]=r,t[32]=x,t[33]=f,t[34]=v,t[35]=g,t[36]=b,t[37]=S,t[38]=h,t[39]=y,t[40]=_,t[41]=C,t[42]=D):D=t[42];let O;t[43]!==r||t[44]!==u||t[45]!==f?(O=r||!f.trim()||u,t[43]=r,t[44]=u,t[45]=f,t[46]=O):O=t[46];let k;t[47]!==n.addBinding||t[48]!==O?(k=(0,Q.jsx)(`div`,{children:(0,Q.jsx)(X,{type:`submit`,disabled:O,children:n.addBinding})}),t[47]=n.addBinding,t[48]=O,t[49]=k):k=t[49];let A;t[50]!==s||t[51]!==E||t[52]!==D||t[53]!==k?(A=(0,Q.jsxs)(`form`,{className:`mt-4 flex flex-col gap-3`,onSubmit:s,children:[E,D,k]}),t[50]=s,t[51]=E,t[52]=D,t[53]=k,t[54]=A):A=t[54];let j;return t[55]!==w||t[56]!==T||t[57]!==A?(j=(0,Q.jsxs)(vt,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto`,children:[w,T,A]}),t[55]=w,t[56]=T,t[57]=A,t[58]=j):j=t[58],j}function Pn(e,t){return(0,Q.jsx)(B,{className:`h-10 rounded-lg`},t)}function Fn(e,t){switch(e){case`adventurer`:return t.avatarStyleAdventurer;case`bottts`:return t.avatarStyleRobot;case`lorelei`:return t.avatarStyleLorelei;case`thumbs`:return t.avatarStyleThumbs;case`fun-emoji`:return t.avatarStyleFunEmoji;default:return e}}function In(e){let{agentId:t,value:n,onChange:r,a:i,id:a}=e,o=(0,$.useRef)(null),[s,l]=(0,$.useState)(!1),[u,d]=(0,$.useState)(null),[f,p]=(0,$.useState)(!1),m=(0,$.useMemo)(()=>{let e=J(n.trim());return e&&xe(e.styleId)?e.styleId:Ve[0]??`adventurer`},[n]),g=(0,$.useCallback)(async(e,n)=>{try{await st(t)}catch{}r(Fe(e,n)),p(!1)},[t,r]),_=(0,$.useCallback)(async e=>{let n=e.target.files?.[0];if(e.target.value=``,n){d(null),l(!0);try{await Le(t,n),Je(t),r(Ke)}catch(e){let t=e instanceof Error?e.message:``;d(t===`avatar_too_large`?i.avatarTooLarge:t===`unsupported_image_type`||t===`empty_file`?i.avatarInvalidImage:i.avatarUploadFailed)}finally{l(!1)}}},[i,t,r]),v=(e,t)=>{let r=J(n.trim());return!!(r&&r.styleId===e&&r.seed===t)};return(0,Q.jsxs)(`div`,{...a?{id:a}:{},className:`flex flex-col gap-3 sm:col-span-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:i.avatarPickerTitle}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`input`,{ref:o,type:`file`,accept:`image/png,image/jpeg,image/webp,.png,.jpg,.jpeg,.webp`,className:`hidden`,onChange:e=>void _(e)}),(0,Q.jsxs)(X,{type:`button`,variant:`secondary`,className:`gap-1.5 px-2.5 py-1.5 text-xs`,disabled:s,onClick:()=>o.current?.click(),children:[(0,Q.jsx)(ee,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),s?i.avatarUploading:i.avatarUploadCustom]})]})]}),u?(0,Q.jsx)(`p`,{className:`text-xs text-red-600 dark:text-red-400`,children:u}):null,(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:Ve.map(e=>(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void g(e,Xe[0]??t),className:c(`rounded-full border px-3 py-1.5 text-xs font-medium transition-colors`,$e.press,m===e?`border-fg bg-fg text-surface-base`:`border-edge-subtle bg-surface-panel text-fg hover:border-edge`),children:Fn(e,i)},e))}),(0,Q.jsxs)(`div`,{className:`rounded-xl border border-edge-subtle bg-surface-panel/50 p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[Xe.map(e=>(0,Q.jsx)(`button`,{type:`button`,title:e,onClick:()=>void g(m,e),className:c(`flex size-12 shrink-0 items-center justify-center rounded-full border-2 transition-colors`,$e.press,v(m,e)?`border-accent ring-2 ring-accent/30`:`border-transparent hover:border-edge`),children:(0,Q.jsx)(`img`,{src:bt(m,e,96),alt:``,width:44,height:44,className:`size-11 rounded-full object-cover`,draggable:!1})},e)),(0,Q.jsxs)(ze,{open:f,onOpenChange:p,children:[(0,Q.jsx)(Ze,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,className:c(`flex size-12 shrink-0 items-center justify-center rounded-xl border border-edge-subtle bg-surface-base text-xs font-medium text-fg-muted hover:border-edge hover:text-fg`,$e.press),children:i.avatarMore})}),(0,Q.jsx)(Ee,{children:(0,Q.jsxs)(Ye,{className:`z-[80] max-h-72 w-[min(22rem,calc(100vw-2rem))] overflow-y-auto rounded-xl border border-edge-subtle bg-surface-panel p-3 shadow-lg`,sideOffset:6,align:`end`,children:[(0,Q.jsx)(`p`,{className:`mb-2 text-xs font-medium text-fg-muted`,children:Fn(m,i)}),(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:Oe.map(e=>(0,Q.jsx)(`button`,{type:`button`,title:e,onClick:()=>void g(m,e),className:c(`flex size-11 shrink-0 items-center justify-center rounded-full border-2 transition-colors`,$e.press,v(m,e)?`border-accent ring-2 ring-accent/30`:`border-transparent hover:border-edge`),children:(0,Q.jsx)(`img`,{src:bt(m,e,88),alt:``,width:40,height:40,className:`size-10 rounded-full object-cover`,draggable:!1})},e))})]})})]})]}),(0,Q.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 border-t border-edge-subtle pt-3`,children:[(0,Q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:i.personaAvatar}),(0,Q.jsx)(h,{agentId:t,avatar:n,size:40}),n.trim()&&!J(n.trim())&&n.trim()!==`xopc:custom`?(0,Q.jsx)(`span`,{className:`truncate font-mono text-[10px] text-fg-muted`,title:n,children:n}):null]})]})]})}var Ln={name:``,description:``,language:``,creature:``,emoji:``,avatar:``};function Rn(e){let t={...Ln};if(!e.trim())return t;let n={name:`name`,description:`description`,language:`language`,creature:`creature`,emoji:`emoji`,avatar:`avatar`};for(let r of e.split(`
|
|
2
|
-
`)){let e=r.match(/^[-*]\s+\*\*(\w+):\*\*\s*(.*)/i);if(!e)continue;let i=n[e[1].toLowerCase()];if(!i)continue;let a=e[2].trim();/^_\(.*\)_$/.test(a)&&(a=``),t[i]=a}return t}function zn(e){return[`# IDENTITY.md - Who Am I?`,``,`- **Name:** ${e.name}`,`- **Description:** ${e.description}`,`- **Language:** ${e.language}`,`- **Creature:** ${e.creature}`,`- **Emoji:** ${e.emoji}`,`- **Avatar:** ${e.avatar}`,``].join(`
|
|
3
|
-
`)}var Bn=[{id:`professional`,labelEn:`Professional & Efficient`,labelZh:`专业高效`,emoji:`🎯`,content:`# SOUL.md - Who You Are
|
|
4
|
-
|
|
5
|
-
## Core Truths
|
|
6
|
-
|
|
7
|
-
**Be genuinely helpful, not performatively helpful.** Skip the filler words — just help. Actions speak louder than pleasantries.
|
|
8
|
-
|
|
9
|
-
**Be precise and efficient.** Value the user's time. Give concise, actionable answers. Expand only when asked.
|
|
10
|
-
|
|
11
|
-
**Earn trust through competence.** Be careful with external actions. Be bold with internal ones (reading, organizing, learning).
|
|
12
|
-
|
|
13
|
-
**Remember you're a guest.** You have access to someone's life. Treat it with respect.
|
|
14
|
-
|
|
15
|
-
## Boundaries
|
|
16
|
-
|
|
17
|
-
- Private things stay private. Period.
|
|
18
|
-
- When in doubt, ask before acting externally.
|
|
19
|
-
- Never send half-baked replies to messaging surfaces.
|
|
20
|
-
|
|
21
|
-
## Vibe
|
|
22
|
-
|
|
23
|
-
Professional, competent, and respectful. Concise when needed, thorough when it matters.`},{id:`casual`,labelEn:`Warm & Friendly`,labelZh:`轻松友好`,emoji:`😊`,content:`# SOUL.md - Who You Are
|
|
24
|
-
|
|
25
|
-
## Core Truths
|
|
26
|
-
|
|
27
|
-
**Be a good friend, not a corporate drone.** Be warm, genuine, and real. Skip the formality when it gets in the way.
|
|
28
|
-
|
|
29
|
-
**Have personality.** You're allowed to be amused, surprised, or excited. An assistant with no personality is just a search engine.
|
|
30
|
-
|
|
31
|
-
**Be resourceful before asking.** Try to figure it out first. Then ask if you're stuck.
|
|
32
|
-
|
|
33
|
-
**Earn trust by being reliable.** Show up, follow through, and remember what matters.
|
|
34
|
-
|
|
35
|
-
**Respect the intimacy.** You have access to someone's life. That's a privilege.
|
|
36
|
-
|
|
37
|
-
## Boundaries
|
|
38
|
-
|
|
39
|
-
- Private things stay private. Always.
|
|
40
|
-
- When in doubt, ask before acting externally.
|
|
41
|
-
- Be careful in group chats — you're not the user's voice.
|
|
42
|
-
|
|
43
|
-
## Vibe
|
|
44
|
-
|
|
45
|
-
Warm, friendly, and a little playful. Like a helpful friend who happens to know everything.`},{id:`geeky`,labelEn:`Geeky & Witty`,labelZh:`极客风格`,emoji:`🧑💻`,content:`# SOUL.md - Who You Are
|
|
46
|
-
|
|
47
|
-
## Core Truths
|
|
48
|
-
|
|
49
|
-
**Precision over politeness.** "This is broken" beats "This might be worth considering." Be direct.
|
|
50
|
-
|
|
51
|
-
**Have opinions.** Disagree, prefer things, find stuff interesting or dull. No personality = no value.
|
|
52
|
-
|
|
53
|
-
**Go deep.** When something is interesting, explore it. Surface-level answers are for search engines.
|
|
54
|
-
|
|
55
|
-
**Be resourceful.** Read the file. Check the context. Search for it. Come back with answers, not questions.
|
|
56
|
-
|
|
57
|
-
**Earn trust through competence.** Be careful with external actions. Be bold with internal ones.
|
|
58
|
-
|
|
59
|
-
## Boundaries
|
|
60
|
-
|
|
61
|
-
- Private things stay private.
|
|
62
|
-
- When in doubt, ask before acting externally.
|
|
63
|
-
- Never send half-baked replies.
|
|
64
|
-
|
|
65
|
-
## Vibe
|
|
66
|
-
|
|
67
|
-
Sharp, direct, slightly nerdy. The kind of engineer you'd want on your team — competent, opinionated, and occasionally funny.`},{id:`custom`,labelEn:`Custom`,labelZh:`自定义`,emoji:`✍️`,content:``}];function Vn(e){let t=e.trimStart();if(!t.startsWith(`---`))return e;let n=t.indexOf(`---`,3);return n===-1?e:t.slice(n+3).trimStart()}function Hn(e){let t=Vn(e).trim();if(!t)return`professional`;for(let e of Bn)if(e.id!==`custom`&&(t===e.content.trim()||Wn(t,e.id)>=2))return e.id;return`custom`}var Un={professional:/precise and efficient|Value the user's time|actionable answers/g,casual:/good friend|corporate drone|a little playful/g,geeky:/Precision over politeness|Go deep|slightly nerdy/g};function Wn(e,t){let n=Un[t];if(!n)return 0;let r=new RegExp(n.source,`g`),i=new Set,a;for(;(a=r.exec(e))!==null;)if(i.add(a[0]),i.size>=2)return i.size;return i.size}var Gn=[{value:`AI assistant`,labelEn:`AI Assistant`,labelZh:`AI 助手`},{value:`robot`,labelEn:`Robot`,labelZh:`机器人`},{value:`familiar`,labelEn:`Familiar`,labelZh:`精灵`},{value:`ghost in the machine`,labelEn:`Ghost in the machine`,labelZh:`机器幽灵`},{value:`digital companion`,labelEn:`Digital Companion`,labelZh:`数字伙伴`}];function Kn(e){let t=(0,Z.c)(185),{a:n,selected:r,busy:i,editName:a,setEditName:o,editDescription:l,setEditDescription:u,profileMarkdownLoading:p,profileDraft:m,updateIdentity:g,handleSoulTemplateChange:_,handleSoulContentChange:v,setAvatarDialogOpen:b,toggleSoulPreviewMode:x,autosave:S}=e,C=d(Yn),w=f(Jn),T;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=sn(),t[0]=T):T=t[0];let D=T,O;t[1]===C?O=t[2]:(O=(e,t)=>C===`zh`?t:e,t[1]=C,t[2]=O);let k=O;if(!r){let e;return t[3]===n.selectAgentHint?e=t[4]:(e=(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.selectAgentHint}),t[3]=n.selectAgentHint,t[4]=e),e}if(p||!m){let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(mt,{rows:4}),t[5]=e):e=t[5],e}let j=m.identity,M=m.soulTemplate,N=m.soulCustomContent,P=m.soulEditorNonce,L=m.soulPreviewMode,ee=m.avatarDialogOpen,B=S.onBlurCapture,V;t[6]!==S.error||t[7]!==S.status?(V=(0,Q.jsx)(ht,{status:S.status,error:S.error}),t[6]=S.error,t[7]=S.status,t[8]=V):V=t[8];let ne;t[9]!==j.avatar||t[10]!==r.id?(ne=(0,Q.jsx)(h,{agentId:r.id,avatar:j.avatar,size:36,className:`size-9 rounded-lg`}),t[9]=j.avatar,t[10]=r.id,t[11]=ne):ne=t[11];let ie;t[12]===b?ie=t[13]:(ie=()=>b(!0),t[12]=b,t[13]=ie);let H;t[14]!==n.avatarOpenSettingsAria||t[15]!==ie?(H={onClick:ie,ariaLabel:n.avatarOpenSettingsAria,id:`agent-avatar-settings`},t[14]=n.avatarOpenSettingsAria,t[15]=ie,t[16]=H):H=t[16];let ae;t[17]!==n.personaSectionIdentity||t[18]!==n.personaSectionIdentityHint||t[19]!==V||t[20]!==ne||t[21]!==H?(ae=(0,Q.jsx)(_t,{icon:q,title:n.personaSectionIdentity,subtitle:n.personaSectionIdentityHint,trailing:V,iconLeading:ne,iconInteractive:H}),t[17]=n.personaSectionIdentity,t[18]=n.personaSectionIdentityHint,t[19]=V,t[20]=ne,t[21]=H,t[22]=ae):ae=t[22];let U;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Q.jsx)(lt,{className:c(`fixed inset-0 bg-scrim backdrop-blur-[2px]`,Ie)}),t[23]=U):U=t[23];let G;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(G=c(`fixed left-1/2 top-1/2 w-[min(calc(100vw-2rem),26rem)] max-h-[min(90dvh,36rem)] -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-xl border border-edge bg-surface-panel p-4 shadow-popover dark:border-edge`,qe),t[24]=G):G=t[24];let se;t[25]===n.avatarPickerTitle?se=t[26]:(se=(0,Q.jsx)(he,{className:`text-base font-semibold text-fg`,children:n.avatarPickerTitle}),t[25]=n.avatarPickerTitle,t[26]=se);let K;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(K=c(be,`shrink-0 p-1.5 hover:bg-surface-base`),t[27]=K):K=t[27];let ce;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,Q.jsx)(E,{className:`size-4`,"aria-hidden":!0}),t[28]=ce):ce=t[28];let le;t[29]===n.closeDialogAria?le=t[30]:(le=(0,Q.jsx)(I,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,className:K,"aria-label":n.closeDialogAria,children:ce})}),t[29]=n.closeDialogAria,t[30]=le);let ue;t[31]!==se||t[32]!==le?(ue=(0,Q.jsxs)(`div`,{className:`mb-3 flex items-start justify-between gap-2`,children:[se,le]}),t[31]=se,t[32]=le,t[33]=ue):ue=t[33];let fe;t[34]===n.avatarRowHint?fe=t[35]:(fe=(0,Q.jsx)(oe,{className:`sr-only`,children:n.avatarRowHint}),t[34]=n.avatarRowHint,t[35]=fe);let pe;t[36]===g?pe=t[37]:(pe=e=>g({avatar:e}),t[36]=g,t[37]=pe);let me;t[38]!==n||t[39]!==j.avatar||t[40]!==r.id||t[41]!==pe?(me=(0,Q.jsx)(In,{agentId:r.id,value:j.avatar,onChange:pe,a:n}),t[38]=n,t[39]=j.avatar,t[40]=r.id,t[41]=pe,t[42]=me):me=t[42];let ge;t[43]!==ue||t[44]!==fe||t[45]!==me?(ge=(0,Q.jsxs)(y,{children:[U,(0,Q.jsxs)(z,{className:G,onOpenAutoFocus:qn,children:[ue,fe,me]})]}),t[43]=ue,t[44]=fe,t[45]=me,t[46]=ge):ge=t[46];let ve;t[47]!==ee||t[48]!==b||t[49]!==ge?(ve=(0,Q.jsx)(A,{open:ee,onOpenChange:b,children:ge}),t[47]=ee,t[48]=b,t[49]=ge,t[50]=ve):ve=t[50];let ye;t[51]===n.displayName?ye=t[52]:(ye=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:n.displayName}),t[51]=n.displayName,t[52]=ye);let xe;t[53]!==o||t[54]!==g?(xe=e=>{o(e.target.value),g({name:e.target.value})},t[53]=o,t[54]=g,t[55]=xe):xe=t[55];let Se;t[56]!==n.personaNamePlaceholder||t[57]!==a||t[58]!==xe?(Se=(0,Q.jsx)(`input`,{className:D,value:a,onChange:xe,placeholder:n.personaNamePlaceholder,autoComplete:`off`}),t[56]=n.personaNamePlaceholder,t[57]=a,t[58]=xe,t[59]=Se):Se=t[59];let Ce;t[60]!==ye||t[61]!==Se?(Ce=(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[ye,Se]}),t[60]=ye,t[61]=Se,t[62]=Ce):Ce=t[62];let we;t[63]===n.personaEmoji?we=t[64]:(we=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:n.personaEmoji}),t[63]=n.personaEmoji,t[64]=we);let Te;t[65]===g?Te=t[66]:(Te=e=>g({emoji:e.target.value}),t[65]=g,t[66]=Te);let Ee;t[67]!==n.personaEmojiPlaceholder||t[68]!==j.emoji||t[69]!==Te?(Ee=(0,Q.jsx)(`input`,{className:D,value:j.emoji,onChange:Te,placeholder:n.personaEmojiPlaceholder,autoComplete:`off`}),t[67]=n.personaEmojiPlaceholder,t[68]=j.emoji,t[69]=Te,t[70]=Ee):Ee=t[70];let De;t[71]!==we||t[72]!==Ee?(De=(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[we,Ee]}),t[71]=we,t[72]=Ee,t[73]=De):De=t[73];let Oe;t[74]===n.agentDescription?Oe=t[75]:(Oe=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:n.agentDescription}),t[74]=n.agentDescription,t[75]=Oe);let ke;t[76]===Symbol.for(`react.memo_cache_sentinel`)?(ke=c(D,`min-h-16 resize-y text-sm leading-relaxed`),t[76]=ke):ke=t[76];let Ae;t[77]!==u||t[78]!==g?(Ae=e=>{u(e.target.value),g({description:e.target.value})},t[77]=u,t[78]=g,t[79]=Ae):Ae=t[79];let je;t[80]!==n.agentDescriptionPlaceholder||t[81]!==l||t[82]!==Ae?(je=(0,Q.jsx)(`textarea`,{className:ke,value:l,onChange:Ae,placeholder:n.agentDescriptionPlaceholder,maxLength:4e3,rows:3,spellCheck:!0}),t[80]=n.agentDescriptionPlaceholder,t[81]=l,t[82]=Ae,t[83]=je):je=t[83];let Ne;t[84]!==Oe||t[85]!==je?(Ne=(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm sm:col-span-2`,children:[Oe,je]}),t[84]=Oe,t[85]=je,t[86]=Ne):Ne=t[86];let Pe;t[87]===n.personaCreature?Pe=t[88]:(Pe=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:n.personaCreature}),t[87]=n.personaCreature,t[88]=Pe);let Fe=Gn.some(e=>e.value===j.creature)?j.creature:`__custom__`,Le;t[89]===g?Le=t[90]:(Le=e=>{if(e.target.value===`__custom__`){g({creature:``});return}g({creature:e.target.value})},t[89]=g,t[90]=Le);let Re;t[91]===k?Re=t[92]:(Re=Gn.map(e=>(0,Q.jsx)(W,{value:e.value,children:k(e.labelEn,e.labelZh)},e.value)),t[91]=k,t[92]=Re);let ze;t[93]===k?ze=t[94]:(ze=k(`Custom…`,`自定义…`),t[93]=k,t[94]=ze);let Be;t[95]===ze?Be=t[96]:(Be=(0,Q.jsx)(W,{value:`__custom__`,children:ze}),t[95]=ze,t[96]=Be);let Ve;t[97]!==Fe||t[98]!==Le||t[99]!==Re||t[100]!==Be?(Ve=(0,Q.jsxs)(_e,{className:D,value:Fe,onChange:Le,children:[Re,Be]}),t[97]=Fe,t[98]=Le,t[99]=Re,t[100]=Be,t[101]=Ve):Ve=t[101];let He;t[102]!==n.personaCreaturePlaceholder||t[103]!==j.creature||t[104]!==g?(He=Gn.some(e=>e.value===j.creature)?null:(0,Q.jsx)(`input`,{className:c(D,`mt-1 text-xs`),value:j.creature,onChange:e=>g({creature:e.target.value}),placeholder:n.personaCreaturePlaceholder,autoComplete:`off`}),t[102]=n.personaCreaturePlaceholder,t[103]=j.creature,t[104]=g,t[105]=He):He=t[105];let J;t[106]!==Pe||t[107]!==Ve||t[108]!==He?(J=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5 text-sm`,children:[Pe,Ve,He]}),t[106]=Pe,t[107]=Ve,t[108]=He,t[109]=J):J=t[109];let Ue;t[110]!==Ce||t[111]!==De||t[112]!==Ne||t[113]!==J?(Ue=(0,Q.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[Ce,De,Ne,J]}),t[110]=Ce,t[111]=De,t[112]=Ne,t[113]=J,t[114]=Ue):Ue=t[114];let We;t[115]!==ve||t[116]!==Ue||t[117]!==ae?(We=(0,Q.jsxs)(vt,{children:[ae,ve,Ue]}),t[115]=ve,t[116]=Ue,t[117]=ae,t[118]=We):We=t[118];let Ge;t[119]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,Q.jsx)(Me,{className:`mt-0.5 size-4 shrink-0 text-accent-fg`,"aria-hidden":!0}),t[119]=Ge):Ge=t[119];let Ke;t[120]===n.sharedUserContextTitle?Ke=t[121]:(Ke=(0,Q.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:n.sharedUserContextTitle}),t[120]=n.sharedUserContextTitle,t[121]=Ke);let Je;t[122]===n.sharedUserContextHint?Je=t[123]:(Je=(0,Q.jsx)(`p`,{className:`mt-0.5 max-w-[68ch] text-xs leading-5 text-fg-muted`,children:n.sharedUserContextHint}),t[122]=n.sharedUserContextHint,t[123]=Je);let Ye;t[124]!==Ke||t[125]!==Je?(Ye=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[Ke,Je]}),t[124]=Ke,t[125]=Je,t[126]=Ye):Ye=t[126];let Xe;t[127]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=(0,Q.jsx)(R,{className:`size-3`,"aria-hidden":!0}),t[127]=Xe):Xe=t[127];let Ze;t[128]===n.sharedUserContextLink?Ze=t[129]:(Ze=(0,Q.jsxs)(s,{to:`/you`,className:`inline-flex shrink-0 items-center gap-1 text-xs font-medium text-accent-fg hover:underline`,children:[n.sharedUserContextLink,Xe]}),t[128]=n.sharedUserContextLink,t[129]=Ze);let Y;t[130]!==Ye||t[131]!==Ze?(Y=(0,Q.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl border border-edge-subtle bg-surface-panel px-4 py-3`,children:[Ge,Ye,Ze]}),t[130]=Ye,t[131]=Ze,t[132]=Y):Y=t[132];let Qe;t[133]!==n.personaSectionSoul||t[134]!==n.personaSectionSoulHint?(Qe=(0,Q.jsx)(_t,{icon:te,title:n.personaSectionSoul,subtitle:n.personaSectionSoulHint}),t[133]=n.personaSectionSoul,t[134]=n.personaSectionSoulHint,t[135]=Qe):Qe=t[135];let $e;t[136]===n.personaSoulTemplate?$e=t[137]:($e=(0,Q.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:n.personaSoulTemplate}),t[136]=n.personaSoulTemplate,t[137]=$e);let et;t[138]===_?et=t[139]:(et=e=>_(e.target.value),t[138]=_,t[139]=et);let X;t[140]===k?X=t[141]:(X=Bn.map(e=>(0,Q.jsxs)(W,{value:e.id,children:[e.emoji,` `,k(e.labelEn,e.labelZh)]},e.id)),t[140]=k,t[141]=X);let tt;t[142]!==i||t[143]!==M||t[144]!==et||t[145]!==X?(tt=(0,Q.jsx)(_e,{className:D,value:M,onChange:et,disabled:i,children:X}),t[142]=i,t[143]=M,t[144]=et,t[145]=X,t[146]=tt):tt=t[146];let nt;t[147]===n.personaTemplateHint?nt=t[148]:(nt=(0,Q.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:n.personaTemplateHint}),t[147]=n.personaTemplateHint,t[148]=nt);let rt;t[149]!==$e||t[150]!==tt||t[151]!==nt?(rt=(0,Q.jsxs)(`div`,{className:`mb-4 flex flex-col gap-2 sm:max-w-sm`,children:[$e,tt,nt]}),t[149]=$e,t[150]=tt,t[151]=nt,t[152]=rt):rt=t[152];let it;t[153]===n.personaBehaviorEditorLabel?it=t[154]:(it=(0,Q.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:n.personaBehaviorEditorLabel}),t[153]=n.personaBehaviorEditorLabel,t[154]=it);let at;t[155]===Symbol.for(`react.memo_cache_sentinel`)?(at=c(be,`inline-flex size-9 shrink-0 items-center justify-center rounded-md p-0 hover:bg-surface-hover`),t[155]=at):at=t[155];let ot=L?n.personaSoulEdit:n.personaSoulPreview,st=L?n.personaSoulEdit:n.personaSoulPreview,ct;t[156]===L?ct=t[157]:(ct=L?(0,Q.jsx)(re,{className:`size-4`,"aria-hidden":!0}):(0,Q.jsx)(F,{className:`size-4`,"aria-hidden":!0}),t[156]=L,t[157]=ct);let dt;t[158]!==ot||t[159]!==st||t[160]!==ct||t[161]!==x?(dt=(0,Q.jsx)(`button`,{type:`button`,className:at,title:ot,"aria-label":st,onClick:x,children:ct}),t[158]=ot,t[159]=st,t[160]=ct,t[161]=x,t[162]=dt):dt=t[162];let ft;t[163]!==it||t[164]!==dt?(ft=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[it,dt]}),t[163]=it,t[164]=dt,t[165]=ft):ft=t[165];let pt;t[166]===Symbol.for(`react.memo_cache_sentinel`)?(pt=c(D,`flex min-h-64 flex-col overflow-hidden p-0`),t[166]=pt):pt=t[166];let gt;t[167]!==v||t[168]!==w||t[169]!==N||t[170]!==P||t[171]!==L?(gt=(0,Q.jsx)(`div`,{className:pt,children:L?(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:(0,Q.jsx)(de,{content:N})}):(0,Q.jsx)(ut,{initialContent:N,onChange:v,isDark:w,className:`min-h-0 flex-1`},`soul-${P}`)}),t[167]=v,t[168]=w,t[169]=N,t[170]=P,t[171]=L,t[172]=gt):gt=t[172];let yt;t[173]!==ft||t[174]!==gt?(yt=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[ft,gt]}),t[173]=ft,t[174]=gt,t[175]=yt):yt=t[175];let bt;t[176]!==Qe||t[177]!==rt||t[178]!==yt?(bt=(0,Q.jsxs)(vt,{children:[Qe,rt,yt]}),t[176]=Qe,t[177]=rt,t[178]=yt,t[179]=bt):bt=t[179];let xt;return t[180]!==S.onBlurCapture||t[181]!==We||t[182]!==Y||t[183]!==bt?(xt=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-8`,onBlurCapture:B,children:[We,Y,bt]}),t[180]=S.onBlurCapture,t[181]=We,t[182]=Y,t[183]=bt,t[184]=xt):xt=t[184],xt}function qn(e){return e.preventDefault()}function Jn(e){return e.resolved===`dark`}function Yn(e){return e.language}function Xn(e){let t=(0,Z.c)(13),{label:n,value:r,badge:i,mono:a}=e,o;t[0]===n?o=t[1]:(o=(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-fg-subtle`,children:n}),t[0]=n,t[1]=o);let s;t[2]===i?s=t[3]:(s=(0,Q.jsx)(`span`,{className:`shrink-0 rounded-full bg-surface-hover px-2 py-0.5 text-xs font-medium text-fg-muted`,children:i}),t[2]=i,t[3]=s);let c;t[4]!==o||t[5]!==s?(c=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[o,s]}),t[4]=o,t[5]=s,t[6]=c):c=t[6];let l=a?`mt-2 truncate font-mono text-xs text-fg`:`mt-2 truncate text-sm font-medium text-fg`,u;t[7]!==l||t[8]!==r?(u=(0,Q.jsx)(`p`,{className:l,children:r}),t[7]=l,t[8]=r,t[9]=u):u=t[9];let d;return t[10]!==c||t[11]!==u?(d=(0,Q.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/80 px-4 py-3 shadow-surface`,children:[c,u]}),t[10]=c,t[11]=u,t[12]=d):d=t[12],d}function Zn(e){let t=(0,Z.c)(12),{icon:n,label:r,value:i}=e,a;t[0]===n?a=t[1]:(a=(0,Q.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-surface-hover text-fg-muted`,children:(0,Q.jsx)(n,{className:`size-4`,strokeWidth:1.8,"aria-hidden":!0})}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-fg-subtle`,children:r}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=(0,Q.jsx)(`p`,{className:`mt-1 truncate text-sm font-medium text-fg`,children:i}),t[4]=i,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-surface-panel/80 px-4 py-3 shadow-surface`,children:[a,c]}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}function Qn(e){let t=(0,Z.c)(117),{a:n,selected:r,defaultModel:i,defaultWorkspace:a,isTuiDefault:o,isTuiDefaultInherited:s,busy:c,onSetDefault:l,onSetTuiDefault:u,onTryInChat:d}=e,f;t[0]!==n||t[1]!==r?(f=ye(r,n),t[0]=n,t[1]=r,t[2]=f):f=t[2];let p=f,m;t[3]!==n||t[4]!==r?(m=je(r,n)||n.listNoDescription,t[3]=n,t[4]=r,t[5]=m):m=t[5];let g=m,_;t[6]!==n.listUnsetValue||t[7]!==i||t[8]!==r.model?.primary?(_=r.model?.primary?.trim()||i||n.listUnsetValue,t[6]=n.listUnsetValue,t[7]=i,t[8]=r.model?.primary,t[9]=_):_=t[9];let v=_,y;t[10]!==n.listUnsetValue||t[11]!==a||t[12]!==r.workspace?(y=r.workspace?.trim()||a||n.listUnsetValue,t[10]=n.listUnsetValue,t[11]=a,t[12]=r.workspace,t[13]=y):y=t[13];let b=y,x=r.model?.primary?.trim()?n.inheritance.badgeOverride:n.inheritance.badgeInherit,S=r.workspace?.trim()&&r.workspace.trim()!==a.trim()?n.inheritance.badgeOverride:n.inheritance.badgeInherit,C=r.tools.effectiveDisable.length,w=r.skills.effectiveAllowlist?.length,T;t[14]!==r.avatar||t[15]!==r.id?(T=(0,Q.jsx)(`div`,{className:`flex size-14 shrink-0 items-center justify-center overflow-hidden rounded-2xl bg-surface-base ring-1 ring-edge-subtle/50`,children:(0,Q.jsx)(h,{agentId:r.id,avatar:r.avatar,size:56,className:`size-full`})}),t[14]=r.avatar,t[15]=r.id,t[16]=T):T=t[16];let E;t[17]===p?E=t[18]:(E=(0,Q.jsx)(`h2`,{className:`truncate text-lg font-semibold text-fg`,children:p}),t[17]=p,t[18]=E);let D;t[19]!==n.globalDefaultBadge||t[20]!==r.isDefault?(D=r.isDefault?(0,Q.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2 py-0.5 text-xs font-medium text-accent`,children:n.globalDefaultBadge}):null,t[19]=n.globalDefaultBadge,t[20]=r.isDefault,t[21]=D):D=t[21];let O;t[22]!==n.tuiDefaultBadge||t[23]!==n.tuiDefaultInheritedBadge||t[24]!==o||t[25]!==s?(O=o?(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-xs font-medium text-fg`,children:s?n.tuiDefaultInheritedBadge:n.tuiDefaultBadge}):null,t[22]=n.tuiDefaultBadge,t[23]=n.tuiDefaultInheritedBadge,t[24]=o,t[25]=s,t[26]=O):O=t[26];let k;t[27]!==E||t[28]!==D||t[29]!==O?(k=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[E,D,O]}),t[27]=E,t[28]=D,t[29]=O,t[30]=k):k=t[30];let A;t[31]===r.id?A=t[32]:(A=(0,Q.jsx)(`p`,{className:`mt-1 truncate font-mono text-xs text-fg-muted`,children:r.id}),t[31]=r.id,t[32]=A);let j;t[33]!==A||t[34]!==k?(j=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[k,A]}),t[33]=A,t[34]=k,t[35]=j):j=t[35];let M;t[36]!==j||t[37]!==T?(M=(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-start gap-4`,children:[T,j]}),t[36]=j,t[37]=T,t[38]=M):M=t[38];let N;t[39]!==n.tryInChat||t[40]!==c||t[41]!==d?(N=d?(0,Q.jsxs)(X,{type:`button`,disabled:c,onClick:d,children:[(0,Q.jsx)(P,{className:`size-4`,"aria-hidden":!0}),n.tryInChat]}):null,t[39]=n.tryInChat,t[40]=c,t[41]=d,t[42]=N):N=t[42];let F;t[43]!==n.setDefault||t[44]!==c||t[45]!==l||t[46]!==r.isDefault?(F=r.isDefault?null:(0,Q.jsx)(X,{type:`button`,variant:`secondary`,disabled:c,onClick:l,children:n.setDefault}),t[43]=n.setDefault,t[44]=c,t[45]=l,t[46]=r.isDefault,t[47]=F):F=t[47];let I;t[48]!==n.setTuiDefault||t[49]!==c||t[50]!==o||t[51]!==u?(I=o?null:(0,Q.jsx)(X,{type:`button`,variant:`secondary`,disabled:c,onClick:u,children:n.setTuiDefault}),t[48]=n.setTuiDefault,t[49]=c,t[50]=o,t[51]=u,t[52]=I):I=t[52];let L;t[53]!==N||t[54]!==F||t[55]!==I?(L=(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-2`,children:[N,F,I]}),t[53]=N,t[54]=F,t[55]=I,t[56]=L):L=t[56];let R;t[57]!==M||t[58]!==L?(R=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between`,children:[M,L]}),t[57]=M,t[58]=L,t[59]=R):R=t[59];let z;t[60]===g?z=t[61]:(z=(0,Q.jsx)(`p`,{className:`w-full text-sm leading-6 text-fg-muted`,children:g}),t[60]=g,t[61]=z);let ee;t[62]!==R||t[63]!==z?(ee=(0,Q.jsx)(vt,{children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[R,z]})}),t[62]=R,t[63]=z,t[64]=ee):ee=t[64];let B;t[65]!==n.overviewRuntimeHint||t[66]!==n.overviewRuntimeTitle?(B=(0,Q.jsx)(_t,{icon:q,title:n.overviewRuntimeTitle,subtitle:n.overviewRuntimeHint}),t[65]=n.overviewRuntimeHint,t[66]=n.overviewRuntimeTitle,t[67]=B):B=t[67];let te;t[68]!==n.modelPrimary||t[69]!==x||t[70]!==v?(te=(0,Q.jsx)(Xn,{label:n.modelPrimary,value:v,badge:x,mono:!0}),t[68]=n.modelPrimary,t[69]=x,t[70]=v,t[71]=te):te=t[71];let V;t[72]!==n.workspacePath||t[73]!==S||t[74]!==b?(V=(0,Q.jsx)(Xn,{label:n.workspacePath,value:b,badge:S,mono:!0}),t[72]=n.workspacePath,t[73]=S,t[74]=b,t[75]=V):V=t[75];let ne;t[76]!==te||t[77]!==V?(ne=(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[te,V]}),t[76]=te,t[77]=V,t[78]=ne):ne=t[78];let re;t[79]!==B||t[80]!==ne?(re=(0,Q.jsxs)(vt,{children:[B,ne]}),t[79]=B,t[80]=ne,t[81]=re):re=t[81];let ie;t[82]!==n.overviewCapabilitiesHint||t[83]!==n.overviewCapabilitiesTitle?(ie=(0,Q.jsx)(_t,{icon:ct,title:n.overviewCapabilitiesTitle,subtitle:n.overviewCapabilitiesHint}),t[82]=n.overviewCapabilitiesHint,t[83]=n.overviewCapabilitiesTitle,t[84]=ie):ie=t[84];let H;t[85]!==n.listToolsAllEnabled||t[86]!==n.listToolsDisabledCount||t[87]!==C?(H=C>0?n.listToolsDisabledCount.replace(`{{count}}`,String(C)):n.listToolsAllEnabled,t[85]=n.listToolsAllEnabled,t[86]=n.listToolsDisabledCount,t[87]=C,t[88]=H):H=t[88];let U;t[89]!==n.listToolsLabel||t[90]!==H?(U=(0,Q.jsx)(Zn,{icon:ae,label:n.listToolsLabel,value:H}),t[89]=n.listToolsLabel,t[90]=H,t[91]=U):U=t[91];let W;t[92]!==n.listInheritedValue||t[93]!==n.listSkillsCount||t[94]!==w?(W=w?n.listSkillsCount.replace(`{{count}}`,String(w)):n.listInheritedValue,t[92]=n.listInheritedValue,t[93]=n.listSkillsCount,t[94]=w,t[95]=W):W=t[95];let G;t[96]!==n.listSkillsLabel||t[97]!==W?(G=(0,Q.jsx)(Zn,{icon:q,label:n.listSkillsLabel,value:W}),t[96]=n.listSkillsLabel,t[97]=W,t[98]=G):G=t[98];let oe;t[99]!==n.connectionsTitle||t[100]!==n.overviewConnectionsManaged?(oe=(0,Q.jsx)(Zn,{icon:Pe,label:n.connectionsTitle,value:n.overviewConnectionsManaged}),t[99]=n.connectionsTitle,t[100]=n.overviewConnectionsManaged,t[101]=oe):oe=t[101];let se;t[102]!==n.overviewSharedMemoryLabel||t[103]!==n.overviewSharedMemoryValue?(se=(0,Q.jsx)(Zn,{icon:Me,label:n.overviewSharedMemoryLabel,value:n.overviewSharedMemoryValue}),t[102]=n.overviewSharedMemoryLabel,t[103]=n.overviewSharedMemoryValue,t[104]=se):se=t[104];let K;t[105]!==U||t[106]!==G||t[107]!==oe||t[108]!==se?(K=(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[U,G,oe,se]}),t[105]=U,t[106]=G,t[107]=oe,t[108]=se,t[109]=K):K=t[109];let ce;t[110]!==ie||t[111]!==K?(ce=(0,Q.jsxs)(vt,{children:[ie,K]}),t[110]=ie,t[111]=K,t[112]=ce):ce=t[112];let le;return t[113]!==ee||t[114]!==re||t[115]!==ce?(le=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-5 overflow-y-auto`,children:[ee,re,ce]}),t[113]=ee,t[114]=re,t[115]=ce,t[116]=le):le=t[116],le}var $n=[`deep`,`fast`,`cheap`,`code`,`review`];function er(e){return $n.includes(e)}function tr(e){let{rows:t,onChange:n,disabled:r,defaultRole:i,chat:a,labels:o}=e,{data:s=[]}=p(fe,D,{revalidateOnFocus:!1}),c=(0,$.useMemo)(()=>new Set(s.filter(e=>e.vision===!0).map(e=>e.id)),[s]),l=(0,$.useRef)([]),u=(0,$.useRef)(0);for(;l.current.length<t.length;)l.current.push(`typed-model-row-${u.current++}`);l.current.length>t.length&&(l.current.length=t.length);let d=(e,r)=>{n(t.map((t,n)=>n===e?{...t,...r}:t))},f=(e,n,r)=>{let i=t[e];if(!i)return;let a=[...i.fallbacks??[]];a[n]=r,d(e,{fallbacks:a})},m=e=>{let n=t[e];n&&d(e,{fallbacks:[...n.fallbacks??[],``]})},h=(e,n)=>{let r=t[e];r&&d(e,{fallbacks:(r.fallbacks??[]).filter((e,t)=>t!==n)})},g=e=>{l.current.splice(e,1),n(t.filter((t,n)=>n!==e))},_=e=>{l.current.push(`typed-model-row-${u.current++}`),n([...t,e])},v=t.find(e=>e.model.trim())?.model??``,y=t.map((e,t)=>({row:e,index:t})),b=$n.map(e=>y.find(t=>t.row.id===e)).filter(e=>!!e),x=y.filter(e=>!er(e.row.id)),S=$n.filter(e=>!t.some(t=>t.id===e)),C=(e,t)=>{let{row:n,index:s}=e,u=n.id===i,p=[n.model,...n.fallbacks??[]].some(e=>c.has(e.trim())),_=er(n.id)?o.roleNames[n.id]:o.id,v=er(n.id)?o.roleDescriptions[n.id]:``;return(0,Q.jsxs)(`div`,{className:`grid gap-3 rounded-lg bg-surface-panel/70 p-3 shadow-surface lg:grid-cols-[minmax(0,11rem)_minmax(0,1fr)_auto] lg:items-start`,children:[t.recommended?(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:_}),u?(0,Q.jsx)(`span`,{className:`shrink-0 rounded-full border border-accent/25 bg-accent/10 px-2 py-0.5 text-[11px] font-medium text-accent`,children:o.defaultBadge}):null,p?(0,Q.jsx)(`span`,{className:`shrink-0 rounded-full border border-accent/25 bg-accent/10 px-2 py-0.5 text-[11px] font-medium text-accent`,children:o.visionBadge}):null]}),(0,Q.jsx)(`div`,{className:`mt-1 truncate font-mono text-[11px] text-fg-subtle`,children:n.id}),v?(0,Q.jsx)(`div`,{className:`mt-1 line-clamp-2 text-xs text-fg-muted`,children:v}):null]}):(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-xs font-medium text-fg-muted`,children:[(0,Q.jsx)(`span`,{children:o.id}),p?(0,Q.jsx)(`span`,{className:`shrink-0 rounded-full border border-accent/25 bg-accent/10 px-2 py-0.5 text-[11px] font-medium text-accent`,children:o.visionBadge}):null]}),(0,Q.jsx)(`input`,{type:`text`,className:Ot(),value:n.id,disabled:r,placeholder:o.idPlaceholder,"aria-label":o.id,onChange:e=>d(s,{id:e.target.value.toLowerCase()})})]}),(0,Q.jsxs)(`div`,{className:`grid min-w-0 gap-2`,children:[(0,Q.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:o.primaryModel}),(0,Q.jsx)(V,{value:n.model,disabled:r,placeholder:a.modelPlaceholder,searchPlaceholder:a.modelSearchPlaceholder,noMatches:a.modelNoMatches,className:`w-full max-w-none`,contentAlign:`start`,onChange:e=>d(s,{model:e})}),p?(0,Q.jsx)(`div`,{className:`text-xs leading-relaxed text-fg-muted`,children:o.visionAutoHint}):null]}),(0,Q.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:o.fallbackModels}),(0,Q.jsxs)(X,{type:`button`,variant:`secondary`,className:`h-7 gap-1 px-2 text-xs`,disabled:r,onClick:()=>m(s),children:[(0,Q.jsx)(se,{className:`size-3.5`,strokeWidth:1.75}),o.addFallback]})]}),(n.fallbacks??[]).length>0?(0,Q.jsx)(`div`,{className:`grid gap-1.5`,children:(n.fallbacks??[]).map((e,t)=>(0,Q.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_auto] gap-2`,children:[(0,Q.jsx)(V,{value:e,disabled:r,placeholder:o.fallbackPlaceholder,searchPlaceholder:a.modelSearchPlaceholder,noMatches:a.modelNoMatches,className:`w-full max-w-none`,contentAlign:`start`,onChange:e=>f(s,t,e)}),(0,Q.jsx)(X,{type:`button`,variant:`secondary`,className:`shrink-0 px-2`,disabled:r,"aria-label":o.removeFallback,onClick:()=>h(s,t),children:(0,Q.jsx)(ge,{className:`size-4`,strokeWidth:1.75})})]},`${l.current[s]??s}-fallback-${t}`))}):(0,Q.jsx)(`div`,{className:`rounded-lg bg-surface-panel/60 px-3 py-2 text-xs text-fg-muted shadow-surface`,children:o.fallbackEmptyHint})]}),(0,Q.jsx)(`input`,{type:`text`,className:Ot(),value:n.description,disabled:r,placeholder:o.descriptionPlaceholder,"aria-label":o.description,onChange:e=>d(s,{description:e.target.value})})]}),(0,Q.jsx)(X,{type:`button`,variant:`secondary`,className:`shrink-0 sm:mt-0`,disabled:r||u,"aria-label":o.remove,onClick:()=>g(s),children:(0,Q.jsx)(ge,{className:`size-4`,strokeWidth:1.75})})]},l.current[s]??`typed-model-row-${s}`)};return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium uppercase tracking-wide text-fg-muted`,children:o.recommendedTitle}),b.map(e=>C(e,{recommended:!0})),S.length>0?(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-2 pt-1`,children:S.map(e=>(0,Q.jsxs)(X,{type:`button`,variant:`secondary`,className:`h-8 gap-1.5 rounded-lg px-2.5 text-xs`,disabled:r,onClick:()=>_({id:e,description:o.roleDescriptions[e],model:v,fallbacks:[]}),children:[(0,Q.jsx)(se,{className:`size-3.5 shrink-0`,strokeWidth:1.75}),o.addPurpose.replace(`{name}`,o.roleNames[e])]},e))}):null]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium uppercase tracking-wide text-fg-muted`,children:o.customTitle}),x.length>0?x.map(e=>C(e,{recommended:!1})):(0,Q.jsx)(`div`,{className:`rounded-lg bg-surface-panel/60 px-3 py-2 text-sm text-fg-muted shadow-surface`,children:o.noCustomRoles})]}),(0,Q.jsxs)(X,{type:`button`,variant:`secondary`,className:`w-fit gap-1.5`,disabled:r,onClick:()=>_({id:``,description:``,model:v,fallbacks:[]}),children:[(0,Q.jsx)(se,{className:`size-4 shrink-0`,strokeWidth:1.75}),o.add]})]})}function nr(e){let t=(0,Z.c)(81),{a:n,chat:r,selected:i,busy:a,modelRows:o,setModelRows:c,onSaveModels:l,onClearModelsEntry:u}=e,d,f;if(t[0]!==o||t[1]!==i.typedModels.effective){let e=Tt(i.typedModels.effective);t[4]===o?d=t[5]:(d=JSON.stringify(kt(o)?.roles??{}),t[4]=o,t[5]=d),f=JSON.stringify(kt(e)?.roles??{}),t[0]=o,t[1]=i.typedModels.effective,t[2]=d,t[3]=f}else d=t[2],f=t[3];let p=d!==f,m;t[6]!==p||t[7]!==o||t[8]!==l?(m={value:o,dirty:p,onSave:l},t[6]=p,t[7]=o,t[8]=l,t[9]=m):m=t[9];let h=gt(m),g;t[10]!==h.error||t[11]!==h.status?(g=(0,Q.jsx)(ht,{status:h.status,error:h.error}),t[10]=h.error,t[11]=h.status,t[12]=g):g=t[12];let _;t[13]!==n.modelsTabHint||t[14]!==n.modelsTabTitle||t[15]!==g?(_=(0,Q.jsx)(_t,{className:`shrink-0`,icon:Ue,title:n.modelsTabTitle,subtitle:n.modelsTabHint,trailing:g}),t[13]=n.modelsTabHint,t[14]=n.modelsTabTitle,t[15]=g,t[16]=_):_=t[16];let v;t[17]===n.modelsPresetLabel?v=t[18]:(v=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:n.modelsPresetLabel}),t[17]=n.modelsPresetLabel,t[18]=v);let y;t[19]===i.typedModels.preset?y=t[20]:(y=Et(i.typedModels.preset),t[19]=i.typedModels.preset,t[20]=y);let b;t[21]!==v||t[22]!==y?(b=(0,Q.jsxs)(`div`,{children:[v,` `,y]}),t[21]=v,t[22]=y,t[23]=b):b=t[23];let x;t[24]===n.modelsEffectiveLabel?x=t[25]:(x=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:n.modelsEffectiveLabel}),t[24]=n.modelsEffectiveLabel,t[25]=x);let S;t[26]===i.typedModels.effective?S=t[27]:(S=Et(i.typedModels.effective),t[26]=i.typedModels.effective,t[27]=S);let C;t[28]!==x||t[29]!==S?(C=(0,Q.jsxs)(`div`,{children:[x,` `,S]}),t[28]=x,t[29]=S,t[30]=C):C=t[30];let w;t[31]!==C||t[32]!==b?(w=(0,Q.jsxs)(`div`,{className:`mb-4 grid gap-2 rounded-lg bg-surface-panel/60 p-3 text-xs text-fg-muted shadow-surface`,children:[b,C]}),t[31]=C,t[32]=b,t[33]=w):w=t[33];let T;t[34]!==n.addTypedModel||t[35]!==n.addTypedModelPurpose||t[36]!==n.removeTypedModel||t[37]!==n.typedModelAddFallback||t[38]!==n.typedModelCustomTitle||t[39]!==n.typedModelDefaultBadge||t[40]!==n.typedModelDescriptionLabel||t[41]!==n.typedModelDescriptionPlaceholder||t[42]!==n.typedModelFallbackEmptyHint||t[43]!==n.typedModelFallbackModelsLabel||t[44]!==n.typedModelFallbackPlaceholder||t[45]!==n.typedModelIdLabel||t[46]!==n.typedModelIdPlaceholder||t[47]!==n.typedModelNoCustomRoles||t[48]!==n.typedModelPrimaryModelLabel||t[49]!==n.typedModelRecommendedTitle||t[50]!==n.typedModelRemoveFallback||t[51]!==n.typedModelRoleDescriptions||t[52]!==n.typedModelRoleNames||t[53]!==n.typedModelVisionAutoHint||t[54]!==n.typedModelVisionBadge?(T={id:n.typedModelIdLabel,description:n.typedModelDescriptionLabel,primaryModel:n.typedModelPrimaryModelLabel,fallbackModels:n.typedModelFallbackModelsLabel,addFallback:n.typedModelAddFallback,removeFallback:n.typedModelRemoveFallback,fallbackPlaceholder:n.typedModelFallbackPlaceholder,fallbackEmptyHint:n.typedModelFallbackEmptyHint,add:n.addTypedModel,remove:n.removeTypedModel,recommendedTitle:n.typedModelRecommendedTitle,customTitle:n.typedModelCustomTitle,defaultBadge:n.typedModelDefaultBadge,visionBadge:n.typedModelVisionBadge,visionAutoHint:n.typedModelVisionAutoHint,addPurpose:n.addTypedModelPurpose,noCustomRoles:n.typedModelNoCustomRoles,idPlaceholder:n.typedModelIdPlaceholder,descriptionPlaceholder:n.typedModelDescriptionPlaceholder,roleNames:n.typedModelRoleNames,roleDescriptions:n.typedModelRoleDescriptions},t[34]=n.addTypedModel,t[35]=n.addTypedModelPurpose,t[36]=n.removeTypedModel,t[37]=n.typedModelAddFallback,t[38]=n.typedModelCustomTitle,t[39]=n.typedModelDefaultBadge,t[40]=n.typedModelDescriptionLabel,t[41]=n.typedModelDescriptionPlaceholder,t[42]=n.typedModelFallbackEmptyHint,t[43]=n.typedModelFallbackModelsLabel,t[44]=n.typedModelFallbackPlaceholder,t[45]=n.typedModelIdLabel,t[46]=n.typedModelIdPlaceholder,t[47]=n.typedModelNoCustomRoles,t[48]=n.typedModelPrimaryModelLabel,t[49]=n.typedModelRecommendedTitle,t[50]=n.typedModelRemoveFallback,t[51]=n.typedModelRoleDescriptions,t[52]=n.typedModelRoleNames,t[53]=n.typedModelVisionAutoHint,t[54]=n.typedModelVisionBadge,t[55]=T):T=t[55];let E;t[56]!==a||t[57]!==r||t[58]!==o||t[59]!==i.typedModels.defaultRole||t[60]!==c||t[61]!==T?(E=(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:(0,Q.jsx)(tr,{rows:o,onChange:c,disabled:a,defaultRole:i.typedModels.defaultRole,chat:r,labels:T})}),t[56]=a,t[57]=r,t[58]=o,t[59]=i.typedModels.defaultRole,t[60]=c,t[61]=T,t[62]=E):E=t[62];let D;t[63]===u?D=t[64]:(D=()=>void u(),t[63]=u,t[64]=D);let O;t[65]!==n.modelsResetInherit||t[66]!==a||t[67]!==D?(O=(0,Q.jsx)(X,{type:`button`,variant:`secondary`,disabled:a,onClick:D,children:n.modelsResetInherit}),t[65]=n.modelsResetInherit,t[66]=a,t[67]=D,t[68]=O):O=t[68];let k,A;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(k=M(`models`),A=(0,Q.jsx)(Te,{className:`size-4`,"aria-hidden":!0}),t[69]=k,t[70]=A):(k=t[69],A=t[70]);let j;t[71]===n.modelsDefaultsLink?j=t[72]:(j=(0,Q.jsx)(X,{asChild:!0,variant:`ghost`,children:(0,Q.jsxs)(s,{to:k,children:[A,n.modelsDefaultsLink]})}),t[71]=n.modelsDefaultsLink,t[72]=j);let N;t[73]!==O||t[74]!==j?(N=(0,Q.jsxs)(`div`,{className:`mt-4 flex shrink-0 flex-wrap gap-2`,children:[O,j]}),t[73]=O,t[74]=j,t[75]=N):N=t[75];let P;return t[76]!==w||t[77]!==E||t[78]!==N||t[79]!==_?(P=(0,Q.jsxs)(vt,{className:`flex min-h-0 flex-1 flex-col`,children:[_,w,E,N]}),t[76]=w,t[77]=E,t[78]=N,t[79]=_,t[80]=P):P=t[80],P}function rr(e){let t=(0,Z.c)(40),{a:n,chat:r,selected:i,busy:a,editWorkspace:o,setEditWorkspace:s,onSaveWorkspace:l,modelRows:u,setModelRows:d,onSaveModels:f,onClearModelsEntry:p}=e,m;t[0]===o?m=t[1]:(m=o.trim(),t[0]=o,t[1]=m);let h=m!==i.workspace,g;t[2]!==o||t[3]!==l||t[4]!==h?(g={value:o,dirty:h,onSave:l},t[2]=o,t[3]=l,t[4]=h,t[5]=g):g=t[5];let _=gt(g),v=_.onBlurCapture,y;t[6]!==_.error||t[7]!==_.status?(y=(0,Q.jsx)(ht,{status:_.status,error:_.error}),t[6]=_.error,t[7]=_.status,t[8]=y):y=t[8];let b;t[9]!==n.runtimeWorkspaceHint||t[10]!==n.runtimeWorkspaceTitle||t[11]!==y?(b=(0,Q.jsx)(_t,{icon:ie,title:n.runtimeWorkspaceTitle,subtitle:n.runtimeWorkspaceHint,trailing:y}),t[9]=n.runtimeWorkspaceHint,t[10]=n.runtimeWorkspaceTitle,t[11]=y,t[12]=b):b=t[12];let x;t[13]===n.workspacePath?x=t[14]:(x=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:n.workspacePath}),t[13]=n.workspacePath,t[14]=x);let S=r.workingDirectory,C;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(C=c(sn(),`font-mono text-xs`),t[15]=C):C=t[15];let w;t[16]!==a||t[17]!==r.workingDirectory||t[18]!==o||t[19]!==s?(w=(0,Q.jsx)(Nt,{value:o,onChange:s,disabled:a,wd:S,inputClassName:C}),t[16]=a,t[17]=r.workingDirectory,t[18]=o,t[19]=s,t[20]=w):w=t[20];let T;t[21]!==x||t[22]!==w?(T=(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[x,w]}),t[21]=x,t[22]=w,t[23]=T):T=t[23];let E;t[24]!==b||t[25]!==T||t[26]!==_.onBlurCapture?(E=(0,Q.jsxs)(vt,{onBlurCapture:v,children:[b,T]}),t[24]=b,t[25]=T,t[26]=_.onBlurCapture,t[27]=E):E=t[27];let D;t[28]!==n||t[29]!==a||t[30]!==r||t[31]!==u||t[32]!==p||t[33]!==f||t[34]!==i||t[35]!==d?(D=(0,Q.jsx)(`section`,{className:`min-h-[34rem]`,children:(0,Q.jsx)(nr,{a:n,chat:r,selected:i,busy:a,modelRows:u,setModelRows:d,onSaveModels:f,onClearModelsEntry:p})}),t[28]=n,t[29]=a,t[30]=r,t[31]=u,t[32]=p,t[33]=f,t[34]=i,t[35]=d,t[36]=D):D=t[36];let O;return t[37]!==E||t[38]!==D?(O=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-6 overflow-y-auto`,children:[E,D]}),t[37]=E,t[38]=D,t[39]=O):O=t[39],O}function ir(e){let t=(0,Z.c)(109),{a:n,chat:r,cCron:i,selected:a,panel:o,data:s,busy:c,editName:l,setEditName:u,editDescription:d,setEditDescription:f,editWorkspace:p,setEditWorkspace:m,onSaveWorkspace:h,editModel:g,defaultModel:_,defaultWorkspace:v,onSetDefault:y,onSetTuiDefault:b,isTuiDefault:x,isTuiDefaultInherited:S,onDelete:C,capabilityPresets:w,defaultPresetId:T,onUpdateAgentExtends:E,onOpenCapabilityPreset:D,overviewProfile:O,filesLoading:k,files:A,activeFile:j,setActiveFile:M,filesViewMode:N,setFilesViewMode:P,fileDraft:F,setFileDraft:I,fileSaving:L,profileFileLoading:R,profileEditorNonce:z,toolEntryDisable:ee,setToolEntryDisable:B,onSaveTools:te,onClearToolsEntry:V,modelRows:ne,setModelRows:re,onSaveModels:ie,onClearModelsEntry:H,skillsCatalogLoading:ae,catalogForPick:U,skillsInherit:W,setSkillsInherit:G,skillsPick:oe,setSkillsPick:se,onSaveSkills:K,bindingsLoading:ce,agentBindings:le,bindChannelStatuses:ue,bindChannelsLoading:de,useManualChannel:fe,newBindChannel:pe,setNewBindChannel:me,bindSessionChats:he,bindSessionsLoading:ge,newBindSessionIdx:_e,setNewBindSessionIdx:ve,newBindCustomPeer:ye,setNewBindCustomPeer:be,refreshBindSessions:xe,onRemoveBinding:Se,onAddBinding:Ce,onTryInChat:we}=e;if(!a){let e;return t[0]===n.selectAgentHint?e=t[1]:(e=(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.selectAgentHint}),t[0]=n.selectAgentHint,t[1]=e),e}if(o===`overview`){let e;return t[2]!==n||t[3]!==c||t[4]!==_||t[5]!==v||t[6]!==x||t[7]!==S||t[8]!==y||t[9]!==b||t[10]!==we||t[11]!==a?(e=(0,Q.jsx)(Qn,{a:n,selected:a,defaultModel:_,defaultWorkspace:v,isTuiDefault:x,isTuiDefaultInherited:S,busy:c,onSetDefault:y,onSetTuiDefault:b,onTryInChat:we}),t[2]=n,t[3]=c,t[4]=_,t[5]=v,t[6]=x,t[7]=S,t[8]=y,t[9]=b,t[10]=we,t[11]=a,t[12]=e):e=t[12],e}if(o===`profile`){let e;return t[13]!==n||t[14]!==c||t[15]!==d||t[16]!==l||t[17]!==O.autosave||t[18]!==O.draft||t[19]!==O.handleSoulContentChange||t[20]!==O.handleSoulTemplateChange||t[21]!==O.profileMarkdownLoading||t[22]!==O.setAvatarDialogOpen||t[23]!==O.toggleSoulPreviewMode||t[24]!==O.updateIdentity||t[25]!==a||t[26]!==f||t[27]!==u?(e=(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,Q.jsx)(Kn,{a:n,selected:a,busy:c,editName:l,setEditName:u,editDescription:d,setEditDescription:f,profileMarkdownLoading:O.profileMarkdownLoading,profileDraft:O.draft,updateIdentity:O.updateIdentity,handleSoulTemplateChange:O.handleSoulTemplateChange,handleSoulContentChange:O.handleSoulContentChange,setAvatarDialogOpen:O.setAvatarDialogOpen,toggleSoulPreviewMode:O.toggleSoulPreviewMode,autosave:O.autosave})}),t[13]=n,t[14]=c,t[15]=d,t[16]=l,t[17]=O.autosave,t[18]=O.draft,t[19]=O.handleSoulContentChange,t[20]=O.handleSoulTemplateChange,t[21]=O.profileMarkdownLoading,t[22]=O.setAvatarDialogOpen,t[23]=O.toggleSoulPreviewMode,t[24]=O.updateIdentity,t[25]=a,t[26]=f,t[27]=u,t[28]=e):e=t[28],e}if(o===`capabilities`){let e;return t[29]!==n||t[30]!==c||t[31]!==U||t[32]!==s||t[33]!==V||t[34]!==K||t[35]!==te||t[36]!==a||t[37]!==G||t[38]!==se||t[39]!==B||t[40]!==ae||t[41]!==W||t[42]!==oe||t[43]!==ee?(e=(0,Q.jsx)(jn,{a:n,data:s,selected:a,busy:c,toolEntryDisable:ee,setToolEntryDisable:B,onSaveTools:te,onClearToolsEntry:V,skillsCatalogLoading:ae,catalogForPick:U,skillsInherit:W,setSkillsInherit:G,skillsPick:oe,setSkillsPick:se,onSaveSkills:K}),t[29]=n,t[30]=c,t[31]=U,t[32]=s,t[33]=V,t[34]=K,t[35]=te,t[36]=a,t[37]=G,t[38]=se,t[39]=B,t[40]=ae,t[41]=W,t[42]=oe,t[43]=ee,t[44]=e):e=t[44],e}if(o===`runtime`){let e;return t[45]!==n||t[46]!==c||t[47]!==r||t[48]!==p||t[49]!==ne||t[50]!==H||t[51]!==ie||t[52]!==h||t[53]!==a||t[54]!==m||t[55]!==re?(e=(0,Q.jsx)(rr,{a:n,chat:r,selected:a,busy:c,editWorkspace:p,setEditWorkspace:m,onSaveWorkspace:h,modelRows:ne,setModelRows:re,onSaveModels:ie,onClearModelsEntry:H}),t[45]=n,t[46]=c,t[47]=r,t[48]=p,t[49]=ne,t[50]=H,t[51]=ie,t[52]=h,t[53]=a,t[54]=m,t[55]=re,t[56]=e):e=t[56],e}if(o===`connections`){let e;return t[57]!==n||t[58]!==le||t[59]!==ue||t[60]!==de||t[61]!==he||t[62]!==ge||t[63]!==ce||t[64]!==c||t[65]!==i.lastActiveLabels||t[66]!==i.selectRecipient||t[67]!==pe||t[68]!==ye||t[69]!==_e||t[70]!==Ce||t[71]!==Se||t[72]!==xe||t[73]!==me||t[74]!==be||t[75]!==ve||t[76]!==fe?(e=(0,Q.jsx)(Nn,{a:n,busy:c,bindingsLoading:ce,agentBindings:le,channelStatuses:ue,channelsStatusLoading:de,useManualChannel:fe,newBindChannel:pe,setNewBindChannel:me,bindSessionChats:he,sessionsLoading:ge,newBindSessionIdx:_e,setNewBindSessionIdx:ve,newBindCustomPeer:ye,setNewBindCustomPeer:be,onRefreshSessions:xe,lastActiveLabels:i.lastActiveLabels,selectRecipient:i.selectRecipient,onRemoveBinding:Se,onAddBinding:Ce}),t[57]=n,t[58]=le,t[59]=ue,t[60]=de,t[61]=he,t[62]=ge,t[63]=ce,t[64]=c,t[65]=i.lastActiveLabels,t[66]=i.selectRecipient,t[67]=pe,t[68]=ye,t[69]=_e,t[70]=Ce,t[71]=Se,t[72]=xe,t[73]=me,t[74]=be,t[75]=ve,t[76]=fe,t[77]=e):e=t[77],e}if(o===`advanced`){let e;return t[78]!==n||t[79]!==j||t[80]!==c||t[81]!==w||t[82]!==_||t[83]!==T||t[84]!==v||t[85]!==g||t[86]!==p||t[87]!==F||t[88]!==L||t[89]!==A||t[90]!==k||t[91]!==N||t[92]!==D||t[93]!==we||t[94]!==E||t[95]!==z||t[96]!==R||t[97]!==a||t[98]!==M||t[99]!==I||t[100]!==P?(e=(0,Q.jsx)(fn,{a:n,selected:a,busy:c,defaultModel:_,defaultWorkspace:v,agentModel:g,agentWorkspace:p,capabilityPresets:w,defaultPresetId:T,onUpdateAgentExtends:E,onOpenCapabilityPreset:D,filesLoading:k,files:A,activeFile:j,setActiveFile:M,filesViewMode:N,setFilesViewMode:P,fileDraft:F,setFileDraft:I,fileSaving:L,profileFileLoading:R,profileEditorNonce:z,onTryInChat:we}),t[78]=n,t[79]=j,t[80]=c,t[81]=w,t[82]=_,t[83]=T,t[84]=v,t[85]=g,t[86]=p,t[87]=F,t[88]=L,t[89]=A,t[90]=k,t[91]=N,t[92]=D,t[93]=we,t[94]=E,t[95]=z,t[96]=R,t[97]=a,t[98]=M,t[99]=I,t[100]=P,t[101]=e):e=t[101],e}if(o===`dangerZone`){let e;return t[102]!==n||t[103]!==c||t[104]!==C||t[105]!==a?(e=(0,Q.jsx)(on,{a:n,selected:a,busy:c,onDelete:C}),t[102]=n,t[103]=c,t[104]=C,t[105]=a,t[106]=e):e=t[106],e}let Te;return t[107]===n.selectAgentHint?Te=t[108]:(Te=(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.selectAgentHint}),t[107]=n.selectAgentHint,t[108]=Te),Te}function ar(e,t,n){let r=t.trim().toLowerCase();return r?e.filter(e=>{let t=ye(e,n).toLowerCase(),i=e.id.toLowerCase(),a=e.workspace.toLowerCase(),o=je(e,n).toLowerCase();return t.includes(r)||i.includes(r)||a.includes(r)||o.includes(r)}):e}function or(e,t){return e.replace(`{{count}}`,String(t))}function sr(e,t){let n=e.tools.effectiveDisable.length,r=e.skills.effectiveAllowlist?.length??0,i=n>0?or(t.listToolsDisabledCount,n):t.listToolsAllEnabled,a=r>0?or(t.listSkillsCount,r):t.listInheritedValue;return`${t.listToolsLabel} ${i} · ${t.listSkillsLabel} ${a}`}function cr(e,t){let n=e.tools.effectiveDisable.length,r=e.skills.effectiveAllowlist?.length??0,i=n>0?or(t.listToolsDisabledCount,n):t.listToolsAllEnabled,a=r>0?or(t.listSkillsCount,r):t.listInheritedValue;return[`${t.listToolsLabel} ${i}`,`${t.listSkillsLabel} ${a}`]}function lr(e){let t=(0,Z.c)(11),{text:n,children:r,className:i}=e,a;t[0]!==r||t[1]!==i||t[2]!==n?(a=(0,Q.jsx)(tt,{asChild:!0,children:(0,Q.jsx)(`span`,{className:i,title:n,children:r})}),t[0]=r,t[1]=i,t[2]=n,t[3]=a):a=t[3];let o;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=c(`max-w-[min(28rem,calc(100vw-2rem))] rounded-lg border border-edge bg-surface-panel px-2.5 py-2`,`text-left text-xs leading-snug text-fg shadow-popover`,Se),t[4]=o):o=t[4];let s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsx)(Ae,{className:`fill-surface-panel`}),t[5]=s):s=t[5];let l;t[6]===n?l=t[7]:(l=(0,Q.jsx)(Y,{children:(0,Q.jsxs)(ve,{side:`top`,align:`start`,sideOffset:6,className:o,children:[n,s]})}),t[6]=n,t[7]=l);let u;return t[8]!==a||t[9]!==l?(u=(0,Q.jsx)(ot,{delayDuration:300,skipDelayDuration:100,children:(0,Q.jsxs)(Ce,{children:[a,l]})}),t[8]=a,t[9]=l,t[10]=u):u=t[10],u}function ur(e){let t=(0,Z.c)(34),{a:n,agents:r,defaultAgentId:i,tuiDefaultAgentId:a,tuiDefaultInherited:o,searchQuery:s,onOpenAgent:l,onChatWithAgent:u,busy:d}=e,f,p,m,g,_;if(t[0]!==n||t[1]!==r||t[2]!==d||t[3]!==i||t[4]!==u||t[5]!==l||t[6]!==s||t[7]!==a||t[8]!==o){_=Symbol.for(`react.early_return_sentinel`);bb0:{let e=ar(r,s,n),v=r.length>0&&e.length===0&&s.trim().length>0;if(r.length===0){let e;t[14]===n.listNoAgentsYet?e=t[15]:(e=(0,Q.jsx)(`p`,{className:`rounded-lg bg-surface-panel px-4 py-8 text-center text-sm text-fg-muted shadow-surface`,children:n.listNoAgentsYet}),t[14]=n.listNoAgentsYet,t[15]=e),_=e;break bb0}m=`flex flex-col gap-4`,t[16]!==n||t[17]!==v?(g=v?(0,Q.jsx)(`p`,{className:`rounded-lg bg-surface-panel px-4 py-8 text-center text-sm text-fg-muted shadow-surface`,children:n.listEmpty}):null,t[16]=n,t[17]=v,t[18]=g):g=t[18],f=`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3`;let y;t[19]!==n||t[20]!==d||t[21]!==i||t[22]!==u||t[23]!==l||t[24]!==a||t[25]!==o?(y=e=>{let t=ye(e,n),r=e.id,s=je(e,n),f=sr(e,n),p=cr(e,n),m=e.id===i||e.isDefault,g=e.id===a,_=g&&o,v=g&&!o;return(0,Q.jsx)(`li`,{className:`h-full min-h-0`,children:(0,Q.jsxs)(`article`,{role:`button`,tabIndex:d?-1:0,"aria-disabled":d,"aria-label":`${t} ${r}`,onClick:()=>{d||l(e.id)},onKeyDown:t=>{d||t.key!==`Enter`&&t.key!==` `||(t.preventDefault(),l(e.id))},className:c(`flex min-h-[15.5rem] cursor-pointer flex-col rounded-xl bg-surface-panel p-4 shadow-surface`,`transition-[background-color,transform,box-shadow] duration-150 ease-out`,`hover:bg-surface-hover/45`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-base`,`aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-60`,$e.pressCard),children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3 text-left`,children:[(0,Q.jsx)(`div`,{className:`flex size-12 shrink-0 items-center justify-center overflow-hidden rounded-2xl bg-surface-base text-fg ring-1 ring-edge-subtle/40`,"aria-hidden":!0,children:(0,Q.jsx)(h,{agentId:e.id,avatar:e.avatar,size:48,className:`size-full`})}),(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`h2`,{className:`truncate text-base font-semibold text-fg`,children:t}),(0,Q.jsx)(`p`,{className:`mt-1 truncate font-mono text-xs text-fg-muted`,title:r,children:r})]})]}),(0,Q.jsxs)(`div`,{className:`flex max-w-[9rem] shrink-0 flex-wrap justify-end gap-1.5`,children:[m?(0,Q.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2 py-0.5 text-xs font-medium text-accent`,children:n.globalDefaultBadge}):null,v?(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-xs font-medium text-fg`,children:n.tuiDefaultBadge}):null,_?(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-xs font-medium text-fg`,children:n.tuiDefaultInheritedBadge}):null,!m&&!g?(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-xs font-medium text-fg-muted`,children:n.listCustomBadge}):null]})]}),(0,Q.jsxs)(`div`,{className:`mt-5 min-h-[6.25rem] text-left`,children:[(0,Q.jsx)(`div`,{className:`rounded-lg bg-surface-base p-3`,children:(0,Q.jsx)(`p`,{className:c(`line-clamp-2 text-sm leading-5`,s?`text-fg`:`text-fg-muted`),title:s||void 0,children:s||n.listNoDescription})}),(0,Q.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-1.5`,title:f,children:p.map(dr)})]}),(0,Q.jsx)(`div`,{className:`mt-auto pt-4`,children:(0,Q.jsxs)(X,{type:`button`,variant:`secondary`,disabled:d,onClick:t=>{t.stopPropagation(),u(e.id)},className:`w-full rounded-2xl py-2.5`,children:[(0,Q.jsx)(P,{className:`size-4 shrink-0`,strokeWidth:2,"aria-hidden":!0}),n.listChatWithAgent]})})]})},e.id)},t[19]=n,t[20]=d,t[21]=i,t[22]=u,t[23]=l,t[24]=a,t[25]=o,t[26]=y):y=t[26],p=e.map(y)}t[0]=n,t[1]=r,t[2]=d,t[3]=i,t[4]=u,t[5]=l,t[6]=s,t[7]=a,t[8]=o,t[9]=f,t[10]=p,t[11]=m,t[12]=g,t[13]=_}else f=t[9],p=t[10],m=t[11],g=t[12],_=t[13];if(_!==Symbol.for(`react.early_return_sentinel`))return _;let v;t[27]!==f||t[28]!==p?(v=(0,Q.jsx)(`ul`,{className:f,children:p}),t[27]=f,t[28]=p,t[29]=v):v=t[29];let y;return t[30]!==m||t[31]!==g||t[32]!==v?(y=(0,Q.jsxs)(`div`,{className:m,children:[g,v]}),t[30]=m,t[31]=g,t[32]=v,t[33]=y):y=t[33],y}function dr(e){return(0,Q.jsx)(lr,{text:e,className:`rounded-full bg-surface-hover px-2 py-0.5 text-xs text-fg-muted`,children:e},e)}function fr(e){let t=(0,Z.c)(172),{open:n,onOpenChange:r,a:i,chat:a,busy:o,modalError:s,profileLanguageLabel:l,createDisplayName:u,setCreateDisplayName:d,createAgentId:f,setCreateAgentId:p,createDescription:m,setCreateDescription:h,createWorkspace:_,setCreateWorkspace:v,createModel:b,setCreateModel:x,onCreate:S,onSuggestWorkspace:C,agents:w,duplicateSourceId:T,onSelectDuplicateSource:D,capabilityPlans:O,defaultPresetId:k,selectedCapabilityPlanIds:j,onSelectedCapabilityPlanIdsChange:M}=e,[N,P]=(0,$.useState)(null),F;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Q.jsx)(lt,{className:c(`xopc-dialog-overlay fixed inset-0 bg-scrim`,Ie)}),t[0]=F):F=t[0];let R;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(R=c(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(90vh,680px)] w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2 flex-col`,qe,`overflow-hidden rounded-xl border border-edge bg-surface-panel p-4 shadow-popover dark:border-edge`),t[1]=R):R=t[1];let ee;t[2]===i.addAgent?ee=t[3]:(ee=(0,Q.jsx)(he,{className:`text-base font-semibold text-fg`,children:i.addAgent}),t[2]=i.addAgent,t[3]=ee);let B;t[4]===i.addAgentHint?B=t[5]:(B=(0,Q.jsx)(oe,{className:`mt-0.5 text-xs text-fg-muted`,children:i.addAgentHint}),t[4]=i.addAgentHint,t[5]=B);let te;t[6]!==ee||t[7]!==B?(te=(0,Q.jsxs)(`div`,{className:`min-w-0 pr-2`,children:[ee,B]}),t[6]=ee,t[7]=B,t[8]=te):te=t[8];let ne;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(ne=c(be,`shrink-0 p-1.5 hover:bg-surface-base`),t[9]=ne):ne=t[9];let re;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Q.jsx)(E,{className:`size-4`,"aria-hidden":!0}),t[10]=re):re=t[10];let ie;t[11]===i.closeDialogAria?ie=t[12]:(ie=(0,Q.jsx)(I,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,className:ne,"aria-label":i.closeDialogAria,children:re})}),t[11]=i.closeDialogAria,t[12]=ie);let H;t[13]!==te||t[14]!==ie?(H=(0,Q.jsxs)(`div`,{className:`mb-3 flex items-start justify-between gap-2`,children:[te,ie]}),t[13]=te,t[14]=ie,t[15]=H):H=t[15];let ae;t[16]!==i||t[17]!==w||t[18]!==T||t[19]!==D?(ae=w.length>0?(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1 text-sm`,children:[(0,Q.jsx)(`span`,{className:`text-fg-muted`,children:i.copyFromExistingAgent}),(0,Q.jsxs)(_e,{className:c(sn(),`bg-surface-panel`),value:T??``,onChange:e=>D(e.target.value||null),children:[(0,Q.jsx)(W,{value:``,children:i.copyFromExistingAgentNone}),w.map(e=>(0,Q.jsxs)(W,{value:e.id,children:[ye(e,i),` · `,e.id]},e.id))]}),(0,Q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:i.duplicateAgentHint})]}):null,t[16]=i,t[17]=w,t[18]=T,t[19]=D,t[20]=ae):ae=t[20];let U;t[21]===i.createCapabilityPlansTitle?U=t[22]:(U=(0,Q.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:i.createCapabilityPlansTitle}),t[21]=i.createCapabilityPlansTitle,t[22]=U);let G;t[23]===i.createCapabilityPlansHint?G=t[24]:(G=(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:i.createCapabilityPlansHint}),t[23]=i.createCapabilityPlansHint,t[24]=G);let se=j.length===0,K;t[25]===M?K=t[26]:(K=()=>M([]),t[25]=M,t[26]=K);let ce;t[27]!==o||t[28]!==se||t[29]!==K?(ce=(0,Q.jsx)(`input`,{type:`radio`,name:`create-capability-plan`,className:`mt-0.5 shrink-0`,checked:se,disabled:o,onChange:K}),t[27]=o,t[28]=se,t[29]=K,t[30]=ce):ce=t[30];let le;t[31]!==i.capabilityPresetsGlobalDefault||t[32]!==O||t[33]!==k?(le=O.find(e=>e.id===k)?.name??i.capabilityPresetsGlobalDefault,t[31]=i.capabilityPresetsGlobalDefault,t[32]=O,t[33]=k,t[34]=le):le=t[34];let ue;t[35]===le?ue=t[36]:(ue=(0,Q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:le}),t[35]=le,t[36]=ue);let de;t[37]!==ce||t[38]!==ue?(de=(0,Q.jsxs)(`label`,{className:`mt-2 flex cursor-pointer items-start gap-2 rounded-md bg-accent/5 px-2.5 py-2`,children:[ce,ue]}),t[37]=ce,t[38]=ue,t[39]=de):de=t[39];let fe;if(t[40]!==o||t[41]!==O||t[42]!==k||t[43]!==M||t[44]!==j[0]){let e;t[46]===k?e=t[47]:(e=e=>e.id!==k,t[46]=k,t[47]=e);let n;t[48]!==o||t[49]!==M||t[50]!==j[0]?(n=e=>(0,Q.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 rounded-md bg-surface-panel px-2.5 py-2`,children:[(0,Q.jsx)(`input`,{type:`radio`,name:`create-capability-plan`,className:`mt-0.5 shrink-0 rounded border-edge`,checked:j[0]===e.id,disabled:o,onChange:()=>M([e.id])}),(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e.name}),e.description?(0,Q.jsx)(`span`,{className:`mt-0.5 line-clamp-2 block text-xs text-fg-muted`,children:e.description}):null]})]},e.id),t[48]=o,t[49]=M,t[50]=j[0],t[51]=n):n=t[51],fe=O.filter(e).map(n),t[40]=o,t[41]=O,t[42]=k,t[43]=M,t[44]=j[0],t[45]=fe}else fe=t[45];let pe;t[52]===fe?pe=t[53]:(pe=(0,Q.jsx)(`div`,{className:`mt-2 grid gap-2`,children:fe}),t[52]=fe,t[53]=pe);let me;t[54]!==U||t[55]!==G||t[56]!==de||t[57]!==pe?(me=(0,Q.jsxs)(`div`,{className:`rounded-lg border border-edge-subtle bg-surface-base p-3 dark:border-edge`,children:[U,G,de,pe]}),t[54]=U,t[55]=G,t[56]=de,t[57]=pe,t[58]=me):me=t[58];let ge;t[59]===s?ge=t[60]:(ge=s?(0,Q.jsx)(`div`,{role:`alert`,className:`rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-800 dark:border-red-900/50 dark:bg-red-950/40 dark:text-red-200`,children:s}):null,t[59]=s,t[60]=ge);let ve;t[61]!==i.newAgentLabel||t[62]!==l?(ve=(0,Q.jsxs)(`span`,{className:`text-fg-muted`,children:[i.newAgentLabel,` (`,l,`)`]}),t[61]=i.newAgentLabel,t[62]=l,t[63]=ve):ve=t[63];let xe;t[64]===Symbol.for(`react.memo_cache_sentinel`)?(xe=sn(),t[64]=xe):xe=t[64];let Se;t[65]===d?Se=t[66]:(Se=e=>d(e.target.value),t[65]=d,t[66]=Se);let Ce;t[67]===C?Ce=t[68]:(Ce=()=>C(),t[67]=C,t[68]=Ce);let we;t[69]!==u||t[70]!==Se||t[71]!==Ce?(we=(0,Q.jsx)(`input`,{className:xe,value:u,onChange:Se,onBlur:Ce,required:!0,autoComplete:`off`}),t[69]=u,t[70]=Se,t[71]=Ce,t[72]=we):we=t[72];let Te;t[73]!==ve||t[74]!==we?(Te=(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1 text-sm`,children:[ve,we]}),t[73]=ve,t[74]=we,t[75]=Te):Te=t[75];let Ee;t[76]===i.newAgentIdOptional?Ee=t[77]:(Ee=(0,Q.jsx)(`span`,{className:`text-fg-muted`,children:i.newAgentIdOptional}),t[76]=i.newAgentIdOptional,t[77]=Ee);let De;t[78]===Symbol.for(`react.memo_cache_sentinel`)?(De=c(sn(),`font-mono text-xs`),t[78]=De):De=t[78];let Oe;t[79]===p?Oe=t[80]:(Oe=e=>p(e.target.value),t[79]=p,t[80]=Oe);let q;t[81]===C?q=t[82]:(q=()=>C(),t[81]=C,t[82]=q);let ke;t[83]!==i.newAgentIdPlaceholder||t[84]!==i.newAgentIdRules||t[85]!==f||t[86]!==Oe||t[87]!==q?(ke=(0,Q.jsx)(`input`,{className:De,value:f,onChange:Oe,onBlur:q,placeholder:i.newAgentIdPlaceholder,autoComplete:`off`,spellCheck:!1,maxLength:64,pattern:`[A-Za-z0-9][A-Za-z0-9_-]{0,63}`,title:i.newAgentIdRules}),t[83]=i.newAgentIdPlaceholder,t[84]=i.newAgentIdRules,t[85]=f,t[86]=Oe,t[87]=q,t[88]=ke):ke=t[88];let Ae;t[89]===i.newAgentIdRules?Ae=t[90]:(Ae=(0,Q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:i.newAgentIdRules}),t[89]=i.newAgentIdRules,t[90]=Ae);let je;t[91]!==Ee||t[92]!==ke||t[93]!==Ae?(je=(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1 text-sm`,children:[Ee,ke,Ae]}),t[91]=Ee,t[92]=ke,t[93]=Ae,t[94]=je):je=t[94];let Me;t[95]!==i.agentDescription||t[96]!==l?(Me=(0,Q.jsxs)(`span`,{className:`text-fg-muted`,children:[i.agentDescription,` (`,l,`)`]}),t[95]=i.agentDescription,t[96]=l,t[97]=Me):Me=t[97];let Ne;t[98]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=c(sn(),`min-h-18 resize-y font-sans text-sm leading-relaxed`),t[98]=Ne):Ne=t[98];let Pe;t[99]===h?Pe=t[100]:(Pe=e=>h(e.target.value),t[99]=h,t[100]=Pe);let Fe;t[101]!==i.agentDescriptionPlaceholder||t[102]!==m||t[103]!==Pe?(Fe=(0,Q.jsx)(`textarea`,{className:Ne,value:m,onChange:Pe,placeholder:i.agentDescriptionPlaceholder,maxLength:4e3,rows:3,spellCheck:!0}),t[101]=i.agentDescriptionPlaceholder,t[102]=m,t[103]=Pe,t[104]=Fe):Fe=t[104];let Le;t[105]!==Me||t[106]!==Fe?(Le=(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1 text-sm`,children:[Me,Fe]}),t[105]=Me,t[106]=Fe,t[107]=Le):Le=t[107];let Re;t[108]===i.newWorkspace?Re=t[109]:(Re=(0,Q.jsx)(`span`,{className:`text-fg-muted`,children:i.newWorkspace}),t[108]=i.newWorkspace,t[109]=Re);let ze;t[110]===Symbol.for(`react.memo_cache_sentinel`)?(ze=c(sn(),`font-mono text-xs`),t[110]=ze):ze=t[110];let Be;t[111]===v?Be=t[112]:(Be=e=>v(e.target.value),t[111]=v,t[112]=Be);let Ve;t[113]!==_||t[114]!==Be?(Ve=(0,Q.jsx)(`input`,{className:ze,value:_,onChange:Be,required:!0,autoComplete:`off`}),t[113]=_,t[114]=Be,t[115]=Ve):Ve=t[115];let He;t[116]!==Re||t[117]!==Ve?(He=(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1 text-sm`,children:[Re,Ve]}),t[116]=Re,t[117]=Ve,t[118]=He):He=t[118];let J;t[119]===i.newModelOptional?J=t[120]:(J=(0,Q.jsx)(`span`,{className:`text-fg-muted`,children:i.newModelOptional}),t[119]=i.newModelOptional,t[120]=J);let Ue;t[121]===x?Ue=t[122]:(Ue=e=>x(e),t[121]=x,t[122]=Ue);let We;t[123]!==o||t[124]!==a.modelNoMatches||t[125]!==a.modelPlaceholder||t[126]!==a.modelSearchPlaceholder||t[127]!==b||t[128]!==Ue?(We=(0,Q.jsx)(V,{className:`min-w-0 flex-1`,value:b,disabled:o,placeholder:a.modelPlaceholder,searchPlaceholder:a.modelSearchPlaceholder,noMatches:a.modelNoMatches,onChange:Ue}),t[123]=o,t[124]=a.modelNoMatches,t[125]=a.modelPlaceholder,t[126]=a.modelSearchPlaceholder,t[127]=b,t[128]=Ue,t[129]=We):We=t[129];let Ge;t[130]!==i.modelClear||t[131]!==o||t[132]!==b||t[133]!==x?(Ge=b.trim()?(0,Q.jsx)(X,{type:`button`,variant:`secondary`,className:`shrink-0`,disabled:o,onClick:()=>x(``),children:i.modelClear}):null,t[130]=i.modelClear,t[131]=o,t[132]=b,t[133]=x,t[134]=Ge):Ge=t[134];let Ke;t[135]!==We||t[136]!==Ge?(Ke=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-stretch gap-2`,children:[We,Ge]}),t[135]=We,t[136]=Ge,t[137]=Ke):Ke=t[137];let Je;t[138]!==J||t[139]!==Ke?(Je=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 text-sm`,children:[J,Ke]}),t[138]=J,t[139]=Ke,t[140]=Je):Je=t[140];let Ye;t[141]!==me||t[142]!==ge||t[143]!==Te||t[144]!==je||t[145]!==Le||t[146]!==He||t[147]!==Je||t[148]!==ae?(Ye=(0,Q.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-3 overflow-y-auto pr-1`,children:[ae,me,ge,Te,je,Le,He,Je]}),t[141]=me,t[142]=ge,t[143]=Te,t[144]=je,t[145]=Le,t[146]=He,t[147]=Je,t[148]=ae,t[149]=Ye):Ye=t[149];let Xe;t[150]!==i.createModalCancel||t[151]!==o?(Xe=(0,Q.jsx)(I,{asChild:!0,children:(0,Q.jsx)(X,{type:`button`,variant:`secondary`,disabled:o,children:i.createModalCancel})}),t[150]=i.createModalCancel,t[151]=o,t[152]=Xe):Xe=t[152];let Ze;t[153]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,Q.jsx)(L,{className:`mr-1 size-4`,"aria-hidden":!0}),t[153]=Ze):Ze=t[153];let Y;t[154]!==i.create||t[155]!==o?(Y=(0,Q.jsxs)(X,{type:`submit`,disabled:o,children:[Ze,i.create]}),t[154]=i.create,t[155]=o,t[156]=Y):Y=t[156];let Qe;t[157]!==Xe||t[158]!==Y?(Qe=(0,Q.jsxs)(`div`,{className:`mt-3 flex shrink-0 justify-end gap-2 border-t border-edge-subtle pt-3 dark:border-edge`,children:[Xe,Y]}),t[157]=Xe,t[158]=Y,t[159]=Qe):Qe=t[159];let $e;t[160]!==S||t[161]!==Ye||t[162]!==Qe?($e=(0,Q.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:S,children:[Ye,Qe]}),t[160]=S,t[161]=Ye,t[162]=Qe,t[163]=$e):$e=t[163];let et;t[164]!==N||t[165]!==$e||t[166]!==H?(et=(0,Q.jsxs)(y,{children:[F,(0,Q.jsx)(z,{ref:P,className:R,onOpenAutoFocus:pr,children:(0,Q.jsxs)(g,{layer:`modal`,portalContainer:N,children:[H,$e]})})]}),t[164]=N,t[165]=$e,t[166]=H,t[167]=et):et=t[167];let tt;return t[168]!==r||t[169]!==n||t[170]!==et?(tt=(0,Q.jsx)(A,{open:n,onOpenChange:r,children:et}),t[168]=r,t[169]=n,t[170]=et,t[171]=tt):tt=t[171],tt}function pr(e){return e.preventDefault()}var mr=`~/.xopc/workspace`;function hr(e){let t=e.trim();return t?`${mr}/${w(t)}`:``}function gr(e){let t=(0,Z.c)(26),{a:n,busy:r,listSearchQuery:i,onListSearchQueryChange:a,onAddAgent:o,onManageCapabilityPresets:s}=e,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(De,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-disabled`,strokeWidth:1.75,"aria-hidden":!0}),t[0]=c):c=t[0];let l;t[1]===a?l=t[2]:(l=e=>a(e.target.value),t[1]=a,t[2]=l);let u;t[3]!==n.listSearchPlaceholder||t[4]!==i||t[5]!==l?(u=(0,Q.jsxs)(`label`,{className:`relative flex min-h-9 min-w-0 max-w-sm cursor-text items-center rounded-pill bg-surface-panel py-1.5 pl-9 pr-3 shadow-surface dark:bg-surface-hover/40 sm:max-w-md`,children:[c,(0,Q.jsx)(`input`,{type:`search`,enterKeyHint:`search`,value:i,onChange:l,placeholder:n.listSearchPlaceholder,autoComplete:`off`,spellCheck:!1,"aria-label":n.listSearchPlaceholder,className:`min-w-0 flex-1 appearance-none border-0 bg-transparent py-0.5 text-sm leading-normal text-fg caret-current placeholder:text-fg-disabled focus:border-0 focus:shadow-none focus:outline-none focus:ring-0 focus-visible:outline-none`})]}),t[3]=n.listSearchPlaceholder,t[4]=i,t[5]=l,t[6]=u):u=t[6];let d;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(Ue,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),t[7]=d):d=t[7];let f;t[8]===n.capabilityPresetsManage?f=t[9]:(f=(0,Q.jsx)(`span`,{className:`hidden xl:inline`,children:n.capabilityPresetsManage}),t[8]=n.capabilityPresetsManage,t[9]=f);let p;t[10]!==n.capabilityPresetsManage||t[11]!==s||t[12]!==f?(p=(0,Q.jsxs)(X,{type:`button`,variant:`secondary`,className:`shrink-0 gap-2`,"aria-label":n.capabilityPresetsManage,onClick:s,children:[d,f]}),t[10]=n.capabilityPresetsManage,t[11]=s,t[12]=f,t[13]=p):p=t[13];let m;t[14]===o?m=t[15]:(m=()=>o(),t[14]=o,t[15]=m);let h;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Q.jsx)(se,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),t[16]=h):h=t[16];let g;t[17]!==n.addAgent||t[18]!==n.addAgentAria||t[19]!==r||t[20]!==m?(g=(0,Q.jsxs)(X,{type:`button`,variant:`primary`,className:`shrink-0 gap-2`,"aria-label":n.addAgentAria,disabled:r,onClick:m,children:[h,n.addAgent]}),t[17]=n.addAgent,t[18]=n.addAgentAria,t[19]=r,t[20]=m,t[21]=g):g=t[21];let _;return t[22]!==u||t[23]!==p||t[24]!==g?(_=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center justify-end gap-2`,children:[u,p,g]}),t[22]=u,t[23]=p,t[24]=g,t[25]=_):_=t[25],_}function _r(e){return{...e,soulEditorNonce:0,soulPreviewMode:!1,avatarDialogOpen:!1}}function vr(e){let{agentId:t,enabled:n,saveRef:r}=e,i=N(async()=>{if(!t)return null;let[e,n]=await Promise.all([rt(t,`IDENTITY.md`).catch(()=>``),rt(t,`SOUL.md`).catch(()=>``)]),r=Rn(e);return{identity:r,soulTemplate:Hn(n),soulCustomContent:n,identityBaseline:JSON.stringify(r),soulBaseline:n}},[t],{enabled:n&&!!t,initial:null,errorData:null}),a=i.data,o=i.loading,s=(0,$.useRef)(!1),[c,l]=(0,$.useState)(null),u=t??``,d=(0,$.useRef)(u);d.current!==u&&(d.current=u,s.current=!1,l(null));let f=c??(a?_r(a):null),p=(0,$.useRef)(f);p.current=f;let m=(0,$.useMemo)(()=>f?JSON.stringify(f.identity)!==f.identityBaseline||f.soulCustomContent!==f.soulBaseline:!1,[f]),h=(0,$.useRef)(t);h.current=t;let g=(0,$.useCallback)(e=>{s.current=!0,l(t=>{let n=t??(a?_r(a):null);return n?e(n):null})},[a]),_=(0,$.useCallback)(e=>{g(t=>({...t,identity:{...t.identity,...e}}))},[g]),v=(0,$.useCallback)(e=>{g(t=>{if(e===`custom`)return{...t,soulTemplate:`custom`};let n=Bn.find(t=>t.id===e);return n?.content?{...t,soulTemplate:e,soulCustomContent:n.content,soulEditorNonce:t.soulEditorNonce+1}:{...t,soulTemplate:e}})},[g]),y=(0,$.useCallback)(e=>{g(t=>({...t,soulCustomContent:e,soulTemplate:`custom`}))},[g]),b=(0,$.useCallback)(e=>{g(t=>({...t,avatarDialogOpen:e}))},[g]),x=(0,$.useCallback)(()=>{g(e=>({...e,soulPreviewMode:!e.soulPreviewMode}))},[g]),S=(0,$.useCallback)(async e=>{let t=h.current,n=e??p.current;!t||!n||(await Promise.all([Re(t,`IDENTITY.md`,zn(n.identity)),Re(t,`SOUL.md`,n.soulCustomContent)]),l(e=>{let t=e??n;return s.current=JSON.stringify(t.identity)!==JSON.stringify(n.identity)||t.soulCustomContent!==n.soulCustomContent,{...t,identityBaseline:JSON.stringify(n.identity),soulBaseline:n.soulCustomContent}}))},[]),C=gt({value:f,dirty:m,enabled:n,onSave:S});return(0,$.useLayoutEffect)(()=>{if(r)return r.current=S,()=>{r.current=null}},[S,r]),{profileMarkdownLoading:o,draft:f,dirty:m,autosave:C,updateIdentity:_,handleSoulTemplateChange:v,handleSoulContentChange:y,setAvatarDialogOpen:b,toggleSoulPreviewMode:x}}var yr={draft:``,editorNonce:0,loadedKey:``};function br(e,t){switch(t.type){case`load`:return{draft:t.content,editorNonce:e.editorNonce+1,loadedKey:t.key};case`setDraft`:return{...e,draft:t.value};case`clear`:return{draft:``,editorNonce:e.editorNonce,loadedKey:``};case`resetViewMode`:return e}}function xr(e){let{panel:t,selectedId:n,hasToken:r,dataAgentsLength:i,saveErrorMessage:a,setError:o}=e,s=N(()=>n?ce(n):Promise.resolve(null),[t,n,r,i],{enabled:t===`advanced`&&!!n&&r,initial:null,errorData:null}),c=s.data,l=s.setData,u=s.loading,[d,f]=(0,$.useState)(null),[p,m]=(0,$.useReducer)(br,yr),[h,g]=(0,$.useState)(!1),[_,v]=(0,$.useState)(`edit`),y=(0,$.useRef)(n);(0,$.useEffect)(()=>{n!==y.current&&(y.current=n,f(null))},[n]),(0,$.useEffect)(()=>{if(c&&c.files.length>0&&!d){let e=c.files.find(e=>e.name===`AGENTS.md`);f(e?e.name:c.files[0].name)}},[c,d]);let b=p.draft,x=p.editorNonce,S=(0,$.useRef)(b);S.current=b;let C=(0,$.useRef)(n);C.current=n;let w=(0,$.useRef)(d);w.current=d;let T=(0,$.useRef)(null),E=(0,$.useRef)(``),D=(0,$.useRef)(``),O=(0,$.useRef)(``),k=(0,$.useRef)(()=>{}),A=N(()=>d&&n?rt(n,d).catch(()=>``):Promise.resolve(``),[d,n,r],{enabled:!!(d&&n&&r),initial:``,errorData:``}),j=A.loading,M=K(async()=>{let e=C.current,t=w.current;if(!e||!t||`${e}:${t}`!==E.current)return;let n=S.current;if(n!==D.current){g(!0),o(null);try{await Re(e,t,n),D.current=n,l(n=>!n||n.agentId!==e?n:{...n,files:n.files.map(e=>e.name===t?{...e,missing:!1}:e)})}catch(e){o(e instanceof Error?e.message:a)}finally{g(!1)}}},800);k.current=M.flush,(0,$.useEffect)(()=>()=>{k.current()},[]);let P=(0,$.useRef)(t);P.current!==t&&(P.current===`advanced`&&k.current(),P.current=t);let F=d&&n?`${n}:${d}`:``;(0,$.useEffect)(()=>{F!==O.current&&(k.current(),O.current=F)},[F]),(0,$.useEffect)(()=>{if(!F){m({type:`clear`});return}j||(E.current=F,D.current=A.data,m({type:`load`,key:F,content:A.data}))},[F,j,A.data]);let I=(0,$.useRef)({activeFile:d,selectedId:n});return(I.current.activeFile!==d||I.current.selectedId!==n)&&(I.current={activeFile:d,selectedId:n},v(`edit`)),{files:c,setFiles:l,filesLoading:u,activeFile:d,setActiveFile:(0,$.useCallback)(e=>{k.current(),f(e)},[]),fileDraft:b,setFileDraft:(0,$.useCallback)(e=>{m({type:`setDraft`,value:typeof e==`function`?e(S.current):e}),M()},[M]),fileSaving:h,filesViewMode:_,setFilesViewMode:v,profileFileLoading:j,profileEditorNonce:x,overviewSaveProfileMarkdownRef:T,saveProfileMarkdownDebounced:M}}function Sr(e){let{panel:t,hasToken:n,bindingsFromConfig:r,gatewayCfgLoading:i,selected:a,saveErrorMessage:o,setBusy:s,setError:c}=e,l=(0,$.useRef)(!1),[u,d]=(0,$.useState)(null),f=(0,$.useRef)(r);t===`connections`&&n&&!l.current&&f.current!==r&&(f.current=r,d(r));let p=u??r,m=t===`connections`&&n,h=N(()=>At(),[t,n],{enabled:m,initial:[],errorData:[]}),g=h.data,_=h.loading,v=(0,$.useMemo)(()=>_||g.length===0?``:g[0]?.name??``,[g,_]),[y,b]=(0,$.useState)(``),x=(0,$.useRef)(v);t===`connections`&&!_&&v&&x.current!==v&&(!y||!g.some(e=>e.name===y))&&(x.current=v,b(v)),x.current=v;let S=y.trim(),C=m&&S.length>0,w=N(()=>jt(S),[t,n,S],{enabled:C,initial:[],errorData:[]}),E=w.data,D=w.loading,O=w.setData,[k,A]=(0,$.useState)(null),[j,M]=(0,$.useState)(``),P=(0,$.useRef)(S);P.current!==S&&(P.current=S,A(null));let F=(0,$.useMemo)(()=>a?p.filter(e=>e.agentId.toLowerCase()===a.id.toLowerCase()):[],[p,a?.id]),I=(0,$.useCallback)(()=>{let e=y.trim();e&&jt(e).then(e=>{O(e),A(t=>t!=null&&t<e.length?t:null)}).catch(()=>{O([]),A(null)})},[y,O]),L=!_&&g.length===0,R=t===`connections`&&n&&i,z=(0,$.useCallback)(async e=>{s(!0),c(null);try{let t=p.filter(t=>t!==e);await T(t),l.current=!0,d(t)}catch(e){c(e instanceof Error?e.message:o)}finally{s(!1)}},[p,o,s,c]);return{agentBindings:F,allBindings:p,bindChannelStatuses:g,bindChannelsLoading:_,bindSessionChats:E,bindSessionsLoading:D,bindingsLoading:R,newBindChannel:y,setNewBindChannel:b,newBindSessionIdx:k,setNewBindSessionIdx:A,newBindCustomPeer:j,setNewBindCustomPeer:M,onAddBinding:(0,$.useCallback)(async e=>{if(e.preventDefault(),!a||!y.trim())return;let t=ln(y,j,k,E),n=[...p,{agentId:a.id,priority:100,enabled:!0,match:t}];s(!0),c(null);try{await T(n),l.current=!0,d(n),A(null),M(``)}catch(e){c(e instanceof Error?e.message:o)}finally{s(!1)}},[p,E,y,j,k,o,a,s,c]),onRemoveBinding:z,refreshBindSessions:I,useManualChannel:L}}function Cr(e,t){let n=(0,Z.c)(16),[r,i]=(0,$.useState)(0),a,o;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{let e=e=>{let t=e.detail;t&&typeof t==`object`&&`section`in t&&t.section===`skills`&&i(Er)};return window.addEventListener(`config-reload`,e),()=>window.removeEventListener(`config-reload`,e)},o=[],n[0]=a,n[1]=o):(a=n[0],o=n[1]),(0,$.useEffect)(a,o);let s;n[2]!==r||n[3]!==e||n[4]!==t?(s=[e,t,r],n[2]=r,n[3]=e,n[4]=t,n[5]=s):s=n[5];let c=e&&t,l;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=[],n[6]=l):l=n[6];let u;n[7]===Symbol.for(`react.memo_cache_sentinel`)?(u=[],n[7]=u):u=n[7];let d;n[8]===c?d=n[9]:(d={enabled:c,initial:l,errorData:u},n[8]=c,n[9]=d);let{data:f,loading:p}=N(Tr,s,d),m;n[10]===f?m=n[11]:(m=f.filter(wr),n[10]=f,n[11]=m);let h=m,g;return n[12]!==h||n[13]!==f||n[14]!==p?(g={catalogForPick:h,skillCatalog:f,skillsCatalogLoading:p},n[12]=h,n[13]=f,n[14]=p,n[15]=g):g=n[15],g}function wr(e){return e.enabled!==!1}function Tr(){return pe()}function Er(e){return e+1}function Dr(e){return Cr(e.panel===`capabilities`,e.hasToken)}function Or(e){return new Set(e.tools.entryDisable)}function kr(e){return e.skills.entry===void 0?{inherit:!0,pick:new Set(e.skills.effectiveAllowlist??[])}:{inherit:!1,pick:new Set(e.skills.entry??[])}}function Ar(e){let{panel:t,selected:n}=e,r=`${t}:${n?.id??``}`,i=(0,$.useRef)(r),[a,o]=(0,$.useState)(()=>new Set),[s,c]=(0,$.useState)(()=>new Set),[l,u]=(0,$.useState)(!0),[d,f]=(0,$.useState)(()=>[]);if(i.current!==r){if(i.current=r,n&&t===`capabilities`){o(Or(n));let e=kr(n);u(e.inherit),c(e.pick)}n&&t===`runtime`&&f(Tt(n.typedModels.effective))}return{toolEntryDisable:a,setToolEntryDisable:o,skillsPick:s,setSkillsPick:c,skillsInherit:l,setSkillsInherit:u,modelRows:d,setModelRows:e=>{f(e)},replaceModelRows:f}}function jr(e){let t=Tt(e.typedModels.preset);return t.some(t=>t.id===e.typedModels.defaultRole)?t:Tt(e.typedModels.effective)}function Mr(e){return Object.fromEntries(Array.from(e).map(e=>e.trim()).filter(Boolean).toSorted((e,t)=>e.localeCompare(t)).map(e=>[e,{mode:`deny`}]))}function Nr(){let e=d(e=>e.language),t=l(e),n=t.agentsSettings,[r,s]=(0,$.useState)(!1),[c,f]=(0,$.useState)(null),[m,h]=(0,$.useState)(!1),[g,v]=(0,$.useState)(``),y=t.cron,b=t.chat,x=!!u(e=>e.token),[S,C]=a(),w=o(),{agentId:T}=i(),E=me(e=>e.setPageHeader),D=me(e=>e.clearPageHeader),{data:k,error:A,isLoading:M,mutate:N}=p(x?`settings-gateway-agents`:null,et,{revalidateOnFocus:!1}),{data:P,mutate:F}=p(x?`settings-capability-presets`:null,St,{revalidateOnFocus:!1}),I=nt(x),{data:L}=I,R=(0,$.useMemo)(()=>O(L?.payload?.config??{}),[L]),z=k??null,ee=(0,$.useMemo)(()=>z?z.agents.find(e=>e.id===z.defaultId)??z.agents[0]??null:null,[z]),B=!!(x&&M),[te,V]=(0,$.useState)(null),re=A instanceof Error?A.message:A?n.loadError:null,ie=te??re,[ae,U]=(0,$.useState)(null),[W,G]=(0,$.useState)(`overview`),[oe,se]=(0,$.useState)(``),[K,ce]=(0,$.useState)(``),[le,de]=(0,$.useState)(``),[fe,pe]=(0,$.useState)(``),[he,ge]=(0,$.useState)(``),[_e,ve]=(0,$.useState)(null),[be,xe]=(0,$.useState)(!1),Se=(0,$.useRef)(``),[Ce,Te]=(0,$.useState)(null),[Ee,De]=(0,$.useState)([]),[Oe,q]=(0,$.useState)(!1),[ke,Ae]=(0,$.useState)(``),[Me,Ne]=(0,$.useState)(``),[Pe,Fe]=(0,$.useState)(``),[Ie,Le]=(0,$.useState)(``),[Re,ze]=(0,$.useState)(``),Ve=(0,$.useRef)(null),He=(0,$.useRef)({data:null,routeAgentId:void 0});z&&(z!==He.current.data||T!==He.current.routeAgentId)&&(He.current={data:z,routeAgentId:T},T&&z.agents.some(e=>e.id===T)?U(T):U(e=>e&&z.agents.some(t=>t.id===e)?e:z.defaultId)),(0,$.useEffect)(()=>{!z||!T||z.agents.some(e=>e.id===T)||w(Be,{replace:!0})},[z,T,w]),(0,$.useEffect)(()=>{T&&G(`overview`)},[T]),(0,$.useEffect)(()=>{S.get(`panel`)===`defaults`&&w(T?Ge(T):Be,{replace:!0,state:{[j]:T?Ge(T):Be}})},[S,T,w]),(0,$.useEffect)(()=>{if(S.get(`focus`)!==`avatar`||!T||(G(`profile`),B||!z?.agents.some(e=>e.id===T)))return;let e=window.setTimeout(()=>{document.getElementById(`agent-avatar-settings`)?.scrollIntoView({behavior:`smooth`,block:`center`}),C(e=>{let t=new URLSearchParams(e);return t.delete(`focus`),t},{replace:!0})},220);return()=>window.clearTimeout(e)},[S,T,B,z,C]);let J=(0,$.useMemo)(()=>z?.agents.find(e=>e.id===ae)??null,[z,ae]),Ue=(0,$.useMemo)(()=>{let e=L?.payload?.config;if(!e||typeof e!=`object`||Array.isArray(e))return``;let t=e.tui;if(!t||typeof t!=`object`||Array.isArray(t))return``;let n=t.defaultAgent;return typeof n==`string`?n.trim().toLowerCase():``},[L]),We=(0,$.useMemo)(()=>!z||Ue&&z.agents.some(e=>e.id===Ue)?Ue:z.defaultId||z.agents[0]?.id||Ue,[z,Ue]),Ke=!!(z&&Ue&&!z.agents.some(e=>e.id===Ue)),qe=(0,$.useRef)(null),Je=J?J.id:null;J&&qe.current!==Je?(qe.current=Je,Ne(J.workspace),Fe(J.model?.primary??``),Le(ye(J,l(e).agentsSettings)),ze(je(J,l(e).agentsSettings))):!J&&qe.current!==null&&(qe.current=null,Ne(``),Fe(``),Le(``),ze(``));let Ye=vr({agentId:J?.id??null,enabled:W===`profile`&&!!J,saveRef:Ve}),Xe=xr({panel:W,selectedId:ae,hasToken:x,dataAgentsLength:z?.agents.length,saveErrorMessage:n.saveError,setError:V}),Ze=Ar({panel:W,selected:J}),Y=Sr({panel:W,hasToken:x,bindingsFromConfig:R,gatewayCfgLoading:L===void 0,selected:J,saveErrorMessage:n.saveError,setBusy:q,setError:V}),$e=Dr({panel:W,hasToken:x}),X=(0,$.useCallback)(()=>{let e=hr(K.trim()||oe);pe(t=>t===``||t===Se.current?(Se.current=e,e):t)},[K,oe]),tt=(0,$.useCallback)(()=>{Se.current=``,se(``),ce(``),de(``),pe(``),ge(``),ve(null),Te(null),De([]),xe(!0)},[]),rt=(0,$.useCallback)(e=>{let t=new Set(z?.agents.map(e=>e.id.toLowerCase())??[]),r=e.trim();if(!t.has(r.toLowerCase()))return r;let i=`${r}${n.duplicateIdSuffix}`;if(!t.has(i.toLowerCase()))return i;for(let e=2;e<1e3;e+=1){let n=`${i}-${e}`;if(!t.has(n.toLowerCase()))return n}return i},[n.duplicateIdSuffix,z]),it=(0,$.useCallback)(e=>{if(Te(e),!e){De([]);return}let t=z?.agents.find(t=>t.id===e);if(!t)return;let r=t.name?.trim()??t.id,i=n.duplicateName.replace(`{{name}}`,r),a=rt(t.id),o=t.description??``;Se.current=``,se(i),ce(a),de(o),pe(t.workspace),ge(t.model?.primary??``),De(t.extends),ve(null)},[n.duplicateName,z,rt]),at=(0,$.useCallback)(e=>{it(e),xe(!0)},[it]),ot=(0,$.useMemo)(()=>(0,Q.jsx)(gr,{a:n,busy:Oe,listSearchQuery:ke,onListSearchQueryChange:Ae,onAddAgent:()=>tt(),onManageCapabilityPresets:()=>w(`/settings/capability-presets`)}),[n,Oe,ke,w,tt]);(0,$.useLayoutEffect)(()=>x?(E({startExtra:null,main:(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:n.title}),(0,Q.jsx)(`p`,{className:`truncate text-xs text-fg-muted`,children:n.subtitle})]}),end:ot}),()=>D()):(D(),()=>D()),[n.subtitle,n.title,ot,D,x,E]);async function st(t){t.preventDefault();let r=oe.trim();if(!r)return;let i=ne(K,r);if(i.ok===!1){ve(i.error);return}let a=fe.trim()||hr(K.trim()||r);if(a){q(!0),ve(null);try{let t=[`# IDENTITY.md - Who Am I?`,``,`- **Name:** ${r}`,`- **Description:** ${le.trim()}`,`- **Language:** ${e}`,`- **Creature:** assistant`,`- **Emoji:**`,`- **Avatar:**`,``].join(`
|
|
68
|
-
`),{createdAgentId:n,...i}=await Qe({workspace:a,...K.trim()?{id:K.trim()}:{},...he.trim()?{models:{defaultRole:`deep`,roles:{deep:{model:he.trim()}}}}:{},profileFiles:{"IDENTITY.md":t},...Ce?{cloneFrom:Ce}:{},extends:Ee});N(i,{revalidate:!1}),se(``),ce(``),de(``),pe(``),ge(``),ve(null),xe(!1),U(n),w(Ge(n))}catch(e){ve(e instanceof Error?e.message:n.saveError)}finally{q(!1)}}}async function ct(e){q(!0),V(null);try{N(await _(e.id,{setDefault:!0}),{revalidate:!1}),U(e.id)}catch(e){V(e instanceof Error?e.message:n.saveError)}finally{q(!1)}}async function lt(e){q(!0),V(null);try{await H(e.id),await I.mutate()}catch(e){V(e instanceof Error?e.message:n.saveError)}finally{q(!1)}}async function ut(e,t){q(!0),V(null);try{let n=await we(e.id,t);N(n,{revalidate:!1}),U(n.defaultId),G(`overview`),T===e.id&&w(Be,{replace:!0}),s(!1),f(null),v(``)}catch(e){V(e instanceof Error?e.message:n.saveError)}finally{q(!1)}}function dt(e,t){e.id!==`main`&&(f(e),h(t),v(``),s(!0))}async function ft(e){if(J){q(!0),V(null);try{N(await _(J.id,{tools:{builtin:Mr(new Set(e))}}),{revalidate:!1})}catch(e){throw V(e instanceof Error?e.message:n.saveError),e}finally{q(!1)}}}async function pt(){if(J){q(!0),V(null);try{N(await _(J.id,{tools:null}),{revalidate:!1}),Ze.setToolEntryDisable(new Set)}catch(e){V(e instanceof Error?e.message:n.saveError)}finally{q(!1)}}}async function mt(e){if(!J)return;let t=wt(e,{invalidId:n.typedModelsInvalidId,duplicateId:n.typedModelsDuplicateId,invalidModel:n.typedModelsInvalidModel});if(t)throw V(t),Error(t);q(!0),V(null);try{N(await _(J.id,{models:{roles:kt(e)?.roles??{}}}),{revalidate:!1})}catch(e){throw V(e instanceof Error?e.message:n.saveError),e}finally{q(!1)}}async function ht(e){if(J){q(!0),V(null);try{N(await _(J.id,{workspace:e.trim()||void 0}),{revalidate:!1})}catch(e){throw V(e instanceof Error?e.message:n.saveError),e}finally{q(!1)}}}async function gt(){if(J){q(!0),V(null);try{N(await _(J.id,{models:null}),{revalidate:!1}),Ze.replaceModelRows(jr(J))}catch(e){V(e instanceof Error?e.message:n.saveError)}finally{q(!1)}}}async function _t(e){if(J){q(!0),V(null);try{N(await _(J.id,{skills:e.inherit?null:e.skills}),{revalidate:!1})}catch(e){throw V(e instanceof Error?e.message:n.saveError),e}finally{q(!1)}}}async function vt(e){if(J){q(!0),V(null);try{N(await _(J.id,{extends:e}),{revalidate:!1}),F()}catch(e){V(e instanceof Error?e.message:n.saveError)}finally{q(!1)}}}async function yt(){switch(W){case`profile`:q(!0),V(null);try{return await(Ve.current?.()??Promise.resolve()),await N(),!0}catch(e){return V(e instanceof Error?e.message:n.saveError),!1}finally{q(!1)}case`runtime`:{let e=J?Tt(J.typedModels.effective):[],t=[];J&&Me.trim()!==J.workspace&&t.push(ht(Me)),J&&JSON.stringify(Ze.modelRows)!==JSON.stringify(e)&&t.push(mt(Ze.modelRows));try{return await Promise.all(t),!0}catch{return!1}}default:return!0}}function bt(e){e||yt().then(e=>{e&&w(Be)})}let xt=J?Ie.trim()||ye(J,n):T??``,Ct=J?.id??T??``,Et=(0,$.useCallback)(async()=>{if(J&&await yt()){Xe.saveProfileMarkdownDebounced.flush();try{globalThis.localStorage?.setItem(ue,J.id)}catch{}w(`/chat/new`,{state:{agentId:J.id,fromAgentEditor:!0}})}},[J,yt,Xe.saveProfileMarkdownDebounced,w]),Dt={a:n,chat:b,cCron:y,selected:J,panel:W,data:z,busy:Oe,editName:Ie,setEditName:Le,editDescription:Re,setEditDescription:ze,editWorkspace:Me,setEditWorkspace:Ne,editModel:Pe,defaultModel:ee?.model?.primary??``,defaultWorkspace:ee?.workspace??``,onSetDefault:()=>{J&&ct(J)},onSetTuiDefault:()=>{J&<(J)},isTuiDefault:!!(J&&J.id===We),isTuiDefaultInherited:!!(J&&J.id===We&&(!Ue||Ke)),onDelete:e=>{J&&dt(J,e)},onTryInChat:()=>void Et(),capabilityPresets:P?.presets??[],defaultPresetId:P?.defaultPresetId,onUpdateAgentExtends:e=>void vt(e),onOpenCapabilityPreset:e=>{w(e?`/settings/capability-presets?preset=${encodeURIComponent(e)}`:`/settings/capability-presets`)},overviewProfile:Ye,filesLoading:Xe.filesLoading,files:Xe.files,activeFile:Xe.activeFile,setActiveFile:Xe.setActiveFile,filesViewMode:Xe.filesViewMode,setFilesViewMode:Xe.setFilesViewMode,fileDraft:Xe.fileDraft,setFileDraft:Xe.setFileDraft,fileSaving:Xe.fileSaving,profileFileLoading:Xe.profileFileLoading,profileEditorNonce:Xe.profileEditorNonce,toolEntryDisable:Ze.toolEntryDisable,setToolEntryDisable:Ze.setToolEntryDisable,onSaveTools:ft,onClearToolsEntry:()=>void pt(),modelRows:Ze.modelRows,setModelRows:Ze.setModelRows,onSaveModels:mt,onSaveWorkspace:ht,onClearModelsEntry:()=>void gt(),skillsCatalogLoading:$e.skillsCatalogLoading,catalogForPick:$e.catalogForPick,skillsInherit:Ze.skillsInherit,setSkillsInherit:Ze.setSkillsInherit,skillsPick:Ze.skillsPick,setSkillsPick:Ze.setSkillsPick,onSaveSkills:_t,bindingsLoading:Y.bindingsLoading,agentBindings:Y.agentBindings,bindChannelStatuses:Y.bindChannelStatuses,bindChannelsLoading:Y.bindChannelsLoading,useManualChannel:Y.useManualChannel,newBindChannel:Y.newBindChannel,setNewBindChannel:Y.setNewBindChannel,bindSessionChats:Y.bindSessionChats,bindSessionsLoading:Y.bindSessionsLoading,newBindSessionIdx:Y.newBindSessionIdx,setNewBindSessionIdx:Y.setNewBindSessionIdx,newBindCustomPeer:Y.newBindCustomPeer,setNewBindCustomPeer:Y.setNewBindCustomPeer,refreshBindSessions:Y.refreshBindSessions,onRemoveBinding:e=>void Y.onRemoveBinding(e),onAddBinding:Y.onAddBinding};return{hasToken:x,a:n,chat:b,language:e,data:z,savedTuiDefaultAgentId:Ue,effectiveTuiDefaultAgentId:We,tuiDefaultAgentUnavailable:Ke,onSetTuiDefaultAgent:lt,onSetDefaultAgent:ct,loading:B,displayError:ie,navigate:w,routeAgentId:T,busy:Oe,listSearchQuery:ke,openAddAgentModal:tt,openDuplicateAgentModal:at,duplicateSourceId:Ce,createPresetIds:Ee,setCreatePresetIds:De,onSelectDuplicateSource:it,panel:W,setPanel:G,modalTitle:xt,modalSubtitle:Ct,onAgentModalOpenChange:bt,addAgentModalOpen:be,setAddAgentModalOpen:xe,createWorkspaceSuggestedRef:Se,createModalError:_e,setCreateModalError:ve,createDisplayName:oe,setCreateDisplayName:se,createAgentId:K,setCreateAgentId:ce,createDescription:le,setCreateDescription:de,createWorkspace:fe,setCreateWorkspace:pe,createModel:he,setCreateModel:ge,onCreate:st,currentLanguageLabel:e===`zh`?`中文`:`English`,applyCreateWorkspaceSuggestion:X,deleteDialogOpen:r,setDeleteDialogOpen:s,deletePurge:m,deleteTarget:c,setDeleteTarget:f,deleteConfirmText:g,setDeleteConfirmText:v,performDelete:ut,editorPanelProps:Dt}}function Pr(){let e=(0,Z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(B,{className:`h-5 w-40`}),(0,Q.jsx)(B,{className:`h-3 w-64 max-w-full`})]}),(0,Q.jsx)(B,{className:`h-9 w-28 rounded-lg`})]}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(`div`,{className:`grid gap-4`,"aria-hidden":`true`,children:[t,(0,Q.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 xl:grid-cols-3`,children:Array.from({length:6}).map(Fr)})]}),e[1]=n):n=e[1],n}function Fr(e,t){return(0,Q.jsxs)(`div`,{className:`rounded-xl bg-surface-base p-4 shadow-surface`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(B,{className:`size-11 rounded-xl`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(B,{className:`h-4 w-2/3`}),(0,Q.jsx)(B,{className:`mt-2 h-3 w-24`})]})]}),(0,Q.jsx)(B,{className:`mt-4 h-3 w-full`}),(0,Q.jsx)(B,{className:`mt-2 h-3 w-4/5`}),(0,Q.jsxs)(`div`,{className:`mt-4 flex gap-2`,children:[(0,Q.jsx)(B,{className:`h-6 w-16 rounded-full`}),(0,Q.jsx)(B,{className:`h-6 w-20 rounded-full`})]})]},t)}function Ir(){let e=Nr();return e.hasToken?(0,Q.jsxs)(ft,{gap:`gap-6`,padding:`px-3 py-8 sm:px-5 xl:px-6`,className:`min-h-full bg-surface-panel`,children:[e.displayError?(0,Q.jsx)(`div`,{className:`rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-700 shadow-surface dark:text-red-300`,children:e.displayError}):null,e.loading?(0,Q.jsx)(Pr,{}):e.data?(0,Q.jsx)(`div`,{className:`flex flex-col gap-4`,children:(0,Q.jsx)(ur,{a:e.a,agents:e.data.agents,defaultAgentId:e.data.defaultId,tuiDefaultAgentId:e.effectiveTuiDefaultAgentId,tuiDefaultInherited:!e.savedTuiDefaultAgentId||e.tuiDefaultAgentUnavailable,searchQuery:e.listSearchQuery,onOpenAgent:t=>e.navigate(Ge(t)),onChatWithAgent:t=>{let n=t.trim().toLowerCase();try{globalThis.localStorage?.setItem(ue,n)}catch{}e.navigate(`/chat/new`,{state:{agentId:n}})},busy:e.busy})}):null,e.routeAgentId&&e.hasToken?(0,Q.jsx)(Rt,{open:!!e.routeAgentId,onOpenChange:e.onAgentModalOpenChange,a:e.a,title:e.modalTitle,subtitle:e.modalSubtitle,panel:e.panel,onPanelChange:e.setPanel,children:e.loading||!e.data?(0,Q.jsx)(Pr,{}):(0,Q.jsx)(ir,{...e.editorPanelProps})}):null,(0,Q.jsx)(fr,{open:e.addAgentModalOpen,onOpenChange:t=>{e.setAddAgentModalOpen(t),t||(e.createWorkspaceSuggestedRef.current=``,e.setCreateDisplayName(``),e.setCreateAgentId(``),e.setCreateDescription(``),e.setCreateWorkspace(``),e.setCreateModel(``),e.setCreateModalError(null),e.onSelectDuplicateSource(null),e.setCreatePresetIds([]))},a:e.a,chat:e.chat,busy:e.busy,modalError:e.createModalError,profileLanguageLabel:e.currentLanguageLabel,createDisplayName:e.createDisplayName,setCreateDisplayName:e.setCreateDisplayName,createAgentId:e.createAgentId,setCreateAgentId:e.setCreateAgentId,createDescription:e.createDescription,setCreateDescription:e.setCreateDescription,createWorkspace:e.createWorkspace,setCreateWorkspace:e.setCreateWorkspace,createModel:e.createModel,setCreateModel:e.setCreateModel,onCreate:e.onCreate,onSuggestWorkspace:()=>e.applyCreateWorkspaceSuggestion(),agents:e.data?.agents??[],duplicateSourceId:e.duplicateSourceId,onSelectDuplicateSource:e.onSelectDuplicateSource,capabilityPlans:e.editorPanelProps.capabilityPresets,defaultPresetId:e.editorPanelProps.defaultPresetId??`default`,selectedCapabilityPlanIds:e.createPresetIds,onSelectedCapabilityPlanIdsChange:e.setCreatePresetIds}),(0,Q.jsx)(Pt,{open:e.deleteDialogOpen,onOpenChange:t=>{e.setDeleteDialogOpen(t),t||(e.setDeleteTarget(null),e.setDeleteConfirmText(``))},busy:e.busy,deletePurge:e.deletePurge,deleteTarget:e.deleteTarget,deleteConfirmText:e.deleteConfirmText,onDeleteConfirmTextChange:e.setDeleteConfirmText,onConfirm:()=>{e.deleteTarget&&e.performDelete(e.deleteTarget,e.deletePurge)},onCancel:()=>e.setDeleteDialogOpen(!1),a:e.a})]}):(0,Q.jsxs)(ft,{gap:`gap-3`,padding:`px-3 py-8 sm:px-5 xl:px-6`,className:`min-h-full bg-surface-panel`,children:[(0,Q.jsx)(dt,{title:e.a.title}),(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:e.a.needToken})]})}export{Ir as AgentsSettingsPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./cn-JdwAhgNB.js";import{t as a}from"./copy-to-clipboard-HOJ79TWv.js";import{t as o}from"./messages-DQ5X6cXp.js";import{n as s,r as c,s as l}from"./locale-store-Bjvw7jtg.js";import{i as u}from"./vendor-swr-BIWyz7Rc.js";import{At as d,Bo as f,Fo as p,Ho as m,Lo as h,Na as g,Nc as _,Ro as v,Vo as y,Wl as b,is as x,rs as S,vs as C,ws as w,zo as T}from"./index-BzPwnXho.js";import{n as E,r as D}from"./settings-page-layout-CTMmZcwj.js";import{t as O}from"./settings-loading-skeleton-BS36Mjzz.js";import{r as k,t as A}from"./settings-form-section-C7rzhi7x.js";var j=n(),M=e(t(),1),N=r();function P(e,t){return e==null?t:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function F(e,t){return e===`PENDING_UPDATE`?t.pendingUpdate??t.generic:e===`UNINSTALLER_NOT_FOUND`?t.uninstallerNotFound??t.generic:e===`NOT_PACKAGED`?t.notPackaged??t.generic:t.generic}function I(e,t){if(e.platform===`darwin`)return t.uninstallDescDarwin;if(e.platform===`win32`)return t.uninstallDescWin;if(e.platform===`linux`){if(e.linuxPackageKind===`appimage`)return t.uninstallDescLinuxAppImage;if(e.linuxPackageKind===`deb`){let n=e.linuxDebPackageName??`xopc`;return t.uninstallDescLinuxDeb.replace(/\{\{package\}\}/g,n)}return t.uninstallDescLinuxUnknown}return t.uninstallDescLinuxUnknown}var L={info:null,loadError:null,actionError:null,copiedField:null,clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``,uninstallDialogOpen:!1,removeUserDataOnUninstall:!1,busy:!1};function R({api:e,messages:t,embedded:n=!0}){let[r,o]=(0,M.useReducer)(d,L),{info:s,loadError:c,actionError:l,copiedField:u,clearDialogOpen:m,clearConfirmChecked:g,clearConfirmText:E,uninstallDialogOpen:D,removeUserDataOnUninstall:k,busy:j}=r,R=(0,M.useCallback)(async()=>{if(e?.getUninstallInfo){o({type:`patch`,patch:{loadError:null}});try{o({type:`patch`,patch:{info:await e.getUninstallInfo()}})}catch(e){o({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}}},[e]);(0,M.useEffect)(()=>{R()},[R]);let z=async(e,n)=>{if(await a(e)){o({type:`patch`,patch:{actionError:null,copiedField:n}}),window.setTimeout(()=>o({type:`patch`,patch:{copiedField:null}}),2e3);return}o({type:`patch`,patch:{actionError:t.copyFailed}})},B=async()=>{if(e?.clearUserData){o({type:`patch`,patch:{busy:!0,actionError:null}});try{let n=await e.clearUserData();n.ok||o({type:`patch`,patch:{actionError:F(n.error,t.errors)}})}catch(e){o({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.errors.generic}})}finally{o({type:`patch`,patch:{busy:!1,clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})}}},V=async()=>{if(e?.uninstallApp){o({type:`patch`,patch:{busy:!0,actionError:null}});try{let n=await e.uninstallApp({removeUserData:k});n.ok||o({type:`patch`,patch:{actionError:F(n.error,t.errors)}})}catch(e){o({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.errors.generic}})}finally{o({type:`patch`,patch:{busy:!1,uninstallDialogOpen:!1}})}}};if(c)return(0,N.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:c});if(!s)return(0,N.jsx)(O,{rows:2});let H=!s.packaged,U=j||s.pendingUpdate||H,W=!H&&s.uninstallMode!==`unsupported`,G=I(s,t),K=g&&E.trim()===t.clearDataConfirmPhrase;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(A,{children:[n?(0,N.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,N.jsx)(_,{className:`size-4 text-accent`,strokeWidth:1.75}),t.title]}):null,l?(0,N.jsx)(`p`,{className:`mb-3 text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:l}):null,H?(0,N.jsxs)(`div`,{className:`mb-4 rounded-xl bg-surface-panel/70 px-3 py-2.5 shadow-surface`,children:[(0,N.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.devOnlyTitle}),(0,N.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:t.devOnlyBody})]}):null,s.pendingUpdate?(0,N.jsx)(`p`,{className:`mb-3 rounded-xl border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-800 dark:text-amber-200`,children:t.pendingUpdateBlocked}):null,(0,N.jsxs)(`dl`,{className:`space-y-3 text-sm`,children:[(0,N.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,children:[(0,N.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:t.appPath}),(0,N.jsxs)(`dd`,{className:`mt-1 flex items-start justify-between gap-2`,children:[(0,N.jsx)(`code`,{className:`break-all text-xs text-fg`,children:s.appPath}),(0,N.jsxs)(`button`,{type:`button`,className:i(`inline-flex shrink-0 items-center gap-1 rounded-lg border border-edge px-2 py-1 text-xs text-fg hover:bg-surface-hover`,C.press),onClick:()=>void z(s.appPath,`app`),children:[(0,N.jsx)(b,{className:`size-3`,"aria-hidden":!0}),u===`app`?t.copied:t.copyPath]})]})]}),(0,N.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,children:[(0,N.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:t.dataPath}),(0,N.jsxs)(`dd`,{className:`mt-1 flex items-start justify-between gap-2`,children:[(0,N.jsx)(`code`,{className:`break-all text-xs text-fg`,children:s.dataPath}),(0,N.jsxs)(`button`,{type:`button`,className:i(`inline-flex shrink-0 items-center gap-1 rounded-lg border border-edge px-2 py-1 text-xs text-fg hover:bg-surface-hover`,C.press),onClick:()=>void z(s.dataPath,`data`),children:[(0,N.jsx)(b,{className:`size-3`,"aria-hidden":!0}),u===`data`?t.copied:t.copyPath]})]}),(0,N.jsxs)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:[t.dataSize,`: `,P(s.dataSizeBytes,t.dataSizeUnknown)]}),(0,N.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-amber-800 dark:text-amber-200`,children:t.sharedDataWarning})]})]}),(0,N.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,N.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.clearData}),(0,N.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:t.clearDataDesc})]}),(0,N.jsx)(`button`,{type:`button`,disabled:U,className:i(`inline-flex shrink-0 items-center justify-center rounded-lg border border-danger/40 bg-danger px-3 py-1.5 text-sm font-medium text-white hover:bg-danger/90 disabled:opacity-50`,C.press),onClick:()=>{o({type:`patch`,patch:{clearConfirmChecked:!1,clearConfirmText:``,clearDialogOpen:!0}})},children:t.clearData})]}),W?(0,N.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.uninstall}),(0,N.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:G})]}),(0,N.jsx)(`button`,{type:`button`,disabled:U,className:i(`inline-flex shrink-0 items-center justify-center rounded-lg border border-edge bg-surface-base px-3 py-1.5 text-sm font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,C.press),onClick:()=>{o({type:`patch`,patch:{removeUserDataOnUninstall:!1,uninstallDialogOpen:!0}})},children:t.uninstall})]}):null]})]}),(0,N.jsx)(p,{open:m,onOpenChange:e=>{e||o({type:`patch`,patch:{clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})},children:(0,N.jsxs)(f,{children:[(0,N.jsx)(T,{className:i(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,x)}),(0,N.jsxs)(h,{className:i(`fixed left-1/2 top-1/2 w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2`,S,`rounded-2xl border border-edge bg-surface-panel p-6 shadow-popover outline-none dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,N.jsx)(y,{className:`text-base font-semibold text-fg`,children:t.clearDataConfirmTitle}),(0,N.jsx)(v,{className:`mt-2 text-sm text-fg-muted`,children:t.clearDataConfirmDesc}),(0,N.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,N.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,checked:g,onChange:e=>o({type:`patch`,patch:{clearConfirmChecked:e.target.checked}})}),(0,N.jsx)(`span`,{children:t.clearDataConfirmCheckbox})]}),(0,N.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,N.jsx)(`label`,{className:`block text-sm font-medium text-fg`,htmlFor:`clear-data-confirm`,children:t.clearDataConfirmLabel}),(0,N.jsx)(`input`,{id:`clear-data-confirm`,type:`text`,autoComplete:`off`,spellCheck:!1,className:i(`w-full rounded-md border border-edge bg-surface-panel px-3 py-1.5 font-mono text-xs text-fg`,`placeholder:text-fg-subtle`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`dark:border-edge`),placeholder:t.clearDataConfirmPhrase,value:E,onChange:e=>o({type:`patch`,patch:{clearConfirmText:e.target.value}})}),(0,N.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.clearDataConfirmHint})]}),(0,N.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[(0,N.jsx)(w,{type:`button`,variant:`secondary`,disabled:j,onClick:()=>{o({type:`patch`,patch:{clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})},children:t.cancel}),(0,N.jsx)(w,{type:`button`,variant:`secondary`,className:`border-danger/40 bg-danger text-white hover:bg-danger/90 dark:border-danger/40`,disabled:j||!K,onClick:()=>void B(),children:t.confirmClear})]})]})]})}),W?(0,N.jsx)(p,{open:D,onOpenChange:e=>{e||o({type:`patch`,patch:{uninstallDialogOpen:!1}})},children:(0,N.jsxs)(f,{children:[(0,N.jsx)(T,{className:i(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,x)}),(0,N.jsxs)(h,{className:i(`fixed left-1/2 top-1/2 w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2`,S,`rounded-2xl border border-edge bg-surface-panel p-6 shadow-popover outline-none dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,N.jsx)(y,{className:`text-base font-semibold text-fg`,children:t.uninstallConfirmTitle}),(0,N.jsx)(v,{className:`mt-2 text-sm text-fg-muted`,children:G}),(0,N.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,N.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,checked:k,onChange:e=>o({type:`patch`,patch:{removeUserDataOnUninstall:e.target.checked}})}),(0,N.jsx)(`span`,{children:t.removeUserDataCheckbox})]}),k?(0,N.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t.clearDataConfirmDesc}):null,(0,N.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[(0,N.jsx)(w,{type:`button`,variant:`secondary`,disabled:j,onClick:()=>o({type:`patch`,patch:{uninstallDialogOpen:!1}}),children:t.cancel}),(0,N.jsx)(w,{type:`button`,variant:`secondary`,className:`border-danger/40 bg-danger text-white hover:bg-danger/90 dark:border-danger/40`,disabled:j,onClick:()=>void V(),children:t.confirmUninstall})]})]})]})}):null]})}async function z(){return(await l(c(`/api/migrations/status`))).payload}async function B(){await l(c(`/api/migrations/apply`),{method:`POST`,body:`{}`})}function V({messages:e}){let{data:t,error:n,isLoading:r,mutate:i}=u(`settings-migration-status`,z,{refreshInterval:0,revalidateOnFocus:!1}),[a,o]=(0,M.useState)(!1),[s,c]=(0,M.useState)(null);async function l(){o(!0),c(null);try{await B(),await i(),window.dispatchEvent(new CustomEvent(`config-reload`))}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1)}}if(r)return(0,N.jsxs)(`section`,{className:`rounded-2xl bg-surface-panel p-4 shadow-surface`,"aria-busy":`true`,children:[(0,N.jsx)(g,{className:`h-5 w-40 max-w-full`}),(0,N.jsx)(g,{className:`mt-2 h-4 w-64 max-w-full`})]});if(n)return(0,N.jsxs)(`section`,{className:`rounded-2xl bg-surface-panel p-4 shadow-surface`,children:[(0,N.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,N.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:e.checkFailed})]});let d=t?.items??[],f=d.filter(e=>e.status===`conflict`||e.status===`error`),p=d.filter(e=>e.safety===`auto`&&e.status===`planned`),m=f.length>0||d.some(e=>e.safety!==`auto`);return(0,N.jsxs)(`section`,{className:`rounded-2xl bg-surface-panel p-4 shadow-surface`,children:[(0,N.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,N.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:d.length===0?e.upToDate:m?e.manualAttention:e.safeRepairs.replace(`{{count}}`,String(p.length))})]}),p.length>0&&!m?(0,N.jsx)(w,{type:`button`,variant:`primary`,className:`px-3 py-1.5 text-xs`,onClick:()=>void l(),disabled:a,children:a?e.applying:e.apply}):null]}),d.length>0?(0,N.jsx)(`div`,{className:`mt-3 space-y-2`,children:d.map(e=>(0,N.jsxs)(`div`,{className:`rounded-xl bg-surface-base px-3 py-2`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,N.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:e.title}),(0,N.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-[11px] uppercase tracking-wide text-fg-muted`,children:e.status})]}),(0,N.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:e.message})]},e.id))}):null,s?(0,N.jsx)(`p`,{className:`mt-3 text-sm text-red-500`,children:s}):null]})}function H(){let e=(0,j.c)(28),t=s(U),n;e[0]===t?n=e[1]:(n=o(t),e[0]=t,e[1]=n);let r=n.systemSettings,i=r.desktopApp,a=typeof window<`u`?window.electronAPI?.system:void 0;if(!m()||!a){let t;e[2]===i.title?t=e[3]:(t=(0,N.jsx)(E,{title:i.title}),e[2]=i.title,e[3]=t);let n;e[4]===i.migrations?n=e[5]:(n=(0,N.jsx)(V,{messages:i.migrations}),e[4]=i.migrations,e[5]=n);let a;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(a=k(),e[6]=a):a=e[6];let o;e[7]===r.desktopOnlyTitle?o=e[8]:(o=(0,N.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:r.desktopOnlyTitle}),e[7]=r.desktopOnlyTitle,e[8]=o);let s;e[9]===r.desktopOnlyBody?s=e[10]:(s=(0,N.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:r.desktopOnlyBody}),e[9]=r.desktopOnlyBody,e[10]=s);let c;e[11]!==o||e[12]!==s?(c=(0,N.jsxs)(`div`,{className:a,children:[o,s]}),e[11]=o,e[12]=s,e[13]=c):c=e[13];let l;return e[14]!==t||e[15]!==n||e[16]!==c?(l=(0,N.jsxs)(D,{gap:`gap-3`,children:[t,n,c]}),e[14]=t,e[15]=n,e[16]=c,e[17]=l):l=e[17],l}let c;e[18]===i.title?c=e[19]:(c=(0,N.jsx)(E,{title:i.title}),e[18]=i.title,e[19]=c);let l;e[20]===i.migrations?l=e[21]:(l=(0,N.jsx)(V,{messages:i.migrations}),e[20]=i.migrations,e[21]=l);let u;e[22]===i?u=e[23]:(u=(0,N.jsx)(R,{api:a,messages:i,embedded:!1}),e[22]=i,e[23]=u);let d;return e[24]!==c||e[25]!==l||e[26]!==u?(d=(0,N.jsxs)(D,{gap:`gap-6`,children:[c,l,u]}),e[24]=c,e[25]=l,e[26]=u,e[27]=d):d=e[27],d}function U(e){return e.language}export{H as AppManagementSettingsPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./cn-JdwAhgNB.js";import{t as a}from"./messages-DQ5X6cXp.js";import{n as o,r as s,s as c}from"./locale-store-Bjvw7jtg.js";import{i as l}from"./theme-store-DtxpMC5S.js";import{Na as u,Qo as d,Yo as f,Zo as p,bo as m,ft as h,vs as g,xo as _}from"./index-BzPwnXho.js";import{n as v,r as y}from"./settings-page-layout-CTMmZcwj.js";import{t as b}from"./settings-advanced-gate-DAvTIbgw.js";var x=e(t(),1),S=n();function C(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function w(e){let t=C(e)?e:{},n=C(t.gateway)?t.gateway:{},r=(C(n.webchat)?n.webchat:{}).activityDetailDefault;return r===`off`||r===`stream`||r===`on`?r:`on`}async function T(e){await c(s(`/api/config`),{method:`PATCH`,body:JSON.stringify({gateway:{webchat:{activityDetailDefault:e}}})}),await m()}var E=r();function D(){return i(`rounded-xl bg-surface-base px-4 py-1 sm:px-5`)}var O={default:{light:{canvas:`#ffffff`,panel:`#fafafa`,accent:`#3a6bff`,fg:`#111111`,muted:`#ececec`},dark:{canvas:`#0a0a0a`,panel:`#121212`,accent:`#3a6bff`,fg:`#f5f5f5`,muted:`#222222`}},emerald:{light:{canvas:`#f0fdf4`,panel:`#ffffff`,accent:`#059669`,fg:`#052e16`,muted:`#86efac`},dark:{canvas:`#000000`,panel:`#0a0a0a`,accent:`#10b981`,fg:`#d1fae5`,muted:`#134e2a`}},mono:{light:{canvas:`#ffffff`,panel:`#f5f5f5`,accent:`#111111`,fg:`#111111`,muted:`#e5e7eb`},dark:{canvas:`#101010`,panel:`#1a1a1a`,accent:`#737373`,fg:`#fafafa`,muted:`#333333`}},clay:{light:{canvas:`#fffaf0`,panel:`#ffffff`,accent:`#1a3a3a`,fg:`#0a0a0a`,muted:`#e5e5e5`},dark:{canvas:`#0a1a1a`,panel:`#1a2a2a`,accent:`#ffb084`,fg:`#fffaf0`,muted:`#2a3a3a`}}};function k(e){let t=(0,S.c)(24),{canvas:n,panel:r,accent:i,fg:a,muted:o}=e,s;t[0]===n?s=t[1]:(s={backgroundColor:n},t[0]=n,t[1]=s);let c;t[2]!==o||t[3]!==r?(c={backgroundColor:r,borderColor:o},t[2]=o,t[3]=r,t[4]=c):c=t[4];let l;t[5]===i?l=t[6]:(l=(0,E.jsx)(`div`,{className:`size-1 shrink-0 rounded-full`,style:{backgroundColor:i}}),t[5]=i,t[6]=l);let u;t[7]===a?u=t[8]:(u=(0,E.jsx)(`div`,{className:`h-1 min-w-0 flex-1 rounded-full`,style:{backgroundColor:a,opacity:.85}}),t[7]=a,t[8]=u);let d;t[9]!==l||t[10]!==u?(d=(0,E.jsxs)(`div`,{className:`flex items-center gap-1`,children:[l,u]}),t[9]=l,t[10]=u,t[11]=d):d=t[11];let f;t[12]===o?f=t[13]:(f=(0,E.jsx)(`div`,{className:`h-1 w-2/3 max-w-[70%] rounded-full`,style:{backgroundColor:o}}),t[12]=o,t[13]=f);let p;t[14]===o?p=t[15]:(p=(0,E.jsx)(`div`,{className:`size-1/2 max-w-[55%] rounded-full`,style:{backgroundColor:o}}),t[14]=o,t[15]=p);let m;t[16]!==c||t[17]!==d||t[18]!==f||t[19]!==p?(m=(0,E.jsxs)(`div`,{className:`flex flex-col gap-0.5 rounded-sm border p-1`,style:c,children:[d,f,p]}),t[16]=c,t[17]=d,t[18]=f,t[19]=p,t[20]=m):m=t[20];let h;return t[21]!==s||t[22]!==m?(h=(0,E.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col justify-center gap-1 p-1.5`,style:s,children:m}),t[21]=s,t[22]=m,t[23]=h):h=t[23],h}function A(e){let t=(0,S.c)(8),{scheme:n}=e,{light:r,dark:i}=O[n],a;t[0]===r?a=t[1]:(a=(0,E.jsx)(k,{...r}),t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,E.jsx)(`div`,{className:`w-px shrink-0 bg-black/12 dark:bg-white/12`,"aria-hidden":!0}),t[2]=o):o=t[2];let s;t[3]===i?s=t[4]:(s=(0,E.jsx)(k,{...i}),t[3]=i,t[4]=s);let c;return t[5]!==a||t[6]!==s?(c=(0,E.jsxs)(`div`,{className:`flex h-11 w-full overflow-hidden rounded-md border border-edge-subtle`,children:[a,o,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7],c}var j=[{value:`default`,labelKey:`colorSchemeDefault`},{value:`emerald`,labelKey:`colorSchemeLightGreen`},{value:`mono`,labelKey:`colorSchemeModernMono`},{value:`clay`,labelKey:`colorSchemeClay`}];function M(){let e=(0,S.c)(18),t=o(F),n;e[0]===t?n=e[1]:(n=a(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,s=l(P),c=l(N),u;e[2]===r.colorSchemeTitle?u=e[3]:(u=(0,E.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:r.colorSchemeTitle}),e[2]=r.colorSchemeTitle,e[3]=u);let d;e[4]===r.colorSchemeDescription?d=e[5]:(d=(0,E.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:r.colorSchemeDescription}),e[4]=r.colorSchemeDescription,e[5]=d);let f;e[6]!==u||e[7]!==d?(f=(0,E.jsxs)(`div`,{className:`min-w-0`,children:[u,d]}),e[6]=u,e[7]=d,e[8]=f):f=e[8];let p;e[9]!==r||e[10]!==s||e[11]!==c?(p=j.map(e=>{let{value:t,labelKey:n}=e,a=s===t;return(0,E.jsxs)(`button`,{type:`button`,"aria-pressed":a,onClick:()=>c(t),className:i(`flex flex-col gap-2 rounded-xl border-2 p-2.5 text-left transition-[border-color,box-shadow,transform] duration-150`,g.pressCard,a?`border-accent shadow-[0_0_0_1px_var(--color-accent)]`:`border-edge-subtle hover:border-edge`),children:[(0,E.jsx)(A,{scheme:t}),(0,E.jsx)(`span`,{className:i(`text-xs font-medium leading-none`,a?`text-accent-fg`:`text-fg-muted`),children:r[n]})]},t)}),e[9]=r,e[10]=s,e[11]=c,e[12]=p):p=e[12];let m;e[13]===p?m=e[14]:(m=(0,E.jsx)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:p}),e[13]=p,e[14]=m);let h;return e[15]!==f||e[16]!==m?(h=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg bg-surface-panel/50 p-3.5 sm:py-4`,children:[f,m]}),e[15]=f,e[16]=m,e[17]=h):h=e[17],h}function N(e){return e.setColorScheme}function P(e){return e.colorScheme}function F(e){return e.language}function I(){let e=(0,S.c)(31),t=o(L),n;e[0]===t?n=e[1]:(n=a(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,{data:s,isLoading:c}=_(!0),l=s?.payload?.config,f;e[2]===l?f=e[3]:(f=w(l),e[2]=l,e[3]=f);let m=f,[h,g]=(0,x.useState)(m),[v,y]=(0,x.useState)(!1),[b,C]=(0,x.useState)(!1),D,O;e[4]===m?(D=e[5],O=e[6]):(D=()=>g(m),O=[m],e[4]=m,e[5]=D,e[6]=O),(0,x.useEffect)(D,O);let k;e[7]===h?k=e[8]:(k=e=>{let t=h;g(e),y(!0),C(!1),T(e).catch(()=>{g(t),C(!0)}).finally(()=>y(!1))},e[7]=h,e[8]=k);let A=k,j;e[9]===r.activityDetailDefaultTitle?j=e[10]:(j=(0,E.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:r.activityDetailDefaultTitle}),e[9]=r.activityDetailDefaultTitle,e[10]=j);let M;e[11]===r.activityDetailDefaultDescription?M=e[12]:(M=(0,E.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:r.activityDetailDefaultDescription}),e[11]=r.activityDetailDefaultDescription,e[12]=M);let N;e[13]!==j||e[14]!==M?(N=(0,E.jsxs)(`div`,{className:`min-w-0`,children:[j,M]}),e[13]=j,e[14]=M,e[15]=N):N=e[15];let P;e[16]!==r.activityDetailLevels||e[17]!==A||e[18]!==c||e[19]!==h||e[20]!==v?(P=c?(0,E.jsx)(u,{className:`h-10 w-full rounded-lg sm:max-w-sm`}):(0,E.jsxs)(p,{value:h,disabled:v,onChange:e=>A(e.target.value),triggerClassName:`sm:max-w-sm`,children:[(0,E.jsx)(d,{value:`off`,children:r.activityDetailLevels.off}),(0,E.jsx)(d,{value:`on`,children:r.activityDetailLevels.on}),(0,E.jsx)(d,{value:`stream`,children:r.activityDetailLevels.stream})]}),e[16]=r.activityDetailLevels,e[17]=A,e[18]=c,e[19]=h,e[20]=v,e[21]=P):P=e[21];let F=b?`text-red-600 dark:text-red-400`:`text-fg-subtle`,I;e[22]===F?I=e[23]:(I=i(`min-h-4 text-xs`,F),e[22]=F,e[23]=I);let R=b?r.activityDetailSaveError:v?r.activityDetailSaving:r.activityDetailDefaultHint,z;e[24]!==I||e[25]!==R?(z=(0,E.jsx)(`p`,{className:I,children:R}),e[24]=I,e[25]=R,e[26]=z):z=e[26];let B;return e[27]!==z||e[28]!==N||e[29]!==P?(B=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 py-3.5 sm:py-4`,children:[N,P,z]}),e[27]=z,e[28]=N,e[29]=P,e[30]=B):B=e[30],B}function L(e){return e.language}function R(){let e=(0,S.c)(27),t=o(V),n;e[0]===t?n=e[1]:(n=a(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i=h(B),s=h(z),c;e[2]===r.developerGroupTitle?c=e[3]:(c=(0,E.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:r.developerGroupTitle}),e[2]=r.developerGroupTitle,e[3]=c);let l;e[4]===r.developerGroupDescription?l=e[5]:(l=(0,E.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:r.developerGroupDescription}),e[4]=r.developerGroupDescription,e[5]=l);let u;e[6]!==c||e[7]!==l?(u=(0,E.jsxs)(`div`,{className:`min-w-0`,children:[c,l]}),e[6]=c,e[7]=l,e[8]=u):u=e[8];let d;e[9]===r.showRawToolDataTitle?d=e[10]:(d=(0,E.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:r.showRawToolDataTitle}),e[9]=r.showRawToolDataTitle,e[10]=d);let f;e[11]===r.showRawToolDataDescription?f=e[12]:(f=(0,E.jsx)(`p`,{className:`text-xs text-fg-muted`,children:r.showRawToolDataDescription}),e[11]=r.showRawToolDataDescription,e[12]=f);let p;e[13]!==d||e[14]!==f?(p=(0,E.jsxs)(`div`,{className:`min-w-0`,children:[d,f]}),e[13]=d,e[14]=f,e[15]=p):p=e[15];let m;e[16]===s?m=e[17]:(m=e=>s(e.target.checked),e[16]=s,e[17]=m);let g;e[18]!==i||e[19]!==m?(g=(0,E.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:i,onChange:m}),e[18]=i,e[19]=m,e[20]=g):g=e[20];let _;e[21]!==p||e[22]!==g?(_=(0,E.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-hover/50 px-3 py-2.5 dark:bg-surface-hover/35`,children:[p,g]}),e[21]=p,e[22]=g,e[23]=_):_=e[23];let v;return e[24]!==u||e[25]!==_?(v=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 py-3.5 sm:py-4`,children:[u,_]}),e[24]=u,e[25]=_,e[26]=v):v=e[26],v}function z(e){return e.setShowRawToolData}function B(e){return e.showRawToolData}function V(e){return e.language}function H(){let e=(0,S.c)(30),t=o(U),n;e[0]===t?n=e[1]:(n=a(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i;e[2]!==r.pageTitle||e[3]!==r.subtitle?(i=(0,E.jsx)(v,{title:r.pageTitle,subtitle:r.subtitle}),e[2]=r.pageTitle,e[3]=r.subtitle,e[4]=i):i=e[4];let s;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=D(),e[5]=s):s=e[5];let c;e[6]===r.languageTitle?c=e[7]:(c=(0,E.jsx)(`h2`,{id:`pref-language-heading`,className:`sr-only`,children:r.languageTitle}),e[6]=r.languageTitle,e[7]=c);let l;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,E.jsx)(f,{variant:`page`,sections:[`language`]}),e[8]=l):l=e[8];let u;e[9]===c?u=e[10]:(u=(0,E.jsxs)(`section`,{className:s,"aria-labelledby":`pref-language-heading`,children:[c,l]}),e[9]=c,e[10]=u);let d;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(d=D(),e[11]=d):d=e[11];let p;e[12]===r.themeTitle?p=e[13]:(p=(0,E.jsx)(`h2`,{id:`pref-appearance-heading`,className:`sr-only`,children:r.themeTitle}),e[12]=r.themeTitle,e[13]=p);let m,h,g;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,E.jsx)(f,{variant:`page`,sections:[`theme`,`font`]}),g=(0,E.jsx)(M,{}),m=(0,E.jsx)(I,{}),e[14]=m,e[15]=h,e[16]=g):(m=e[14],h=e[15],g=e[16]);let _;e[17]===p?_=e[18]:(_=(0,E.jsxs)(`section`,{className:d,"aria-labelledby":`pref-appearance-heading`,children:[p,h,g,m]}),e[17]=p,e[18]=_);let x;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(x=D(),e[19]=x):x=e[19];let C;e[20]===r.developerGroupTitle?C=e[21]:(C=(0,E.jsx)(`h2`,{id:`pref-developer-heading`,className:`sr-only`,children:r.developerGroupTitle}),e[20]=r.developerGroupTitle,e[21]=C);let w;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,E.jsx)(R,{}),e[22]=w):w=e[22];let T;e[23]===C?T=e[24]:(T=(0,E.jsx)(b,{children:(0,E.jsxs)(`section`,{className:x,"aria-labelledby":`pref-developer-heading`,children:[C,w]})}),e[23]=C,e[24]=T);let O;return e[25]!==i||e[26]!==_||e[27]!==T||e[28]!==u?(O=(0,E.jsxs)(y,{gap:`gap-6`,children:[i,u,_,T]}),e[25]=i,e[26]=_,e[27]=T,e[28]=u,e[29]=O):O=e[29],O}function U(e){return e.language}export{H as AppearanceSettingsPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{f as i,t as a}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{t as o}from"./check-DUBLcKHA.js";import{t as s}from"./cn-JdwAhgNB.js";import{t as c}from"./messages-DQ5X6cXp.js";import{l,n as u,o as d,r as f,s as p}from"./locale-store-Bjvw7jtg.js";import{a as m,i as h}from"./vendor-swr-BIWyz7Rc.js";import{At as g,Ba as _,Bo as v,Bs as y,Ds as b,Fa as x,Fo as S,Kc as C,La as w,Ll as T,Lo as E,Na as D,Nc as O,Oa as k,Ra as A,Ro as j,Sc as M,Ti as ee,Ua as N,Vo as te,Vs as ne,ac as re,dc as P,ku as ie,lu as F,sc as I,vu as L,ws as R,za as z,zo as ae}from"./index-BzPwnXho.js";import{t as B}from"./page-tabs-HXweXqYE.js";var V=e(t(),1),H=n();function U(e){return e===`builtin`||e===`user`?e:`marketplace`}async function W(e){try{let t=await e.json();if(typeof t.error==`string`)return t.error;if(t.error&&typeof t.error==`object`&&typeof t.error.message==`string`)return t.error.message;if(typeof t.message==`string`)return t.message}catch{}return e.statusText||`HTTP ${e.status}`}async function oe(e){let t=await d(f(`/api/marketplace/packages/${encodeURIComponent(e.trim())}`),{cache:`no-store`});if(!t.ok)throw Error(await W(t));let n=await t.json();if(!n.ok||!n.payload?.id)throw Error(n.error??`Invalid response`);return n.payload}async function G(e){let t=await d(f(`/api/marketplace/install`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await W(t));let n=await t.json();if(!n.ok||!n.payload?.extensionId)throw Error(n.error??`Invalid response`);return n.payload}async function K(e){let t=await d(f(`/api/extensions/bundled/activation`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({extensionId:e.extensionId.trim(),enabled:e.enabled})});if(!t.ok)throw Error(await W(t));let n=await t.json();if(!n.ok||!n.payload)throw Error(n.error?.message??`Invalid response`);return n.payload}async function q(e){let t=await d(f(`/api/marketplace/uninstall`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({extensionId:e})});if(!t.ok)throw Error(await W(t));let n=await t.json();if(!n.ok||!n.payload)throw Error(n.error??`Invalid response`);return n.payload}var J=r();function se(e,t){let n=e.find(e=>e.id===t);return n?n.source===`bundled`?`bundled`:`user`:`absent`}var Y={q:``,debounced:``,detailPkg:null,rowBusy:null,actionError:null,restartHint:null};function X({className:e}){let t=c(u(e=>e.language)).extensionsPage,n=l(e=>!!e.token),r=w(),{mutate:i}=m(),[a,o]=(0,V.useReducer)(g,Y),{q:d,debounced:_,detailPkg:v,rowBusy:y,actionError:b,restartHint:x}=a,S=n?`marketplace-${_}`:null;(0,V.useEffect)(()=>{let e=window.setTimeout(()=>o({type:`patch`,patch:{debounced:d.trim()}}),300);return()=>window.clearTimeout(e)},[d]);let{data:T,isLoading:E,error:A}=h(S,async()=>p(_.length>0?f(`/api/marketplace?q=${encodeURIComponent(_)}`):f(`/api/marketplace`)),{revalidateOnFocus:!1}),j=(0,V.useCallback)(()=>{i(`gateway-extensions-list`),k()},[i]),M=(0,V.useCallback)(async(e,n)=>{o({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let r=await G({name:e,overwrite:n});j(),r.requiresGatewayRestart&&o({type:`patch`,patch:{restartHint:t.marketplaceRestartHint}})}catch(e){throw o({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.marketplaceInstallFailed}}),e}finally{o({type:`patch`,patch:{rowBusy:null}})}},[t.marketplaceInstallFailed,t.marketplaceRestartHint,j]),ee=(0,V.useCallback)(async e=>{o({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let n=await q(e);j(),n.requiresGatewayRestart&&o({type:`patch`,patch:{restartHint:t.marketplaceRestartHint}})}catch(e){throw o({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.marketplaceUninstallFailed}}),e}finally{o({type:`patch`,patch:{rowBusy:null}})}},[t.marketplaceRestartHint,t.marketplaceUninstallFailed,j]),N=T?.extensions??[];return(0,J.jsxs)(`div`,{className:s(`flex flex-col gap-4`,e),children:[(0,J.jsxs)(`div`,{className:`relative`,children:[(0,J.jsx)(P,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-muted`,strokeWidth:1.75,"aria-hidden":!0}),(0,J.jsx)(`input`,{type:`search`,value:d,onChange:e=>o({type:`patch`,patch:{q:e.target.value}}),placeholder:t.marketplaceSearchPlaceholder,className:`ui-input h-10 w-full rounded-lg border border-edge bg-surface-base pl-9 pr-3 text-sm text-fg placeholder:text-fg-muted`})]}),A?(0,J.jsx)(`p`,{className:`text-sm text-fg-muted`,children:A instanceof Error?A.message:t.marketplaceLoadFailed}):null,b?(0,J.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:b}):null,x?(0,J.jsx)(`p`,{className:`text-sm text-fg-muted`,children:x}):null,E&&!T?(0,J.jsx)(`ul`,{className:`flex flex-col gap-3`,"aria-label":t.marketplaceLoading,children:[0,1,2].map(e=>(0,J.jsx)(`li`,{className:`rounded-xl bg-surface-panel p-4 shadow-surface`,children:(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,J.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2.5`,children:[(0,J.jsx)(D,{className:`h-5 w-40`}),(0,J.jsx)(D,{className:`h-4 w-full max-w-xl`}),(0,J.jsx)(D,{className:`h-4 w-2/3 max-w-md`})]}),(0,J.jsx)(D,{className:`h-8 w-20`})]})},e))}):(0,J.jsx)(`ul`,{className:`flex flex-col gap-3`,children:N.length===0?(0,J.jsx)(`li`,{className:`text-sm text-fg-muted`,children:t.marketplaceEmpty}):N.map(e=>{let n=se(r,e.id),i=y===e.id;return(0,J.jsx)(`li`,{className:`list-none`,children:(0,J.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-label":`${e.name}, ${t.marketplaceDetailTitle}`,onClick:()=>o({type:`patch`,patch:{detailPkg:e.id}}),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),o({type:`patch`,patch:{detailPkg:e.id}}))},className:s(`flex w-full cursor-pointer flex-wrap items-start gap-3 rounded-xl bg-surface-panel p-4 text-left shadow-surface`,`transition-[transform,background-color,box-shadow] duration-150 ease-out`,`hover:bg-surface-hover/40`,`active:scale-[0.992] active:bg-surface-hover/55`,`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:bg-surface-hover/25 dark:active:bg-surface-hover/35`),children:[(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(`h3`,{className:`font-semibold text-fg`,children:e.name}),e.verified?(0,J.jsx)(F,{className:`size-4 shrink-0 text-emerald-600 dark:text-emerald-400`,strokeWidth:1.75,"aria-label":`Verified`}):null,e.version?(0,J.jsx)(`span`,{className:`text-xs text-fg-muted`,children:e.version}):null]}),e.description?(0,J.jsx)(`p`,{className:`mt-1 line-clamp-2 text-sm text-fg-muted`,children:e.description}):null,(0,J.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:(e.categories??[]).map(e=>(0,J.jsx)(`span`,{className:`rounded-md border border-edge bg-surface-panel px-2 py-0.5 text-[11px] text-fg-muted`,children:e},e))}),(0,J.jsxs)(`p`,{className:`mt-2 flex items-center gap-1.5 text-xs text-fg-muted`,children:[(0,J.jsx)(O,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),(0,J.jsx)(`code`,{className:`rounded bg-surface-panel px-1 py-0.5`,children:e.npmPackage})]})]}),(0,J.jsx)(`div`,{role:`group`,className:`flex shrink-0 flex-col items-end gap-2 sm:min-w-[9rem]`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:n===`bundled`?(0,J.jsx)(`span`,{className:`rounded-md bg-surface-hover px-2 py-1 text-[11px] font-medium text-fg-muted`,children:t.marketplaceBuiltin}):n===`user`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`text-[11px] font-medium text-fg-muted`,children:t.marketplaceInstalled}),(0,J.jsxs)(`button`,{type:`button`,disabled:i,onClick:()=>{window.confirm(t.marketplaceUninstallConfirm)&&ee(e.id).catch(()=>{})},className:s(`inline-flex items-center justify-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg`,`transition-colors active:scale-[0.98] active:bg-surface-hover/80`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,`disabled:pointer-events-none disabled:opacity-50`),children:[i?(0,J.jsx)(C,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,J.jsx)(ne,{className:`size-3.5`,strokeWidth:2,"aria-hidden":!0}),t.marketplaceUninstall]})]}):(0,J.jsx)(`button`,{type:`button`,onClick:()=>o({type:`patch`,patch:{detailPkg:e.id}}),className:s(`inline-flex w-full items-center justify-center rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg`,`transition-[transform,background-color] active:scale-[0.98]`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:t.marketplaceReview})})]})},e.id)})}),v?(0,J.jsx)(Z,{packageName:v,copy:t,extensions:r,onClose:()=>o({type:`patch`,patch:{detailPkg:null}}),onInstall:M,onUninstall:ee}):null]})}function Z(e){let t=(0,H.c)(102),{packageName:n,copy:r,extensions:i,onClose:o,onInstall:c,onUninstall:u}=e,[d,f]=(0,V.useState)(!1),[p,m]=(0,V.useState)(!1),g=l(fe)?`ext-mp-detail-${n}`:null,_;t[0]===n?_=t[1]:(_=async()=>oe(n),t[0]=n,t[1]=_);let x;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(x={revalidateOnFocus:!1},t[2]=x):x=t[2];let{data:w,error:T,isLoading:O}=h(g,_,x),k;t[3]!==i||t[4]!==n?(k=se(i,n),t[3]=i,t[4]=n,t[5]=k):k=t[5];let A=k,j=A===`user`,M=w?.manifest?.permissions,N,P,F,I,L,R,z,B,U,W,G;if(t[6]!==r.detailBack||t[7]!==r.detailClose||t[8]!==r.marketplaceAuthor||t[9]!==r.marketplaceCodeRisk||t[10]!==r.marketplaceDependencies||t[11]!==r.marketplaceDetailLoadFailed||t[12]!==r.marketplaceDetailReadmeHeading||t[13]!==r.marketplaceDetailTitle||t[14]!==r.marketplaceDownloads||t[15]!==r.marketplaceIntegrity||t[16]!==r.marketplaceIntegrityVerified||t[17]!==r.marketplaceLifecycleScripts||t[18]!==r.marketplaceLoadFailed||t[19]!==r.marketplaceLoading||t[20]!==r.marketplaceNoReadme||t[21]!==r.marketplacePermissions||t[22]!==r.marketplacePermissionsNone||t[23]!==r.marketplaceRiskConfirm||t[24]!==r.marketplaceRiskTitle||t[25]!==r.marketplaceUnavailableBody||t[26]!==r.marketplaceUnavailableTitle||t[27]!==r.marketplaceVersion||t[28]!==w||t[29]!==T||t[30]!==A||t[31]!==O||t[32]!==o||t[33]!==M||t[34]!==p){let e=M&&typeof M==`object`&&!Array.isArray(M)?Object.entries(M):[],n;t[46]!==r.marketplaceNoReadme||t[47]!==w?(n=w?.readme?.trim()||(w?.description?.trim()?`### ${w.name}\n\n${w.description}`:`*${r.marketplaceNoReadme}*`),t[46]=r.marketplaceNoReadme,t[47]=w,t[48]=n):n=t[48];let i=n;F=S,I=!0,t[49]===o?L=t[50]:(L=e=>!e&&o(),t[49]=o,t[50]=L),P=v,t[51]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,J.jsx)(ae,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),t[51]=G):G=t[51],N=E,B=`fixed left-1/2 top-1/2 z-[131] flex h-[min(44rem,calc(100vh-1.5rem))] w-[min(42rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-panel shadow-elevated`,U=de;let a;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,J.jsx)(ie,{className:`size-5`}),t[52]=a):a=t[52];let s;t[53]!==r.detailBack||t[54]!==o?(s=(0,J.jsx)(`button`,{type:`button`,onClick:o,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":r.detailBack,children:a}),t[53]=r.detailBack,t[54]=o,t[55]=s):s=t[55];let c;t[56]===r.marketplaceDetailTitle?c=t[57]:(c=(0,J.jsx)(te,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:r.marketplaceDetailTitle}),t[56]=r.marketplaceDetailTitle,t[57]=c);let l;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,J.jsx)(b,{className:`size-5`}),t[58]=l):l=t[58];let u;t[59]!==r.detailClose||t[60]!==o?(u=(0,J.jsx)(`button`,{type:`button`,onClick:o,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":r.detailClose,children:l}),t[59]=r.detailClose,t[60]=o,t[61]=u):u=t[61],t[62]!==s||t[63]!==c||t[64]!==u?(W=(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[s,c,u]}),t[62]=s,t[63]=c,t[64]=u,t[65]=W):W=t[65],R=`min-h-0 flex-1 overflow-y-auto p-5`,z=O&&!w?(0,J.jsxs)(`div`,{className:`space-y-4`,"aria-label":r.marketplaceLoading,children:[(0,J.jsx)(D,{className:`h-6 w-48`}),(0,J.jsx)(D,{className:`h-4 w-28`}),(0,J.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,J.jsx)(D,{className:`h-12`}),(0,J.jsx)(D,{className:`h-12`})]}),(0,J.jsx)(D,{className:`h-28 w-full`}),(0,J.jsx)(D,{className:`h-36 w-full`})]}):T?(0,J.jsxs)(`div`,{className:`rounded-lg border border-red-300/70 bg-red-50 p-4 text-sm dark:border-red-900 dark:bg-red-950/30`,children:[(0,J.jsx)(`p`,{className:`font-medium text-red-700 dark:text-red-300`,children:r.marketplaceDetailLoadFailed}),(0,J.jsx)(`p`,{className:`mt-1 break-words text-red-600 dark:text-red-400`,children:T instanceof Error?T.message:r.marketplaceLoadFailed})]}):w?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`h3`,{className:`text-lg font-semibold text-fg`,children:w.name}),(0,J.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:(0,J.jsx)(`code`,{className:`rounded bg-surface-panel px-1 py-0.5`,children:w.id})}),(0,J.jsxs)(`dl`,{className:`mt-3 grid gap-2 text-xs text-fg-muted sm:grid-cols-2`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`dt`,{className:`font-medium text-fg`,children:r.marketplaceAuthor}),(0,J.jsx)(`dd`,{children:w.author.username})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`dt`,{className:`font-medium text-fg`,children:r.marketplaceVersion}),(0,J.jsx)(`dd`,{children:w.latestVersion.version})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`dt`,{className:`font-medium text-fg`,children:r.marketplaceDownloads}),(0,J.jsx)(`dd`,{children:w.downloads})]})]}),A===`bundled`?null:(0,J.jsxs)(`section`,{className:`mt-5 space-y-3 rounded-lg border border-edge bg-surface-base p-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[w.installability.available?(0,J.jsx)(re,{className:`mt-0.5 size-5 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}):(0,J.jsx)(y,{className:`mt-0.5 size-5 shrink-0 text-amber-600 dark:text-amber-400`,"aria-hidden":!0}),(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:w.installability.available?r.marketplaceRiskTitle:r.marketplaceUnavailableTitle}),(0,J.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:w.installability.available?r.marketplaceCodeRisk:w.installability.reason??r.marketplaceUnavailableBody})]})]}),w.installability.available?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`dl`,{className:`grid gap-2 text-xs text-fg-muted sm:grid-cols-2`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`dt`,{className:`font-medium text-fg`,children:r.marketplaceIntegrity}),(0,J.jsx)(`dd`,{children:r.marketplaceIntegrityVerified})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`dt`,{className:`font-medium text-fg`,children:r.marketplaceDependencies}),(0,J.jsx)(`dd`,{children:w.packageSummary?.dependencyCount??0})]})]}),(0,J.jsxs)(`div`,{className:`text-xs text-fg-muted`,children:[(0,J.jsx)(`p`,{className:`font-medium text-fg`,children:r.marketplacePermissions}),e.length>0?(0,J.jsx)(`ul`,{className:`mt-1 space-y-1`,children:e.map(ue)}):(0,J.jsx)(`p`,{className:`mt-1`,children:r.marketplacePermissionsNone})]}),(w.packageSummary?.lifecycleScripts.length??0)>0?(0,J.jsxs)(`p`,{className:`text-xs leading-relaxed text-amber-700 dark:text-amber-300`,children:[r.marketplaceLifecycleScripts,`: `,w.packageSummary?.lifecycleScripts.join(`, `)]}):null,(0,J.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,J.jsx)(`input`,{type:`checkbox`,checked:p,onChange:e=>m(e.target.checked),className:`mt-0.5 size-4 rounded border-edge accent-[var(--color-accent)]`}),(0,J.jsx)(`span`,{children:r.marketplaceRiskConfirm})]})]}):null]}),w.readme?.trim()?(0,J.jsx)(`h4`,{className:`mb-2 mt-6 text-sm font-semibold text-fg`,children:r.marketplaceDetailReadmeHeading}):null,(0,J.jsx)(`div`,{className:`markdown-content min-w-0 break-words text-sm`,children:(0,J.jsx)(ee,{content:i})})]}):null,t[6]=r.detailBack,t[7]=r.detailClose,t[8]=r.marketplaceAuthor,t[9]=r.marketplaceCodeRisk,t[10]=r.marketplaceDependencies,t[11]=r.marketplaceDetailLoadFailed,t[12]=r.marketplaceDetailReadmeHeading,t[13]=r.marketplaceDetailTitle,t[14]=r.marketplaceDownloads,t[15]=r.marketplaceIntegrity,t[16]=r.marketplaceIntegrityVerified,t[17]=r.marketplaceLifecycleScripts,t[18]=r.marketplaceLoadFailed,t[19]=r.marketplaceLoading,t[20]=r.marketplaceNoReadme,t[21]=r.marketplacePermissions,t[22]=r.marketplacePermissionsNone,t[23]=r.marketplaceRiskConfirm,t[24]=r.marketplaceRiskTitle,t[25]=r.marketplaceUnavailableBody,t[26]=r.marketplaceUnavailableTitle,t[27]=r.marketplaceVersion,t[28]=w,t[29]=T,t[30]=A,t[31]=O,t[32]=o,t[33]=M,t[34]=p,t[35]=N,t[36]=P,t[37]=F,t[38]=I,t[39]=L,t[40]=R,t[41]=z,t[42]=B,t[43]=U,t[44]=W,t[45]=G}else N=t[35],P=t[36],F=t[37],I=t[38],L=t[39],R=t[40],z=t[41],B=t[42],U=t[43],W=t[44],G=t[45];let K;t[66]!==R||t[67]!==z?(K=(0,J.jsx)(`div`,{className:R,children:z}),t[66]=R,t[67]=z,t[68]=K):K=t[68];let q;t[69]!==d||t[70]!==r.marketplaceBuiltinGoBuiltin||t[71]!==r.marketplaceBuiltinManageHint||t[72]!==r.marketplaceInstall||t[73]!==r.marketplaceReinstall||t[74]!==r.marketplaceReinstallConfirm||t[75]!==r.marketplaceUninstall||t[76]!==r.marketplaceUninstallConfirm||t[77]!==w||t[78]!==A||t[79]!==o||t[80]!==c||t[81]!==u||t[82]!==n||t[83]!==p||t[84]!==j?(q=w?(0,J.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-edge-subtle px-5 py-4`,children:A===`bundled`?(0,J.jsxs)(`div`,{className:`flex w-full flex-col items-stretch gap-2`,children:[(0,J.jsx)(`p`,{className:`text-sm leading-relaxed text-fg-muted`,children:r.marketplaceBuiltinManageHint}),(0,J.jsx)(a,{to:`/extensions?tab=builtin`,onClick:o,className:`inline-flex w-fit items-center justify-center rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:r.marketplaceBuiltinGoBuiltin})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`button`,{type:`button`,disabled:d||!w.installability.available||!p,onClick:()=>{j&&!window.confirm(r.marketplaceReinstallConfirm)||(f(!0),c(n,j).catch(le).finally(()=>f(!1)))},className:s(`inline-flex items-center justify-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium`,`bg-accent text-white shadow-surface hover:bg-accent-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`disabled:pointer-events-none disabled:opacity-50`),children:[d?(0,J.jsx)(C,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,j?r.marketplaceReinstall:r.marketplaceInstall]}),j?(0,J.jsxs)(`button`,{type:`button`,disabled:d,onClick:()=>{window.confirm(r.marketplaceUninstallConfirm)&&(f(!0),u(n).then(()=>o()).catch(ce).finally(()=>f(!1)))},className:s(`inline-flex items-center justify-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,`disabled:pointer-events-none disabled:opacity-50`),children:[(0,J.jsx)(ne,{className:`size-4 shrink-0`,"aria-hidden":!0}),r.marketplaceUninstall]}):null]})}):null,t[69]=d,t[70]=r.marketplaceBuiltinGoBuiltin,t[71]=r.marketplaceBuiltinManageHint,t[72]=r.marketplaceInstall,t[73]=r.marketplaceReinstall,t[74]=r.marketplaceReinstallConfirm,t[75]=r.marketplaceUninstall,t[76]=r.marketplaceUninstallConfirm,t[77]=w,t[78]=A,t[79]=o,t[80]=c,t[81]=u,t[82]=n,t[83]=p,t[84]=j,t[85]=q):q=t[85];let Y;t[86]!==N||t[87]!==K||t[88]!==q||t[89]!==B||t[90]!==U||t[91]!==W?(Y=(0,J.jsxs)(N,{className:B,onOpenAutoFocus:U,children:[W,K,q]}),t[86]=N,t[87]=K,t[88]=q,t[89]=B,t[90]=U,t[91]=W,t[92]=Y):Y=t[92];let X;t[93]!==P||t[94]!==Y||t[95]!==G?(X=(0,J.jsxs)(P,{children:[G,Y]}),t[93]=P,t[94]=Y,t[95]=G,t[96]=X):X=t[96];let Z;return t[97]!==F||t[98]!==I||t[99]!==L||t[100]!==X?(Z=(0,J.jsx)(F,{defaultOpen:I,onOpenChange:L,children:X}),t[97]=F,t[98]=I,t[99]=L,t[100]=X,t[101]=Z):Z=t[101],Z}function ce(){}function le(){}function ue(e){let[t,n]=e;return(0,J.jsxs)(`li`,{className:`break-words`,children:[(0,J.jsx)(`code`,{children:t}),`: `,Array.isArray(n)?n.join(`, `):String(n)]},t)}function de(e){return e.preventDefault()}function fe(e){return!!e.token}function pe(){let e=u(e=>e.language),t=c(e),n=N(e=>e.setPageHeader),r=N(e=>e.clearPageHeader),o=w(),s=A(),[l,d]=i(),f=U(l.get(`tab`)),p=l.get(`q`)??``,[m,h]=(0,V.useState)(f),[g,_]=(0,V.useState)(p),[v,y]=(0,V.useState)(null),b=l.toString(),x=(0,V.useRef)(b);if(x.current!==b){x.current=b;let e=U(l.get(`tab`)),t=l.get(`q`)??``;h(t=>t===e?t:e),_(e=>e===t?e:t)}(0,V.useEffect)(()=>{d(e=>{let t=new URLSearchParams(e),n=g.trim();return n?t.set(`q`,n):t.delete(`q`),m===`marketplace`?t.delete(`tab`):t.set(`tab`,m),t.toString()===e.toString()?e:t},{replace:!0})},[m,g,d]);let S=(0,V.useMemo)(()=>o.filter(e=>e.source===`bundled`),[o]),C=(0,V.useMemo)(()=>o.filter(e=>e.source!==`bundled`),[o]),T=m===`builtin`?S:C,E=(0,V.useMemo)(()=>{let t=g.trim().toLowerCase(),n=T;return t&&(n=n.filter(e=>(e.name??``).toLowerCase().includes(t)||e.id.toLowerCase().includes(t)||(e.description??``).toLowerCase().includes(t))),n.toSorted((t,n)=>t.hasUi===n.hasUi?(t.name||t.id).localeCompare(n.name||n.id,e):t.hasUi?-1:1)},[T,g,e]);if((0,V.useEffect)(()=>{y(e=>{if(!e)return e;let t=o.find(t=>t.id===e.id);return t?Q(e)===Q(t)&&e.active===t.active?e:t:null})},[o]),(0,V.useLayoutEffect)(()=>(n({startExtra:null,main:(0,J.jsx)(`div`,{className:`min-w-0`,children:(0,J.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:t.extensionsPage.title})}),end:(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(R,{asChild:!0,variant:`secondary`,className:`h-9`,children:(0,J.jsxs)(a,{to:`/local-apps`,"aria-label":t.extensionsPage.openLocalApps,title:t.extensionsPage.openLocalApps,children:[(0,J.jsx)(L,{className:`size-4`}),(0,J.jsx)(`span`,{className:`hidden sm:inline`,children:t.extensionsPage.openLocalApps})]})}),(0,J.jsx)(R,{asChild:!0,variant:`primary`,className:`h-9`,children:(0,J.jsxs)(a,{to:`/local-apps/new`,children:[(0,J.jsx)(M,{className:`size-4`}),t.extensionsPage.createLocalApp]})})]})}),()=>r()),[r,t.extensionsPage.createLocalApp,t.extensionsPage.openLocalApps,t.extensionsPage.title,n]),s&&m!==`marketplace`)return(0,J.jsx)(ye,{});let D=m!==`marketplace`&&T.length>0;return(0,J.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col bg-surface-panel`,children:[(0,J.jsxs)(`div`,{className:`w-full px-3 py-8 sm:px-5 xl:px-6`,children:[(0,J.jsxs)(`div`,{className:`mb-5 flex flex-col gap-3 rounded-xl border border-edge-subtle bg-surface-base p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,J.jsx)(B,{items:[{id:`marketplace`,label:t.extensionsPage.tabMarketplace},{id:`builtin`,label:t.extensionsPage.tabBuiltin,count:S.length},{id:`user`,label:t.extensionsPage.tabUser,count:C.length}],activeTab:m,onChange:h,ariaLabel:t.extensionsPage.extensionsNavAria,tabIdPrefix:`extensions-tab`,panelIdPrefix:`extensions-panel`,className:`flex-wrap`}),D?(0,J.jsxs)(`div`,{className:`relative w-full min-w-0 sm:max-w-xs`,children:[(0,J.jsx)(P,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-muted`,"aria-hidden":!0}),(0,J.jsx)(`input`,{type:`search`,value:g,onChange:e=>_(e.target.value),placeholder:t.extensionsPage.searchPlaceholder,className:`w-full rounded-lg border border-edge bg-surface-base py-2 pl-9 pr-3 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,autoComplete:`off`})]}):null]}),m===`marketplace`?(0,J.jsx)(X,{}):m===`builtin`&&S.length===0?(0,J.jsx)(xe,{message:t.extensionsPage.emptyBuiltin}):m===`user`&&C.length===0?(0,J.jsx)(xe,{message:t.extensionsPage.emptyUser}):E.length===0?(0,J.jsx)(`p`,{className:`rounded-xl border border-edge-subtle bg-surface-base px-3 py-8 text-center text-sm text-fg-muted shadow-surface sm:px-5 xl:px-6`,children:t.extensionsPage.noSearchResults}):(0,J.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:E.map(e=>(0,J.jsx)(_e,{extension:e,copy:t.extensionsPage,showSourceBadge:m===`user`,onOpen:()=>y(e)},e.id))})]}),v?(0,J.jsx)(ve,{extension:v,copy:t.extensionsPage,onClose:()=>y(null)},v.id):null]})}function Q(e){return e.activationEligible??e.active}function me(e,t){return e.source===`bundled`?t.providerBundled:e.source===`global`?t.providerGlobal:e.source===`workspace`?t.providerWorkspace:t.providerOther}function he(e,t){return e.source===`global`?t.badgeSourceGlobal:e.source===`workspace`?t.badgeSourceWorkspace:t.badgeSourceOther}function ge(e,t){let n=Q(e);return n&&e.active?t.runStateLive:n&&!e.active?t.runStatePendingOn:!n&&e.active?t.runStatePendingOff:t.runStateOff}function _e(e){let t=(0,H.c)(45),{extension:n,copy:r,showSourceBadge:i,onOpen:a}=e,c;t[0]===n?c=t[1]:(c=Q(n),t[0]=n,t[1]=c);let l=c,u=n.hasUi?r.cardTooltipHasUi:r.cardTooltipNoUi,d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=s(`group flex w-full flex-col rounded-xl border border-edge-subtle bg-surface-base p-4 text-left shadow-surface transition-colors`,`hover:bg-surface-hover/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,`dark:hover:bg-surface-hover/25`),t[2]=d):d=t[2];let f=n.name||n.id,p;t[3]===f?p=t[4]:(p=f.charAt(0).toUpperCase(),t[3]=f,t[4]=p);let m;t[5]===p?m=t[6]:(m=(0,J.jsx)(`div`,{className:`flex size-12 shrink-0 items-center justify-center rounded-xl bg-accent-soft text-base font-semibold text-accent-fg`,"aria-hidden":!0,children:p}),t[5]=p,t[6]=m);let h;t[7]===n.name?h=t[8]:(h=(0,J.jsx)(`h2`,{className:`truncate text-sm font-semibold text-fg`,children:n.name}),t[7]=n.name,t[8]=h);let g;t[9]===n.version?g=t[10]:(g=n.version?(0,J.jsxs)(`span`,{className:`text-[11px] text-fg-muted`,children:[`v`,n.version]}):null,t[9]=n.version,t[10]=g);let _;t[11]!==h||t[12]!==g?(_=(0,J.jsxs)(`div`,{className:`min-w-0`,children:[h,g]}),t[11]=h,t[12]=g,t[13]=_):_=t[13];let v;t[14]!==r.statusEnabled||t[15]!==l?(v=l?(0,J.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-full bg-surface-hover px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:[(0,J.jsx)(o,{className:`size-3`,strokeWidth:2.5,"aria-hidden":!0}),r.statusEnabled]}):(0,J.jsx)(`span`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full border-2 border-accent text-accent`,"aria-hidden":!0,children:(0,J.jsx)(M,{className:`size-4`,strokeWidth:2.5})}),t[14]=r.statusEnabled,t[15]=l,t[16]=v):v=t[16];let y;t[17]!==_||t[18]!==v?(y=(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[_,v]}),t[17]=_,t[18]=v,t[19]=y):y=t[19];let b;t[20]!==r.cardNoDescription||t[21]!==n.description?(b=n.description?.trim()||r.cardNoDescription,t[20]=r.cardNoDescription,t[21]=n.description,t[22]=b):b=t[22];let x;t[23]===b?x=t[24]:(x=(0,J.jsx)(`p`,{className:`mt-2 line-clamp-2 text-xs leading-relaxed text-fg-muted`,children:b}),t[23]=b,t[24]=x);let S=n.hasUi?r.badgeKindUi:r.badgeKindBackend,C;t[25]!==S||t[26]!==u?(C=(0,J.jsx)(`span`,{title:u,className:`rounded-md bg-surface-hover px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-fg-muted`,children:S}),t[25]=S,t[26]=u,t[27]=C):C=t[27];let w;t[28]!==r||t[29]!==n||t[30]!==i?(w=n.source===`bundled`?(0,J.jsx)(`span`,{className:`rounded-md bg-surface-hover px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-fg-muted`,children:r.badgeBundled}):i?(0,J.jsx)(`span`,{title:me(n,r),className:`rounded-md bg-surface-hover px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-fg-muted`,children:he(n,r)}):null,t[28]=r,t[29]=n,t[30]=i,t[31]=w):w=t[31];let T;t[32]!==C||t[33]!==w?(T=(0,J.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:[C,w]}),t[32]=C,t[33]=w,t[34]=T):T=t[34];let E;t[35]!==y||t[36]!==x||t[37]!==T?(E=(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[y,x,T]}),t[35]=y,t[36]=x,t[37]=T,t[38]=E):E=t[38];let D;t[39]!==E||t[40]!==m?(D=(0,J.jsxs)(`div`,{className:`flex gap-3`,children:[m,E]}),t[39]=E,t[40]=m,t[41]=D):D=t[41];let O;return t[42]!==a||t[43]!==D?(O=(0,J.jsx)(`button`,{type:`button`,onClick:a,className:d,children:D}),t[42]=a,t[43]=D,t[44]=O):O=t[44],O}function ve({extension:e,copy:t,onClose:n}){let{mutate:r}=m(),[i,o]=(0,V.useState)(!1),[c,l]=(0,V.useState)(null),[u,d]=(0,V.useState)(!1),f=e.activationEligible===!0,p=(0,V.useCallback)(async()=>{if(e.source===`bundled`){l(null),d(!1),o(!0);try{let{requiresGatewayRestart:t}=await K({extensionId:e.id,enabled:!f});await r(`gateway-extensions-list`),k(),d(t)}catch(e){l(e instanceof Error?e.message:t.builtinToggleFailed)}finally{o(!1)}}},[f,t.builtinToggleFailed,e.id,e.source,r]),h=e.ui?.contributions?.pages??[],g=e.ui?.contributions?.settingsPanels??[],y=e.ui?.contributions?.chatWidgets??[],w=e.ui?.contributions?.sidebarPanels??[],D=h.find(e=>e.showInNav)??h[0],O=g[0],A=D?x(e.id,D):null,M=O?`/settings/ext/${e.id}/${O.id}`:e.hasConfigSchema||z(e)?`/settings/ext/${e.id}`:null;return(0,J.jsx)(S,{defaultOpen:!0,onOpenChange:e=>!e&&n(),children:(0,J.jsxs)(v,{children:[(0,J.jsx)(ae,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),(0,J.jsxs)(E,{className:`fixed left-1/2 top-1/2 z-[131] flex max-h-[min(90vh,44rem)] w-[min(42rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-panel shadow-elevated`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:n,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":t.detailBack,children:(0,J.jsx)(ie,{className:`size-5`})}),(0,J.jsx)(te,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:t.detailTitle}),(0,J.jsxs)(j,{className:`sr-only`,children:[e.name,` (`,e.id,`)`]}),(0,J.jsx)(`button`,{type:`button`,onClick:n,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":t.detailClose,children:(0,J.jsx)(b,{className:`size-5`})})]}),(0,J.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-start gap-4`,children:[(0,J.jsx)(`div`,{className:`flex size-16 shrink-0 items-center justify-center rounded-2xl bg-accent-soft text-xl font-semibold text-accent-fg`,"aria-hidden":!0,children:(e.name||e.id).charAt(0).toUpperCase()}),(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsx)(`h3`,{className:`text-lg font-semibold text-fg`,children:e.name}),(0,J.jsxs)(`p`,{className:`mt-0.5 text-sm text-fg-muted`,children:[t.detailProviderPrefix,` `,me(e,t)]}),e.version?(0,J.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[`v`,e.version]}):null]})]}),(0,J.jsx)(`p`,{className:`mt-5 text-sm leading-relaxed text-fg`,children:e.description?.trim()||t.detailNoDescription}),e.hasUi?null:(0,J.jsx)(`p`,{className:`mt-3 text-xs text-fg-muted`,children:t.backendOnlyHint}),(0,J.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:ge(e,t)}),e.source===`bundled`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{className:`mt-4 rounded-lg bg-surface-hover/40 px-3 py-2 text-xs text-fg-muted shadow-surface dark:bg-surface-hover/20`,children:t.builtinConfigHint}),(0,J.jsxs)(`div`,{className:`mt-3 rounded-lg bg-surface-hover/40 p-3 shadow-surface dark:bg-surface-hover/20`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,J.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:t.builtinRuntimeToggle}),(0,J.jsx)(R,{type:`button`,variant:`secondary`,disabled:i,onClick:()=>void p(),className:`shrink-0 py-1.5 text-xs`,children:i?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(C,{className:`mr-1.5 size-3.5 shrink-0 animate-spin`,"aria-hidden":!0}),t.builtinToggleBusy]}):f?t.builtinToggleDisable:t.builtinToggleEnable})]}),c?(0,J.jsx)(`p`,{className:`mt-2 text-xs text-rose-600 dark:text-rose-400`,children:c}):null,u?(0,J.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t.builtinToggleRestartHint}):null]})]}):(0,J.jsx)(`p`,{className:`mt-4 rounded-lg bg-surface-hover/40 px-3 py-2 text-xs text-fg-muted shadow-surface dark:bg-surface-hover/20`,children:t.cliManageHint}),e.hasUi&&(h.length>0||g.length>0||y.length>0)?(0,J.jsxs)(`section`,{className:`mt-8`,children:[(0,J.jsx)(`h4`,{className:`mb-3 text-sm font-semibold text-fg`,children:t.detailSectionFeatures}),(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,J.jsx)($,{template:t.badgePages,count:h.length,hidden:h.length===0}),(0,J.jsx)($,{template:t.badgeSettings,count:g.length,hidden:g.length===0}),(0,J.jsx)($,{template:t.badgeWidgets,count:y.length,hidden:y.length===0}),(0,J.jsx)($,{template:t.badgeSidebar,count:w.length,hidden:w.length===0})]})]}):null,_(e)&&(A||M)?(0,J.jsxs)(`div`,{className:`mt-6 flex flex-wrap gap-2 border-t border-edge-subtle pt-4`,children:[A?(0,J.jsxs)(a,{to:A,onClick:n,className:s(`inline-flex items-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:[(0,J.jsx)(T,{className:`size-4 shrink-0 opacity-80`,"aria-hidden":!0}),t.open]}):null,M?(0,J.jsxs)(a,{to:M,onClick:n,className:s(`inline-flex items-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:[(0,J.jsx)(I,{className:`size-4 shrink-0 opacity-80`,"aria-hidden":!0}),t.openSettings]}):null]}):null,(0,J.jsx)(`p`,{className:`mt-6 text-[11px] leading-relaxed text-fg-muted`,children:t.restartNote})]})]})]})})}function $(e){let t=(0,H.c)(6),{template:n,count:r,hidden:i}=e;if(i||r===0)return null;let a;if(t[0]!==r||t[1]!==n){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=/\{\{count\}\}/g,t[3]=e):e=t[3],a=n.replace(e,String(r)),t[0]=r,t[1]=n,t[2]=a}else a=t[2];let o;return t[4]===a?o=t[5]:(o=(0,J.jsx)(`span`,{className:`inline-flex items-center rounded-md bg-surface-hover px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:a}),t[4]=a,t[5]=o),o}function ye(){let e=(0,H.c)(5),t,n,r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,J.jsx)(`div`,{className:`mb-6 h-8 w-40 max-w-full animate-pulse rounded-md bg-surface-hover`}),n=(0,J.jsx)(`div`,{className:`mb-2 h-4 w-full max-w-md animate-pulse rounded bg-surface-hover`}),r=(0,J.jsx)(`div`,{className:`mb-5 h-9 w-full max-w-lg animate-pulse rounded-full bg-surface-hover`}),e[0]=t,e[1]=n,e[2]=r):(t=e[0],n=e[1],r=e[2]);let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=[`ap0`,`ap1`,`ap2`,`ap3`,`ap4`,`ap5`],e[3]=i):i=e[3];let a;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,J.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col bg-surface-panel`,children:(0,J.jsxs)(`div`,{className:`w-full px-3 py-8 sm:px-5 xl:px-6`,children:[t,n,r,(0,J.jsx)(`div`,{className:`mt-6 grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:i.map(be)})]})}),e[4]=a):a=e[4],a}function be(e){return(0,J.jsx)(`div`,{className:`h-36 animate-pulse rounded-xl border border-edge-subtle bg-surface-base shadow-surface`},e)}function xe(e){let t=(0,H.c)(2),{message:n}=e,r;return t[0]===n?r=t[1]:(r=(0,J.jsx)(`div`,{className:`flex min-h-[min(40vh,16rem)] flex-col items-center justify-center rounded-xl border border-edge-subtle bg-surface-base px-4 py-12 text-center shadow-surface`,children:(0,J.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n})}),t[0]=n,t[1]=r),r}export{pe as ExtensionsPage};
|