dsh-model-groups 0.3.3 → 0.3.5

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.
@@ -3,7 +3,7 @@
3
3
  "packageName": "@deepseek-ai/dsh-client-ui-settings-models",
4
4
  "target": "node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/client.js",
5
5
  "baseSha256": "e111ecefea8262e0426f528864b9681d818068042e93d053bcb0b6884b317278",
6
- "resultSha256": "651052eccf0bdba6a8dd1624bfc25ce9215268cdd6a9a08b80e1095329c1ea5a",
6
+ "resultSha256": "6834aeb8fc479533782b326b2810416e70cb4b1f9587dcc09388c8c9e299df43",
7
7
  "replacements": [
8
8
  {
9
9
  "before": "\t\t//#region lib/types/client/CustomProviderCard.js",
@@ -144,6 +144,194 @@
144
144
  {
145
145
  "before": "\t\tconst zh = {",
146
146
  "after": "\t\tconst zh = {\n\t\t\tmultiKey: \"多密钥配置\",\n\t\t\tmultiKeyHelp: \"各配置共享 Provider ID、API 地址与协议,分别管理名称、API 密钥和模型。关闭后恢复原单密钥配置,已保存的配置与密钥不会删除。\",\n\t\t\tmultiKeySharedSettings: \"公共设置\",\n\t\t\tmultiKeyAdd: \"添加密钥配置\",\n\t\t\tmultiKeyRemove: \"移除\",\n\t\t\tmultiKeyEntryName: \"配置名称\",\n\t\t\tmultiKeyDefaultName: \"密钥配置\",\n\t\t\tmultiKeyDisableTitle: \"关闭多密钥配置?\",\n\t\t\tmultiKeyDisableDescription: \"应用后,此供应商将使用原单密钥配置,已保存的密钥配置与凭据不会删除。正在使用密钥配置的会话需要重新开启,或手动选择单密钥模型;不会自动换用其他密钥。\",\n\t\t\tmultiKeyKeepEnabled: \"保持开启\",\n\t\t\tmultiKeyDisableConfirm: \"确认关闭(待应用)\",\n\t\t\tmultiKeyUnsavedTitle: \"请先保存新输入的密钥\",\n\t\t\tmultiKeyUnsavedKeys: \"当前有尚未保存的 API 密钥输入。关闭后直接应用不会保存这些输入,因此开关将保持开启。请返回密钥配置并应用保存,再重新打开此卡片关闭;当前输入与已存储的密钥均未删除。\",\n\t\t\tmultiKeyReturnToEdit: \"返回密钥配置\",\n\t\t\tmultiKeyRef: \"密钥引用:{ref}\",\n\t\t\tmultiKeySaved: \"引用已保存,尚未检查密钥状态;输入留空可保留原密钥。\",\n\t\t\tmultiKeyNew: \"尚未保存;输入留空不会创建密钥。\",\n\t\t\tmultiKeyConfigured: \"已确认密钥已配置;留空可保留。\",\n\t\t\tmultiKeyMissing: \"已确认此引用缺少密钥,请输入或在环境中配置。\",\n\t\t\tmultiKeyKeepCredentials: \"移除密钥配置不会删除已存储的密钥。\",\n\t\t\tmultiKeyNeedsEntries: \"请至少添加一个密钥配置。\",\n\t\t\tmultiKeyInvalidId: \"密钥配置 ID 无效,请重新打开此卡片或修正配置。\",\n\t\t\tmultiKeyInvalidName: \"每个配置名称须为 1–120 个字符。\",\n\t\t\tmultiKeyInvalidRef: \"密钥引用无效。\",\n\t\t\tmultiKeyDuplicateRef: \"多个密钥配置使用了相同的密钥引用;每个配置必须使用独立引用。\",\n\t\t\tmultiKeyNeedsModels: \"每个密钥配置至少需要一个模型。\",\n\t\t\tmultiKeyReplaceConfirm: \"确认替换 {ref} 的密钥;共用此引用的其他配置也会受到影响。\",\n\t\t\tmultiKeyConfirmRequired: \"请先确认替换已引用的密钥,再应用。\",\n\t\t\tmultiKeyProbeNeedsKey: \"保存前请先输入此配置的 API 密钥再获取模型;不会使用供应商原来的密钥。\",\n\t\t\tmultiKeySaveFailed: \"保存尚未完成。请保留此卡片并重试;已成功写入的密钥不会重复写入。\","
147
+ },
148
+ {
149
+ "before": "\t\tfunction MultiKeyEntriesEditor(props) {",
150
+ "after": "\t\tfunction multiKeyEntryDirty(entry, saved, draft) {\n\t\t\treturn saved === void 0 || JSON.stringify(entry) !== JSON.stringify(saved) || (draft ?? \"\").length > 0;\n\t\t}\n\t\tfunction MultiKeyEntriesEditor(props) {"
151
+ },
152
+ {
153
+ "before": "const [busyEntries, setBusyEntries] = (0, react.useState)({});",
154
+ "after": "const [busyEntries, setBusyEntries] = (0, react.useState)({});\n\t\t\tconst [expandedEntries, setExpandedEntries] = (0, react.useState)({});\n\t\t\tconst detailsPrefix = (0, react.useId)();\n\t\t\tconst previousSave = (0, react.useRef)(props.saveState);\n\t\t\t(0, react.useEffect)(() => {\n\t\t\t\tconst save = props.saveState;\n\t\t\t\tif (save === previousSave.current) return;\n\t\t\t\tpreviousSave.current = save;\n\t\t\t\tif (!save) return;\n\t\t\t\tsetExpandedEntries((current) => {\n\t\t\t\t\tconst next = { ...current };\n\t\t\t\t\tfor (const id of Object.keys(save.entries)) {\n\t\t\t\t\t\t// Only collapse the exact snapshot acknowledged by this save.\n\t\t\t\t\t\tif (!save.ok || !multiKeyEntryDirty(entries[id], save.entries[id], keyDrafts[id])) next[id] = !save.ok;\n\t\t\t\t\t}\n\t\t\t\t\treturn next;\n\t\t\t\t});\n\t\t\t}, [props.saveState, entries, keyDrafts]);\n\t\t\tconst invalidRows = Object.keys(entries).filter((id) => multiKeyFailure(route, { [id]: entries[id] }, keyDrafts, confirmations, t) !== void 0);\n\t\t\tconst invalidEntries = invalidRows.length > 0 ? invalidRows : multiKeyFailure(route, entries, keyDrafts, confirmations, t) !== void 0 ? Object.keys(entries) : [];\n\t\t\tconst invalidSignature = JSON.stringify(invalidEntries);\n\t\t\t(0, react.useEffect)(() => {\n\t\t\t\tif (invalidEntries.length > 0) setExpandedEntries((current) => ({ ...current, ...Object.fromEntries(invalidEntries.map((id) => [id, true])) }));\n\t\t\t}, [invalidSignature]);"
155
+ },
156
+ {
157
+ "before": "const heading = typeof entry.name === \"string\"",
158
+ "after": "const dirty = multiKeyEntryDirty(entry, props.savedEntries?.[id] ?? props.persistedEntries?.[id], draft);\n\t\t\t\t\tconst expanded = expandedEntries[id] ?? !Object.hasOwn(props.persistedEntries ?? {}, id);\n\t\t\t\t\tconst detailsId = detailsPrefix + \"-\" + id;\n\t\t\t\t\tconst heading = typeof entry.name === \"string\""
159
+ },
160
+ {
161
+ "before": "\"data-key-entry-id\": id, role: \"group\", \"aria-label\": heading,",
162
+ "after": "\"data-key-entry-id\": id, \"data-key-entry-expanded\": expanded, \"data-key-entry-dirty\": dirty, role: \"group\", \"aria-label\": heading,"
163
+ },
164
+ {
165
+ "before": "\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\t\t\"data-key-entry-heading\": true,\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"rowHead\"],\n\t\t\t\t\t\t\tstyle: { flexWrap: \"wrap\" },\n\t\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"rowName\"],\n\t\t\t\t\t\t\t\tstyle: { minWidth: 0, overflowWrap: \"anywhere\", flex: \"1 1 120px\" }, children: heading\n\t\t\t\t\t\t\t}), (0, react_jsx_runtime.jsx)(\"div\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"rowActions\"],\n\t\t\t\t\t\t\t\tchildren: (0, react_jsx_runtime.jsx)(\"button\", {\n\t\t\t\t\t\t\t\t\ttype: \"button\", className: ModelsSection_module_css_default[\"secondaryButton\"], disabled,\n\t\t\t\t\t\t\t\t\tonClick: () => remove(id), children: t(\"multiKeyRemove\")\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t})]\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t(0, react_jsx_runtime.jsxs)(\"label\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"span\", { className: ModelsSection_module_css_default[\"fieldLabel\"], children: t(\"multiKeyEntryName\") }),\n\t\t\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(\"input\", {\n\t\t\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"input\"], type: \"text\", value: entry.name ?? \"\", maxLength: 120,\n\t\t\t\t\t\t\t\t\t\t\"aria-label\": `${t(\"multiKeyEntryName\")} ${String(index + 1)}`, disabled,\n\t\t\t\t\t\t\t\t\t\tonChange: (event) => update(id, { name: event.target.value })\n\t\t\t\t\t\t\t\t\t})]\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t(0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"span\", { className: ModelsSection_module_css_default[\"fieldLabel\"], children: t(\"keyInput\") }),\n\t\t\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(ApiKeyInput, {\n\t\t\t\t\t\t\t\t\t\tt, value: draft, placeholder: t(persisted ? \"keyPlaceholderSaved\" : \"keyPlaceholder\"),\n\t\t\t\t\t\t\t\t\t\t\"aria-label\": `${t(\"keyInput\")} ${String(index + 1)}`, \"aria-invalid\": keyFailure !== void 0,\n\t\t\t\t\t\t\t\t\t\tdisabled: props.keyDisabled ?? disabled,\n\t\t\t\t\t\t\t\t\t\tonChange: (event) => {\n\t\t\t\t\t\t\t\t\t\t\tconst value = event.target.value;\n\t\t\t\t\t\t\t\t\t\t\tonKeyDraftsChange((current) => ({ ...current, [id]: value }));\n\t\t\t\t\t\t\t\t\t\t\tonConfirmationsChange((current) => ({ ...current, [id]: false }));\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(\"p\", { className: ModelsSection_module_css_default[\"advancedHint\"], children: t(status) }),\n\t\t\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(\"p\", { className: ModelsSection_module_css_default[\"advancedHint\"], style: { overflowWrap: \"anywhere\" }, children: t(\"multiKeyRef\").replace(\"{ref}\", () => ref) }),\n\t\t\t\t\t\t\t\t\tkeyFailure === void 0 ? null : (0, react_jsx_runtime.jsx)(\"p\", { className: ModelsSection_module_css_default[\"error\"], children: t(keyFailure) })]\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tneedsConfirmation ? (0, react_jsx_runtime.jsxs)(\"label\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"fieldLabel\"],\n\t\t\t\t\t\t\t\tstyle: { display: \"flex\", alignItems: \"flex-start\", gap: 8, overflowWrap: \"anywhere\" },\n\t\t\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"input\", {\n\t\t\t\t\t\t\t\t\ttype: \"checkbox\", \"data-confirm-entry\": id, \"aria-label\": t(\"multiKeyReplaceConfirm\").replace(\"{ref}\", () => ref),\n\t\t\t\t\t\t\t\t\tchecked: confirmations[id] === true, disabled: props.keyDisabled ?? disabled,\n\t\t\t\t\t\t\t\t\tonChange: (event) => onConfirmationsChange((current) => ({ ...current, [id]: event.target.checked }))\n\t\t\t\t\t\t\t\t}), (0, react_jsx_runtime.jsx)(\"span\", { children: t(\"multiKeyReplaceConfirm\").replace(\"{ref}\", () => ref) })]\n\t\t\t\t\t\t\t}) : null,\n\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(ModelListEditor, {\n\t\t\t\t\t\t\t\tmodels: modelDrafts(entry.models), onChange: (models) => update(id, { models }),\n\t\t\t\t\t\t\t\treasoningLevels: props.reasoningLevels, probe,\n\t\t\t\t\t\t\t\tprobeBlocked: keyFailure ?? props.probeBlocked ?? (!canUseStored && draft.trim().length === 0 ? \"multiKeyProbeNeedsKey\" : void 0),\n\t\t\t\t\t\t\t\toperations, t, disabled,\n\t\t\t\t\t\t\t\tonBusyChange: (value) => setBusyEntries((current) => current[id] === value ? current : { ...current, [id]: value })\n\t\t\t\t\t\t\t})]",
166
+ "after": "\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\t\t\"data-key-entry-heading\": true,\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"rowHead\"], style: { flexWrap: \"wrap\" },\n\t\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"rowName\"],\n\t\t\t\t\t\t\t\tstyle: { minWidth: 0, overflowWrap: \"anywhere\", flex: \"1 1 120px\" }, children: heading\n\t\t\t\t\t\t\t}), dirty ? (0, react_jsx_runtime.jsx)(\"span\", { \"data-key-entry-unsaved\": true, children: t(\"multiKeyUnsaved\") }) : null,\n\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(\"button\", {\n\t\t\t\t\t\t\t\ttype: \"button\", className: ModelsSection_module_css_default[\"secondaryButton\"],\n\t\t\t\t\t\t\t\t\"aria-expanded\": expanded, \"aria-controls\": detailsId,\n\t\t\t\t\t\t\t\tonClick: () => setExpandedEntries((current) => ({ ...current, [id]: !expanded })),\n\t\t\t\t\t\t\t\tchildren: t(expanded ? \"multiKeyCollapse\" : \"multiKeyExpand\")\n\t\t\t\t\t\t\t})]\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t(0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"span\", { className: ModelsSection_module_css_default[\"fieldLabel\"], children: t(\"keyInput\") }),\n\t\t\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(ApiKeyInput, {\n\t\t\t\t\t\t\t\t\t\tt, value: draft, placeholder: t(persisted ? \"keyPlaceholderSaved\" : \"keyPlaceholder\"),\n\t\t\t\t\t\t\t\t\t\t\"aria-label\": `${t(\"keyInput\")} ${String(index + 1)}`, \"aria-invalid\": keyFailure !== void 0,\n\t\t\t\t\t\t\t\t\t\tdisabled: props.keyDisabled ?? disabled,\n\t\t\t\t\t\t\t\t\t\tonChange: (event) => {\n\t\t\t\t\t\t\t\t\t\t\tconst value = event.target.value;\n\t\t\t\t\t\t\t\t\t\t\tonKeyDraftsChange((current) => ({ ...current, [id]: value }));\n\t\t\t\t\t\t\t\t\t\t\tonConfirmationsChange((current) => ({ ...current, [id]: false }));\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(\"p\", { className: ModelsSection_module_css_default[\"advancedHint\"], children: t(status) }),\n\t\t\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(\"p\", { className: ModelsSection_module_css_default[\"advancedHint\"], style: { overflowWrap: \"anywhere\" }, children: t(\"multiKeyRef\").replace(\"{ref}\", () => ref) }),\n\t\t\t\t\t\t\t\t\tkeyFailure === void 0 ? null : (0, react_jsx_runtime.jsx)(\"p\", { className: ModelsSection_module_css_default[\"error\"], children: t(keyFailure) })]\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tneedsConfirmation ? (0, react_jsx_runtime.jsxs)(\"label\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"fieldLabel\"],\n\t\t\t\t\t\t\t\tstyle: { display: \"flex\", alignItems: \"flex-start\", gap: 8, overflowWrap: \"anywhere\" },\n\t\t\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"input\", {\n\t\t\t\t\t\t\t\t\ttype: \"checkbox\", \"data-confirm-entry\": id, \"aria-label\": t(\"multiKeyReplaceConfirm\").replace(\"{ref}\", () => ref),\n\t\t\t\t\t\t\t\t\tchecked: confirmations[id] === true, disabled: props.keyDisabled ?? disabled,\n\t\t\t\t\t\t\t\t\tonChange: (event) => onConfirmationsChange((current) => ({ ...current, [id]: event.target.checked }))\n\t\t\t\t\t\t\t\t}), (0, react_jsx_runtime.jsx)(\"span\", { children: t(\"multiKeyReplaceConfirm\").replace(\"{ref}\", () => ref) })]\n\t\t\t\t\t\t\t}) : null,\n\t\t\t\t\t\t(0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\t\tid: detailsId, \"data-key-entry-details\": true, hidden: !expanded,\n\t\t\t\t\t\t\tstyle: { display: expanded ? \"contents\" : \"none\" }, children: [\n\t\t\t\t\t\t\t(0, react_jsx_runtime.jsxs)(\"label\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"span\", { className: ModelsSection_module_css_default[\"fieldLabel\"], children: t(\"multiKeyEntryName\") }),\n\t\t\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(\"input\", {\n\t\t\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"input\"], type: \"text\", value: entry.name ?? \"\", maxLength: 120,\n\t\t\t\t\t\t\t\t\t\t\"aria-label\": `${t(\"multiKeyEntryName\")} ${String(index + 1)}`, disabled,\n\t\t\t\t\t\t\t\t\t\tonChange: (event) => update(id, { name: event.target.value })\n\t\t\t\t\t\t\t\t\t})]\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(ModelListEditor, {\n\t\t\t\t\t\t\t\tmodels: modelDrafts(entry.models), onChange: (models) => update(id, { models }),\n\t\t\t\t\t\t\t\treasoningLevels: props.reasoningLevels, probe,\n\t\t\t\t\t\t\t\tprobeBlocked: keyFailure ?? props.probeBlocked ?? (!canUseStored && draft.trim().length === 0 ? \"multiKeyProbeNeedsKey\" : void 0),\n\t\t\t\t\t\t\t\toperations, t, disabled,\n\t\t\t\t\t\t\t\tonBusyChange: (value) => setBusyEntries((current) => current[id] === value ? current : { ...current, [id]: value })\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(\"button\", {\n\t\t\t\t\t\t\t\ttype: \"button\", className: ModelsSection_module_css_default[\"secondaryButton\"], disabled,\n\t\t\t\t\t\t\t\tonClick: () => remove(id), children: t(\"multiKeyRemove\")\n\t\t\t\t\t\t\t})]\n\t\t\t\t\t\t})]"
167
+ },
168
+ {
169
+ "before": "function CustomProviderCard(props) {\n\t\t\tconst { taken, protocols, reasoningLevels, operations, t, onBusyChange } = props;\n\t\t\tconst supportsMultiKey = supportsMultiKeySchema(props.namespace, props.schema, [\"providers\", PROBE_ROUTE]);\n\t\t\tconst [openedAt] = (0, react.useState)(() => props.revision);\n\t\t\tconst [route, setRoute] = (0, react.useState)(\"\");\n\t\t\tconst [displayName, setDisplayName] = (0, react.useState)(\"\");\n\t\t\tconst [baseURL, setBaseURL] = (0, react.useState)(\"\");\n\t\t\tconst [protocol, setProtocol] = (0, react.useState)(protocols[0] ?? \"\");\n\t\t\tconst [keyDraft, setKeyDraft] = (0, react.useState)(\"\");\n\t\t\tconst [models, setModels] = (0, react.useState)([]);\n\t\t\tconst [multiKey, setMultiKey] = (0, react.useState)(false);\n\t\t\tconst [keyEntries, setKeyEntries] = (0, react.useState)({});\n\t\t\tconst [entryKeyDrafts, setEntryKeyDrafts] = (0, react.useState)({});\n\t\t\tconst [entryConfirmations, setEntryConfirmations] = (0, react.useState)({});\n\t\t\tconst saving = (0, react.useRef)(false);\n\t\t\tconst [busy, setBusy] = (0, react.useState)(false);\n\t\t\tconst [listBusy, setListBusy] = (0, react.useState)(false);\n\t\t\t(0, react.useEffect)(() => {\n\t\t\t\tonBusyChange?.(busy || listBusy);\n\t\t\t}, [\n\t\t\t\tbusy,\n\t\t\t\tlistBusy,\n\t\t\t\tonBusyChange\n\t\t\t]);\n\t\t\tconst [failure, setFailure] = (0, react.useState)(void 0);\n\t\t\t/**\n\t\t\t* The profile write landed. Only the key write can still be outstanding, so\n\t\t\t* the fields that describe the provider are settled and the retry path is\n\t\t\t* the credential alone.\n\t\t\t*/\n\t\t\tconst [committed, setCommitted] = (0, react.useState)(false);\n\t\t\tconst disabled = props.readOnly || busy;\n\t\t\t/** Everything but the key stops being editable once the provider exists. */\n\t\t\tconst profileDisabled = disabled || committed;\n\t\t\tconst routeInvalid = route.length > 0 && !ROUTE_PATTERN.test(route);\n\t\t\tconst routeTaken = taken.includes(route);\n\t\t\tconst normalizedBaseURL = baseURL.trim();\n\t\t\tconst baseUrlInvalid = baseURL.length > 0 && !isHttpUrl(normalizedBaseURL);\n\t\t\tconst modelFailure = multiKey ? void 0 : validateDeepSeekModels(models) ?? validateReasoningEfforts(models);\n\t\t\tconst entryFailure = multiKey ? multiKeyFailure(route, keyEntries, entryKeyDrafts, entryConfirmations, t) : void 0;\n\t\t\tconst keyFailure = multiKey ? void 0 : apiKeyFailure(keyDraft);\n\t\t\tconst keyValue = keyDraft.trim();\n\t\t\tconst ready = (committed || route.length > 0 && !routeInvalid && !routeTaken) && normalizedBaseURL.length > 0 && !baseUrlInvalid && (multiKey ? entryFailure === void 0 : models.length > 0 && modelFailure === void 0 && keyFailure === void 0);\n\t\t\tconst hint = entryFailure ?? (failure !== void 0 || ready || keyFailure !== void 0 || route.length === 0 || routeInvalid || routeTaken || baseUrlInvalid ? void 0 : normalizedBaseURL.length === 0 ? t(\"customNeedsBaseUrl\") : modelFailure !== void 0 ? `${t(\"model\")} ${String(modelFailure.index + 1)}: ${t(modelFailure.key)}` : t(\"customNeedsModels\"));\n\t\t\t/** Perform the create, returning a failure message or undefined. */\n\t\t\tconst createOnce = async () => {\n\t\t\t\tconst entries = normalizedMultiKeyEntries(route, keyEntries);\n\t\t\t\tconst firstEntry = Object.values(entries)[0];\n\t\t\t\tconst keyRef = multiKey ? firstEntry?.apiKeyEnv : deriveKeyRef(route);\n\t\t\t\tconst storesKey = !multiKey && keyValue.length > 0;\n\t\t\t\tif (multiKey && entryFailure !== void 0) return entryFailure;\n\t\t\t\tif (!committed) {\n\t\t\t\t\tconst profile = {\n\t\t\t\t\t\t...displayName.length === 0 ? {} : { displayName },\n\t\t\t\t\t\t...storesKey || multiKey ? { apiKeyEnv: keyRef } : {},\n\t\t\t\t\t\tapi: protocol,\n\t\t\t\t\t\tbaseURL: normalizedBaseURL,\n\t\t\t\t\t\tmodels: (multiKey ? firstEntry.models : models).map((model) => ({ ...model })),\n\t\t\t\t\t\t...(multiKey || Object.keys(keyEntries).length > 0 ? { multiKey, keyEntries: entries } : {})\n\t\t\t\t\t};\n\t\t\t\t\tconst written = await operations.writeSettings(NS$1, [{\n\t\t\t\t\t\top: \"set\",\n\t\t\t\t\t\tpath: [\"providers\", route],\n\t\t\t\t\t\tvalue: profile\n\t\t\t\t\t}], openedAt);\n\t\t\t\t\tif (written.kind !== \"written\") return written.kind === \"conflict\" ? t(\"conflict\") : written.message;\n\t\t\t\t\tsetCommitted(true);\n\t\t\t\t}\n\t\t\t\tif (multiKey) return storeMultiKeyDrafts(operations, entries, entryKeyDrafts, setEntryKeyDrafts);\n\t\t\t\tif (storesKey) {\n\t\t\t\t\tconst stored = await operations.storeCredential(keyRef, keyValue);\n\t\t\t\t\tif (stored !== void 0) return stored;\n\t\t\t\t\tsetKeyDraft(\"\");\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst create = async () => {\n\t\t\t\tif (saving.current || !ready || props.readOnly || listBusy) return;\n\t\t\t\tsaving.current = true;\n\t\t\t\tsetBusy(true);\n\t\t\t\tsetFailure(void 0);\n\t\t\t\ttry {\n\t\t\t\t\tconst outcome = await createOnce();\n\t\t\t\t\tif (outcome !== void 0) {\n\t\t\t\t\t\tsetFailure(outcome);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tprops.onClose(true);\n\t\t\t\t} catch {\n\t\t\t\t\tsetFailure(t(\"multiKeySaveFailed\"));\n\t\t\t\t} finally {\n\t\t\t\t\tsaving.current = false;\n\t\t\t\t\tsetBusy(false);\n\t\t\t\t}\n\t\t\t};\n\t\t\treturn (0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\tclassName: ModelsSection_module_css_default[\"editor\"],\n\t\t\t\tchildren: [\n\t\t\t\t\t(0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"fieldLabel\"],\n\t\t\t\t\t\t\tchildren: t(\"customRoute\")\n\t\t\t\t\t\t}), (0, react_jsx_runtime.jsx)(\"input\", {\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"input\"],\n\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\tvalue: route,\n\t\t\t\t\t\t\tplaceholder: \"acme-gateway\",\n\t\t\t\t\t\t\t\"aria-label\": t(\"customRoute\"),\n\t\t\t\t\t\t\tdisabled: profileDisabled,\n\t\t\t\t\t\t\tonChange: (event) => {\n\t\t\t\t\t\t\t\tsetRoute(event.target.value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})]\n\t\t\t\t\t}),\n\t\t\t\t\trouteInvalid || routeTaken ? (0, react_jsx_runtime.jsx)(\"p\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"error\"],\n\t\t\t\t\t\tchildren: t(routeInvalid ? \"customRouteInvalid\" : \"customRouteTaken\")\n\t\t\t\t\t}) : (0, react_jsx_runtime.jsx)(\"p\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"advancedHint\"],\n\t\t\t\t\t\tchildren: t(\"customRouteHint\")\n\t\t\t\t\t}),\n\t\t\t\t\t(0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"fieldLabel\"],\n\t\t\t\t\t\t\tchildren: t(\"customDisplayName\")\n\t\t\t\t\t\t}), (0, react_jsx_runtime.jsx)(\"input\", {\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"input\"],\n\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\tvalue: displayName,\n\t\t\t\t\t\t\tplaceholder: route.length === 0 ? t(\"customDisplayName\") : route,\n\t\t\t\t\t\t\t\"aria-label\": t(\"customDisplayName\"),\n\t\t\t\t\t\t\tdisabled: profileDisabled,\n\t\t\t\t\t\t\tonChange: (event) => {\n\t\t\t\t\t\t\t\tsetDisplayName(event.target.value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})]\n\t\t\t\t\t}),\n\t\t\t\t\t(0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"fieldLabel\"],\n\t\t\t\t\t\t\tchildren: t(\"baseUrl\")\n\t\t\t\t\t\t}), (0, react_jsx_runtime.jsx)(\"input\", {\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"input\"],\n\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\tvalue: baseURL,\n\t\t\t\t\t\t\tplaceholder: t(protocol === \"anthropic-messages\" ? \"customAnthropicBaseUrlPlaceholder\" : \"customBaseUrlPlaceholder\"),\n\t\t\t\t\t\t\t\"aria-label\": t(\"baseUrl\"),\n\t\t\t\t\t\t\t\"aria-invalid\": baseUrlInvalid,\n\t\t\t\t\t\t\tdisabled: profileDisabled,\n\t\t\t\t\t\t\tonChange: (event) => {\n\t\t\t\t\t\t\t\tsetBaseURL(event.target.value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})]\n\t\t\t\t\t}),\n\t\t\t\t\tbaseUrlInvalid ? (0, react_jsx_runtime.jsx)(\"p\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"error\"],\n\t\t\t\t\t\tchildren: t(\"customBaseUrlInvalid\")\n\t\t\t\t\t}) : null,\n\t\t\t\t\t(0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"fieldLabel\"],\n\t\t\t\t\t\t\tchildren: t(\"customApi\")\n\t\t\t\t\t\t}), (0, react_jsx_runtime.jsx)(\"select\", {\n\t\t\t\t\t\t\tclassName: `${ModelsSection_module_css_default[\"input\"]} ${ModelsSection_module_css_default[\"selectInput\"]}`,\n\t\t\t\t\t\t\tvalue: protocol,\n\t\t\t\t\t\t\t\"aria-label\": t(\"customApi\"),\n\t\t\t\t\t\t\tdisabled: profileDisabled,\n\t\t\t\t\t\t\tonChange: (event) => {\n\t\t\t\t\t\t\t\tsetProtocol(event.target.value);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tchildren: protocols.map((choice) => (0, react_jsx_runtime.jsx)(\"option\", {\n\t\t\t\t\t\t\t\tvalue: choice,\n\t\t\t\t\t\t\t\tchildren: protocolLabel(t, choice)\n\t\t\t\t\t\t\t}, choice))\n\t\t\t\t\t\t})]\n\t\t\t\t\t}),\n\t\t\t\t\tsupportsMultiKey ? (0, react_jsx_runtime.jsx)(MultiKeyToggle, {\n\t\t\t\t\t\tt, checked: multiKey, disabled: profileDisabled || listBusy, hasUnsavedKeys: hasMultiKeyDrafts(entryKeyDrafts),\n\t\t\t\t\t\tonChange: (enabled) => {\n\t\t\t\t\t\t\tif (enabled && Object.keys(keyEntries).length === 0) {\n\t\t\t\t\t\t\t\tconst [id, entry] = newMultiKeyEntry(route, { name: displayName || route || t(\"multiKeyDefaultName\"), models });\n\t\t\t\t\t\t\t\tsetKeyEntries({ [id]: entry });\n\t\t\t\t\t\t\t\tif (keyDraft.length > 0) setEntryKeyDrafts({ [id]: keyDraft });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsetMultiKey(enabled);\n\t\t\t\t\t\t}\n\t\t\t\t\t}) : null,\n\t\t\t\t\tmultiKey ? (0, react_jsx_runtime.jsx)(MultiKeyEntriesEditor, {\n\t\t\t\t\t\troute, entries: keyEntries, onChange: setKeyEntries,\n\t\t\t\t\t\tkeyDrafts: entryKeyDrafts, onKeyDraftsChange: setEntryKeyDrafts,\n\t\t\t\t\t\tconfirmations: entryConfirmations, onConfirmationsChange: setEntryConfirmations,\n\t\t\t\t\t\tpersistedEntries: committed ? normalizedMultiKeyEntries(route, keyEntries) : {},\n\t\t\t\t\t\tprobe: { settingsNs: NS$1, ...(committed ? { provider: route } : {}), baseURL: normalizedBaseURL, api: protocol },\n\t\t\t\t\t\tprobeBlocked: baseUrlInvalid ? \"customBaseUrlInvalid\" : normalizedBaseURL.length === 0 ? \"customNeedsBaseUrl\" : void 0,\n\t\t\t\t\t\treasoningLevels, operations, t, disabled: profileDisabled || listBusy, keyDisabled: disabled || listBusy, onBusyChange: setListBusy\n\t\t\t\t\t}) : null,\n\t\t\t\t\tmultiKey ? null : (0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"fieldLabel\"],\n\t\t\t\t\t\t\t\tchildren: t(\"keyInput\")\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(ApiKeyInput, {\n\t\t\t\t\t\t\t\tt,\n\t\t\t\t\t\t\t\tvalue: keyDraft,\n\t\t\t\t\t\t\t\tplaceholder: t(\"keyPlaceholder\"),\n\t\t\t\t\t\t\t\t\"aria-label\": t(\"keyInput\"),\n\t\t\t\t\t\t\t\tdisabled,\n\t\t\t\t\t\t\t\tonChange: (event) => {\n\t\t\t\t\t\t\t\t\tsetKeyDraft(event.target.value);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tkeyFailure === void 0 ? null : (0, react_jsx_runtime.jsx)(\"p\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"error\"],\n\t\t\t\t\t\t\t\tchildren: t(keyFailure === \"keyBlank\" ? \"keyBlankNew\" : keyFailure)\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t]\n\t\t\t\t\t}),\n\t\t\t\t\t!multiKey ? (0, react_jsx_runtime.jsx)(ModelListEditor, {\n\t\t\t\t\t\tmodels,\n\t\t\t\t\t\tonChange: setModels,\n\t\t\t\t\t\treasoningLevels,\n\t\t\t\t\t\tprobe: {\n\t\t\t\t\t\t\tsettingsNs: NS$1,\n\t\t\t\t\t\t\tbaseURL: normalizedBaseURL,\n\t\t\t\t\t\t\tapi: protocol,\n\t\t\t\t\t\t\t...keyValue.length === 0 ? {} : { apiKey: keyValue }\n\t\t\t\t\t\t},\n\t\t\t\t\t\tprobeBlocked: baseUrlInvalid ? \"customBaseUrlInvalid\" : keyFailure === \"keyBlank\" ? \"keyBlankNew\" : keyFailure,\n\t\t\t\t\t\toperations,\n\t\t\t\t\t\tt,\n\t\t\t\t\t\tdisabled: profileDisabled,\n\t\t\t\t\t\tonBusyChange: setListBusy\n\t\t\t\t\t}) : null,\n\t\t\t\t\tfailure !== void 0 ? (0, react_jsx_runtime.jsx)(\"p\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"error\"],\n\t\t\t\t\t\tchildren: failure\n\t\t\t\t\t}) : null,\n\t\t\t\t\thint === void 0 ? null : (0, react_jsx_runtime.jsx)(\"p\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"advancedHint\"],\n\t\t\t\t\t\tchildren: hint\n\t\t\t\t\t}),\n\t\t\t\t\t(0, react_jsx_runtime.jsx)(EditorFooter, {\n\t\t\t\t\t\tt,\n\t\t\t\t\t\tbusy,\n\t\t\t\t\t\tsubmitDisabled: disabled || listBusy || !ready,\n\t\t\t\t\t\tsubmitLabelKey: \"create\",\n\t\t\t\t\t\tsubmitBusyLabelKey: \"creating\",\n\t\t\t\t\t\tonCancel: () => {\n\t\t\t\t\t\t\tprops.onClose(committed);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonSubmit: () => {\n\t\t\t\t\t\t\tcreate();\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t]\n\t\t\t});\n\t\t}",
170
+ "after": "function CustomProviderCard(props) {\n\t\t\tconst { taken, protocols, reasoningLevels, operations, t, onBusyChange } = props;\n\t\t\tconst supportsMultiKey = supportsMultiKeySchema(props.namespace, props.schema, [\"providers\", PROBE_ROUTE]);\n\t\t\tconst [openedAt] = (0, react.useState)(() => props.revision);\n\t\t\tconst [route, setRoute] = (0, react.useState)(\"\");\n\t\t\tconst [displayName, setDisplayName] = (0, react.useState)(\"\");\n\t\t\tconst [baseURL, setBaseURL] = (0, react.useState)(\"\");\n\t\t\tconst [protocol, setProtocol] = (0, react.useState)(protocols[0] ?? \"\");\n\t\t\tconst [keyDraft, setKeyDraft] = (0, react.useState)(\"\");\n\t\t\tconst [models, setModels] = (0, react.useState)([]);\n\t\t\tconst [multiKey, setMultiKey] = (0, react.useState)(false);\n\t\t\tconst [keyEntries, setKeyEntries] = (0, react.useState)({});\n\t\t\tconst [entryKeyDrafts, setEntryKeyDrafts] = (0, react.useState)({});\n\t\t\tconst [entryConfirmations, setEntryConfirmations] = (0, react.useState)({});\n\t\t\tconst [entrySaveState, setEntrySaveState] = (0, react.useState)(void 0);\n\t\t\tconst saving = (0, react.useRef)(false);\n\t\t\tconst [busy, setBusy] = (0, react.useState)(false);\n\t\t\tconst [listBusy, setListBusy] = (0, react.useState)(false);\n\t\t\t(0, react.useEffect)(() => {\n\t\t\t\tonBusyChange?.(busy || listBusy);\n\t\t\t}, [\n\t\t\t\tbusy,\n\t\t\t\tlistBusy,\n\t\t\t\tonBusyChange\n\t\t\t]);\n\t\t\tconst [failure, setFailure] = (0, react.useState)(void 0);\n\t\t\t/**\n\t\t\t* The profile write landed. Only the key write can still be outstanding, so\n\t\t\t* the fields that describe the provider are settled and the retry path is\n\t\t\t* the credential alone.\n\t\t\t*/\n\t\t\tconst [committed, setCommitted] = (0, react.useState)(false);\n\t\t\tconst disabled = props.readOnly || busy;\n\t\t\t/** Everything but the key stops being editable once the provider exists. */\n\t\t\tconst profileDisabled = disabled || committed;\n\t\t\tconst routeInvalid = route.length > 0 && !ROUTE_PATTERN.test(route);\n\t\t\tconst routeTaken = taken.includes(route);\n\t\t\tconst normalizedBaseURL = baseURL.trim();\n\t\t\tconst baseUrlInvalid = baseURL.length > 0 && !isHttpUrl(normalizedBaseURL);\n\t\t\tconst modelFailure = multiKey ? void 0 : validateDeepSeekModels(models) ?? validateReasoningEfforts(models);\n\t\t\tconst entryFailure = multiKey ? multiKeyFailure(route, keyEntries, entryKeyDrafts, entryConfirmations, t) : void 0;\n\t\t\tconst keyFailure = multiKey ? void 0 : apiKeyFailure(keyDraft);\n\t\t\tconst keyValue = keyDraft.trim();\n\t\t\tconst ready = (committed || route.length > 0 && !routeInvalid && !routeTaken) && normalizedBaseURL.length > 0 && !baseUrlInvalid && (multiKey ? entryFailure === void 0 : models.length > 0 && modelFailure === void 0 && keyFailure === void 0);\n\t\t\tconst hint = entryFailure ?? (failure !== void 0 || ready || keyFailure !== void 0 || route.length === 0 || routeInvalid || routeTaken || baseUrlInvalid ? void 0 : normalizedBaseURL.length === 0 ? t(\"customNeedsBaseUrl\") : modelFailure !== void 0 ? `${t(\"model\")} ${String(modelFailure.index + 1)}: ${t(modelFailure.key)}` : t(\"customNeedsModels\"));\n\t\t\t/** Perform the create, returning a failure message or undefined. */\n\t\t\tconst createOnce = async () => {\n\t\t\t\tconst entries = normalizedMultiKeyEntries(route, keyEntries);\n\t\t\t\tconst firstEntry = Object.values(entries)[0];\n\t\t\t\tconst keyRef = multiKey ? firstEntry?.apiKeyEnv : deriveKeyRef(route);\n\t\t\t\tconst storesKey = !multiKey && keyValue.length > 0;\n\t\t\t\tif (multiKey && entryFailure !== void 0) return entryFailure;\n\t\t\t\tif (!committed) {\n\t\t\t\t\tconst profile = {\n\t\t\t\t\t\t...displayName.length === 0 ? {} : { displayName },\n\t\t\t\t\t\t...storesKey || multiKey ? { apiKeyEnv: keyRef } : {},\n\t\t\t\t\t\tapi: protocol,\n\t\t\t\t\t\tbaseURL: normalizedBaseURL,\n\t\t\t\t\t\tmodels: (multiKey ? firstEntry.models : models).map((model) => ({ ...model })),\n\t\t\t\t\t\t...(multiKey || Object.keys(keyEntries).length > 0 ? { multiKey, keyEntries: entries } : {})\n\t\t\t\t\t};\n\t\t\t\t\tconst written = await operations.writeSettings(NS$1, [{\n\t\t\t\t\t\top: \"set\",\n\t\t\t\t\t\tpath: [\"providers\", route],\n\t\t\t\t\t\tvalue: profile\n\t\t\t\t\t}], openedAt);\n\t\t\t\t\tif (written.kind !== \"written\") return written.kind === \"conflict\" ? t(\"conflict\") : written.message;\n\t\t\t\t\tsetCommitted(true);\n\t\t\t\t}\n\t\t\t\tif (multiKey) return storeMultiKeyDrafts(operations, entries, entryKeyDrafts, setEntryKeyDrafts);\n\t\t\t\tif (storesKey) {\n\t\t\t\t\tconst stored = await operations.storeCredential(keyRef, keyValue);\n\t\t\t\t\tif (stored !== void 0) return stored;\n\t\t\t\t\tsetKeyDraft(\"\");\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst create = async () => {\n\t\t\t\tif (saving.current || !ready || props.readOnly || listBusy) return;\n\t\t\t\tsaving.current = true;\n\t\t\t\tsetBusy(true);\n\t\t\t\tsetFailure(void 0);\n\t\t\t\ttry {\n\t\t\t\t\tconst outcome = await createOnce();\n\t\t\t\t\tif (multiKey) setEntrySaveState({ ok: outcome === void 0, entries: structuredClone(outcome === void 0 ? normalizedMultiKeyEntries(route, keyEntries) : keyEntries) });\n\t\t\t\t\tif (outcome !== void 0) {\n\t\t\t\t\t\tsetFailure(outcome);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tprops.onClose(true);\n\t\t\t\t} catch {\n\t\t\t\t\tif (multiKey) setEntrySaveState({ ok: false, entries: structuredClone(keyEntries) });\n\t\t\t\t\tsetFailure(t(\"multiKeySaveFailed\"));\n\t\t\t\t} finally {\n\t\t\t\t\tsaving.current = false;\n\t\t\t\t\tsetBusy(false);\n\t\t\t\t}\n\t\t\t};\n\t\t\treturn (0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\tclassName: ModelsSection_module_css_default[\"editor\"],\n\t\t\t\tchildren: [\n\t\t\t\t\t(0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"fieldLabel\"],\n\t\t\t\t\t\t\tchildren: t(\"customRoute\")\n\t\t\t\t\t\t}), (0, react_jsx_runtime.jsx)(\"input\", {\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"input\"],\n\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\tvalue: route,\n\t\t\t\t\t\t\tplaceholder: \"acme-gateway\",\n\t\t\t\t\t\t\t\"aria-label\": t(\"customRoute\"),\n\t\t\t\t\t\t\tdisabled: profileDisabled,\n\t\t\t\t\t\t\tonChange: (event) => {\n\t\t\t\t\t\t\t\tsetRoute(event.target.value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})]\n\t\t\t\t\t}),\n\t\t\t\t\trouteInvalid || routeTaken ? (0, react_jsx_runtime.jsx)(\"p\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"error\"],\n\t\t\t\t\t\tchildren: t(routeInvalid ? \"customRouteInvalid\" : \"customRouteTaken\")\n\t\t\t\t\t}) : (0, react_jsx_runtime.jsx)(\"p\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"advancedHint\"],\n\t\t\t\t\t\tchildren: t(\"customRouteHint\")\n\t\t\t\t\t}),\n\t\t\t\t\t(0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"fieldLabel\"],\n\t\t\t\t\t\t\tchildren: t(\"customDisplayName\")\n\t\t\t\t\t\t}), (0, react_jsx_runtime.jsx)(\"input\", {\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"input\"],\n\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\tvalue: displayName,\n\t\t\t\t\t\t\tplaceholder: route.length === 0 ? t(\"customDisplayName\") : route,\n\t\t\t\t\t\t\t\"aria-label\": t(\"customDisplayName\"),\n\t\t\t\t\t\t\tdisabled: profileDisabled,\n\t\t\t\t\t\t\tonChange: (event) => {\n\t\t\t\t\t\t\t\tsetDisplayName(event.target.value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})]\n\t\t\t\t\t}),\n\t\t\t\t\t(0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"fieldLabel\"],\n\t\t\t\t\t\t\tchildren: t(\"baseUrl\")\n\t\t\t\t\t\t}), (0, react_jsx_runtime.jsx)(\"input\", {\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"input\"],\n\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\tvalue: baseURL,\n\t\t\t\t\t\t\tplaceholder: t(protocol === \"anthropic-messages\" ? \"customAnthropicBaseUrlPlaceholder\" : \"customBaseUrlPlaceholder\"),\n\t\t\t\t\t\t\t\"aria-label\": t(\"baseUrl\"),\n\t\t\t\t\t\t\t\"aria-invalid\": baseUrlInvalid,\n\t\t\t\t\t\t\tdisabled: profileDisabled,\n\t\t\t\t\t\t\tonChange: (event) => {\n\t\t\t\t\t\t\t\tsetBaseURL(event.target.value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})]\n\t\t\t\t\t}),\n\t\t\t\t\tbaseUrlInvalid ? (0, react_jsx_runtime.jsx)(\"p\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"error\"],\n\t\t\t\t\t\tchildren: t(\"customBaseUrlInvalid\")\n\t\t\t\t\t}) : null,\n\t\t\t\t\t(0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"fieldLabel\"],\n\t\t\t\t\t\t\tchildren: t(\"customApi\")\n\t\t\t\t\t\t}), (0, react_jsx_runtime.jsx)(\"select\", {\n\t\t\t\t\t\t\tclassName: `${ModelsSection_module_css_default[\"input\"]} ${ModelsSection_module_css_default[\"selectInput\"]}`,\n\t\t\t\t\t\t\tvalue: protocol,\n\t\t\t\t\t\t\t\"aria-label\": t(\"customApi\"),\n\t\t\t\t\t\t\tdisabled: profileDisabled,\n\t\t\t\t\t\t\tonChange: (event) => {\n\t\t\t\t\t\t\t\tsetProtocol(event.target.value);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tchildren: protocols.map((choice) => (0, react_jsx_runtime.jsx)(\"option\", {\n\t\t\t\t\t\t\t\tvalue: choice,\n\t\t\t\t\t\t\t\tchildren: protocolLabel(t, choice)\n\t\t\t\t\t\t\t}, choice))\n\t\t\t\t\t\t})]\n\t\t\t\t\t}),\n\t\t\t\t\tsupportsMultiKey ? (0, react_jsx_runtime.jsx)(MultiKeyToggle, {\n\t\t\t\t\t\tt, checked: multiKey, disabled: profileDisabled || listBusy, hasUnsavedKeys: hasMultiKeyDrafts(entryKeyDrafts),\n\t\t\t\t\t\tonChange: (enabled) => {\n\t\t\t\t\t\t\tif (enabled && Object.keys(keyEntries).length === 0) {\n\t\t\t\t\t\t\t\tconst [id, entry] = newMultiKeyEntry(route, { name: displayName || route || t(\"multiKeyDefaultName\"), models });\n\t\t\t\t\t\t\t\tsetKeyEntries({ [id]: entry });\n\t\t\t\t\t\t\t\tif (keyDraft.length > 0) setEntryKeyDrafts({ [id]: keyDraft });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsetMultiKey(enabled);\n\t\t\t\t\t\t}\n\t\t\t\t\t}) : null,\n\t\t\t\t\tmultiKey ? (0, react_jsx_runtime.jsx)(MultiKeyEntriesEditor, {\n\t\t\t\t\t\troute, entries: keyEntries, saveState: entrySaveState, savedEntries: entrySaveState?.ok ? entrySaveState.entries : void 0, onChange: setKeyEntries,\n\t\t\t\t\t\tkeyDrafts: entryKeyDrafts, onKeyDraftsChange: setEntryKeyDrafts,\n\t\t\t\t\t\tconfirmations: entryConfirmations, onConfirmationsChange: setEntryConfirmations,\n\t\t\t\t\t\tpersistedEntries: committed ? normalizedMultiKeyEntries(route, keyEntries) : {},\n\t\t\t\t\t\tprobe: { settingsNs: NS$1, ...(committed ? { provider: route } : {}), baseURL: normalizedBaseURL, api: protocol },\n\t\t\t\t\t\tprobeBlocked: baseUrlInvalid ? \"customBaseUrlInvalid\" : normalizedBaseURL.length === 0 ? \"customNeedsBaseUrl\" : void 0,\n\t\t\t\t\t\treasoningLevels, operations, t, disabled: profileDisabled || listBusy, keyDisabled: disabled || listBusy, onBusyChange: setListBusy\n\t\t\t\t\t}) : null,\n\t\t\t\t\tmultiKey ? null : (0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"fieldLabel\"],\n\t\t\t\t\t\t\t\tchildren: t(\"keyInput\")\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(ApiKeyInput, {\n\t\t\t\t\t\t\t\tt,\n\t\t\t\t\t\t\t\tvalue: keyDraft,\n\t\t\t\t\t\t\t\tplaceholder: t(\"keyPlaceholder\"),\n\t\t\t\t\t\t\t\t\"aria-label\": t(\"keyInput\"),\n\t\t\t\t\t\t\t\tdisabled,\n\t\t\t\t\t\t\t\tonChange: (event) => {\n\t\t\t\t\t\t\t\t\tsetKeyDraft(event.target.value);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tkeyFailure === void 0 ? null : (0, react_jsx_runtime.jsx)(\"p\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"error\"],\n\t\t\t\t\t\t\t\tchildren: t(keyFailure === \"keyBlank\" ? \"keyBlankNew\" : keyFailure)\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t]\n\t\t\t\t\t}),\n\t\t\t\t\t!multiKey ? (0, react_jsx_runtime.jsx)(ModelListEditor, {\n\t\t\t\t\t\tmodels,\n\t\t\t\t\t\tonChange: setModels,\n\t\t\t\t\t\treasoningLevels,\n\t\t\t\t\t\tprobe: {\n\t\t\t\t\t\t\tsettingsNs: NS$1,\n\t\t\t\t\t\t\tbaseURL: normalizedBaseURL,\n\t\t\t\t\t\t\tapi: protocol,\n\t\t\t\t\t\t\t...keyValue.length === 0 ? {} : { apiKey: keyValue }\n\t\t\t\t\t\t},\n\t\t\t\t\t\tprobeBlocked: baseUrlInvalid ? \"customBaseUrlInvalid\" : keyFailure === \"keyBlank\" ? \"keyBlankNew\" : keyFailure,\n\t\t\t\t\t\toperations,\n\t\t\t\t\t\tt,\n\t\t\t\t\t\tdisabled: profileDisabled,\n\t\t\t\t\t\tonBusyChange: setListBusy\n\t\t\t\t\t}) : null,\n\t\t\t\t\tfailure !== void 0 ? (0, react_jsx_runtime.jsx)(\"p\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"error\"],\n\t\t\t\t\t\tchildren: failure\n\t\t\t\t\t}) : null,\n\t\t\t\t\thint === void 0 ? null : (0, react_jsx_runtime.jsx)(\"p\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"advancedHint\"],\n\t\t\t\t\t\tchildren: hint\n\t\t\t\t\t}),\n\t\t\t\t\t(0, react_jsx_runtime.jsx)(EditorFooter, {\n\t\t\t\t\t\tt,\n\t\t\t\t\t\tbusy,\n\t\t\t\t\t\tsubmitDisabled: disabled || listBusy || !ready,\n\t\t\t\t\t\tsubmitLabelKey: \"create\",\n\t\t\t\t\t\tsubmitBusyLabelKey: \"creating\",\n\t\t\t\t\t\tonCancel: () => {\n\t\t\t\t\t\t\tprops.onClose(committed);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonSubmit: () => {\n\t\t\t\t\t\t\tcreate();\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t]\n\t\t\t});\n\t\t}"
171
+ },
172
+ {
173
+ "before": "function ProviderEditor(props) {\n\t\t\tconst { namespace, schema, settingsPath, operations, t } = props;\n\t\t\tconst [draft, setDraft] = (0, react.useState)(() => draftAt(schema, namespace, settingsPath));\n\t\t\tconst [entryKeyDrafts, setEntryKeyDrafts] = (0, react.useState)({});\n\t\t\tconst [entryConfirmations, setEntryConfirmations] = (0, react.useState)({});\n\t\t\tconst saving = (0, react.useRef)(false);\n\t\t\tconst [keyDraft, setKeyDraft] = (0, react.useState)(\"\");\n\t\t\tconst [busy, setBusy] = (0, react.useState)(false);\n\t\t\tconst [listBusy, setListBusy] = (0, react.useState)(false);\n\t\t\tconst { onBusyChange } = props;\n\t\t\t(0, react.useEffect)(() => {\n\t\t\t\tonBusyChange?.(busy || listBusy);\n\t\t\t}, [\n\t\t\t\tbusy,\n\t\t\t\tlistBusy,\n\t\t\t\tonBusyChange\n\t\t\t]);\n\t\t\tconst [failure, setFailure] = (0, react.useState)(void 0);\n\t\t\tconst [committedOriginal, setCommittedOriginal] = (0, react.useState)(() => schema.getPath(namespace.user, settingsPath));\n\t\t\tconst [expectedRevision, setExpectedRevision] = (0, react.useState)(() => namespace.revision);\n\t\t\tconst root = (0, react.useMemo)(() => schema.rehydrate(namespace.schema), [namespace.schema, schema]);\n\t\t\tconst node = (0, react.useMemo)(() => schema.nodeAtPath(root, settingsPath), [\n\t\t\t\troot,\n\t\t\t\tschema,\n\t\t\t\tsettingsPath\n\t\t\t]);\n\t\t\tconst fallback = schema.getPath(namespace.value, settingsPath);\n\t\t\tconst disabled = props.readOnly || busy;\n\t\t\tconst layout = layoutOf(namespace.ns);\n\t\t\tconst keyRef = refFor(schema, namespace, settingsPath, props.provider);\n\t\t\tconst supportsMultiKey = layout === \"pi-ai\" && props.declared === true && props.credentialOnly !== true && supportsMultiKeySchema(namespace, schema, settingsPath);\n\t\t\tconst multiKey = supportsMultiKey && (draft.multiKey ?? fallback?.multiKey) === true;\n\t\t\tconst keyEntries = draft.keyEntries ?? fallback?.keyEntries ?? {};\n\t\t\tconst entryFailure = multiKey ? multiKeyFailure(props.provider, keyEntries, entryKeyDrafts, entryConfirmations, t) : void 0;\n\t\t\tconst protocols = (0, react.useMemo)(() => layout === \"pi-ai\" ? protocolChoices(namespace, schema) : [], [\n\t\t\t\tlayout,\n\t\t\t\tnamespace,\n\t\t\t\tschema\n\t\t\t]);\n\t\t\tconst stringAt = (source, key) => {\n\t\t\t\tconst value = schema.getPath(source, [key]);\n\t\t\t\treturn typeof value === \"string\" && value.trim().length > 0 ? value : void 0;\n\t\t\t};\n\t\t\tconst setField = (key, next) => {\n\t\t\t\tconst value = next === void 0 || next.trim().length === 0 ? void 0 : next;\n\t\t\t\tsetDraft((current) => value === void 0 ? schema.deletePath(current, [key]) : schema.setPath(current, [key], value));\n\t\t\t};\n\t\t\tconst reasoningLevels = (0, react.useMemo)(() => layout === \"pi-ai\" && props.declared === true ? reasoningLevelChoices(namespace, schema) : [], [\n\t\t\t\tlayout,\n\t\t\t\tprops.declared,\n\t\t\t\tnamespace,\n\t\t\t\tschema\n\t\t\t]);\n\t\t\tconst editsReasoning = reasoningLevels.length > 0;\n\t\t\tconst validateModels = (value) => validateDeepSeekModels(value) ?? (editsReasoning ? validateReasoningEfforts(value) : void 0);\n\t\t\tconst modelFailure = multiKey ? void 0 : validateModels(schema.getPath(draft, [\"models\"]));\n\t\t\tconst keyFailure = multiKey ? void 0 : apiKeyFailure(keyDraft);\n\t\t\tconst keyValue = keyDraft.trim();\n\t\t\tconst shownKeyFailure = (props.credentialRequired === true && keyDraft.length > 0 && keyValue.length === 0 ? \"keyRequired\" : void 0) ?? keyFailure;\n\t\t\tconst probeApi = stringAt(draft, \"api\") ?? stringAt(fallback, \"api\");\n\t\t\tconst probeBaseURL = stringAt(draft, \"baseURL\") ?? stringAt(fallback, \"baseURL\");\n\t\t\tconst probe = {\n\t\t\t\tsettingsNs: namespace.ns,\n\t\t\t\tprovider: props.provider,\n\t\t\t\t...probeBaseURL === void 0 ? {} : { baseURL: probeBaseURL },\n\t\t\t\t...probeApi === void 0 ? {} : { api: probeApi },\n\t\t\t\t...keyValue.length === 0 ? {} : { apiKey: keyValue }\n\t\t\t};\n\t\t\t/**\n\t\t\t* The write for this card, or a failure message. Every edit travels as\n\t\t\t* path ops against the STORED section: the draft comes from the redacted\n\t\t\t* descriptor, so a wholesale replace rebuilt from it could delete fields\n\t\t\t* outside the card. Ops name only the fields this card can see.\n\t\t\t*/\n\t\t\tconst applyOnce = async () => {\n\t\t\t\tconst ns = namespace.ns;\n\t\t\t\tconst normalizedDraft = supportsMultiKey && schema.hasPath(draft, [\"keyEntries\"]) ? schema.setPath(draft, [\"keyEntries\"], normalizedMultiKeyEntries(props.provider, keyEntries)) : draft;\n\t\t\t\tconst next = multiKey ? schema.setPath(normalizedDraft, [\"keyEntries\"], normalizedMultiKeyEntries(props.provider, keyEntries)) : layout === \"pi-ai\" && stringAt(draft, \"apiKeyEnv\") === void 0 && stringAt(fallback, \"apiKeyEnv\") === void 0 && keyValue.length > 0 ? schema.setPath(normalizedDraft, [\"apiKeyEnv\"], keyRef) : normalizedDraft;\n\t\t\t\tif (entryFailure !== void 0) return entryFailure;\n\t\t\t\tif (props.credentialOnly !== true && !multiKey) {\n\t\t\t\t\tconst failure = validateModels(schema.getPath(next, [\"models\"]));\n\t\t\t\t\t/* v8 ignore next 3 -- unreachable from the card: the same failure disables submit */\n\t\t\t\t\tif (failure !== void 0) return `${t(\"model\")} ${String(failure.index + 1)}: ${t(failure.key)}`;\n\t\t\t\t}\n\t\t\t\t/* v8 ignore next -- apply is only reachable from the rendered card, which required a resolved node */\n\t\t\t\tif (props.credentialOnly !== true && node !== void 0 && settingsPath.length === 0) {\n\t\t\t\t\tconst sectionError = schema.validate(node, next);\n\t\t\t\t\tif (sectionError !== void 0) return sectionError;\n\t\t\t\t}\n\t\t\t\tconst materializesNativeProfile = layout === \"pi-ai\" && fallback === void 0 && committedOriginal === void 0 && Object.keys(next).length === 0;\n\t\t\t\tconst ops = props.credentialOnly === true ? [] : materializesNativeProfile ? [{\n\t\t\t\t\top: \"set\",\n\t\t\t\t\tpath: [...settingsPath],\n\t\t\t\t\tvalue: {}\n\t\t\t\t}] : pathOps(settingsPath, committedOriginal, next);\n\t\t\t\tif (ops.length > 0) {\n\t\t\t\t\tconst written = await operations.writeSettings(ns, ops, expectedRevision);\n\t\t\t\t\tif (written.kind !== \"written\") return written.kind === \"conflict\" ? t(\"conflict\") : written.message;\n\t\t\t\t\tsetCommittedOriginal(schema.getPath(written.view.user, settingsPath));\n\t\t\t\t\tsetExpectedRevision(written.view.revision);\n\t\t\t\t\tsetDraft(next);\n\t\t\t\t}\n\t\t\t\tif (multiKey) return storeMultiKeyDrafts(operations, next.keyEntries, entryKeyDrafts, setEntryKeyDrafts);\n\t\t\t\tif (keyValue.length > 0) {\n\t\t\t\t\tconst stored = await operations.storeCredential(keyRef, keyValue);\n\t\t\t\t\tif (stored !== void 0) return stored;\n\t\t\t\t}\n\t\t\t\tsetKeyDraft(\"\");\n\t\t\t};\n\t\t\tconst apply = async () => {\n\t\t\t\tif (saving.current || props.readOnly || listBusy || entryFailure !== void 0) return;\n\t\t\t\tsaving.current = true;\n\t\t\t\tsetBusy(true);\n\t\t\t\tsetFailure(void 0);\n\t\t\t\ttry {\n\t\t\t\t\tconst failure = await applyOnce();\n\t\t\t\t\tif (failure !== void 0) {\n\t\t\t\t\t\tsetFailure(failure);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tprops.onClose(true);\n\t\t\t\t} catch {\n\t\t\t\t\tsetFailure(t(\"multiKeySaveFailed\"));\n\t\t\t\t} finally {\n\t\t\t\t\tsaving.current = false;\n\t\t\t\t\tsetBusy(false);\n\t\t\t\t}\n\t\t\t};\n\t\t\tif (node === void 0) return (0, react_jsx_runtime.jsxs)(\"p\", {\n\t\t\t\tclassName: ModelsSection_module_css_default[\"error\"],\n\t\t\t\tchildren: [\n\t\t\t\t\tprops.provider,\n\t\t\t\t\t\": \",\n\t\t\t\t\tprops.t(\"settingsPathUnresolvable\")\n\t\t\t\t]\n\t\t\t});\n\t\t\t/**\n\t\t\t* The catalog beneath the user layer: what the composition entry pinned, or\n\t\t\t* else the schema default that `resolve` would supply. The effective value\n\t\t\t* cannot answer this — it still carries the stored override until the unset\n\t\t\t* is applied, so reading it would echo that override straight back the\n\t\t\t* moment reset drops it, leaving the rows unchanged until a reload.\n\t\t\t*/\n\t\t\tconst inheritedModels = () => {\n\t\t\t\treturn schema.getPath(namespace.base, [...settingsPath, \"models\"]) ?? schema.nodeAtPath(root, [...settingsPath, \"models\"])?.meta.default;\n\t\t\t};\n\t\t\t/**\n\t\t\t* The curated fields of one known adapter family. The family arrives\n\t\t\t* narrowed so the per-family branches below are total: an unknown namespace\n\t\t\t* renders the hint instead and never reaches this body.\n\t\t\t*/\n\t\t\tconst curatedFields = (family) => {\n\t\t\t\tconst ownsIdentity = family === \"pi-ai\" && props.declared === true;\n\t\t\t\tconst customModels = schema.getPath(draft, [\"models\"]);\n\t\t\t\tconst modelsOverridden = schema.hasPath(draft, [\"models\"]);\n\t\t\t\tconst models = modelDrafts(modelsOverridden ? customModels : inheritedModels());\n\t\t\t\tconst defaultContextWindow = schema.getPath(fallback, [\"defaultContextWindow\"]);\n\t\t\t\tconst defaultMaxTokens = schema.getPath(fallback, [\"maxTokens\"]);\n\t\t\t\tconst defaultInput = schema.getPath(fallback, [\"defaultInput\"]);\n\t\t\t\tconst baseURL = stringAt(fallback, \"baseURL\") ?? props.defaultBaseURL;\n\t\t\t\tconst endpointEnv = props.baseURLEnv ?? [];\n\t\t\t\tconst endpointHint = family === \"deepseek\" ? t(\"deepSeekEndpointHint\") : baseURL === void 0 && endpointEnv.length > 0 ? t(\"baseUrlEnvironment\").replace(\"{env}\", () => endpointEnv.join(\", \")) : void 0;\n\t\t\t\tconst namedRef = stringAt(fallback, \"apiKeyEnv\");\n\t\t\t\tconst nativeAuth = namedRef === void 0 ? props.nativeAuth : void 0;\n\t\t\t\tconst authRefs = namedRef === void 0 ? (nativeAuth?.env ?? []).filter((ref) => !endpointEnv.includes(ref)) : [namedRef];\n\t\t\t\tconst visibleRefs = authRefs.filter((ref) => !ref.toLowerCase().includes(\"oauth\"));\n\t\t\t\tconst keyHint = visibleRefs[0];\n\t\t\t\tconst checkedRefs = authRefs.map((ref) => [ref, props.credentialChecks?.[ref] ?? (ref === namedRef ? props.credential : void 0)]);\n\t\t\t\tconst detected = checkedRefs.find(([, info]) => info?.configured === true);\n\t\t\t\tconst detectedRef = detected?.[0];\n\t\t\t\tconst detectedVisibleRef = detectedRef === void 0 || !visibleRefs.includes(detectedRef) ? void 0 : detectedRef;\n\t\t\t\tconst missingRefs = checkedRefs.length > 0 && checkedRefs.every(([, info]) => info?.configured === false);\n\t\t\t\tconst savedCredential = detected?.[1]?.source === \"file\";\n\t\t\t\tconst credentialHint = keyDraft.length > 0 || savedCredential || keyHint === void 0 || props.credentialRequired === true ? void 0 : t(detectedRef === void 0 ? missingRefs ? \"keyFallbackMissing\" : \"keyFallbackUnchecked\" : detectedVisibleRef === void 0 ? \"keyFallbackDetectedHidden\" : \"keyFallbackDetected\").replace(\"{hint}\", () => detectedVisibleRef ?? keyHint);\n\t\t\t\tconst keyHelp = visibleRefs.length === 0 ? void 0 : t(\"keyHelp\").replace(\"{env}\", () => visibleRefs.join(\" / \"));\n\t\t\t\tconst authHelp = keyHelp === void 0 ? null : (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {\n\t\t\t\t\tlabel: keyHelp,\n\t\t\t\t\tside: \"right\",\n\t\t\t\t\tdelayMs: 0,\n\t\t\t\t\tfocusDelayMs: 0,\n\t\t\t\t\tportal: true,\n\t\t\t\t\topenOnClick: true,\n\t\t\t\t\tchildren: (0, react_jsx_runtime.jsx)(\"button\", {\n\t\t\t\t\t\ttype: \"button\",\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"helpButton\"],\n\t\t\t\t\t\t\"aria-label\": t(\"authHelp\"),\n\t\t\t\t\t\tchildren: \"?\"\n\t\t\t\t\t})\n\t\t\t\t});\n\t\t\t\tconst keylessNativeAuth = nativeAuth?.env.length === 0 && nativeAuth.oauth;\n\t\t\t\tconst keyPlaceholder = keyHint === void 0 || props.credentialRequired === true ? t(\"keyPlaceholder\") : t(savedCredential ? \"keyPlaceholderSaved\" : \"keyPlaceholderFallback\").replace(\"{hint}\", () => keyHint);\n\t\t\t\t/** What both family editors take: the rows, whose layer owns them, and the two writes. */\n\t\t\t\tconst catalogProps = {\n\t\t\t\t\tmodels,\n\t\t\t\t\toverridden: modelsOverridden,\n\t\t\t\t\tt,\n\t\t\t\t\tdisabled,\n\t\t\t\t\tonChange: (next) => {\n\t\t\t\t\t\tsetDraft((current) => schema.setPath(current, [\"models\"], next));\n\t\t\t\t\t},\n\t\t\t\t\tonReset: () => {\n\t\t\t\t\t\tsetDraft((current) => schema.deletePath(current, [\"models\"]));\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tconst credentials = (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [supportsMultiKey ? (0, react_jsx_runtime.jsx)(MultiKeyToggle, {\n\t\t\t\t\tt, checked: multiKey, disabled: disabled || listBusy, hasUnsavedKeys: hasMultiKeyDrafts(entryKeyDrafts),\n\t\t\t\t\tonChange: (enabled) => {\n\t\t\t\t\t\tlet updated = schema.setPath(draft, [\"multiKey\"], enabled);\n\t\t\t\t\t\tif (enabled && Object.keys(keyEntries).length === 0) {\n\t\t\t\t\t\t\tconst namedRef = stringAt(draft, \"apiKeyEnv\") ?? stringAt(fallback, \"apiKeyEnv\");\n\t\t\t\t\t\t\tconst [id, entry] = newMultiKeyEntry(props.provider, {\n\t\t\t\t\t\t\t\tname: stringAt(draft, \"displayName\") ?? stringAt(fallback, \"displayName\") ?? props.displayName ?? props.provider,\n\t\t\t\t\t\t\t\tapiKeyEnv: namedRef,\n\t\t\t\t\t\t\t\tmodels: draft.models ?? fallback?.models ?? inheritedModels()\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif (keyDraft.length > 0) {\n\t\t\t\t\t\t\t\tsetEntryKeyDrafts({ [id]: keyDraft });\n\t\t\t\t\t\t\t\tif (namedRef === void 0) updated = schema.setPath(updated, [\"apiKeyEnv\"], multiKeyRef(props.provider, id));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tupdated = schema.setPath(updated, [\"keyEntries\"], { [id]: entry });\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetDraft(updated);\n\t\t\t\t\t}\n\t\t\t\t}) : null, multiKey ? (0, react_jsx_runtime.jsx)(MultiKeyEntriesEditor, {\n\t\t\t\t\troute: props.provider, entries: keyEntries,\n\t\t\t\t\tonChange: (entries) => setDraft((current) => schema.setPath(current, [\"keyEntries\"], entries)),\n\t\t\t\t\tkeyDrafts: entryKeyDrafts, onKeyDraftsChange: setEntryKeyDrafts,\n\t\t\t\t\tconfirmations: entryConfirmations, onConfirmationsChange: setEntryConfirmations,\n\t\t\t\t\tpersistedEntries: schema.getPath(committedOriginal, [\"keyEntries\"]) ?? fallback?.keyEntries ?? {},\n\t\t\t\t\tcredentialChecks: props.credentialChecks,\n\t\t\t\t\tprobe: { settingsNs: namespace.ns, provider: props.provider, ...(probeBaseURL === void 0 ? {} : { baseURL: probeBaseURL }), ...(probeApi === void 0 ? {} : { api: probeApi }) },\n\t\t\t\t\treasoningLevels, operations, t, disabled: disabled || listBusy, onBusyChange: setListBusy\n\t\t\t\t}) : null, multiKey || keylessNativeAuth ? null : (0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\t\tchildren: [\n\t\t\t\t\t\t(0, react_jsx_runtime.jsxs)(\"span\", {\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"fieldLabel\"],\n\t\t\t\t\t\t\tchildren: [t(\"keyInput\"), authHelp]\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(ApiKeyInput, {\n\t\t\t\t\t\t\tt,\n\t\t\t\t\t\t\tvalue: keyDraft,\n\t\t\t\t\t\t\tplaceholder: keyPlaceholder,\n\t\t\t\t\t\t\t\"aria-label\": t(\"keyInput\"),\n\t\t\t\t\t\t\t\"aria-invalid\": shownKeyFailure !== void 0,\n\t\t\t\t\t\t\t\"aria-describedby\": credentialHint === void 0 ? void 0 : `${props.provider}-credential-hint`,\n\t\t\t\t\t\t\trequired: props.credentialRequired === true,\n\t\t\t\t\t\t\tautoFocus: props.autoFocusCredential === true,\n\t\t\t\t\t\t\tdisabled,\n\t\t\t\t\t\t\tonChange: (event) => {\n\t\t\t\t\t\t\t\tsetKeyDraft(event.target.value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tcredentialHint === void 0 ? null : (0, react_jsx_runtime.jsx)(\"p\", {\n\t\t\t\t\t\t\tid: `${props.provider}-credential-hint`,\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[missingRefs ? \"notice\" : detectedRef === void 0 ? \"advancedHint\" : \"savedNotice\"],\n\t\t\t\t\t\t\tchildren: credentialHint\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tshownKeyFailure === void 0 ? null : (0, react_jsx_runtime.jsx)(\"p\", {\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"error\"],\n\t\t\t\t\t\t\tchildren: t(shownKeyFailure)\n\t\t\t\t\t\t})\n\t\t\t\t\t]\n\t\t\t\t})] });\n\t\t\t\tconst customization = props.credentialOnly === true ? null : (0, react_jsx_runtime.jsxs)(\"details\", {\n\t\t\t\t\tclassName: ModelsSection_module_css_default[\"customized\"],\n\t\t\t\t\topen: supportsMultiKey ? true : void 0,\n\t\t\t\t\t\"data-multi-key-shared-settings\": supportsMultiKey ? true : void 0,\n\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"summary\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"customizedSummary\"],\n\t\t\t\t\t\tchildren: t(supportsMultiKey ? \"multiKeySharedSettings\" : \"customized\")\n\t\t\t\t\t}), (0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"customizedBody\"],\n\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\townsIdentity ? (0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"fieldLabel\"],\n\t\t\t\t\t\t\t\t\tchildren: t(\"customDisplayName\")\n\t\t\t\t\t\t\t\t}), (0, react_jsx_runtime.jsx)(\"input\", {\n\t\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"input\"],\n\t\t\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\t\t\tvalue: stringAt(draft, \"displayName\") ?? \"\",\n\t\t\t\t\t\t\t\t\tplaceholder: stringAt(schema.getPath(namespace.base, settingsPath), \"displayName\") ?? props.provider,\n\t\t\t\t\t\t\t\t\t\"aria-label\": t(\"customDisplayName\"),\n\t\t\t\t\t\t\t\t\tdisabled,\n\t\t\t\t\t\t\t\t\tonChange: (event) => {\n\t\t\t\t\t\t\t\t\t\tsetField(\"displayName\", event.target.value);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})]\n\t\t\t\t\t\t\t}) : null,\n\t\t\t\t\t\t\t(0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"fieldLabel\"],\n\t\t\t\t\t\t\t\t\t\tchildren: t(\"baseUrl\")\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(\"input\", {\n\t\t\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"input\"],\n\t\t\t\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\t\t\t\tvalue: stringAt(draft, \"baseURL\") ?? \"\",\n\t\t\t\t\t\t\t\t\t\tplaceholder: family === \"deepseek\" ? t(\"deepSeekBaseUrl\") : baseURL === void 0 ? t(endpointEnv.length > 0 ? \"baseUrlConfigured\" : \"baseUrlDefault\") : t(\"baseUrlPlaceholder\").replace(\"{url}\", () => baseURL),\n\t\t\t\t\t\t\t\t\t\t\"aria-describedby\": endpointHint === void 0 ? void 0 : `${props.provider}-endpoint-hint`,\n\t\t\t\t\t\t\t\t\t\t\"aria-label\": t(\"baseUrl\"),\n\t\t\t\t\t\t\t\t\t\tdisabled,\n\t\t\t\t\t\t\t\t\t\tonChange: (event) => {\n\t\t\t\t\t\t\t\t\t\t\tsetField(\"baseURL\", event.target.value === \"\" ? void 0 : event.target.value);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\tendpointHint === void 0 ? null : (0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\t\t\t\tid: `${props.provider}-endpoint-hint`,\n\t\t\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"advancedHint\"],\n\t\t\t\t\t\t\t\t\t\tchildren: endpointHint\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\townsIdentity ? (0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"fieldLabel\"],\n\t\t\t\t\t\t\t\t\tchildren: t(\"customApi\")\n\t\t\t\t\t\t\t\t}), (0, react_jsx_runtime.jsxs)(\"select\", {\n\t\t\t\t\t\t\t\t\tclassName: `${ModelsSection_module_css_default[\"input\"]} ${ModelsSection_module_css_default[\"selectInput\"]}`,\n\t\t\t\t\t\t\t\t\tvalue: probeApi ?? \"\",\n\t\t\t\t\t\t\t\t\t\"aria-label\": t(\"customApi\"),\n\t\t\t\t\t\t\t\t\tdisabled,\n\t\t\t\t\t\t\t\t\tonChange: (event) => {\n\t\t\t\t\t\t\t\t\t\tsetField(\"api\", event.target.value);\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tchildren: [probeApi === void 0 ? (0, react_jsx_runtime.jsx)(\"option\", {\n\t\t\t\t\t\t\t\t\t\tvalue: \"\",\n\t\t\t\t\t\t\t\t\t\tchildren: t(\"customApiUnset\")\n\t\t\t\t\t\t\t\t\t}) : null, protocols.map((choice) => (0, react_jsx_runtime.jsx)(\"option\", {\n\t\t\t\t\t\t\t\t\t\tvalue: choice,\n\t\t\t\t\t\t\t\t\t\tchildren: protocolLabel(t, choice)\n\t\t\t\t\t\t\t\t\t}, choice))]\n\t\t\t\t\t\t\t\t})]\n\t\t\t\t\t\t\t}) : null,\n\t\t\t\t\t\t\tmultiKey ? null : family === \"deepseek\" ? (0, react_jsx_runtime.jsx)(DeepSeekModelsEditor, {\n\t\t\t\t\t\t\t\t...catalogProps,\n\t\t\t\t\t\t\t\tdefaultContextWindow: typeof defaultContextWindow === \"number\" ? defaultContextWindow : void 0,\n\t\t\t\t\t\t\t\tdefaultMaxTokens: typeof defaultMaxTokens === \"number\" ? defaultMaxTokens : void 0\n\t\t\t\t\t\t\t}) : (0, react_jsx_runtime.jsx)(ModelListEditor, {\n\t\t\t\t\t\t\t\t...catalogProps,\n\t\t\t\t\t\t\t\tcatalogProvider: props.declared === true ? void 0 : props.provider,\n\t\t\t\t\t\t\t\treasoningLevels,\n\t\t\t\t\t\t\t\tdefaultInput: Array.isArray(defaultInput) ? defaultInput : void 0,\n\t\t\t\t\t\t\t\tprobe,\n\t\t\t\t\t\t\t\tprobeBlocked: keyFailure,\n\t\t\t\t\t\t\t\toperations,\n\t\t\t\t\t\t\t\tonBusyChange: setListBusy\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t]\n\t\t\t\t\t})]\n\t\t\t\t});\n\t\t\t\treturn (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: supportsMultiKey ? [customization, credentials] : [credentials, customization] });\n\t\t\t};\n\t\t\treturn (0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\tclassName: props.credentialOnly === true ? ModelsSection_module_css_default[\"addBlock\"] : ModelsSection_module_css_default[\"editor\"],\n\t\t\t\tchildren: [\n\t\t\t\t\tprops.hideTitle === true ? null : (0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"editorHeader\"],\n\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"editorTitle\"],\n\t\t\t\t\t\t\tchildren: props.displayName\n\t\t\t\t\t\t}), props.provider !== props.displayName ? (0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"editorRoute\"],\n\t\t\t\t\t\t\tchildren: props.provider\n\t\t\t\t\t\t}) : null]\n\t\t\t\t\t}),\n\t\t\t\t\tlayout === \"unknown\" ? (0, react_jsx_runtime.jsx)(\"p\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"advancedHint\"],\n\t\t\t\t\t\tchildren: `${t(\"advancedHint\")} (${namespace.ns})`\n\t\t\t\t\t}) : curatedFields(layout),\n\t\t\t\t\t(failure ?? entryFailure) !== void 0 ? (0, react_jsx_runtime.jsx)(\"p\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"error\"],\n\t\t\t\t\t\tchildren: failure ?? entryFailure\n\t\t\t\t\t}) : null,\n\t\t\t\t\tprops.credentialOnly === true || modelFailure === void 0 ? null : (0, react_jsx_runtime.jsx)(\"p\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"advancedHint\"],\n\t\t\t\t\t\tchildren: `${t(\"model\")} ${String(modelFailure.index + 1)}: ${t(modelFailure.key)}`\n\t\t\t\t\t}),\n\t\t\t\t\t(0, react_jsx_runtime.jsx)(EditorFooter, {\n\t\t\t\t\t\tt,\n\t\t\t\t\t\tbusy,\n\t\t\t\t\t\tsubmitDisabled: disabled || listBusy || layout === \"unknown\" || entryFailure !== void 0 || props.credentialOnly !== true && modelFailure !== void 0 || !multiKey && (shownKeyFailure !== void 0 || props.credentialRequired === true && keyValue.length === 0),\n\t\t\t\t\t\tsubmitLabelKey: props.submitLabelKey ?? \"apply\",\n\t\t\t\t\t\tsubmitBusyLabelKey: props.submitBusyLabelKey ?? \"applying\",\n\t\t\t\t\t\t...props.cancelLabelKey === void 0 ? {} : { cancelLabelKey: props.cancelLabelKey },\n\t\t\t\t\t\tonCancel: () => {\n\t\t\t\t\t\t\tprops.onClose(false);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonSubmit: () => {\n\t\t\t\t\t\t\tprops.onSubmitCredential?.();\n\t\t\t\t\t\t\tapply();\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t]\n\t\t\t});\n\t\t}",
174
+ "after": "function ProviderEditor(props) {\n\t\t\tconst { namespace, schema, settingsPath, operations, t } = props;\n\t\t\tconst [draft, setDraft] = (0, react.useState)(() => draftAt(schema, namespace, settingsPath));\n\t\t\tconst [entryKeyDrafts, setEntryKeyDrafts] = (0, react.useState)({});\n\t\t\tconst [entryConfirmations, setEntryConfirmations] = (0, react.useState)({});\n\t\t\tconst [entrySaveState, setEntrySaveState] = (0, react.useState)(void 0);\n\t\t\tconst saving = (0, react.useRef)(false);\n\t\t\tconst [keyDraft, setKeyDraft] = (0, react.useState)(\"\");\n\t\t\tconst [busy, setBusy] = (0, react.useState)(false);\n\t\t\tconst [listBusy, setListBusy] = (0, react.useState)(false);\n\t\t\tconst { onBusyChange } = props;\n\t\t\t(0, react.useEffect)(() => {\n\t\t\t\tonBusyChange?.(busy || listBusy);\n\t\t\t}, [\n\t\t\t\tbusy,\n\t\t\t\tlistBusy,\n\t\t\t\tonBusyChange\n\t\t\t]);\n\t\t\tconst [failure, setFailure] = (0, react.useState)(void 0);\n\t\t\tconst [committedOriginal, setCommittedOriginal] = (0, react.useState)(() => schema.getPath(namespace.user, settingsPath));\n\t\t\tconst [expectedRevision, setExpectedRevision] = (0, react.useState)(() => namespace.revision);\n\t\t\tconst root = (0, react.useMemo)(() => schema.rehydrate(namespace.schema), [namespace.schema, schema]);\n\t\t\tconst node = (0, react.useMemo)(() => schema.nodeAtPath(root, settingsPath), [\n\t\t\t\troot,\n\t\t\t\tschema,\n\t\t\t\tsettingsPath\n\t\t\t]);\n\t\t\tconst fallback = schema.getPath(namespace.value, settingsPath);\n\t\t\tconst disabled = props.readOnly || busy;\n\t\t\tconst layout = layoutOf(namespace.ns);\n\t\t\tconst keyRef = refFor(schema, namespace, settingsPath, props.provider);\n\t\t\tconst supportsMultiKey = layout === \"pi-ai\" && props.declared === true && props.credentialOnly !== true && supportsMultiKeySchema(namespace, schema, settingsPath);\n\t\t\tconst multiKey = supportsMultiKey && (draft.multiKey ?? fallback?.multiKey) === true;\n\t\t\tconst keyEntries = draft.keyEntries ?? fallback?.keyEntries ?? {};\n\t\t\tconst entryFailure = multiKey ? multiKeyFailure(props.provider, keyEntries, entryKeyDrafts, entryConfirmations, t) : void 0;\n\t\t\tconst protocols = (0, react.useMemo)(() => layout === \"pi-ai\" ? protocolChoices(namespace, schema) : [], [\n\t\t\t\tlayout,\n\t\t\t\tnamespace,\n\t\t\t\tschema\n\t\t\t]);\n\t\t\tconst stringAt = (source, key) => {\n\t\t\t\tconst value = schema.getPath(source, [key]);\n\t\t\t\treturn typeof value === \"string\" && value.trim().length > 0 ? value : void 0;\n\t\t\t};\n\t\t\tconst setField = (key, next) => {\n\t\t\t\tconst value = next === void 0 || next.trim().length === 0 ? void 0 : next;\n\t\t\t\tsetDraft((current) => value === void 0 ? schema.deletePath(current, [key]) : schema.setPath(current, [key], value));\n\t\t\t};\n\t\t\tconst reasoningLevels = (0, react.useMemo)(() => layout === \"pi-ai\" && props.declared === true ? reasoningLevelChoices(namespace, schema) : [], [\n\t\t\t\tlayout,\n\t\t\t\tprops.declared,\n\t\t\t\tnamespace,\n\t\t\t\tschema\n\t\t\t]);\n\t\t\tconst editsReasoning = reasoningLevels.length > 0;\n\t\t\tconst validateModels = (value) => validateDeepSeekModels(value) ?? (editsReasoning ? validateReasoningEfforts(value) : void 0);\n\t\t\tconst modelFailure = multiKey ? void 0 : validateModels(schema.getPath(draft, [\"models\"]));\n\t\t\tconst keyFailure = multiKey ? void 0 : apiKeyFailure(keyDraft);\n\t\t\tconst keyValue = keyDraft.trim();\n\t\t\tconst shownKeyFailure = (props.credentialRequired === true && keyDraft.length > 0 && keyValue.length === 0 ? \"keyRequired\" : void 0) ?? keyFailure;\n\t\t\tconst probeApi = stringAt(draft, \"api\") ?? stringAt(fallback, \"api\");\n\t\t\tconst probeBaseURL = stringAt(draft, \"baseURL\") ?? stringAt(fallback, \"baseURL\");\n\t\t\tconst probe = {\n\t\t\t\tsettingsNs: namespace.ns,\n\t\t\t\tprovider: props.provider,\n\t\t\t\t...probeBaseURL === void 0 ? {} : { baseURL: probeBaseURL },\n\t\t\t\t...probeApi === void 0 ? {} : { api: probeApi },\n\t\t\t\t...keyValue.length === 0 ? {} : { apiKey: keyValue }\n\t\t\t};\n\t\t\t/**\n\t\t\t* The write for this card, or a failure message. Every edit travels as\n\t\t\t* path ops against the STORED section: the draft comes from the redacted\n\t\t\t* descriptor, so a wholesale replace rebuilt from it could delete fields\n\t\t\t* outside the card. Ops name only the fields this card can see.\n\t\t\t*/\n\t\t\tconst applyOnce = async () => {\n\t\t\t\tconst ns = namespace.ns;\n\t\t\t\tconst normalizedDraft = supportsMultiKey && schema.hasPath(draft, [\"keyEntries\"]) ? schema.setPath(draft, [\"keyEntries\"], normalizedMultiKeyEntries(props.provider, keyEntries)) : draft;\n\t\t\t\tconst next = multiKey ? schema.setPath(normalizedDraft, [\"keyEntries\"], normalizedMultiKeyEntries(props.provider, keyEntries)) : layout === \"pi-ai\" && stringAt(draft, \"apiKeyEnv\") === void 0 && stringAt(fallback, \"apiKeyEnv\") === void 0 && keyValue.length > 0 ? schema.setPath(normalizedDraft, [\"apiKeyEnv\"], keyRef) : normalizedDraft;\n\t\t\t\tif (entryFailure !== void 0) return entryFailure;\n\t\t\t\tif (props.credentialOnly !== true && !multiKey) {\n\t\t\t\t\tconst failure = validateModels(schema.getPath(next, [\"models\"]));\n\t\t\t\t\t/* v8 ignore next 3 -- unreachable from the card: the same failure disables submit */\n\t\t\t\t\tif (failure !== void 0) return `${t(\"model\")} ${String(failure.index + 1)}: ${t(failure.key)}`;\n\t\t\t\t}\n\t\t\t\t/* v8 ignore next -- apply is only reachable from the rendered card, which required a resolved node */\n\t\t\t\tif (props.credentialOnly !== true && node !== void 0 && settingsPath.length === 0) {\n\t\t\t\t\tconst sectionError = schema.validate(node, next);\n\t\t\t\t\tif (sectionError !== void 0) return sectionError;\n\t\t\t\t}\n\t\t\t\tconst materializesNativeProfile = layout === \"pi-ai\" && fallback === void 0 && committedOriginal === void 0 && Object.keys(next).length === 0;\n\t\t\t\tconst ops = props.credentialOnly === true ? [] : materializesNativeProfile ? [{\n\t\t\t\t\top: \"set\",\n\t\t\t\t\tpath: [...settingsPath],\n\t\t\t\t\tvalue: {}\n\t\t\t\t}] : pathOps(settingsPath, committedOriginal, next);\n\t\t\t\tif (ops.length > 0) {\n\t\t\t\t\tconst written = await operations.writeSettings(ns, ops, expectedRevision);\n\t\t\t\t\tif (written.kind !== \"written\") return written.kind === \"conflict\" ? t(\"conflict\") : written.message;\n\t\t\t\t\tsetCommittedOriginal(schema.getPath(written.view.user, settingsPath));\n\t\t\t\t\tsetExpectedRevision(written.view.revision);\n\t\t\t\t\tsetDraft(next);\n\t\t\t\t}\n\t\t\t\tif (multiKey) return storeMultiKeyDrafts(operations, next.keyEntries, entryKeyDrafts, setEntryKeyDrafts);\n\t\t\t\tif (keyValue.length > 0) {\n\t\t\t\t\tconst stored = await operations.storeCredential(keyRef, keyValue);\n\t\t\t\t\tif (stored !== void 0) return stored;\n\t\t\t\t}\n\t\t\t\tsetKeyDraft(\"\");\n\t\t\t};\n\t\t\tconst apply = async () => {\n\t\t\t\tif (saving.current || props.readOnly || listBusy || entryFailure !== void 0) return;\n\t\t\t\tsaving.current = true;\n\t\t\t\tsetBusy(true);\n\t\t\t\tsetFailure(void 0);\n\t\t\t\ttry {\n\t\t\t\t\tconst failure = await applyOnce();\n\t\t\t\t\tif (multiKey) setEntrySaveState({ ok: failure === void 0, entries: structuredClone(failure === void 0 ? normalizedMultiKeyEntries(props.provider, keyEntries) : keyEntries) });\n\t\t\t\t\tif (failure !== void 0) {\n\t\t\t\t\t\tsetFailure(failure);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (!multiKey) props.onClose(true);\n\t\t\t\t} catch {\n\t\t\t\t\tif (multiKey) setEntrySaveState({ ok: false, entries: structuredClone(keyEntries) });\n\t\t\t\t\tsetFailure(t(\"multiKeySaveFailed\"));\n\t\t\t\t} finally {\n\t\t\t\t\tsaving.current = false;\n\t\t\t\t\tsetBusy(false);\n\t\t\t\t}\n\t\t\t};\n\t\t\tif (node === void 0) return (0, react_jsx_runtime.jsxs)(\"p\", {\n\t\t\t\tclassName: ModelsSection_module_css_default[\"error\"],\n\t\t\t\tchildren: [\n\t\t\t\t\tprops.provider,\n\t\t\t\t\t\": \",\n\t\t\t\t\tprops.t(\"settingsPathUnresolvable\")\n\t\t\t\t]\n\t\t\t});\n\t\t\t/**\n\t\t\t* The catalog beneath the user layer: what the composition entry pinned, or\n\t\t\t* else the schema default that `resolve` would supply. The effective value\n\t\t\t* cannot answer this — it still carries the stored override until the unset\n\t\t\t* is applied, so reading it would echo that override straight back the\n\t\t\t* moment reset drops it, leaving the rows unchanged until a reload.\n\t\t\t*/\n\t\t\tconst inheritedModels = () => {\n\t\t\t\treturn schema.getPath(namespace.base, [...settingsPath, \"models\"]) ?? schema.nodeAtPath(root, [...settingsPath, \"models\"])?.meta.default;\n\t\t\t};\n\t\t\t/**\n\t\t\t* The curated fields of one known adapter family. The family arrives\n\t\t\t* narrowed so the per-family branches below are total: an unknown namespace\n\t\t\t* renders the hint instead and never reaches this body.\n\t\t\t*/\n\t\t\tconst curatedFields = (family) => {\n\t\t\t\tconst ownsIdentity = family === \"pi-ai\" && props.declared === true;\n\t\t\t\tconst customModels = schema.getPath(draft, [\"models\"]);\n\t\t\t\tconst modelsOverridden = schema.hasPath(draft, [\"models\"]);\n\t\t\t\tconst models = modelDrafts(modelsOverridden ? customModels : inheritedModels());\n\t\t\t\tconst defaultContextWindow = schema.getPath(fallback, [\"defaultContextWindow\"]);\n\t\t\t\tconst defaultMaxTokens = schema.getPath(fallback, [\"maxTokens\"]);\n\t\t\t\tconst defaultInput = schema.getPath(fallback, [\"defaultInput\"]);\n\t\t\t\tconst baseURL = stringAt(fallback, \"baseURL\") ?? props.defaultBaseURL;\n\t\t\t\tconst endpointEnv = props.baseURLEnv ?? [];\n\t\t\t\tconst endpointHint = family === \"deepseek\" ? t(\"deepSeekEndpointHint\") : baseURL === void 0 && endpointEnv.length > 0 ? t(\"baseUrlEnvironment\").replace(\"{env}\", () => endpointEnv.join(\", \")) : void 0;\n\t\t\t\tconst namedRef = stringAt(fallback, \"apiKeyEnv\");\n\t\t\t\tconst nativeAuth = namedRef === void 0 ? props.nativeAuth : void 0;\n\t\t\t\tconst authRefs = namedRef === void 0 ? (nativeAuth?.env ?? []).filter((ref) => !endpointEnv.includes(ref)) : [namedRef];\n\t\t\t\tconst visibleRefs = authRefs.filter((ref) => !ref.toLowerCase().includes(\"oauth\"));\n\t\t\t\tconst keyHint = visibleRefs[0];\n\t\t\t\tconst checkedRefs = authRefs.map((ref) => [ref, props.credentialChecks?.[ref] ?? (ref === namedRef ? props.credential : void 0)]);\n\t\t\t\tconst detected = checkedRefs.find(([, info]) => info?.configured === true);\n\t\t\t\tconst detectedRef = detected?.[0];\n\t\t\t\tconst detectedVisibleRef = detectedRef === void 0 || !visibleRefs.includes(detectedRef) ? void 0 : detectedRef;\n\t\t\t\tconst missingRefs = checkedRefs.length > 0 && checkedRefs.every(([, info]) => info?.configured === false);\n\t\t\t\tconst savedCredential = detected?.[1]?.source === \"file\";\n\t\t\t\tconst credentialHint = keyDraft.length > 0 || savedCredential || keyHint === void 0 || props.credentialRequired === true ? void 0 : t(detectedRef === void 0 ? missingRefs ? \"keyFallbackMissing\" : \"keyFallbackUnchecked\" : detectedVisibleRef === void 0 ? \"keyFallbackDetectedHidden\" : \"keyFallbackDetected\").replace(\"{hint}\", () => detectedVisibleRef ?? keyHint);\n\t\t\t\tconst keyHelp = visibleRefs.length === 0 ? void 0 : t(\"keyHelp\").replace(\"{env}\", () => visibleRefs.join(\" / \"));\n\t\t\t\tconst authHelp = keyHelp === void 0 ? null : (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {\n\t\t\t\t\tlabel: keyHelp,\n\t\t\t\t\tside: \"right\",\n\t\t\t\t\tdelayMs: 0,\n\t\t\t\t\tfocusDelayMs: 0,\n\t\t\t\t\tportal: true,\n\t\t\t\t\topenOnClick: true,\n\t\t\t\t\tchildren: (0, react_jsx_runtime.jsx)(\"button\", {\n\t\t\t\t\t\ttype: \"button\",\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"helpButton\"],\n\t\t\t\t\t\t\"aria-label\": t(\"authHelp\"),\n\t\t\t\t\t\tchildren: \"?\"\n\t\t\t\t\t})\n\t\t\t\t});\n\t\t\t\tconst keylessNativeAuth = nativeAuth?.env.length === 0 && nativeAuth.oauth;\n\t\t\t\tconst keyPlaceholder = keyHint === void 0 || props.credentialRequired === true ? t(\"keyPlaceholder\") : t(savedCredential ? \"keyPlaceholderSaved\" : \"keyPlaceholderFallback\").replace(\"{hint}\", () => keyHint);\n\t\t\t\t/** What both family editors take: the rows, whose layer owns them, and the two writes. */\n\t\t\t\tconst catalogProps = {\n\t\t\t\t\tmodels,\n\t\t\t\t\toverridden: modelsOverridden,\n\t\t\t\t\tt,\n\t\t\t\t\tdisabled,\n\t\t\t\t\tonChange: (next) => {\n\t\t\t\t\t\tsetDraft((current) => schema.setPath(current, [\"models\"], next));\n\t\t\t\t\t},\n\t\t\t\t\tonReset: () => {\n\t\t\t\t\t\tsetDraft((current) => schema.deletePath(current, [\"models\"]));\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tconst credentials = (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [supportsMultiKey ? (0, react_jsx_runtime.jsx)(MultiKeyToggle, {\n\t\t\t\t\tt, checked: multiKey, disabled: disabled || listBusy, hasUnsavedKeys: hasMultiKeyDrafts(entryKeyDrafts),\n\t\t\t\t\tonChange: (enabled) => {\n\t\t\t\t\t\tlet updated = schema.setPath(draft, [\"multiKey\"], enabled);\n\t\t\t\t\t\tif (enabled && Object.keys(keyEntries).length === 0) {\n\t\t\t\t\t\t\tconst namedRef = stringAt(draft, \"apiKeyEnv\") ?? stringAt(fallback, \"apiKeyEnv\");\n\t\t\t\t\t\t\tconst [id, entry] = newMultiKeyEntry(props.provider, {\n\t\t\t\t\t\t\t\tname: stringAt(draft, \"displayName\") ?? stringAt(fallback, \"displayName\") ?? props.displayName ?? props.provider,\n\t\t\t\t\t\t\t\tapiKeyEnv: namedRef,\n\t\t\t\t\t\t\t\tmodels: draft.models ?? fallback?.models ?? inheritedModels()\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif (keyDraft.length > 0) {\n\t\t\t\t\t\t\t\tsetEntryKeyDrafts({ [id]: keyDraft });\n\t\t\t\t\t\t\t\tif (namedRef === void 0) updated = schema.setPath(updated, [\"apiKeyEnv\"], multiKeyRef(props.provider, id));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tupdated = schema.setPath(updated, [\"keyEntries\"], { [id]: entry });\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetDraft(updated);\n\t\t\t\t\t}\n\t\t\t\t}) : null, multiKey ? (0, react_jsx_runtime.jsx)(MultiKeyEntriesEditor, {\n\t\t\t\t\troute: props.provider, entries: keyEntries, saveState: entrySaveState, savedEntries: entrySaveState?.ok ? entrySaveState.entries : void 0,\n\t\t\t\t\tonChange: (entries) => setDraft((current) => schema.setPath(current, [\"keyEntries\"], entries)),\n\t\t\t\t\tkeyDrafts: entryKeyDrafts, onKeyDraftsChange: setEntryKeyDrafts,\n\t\t\t\t\tconfirmations: entryConfirmations, onConfirmationsChange: setEntryConfirmations,\n\t\t\t\t\tpersistedEntries: schema.getPath(committedOriginal, [\"keyEntries\"]) ?? fallback?.keyEntries ?? {},\n\t\t\t\t\tcredentialChecks: props.credentialChecks,\n\t\t\t\t\tprobe: { settingsNs: namespace.ns, provider: props.provider, ...(probeBaseURL === void 0 ? {} : { baseURL: probeBaseURL }), ...(probeApi === void 0 ? {} : { api: probeApi }) },\n\t\t\t\t\treasoningLevels, operations, t, disabled: disabled || listBusy, onBusyChange: setListBusy\n\t\t\t\t}) : null, multiKey || keylessNativeAuth ? null : (0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\t\tchildren: [\n\t\t\t\t\t\t(0, react_jsx_runtime.jsxs)(\"span\", {\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"fieldLabel\"],\n\t\t\t\t\t\t\tchildren: [t(\"keyInput\"), authHelp]\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(ApiKeyInput, {\n\t\t\t\t\t\t\tt,\n\t\t\t\t\t\t\tvalue: keyDraft,\n\t\t\t\t\t\t\tplaceholder: keyPlaceholder,\n\t\t\t\t\t\t\t\"aria-label\": t(\"keyInput\"),\n\t\t\t\t\t\t\t\"aria-invalid\": shownKeyFailure !== void 0,\n\t\t\t\t\t\t\t\"aria-describedby\": credentialHint === void 0 ? void 0 : `${props.provider}-credential-hint`,\n\t\t\t\t\t\t\trequired: props.credentialRequired === true,\n\t\t\t\t\t\t\tautoFocus: props.autoFocusCredential === true,\n\t\t\t\t\t\t\tdisabled,\n\t\t\t\t\t\t\tonChange: (event) => {\n\t\t\t\t\t\t\t\tsetKeyDraft(event.target.value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tcredentialHint === void 0 ? null : (0, react_jsx_runtime.jsx)(\"p\", {\n\t\t\t\t\t\t\tid: `${props.provider}-credential-hint`,\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[missingRefs ? \"notice\" : detectedRef === void 0 ? \"advancedHint\" : \"savedNotice\"],\n\t\t\t\t\t\t\tchildren: credentialHint\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tshownKeyFailure === void 0 ? null : (0, react_jsx_runtime.jsx)(\"p\", {\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"error\"],\n\t\t\t\t\t\t\tchildren: t(shownKeyFailure)\n\t\t\t\t\t\t})\n\t\t\t\t\t]\n\t\t\t\t})] });\n\t\t\t\tconst customization = props.credentialOnly === true ? null : (0, react_jsx_runtime.jsxs)(\"details\", {\n\t\t\t\t\tclassName: ModelsSection_module_css_default[\"customized\"],\n\t\t\t\t\topen: supportsMultiKey ? true : void 0,\n\t\t\t\t\t\"data-multi-key-shared-settings\": supportsMultiKey ? true : void 0,\n\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"summary\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"customizedSummary\"],\n\t\t\t\t\t\tchildren: t(supportsMultiKey ? \"multiKeySharedSettings\" : \"customized\")\n\t\t\t\t\t}), (0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"customizedBody\"],\n\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\townsIdentity ? (0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"fieldLabel\"],\n\t\t\t\t\t\t\t\t\tchildren: t(\"customDisplayName\")\n\t\t\t\t\t\t\t\t}), (0, react_jsx_runtime.jsx)(\"input\", {\n\t\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"input\"],\n\t\t\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\t\t\tvalue: stringAt(draft, \"displayName\") ?? \"\",\n\t\t\t\t\t\t\t\t\tplaceholder: stringAt(schema.getPath(namespace.base, settingsPath), \"displayName\") ?? props.provider,\n\t\t\t\t\t\t\t\t\t\"aria-label\": t(\"customDisplayName\"),\n\t\t\t\t\t\t\t\t\tdisabled,\n\t\t\t\t\t\t\t\t\tonChange: (event) => {\n\t\t\t\t\t\t\t\t\t\tsetField(\"displayName\", event.target.value);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})]\n\t\t\t\t\t\t\t}) : null,\n\t\t\t\t\t\t\t(0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"fieldLabel\"],\n\t\t\t\t\t\t\t\t\t\tchildren: t(\"baseUrl\")\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(\"input\", {\n\t\t\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"input\"],\n\t\t\t\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\t\t\t\tvalue: stringAt(draft, \"baseURL\") ?? \"\",\n\t\t\t\t\t\t\t\t\t\tplaceholder: family === \"deepseek\" ? t(\"deepSeekBaseUrl\") : baseURL === void 0 ? t(endpointEnv.length > 0 ? \"baseUrlConfigured\" : \"baseUrlDefault\") : t(\"baseUrlPlaceholder\").replace(\"{url}\", () => baseURL),\n\t\t\t\t\t\t\t\t\t\t\"aria-describedby\": endpointHint === void 0 ? void 0 : `${props.provider}-endpoint-hint`,\n\t\t\t\t\t\t\t\t\t\t\"aria-label\": t(\"baseUrl\"),\n\t\t\t\t\t\t\t\t\t\tdisabled,\n\t\t\t\t\t\t\t\t\t\tonChange: (event) => {\n\t\t\t\t\t\t\t\t\t\t\tsetField(\"baseURL\", event.target.value === \"\" ? void 0 : event.target.value);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\tendpointHint === void 0 ? null : (0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\t\t\t\tid: `${props.provider}-endpoint-hint`,\n\t\t\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"advancedHint\"],\n\t\t\t\t\t\t\t\t\t\tchildren: endpointHint\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\townsIdentity ? (0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"fieldLabel\"],\n\t\t\t\t\t\t\t\t\tchildren: t(\"customApi\")\n\t\t\t\t\t\t\t\t}), (0, react_jsx_runtime.jsxs)(\"select\", {\n\t\t\t\t\t\t\t\t\tclassName: `${ModelsSection_module_css_default[\"input\"]} ${ModelsSection_module_css_default[\"selectInput\"]}`,\n\t\t\t\t\t\t\t\t\tvalue: probeApi ?? \"\",\n\t\t\t\t\t\t\t\t\t\"aria-label\": t(\"customApi\"),\n\t\t\t\t\t\t\t\t\tdisabled,\n\t\t\t\t\t\t\t\t\tonChange: (event) => {\n\t\t\t\t\t\t\t\t\t\tsetField(\"api\", event.target.value);\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tchildren: [probeApi === void 0 ? (0, react_jsx_runtime.jsx)(\"option\", {\n\t\t\t\t\t\t\t\t\t\tvalue: \"\",\n\t\t\t\t\t\t\t\t\t\tchildren: t(\"customApiUnset\")\n\t\t\t\t\t\t\t\t\t}) : null, protocols.map((choice) => (0, react_jsx_runtime.jsx)(\"option\", {\n\t\t\t\t\t\t\t\t\t\tvalue: choice,\n\t\t\t\t\t\t\t\t\t\tchildren: protocolLabel(t, choice)\n\t\t\t\t\t\t\t\t\t}, choice))]\n\t\t\t\t\t\t\t\t})]\n\t\t\t\t\t\t\t}) : null,\n\t\t\t\t\t\t\tmultiKey ? null : family === \"deepseek\" ? (0, react_jsx_runtime.jsx)(DeepSeekModelsEditor, {\n\t\t\t\t\t\t\t\t...catalogProps,\n\t\t\t\t\t\t\t\tdefaultContextWindow: typeof defaultContextWindow === \"number\" ? defaultContextWindow : void 0,\n\t\t\t\t\t\t\t\tdefaultMaxTokens: typeof defaultMaxTokens === \"number\" ? defaultMaxTokens : void 0\n\t\t\t\t\t\t\t}) : (0, react_jsx_runtime.jsx)(ModelListEditor, {\n\t\t\t\t\t\t\t\t...catalogProps,\n\t\t\t\t\t\t\t\tcatalogProvider: props.declared === true ? void 0 : props.provider,\n\t\t\t\t\t\t\t\treasoningLevels,\n\t\t\t\t\t\t\t\tdefaultInput: Array.isArray(defaultInput) ? defaultInput : void 0,\n\t\t\t\t\t\t\t\tprobe,\n\t\t\t\t\t\t\t\tprobeBlocked: keyFailure,\n\t\t\t\t\t\t\t\toperations,\n\t\t\t\t\t\t\t\tonBusyChange: setListBusy\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t]\n\t\t\t\t\t})]\n\t\t\t\t});\n\t\t\t\treturn (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: supportsMultiKey ? [customization, credentials] : [credentials, customization] });\n\t\t\t};\n\t\t\treturn (0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\tclassName: props.credentialOnly === true ? ModelsSection_module_css_default[\"addBlock\"] : ModelsSection_module_css_default[\"editor\"],\n\t\t\t\tchildren: [\n\t\t\t\t\tprops.hideTitle === true ? null : (0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"editorHeader\"],\n\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"editorTitle\"],\n\t\t\t\t\t\t\tchildren: props.displayName\n\t\t\t\t\t\t}), props.provider !== props.displayName ? (0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"editorRoute\"],\n\t\t\t\t\t\t\tchildren: props.provider\n\t\t\t\t\t\t}) : null]\n\t\t\t\t\t}),\n\t\t\t\t\tlayout === \"unknown\" ? (0, react_jsx_runtime.jsx)(\"p\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"advancedHint\"],\n\t\t\t\t\t\tchildren: `${t(\"advancedHint\")} (${namespace.ns})`\n\t\t\t\t\t}) : curatedFields(layout),\n\t\t\t\t\t(failure ?? entryFailure) !== void 0 ? (0, react_jsx_runtime.jsx)(\"p\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"error\"],\n\t\t\t\t\t\tchildren: failure ?? entryFailure\n\t\t\t\t\t}) : null,\n\t\t\t\t\tprops.credentialOnly === true || modelFailure === void 0 ? null : (0, react_jsx_runtime.jsx)(\"p\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"advancedHint\"],\n\t\t\t\t\t\tchildren: `${t(\"model\")} ${String(modelFailure.index + 1)}: ${t(modelFailure.key)}`\n\t\t\t\t\t}),\n\t\t\t\t\t(0, react_jsx_runtime.jsx)(EditorFooter, {\n\t\t\t\t\t\tt,\n\t\t\t\t\t\tbusy,\n\t\t\t\t\t\tsubmitDisabled: disabled || listBusy || layout === \"unknown\" || entryFailure !== void 0 || props.credentialOnly !== true && modelFailure !== void 0 || !multiKey && (shownKeyFailure !== void 0 || props.credentialRequired === true && keyValue.length === 0),\n\t\t\t\t\t\tsubmitLabelKey: props.submitLabelKey ?? \"apply\",\n\t\t\t\t\t\tsubmitBusyLabelKey: props.submitBusyLabelKey ?? \"applying\",\n\t\t\t\t\t\t...props.cancelLabelKey === void 0 ? {} : { cancelLabelKey: props.cancelLabelKey },\n\t\t\t\t\t\tonCancel: () => {\n\t\t\t\t\t\t\tprops.onClose(false);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonSubmit: () => {\n\t\t\t\t\t\t\tprops.onSubmitCredential?.();\n\t\t\t\t\t\t\tapply();\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t]\n\t\t\t});\n\t\t}"
175
+ },
176
+ {
177
+ "before": "className: ModelsSection_module_css_default[\"editorActions\"],",
178
+ "after": "className: ModelsSection_module_css_default[\"editorActions\"],\n\t\t\t\t\"data-model-save-actions\": true,\n\t\t\t\tstyle: { position: \"sticky\", bottom: \"calc(var(--dsh-model-save-offset, 0px) + env(safe-area-inset-bottom, 0px))\", zIndex: 2, padding: \"10px 0\", background: \"var(--dsw-alias-bg-module-platform)\", flexWrap: \"wrap\" },"
179
+ },
180
+ {
181
+ "before": "const en = {\n",
182
+ "after": "const en = {\n\t\t\tmultiKeyExpand: \"Expand details\",\n\t\t\tmultiKeyCollapse: \"Collapse details\",\n\t\t\tmultiKeyUnsaved: \"Not saved\",\n"
183
+ },
184
+ {
185
+ "before": "const zh = {\n",
186
+ "after": "const zh = {\n\t\t\tmultiKeyExpand: \"展开详情\",\n\t\t\tmultiKeyCollapse: \"收起详情\",\n\t\t\tmultiKeyUnsaved: \"未保存\",\n"
187
+ }
188
+ ],
189
+ "variants": [
190
+ {
191
+ "baseSha256": "e111ecefea8262e0426f528864b9681d818068042e93d053bcb0b6884b317278",
192
+ "resultSha256": "651052eccf0bdba6a8dd1624bfc25ce9215268cdd6a9a08b80e1095329c1ea5a",
193
+ "replacements": [
194
+ {
195
+ "before": "\t\t//#region lib/types/client/CustomProviderCard.js",
196
+ "after": "\t\t//#region dsh-model-groups/native/multikey\n\t\t// Entries live under one native provider. Secrets exist only in local drafts\n\t\t// and credentials/set; profile mutations contain credential references only.\n\t\tconst MULTI_KEY_ENTRY_ID = /^[A-Za-z0-9][A-Za-z0-9_-]{0,79}$/;\n\t\tconst MULTI_KEY_REF = /^[A-Za-z_][A-Za-z0-9_]*$/;\n\t\tconst MULTI_KEY_UNSAFE_IDS = new Set([\"__proto__\", \"prototype\", \"constructor\"]);\n\t\tfunction supportsMultiKeySchema(namespace, schema, path) {\n\t\t\tif (!namespace || !schema) return false;\n\t\t\tconst root = schema.rehydrate(namespace.schema);\n\t\t\tconst profile = schema.nodeAtPath(root, path);\n\t\t\treturn profile?.dict?.multiKey !== void 0 && profile?.dict?.keyEntries !== void 0;\n\t\t}\n\t\tfunction multiKeyRef(route, id) {\n\t\t\tconst normalized = route.toUpperCase().replace(/[^A-Z0-9]+/g, \"_\");\n\t\t\tconst stem = /^[A-Z_]/.test(normalized) ? normalized : `DSH_${normalized}`;\n\t\t\treturn `${stem}_MULTKEY_${id.toUpperCase().replace(/[^A-Z0-9]+/g, \"_\")}_API_KEY`;\n\t\t}\n\t\tfunction newMultiKeyEntry(route, source = {}) {\n\t\t\tconst id = `k${crypto.randomUUID()}`;\n\t\t\treturn [id, {\n\t\t\t\tname: source.name ?? \"\",\n\t\t\t\t...(typeof source.apiKeyEnv === \"string\" && source.apiKeyEnv.length > 0 ? { apiKeyEnv: source.apiKeyEnv } : {}),\n\t\t\t\tmodels: modelDrafts(source.models).map((model) => structuredClone(model))\n\t\t\t}];\n\t\t}\n\t\tfunction normalizedMultiKeyEntries(route, entries) {\n\t\t\treturn Object.fromEntries(Object.entries(entries).map(([id, entry]) => [id, {\n\t\t\t\t...entry,\n\t\t\t\tname: typeof entry?.name === \"string\" ? entry.name.trim() : \"\",\n\t\t\t\tapiKeyEnv: typeof entry?.apiKeyEnv === \"string\" && entry.apiKeyEnv.length > 0 ? entry.apiKeyEnv : multiKeyRef(route, id),\n\t\t\t\tmodels: modelDrafts(entry?.models).map((model) => structuredClone(model))\n\t\t\t}]));\n\t\t}\n\t\tfunction multiKeyFailure(route, entries, drafts, confirmations, t) {\n\t\t\tif (!entries || typeof entries !== \"object\" || Array.isArray(entries) || Object.keys(entries).length === 0) return t(\"multiKeyNeedsEntries\");\n\t\t\tconst refs = new Set();\n\t\t\tfor (const [id, entry] of Object.entries(entries)) {\n\t\t\t\tif (!MULTI_KEY_ENTRY_ID.test(id) || MULTI_KEY_UNSAFE_IDS.has(id)) return t(\"multiKeyInvalidId\");\n\t\t\t\tif (!entry || typeof entry.name !== \"string\" || entry.name.trim().length === 0 || entry.name.trim().length > 120) return t(\"multiKeyInvalidName\");\n\t\t\t\tconst ref = entry.apiKeyEnv ?? multiKeyRef(route, id);\n\t\t\t\tif (typeof ref !== \"string\" || !MULTI_KEY_REF.test(ref)) return t(\"multiKeyInvalidRef\");\n\t\t\t\tif (refs.has(ref)) return t(\"multiKeyDuplicateRef\");\n\t\t\t\trefs.add(ref);\n\t\t\t\tconst keyFailure = apiKeyFailure(drafts[id] ?? \"\");\n\t\t\t\tif (keyFailure !== void 0) return `${entry.name}: ${t(keyFailure)}`;\n\t\t\t\tif ((drafts[id] ?? \"\").trim().length > 0 && ref !== multiKeyRef(route, id) && confirmations[id] !== true) return `${entry.name}: ${t(\"multiKeyConfirmRequired\")}`;\n\t\t\t\tif (!Array.isArray(entry.models) || entry.models.length === 0) return `${entry.name}: ${t(\"multiKeyNeedsModels\")}`;\n\t\t\t\tconst modelFailure = validateDeepSeekModels(entry.models) ?? validateReasoningEfforts(entry.models);\n\t\t\t\tif (modelFailure !== void 0) return `${entry.name}: ${t(\"model\")} ${String(modelFailure.index + 1)}: ${t(modelFailure.key)}`;\n\t\t\t}\n\t\t}\n\t\tasync function storeMultiKeyDrafts(operations, entries, drafts, setDrafts) {\n\t\t\tfor (const [id, entry] of Object.entries(entries)) {\n\t\t\t\tconst draft = Object.hasOwn(drafts, id) ? drafts[id] : \"\";\n\t\t\t\tif (draft.trim().length === 0) continue;\n\t\t\t\tconst failure = await operations.storeCredential(entry.apiKeyEnv, draft.trim());\n\t\t\t\tif (failure !== void 0) return failure;\n\t\t\t\t// Clear only successful, unchanged drafts: partial failures retry just\n\t\t\t\t// the unfinished credentials without rewriting the provider profile.\n\t\t\t\tsetDrafts((current) => current[id] === draft ? { ...current, [id]: \"\" } : current);\n\t\t\t}\n\t\t}\n\t\tfunction hasMultiKeyDrafts(drafts) {\n\t\t\treturn Object.values(drafts).some((value) => typeof value === \"string\" && value.length > 0);\n\t\t}\n\t\tfunction MultiKeyToggle({ t, checked, disabled, onChange, hasUnsavedKeys = false }) {\n\t\t\tconst [confirmOff, setConfirmOff] = (0, react.useState)(false);\n\t\t\t(0, react.useEffect)(() => {\n\t\t\t\tif (!checked || disabled) setConfirmOff(false);\n\t\t\t}, [checked, disabled]);\n\t\t\tconst close = () => setConfirmOff(false);\n\t\t\treturn (0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\"data-multi-key-toggle\": true,\n\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\tchildren: [(0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\tclassName: ModelsSection_module_css_default[\"modelReasoningHead\"],\n\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"fieldLabel\"], children: t(\"multiKey\")\n\t\t\t\t\t}), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Switch, {\n\t\t\t\t\t\tchecked, label: t(\"multiKey\"), disabled,\n\t\t\t\t\t\tonChange: (enabled) => {\n\t\t\t\t\t\t\tif (disabled || enabled === checked) return;\n\t\t\t\t\t\t\tif (!enabled) setConfirmOff(true);\n\t\t\t\t\t\t\telse onChange(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t})]\n\t\t\t\t}), (0, react_jsx_runtime.jsx)(\"p\", {\n\t\t\t\t\tclassName: ModelsSection_module_css_default[\"advancedHint\"], children: t(\"multiKeyHelp\")\n\t\t\t\t}), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {\n\t\t\t\t\topen: confirmOff && checked && !disabled, onClose: close,\n\t\t\t\t\ttitle: t(hasUnsavedKeys ? \"multiKeyUnsavedTitle\" : \"multiKeyDisableTitle\"),\n\t\t\t\t\tcloseLabel: t(\"close\"),\n\t\t\t\t\tdescription: t(hasUnsavedKeys ? \"multiKeyUnsavedKeys\" : \"multiKeyDisableDescription\"),\n\t\t\t\t\tclassName: ModelsSection_module_css_default[\"deleteDialog\"],\n\t\t\t\t\tfooter: (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [\n\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {\n\t\t\t\t\t\t\tvariant: \"outline\", \"data-modal-autofocus\": true, onClick: close,\n\t\t\t\t\t\t\tchildren: t(hasUnsavedKeys ? \"multiKeyReturnToEdit\" : \"multiKeyKeepEnabled\")\n\t\t\t\t\t\t}), hasUnsavedKeys ? null : (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {\n\t\t\t\t\t\t\tvariant: \"outline\", disabled,\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\tif (disabled || !checked || hasUnsavedKeys) return;\n\t\t\t\t\t\t\t\tclose(); onChange(false);\n\t\t\t\t\t\t\t}, children: t(\"multiKeyDisableConfirm\")\n\t\t\t\t\t\t})\n\t\t\t\t\t] })\n\t\t\t\t})]\n\t\t\t});\n\t\t}\n\t\tfunction MultiKeyEntriesEditor(props) {\n\t\t\tconst { route, entries, keyDrafts, confirmations, onChange, onKeyDraftsChange, onConfirmationsChange, operations, t, disabled } = props;\n\t\t\tconst [busyEntries, setBusyEntries] = (0, react.useState)({});\n\t\t\tconst anyBusy = Object.values(busyEntries).some(Boolean);\n\t\t\tconst { onBusyChange } = props;\n\t\t\t(0, react.useEffect)(() => {\n\t\t\t\tonBusyChange?.(anyBusy);\n\t\t\t}, [anyBusy, onBusyChange]);\n\t\t\t(0, react.useEffect)(() => () => onBusyChange?.(false), [onBusyChange]);\n\t\t\tconst update = (id, patch) => onChange({ ...entries, [id]: { ...entries[id], ...patch } });\n\t\t\tconst remove = (id) => {\n\t\t\t\tconst { [id]: removed, ...remaining } = entries;\n\t\t\t\tonChange(remaining);\n\t\t\t\tonKeyDraftsChange((current) => { const { [id]: removed, ...rest } = current; return rest; });\n\t\t\t\tonConfirmationsChange((current) => { const { [id]: removed, ...rest } = current; return rest; });\n\t\t\t\tsetBusyEntries((current) => { const { [id]: removed, ...rest } = current; return rest; });\n\t\t\t};\n\t\t\treturn (0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\"data-multi-key-entries\": true,\n\t\t\t\tclassName: ModelsSection_module_css_default[\"modelList\"],\n\t\t\t\tchildren: [Object.entries(entries).map(([id, candidate], index) => {\n\t\t\t\t\tconst entry = candidate && typeof candidate === \"object\" && !Array.isArray(candidate) ? candidate : {};\n\t\t\t\t\tconst ref = entry.apiKeyEnv ?? multiKeyRef(route, id);\n\t\t\t\t\tconst draft = Object.hasOwn(keyDrafts, id) ? keyDrafts[id] : \"\";\n\t\t\t\t\tconst keyFailure = apiKeyFailure(draft);\n\t\t\t\t\tconst persisted = Object.hasOwn(props.persistedEntries ?? {}, id) && props.persistedEntries[id]?.apiKeyEnv === ref;\n\t\t\t\t\tconst info = props.credentialChecks?.[ref];\n\t\t\t\t\tconst status = info?.configured === true ? \"multiKeyConfigured\" : info?.configured === false ? \"multiKeyMissing\" : persisted ? \"multiKeySaved\" : \"multiKeyNew\";\n\t\t\t\t\tconst needsConfirmation = draft.trim().length > 0 && ref !== multiKeyRef(route, id);\n\t\t\t\t\tconst canUseStored = persisted && props.probe.provider !== void 0;\n\t\t\t\t\tconst probe = {\n\t\t\t\t\t\t...props.probe,\n\t\t\t\t\t\t...(canUseStored ? { keyEntryId: id } : {}),\n\t\t\t\t\t\t...(draft.trim().length > 0 ? { apiKey: draft.trim() } : {})\n\t\t\t\t\t};\n\t\t\t\t\tconst heading = typeof entry.name === \"string\" && entry.name.trim().length > 0 ? entry.name.trim() : `${t(\"multiKeyDefaultName\")} ${String(index + 1)}`;\n\t\t\t\t\treturn (0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\t\"data-key-entry-id\": id, role: \"group\", \"aria-label\": heading,\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"rowCard\"],\n\t\t\t\t\t\tstyle: { minWidth: 0 },\n\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\t\t\"data-key-entry-heading\": true,\n\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"rowHead\"],\n\t\t\t\t\t\t\tstyle: { flexWrap: \"wrap\" },\n\t\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"rowName\"],\n\t\t\t\t\t\t\t\tstyle: { minWidth: 0, overflowWrap: \"anywhere\", flex: \"1 1 120px\" }, children: heading\n\t\t\t\t\t\t\t}), (0, react_jsx_runtime.jsx)(\"div\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"rowActions\"],\n\t\t\t\t\t\t\t\tchildren: (0, react_jsx_runtime.jsx)(\"button\", {\n\t\t\t\t\t\t\t\t\ttype: \"button\", className: ModelsSection_module_css_default[\"secondaryButton\"], disabled,\n\t\t\t\t\t\t\t\t\tonClick: () => remove(id), children: t(\"multiKeyRemove\")\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t})]\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t(0, react_jsx_runtime.jsxs)(\"label\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"span\", { className: ModelsSection_module_css_default[\"fieldLabel\"], children: t(\"multiKeyEntryName\") }),\n\t\t\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(\"input\", {\n\t\t\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"input\"], type: \"text\", value: entry.name ?? \"\", maxLength: 120,\n\t\t\t\t\t\t\t\t\t\t\"aria-label\": `${t(\"multiKeyEntryName\")} ${String(index + 1)}`, disabled,\n\t\t\t\t\t\t\t\t\t\tonChange: (event) => update(id, { name: event.target.value })\n\t\t\t\t\t\t\t\t\t})]\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t(0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"span\", { className: ModelsSection_module_css_default[\"fieldLabel\"], children: t(\"keyInput\") }),\n\t\t\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(ApiKeyInput, {\n\t\t\t\t\t\t\t\t\t\tt, value: draft, placeholder: t(persisted ? \"keyPlaceholderSaved\" : \"keyPlaceholder\"),\n\t\t\t\t\t\t\t\t\t\t\"aria-label\": `${t(\"keyInput\")} ${String(index + 1)}`, \"aria-invalid\": keyFailure !== void 0,\n\t\t\t\t\t\t\t\t\t\tdisabled: props.keyDisabled ?? disabled,\n\t\t\t\t\t\t\t\t\t\tonChange: (event) => {\n\t\t\t\t\t\t\t\t\t\t\tconst value = event.target.value;\n\t\t\t\t\t\t\t\t\t\t\tonKeyDraftsChange((current) => ({ ...current, [id]: value }));\n\t\t\t\t\t\t\t\t\t\t\tonConfirmationsChange((current) => ({ ...current, [id]: false }));\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(\"p\", { className: ModelsSection_module_css_default[\"advancedHint\"], children: t(status) }),\n\t\t\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(\"p\", { className: ModelsSection_module_css_default[\"advancedHint\"], style: { overflowWrap: \"anywhere\" }, children: t(\"multiKeyRef\").replace(\"{ref}\", () => ref) }),\n\t\t\t\t\t\t\t\t\tkeyFailure === void 0 ? null : (0, react_jsx_runtime.jsx)(\"p\", { className: ModelsSection_module_css_default[\"error\"], children: t(keyFailure) })]\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tneedsConfirmation ? (0, react_jsx_runtime.jsxs)(\"label\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"fieldLabel\"],\n\t\t\t\t\t\t\t\tstyle: { display: \"flex\", alignItems: \"flex-start\", gap: 8, overflowWrap: \"anywhere\" },\n\t\t\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"input\", {\n\t\t\t\t\t\t\t\t\ttype: \"checkbox\", \"data-confirm-entry\": id, \"aria-label\": t(\"multiKeyReplaceConfirm\").replace(\"{ref}\", () => ref),\n\t\t\t\t\t\t\t\t\tchecked: confirmations[id] === true, disabled: props.keyDisabled ?? disabled,\n\t\t\t\t\t\t\t\t\tonChange: (event) => onConfirmationsChange((current) => ({ ...current, [id]: event.target.checked }))\n\t\t\t\t\t\t\t\t}), (0, react_jsx_runtime.jsx)(\"span\", { children: t(\"multiKeyReplaceConfirm\").replace(\"{ref}\", () => ref) })]\n\t\t\t\t\t\t\t}) : null,\n\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(ModelListEditor, {\n\t\t\t\t\t\t\t\tmodels: modelDrafts(entry.models), onChange: (models) => update(id, { models }),\n\t\t\t\t\t\t\t\treasoningLevels: props.reasoningLevels, probe,\n\t\t\t\t\t\t\t\tprobeBlocked: keyFailure ?? props.probeBlocked ?? (!canUseStored && draft.trim().length === 0 ? \"multiKeyProbeNeedsKey\" : void 0),\n\t\t\t\t\t\t\t\toperations, t, disabled,\n\t\t\t\t\t\t\t\tonBusyChange: (value) => setBusyEntries((current) => current[id] === value ? current : { ...current, [id]: value })\n\t\t\t\t\t\t\t})]\n\t\t\t\t\t}, id);\n\t\t\t\t}), (0, react_jsx_runtime.jsx)(\"button\", {\n\t\t\t\t\ttype: \"button\", className: ModelsSection_module_css_default[\"addModelButton\"], disabled,\n\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\tlet id, entry;\n\t\t\t\t\t\tdo { [id, entry] = newMultiKeyEntry(route, { name: `${t(\"multiKeyDefaultName\")} ${String(Object.keys(entries).length + 1)}` }); } while (Object.hasOwn(entries, id) || Object.values(entries).some((other) => other.apiKeyEnv === multiKeyRef(route, id)));\n\t\t\t\t\t\tonChange({ ...entries, [id]: entry });\n\t\t\t\t\t}, children: t(\"multiKeyAdd\")\n\t\t\t\t}), (0, react_jsx_runtime.jsx)(\"p\", { className: ModelsSection_module_css_default[\"advancedHint\"], children: t(\"multiKeyKeepCredentials\") })]\n\t\t\t});\n\t\t}\n\t\t//#endregion\n\n\t\t//#region lib/types/client/CustomProviderCard.js"
197
+ },
198
+ {
199
+ "before": "\t\t\t\t\t...probe.provider === void 0 ? {} : { provider: probe.provider },",
200
+ "after": "\t\t\t\t\t...probe.provider === void 0 ? {} : { provider: probe.provider },\n\t\t\t\t\t...probe.keyEntryId === void 0 ? {} : { keyEntryId: probe.keyEntryId },"
201
+ },
202
+ {
203
+ "before": "const { taken, protocols, reasoningLevels, operations, t, onBusyChange } = props;",
204
+ "after": "const { taken, protocols, reasoningLevels, operations, t, onBusyChange } = props;\n\t\t\tconst supportsMultiKey = supportsMultiKeySchema(props.namespace, props.schema, [\"providers\", PROBE_ROUTE]);"
205
+ },
206
+ {
207
+ "before": "const [models, setModels] = (0, react.useState)([]);\n\t\t\tconst [busy, setBusy]",
208
+ "after": "const [models, setModels] = (0, react.useState)([]);\n\t\t\tconst [multiKey, setMultiKey] = (0, react.useState)(false);\n\t\t\tconst [keyEntries, setKeyEntries] = (0, react.useState)({});\n\t\t\tconst [entryKeyDrafts, setEntryKeyDrafts] = (0, react.useState)({});\n\t\t\tconst [entryConfirmations, setEntryConfirmations] = (0, react.useState)({});\n\t\t\tconst saving = (0, react.useRef)(false);\n\t\t\tconst [busy, setBusy]"
209
+ },
210
+ {
211
+ "before": "const modelFailure = validateDeepSeekModels(models) ?? validateReasoningEfforts(models);\n\t\t\tconst keyFailure = apiKeyFailure(keyDraft);",
212
+ "after": "const modelFailure = multiKey ? void 0 : validateDeepSeekModels(models) ?? validateReasoningEfforts(models);\n\t\t\tconst entryFailure = multiKey ? multiKeyFailure(route, keyEntries, entryKeyDrafts, entryConfirmations, t) : void 0;\n\t\t\tconst keyFailure = multiKey ? void 0 : apiKeyFailure(keyDraft);"
213
+ },
214
+ {
215
+ "before": "const ready = route.length > 0 && !routeInvalid && !routeTaken && normalizedBaseURL.length > 0 && !baseUrlInvalid && models.length > 0 && modelFailure === void 0 && keyFailure === void 0;",
216
+ "after": "const ready = (committed || route.length > 0 && !routeInvalid && !routeTaken) && normalizedBaseURL.length > 0 && !baseUrlInvalid && (multiKey ? entryFailure === void 0 : models.length > 0 && modelFailure === void 0 && keyFailure === void 0);"
217
+ },
218
+ {
219
+ "before": "const hint = failure !== void 0 || ready || keyFailure !== void 0 || route.length === 0 || routeInvalid || routeTaken || baseUrlInvalid ? void 0 : normalizedBaseURL.length === 0 ? t(\"customNeedsBaseUrl\") : modelFailure !== void 0 ? `${t(\"model\")} ${String(modelFailure.index + 1)}: ${t(modelFailure.key)}` : t(\"customNeedsModels\");",
220
+ "after": "const hint = entryFailure ?? (failure !== void 0 || ready || keyFailure !== void 0 || route.length === 0 || routeInvalid || routeTaken || baseUrlInvalid ? void 0 : normalizedBaseURL.length === 0 ? t(\"customNeedsBaseUrl\") : modelFailure !== void 0 ? `${t(\"model\")} ${String(modelFailure.index + 1)}: ${t(modelFailure.key)}` : t(\"customNeedsModels\"));"
221
+ },
222
+ {
223
+ "before": "const keyRef = deriveKeyRef(route);\n\t\t\t\tconst storesKey = keyValue.length > 0;",
224
+ "after": "const entries = normalizedMultiKeyEntries(route, keyEntries);\n\t\t\t\tconst firstEntry = Object.values(entries)[0];\n\t\t\t\tconst keyRef = multiKey ? firstEntry?.apiKeyEnv : deriveKeyRef(route);\n\t\t\t\tconst storesKey = !multiKey && keyValue.length > 0;\n\t\t\t\tif (multiKey && entryFailure !== void 0) return entryFailure;"
225
+ },
226
+ {
227
+ "before": "...storesKey ? { apiKeyEnv: keyRef } : {},\n\t\t\t\t\t\tapi: protocol,\n\t\t\t\t\t\tbaseURL: normalizedBaseURL,\n\t\t\t\t\t\tmodels: models.map((model) => ({ ...model }))",
228
+ "after": "...storesKey || multiKey ? { apiKeyEnv: keyRef } : {},\n\t\t\t\t\t\tapi: protocol,\n\t\t\t\t\t\tbaseURL: normalizedBaseURL,\n\t\t\t\t\t\tmodels: (multiKey ? firstEntry.models : models).map((model) => ({ ...model })),\n\t\t\t\t\t\t...(multiKey || Object.keys(keyEntries).length > 0 ? { multiKey, keyEntries: entries } : {})"
229
+ },
230
+ {
231
+ "before": "\t\t\t\tif (storesKey) {\n\t\t\t\t\tconst stored = await operations.storeCredential(keyRef, keyValue);\n\t\t\t\t\tif (stored !== void 0) return stored;\n\t\t\t\t}\n\t\t\t};",
232
+ "after": "\t\t\t\tif (multiKey) return storeMultiKeyDrafts(operations, entries, entryKeyDrafts, setEntryKeyDrafts);\n\t\t\t\tif (storesKey) {\n\t\t\t\t\tconst stored = await operations.storeCredential(keyRef, keyValue);\n\t\t\t\t\tif (stored !== void 0) return stored;\n\t\t\t\t\tsetKeyDraft(\"\");\n\t\t\t\t}\n\t\t\t};"
233
+ },
234
+ {
235
+ "before": "const create = async () => {\n\t\t\t\tsetBusy(true);",
236
+ "after": "const create = async () => {\n\t\t\t\tif (saving.current || !ready || props.readOnly || listBusy) return;\n\t\t\t\tsaving.current = true;\n\t\t\t\tsetBusy(true);"
237
+ },
238
+ {
239
+ "before": "props.onClose(true);\n\t\t\t\t} finally {\n\t\t\t\t\tsetBusy(false);\n\t\t\t\t}\n\t\t\t};\n\t\t\treturn (0, react_jsx_runtime.jsxs)(\"div\", {",
240
+ "after": "props.onClose(true);\n\t\t\t\t} catch {\n\t\t\t\t\tsetFailure(t(\"multiKeySaveFailed\"));\n\t\t\t\t} finally {\n\t\t\t\t\tsaving.current = false;\n\t\t\t\t\tsetBusy(false);\n\t\t\t\t}\n\t\t\t};\n\t\t\treturn (0, react_jsx_runtime.jsxs)(\"div\", {"
241
+ },
242
+ {
243
+ "before": "\t\t\t\t\t(0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"fieldLabel\"],\n\t\t\t\t\t\t\t\tchildren: t(\"keyInput\")",
244
+ "after": "\t\t\t\t\tsupportsMultiKey ? (0, react_jsx_runtime.jsx)(MultiKeyToggle, {\n\t\t\t\t\t\tt, checked: multiKey, disabled: profileDisabled || listBusy, hasUnsavedKeys: hasMultiKeyDrafts(entryKeyDrafts),\n\t\t\t\t\t\tonChange: (enabled) => {\n\t\t\t\t\t\t\tif (enabled && Object.keys(keyEntries).length === 0) {\n\t\t\t\t\t\t\t\tconst [id, entry] = newMultiKeyEntry(route, { name: displayName || route || t(\"multiKeyDefaultName\"), models });\n\t\t\t\t\t\t\t\tsetKeyEntries({ [id]: entry });\n\t\t\t\t\t\t\t\tif (keyDraft.length > 0) setEntryKeyDrafts({ [id]: keyDraft });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsetMultiKey(enabled);\n\t\t\t\t\t\t}\n\t\t\t\t\t}) : null,\n\t\t\t\t\tmultiKey ? (0, react_jsx_runtime.jsx)(MultiKeyEntriesEditor, {\n\t\t\t\t\t\troute, entries: keyEntries, onChange: setKeyEntries,\n\t\t\t\t\t\tkeyDrafts: entryKeyDrafts, onKeyDraftsChange: setEntryKeyDrafts,\n\t\t\t\t\t\tconfirmations: entryConfirmations, onConfirmationsChange: setEntryConfirmations,\n\t\t\t\t\t\tpersistedEntries: committed ? normalizedMultiKeyEntries(route, keyEntries) : {},\n\t\t\t\t\t\tprobe: { settingsNs: NS$1, ...(committed ? { provider: route } : {}), baseURL: normalizedBaseURL, api: protocol },\n\t\t\t\t\t\tprobeBlocked: baseUrlInvalid ? \"customBaseUrlInvalid\" : normalizedBaseURL.length === 0 ? \"customNeedsBaseUrl\" : void 0,\n\t\t\t\t\t\treasoningLevels, operations, t, disabled: profileDisabled || listBusy, keyDisabled: disabled || listBusy, onBusyChange: setListBusy\n\t\t\t\t\t}) : null,\n\t\t\t\t\tmultiKey ? null : (0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"field\"],\n\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"fieldLabel\"],\n\t\t\t\t\t\t\t\tchildren: t(\"keyInput\")"
245
+ },
246
+ {
247
+ "before": "\t\t\t\t\t(0, react_jsx_runtime.jsx)(ModelListEditor, {\n\t\t\t\t\t\tmodels,\n\t\t\t\t\t\tonChange: setModels,",
248
+ "after": "\t\t\t\t\t!multiKey ? (0, react_jsx_runtime.jsx)(ModelListEditor, {\n\t\t\t\t\t\tmodels,\n\t\t\t\t\t\tonChange: setModels,"
249
+ },
250
+ {
251
+ "before": "\t\t\t\t\t\tonBusyChange: setListBusy\n\t\t\t\t\t}),\n\t\t\t\t\tfailure !== void 0",
252
+ "after": "\t\t\t\t\t\tonBusyChange: setListBusy\n\t\t\t\t\t}) : null,\n\t\t\t\t\tfailure !== void 0"
253
+ },
254
+ {
255
+ "before": "submitDisabled: disabled || !ready,",
256
+ "after": "submitDisabled: disabled || listBusy || !ready,"
257
+ },
258
+ {
259
+ "before": "taken: state.rows.map((row) => row.entry.provider),\n\t\t\t\t\t\t\t\t\t\tprotocols,",
260
+ "after": "taken: state.rows.map((row) => row.entry.provider),\n\t\t\t\t\t\t\t\t\t\tnamespace: piAi,\n\t\t\t\t\t\t\t\t\t\tschema,\n\t\t\t\t\t\t\t\t\t\tprotocols,"
261
+ },
262
+ {
263
+ "before": "const [draft, setDraft] = (0, react.useState)(() => draftAt(schema, namespace, settingsPath));",
264
+ "after": "const [draft, setDraft] = (0, react.useState)(() => draftAt(schema, namespace, settingsPath));\n\t\t\tconst [entryKeyDrafts, setEntryKeyDrafts] = (0, react.useState)({});\n\t\t\tconst [entryConfirmations, setEntryConfirmations] = (0, react.useState)({});\n\t\t\tconst saving = (0, react.useRef)(false);"
265
+ },
266
+ {
267
+ "before": "const keyRef = refFor(schema, namespace, settingsPath, props.provider);",
268
+ "after": "const keyRef = refFor(schema, namespace, settingsPath, props.provider);\n\t\t\tconst supportsMultiKey = layout === \"pi-ai\" && props.declared === true && props.credentialOnly !== true && supportsMultiKeySchema(namespace, schema, settingsPath);\n\t\t\tconst multiKey = supportsMultiKey && (draft.multiKey ?? fallback?.multiKey) === true;\n\t\t\tconst keyEntries = draft.keyEntries ?? fallback?.keyEntries ?? {};\n\t\t\tconst entryFailure = multiKey ? multiKeyFailure(props.provider, keyEntries, entryKeyDrafts, entryConfirmations, t) : void 0;"
269
+ },
270
+ {
271
+ "before": "const modelFailure = validateModels(schema.getPath(draft, [\"models\"]));\n\t\t\tconst keyFailure = apiKeyFailure(keyDraft);",
272
+ "after": "const modelFailure = multiKey ? void 0 : validateModels(schema.getPath(draft, [\"models\"]));\n\t\t\tconst keyFailure = multiKey ? void 0 : apiKeyFailure(keyDraft);"
273
+ },
274
+ {
275
+ "before": "const next = layout === \"pi-ai\" && stringAt(draft, \"apiKeyEnv\") === void 0 && stringAt(fallback, \"apiKeyEnv\") === void 0 && keyValue.length > 0 ? schema.setPath(draft, [\"apiKeyEnv\"], keyRef) : draft;",
276
+ "after": "const normalizedDraft = supportsMultiKey && schema.hasPath(draft, [\"keyEntries\"]) ? schema.setPath(draft, [\"keyEntries\"], normalizedMultiKeyEntries(props.provider, keyEntries)) : draft;\n\t\t\t\tconst next = multiKey ? schema.setPath(normalizedDraft, [\"keyEntries\"], normalizedMultiKeyEntries(props.provider, keyEntries)) : layout === \"pi-ai\" && stringAt(draft, \"apiKeyEnv\") === void 0 && stringAt(fallback, \"apiKeyEnv\") === void 0 && keyValue.length > 0 ? schema.setPath(normalizedDraft, [\"apiKeyEnv\"], keyRef) : normalizedDraft;\n\t\t\t\tif (entryFailure !== void 0) return entryFailure;"
277
+ },
278
+ {
279
+ "before": "if (props.credentialOnly !== true) {\n\t\t\t\t\tconst failure = validateModels",
280
+ "after": "if (props.credentialOnly !== true && !multiKey) {\n\t\t\t\t\tconst failure = validateModels"
281
+ },
282
+ {
283
+ "before": "\t\t\t\tif (keyValue.length > 0) {\n\t\t\t\t\tconst stored = await operations.storeCredential(keyRef, keyValue);",
284
+ "after": "\t\t\t\tif (multiKey) return storeMultiKeyDrafts(operations, next.keyEntries, entryKeyDrafts, setEntryKeyDrafts);\n\t\t\t\tif (keyValue.length > 0) {\n\t\t\t\t\tconst stored = await operations.storeCredential(keyRef, keyValue);"
285
+ },
286
+ {
287
+ "before": "const apply = async () => {\n\t\t\t\tsetBusy(true);",
288
+ "after": "const apply = async () => {\n\t\t\t\tif (saving.current || props.readOnly || listBusy || entryFailure !== void 0) return;\n\t\t\t\tsaving.current = true;\n\t\t\t\tsetBusy(true);"
289
+ },
290
+ {
291
+ "before": "props.onClose(true);\n\t\t\t\t} finally {\n\t\t\t\t\tsetBusy(false);\n\t\t\t\t}\n\t\t\t};\n\t\t\tif (node === void 0)",
292
+ "after": "props.onClose(true);\n\t\t\t\t} catch {\n\t\t\t\t\tsetFailure(t(\"multiKeySaveFailed\"));\n\t\t\t\t} finally {\n\t\t\t\t\tsaving.current = false;\n\t\t\t\t\tsetBusy(false);\n\t\t\t\t}\n\t\t\t};\n\t\t\tif (node === void 0)"
293
+ },
294
+ {
295
+ "before": "return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [keylessNativeAuth ? null :",
296
+ "after": "return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [supportsMultiKey ? (0, react_jsx_runtime.jsx)(MultiKeyToggle, {\n\t\t\t\t\tt, checked: multiKey, disabled: disabled || listBusy, hasUnsavedKeys: hasMultiKeyDrafts(entryKeyDrafts),\n\t\t\t\t\tonChange: (enabled) => {\n\t\t\t\t\t\tlet updated = schema.setPath(draft, [\"multiKey\"], enabled);\n\t\t\t\t\t\tif (enabled && Object.keys(keyEntries).length === 0) {\n\t\t\t\t\t\t\tconst namedRef = stringAt(draft, \"apiKeyEnv\") ?? stringAt(fallback, \"apiKeyEnv\");\n\t\t\t\t\t\t\tconst [id, entry] = newMultiKeyEntry(props.provider, {\n\t\t\t\t\t\t\t\tname: stringAt(draft, \"displayName\") ?? stringAt(fallback, \"displayName\") ?? props.displayName ?? props.provider,\n\t\t\t\t\t\t\t\tapiKeyEnv: namedRef,\n\t\t\t\t\t\t\t\tmodels: draft.models ?? fallback?.models ?? inheritedModels()\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif (keyDraft.length > 0) {\n\t\t\t\t\t\t\t\tsetEntryKeyDrafts({ [id]: keyDraft });\n\t\t\t\t\t\t\t\tif (namedRef === void 0) updated = schema.setPath(updated, [\"apiKeyEnv\"], multiKeyRef(props.provider, id));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tupdated = schema.setPath(updated, [\"keyEntries\"], { [id]: entry });\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetDraft(updated);\n\t\t\t\t\t}\n\t\t\t\t}) : null, multiKey ? (0, react_jsx_runtime.jsx)(MultiKeyEntriesEditor, {\n\t\t\t\t\troute: props.provider, entries: keyEntries,\n\t\t\t\t\tonChange: (entries) => setDraft((current) => schema.setPath(current, [\"keyEntries\"], entries)),\n\t\t\t\t\tkeyDrafts: entryKeyDrafts, onKeyDraftsChange: setEntryKeyDrafts,\n\t\t\t\t\tconfirmations: entryConfirmations, onConfirmationsChange: setEntryConfirmations,\n\t\t\t\t\tpersistedEntries: schema.getPath(committedOriginal, [\"keyEntries\"]) ?? fallback?.keyEntries ?? {},\n\t\t\t\t\tcredentialChecks: props.credentialChecks,\n\t\t\t\t\tprobe: { settingsNs: namespace.ns, provider: props.provider, ...(probeBaseURL === void 0 ? {} : { baseURL: probeBaseURL }), ...(probeApi === void 0 ? {} : { api: probeApi }) },\n\t\t\t\t\treasoningLevels, operations, t, disabled: disabled || listBusy, onBusyChange: setListBusy\n\t\t\t\t}) : null, multiKey || keylessNativeAuth ? null :"
297
+ },
298
+ {
299
+ "before": "family === \"deepseek\" ? (0, react_jsx_runtime.jsx)(DeepSeekModelsEditor, {",
300
+ "after": "multiKey ? null : family === \"deepseek\" ? (0, react_jsx_runtime.jsx)(DeepSeekModelsEditor, {"
301
+ },
302
+ {
303
+ "before": "\t\t\t\t\tfailure !== void 0 ? (0, react_jsx_runtime.jsx)(\"p\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"error\"],\n\t\t\t\t\t\tchildren: failure\n\t\t\t\t\t}) : null,\n\t\t\t\t\tprops.credentialOnly",
304
+ "after": "\t\t\t\t\t(failure ?? entryFailure) !== void 0 ? (0, react_jsx_runtime.jsx)(\"p\", {\n\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"error\"],\n\t\t\t\t\t\tchildren: failure ?? entryFailure\n\t\t\t\t\t}) : null,\n\t\t\t\t\tprops.credentialOnly"
305
+ },
306
+ {
307
+ "before": "submitDisabled: disabled || layout === \"unknown\" || props.credentialOnly !== true && modelFailure !== void 0 || shownKeyFailure !== void 0 || props.credentialRequired === true && keyValue.length === 0,",
308
+ "after": "submitDisabled: disabled || listBusy || layout === \"unknown\" || entryFailure !== void 0 || props.credentialOnly !== true && modelFailure !== void 0 || !multiKey && (shownKeyFailure !== void 0 || props.credentialRequired === true && keyValue.length === 0),"
309
+ },
310
+ {
311
+ "before": "return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [supportsMultiKey ? (0, react_jsx_runtime.jsx)(MultiKeyToggle, {",
312
+ "after": "const credentials = (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [supportsMultiKey ? (0, react_jsx_runtime.jsx)(MultiKeyToggle, {"
313
+ },
314
+ {
315
+ "before": "\t\t\t\t}), props.credentialOnly === true ? null : (0, react_jsx_runtime.jsxs)(\"details\", {\n\t\t\t\t\tclassName: ModelsSection_module_css_default[\"customized\"],",
316
+ "after": "\t\t\t\t})] });\n\t\t\t\tconst customization = props.credentialOnly === true ? null : (0, react_jsx_runtime.jsxs)(\"details\", {\n\t\t\t\t\tclassName: ModelsSection_module_css_default[\"customized\"],\n\t\t\t\t\topen: supportsMultiKey ? true : void 0,\n\t\t\t\t\t\"data-multi-key-shared-settings\": supportsMultiKey ? true : void 0,"
317
+ },
318
+ {
319
+ "before": "children: t(\"customized\")\n\t\t\t\t\t}), (0, react_jsx_runtime.jsxs)(\"div\", {",
320
+ "after": "children: t(supportsMultiKey ? \"multiKeySharedSettings\" : \"customized\")\n\t\t\t\t\t}), (0, react_jsx_runtime.jsxs)(\"div\", {"
321
+ },
322
+ {
323
+ "before": "\t\t\t\t})] });\n\t\t\t};\n\t\t\treturn (0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\tclassName: props.credentialOnly",
324
+ "after": "\t\t\t\t});\n\t\t\t\treturn (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: supportsMultiKey ? [customization, credentials] : [credentials, customization] });\n\t\t\t};\n\t\t\treturn (0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\tclassName: props.credentialOnly"
325
+ },
326
+ {
327
+ "before": "\t\tconst en = {",
328
+ "after": "\t\tconst en = {\n\t\t\tmultiKey: \"Multiple key configurations\",\n\t\t\tmultiKeyHelp: \"Configurations share one provider ID, endpoint and protocol; each has its own name, API key and models. Turning this off restores the original single-key configuration without deleting entries or credentials.\",\n\t\t\tmultiKeySharedSettings: \"Shared settings\",\n\t\t\tmultiKeyAdd: \"Add key configuration\",\n\t\t\tmultiKeyRemove: \"Remove\",\n\t\t\tmultiKeyEntryName: \"Configuration name\",\n\t\t\tmultiKeyDefaultName: \"Key configuration\",\n\t\t\tmultiKeyDisableTitle: \"Turn off multiple key configurations?\",\n\t\t\tmultiKeyDisableDescription: \"After applying, this provider will use its original single-key configuration. Saved configurations and credentials will not be deleted. Sessions using a key configuration will need you to re-enable it or select a single-key model; no other key will be chosen automatically.\",\n\t\t\tmultiKeyKeepEnabled: \"Keep enabled\",\n\t\t\tmultiKeyDisableConfirm: \"Turn off in draft\",\n\t\t\tmultiKeyUnsavedTitle: \"Save the API keys before turning this off\",\n\t\t\tmultiKeyUnsavedKeys: \"Some API keys have been typed but not saved. Turning this off and applying would not store those inputs, so the switch will stay on. Return to the configurations and apply to save them, then reopen this card to turn it off. Nothing has been deleted.\",\n\t\t\tmultiKeyReturnToEdit: \"Return to configurations\",\n\t\t\tmultiKeyRef: \"Credential reference: {ref}\",\n\t\t\tmultiKeySaved: \"Saved reference; credential status not checked. Leave the key blank to keep it.\",\n\t\t\tmultiKeyNew: \"Not saved yet. An empty key does not create a credential.\",\n\t\t\tmultiKeyConfigured: \"Credential confirmed configured; leave blank to keep it.\",\n\t\t\tmultiKeyMissing: \"Credential confirmed missing. Enter a key or configure this reference.\",\n\t\t\tmultiKeyKeepCredentials: \"Removing a key configuration does not delete its stored credential.\",\n\t\t\tmultiKeyNeedsEntries: \"Add at least one key configuration.\",\n\t\t\tmultiKeyInvalidId: \"Invalid key-configuration ID; reopen this card or fix the profile.\",\n\t\t\tmultiKeyInvalidName: \"Each key configuration needs a name of 1–120 characters.\",\n\t\t\tmultiKeyInvalidRef: \"Invalid credential reference.\",\n\t\t\tmultiKeyDuplicateRef: \"Two configurations use the same credential reference. Each configuration must have its own reference.\",\n\t\t\tmultiKeyNeedsModels: \"Each key configuration needs at least one model.\",\n\t\t\tmultiKeyReplaceConfirm: \"Replace the key at {ref}. Other configurations sharing this reference will also be affected.\",\n\t\t\tmultiKeyConfirmRequired: \"Confirm the credential replacement before applying.\",\n\t\t\tmultiKeyProbeNeedsKey: \"Enter this configuration’s API key to discover models before saving. The provider’s original key will not be used.\",\n\t\t\tmultiKeySaveFailed: \"Saving did not complete. Keep this card open and retry; successful credential writes will not be repeated.\","
329
+ },
330
+ {
331
+ "before": "\t\tconst zh = {",
332
+ "after": "\t\tconst zh = {\n\t\t\tmultiKey: \"多密钥配置\",\n\t\t\tmultiKeyHelp: \"各配置共享 Provider ID、API 地址与协议,分别管理名称、API 密钥和模型。关闭后恢复原单密钥配置,已保存的配置与密钥不会删除。\",\n\t\t\tmultiKeySharedSettings: \"公共设置\",\n\t\t\tmultiKeyAdd: \"添加密钥配置\",\n\t\t\tmultiKeyRemove: \"移除\",\n\t\t\tmultiKeyEntryName: \"配置名称\",\n\t\t\tmultiKeyDefaultName: \"密钥配置\",\n\t\t\tmultiKeyDisableTitle: \"关闭多密钥配置?\",\n\t\t\tmultiKeyDisableDescription: \"应用后,此供应商将使用原单密钥配置,已保存的密钥配置与凭据不会删除。正在使用密钥配置的会话需要重新开启,或手动选择单密钥模型;不会自动换用其他密钥。\",\n\t\t\tmultiKeyKeepEnabled: \"保持开启\",\n\t\t\tmultiKeyDisableConfirm: \"确认关闭(待应用)\",\n\t\t\tmultiKeyUnsavedTitle: \"请先保存新输入的密钥\",\n\t\t\tmultiKeyUnsavedKeys: \"当前有尚未保存的 API 密钥输入。关闭后直接应用不会保存这些输入,因此开关将保持开启。请返回密钥配置并应用保存,再重新打开此卡片关闭;当前输入与已存储的密钥均未删除。\",\n\t\t\tmultiKeyReturnToEdit: \"返回密钥配置\",\n\t\t\tmultiKeyRef: \"密钥引用:{ref}\",\n\t\t\tmultiKeySaved: \"引用已保存,尚未检查密钥状态;输入留空可保留原密钥。\",\n\t\t\tmultiKeyNew: \"尚未保存;输入留空不会创建密钥。\",\n\t\t\tmultiKeyConfigured: \"已确认密钥已配置;留空可保留。\",\n\t\t\tmultiKeyMissing: \"已确认此引用缺少密钥,请输入或在环境中配置。\",\n\t\t\tmultiKeyKeepCredentials: \"移除密钥配置不会删除已存储的密钥。\",\n\t\t\tmultiKeyNeedsEntries: \"请至少添加一个密钥配置。\",\n\t\t\tmultiKeyInvalidId: \"密钥配置 ID 无效,请重新打开此卡片或修正配置。\",\n\t\t\tmultiKeyInvalidName: \"每个配置名称须为 1–120 个字符。\",\n\t\t\tmultiKeyInvalidRef: \"密钥引用无效。\",\n\t\t\tmultiKeyDuplicateRef: \"多个密钥配置使用了相同的密钥引用;每个配置必须使用独立引用。\",\n\t\t\tmultiKeyNeedsModels: \"每个密钥配置至少需要一个模型。\",\n\t\t\tmultiKeyReplaceConfirm: \"确认替换 {ref} 的密钥;共用此引用的其他配置也会受到影响。\",\n\t\t\tmultiKeyConfirmRequired: \"请先确认替换已引用的密钥,再应用。\",\n\t\t\tmultiKeyProbeNeedsKey: \"保存前请先输入此配置的 API 密钥再获取模型;不会使用供应商原来的密钥。\",\n\t\t\tmultiKeySaveFailed: \"保存尚未完成。请保留此卡片并重试;已成功写入的密钥不会重复写入。\","
333
+ }
334
+ ]
147
335
  }
148
336
  ]
149
337
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-model-groups",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "DSH 网页模型选择器:供应商与密钥配置分层折叠、多密钥手动选择。支持 DSH 0.2.2-rc.1。",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -28,6 +28,7 @@
28
28
  "lib",
29
29
  "native/*.patch.json",
30
30
  "scripts",
31
+ "!scripts/settings-models-collapse.mjs",
31
32
  "cordis.patch.yml",
32
33
  "README.md",
33
34
  "LICENSE"
@@ -45,7 +46,8 @@
45
46
  "inject": [
46
47
  "@deepseek-ai/dsh-client-ui-model-selection",
47
48
  "@deepseek-ai/dsh-client-ui-renderer",
48
- "@deepseek-ai/dsh-client-ui-settings-models"
49
+ "@deepseek-ai/dsh-client-ui-settings-models",
50
+ "@deepseek-ai/dsh-client-ui-settings"
49
51
  ],
50
52
  "external": [
51
53
  "react",
@@ -61,6 +63,7 @@
61
63
  "test": "node --test test/*.test.mjs",
62
64
  "test:ui": "node --test test/picker-ui.test.mjs",
63
65
  "native:check": "node scripts/native-patches.mjs --check",
66
+ "doctor": "node scripts/doctor.mjs",
64
67
  "prepack": "npm run build && npm run check:build"
65
68
  }
66
69
  }
