@xopcai/xopc 0.0.480 → 0.0.481
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/feishu/src/outbound/media-load.js +1 -1
- package/dist/extensions/feishu/src/transport/client/install-sdk.js +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/api/api.js +2 -2
- package/dist/extensions/weixin/src/auth/accounts.js +1 -1
- package/dist/extensions/weixin/src/cdn/upload.js +1 -1
- package/dist/extensions/weixin/src/media/data-url.js +1 -1
- package/dist/extensions/weixin/src/messaging/debug-mode.js +1 -1
- package/dist/extensions/weixin/src/messaging/inbound.js +1 -1
- package/dist/extensions/weixin/src/messaging/process-message.js +1 -1
- package/dist/gateway/server/chunks.bin +583 -583
- package/dist/gateway/server/chunks.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-9wMoZ4Ok.js → activity-store-zMwJQbPV.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-TrALdAg_.js → agent-avatar-dicebear-VUJHrVXo.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-BiHRFRo2.js → agent-avatar-display-umdw-BQZ.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-DLopBKfN.js → agent-defaults-settings-panel-2JEkjXQB.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-wisFd2cR.js → agent-plugin-dialog-Cz08StU4.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-CzgZX_E9.js → agents-BXVjWw0p.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-Crvl6IB4.js → agents-admin-api-C1Ab97Mn.js} +1 -1
- package/dist/gateway/static/root/assets/{api-CJvZsRen.js → api-5GGJYrzC.js} +1 -1
- package/dist/gateway/static/root/assets/{api-DQVcF1zq.js → api-B2QJSgN6.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-CYwY9a8P.js → app-management-settings-panel-IaAONzFg.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-8clf9SDY.js → appearance-settings-BFo0Yk57.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-B2qv9gWd.js → apps-page-aVZLDS59.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-Bu1nF6Lg.js → archive-plugin-BgX_1X6q.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-HQmKv0Sm.js → automation-api-DtFbVh6a.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-CMjfyY6p.js → automation-result-state-CBfGJb7v.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-run-list-wlGMBYYv.js → automation-run-list-C-nOpY2_.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-task-card-2EsZ1jBs.js → automation-task-card-BgS9JQeL.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BUtoiUiH.js → automations-page-C6dw7Nqb.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-CW_8-0Cb.js → automations-workspace-CKCsL5wQ.js} +2 -2
- package/dist/gateway/static/root/assets/{binary-plugins-Dz62GXI_.js → binary-plugins-DX9lDAWC.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CA66tdm3.js → block-editor-DRNtaARK.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-hAttQ9qS.js → browser-settings-page-Btf2a-_0.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-BNmDs-Ca.js → capabilities-C5MLP2Rx.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-BcgSEYc5.js → capabilities-SIty9Vcz.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-CT6qMkqA.js → capabilities-page-BnTgeZB3.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-7MsgsVvQ.js +8 -0
- package/dist/gateway/static/root/assets/capability-presentation-DlJQUUlM.js +1 -0
- package/dist/gateway/static/root/assets/{channels-CFmGXibE.js → channels-CLpOmzO5.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-LVSL686y.js → chat-agents-api-JoSvbwve.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-Drmp5p0m.js → chat-chart-block-D1XpCNA5.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-page-qrdWReZ2.js → chat-page-sPNbEboB.js} +31 -31
- package/dist/gateway/static/root/assets/{chat-terminal-dock-twWNRsuW.js → chat-terminal-dock-BDHq9kj3.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-B27c_GTI.js → command-palette-api-C2IaBEe4.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-model-config-control-DdxZ-1U4.js → composer-model-config-control-C5hjuJQc.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-notifications-Dd64p5ZI.js → composer-notifications-BSboNnS6.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-Cbkv-F26.js → composer-payload-handoff-D5CvsQWj.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-B8UkO-mU.js → computer-settings-page-CwB7HgUb.js} +1 -1
- package/dist/gateway/static/root/assets/connected-providers-grid-DPJ_E0_Y.js +1 -0
- package/dist/gateway/static/root/assets/{connection-usage-guide-CNB9P9jg.js → connection-usage-guide-DWj6jcFA.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-DkifsBTl.js → connector-service-page-DEnQE7bH.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-DjIpuBCy.js → connectors-api-BRGeDfyP.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-oGveGlkI.js → connectors-page--3zYHSCM.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-_G6tIiGk.js → date-picker-jqmqOuOL.js} +1 -1
- package/dist/gateway/static/root/assets/{date-time-picker-B3lS-ZGW.js → date-time-picker-B3n_gScw.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-BAKyq-sn.js → desktop-pet-D8Tz4lEu.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-DGpu4hH_.js → desktop-pet-settings-24N6UYdz.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-DqYjZFu1.js → dev-view-store-DMaKk2H5.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-CIvmpDvo.js → device-pairing-wizard-CUMh0ui_.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BAsEQvG4.js → directory-picker-path-field-DqknuyWo.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-authoritative-grants-BmlRcbhA.js → extension-authoritative-grants-Choc5BaY.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page--EU_kb8E.js → extension-debug-page-8tHOJM-0.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-CcspWP4N.js → extension-iframe-host-crHrHgry.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-BQIfGFSy.js → extension-marketplace-api-3vDR-EC4.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-message-router-f7v82b69.js → extension-message-router-CBdW5Mi0.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CJxtbXQj.js → extension-page-ouZIIOwR.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-htRLPCBf.js → extension-provider-CJJRG7Gq.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CKui11ZQ.js → extension-settings-page-BO8VsTJF.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-Cwy9Cgaq.js → file-preview-surface-zEJDQWOT.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-abWJ0Q_y.js → gateway-config-swr-CNzw8MWj.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-PYDAppcy.js → gateway-realtime-BCghEC3U.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-CQygYU9S.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-BtAJNIO-.js → gateway-restart-DaKNDKV9.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-BvD8fcB2.js → gateway-settings-BxBJ1zGZ.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-Cza1BaL8.js → gateway-startup-retry-CSY11ude.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-BIa73mvy.js → global-defaults-api-C0qPO4zT.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-DzSLTEJf.js +8 -0
- package/dist/gateway/static/root/assets/{image-generation-api-BCU7Uxyy.js → image-generation-api-CD1tNChr.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-Clh0polM.js → imports-page-DHWKf1n3.js} +1 -1
- package/dist/gateway/static/root/assets/index-B9_yImuQ.css +1 -0
- package/dist/gateway/static/root/assets/index-BrXVoLVe.js +11 -0
- package/dist/gateway/static/root/assets/{install-connector-dialog-DSkXYsng.js → install-connector-dialog-B3A7BKlp.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-Crf76ecq.js → keyboard-shortcuts-settings-BZaTvMnH.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-WudNXl41.js → local-app-workbench-page-DH1zWMav.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-Br9ZO7Ad.js → local-apps-page-CSnxRVm2.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-BHrHLZJJ.js → local-session-drafts-CfgBHtlt.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-5DzxIIeq.js → locale-store-CeEXxDaP.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-BqUeqzPB.js → logs-page-fF3rKMVM.js} +1 -1
- package/dist/gateway/static/root/assets/{management-api-DHCpR1ma.js → management-api-iUbR1cSS.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-BccKy8tW.js → management-settings-BWJ-4D2j.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-BwbjZnQ6.js → markdown-view-BQw7H2MV.js} +1 -1
- package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-DxZ-KH6B.js → mcp-conversation-setup-page-CJdg6fgZ.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DissTT0S.js → media-plugins-B_0Q_dY0.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-CGGOcV9B.js → messages-L7tv_OPK.js} +2 -2
- package/dist/gateway/static/root/assets/{model-selector-DsCLjn_X.js → model-selector-CMsLur91.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-B0Y9Frop.js → models-hub-cache-DI9vvuFx.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-DEz8I-eN.js → note-detail-panel-BhJM-EYy.js} +3 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-y9OBo4Kv.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-CdC4jVPP.js → notes-api-Ck4Yvy_j.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-CC5-BWmA.js → notes-page-qellAl3o.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-CAPuqZdT.js → oauth-api-3nGo5FdC.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-7i3NoKo4.js → oauth-provider-connect-wtw_Oup3.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-BcSfcOme.js → page-context-capture-button-Bm8TI2e0.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-BJ2cY1Us.js → page-context-draft-D7Wh_S2e.js} +1 -1
- package/dist/gateway/static/root/assets/{page-header-store-xgXJVGDC.js → page-header-store-hCKJckdJ.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-avatar-CidTaDAv.js → personal-avatar-CW6MOp9q.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-BlxApjBh.js → personal-page-YTJfXUqr.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-profile-settings-D1TpPIVg.js → personal-profile-settings-Qn6MR0gu.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-BXKSkUoc.js → personal-settings-panel-DgGTnduT.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-_7leySaj.js → phone-dependencies-card-CiLziQ8R.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-connection-CVI6GGMF.js → phone-model-connection-DjQJIS33.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-qP1Sh-eA.js → phone-model-picker-BaHl_-yf.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-BAKOJllx.js → phone-settings-page-DEvyfoAt.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-CDtfKAUX.js → phone-workspace-store-9hDVXN9z.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-BpPMZLLz.js → plugin-details-dialog-BI--oe7J.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-BS-XMhb4.js → preference-select-fields-DAhA9Z56.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-runtime-D8kxmrLV.js → preview-runtime-DNxSgx2a.js} +3 -3
- package/dist/gateway/static/root/assets/{product-automation-feedback-CDjJlwol.js → product-automation-feedback-ChMWhk-X.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-BUqA67HG.js → product-open-page-KyiYh48g.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-CowHxHNk.js → product-preview-content-BSj9eoc8.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-BJDwL7x3.js → product-preview-modal-DhONFWvj.js} +2 -2
- package/dist/gateway/static/root/assets/{project-detail-page-CJQuslC9.js → project-detail-page-DA11E8Iz.js} +1 -1
- package/dist/gateway/static/root/assets/{project-understanding-eH4uN6k8.js → project-understanding-DjOdtNHh.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-DFo_ESE9.js → projects-page-3Y7Bj3vP.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-Df4w723e.js → providers-api-BKDzcCQr.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-DnRi2KQ5.js → recording-upload-Bg_HBFTj.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-Dw8Ou9VV.js → registry-api-C91pIb6J.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-B7jGK_WY.js → remote-access-hub-DZjxntjM.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-CZV8cItD.js → resource-unavailable-D8FrMGjx.js} +1 -1
- package/dist/gateway/static/root/assets/{right-workspace-store-DOyKalyG.js → right-workspace-store-D3nQJkDG.js} +1 -1
- package/dist/gateway/static/root/assets/route-preload-B_CMsS70.js +2 -0
- package/dist/gateway/static/root/assets/routine-panel-BTuii051.js +2 -0
- package/dist/gateway/static/root/assets/{runtime-tools-api-2sksjMtE.js → runtime-tools-api-CbVocuF5.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DPX5htrV.js → runtime-tools-settings-panel-BVcSYWWj.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-BnJcjQuF.js → service-recommendation-list-DEIaJSOU.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-CUkWJyfm.js → session-api-M4P3knYu.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-BRzFtnn4.js → session-manager-DQ0fiEo9.js} +2 -2
- package/dist/gateway/static/root/assets/{sessions-page-PjTnKj7l.js → sessions-page-UTEjz3V0.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Cnkvm_q6.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-Bponzv_k.js → settings-advanced-section-BRNFkPxE.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-BtgmaA-P.js → settings-mode-store-va_oX_Q8.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-C1USPFgf.js → settings-page-BVFv8SOp.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-B8nLRdnY.js → settings-page-header-Wx54i9EL.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-DhOLVJYv.js → settings-page-layout-DDTKMXIb.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-CyEO6jAM.js → setup-interaction-page-CaHdjPKk.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-CNpRqxnq.js → setup-status-panel-D1XJedVC.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-kZSUpbBN.js → share-link-dialog-C8bVavnr.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-9-aTa7_a.js → share-preview-page-3QEwX9TP.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-BxQqmxkq.js → shares-api-Dp6g-bfj.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-DoMMw8Ud.js → shares-settings-BbxnfBhc.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-V3Y6pTog.js → skill-api-BTiymSB8.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-BSHfM0qb.js → skill-list-api-BM8u0Bs_.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-Dq3F9pqP.js → skill-reload-api-BP2ecrz2.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-DGWy1Jns.js → skills-page-DTrONo3c.js} +1 -1
- package/dist/gateway/static/root/assets/{space-api-BkXqM2MT.js → space-api-Ix7mfZDi.js} +1 -1
- package/dist/gateway/static/root/assets/space-page-Dpy0BPbT.js +2 -0
- package/dist/gateway/static/root/assets/{space-workbook-7S_FfalA.js → space-workbook-CxV64kNP.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-DSmwwU8o.js → system-settings-panel-C2BWOeNW.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-DqgGOX0M.js +3 -0
- package/dist/gateway/static/root/assets/{task-header-title-DAwu5vni.js → task-header-title-Di5TvRaj.js} +1 -1
- package/dist/gateway/static/root/assets/task-run-issue-notice-FMMn1lE6.js +1 -0
- package/dist/gateway/static/root/assets/{terminal-panel-store-IpKmyQVN.js → terminal-panel-store-mDqqa0EW.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-B75oCec7.js → theme-store-kQ-dt8qP.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-CVj7aLAl.js → tracing-settings-page-BYAYhuS8.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-TWW8dGwO.js → tunnel-api-XScou7Y8.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-NgjWPD55.js → understanding-activity-store-NVT8M3Rv.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-CN-7T5G5.js → understanding-refresh-store-D5pgGLiW.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-D6mzQviK.js → usage-page-CWMg8m0Q.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-BYtW_pgF.js → use-autosave-Iy9pO3fa.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-Dn6X6xAP.js → use-composer-attachments-DfSh4D1i.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-BT0pss9g.js → use-file-preview-expanded-BFw8CA51.js} +1 -1
- package/dist/gateway/static/root/assets/{use-generated-media-CuhMqXFp.js → use-generated-media-MuDDqdB3.js} +1 -1
- package/dist/gateway/static/root/assets/{use-personal-profile-DxE21oPS.js → use-personal-profile-Csm85ZFS.js} +1 -1
- package/dist/gateway/static/root/assets/{use-personal-work-j8AH0g9w.js → use-personal-work-CVmHKsJn.js} +1 -1
- package/dist/gateway/static/root/assets/{use-realtime-voice-CNG2yeaO.js → use-realtime-voice-D1zQbDnk.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-BohZkOOW.js → use-workspace-tree-B_do34-j.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-Dlm-Mmo4.js → user-model-page-BlBvDtwt.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-D_o-xx9v.js → voice-api-key-field-DRlguUPt.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-BX2Q9Cgb.js → voice-config-api-B2AO_uL_.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-qbqLMfW_.js → voice-input-shortcut-events-jLnl_86X.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-player-store-z-upb7lD.js → voice-player-store-C8BTMBVX.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-settings-BEhihzNq.js → voice-settings-D8Snr-5R.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-ClPiLw1F.js → work-discovery-overlay-C0oaToAM.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-BohjMx1A.js → work-discovery-page-IEKvSp0W.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-CcD0smT0.js → working-directory-picker-modal-ppDpY-AP.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-Bpq_rBZM.js → workspace-api-C85sEgvX.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-CNPlB8xY.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-BjJEOajj.js → workspace-file-preview-dialog-DGsFnZh-.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-Bc8qK8WA.js → workspace-open-location-menu-CGe_tu1_.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-preview-store-QUX-jyAL.js → workspace-preview-store-D8eGmciG.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-BWdmU4iy.js → xopc-cloud-account-card-L-HD-Zf7.js} +1 -1
- package/dist/gateway/static/root/index.html +95 -94
- package/dist/package.js +1 -1
- package/dist/src/activity/emitter.js +1 -1
- package/dist/src/activity/index.js +1 -1
- package/dist/src/agent/agent-manager.js +6 -6
- package/dist/src/agent/agent-scope.js +1 -1
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/bootstrap/load-bootstrap-files.js +1 -1
- package/dist/src/agent/coding/repository-instructions.js +1 -1
- package/dist/src/agent/coding/workspace-revision.js +2 -2
- package/dist/src/agent/commands/command-registry.js +3 -3
- package/dist/src/agent/commands/commandMounts.js +1 -1
- package/dist/src/agent/context/workspace-seed.js +2 -2
- package/dist/src/agent/context/workspace-state.js +1 -1
- package/dist/src/agent/data-acquisition/service.js +1 -1
- package/dist/src/agent/embedded/codemode-output.js +4 -4
- package/dist/src/agent/embedded/run-for-session.js +2 -2
- package/dist/src/agent/embedded/run-turn.js +1 -1
- package/dist/src/agent/embedded/session-runner.js +1 -1
- package/dist/src/agent/external-tools/cliProvider.js +2 -2
- package/dist/src/agent/external-tools/composio-provider.js +1 -1
- package/dist/src/agent/image/load-image-media.js +2 -2
- package/dist/src/agent/mcp/connection-drafts.d.ts +1 -1
- package/dist/src/agent/mcp/connection-drafts.js +15 -2
- package/dist/src/agent/mcp/native-mcp.js +1 -1
- package/dist/src/agent/memory/compaction.js +1 -1
- package/dist/src/agent/memory/plugin-discovery.js +1 -1
- package/dist/src/agent/prompt/response-language.js +1 -1
- package/dist/src/agent/reply/post-compaction-context.js +1 -1
- package/dist/src/agent/reply/workspace-boundary-read.js +1 -1
- package/dist/src/agent/sandbox/fileAccess.js +1 -1
- package/dist/src/agent/sandbox/native-command.js +1 -1
- package/dist/src/agent/sandbox/path-policy.js +2 -2
- package/dist/src/agent/service/process-direct-streaming.js +2 -2
- package/dist/src/agent/service.js +1 -1
- package/dist/src/agent/skills/config.js +1 -1
- package/dist/src/agent/skills/hub-hash.js +2 -2
- package/dist/src/agent/skills/hub-pull.js +4 -4
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/skill-sources.js +2 -2
- package/dist/src/agent/starter-agents.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +1 -1
- package/dist/src/agent/tools/create-share-tool.js +1 -1
- package/dist/src/agent/tools/factory.js +1 -1
- package/dist/src/agent/tools/image-generate-tool.js +1 -1
- package/dist/src/agent/tools/personal-memory-tool.js +1 -1
- package/dist/src/agent/tools/review-workspace.js +1 -1
- package/dist/src/agent/tools/scoped-workspace-tools.js +2 -2
- package/dist/src/agent/tools/task-collaboration-tool.js +1 -1
- package/dist/src/agent/tools/tool-media.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +3 -3
- package/dist/src/agent-catalog/repository.js +1 -1
- package/dist/src/agent-catalog/service.js +1 -1
- package/dist/src/auth/credentials.js +1 -1
- package/dist/src/auth/oauth/openai.js +1 -1
- package/dist/src/auth/oauth/xopc-cloud.js +1 -1
- package/dist/src/auth/oauth-provider-lock.js +2 -2
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/automations/service/action-executor.js +1 -1
- package/dist/src/automations/service/automation-service.js +1 -1
- package/dist/src/backup/archive.js +5 -5
- package/dist/src/browser/cache-dir-policy.js +1 -1
- package/dist/src/browser/native-messaging-host.js +1 -1
- package/dist/src/browser/providers/browser-ext-install.js +7 -7
- package/dist/src/browser/providers/playwright-doctor.js +2 -2
- package/dist/src/browser/runtime/browser-runtime.js +1 -1
- package/dist/src/capabilities/capability-catalog.js +1 -1
- package/dist/src/channels/catalog/channel-catalog-service.js +1 -1
- package/dist/src/channels/pairing/allow-from-file.js +1 -1
- package/dist/src/channels/pairing/pairing-store.js +2 -2
- package/dist/src/cli/commands/doctor/checks/config-health.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +2 -2
- package/dist/src/cli/commands/doctor/checks/state-integrity.js +1 -1
- package/dist/src/cli/commands/doctor/checks/workspace-status.js +1 -1
- package/dist/src/cli/commands/extension-agent-plugin.js +1 -1
- package/dist/src/cli/commands/extension-create.js +1 -1
- package/dist/src/cli/commands/extension-dev.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +2 -2
- package/dist/src/cli/commands/extension-pack.js +3 -3
- package/dist/src/cli/commands/extension.js +1 -1
- package/dist/src/cli/commands/gateway/logs.js +1 -1
- package/dist/src/cli/commands/gateway/shared.js +1 -1
- package/dist/src/cli/commands/mcp.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +2 -2
- package/dist/src/config/config-file.js +1 -1
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/paths-state.js +1 -1
- package/dist/src/config/workspace-path.js +1 -1
- package/dist/src/connectors/cli/assets.js +1 -1
- package/dist/src/connectors/cli/installer.js +3 -3
- package/dist/src/connectors/connected-source-ingestion.js +1 -1
- package/dist/src/connectors/content-enrichment.js +2 -2
- package/dist/src/connectors/plugin-connection.js +1 -1
- package/dist/src/daemon/constants.js +1 -1
- package/dist/src/daemon/install-plan.js +2 -2
- package/dist/src/daemon/launchd.js +3 -3
- package/dist/src/daemon/schtasks.js +2 -2
- package/dist/src/daemon/systemd.js +3 -3
- package/dist/src/discussions/action-tasks.js +1 -1
- package/dist/src/discussions/live-worker.js +1 -1
- package/dist/src/discussions/recording.js +3 -3
- package/dist/src/discussions/repository.js +1 -1
- package/dist/src/discussions/sealer.js +2 -2
- package/dist/src/discussions/service.js +1 -1
- package/dist/src/endpoint-tools/bridge-host.js +1 -1
- package/dist/src/endpoint-tools/delegation.js +1 -1
- package/dist/src/endpoint-tools/provider-operation-journal.js +1 -1
- package/dist/src/endpoint-tools/runtime.js +1 -1
- package/dist/src/endpoint-tools/upload-service.js +2 -2
- package/dist/src/execution-environments/local-worktree-manager.js +3 -3
- package/dist/src/execution-environments/store.js +1 -1
- package/dist/src/execution-environments/worktree-safety.js +1 -1
- package/dist/src/extensions/agent-plugins/auth.js +2 -2
- package/dist/src/extensions/agent-plugins/branding.js +2 -2
- package/dist/src/extensions/agent-plugins/capability-access.js +1 -1
- package/dist/src/extensions/agent-plugins/cli-authorization.js +3 -3
- package/dist/src/extensions/agent-plugins/contained-path.js +1 -1
- package/dist/src/extensions/agent-plugins/credentials.js +1 -1
- package/dist/src/extensions/agent-plugins/formats.js +1 -1
- package/dist/src/extensions/agent-plugins/inventory.js +1 -1
- package/dist/src/extensions/agent-plugins/mcp-adapter.js +3 -3
- package/dist/src/extensions/agent-plugins/resources.js +2 -2
- package/dist/src/extensions/agent-plugins/setup.js +4 -4
- package/dist/src/extensions/agent-plugins/skill-catalog.js +1 -1
- package/dist/src/extensions/agent-plugins/source-catalog.js +3 -3
- package/dist/src/extensions/agent-plugins/sources.js +2 -2
- package/dist/src/extensions/agent-plugins/store.js +5 -5
- package/dist/src/extensions/agent-plugins/user-config.js +2 -2
- package/dist/src/extensions/agent-plugins/validation.js +2 -2
- package/dist/src/extensions/connector-dependencies.js +1 -1
- package/dist/src/extensions/install-transaction.js +1 -1
- package/dist/src/extensions/install.js +1 -1
- package/dist/src/extensions/loader.js +1 -1
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/extensions/update.js +2 -2
- package/dist/src/files/file-service.js +4 -4
- package/dist/src/files/file-versions.js +1 -1
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/hono/lib/static-ui.js +2 -2
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/browser.js +1 -1
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/hono/routes/extension-ui-assets.js +1 -1
- package/dist/src/gateway/hono/routes/host-fs.js +1 -1
- package/dist/src/gateway/hono/routes/local-apps.js +2 -2
- package/dist/src/gateway/hono/routes/location-sharing.js +1 -1
- package/dist/src/gateway/hono/routes/memory-learning.js +1 -1
- package/dist/src/gateway/hono/routes/mobile-capability-panels.d.ts +3 -1
- package/dist/src/gateway/hono/routes/mobile-capability-panels.js +121 -44
- package/dist/src/gateway/hono/routes/notes.js +1 -1
- package/dist/src/gateway/hono/routes/personal-agent.js +1 -1
- package/dist/src/gateway/hono/routes/phone-setup.js +1 -1
- package/dist/src/gateway/hono/routes/phone.js +1 -1
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/provider-setup.js +1 -1
- package/dist/src/gateway/hono/routes/sessions.js +1 -1
- package/dist/src/gateway/hono/routes/shares.js +2 -2
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/hono/routes/video-generation.js +1 -1
- package/dist/src/gateway/lock.js +2 -2
- package/dist/src/gateway/next-turn-suggestions/snapshot.js +1 -1
- package/dist/src/gateway/security/device-request-proof.js +1 -1
- package/dist/src/gateway/security/phone-access.js +1 -1
- package/dist/src/gateway/service/agent-runner.js +1 -1
- package/dist/src/gateway/service/session-input-coordinator.js +1 -1
- package/dist/src/gateway/service.js +4 -4
- package/dist/src/gateway/session-context-summary.js +1 -1
- package/dist/src/gateway/workspace-editor-path.js +1 -1
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/home-intelligence/follow-ups.js +1 -1
- package/dist/src/home-intelligence/host.js +1 -1
- package/dist/src/home-intelligence/repository.js +1 -1
- package/dist/src/home-intelligence/routines.js +1 -1
- package/dist/src/imports/files.js +3 -3
- package/dist/src/imports/importService.js +3 -3
- package/dist/src/imports/inventory.js +2 -2
- package/dist/src/imports/planner.js +2 -2
- package/dist/src/imports/productImport.js +1 -1
- package/dist/src/imports/scanner.js +2 -2
- package/dist/src/imports/sources.js +2 -2
- package/dist/src/infra/brew.js +1 -1
- package/dist/src/infra/package-runtime-check.js +2 -2
- package/dist/src/infra/path-env.js +2 -2
- package/dist/src/infra/process-diagnostics.js +1 -1
- package/dist/src/infra/restart.js +1 -1
- package/dist/src/infra/update-check.js +1 -1
- package/dist/src/infra/update-global.js +1 -1
- package/dist/src/infra/update-lock.js +1 -1
- package/dist/src/infra/update-startup.js +1 -1
- package/dist/src/infra/write-file-atomic.js +2 -2
- package/dist/src/knowledge/local-folder-adapter.js +1 -1
- package/dist/src/local-apps/acceptance.js +1 -1
- package/dist/src/local-apps/artifact-files.js +2 -2
- package/dist/src/local-apps/execution-authority.js +1 -1
- package/dist/src/local-apps/p1-services.js +3 -3
- package/dist/src/local-apps/preview-fixtures.js +1 -1
- package/dist/src/local-apps/preview-sessions.js +2 -2
- package/dist/src/local-apps/preview-worker.js +2 -2
- package/dist/src/local-apps/public-assets.js +2 -2
- package/dist/src/local-apps/scaffold.js +1 -1
- package/dist/src/local-apps/service.js +5 -5
- package/dist/src/local-apps/snapshot-store.js +1 -1
- package/dist/src/local-apps/store.js +1 -1
- package/dist/src/media/session-references.js +1 -1
- package/dist/src/media/store.js +1 -1
- package/dist/src/memory-learning/source-learning.js +1 -1
- package/dist/src/memory-learning/task-receipts.js +1 -1
- package/dist/src/migrations/runner.js +1 -1
- package/dist/src/music-generation/artifact.js +2 -2
- package/dist/src/notes/capabilities/write.js +1 -1
- package/dist/src/notes/service.js +2 -2
- package/dist/src/notes/store.js +2 -2
- package/dist/src/notifications/harmony-push.js +1 -1
- package/dist/src/notifications/store.js +1 -1
- package/dist/src/observability/store.js +1 -1
- package/dist/src/personal-agent/proactivity/repository.js +1 -1
- package/dist/src/personal-agent/proactivity/service.js +2 -2
- package/dist/src/personal-agent/reply-composer.js +3 -3
- package/dist/src/personal-agent/request-delivery.js +1 -1
- package/dist/src/personal-agent/request-service.js +1 -1
- package/dist/src/personal-agent/result-reader.js +3 -3
- package/dist/src/personal-agent/unread.js +1 -1
- package/dist/src/pets/factory.js +1 -1
- package/dist/src/pets/validator.js +1 -1
- package/dist/src/phone/adb-driver.js +3 -3
- package/dist/src/phone/assistance-service.js +1 -1
- package/dist/src/phone/assistance.js +1 -1
- package/dist/src/phone/cloud-adb-connection.js +1 -1
- package/dist/src/phone/execution-trace.js +1 -1
- package/dist/src/phone/hdc-driver.js +3 -3
- package/dist/src/phone/hdc-video-tools.js +2 -2
- package/dist/src/phone/location-baseline-store.js +1 -1
- package/dist/src/phone/location-environment.js +1 -1
- package/dist/src/phone/repository.js +1 -1
- package/dist/src/phone/ui-session.js +2 -2
- package/dist/src/project-trust/trust-store.js +2 -2
- package/dist/src/projects/project-kind.js +1 -1
- package/dist/src/projects/project-service.js +1 -1
- package/dist/src/projects/project-skill-service.js +1 -1
- package/dist/src/projects/workspace-project.js +2 -2
- package/dist/src/providers/auth-runtime/auth-profile-store.js +1 -1
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/providers/xopc-cloud-credit-budget.js +1 -1
- package/dist/src/runtime-tools/archive.js +2 -2
- package/dist/src/runtime-tools/downloader.js +2 -2
- package/dist/src/runtime-tools/harmony-dependencies.js +1 -1
- package/dist/src/runtime-tools/manager.js +1 -1
- package/dist/src/runtime-tools/manifest-store.js +1 -1
- package/dist/src/runtime-tools/phone-dependencies.js +1 -1
- package/dist/src/session/init-session-turn.js +1 -1
- package/dist/src/session/resolve-session.js +1 -1
- package/dist/src/share/hosted-note-publication.js +1 -1
- package/dist/src/share/hosted-session-share.js +2 -2
- package/dist/src/share/hosted-static-site-publication.js +2 -2
- package/dist/src/share/note-share-service.js +1 -1
- package/dist/src/share/session-share-service.js +2 -2
- package/dist/src/share/share-auto.js +2 -2
- package/dist/src/share/share-store.js +2 -2
- package/dist/src/share/share-zip.js +1 -1
- package/dist/src/share/site-share-store.js +1 -1
- package/dist/src/share/site-static-serve.js +1 -1
- package/dist/src/space/budget-workbook.js +1 -1
- package/dist/src/space/ingest.js +1 -1
- package/dist/src/space/repository.js +3 -3
- package/dist/src/space/workbook-turn.js +1 -1
- package/dist/src/space/worker.js +1 -1
- package/dist/src/storage/sqlite/ai-usage-repository.js +1 -1
- package/dist/src/storage/sqlite/clarification-wait-repository.js +2 -2
- package/dist/src/storage/sqlite/connection.js +3 -3
- package/dist/src/storage/sqlite/conversation-repository.js +2 -2
- package/dist/src/storage/sqlite/desktop-execution-repository.js +1 -1
- package/dist/src/storage/sqlite/desktop-execution-stop-repository.js +1 -1
- package/dist/src/storage/sqlite/device-access-repository.js +1 -1
- package/dist/src/storage/sqlite/device-pairing-approval.js +1 -1
- package/dist/src/storage/sqlite/index.js +1 -1
- package/dist/src/storage/sqlite/offline-access.js +1 -1
- package/dist/src/storage/sqlite/schema-upgrade.js +3 -3
- package/dist/src/storage/sqlite/session-creation-repository.js +1 -1
- package/dist/src/storage/sqlite/session-input-control-repository.js +1 -1
- package/dist/src/storage/sqlite/session-repository.js +1 -1
- package/dist/src/storage/sqlite/sql-assets.js +1 -1
- package/dist/src/storage/sqlite/windows-database-owners.js +1 -1
- package/dist/src/tasks/capabilities/management.js +1 -1
- package/dist/src/tasks/capabilities/relations.js +1 -1
- package/dist/src/tasks/task-allocation-service.js +2 -2
- package/dist/src/tasks/task-application-service.js +1 -1
- package/dist/src/tasks/task-context-assembler.js +2 -2
- package/dist/src/tasks/task-criterion-review-repository.js +1 -1
- package/dist/src/tasks/task-deliverables.js +1 -1
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tasks/task-handoff.js +8 -8
- package/dist/src/tasks/task-json-acceptance.js +2 -2
- package/dist/src/tasks/task-research-repair.js +2 -2
- package/dist/src/tasks/task-research-result.js +2 -2
- package/dist/src/tasks/task-result-delivery-repository.js +1 -1
- package/dist/src/tasks/task-result-delivery-service.js +2 -2
- package/dist/src/tasks/task-run-coordinator.js +2 -2
- package/dist/src/tasks/task-run-repository.js +1 -1
- package/dist/src/tasks/task-signal-service.js +1 -1
- package/dist/src/tasks/task-workspace-verification.js +3 -3
- package/dist/src/tui/backends/embedded-backend.js +5 -5
- package/dist/src/tui/backends/embedded-drafts.js +2 -2
- package/dist/src/tui/backends/gateway-realtime-backend.js +1 -1
- package/dist/src/tui/clipboard-image.js +3 -3
- package/dist/src/tui/theme-manager.js +1 -1
- package/dist/src/tui/tui-command-formatters.js +1 -1
- package/dist/src/tui/tui-commands.js +1 -1
- package/dist/src/tui/tui-keybindings-file.js +1 -1
- package/dist/src/tui/tui-scoped-models.js +1 -1
- package/dist/src/tui/tui-settings.js +1 -1
- package/dist/src/tui/tui.js +3 -3
- package/dist/src/tunnel/frpc-binary.js +2 -2
- package/dist/src/tunnel/frpc-config.js +1 -1
- package/dist/src/tunnel/frpc-extract.js +2 -2
- package/dist/src/tunnel/tunnel-state.js +1 -1
- package/dist/src/user-context/access-policy.js +1 -1
- package/dist/src/user-context/changes.d.ts +1 -1
- package/dist/src/user-model/repository.js +1 -1
- package/dist/src/utils/index.js +1 -1
- package/dist/src/utils/logger/index.js +1 -1
- package/dist/src/utils/logger.js +1 -1
- package/dist/src/video-generation/artifact.js +2 -2
- package/dist/src/video-generation/repository.js +1 -1
- package/dist/src/voice/audio/normalize.js +2 -2
- package/dist/src/voice/realtime/memory-context.d.ts +1 -1
- package/dist/src/voice/realtime/memory-context.js +12 -10
- package/dist/src/voice/realtime/omniEngine.js +32 -12
- package/dist/src/voice/realtime/omniRoute.js +1 -1
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/dist/src/voice/realtime/runtime.js +16 -12
- package/dist/src/voice/tts/providers/edge-speech.js +2 -2
- package/dist/src/work-discovery/candidate-discovery.js +3 -3
- package/dist/src/work-discovery/probe.js +4 -4
- package/dist/src/work-discovery/service.js +2 -2
- package/package.json +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-9lLzGQ-F.js +0 -8
- package/dist/gateway/static/root/assets/connected-providers-grid-ds0J-7Qc.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-DTcS5Hqk.js +0 -1
- package/dist/gateway/static/root/assets/home-page-CwUc6499.js +0 -8
- package/dist/gateway/static/root/assets/index-BWJ0tePz.js +0 -11
- package/dist/gateway/static/root/assets/index-C-4H3NhI.css +0 -1
- package/dist/gateway/static/root/assets/note-image-lightbox-D-7a_BCN.js +0 -1
- package/dist/gateway/static/root/assets/route-preload-N7Ieq1wB.js +0 -2
- package/dist/gateway/static/root/assets/routine-panel-BvBR3khG.js +0 -2
- package/dist/gateway/static/root/assets/settings-advanced-gate-JrndQtAT.js +0 -1
- package/dist/gateway/static/root/assets/space-page-BAp28k1I.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-15Qm8kNq.js +0 -3
- package/dist/gateway/static/root/assets/task-result-evidence-BqAt23uk.js +0 -1
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-BkCt8mdN.js +0 -1
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-swr-CdRzEUwF.js","assets/rolldown-runtime-aKtaBQYM.js","assets/vendor-react-BOUWij0V.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
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"./preload-helper-Czpn1I53.js";import{_ as a,d as o,h as s,r as c,t as l}from"./chunk-KS7C4IRE-DIIvxCDx.js";import{a as u,i as d,l as f,n as p,o as m}from"./locale-store-5DzxIIeq.js";import{t as h}from"./messages-CGGOcV9B.js";import{a as g,i as _,n as v,o as y,r as b,s as x,t as S}from"./dist-DlirbHVs.js";import{t as C}from"./arrow-right-DSSvoX71.js";import{a as w,i as T,n as E,t as D}from"./video-generation-Cec49Jwg.js";import{t as O}from"./chevron-right-BweFrslA.js";import{n as k,r as A,t as j}from"./popover-select-hRG1EzAY.js";import{t as M}from"./circle-check-C23XjkUj.js";import{C as N,S as ee,T as P,_ as F,a as I,b as L,c as R,d as z,f as B,g as V,h as H,i as U,l as te,m as W,n as ne,o as G,p as re,r as ie,s as K,t as ae,u as oe,v as se,w as ce,x as le,y as q}from"./connected-providers-grid-ds0J-7Qc.js";import{t as ue}from"./cloud-C4-yfnnk.js";import{t as de}from"./external-link-DjqjBmc3.js";import{t as fe}from"./secret-input-DsjfQmDn.js";import{t as pe}from"./eye-CABVeTq0.js";import{t as me}from"./image-Cwyalflz.js";import{t as he}from"./key-round-DWbpyU2U.js";import{t as ge}from"./loader-circle-CifKLtgG.js";import{t as _e}from"./pencil-DmIY3Oa-.js";import{t as ve}from"./plug-DKYPEgkR.js";import{t as ye}from"./plus-Q2yW6OE7.js";import{t as be}from"./refresh-cw-BRlGaq2w.js";import{t as xe}from"./settings-2-D-csvaET.js";import{t as Se}from"./shield-check-BU58siTV.js";import{t as Ce}from"./sliders-horizontal-DqsYor6I.js";import{t as we}from"./trash-2-DusmjVPV.js";import{t as Te}from"./triangle-alert-2JXFNNKU.js";import{t as Ee}from"./wrench-DFb4r8bH.js";import{t as De}from"./x-B_N4OPjy.js";import{t as J}from"./cn-0WouolD0.js";import{t as Y}from"./skeleton-DzdOeGYz.js";import{t as Oe}from"./voice-CUfqdnlR.js";import{n as ke}from"./cloud-credits-B-nbtkqv.js";import{a as Ae,i as X}from"./vendor-swr-CdRzEUwF.js";import{n as je,r as Me}from"./gateway-config-swr-abWJ0Q_y.js";import{n as Ne,t as Pe}from"./registry-api-Dw8Ou9VV.js";import{t as Z}from"./button-C5tRaJxt.js";import{i as Fe,o as Ie}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{n as Le}from"./open-capability-settings-DQsmJxI7.js";import{n as Re,t as ze}from"./interaction-BdhHBbYa.js";import{n as Be,t as Ve}from"./voice-settings-BEhihzNq.js";import{a as He,o as Ue,s as We}from"./form-field-width-DJw_jULe.js";import{n as Ge}from"./is-masked-secret-DOkL5b_X.js";import{n as Ke,t as qe}from"./secret-input-labels-B5Jl5HqK.js";import{a as Je}from"./navigation-ByOzYT0t.js";import{t as Ye}from"./electron-env-DHOGevH3.js";import{n as Xe,t as Ze}from"./settings-form-draft-Dy10ldo8.js";import{t as Qe}from"./sliding-tab-list-CmcrqRzN.js";import{t as $e}from"./confirm-dialog-MHCmEEUZ.js";import{n as et,t as tt}from"./model-sort-_Tz8s_4N.js";import{n as nt,r as rt}from"./model-selector-DsCLjn_X.js";import{n as it}from"./agents-app-path-ciChvpCS.js";import{n as at,t as ot}from"./global-defaults-api-BIa73mvy.js";import{t as st}from"./settings-loading-skeleton-CAoOV17i.js";import{i as ct,n as lt,r as ut,t as dt}from"./capability-navigation-CZbCI5C2.js";import{a as ft,i as pt,o as mt,r as ht,t as gt}from"./models-hub-cache-B0Y9Frop.js";import{a as _t,r as vt,s as yt,t as bt}from"./providers-api-Df4w723e.js";import{a as xt,i as St,n as Ct,o as wt,r as Tt,t as Et}from"./oauth-api-CAPuqZdT.js";import{t as Dt}from"./settings-advanced-section-Bponzv_k.js";import{n as Ot,r as kt,t as At}from"./oauth-authorization-window-o6URRos4.js";import{t as jt}from"./number-input-El7Szeln.js";import{n as Mt,t as Nt}from"./settings-page-header-B8nLRdnY.js";import"./settings-page-layout-DhOLVJYv.js";import{n as Pt,t as Ft}from"./settings-form-section-num14vSv.js";import{n as It,t as Lt}from"./use-autosave-BYtW_pgF.js";import{c as Rt,h as zt,l as Bt,n as Vt,o as Ht,t as Ut}from"./voice-config-api-BX2Q9Cgb.js";import{a as Wt,i as Gt,n as Kt,o as qt,r as Jt,s as Yt,t as Xt}from"./image-generation-api-BCU7Uxyy.js";import{t as Zt}from"./xopc-cloud-account-card-BWdmU4iy.js";var Qt=`tencent-mps`,$t=n(),Q=e(t(),1),$=r(),en={en:{addTitle:`Add image service`,editTitle:`Manage image service`,intro:`Connect an endpoint that implements the OpenAI Images protocol.`,connection:`Connection`,providerId:`Provider ID`,providerIdHint:`Lowercase letters, numbers, hyphens, or underscores.`,name:`Display name`,baseUrl:`Base URL`,auth:`Authentication`,bearer:`Bearer token`,header:`Custom API key header`,none:`No authentication`,headerName:`Header name`,apiKey:`API key`,apiKeyHint:`Stored in the local credential store, separate from models.json.`,apiKeyUrl:`API key page (optional)`,docsUrl:`Documentation page (optional)`,openKeyPage:`Create API key`,paths:`Protocol and network`,generationsPath:`Generations path`,editsPath:`Edits path`,allowedHosts:`Allowed private hosts (optional)`,allowedHostsHint:`One exact hostname or IP per line. Private endpoints stay blocked unless listed here.`,staticHeaders:`Static headers (optional)`,staticHeadersHint:`One per line: X-Tenant: value. Credential headers are rejected.`,models:`Image models`,addModel:`Add model`,modelId:`Model ID`,modelName:`Name (optional)`,defaultModel:`Default model`,maxCount:`Max images`,defaultCount:`Default count`,defaultSize:`Default size`,format:`Output format`,supportsSize:`Supports size`,edit:`Supports edits`,remove:`Remove`,cancel:`Cancel`,save:`Save service`,saving:`Saving…`,test:`Test generation`,testing:`Generating…`,delete:`Delete service`,confirmDelete:`Delete permanently`,saved:`Image service saved.`,deleted:`Image service deleted.`,testReady:`Test image generated.`,show:`Show key`,hide:`Hide key`,copy:`Copy key`,copied:`Copied`,revealFailed:`Unable to reveal the saved key.`,notRevealable:`No revealable key is stored locally.`,required:`Complete the required connection and model fields.`,duplicateModels:`Model IDs must be unique.`,invalidHeaders:`Static headers must use “Name: value”, one per line.`},zh:{addTitle:`添加图片服务`,editTitle:`管理图片服务`,intro:`连接一个严格实现 OpenAI Images 协议的服务端点。`,connection:`连接信息`,providerId:`Provider ID`,providerIdHint:`仅支持小写字母、数字、连字符和下划线。`,name:`显示名称`,baseUrl:`Base URL`,auth:`认证方式`,bearer:`Bearer Token`,header:`自定义 API Key Header`,none:`无需认证`,headerName:`Header 名称`,apiKey:`API Key`,apiKeyHint:`密钥单独保存在本机凭据存储,不写入 models.json。`,apiKeyUrl:`API Key 创建页面(可选)`,docsUrl:`协议文档页面(可选)`,openKeyPage:`去创建 API Key`,paths:`协议与网络`,generationsPath:`生成路径`,editsPath:`编辑路径`,allowedHosts:`允许访问的私有主机(可选)`,allowedHostsHint:`每行一个精确主机名或 IP;未列出的私网端点保持阻止。`,staticHeaders:`静态 Headers(可选)`,staticHeadersHint:`每行一个:X-Tenant: value。认证 Header 会被拒绝。`,models:`图片模型`,addModel:`添加模型`,modelId:`模型 ID`,modelName:`名称(可选)`,defaultModel:`默认模型`,maxCount:`单次最大张数`,defaultCount:`默认张数`,defaultSize:`默认尺寸`,format:`输出格式`,supportsSize:`支持尺寸参数`,edit:`支持图片编辑`,remove:`移除`,cancel:`取消`,save:`保存服务`,saving:`保存中…`,test:`测试生成`,testing:`生成中…`,delete:`删除服务`,confirmDelete:`确认永久删除`,saved:`图片服务已保存。`,deleted:`图片服务已删除。`,testReady:`测试图片生成成功。`,show:`显示密钥`,hide:`隐藏密钥`,copy:`复制密钥`,copied:`已复制`,revealFailed:`无法查看已保存的密钥。`,notRevealable:`本机没有可查看的密钥。`,required:`请补全必填的连接和模型信息。`,duplicateModels:`模型 ID 不能重复。`,invalidHeaders:`静态 Header 必须使用“名称: 值”格式,每行一个。`}},tn=`mt-1.5 h-10 w-full rounded-lg border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/20`;function nn(e){let t=e??{id:``,capabilities:{generate:{maxCount:1,supportsSize:!0},edit:{enabled:!1}}};return{original:t,id:t.id,name:t.name??``,maxCount:String(t.capabilities.generate?.maxCount??1),defaultCount:t.defaults?.count?String(t.defaults.count):``,defaultSize:t.defaults?.size??``,outputFormat:t.defaults?.outputFormat??``,supportsSize:t.capabilities.generate?.supportsSize??!1,editEnabled:t.capabilities.edit?.enabled??!1}}function rn(e){let t=e.split(`
|
|
3
|
-
`).map(e=>e.trim()).filter(Boolean);if(t.length===0)return;let n=t.map(e=>{let t=e.indexOf(`:`);if(t<=0||!e.slice(t+1).trim())throw Error(`invalid_headers`);return[e.slice(0,t).trim(),e.slice(t+1).trim()]});return Object.fromEntries(n)}function an({open:e,onOpenChange:t,provider:n,configured:r,language:i,onSaved:a,portalContainer:o,onPendingChange:s}){let c=en[i],[l,u]=(0,Q.useState)(``),[d,f]=(0,Q.useState)(``),[p,m]=(0,Q.useState)(``),[h,C]=(0,Q.useState)(`bearer`),[T,E]=(0,Q.useState)(`x-api-key`),[D,O]=(0,Q.useState)(``),[k,A]=(0,Q.useState)(``),[M,N]=(0,Q.useState)(``),[ee,P]=(0,Q.useState)(`/images/generations`),[F,I]=(0,Q.useState)(`/images/edits`),[L,R]=(0,Q.useState)(``),[z,B]=(0,Q.useState)(``),[V,H]=(0,Q.useState)([nn()]),[U,te]=(0,Q.useState)(``),[W,ne]=(0,Q.useState)(),[G,re]=(0,Q.useState)(!1),[ie,K]=(0,Q.useState)(),[ae,oe]=(0,Q.useState)(),[se,ce]=(0,Q.useState)();(0,Q.useEffect)(()=>(s?.(!!W),()=>s?.(!1)),[W,s]),(0,Q.useEffect)(()=>{if(!e)return;let t=n?.imageGeneration;u(n?.providerId??``),f(t?.name??``),m(n?.baseUrl??``),C(t?.auth.type??`bearer`),E(t?.auth.type===`header`?t.auth.headerName:`x-api-key`),O(r?`••••••••••••`:``),A(t?.apiKeyUrl??``),N(t?.documentationUrl??``),P(t?.paths?.generations??`/images/generations`),I(t?.paths?.edits??`/images/edits`),R(t?.network?.allowedHosts.join(`
|
|
4
|
-
`)??``),B(Object.entries(n?.headers??{}).map(([e,t])=>`${e}: ${t}`).join(`
|
|
5
|
-
`)),H(t?.models.map(nn)??[nn()]),te(t?.defaultModel??``),oe(void 0),ne(void 0),re(!1),K(void 0),ce(void 0)},[r,e,n]);let le=(0,Q.useMemo)(()=>V.filter(e=>e.id.trim()).sort(et).map(e=>({value:e.id.trim(),label:e.name.trim()||e.id.trim()})),[V]),q=(e,t)=>{H(n=>n.map((n,r)=>r===e?{...n,...t}:n))},ue=()=>{let e=l.trim(),t=V.map(e=>({...e,id:e.id.trim(),name:e.name.trim()}));if(!e||!d.trim()||!p.trim()||t.some(e=>!e.id))throw Error(c.required);if(new Set(t.map(e=>e.id)).size!==t.length)throw Error(c.duplicateModels);let n=U||t[0]?.id;if(!n||!t.some(e=>e.id===n))throw Error(c.required);let r;try{r=rn(z)}catch{throw Error(c.invalidHeaders)}return{providerId:e,input:{baseUrl:p.trim(),...r?{headers:r}:{},imageGeneration:{api:`openai-images`,name:d.trim(),...M.trim()?{documentationUrl:M.trim()}:{},...k.trim()?{apiKeyUrl:k.trim()}:{},defaultModel:n,auth:h===`header`?{type:`header`,headerName:T.trim()}:{type:h},paths:{...ee.trim()?{generations:ee.trim()}:{},...F.trim()?{edits:F.trim()}:{}},...L.trim()?{network:{allowedHosts:L.split(`
|
|
6
|
-
`).map(e=>e.trim()).filter(Boolean)}}:{},models:t.map(e=>({...e.original,id:e.id,...e.name?{name:e.name}:{name:void 0},capabilities:{...e.original.capabilities,generate:{...e.original.capabilities.generate,maxCount:Math.max(1,Number.parseInt(e.maxCount,10)||1),supportsSize:e.supportsSize},edit:{...e.original.capabilities.edit,enabled:e.editEnabled}},defaults:{...e.original.defaults,...e.defaultCount?{count:Math.max(1,Number.parseInt(e.defaultCount,10)||1)}:{count:void 0},...e.defaultSize.trim()?{size:e.defaultSize.trim()}:{size:void 0},...e.outputFormat?{outputFormat:e.outputFormat}:{outputFormat:void 0}}}))}}}},de=async()=>{let e=ue();return await Gt(e.providerId,e.input),h!==`none`&&D.trim()&&!Ge(D)&&await Wt(e.providerId,D.trim()),await a(e.providerId),e},me=async()=>{ne(`save`),K(void 0),oe(void 0);try{await de(),O(h===`none`?``:`••••••••••••`),oe(c.saved)}catch(e){K(e instanceof Error?e.message:String(e))}finally{ne(void 0)}},he=async()=>{ne(`test`),K(void 0),oe(void 0),ce(void 0);try{let e=await de(),t=await qt(e.providerId,e.input.imageGeneration.defaultModel);ce(t.images[0]?.dataUrl),oe(c.testReady)}catch(e){K(e instanceof Error?e.message:String(e))}finally{ne(void 0)}},_e=async()=>{if(n){if(!G){re(!0);return}ne(`delete`),K(void 0);try{await Xt(n.providerId),await a(),t(!1)}catch(e){K(e instanceof Error?e.message:String(e))}finally{ne(void 0)}}};return(0,$.jsx)(S,{open:e,onOpenChange:e=>{W||t(e)},children:(0,$.jsxs)(y,{container:o,children:[(0,$.jsx)(g,{className:J(`xopc-dialog-overlay fixed inset-0 bg-scrim`,Ie)}),(0,$.jsxs)(b,{className:J(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(88vh,760px)] w-[min(calc(100%-2rem),52rem)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-popover`,Fe),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,$.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-4 border-b border-edge px-5 py-4`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(x,{className:`font-semibold text-fg`,children:n?c.editTitle:c.addTitle}),(0,$.jsx)(_,{className:`mt-1 text-sm text-fg-muted`,children:c.intro})]}),(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,disabled:!!W,className:`rounded-md p-1 text-fg-muted hover:bg-surface-inset hover:text-fg`,"aria-label":c.cancel,children:(0,$.jsx)(De,{className:`size-5`})})})]}),(0,$.jsxs)(`fieldset`,{disabled:!!W,className:`min-h-0 min-w-0 flex-1 space-y-6 overflow-y-auto px-5 py-4`,children:[(0,$.jsxs)(`section`,{className:`space-y-4`,children:[(0,$.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-fg-subtle`,children:c.connection}),(0,$.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.providerId,(0,$.jsx)(`input`,{value:l,disabled:!!n,onChange:e=>u(e.target.value),placeholder:`my-image-service`,className:tn}),(0,$.jsx)(`span`,{className:`mt-1 block font-normal text-fg-subtle`,children:c.providerIdHint})]}),(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.name,(0,$.jsx)(`input`,{value:d,onChange:e=>f(e.target.value),placeholder:`My Image Service`,className:tn})]})]}),(0,$.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[c.baseUrl,(0,$.jsx)(`input`,{value:p,onChange:e=>m(e.target.value),placeholder:`https://api.example.com/v1`,className:tn})]}),(0,$.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.auth,(0,$.jsx)(j,{value:h,options:[{value:`bearer`,label:c.bearer},{value:`header`,label:c.header},{value:`none`,label:c.none}],placeholder:c.auth,allowEmpty:!1,onChange:e=>C(e),triggerClassName:`mt-1.5`})]}),h===`header`?(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.headerName,(0,$.jsx)(`input`,{value:T,onChange:e=>E(e.target.value),className:tn})]}):null]}),h===`none`?null:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,$.jsx)(`label`,{htmlFor:`custom-image-api-key`,className:`text-xs font-medium text-fg-muted`,children:c.apiKey}),k.trim()?(0,$.jsxs)(`a`,{href:k.trim(),target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-xs text-accent hover:underline`,children:[c.openKeyPage,(0,$.jsx)(w,{className:`size-3.5`})]}):null]}),(0,$.jsx)(fe,{id:`custom-image-api-key`,value:D,onChange:e=>O(Ge(D)?e.replace(/^•+/,``):e),labels:{show:c.show,hide:c.hide,copy:c.copy,copied:c.copied},reveal:()=>yt(l).then(e=>e.apiKey),loadFailedLabel:c.revealFailed,notInConfigFile:c.notRevealable}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:c.apiKeyHint})]}),(0,$.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.apiKeyUrl,(0,$.jsx)(`input`,{value:k,onChange:e=>A(e.target.value),placeholder:`https://…`,className:tn})]}),(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.docsUrl,(0,$.jsx)(`input`,{value:M,onChange:e=>N(e.target.value),placeholder:`https://…`,className:tn})]})]}),(0,$.jsxs)(`details`,{className:`rounded-lg border border-edge bg-surface-inset px-3 py-2.5`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted`,children:c.paths}),(0,$.jsxs)(`div`,{className:`mt-3 grid gap-4 md:grid-cols-2`,children:[(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.generationsPath,(0,$.jsx)(`input`,{value:ee,onChange:e=>P(e.target.value),className:tn})]}),(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.editsPath,(0,$.jsx)(`input`,{value:F,onChange:e=>I(e.target.value),className:tn})]})]}),(0,$.jsxs)(`label`,{className:`mt-4 block text-xs font-medium text-fg-muted`,children:[c.allowedHosts,(0,$.jsx)(`textarea`,{value:L,onChange:e=>R(e.target.value),rows:2,placeholder:`127.0.0.1
|
|
7
|
-
image-server.lan`,className:`mt-1.5 w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 font-mono text-xs text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/20`}),(0,$.jsx)(`span`,{className:`mt-1 block font-normal text-fg-subtle`,children:c.allowedHostsHint})]}),(0,$.jsxs)(`label`,{className:`mt-4 block text-xs font-medium text-fg-muted`,children:[c.staticHeaders,(0,$.jsx)(`textarea`,{value:z,onChange:e=>B(e.target.value),rows:3,className:`mt-1.5 w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 font-mono text-xs text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/20`}),(0,$.jsx)(`span`,{className:`mt-1 block font-normal text-fg-subtle`,children:c.staticHeadersHint})]})]})]}),(0,$.jsxs)(`section`,{className:`space-y-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-fg-subtle`,children:c.models}),(0,$.jsxs)(Z,{variant:`secondary`,className:`px-2.5 py-1.5 text-xs`,onClick:()=>H(e=>[...e,nn()]),children:[(0,$.jsx)(ye,{className:`size-4`}),c.addModel]})]}),(0,$.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[c.defaultModel,(0,$.jsx)(j,{value:U||V.find(e=>e.id.trim())?.id.trim()||``,options:le,placeholder:c.defaultModel,allowEmpty:!1,onChange:te,triggerClassName:`mt-1.5 max-w-sm`})]}),V.map((e,t)=>(0,$.jsxs)(`div`,{className:`rounded-lg border border-edge bg-surface-base p-3`,children:[(0,$.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.modelId,(0,$.jsx)(`input`,{value:e.id,onChange:e=>q(t,{id:e.target.value}),placeholder:`image-1`,className:tn})]}),(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.modelName,(0,$.jsx)(`input`,{value:e.name,onChange:e=>q(t,{name:e.target.value}),className:tn})]})]}),(0,$.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.maxCount,(0,$.jsx)(`input`,{type:`number`,min:1,value:e.maxCount,onChange:e=>q(t,{maxCount:e.target.value}),className:tn})]}),(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.defaultCount,(0,$.jsx)(`input`,{type:`number`,min:1,value:e.defaultCount,onChange:e=>q(t,{defaultCount:e.target.value}),className:tn})]}),(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.defaultSize,(0,$.jsx)(`input`,{value:e.defaultSize,onChange:e=>q(t,{defaultSize:e.target.value}),placeholder:`1024x1024`,className:tn})]}),(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.format,(0,$.jsx)(j,{value:e.outputFormat,options:[{value:`png`,label:`PNG`},{value:`jpeg`,label:`JPEG`},{value:`webp`,label:`WebP`}],placeholder:c.format,allowEmpty:!0,onChange:e=>q(t,{outputFormat:e}),triggerClassName:`mt-1.5`})]})]}),(0,$.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-4`,children:[(0,$.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-fg-muted`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:e.supportsSize,onChange:e=>q(t,{supportsSize:e.target.checked})}),c.supportsSize]}),(0,$.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-fg-muted`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:e.editEnabled,onChange:e=>q(t,{editEnabled:e.target.checked})}),c.edit]}),(0,$.jsxs)(`button`,{type:`button`,disabled:V.length===1,onClick:()=>H(e=>e.filter((e,n)=>n!==t)),className:`ml-auto inline-flex items-center gap-1 text-xs text-red-600 disabled:opacity-40 dark:text-red-400`,children:[(0,$.jsx)(we,{className:`size-3.5`}),c.remove]})]})]},t))]}),se?(0,$.jsxs)(`section`,{className:`rounded-lg border border-edge bg-surface-base p-3`,children:[(0,$.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 text-sm font-medium text-fg`,children:[(0,$.jsx)(pe,{className:`size-4`}),c.testReady]}),(0,$.jsx)(`img`,{src:se,alt:`Generated provider test`,className:`max-h-72 rounded-lg object-contain`})]}):null,ae?(0,$.jsx)(`p`,{className:`rounded-lg bg-emerald-500/10 px-3 py-2 text-sm text-emerald-700 dark:text-emerald-300`,role:`status`,children:ae}):null,ie?(0,$.jsx)(`p`,{className:`rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-600 dark:text-red-400`,children:ie}):null]}),(0,$.jsxs)(`footer`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-t border-edge px-5 py-3`,children:[n?(0,$.jsxs)(Z,{variant:`secondary`,className:`border-red-500/30 text-red-600 hover:bg-red-500/10 dark:text-red-400`,disabled:!!W,onClick:()=>void _e(),children:[W===`delete`?(0,$.jsx)(ge,{className:`size-4 animate-spin`}):(0,$.jsx)(we,{className:`size-4`}),G?c.confirmDelete:c.delete]}):null,(0,$.jsxs)(`div`,{className:`ml-auto flex gap-2`,children:[(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(Z,{variant:`secondary`,disabled:!!W,children:c.cancel})}),(0,$.jsxs)(Z,{variant:`secondary`,disabled:!!W,onClick:()=>void he(),children:[W===`test`?(0,$.jsx)(ge,{className:`size-4 animate-spin`}):null,W===`test`?c.testing:c.test]}),(0,$.jsxs)(Z,{variant:`primary`,disabled:!!W,onClick:()=>void me(),children:[W===`save`?(0,$.jsx)(ge,{className:`size-4 animate-spin`}):null,W===`save`?c.saving:c.save]})]})]})]})]})})}var on=`••••••••••••`,sn={en:{title:`Image generation`,intro:`Configure the default image model and service. Agents inherit this setting unless overridden in Agent settings.`,provider:`Provider`,model:`Model`,apiKey:`API key`,getApiKey:`Get API key`,apiKeyHint:`Stored in the local credential store, never in xopc.json.`,existingKey:`A credential or environment variable is already available. Leave this blank to reuse it.`,savedKey:`A credential is saved. Use the eye button to view it, or type a new key to replace it.`,revealFailed:`Unable to load the saved API key.`,keyNotRevealable:`This credential comes from an environment variable or another non-revealable source.`,advanced:`Provider settings`,enable:`Enable image generation`,enabling:`Verifying and enabling…`,enabled:`Image generation is ready.`,addService:`Add image service`,manageService:`Manage service`,custom:`Custom`,current:`Current`,configured:`Credential ready`,needsKey:`API key required`,connect:`Connect to a gateway to continue.`,loadError:`Unable to load image generation settings.`,selectModel:`Select a model`,show:`Show key`,hide:`Hide key`,copy:`Copy key`,copied:`Copied`},zh:{title:`图片生成`,intro:`配置全局图片生成模型和服务。各智能体默认继承此设置,也可在智能体详情中单独覆盖。`,provider:`Provider`,model:`模型`,apiKey:`API Key`,getApiKey:`获取 API Key`,apiKeyHint:`密钥只保存在本机凭据存储中,不会写入 xopc.json。`,existingKey:`已有凭据或环境变量;留空即可继续使用。`,savedKey:`凭据已保存。点击眼睛可查看,直接输入新密钥可替换。`,revealFailed:`无法读取已保存的 API Key。`,keyNotRevealable:`当前凭据来自环境变量或其他不可查看的来源。`,advanced:`服务商设置`,enable:`启用图片生成`,enabling:`正在验证并启用…`,enabled:`图片生成已可用。`,addService:`添加图片服务`,manageService:`管理服务`,custom:`自定义`,current:`当前使用`,configured:`凭据已就绪`,needsKey:`需要 API Key`,connect:`请先连接网关。`,loadError:`无法加载图片生成设置。`,selectModel:`选择模型`,show:`显示密钥`,hide:`隐藏密钥`,copy:`复制密钥`,copied:`已复制`}};async function cn(){let e=await m(d(`/api/image-generation/default`));if(!e.payload)throw Error(`Invalid default image generation response`);return e.payload}function ln(e){let t=e?.indexOf(`/`)??-1;return t>0?e.slice(0,t):void 0}function un(e){let t=e?.indexOf(`/`)??-1;return t>0?e.slice(t+1):void 0}function dn(e){return Object.fromEntries(e.configFields.map(t=>[t.key,e.config[t.key]??(t.required?t.options?.[0]?.value??``:``)]))}function fn(e){let t=(0,$t.c)(11),{field:n,value:r,onChange:i}=e,a;t[0]!==n.label||t[1]!==n.options||t[2]!==n.placeholder||t[3]!==n.required||t[4]!==n.type||t[5]!==i||t[6]!==r?(a=n.type===`select`?(0,$.jsx)(j,{value:r,options:(n.options??[]).map(pn),placeholder:n.placeholder??n.label,allowEmpty:!n.required,onChange:i,triggerClassName:`mt-1.5`}):(0,$.jsx)(`input`,{type:`url`,value:r,required:n.required,onChange:e=>i(e.target.value),placeholder:n.placeholder,className:`mt-1.5 h-10 w-full rounded-lg border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/20`}),t[0]=n.label,t[1]=n.options,t[2]=n.placeholder,t[3]=n.required,t[4]=n.type,t[5]=i,t[6]=r,t[7]=a):a=t[7];let o;return t[8]!==n.label||t[9]!==a?(o=(0,$.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[n.label,a]}),t[8]=n.label,t[9]=a,t[10]=o):o=t[10],o}function pn(e){return{value:e.value,label:e.label}}function mn(){let e=(0,$t.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Y,{className:`h-24 rounded-xl`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`div`,{className:`grid gap-4`,"aria-hidden":`true`,children:[t,(0,$.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 xl:grid-cols-3`,children:Array.from({length:5}).map(hn)}),(0,$.jsx)(Y,{className:`h-64 rounded-xl`})]}),e[1]=n):n=e[1],n}function hn(e,t){return(0,$.jsx)(Y,{className:`h-24 rounded-xl`},t)}function gn({connectOnly:e=!1,onConnected:t,onPendingChange:n}={}){let r=p(e=>e.language),a=sn[r],o=!!f(e=>e.conversationId),[s,c]=(0,Q.useState)(``),[l,u]=(0,Q.useState)(``),[h,g]=(0,Q.useState)(``),[_,v]=(0,Q.useState)({}),[y,b]=(0,Q.useState)(!1),[x,S]=(0,Q.useState)(!1),[C,T]=(0,Q.useState)(null);(0,Q.useEffect)(()=>(n?.(y||x),()=>n?.(!1)),[y,x,n]);let[E,D]=(0,Q.useState)(),[O,k]=(0,Q.useState)(!1),[A,N]=(0,Q.useState)(!1),[ee,P]=(0,Q.useState)(),{data:F,isLoading:I,error:L,mutate:R}=X(o?d(`/api/image-generation/catalog`):null,Jt,{revalidateOnFocus:!1}),{data:z,isLoading:B,error:V,mutate:H}=X(o?d(`/api/image-generation/custom-providers`):null,Kt,{revalidateOnFocus:!1}),{data:U,isLoading:te,error:W,mutate:ne}=X(o?`default-image-generation`:null,cn,{revalidateOnFocus:!1});(0,Q.useEffect)(()=>{if(!F||!U)return;let e=ln(U.model?.primary),t=F.find(t=>t.id===e)??F.find(e=>e.configured)??F[0];t&&(c(t.id),u(t.id===e&&un(U.model?.primary)||t.defaultModel),g(t.configured?on:``),v(dn(t)))},[U,F]);let G=F?.find(e=>e.id===s),re=G?G.apiKeyUrl??q(G.id,r)[0]?.href:void 0,ie=(0,Q.useMemo)(()=>[...G?.models??[]].sort(tt).map(e=>({value:e,label:e})),[G?.models]),K=U?.model?.primary,ae=!!(G&&l&&(G.credentialMode!==`api-key`||G.configured||h.trim())&&G.configFields.every(e=>!e.required||_[e.key]?.trim()));if(!o)return(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:a.connect});if(I||B||te)return(0,$.jsx)(mn,{});if(L||V||W||!F||!z)return(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:a.loadError});let oe=e=>{c(e.id),u(e.defaultModel),g(e.configured?on:``),v(dn(e)),D(void 0)},se=()=>{P(void 0),N(!0)},ce=()=>{let e=z.find(e=>e.providerId===G?.id);e&&(P(e),N(!0))},le=async n=>{let[r,i]=await Promise.all([H(),R()]);if(n&&i?.some(e=>e.id===n)){let a=i.find(e=>e.id===n);c(a.id),u(a.defaultModel),g(a.configured?on:``),v(dn(a)),P(r?.find(e=>e.providerId===n)),e&&a.configured&&t?.()}},ue=async()=>{if(!(!G||!ae)){b(!0),D(void 0),k(!1);try{if(e){h.trim()&&!Ge(h)&&await Wt(G.id,h.trim()),Object.keys(_).length&&await m(d(`/api/config`),{method:`PATCH`,body:JSON.stringify({providersConfig:{[G.id]:_}})});let[e]=await Promise.all([R(),je()]);if(!e?.find(e=>e.id===G.id)?.configured)throw Error(r===`zh`?`连接尚未就绪,请先完成对应服务的授权或凭据设置。`:`Connection is not ready. Complete authorization or credentials first.`);k(!0),t?.();return}let n=await m(d(`/api/image-generation/default/setup`),{method:`POST`,body:JSON.stringify({providerId:G.id,modelId:l,...h.trim()&&!Ge(h)?{apiKey:h.trim()}:{},providerConfig:Object.fromEntries(Object.entries(_).filter(([,e])=>e.trim()))})});if(!n.payload)throw Error(`Invalid setup response`);await Promise.all([ne(n.payload.default,{revalidate:!1}),R(n.payload.providers,{revalidate:!1}),i(async()=>{let{mutate:e}=await import(`./vendor-swr-CdRzEUwF.js`).then(e=>e.r);return{mutate:e}},__vite__mapDeps([0,1,2])).then(({mutate:e})=>Promise.all([e(`settings-agent-defaults`),e(`settings-gateway-agents`)])),je()]),g(on),k(!0)}catch(e){D(e instanceof Error?e.message:String(e))}finally{b(!1)}}};return(0,$.jsxs)(`div`,{ref:T,className:`flex flex-col gap-4`,children:[(0,$.jsx)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsx)(`div`,{className:`rounded-lg bg-accent/10 p-2 text-accent`,children:(0,$.jsx)(me,{className:`size-5`})}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:a.title}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg-muted`,children:e?r===`zh`?`连接图片来源,不修改默认模型,也不发送生成测试请求。`:`Connect image sources without changing defaults or sending generation tests.`:a.intro})]})]})}),(0,$.jsxs)(`section`,{children:[(0,$.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,$.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-fg-subtle`,children:a.provider}),(0,$.jsxs)(Z,{variant:`secondary`,className:`px-2.5 py-1.5 text-xs`,onClick:se,children:[(0,$.jsx)(ye,{className:`size-4`}),a.addService]})]}),(0,$.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 xl:grid-cols-3`,children:F.map(e=>{let t=e.id===s,n=e.id===ln(K);return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>oe(e),className:`min-h-24 rounded-xl p-4 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${t?`bg-accent-soft shadow-surface`:`bg-surface-base/55 hover:bg-surface-hover`}`,children:[(0,$.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`truncate font-medium text-fg`,children:e.label}),e.source===`custom`?(0,$.jsx)(`span`,{className:`rounded-full bg-surface-inset px-2 py-0.5 text-[10px] text-fg-subtle`,children:a.custom}):null]}),(0,$.jsx)(`span`,{"aria-hidden":!n,className:`shrink-0 rounded-full bg-accent/10 px-2 py-0.5 text-[11px] font-medium text-accent ${n?``:`invisible`}`,children:a.current})]}),(0,$.jsxs)(`span`,{className:`mt-2 flex items-center gap-1.5 text-xs ${e.configured?`text-emerald-600 dark:text-emerald-400`:`text-fg-muted`}`,children:[e.configured||e.credentialMode!==`api-key`?(0,$.jsx)(M,{className:`size-3.5`}):(0,$.jsx)(he,{className:`size-3.5`}),e.configured||e.credentialMode!==`api-key`?a.configured:a.needsKey]})]},e.id)})})]}),G?(0,$.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,$.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[e?null:(0,$.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[a.model,(0,$.jsx)(j,{value:l,options:ie,placeholder:a.selectModel,allowEmpty:!1,onChange:u,triggerClassName:`mt-1.5`})]}),G.configFields.filter(e=>e.required).map(e=>(0,$.jsx)(fn,{field:e,value:_[e.key]??``,onChange:t=>v(n=>({...n,[e.key]:t}))},e.key))]}),G.source===`custom`?(0,$.jsx)(`div`,{className:`mt-4 flex justify-end`,children:(0,$.jsxs)(Z,{variant:`secondary`,onClick:ce,children:[(0,$.jsx)(xe,{className:`size-4`}),a.manageService]})}):null,G.credentialMode===`api-key`?(0,$.jsxs)(`div`,{className:`mt-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsx)(`label`,{htmlFor:`image-generation-api-key`,className:`text-xs font-medium text-fg-muted`,children:a.apiKey}),re?(0,$.jsxs)(`a`,{href:re,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-xs font-medium text-accent hover:underline`,children:[a.getApiKey,(0,$.jsx)(w,{className:`size-3.5`,"aria-hidden":`true`})]}):null]}),(0,$.jsx)(fe,{id:`image-generation-api-key`,value:h,onChange:e=>g(Ge(h)?e.replace(/^•+/,``):e),placeholder:G.configured?a.existingKey:a.needsKey,labels:{show:a.show,hide:a.hide,copy:a.copy,copied:a.copied},reveal:()=>yt(G.id).then(e=>e.apiKey),loadFailedLabel:a.revealFailed,notInConfigFile:a.keyNotRevealable,className:`mt-1.5`,autoComplete:`new-password`},G.id),(0,$.jsx)(`span`,{className:`mt-1.5 block font-normal leading-relaxed text-fg-subtle`,children:G.configured?a.savedKey:a.apiKeyHint})]}):null,G.configFields.some(e=>!e.required)?(0,$.jsxs)(`details`,{className:`mt-4 rounded-lg bg-surface-base/55 px-3 py-2.5`,children:[(0,$.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-2 text-sm font-medium text-fg-muted`,children:[(0,$.jsx)(Ce,{className:`size-4`}),a.advanced]}),(0,$.jsx)(`div`,{className:`mt-3 grid gap-3 md:grid-cols-2`,children:G.configFields.filter(e=>!e.required).map(e=>(0,$.jsx)(fn,{field:e,value:_[e.key]??``,onChange:t=>v(n=>({...n,[e.key]:t}))},e.key))})]}):null,O?(0,$.jsx)(`p`,{className:`mt-4 rounded-lg bg-emerald-500/10 px-3 py-2 text-sm text-emerald-700 dark:text-emerald-300`,role:`status`,children:e?r===`zh`?`连接已保存`:`Connection saved`:a.enabled}):null,E?(0,$.jsx)(`p`,{className:`mt-4 rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-600 dark:text-red-400`,children:E}):null,(0,$.jsx)(`div`,{className:`mt-4 flex justify-end`,children:(0,$.jsxs)(Z,{variant:`primary`,disabled:!ae||y,onClick:()=>void ue(),children:[y?(0,$.jsx)(ge,{className:`size-4 animate-spin`}):(0,$.jsx)(M,{className:`size-4`}),(0,$.jsxs)(`span`,{className:`grid`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1`,children:a.enable}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1`,children:a.enabling}),(0,$.jsx)(`span`,{className:`col-start-1 row-start-1`,children:e?y?r===`zh`?`保存中…`:`Saving…`:r===`zh`?`保存图片连接`:`Save image connection`:y?a.enabling:a.enable})]})]})})]}):null,(0,$.jsx)(an,{portalContainer:C?.closest(`[role="dialog"]`),onPendingChange:S,open:A,onOpenChange:N,provider:ee,configured:!!(ee&&F.find(e=>e.id===ee.providerId)?.configured),language:r,onSaved:le})]})}function _n(e){return e.some(e=>e.disabled?!1:e.type===`searxng`?e.url.trim().length>0:e.apiKey.trim().length>0)}function vn(e){let t=e&&typeof e==`object`&&`tools`in e?e.tools:void 0,n=t&&typeof t==`object`&&`web`in t?t.web:void 0,r=n&&typeof n==`object`&&`region`in n?n.region:void 0,i=r===`cn`||r===`global`?r:`auto`,a=n&&typeof n==`object`&&`search`in n?n.search:void 0,o=a&&typeof a==`object`?a:{},s=typeof o.maxResults==`number`&&Number.isFinite(o.maxResults)?Math.floor(o.maxResults):5,c=n&&typeof n==`object`&&`blocklist`in n?n.blocklist:void 0,l=c&&typeof c==`object`?c:{},u=Array.isArray(l.domains)?l.domains.filter(e=>typeof e==`string`&&e.trim().length>0):[],d=o.providers;return{regionMode:i,maxResults:s,providers:Array.isArray(d)?d.map((e,t)=>{let n=e&&typeof e==`object`?e:{},r=n.type,i=r===`brave`||r===`tavily`||r===`bing`||r===`searxng`||r===`deepseek`?r:`brave`;return{clientKey:`search-provider-${t}`,type:i,apiKey:typeof n.apiKey==`string`?n.apiKey:``,url:typeof n.url==`string`?n.url:``,disabled:n.disabled===!0}}):[],blocklistEnabled:l.enabled===!0,blocklistDomains:u}}async function yn(e){let t=e.regionMode===`auto`?`auto`:e.regionMode===`cn`?`cn`:`global`,n={maxResults:e.maxResults,providers:e.providers.map(e=>{let t={type:e.type,apiKey:e.apiKey};return(e.type===`searxng`||e.type===`deepseek`)&&e.url.trim()&&(t.url=e.url.trim().replace(/\/+$/,``)),e.disabled&&(t.disabled=!0),t})};await m(d(`/api/config`),{method:`PATCH`,body:JSON.stringify({tools:{web:{region:t,search:n,blocklist:{enabled:e.blocklistEnabled,domains:e.blocklistDomains}}}})}),je()}async function bn(e){let t=await m(d(`/api/tools/web/reveal-search-api-key`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({index:e})});if(!t.ok||!t.payload)throw Error(t.error?.message??`Reveal failed`);return t.payload}function xn(e){let t=(0,$t.c)(8),{label:n,description:r,children:i}=e,a;t[0]===n?a=t[1]:(a=(0,$.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,$.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-subtle`,children:r}),t[2]=r,t[3]=o);let s;return t[4]!==i||t[5]!==a||t[6]!==o?(s=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[a,i,o]}),t[4]=i,t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function Sn(){return J(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,`placeholder:text-fg-subtle`,We,`dark:border-edge`)}function Cn(){return J(Ue,He)}var wn=[`brave`,`tavily`,`bing`,`searxng`,`deepseek`];function Tn(){return{clientKey:crypto.randomUUID(),type:`brave`,apiKey:``,url:``,disabled:!1}}var En=Ze();function Dn(){let e=h(p(e=>e.language)),t=e.webSearchSettings,n=e.logs,r=!!f(e=>e.conversationId),[i,a]=(0,Q.useReducer)(En,{form:null,baseline:null}),o=i.form,s=i.baseline,c=(0,Q.useRef)(!1),l=(0,Q.useRef)(o);l.current=o;let u=(0,Q.useRef)(null),{data:d,error:m,isLoading:g,mutate:_}=Me(r);Xe({enabled:r,parsed:(0,Q.useMemo)(()=>d?.payload?.config===void 0?null:vn(d.payload.config),[d]),dirty:c.current,trackedParsedRef:u,dispatch:a,onResetDirty:()=>{c.current=!1}});let v=!!(r&&g&&d===void 0&&!m),y=m instanceof Error?m.message:m?String(m):null,b=(0,Q.useMemo)(()=>!o||!s?!1:JSON.stringify(o)!==JSON.stringify(s),[o,s]),x=(0,Q.useCallback)(e=>{c.current=!0,a({type:`patch`,patch:e})},[]),S=Lt({value:o,dirty:b,onSave:(0,Q.useCallback)(async e=>{try{await yn(e),a({type:`saved`,value:e}),c.current=!!(l.current&&JSON.stringify(l.current)!==JSON.stringify(e))}catch(e){throw Error(e instanceof Error?e.message:t.saveError)}},[t.saveError])});if(!r)return(0,$.jsx)(`div`,{className:`flex flex-col gap-3`,children:(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.needToken})});if(v)return(0,$.jsx)(st,{rows:3});if(!o)return(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:y??t.loadError}),(0,$.jsx)(Z,{type:`button`,variant:`secondary`,onClick:()=>void _(),children:n.refresh})]});let C=_n(o.providers);return(0,$.jsxs)(`div`,{className:`flex flex-col gap-5`,onBlurCapture:S.onBlurCapture,children:[S.error?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:S.error}):null,(0,$.jsxs)(Ft,{children:[(0,$.jsx)(Pt,{icon:ve,title:t.sectionSearch,subtitle:t.sectionSearchHint,trailing:(0,$.jsx)(It,{status:S.status,error:S.error})}),(0,$.jsxs)(`div`,{className:`flex max-w-2xl flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3 rounded-lg border border-edge bg-surface-base/55 px-4 py-3`,children:[(0,$.jsx)(ue,{className:`mt-0.5 size-5 shrink-0 text-accent`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:t.cloudProvider}),(0,$.jsx)(`span`,{className:J(`rounded-full px-2 py-0.5 text-[11px] font-medium`,C?`bg-surface-panel text-fg-muted`:`bg-accent-soft text-accent`),children:C?t.cloudOverridden:t.cloudAutomatic})]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-subtle`,children:C?t.cloudOverriddenHint:t.cloudAutomaticHint})]})]}),(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:t.providersTitle}),o.providers.map((n,r)=>(0,$.jsx)(On,{row:n,providerIndex:r,labels:t,secretLabels:Ke(e.providersSettings),onChange:e=>{let t=[...o.providers];t[r]=e,x({providers:t})},onRemove:()=>{x({providers:o.providers.filter((e,t)=>t!==r)})}},n.clientKey??r)),(0,$.jsxs)(Z,{type:`button`,variant:`secondary`,className:`w-fit gap-1.5 text-sm`,onClick:()=>x({providers:[...o.providers,Tn()]}),children:[(0,$.jsx)(ye,{className:`size-4`}),t.addProvider]})]})]}),(0,$.jsxs)(Ft,{children:[(0,$.jsx)(Pt,{icon:Ce,title:t.sectionPreferences}),(0,$.jsxs)(`div`,{className:`grid max-w-2xl gap-4 sm:grid-cols-2`,children:[(0,$.jsx)(xn,{label:t.regionLabel,description:t.regionDesc,children:(0,$.jsxs)(k,{className:Cn(),value:o.regionMode,onChange:e=>x({regionMode:e.target.value}),children:[(0,$.jsx)(A,{value:`auto`,children:t.regionAuto}),(0,$.jsx)(A,{value:`cn`,children:t.regionCn}),(0,$.jsx)(A,{value:`global`,children:t.regionGlobal})]})}),(0,$.jsx)(Dt,{title:t.maxResultsLabel,summary:o.maxResults,children:(0,$.jsx)(xn,{label:t.maxResultsLabel,description:t.maxResultsDesc,children:(0,$.jsx)(jt,{type:`number`,min:1,max:50,className:Sn(),value:o.maxResults,onChange:e=>x({maxResults:Math.max(1,Math.min(50,Number(e.target.value)||5))})})})})]})]}),(0,$.jsxs)(`details`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,$.jsxs)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:[t.sectionBlocklist,` · `,o.blocklistEnabled?o.blocklistDomains.length:0]}),(0,$.jsxs)(Ft,{children:[(0,$.jsx)(Pt,{icon:Se,title:t.sectionBlocklist,subtitle:t.sectionBlocklistHint}),(0,$.jsxs)(`div`,{className:`flex max-w-2xl flex-col gap-4`,children:[(0,$.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,$.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,checked:o.blocklistEnabled,onChange:e=>x({blocklistEnabled:e.target.checked})}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:t.blocklistEnabled}),(0,$.jsx)(`span`,{className:`mt-0.5 block text-xs text-fg-subtle`,children:t.blocklistEnabledDesc})]})]}),o.blocklistEnabled?(0,$.jsx)(xn,{label:t.blocklistDomains,description:t.blocklistDomainsDesc,children:(0,$.jsx)(`textarea`,{className:J(Sn(),`min-h-[6rem] font-mono text-xs`),value:o.blocklistDomains.join(`
|
|
8
|
-
`),placeholder:t.blocklistDomainsPlaceholder,onChange:e=>{let t=e.target.value.split(/\r?\n/).flatMap(e=>{let t=e.trim().toLowerCase();return t?[t]:[]});x({blocklistDomains:t})}})}):null]})]})]})]})}function On(e){let t=(0,$t.c)(56),{row:n,providerIndex:r,labels:i,secretLabels:a,onChange:o,onRemove:s}=e,c;t[0]===r?c=t[1]:(c=()=>bn(r).then(kn),t[0]=r,t[1]=c);let l=c,u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=J(Cn(),`min-w-[8rem]`),t[2]=u):u=t[2];let d=n.type,f;t[3]!==o||t[4]!==n?(f=e=>o({...n,type:e.target.value,url:``,apiKey:``}),t[3]=o,t[4]=n,t[5]=f):f=t[5];let p;t[6]===i.providerTypes?p=t[7]:(p=wn.map(e=>(0,$.jsx)(A,{value:e,children:i.providerTypes[e]},e)),t[6]=i.providerTypes,t[7]=p);let m;t[8]!==n.type||t[9]!==f||t[10]!==p?(m=(0,$.jsx)(k,{className:u,value:d,onChange:f,children:p}),t[8]=n.type,t[9]=f,t[10]=p,t[11]=m):m=t[11];let h;t[12]!==o||t[13]!==n?(h=e=>o({...n,disabled:e.target.checked}),t[12]=o,t[13]=n,t[14]=h):h=t[14];let g;t[15]!==n.disabled||t[16]!==h?(g=(0,$.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:n.disabled,onChange:h}),t[15]=n.disabled,t[16]=h,t[17]=g):g=t[17];let _;t[18]!==i.disabled||t[19]!==g?(_=(0,$.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5 text-xs text-fg-muted`,children:[g,i.disabled]}),t[18]=i.disabled,t[19]=g,t[20]=_):_=t[20];let v;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(we,{className:`size-4`}),t[21]=v):v=t[21];let y;t[22]===s?y=t[23]:(y=(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-fg-muted`,onClick:s,children:v}),t[22]=s,t[23]=y);let b;t[24]!==y||t[25]!==_?(b=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[_,y]}),t[24]=y,t[25]=_,t[26]=b):b=t[26];let x;t[27]!==b||t[28]!==m?(x=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[m,b]}),t[27]=b,t[28]=m,t[29]=x):x=t[29];let S;t[30]!==i.deepseekUrlDesc||t[31]!==i.deepseekUrlLabel||t[32]!==i.urlDesc||t[33]!==i.urlLabel||t[34]!==o||t[35]!==n?(S=n.type===`searxng`||n.type===`deepseek`?(0,$.jsx)(xn,{label:n.type===`deepseek`?i.deepseekUrlLabel:i.urlLabel,description:n.type===`deepseek`?i.deepseekUrlDesc:i.urlDesc,children:(0,$.jsx)(`input`,{type:`url`,className:Sn(),value:n.url,placeholder:n.type===`deepseek`?`https://api.deepseek.com`:`http://localhost:8080`,onChange:e=>o({...n,url:e.target.value})})}):null,t[30]=i.deepseekUrlDesc,t[31]=i.deepseekUrlLabel,t[32]=i.urlDesc,t[33]=i.urlLabel,t[34]=o,t[35]=n,t[36]=S):S=t[36];let C;t[37]!==o||t[38]!==n?(C=e=>o({...n,apiKey:e}),t[37]=o,t[38]=n,t[39]=C):C=t[39];let w;t[40]!==i.keyPlaceholder||t[41]!==i.keyPlaceholderMasked||t[42]!==i.saveError||t[43]!==l||t[44]!==n.apiKey||t[45]!==a||t[46]!==C?(w=(0,$.jsx)(fe,{value:n.apiKey,onChange:C,placeholder:i.keyPlaceholder,labels:a,reveal:l,loadFailedLabel:i.saveError,notInConfigFile:i.keyPlaceholderMasked}),t[40]=i.keyPlaceholder,t[41]=i.keyPlaceholderMasked,t[42]=i.saveError,t[43]=l,t[44]=n.apiKey,t[45]=a,t[46]=C,t[47]=w):w=t[47];let T;t[48]!==i.apiKeyDesc||t[49]!==i.apiKeyLabel||t[50]!==w?(T=(0,$.jsx)(xn,{label:i.apiKeyLabel,description:i.apiKeyDesc,children:w}),t[48]=i.apiKeyDesc,t[49]=i.apiKeyLabel,t[50]=w,t[51]=T):T=t[51];let E;return t[52]!==x||t[53]!==S||t[54]!==T?(E=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-xl bg-surface-panel/60 p-4`,children:[x,S,T]}),t[52]=x,t[53]=S,t[54]=T,t[55]=E):E=t[55],E}function kn(e){return e.apiKey??null}function An(e,t,n=[]){return e.filter(e=>!n.includes(e.providerId)&&e.uses.some(e=>e.id===t&&e.choices.length>0))}function jn(e){let t=(0,$t.c)(75),{use:n,data:r,language:i,labels:a,onSaved:o,inline:s,onPendingChange:c,onEditingChange:l}=e,u=s!==void 0&&s,d=i===`zh`,[f,p]=(0,Q.useState)(),[m,h]=(0,Q.useState)(!1),g;t[0]===c?g=t[1]:(g=e=>{h(e),c?.(e)},t[0]=c,t[1]=g);let _=g,v=n===`transcription`?`stt`:n===`speech`?`tts`:void 0,y,b,x;if(t[2]!==r.builtinRows||t[3]!==r.cards||t[4]!==r.customConfig?.providers||t[5]!==r.loading||t[6]!==n){let e=new Set(r.cards.filter(e=>!re(e.id)||!!r.customConfig?.providers?.[e.id]).map(Bn));y=[...new Set([...r.builtinRows.map(zn),...e])].filter(t=>!re(t)||e.has(t)).sort(),b=X,x=r.loading?null:[`capability-service-connections`,n,y.join(`,`)],t[2]=r.builtinRows,t[3]=r.cards,t[4]=r.customConfig?.providers,t[5]=r.loading,t[6]=n,t[7]=y,t[8]=b,t[9]=x}else y=t[7],b=t[8],x=t[9];let S;t[10]!==y||t[11]!==n||t[12]!==v?(S=async()=>{let e=v===`stt`?await Rt():v===`tts`?await Ht():void 0,t=e?.providers.filter(Rn).map(Ln),r=e?.providers.filter(In).map(Fn)??[],i=t?y.filter(e=>t.includes(e)):y,a=await Promise.allSettled(i.map(ee));return{services:An(a.flatMap(Pn),n,r),failed:a.some(Nn)}},t[10]=y,t[11]=n,t[12]=v,t[13]=S):S=t[13];let C;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(C={revalidateOnFocus:!1},t[14]=C):C=t[14];let{data:w,error:T,isLoading:E,mutate:D}=b(x,S,C),O;t[15]===w?.services?O=t[16]:(O=new Set(w?.services.map(Mn)),t[15]=w?.services,t[16]=O);let k=O,A,j;if(t[17]!==l||t[18]!==f?(A=()=>(l?.(!!f),()=>l?.(!1)),j=[f,l],t[17]=l,t[18]=f,t[19]=A,t[20]=j):(A=t[19],j=t[20]),(0,Q.useEffect)(A,j),f&&u){let e;if(t[21]!==r.builtinRows||t[22]!==f){let n;t[24]===f?n=t[25]:(n=e=>e.id===f,t[24]=f,t[25]=n),e=r.builtinRows.find(n),t[21]=r.builtinRows,t[22]=f,t[23]=e}else e=t[23];let a;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>p(void 0),t[26]=a):a=t[26];let s;t[27]!==D||t[28]!==o?(s=()=>{D(),p(void 0),o()},t[27]=D,t[28]=o,t[29]=s):s=t[29];let c;return t[30]!==i||t[31]!==f||t[32]!==_||t[33]!==e||t[34]!==s||t[35]!==n?(c=(0,$.jsx)(`section`,{className:`overflow-hidden rounded-xl border border-edge`,children:(0,$.jsx)(I,{inline:!0,providerId:f,row:e,targetUse:n,language:i,onPendingChange:_,onDone:a,onApplied:s},f)}),t[30]=i,t[31]=f,t[32]=_,t[33]=e,t[34]=s,t[35]=n,t[36]=c):c=t[36],c}let M=d?`选择服务`:`Choose a service`,N;t[37]===M?N=t[38]:(N=(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:M}),t[37]=M,t[38]=N);let P;t[39]!==r.loading||t[40]!==E?(P=r.loading||E?(0,$.jsx)(Y,{className:`h-24 w-full`}):null,t[39]=r.loading,t[40]=E,t[41]=P):P=t[41];let F;t[42]!==w?.failed||t[43]!==T||t[44]!==D||t[45]!==d?(F=T||w?.failed?(0,$.jsxs)(`p`,{role:`alert`,className:`text-sm text-fg-muted`,children:[d?`部分服务目录暂时不可用。`:`Some service catalogs are unavailable.`,(0,$.jsx)(Z,{variant:`ghost`,onClick:()=>void D(),children:d?`重试`:`Retry`})]}):null,t[42]=w?.failed,t[43]=T,t[44]=D,t[45]=d,t[46]=F):F=t[46];let L;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(L=[!0,!1],t[47]=L):L=t[47];let R;t[48]!==m||t[49]!==w?.services||t[50]!==d?(R=L.map(e=>{let t=w?.services.filter(t=>t.configured===e)??[];return t.length?(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:e?d?`已连接`:`Connected`:d?`添加服务`:`Add a service`}),t.map(t=>(0,$.jsxs)(`button`,{type:`button`,disabled:m,onClick:()=>p(t.providerId),className:`flex min-h-14 w-full items-center justify-between gap-3 rounded-lg px-3 py-3 text-left transition-colors hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-50`,children:[(0,$.jsx)(`span`,{className:`min-w-0 text-sm font-medium text-fg`,children:te(t.providerId,t.profile.name,d)}),(0,$.jsx)(`span`,{className:`shrink-0 text-sm text-accent-fg`,children:e?d?`选择`:`Choose`:d?`连接`:`Connect`})]},t.providerId))]},String(e)):null}),t[48]=m,t[49]=w?.services,t[50]=d,t[51]=R):R=t[51];let z;t[52]!==w||t[53]!==d?(z=w&&!w.services.length&&!w.failed?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:d?`暂无支持此能力的模型服务。`:`No model services currently support this capability.`}):null,t[52]=w,t[53]=d,t[54]=z):z=t[54];let B=d?`仅列出支持${lt[n][0]}的服务。`:`Only compatible services are shown. Reuse saved credentials, then return to select a model.`,V;t[55]===B?V=t[56]:(V=(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:B}),t[55]=B,t[56]=V);let H;t[57]!==r.builtinRows||t[58]!==r.customConfig||t[59]!==k||t[60]!==a||t[61]!==i||t[62]!==D||t[63]!==o||t[64]!==f||t[65]!==n?(H=f?(0,$.jsx)(ie,{open:!0,initialProviderId:f,initialUse:n,connectOnly:!0,onOpenChange:e=>{e||p(void 0)},builtinRows:r.builtinRows.filter(e=>k.has(e.id)),customConfig:r.customConfig,labels:a,language:i,onSaved:()=>{D(),p(void 0),o()}},f):null,t[57]=r.builtinRows,t[58]=r.customConfig,t[59]=k,t[60]=a,t[61]=i,t[62]=D,t[63]=o,t[64]=f,t[65]=n,t[66]=H):H=t[66];let U;return t[67]!==N||t[68]!==P||t[69]!==F||t[70]!==R||t[71]!==z||t[72]!==V||t[73]!==H?(U=(0,$.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-edge p-4`,children:[N,P,F,R,z,V,H]}),t[67]=N,t[68]=P,t[69]=F,t[70]=R,t[71]=z,t[72]=V,t[73]=H,t[74]=U):U=t[74],U}function Mn(e){return e.providerId}function Nn(e){return e.status===`rejected`}function Pn(e){return e.status===`fulfilled`?[e.value]:[]}function Fn(e){return e.id}function In(e){return e.diagnostics.requiresApiKey}function Ln(e){return e.id}function Rn(e){return!e.diagnostics.requiresApiKey}function zn(e){return e.id}function Bn(e){return e.id}function Vn({zh:e,kind:t,modelServiceIds:n,onSaved:r,onPendingChange:i}){let{data:a,error:o,mutate:s}=X([`native-voice-connections`,t??`all`,n.join(`,`)],async()=>{let[e,r]=await Promise.all([t===`tts`?Promise.resolve({providers:[]}):Rt(),t===`stt`?Promise.resolve({providers:[]}):Ht()]);return[...e.providers.map(e=>({...e,kind:`stt`})),...r.providers.map(e=>({...e,kind:`tts`}))].filter(e=>e.diagnostics.requiresApiKey||!n.includes(e.id))}),[c,l]=(0,Q.useState)(``),[u,f]=(0,Q.useState)({}),[p,h]=(0,Q.useState)(!1),g=(0,Q.useRef)(!1),[_,v]=(0,Q.useState)(``);(0,Q.useEffect)(()=>(i?.(p),()=>i?.(!1)),[p,i]);let y=a?.find(e=>`${e.kind}:${e.id}`===c),b=y?.fields.filter(e=>e.secret||e.type===`password`||[`baseUrl`,`region`,`groupId`].includes(e.key))??[],x=async()=>{if(!(!y||g.current)){g.current=!0,h(!0),v(``);try{let t=Object.fromEntries(Object.entries(u).filter(([,e])=>e.trim()).map(([e,t])=>[e,t.trim()]));Object.keys(t).length&&await m(d(`/api/config`),{method:`PATCH`,body:JSON.stringify({[y.kind]:{providers:{[y.id]:t}}})});let[n]=await Promise.all([s(),pt()]);if(!n?.find(e=>e.kind===y.kind&&e.id===y.id)?.configured)throw Error(e?`连接尚未就绪,请补齐所需凭据。`:`Connection is not ready. Complete the required credentials.`);f({}),r()}catch(e){v(e instanceof Error?e.message:String(e))}finally{g.current=!1,h(!1)}}};return a&&!a.length?null:(0,$.jsxs)(`details`,{className:`rounded-xl border border-edge p-4`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:e?`其他语音服务与本地语音`:`Other voice services and local speech`}),(0,$.jsxs)(`section`,{className:`mt-4 space-y-4`,children:[(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:t===`stt`?e?`其他识别服务`:`Other recognition services`:t===`tts`?e?`其他合成服务与本地语音`:`Other synthesis services and local speech`:e?`语音 API 与本地语音`:`Voice APIs and local speech`}),!a&&!o?(0,$.jsx)(Y,{className:`h-20 w-full`}):null,o?(0,$.jsxs)(`p`,{role:`alert`,children:[e?`语音服务加载失败`:`Could not load voice services`,(0,$.jsx)(Z,{variant:`ghost`,onClick:()=>void s(),children:e?`重试`:`Retry`})]}):null,(0,$.jsxs)(k,{value:c,disabled:p,"aria-label":e?`语音服务接入`:`Connect voice service`,onChange:e=>{l(e.target.value),f({}),v(``)},children:[(0,$.jsx)(A,{value:``,children:e?`选择语音来源`:`Choose a voice source`}),a?.map(n=>(0,$.jsxs)(A,{value:`${n.kind}:${n.id}`,children:[n.displayName,t?``:` · ${n.kind.toUpperCase()}`,n.configured?e?` · 已连接`:` · Connected`:``]},`${n.kind}:${n.id}`))]}),y?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:y.diagnostics.requiresApiKey?e?`此服务使用独立的 API Key。保存连接后,可在“模型与参数”中选用。`:`This service uses its own API key. Save the connection, then choose it in Model and parameters.`:e?`此来源无需 API Key,可返回能力设置选择。`:`No API key needed. Choose this source in capability settings.`}),b.map(t=>(0,$.jsxs)(`label`,{className:`block space-y-1 text-sm text-fg`,children:[(0,$.jsx)(`span`,{children:t.label}),t.secret||t.type===`password`?(0,$.jsx)(fe,{labels:qe,value:u[t.key]??``,onChange:e=>f(n=>({...n,[t.key]:e})),disabled:p}):t.options?.length?(0,$.jsxs)(k,{value:u[t.key]??``,disabled:p,onChange:e=>f(n=>({...n,[t.key]:e.target.value})),children:[(0,$.jsx)(A,{value:``,children:e?`保留现有值`:`Keep existing`}),(t.key===`model`?[...t.options].sort(et):t.options).map(e=>(0,$.jsx)(A,{value:e.id,children:e.name},e.id))]}):(0,$.jsx)(`input`,{className:`w-full rounded-lg border border-edge bg-surface-panel p-2`,value:u[t.key]??``,disabled:p,placeholder:t.placeholder,onChange:e=>f(n=>({...n,[t.key]:e.target.value}))})]},t.key)),_?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:_}):null,(0,$.jsx)(Z,{disabled:p||!y.configured&&y.diagnostics.requiresApiKey&&!Object.values(u).some(e=>e.trim()),onClick:()=>void x(),children:p?e?`保存中…`:`Saving…`:e?`保存连接`:`Save connection`})]}):null]})]})}function Hn(e){let t=(0,$t.c)(8),{section:n,title:r,children:i}=e,a;t[0]===r?a=t[1]:(a=(0,$.jsx)(`h3`,{className:`bg-surface-panel px-4 py-1.5 text-xs font-medium text-fg-muted`,children:r}),t[0]=r,t[1]=a);let o;t[2]===i?o=t[3]:(o=(0,$.jsx)(`div`,{className:`divide-y divide-edge-subtle px-4`,children:i}),t[2]=i,t[3]=o);let s;return t[4]!==n||t[5]!==a||t[6]!==o?(s=(0,$.jsxs)(`section`,{"data-model-section":n,className:`min-w-0 border-t border-edge first:border-t-0`,children:[a,o]}),t[4]=n,t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function Un(e){let t=(0,$t.c)(10),{name:n,manageLabel:r,onManage:i,disabled:a}=e;if(!i){let e;return t[0]===n?e=t[1]:(e=n?(0,$.jsx)(`p`,{className:`px-1 text-xs text-fg-muted`,children:n}):null,t[0]=n,t[1]=e),e}let o=n?`${r} · ${n}`:r,s=n||r,c;t[2]===s?c=t[3]:(c=(0,$.jsx)(`span`,{className:`truncate`,children:s}),t[2]=s,t[3]=c);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(O,{className:`size-3 shrink-0`,"aria-hidden":!0}),t[4]=l):l=t[4];let u;return t[5]!==a||t[6]!==i||t[7]!==o||t[8]!==c?(u=(0,$.jsxs)(Z,{variant:`ghost`,disabled:a,"aria-label":o,className:`min-h-8 max-w-full justify-start gap-1 rounded-md px-1 py-1 text-xs font-normal`,onClick:i,children:[c,l]}),t[5]=a,t[6]=i,t[7]=o,t[8]=c,t[9]=u):u=t[9],u}function Wn(e){let t=(0,$t.c)(13),{description:n,picker:r,actions:i,inline:a,actionColumn:o}=e;if(a){let e;return t[0]===r?e=t[1]:(e=(0,$.jsx)(`div`,{className:`min-w-0 space-y-1 py-2`,children:r}),t[0]=r,t[1]=e),e}let s=`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 gap-y-1 py-2.5 @min-[40rem]:gap-x-4 ${o?`@min-[40rem]:grid-cols-[minmax(0,1fr)_minmax(0,1.35fr)_4.5rem]`:`@min-[40rem]:grid-cols-[minmax(0,1fr)_minmax(0,1.35fr)]`}`,c;t[2]===n?c=t[3]:(c=(0,$.jsx)(`div`,{className:`col-start-1 row-start-1 min-w-0`,children:n}),t[2]=n,t[3]=c);let l;t[4]===r?l=t[5]:(l=(0,$.jsx)(`div`,{className:`col-span-2 row-start-2 w-full min-w-0 @min-[40rem]:col-span-1 @min-[40rem]:col-start-2 @min-[40rem]:row-start-1`,children:r}),t[4]=r,t[5]=l);let u;t[6]===i?u=t[7]:(u=i&&(0,$.jsx)(`div`,{className:`col-start-2 row-start-1 flex justify-end @min-[40rem]:col-start-3`,children:i}),t[6]=i,t[7]=u);let d;return t[8]!==s||t[9]!==c||t[10]!==l||t[11]!==u?(d=(0,$.jsxs)(`div`,{className:s,children:[c,l,u]}),t[8]=s,t[9]=c,t[10]=l,t[11]=u,t[12]=d):d=t[12],d}var Gn=`clear-natural-model`;function Kn({label:e,value:t,currentLabel:n,options:r,loading:i,disabled:a,zh:o,onConnect:s,onManage:c,onSelect:l}){let[u,d]=(0,Q.useState)(``),f=u.trim().toLowerCase().split(/\s+/).filter(Boolean),p=[...r].sort((e,t)=>(e.group??``).localeCompare(t.group??``,`en`,{numeric:!0,sensitivity:`base`})||tt(e.label,t.label)||tt(e.value,t.value)).filter(e=>{let t=`${e.label} ${e.group} ${e.value} ${e.searchText??``}`.toLowerCase();return f.every(e=>t.includes(e))}),m=r.find(e=>e.value===t),h=m?.group??r.find(e=>e.value.split(`/`)[0]===t?.split(`/`)[0])?.group,g=m?.label??(t?.endsWith(`/default`)?o?`默认模型`:`Default model`:n??t),_=h?`${g} · ${h}`:g;return!i&&!r.length?(0,$.jsx)(Z,{variant:`secondary`,className:`min-h-11 w-full sm:justify-start`,"aria-label":`${o?`连接`:`Connect`} ${e}`,disabled:a,onClick:s,children:o?`连接服务以启用`:`Connect a service to enable`}):(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,$.jsx)(j,{value:t??``,options:p,selectedLabel:g,title:_,placeholder:o?`选择模型`:`Choose a model`,ariaLabel:`${o?`选择`:`Select`} ${e}`,allowEmpty:!1,disabled:a,loading:i,onChange:l,searchPlaceholder:o?`搜索模型或服务`:`Search models or services`,searchValue:u,onSearchChange:d,statusMessage:p.length?void 0:o?`没有可用模型`:`No available models`,triggerClassName:`min-h-11`}),(0,$.jsx)(Un,{name:h,manageLabel:o?`管理服务`:`Manage services`,onManage:c,disabled:a})]})}function qn({data:e,zh:t,onChange:n,onSettings:r,onlyUse:i,disabled:a=!1,onPendingChange:o,videoRow:s,musicRow:c}){let{data:l,error:u,mutate:f}=X(`settings-agent-defaults`,ot),{data:p}=Me(!0),{data:m,mutate:h}=X(!i||i===`conversation`?d(Ut):null,Vt),{data:g,isLoading:_,error:v,mutate:y}=X(`model-capability-media-sources`,async()=>{let e=await Promise.allSettled([Ht(),Rt(),Jt()]);return{ids:[...new Set(e.flatMap(e=>e.status===`fulfilled`?(Array.isArray(e.value)?e.value:e.value.providers).filter(e=>e.configured).map(e=>e.id):[]))],failed:e.some(e=>e.status===`rejected`)}}),b=[...new Set([...e.cards.filter(t=>t.configured&&(!re(t.id)||!!e.customConfig?.providers?.[t.id])).map(e=>e.id),...g?.ids??[]])].sort(),{data:x,isLoading:S,mutate:C}=X(e.loading?null:[`model-use-choices`,...b],async()=>{let e=await Promise.allSettled(b.map(ee));return{previews:e.flatMap(e=>e.status===`fulfilled`&&e.value.configured?[e.value]:[]),failed:e.some(e=>e.status===`rejected`)}},{revalidateOnFocus:!1}),[w,T]=(0,Q.useState)(null),[E,D]=(0,Q.useState)(null),O=(0,Q.useRef)(!1),k=(0,Q.useRef)(null);(0,Q.useEffect)(()=>()=>o?.(!1),[o]);let A=async(e,t)=>{if(O.current||a)return;let n=x?.previews.find(n=>n.uses.some(n=>n.id===e&&n.choices.some(e=>e.id===t))),r=e===`conversation`&&(t===`boson/higgs-realtime`||t===Gn);if(!n&&!r)return;O.current=!0,o?.(!0),T(e),D(null);let i={mode:`replace`,selected:[e],overrides:{[e]:t}};try{if(r)await h(await zt({defaultForNatural:t===Oe}),{revalidate:!1}),await je();else if(n){let t=await N(n.providerId,i);await le(n.providerId,i,t.revision),await Promise.all([f(),C(),...e===`conversation`?[h(),je()]:[]])}D({use:e})}catch(t){D({use:e,error:t instanceof Error?t.message:String(t)}),Promise.allSettled([f(),C()])}finally{O.current=!1,T(null),o?.(!1),requestAnimationFrame(()=>k.current?.querySelector(`[data-capability="${e}"] button[aria-label]`)?.focus())}},j=p?.payload?.config?Bt(p.payload.config):void 0;if(!l&&!u)return(0,$.jsx)(Y,{className:`h-48 w-full rounded-xl`});if(u)return(0,$.jsxs)(`div`,{role:`alert`,className:`text-sm text-danger`,children:[t?`模型用途加载失败`:`Could not load model uses`,(0,$.jsx)(Z,{variant:`ghost`,onClick:()=>void f(),children:t?`重试`:`Retry`})]});let M=l.defaults.models,P=j?.voice.realtime,F=P?.enabled&&P.omni?`${P.omni.provider}/${P.omni.model}`:void 0,I=m?.defaultForNatural??P?.boson?.defaultForNatural?Oe:F,L=M.background?.primary??M.chat.primary,z=e.builtinRows.find(e=>e.id===L.split(`/`)[0])?.setupProfile?.interactiveOnly!==!0,B=x?.previews[0]?.uses.find(e=>e.id===`background`),V=B?B.current:z?L:void 0,H=[{id:`chat`,label:t?`对话与任务`:`Chat and tasks`,ref:M.chat.primary},{id:`vision`,label:t?`看图`:`Image understanding`,ref:M.imageUnderstanding?.primary},{id:`image`,label:t?`画图`:`Image generation`,ref:M.imageGeneration?.primary},{id:`background`,label:t?`后台任务`:`Background tasks`,ref:V,inherited:!M.background&&!!V},{id:`transcription`,label:t?`录音与听写`:`Recording and dictation`,ref:j?.stt.enabled?`${j.stt.provider}/${j.stt.providers?.[j.stt.provider]?.model??`default`}`:void 0},{id:`speech`,label:t?`语音合成`:`Speech synthesis`,ref:j?.tts.enabled?`${j.tts.provider}/${j.tts.providers?.[j.tts.provider]?.model??`default`}`:void 0},{id:`conversation`,label:t?`自然语音模型`:`Natural voice model`,ref:I}];return(0,$.jsxs)(`section`,{ref:k,className:`@container min-w-0`,children:[(0,$.jsx)(`h2`,{className:i?`mb-2 text-sm font-semibold text-fg`:`sr-only`,children:i?t?`当前模型`:`Current model`:t?`能力总览`:`Capabilities`}),(0,$.jsx)(`div`,{className:i?`space-y-4`:`overflow-hidden rounded-2xl bg-surface-inset`,children:dt.filter(e=>!i||e.uses.includes(i)).map(o=>{let l=o.uses.filter(e=>!i||e===i).map(o=>{let s=H.find(e=>e.id===o),c=Jn(x?.previews??[],s.id,t);s.id===`conversation`&&((m?.credentialSource||s.ref===`boson/higgs-realtime`)&&c.push({value:Oe,label:`Higgs Realtime`,group:`Boson AI`,disabled:!m?.credentialSource}),s.ref===`boson/higgs-realtime`&&!c.some(e=>e.value!==`boson/higgs-realtime`)&&c.push({value:Gn,label:t?`取消默认模型`:`Clear default model`}));let l=s.ref?e.allModels.find(e=>e.id===s.ref):void 0,u=l?rt(l,t?`zh`:`en`):s.ref;return(0,$.jsx)(`div`,{"data-capability":s.id,children:(0,$.jsx)(Wn,{inline:!!i,actionColumn:!!r,description:(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:lt[s.id][+!t]}),(0,$.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:s.ref?c.some(e=>e.value===s.ref||s.ref?.endsWith(`/default`)&&e.value.split(`/`)[0]===s.ref.split(`/`)[0])?null:t?`待连接`:`Connection needed`:t?`未配置`:`Not set up`})]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:R[s.id][+!t]}),s.inherited?(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:t?`继承默认对话`:`Inherits chat default`}):null]}),picker:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Kn,{label:s.id===`conversation`?s.label:lt[s.id][+!t],value:s.ref,currentLabel:u,options:c,loading:e.loading||S||_,disabled:w!==null||a,zh:t,onConnect:()=>n(s.id),onManage:r?()=>n(s.id):void 0,onSelect:e=>{e!==s.ref&&A(s.id,e)}}),w===s.id?(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:t?`正在切换…`:`Switching…`}):null,E?.use===s.id?(0,$.jsx)(`div`,{role:E.error?`alert`:`status`,className:`text-xs text-fg-muted`,children:E.error?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`text-danger`,children:t?`未能切换模型,请重试。`:`Could not switch models. Please retry.`}),(0,$.jsxs)(`details`,{className:`mt-1`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer`,children:t?`查看详情`:`Show details`}),(0,$.jsx)(`p`,{className:`mt-1 break-words`,children:E.error})]})]}):t?`已切换`:`Model changed`}):null]}),actions:r&&(s.id===`conversation`||c.length>0||S||_)?(0,$.jsx)(Z,{variant:`ghost`,className:`min-h-11`,disabled:w!==null||a,onClick:()=>r(s.id),children:t?`设置`:`Settings`}):null})},s.id)});return i?(0,$.jsx)(`div`,{className:`min-w-0 divide-y divide-edge-subtle`,children:l},o.uses[0]):(0,$.jsxs)(Hn,{section:o.uses[0],title:o.label[+!t],children:[l,o.uses.includes(`vision`)&&s,o.uses.includes(`vision`)&&c]},o.uses[0])})}),(!r||i)&&(x?.failed||g?.failed||v)?(0,$.jsxs)(`p`,{role:`alert`,className:`mt-2 text-xs text-danger`,children:[t?`部分服务的模型加载失败`:`Some model services could not be loaded`,(0,$.jsx)(Z,{variant:`ghost`,onClick:()=>void Promise.all([y(),C()]),children:t?`重试`:`Retry`})]}):null,i||r?null:(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t?`快速与复杂任务模型随对话配置;音色、流式听写及电脑操作可在详细设置中调整。`:`Fast and complex task models follow chat setup. Voices, streaming dictation and Computer Use have detailed settings.`})]})}function Jn(e,t,n=!1){return e.flatMap(e=>e.uses.find(e=>e.id===t)?.choices.map(t=>({value:t.id,label:t.name,group:te(e.providerId,e.profile.name,n),searchText:e.profile.name}))??[])}var Yn={id:`services`,label:[`服务账户`,`Service accounts`]},Xn=[...dt.map(e=>({id:e.uses[0],label:e.label})),Yn];function Zn(e){let t=e.parentElement;for(;t&&!/^(auto|scroll|overlay)$/.test(getComputedStyle(t).overflowY);)t=t.parentElement;return t}function Qn(){return window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches?`instant`:`smooth`}function $n(e){let t=(0,$t.c)(37),{zh:n,children:r}=e,i=(0,Q.useRef)(null),a=(0,Q.useRef)(null),o=(0,Q.useRef)(null),s=(0,Q.useRef)(null),[c,l]=(0,Q.useState)(Xn[0].id),u,d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{let e=i.current,t=a.current;if(!e||!t)return;let n=Zn(e);if(!n)return;let r=0,o=()=>{if(r=0,s.current!==null){Math.abs(n.scrollTop-s.current)<=1&&(s.current=null);return}let i=[...e.querySelectorAll(`[data-model-section]`)],a=t.getBoundingClientRect().bottom+9,o=n.scrollHeight-n.clientHeight,c=(o>1&&n.scrollTop>=o-1?i.at(-1):i.findLast(e=>e.getBoundingClientRect().top<=a))??i[0];c?.dataset.modelSection&&l(c.dataset.modelSection)},c=()=>{r||=requestAnimationFrame(o)},u=()=>{s.current=null},d=()=>{s.current===null||Math.abs(n.scrollTop-s.current)<=1||(u(),c())},f=e=>{[`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `].includes(e.key)&&u()};n.addEventListener(`scroll`,c,{passive:!0}),n.addEventListener(`scrollend`,d),n.addEventListener(`wheel`,u,{passive:!0}),n.addEventListener(`touchstart`,u,{passive:!0}),n.addEventListener(`pointerdown`,u),n.addEventListener(`keydown`,f);let p=typeof ResizeObserver>`u`?null:new ResizeObserver(c);return p?.observe(e),p?.observe(n),c(),()=>{cancelAnimationFrame(r),p?.disconnect(),n.removeEventListener(`scroll`,c),n.removeEventListener(`scrollend`,d),n.removeEventListener(`wheel`,u),n.removeEventListener(`touchstart`,u),n.removeEventListener(`pointerdown`,u),n.removeEventListener(`keydown`,f)}},d=[],t[0]=u,t[1]=d):(u=t[0],d=t[1]),(0,Q.useEffect)(u,d);let f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>{let e=o.current,t=e?.querySelector(`[aria-current="location"]`);if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=r.left<n.left?r.left-n.left:Math.max(0,r.right-n.right);i&&e.scrollBy({left:i,behavior:Qn()})},t[2]=f):f=t[2];let p;t[3]===c?p=t[4]:(p=[c],t[3]=c,t[4]=p),(0,Q.useEffect)(f,p);let m,h,g,_,v,y,b,x,S,C,w,T;if(t[5]!==c||t[6]!==n){let e=function(e){let t=i.current,n=a.current,r=t?.querySelector(`[data-model-section="${e}"]`);if(!t||!n||!r)return;l(e);let o=Zn(t);if(!o){r.scrollIntoView?.({block:`start`,behavior:Qn()});return}let c=Math.max(0,Math.min(o.scrollHeight-o.clientHeight,o.scrollTop+r.getBoundingClientRect().top-o.getBoundingClientRect().top-o.clientTop-n.getBoundingClientRect().height-8));if(Math.abs(o.scrollTop-c)<1){s.current!==null&&o.scrollTo({top:c,behavior:`instant`}),s.current=null;return}s.current=c,o.scrollTo({top:c,behavior:Qn()})};y=i,b=`flex min-w-0 flex-col gap-5`,_=a,v=`sticky top-0 z-10 min-w-0 bg-surface-panel py-1`,m=Qe,x=`nav`,S=o,C=n?`模型配置分区`:`Model settings sections`,w=!1,T=`flex w-full gap-0.5 overflow-x-auto rounded-xl bg-surface-inset p-1`,h=`rounded-lg bg-surface-panel ring-1 ring-edge-subtle motion-reduce:transition-none`,g=Xn.map(t=>(0,$.jsx)(`button`,{type:`button`,"aria-current":c===t.id?`location`:void 0,"aria-pressed":c===t.id,className:J(`touch-target relative z-10 min-h-9 min-w-max flex-1 whitespace-nowrap rounded-lg px-3 text-xs font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,c===t.id?`text-fg`:`text-fg-muted hover:text-fg`),onClick:()=>e(t.id),children:t.label[+!n]},t.id)),t[5]=c,t[6]=n,t[7]=m,t[8]=h,t[9]=g,t[10]=_,t[11]=v,t[12]=y,t[13]=b,t[14]=x,t[15]=S,t[16]=C,t[17]=w,t[18]=T}else m=t[7],h=t[8],g=t[9],_=t[10],v=t[11],y=t[12],b=t[13],x=t[14],S=t[15],C=t[16],w=t[17],T=t[18];let E;t[19]!==m||t[20]!==h||t[21]!==g||t[22]!==x||t[23]!==S||t[24]!==C||t[25]!==w||t[26]!==T?(E=(0,$.jsx)(m,{as:x,ref:S,"aria-label":C,scrollFocusedItemIntoView:w,className:T,indicatorClassName:h,children:g}),t[19]=m,t[20]=h,t[21]=g,t[22]=x,t[23]=S,t[24]=C,t[25]=w,t[26]=T,t[27]=E):E=t[27];let D;t[28]!==_||t[29]!==v||t[30]!==E?(D=(0,$.jsx)(`div`,{ref:_,className:v,children:E}),t[28]=_,t[29]=v,t[30]=E,t[31]=D):D=t[31];let O;return t[32]!==r||t[33]!==y||t[34]!==b||t[35]!==D?(O=(0,$.jsxs)(`div`,{ref:y,className:b,children:[D,r]}),t[32]=r,t[33]=y,t[34]=b,t[35]=D,t[36]=O):O=t[36],O}function er(e){let t=(0,$t.c)(208),{model:n,isNew:r,providerId:i,onSave:a,onClose:o,m:s}=e,c=p(nr)===`zh`,l;t[0]===n?l=t[1]:(l=()=>n?{...n}:V(``),t[0]=n,t[1]=l);let[u,d]=(0,Q.useState)(l),[f,m]=(0,Q.useState)(tr),h;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=(e,t)=>{d(n=>({...n,[e]:t})),m(t=>{let n=new Map(t);return n.delete(e),n})},t[2]=h):h=t[2];let g=h,_;t[3]!==u.computerUse||t[4]!==u.contextWindow||t[5]!==u.id||t[6]!==u.input||t[7]!==u.maxTokens||t[8]!==s.modelIdRequired||t[9]!==s.mustBePositive||t[10]!==c?(_=()=>{let e=new Map;return(u.id||``).trim()||e.set(`id`,s.modelIdRequired),u.contextWindow!==void 0&&u.contextWindow<=0&&e.set(`contextWindow`,s.mustBePositive),u.maxTokens!==void 0&&u.maxTokens<=0&&e.set(`maxTokens`,s.mustBePositive),u.computerUse&&!u.input?.includes(`image`)&&e.set(`computerUse`,c?`电脑控制模型必须支持图片输入`:`Computer Use requires image input`),m(e),e.size===0},t[3]=u.computerUse,t[4]=u.contextWindow,t[5]=u.id,t[6]=u.input,t[7]=u.maxTokens,t[8]=s.modelIdRequired,t[9]=s.mustBePositive,t[10]=c,t[11]=_):_=t[11];let y=_,b;t[12]!==u||t[13]!==o||t[14]!==a||t[15]!==y?(b=()=>{if(!y())return;let e=(u.id||``).trim(),t={...u,id:e,name:u.name?.trim()||e,reasoning:u.reasoning||!1,input:u.input||[`text`],contextWindow:u.contextWindow??128e3,maxTokens:u.maxTokens??16384,cost:{input:u.cost?.input??0,output:u.cost?.output??0,cacheRead:u.cost?.cacheRead??0,cacheWrite:u.cost?.cacheWrite??0}};a(t),o()},t[12]=u,t[13]=o,t[14]=a,t[15]=y,t[16]=b):b=t[16];let S=b,C=u,w;t[17]===C?w=t[18]:(w=W(C),t[17]=C,t[18]=w);let T=w,E=r?s.addModelTitle:s.editModelTitle,D;t[19]===E?D=t[20]:(D=(0,$.jsx)(x,{className:`text-base font-semibold text-fg`,children:E}),t[19]=E,t[20]=D);let O;t[21]!==s.modelProviderLabel||t[22]!==i?(O=i?(0,$.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[s.modelProviderLabel,`: `,i]}):null,t[21]=s.modelProviderLabel,t[22]=i,t[23]=O):O=t[23];let j;t[24]!==D||t[25]!==O?(j=(0,$.jsxs)(`div`,{children:[D,O]}),t[24]=D,t[25]=O,t[26]=j):j=t[26];let M;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(M=J(ze,`p-1.5 hover:bg-surface-base`),t[27]=M):M=t[27];let N;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(De,{className:`size-4`}),t[28]=N):N=t[28];let ee;t[29]===s.close?ee=t[30]:(ee=(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:M,"aria-label":s.close,children:N})}),t[29]=s.close,t[30]=ee);let P;t[31]!==j||t[32]!==ee?(P=(0,$.jsxs)(`div`,{className:`mb-3 flex shrink-0 items-start justify-between gap-2`,children:[j,ee]}),t[31]=j,t[32]=ee,t[33]=P):P=t[33];let F;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(`span`,{className:`text-red-600 dark:text-red-400`,children:` *`}),t[34]=F):F=t[34];let I;t[35]===s.modelId?I=t[36]:(I=(0,$.jsxs)(`label`,{className:`mb-1 block text-xs font-medium text-fg`,children:[s.modelId,F]}),t[35]=s.modelId,t[36]=I);let L;t[37]===f?L=t[38]:(L=J(z(),f.has(`id`)&&`border-red-500`),t[37]=f,t[38]=L);let R=u.id||``,U;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(U=e=>g(`id`,e.target.value),t[39]=U):U=t[39];let te=!r,ne;t[40]!==L||t[41]!==R||t[42]!==te?(ne=(0,$.jsx)(`input`,{className:L,value:R,onChange:U,placeholder:`e.g. llama3.1:8b`,disabled:te}),t[40]=L,t[41]=R,t[42]=te,t[43]=ne):ne=t[43];let G;t[44]===f?G=t[45]:(G=f.has(`id`)?(0,$.jsx)(`p`,{className:`mt-1 text-xs text-red-600 dark:text-red-400`,children:f.get(`id`)}):null,t[44]=f,t[45]=G);let re;t[46]!==I||t[47]!==ne||t[48]!==G?(re=(0,$.jsxs)(`div`,{children:[I,ne,G]}),t[46]=I,t[47]=ne,t[48]=G,t[49]=re):re=t[49];let ie;t[50]===s.displayName?ie=t[51]:(ie=(0,$.jsx)(`label`,{className:`mb-1 block text-xs font-medium text-fg-muted`,children:s.displayName}),t[50]=s.displayName,t[51]=ie);let K;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(K=z(),t[52]=K):K=t[52];let ae=u.name||``,se;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(se=e=>g(`name`,e.target.value),t[53]=se):se=t[53];let ce;t[54]===ae?ce=t[55]:(ce=(0,$.jsx)(`input`,{className:K,value:ae,onChange:se}),t[54]=ae,t[55]=ce);let le;t[56]!==ie||t[57]!==ce?(le=(0,$.jsxs)(`div`,{children:[ie,ce]}),t[56]=ie,t[57]=ce,t[58]=le):le=t[58];let q;t[59]===s.inputTypes?q=t[60]:(q=(0,$.jsx)(`label`,{className:`mb-1 block text-xs font-medium text-fg-muted`,children:s.inputTypes}),t[59]=s.inputTypes,t[60]=q);let ue;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(ue=H(),t[61]=ue):ue=t[61];let de;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(de=e=>g(`input`,B(e.target.value)),t[62]=de):de=t[62];let fe;t[63]===s?fe=t[64]:(fe=oe.map(e=>(0,$.jsx)(A,{value:e.value,children:s[e.labelKey]},e.value)),t[63]=s,t[64]=fe);let pe;t[65]!==T||t[66]!==fe?(pe=(0,$.jsx)(k,{className:ue,value:T,onChange:de,children:fe}),t[65]=T,t[66]=fe,t[67]=pe):pe=t[67];let me;t[68]!==q||t[69]!==pe?(me=(0,$.jsxs)(`div`,{children:[q,pe]}),t[68]=q,t[69]=pe,t[70]=me):me=t[70];let he=u.reasoning||!1,ge;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(ge=e=>g(`reasoning`,e.target.checked),t[71]=ge):ge=t[71];let _e;t[72]===he?_e=t[73]:(_e=(0,$.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:he,onChange:ge}),t[72]=he,t[73]=_e);let ve;t[74]!==s.reasoning||t[75]!==_e?(ve=(0,$.jsxs)(`label`,{className:`mt-6 flex cursor-pointer items-center gap-2 text-sm text-fg`,children:[_e,s.reasoning]}),t[74]=s.reasoning,t[75]=_e,t[76]=ve):ve=t[76];let ye;t[77]!==me||t[78]!==ve?(ye=(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[me,ve]}),t[77]=me,t[78]=ve,t[79]=ye):ye=t[79];let be;t[80]===s.contextWindow?be=t[81]:(be=(0,$.jsx)(`label`,{className:`mb-1 block text-xs font-medium text-fg-muted`,children:s.contextWindow}),t[80]=s.contextWindow,t[81]=be);let xe;t[82]===f?xe=t[83]:(xe=J(z(),f.has(`contextWindow`)&&`border-red-500`),t[82]=f,t[83]=xe);let Se=u.contextWindow??128e3,Ce;t[84]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=e=>g(`contextWindow`,parseInt(e.target.value,10)||0),t[84]=Ce):Ce=t[84];let we;t[85]!==xe||t[86]!==Se?(we=(0,$.jsx)(jt,{type:`number`,min:1,className:xe,value:Se,onChange:Ce}),t[85]=xe,t[86]=Se,t[87]=we):we=t[87];let Te;t[88]===f?Te=t[89]:(Te=f.has(`contextWindow`)?(0,$.jsx)(`p`,{className:`mt-1 text-xs text-red-600 dark:text-red-400`,children:f.get(`contextWindow`)}):null,t[88]=f,t[89]=Te);let Ee;t[90]!==be||t[91]!==we||t[92]!==Te?(Ee=(0,$.jsxs)(`div`,{children:[be,we,Te]}),t[90]=be,t[91]=we,t[92]=Te,t[93]=Ee):Ee=t[93];let Y;t[94]===s.maxOutputTokens?Y=t[95]:(Y=(0,$.jsx)(`label`,{className:`mb-1 block text-xs font-medium text-fg-muted`,children:s.maxOutputTokens}),t[94]=s.maxOutputTokens,t[95]=Y);let Oe;t[96]===f?Oe=t[97]:(Oe=J(z(),f.has(`maxTokens`)&&`border-red-500`),t[96]=f,t[97]=Oe);let ke=u.maxTokens??16384,Ae;t[98]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=e=>g(`maxTokens`,parseInt(e.target.value,10)||0),t[98]=Ae):Ae=t[98];let X;t[99]!==Oe||t[100]!==ke?(X=(0,$.jsx)(jt,{type:`number`,min:1,className:Oe,value:ke,onChange:Ae}),t[99]=Oe,t[100]=ke,t[101]=X):X=t[101];let je;t[102]===f?je=t[103]:(je=f.has(`maxTokens`)?(0,$.jsx)(`p`,{className:`mt-1 text-xs text-red-600 dark:text-red-400`,children:f.get(`maxTokens`)}):null,t[102]=f,t[103]=je);let Me;t[104]!==Y||t[105]!==X||t[106]!==je?(Me=(0,$.jsxs)(`div`,{children:[Y,X,je]}),t[104]=Y,t[105]=X,t[106]=je,t[107]=Me):Me=t[107];let Ne;t[108]!==Ee||t[109]!==Me?(Ne=(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[Ee,Me]}),t[108]=Ee,t[109]=Me,t[110]=Ne):Ne=t[110];let Pe;t[111]===s.costSection?Pe=t[112]:(Pe=(0,$.jsx)(`p`,{className:`mb-2 text-xs font-semibold text-fg`,children:s.costSection}),t[111]=s.costSection,t[112]=Pe);let Fe;t[113]===s.costInput?Fe=t[114]:(Fe=(0,$.jsx)(`label`,{className:`mb-1 block text-xs text-fg-muted`,children:s.costInput}),t[113]=s.costInput,t[114]=Fe);let Ie;t[115]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=z(),t[115]=Ie):Ie=t[115];let Le=u.cost?.input??0,Re;t[116]===u.cost?Re=t[117]:(Re=e=>g(`cost`,{...u.cost,input:parseFloat(e.target.value)||0,output:u.cost?.output??0,cacheRead:u.cost?.cacheRead??0,cacheWrite:u.cost?.cacheWrite??0}),t[116]=u.cost,t[117]=Re);let Be;t[118]!==Le||t[119]!==Re?(Be=(0,$.jsx)(jt,{type:`number`,step:`any`,min:0,className:Ie,value:Le,onChange:Re}),t[118]=Le,t[119]=Re,t[120]=Be):Be=t[120];let Ve;t[121]!==Fe||t[122]!==Be?(Ve=(0,$.jsxs)(`div`,{children:[Fe,Be]}),t[121]=Fe,t[122]=Be,t[123]=Ve):Ve=t[123];let He;t[124]===s.costOutput?He=t[125]:(He=(0,$.jsx)(`label`,{className:`mb-1 block text-xs text-fg-muted`,children:s.costOutput}),t[124]=s.costOutput,t[125]=He);let Ue;t[126]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=z(),t[126]=Ue):Ue=t[126];let We=u.cost?.output??0,Ge;t[127]===u.cost?Ge=t[128]:(Ge=e=>g(`cost`,{...u.cost,input:u.cost?.input??0,output:parseFloat(e.target.value)||0,cacheRead:u.cost?.cacheRead??0,cacheWrite:u.cost?.cacheWrite??0}),t[127]=u.cost,t[128]=Ge);let Ke;t[129]!==We||t[130]!==Ge?(Ke=(0,$.jsx)(jt,{type:`number`,step:`any`,min:0,className:Ue,value:We,onChange:Ge}),t[129]=We,t[130]=Ge,t[131]=Ke):Ke=t[131];let qe;t[132]!==He||t[133]!==Ke?(qe=(0,$.jsxs)(`div`,{children:[He,Ke]}),t[132]=He,t[133]=Ke,t[134]=qe):qe=t[134];let Je;t[135]!==Ve||t[136]!==qe?(Je=(0,$.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[Ve,qe]}),t[135]=Ve,t[136]=qe,t[137]=Je):Je=t[137];let Ye;t[138]!==Pe||t[139]!==Je?(Ye=(0,$.jsxs)(`div`,{className:`border-t border-edge-subtle pt-2 dark:border-edge`,children:[Pe,Je]}),t[138]=Pe,t[139]=Je,t[140]=Ye):Ye=t[140];let Xe;t[141]!==re||t[142]!==le||t[143]!==ye||t[144]!==Ne||t[145]!==Ye?(Xe=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[re,le,ye,Ne,Ye]}),t[141]=re,t[142]=le,t[143]=ye,t[144]=Ne,t[145]=Ye,t[146]=Xe):Xe=t[146];let Ze=c?`高级:手机操作协议`:`Advanced: Phone Use protocol`,Qe;t[147]===Ze?Qe=t[148]:(Qe=(0,$.jsx)(`summary`,{className:`cursor-pointer`,children:Ze}),t[147]=Ze,t[148]=Qe);let $e=c?`手机操作协议`:`Phone Use protocol`,et=u.phoneUse?.profile??``,tt;t[149]===Symbol.for(`react.memo_cache_sentinel`)?(tt=e=>g(`phoneUse`,e.target.value?{profile:e.target.value}:void 0),t[149]=tt):tt=t[149];let nt=c?`自动识别`:`Automatic`,rt;t[150]===nt?rt=t[151]:(rt=(0,$.jsx)(A,{value:``,children:nt}),t[150]=nt,t[151]=rt);let it,at,ot,st,ct;t[152]===Symbol.for(`react.memo_cache_sentinel`)?(it=(0,$.jsx)(A,{value:`autoglm-phone-v1`,children:`AutoGLM Phone`}),at=(0,$.jsx)(A,{value:`structured-phone-v1`,children:`Structured Phone`}),ot=(0,$.jsx)(A,{value:`structured-tools-phone-v1`,children:`Visual function tools`}),st=(0,$.jsx)(A,{value:`doubao-seed-phone-v1`,children:`Doubao Seed GUI`}),ct=(0,$.jsx)(A,{value:`gui-owl-phone-v1`,children:`GUI-Owl 1.5`}),t[152]=it,t[153]=at,t[154]=ot,t[155]=st,t[156]=ct):(it=t[152],at=t[153],ot=t[154],st=t[155],ct=t[156]);let lt;t[157]!==$e||t[158]!==et||t[159]!==rt?(lt=(0,$.jsxs)(k,{"aria-label":$e,value:et,onChange:tt,children:[rt,it,at,ot,st,ct]}),t[157]=$e,t[158]=et,t[159]=rt,t[160]=lt):lt=t[160];let ut=c?`通用视觉模型支持图片输入和工具调用时会自动显示;也可指定专用手机协议。`:`Visual models with image input and function tools appear automatically. Dedicated phone protocols can also be selected.`,dt;t[161]===ut?dt=t[162]:(dt=(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:ut}),t[161]=ut,t[162]=dt);let ft;t[163]!==lt||t[164]!==dt?(ft=(0,$.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[lt,dt]}),t[163]=lt,t[164]=dt,t[165]=ft):ft=t[165];let pt;t[166]!==Qe||t[167]!==ft?(pt=(0,$.jsxs)(`details`,{className:`mt-4 rounded-lg border border-edge p-3 text-sm text-fg`,children:[Qe,ft]}),t[166]=Qe,t[167]=ft,t[168]=pt):pt=t[168];let mt=c?`高级:电脑控制协议`:`Advanced: Computer Use protocol`,ht;t[169]===mt?ht=t[170]:(ht=(0,$.jsx)(`summary`,{className:`cursor-pointer`,children:mt}),t[169]=mt,t[170]=ht);let gt=c?`电脑控制协议`:`Computer Use protocol`,_t=u.computerUse?.profile??``,vt;t[171]===Symbol.for(`react.memo_cache_sentinel`)?(vt=e=>g(`computerUse`,e.target.value?{profile:e.target.value}:void 0),t[171]=vt):vt=t[171];let yt=c?`自动识别`:`Automatic`,bt;t[172]===yt?bt=t[173]:(bt=(0,$.jsx)(A,{value:``,children:yt}),t[172]=yt,t[173]=bt);let xt,St,Ct;t[174]===Symbol.for(`react.memo_cache_sentinel`)?(xt=(0,$.jsx)(A,{value:`gui-plus-2026-02-26`,children:`GUI-Plus (2026-02-26)`}),St=(0,$.jsx)(A,{value:`structured-tools-v1`,children:`structured-tools-v1`}),Ct=(0,$.jsx)(A,{value:`openai-responses-computer-v1`,children:`OpenAI Responses Computer`}),t[174]=xt,t[175]=St,t[176]=Ct):(xt=t[174],St=t[175],Ct=t[176]);let wt;t[177]!==gt||t[178]!==_t||t[179]!==bt?(wt=(0,$.jsxs)(k,{"aria-label":gt,value:_t,onChange:vt,children:[bt,xt,St,Ct]}),t[177]=gt,t[178]=_t,t[179]=bt,t[180]=wt):wt=t[180];let Tt=c?`协议必须与模型 API 匹配。声明协议不代表模型已通过效果验证。`:`The protocol must match the model API. Declaring a protocol does not certify model quality.`,Et;t[181]===Tt?Et=t[182]:(Et=(0,$.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:Tt}),t[181]=Tt,t[182]=Et);let Dt;t[183]===f?Dt=t[184]:(Dt=f.has(`computerUse`)&&(0,$.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:f.get(`computerUse`)}),t[183]=f,t[184]=Dt);let Ot;t[185]!==Et||t[186]!==Dt||t[187]!==wt?(Ot=(0,$.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[wt,Et,Dt]}),t[185]=Et,t[186]=Dt,t[187]=wt,t[188]=Ot):Ot=t[188];let kt;t[189]!==Ot||t[190]!==ht?(kt=(0,$.jsxs)(`details`,{className:`mt-4 rounded-lg border border-edge p-3 text-sm text-fg`,children:[ht,Ot]}),t[189]=Ot,t[190]=ht,t[191]=kt):kt=t[191];let At;t[192]!==kt||t[193]!==Xe||t[194]!==pt?(At=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pr-1`,children:[Xe,pt,kt]}),t[192]=kt,t[193]=Xe,t[194]=pt,t[195]=At):At=t[195];let Mt;t[196]===s.cancel?Mt=t[197]:(Mt=(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(Z,{type:`button`,variant:`secondary`,children:s.cancel})}),t[196]=s.cancel,t[197]=Mt);let Nt=r?s.addModelConfirm:s.saveModelConfirm,Pt;t[198]!==S||t[199]!==Nt?(Pt=(0,$.jsx)(Z,{type:`button`,variant:`primary`,className:`hover:bg-accent/90`,onClick:S,children:Nt}),t[198]=S,t[199]=Nt,t[200]=Pt):Pt=t[200];let Ft;t[201]!==Mt||t[202]!==Pt?(Ft=(0,$.jsxs)(`div`,{className:`mt-4 flex shrink-0 justify-end gap-2 border-t border-edge-subtle pt-3 dark:border-edge`,children:[Mt,Pt]}),t[201]=Mt,t[202]=Pt,t[203]=Ft):Ft=t[203];let It;return t[204]!==At||t[205]!==Ft||t[206]!==P?(It=(0,$.jsxs)($.Fragment,{children:[P,At,Ft]}),t[204]=At,t[205]=Ft,t[206]=P,t[207]=It):It=t[207],It}function tr(){return new Map}function nr(e){return e.language}function rr(e){let t=(0,$t.c)(16),{open:n,onOpenChange:r,providerId:i,model:a,isNew:o,onSave:s,m:c}=e,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(g,{className:J(`xopc-dialog-overlay fixed inset-0 bg-scrim`,Ie)}),t[0]=l):l=t[0];let u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u=J(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(90vh,720px)] w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2 flex-col`,Fe,`overflow-hidden rounded-xl border border-edge bg-surface-overlay p-4 shadow-popover dark:border-edge`),t[1]=u):u=t[1];let d;t[2]!==o||t[3]!==c||t[4]!==a||t[5]!==r||t[6]!==s||t[7]!==n||t[8]!==i?(d=n?(0,$.jsx)(er,{model:a,isNew:o,providerId:i,onSave:s,onClose:()=>r(!1),m:c},`${i??`none`}-${a?.id??`new`}`):null,t[2]=o,t[3]=c,t[4]=a,t[5]=r,t[6]=s,t[7]=n,t[8]=i,t[9]=d):d=t[9];let f;t[10]===d?f=t[11]:(f=(0,$.jsxs)(y,{children:[l,(0,$.jsx)(b,{className:u,onOpenAutoFocus:ir,children:d})]}),t[10]=d,t[11]=f);let p;return t[12]!==r||t[13]!==n||t[14]!==f?(p=(0,$.jsx)(S,{open:n,onOpenChange:r,children:f}),t[12]=r,t[13]=n,t[14]=f,t[15]=p):p=t[15],p}function ir(e){return e.preventDefault()}function ar(e){let t=(0,$t.c)(14),{providerId:n,inputId:r,value:i,onChange:a,labels:o}=e,s;t[0]===n?s=t[1]:(s=()=>yt(n).then(or),t[0]=n,t[1]=s);let c=s,l;t[2]!==r||t[3]!==o.apiKeyLabel?(l=(0,$.jsx)(`label`,{htmlFor:r,className:`text-sm font-medium text-fg`,children:o.apiKeyLabel}),t[2]=r,t[3]=o.apiKeyLabel,t[4]=l):l=t[4];let u;t[5]!==r||t[6]!==o||t[7]!==a||t[8]!==c||t[9]!==i?(u=(0,$.jsx)(fe,{id:r,value:i,onChange:a,placeholder:o.apiKeyPlaceholder,labels:o,reveal:c,loadFailedLabel:o.loadFailed,maskedHelp:o.maskedHelp,notInConfigFile:o.notInConfigFile}),t[5]=r,t[6]=o,t[7]=a,t[8]=c,t[9]=i,t[10]=u):u=t[10];let d;return t[11]!==l||t[12]!==u?(d=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[l,u]}),t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function or(e){return e.apiKey??null}function sr(e){let t=(0,$t.c)(23),{open:n,onOpenChange:r,providerId:i,isCustom:a,builtinRows:o,customConfig:s,allModels:c,labels:l,language:u,onSaved:d}=e,f=(0,Q.useRef)(null),[p,m]=(0,Q.useState)(!1),[h,_]=(0,Q.useState)(null),v;t[0]===r?v=t[1]:(v=e=>{e||(_(null),m(!1)),r(e)},t[0]=r,t[1]=v);let x=v,C;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(g,{className:J(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,Ie)}),t[2]=C):C=t[2];let w,T,E;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>{f.current=document.activeElement instanceof HTMLElement?document.activeElement:null},T=e=>{f.current?.isConnected&&(e.preventDefault(),f.current.focus({preventScroll:!0}))},E=J(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(85vh,720px)] w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay`,Fe),t[3]=w,t[4]=T,t[5]=E):(w=t[3],T=t[4],E=t[5]);let D;t[6]!==c||t[7]!==o||t[8]!==s||t[9]!==x||t[10]!==a||t[11]!==l||t[12]!==u||t[13]!==r||t[14]!==d||t[15]!==i||t[16]!==p||t[17]!==h?(D=(0,$.jsxs)(y,{children:[C,(0,$.jsx)(b,{onOpenAutoFocus:w,onCloseAutoFocus:T,className:E,children:h?(0,$.jsx)(U,{target:h,zh:u===`zh`,onDone:()=>x(!1)}):!a&&p?(0,$.jsx)(I,{providerId:i,existingConnection:!0,row:o.find(e=>e.id===i),language:u,onApplied:d,onBack:()=>m(!1),onDone:()=>x(!1)}):a?(0,$.jsx)(lr,{providerId:i,customConfig:s,labels:l,language:u,onClose:()=>r(!1),onSaved:d,onModelAdded:e=>_({providerId:i,modelIds:[e]})}):(0,$.jsx)(cr,{providerId:i,builtinRows:o,allModels:c,labels:l,language:u,onClose:()=>r(!1),onSaved:d,onQuickSetup:()=>m(!0)},i)})]}),t[6]=c,t[7]=o,t[8]=s,t[9]=x,t[10]=a,t[11]=l,t[12]=u,t[13]=r,t[14]=d,t[15]=i,t[16]=p,t[17]=h,t[18]=D):D=t[18];let O;return t[19]!==x||t[20]!==n||t[21]!==D?(O=(0,$.jsx)(S,{open:n,onOpenChange:x,children:D}),t[19]=x,t[20]=n,t[21]=D,t[22]=O):O=t[22],O}function cr({providerId:e,builtinRows:t,allModels:n,labels:r,language:i,onClose:a,onSaved:o,onQuickSetup:s}){let c=t.find(t=>t.id===e),u=se[e],d=n.filter(t=>t.provider===e),[f,p]=(0,Q.useState)(!1),[m,g]=(0,Q.useState)(c?.apiKey??``),[_,y]=(0,Q.useState)(!1),[b,S]=(0,Q.useState)(!1),[C,w]=(0,Q.useState)(null),[T,E]=(0,Q.useState)(!1),D=h(i).providersSettings,O=c?.supportsApiKey!==!1,k=c?.supportsOAuth===!0,[A,j]=(0,Q.useState)(c?.authMode===`oauth`||!O?`oauth`:`api-key`),N=c?.authMode===`oauth`&&c.authStatus===`connected`,ee=c?.configured===!0&&c.authMode!==`oauth`&&c.activeKeySource!==`env`&&c.activeKeySource!==`extension`&&c.activeKeySource!==`models_json`,[P,F]=(0,Q.useState)(null),[I,R]=(0,Q.useState)(null),[z,B]=(0,Q.useState)(`idle`),[V,H]=(0,Q.useState)(null),[U,te]=(0,Q.useState)(null),[W,ne]=(0,Q.useState)(null),[re,ie]=(0,Q.useState)(``),ae=(0,Q.useRef)(null),oe=(0,Q.useRef)(null),le=z===`waiting`||z===`waiting_code`,ue=(0,Q.useMemo)(()=>q(e,i),[e,i]),fe=m!==(c?.apiKey??``),pe=async()=>{let t=m.trim();if(!(!t||!O||vt(t))){y(!0),w(null);try{await _t({[e]:t}),S(!0),window.setTimeout(()=>{o(),a()},600)}catch(e){w(e instanceof Error?e.message:r.saveError)}finally{y(!1)}}};(0,Q.useEffect)(()=>{if(!P||!le)return;let t=!0,n=window.setInterval(()=>{(async()=>{try{let r=await Tt(P);if(!t)return;if(r.status===`waiting_auth`||r.status===`waiting_code`)B(r.status===`waiting_code`?`waiting_code`:`waiting`),R(r.message??null),H(r.authUrl??null),te(r.instructions??null),ne(r.deviceCode??null),r.authUrl&&r.authUrl!==oe.current&&(oe.current=r.authUrl,Ot(r.authUrl,ae.current).catch(()=>{}));else if(r.status===`completed`)t=!1,window.clearInterval(n),At(ae.current),ae.current=null,B(`success`),R(r.message??D.saved),window.setTimeout(()=>{o(),a()},600);else if(r.status===`failed`||r.status===`cancelled`){t=!1,window.clearInterval(n),At(ae.current),ae.current=null,F(null),B(`error`);let i=e===`openai`&&/"error"\s*:\s*"invalid_grant"/.test(r.error??``);R(i?D.oauthGrantRejected:r.error??r.message??D.revokeFailed)}}catch{}})()},1e3);return()=>{t=!1,window.clearInterval(n)}},[P,le,a,o,e,D.oauthGrantRejected,D.revokeFailed,D.saved]),(0,Q.useEffect)(()=>()=>{P&&Ct(P).catch(()=>{})},[P]),(0,Q.useEffect)(()=>()=>{At(ae.current),ae.current=null},[]);let me=async()=>{try{await bt(e),o(),a()}catch{}},he=async()=>{At(ae.current),ae.current=kt(),oe.current=null,B(`waiting`),R(D.oauthStarting),H(null),te(null),ne(null),ie(``),w(null);try{let t=await xt(e);F(t.sessionId)}catch(e){At(ae.current),ae.current=null,B(`error`),R(e instanceof Error?e.message:D.revokeFailed)}},_e=async()=>{if(P){try{await Et(P)}catch{}At(ae.current),ae.current=null,oe.current=null,B(`idle`),R(null),F(null),H(null),te(null),ne(null)}},ve=async()=>{if(!(!P||!re.trim()))try{await wt(P,re.trim()),ie(``),R(D.oauthProcessingCode)}catch(e){B(`error`),R(e instanceof Error?e.message:D.revokeFailed)}},ye=async()=>{try{await St(e),o(),a()}catch(e){w(e instanceof Error?e.message:D.revokeFailed)}};return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-edge-subtle px-5 py-4`,children:[(0,$.jsx)(x,{className:`text-base font-semibold text-fg`,children:c?.name??e}),(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:J(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,Re.press),children:(0,$.jsx)(De,{className:`size-4`,"aria-hidden":!0})})})]}),(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-5 py-4`,children:[u?.description?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:u.description}):null,(0,$.jsx)(K,{row:c,language:i}),O&&k?(0,$.jsx)(G,{value:A,onChange:j,language:i,disabled:le||_}):null,O&&A===`api-key`?(0,$.jsx)(ar,{providerId:e,inputId:`manage-api-key`,value:m,onChange:e=>{g(e),S(!1)},labels:{apiKeyLabel:r.apiKeyLabel,apiKeyPlaceholder:r.apiKeyPlaceholder,maskedHelp:r.maskedHelp,copy:r.copy,copied:r.copied,show:r.showKey,hide:r.hideKey,notInConfigFile:r.notInConfigFile,loadFailed:r.loadFailed}}):!O&&c?.category===`extension`?(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg border border-edge-subtle bg-surface-panel/60 px-3 py-2 text-sm text-fg-muted`,children:[(0,$.jsx)(`p`,{children:r.extensionKeyHint}),c?.extensionId?(0,$.jsxs)(l,{to:`/settings/ext/${encodeURIComponent(c.extensionId)}`,className:`inline-flex w-fit items-center gap-1 font-medium text-accent hover:underline`,title:r.extensionSettingsLinkTitle,onClick:a,children:[r.openExtensionSettings,(0,$.jsx)(de,{className:`size-3`,"aria-hidden":!0})]}):null]}):null,k&&A===`oauth`?(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg border border-edge-subtle bg-surface-panel/60 p-3`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:D.oauth}),(0,$.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:N?i===`zh`?`账号已连接`:`Account connected`:c?.authMode===`oauth`&&c.authStatus===`expired`?i===`zh`?`授权已过期,请重新登录`:`Authorization expired. Sign in again.`:i===`zh`?`通过浏览器授权连接账号`:`Authorize your account in the browser`})]}),N?(0,$.jsx)(Z,{type:`button`,variant:`secondary`,className:`gap-1.5 text-red-600 dark:text-red-400`,onClick:()=>void ye(),children:D.revoke}):(0,$.jsxs)(Z,{type:`button`,variant:`primary`,className:`gap-1.5`,disabled:le,onClick:()=>void he(),children:[le?(0,$.jsx)(ge,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0}),D.oauth]})]}),I?(0,$.jsx)(`p`,{className:J(`text-xs`,z===`error`?`text-red-600 dark:text-red-400`:`text-fg-muted`),children:I}):null,z===`waiting`||z===`waiting_code`?(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[V?(0,$.jsxs)(`a`,{href:V,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-2 text-sm font-medium text-on-accent hover:bg-accent-hover`,children:[(0,$.jsx)(de,{className:`size-4`,"aria-hidden":!0}),D.openAuthPage]}):null,(0,$.jsx)(Z,{type:`button`,variant:`secondary`,onClick:()=>void _e(),children:D.cancelOAuth})]}):null,le&&U?(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:U}):null,le&&W?(0,$.jsxs)(`div`,{className:`rounded-lg border border-edge-subtle bg-surface-panel px-3 py-2`,children:[(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:D.deviceCodeLabel}),(0,$.jsx)(`code`,{className:`mt-1 block select-all font-mono text-lg font-semibold tracking-widest text-fg`,children:W}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:D.deviceCodeHint})]}):null,z===`waiting_code`?(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:[(0,$.jsx)(`input`,{type:`text`,value:re,onChange:e=>ie(e.target.value),onKeyDown:e=>e.key===`Enter`&&void ve(),"aria-label":D.pasteRedirectUrl,placeholder:D.pasteRedirectUrl,className:J(`min-w-0 flex-1 rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle`,We)}),(0,$.jsx)(Z,{type:`button`,variant:`primary`,onClick:()=>void ve(),children:D.submitCode})]}):null]}):null,ue.length>0&&O&&A===`api-key`?(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:ue.map(({kind:e,href:t})=>(0,$.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-xs text-accent hover:underline`,children:[L(e,r),(0,$.jsx)(de,{className:`size-3`,"aria-hidden":!0})]},e))}):null,A===`api-key`&&c?.baseUrl?(0,$.jsxs)(`details`,{className:`rounded-lg border border-edge-subtle p-3`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:i===`zh`?`高级设置`:`Advanced settings`}),(0,$.jsxs)(`div`,{className:`mt-3 flex flex-col gap-1.5`,children:[(0,$.jsx)(`span`,{className:`text-xs text-fg-muted`,children:r.apiUrlLabel}),(0,$.jsx)(`code`,{className:`break-all font-mono text-xs text-fg-muted`,children:c.baseUrl})]})]}):c?.category===`extension`?(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:r.apiUrlExtensionHint}):null,d.length>0?(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsxs)(`span`,{className:`text-sm font-medium text-fg`,children:[i===`zh`?`模型目录`:`Model catalog`,` (`,d.length,`)`]}),(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i===`zh`?`此服务的模型目录;实际访问权限取决于当前生效的凭据和账号。`:`Models registered for this provider. Access depends on the active credentials and account.`}),(0,$.jsxs)(`label`,{className:`mb-2 flex items-center gap-2 text-xs text-fg-muted`,children:[(0,$.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:f,onChange:e=>p(e.target.checked)}),i===`zh`?`仅电脑控制模型`:`Computer Use only`]}),(0,$.jsx)(`div`,{className:`max-h-40 overflow-y-auto rounded-lg border border-edge-subtle bg-surface-panel/40 p-2`,children:(0,$.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:d.filter(e=>!f||e.computerUse).map(e=>(0,$.jsxs)(`span`,{className:`inline-block rounded-md bg-surface-hover px-2 py-1 text-xs text-fg-muted`,children:[rt(e,i),e.computerUse?` · Computer Use`:``]},e.id))})})]}):(0,$.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:r.noModels}),s?(0,$.jsx)(Z,{variant:`secondary`,disabled:fe||le||c?.authStatus!==`connected`,onClick:s,children:i===`zh`?`配置模型用途`:`Configure model uses`}):null,C?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:C}):null]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-t border-edge-subtle px-5 py-3`,children:[ee?(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`gap-1.5 text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300`,onClick:()=>E(!0),children:[(0,$.jsx)(we,{className:`size-3.5`,"aria-hidden":!0}),i===`zh`?`移除 API Key`:`Remove API key`]}):(0,$.jsx)(`span`,{}),(0,$.jsx)(`div`,{className:`flex items-center gap-2`,children:O&&A===`api-key`&&fe&&!vt(m.trim())?(0,$.jsx)(Z,{type:`button`,variant:`primary`,disabled:!m.trim()||_||b,onClick:()=>void pe(),children:b?(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(M,{className:`size-3.5`,"aria-hidden":!0}),r.saved]}):_?(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(ge,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),r.saving]}):r.save}):null})]}),(0,$.jsx)($e,{open:T,title:r.removeConfirmTitle,description:r.removeConfirmDescription.replace(`{{provider}}`,c?.name??e),confirmLabel:r.removeConfirmAction,cancelLabel:r.cancel,destructive:!0,onConfirm:()=>void me(),onCancel:()=>E(!1)})]})}function lr({providerId:e,customConfig:t,labels:n,language:r,onClose:i,onSaved:a,onModelAdded:o}){let s=h(r).modelsSettings,c=t?.providers[e],[l,u]=(0,Q.useState)(c?.baseUrl??``),[d,f]=(0,Q.useState)(c?.apiKey??``),[p,m]=(0,Q.useState)(c?.models??[]),[g,_]=(0,Q.useState)(!1),[y,b]=(0,Q.useState)(c?.modelDiscovery?.enabled===!0),[S,C]=(0,Q.useState)(!1),[w,T]=(0,Q.useState)(null),[E,D]=(0,Q.useState)(!1),[O,k]=(0,Q.useState)(null),[A,j]=(0,Q.useState)(!1),[M,N]=(0,Q.useState)(null),ee=n=>{if(!t)return null;let r=d.trim(),i={...c,baseUrl:l.trim()||void 0,apiKey:vt(r)?c?.apiKey:r||void 0,...n};return{providers:{...t.providers,[e]:i}}},P=async()=>{let e=ee({models:p,modelDiscovery:{enabled:y}});if(e){C(!0),T(null);try{await F(e),a(),i()}catch(e){T(e instanceof Error?e.message:n.saveError)}finally{C(!1)}}},I=async()=>{if(t)try{let{[e]:n,...r}=t.providers;await F({providers:r}),a(),i()}catch{}},L=(e,t)=>{N({model:e,isNew:t}),j(!0)},R=async e=>{if(!M)return;let t=M.isNew&&!p.some(t=>t.id===e.id),r=M.isNew?[...p,e]:p.map(t=>t.id===e.id?e:t);m(r);let i=ee({models:r});if(i)try{await F(i),a(),t&&!e.computerUse&&o(e.id)}catch(e){T(e instanceof Error?e.message:n.saveError)}},z=async e=>{let t=p.filter(t=>t.id!==e);m(t),k(null);let r=ee({models:t});if(r)try{await F(r),a()}catch(e){T(e instanceof Error?e.message:n.saveError)}};return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between border-b border-edge-subtle px-5 py-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(x,{className:`text-base font-semibold text-fg`,children:e}),(0,$.jsx)(`span`,{className:`rounded bg-surface-hover px-1.5 py-0.5 text-[10px] font-medium text-fg-subtle`,children:n.custom})]}),(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:J(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,Re.press),children:(0,$.jsx)(De,{className:`size-4`,"aria-hidden":!0})})})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-4 overflow-y-auto px-5 py-4`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`label`,{htmlFor:`manage-base-url`,className:`text-sm font-medium text-fg`,children:n.baseUrlLabel}),(0,$.jsx)(`input`,{id:`manage-base-url`,type:`url`,autoComplete:`off`,value:l,onChange:e=>u(e.target.value),className:J(`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle`,We)})]}),(0,$.jsx)(ar,{providerId:e,inputId:`manage-custom-api-key`,value:d,onChange:f,labels:{apiKeyLabel:n.apiKeyLabel,apiKeyPlaceholder:n.apiKeyPlaceholder,maskedHelp:n.maskedHelp,copy:n.copy,copied:n.copied,show:n.showKey,hide:n.hideKey,notInConfigFile:n.notInConfigFile,loadFailed:n.loadFailed}}),(0,$.jsxs)(`label`,{className:`flex items-start gap-3 rounded-xl border border-edge-subtle bg-surface-panel/40 p-3`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:y,onChange:e=>b(e.target.checked),className:`mt-0.5 size-4 rounded border-edge accent-accent`}),(0,$.jsxs)(`span`,{className:`min-w-0`,children:[(0,$.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:r===`zh`?`自动同步模型目录`:`Automatically sync model catalog`}),(0,$.jsx)(`span`,{className:`mt-0.5 block text-xs text-fg-muted`,children:r===`zh`?`启动时及定时从此服务的 /models 接口更新模型。`:`Update models from this service’s /models endpoint at startup and on schedule.`})]})]}),(0,$.jsxs)(`div`,{className:`border-t border-edge-subtle pt-3`,children:[(0,$.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,$.jsxs)(`span`,{className:`text-sm font-semibold text-fg`,children:[s.modelsSection,p.length>0?` (${p.length})`:``]}),(0,$.jsxs)(Z,{type:`button`,variant:`primary`,className:`gap-1.5 px-2 py-1 text-xs`,onClick:()=>L(null,!0),children:[(0,$.jsx)(ye,{className:`size-3.5`,"aria-hidden":!0}),s.addModel]})]}),(0,$.jsxs)(`label`,{className:`mb-2 flex items-center gap-2 text-xs text-fg-muted`,children:[(0,$.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:g,onChange:e=>_(e.target.checked)}),r===`zh`?`仅电脑控制模型`:`Computer Use only`]}),p.filter(e=>!g||e.computerUse).length===0?(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:s.modelsEmpty}):(0,$.jsx)(`ul`,{className:`space-y-2`,children:p.filter(e=>!g||e.computerUse).map(e=>(0,$.jsxs)(`li`,{className:`flex items-center justify-between gap-2 rounded-lg border border-edge-subtle bg-surface-panel/40 px-3 py-2`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:e.id}),e.computerUse&&(0,$.jsx)(`span`,{className:`text-xs text-fg-muted`,children:`Computer Use`}),e.name&&e.name!==e.id?(0,$.jsx)(`div`,{className:`truncate text-xs text-fg-muted`,children:e.name}):null]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 gap-1`,children:[(0,$.jsx)(`button`,{type:`button`,className:J(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,Re.press),onClick:()=>L(e,!1),"aria-label":s.editModel,children:(0,$.jsx)(_e,{className:`size-3.5`,"aria-hidden":!0})}),(0,$.jsx)(`button`,{type:`button`,className:J(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-red-600 dark:hover:text-red-400`,Re.press),onClick:()=>k(e.id),"aria-label":s.removeModel,children:(0,$.jsx)(we,{className:`size-3.5`,"aria-hidden":!0})})]})]},e.id))})]}),w?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:w}):null]}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between border-t border-edge-subtle px-5 py-3`,children:[(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`gap-1.5 text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300`,onClick:()=>D(!0),children:[(0,$.jsx)(we,{className:`size-3.5`,"aria-hidden":!0}),n.remove]}),(0,$.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,$.jsx)(Z,{type:`button`,variant:`primary`,disabled:S,onClick:()=>void P(),children:S?(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(ge,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),n.saving]}):n.save})})]}),(0,$.jsx)($e,{open:E,title:n.removeConfirmTitle,description:n.removeConfirmDescription.replace(`{{provider}}`,e),confirmLabel:n.removeConfirmAction,cancelLabel:n.cancel,destructive:!0,onConfirm:()=>void I(),onCancel:()=>D(!1)}),(0,$.jsx)($e,{open:O!==null,title:s.removeModel,description:s.removeModelConfirm.replace(`{{id}}`,O??``),confirmLabel:n.removeConfirmAction,cancelLabel:n.cancel,destructive:!0,onConfirm:()=>{O&&z(O)},onCancel:()=>k(null)}),(0,$.jsx)(rr,{open:A,onOpenChange:e=>{j(e),e||N(null)},providerId:e,model:M?.model??null,isNew:M?.isNew??!1,onSave:e=>void R(e),m:s})]})}var ur=[`fast`,`reasoning`,`coding`,`review`,`vision`,`understanding`],dr=`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/15`,fr={en:{fast:[`Fast tasks`,`Short, low-latency work`],reasoning:[`Complex reasoning`,`Planning and multi-step analysis`],coding:[`Coding`,`Implementation and debugging`],review:[`Review`,`Critique and verification`],vision:[`Vision`,`Image and visual analysis`],understanding:[`Understanding`,`Long-form content comprehension`]},zh:{fast:[`快速任务`,`简短、低延迟的工作`],reasoning:[`复杂推理`,`规划和多步骤分析`],coding:[`编程`,`实现、调试和代码修改`],review:[`审查`,`检查、批评和验证`],vision:[`视觉任务`,`图片和视觉内容分析`],understanding:[`内容理解`,`长内容阅读和理解`]}};function pr(e,t){return{primary:t,fallbacks:e?.fallbacks??[]}}function mr(e){let t=(0,$t.c)(38),{draft:n,setDraft:r,zh:i,capability:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={revalidateOnFocus:!1},t[0]=o):o=t[0];let s=X(Pe,Ne,o),c;t[1]===s.data?c=t[2]:(c=s.data??[],t[1]=s.data,t[2]=c);let l=c,u=i?fr.zh:fr.en,d;t[3]!==n||t[4]!==r?(d=(e,t)=>{let i={...n.models.intents};t?i[e]=pr(i[e],t):delete i[e],r({...n,models:{...n.models,intents:i}})},t[3]=n,t[4]=r,t[5]=d):d=t[5];let f=d,p;t[6]!==a||t[7]!==n||t[8]!==l||t[9]!==s.error||t[10]!==s.isLoading||t[11]!==r||t[12]!==i?(p=a===`chat`?(0,$.jsx)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:(0,$.jsx)(Dt,{title:i?`模型回退`:`Model fallbacks`,summary:i?`已配置 ${n.models.chat.fallbacks.length} 个备用模型。`:`${n.models.chat.fallbacks.length} fallback models configured.`,children:(0,$.jsx)(`div`,{className:`mt-6 rounded-xl bg-surface-base/45 p-4`,children:(0,$.jsx)(Yt,{primary:n.models.chat.primary,value:n.models.chat.fallbacks,models:l,loading:s.isLoading,error:s.error,zh:i,onChange:e=>r({...n,models:{...n.models,chat:{...n.models.chat,fallbacks:e}}})})})})}):null,t[6]=a,t[7]=n,t[8]=l,t[9]=s.error,t[10]=s.isLoading,t[11]=r,t[12]=i,t[13]=p):p=t[13];let m;t[14]!==a||t[15]!==n||t[16]!==r||t[17]!==i?(m=a===`image`?(0,$.jsx)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:n.models.imageGeneration?(0,$.jsx)(Dt,{title:i?`图片执行策略`:`Image execution policy`,summary:i?`当前超时与回退策略继续生效。`:`The current timeout and fallback policy remains active.`,children:(0,$.jsxs)(`div`,{className:`mt-5 grid gap-4 rounded-xl bg-surface-base/45 p-4 sm:grid-cols-2`,children:[(0,$.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[i?`生成超时(毫秒)`:`Generation timeout (ms)`,(0,$.jsx)(jt,{allowEmpty:!0,type:`number`,min:1,className:`${dr} mt-2`,value:n.models.imageGeneration.timeoutMs??``,onChange:e=>r({...n,models:{...n.models,imageGeneration:{...n.models.imageGeneration,timeoutMs:e.target.value?Number(e.target.value):void 0}}})})]}),(0,$.jsxs)(`div`,{className:`text-xs font-medium text-fg-muted`,children:[(0,$.jsx)(`span`,{children:i?`服务商自动回退`:`Automatic provider fallback`}),(0,$.jsx)(Qe,{className:`mt-1.5 flex rounded-lg bg-surface-panel p-1`,role:`group`,"aria-label":i?`服务商自动回退`:`Automatic provider fallback`,children:[!0,!1].map(e=>(0,$.jsx)(Z,{"aria-pressed":n.models.imageGeneration?.autoProviderFallback===e,variant:n.models.imageGeneration?.autoProviderFallback===e?`secondary`:`ghost`,className:`flex-1 py-1.5 text-xs`,onClick:()=>r({...n,models:{...n.models,imageGeneration:{...n.models.imageGeneration,autoProviderFallback:e}}}),children:e?i?`开启`:`On`:i?`关闭`:`Off`},String(e)))})]})]})}):null}):null,t[14]=a,t[15]=n,t[16]=r,t[17]=i,t[18]=m):m=t[18];let h;t[19]!==a||t[20]!==n||t[21]!==l||t[22]!==s.error||t[23]!==s.isLoading||t[24]!==r||t[25]!==i?(h=a===`vision`&&n.models.imageUnderstanding?(0,$.jsx)(Dt,{title:i?`模型回退`:`Model fallbacks`,summary:i?`主模型不可用时使用已配置的备用模型。`:`Use configured fallback models when the primary is unavailable.`,children:(0,$.jsx)(Yt,{primary:n.models.imageUnderstanding.primary,value:n.models.imageUnderstanding.fallbacks,models:l.filter(hr),loading:s.isLoading,error:s.error,zh:i,onChange:e=>r({...n,models:{...n.models,imageUnderstanding:{...n.models.imageUnderstanding,fallbacks:e}}})})}):null,t[19]=a,t[20]=n,t[21]=l,t[22]=s.error,t[23]=s.isLoading,t[24]=r,t[25]=i,t[26]=h):h=t[26];let g;t[27]!==a||t[28]!==u||t[29]!==n||t[30]!==f||t[31]!==i?(g=a===`chat`?(0,$.jsx)(Dt,{title:i?`任务模型路由`:`Task model routing`,summary:i?`已配置 ${Object.keys(n.models.intents).length} 类任务路由;其他任务使用默认模型。`:`${Object.keys(n.models.intents).length} task routes configured; other tasks use the default model.`,children:(0,$.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:i?`按任务选择模型`:`Route by task`}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:i?`仅在确实需要不同模型时设置;否则保持“使用默认对话模型”。`:`Set a route only when a task genuinely needs another model; otherwise keep the default.`}),(0,$.jsx)(`div`,{className:`mt-5 grid gap-3 lg:grid-cols-2`,children:ur.map(e=>(0,$.jsxs)(`div`,{className:`rounded-xl bg-surface-base/55 p-4`,children:[(0,$.jsxs)(`div`,{className:`mb-3`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:u[e][0]}),(0,$.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:u[e][1]})]}),(0,$.jsx)(nt,{value:n.models.intents[e]?.primary??``,placeholder:i?`使用默认对话模型`:`Use default conversation model`,searchPlaceholder:i?`搜索模型或服务商`:`Search models or providers`,noMatches:i?`没有匹配的模型`:`No matching models`,allowEmpty:!0,emptyLabel:i?`使用默认对话模型`:`Use default conversation model`,showProviderInTrigger:!1,contentAlign:`start`,className:`w-full`,ariaLabel:i?`${u[e][0]}模型`:`${u[e][0]} model`,onChange:t=>f(e,t)})]},e))})]})}):null,t[27]=a,t[28]=u,t[29]=n,t[30]=f,t[31]=i,t[32]=g):g=t[32];let _;return t[33]!==p||t[34]!==m||t[35]!==h||t[36]!==g?(_=(0,$.jsxs)(`div`,{className:`space-y-5`,children:[p,m,h,g]}),t[33]=p,t[34]=m,t[35]=h,t[36]=g,t[37]=_):_=t[37],_}function hr(e){return e.vision}function gr(e){let t=(0,$t.c)(9),{data:n,error:r}=X(`settings-agent-defaults`,ot);if(r&&!n){let e=String(r),n;return t[0]===e?n=t[1]:(n=(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:e}),t[0]=e,t[1]=n),n}if(!n){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Y,{className:`h-32 rounded-xl`}),t[2]=e):e=t[2],e}let i;t[3]===n.defaults.models?i=t[4]:(i=JSON.stringify(n.defaults.models),t[3]=n.defaults.models,t[4]=i);let a;return t[5]!==n.defaults||t[6]!==e||t[7]!==i?(a=(0,$.jsx)(_r,{...e,initial:n.defaults},i),t[5]=n.defaults,t[6]=e,t[7]=i,t[8]=a):a=t[8],a}function _r(e){let t=(0,$t.c)(36),{initial:n,capability:r,zh:i,disabled:a,onPendingChange:o}=e,s;t[0]===n?s=t[1]:(s=()=>structuredClone(n),t[0]=n,t[1]=s);let[c,l]=(0,Q.useState)(s),u;t[2]===n?u=t[3]:(u=()=>structuredClone(n),t[2]=n,t[3]=u);let[d,f]=(0,Q.useState)(u),p;t[4]===c.models?p=t[5]:(p=JSON.stringify(c.models),t[4]=c.models,t[5]=p);let m;t[6]===d.models?m=t[7]:(m=JSON.stringify(d.models),t[6]=d.models,t[7]=m);let h=p!==m,g;t[8]!==n.models||t[9]!==i?(g=async e=>{let t=await ot();if(JSON.stringify(t.defaults.models)!==JSON.stringify(n.models))throw Error(i?`模型设置已变化,请刷新后重试。`:`Model settings changed. Refresh before retrying.`);let r=await at({...t.defaults,models:e.models},{scope:`models`,expectedModels:n.models});f(r.defaults),await pt()},t[8]=n.models,t[9]=i,t[10]=g):g=t[10];let _=g,v;t[11]!==h||t[12]!==c||t[13]!==_?(v={value:c,dirty:h,onSave:_,delayMs:0},t[11]=h,t[12]=c,t[13]=_,t[14]=v):v=t[14];let y=Lt(v),b=h||y.status===`saving`||!!y.error,x,S;t[15]!==o||t[16]!==b?(x=()=>(o(b),()=>o(!1)),S=[b,o],t[15]=o,t[16]=b,t[17]=x,t[18]=S):(x=t[17],S=t[18]),(0,Q.useEffect)(x,S);let C=a||y.status===`saving`,w;t[19]!==y.error||t[20]!==y.status?(w=(0,$.jsx)(It,{status:y.status,error:y.error}),t[19]=y.error,t[20]=y.status,t[21]=w):w=t[21];let T;t[22]!==y.error||t[23]!==y.retry||t[24]!==i?(T=y.error?(0,$.jsx)(Z,{variant:`secondary`,onClick:y.retry,children:i?`重试保存`:`Retry saving`}):null,t[22]=y.error,t[23]=y.retry,t[24]=i,t[25]=T):T=t[25];let E;t[26]!==r||t[27]!==c||t[28]!==i?(E=(0,$.jsx)(mr,{capability:r,draft:c,setDraft:l,zh:i}),t[26]=r,t[27]=c,t[28]=i,t[29]=E):E=t[29];let D;return t[30]!==y.onBlurCapture||t[31]!==w||t[32]!==T||t[33]!==E||t[34]!==C?(D=(0,$.jsxs)(`fieldset`,{disabled:C,onBlurCapture:y.onBlurCapture,className:`min-w-0 space-y-3`,children:[w,T,E]}),t[30]=y.onBlurCapture,t[31]=w,t[32]=T,t[33]=E,t[34]=C,t[35]=D):D=t[35],D}function vr(e){return e.status===`ready`?`ready`:e.status===`disabled`?`off`:e.status===`degraded`?`degraded`:e.rejected?.length?`misconfigured`:`not-configured`}function yr(e,t){if(e.startsWith(`agentCatalog.defaults.models`))return{label:t?`模型与能力`:`Models and capabilities`,href:`/settings/capabilities/models`};let n=e.match(/^agentCatalog\.agents\.([^.]+)\.models/);return n?.[1]?{label:t?`智能体 ${n[1]}`:`Agent ${n[1]}`,href:it(n[1])}:e.startsWith(`sessions.`)?{label:t?`会话模型覆盖`:`Session model override`,href:`/settings/sessions`}:{label:e,href:`/settings/agent-defaults`}}function br(e,t){switch(e){case`computer-use`:return{guidance:t?`选择兼容的电脑控制模型;本机权限需单独授权`:`Select a compatible computer model; local access requires separate approval`,action:t?`配置电脑控制`:`Configure computer use`};case`vision`:return{guidance:t?`接入支持图片理解的模型服务`:`Connect a model service that supports vision`,action:t?`去接入模型`:`Connect model`};case`image-generation`:return{guidance:t?`选择图片模型并配置所需凭据`:`Choose an image model and configure its credentials`,action:t?`去配置图片生成`:`Configure image generation`};case`stt`:return{guidance:t?`选择语音识别服务,或安装自管 STT 插件`:`Choose a speech-to-text service or install a self-managed STT plugin`,action:t?`去配置语音识别`:`Configure speech-to-text`};case`tts`:return{guidance:t?`选择语音合成服务并完成凭据配置`:`Choose a text-to-speech service and configure its credentials`,action:t?`去配置语音合成`:`Configure text-to-speech`}}}async function xr(){let e=await u(d(`/api/models/catalog`)),t=await e.json().catch(()=>null);if(!e.ok||!t?.ok||!t.payload)throw Error(t?.error?.message??`HTTP ${e.status}`);return t.payload}async function Sr(){let e=await u(d(`/api/capabilities/readiness`)),t=await e.json().catch(()=>null);if(!e.ok||!t?.ok||!t.payload)throw Error(t?.error?.message??`HTTP ${e.status}`);return t.payload}function Cr({showCapabilities:e=!0,embedded:t=!1}={}){let n=p(e=>e.language)===`zh`,{data:r,error:i,isLoading:a}=X(ht,xr,{revalidateOnFocus:!0,refreshInterval:6e4}),{data:o}=X(gt,Sr,{revalidateOnFocus:!1}),[s,c]=(0,Q.useState)(!1),[f,m]=(0,Q.useState)(null),h=Object.values(r?.sources??{}),g=h.reduce((e,t)=>e+t.models.filter(e=>e.availability===`available`).length,0),_=(r?.references??[]).filter(e=>e.availability===`unavailable`),v=r?.sync.lastSuccessAt??Math.max(0,...h.map(e=>e.lastSuccessAt)),y=!!i,b=r?.sync.sourceErrors??{},x=[...r?.sync.lastError?[[`catalog`,r.sync.lastError]]:[],...Object.entries(b),...f?[[`refresh`,f]]:[],...i instanceof Error?[[`load`,i.message]]:[]],S=r?.sync.lastAttemptAt??v,w=Object.entries(o?.capabilities??{}).filter(([e])=>e!==`computer-use`||Ye()),T=w.some(([,e])=>{let t=vr(e);return t===`degraded`||t===`misconfigured`}),E=w.filter(([,e])=>vr(e)===`ready`).length,D=(0,Q.useRef)(null);if((0,Q.useEffect)(()=>{T&&!a&&D.current?.setAttribute(`open`,``)},[T,a]),a)return(0,$.jsx)(Y,{className:`h-24 w-full rounded-2xl`});let k=async()=>{c(!0),m(null);try{let e=await u(d(`/api/models/catalog/refresh`),{method:`POST`});if(!e.ok)throw Error(`HTTP ${e.status}`);await pt()}catch(e){m(e instanceof Error?e.message:String(e))}finally{c(!1)}},A=(0,$.jsx)(`div`,{className:`mt-2 space-y-1 rounded-lg bg-surface-base/45 p-2 font-mono text-[11px] leading-5`,"aria-label":n?`同步错误详情`:`Sync error details`,children:x.map(([e,t],n)=>(0,$.jsxs)(`p`,{className:`break-words`,children:[e,`: `,t]},`${e}-${n}`))}),j=(0,$.jsxs)(`div`,{className:`mt-3 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 text-xs text-fg-muted`,children:[(0,$.jsx)(`p`,{children:n?`${h.length} 个来源,${g} 个可用模型${v?` · 最近同步 ${new Date(v).toLocaleString()}`:``}`:`${h.length} sources, ${g} available models${v?` · Last synced ${new Date(v).toLocaleString()}`:``}`}),x.length>0?t?(0,$.jsxs)(`details`,{className:`mt-2 rounded-lg bg-surface-base/45 p-2`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer rounded text-xs font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:n?`高级诊断`:`Advanced diagnostics`}),A]}):A:null]}),(0,$.jsxs)(Z,{className:`shrink-0`,type:`button`,variant:`secondary`,disabled:s,onClick:()=>void k(),children:[s?(0,$.jsx)(ge,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(be,{className:`size-4`,"aria-hidden":!0}),s?n?`刷新中…`:`Refreshing…`:n?`刷新目录`:`Refresh catalog`]})]});return(0,$.jsxs)(`section`,{className:t?`mt-4 border-t border-edge-subtle pt-1`:`rounded-xl bg-surface-hover/25 p-4 sm:p-5`,children:[e?(0,$.jsxs)(`details`,{ref:D,className:`group`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer list-none rounded-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:(0,$.jsxs)(`div`,{className:`flex min-h-10 items-center gap-2`,children:[T?(0,$.jsx)(Te,{className:`size-4 text-amber-500`,"aria-hidden":!0}):E===w.length&&w.length>0?(0,$.jsx)(M,{className:`size-4 text-emerald-500`,"aria-hidden":!0}):(0,$.jsx)(P,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`span`,{className:`block text-sm font-semibold text-fg`,children:n?`可选能力`:`Optional capabilities`}),(0,$.jsx)(`span`,{className:`mt-0.5 block text-xs font-normal text-fg-muted`,children:n?`${E}/${w.length} 项已配置,不影响基础聊天功能`:`${E} of ${w.length} configured · Not required for chat`})]}),(0,$.jsx)(O,{className:`size-4 shrink-0 text-fg-subtle transition-transform group-open:rotate-90 motion-reduce:transition-none`,"aria-hidden":!0})]})}),o?(0,$.jsx)(`div`,{className:`mt-3 grid gap-1 sm:grid-cols-2`,children:Object.entries(o.capabilities).map(([e,t])=>{if(e===`computer-use`&&!Ye())return null;let r=e===`vision`?n?`图片理解`:`Vision`:e===`image-generation`?n?`图片生成`:`Image generation`:e===`computer-use`?n?`电脑控制模型`:`Computer use model`:e.toUpperCase(),i=t.selectionSource!==`explicit-config`,a=vr(t),o=a===`degraded`||a===`misconfigured`,s=br(e,n),c=(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,$.jsx)(`span`,{className:`min-w-0 text-xs font-medium text-fg`,children:r}),(0,$.jsx)(`span`,{className:a===`ready`?`shrink-0 text-xs text-emerald-600 dark:text-emerald-400`:a===`off`||a===`not-configured`?`shrink-0 text-xs text-fg-muted`:`shrink-0 text-xs text-amber-600 dark:text-amber-400`,children:a===`ready`?e===`computer-use`?n?`已配置`:`Configured`:n?`可用`:`Ready`:a===`off`?n?`已关闭`:`Off`:a===`not-configured`?n?`未配置`:`Not configured`:a===`degraded`?n?`正在使用备用方案`:`Using fallback`:n?`需处理`:`Needs attention`})]}),(0,$.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-muted`,title:t.primary?`${t.primary.provider}/${t.primary.model}`:void 0,children:t.primary?`${i?n?`自动`:`Auto`:n?`显式`:`Explicit`} · ${t.primary.provider}/${t.primary.model}`:a===`not-configured`?n?`可稍后按需配置`:`Set up later if needed`:n?`已配置的模型不可用`:`The configured model is unavailable`}),o?(0,$.jsxs)(`div`,{className:`mt-2 rounded-lg bg-amber-500/10 p-2`,children:[(0,$.jsx)(`p`,{className:`text-xs leading-5 text-amber-700 dark:text-amber-300`,children:t.status===`degraded`?n?`当前配置不可用,正在使用备用方案。${s.guidance}`:`The current configuration is unavailable, so a fallback is in use. ${s.guidance}.`:s.guidance}),(0,$.jsxs)(`span`,{className:`mt-1 inline-flex items-center gap-1 text-xs font-medium text-accent`,children:[s.action,(0,$.jsx)(C,{className:`size-3.5`,"aria-hidden":!0})]})]}):null]}),u={"aria-label":o?`${r}:${s.action}`:`${n?`配置`:`Configure`} ${r}`,className:J(`rounded-lg bg-surface-base/45 px-3 py-3 text-left transition-colors`,o?`bg-amber-500/5 hover:bg-amber-500/10`:`hover:bg-surface-hover/30`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`)};if(e===`computer-use`)return(0,$.jsx)(l,{to:`/settings/computer-use`,...u,children:c},e);let d={vision:`vision`,"image-generation":`image`,stt:`transcription`,tts:`speech`}[e];return(0,$.jsx)(`button`,{type:`button`,"aria-haspopup":`dialog`,...u,onClick:()=>Le(d,o?`services`:`settings`),children:c},e)})}):null]}):null,_.length>0?(0,$.jsx)(`div`,{className:`mt-3 space-y-2`,"aria-live":`polite`,children:_.map(e=>(0,$.jsx)(`div`,{className:`rounded-lg border border-amber-500/25 bg-amber-500/5 p-3`,children:(()=>{let t=e.ref.split(`/`)[0]??``,r=!!b[t],i=yr(e.locations[0]??``,n);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,$.jsx)(Te,{className:`mt-0.5 size-4 shrink-0 text-amber-500`,"aria-hidden":!0}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`p`,{className:`break-words text-sm font-medium text-fg`,children:[e.ref,(0,$.jsx)(`span`,{className:`ml-2 font-normal text-amber-700 dark:text-amber-300`,children:r?n?`暂时无法验证`:`Temporarily unverified`:n?`不可用`:`Unavailable`})]}),(0,$.jsxs)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:[r?n?`模型目录同步暂时失败,当前状态可能已过期;不会影响其他可用模型。`:`Catalog sync temporarily failed, so this status may be stale. Other available models are unaffected.`:n?`此模型已无法从当前配置中解析,使用它的功能可能失败。`:`This model no longer resolves from the current configuration. Features using it may fail.`,S?` · ${n?`最近检测`:`Last checked`} ${new Date(S).toLocaleString()}`:``]}),e.suggestedRef?(0,$.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[n?`可替换为`:`Suggested replacement`,`:`,(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:e.suggestedRef})]}):null]})]}),(0,$.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1`,children:[(0,$.jsxs)(Z,{className:`px-2.5 py-1.5 text-xs`,variant:`ghost`,disabled:s,onClick:()=>void k(),children:[s?(0,$.jsx)(ge,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(be,{className:`size-3.5`,"aria-hidden":!0}),s?n?`检测中…`:`Checking…`:n?`重新检测`:`Check again`]}),(0,$.jsx)(Z,{asChild:!0,className:`px-2.5 py-1.5 text-xs`,variant:`ghost`,children:(0,$.jsxs)(l,{to:i.href,children:[(0,$.jsx)(Ee,{className:`size-3.5`,"aria-hidden":!0}),e.suggestedRef?n?`更换模型`:`Replace model`:n?`调整配置`:`Adjust configuration`]})}),(0,$.jsxs)(`details`,{className:`group/references`,children:[(0,$.jsxs)(`summary`,{className:`touch-target inline-flex cursor-pointer list-none items-center gap-1 rounded-xl px-2.5 py-1.5 text-xs font-medium text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[n?`查看 ${e.locations.length} 处引用`:`View ${e.locations.length} ${e.locations.length===1?`reference`:`references`}`,(0,$.jsx)(O,{className:`size-3.5 transition-transform group-open/references:rotate-90 motion-reduce:transition-none`,"aria-hidden":!0})]}),(0,$.jsx)(`ul`,{className:`mt-1 space-y-1 pl-2 text-xs text-fg-muted`,children:e.locations.map(e=>{let t=yr(e,n);return(0,$.jsx)(`li`,{children:(0,$.jsx)(l,{className:`inline-flex rounded px-1.5 py-1 text-accent hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,to:t.href,title:e,children:t.label})},e)})})]})]})]})})()},e.ref))}):null,y||f?(0,$.jsx)(`p`,{className:`mt-3 text-sm text-danger`,role:`alert`,children:y?n?`暂时无法读取模型状态,请重新检测;详细信息可在高级诊断中查看。`:`Model status is temporarily unavailable. Check again; details are available in Advanced diagnostics.`:n?`重新检测失败,请稍后重试;详细信息可在高级诊断中查看。`:`The check failed. Try again later; details are available in Advanced diagnostics.`}):null,t?j:(0,$.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-3`,children:[(0,$.jsx)(`summary`,{className:`min-h-8 cursor-pointer rounded-md py-1.5 text-xs font-medium text-fg-muted hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:n?`高级诊断`:`Advanced diagnostics`}),j]})]})}var wr=()=>d(`/api/music-generation/settings`),Tr=new Map([[`mureka-cn`,`https://platform.mureka.cn/`],[`mureka-global`,`https://platform.mureka.ai/`]]),Er={secretId:`SecretId`,secretKey:`SecretKey`},Dr=[`secretId`,`secretKey`];function Or(e,t){return e===`mureka-cn`?t?`Mureka 中国站`:`Mureka China`:e===`mureka-global`?t?`Mureka 国际站`:`Mureka Global`:e===`tencent-mps`?t?`腾讯云媒体处理(MPS)`:`Tencent Cloud MPS`:e===`xopc-cloud`?`XOPC Cloud`:e}function kr({zh:e,disabled:t,onManageCloud:n}){let{data:r,error:i,mutate:a}=X(wr(),m),{mutate:o}=Ae(),[s,c]=(0,Q.useState)(),[l,u]=(0,Q.useState)(),[f,p]=(0,Q.useState)(),[h,C]=(0,Q.useState)({}),[T,E]=(0,Q.useState)(!1),[D,O]=(0,Q.useState)(``),M=r?.models.find(e=>e.ref===r.modelRef),N=r?.models.find(e=>e.ref===l?.modelRef),ee=t=>t===`song`?e?`歌曲`:`Song`:e?`纯音乐`:`Instrumental`,P=s?r?.credentials[s]:void 0,F=s?Tr.get(s):void 0,I=s===Qt,L=s?`${wr()}/credentials/${encodeURIComponent(s)}`:``,R=f??(P===`saved`?`••••••••••••`:``),z=f?.trim()??``,B=I?Dr.every(e=>{let t=h[e]?.trim()??``;return t&&!Ge(t)}):!!(z&&!Ge(z)),V=t=>t===`saved`?e?`已保存密钥`:`Credentials saved`:t===`oauth`?e?`已连接`:`Connected`:t===`environment`?e?`使用环境变量`:`Using environment variables`:e?`待连接`:`Connection needed`;async function H(e,n,r){if(t||T)return!1;E(!0),O(``);try{let t=await m(e,{method:n,body:r&&JSON.stringify(r)});return await a(t,{revalidate:!1}),o(e=>typeof e==`string`&&e.startsWith(d(`/api/music-generation/sessions/`))),!0}catch(e){return O(e instanceof Error?e.message:String(e)),!1}finally{E(!1)}}function U(){c(void 0),u(void 0),p(void 0),C({}),O(``)}return(0,$.jsxs)(`div`,{"data-capability":`music`,children:[(0,$.jsx)(Wn,{actionColumn:!0,description:(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:e?`创作音乐`:`Music generation`}),M&&(0,$.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:V(r?.credentials[M.providerId])})]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:e?`生成带歌词的歌曲和纯音乐`:`Generate songs with lyrics and instrumental tracks`})]}),picker:r&&M?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(j,{placeholder:e?`选择模型`:`Choose a model`,ariaLabel:e?`选择音乐生成模型`:`Select music generation model`,value:r.modelRef,allowEmpty:!1,triggerClassName:`min-h-11`,disabled:t||T,onChange:e=>{e!==r.modelRef&&H(wr(),`PUT`,{modelRef:e})},options:r.models.map(t=>({value:t.ref,label:t.name,group:Or(t.providerId,e)}))}),(0,$.jsx)(Un,{name:Or(M.providerId,e),manageLabel:e?`管理服务`:`Manage services`,disabled:t||T,onManage:M.providerId===`xopc-cloud`?n:()=>{O(``),c(M.providerId)}}),M.creditMicroPerTrack&&(0,$.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[ke(String(M.creditMicroPerTrack)),` `,e?`Credits / 首`:`Credits / track`]}),T&&!s&&!l&&(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:e?`正在切换…`:`Switching…`}),!s&&!l&&D&&(0,$.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:D})]}):i?(0,$.jsxs)(`div`,{role:`alert`,className:`text-sm text-danger`,children:[e?`音乐模型加载失败`:`Could not load music models`,(0,$.jsx)(Z,{variant:`ghost`,onClick:()=>void a(),children:e?`重试`:`Retry`})]}):(0,$.jsx)(Y,{className:`h-11 w-full rounded-xl`}),actions:r&&M&&(0,$.jsx)(Z,{variant:`ghost`,className:`min-h-11`,disabled:t||T,onClick:()=>{O(``),u({modelRef:r.modelRef,mode:r.defaults?.mode??M.modes[0]??`song`})},children:e?`设置`:`Settings`})}),(0,$.jsx)(S,{open:!!l,onOpenChange:e=>{!e&&!T&&U()},children:(0,$.jsxs)(y,{children:[(0,$.jsx)(g,{className:`fixed inset-0 z-[150] bg-scrim`}),(0,$.jsxs)(b,{className:`fixed left-1/2 top-1/2 z-[151] flex h-[min(20rem,calc(100dvh-2rem))] w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay`,children:[(0,$.jsxs)(`header`,{className:`border-b border-edge px-5 py-4`,children:[(0,$.jsx)(x,{className:`font-semibold text-fg`,children:e?`音乐生成设置`:`Music generation settings`}),(0,$.jsx)(_,{className:`mt-1 text-sm text-fg-muted`,children:N&&[Or(N.providerId,e),N.name].join(` · `)})]}),l&&N&&(0,$.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:async e=>{e.preventDefault(),await H(wr(),`PATCH`,l)&&U()},children:[(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto px-5 py-4 text-sm`,children:[(0,$.jsx)(`label`,{htmlFor:`music-default-mode`,className:`block font-medium text-fg`,children:e?`默认创作类型`:`Default creation type`}),(0,$.jsx)(k,{id:`music-default-mode`,value:l.mode,disabled:T,onChange:e=>u({...l,mode:e.target.value}),children:N.modes.map(e=>(0,$.jsx)(A,{value:e,children:ee(e)},e))}),(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e?`聊天中未指定类型时使用。`:`Used when the chat request does not specify a type.`}),D&&(0,$.jsx)(`p`,{role:`alert`,className:`break-words text-xs text-danger`,children:D})]}),(0,$.jsxs)(`footer`,{className:`flex justify-end gap-2 border-t border-edge px-5 py-3`,children:[(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(Z,{variant:`ghost`,disabled:T,children:e?`取消`:`Cancel`})}),(0,$.jsx)(Z,{type:`submit`,variant:`primary`,disabled:t||T,children:T?e?`正在保存…`:`Saving…`:e?`保存`:`Save`})]})]})]})]})}),(0,$.jsx)(S,{open:!!s,onOpenChange:e=>{!e&&!T&&U()},children:(0,$.jsxs)(y,{children:[(0,$.jsx)(g,{className:`fixed inset-0 z-[150] bg-scrim`}),(0,$.jsxs)(b,{className:`fixed left-1/2 top-1/2 z-[151] flex h-[min(23rem,calc(100dvh-2rem))] w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay`,children:[(0,$.jsxs)(`header`,{className:`border-b border-edge px-5 py-4`,children:[(0,$.jsx)(x,{className:`font-semibold text-fg`,children:s&&Or(s,e)}),(0,$.jsx)(_,{className:`mt-1 text-sm text-fg-muted`,children:V(P)})]}),s&&(0,$.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:async e=>{e.preventDefault(),B&&await H(L,`PUT`,I?h:{apiKey:z})&&U()},children:[(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-3 overflow-y-auto px-5 py-4`,children:[I?(0,$.jsxs)($.Fragment,{children:[Dr.map(n=>{let r=h[n]??(P===`saved`?`••••••••••••`:``),i=Er[n];return(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`label`,{htmlFor:`music-provider-${n}`,className:`block text-sm font-medium text-fg`,children:i}),(0,$.jsx)(fe,{id:`music-provider-${n}`,autoComplete:`new-password`,value:r,disabled:t||T,onChange:e=>C(t=>({...t,[n]:Ge(r)?e.replace(/^•+/,``):e})),labels:e?{show:`显示 ${i}`,hide:`隐藏 ${i}`,copy:`复制 ${i}`,copied:`已复制`}:{show:`Show ${i}`,hide:`Hide ${i}`,copy:`Copy ${i}`,copied:`Copied`},reveal:P===`saved`?()=>m(L,{method:`POST`,body:JSON.stringify({field:n})}).then(e=>e.value):void 0,allowUnrevealedCopy:!0,loadFailedLabel:e?`无法读取已保存的密钥。`:`Could not load the saved credential.`})]},n)}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-xs`,children:[(0,$.jsxs)(`a`,{href:`https://console.cloud.tencent.com/mps`,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-accent-fg hover:underline`,children:[e?`开通腾讯云 MPS`:`Activate Tencent Cloud MPS`,(0,$.jsx)(w,{className:`size-3.5`,"aria-hidden":!0})]}),(0,$.jsxs)(`a`,{href:`https://console.cloud.tencent.com/cam/capi`,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-accent-fg hover:underline`,children:[e?`管理腾讯云 API 密钥`:`Manage Tencent Cloud API keys`,(0,$.jsx)(w,{className:`size-3.5`,"aria-hidden":!0})]})]}),(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e?`请填写同一对密钥。更新时需重新填写两项。`:`Enter a matching pair. Fill in both fields when replacing credentials.`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-3 gap-y-1`,children:[(0,$.jsx)(`label`,{className:`text-sm font-medium text-fg`,htmlFor:`music-provider-api-key`,children:`API Key`}),F&&(0,$.jsxs)(`a`,{href:F,target:`_blank`,rel:`noreferrer`,className:`inline-flex min-h-8 items-center gap-1 rounded-sm text-xs text-accent-fg hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[e?`获取 API Key`:`Get an API key`,(0,$.jsx)(w,{className:`size-3.5`,"aria-hidden":!0})]})]}),(0,$.jsx)(fe,{id:`music-provider-api-key`,autoComplete:`new-password`,value:R,disabled:t||T,onChange:e=>p(Ge(R)?e.replace(/^•+/,``):e),placeholder:e?`粘贴 API Key`:`Paste your API key`,labels:e?{show:`显示密钥`,hide:`隐藏密钥`,copy:`复制密钥`,copied:`已复制`}:{show:`Show key`,hide:`Hide key`,copy:`Copy key`,copied:`Copied`},reveal:P===`saved`?()=>yt(s).then(e=>e.apiKey):void 0,allowUnrevealedCopy:!0,loadFailedLabel:e?`无法读取已保存的 API Key。`:`Could not load the saved API key.`,notInConfigFile:e?`网关中没有可查看的密钥。`:`No saved key is available to show.`},s),F&&(0,$.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:e?`登录对应站点的 Mureka 开放平台,在「API Keys」创建密钥,然后粘贴到这里并保存。`:`Sign in to this region’s Mureka API platform, create a key under API Keys, then paste it here and save.`})]}),D&&(0,$.jsx)(`p`,{role:`alert`,className:`break-words text-xs text-danger`,children:D})]}),(0,$.jsxs)(`footer`,{className:`flex items-center justify-end gap-2 border-t border-edge px-5 py-3`,children:[P===`saved`&&(0,$.jsx)(Z,{variant:`ghost`,type:`button`,className:`mr-auto`,disabled:T,onClick:async()=>{await H(L,`DELETE`)&&U()},children:e?`移除密钥`:`Remove key`}),(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(Z,{variant:`ghost`,disabled:T,children:e?`取消`:`Cancel`})}),(0,$.jsx)(Z,{type:`submit`,variant:`primary`,disabled:t||T||!B,children:T?e?`正在保存…`:`Saving…`:e?`保存`:`Save`})]})]})]})]})})]})}function Ar({zh:e,disabled:t,onManage:n}){let{data:r,error:i,mutate:a}=ft(),{mutate:o}=Ae(),[s,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(``),[f,p]=(0,Q.useState)(null),h=e=>r?.models?.[e]??E[e],C=r&&h(r.modelRef),w=C&&r?.configured[C.provider],O=t=>t===`dashscope-cn`?e?`阿里云百炼`:`Alibaba Cloud Bailian`:t===`xopc-cloud`?`XOPC Cloud`:e?`火山方舟`:`Volcengine Ark`;async function M(e,n){if(t||s)return!1;c(!0),u(``);try{let t=await m(d(mt),{method:e,body:JSON.stringify(n)});return await a(t,{revalidate:!1}),o(e=>typeof e==`string`&&e.startsWith(d(`/api/video-generation/sessions/`))),!0}catch(e){return u(e instanceof Error?e.message:String(e)),!1}finally{c(!1)}}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{"data-capability":`video`,children:(0,$.jsx)(Wn,{actionColumn:!0,description:(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:e?`生成视频`:`Video generation`}),C&&!w&&(0,$.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:e?`待连接`:`Connection needed`})]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:e?`文生视频和图生视频`:`Text-to-video and image-to-video`})]}),picker:r&&C?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(j,{placeholder:e?`选择模型`:`Choose a model`,ariaLabel:e?`选择视频生成模型`:`Select video generation model`,value:r.modelRef,triggerClassName:`min-h-11`,allowEmpty:!1,disabled:t||s,onChange:e=>{e!==r.modelRef&&M(`PUT`,{modelRef:e})},options:(r.modelRefs??D).map(e=>{let t=h(e);return{value:e,label:t.name,group:O(t.provider)}})}),(0,$.jsx)(Un,{name:O(C.provider),manageLabel:e?`管理服务`:`Manage services`,onManage:()=>n(C.provider),disabled:t||s}),s&&(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:e?`正在切换…`:`Switching…`}),!f&&l&&(0,$.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:l})]}):i?(0,$.jsxs)(`div`,{role:`alert`,className:`text-sm text-danger`,children:[e?`视频模型加载失败`:`Could not load video models`,(0,$.jsx)(Z,{variant:`ghost`,onClick:()=>void a(),children:e?`重试`:`Retry`})]}):(0,$.jsx)(Y,{className:`h-11 w-full rounded-xl`}),actions:r&&C&&(0,$.jsx)(Z,{variant:`ghost`,className:`min-h-11`,disabled:t||s,onClick:()=>{u(``),p({modelRef:r.modelRef,...r.defaults})},children:e?`设置`:`Settings`})})}),(0,$.jsx)(S,{open:!!f,onOpenChange:e=>{!e&&!s&&(p(null),u(``))},children:(0,$.jsxs)(y,{children:[(0,$.jsx)(g,{className:`fixed inset-0 z-[150] bg-scrim`}),(0,$.jsxs)(b,{className:`fixed left-1/2 top-1/2 z-[151] flex h-[min(22rem,calc(100dvh-2rem))] w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay`,children:[(0,$.jsxs)(`header`,{className:`border-b border-edge px-5 py-4`,children:[(0,$.jsx)(x,{className:`font-semibold text-fg`,children:e?`视频生成设置`:`Video generation settings`}),(0,$.jsxs)(_,{className:`mt-1 text-sm text-fg-muted`,children:[f&&h(f.modelRef).name,` · `,e?`新任务的默认参数`:`Defaults for new jobs`]})]}),f&&(0,$.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:async e=>{e.preventDefault(),await M(`PATCH`,f)&&p(null)},children:[(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-5 py-4 text-sm`,children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`p`,{children:e?`默认时长`:`Default duration`}),(0,$.jsx)(k,{"aria-label":e?`默认时长`:`Default duration`,value:String(f.duration),disabled:s,onChange:e=>p({...f,duration:Number(e.target.value)}),children:T(h(f.modelRef)).map(t=>(0,$.jsx)(A,{value:String(t),children:t===-1?e?`自动`:`Auto`:`${t}s`},t))})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`p`,{children:e?`默认分辨率`:`Default resolution`}),(0,$.jsx)(k,{"aria-label":e?`默认分辨率`:`Default resolution`,value:f.resolution,disabled:s,onChange:e=>p({...f,resolution:e.target.value}),children:h(f.modelRef).resolutions.map(e=>(0,$.jsx)(A,{value:e,children:e.toLowerCase()},e))})]}),l&&(0,$.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:l})]}),(0,$.jsxs)(`footer`,{className:`flex justify-end gap-2 border-t border-edge px-5 py-3`,children:[(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(Z,{variant:`ghost`,disabled:s,children:e?`取消`:`Cancel`})}),(0,$.jsx)(Z,{type:`submit`,variant:`primary`,disabled:s,children:s?e?`正在保存…`:`Saving…`:e?`保存`:`Save`})]})]})]})]})})]})}function jr(e){let t=(0,$t.c)(183),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{inlineUse:r,inlineView:i,onViewChange:u,onPendingChange:d}=n,f=i===void 0?`settings`:i,m=p(Fr),g=m===`zh`,_;t[2]===m?_=t[3]:(_=h(m),t[2]=m,t[3]=_);let v=_.capabilitiesSettings,{capability:y}=s(),[b,x]=a(),{state:S}=o(),C;t[4]===b?C=t[5]:(C=ut(b.get(`returnTo`)),t[4]=b,t[5]=C);let w=C,[T,E]=(0,Q.useState)(),[D,O]=(0,Q.useState)(!1),[k,A]=(0,Q.useState)(!1),[j,M]=(0,Q.useState)(!1),[N,ee]=(0,Q.useState)(!1),P=j||N||k,[F,I]=(0,Q.useState)(!1),[L,R]=(0,Q.useState)(null),z=ne(),B;t[6]===z.cards?B=t[7]:(B=z.cards.some(Pr),t[6]=z.cards,t[7]=B);let V=B,H=Nr,U,te;t[8]!==d||t[9]!==P?(U=()=>(d?.(P),()=>d?.(!1)),te=[P,d],t[8]=d,t[9]=P,t[10]=U,t[11]=te):(U=t[10],te=t[11]),(0,Q.useEffect)(U,te);let W,G;t[12]!==y||t[13]!==r||t[14]!==S||t[15]!==b||t[16]!==x?(W=()=>{if(r||y!==`models`)return;let e=ct(b.get(`configure`));if(!e&&b.get(`add`)!==`1`)return;let t=window.setTimeout(()=>{e?Le(e,b.get(`tab`)===`services`?`services`:`settings`):I(!0);let t=new URLSearchParams(b);t.delete(`configure`),t.delete(`tab`),t.delete(`add`),x(t,{replace:!0,state:S})},0);return()=>window.clearTimeout(t)},G=[y,r,b,x,S],t[12]=y,t[13]=r,t[14]=S,t[15]=b,t[16]=x,t[17]=W,t[18]=G):(W=t[17],G=t[18]),(0,Q.useEffect)(W,G);let re;t[19]!==r||t[20]!==u||t[21]!==P?(re=e=>{if(!P){if(!r){Le(e,`services`);return}u?.(`services`),E(void 0)}},t[19]=r,t[20]=u,t[21]=P,t[22]=re):re=t[22];let K=re,oe;t[23]===u?oe=t[24]:(oe=e=>{H(),u?.(`settings`),E(e)},t[23]=u,t[24]=oe);let se=oe;if(r){let e=f===`services`,n=N||k,i;t[25]!==r||t[26]!==K||t[27]!==z||t[28]!==n||t[29]!==g?(i=(0,$.jsx)(qn,{data:z,zh:g,onlyUse:r,disabled:n,onPendingChange:M,onChange:K}),t[25]=r,t[26]=K,t[27]=z,t[28]=n,t[29]=g,t[30]=i):i=t[30];let a;t[31]!==e||t[32]!==i?(a=(0,$.jsx)(`div`,{hidden:e,children:i}),t[31]=e,t[32]=i,t[33]=a):a=t[33];let o;t[34]!==T||t[35]!==r||t[36]!==f||t[37]!==g?(o=T===r&&f===`settings`?(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:g?`服务设置已保存`:`Service settings saved`}):null,t[34]=T,t[35]=r,t[36]=f,t[37]=g,t[38]=o):o=t[38];let s=f!==`services`,c;t[39]!==se||t[40]!==r?(c=()=>se(r),t[39]=se,t[40]=r,t[41]=c):c=t[41];let l;t[42]!==v.addProviderDialog||t[43]!==r||t[44]!==m||t[45]!==z||t[46]!==c?(l=(0,$.jsx)(jn,{inline:!0,onEditingChange:O,use:r,data:z,language:m,labels:v.addProviderDialog,onPendingChange:A,onSaved:c},r),t[42]=v.addProviderDialog,t[43]=r,t[44]=m,t[45]=z,t[46]=c,t[47]=l):l=t[47];let d;t[48]!==se||t[49]!==D||t[50]!==r||t[51]!==z.builtinRows||t[52]!==g?(d=r===`transcription`||r===`speech`?(0,$.jsx)(`div`,{hidden:D,children:(0,$.jsx)(Vn,{kind:r===`transcription`?`stt`:`tts`,modelServiceIds:z.builtinRows.map(Mr),zh:g,onPendingChange:A,onSaved:()=>se(r)},r)}):null,t[48]=se,t[49]=D,t[50]=r,t[51]=z.builtinRows,t[52]=g,t[53]=d):d=t[53];let p;t[54]!==D||t[55]!==r||t[56]!==u||t[57]!==g?(p=r===`conversation`&&!D&&(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 rounded-lg border border-edge p-3`,children:[(0,$.jsx)(`span`,{className:`text-sm text-fg`,children:`Boson AI · Higgs Realtime`}),(0,$.jsx)(Z,{variant:`secondary`,onClick:()=>u?.(`settings`),children:g?`配置 Boson`:`Configure Boson`})]}),t[54]=D,t[55]=r,t[56]=u,t[57]=g,t[58]=p):p=t[58];let h;t[59]!==se||t[60]!==r?(h=r===`image`?(0,$.jsx)(gn,{connectOnly:!0,onPendingChange:A,onConnected:()=>se(r)}):null,t[59]=se,t[60]=r,t[61]=h):h=t[61];let _;t[62]!==k||t[63]!==s||t[64]!==l||t[65]!==d||t[66]!==p||t[67]!==h?(_=(0,$.jsxs)(`fieldset`,{hidden:s,disabled:k,className:`min-w-0 space-y-3`,children:[l,d,p,h]}),t[62]=k,t[63]=s,t[64]=l,t[65]=d,t[66]=p,t[67]=h,t[68]=_):_=t[68];let y=f===`services`,b;t[69]!==k||t[70]!==r||t[71]!==j?(b=r===`transcription`||r===`speech`||r===`conversation`?(0,$.jsx)(Ve,{capability:r,onPendingChange:ee,disabled:j||k},r):null,t[69]=k,t[70]=r,t[71]=j,t[72]=b):b=t[72];let x;t[73]!==k||t[74]!==r||t[75]!==j||t[76]!==g?(x=r===`chat`||r===`vision`||r===`image`?(0,$.jsx)(gr,{capability:r,zh:g,disabled:j||k,onPendingChange:ee}):null,t[73]=k,t[74]=r,t[75]=j,t[76]=g,t[77]=x):x=t[77];let S;t[78]!==r||t[79]!==g?(S=r===`background`?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:g?`使用所选模型执行自动化、定时和无人值守任务。此设置不会启用任务,也不会自动改用其他计费服务。`:`Use the selected model for automations, schedules and unattended tasks. This does not enable tasks or automatically switch billing services.`}):null,t[78]=r,t[79]=g,t[80]=S):S=t[80];let C;t[81]!==y||t[82]!==b||t[83]!==x||t[84]!==S?(C=(0,$.jsxs)(`div`,{hidden:y,className:`space-y-4`,children:[b,x,S]}),t[81]=y,t[82]=b,t[83]=x,t[84]=S,t[85]=C):C=t[85];let w;t[86]!==K||t[87]!==o||t[88]!==_||t[89]!==C?(w=(0,$.jsxs)(Be.Provider,{value:K,children:[o,_,C]}),t[86]=K,t[87]=o,t[88]=_,t[89]=C,t[90]=w):w=t[90];let E;return t[91]!==a||t[92]!==w?(E=(0,$.jsxs)(`div`,{className:`min-w-0 space-y-4`,children:[a,w]}),t[91]=a,t[92]=w,t[93]=E):E=t[93],E}if(y===`search`){let e;t[94]===m?e=t[95]:(e=h(m),t[94]=m,t[95]=e);let n;t[96]===e.nav.settingsSearch?n=t[97]:(n=(0,$.jsx)(Nt,{title:e.nav.settingsSearch}),t[96]=e.nav.settingsSearch,t[97]=n);let r;t[98]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(Dn,{}),t[98]=r):r=t[98];let i;return t[99]===n?i=t[100]:(i=(0,$.jsxs)(Mt,{children:[n,r]}),t[99]=n,t[100]=i),i}if(y!==`models`){let e;return t[101]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(c,{to:`/settings/capabilities/models`,replace:!0}),t[101]=e):e=t[101],e}let ce=g?`模型与能力`:`Models and capabilities`,le=g?`按用途选择模型,点击服务商名称管理连接。`:`Choose models by purpose. Select a provider name to manage its connection.`,q;t[102]===m?q=t[103]:(q=Je(m,`configuration`),t[102]=m,t[103]=q);let ue;t[104]!==v.docsLink||t[105]!==q?(ue=(0,$.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,$.jsx)(`a`,{href:q,target:`_blank`,rel:`noreferrer`,className:`inline-flex min-h-11 items-center rounded-lg px-2 text-xs text-fg-muted hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:v.docsLink})}),t[104]=v.docsLink,t[105]=q,t[106]=ue):ue=t[106];let de;t[107]!==ce||t[108]!==le||t[109]!==ue?(de=(0,$.jsx)(Nt,{title:ce,subtitle:le,actions:ue}),t[107]=ce,t[108]=le,t[109]=ue,t[110]=de):de=t[110];let fe;t[111]!==w||t[112]!==g?(fe=w?(0,$.jsx)(l,{to:w,className:`text-sm text-accent-fg hover:underline`,children:w===`/settings/phone-use`?g?`返回手机控制并测试模型`:`Return to phone control and test the model`:g?`返回原来的工作`:`Return to your work`}):null,t[111]=w,t[112]=g,t[113]=fe):fe=t[113];let pe;t[114]!==w||t[115]!==g?(pe=w?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:w===`/settings/phone-use`?g?`正在为手机控制连接模型服务;此处保存服务设置后,还需返回选择并测试手机模型。`:`Connect a model service for phone control, then return to select and test the phone model.`:g?`正在为原来的工作配置模型。服务保存、模型选择和实际运行验证分别生效。`:`Configure models for your work. Saving a service, choosing a model and verifying a run are separate steps.`}):null,t[114]=w,t[115]=g,t[116]=pe):pe=t[116];let me;t[117]===Symbol.for(`react.memo_cache_sentinel`)?(me=e=>R({providerId:e,isCustom:!1}),t[117]=me):me=t[117];let he;t[118]!==P||t[119]!==g?(he=(0,$.jsx)(Ar,{zh:g,disabled:P,onManage:me}),t[118]=P,t[119]=g,t[120]=he):he=t[120];let ge;t[121]===Symbol.for(`react.memo_cache_sentinel`)?(ge=()=>R({providerId:`xopc-cloud`,isCustom:!1}),t[121]=ge):ge=t[121];let _e;t[122]!==P||t[123]!==g?(_e=(0,$.jsx)(kr,{zh:g,disabled:P,onManageCloud:ge}),t[122]=P,t[123]=g,t[124]=_e):_e=t[124];let ve;t[125]===P?ve=t[126]:(ve=e=>{P||Le(e)},t[125]=P,t[126]=ve);let ye;t[127]!==K||t[128]!==z||t[129]!==P||t[130]!==he||t[131]!==_e||t[132]!==ve||t[133]!==g?(ye=(0,$.jsx)(qn,{data:z,zh:g,videoRow:he,musicRow:_e,disabled:P,onPendingChange:M,onChange:K,onSettings:ve}),t[127]=K,t[128]=z,t[129]=P,t[130]=he,t[131]=_e,t[132]=ve,t[133]=g,t[134]=ye):ye=t[134];let be=g?`连接的服务`:`Connected services`,xe;t[135]===be?xe=t[136]:(xe=(0,$.jsx)(`h2`,{id:`model-services-heading`,className:`text-base font-semibold text-fg`,children:be}),t[135]=be,t[136]=xe);let Se=g?`在这里管理账户和密钥;各项能力的模型与参数在上方调整。`:`Manage accounts and keys here. Choose models and adjust capability settings above.`,Ce;t[137]===Se?Ce=t[138]:(Ce=(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:Se}),t[137]=Se,t[138]=Ce);let we;t[139]!==xe||t[140]!==Ce?(we=(0,$.jsxs)(`div`,{children:[xe,Ce]}),t[139]=xe,t[140]=Ce,t[141]=we):we=t[141];let Te;t[142]!==v.xopcCloudAccount||t[143]!==V?(Te=V?(0,$.jsx)(Zt,{labels:v.xopcCloudAccount,children:(0,$.jsx)(Cr,{showCapabilities:!1,embedded:!0})}):null,t[142]=v.xopcCloudAccount,t[143]=V,t[144]=Te):Te=t[144];let Ee,De;t[145]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=()=>I(!0),De=(e,t)=>R({providerId:e,isCustom:t}),t[145]=Ee,t[146]=De):(Ee=t[145],De=t[146]);let J;t[147]!==v.connectedProviders||t[148]!==z?(J=(0,$.jsx)(ae,{labels:v.connectedProviders,data:z,onAdd:Ee,onManage:De}),t[147]=v.connectedProviders,t[148]=z,t[149]=J):J=t[149];let Y;t[150]!==V||t[151]!==z.cards.length?(Y=!V&&z.cards.length>0?(0,$.jsx)(Cr,{showCapabilities:!1}):null,t[150]=V,t[151]=z.cards.length,t[152]=Y):Y=t[152];let Oe;t[153]!==we||t[154]!==Te||t[155]!==J||t[156]!==Y?(Oe=(0,$.jsxs)(`section`,{"data-model-section":`services`,"aria-labelledby":`model-services-heading`,className:`space-y-4 scroll-mt-4 rounded-xl focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[we,Te,J,Y]}),t[153]=we,t[154]=Te,t[155]=J,t[156]=Y,t[157]=Oe):Oe=t[157];let ke;t[158]!==ye||t[159]!==Oe||t[160]!==g?(ke=(0,$.jsxs)($n,{zh:g,children:[ye,Oe]}),t[158]=ye,t[159]=Oe,t[160]=g,t[161]=ke):ke=t[161];let Ae;t[162]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=()=>{H(),I(!1)},t[162]=Ae):Ae=t[162];let X;t[163]!==F||t[164]!==v.addProviderDialog||t[165]!==m||t[166]!==z.builtinRows||t[167]!==z.customConfig?(X=(0,$.jsx)(ie,{open:F,connectOnly:!0,onOpenChange:I,builtinRows:z.builtinRows,customConfig:z.customConfig,labels:v.addProviderDialog,language:m,onSaved:Ae}),t[163]=F,t[164]=v.addProviderDialog,t[165]=m,t[166]=z.builtinRows,t[167]=z.customConfig,t[168]=X):X=t[168];let je;t[169]!==v.manageProviderDialog||t[170]!==m||t[171]!==L||t[172]!==z.allModels||t[173]!==z.builtinRows||t[174]!==z.customConfig?(je=L?(0,$.jsx)(sr,{open:!0,onOpenChange:e=>{e||R(null)},providerId:L.providerId,isCustom:L.isCustom,builtinRows:z.builtinRows,customConfig:z.customConfig,allModels:z.allModels,labels:v.manageProviderDialog,language:m,onSaved:H}):null,t[169]=v.manageProviderDialog,t[170]=m,t[171]=L,t[172]=z.allModels,t[173]=z.builtinRows,t[174]=z.customConfig,t[175]=je):je=t[175];let Me;return t[176]!==de||t[177]!==fe||t[178]!==pe||t[179]!==ke||t[180]!==X||t[181]!==je?(Me=(0,$.jsxs)(Mt,{children:[de,fe,pe,ke,X,je]}),t[176]=de,t[177]=fe,t[178]=pe,t[179]=ke,t[180]=X,t[181]=je,t[182]=Me):Me=t[182],Me}function Mr(e){return e.id}function Nr(){pt()}function Pr(e){return e.id===`xopc-cloud`&&!e.isCustom}function Fr(e){return e.language}export{jr as CapabilitiesSettingsPanel};
|
|
@@ -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{a as i,i as a,l as o,o as s}from"./locale-store-5DzxIIeq.js";import{t as c}from"./messages-CGGOcV9B.js";import{a as l,i as u,n as d,o as f,r as p,s as m,t as h}from"./dist-DlirbHVs.js";import{t as g}from"./createLucideIcon-DPHK1VkS.js";import{t as _}from"./chevron-left-DqFhpbvK.js";import{t as v}from"./chevron-right-BweFrslA.js";import{n as y,r as b}from"./popover-select-hRG1EzAY.js";import{t as x}from"./circle-check-C23XjkUj.js";import{t as S}from"./secret-input-DsjfQmDn.js";import{t as C}from"./globe-DSSGFWFn.js";import{t as w}from"./loader-circle-CifKLtgG.js";import{t as T}from"./plus-Q2yW6OE7.js";import{t as E}from"./search-DA7gz22f.js";import{t as D}from"./settings-2-D-csvaET.js";import{t as O}from"./x-B_N4OPjy.js";import{t as k}from"./cn-0WouolD0.js";import{t as A}from"./skeleton-DzdOeGYz.js";import{i as j}from"./vendor-swr-CdRzEUwF.js";import{r as M}from"./gateway-config-swr-abWJ0Q_y.js";import{n as N,t as P}from"./registry-api-Dw8Ou9VV.js";import{t as F}from"./button-C5tRaJxt.js";import{i as ee,o as te}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{n as I}from"./interaction-BdhHBbYa.js";import{a as L,o as ne,s as R}from"./form-field-width-DJw_jULe.js";import{n as re}from"./secret-input-labels-B5Jl5HqK.js";import{t as ie}from"./sliding-tab-list-CmcrqRzN.js";import{n as ae}from"./model-sort-_Tz8s_4N.js";import{n as oe}from"./capability-navigation-CZbCI5C2.js";import{i as se,n as ce}from"./models-hub-cache-B0Y9Frop.js";import{a as le,i as z,o as ue}from"./providers-api-Df4w723e.js";import{t as de}from"./oauth-provider-connect-7i3NoKo4.js";var B=g(`circle-dashed`,[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]),fe=g(`log-in`,[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]),V=e(t(),1),H=n(),U=r();async function W(e){return(await s(a(`/api/models/setup/${encodeURIComponent(e)}`))).payload}async function pe(e,t={}){return(await s(a(`/api/models/setup/${encodeURIComponent(e)}/preview`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)})).payload}async function me(e,t,n){await s(a(`/api/models/setup/${encodeURIComponent(e)}/apply`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...t,revision:n})}),await se()}function G(e,t){return e===`single`?t.getApiKey:e===`intl`?t.getApiKeyIntl:t.getApiKeyCn}var K={"qwen-token-plan-cn":{apiKeyUrl:`https://bailian.console.aliyun.com/cn-beijing/subscription/overview`,docsUrl:`https://help.aliyun.cn/zh/model-studio/token-plan-personal-quick-start`,description:`Alibaba Bailian subscription. Configure chat, vision and image generation with one key.`,descriptionZh:`阿里云百炼订阅,一份 Key 配置对话、视觉和图片生成。`,bestFor:[`general`,`coding`,`vision`],aliases:[`阿里云订阅`,`百炼订阅`,`aliyun`,`bailian`,`qwen`,`token plan`,`通义`,`千问`],envVars:[`QWEN_TOKEN_PLAN_CN_API_KEY`]},openai:{apiKeyUrl:`https://platform.openai.com/api-keys`,pricingUrl:`https://openai.com/pricing`,docsUrl:`https://platform.openai.com/docs`,description:`The most widely used LLM provider. Powers ChatGPT.`,descriptionZh:`最广泛使用的 LLM 服务商,ChatGPT 背后的技术。`,bestFor:[`general`,`coding`,`vision`],freeTier:!1,freeTierNote:`Pay-as-you-go; new accounts may receive trial credits.`,aliases:[`chatgpt`,`gpt`,`gpt-4`,`gpt4`,`gpt-4o`,`gpt4o`],envVars:[`OPENAI_API_KEY`]},anthropic:{apiKeyUrl:`https://console.anthropic.com/settings/keys`,pricingUrl:`https://www.anthropic.com/pricing`,docsUrl:`https://docs.anthropic.com`,description:`Anthropic model access. Available models are loaded from the gateway catalog.`,descriptionZh:`Anthropic 模型服务。可用模型由网关目录动态加载。`,bestFor:[`long context`,`coding`,`reasoning`],freeTier:!1,aliases:[`claude`,`claude 3`,`claude sonnet`,`claude opus`,`claude haiku`],envVars:[`ANTHROPIC_OAUTH_TOKEN`,`ANTHROPIC_API_KEY`]},google:{apiKeyUrl:`https://aistudio.google.com/app/apikey`,pricingUrl:`https://ai.google.dev/pricing`,docsUrl:`https://ai.google.dev/docs`,description:`Google AI model access. Available models are loaded from the gateway catalog.`,descriptionZh:`Google AI 模型服务。可用模型由网关目录动态加载。`,bestFor:[`multimodal`,`long context`,`general`],freeTier:!0,freeTierNote:`Free tier available via Google AI Studio.`,aliases:[`gemini`,`google gemini`,`bard`,`google ai`],envVars:[`GEMINI_API_KEY`,`GOOGLE_API_KEY`]},"google-vertex":{apiKeyUrl:`https://console.cloud.google.com/apis/credentials`,pricingUrl:`https://cloud.google.com/vertex-ai/pricing`,docsUrl:`https://cloud.google.com/vertex-ai/docs`,description:`Google Vertex AI — enterprise-grade model hosting on GCP.`,descriptionZh:`Google Vertex AI,企业级 GCP 托管模型服务。`,bestFor:[`enterprise`,`multimodal`,`compliance`],freeTier:!1,aliases:[`vertex`,`vertex ai`,`gcp`,`google cloud`],envVars:[`GOOGLE_CLOUD_API_KEY`,`GOOGLE_CLOUD_PROJECT`,`GOOGLE_CLOUD_LOCATION`]},"google-gemini-cli":{apiKeyUrl:`https://aistudio.google.com/app/apikey`,pricingUrl:`https://ai.google.dev/pricing`,docsUrl:`https://ai.google.dev/docs`,description:`Gemini via CLI token — for users authenticated with the Gemini CLI tool.`,descriptionZh:`通过 Gemini CLI 令牌访问 Gemini,适合已安装 CLI 工具的用户。`,bestFor:[`general`,`multimodal`],freeTier:!0,freeTierNote:`Uses your existing Gemini CLI authentication.`,aliases:[`gemini cli`,`gemini-cli`],envVars:[`GEMINI_CLI_TOKEN`,`GOOGLE_TOKEN`]},"google-antigravity":{apiKeyUrl:`https://console.cloud.google.com/apis/credentials`,pricingUrl:`https://cloud.google.com/pricing`,docsUrl:`https://cloud.google.com/docs`,description:`Google Antigravity — internal/experimental Google AI endpoint.`,descriptionZh:`Google Antigravity,Google 内部/实验性 AI 端点。`,bestFor:[`experimental`],freeTier:!1,aliases:[`antigravity`,`google antigravity`],envVars:[`ANTIGRAVITY_API_KEY`]},groq:{apiKeyUrl:`https://console.groq.com/keys`,pricingUrl:`https://groq.com/pricing/`,docsUrl:`https://console.groq.com/docs`,description:`Extremely fast inference — ideal for latency-sensitive applications.`,descriptionZh:`推理速度极快,适合对延迟敏感的场景。`,bestFor:[`speed`,`cheap`],freeTier:!0,freeTierNote:`Generous free tier with rate limits.`,aliases:[`groq`,`llama on groq`,`mixtral on groq`],envVars:[`GROQ_API_KEY`]},deepseek:{apiKeyUrl:`https://platform.deepseek.com/api_keys`,pricingUrl:`https://api-docs.deepseek.com/quick_start/pricing/`,docsUrl:`https://platform.deepseek.com/api-docs/`,description:`DeepSeek model access through an OpenAI-compatible API.`,descriptionZh:`通过 OpenAI 兼容 API 访问 DeepSeek 模型。`,bestFor:[`reasoning`,`cheap`,`coding`],freeTier:!0,freeTierNote:`Free credits may be available for new accounts.`,aliases:[`deepseek`,`deep seek`,`deepseek v4`,`deepseek-v4`,`r1`],envVars:[`DEEPSEEK_API_KEY`]},"volcengine-ark":{apiKeyUrl:`https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey`,pricingUrl:`https://www.volcengine.com/docs/82379/1099320`,docsUrl:`https://www.volcengine.com/docs/82379/1302008`,description:`Volcengine Ark — OpenAI-compatible access to Doubao and custom Ark endpoints.`,descriptionZh:`火山方舟,通过 OpenAI 兼容接口访问豆包与自定义方舟 endpoint。`,bestFor:[`chinese`,`general`,`enterprise`],aliases:[`volcengine`,`ark`,`doubao`,`volces`,`火山方舟`,`豆包`],envVars:[`ARK_API_KEY`,`VOLCENGINE_API_KEY`]},"volcengine-plan":{apiKeyUrl:`https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey`,pricingUrl:`https://www.volcengine.com/docs/82379/1099320`,docsUrl:`https://www.volcengine.com/docs/82379/1302008`,description:`Volcengine Doubao Coding Plan — Ark coding endpoint.`,descriptionZh:`火山方舟豆包 Coding Plan,使用 Ark coding endpoint。`,bestFor:[`coding`,`chinese`],aliases:[`volcengine plan`,`ark coding`,`doubao coding`,`火山方舟 coding`],envVars:[`ARK_API_KEY`,`VOLCENGINE_API_KEY`]},"byteplus-plan":{apiKeyUrl:`https://console.byteplus.com/ark/region:ark+ap-southeast-1/apiKey`,pricingUrl:`https://docs.byteplus.com/en/docs/ModelArk`,docsUrl:`https://docs.byteplus.com/en/docs/ModelArk/OpenAI`,description:`BytePlus Doubao Coding Plan — international Ark coding endpoint.`,descriptionZh:`BytePlus 豆包 Coding Plan,国际区 Ark coding endpoint。`,bestFor:[`coding`,`chinese`],aliases:[`byteplus`,`byteplus plan`,`doubao coding international`],envVars:[`BYTEPLUS_API_KEY`,`ARK_API_KEY`]},xai:{apiKeyUrl:`https://console.x.ai/`,pricingUrl:`https://x.ai/api`,docsUrl:`https://docs.x.ai/`,description:`xAI model access. Available models are loaded from the gateway catalog.`,descriptionZh:`xAI 模型服务。可用模型由网关目录动态加载。`,bestFor:[`reasoning`,`real-time`],freeTier:!1,aliases:[`grok`,`xai`,`x.ai`],envVars:[`XAI_API_KEY`]},cerebras:{apiKeyUrl:`https://cloud.cerebras.ai/platform/`,pricingUrl:`https://cloud.cerebras.ai/platform/`,docsUrl:`https://inference-docs.cerebras.ai/`,description:`Ultra-fast inference on custom AI chips. Fastest Llama inference available.`,descriptionZh:`基于专用 AI 芯片的超快推理,Llama 推理速度业界最快。`,bestFor:[`speed`],freeTier:!0,freeTierNote:`Free tier available.`,aliases:[`cerebras`],envVars:[`CEREBRAS_API_KEY`]},mistral:{apiKeyUrl:`https://console.mistral.ai/api-keys/`,pricingUrl:`https://mistral.ai/technology/#pricing`,docsUrl:`https://docs.mistral.ai/`,description:`European open-weight models. Good balance of quality and cost.`,descriptionZh:`欧洲开源模型,质量与成本平衡好。`,bestFor:[`general`,`cheap`,`coding`],freeTier:!1,aliases:[`mistral`,`mixtral`,`codestral`],envVars:[`MISTRAL_API_KEY`]},openrouter:{apiKeyUrl:`https://openrouter.ai/keys`,pricingUrl:`https://openrouter.ai/models`,docsUrl:`https://openrouter.ai/docs`,description:`API gateway to 100+ models from many providers with a single key.`,descriptionZh:`统一 API 网关,一个 Key 访问 100+ 模型。`,bestFor:[`general`,`flexibility`],freeTier:!0,freeTierNote:`Some models are free; pay-per-use for others.`,aliases:[`openrouter`,`open router`],envVars:[`OPENROUTER_API_KEY`]},azure:{apiKeyUrl:`https://portal.azure.com/#view/Microsoft_Azure_ProjectOxford/CognitiveServicesHub/~/OpenAI`,pricingUrl:`https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/`,docsUrl:`https://learn.microsoft.com/en-us/azure/ai-services/openai/`,description:`OpenAI models hosted on Azure. Enterprise SLA and data residency.`,descriptionZh:`Azure 托管的 OpenAI 模型,企业级 SLA 和数据合规。`,bestFor:[`enterprise`,`compliance`,`coding`],freeTier:!1,aliases:[`azure`,`azure openai`,`aoai`],envVars:[`AZURE_OPENAI_API_KEY`,`AZURE_OPENAI_BASE_URL`]},"amazon-bedrock":{apiKeyUrl:`https://console.aws.amazon.com/iam/home#/security_credentials`,pricingUrl:`https://aws.amazon.com/bedrock/pricing/`,docsUrl:`https://docs.aws.amazon.com/bedrock/`,description:`AWS Bedrock hosted model access with enterprise controls.`,descriptionZh:`AWS Bedrock 托管模型服务,提供企业级控制能力。`,bestFor:[`enterprise`,`compliance`],freeTier:!1,aliases:[`bedrock`,`aws`,`amazon`],envVars:[`AWS_ACCESS_KEY_ID`,`AWS_SECRET_ACCESS_KEY`,`AWS_REGION`]},minimax:{apiKeyUrl:`https://platform.minimax.io/user-center/basic-information/interface-key`,pricingUrl:`https://platform.minimax.io/docs/guides/models-intro`,docsUrl:`https://platform.minimax.io/docs/guides/quickstart-preparation`,description:`MiniMax — Chinese multimodal model with strong text and audio capabilities.`,descriptionZh:`MiniMax,国产多模态模型,文本和音频能力强。`,bestFor:[`multimodal`,`chinese`],freeTier:!0,freeTierNote:`注册赠送免费额度。`,aliases:[`minimax`,`mini max`,`abab`],envVars:[`MINIMAX_API_KEY`]},"minimax-cn":{apiKeyUrl:`https://platform.minimaxi.com/user-center/basic-information/interface-key`,pricingUrl:`https://platform.minimaxi.com/document/Price`,docsUrl:`https://platform.minimaxi.com/document/Announcement`,description:`MiniMax (China endpoint) — domestic access for Chinese users.`,descriptionZh:`MiniMax 国内端点,国内用户直连访问。`,bestFor:[`multimodal`,`chinese`],freeTier:!0,freeTierNote:`注册赠送免费额度。`,aliases:[`minimax cn`,`minimax china`,`abab`],envVars:[`MINIMAX_CN_API_KEY`,`MINIMAX_API_KEY`]},stepfun:{apiKeyUrl:`https://platform.stepfun.com/interface-key`,pricingUrl:`https://platform.stepfun.com/docs/pricing`,docsUrl:`https://platform.stepfun.com/docs`,description:`StepFun OpenAI-compatible endpoint.`,descriptionZh:`阶跃星辰 StepFun OpenAI 兼容端点。`,bestFor:[`chinese`,`reasoning`,`general`],aliases:[`stepfun`,`step`,`阶跃星辰`],envVars:[`STEPFUN_API_KEY`]},"stepfun-cn":{apiKeyUrl:`https://platform.stepfun.com/interface-key`,pricingUrl:`https://platform.stepfun.com/docs/pricing`,docsUrl:`https://platform.stepfun.com/docs`,description:`StepFun China — OpenAI-compatible chat endpoint.`,descriptionZh:`阶跃星辰 StepFun 中国区 OpenAI 兼容对话端点。`,bestFor:[`chinese`,`reasoning`,`general`],aliases:[`stepfun cn`,`step cn`,`阶跃星辰`],envVars:[`STEPFUN_API_KEY`]},"stepfun-intl":{apiKeyUrl:`https://platform.stepfun.com/interface-key`,pricingUrl:`https://platform.stepfun.com/docs/pricing`,docsUrl:`https://platform.stepfun.com/docs`,description:`StepFun International — OpenAI-compatible chat endpoint.`,descriptionZh:`阶跃星辰 StepFun 国际区 OpenAI 兼容对话端点。`,bestFor:[`chinese`,`reasoning`,`general`],aliases:[`stepfun intl`,`step international`],envVars:[`STEPFUN_API_KEY`]},"stepfun-plan":{apiKeyUrl:`https://platform.stepfun.com/interface-key`,pricingUrl:`https://platform.stepfun.com/docs/pricing`,docsUrl:`https://platform.stepfun.com/docs`,description:`StepFun Step Plan coding/planning endpoint.`,descriptionZh:`阶跃星辰 Step Plan coding/planning 专用端点。`,bestFor:[`coding`,`reasoning`,`chinese`],aliases:[`stepfun plan`,`step plan`,`阶跃 plan`],envVars:[`STEPFUN_API_KEY`]},"stepfun-plan-cn":{apiKeyUrl:`https://platform.stepfun.com/interface-key`,pricingUrl:`https://platform.stepfun.com/docs/pricing`,docsUrl:`https://platform.stepfun.com/docs`,description:`StepFun Step Plan China — coding/planning endpoint.`,descriptionZh:`阶跃星辰 Step Plan 中国区 coding/planning 专用端点。`,bestFor:[`coding`,`reasoning`,`chinese`],aliases:[`stepfun plan cn`,`step plan cn`,`阶跃 plan`],envVars:[`STEPFUN_API_KEY`]},"stepfun-plan-intl":{apiKeyUrl:`https://platform.stepfun.com/interface-key`,pricingUrl:`https://platform.stepfun.com/docs/pricing`,docsUrl:`https://platform.stepfun.com/docs`,description:`StepFun Step Plan International — coding/planning endpoint.`,descriptionZh:`阶跃星辰 Step Plan 国际区 coding/planning 专用端点。`,bestFor:[`coding`,`reasoning`,`chinese`],aliases:[`stepfun plan intl`,`step plan international`],envVars:[`STEPFUN_API_KEY`]},"kimi-coding":{apiKeyUrl:`https://platform.kimi.com/console/api-keys`,pricingUrl:`https://platform.kimi.com/docs/pricing/chat`,docsUrl:`https://platform.kimi.com/docs`,description:`Kimi Coding — dedicated Anthropic-compatible coding endpoint.`,descriptionZh:`Kimi Coding,Anthropic 兼容的专用 coding 端点。`,bestFor:[`coding`,`chinese`,`vision`],freeTier:!0,freeTierNote:`注册赠送免费额度。`,aliases:[`kimi coding`,`moonshot coding`,`kimi code`],envVars:[`KIMI_API_KEY`,`MOONSHOT_API_KEY`]},moonshotai:{apiKeyUrl:`https://platform.moonshot.ai/console/api-keys`,pricingUrl:`https://platform.moonshot.ai/docs/pricing`,docsUrl:`https://platform.moonshot.ai/docs`,description:`Moonshot Kimi — international API (api.moonshot.ai).`,descriptionZh:`月之暗面 Kimi 国际版 API(api.moonshot.ai)。`,bestFor:[`coding`,`chinese`,`long context`],freeTier:!0,aliases:[`moonshot`,`kimi`,`moonshot ai`],envVars:[`MOONSHOT_API_KEY`]},"moonshotai-cn":{apiKeyUrl:`https://platform.moonshot.cn/console/api-keys`,pricingUrl:`https://platform.moonshot.cn/docs/pricing/chat`,docsUrl:`https://platform.moonshot.cn/docs`,description:`Moonshot Kimi — China region endpoint.`,descriptionZh:`月之暗面 Kimi 中国区域端点。`,bestFor:[`coding`,`chinese`,`long context`],freeTier:!0,aliases:[`moonshot cn`,`kimi cn`],envVars:[`MOONSHOT_API_KEY`]},fal:{apiKeyUrl:`https://fal.ai/dashboard/keys`,pricingUrl:`https://fal.ai/pricing`,docsUrl:`https://fal.ai/docs`,description:`fal — serverless image and media generation APIs.`,descriptionZh:`fal:无服务器图像与媒体生成 API。`,bestFor:[`image`,`video`],freeTier:!0,aliases:[`fal ai`,`fal.ai`],envVars:[`FAL_KEY`,`FAL_API_KEY`]},fireworks:{apiKeyUrl:`https://fireworks.ai/account/api-keys`,pricingUrl:`https://fireworks.ai/pricing`,docsUrl:`https://docs.fireworks.ai`,description:`Fireworks AI — fast inference for open and proprietary models.`,descriptionZh:`Fireworks AI,多种开源与商业模型的高速推理服务。`,bestFor:[`speed`,`coding`,`open weights`],freeTier:!0,aliases:[`fireworks ai`,`fireworks`],envVars:[`FIREWORKS_API_KEY`]},together:{apiKeyUrl:`https://api.together.xyz/settings/api-keys`,pricingUrl:`https://www.together.ai/pricing`,docsUrl:`https://docs.together.ai`,description:`Together AI — hosted Llama, Qwen, DeepSeek, and more.`,descriptionZh:`Together AI,托管 Llama、Qwen、DeepSeek 等模型。`,bestFor:[`open source`,`flexibility`],freeTier:!0,aliases:[`together ai`,`together.xyz`],envVars:[`TOGETHER_API_KEY`]},"cloudflare-workers-ai":{apiKeyUrl:`https://dash.cloudflare.com/?to=/:account/ai/workers-ai`,pricingUrl:`https://developers.cloudflare.com/workers-ai/platform/pricing/`,docsUrl:`https://developers.cloudflare.com/workers-ai/`,description:`Cloudflare Workers AI — models at the edge via Cloudflare API.`,descriptionZh:`Cloudflare Workers AI,通过 Cloudflare API 在边缘运行模型。`,bestFor:[`edge`,`latency`],freeTier:!0,aliases:[`workers ai`,`cf workers ai`],envVars:[`CLOUDFLARE_API_KEY`]},"cloudflare-ai-gateway":{apiKeyUrl:`https://dash.cloudflare.com/?to=/:account/ai/ai-gateway`,pricingUrl:`https://developers.cloudflare.com/ai-gateway/pricing/`,docsUrl:`https://developers.cloudflare.com/ai-gateway/`,description:`Cloudflare AI Gateway — unified OpenAI/Anthropic-compatible routing.`,descriptionZh:`Cloudflare AI Gateway,统一 OpenAI/Anthropic 兼容路由。`,bestFor:[`routing`,`observability`,`enterprise`],freeTier:!0,aliases:[`cf ai gateway`,`cloudflare gateway`],envVars:[`CLOUDFLARE_API_KEY`]},xiaomi:{apiKeyUrl:`https://platform.xiaomimimo.com/#/console/api-keys`,pricingUrl:`https://mimo.mi.com/`,docsUrl:`https://platform.xiaomimimo.com/`,description:`Xiaomi MiMo — API billing through the MiMo open platform; endpoint api.xiaomimimo.com.`,descriptionZh:`小米 MiMo 按量计费线路,在开放平台创建密钥;接口域名为 api.xiaomimimo.com。`,bestFor:[`general`,`coding`],freeTier:!1,aliases:[`xiaomi`,`mimo`,`小米`,`xiaomimimo`],envVars:[`XIAOMI_API_KEY`]},"xiaomi-token-plan-cn":{apiKeyUrl:`https://platform.xiaomimimo.com/#/console/api-keys`,pricingUrl:`https://mimo.mi.com/`,docsUrl:`https://platform.xiaomimimo.com/`,description:`Xiaomi MiMo Token Plan — China region (token-plan-cn.xiaomimimo.com).`,descriptionZh:`小米 MiMo Token 套餐 · 中国区(token-plan-cn.xiaomimimo.com)。`,bestFor:[`general`,`coding`],freeTier:!1,aliases:[`xiaomi token cn`,`mimo token cn`],envVars:[`XIAOMI_TOKEN_PLAN_CN_API_KEY`,`XIAOMI_TOKEN_PLAN_API_KEY`]},"xiaomi-token-plan-ams":{apiKeyUrl:`https://platform.xiaomimimo.com/#/console/api-keys`,pricingUrl:`https://mimo.mi.com/`,docsUrl:`https://platform.xiaomimimo.com/`,description:`Xiaomi MiMo Token Plan — Amsterdam region (token-plan-ams.xiaomimimo.com).`,descriptionZh:`小米 MiMo Token 套餐 · 阿姆斯特丹(token-plan-ams.xiaomimimo.com)。`,bestFor:[`general`,`coding`],freeTier:!1,aliases:[`xiaomi token ams`,`mimo token ams`],envVars:[`XIAOMI_TOKEN_PLAN_AMS_API_KEY`,`XIAOMI_TOKEN_PLAN_API_KEY`]},"xiaomi-token-plan-sgp":{apiKeyUrl:`https://platform.xiaomimimo.com/#/console/api-keys`,pricingUrl:`https://mimo.mi.com/`,docsUrl:`https://platform.xiaomimimo.com/`,description:`Xiaomi MiMo Token Plan — Singapore region (token-plan-sgp.xiaomimimo.com).`,descriptionZh:`小米 MiMo Token 套餐 · 新加坡(token-plan-sgp.xiaomimimo.com)。`,bestFor:[`general`,`coding`],freeTier:!1,aliases:[`xiaomi token sgp`,`mimo token sgp`],envVars:[`XIAOMI_TOKEN_PLAN_SGP_API_KEY`,`XIAOMI_TOKEN_PLAN_API_KEY`]},"ant-ling":{apiKeyUrl:`https://ling.tbox.cn/`,docsUrl:`https://ling.tbox.cn/`,description:`Ant Ling — domestic OpenAI-compatible access to Ling and Ring models.`,descriptionZh:`蚂蚁 Ling,国内 OpenAI 兼容服务,提供 Ling 与 Ring 系列模型。`,bestFor:[`chinese`,`reasoning`,`coding`],aliases:[`ant ling`,`ling`,`ring`,`蚂蚁 ling`,`蚂蚁灵`],envVars:[`ANT_LING_API_KEY`,`LING_API_KEY`]},"zai-coding-cn":{apiKeyUrl:`https://bigmodel.cn/usercenter/proj-mgmt/apikeys`,pricingUrl:`https://bigmodel.cn/pricing`,docsUrl:`https://docs.bigmodel.cn/cn/guide/start/model-overview`,description:`Zhipu GLM Coding Plan — China endpoint from the pi-ai provider catalog.`,descriptionZh:`智谱 GLM Coding Plan 中国区,来自 pi-ai 内置 provider 目录。`,bestFor:[`coding`,`reasoning`,`chinese`],aliases:[`zai coding cn`,`zhipu coding cn`,`glm coding cn`,`智谱 coding`],envVars:[`ZAI_CODING_CN_API_KEY`,`ZHIPU_API_KEY`,`BIGMODEL_API_KEY`,`ZAI_API_KEY`]},"zhipu-cn":{apiKeyUrl:`https://bigmodel.cn/usercenter/proj-mgmt/apikeys`,pricingUrl:`https://bigmodel.cn/pricing`,docsUrl:`https://docs.bigmodel.cn/cn/guide/start/model-overview`,description:`Zhipu GLM China — BigModel OpenAI-compatible endpoint.`,descriptionZh:`智谱 GLM 中国区,通过 BigModel OpenAI 兼容接口访问。`,bestFor:[`chinese`,`reasoning`,`general`],freeTier:!0,aliases:[`zhipu`,`glm`,`bigmodel`,`智谱`,`z.ai cn`],envVars:[`ZHIPU_API_KEY`,`BIGMODEL_API_KEY`]},huggingface:{apiKeyUrl:`https://huggingface.co/settings/tokens`,pricingUrl:`https://huggingface.co/pricing`,docsUrl:`https://huggingface.co/docs/api-inference/`,description:`Access thousands of open-source models via Hugging Face Inference API.`,descriptionZh:`通过 Hugging Face 访问数千个开源模型。`,bestFor:[`open source`,`flexibility`],freeTier:!0,freeTierNote:`Free tier with rate limits.`,aliases:[`huggingface`,`hugging face`,`hf`],envVars:[`HF_TOKEN`,`HUGGINGFACE_TOKEN`]},opencode:{apiKeyUrl:`https://opencode.ai/auth`,pricingUrl:`https://opencode.ai/docs`,docsUrl:`https://opencode.ai/docs/providers/`,description:`OpenCode — AI coding assistant provider.`,descriptionZh:`OpenCode,AI 代码助手服务商。`,bestFor:[`coding`],freeTier:!1,aliases:[`opencode`,`open code`],envVars:[`OPENCODE_API_KEY`]},"opencode-go":{apiKeyUrl:`https://opencode.ai/auth`,pricingUrl:`https://opencode.ai/docs`,docsUrl:`https://opencode.ai/docs/providers/`,description:`OpenCode Go — AI coding assistant provider (Go variant).`,descriptionZh:`OpenCode Go,AI 代码助手服务商(Go 版本)。`,bestFor:[`coding`],freeTier:!1,aliases:[`opencode go`,`opencode-go`],envVars:[`OPENCODE_API_KEY`]},zai:{apiKeyUrl:`https://z.ai/manage-apikey/apikey-list`,pricingUrl:`https://z.ai/manage-apikey/billing`,docsUrl:`https://docs.z.ai/guides/overview/quick-start`,description:`Zhipu GLM Coding Plan — international z.ai endpoint.`,descriptionZh:`智谱 GLM Coding Plan 国际区 z.ai 端点。`,bestFor:[`coding`,`reasoning`,`chinese`],aliases:[`zai coding`,`zhipu coding global`,`glm coding global`],envVars:[`ZAI_API_KEY`,`Z_AI_API_KEY`]},"zai-api":{apiKeyUrl:`https://z.ai/manage-apikey/apikey-list`,pricingUrl:`https://z.ai/manage-apikey/billing`,docsUrl:`https://docs.z.ai/guides/overview/quick-start`,description:`Zhipu GLM International — z.ai OpenAI-compatible endpoint.`,descriptionZh:`智谱 GLM 国际区,通过 z.ai OpenAI 兼容接口访问。`,bestFor:[`general`,`reasoning`,`chinese`],freeTier:!1,aliases:[`zai`,`z.ai`,`zhipu global`,`glm global`,`智谱`],envVars:[`ZAI_API_KEY`,`Z_AI_API_KEY`]},dashscope:{apiKeyUrl:`https://dashscope.console.aliyun.com/apiKey`,pricingUrl:`https://help.aliyun.com/zh/dashscope/developer-reference/tongyi-thousand-questions-metering-and-billing`,docsUrl:`https://help.aliyun.com/zh/model-studio/developer-reference/compatibility-of-openai-with-dashscope`,description:`Alibaba Bailian / DashScope service provider.`,descriptionZh:`阿里百炼 / DashScope 服务 provider。`,bestFor:[`chinese`,`coding`,`image`,`speech`],freeTier:!0,aliases:[`dash scope`,`alibaba dashscope`,`qwen`,`tongyi`,`阿里百炼`,`通义千问`],envVars:[`DASHSCOPE_API_KEY`,`QWEN_API_KEY`]},"dashscope-cn":{apiKeyUrl:`https://dashscope.console.aliyun.com/apiKey`,pricingUrl:`https://help.aliyun.com/zh/dashscope/developer-reference/tongyi-thousand-questions-metering-and-billing`,docsUrl:`https://help.aliyun.com/zh/model-studio/developer-reference/compatibility-of-openai-with-dashscope`,description:`Alibaba Bailian / DashScope China — Qwen LLMs through the China endpoint.`,descriptionZh:`阿里百炼 / DashScope 中国区:通过国内端点访问通义千问 LLM。`,bestFor:[`chinese`,`coding`,`image`],freeTier:!0,aliases:[`dash scope cn`,`alibaba dashscope cn`,`qwen cn`,`tongyi cn`,`阿里百炼`,`通义千问`],envVars:[`DASHSCOPE_API_KEY`,`QWEN_API_KEY`]},"dashscope-intl":{apiKeyUrl:`https://modelstudio.console.alibabacloud.com/`,pricingUrl:`https://www.alibabacloud.com/help/en/model-studio/billing-for-tongyi-qianwen`,docsUrl:`https://www.alibabacloud.com/help/en/model-studio/compatibility-of-openai-with-dashscope`,description:`Alibaba Bailian / DashScope International — Qwen LLMs through the international endpoint.`,descriptionZh:`阿里百炼 / DashScope 国际区:通过国际端点访问通义千问 LLM。`,bestFor:[`chinese`,`coding`,`image`],freeTier:!0,aliases:[`dash scope intl`,`alibaba cloud dashscope`,`qwen intl`,`tongyi intl`],envVars:[`DASHSCOPE_API_KEY`,`QWEN_API_KEY`]},"vercel-ai-gateway":{apiKeyUrl:`https://vercel.com/account/tokens`,pricingUrl:`https://vercel.com/pricing`,docsUrl:`https://vercel.com/docs/ai/ai-gateway`,description:`Vercel AI Gateway — route requests to multiple LLM providers via Vercel.`,descriptionZh:`Vercel AI Gateway,通过 Vercel 路由请求到多个 LLM 服务商。`,bestFor:[`flexibility`,`enterprise`],freeTier:!1,aliases:[`vercel gateway`,`vercel ai gateway`],envVars:[`AI_GATEWAY_API_KEY`,`VERCEL_AI_GATEWAY_API_KEY`]},"github-copilot":{apiKeyUrl:`https://github.com/settings/tokens`,pricingUrl:`https://github.com/features/copilot#pricing`,docsUrl:`https://docs.github.com/en/copilot`,description:`GitHub Copilot — use your GitHub token to access Copilot models.`,descriptionZh:`使用 GitHub 令牌访问 Copilot 模型。`,bestFor:[`coding`],freeTier:!0,freeTierNote:`Free for verified students and open-source maintainers.`,aliases:[`github copilot`,`copilot`,`github`],envVars:[`COPILOT_GITHUB_TOKEN`,`GH_TOKEN`,`GITHUB_TOKEN`,`GITHUB_COPILOT_TOKEN`]}};function q(e,t){let n=K[e];return n&&n.apiKeyUrl?[{href:n.apiKeyUrl,kind:`single`}]:[]}var he=[`common`,`domestic`,`specialty`,`enterprise`,`oauth`,`extension`];function ge(e){let t=new Map;for(let e of he)t.set(e,[]);for(let n of e){let e=n.category||`specialty`,r=t.get(e)??[];r.push(n),t.set(e,r)}return t}function _e(e,t){switch(t){case`agent`:return e.sourceAgent;case`gateway`:return e.sourceGateway;case`oauth`:return e.sourceOauth;case`env`:return e.sourceEnv;case`models_json`:return e.sourceModelsJson;case`extension`:return e.sourceExtension;default:return e.sourceNone}}var ve=[{value:`openai-completions`,label:`OpenAI Completions`},{value:`openai-responses`,label:`OpenAI Responses`},{value:`anthropic-messages`,label:`Anthropic Messages`},{value:`google-generative-ai`,label:`Google Generative AI`},{value:`azure-openai-responses`,label:`Azure OpenAI`},{value:`bedrock-converse-stream`,label:`AWS Bedrock`},{value:`google-gemini-cli`,label:`Google Gemini CLI`},{value:`google-vertex`,label:`Google Vertex AI`}];function J(e){if(!e||typeof e!=`object`)return;let t=e;if(typeof t.error==`string`)return t.error;if(t.error&&typeof t.error==`object`&&`message`in t.error){let e=t.error.message;return typeof e==`string`?e:void 0}}function ye(e){if(!e||typeof e!=`object`)return{providers:{}};let t=e,n=t.providers;return n&&typeof n==`object`&&!Array.isArray(n)?e:{...t,providers:{}}}async function be(){let e=await i(a(`/api/models-json`)),t=await e.json().catch(()=>({}));if(!e.ok||!t.ok||!t.payload)throw Error(J(t)||`HTTP ${e.status}`);return{...t.payload,config:ye(t.payload.config)}}async function Y(e){let t=await i(a(`/api/models-json`),{method:`PATCH`,body:JSON.stringify({config:e})}),n=await t.json().catch(()=>({}));if(!t.ok||!n.ok||!n.payload)throw Error(J(n)||`HTTP ${t.status}`);return await se(),n.payload}async function X(e){let t=await i(a(`/api/models-json/discover-models`),{method:`POST`,body:JSON.stringify(e)}),n=await t.json().catch(()=>({}));if(!t.ok||!n.ok||!n.payload)throw Error(J(n)||`HTTP ${t.status}`);return n.payload.models}function xe(e,t,n){return{id:e,name:t||e,input:[`text`],contextWindow:128e3,maxTokens:16384,cost:{input:0,output:0,cacheRead:0,cacheWrite:0},...n}}var Z={ollama:{label:`Ollama`,providerId:`ollama`,config:{baseUrl:`http://localhost:11434/v1`,api:`openai-completions`,apiKey:`ollama`}},lmstudio:{label:`LM Studio`,providerId:`lmstudio`,config:{baseUrl:`http://localhost:1234/v1`,api:`openai-completions`,apiKey:`lmstudio`}},zhipuCn:{label:`Zhipu GLM China`,providerId:`zhipu-cn`,config:{baseUrl:`https://open.bigmodel.cn/api/paas/v4`,api:`openai-completions`,apiKey:`ZHIPU_API_KEY`,models:[{id:`glm-5.2`,name:`GLM 5.2`,contextWindow:1e6,maxTokens:65536,reasoning:!0,input:[`text`]}]}},zaiGeneral:{label:`Zhipu GLM API (International)`,providerId:`zai-api`,config:{baseUrl:`https://api.z.ai/api/paas/v4`,api:`openai-completions`,apiKey:`ZAI_API_KEY`,models:[{id:`glm-5.2`,name:`GLM 5.2`,contextWindow:1e6,maxTokens:65536,reasoning:!0,input:[`text`]}]}},dashscopeCn:{label:`Alibaba Bailian / DashScope China`,providerId:`dashscope-cn`,description:`China OpenAI-compatible Qwen endpoint`,config:{baseUrl:`https://dashscope.aliyuncs.com/compatible-mode/v1`,api:`openai-completions`,apiKey:`DASHSCOPE_API_KEY`,models:[{id:`qwen3.7-max`,name:`Qwen3.7 Max`,contextWindow:1e6,input:[`text`,`image`]},{id:`qwen3.7-plus`,name:`Qwen3.7 Plus`,contextWindow:1e6,input:[`text`,`image`]},{id:`qwen3.6-flash`,name:`Qwen3.6 Flash`,contextWindow:1e6,input:[`text`]}]}},dashscopeIntl:{label:`Alibaba Bailian / DashScope International`,providerId:`dashscope-intl`,description:`International OpenAI-compatible Qwen endpoint`,config:{baseUrl:`https://dashscope-intl.aliyuncs.com/compatible-mode/v1`,api:`openai-completions`,apiKey:`DASHSCOPE_API_KEY`,models:[{id:`qwen3.7-max`,name:`Qwen3.7 Max`,contextWindow:1e6,input:[`text`,`image`]},{id:`qwen3.7-plus`,name:`Qwen3.7 Plus`,contextWindow:1e6,input:[`text`,`image`]},{id:`qwen3.6-flash`,name:`Qwen3.6 Flash`,contextWindow:1e6,input:[`text`]}]}},dashscopePhone:{label:`Alibaba Bailian · Phone Use`,providerId:`dashscope-phone`,description:`Beijing GUI-Plus API, the official GUI-Owl hosted entry; requires a Beijing Bailian key`,config:{baseUrl:`https://dashscope.aliyuncs.com/compatible-mode/v1`,api:`openai-completions`,apiKey:`DASHSCOPE_API_KEY`,models:[{id:`gui-plus-2026-02-26`,name:`Bailian GUI-Plus · Phone`,input:[`text`,`image`],contextWindow:262144,maxTokens:4096,phoneUse:{profile:`gui-owl-phone-v1`}}]}},modelscope:{label:`ModelScope`,providerId:`modelscope`,description:`General inference; select a model currently offered by ModelScope`,config:{baseUrl:`https://api-inference.modelscope.cn/v1`,api:`openai-completions`,apiKey:`MODELSCOPE_TOKEN`,models:[{id:`Qwen/Qwen3.5-35B-A3B`,name:`Qwen3.5 35B A3B`,input:[`text`],maxTokens:4096}]}},volcengineArk:{label:`Volcengine Ark`,providerId:`volcengine-ark`,description:`Doubao Seed GUI; use the activated model ID or your Ark endpoint ID`,config:{baseUrl:`https://ark.cn-beijing.volces.com/api/v3`,api:`openai-completions`,apiKey:`ARK_API_KEY`,models:[{id:`doubao-seed-2-1-pro-260915`,name:`Doubao Seed 2.1 Pro`,contextWindow:1024e3,maxTokens:4096,input:[`text`,`image`],phoneUse:{profile:`doubao-seed-phone-v1`}}]}},volcenginePlan:{label:`Volcengine Doubao Coding Plan`,providerId:`volcengine-plan`,description:`Doubao coding-plan endpoint on Volcengine Ark`,config:{baseUrl:`https://ark.cn-beijing.volces.com/api/coding/v3`,api:`openai-completions`,apiKey:`ARK_API_KEY`,models:[{id:`ark-code-latest`,name:`Ark Coding Plan`,contextWindow:256e3,maxTokens:4096,input:[`text`]},{id:`doubao-seed-2.0-code`,name:`Doubao Seed 2.0 Code`,contextWindow:256e3,maxTokens:4096,input:[`text`]},{id:`doubao-seed-2.0-pro`,name:`Doubao Seed 2.0 Pro`,contextWindow:256e3,maxTokens:4096,input:[`text`]},{id:`doubao-seed-2.0-lite`,name:`Doubao Seed 2.0 Lite`,contextWindow:256e3,maxTokens:4096,input:[`text`]}]}},byteplusPlan:{label:`BytePlus Doubao Coding Plan`,providerId:`byteplus-plan`,description:`Doubao coding-plan endpoint on BytePlus`,config:{baseUrl:`https://ark.ap-southeast.bytepluses.com/api/coding/v3`,api:`openai-completions`,apiKey:`BYTEPLUS_API_KEY`,models:[{id:`ark-code-latest`,name:`Ark Coding Plan`,contextWindow:256e3,maxTokens:4096,input:[`text`]},{id:`doubao-seed-2.0-code`,name:`Doubao Seed 2.0 Code`,contextWindow:256e3,maxTokens:4096,input:[`text`]},{id:`doubao-seed-2.0-pro`,name:`Doubao Seed 2.0 Pro`,contextWindow:256e3,maxTokens:4096,input:[`text`]},{id:`doubao-seed-2.0-lite`,name:`Doubao Seed 2.0 Lite`,contextWindow:256e3,maxTokens:4096,input:[`text`]}]}},stepfunIntl:{label:`StepFun International`,providerId:`stepfun-intl`,config:{baseUrl:`https://api.stepfun.ai/v1`,api:`openai-completions`,apiKey:`STEPFUN_API_KEY`,models:[{id:`step-3.7-flash`,name:`Step 3.7 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash-2603`,name:`Step 3.5 Flash 2603`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash`,name:`Step 3.5 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`]}]}},stepfunCn:{label:`StepFun China`,providerId:`stepfun-cn`,config:{baseUrl:`https://api.stepfun.com/v1`,api:`openai-completions`,apiKey:`STEPFUN_API_KEY`,models:[{id:`step-3.7-flash`,name:`Step 3.7 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash-2603`,name:`Step 3.5 Flash 2603`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash`,name:`Step 3.5 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`]}]}},stepfunPlanIntl:{label:`StepFun Step Plan International`,providerId:`stepfun-plan-intl`,config:{baseUrl:`https://api.stepfun.ai/step_plan/v1`,api:`openai-completions`,apiKey:`STEPFUN_API_KEY`,models:[{id:`step-3.7-flash`,name:`Step 3.7 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash-2603`,name:`Step 3.5 Flash 2603`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash`,name:`Step 3.5 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`]}]}},stepfunPlanCn:{label:`StepFun Step Plan China`,providerId:`stepfun-plan-cn`,config:{baseUrl:`https://api.stepfun.com/step_plan/v1`,api:`openai-completions`,apiKey:`STEPFUN_API_KEY`,models:[{id:`step-3.7-flash`,name:`Step 3.7 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash-2603`,name:`Step 3.5 Flash 2603`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash`,name:`Step 3.5 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`]}]}}},Se=Object.entries(Z).map(([e,t])=>({key:e,...t}));function Q(e){return Z[e]?.providerId??e}function Ce(e){return Se.find(t=>t.providerId===e)?.key}var we=new Set([`modelscope`,`dashscope-phone`,`dashscope-cn`,`dashscope-intl`,`volcengine-ark`,`volcengine-plan`,`byteplus-plan`,`stepfun-cn`,`stepfun-intl`,`stepfun-plan-cn`,`stepfun-plan-intl`,`zhipu-cn`,`zai-api`]);function $(e){if(we.has(e))return Ce(e)}var Te=[{value:`text`,labelKey:`inputTextOnly`},{value:`text,image`,labelKey:`inputTextVision`}];function Ee(){return k(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,`placeholder:text-fg-subtle`,R,`dark:border-edge`)}function De(){return k(ne,L)}function Oe(e){return(e.input||[`text`]).includes(`image`)?`text,image`:`text`}function ke(e){return e===`text,image`?[`text`,`image`]:[`text`]}var Ae={chat:[`日常对话与交办任务`,`Everyday conversations and tasks`],vision:[`理解照片、截图和图片内容`,`Understand photos, screenshots and images`],image:[`根据描述生成图片`,`Create images from a description`],transcription:[`聊天听写与笔记录音转文字`,`Dictate messages and transcribe recorded notes`],speech:[`朗读消息,选择喜欢的音色`,`Read messages aloud in your preferred voice`],conversation:[`实时通话、音色与音频设备`,`Live calls, voices and audio devices`],background:[`自动化、定时和无人值守任务`,`Automations, schedules and unattended tasks`]};function je(e,t,n){return n?{"qwen-token-plan-cn":`阿里云百炼订阅 · 北京`,"qwen-token-plan":`阿里云百炼订阅 · 国际`,"dashscope-cn":`阿里云百炼 · 中国区`,"dashscope-intl":`阿里云百炼 · 国际区`,"xiaomi-token-plan-cn":`小米 MiMo 订阅 · 中国区`}[e]??t:t}function Me(e){let t=(0,H.c)(16),{value:n,onChange:r,language:i,disabled:a}=e,o=a!==void 0&&a,s=i===`zh`,c=(0,V.useId)(),l=s?`配置接入方式`:`Configure access method`,u;t[0]===l?u=t[1]:(u=(0,U.jsx)(`legend`,{className:`mb-2 text-sm font-medium text-fg`,children:l}),t[0]=l,t[1]=u);let d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=[`api-key`,`oauth`],t[2]=d):d=t[2];let f;t[3]!==o||t[4]!==c||t[5]!==r||t[6]!==n||t[7]!==s?(f=(0,U.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:d.map(e=>(0,U.jsxs)(`label`,{className:k(`relative flex min-h-11 cursor-pointer items-center justify-center gap-2 rounded-lg border px-3 text-sm text-fg has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-accent`,n===e?`border-accent bg-surface-active`:`border-edge bg-surface-panel`,o&&`cursor-default opacity-60`),children:[(0,U.jsx)(`input`,{className:`sr-only`,type:`radio`,name:c,value:e,checked:n===e,onChange:()=>r(e)}),e===`api-key`?`API Key`:s?`账号登录(OAuth)`:`Account (OAuth)`]},e))}),t[3]=o,t[4]=c,t[5]=r,t[6]=n,t[7]=s,t[8]=f):f=t[8];let p=s?`选择要配置的方式;保存密钥或完成授权后,按凭据优先级生效。已保存的 API Key 优先于 OAuth。`:`Choose which credentials to configure. Saved API keys take priority over OAuth; selecting a form does not switch the active connection.`,m;t[9]===p?m=t[10]:(m=(0,U.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:p}),t[9]=p,t[10]=m);let h;return t[11]!==o||t[12]!==u||t[13]!==f||t[14]!==m?(h=(0,U.jsxs)(`fieldset`,{disabled:o,className:`space-y-2`,children:[u,f,m]}),t[11]=o,t[12]=u,t[13]=f,t[14]=m,t[15]=h):h=t[15],h}function Ne(e){let t=(0,H.c)(17),{row:n,language:r}=e,i=r===`zh`,a=n?.authMode??n?.activeKeySource,o=n?.authStatus,s=o===`connected`,l=o===`expired`?i?`授权已过期`:`Authorization expired`:s?i?`凭据已配置`:`Credentials configured`:i?`未连接`:`Not connected`,u;t[0]===l?u=t[1]:(u=(0,U.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:l}),t[0]=l,t[1]=u);let d;t[2]!==r||t[3]!==a||t[4]!==i?(d=a&&a!==`none`?(0,U.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[i?`当前认证来源:`:`Current credential source: `,_e(c(r).providersSettings,a)]}):null,t[2]=r,t[3]=a,t[4]=i,t[5]=d):d=t[5];let f;t[6]!==a||t[7]!==i?(f=a===`env`?(0,U.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i?`正在使用环境变量中的凭据,无需重复填写。`:`Using credentials from the environment. No need to enter them again.`}):null,t[6]=a,t[7]=i,t[8]=f):f=t[8];let p;t[9]!==s||t[10]!==i?(p=s?(0,U.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i?`凭据状态不代表模型调用已验证。`:`Credential status does not verify model access.`}):null,t[9]=s,t[10]=i,t[11]=p):p=t[11];let m;return t[12]!==u||t[13]!==d||t[14]!==f||t[15]!==p?(m=(0,U.jsxs)(`div`,{role:`status`,className:`space-y-1 rounded-lg border border-edge-subtle bg-surface-panel/60 p-3`,children:[u,d,f,p]}),t[12]=u,t[13]=d,t[14]=f,t[15]=p,t[16]=m):m=t[16],m}var Pe={chat:[`对话与任务`,`Chat and tasks`],vision:[`看图`,`Image understanding`],image:[`画图`,`Image generation`],background:[`后台任务`,`Background tasks`],speech:[`语音合成`,`Speech synthesis`],transcription:[`录音识别`,`Recorded audio recognition`],conversation:[`实时语音对话`,`Realtime conversation`]};function Fe({providerId:e,row:t,modelIds:n,existingConnection:r=!1,targetUse:i,connectOnly:a=!1,language:o,alternatives:s=[],onChooseProvider:l,onBack:d,onDone:f,onApplied:p,inline:h=!1,onPendingChange:g}){let v=o===`zh`,C=(0,V.useRef)(!1),[T,E]=(0,V.useState)(null),[D,k]=(0,V.useState)({mode:i?`replace`:`fill`,modelIds:n}),[j,M]=(0,V.useState)(null),[N,P]=(0,V.useState)(!1),[ee,te]=(0,V.useState)(!1),[I,L]=(0,V.useState)(``),[ne,R]=(0,V.useState)(!1),[se,ce]=(0,V.useState)(!1),[z,ue]=(0,V.useState)(r||!!t?.configured),[B,fe]=(0,V.useState)(!1),H=(0,V.useRef)(!1),[W,G]=(0,V.useState)(``),[q,he]=(0,V.useState)(!1),[ge,_e]=(0,V.useState)(0);(0,V.useEffect)(()=>{let t=!0;return pe(e,{modelIds:n,...a?{selected:[]}:{},...i&&!a?{mode:`replace`,selected:[i]}:{}}).then(e=>{t&&(E(e),ue(e.configured),C.current||(C.current=!0,k({mode:i?`replace`:`fill`,modelIds:n,selected:a?[]:e.uses.filter(e=>e.selected).map(e=>e.id)})),G(``))}).catch(e=>{t&&G(e instanceof Error?e.message:String(e))}),()=>{t=!1}},[e,n,i,a,ge]),(0,V.useEffect)(()=>(g?.(B||N),()=>g?.(!1)),[B,N,g]);let ve=t?.supportsOAuth??T?.profile.credential===`oauth`,J=t?.supportsApiKey??T?.profile.credential===`api-key`,ye=j??(t?.authMode===`oauth`||!J?`oauth`:`api-key`),be=J&&ye===`api-key`,Y=ve&&ye===`oauth`,X=ee||z&&(t?t.authMode===`oauth`&&t.authStatus===`connected`:T?.profile.credential===`oauth`),xe=t?!!t.apiKey:T?.profile.credential===`api-key`,Z=J&&ve&&!r&&!q?(0,U.jsx)(Me,{value:ye,language:o,disabled:B||N,onChange:e=>{M(e),L(``),R(!1)}}):null,Se=()=>{ue(!0),te(!0),L(``),R(!1),a?(he(!0),p?.()):_e(e=>e+1)},Q=D.selected??[],Ce=e=>{k({...D,mode:e,selected:T?.uses.filter(t=>t.recommended&&t.choices.length&&(e===`replace`||t.selected)).map(e=>e.id)??[]})},we=async()=>{if(!T||H.current)return;H.current=!0,fe(!0),G(``),ce(!1);let t=!1;try{I.trim()&&(await le({[e]:I.trim()}),t=!0,ce(!0),ue(!0),R(!1),L(``));let n=await pe(e,D);if(ue(n.configured),a){if(!n.configured)throw Error(v?`请先连接此服务。`:`Connect this service first.`);E(n),he(!0),p?.();return}let r=T.uses.filter(e=>Q.includes(e.id)).map(e=>D.overrides?.[e.id]??e.recommended),i=n.uses.filter(e=>Q.includes(e.id)).map(e=>D.overrides?.[e.id]??e.recommended);if(T.revision!==n.revision||JSON.stringify(r)!==JSON.stringify(i))throw E(n),k({...D,selected:n.uses.filter(e=>e.selected).map(e=>e.id)}),Error(v?`目录或当前配置已更新,请核对后再次应用。`:`The catalog or settings changed. Review the updated choices and apply again.`);if(!n.configured)throw Error(v?`请先连接此服务。`:`Connect this service first.`);await me(e,D,n.revision),E(n),he(!0),p?.()}catch(e){let n=e instanceof Error?e.message:String(e);G((!h&&t?v?`服务已保存,用途配置未完成。`:`Connection saved; model setup is incomplete. `:``)+n)}finally{H.current=!1,fe(!1)}},$=T?.profile.name??t?.name??e,Te=T?.profile.apiKeyUrl??K[e]?.apiKeyUrl;if(h){let t=T?.uses.find(e=>e.id===i),n=i?D.overrides?.[i]??t?.recommended:void 0,r=je(e,$,v);return(0,U.jsxs)(`div`,{className:`space-y-6 p-4 sm:p-5`,children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:r}),(0,U.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:i?`${v?`用于`:`For `}${oe[i][+!v]}`:``})]}),(0,U.jsx)(F,{variant:`ghost`,disabled:B||N,onClick:f,children:v?`更换服务`:`Change service`})]}),!T&&!W?(0,U.jsx)(A,{className:`h-48 w-full rounded-xl`}):null,T?(0,U.jsxs)(U.Fragment,{children:[Z,Y&&!X?(0,U.jsx)(de,{providerId:e,displayName:r,connected:X,onConnected:Se,onPendingChange:P}):null,Y&&X?(0,U.jsxs)(`p`,{className:`flex items-center gap-2 rounded-xl bg-surface-inset px-4 py-3 text-sm text-fg`,children:[(0,U.jsx)(x,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),v?`使用已有连接`:`Using the existing connection`]}):null,be?(0,U.jsx)(`div`,{className:`space-y-3`,children:z&&!ne?(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-inset px-4 py-3`,children:[(0,U.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-fg`,children:[(0,U.jsx)(x,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),v?`使用已有连接`:`Using the existing connection`]}),(0,U.jsx)(F,{variant:`ghost`,disabled:B,onClick:()=>R(!0),children:xe?v?`更换`:`Change`:v?`添加 API Key`:`Add API key`})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,U.jsx)(`label`,{htmlFor:`provider-setup-key`,className:`text-sm font-medium text-fg`,children:T.profile.access===`subscription`?v?`订阅 API Key`:`Subscription API key`:`API Key`}),z?(0,U.jsx)(F,{variant:`ghost`,disabled:B,onClick:()=>{R(!1),L(``)},children:xe?v?`保留原 Key`:`Keep saved key`:v?`保留当前连接`:`Keep current connection`}):null]}),(0,U.jsx)(S,{id:`provider-setup-key`,disabled:B,value:I,onChange:L,placeholder:z?v?`输入新的 API Key`:`Enter a new API key`:v?`粘贴 API Key`:`Paste your API key`,labels:re(c(o).providersSettings)}),z?(0,U.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:v?`此服务的其他已配置模型也会使用新的 Key。`:`Other models configured with this service will also use the new key.`}):null,Te?(0,U.jsx)(`a`,{className:`inline-flex min-h-10 items-center text-sm text-accent-fg hover:underline`,href:Te,target:`_blank`,rel:`noopener noreferrer`,children:v?`获取 API Key`:`Get an API key`}):null]})}):null,t?(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsx)(`label`,{className:`block text-sm font-medium text-fg`,children:v?`选择模型`:`Model`}),(0,U.jsx)(y,{value:n??``,disabled:B||!t.choices.length,"aria-label":v?`选择模型`:`Model`,onChange:e=>k({...D,selected:[t.id],overrides:{...D.overrides,[t.id]:e.target.value}}),children:[...t.choices].sort(ae).map(e=>(0,U.jsx)(b,{value:e.id,children:e.name},e.id))})]}):null,(0,U.jsxs)(`p`,{className:`text-sm leading-relaxed text-fg-muted`,children:[v?`只更改当前能力使用的模型。`:`Changes the model for this capability only.`,T.profile.interactiveOnly?v?` 后台任务继续使用原服务。`:` Background tasks keep their current service.`:``]})]}):null,W?(0,U.jsxs)(`div`,{role:`alert`,className:`space-y-2 rounded-xl border border-edge p-3`,children:[(0,U.jsx)(`p`,{className:`text-sm text-danger`,children:se?v?`连接信息已保存,模型尚未切换。请重试。`:`Connection saved. The model has not switched; please retry.`:v?`未能应用配置,请重试。`:`Could not apply settings. Please retry.`}),(0,U.jsxs)(`details`,{className:`text-xs text-fg-muted`,children:[(0,U.jsx)(`summary`,{className:`cursor-pointer`,children:v?`查看详情`:`Show details`}),(0,U.jsx)(`p`,{className:`mt-2 break-words`,children:W})]})]}):null,(0,U.jsx)(`div`,{className:`flex items-center justify-end gap-3 border-t border-edge-subtle pt-4`,children:(0,U.jsxs)(F,{variant:`primary`,disabled:B||!T&&!W||!!T&&(!z&&!I.trim()||!n||!t?.choices.some(e=>e.id===n)),onClick:()=>{T?we():_e(e=>e+1)},children:[B?(0,U.jsx)(w,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,B?v?`正在应用…`:`Applying…`:!T&&W?v?`重新加载`:`Reload`:W?v?`重试`:`Retry`:z&&!I.trim()?v?`使用此模型`:`Use this model`:v?`连接并使用`:`Connect and use`]})})]})}let Ee=h?`h3`:m,De=h?`p`:u;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`flex shrink-0 items-start gap-3 px-5 py-5`,children:[d&&!B&&!q?(0,U.jsx)(F,{variant:`ghost`,className:`shrink-0 p-1.5`,"aria-label":v?`返回`:`Back`,onClick:d,children:(0,U.jsx)(_,{className:`size-4`})}):null,(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(Ee,{className:`text-base font-semibold text-fg`,children:i?`${v?`连接服务 · `:`Connect service · `}${Pe[i][+!v]}`:v?`连接模型服务`:`Connect model service`}),(0,U.jsx)(De,{className:`mt-2 text-sm text-fg-muted`,children:$})]}),(0,U.jsx)(F,{variant:`ghost`,className:`shrink-0 p-1.5`,disabled:B,"aria-label":v?`关闭`:`Close`,onClick:f,children:(0,U.jsx)(O,{className:`size-4`})})]}),(0,U.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-5 pb-5`,children:[!T&&!W?(0,U.jsx)(A,{className:`h-64 w-full rounded-xl`}):null,T?(0,U.jsxs)(U.Fragment,{children:[Z,!q&&s.length>1&&l?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`mb-2 block text-xs text-fg-muted`,children:v?`接入方式 / 地域`:`Access method / region`}),(0,U.jsx)(y,{value:e,disabled:B,"aria-label":v?`接入方式 / 地域`:`Access method / region`,onChange:e=>l(e.target.value),children:s.map(e=>(0,U.jsx)(b,{value:e.id,children:e.setupProfile?.name??e.name},e.id))})]}):null,q?(0,U.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-fg`,children:[(0,U.jsx)(x,{className:`size-4`}),a?v?`服务连接已保存`:`Connection saved`:v?`所选用途配置已保存`:`Selected model uses saved`]}):(0,U.jsxs)(U.Fragment,{children:[Y&&!X?(0,U.jsx)(de,{providerId:e,displayName:$,connected:X,onConnected:Se,onPendingChange:P}):null,z&&!ne?(0,U.jsxs)(`div`,{role:`status`,className:`flex items-center justify-between gap-3 rounded-xl bg-surface-inset px-4 py-3`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[(0,U.jsx)(x,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:v?`服务已连接`:`Service connected`}),(0,U.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:v?`可直接选择模型,无需重复填写凭据。`:`Choose a model without entering credentials again.`})]})]}),!r&&be?(0,U.jsx)(F,{variant:`ghost`,disabled:B,onClick:()=>R(!0),children:xe?v?`更换 API Key`:`Change API key`:v?`添加 API Key`:`Add API key`}):null]}):null,be&&!r&&(!z||ne)?(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,U.jsx)(`label`,{htmlFor:`provider-setup-key`,className:`text-sm font-medium text-fg`,children:T.profile.access===`subscription`?v?`套餐 API Key`:`Plan API key`:`API Key`}),z?(0,U.jsx)(F,{variant:`ghost`,disabled:B,onClick:()=>{R(!1),L(``)},children:v?`取消更换`:`Cancel change`}):null]}),(0,U.jsx)(S,{id:`provider-setup-key`,disabled:B,value:I,onChange:L,placeholder:z?v?`输入新的 API Key`:`Enter a new API key`:`API Key`,labels:re(c(o).providersSettings)}),Te?(0,U.jsx)(`a`,{className:`inline-flex min-h-8 items-center text-sm text-accent-fg hover:underline`,href:Te,target:`_blank`,rel:`noopener noreferrer`,children:v?`获取对应接入方式的 Key`:`Get a key for this access method`}):null]}):null,!a&&!h?(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,U.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:v?`模型用途`:`Model uses`}),(0,U.jsx)(ie,{className:`flex gap-2`,indicatorClassName:`rounded-lg bg-surface-active`,children:[`fill`,`replace`].map(e=>(0,U.jsx)(F,{variant:D.mode===e?`secondary`:`ghost`,disabled:B,"aria-pressed":D.mode===e,onClick:()=>Ce(e),children:e===`fill`?v?`补齐未配置`:`Fill missing`:v?`改用此服务`:`Switch to this service`},e))})]}):(0,U.jsx)(`p`,{className:`text-sm text-fg-muted`,children:h?v?`仅更新当前能力,其他模型和参数保持原设置。`:`Only this capability changes; other settings are preserved.`:z?v?`连接已就绪,返回能力设置选择要使用的模型。`:`The connection is ready. Return to capability settings to choose a model.`:v?`保存连接后返回能力设置,再选择要使用的模型。`:`Save the connection, then choose a model in capability settings.`})]}),a?(0,U.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[v?`支持用途:`:`Supported uses: `,T.uses.filter(e=>e.choices.length&&(!i||e.id===i)).map(e=>Pe[e.id][+!v]).join(`、`)]}):null,a?null:(0,U.jsx)(`div`,{className:`divide-y divide-edge rounded-xl border border-edge bg-surface-inset px-4`,children:T.uses.filter(e=>!h||!i||e.id===i).map(e=>{let t=D.overrides?.[e.id]??e.recommended,n=e.choices.find(e=>e.id===t);return(0,U.jsxs)(`div`,{className:`space-y-2 py-3`,children:[(0,U.jsxs)(`label`,{className:`flex min-h-10 items-start gap-3`,children:[(0,U.jsx)(`input`,{hidden:h,type:`checkbox`,className:`ui-checkbox mt-1`,checked:Q.includes(e.id),disabled:h||B||q||!t||!e.choices.length,onChange:t=>k({...D,selected:t.target.checked?[...Q,e.id]:Q.filter(t=>t!==e.id)})}),(0,U.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:Pe[e.id][+!v]}),(0,U.jsx)(`span`,{className:`mt-1 block break-all text-xs text-fg-muted`,children:Q.includes(e.id)?`${e.current?`${e.current} → `:``}${n?.name??t??``}`:e.current?`${v?`保留:`:`Keep: `}${e.current}`:e.reason===`interactive_only`?v?`此套餐不用于后台任务`:`This plan is not used for background tasks`:n?.name??(v?`暂无可自动配置的模型`:`No automatic model selection available`)})]})]}),!q&&e.choices.length>1?(0,U.jsxs)(`details`,{open:h||void 0,className:`pl-7`,children:[(0,U.jsx)(`summary`,{className:`text-xs text-accent-fg`,children:v?`选择具体模型`:`Choose a model`}),(0,U.jsx)(y,{value:t??``,disabled:B,"aria-label":Pe[e.id][+!v],onChange:t=>k({...D,selected:[...new Set([...Q,e.id])],overrides:{...D.overrides,[e.id]:t.target.value}}),children:[...e.choices].sort(ae).map(e=>(0,U.jsx)(b,{value:e.id,children:e.name},e.id))})]}):null]},e.id)})}),q?null:(0,U.jsx)(F,{variant:`ghost`,disabled:B,onClick:()=>_e(e=>e+1),children:v?`刷新目录`:`Refresh catalog`}),!a&&!h?(0,U.jsxs)(`details`,{children:[(0,U.jsx)(`summary`,{className:`text-xs text-accent-fg`,children:v?`任务模型与其他用途`:`Task models and other uses`}),(0,U.jsxs)(`div`,{className:`mt-2 space-y-1 text-xs text-fg-muted`,children:[Object.entries(T.taskModels).map(([e,t])=>(0,U.jsxs)(`p`,{children:[e,`: `,t]},e)),(0,U.jsx)(`p`,{children:v?`未选用途与电脑操作保留当前配置;所选用途清除跨服务回退。`:`Unselected uses and Computer Use keep their settings. Selected uses clear cross-service fallbacks.`})]})]}):null,a?null:(0,U.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:T.profile.interactiveOnly?v?`此套餐仅用于交互任务。后台调用会检查使用范围,不会自动切换到其他收费来源。`:`This plan is for interactive tasks. Background calls check usage scope and do not automatically switch billing sources.`:v?`仅更新勾选的全局用途,智能体和会话的独立设置继续生效。`:`Only selected global uses change. Agent and session overrides remain effective.`}),(0,U.jsx)(`p`,{className:`text-xs text-fg-muted`,children:v?`配置保存与模型真实调用验证分别显示;此操作不会发送测试请求。`:`Saving settings does not perform a model test request.`})]}):null,W?(0,U.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:W}):null]}),(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-t border-edge px-5 py-4`,children:[(0,U.jsx)(`span`,{className:`text-xs text-fg-muted`,children:T&&!q&&!a?v?`将配置 ${Q.length} 项`:`${Q.length} uses selected`:``}),q||a&&z&&!I.trim()&&!ne?(0,U.jsx)(F,{disabled:B||N||!T,onClick:()=>{q||p?.(),f()},children:a?v?`返回选择模型`:`Return to model selection`:v?`完成`:`Done`}):!T&&W?(0,U.jsx)(F,{onClick:()=>_e(e=>e+1),children:v?`重试`:`Retry`}):(0,U.jsxs)(F,{onClick:()=>void we(),disabled:B||N||!T||!z&&!I.trim()||h&&!Q.some(e=>D.overrides?.[e]||T.uses.find(t=>t.id===e)?.recommended),children:[B?(0,U.jsx)(w,{className:`mr-2 size-4 animate-spin`,"aria-hidden":!0}):null,B?v?`正在应用…`:`Applying…`:Q.length?h&&i?`${v?`连接并用于`:`Connect and use for `}${Pe[i][+!v]}`:v?`连接并应用`:`Connect and apply`:v?`仅连接`:`Connect only`]})]})]})}function Ie(e){let t=(0,H.c)(7),{target:n,targetUse:r,zh:i,onDone:a,onApplied:o}=e,s=i?`zh`:`en`,c;return t[0]!==o||t[1]!==a||t[2]!==s||t[3]!==n.modelIds||t[4]!==n.providerId||t[5]!==r?(c=(0,U.jsx)(Fe,{providerId:n.providerId,modelIds:n.modelIds,targetUse:r,language:s,existingConnection:!0,onDone:a,onApplied:o},n.providerId),t[0]=o,t[1]=a,t[2]=s,t[3]=n.modelIds,t[4]=n.providerId,t[5]=r,t[6]=c):c=t[6],c}function Le(e){let t=(0,H.c)(38),{open:n,initialProviderId:r,initialUse:i,connectOnly:a,onOpenChange:o,builtinRows:s,customConfig:c,labels:u,language:d,onSaved:m}=e,g=a!==void 0&&a,_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_={type:`pick`},t[0]=_):_=t[0];let[v,y]=(0,V.useState)(_),[b,x]=(0,V.useState)(``),S;t[1]!==r||t[2]!==v?(S=v.type===`pick`&&r?{type:`builtin`,providerId:r}:v,t[1]=r,t[2]=v,t[3]=S):S=t[3];let C=S,w=(0,V.useRef)(0),T;t[4]!==C.providerId||t[5]!==C.type||t[6]!==s?(T=C.type===`builtin`?s.find(e=>e.id===C.providerId)?.setupProfile?.brand:void 0,t[4]=C.providerId,t[5]=C.type,t[6]=s,t[7]=T):T=t[7];let E=T,D;t[8]===o?D=t[9]:(D=e=>{e||window.setTimeout(()=>{y({type:`pick`}),x(``),w.current=0},200),o(e)},t[8]=o,t[9]=D);let O=D,A;t[10]!==s||t[11]!==g||t[12]!==O||t[13]!==m?(A=(e,t)=>{let n=s.some(t=>t.id===e&&t.configured);g||t?.length===0||t===void 0&&n?(m(e),O(!1)):y({type:`success`,target:{providerId:e,modelIds:t}})},t[10]=s,t[11]=g,t[12]=O,t[13]=m,t[14]=A):A=t[14];let j=A,M;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,U.jsx)(l,{className:k(`xopc-dialog-overlay fixed inset-0 bg-scrim`,te)}),t[15]=M):M=t[15];let N;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(N=k(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(40rem,calc(100vh-3rem))] w-[min(40rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay`,ee),t[16]=N):N=t[16];let P;t[17]!==C.presetKey||t[18]!==C.providerId||t[19]!==C.target||t[20]!==C.type||t[21]!==s||t[22]!==g||t[23]!==c||t[24]!==O||t[25]!==j||t[26]!==r||t[27]!==i||t[28]!==u||t[29]!==d||t[30]!==m||t[31]!==b||t[32]!==E?(P=(0,U.jsxs)(f,{children:[M,(0,U.jsx)(p,{className:N,children:C.type===`success`?(0,U.jsx)(Ie,{target:C.target,targetUse:i,zh:d===`zh`,onApplied:()=>m(C.target.providerId),onDone:()=>O(!1)}):C.type===`pick`?(0,U.jsx)(ze,{builtinRows:s,searchQuery:b,onSearchChange:x,labels:u,language:d,scrollTopRef:w,onPickBuiltin:e=>{let t=$(e);y(t?{type:`custom`,presetKey:t}:{type:`builtin`,providerId:e})},onPickCustom:()=>y({type:`custom`})}):C.type===`builtin`?(0,U.jsx)(Fe,{providerId:C.providerId,targetUse:i,connectOnly:g,row:s.find(e=>e.id===C.providerId),language:d,alternatives:E?s.filter(e=>e.setupProfile?.brand===E):[],onChooseProvider:e=>{let t=$(e);y(t?{type:`custom`,presetKey:t}:{type:`builtin`,providerId:e})},onBack:r?void 0:()=>y({type:`pick`}),onApplied:()=>{m(C.providerId),g&&O(!1)},onDone:()=>O(!1)},C.providerId):(0,U.jsx)(Ge,{initialPresetKey:C.presetKey,customConfig:c,labels:u,language:d,onBack:()=>y({type:`pick`}),onSaved:j})})]}),t[17]=C.presetKey,t[18]=C.providerId,t[19]=C.target,t[20]=C.type,t[21]=s,t[22]=g,t[23]=c,t[24]=O,t[25]=j,t[26]=r,t[27]=i,t[28]=u,t[29]=d,t[30]=m,t[31]=b,t[32]=E,t[33]=P):P=t[33];let F;return t[34]!==O||t[35]!==n||t[36]!==P?(F=(0,U.jsx)(h,{open:n,onOpenChange:O,children:P}),t[34]=O,t[35]=n,t[36]=P,t[37]=F):F=t[37],F}function Re(e){let t=(0,H.c)(4),{label:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=k(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,I.press),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,U.jsx)(O,{className:`size-4`,"aria-hidden":!0}),t[1]=i):i=t[1];let a;return t[2]===n?a=t[3]:(a=(0,U.jsx)(d,{asChild:!0,children:(0,U.jsx)(`button`,{type:`button`,className:r,"aria-label":n,children:i})}),t[2]=n,t[3]=a),a}function ze({builtinRows:e,searchQuery:t,onSearchChange:n,labels:r,language:i,scrollTopRef:a,onPickBuiltin:o,onPickCustom:s}){let c=t.trim().toLowerCase(),l=(0,V.useRef)(null);(0,V.useLayoutEffect)(()=>{let e=l.current;e&&a.current>0&&(e.scrollTop=a.current)},[a]);let d=(0,V.useMemo)(()=>c?e.filter(e=>{let t=K[e.id]?.aliases??[];return e.id.toLowerCase().includes(c)||e.name.toLowerCase().includes(c)||t.some(e=>e.toLowerCase().includes(c))}):e,[e,c]),f=(0,V.useMemo)(()=>{let e=new Set;return d.filter(t=>{let n=t.setupProfile?.brand??t.id;return e.has(n)?!1:(e.add(n),!0)})},[d]),p=f.filter(e=>e.id===`xopc-cloud`),h=p.map(e=>e.id),g=f.filter(e=>e.configured&&!h.includes(e.id)),_=(0,V.useMemo)(()=>ge(f.filter(e=>!h.includes(e.id)&&!e.configured)),[f,h]),y=e=>{let t=K[e.id];return i===`zh`?t?.descriptionZh??t?.description:t?.description};return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-4 px-5 pb-3 pt-5`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(m,{className:`text-base font-semibold text-fg`,children:r.step1Title}),(0,U.jsx)(u,{className:`mt-1 text-sm text-fg-muted`,children:r.step1Subtitle})]}),(0,U.jsx)(Re,{label:r.close})]}),(0,U.jsx)(`div`,{className:`px-5 pb-3`,children:(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(E,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,strokeWidth:1.75,"aria-hidden":!0}),(0,U.jsx)(`input`,{type:`search`,value:t,onChange:e=>n(e.target.value),placeholder:r.searchPlaceholder,autoComplete:`off`,className:k(`h-10 w-full rounded-xl border border-edge bg-surface-base py-2 pl-10 pr-3 text-sm text-fg placeholder:text-fg-subtle`,R)})]})}),(0,U.jsx)(`div`,{ref:l,onScroll:e=>{a.current=e.currentTarget.scrollTop},className:`min-h-0 flex-1 overscroll-contain overflow-y-auto px-5 pb-5`,children:c&&f.length===0?(0,U.jsx)(`p`,{className:`py-6 text-center text-sm text-fg-muted`,children:r.noResults}):c?(0,U.jsx)(Be,{title:r.searchResults,children:f.map(e=>(0,U.jsx)(Ve,{row:e,description:y(e),labels:r,onPick:o},e.id))}):(0,U.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[p.length>0?(0,U.jsx)(Be,{title:r.quickStart,children:p.map(e=>(0,U.jsx)(Ve,{row:e,description:y(e),labels:r,prominent:!0,onPick:o},e.id))}):null,g.length>0?(0,U.jsx)(Be,{title:r.connectedSection,children:g.map(e=>(0,U.jsx)(Ve,{row:e,description:y(e),labels:r,onPick:o},e.id))}):null,he.map(e=>{let t=_.get(e)??[];return t.length===0?null:(0,U.jsx)(Be,{title:r.categories[e]??e,children:t.map(e=>(0,U.jsx)(Ve,{row:e,description:y(e),labels:r,onPick:o},e.id))},e)}),(0,U.jsxs)(`button`,{type:`button`,onClick:s,className:k(`flex w-full items-center gap-3 rounded-xl bg-surface-hover/25 px-4 py-3 text-left transition-colors`,`hover:bg-surface-hover/55 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:[(0,U.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-surface-base/60 text-fg-muted`,children:(0,U.jsx)(C,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0})}),(0,U.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:r.addCustom}),(0,U.jsx)(`span`,{className:`mt-0.5 block text-xs text-fg-muted`,children:r.customDescription})]}),(0,U.jsx)(v,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0})]})]})})]})}function Be(e){let t=(0,H.c)(7),{title:n,children:r}=e,i;t[0]===n?i=t[1]:(i=(0,U.jsx)(`h3`,{className:`mb-1.5 px-1 text-xs font-semibold text-fg-muted`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,U.jsx)(`div`,{className:`flex flex-col gap-1 rounded-xl bg-surface-hover/20 p-1`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,U.jsxs)(`section`,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Ve(e){let t=(0,H.c)(27),{row:n,description:r,labels:i,prominent:a,onPick:o}=e,s=a!==void 0&&a,c;t[0]!==o||t[1]!==n.id?(c=()=>o(n.id),t[0]=o,t[1]=n.id,t[2]=c):c=t[2];let l=s&&`bg-surface-base/80`,u;t[3]===l?u=t[4]:(u=k(`flex min-h-12 w-full items-center gap-3 rounded-lg bg-surface-base/55 px-3 py-2.5 text-left transition-colors`,`hover:bg-surface-base focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,l),t[3]=l,t[4]=u);let d;t[5]===n.name?d=t[6]:(d=(0,U.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:n.name}),t[5]=n.name,t[6]=d);let f;t[7]!==i||t[8]!==s?(f=s?(0,U.jsx)(`span`,{className:`shrink-0 rounded-full bg-accent-soft px-2 py-0.5 text-[11px] font-medium text-accent-fg`,children:i.recommended}):null,t[7]=i,t[8]=s,t[9]=f):f=t[9];let p;t[10]!==d||t[11]!==f?(p=(0,U.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[d,f]}),t[10]=d,t[11]=f,t[12]=p):p=t[12];let m;t[13]===r?m=t[14]:(m=r?(0,U.jsx)(`span`,{className:`mt-0.5 block truncate text-xs text-fg-muted`,children:r}):null,t[13]=r,t[14]=m);let h;t[15]!==p||t[16]!==m?(h=(0,U.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[p,m]}),t[15]=p,t[16]=m,t[17]=h):h=t[17];let g;t[18]!==i||t[19]!==n.configured?(g=n.configured?(0,U.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-1 text-[11px] font-medium text-emerald-700 dark:text-emerald-300`,children:[(0,U.jsx)(x,{className:`size-3.5`,"aria-hidden":!0}),i.connected]}):null,t[18]=i,t[19]=n.configured,t[20]=g):g=t[20];let _;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,U.jsx)(v,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0}),t[21]=_):_=t[21];let y;return t[22]!==g||t[23]!==c||t[24]!==u||t[25]!==h?(y=(0,U.jsxs)(`button`,{type:`button`,onClick:c,className:u,children:[h,g,_]}),t[22]=g,t[23]=c,t[24]=u,t[25]=h,t[26]=y):y=t[26],y}function He(e){return{clientKey:crypto.randomUUID(),value:e}}function Ue(e=`custom`){if(e!==`custom`&&Z[e]){let t=Z[e].config;return{preset:e,providerId:Q(e),baseUrl:t.baseUrl??``,api:t.api??`openai-completions`,apiKey:t.apiKey??``,modelSlots:(t.models?.map(e=>e.id)??[``]).map(He),error:null}}return{preset:`custom`,providerId:``,baseUrl:``,api:`openai-completions`,apiKey:``,modelSlots:[He(``)],error:null}}function We(e,t){switch(t.type){case`applyPreset`:return t.key===`custom`?{...e,preset:`custom`,error:null}:Z[t.key]?Ue(t.key):e;case`setProviderId`:return{...e,providerId:t.value};case`setBaseUrl`:return{...e,baseUrl:t.value};case`setApi`:return{...e,api:t.value};case`setApiKey`:return{...e,apiKey:t.value};case`addModelSlot`:return{...e,modelSlots:[...e.modelSlots,He(``)]};case`updateModelId`:return{...e,modelSlots:e.modelSlots.map((e,n)=>n===t.index?{...e,value:t.value}:e)};case`setModelIds`:return{...e,modelSlots:(t.values.length>0?t.values:[``]).map(He)};case`removeModelSlot`:return{...e,modelSlots:e.modelSlots.filter((e,n)=>n!==t.index)};case`setError`:return{...e,error:t.value}}}function Ge({initialPresetKey:e,customConfig:t,labels:n,language:r,onBack:i,onSaved:a}){let[o,s]=(0,V.useReducer)(We,void 0,()=>Ue(e)),[l,u]=(0,V.useState)(!1),[d,f]=(0,V.useState)(!1),p=re(c(r).providersSettings),{preset:h,providerId:g,baseUrl:_,api:x,apiKey:C,modelSlots:D,error:A}=o,j=D.map(e=>e.value),M=async()=>{let e=g.trim(),r=_.trim();if(!e){s({type:`setError`,value:n.providerIdRequired});return}if(!r){s({type:`setError`,value:n.baseUrlRequired});return}let i=j.map(e=>e.trim()).filter(Boolean);u(!0),s({type:`setError`,value:null});try{let n=t?.providers??{},o=h===`custom`?void 0:Z[h]?.config,s={...o??{},baseUrl:r,api:x,apiKey:C.trim()||void 0,models:i.map(e=>o?.models?.find(t=>t.id===e)??{id:e})};await Y({providers:{...n,[e]:s}});let c=new Set(n[e]?.models?.map(e=>e.id)??[]);a(e,s.models?.filter(e=>!c.has(e.id)&&!e.computerUse).map(e=>e.id)??[])}catch(e){s({type:`setError`,value:e instanceof Error?e.message:n.saveError})}finally{u(!1)}},N=async()=>{let e=g.trim()||Q(h)||`custom`,t=_.trim();if(!t){s({type:`setError`,value:n.baseUrlRequired});return}f(!0),s({type:`setError`,value:null});try{let r=h===`custom`?void 0:Z[h]?.config,i=(await X({providerId:e,baseUrl:t,apiKey:C.trim()||void 0,api:x,headers:r?.headers})).map(e=>e.id).filter(e=>e&&!e.includes(`/`));s({type:`setModelIds`,values:i}),i.length===0&&s({type:`setError`,value:n.discoverModelsHint})}catch(e){s({type:`setError`,value:e instanceof Error?e.message:n.discoverModelsHint})}finally{f(!1)}},P=g.trim()&&_.trim(),ee=(x===`openai-completions`||x===`openai-responses`)&&_.trim();return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 px-5 pb-3 pt-5`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:i,className:k(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,I.press),"aria-label":n.back,children:(0,U.jsx)(v,{className:`size-4 rotate-180`,"aria-hidden":!0})}),(0,U.jsx)(m,{className:`min-w-0 flex-1 text-base font-semibold text-fg`,children:n.step2CustomTitle}),(0,U.jsx)(Re,{label:n.close})]}),(0,U.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 pb-4`,children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-4 rounded-xl bg-surface-hover/20 p-4`,children:[(0,U.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.customDescription}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,U.jsx)(`label`,{htmlFor:`custom-preset`,className:`text-sm font-medium text-fg`,children:n.presetLabel}),(0,U.jsxs)(y,{id:`custom-preset`,value:h,onChange:e=>s({type:`applyPreset`,key:e.target.value}),className:De(),children:[(0,U.jsx)(b,{value:`custom`,children:n.presetCustom}),Se.map(e=>(0,U.jsx)(b,{value:e.key,children:e.label},e.key))]})]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,U.jsx)(`label`,{htmlFor:`custom-provider-id`,className:`text-sm font-medium text-fg`,children:n.providerIdLabel}),(0,U.jsx)(`input`,{id:`custom-provider-id`,type:`text`,autoComplete:`off`,value:g,onChange:e=>s({type:`setProviderId`,value:e.target.value}),placeholder:n.providerIdPlaceholder,className:k(`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle`,R)})]}),(0,U.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,U.jsx)(`label`,{htmlFor:`custom-base-url`,className:`text-sm font-medium text-fg`,children:n.baseUrlLabel}),(0,U.jsx)(`input`,{id:`custom-base-url`,type:`url`,autoComplete:`off`,value:_,onChange:e=>s({type:`setBaseUrl`,value:e.target.value}),placeholder:n.baseUrlPlaceholder,className:k(`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle`,R)})]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,U.jsx)(`label`,{htmlFor:`custom-api-type`,className:`text-sm font-medium text-fg`,children:n.apiTypeLabel}),(0,U.jsx)(y,{id:`custom-api-type`,value:x,onChange:e=>s({type:`setApi`,value:e.target.value}),className:De(),children:ve.map(e=>(0,U.jsx)(b,{value:e.value,children:e.label},e.value))})]})]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,U.jsx)(`label`,{htmlFor:`custom-api-key`,className:`text-sm font-medium text-fg`,children:n.apiKeyLabel}),(0,U.jsx)(S,{id:`custom-api-key`,value:C,onChange:e=>s({type:`setApiKey`,value:e}),placeholder:n.apiKeyPlaceholder,labels:p})]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,U.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:n.modelIdLabel}),(0,U.jsxs)(F,{type:`button`,variant:`secondary`,className:`gap-1.5`,disabled:!ee||d,onClick:()=>void N(),children:[d?(0,U.jsx)(w,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,U.jsx)(E,{className:`size-3.5`,"aria-hidden":!0}),d?n.discoveringModels:n.discoverModels]})]}),j.map((e,t)=>(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`input`,{type:`text`,autoComplete:`off`,value:e,onChange:e=>s({type:`updateModelId`,index:t,value:e.target.value}),placeholder:n.modelIdPlaceholder,className:k(`flex-1 rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle`,R)}),j.length>1?(0,U.jsx)(`button`,{type:`button`,onClick:()=>s({type:`removeModelSlot`,index:t}),className:k(`rounded-lg p-1.5 text-fg-subtle hover:bg-surface-hover hover:text-fg`,I.press),children:(0,U.jsx)(O,{className:`size-3.5`,"aria-hidden":!0})}):null]},D[t].clientKey)),(0,U.jsxs)(F,{type:`button`,variant:`ghost`,className:`w-fit gap-1.5 text-fg-muted`,onClick:()=>s({type:`addModelSlot`}),children:[(0,U.jsx)(T,{className:`size-3.5`,"aria-hidden":!0}),n.addModel]})]}),A?(0,U.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:A}):null]})}),(0,U.jsxs)(`div`,{className:`flex items-center justify-end gap-2 bg-surface-hover/15 px-5 py-3`,children:[(0,U.jsx)(F,{type:`button`,variant:`secondary`,onClick:i,children:n.cancel}),(0,U.jsx)(F,{type:`button`,variant:`primary`,disabled:!P||l,onClick:()=>void M(),children:l?(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(w,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),n.saving]}):n.save})]})]})}function Ke(){let e=(0,H.c)(29),t=!!o(Qe),{data:n,isLoading:r}=M(t),i;e[0]===t?i=e[1]:(i=t?a(`/api/providers/meta`):null,e[0]=t,e[1]=i);let s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(s={revalidateOnFocus:!1},e[2]=s):s=e[2];let{data:c,isLoading:l}=j(i,Ze,s),u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(u={revalidateOnFocus:!1},e[3]=u):u=e[3];let{data:d,isLoading:f}=j(t?P:null,Xe,u),p;e[4]===d?p=e[5]:(p=d===void 0?[]:d,e[4]=d,e[5]=p);let m=p,h;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(h={revalidateOnFocus:!1},e[6]=h):h=e[6];let{data:g}=j(t?ce:null,Ye,h),_;bb0:{if(!c||n===void 0){let t;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[7]=t):t=e[7],_=t;break bb0}let t;e[8]!==n?.payload?.config||e[9]!==c||e[10]!==m?(t=z(c,ue(n?.payload?.config),m),e[8]=n?.payload?.config,e[9]=c,e[10]=m,e[11]=t):t=e[11],_=t}let v=_,y;bb1:{if(!g){y=null;break bb1}let t;e[12]===g.config?t=e[13]:(t=ye(g.config),e[12]=g.config,e[13]=t),y=t}let b=y,x;if(e[14]!==v||e[15]!==b||e[16]!==c||e[17]!==m){x=[];let t=new Set((c??[]).filter(Je).map(qe)),n;e[19]===b?n=e[20]:(n=new Set(b?Object.keys(b.providers):[]),e[19]=b,e[20]=n);let r=n;for(let e of v){if(!t.has(e.id))continue;let n=r.has(e.id),i=n?b.providers[e.id]?.models?.length??0:m.filter(t=>t.provider===e.id).length;x.push({id:e.id,name:e.name,configured:!0,isCustom:n,modelCount:i})}if(b){let t;e[21]===b.providers?t=e[22]:(t=Object.entries(b.providers),e[21]=b.providers,e[22]=t);for(let[e,n]of t)x.some(t=>t.id===e)||x.push({id:e,name:e,configured:!0,isCustom:!0,modelCount:n.models?.length??0})}e[14]=v,e[15]=b,e[16]=c,e[17]=m,e[18]=x}else x=e[18];let S=x,C=r||l||f,w;return e[23]!==v||e[24]!==S||e[25]!==b||e[26]!==C||e[27]!==m?(w={cards:S,loading:C,builtinRows:v,customConfig:b,allModels:m},e[23]=v,e[24]=S,e[25]=b,e[26]=C,e[27]=m,e[28]=w):w=e[28],w}function qe(e){return e.id}function Je(e){return e.configured}function Ye(){return be()}function Xe(){return N()}async function Ze(e){let{payload:t}=await(await fetch(e,{credentials:`same-origin`,redirect:`error`})).json();return t?.providers??[]}function Qe(e){return e.conversationId}function $e(e){let t=(0,H.c)(12),{labels:n,data:r,onAdd:i,onManage:a}=e,{cards:o,loading:s}=r;if(s){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,U.jsx)(A,{className:`h-6 w-48 max-w-full`}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,U.jsxs)(`div`,{className:`flex flex-col gap-3`,"aria-busy":`true`,children:[e,(0,U.jsx)(`div`,{className:`flex flex-col gap-1`,children:[1,2,3].map(tt)})]}),t[1]=n):n=t[1],n}let c;if(t[2]!==o||t[3]!==n||t[4]!==i||t[5]!==a){let e=o.filter(et),r=e.length>0?n.titleCount.replace(`{{count}}`,String(e.length)):n.title,s;t[7]===r?s=t[8]:(s=(0,U.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:r}),t[7]=r,t[8]=s);let l=e.length>0?(0,U.jsxs)(F,{type:`button`,variant:`primary`,className:`gap-1.5`,onClick:i,children:[(0,U.jsx)(T,{className:`size-3.5`,strokeWidth:2,"aria-hidden":!0}),n.addProvider]}):null,u;t[9]!==s||t[10]!==l?(u=(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[s,l]}),t[9]=s,t[10]=l,t[11]=u):u=t[11],c=(0,U.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[u,e.length===0?(0,U.jsxs)(`div`,{className:`rounded-xl bg-surface-hover/25 px-6 py-10 text-center`,children:[(0,U.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:n.empty}),(0,U.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:n.emptyHint}),(0,U.jsxs)(F,{type:`button`,variant:`primary`,className:`mt-4 gap-1.5`,onClick:i,children:[(0,U.jsx)(T,{className:`size-3.5`,strokeWidth:2,"aria-hidden":!0}),n.addProvider]})]}):(0,U.jsx)(`div`,{className:`flex flex-col gap-1 rounded-xl bg-surface-hover/20 p-1`,children:e.map(e=>(0,U.jsx)(nt,{card:e,labels:n,onManage:()=>a(e.id,e.isCustom)},e.id))})]}),t[2]=o,t[3]=n,t[4]=i,t[5]=a,t[6]=c}else c=t[6];return c}function et(e){return e.configured}function tt(e){return(0,U.jsx)(A,{className:`h-16 rounded-lg`},e)}function nt(e){let t=(0,H.c)(26),{card:n,labels:r,onManage:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=k(`group relative flex min-h-16 w-full flex-col justify-center gap-2 rounded-lg bg-surface-base/45 px-3 py-3 text-left transition-colors sm:flex-row sm:items-center sm:gap-4`,`hover:bg-surface-hover/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,I.pressCard),t[0]=a):a=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,U.jsx)(x,{className:`size-4 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}),t[1]=o):o=t[1];let s;t[2]===n.name?s=t[3]:(s=(0,U.jsx)(`span`,{className:`min-w-0 text-sm font-semibold leading-snug text-fg`,children:n.name}),t[2]=n.name,t[3]=s);let c;t[4]!==n.isCustom||t[5]!==r.custom?(c=n.isCustom?(0,U.jsx)(`span`,{className:`shrink-0 rounded bg-surface-hover px-1.5 py-0.5 text-[10px] font-medium text-fg-subtle`,children:r.custom}):null,t[4]=n.isCustom,t[5]=r.custom,t[6]=c):c=t[6];let l;t[7]!==s||t[8]!==c?(l=(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[o,s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9];let u;t[10]!==n.modelCount||t[11]!==r.modelsCount||t[12]!==r.noModels?(u=n.modelCount>0?r.modelsCount.replace(`{{count}}`,String(n.modelCount)):r.noModels,t[10]=n.modelCount,t[11]=r.modelsCount,t[12]=r.noModels,t[13]=u):u=t[13];let d;t[14]===u?d=t[15]:(d=(0,U.jsx)(`span`,{className:`whitespace-nowrap text-xs text-fg-subtle`,children:u}),t[14]=u,t[15]=d);let f;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,U.jsx)(D,{className:`size-3`,"aria-hidden":!0}),t[16]=f):f=t[16];let p;t[17]===r.manage?p=t[18]:(p=(0,U.jsxs)(`span`,{className:`flex items-center gap-1 text-xs font-medium text-accent-fg`,children:[f,r.manage]}),t[17]=r.manage,t[18]=p);let m;t[19]!==d||t[20]!==p?(m=(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-4 pl-6 sm:justify-end sm:pl-0`,children:[d,p]}),t[19]=d,t[20]=p,t[21]=m):m=t[21];let h;return t[22]!==i||t[23]!==m||t[24]!==l?(h=(0,U.jsxs)(`button`,{type:`button`,onClick:i,className:a,children:[l,m]}),t[22]=i,t[23]=m,t[24]=l,t[25]=h):h=t[25],h}export{pe as C,W as S,B as T,Y as _,Fe as a,G as b,Ae as c,Ee as d,ke as f,xe as g,De as h,Ie as i,je as l,Oe as m,Ke as n,Me as o,$ as p,Le as r,Ne as s,$e as t,Te as u,K as v,fe as w,me as x,q as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as e}from"./locale-store-5DzxIIeq.js";var t=e(()=>({connectionState:`idle`,error:null}));function n(e){t.setState(e)}export{t as n,n as t};
|