package/scripts/build.mjs CHANGED
@@ -8,7 +8,11 @@ const withoutExports = source => source.replace(/^export /gm, '');
8
8
  // Styles belong to the mounted plugin, not to module materialization: a
9
9
  // disposal removes them and a re-applied (memoized) module must restore them.
10
10
  const styles = `\nconst MODEL_GROUPS_CSS = ${JSON.stringify(read('src/groups.css'))};\nfunction installModelGroupsStyles() {\n const tagId = 'dsh-model-groups/groups.css';\n if (document.querySelector('style[data-plugin-css="' + tagId + '"]') !== null) return;\n const style = document.createElement('style');\n style.dataset.plugin = 'dsh-model-groups';\n style.dataset.pluginCss = tagId;\n style.textContent = MODEL_GROUPS_CSS;\n document.head.appendChild(style);\n}\n`;
11
- const source = `// Generated by scripts/build.mjs; edit src instead.\nwindow.__ModuleLoader__.load({\n id: 'dsh-model-groups',\n factory(require) {\n const react = require('react');\n const react_dom = require('react-dom');\n const react_jsx_runtime = require('react/jsx-runtime');\n const _deepseek_ai_dsh_client_ui_primitives = require('@deepseek-ai/dsh-client-ui-primitives');\n${withoutExports(read('src/group-state.js'))}\n${withoutExports(read('src/hierarchy.js')).replace(/^import .*;\n/gm, '')}\n${read('src/model-select.js')}\n${withoutExports(read('src/fallback.js'))}\n${styles}\n${withoutExports(read('src/client.js'))}\n return { apply, inject };\n },\n});\n`;
11
+ const settingsStyles = styleInstaller('SETTINGS_PAGE_CSS', 'installSettingsPageStyles', 'src/settings-page.css', 'dsh-model-groups/settings-page.css');
12
+ function styleInstaller(constant, installer, file, tagId) {
13
+ return `\nconst ${constant} = ${JSON.stringify(read(file))};\nfunction ${installer}() {\n const tagId = ${JSON.stringify(tagId)};\n if (document.querySelector('style[data-plugin-css="' + tagId + '"]') !== null) return;\n const style = document.createElement('style');\n style.dataset.plugin = 'dsh-model-groups';\n style.dataset.pluginCss = tagId;\n style.textContent = ${constant};\n document.head.appendChild(style);\n}\n`;
14
+ }
15
+ const source = `// Generated by scripts/build.mjs; edit src instead.\nwindow.__ModuleLoader__.load({\n id: 'dsh-model-groups',\n factory(require) {\n const react = require('react');\n const react_dom = require('react-dom');\n const react_jsx_runtime = require('react/jsx-runtime');\n const _deepseek_ai_dsh_client_ui_primitives = require('@deepseek-ai/dsh-client-ui-primitives');\n${withoutExports(read('src/group-state.js'))}\n${withoutExports(read('src/hierarchy.js')).replace(/^import .*;\n/gm, '')}\n${read('src/model-select.js')}\n${withoutExports(read('src/fallback.js'))}\n${styles}\n${settingsStyles}\n${withoutExports(read('src/maintenance-state.js'))}\n${withoutExports(read('src/settings-page.js'))}\n${withoutExports(read('src/client.js'))}\n return { apply, inject };\n },\n});\n`;
12
16
  const target = path.join(root, 'lib/client.js');
13
17
  // Compile the classic-script bundle before writing anything.
14
18
  new Function(source);
@@ -0,0 +1,39 @@
1
+ import fs from 'node:fs';
2
+ import { fileURLToPath } from 'node:url';
3
+ import { planPatches } from './native-patches.mjs';
4
+
5
+ const args = process.argv.slice(2);
6
+ if (args.includes('--help')) {
7
+ console.log('Usage: node scripts/doctor.mjs --dsh-root <DSH installation directory> [--json]\nRead-only installation check. Does not read credentials or change DSH.');
8
+ } else {
9
+ try {
10
+ const i = args.indexOf('--dsh-root');
11
+ if (i < 0 || !args[i + 1] || args.some((arg, index) => index !== i + 1 && !['--dsh-root', '--json'].includes(arg))) {
12
+ throw new Error('请用 --dsh-root 指定正在使用的 DSH 安装目录。');
13
+ }
14
+ const pkg = JSON.parse(fs.readFileSync(fileURLToPath(new URL('../package.json', import.meta.url)), 'utf8'));
15
+ const plans = planPatches(args[i + 1], 'check');
16
+ const missing = plans.filter(plan => plan.state !== 'patched');
17
+ const report = {
18
+ plugin: pkg.name,
19
+ version: pkg.version,
20
+ supportedDsh: pkg.engines.dsh,
21
+ diskPatchesReady: missing.length === 0,
22
+ runtimeVerified: false,
23
+ files: plans.map(plan => ({ target: plan.artifact.target, state: plan.state })),
24
+ next: missing.length > 0
25
+ ? '多密钥安装尚未完成:需要按 README 应用尚未安装的兼容补丁,再重启原 DSH 服务并刷新网页。'
26
+ : '磁盘补丁齐全。请确认原 DSH 服务已在应用补丁后重启,并刷新网页;本检查不能确认运行中的模块或浏览器缓存。',
27
+ };
28
+ if (args.includes('--json')) console.log(JSON.stringify(report, null, 2));
29
+ else {
30
+ console.log(`${report.plugin} ${report.version} · DSH ${report.supportedDsh}`);
31
+ for (const item of report.files) console.log(`${item.state}: ${item.target}`);
32
+ console.log(report.next);
33
+ }
34
+ if (missing.length) process.exitCode = 2;
35
+ } catch (error) {
36
+ console.error(`无法确认多密钥安装状态:${error.message}`);
37
+ process.exitCode = 1;
38
+ }
39
+ }