dsh-model-groups 0.3.9 → 0.3.10

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": "2fac0f7bf6f7affa2cdfd10a8a57c6d14166207e5f376f69bb4a46cb2a2a66ab",
6
+ "resultSha256": "18b5137d945d4a4886805ea6e5d96f98f094dee8a242b3c9aeee900e58dbbe31",
7
7
  "replacements": [
8
8
  {
9
9
  "before": "\t\t//#region lib/types/client/CustomProviderCard.js",
@@ -268,6 +268,30 @@
268
268
  {
269
269
  "before": "const zh = {\n",
270
270
  "after": "const zh = {\n\t\t\tmultiKeyReorder: \"调整密钥分组顺序\",\n\t\t\tmultiKeyReorderHelp: \"长按手柄拖动,或用上下方向键调整;与其他改动一起保存。\",\n\t\t\tmodelReorderTouchHelp: \"长按手柄拖动,或用上下方向键调整;与其他改动一起保存。\",\n"
271
+ },
272
+ {
273
+ "before": "const MULTI_KEY_PROTOCOLS =",
274
+ "after": "function applyModelCapabilities(model, defaults) {\n const object = value => value !== null && typeof value === 'object' && !Array.isArray(value);\n const overrides = model.capabilityOverrides;\n if (defaults !== undefined && (!object(defaults) || Object.keys(defaults).some(key => key !== 'vision' && key !== 'reasoning') || typeof defaults.vision !== 'boolean' || typeof defaults.reasoning !== 'boolean')) {\n throw new TypeError('capabilityDefaults must contain only boolean vision and reasoning');\n }\n if (overrides !== undefined && (!object(overrides) || Object.keys(overrides).some(key => key !== 'vision' && key !== 'reasoning') || Object.values(overrides).some(value => typeof value !== 'boolean' && value !== 'original'))) {\n throw new TypeError('capabilityOverrides must contain only boolean or original vision and reasoning');\n }\n const { capabilityOverrides: ignored, ...effective } = model;\n if (defaults === undefined) return effective;\n const choice = key => overrides?.[key] === 'original' ? undefined : overrides?.[key] ?? defaults[key];\n const vision = choice('vision');\n if (vision !== undefined) {\n const input = Array.isArray(model.input) ? [...model.input] : ['text'];\n effective.input = [...new Set(input.filter(value => vision || value !== 'image'))];\n if (effective.input.length === 0) effective.input.push('text');\n if (vision && !effective.input.includes('image')) effective.input.push('image');\n }\n const reasoning = choice('reasoning');\n if (reasoning === false) effective.reasoningEfforts = false;\n if (reasoning === true) {\n const levels = ['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'];\n const efforts = model.reasoningEfforts;\n const valid = object(efforts) && Object.keys(efforts).every(key => levels.includes(key)) && Object.entries(efforts).every(([key, value]) => key === 'off' && value === null || typeof value === 'string' && value.length > 0) && Object.keys(efforts).some(key => key !== 'off');\n effective.reasoningEfforts = valid ? { ...efforts } : { off: null, low: 'low', medium: 'medium', high: 'high' };\n }\n return effective;\n}\nfunction validateCapabilityBatch(batch) {\n if (batch !== undefined && (batch === null || typeof batch !== 'object' || Array.isArray(batch) || Object.keys(batch).some(key => key !== 'vision' && key !== 'reasoning') || Object.values(batch).some(value => typeof value !== 'boolean'))) {\n throw new TypeError('capabilityBatch must contain only boolean vision and reasoning');\n }\n return batch;\n}\nfunction applyModelBatchCapabilities(model, batch) {\n validateCapabilityBatch(batch);\n const original = applyModelCapabilities(model);\n if (batch === undefined || Object.keys(batch).length === 0) return original;\n return applyModelCapabilities({ ...original, capabilityOverrides: {\n ...(batch.vision === undefined ? { vision: 'original' } : {}),\n ...(batch.reasoning === undefined ? { reasoning: 'original' } : {}),\n } }, { vision: batch.vision ?? false, reasoning: batch.reasoning ?? false });\n}\nfunction materializeCapabilityEntry(entry) {\n validateCapabilityBatch(entry.capabilityBatch);\n const { capabilityDefaults, ...rest } = entry;\n applyModelCapabilities({}, capabilityDefaults);\n const models = (Array.isArray(entry.models) ? entry.models : []).map(model => applyModelCapabilities(model, capabilityDefaults));\n const capabilityBatch = capabilityDefaults === undefined ? entry.capabilityBatch : { ...capabilityDefaults, ...entry.capabilityBatch };\n return { ...rest, models, ...(capabilityBatch === undefined ? {} : { capabilityBatch }) };\n}\nfunction applyCapabilityBatch(entry, key, enabled) {\n if (!['vision', 'reasoning'].includes(key) || typeof enabled !== 'boolean') throw new TypeError('capability batch needs vision/reasoning and a boolean');\n const migrated = materializeCapabilityEntry(entry);\n return { ...migrated, capabilityBatch: { ...migrated.capabilityBatch, [key]: enabled }, models: migrated.models.map(model => applyModelBatchCapabilities(model, { [key]: enabled })) };\n}\nfunction mergeCapabilityModels(entry, incoming) {\n const migrated = materializeCapabilityEntry(entry);\n const rows = new Map();\n for (const model of migrated.models) {\n if (!rows.has(model.id)) rows.set(model.id, []);\n rows.get(model.id).push(model);\n }\n const grows = incoming.length > migrated.models.length;\n return { ...migrated, models: incoming.map(model => {\n const previous = rows.get(model.id)?.shift();\n const nativeOff = migrated.capabilityBatch?.reasoning !== undefined && previous?.reasoningEfforts !== null && typeof previous?.reasoningEfforts === 'object' && !Array.isArray(previous.reasoningEfforts) && model.reasoningEfforts === undefined;\n const edited = nativeOff ? { ...model, reasoningEfforts: false } : model;\n return !grows || previous !== undefined ? applyModelCapabilities(edited) : applyModelBatchCapabilities(edited, migrated.capabilityBatch);\n }) };\n}\nfunction GroupCapabilityBatch({ entry, onChange, disabled, t }) {\n const migrated = materializeCapabilityEntry(entry);\n const jsx = react_jsx_runtime.jsx, jsxs = react_jsx_runtime.jsxs;\n const css = ModelsSection_module_css_default;\n return jsxs('div', { 'data-group-capabilities': true, className: css.field, children: ['vision', 'reasoning'].map(key => jsxs('div', {\n className: css.modelReasoningHead,\n children: [jsx('span', { className: css.fieldLabel, children: t(key === 'vision' ? 'capabilityVision' : 'capabilityReasoning') }), jsx(_deepseek_ai_dsh_client_ui_primitives.Switch, {\n 'data-capability-batch': key, label: t(key === 'vision' ? 'capabilityVision' : 'capabilityReasoning'), checked: migrated.capabilityBatch?.[key] === true, disabled,\n onChange: enabled => { if (!disabled && typeof enabled === 'boolean') onChange(applyCapabilityBatch(entry, key, enabled)); }\n })]\n }, key)) });\n}\n\t\tconst MULTI_KEY_PROTOCOLS ="
275
+ },
276
+ {
277
+ "before": "JSON.stringify(entry) !== JSON.stringify(saved)",
278
+ "after": "JSON.stringify(materializeCapabilityEntry(entry)) !== JSON.stringify(materializeCapabilityEntry(saved))"
279
+ },
280
+ {
281
+ "before": "return Object.fromEntries(orderedKeyEntries(entries).map(([id, entry]) => {",
282
+ "after": "return Object.fromEntries(orderedKeyEntries(entries).map(([id, rawEntry]) => {\n\t\t\t\tconst entry = materializeCapabilityEntry(rawEntry);"
283
+ },
284
+ {
285
+ "before": "(0, react_jsx_runtime.jsx)(ModelListEditor, {\n\t\t\t\t\t\t\t\tmodels: modelDrafts(entry.models), onChange: (models) => update(id, { models }),",
286
+ "after": "(0, react_jsx_runtime.jsx)(GroupCapabilityBatch, { entry, t, disabled: disabled || anyBusy, onChange: (next) => { if (!disabled && !anyBusy) onChange({ ...entries, [id]: next }); } }), (0, react_jsx_runtime.jsx)(ModelListEditor, {\n\t\t\t\t\t\t\t\tmodels: modelDrafts(materializeCapabilityEntry(entry).models), onChange: (models) => { if (!disabled && !anyBusy) onChange({ ...entries, [id]: mergeCapabilityModels(entry, models) }); },"
287
+ },
288
+ {
289
+ "before": "const en = {\n",
290
+ "after": "const en = {\n\t\t\tcapabilityVision: \"Image input\",\n\t\t\tcapabilityReasoning: \"Reasoning effort\",\n"
291
+ },
292
+ {
293
+ "before": "const zh = {\n",
294
+ "after": "const zh = {\n\t\t\tcapabilityVision: \"识图\",\n\t\t\tcapabilityReasoning: \"思考强度\",\n"
271
295
  }
272
296
  ],
273
297
  "current": true,
@@ -1083,6 +1107,594 @@
1083
1107
  "after": "const zh = {\n\t\t\tmultiKeyReorder: \"调整密钥分组顺序\",\n\t\t\tmultiKeyReorderHelp: \"长按手柄拖动,或用上下方向键调整;与其他改动一起保存。\",\n\t\t\tmodelReorderTouchHelp: \"长按手柄拖动,或用上下方向键调整;与其他改动一起保存。\",\n"
1084
1108
  }
1085
1109
  ]
1110
+ },
1111
+ {
1112
+ "baseSha256": "e111ecefea8262e0426f528864b9681d818068042e93d053bcb0b6884b317278",
1113
+ "resultSha256": "2fac0f7bf6f7affa2cdfd10a8a57c6d14166207e5f376f69bb4a46cb2a2a66ab",
1114
+ "replacements": [
1115
+ {
1116
+ "before": "\t\t//#region lib/types/client/CustomProviderCard.js",
1117
+ "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"
1118
+ },
1119
+ {
1120
+ "before": "\t\t\t\t\t...probe.provider === void 0 ? {} : { provider: probe.provider },",
1121
+ "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 },"
1122
+ },
1123
+ {
1124
+ "before": "const { taken, protocols, reasoningLevels, operations, t, onBusyChange } = props;",
1125
+ "after": "const { taken, protocols, reasoningLevels, operations, t, onBusyChange } = props;\n\t\t\tconst supportsMultiKey = supportsMultiKeySchema(props.namespace, props.schema, [\"providers\", PROBE_ROUTE]);"
1126
+ },
1127
+ {
1128
+ "before": "const [models, setModels] = (0, react.useState)([]);\n\t\t\tconst [busy, setBusy]",
1129
+ "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]"
1130
+ },
1131
+ {
1132
+ "before": "const modelFailure = validateDeepSeekModels(models) ?? validateReasoningEfforts(models);\n\t\t\tconst keyFailure = apiKeyFailure(keyDraft);",
1133
+ "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);"
1134
+ },
1135
+ {
1136
+ "before": "const ready = route.length > 0 && !routeInvalid && !routeTaken && normalizedBaseURL.length > 0 && !baseUrlInvalid && models.length > 0 && modelFailure === void 0 && keyFailure === void 0;",
1137
+ "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);"
1138
+ },
1139
+ {
1140
+ "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\");",
1141
+ "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\"));"
1142
+ },
1143
+ {
1144
+ "before": "const keyRef = deriveKeyRef(route);\n\t\t\t\tconst storesKey = keyValue.length > 0;",
1145
+ "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;"
1146
+ },
1147
+ {
1148
+ "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 }))",
1149
+ "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 } : {})"
1150
+ },
1151
+ {
1152
+ "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};",
1153
+ "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};"
1154
+ },
1155
+ {
1156
+ "before": "const create = async () => {\n\t\t\t\tsetBusy(true);",
1157
+ "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);"
1158
+ },
1159
+ {
1160
+ "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\", {",
1161
+ "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\", {"
1162
+ },
1163
+ {
1164
+ "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\")",
1165
+ "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\")"
1166
+ },
1167
+ {
1168
+ "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,",
1169
+ "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,"
1170
+ },
1171
+ {
1172
+ "before": "\t\t\t\t\t\tonBusyChange: setListBusy\n\t\t\t\t\t}),\n\t\t\t\t\tfailure !== void 0",
1173
+ "after": "\t\t\t\t\t\tonBusyChange: setListBusy\n\t\t\t\t\t}) : null,\n\t\t\t\t\tfailure !== void 0"
1174
+ },
1175
+ {
1176
+ "before": "submitDisabled: disabled || !ready,",
1177
+ "after": "submitDisabled: disabled || listBusy || !ready,"
1178
+ },
1179
+ {
1180
+ "before": "taken: state.rows.map((row) => row.entry.provider),\n\t\t\t\t\t\t\t\t\t\tprotocols,",
1181
+ "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,"
1182
+ },
1183
+ {
1184
+ "before": "const [draft, setDraft] = (0, react.useState)(() => draftAt(schema, namespace, settingsPath));",
1185
+ "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);"
1186
+ },
1187
+ {
1188
+ "before": "const keyRef = refFor(schema, namespace, settingsPath, props.provider);",
1189
+ "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;"
1190
+ },
1191
+ {
1192
+ "before": "const modelFailure = validateModels(schema.getPath(draft, [\"models\"]));\n\t\t\tconst keyFailure = apiKeyFailure(keyDraft);",
1193
+ "after": "const modelFailure = multiKey ? void 0 : validateModels(schema.getPath(draft, [\"models\"]));\n\t\t\tconst keyFailure = multiKey ? void 0 : apiKeyFailure(keyDraft);"
1194
+ },
1195
+ {
1196
+ "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;",
1197
+ "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;"
1198
+ },
1199
+ {
1200
+ "before": "if (props.credentialOnly !== true) {\n\t\t\t\t\tconst failure = validateModels",
1201
+ "after": "if (props.credentialOnly !== true && !multiKey) {\n\t\t\t\t\tconst failure = validateModels"
1202
+ },
1203
+ {
1204
+ "before": "\t\t\t\tif (keyValue.length > 0) {\n\t\t\t\t\tconst stored = await operations.storeCredential(keyRef, keyValue);",
1205
+ "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);"
1206
+ },
1207
+ {
1208
+ "before": "const apply = async () => {\n\t\t\t\tsetBusy(true);",
1209
+ "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);"
1210
+ },
1211
+ {
1212
+ "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)",
1213
+ "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)"
1214
+ },
1215
+ {
1216
+ "before": "return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [keylessNativeAuth ? null :",
1217
+ "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 :"
1218
+ },
1219
+ {
1220
+ "before": "family === \"deepseek\" ? (0, react_jsx_runtime.jsx)(DeepSeekModelsEditor, {",
1221
+ "after": "multiKey ? null : family === \"deepseek\" ? (0, react_jsx_runtime.jsx)(DeepSeekModelsEditor, {"
1222
+ },
1223
+ {
1224
+ "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",
1225
+ "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"
1226
+ },
1227
+ {
1228
+ "before": "submitDisabled: disabled || layout === \"unknown\" || props.credentialOnly !== true && modelFailure !== void 0 || shownKeyFailure !== void 0 || props.credentialRequired === true && keyValue.length === 0,",
1229
+ "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),"
1230
+ },
1231
+ {
1232
+ "before": "return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [supportsMultiKey ? (0, react_jsx_runtime.jsx)(MultiKeyToggle, {",
1233
+ "after": "const credentials = (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [supportsMultiKey ? (0, react_jsx_runtime.jsx)(MultiKeyToggle, {"
1234
+ },
1235
+ {
1236
+ "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\"],",
1237
+ "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,"
1238
+ },
1239
+ {
1240
+ "before": "children: t(\"customized\")\n\t\t\t\t\t}), (0, react_jsx_runtime.jsxs)(\"div\", {",
1241
+ "after": "children: t(supportsMultiKey ? \"multiKeySharedSettings\" : \"customized\")\n\t\t\t\t\t}), (0, react_jsx_runtime.jsxs)(\"div\", {"
1242
+ },
1243
+ {
1244
+ "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",
1245
+ "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"
1246
+ },
1247
+ {
1248
+ "before": "\t\tconst en = {",
1249
+ "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.\","
1250
+ },
1251
+ {
1252
+ "before": "\t\tconst zh = {",
1253
+ "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: \"保存尚未完成。请保留此卡片并重试;已成功写入的密钥不会重复写入。\","
1254
+ },
1255
+ {
1256
+ "before": "const MULTI_KEY_ENTRY_ID =",
1257
+ "after": "const MULTI_KEY_PROTOCOLS = new Set([\"openai-completions\", \"openai-responses\", \"anthropic-messages\"]);\n\t\tconst MULTI_KEY_ENTRY_ID ="
1258
+ },
1259
+ {
1260
+ "before": "name: source.name ?? \"\",",
1261
+ "after": "name: source.name ?? \"\",\n\t\t\t\t...(source.api === void 0 ? {} : { api: source.api }),"
1262
+ },
1263
+ {
1264
+ "before": "return 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}]));",
1265
+ "after": "return Object.fromEntries(Object.entries(entries).map(([id, entry]) => {\n\t\t\t\tconst { api, ...rest } = entry;\n\t\t\t\treturn [id, {\n\t\t\t\t\t...rest,\n\t\t\t\t\t...(api === void 0 || api === \"\" ? {} : { api }),\n\t\t\t\t\tname: typeof entry?.name === \"string\" ? entry.name.trim() : \"\",\n\t\t\t\t\tapiKeyEnv: typeof entry?.apiKeyEnv === \"string\" && entry.apiKeyEnv.length > 0 ? entry.apiKeyEnv : multiKeyRef(route, id),\n\t\t\t\t\tmodels: modelDrafts(entry?.models).map((model) => structuredClone(model))\n\t\t\t\t}];\n\t\t\t}));"
1266
+ },
1267
+ {
1268
+ "before": "return t(\"multiKeyInvalidName\");\n\t\t\t\tconst ref = entry.apiKeyEnv ?? multiKeyRef(route, id);",
1269
+ "after": "return t(\"multiKeyInvalidName\");\n\t\t\t\tif (entry.api !== void 0 && !MULTI_KEY_PROTOCOLS.has(entry.api)) return t(\"multiKeyInvalidProtocol\");\n\t\t\t\tconst ref = entry.apiKeyEnv ?? multiKeyRef(route, id);"
1270
+ },
1271
+ {
1272
+ "before": "...(canUseStored ? { keyEntryId: id } : {}),",
1273
+ "after": "...(canUseStored ? { keyEntryId: id } : {}),\n\t\t\t\t\t\t...(entry.api === void 0 ? {} : { api: entry.api }),"
1274
+ },
1275
+ {
1276
+ "before": "\t\tfunction MultiKeyEntriesEditor(props) {",
1277
+ "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) {"
1278
+ },
1279
+ {
1280
+ "before": "const [busyEntries, setBusyEntries] = (0, react.useState)({});",
1281
+ "after": "const [busyEntries, setBusyEntries] = (0, react.useState)({});\n\t\t\tconst [expandedEntries, setExpandedEntries] = (0, react.useState)({});\n\t\t\tconst [removeTarget, setRemoveTarget] = (0, react.useState)(void 0);\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]);"
1282
+ },
1283
+ {
1284
+ "before": "const anyBusy = Object.values(busyEntries).some(Boolean);",
1285
+ "after": "const anyBusy = Object.values(busyEntries).some(Boolean);\n\t\t\t(0, react.useEffect)(() => {\n\t\t\t\tif (disabled || anyBusy || removeTarget !== void 0 && !Object.hasOwn(entries, removeTarget)) setRemoveTarget(void 0);\n\t\t\t}, [disabled, anyBusy, removeTarget, entries]);\n\t\t\tconst removeName = typeof entries[removeTarget]?.name === \"string\" && entries[removeTarget].name.trim() ? entries[removeTarget].name.trim() : t(\"multiKeyDefaultName\");"
1286
+ },
1287
+ {
1288
+ "before": "const remove = (id) => {",
1289
+ "after": "const remove = (id) => {\n\t\t\t\tif (disabled || anyBusy || !Object.hasOwn(entries, id)) return;"
1290
+ },
1291
+ {
1292
+ "before": "const heading = typeof entry.name === \"string\"",
1293
+ "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\""
1294
+ },
1295
+ {
1296
+ "before": "\"data-key-entry-id\": id, role: \"group\", \"aria-label\": heading,",
1297
+ "after": "\"data-key-entry-id\": id, \"data-key-entry-expanded\": expanded, \"data-key-entry-dirty\": dirty, role: \"group\", \"aria-label\": heading,"
1298
+ },
1299
+ {
1300
+ "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})]",
1301
+ "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}), (0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"rowActions\"],\n\t\t\t\t\t\t\t\tchildren: [dirty ? (0, react_jsx_runtime.jsx)(\"span\", { className: ModelsSection_module_css_default[\"rowTag\"], \"data-key-entry-unsaved\": true, children: t(\"multiKeyUnsaved\") }) : null,\n\t\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(\"button\", {\n\t\t\t\t\t\t\t\t\ttype: \"button\", className: ModelsSection_module_css_default[\"secondaryButton\"],\n\t\t\t\t\t\t\t\t\t\"aria-expanded\": expanded, \"aria-controls\": detailsId,\n\t\t\t\t\t\t\t\t\tonClick: () => setExpandedEntries((current) => ({ ...current, [id]: !expanded })),\n\t\t\t\t\t\t\t\t\tchildren: t(expanded ? \"multiKeyCollapse\" : \"multiKeyExpand\")\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)(\"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 ? \"flex\" : \"none\", flexDirection: \"column\", gap: 12, minWidth: 0, borderTop: \"0.5px solid var(--dsw-alias-settings-card-stroke)\", paddingTop: 12 },\n\t\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\t\t\t\"data-key-entry-fields\": true, style: { display: \"grid\", gridTemplateColumns: \"repeat(auto-fit, minmax(min(100%, 220px), 1fr))\", gap: 12, minWidth: 0 }, 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.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(\"multiKeyProtocol\") }),\n\t\t\t\t\t\t\t\t(0, react_jsx_runtime.jsxs)(\"select\", {\n\t\t\t\t\t\t\t\t\t\"data-key-entry-protocol\": id, \"aria-label\": t(\"multiKeyProtocol\") + \" \" + heading,\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\tstyle: { maxWidth: \"none\" }, value: entry.api ?? \"\", disabled: disabled || anyBusy,\n\t\t\t\t\t\t\t\t\tonChange: (event) => {\n\t\t\t\t\t\t\t\t\t\tconst value = event.target.value;\n\t\t\t\t\t\t\t\t\t\tif (disabled || anyBusy || value !== \"\" && !MULTI_KEY_PROTOCOLS.has(value)) return;\n\t\t\t\t\t\t\t\t\t\tconst { api, ...inherited } = entries[id];\n\t\t\t\t\t\t\t\t\t\tonChange({ ...entries, [id]: value === \"\" ? inherited : { ...inherited, api: value } });\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"option\", { value: \"\", children: t(\"multiKeyProtocolInherit\").replace(\"{protocol}\", () => props.probe.api ? protocolLabel(t, props.probe.api) : t(\"multiKeyProtocolDefault\")) }),\n\t\t\t\t\t\t\t\t\t...(props.protocols ?? [...MULTI_KEY_PROTOCOLS]).map((choice) => (0, react_jsx_runtime.jsx)(\"option\", { value: choice, children: protocolLabel(t, choice) }, choice))]\n\t\t\t\t\t\t\t\t}), (0, react_jsx_runtime.jsx)(\"span\", { className: ModelsSection_module_css_default[\"advancedHint\"], children: t(\"multiKeyProtocolHelp\") })]\n\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.jsxs)(\"div\", {\n\t\t\t\t\t\t\t\t\"data-key-entry-danger-zone\": true,\n\t\t\t\t\t\t\t\tstyle: { display: \"flex\", flexDirection: \"column\", gap: 6, borderTop: \"0.5px solid var(--dsw-alias-settings-card-stroke)\", paddingTop: 12 },\n\t\t\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"p\", { className: ModelsSection_module_css_default[\"advancedHint\"], children: t(\"multiKeyRemoveHelp\") }),\n\t\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(\"button\", {\n\t\t\t\t\t\t\t\t\ttype: \"button\", \"data-key-entry-remove\": id,\n\t\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"dangerButton\"], style: { alignSelf: \"flex-start\" }, disabled: disabled || anyBusy,\n\t\t\t\t\t\t\t\t\tonClick: () => { if (!disabled && !anyBusy) setRemoveTarget(id); }, children: t(\"multiKeyRemoveGroup\")\n\t\t\t\t\t\t\t\t})]\n\t\t\t\t\t\t\t})]\n\t\t\t\t\t\t})]"
1302
+ },
1303
+ {
1304
+ "before": "}), (0, react_jsx_runtime.jsx)(\"p\", { className: ModelsSection_module_css_default[\"advancedHint\"], children: t(\"multiKeyKeepCredentials\") })]",
1305
+ "after": "}), (0, react_jsx_runtime.jsx)(\"p\", { className: ModelsSection_module_css_default[\"advancedHint\"], children: t(\"multiKeyKeepCredentials\") }),\n\t\t\t\t(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {\n\t\t\t\t\topen: removeTarget !== void 0 && Object.hasOwn(entries, removeTarget) && !disabled && !anyBusy,\n\t\t\t\t\t\"data-key-entry-remove-dialog\": true, onClose: () => setRemoveTarget(void 0),\n\t\t\t\t\ttitle: t(\"multiKeyRemoveTitle\").replace(\"{name}\", () => removeName), closeLabel: t(\"close\"),\n\t\t\t\t\tdescription: t(\"multiKeyRemoveDescription\"), className: 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, { variant: \"outline\", \"data-modal-autofocus\": true, onClick: () => setRemoveTarget(void 0), children: t(\"cancel\") }),\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\", className: ModelsSection_module_css_default[\"deleteConfirm\"], disabled: disabled || anyBusy,\n\t\t\t\t\t\t\tonClick: () => { if (removeTarget === void 0 || disabled || anyBusy) return; remove(removeTarget); setRemoveTarget(void 0); }, children: t(\"multiKeyRemoveGroup\")\n\t\t\t\t\t\t})]\n\t\t\t\t\t})\n\t\t\t\t})]"
1306
+ },
1307
+ {
1308
+ "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}",
1309
+ "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, protocols, 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}"
1310
+ },
1311
+ {
1312
+ "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}",
1313
+ "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, protocols, 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}"
1314
+ },
1315
+ {
1316
+ "before": "className: ModelsSection_module_css_default[\"editorActions\"],",
1317
+ "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\" },"
1318
+ },
1319
+ {
1320
+ "before": "const en = {\n",
1321
+ "after": "const en = {\n\t\t\tmultiKeyExpand: \"Expand details\",\n\t\t\tmultiKeyCollapse: \"Collapse details\",\n\t\t\tmultiKeyUnsaved: \"Not saved\",\n\t\t\tmultiKeyProtocol: \"Group API protocol\",\n\t\t\tmultiKeyProtocolInherit: \"Inherit provider ({protocol})\",\n\t\t\tmultiKeyProtocolDefault: \"default protocol\",\n\t\t\tmultiKeyProtocolHelp: \"Only this key group is affected. Choose the protocol supported by your relay, not just the model name.\",\n\t\t\tmultiKeyInvalidProtocol: \"Unsupported key-group protocol.\",\n\t\t\tmultiKeyRemoveGroup: \"Remove this key group\",\n\t\t\tmultiKeyRemoveTitle: \"Remove key group “{name}”?\",\n\t\t\tmultiKeyRemoveHelp: \"Removes the entire key group and its model list, not just one model above. Stored credentials are retained.\",\n\t\t\tmultiKeyRemoveDescription: \"This removes the selected group and all of its model entries from the draft. Other groups and stored credentials are retained. Existing conversations are not switched automatically. Changes take effect after Apply; Cancel editing to discard them.\",\n"
1322
+ },
1323
+ {
1324
+ "before": "const zh = {\n",
1325
+ "after": "const zh = {\n\t\t\tmultiKeyExpand: \"展开详情\",\n\t\t\tmultiKeyCollapse: \"收起详情\",\n\t\t\tmultiKeyUnsaved: \"未保存\",\n\t\t\tmultiKeyProtocol: \"分组 API 协议\",\n\t\t\tmultiKeyProtocolInherit: \"跟随供应商({protocol})\",\n\t\t\tmultiKeyProtocolDefault: \"默认协议\",\n\t\t\tmultiKeyProtocolHelp: \"仅影响此密钥分组,请按中转站支持的协议选择,不按模型名称自动切换。\",\n\t\t\tmultiKeyInvalidProtocol: \"不支持此密钥分组协议。\",\n\t\t\tmultiKeyRemoveGroup: \"移除此密钥分组\",\n\t\t\tmultiKeyRemoveTitle: \"移除密钥分组“{name}”?\",\n\t\t\tmultiKeyRemoveHelp: \"移除整个密钥分组及其模型列表,不是仅移除上方一个模型。已保存的密钥凭据会保留。\",\n\t\t\tmultiKeyRemoveDescription: \"此操作从编辑草稿移除该分组及其全部模型条目,其他分组和已保存的密钥凭据不变,不会自动切换现有会话。点击“应用”后才生效;取消编辑可放弃更改。\",\n"
1326
+ },
1327
+ {
1328
+ "before": "const MULTI_KEY_ENTRY_ID =",
1329
+ "after": "function orderedKeyEntries(entries) {\n const rank = entry => Number.isSafeInteger(entry?.sortOrder) && entry.sortOrder >= 0 ? entry.sortOrder : Infinity;\n return Object.entries(entries ?? {}).sort(([, left], [, right]) => {\n const a = rank(left), b = rank(right);\n return a === b ? 0 : a < b ? -1 : 1;\n });\n}\n\t\tfunction createSettingsReorder({ handle, row, selector, commit, delay = 400 }) {\n const doc = handle.ownerDocument;\n const win = doc.defaultView;\n const list = row.parentElement;\n const rows = () => [...list.querySelectorAll(selector)].filter(item => item.parentElement === list);\n const original = rows();\n let active = false, stopped = false, timer, frame, target, half;\n let x, y, startX, startY, pointerId;\n const oldOutline = row.style.outline;\n const oldOpacity = row.style.opacity;\n let targetShadow, marker;\n function clearTarget() {\n marker?.remove(); marker = undefined;\n if (target) target.style.boxShadow = targetShadow;\n target = undefined;\n }\n function locate() {\n clearTarget();\n const bounds = list.getBoundingClientRect();\n if (x < bounds.left - 40 || x > bounds.right + 40) return;\n const candidates = rows().filter(item => item !== row && item.getBoundingClientRect().height > 0);\n target = candidates.find(item => y < item.getBoundingClientRect().bottom) ?? candidates.at(-1);\n if (!target) return;\n const rect = target.getBoundingClientRect();\n half = y < rect.top + rect.height / 2 ? 'before' : 'after';\n targetShadow = target.style.boxShadow;\n target.style.boxShadow = `inset 0 ${half === 'before' ? 3 : -3}px 0 #3987ff`;\n // A viewport overlay stays above card borders and does not move the rows.\n const edge = half === 'before' ? rect.top : rect.bottom;\n if (edge < 0 || edge > win.innerHeight) return;\n const visibleEdge = Math.max(4, Math.min(win.innerHeight - 4, edge));\n marker = doc.createElement('div');\n marker.setAttribute('data-settings-reorder-marker', '');\n marker.setAttribute('aria-hidden', 'true');\n Object.assign(marker.style, {\n position: 'fixed', pointerEvents: 'none', zIndex: '2147483647',\n left: `${Math.max(8, bounds.left)}px`, right: `${Math.max(8, win.innerWidth - bounds.right)}px`,\n top: `${visibleEdge - 2}px`, height: '4px', borderRadius: '4px',\n background: '#3987ff', boxShadow: '0 0 0 2px #fff, 0 2px 8px #0008'\n });\n const label = doc.createElement('span');\n label.textContent = doc.documentElement.lang?.startsWith('en') ? 'Release to place here' : '松手后放在这里';\n Object.assign(label.style, {\n position: 'absolute', right: '4px', top: edge < 44 ? '8px' : '-30px',\n padding: '4px 10px', borderRadius: '6px', color: '#fff', background: '#175fc9',\n font: 'bold 13px/20px sans-serif', whiteSpace: 'nowrap', boxShadow: '0 2px 8px #0005'\n });\n marker.appendChild(label); doc.body.appendChild(marker);\n }\n const scrollParent = () => {\n for (let node = list; node && node !== doc.documentElement; node = node.parentElement) {\n if (node.scrollHeight > node.clientHeight && /auto|scroll/.test(win.getComputedStyle(node).overflowY)) return node;\n }\n return doc.scrollingElement;\n };\n function tick() {\n if (!active || stopped) return;\n const scroll = scrollParent();\n if (scroll) {\n const viewport = scroll === doc.scrollingElement;\n const rect = viewport ? { top: 0, bottom: win.innerHeight } : scroll.getBoundingClientRect();\n const top = Math.max(0, rect.top), bottom = Math.min(win.innerHeight, rect.bottom);\n const speed = y < top + 56 ? -Math.min(14, (top + 56 - y) / 3) : y > bottom - 56 ? Math.min(14, (y - bottom + 56) / 3) : 0;\n if (speed) { scroll.scrollTop += speed; locate(); }\n }\n frame = win.requestAnimationFrame(tick);\n }\n function cancel() { finish(false); }\n function move(event) {\n if (event.pointerId !== pointerId) { cancel(); return; }\n x = event.clientX; y = event.clientY;\n if (!active) {\n // A swipe before activation is never interpreted as a reorder.\n if (Math.hypot(x - startX, y - startY) > 10) cancel();\n return;\n }\n event.preventDefault();\n locate();\n }\n function up(event) {\n if (event.pointerId !== pointerId) return;\n if (Number.isFinite(event.clientX)) x = event.clientX;\n if (Number.isFinite(event.clientY)) y = event.clientY;\n if (active) locate();\n finish(true);\n }\n function escape(event) { if (event.key === 'Escape') { event.preventDefault(); cancel(); } }\n function context(event) { event.preventDefault(); }\n function finish(save) {\n if (stopped) return;\n stopped = true;\n win.clearTimeout(timer); win.cancelAnimationFrame(frame);\n doc.removeEventListener('pointermove', move, true);\n doc.removeEventListener('pointerup', up, true);\n doc.removeEventListener('pointercancel', cancel, true);\n doc.removeEventListener('pointerdown', secondPointer, true);\n doc.removeEventListener('keydown', escape, true);\n doc.removeEventListener('contextmenu', context, true);\n win.removeEventListener('blur', cancel);\n doc.removeEventListener('visibilitychange', cancel);\n const destination = target;\n clearTarget(); row.style.outline = oldOutline; row.style.opacity = oldOpacity;\n if (handle.hasPointerCapture?.(pointerId)) handle.releasePointerCapture(pointerId);\n const current = rows();\n // Do not apply an offset to a list changed by another control while held.\n if (!save || !active || !destination || current.length !== original.length || current.some((item, index) => item !== original[index])) return;\n const from = current.indexOf(row), at = current.indexOf(destination);\n const insertion = at + (half === 'after' ? 1 : 0);\n const to = insertion > from ? insertion - 1 : insertion;\n if (from >= 0 && to >= 0 && to !== from) commit(to - from);\n }\n function secondPointer(event) { if (event.pointerId !== pointerId) cancel(); }\n return {\n start(event) {\n if (event.button !== 0 || event.isPrimary === false) return;\n pointerId = event.pointerId; x = startX = event.clientX; y = startY = event.clientY;\n handle.setPointerCapture?.(pointerId);\n doc.addEventListener('pointermove', move, { capture: true, passive: false });\n doc.addEventListener('pointerup', up, true);\n doc.addEventListener('pointercancel', cancel, true);\n doc.addEventListener('pointerdown', secondPointer, true);\n doc.addEventListener('keydown', escape, true);\n doc.addEventListener('contextmenu', context, true);\n win.addEventListener('blur', cancel);\n doc.addEventListener('visibilitychange', cancel);\n timer = win.setTimeout(() => {\n if (stopped || !row.isConnected) { cancel(); return; }\n active = true;\n row.style.outline = '2px solid var(--dsw-alias-label-primary, #679cff)';\n row.style.opacity = '0.65';\n locate(); tick();\n }, delay);\n }, cancel\n };\n}\n\t\tfunction useSettingsReorder(config) {\n const latest = (0, react.useRef)(config);\n latest.current = config;\n const gesture = (0, react.useRef)();\n (0, react.useEffect)(() => {\n if (config.disabled) gesture.current?.cancel();\n return () => gesture.current?.cancel();\n }, [config.disabled]);\n return id => ({\n draggable: false,\n style: { minWidth: 44, minHeight: 44, touchAction: 'none', userSelect: 'none', WebkitTouchCallout: 'none', cursor: 'grab', flexShrink: 0 },\n onContextMenu: event => event.preventDefault(),\n onClick: event => { event.preventDefault(); event.stopPropagation(); },\n onPointerDown: event => {\n if (latest.current.disabled || event.button !== 0 || event.isPrimary === false) return;\n gesture.current?.cancel();\n const handle = event.currentTarget;\n const row = handle.closest(latest.current.selector);\n if (!row) return;\n gesture.current = createSettingsReorder({ handle, row, selector: latest.current.selector, commit: offset => {\n if (!latest.current.disabled) latest.current.move(id, offset);\n } });\n gesture.current.start(event);\n },\n onLostPointerCapture: () => gesture.current?.cancel(),\n onKeyDown: event => {\n if (latest.current.disabled || (event.key !== 'ArrowUp' && event.key !== 'ArrowDown')) return;\n event.preventDefault(); event.stopPropagation();\n latest.current.move(id, event.key === 'ArrowUp' ? -1 : 1);\n }\n });\n}\n\t\tconst MULTI_KEY_ENTRY_ID ="
1330
+ },
1331
+ {
1332
+ "before": "children: [Object.entries(entries).map(([id, candidate], index) => {",
1333
+ "after": "children: [orderedKeyEntries(entries).map(([id, candidate], index) => {"
1334
+ },
1335
+ {
1336
+ "before": "return Object.fromEntries(Object.entries(entries).map(([id, entry]) => {",
1337
+ "after": "return Object.fromEntries(orderedKeyEntries(entries).map(([id, entry]) => {"
1338
+ },
1339
+ {
1340
+ "before": "const anyBusy = Object.values(busyEntries).some(Boolean);",
1341
+ "after": "const anyBusy = Object.values(busyEntries).some(Boolean);\n\t\t\tconst savedEntryOrder = orderedKeyEntries(props.savedEntries ?? props.persistedEntries ?? {}).map(([id]) => id);\n\t\t\tconst reorder = useSettingsReorder({ disabled: disabled || anyBusy, selector: \"[data-key-entry-id]\", move: (id, offset) => {\n\t\t\t\tconst ordered = orderedKeyEntries(entries), from = ordered.findIndex(([key]) => key === id), to = from + offset;\n\t\t\t\tif (from < 0 || to < 0 || to >= ordered.length) return;\n\t\t\t\tconst [moved] = ordered.splice(from, 1); ordered.splice(to, 0, moved);\n\t\t\t\tonChange(Object.fromEntries(ordered.map(([key, entry], sortOrder) => [key, { ...entry, sortOrder }])));\n\t\t\t} });"
1342
+ },
1343
+ {
1344
+ "before": "const dirty = multiKeyEntryDirty(entry, props.savedEntries?.[id] ?? props.persistedEntries?.[id], draft);",
1345
+ "after": "const dirty = savedEntryOrder.indexOf(id) !== index || multiKeyEntryDirty(entry, props.savedEntries?.[id] ?? props.persistedEntries?.[id], draft);"
1346
+ },
1347
+ {
1348
+ "before": "children: [(0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"rowName\"],",
1349
+ "after": "children: [(0, react_jsx_runtime.jsx)(\"button\", {\n\t\t\t\t\t\t\t\ttype: \"button\", className: ModelsSection_module_css_default[\"iconButton\"],\n\t\t\t\t\t\t\t\t\"data-key-entry-handle\": id, \"aria-label\": t(\"multiKeyReorder\") + \" \" + heading,\n\t\t\t\t\t\t\t\t\"aria-keyshortcuts\": \"ArrowUp ArrowDown\", \"aria-description\": t(\"multiKeyReorderHelp\"), title: t(\"multiKeyReorderHelp\"),\n\t\t\t\t\t\t\t\tdisabled: disabled || anyBusy, ...reorder(id),\n\t\t\t\t\t\t\t\tchildren: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconDragHandleOutlineRegular, { size: 14 })\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[\"rowName\"],"
1350
+ },
1351
+ {
1352
+ "before": "const preview = (0, _deepseek_ai_dsh_client_ui_primitives.useRowDragPreview)(ModelsSection_module_css_default[\"modelDragPreview\"]);",
1353
+ "after": "const reorder = useSettingsReorder({ disabled, selector: \"[data-row-key]\", move: (_key, offset) => props.order.onMove(offset) });"
1354
+ },
1355
+ {
1356
+ "before": "\n\t\t\t\tonDragOver: (event) => {\n\t\t\t\t\tif (!props.order.canDrop) return;\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tevent.dataTransfer.dropEffect = \"move\";\n\t\t\t\t\tprops.order.onOver(rowHalf(event));\n\t\t\t\t},\n\t\t\t\tonDragLeave: (event) => {\n\t\t\t\t\tif (event.relatedTarget instanceof Node && event.currentTarget.contains(event.relatedTarget)) return;\n\t\t\t\t\tprops.order.onLeave();\n\t\t\t\t},\n\t\t\t\tonDrop: (event) => {\n\t\t\t\t\tif (!props.order.canDrop) return;\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tprops.order.onDrop(rowHalf(event));\n\t\t\t\t},",
1357
+ "after": "\n\t\t\t\t// Reordering is handled by the pointer handle below."
1358
+ },
1359
+ {
1360
+ "before": "\n\t\t\t\t\t\t\t\tdraggable: !disabled,\n\t\t\t\t\t\t\t\tonDragStart: (event) => {\n\t\t\t\t\t\t\t\t\tevent.dataTransfer.effectAllowed = \"move\";\n\t\t\t\t\t\t\t\t\tevent.dataTransfer.setData(\"application/x-dsh-model-order\", String(position));\n\t\t\t\t\t\t\t\t\tprops.order.onStart();\n\t\t\t\t\t\t\t\t\tpreview.start(event, event.currentTarget.closest(\"[data-row-key]\"));\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tonDragEnd: () => {\n\t\t\t\t\t\t\t\t\tif (preview.clear()) props.order.onEnd();\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tonKeyDown: (event) => {\n\t\t\t\t\t\t\t\t\tif (event.key !== \"ArrowUp\" && event.key !== \"ArrowDown\") return;\n\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\tprops.order.onMove(event.key === \"ArrowUp\" ? -1 : 1);\n\t\t\t\t\t\t\t\t},",
1361
+ "after": "\n\t\t\t\t\t\t\t\t...reorder(props.rowKey),"
1362
+ },
1363
+ {
1364
+ "before": "label: t(\"reorderModelHelp\"),",
1365
+ "after": "label: t(\"modelReorderTouchHelp\"),"
1366
+ },
1367
+ {
1368
+ "before": "\"aria-description\": t(\"reorderModelHelp\"),",
1369
+ "after": "\"aria-description\": t(\"modelReorderTouchHelp\"),"
1370
+ },
1371
+ {
1372
+ "before": "const en = {\n",
1373
+ "after": "const en = {\n\t\t\tmultiKeyReorder: \"Reorder key group\",\n\t\t\tmultiKeyReorderHelp: \"Hold the handle to reorder; or use Arrow Up/Down. Save with the other edits.\",\n\t\t\tmodelReorderTouchHelp: \"Hold the handle to reorder; or use Arrow Up/Down. Save with the other edits.\",\n"
1374
+ },
1375
+ {
1376
+ "before": "const zh = {\n",
1377
+ "after": "const zh = {\n\t\t\tmultiKeyReorder: \"调整密钥分组顺序\",\n\t\t\tmultiKeyReorderHelp: \"长按手柄拖动,或用上下方向键调整;与其他改动一起保存。\",\n\t\t\tmodelReorderTouchHelp: \"长按手柄拖动,或用上下方向键调整;与其他改动一起保存。\",\n"
1378
+ }
1379
+ ]
1380
+ },
1381
+ {
1382
+ "baseSha256": "e111ecefea8262e0426f528864b9681d818068042e93d053bcb0b6884b317278",
1383
+ "resultSha256": "4c4d72e9c5da4b850ba2df3da602c16d50f18cc356acdae3cb26a25cb00d44ce",
1384
+ "replacements": [
1385
+ {
1386
+ "before": "\t\t//#region lib/types/client/CustomProviderCard.js",
1387
+ "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"
1388
+ },
1389
+ {
1390
+ "before": "\t\t\t\t\t...probe.provider === void 0 ? {} : { provider: probe.provider },",
1391
+ "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 },"
1392
+ },
1393
+ {
1394
+ "before": "const { taken, protocols, reasoningLevels, operations, t, onBusyChange } = props;",
1395
+ "after": "const { taken, protocols, reasoningLevels, operations, t, onBusyChange } = props;\n\t\t\tconst supportsMultiKey = supportsMultiKeySchema(props.namespace, props.schema, [\"providers\", PROBE_ROUTE]);"
1396
+ },
1397
+ {
1398
+ "before": "const [models, setModels] = (0, react.useState)([]);\n\t\t\tconst [busy, setBusy]",
1399
+ "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]"
1400
+ },
1401
+ {
1402
+ "before": "const modelFailure = validateDeepSeekModels(models) ?? validateReasoningEfforts(models);\n\t\t\tconst keyFailure = apiKeyFailure(keyDraft);",
1403
+ "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);"
1404
+ },
1405
+ {
1406
+ "before": "const ready = route.length > 0 && !routeInvalid && !routeTaken && normalizedBaseURL.length > 0 && !baseUrlInvalid && models.length > 0 && modelFailure === void 0 && keyFailure === void 0;",
1407
+ "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);"
1408
+ },
1409
+ {
1410
+ "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\");",
1411
+ "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\"));"
1412
+ },
1413
+ {
1414
+ "before": "const keyRef = deriveKeyRef(route);\n\t\t\t\tconst storesKey = keyValue.length > 0;",
1415
+ "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;"
1416
+ },
1417
+ {
1418
+ "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 }))",
1419
+ "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 } : {})"
1420
+ },
1421
+ {
1422
+ "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};",
1423
+ "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};"
1424
+ },
1425
+ {
1426
+ "before": "const create = async () => {\n\t\t\t\tsetBusy(true);",
1427
+ "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);"
1428
+ },
1429
+ {
1430
+ "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\", {",
1431
+ "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\", {"
1432
+ },
1433
+ {
1434
+ "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\")",
1435
+ "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\")"
1436
+ },
1437
+ {
1438
+ "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,",
1439
+ "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,"
1440
+ },
1441
+ {
1442
+ "before": "\t\t\t\t\t\tonBusyChange: setListBusy\n\t\t\t\t\t}),\n\t\t\t\t\tfailure !== void 0",
1443
+ "after": "\t\t\t\t\t\tonBusyChange: setListBusy\n\t\t\t\t\t}) : null,\n\t\t\t\t\tfailure !== void 0"
1444
+ },
1445
+ {
1446
+ "before": "submitDisabled: disabled || !ready,",
1447
+ "after": "submitDisabled: disabled || listBusy || !ready,"
1448
+ },
1449
+ {
1450
+ "before": "taken: state.rows.map((row) => row.entry.provider),\n\t\t\t\t\t\t\t\t\t\tprotocols,",
1451
+ "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,"
1452
+ },
1453
+ {
1454
+ "before": "const [draft, setDraft] = (0, react.useState)(() => draftAt(schema, namespace, settingsPath));",
1455
+ "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);"
1456
+ },
1457
+ {
1458
+ "before": "const keyRef = refFor(schema, namespace, settingsPath, props.provider);",
1459
+ "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;"
1460
+ },
1461
+ {
1462
+ "before": "const modelFailure = validateModels(schema.getPath(draft, [\"models\"]));\n\t\t\tconst keyFailure = apiKeyFailure(keyDraft);",
1463
+ "after": "const modelFailure = multiKey ? void 0 : validateModels(schema.getPath(draft, [\"models\"]));\n\t\t\tconst keyFailure = multiKey ? void 0 : apiKeyFailure(keyDraft);"
1464
+ },
1465
+ {
1466
+ "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;",
1467
+ "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;"
1468
+ },
1469
+ {
1470
+ "before": "if (props.credentialOnly !== true) {\n\t\t\t\t\tconst failure = validateModels",
1471
+ "after": "if (props.credentialOnly !== true && !multiKey) {\n\t\t\t\t\tconst failure = validateModels"
1472
+ },
1473
+ {
1474
+ "before": "\t\t\t\tif (keyValue.length > 0) {\n\t\t\t\t\tconst stored = await operations.storeCredential(keyRef, keyValue);",
1475
+ "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);"
1476
+ },
1477
+ {
1478
+ "before": "const apply = async () => {\n\t\t\t\tsetBusy(true);",
1479
+ "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);"
1480
+ },
1481
+ {
1482
+ "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)",
1483
+ "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)"
1484
+ },
1485
+ {
1486
+ "before": "return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [keylessNativeAuth ? null :",
1487
+ "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 :"
1488
+ },
1489
+ {
1490
+ "before": "family === \"deepseek\" ? (0, react_jsx_runtime.jsx)(DeepSeekModelsEditor, {",
1491
+ "after": "multiKey ? null : family === \"deepseek\" ? (0, react_jsx_runtime.jsx)(DeepSeekModelsEditor, {"
1492
+ },
1493
+ {
1494
+ "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",
1495
+ "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"
1496
+ },
1497
+ {
1498
+ "before": "submitDisabled: disabled || layout === \"unknown\" || props.credentialOnly !== true && modelFailure !== void 0 || shownKeyFailure !== void 0 || props.credentialRequired === true && keyValue.length === 0,",
1499
+ "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),"
1500
+ },
1501
+ {
1502
+ "before": "return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [supportsMultiKey ? (0, react_jsx_runtime.jsx)(MultiKeyToggle, {",
1503
+ "after": "const credentials = (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [supportsMultiKey ? (0, react_jsx_runtime.jsx)(MultiKeyToggle, {"
1504
+ },
1505
+ {
1506
+ "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\"],",
1507
+ "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,"
1508
+ },
1509
+ {
1510
+ "before": "children: t(\"customized\")\n\t\t\t\t\t}), (0, react_jsx_runtime.jsxs)(\"div\", {",
1511
+ "after": "children: t(supportsMultiKey ? \"multiKeySharedSettings\" : \"customized\")\n\t\t\t\t\t}), (0, react_jsx_runtime.jsxs)(\"div\", {"
1512
+ },
1513
+ {
1514
+ "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",
1515
+ "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"
1516
+ },
1517
+ {
1518
+ "before": "\t\tconst en = {",
1519
+ "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.\","
1520
+ },
1521
+ {
1522
+ "before": "\t\tconst zh = {",
1523
+ "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: \"保存尚未完成。请保留此卡片并重试;已成功写入的密钥不会重复写入。\","
1524
+ },
1525
+ {
1526
+ "before": "const MULTI_KEY_ENTRY_ID =",
1527
+ "after": "const MULTI_KEY_PROTOCOLS = new Set([\"openai-completions\", \"openai-responses\", \"anthropic-messages\"]);\n\t\tconst MULTI_KEY_ENTRY_ID ="
1528
+ },
1529
+ {
1530
+ "before": "name: source.name ?? \"\",",
1531
+ "after": "name: source.name ?? \"\",\n\t\t\t\t...(source.api === void 0 ? {} : { api: source.api }),"
1532
+ },
1533
+ {
1534
+ "before": "return 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}]));",
1535
+ "after": "return Object.fromEntries(Object.entries(entries).map(([id, entry]) => {\n\t\t\t\tconst { api, ...rest } = entry;\n\t\t\t\treturn [id, {\n\t\t\t\t\t...rest,\n\t\t\t\t\t...(api === void 0 || api === \"\" ? {} : { api }),\n\t\t\t\t\tname: typeof entry?.name === \"string\" ? entry.name.trim() : \"\",\n\t\t\t\t\tapiKeyEnv: typeof entry?.apiKeyEnv === \"string\" && entry.apiKeyEnv.length > 0 ? entry.apiKeyEnv : multiKeyRef(route, id),\n\t\t\t\t\tmodels: modelDrafts(entry?.models).map((model) => structuredClone(model))\n\t\t\t\t}];\n\t\t\t}));"
1536
+ },
1537
+ {
1538
+ "before": "return t(\"multiKeyInvalidName\");\n\t\t\t\tconst ref = entry.apiKeyEnv ?? multiKeyRef(route, id);",
1539
+ "after": "return t(\"multiKeyInvalidName\");\n\t\t\t\tif (entry.api !== void 0 && !MULTI_KEY_PROTOCOLS.has(entry.api)) return t(\"multiKeyInvalidProtocol\");\n\t\t\t\tconst ref = entry.apiKeyEnv ?? multiKeyRef(route, id);"
1540
+ },
1541
+ {
1542
+ "before": "...(canUseStored ? { keyEntryId: id } : {}),",
1543
+ "after": "...(canUseStored ? { keyEntryId: id } : {}),\n\t\t\t\t\t\t...(entry.api === void 0 ? {} : { api: entry.api }),"
1544
+ },
1545
+ {
1546
+ "before": "\t\tfunction MultiKeyEntriesEditor(props) {",
1547
+ "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) {"
1548
+ },
1549
+ {
1550
+ "before": "const [busyEntries, setBusyEntries] = (0, react.useState)({});",
1551
+ "after": "const [busyEntries, setBusyEntries] = (0, react.useState)({});\n\t\t\tconst [expandedEntries, setExpandedEntries] = (0, react.useState)({});\n\t\t\tconst [removeTarget, setRemoveTarget] = (0, react.useState)(void 0);\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]);"
1552
+ },
1553
+ {
1554
+ "before": "const anyBusy = Object.values(busyEntries).some(Boolean);",
1555
+ "after": "const anyBusy = Object.values(busyEntries).some(Boolean);\n\t\t\t(0, react.useEffect)(() => {\n\t\t\t\tif (disabled || anyBusy || removeTarget !== void 0 && !Object.hasOwn(entries, removeTarget)) setRemoveTarget(void 0);\n\t\t\t}, [disabled, anyBusy, removeTarget, entries]);\n\t\t\tconst removeName = typeof entries[removeTarget]?.name === \"string\" && entries[removeTarget].name.trim() ? entries[removeTarget].name.trim() : t(\"multiKeyDefaultName\");"
1556
+ },
1557
+ {
1558
+ "before": "const remove = (id) => {",
1559
+ "after": "const remove = (id) => {\n\t\t\t\tif (disabled || anyBusy || !Object.hasOwn(entries, id)) return;"
1560
+ },
1561
+ {
1562
+ "before": "const heading = typeof entry.name === \"string\"",
1563
+ "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\""
1564
+ },
1565
+ {
1566
+ "before": "\"data-key-entry-id\": id, role: \"group\", \"aria-label\": heading,",
1567
+ "after": "\"data-key-entry-id\": id, \"data-key-entry-expanded\": expanded, \"data-key-entry-dirty\": dirty, role: \"group\", \"aria-label\": heading,"
1568
+ },
1569
+ {
1570
+ "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})]",
1571
+ "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}), (0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"rowActions\"],\n\t\t\t\t\t\t\t\tchildren: [dirty ? (0, react_jsx_runtime.jsx)(\"span\", { className: ModelsSection_module_css_default[\"rowTag\"], \"data-key-entry-unsaved\": true, children: t(\"multiKeyUnsaved\") }) : null,\n\t\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(\"button\", {\n\t\t\t\t\t\t\t\t\ttype: \"button\", className: ModelsSection_module_css_default[\"secondaryButton\"],\n\t\t\t\t\t\t\t\t\t\"aria-expanded\": expanded, \"aria-controls\": detailsId,\n\t\t\t\t\t\t\t\t\tonClick: () => setExpandedEntries((current) => ({ ...current, [id]: !expanded })),\n\t\t\t\t\t\t\t\t\tchildren: t(expanded ? \"multiKeyCollapse\" : \"multiKeyExpand\")\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)(\"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 ? \"flex\" : \"none\", flexDirection: \"column\", gap: 12, minWidth: 0, borderTop: \"0.5px solid var(--dsw-alias-settings-card-stroke)\", paddingTop: 12 },\n\t\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsxs)(\"div\", {\n\t\t\t\t\t\t\t\t\"data-key-entry-fields\": true, style: { display: \"grid\", gridTemplateColumns: \"repeat(auto-fit, minmax(min(100%, 220px), 1fr))\", gap: 12, minWidth: 0 }, 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.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(\"multiKeyProtocol\") }),\n\t\t\t\t\t\t\t\t(0, react_jsx_runtime.jsxs)(\"select\", {\n\t\t\t\t\t\t\t\t\t\"data-key-entry-protocol\": id, \"aria-label\": t(\"multiKeyProtocol\") + \" \" + heading,\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\tstyle: { maxWidth: \"none\" }, value: entry.api ?? \"\", disabled: disabled || anyBusy,\n\t\t\t\t\t\t\t\t\tonChange: (event) => {\n\t\t\t\t\t\t\t\t\t\tconst value = event.target.value;\n\t\t\t\t\t\t\t\t\t\tif (disabled || anyBusy || value !== \"\" && !MULTI_KEY_PROTOCOLS.has(value)) return;\n\t\t\t\t\t\t\t\t\t\tconst { api, ...inherited } = entries[id];\n\t\t\t\t\t\t\t\t\t\tonChange({ ...entries, [id]: value === \"\" ? inherited : { ...inherited, api: value } });\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"option\", { value: \"\", children: t(\"multiKeyProtocolInherit\").replace(\"{protocol}\", () => props.probe.api ? protocolLabel(t, props.probe.api) : t(\"multiKeyProtocolDefault\")) }),\n\t\t\t\t\t\t\t\t\t...(props.protocols ?? [...MULTI_KEY_PROTOCOLS]).map((choice) => (0, react_jsx_runtime.jsx)(\"option\", { value: choice, children: protocolLabel(t, choice) }, choice))]\n\t\t\t\t\t\t\t\t}), (0, react_jsx_runtime.jsx)(\"span\", { className: ModelsSection_module_css_default[\"advancedHint\"], children: t(\"multiKeyProtocolHelp\") })]\n\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.jsxs)(\"div\", {\n\t\t\t\t\t\t\t\t\"data-key-entry-danger-zone\": true,\n\t\t\t\t\t\t\t\tstyle: { display: \"flex\", flexDirection: \"column\", gap: 6, borderTop: \"0.5px solid var(--dsw-alias-settings-card-stroke)\", paddingTop: 12 },\n\t\t\t\t\t\t\t\tchildren: [(0, react_jsx_runtime.jsx)(\"p\", { className: ModelsSection_module_css_default[\"advancedHint\"], children: t(\"multiKeyRemoveHelp\") }),\n\t\t\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(\"button\", {\n\t\t\t\t\t\t\t\t\ttype: \"button\", \"data-key-entry-remove\": id,\n\t\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"dangerButton\"], style: { alignSelf: \"flex-start\" }, disabled: disabled || anyBusy,\n\t\t\t\t\t\t\t\t\tonClick: () => { if (!disabled && !anyBusy) setRemoveTarget(id); }, children: t(\"multiKeyRemoveGroup\")\n\t\t\t\t\t\t\t\t})]\n\t\t\t\t\t\t\t})]\n\t\t\t\t\t\t})]"
1572
+ },
1573
+ {
1574
+ "before": "}), (0, react_jsx_runtime.jsx)(\"p\", { className: ModelsSection_module_css_default[\"advancedHint\"], children: t(\"multiKeyKeepCredentials\") })]",
1575
+ "after": "}), (0, react_jsx_runtime.jsx)(\"p\", { className: ModelsSection_module_css_default[\"advancedHint\"], children: t(\"multiKeyKeepCredentials\") }),\n\t\t\t\t(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {\n\t\t\t\t\topen: removeTarget !== void 0 && Object.hasOwn(entries, removeTarget) && !disabled && !anyBusy,\n\t\t\t\t\t\"data-key-entry-remove-dialog\": true, onClose: () => setRemoveTarget(void 0),\n\t\t\t\t\ttitle: t(\"multiKeyRemoveTitle\").replace(\"{name}\", () => removeName), closeLabel: t(\"close\"),\n\t\t\t\t\tdescription: t(\"multiKeyRemoveDescription\"), className: 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, { variant: \"outline\", \"data-modal-autofocus\": true, onClick: () => setRemoveTarget(void 0), children: t(\"cancel\") }),\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\", className: ModelsSection_module_css_default[\"deleteConfirm\"], disabled: disabled || anyBusy,\n\t\t\t\t\t\t\tonClick: () => { if (removeTarget === void 0 || disabled || anyBusy) return; remove(removeTarget); setRemoveTarget(void 0); }, children: t(\"multiKeyRemoveGroup\")\n\t\t\t\t\t\t})]\n\t\t\t\t\t})\n\t\t\t\t})]"
1576
+ },
1577
+ {
1578
+ "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}",
1579
+ "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, protocols, 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}"
1580
+ },
1581
+ {
1582
+ "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}",
1583
+ "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, protocols, 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}"
1584
+ },
1585
+ {
1586
+ "before": "className: ModelsSection_module_css_default[\"editorActions\"],",
1587
+ "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\" },"
1588
+ },
1589
+ {
1590
+ "before": "const en = {\n",
1591
+ "after": "const en = {\n\t\t\tmultiKeyExpand: \"Expand details\",\n\t\t\tmultiKeyCollapse: \"Collapse details\",\n\t\t\tmultiKeyUnsaved: \"Not saved\",\n\t\t\tmultiKeyProtocol: \"Group API protocol\",\n\t\t\tmultiKeyProtocolInherit: \"Inherit provider ({protocol})\",\n\t\t\tmultiKeyProtocolDefault: \"default protocol\",\n\t\t\tmultiKeyProtocolHelp: \"Only this key group is affected. Choose the protocol supported by your relay, not just the model name.\",\n\t\t\tmultiKeyInvalidProtocol: \"Unsupported key-group protocol.\",\n\t\t\tmultiKeyRemoveGroup: \"Remove this key group\",\n\t\t\tmultiKeyRemoveTitle: \"Remove key group “{name}”?\",\n\t\t\tmultiKeyRemoveHelp: \"Removes the entire key group and its model list, not just one model above. Stored credentials are retained.\",\n\t\t\tmultiKeyRemoveDescription: \"This removes the selected group and all of its model entries from the draft. Other groups and stored credentials are retained. Existing conversations are not switched automatically. Changes take effect after Apply; Cancel editing to discard them.\",\n"
1592
+ },
1593
+ {
1594
+ "before": "const zh = {\n",
1595
+ "after": "const zh = {\n\t\t\tmultiKeyExpand: \"展开详情\",\n\t\t\tmultiKeyCollapse: \"收起详情\",\n\t\t\tmultiKeyUnsaved: \"未保存\",\n\t\t\tmultiKeyProtocol: \"分组 API 协议\",\n\t\t\tmultiKeyProtocolInherit: \"跟随供应商({protocol})\",\n\t\t\tmultiKeyProtocolDefault: \"默认协议\",\n\t\t\tmultiKeyProtocolHelp: \"仅影响此密钥分组,请按中转站支持的协议选择,不按模型名称自动切换。\",\n\t\t\tmultiKeyInvalidProtocol: \"不支持此密钥分组协议。\",\n\t\t\tmultiKeyRemoveGroup: \"移除此密钥分组\",\n\t\t\tmultiKeyRemoveTitle: \"移除密钥分组“{name}”?\",\n\t\t\tmultiKeyRemoveHelp: \"移除整个密钥分组及其模型列表,不是仅移除上方一个模型。已保存的密钥凭据会保留。\",\n\t\t\tmultiKeyRemoveDescription: \"此操作从编辑草稿移除该分组及其全部模型条目,其他分组和已保存的密钥凭据不变,不会自动切换现有会话。点击“应用”后才生效;取消编辑可放弃更改。\",\n"
1596
+ },
1597
+ {
1598
+ "before": "const MULTI_KEY_ENTRY_ID =",
1599
+ "after": "function orderedKeyEntries(entries) {\n const rank = entry => Number.isSafeInteger(entry?.sortOrder) && entry.sortOrder >= 0 ? entry.sortOrder : Infinity;\n return Object.entries(entries ?? {}).sort(([, left], [, right]) => {\n const a = rank(left), b = rank(right);\n return a === b ? 0 : a < b ? -1 : 1;\n });\n}\n\t\tfunction createSettingsReorder({ handle, row, selector, commit, delay = 400 }) {\n const doc = handle.ownerDocument;\n const win = doc.defaultView;\n const list = row.parentElement;\n const rows = () => [...list.querySelectorAll(selector)].filter(item => item.parentElement === list);\n const original = rows();\n let active = false, stopped = false, timer, frame, target, half;\n let x, y, startX, startY, pointerId;\n const oldOutline = row.style.outline;\n const oldOpacity = row.style.opacity;\n let targetShadow, marker;\n function clearTarget() {\n marker?.remove(); marker = undefined;\n if (target) target.style.boxShadow = targetShadow;\n target = undefined;\n }\n function locate() {\n clearTarget();\n const bounds = list.getBoundingClientRect();\n if (x < bounds.left - 40 || x > bounds.right + 40) return;\n const candidates = rows().filter(item => item !== row && item.getBoundingClientRect().height > 0);\n target = candidates.find(item => y < item.getBoundingClientRect().bottom) ?? candidates.at(-1);\n if (!target) return;\n const rect = target.getBoundingClientRect();\n half = y < rect.top + rect.height / 2 ? 'before' : 'after';\n targetShadow = target.style.boxShadow;\n target.style.boxShadow = `inset 0 ${half === 'before' ? 3 : -3}px 0 #3987ff`;\n // A viewport overlay stays above card borders and does not move the rows.\n const edge = half === 'before' ? rect.top : rect.bottom;\n if (edge < 0 || edge > win.innerHeight) return;\n const visibleEdge = Math.max(4, Math.min(win.innerHeight - 4, edge));\n marker = doc.createElement('div');\n marker.setAttribute('data-settings-reorder-marker', '');\n marker.setAttribute('aria-hidden', 'true');\n Object.assign(marker.style, {\n position: 'fixed', pointerEvents: 'none', zIndex: '2147483647',\n left: `${Math.max(8, bounds.left)}px`, right: `${Math.max(8, win.innerWidth - bounds.right)}px`,\n top: `${visibleEdge - 2}px`, height: '4px', borderRadius: '4px',\n background: '#3987ff', boxShadow: '0 0 0 2px #fff, 0 2px 8px #0008'\n });\n const label = doc.createElement('span');\n label.textContent = doc.documentElement.lang?.startsWith('en') ? 'Release to place here' : '松手后放在这里';\n Object.assign(label.style, {\n position: 'absolute', right: '4px', top: edge < 44 ? '8px' : '-30px',\n padding: '4px 10px', borderRadius: '6px', color: '#fff', background: '#175fc9',\n font: 'bold 13px/20px sans-serif', whiteSpace: 'nowrap', boxShadow: '0 2px 8px #0005'\n });\n marker.appendChild(label); doc.body.appendChild(marker);\n }\n const scrollParent = () => {\n for (let node = list; node && node !== doc.documentElement; node = node.parentElement) {\n if (node.scrollHeight > node.clientHeight && /auto|scroll/.test(win.getComputedStyle(node).overflowY)) return node;\n }\n return doc.scrollingElement;\n };\n function tick() {\n if (!active || stopped) return;\n const scroll = scrollParent();\n if (scroll) {\n const viewport = scroll === doc.scrollingElement;\n const rect = viewport ? { top: 0, bottom: win.innerHeight } : scroll.getBoundingClientRect();\n const top = Math.max(0, rect.top), bottom = Math.min(win.innerHeight, rect.bottom);\n const speed = y < top + 56 ? -Math.min(14, (top + 56 - y) / 3) : y > bottom - 56 ? Math.min(14, (y - bottom + 56) / 3) : 0;\n if (speed) { scroll.scrollTop += speed; locate(); }\n }\n frame = win.requestAnimationFrame(tick);\n }\n function cancel() { finish(false); }\n function move(event) {\n if (event.pointerId !== pointerId) { cancel(); return; }\n x = event.clientX; y = event.clientY;\n if (!active) {\n // A swipe before activation is never interpreted as a reorder.\n if (Math.hypot(x - startX, y - startY) > 10) cancel();\n return;\n }\n event.preventDefault();\n locate();\n }\n function up(event) {\n if (event.pointerId !== pointerId) return;\n if (Number.isFinite(event.clientX)) x = event.clientX;\n if (Number.isFinite(event.clientY)) y = event.clientY;\n if (active) locate();\n finish(true);\n }\n function escape(event) { if (event.key === 'Escape') { event.preventDefault(); cancel(); } }\n function context(event) { event.preventDefault(); }\n function finish(save) {\n if (stopped) return;\n stopped = true;\n win.clearTimeout(timer); win.cancelAnimationFrame(frame);\n doc.removeEventListener('pointermove', move, true);\n doc.removeEventListener('pointerup', up, true);\n doc.removeEventListener('pointercancel', cancel, true);\n doc.removeEventListener('pointerdown', secondPointer, true);\n doc.removeEventListener('keydown', escape, true);\n doc.removeEventListener('contextmenu', context, true);\n win.removeEventListener('blur', cancel);\n doc.removeEventListener('visibilitychange', cancel);\n const destination = target;\n clearTarget(); row.style.outline = oldOutline; row.style.opacity = oldOpacity;\n if (handle.hasPointerCapture?.(pointerId)) handle.releasePointerCapture(pointerId);\n const current = rows();\n // Do not apply an offset to a list changed by another control while held.\n if (!save || !active || !destination || current.length !== original.length || current.some((item, index) => item !== original[index])) return;\n const from = current.indexOf(row), at = current.indexOf(destination);\n const insertion = at + (half === 'after' ? 1 : 0);\n const to = insertion > from ? insertion - 1 : insertion;\n if (from >= 0 && to >= 0 && to !== from) commit(to - from);\n }\n function secondPointer(event) { if (event.pointerId !== pointerId) cancel(); }\n return {\n start(event) {\n if (event.button !== 0 || event.isPrimary === false) return;\n pointerId = event.pointerId; x = startX = event.clientX; y = startY = event.clientY;\n handle.setPointerCapture?.(pointerId);\n doc.addEventListener('pointermove', move, { capture: true, passive: false });\n doc.addEventListener('pointerup', up, true);\n doc.addEventListener('pointercancel', cancel, true);\n doc.addEventListener('pointerdown', secondPointer, true);\n doc.addEventListener('keydown', escape, true);\n doc.addEventListener('contextmenu', context, true);\n win.addEventListener('blur', cancel);\n doc.addEventListener('visibilitychange', cancel);\n timer = win.setTimeout(() => {\n if (stopped || !row.isConnected) { cancel(); return; }\n active = true;\n row.style.outline = '2px solid var(--dsw-alias-label-primary, #679cff)';\n row.style.opacity = '0.65';\n locate(); tick();\n }, delay);\n }, cancel\n };\n}\n\t\tfunction useSettingsReorder(config) {\n const latest = (0, react.useRef)(config);\n latest.current = config;\n const gesture = (0, react.useRef)();\n (0, react.useEffect)(() => {\n if (config.disabled) gesture.current?.cancel();\n return () => gesture.current?.cancel();\n }, [config.disabled]);\n return id => ({\n draggable: false,\n style: { minWidth: 44, minHeight: 44, touchAction: 'none', userSelect: 'none', WebkitTouchCallout: 'none', cursor: 'grab', flexShrink: 0 },\n onContextMenu: event => event.preventDefault(),\n onClick: event => { event.preventDefault(); event.stopPropagation(); },\n onPointerDown: event => {\n if (latest.current.disabled || event.button !== 0 || event.isPrimary === false) return;\n gesture.current?.cancel();\n const handle = event.currentTarget;\n const row = handle.closest(latest.current.selector);\n if (!row) return;\n gesture.current = createSettingsReorder({ handle, row, selector: latest.current.selector, commit: offset => {\n if (!latest.current.disabled) latest.current.move(id, offset);\n } });\n gesture.current.start(event);\n },\n onLostPointerCapture: () => gesture.current?.cancel(),\n onKeyDown: event => {\n if (latest.current.disabled || (event.key !== 'ArrowUp' && event.key !== 'ArrowDown')) return;\n event.preventDefault(); event.stopPropagation();\n latest.current.move(id, event.key === 'ArrowUp' ? -1 : 1);\n }\n });\n}\n\t\tconst MULTI_KEY_ENTRY_ID ="
1600
+ },
1601
+ {
1602
+ "before": "children: [Object.entries(entries).map(([id, candidate], index) => {",
1603
+ "after": "children: [orderedKeyEntries(entries).map(([id, candidate], index) => {"
1604
+ },
1605
+ {
1606
+ "before": "return Object.fromEntries(Object.entries(entries).map(([id, entry]) => {",
1607
+ "after": "return Object.fromEntries(orderedKeyEntries(entries).map(([id, entry]) => {"
1608
+ },
1609
+ {
1610
+ "before": "const anyBusy = Object.values(busyEntries).some(Boolean);",
1611
+ "after": "const anyBusy = Object.values(busyEntries).some(Boolean);\n\t\t\tconst savedEntryOrder = orderedKeyEntries(props.savedEntries ?? props.persistedEntries ?? {}).map(([id]) => id);\n\t\t\tconst reorder = useSettingsReorder({ disabled: disabled || anyBusy, selector: \"[data-key-entry-id]\", move: (id, offset) => {\n\t\t\t\tconst ordered = orderedKeyEntries(entries), from = ordered.findIndex(([key]) => key === id), to = from + offset;\n\t\t\t\tif (from < 0 || to < 0 || to >= ordered.length) return;\n\t\t\t\tconst [moved] = ordered.splice(from, 1); ordered.splice(to, 0, moved);\n\t\t\t\tonChange(Object.fromEntries(ordered.map(([key, entry], sortOrder) => [key, { ...entry, sortOrder }])));\n\t\t\t} });"
1612
+ },
1613
+ {
1614
+ "before": "const dirty = multiKeyEntryDirty(entry, props.savedEntries?.[id] ?? props.persistedEntries?.[id], draft);",
1615
+ "after": "const dirty = savedEntryOrder.indexOf(id) !== index || multiKeyEntryDirty(entry, props.savedEntries?.[id] ?? props.persistedEntries?.[id], draft);"
1616
+ },
1617
+ {
1618
+ "before": "children: [(0, react_jsx_runtime.jsx)(\"span\", {\n\t\t\t\t\t\t\t\tclassName: ModelsSection_module_css_default[\"rowName\"],",
1619
+ "after": "children: [(0, react_jsx_runtime.jsx)(\"button\", {\n\t\t\t\t\t\t\t\ttype: \"button\", className: ModelsSection_module_css_default[\"iconButton\"],\n\t\t\t\t\t\t\t\t\"data-key-entry-handle\": id, \"aria-label\": t(\"multiKeyReorder\") + \" \" + heading,\n\t\t\t\t\t\t\t\t\"aria-keyshortcuts\": \"ArrowUp ArrowDown\", \"aria-description\": t(\"multiKeyReorderHelp\"), title: t(\"multiKeyReorderHelp\"),\n\t\t\t\t\t\t\t\tdisabled: disabled || anyBusy, ...reorder(id),\n\t\t\t\t\t\t\t\tchildren: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconDragHandleOutlineRegular, { size: 14 })\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[\"rowName\"],"
1620
+ },
1621
+ {
1622
+ "before": "const preview = (0, _deepseek_ai_dsh_client_ui_primitives.useRowDragPreview)(ModelsSection_module_css_default[\"modelDragPreview\"]);",
1623
+ "after": "const reorder = useSettingsReorder({ disabled, selector: \"[data-row-key]\", move: (_key, offset) => props.order.onMove(offset) });"
1624
+ },
1625
+ {
1626
+ "before": "\n\t\t\t\tonDragOver: (event) => {\n\t\t\t\t\tif (!props.order.canDrop) return;\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tevent.dataTransfer.dropEffect = \"move\";\n\t\t\t\t\tprops.order.onOver(rowHalf(event));\n\t\t\t\t},\n\t\t\t\tonDragLeave: (event) => {\n\t\t\t\t\tif (event.relatedTarget instanceof Node && event.currentTarget.contains(event.relatedTarget)) return;\n\t\t\t\t\tprops.order.onLeave();\n\t\t\t\t},\n\t\t\t\tonDrop: (event) => {\n\t\t\t\t\tif (!props.order.canDrop) return;\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tprops.order.onDrop(rowHalf(event));\n\t\t\t\t},",
1627
+ "after": "\n\t\t\t\t// Reordering is handled by the pointer handle below."
1628
+ },
1629
+ {
1630
+ "before": "\n\t\t\t\t\t\t\t\tdraggable: !disabled,\n\t\t\t\t\t\t\t\tonDragStart: (event) => {\n\t\t\t\t\t\t\t\t\tevent.dataTransfer.effectAllowed = \"move\";\n\t\t\t\t\t\t\t\t\tevent.dataTransfer.setData(\"application/x-dsh-model-order\", String(position));\n\t\t\t\t\t\t\t\t\tprops.order.onStart();\n\t\t\t\t\t\t\t\t\tpreview.start(event, event.currentTarget.closest(\"[data-row-key]\"));\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tonDragEnd: () => {\n\t\t\t\t\t\t\t\t\tif (preview.clear()) props.order.onEnd();\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tonKeyDown: (event) => {\n\t\t\t\t\t\t\t\t\tif (event.key !== \"ArrowUp\" && event.key !== \"ArrowDown\") return;\n\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\tprops.order.onMove(event.key === \"ArrowUp\" ? -1 : 1);\n\t\t\t\t\t\t\t\t},",
1631
+ "after": "\n\t\t\t\t\t\t\t\t...reorder(props.rowKey),"
1632
+ },
1633
+ {
1634
+ "before": "label: t(\"reorderModelHelp\"),",
1635
+ "after": "label: t(\"modelReorderTouchHelp\"),"
1636
+ },
1637
+ {
1638
+ "before": "\"aria-description\": t(\"reorderModelHelp\"),",
1639
+ "after": "\"aria-description\": t(\"modelReorderTouchHelp\"),"
1640
+ },
1641
+ {
1642
+ "before": "const en = {\n",
1643
+ "after": "const en = {\n\t\t\tmultiKeyReorder: \"Reorder key group\",\n\t\t\tmultiKeyReorderHelp: \"Hold the handle to reorder; or use Arrow Up/Down. Save with the other edits.\",\n\t\t\tmodelReorderTouchHelp: \"Hold the handle to reorder; or use Arrow Up/Down. Save with the other edits.\",\n"
1644
+ },
1645
+ {
1646
+ "before": "const zh = {\n",
1647
+ "after": "const zh = {\n\t\t\tmultiKeyReorder: \"调整密钥分组顺序\",\n\t\t\tmultiKeyReorderHelp: \"长按手柄拖动,或用上下方向键调整;与其他改动一起保存。\",\n\t\t\tmodelReorderTouchHelp: \"长按手柄拖动,或用上下方向键调整;与其他改动一起保存。\",\n"
1648
+ },
1649
+ {
1650
+ "before": "const MULTI_KEY_PROTOCOLS =",
1651
+ "after": "function applyModelCapabilities(model, defaults) {\n const object = value => value !== null && typeof value === 'object' && !Array.isArray(value);\n const overrides = model.capabilityOverrides;\n if (defaults !== undefined && (!object(defaults) || Object.keys(defaults).some(key => key !== 'vision' && key !== 'reasoning') || typeof defaults.vision !== 'boolean' || typeof defaults.reasoning !== 'boolean')) {\n throw new TypeError('capabilityDefaults must contain only boolean vision and reasoning');\n }\n if (overrides !== undefined && (!object(overrides) || Object.keys(overrides).some(key => key !== 'vision' && key !== 'reasoning') || Object.values(overrides).some(value => typeof value !== 'boolean' && value !== 'original'))) {\n throw new TypeError('capabilityOverrides must contain only boolean or original vision and reasoning');\n }\n const { capabilityOverrides: ignored, ...effective } = model;\n if (defaults === undefined) return effective;\n const choice = key => overrides?.[key] === 'original' ? undefined : overrides?.[key] ?? defaults[key];\n const vision = choice('vision');\n if (vision !== undefined) {\n const input = Array.isArray(model.input) ? [...model.input] : ['text'];\n effective.input = [...new Set(input.filter(value => vision || value !== 'image'))];\n if (effective.input.length === 0) effective.input.push('text');\n if (vision && !effective.input.includes('image')) effective.input.push('image');\n }\n const reasoning = choice('reasoning');\n if (reasoning === false) effective.reasoningEfforts = false;\n if (reasoning === true) {\n const levels = ['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'];\n const efforts = model.reasoningEfforts;\n const valid = object(efforts) && Object.keys(efforts).every(key => levels.includes(key)) && Object.entries(efforts).every(([key, value]) => key === 'off' && value === null || typeof value === 'string' && value.length > 0) && Object.keys(efforts).some(key => key !== 'off');\n effective.reasoningEfforts = valid ? { ...efforts } : { off: null, low: 'low', medium: 'medium', high: 'high' };\n }\n return effective;\n}\nfunction GroupCapabilityDefaults({ entry, onChange, disabled, t }) {\n const [mode, setMode] = (0, react.useState)('preserve');\n const [vision, setVision] = (0, react.useState)(true);\n const [reasoning, setReasoning] = (0, react.useState)(true);\n const [confirm, setConfirm] = (0, react.useState)(false);\n const defaults = entry.capabilityDefaults;\n const models = Array.isArray(entry.models) ? entry.models : [];\n const exceptions = models.filter(model => ['vision', 'reasoning'].some(key => model.capabilityOverrides?.[key] !== void 0)).length;\n const h = react_jsx_runtime.jsx, hs = react_jsx_runtime.jsxs;\n const css = ModelsSection_module_css_default;\n const button = (label, action, extra = {}) => h('button', { type: 'button', className: css.secondaryButton, disabled, onClick: () => { if (!disabled) action(); }, children: t(label), ...extra });\n const toggle = (key, value, change) => hs('div', { className: css.field, style: { display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', gap: 10, minHeight: 44 }, children: [h('span', { children: t(key === 'vision' ? 'capabilityVision' : 'capabilityReasoning') }), h(_deepseek_ai_dsh_client_ui_primitives.Switch, { 'data-capability-default': key, label: t(key === 'vision' ? 'capabilityVision' : 'capabilityReasoning'), checked: value, disabled, onChange: value => { if (!disabled) change(value); } })] });\n return hs('section', { 'data-group-capabilities': true, style: { display: 'flex', flexDirection: 'column', gap: 8, minWidth: 0, borderTop: '0.5px solid var(--dsw-alias-settings-card-stroke)', paddingTop: 12 }, children: [\n h('strong', { children: t('capabilityDefaultsTitle') }),\n h('p', { className: css.advancedHint, children: t(defaults ? 'capabilityDefaultsHelp' : 'capabilityEnableHelp') }),\n toggle('vision', defaults ? defaults.vision : vision, value => defaults ? onChange({ ...entry, capabilityDefaults: { ...defaults, vision: value } }) : setVision(value)),\n toggle('reasoning', defaults ? defaults.reasoning : reasoning, value => defaults ? onChange({ ...entry, capabilityDefaults: { ...defaults, reasoning: value } }) : setReasoning(value)),\n !defaults ? hs(react_jsx_runtime.Fragment, { children: [\n hs('label', { className: css.field, children: [h('span', { children: t('capabilityExisting') }), hs('select', { 'data-capability-initial-mode': true, className: css.input + ' ' + css.selectInput, value: mode, disabled, onChange: event => { if (!disabled && ['preserve', 'follow'].includes(event.target.value)) setMode(event.target.value); }, children: [h('option', { value: 'preserve', children: t('capabilityPreserve') }), h('option', { value: 'follow', children: t('capabilityAllFollow') })] })] }),\n button('capabilityEnable', () => onChange({ ...entry, capabilityDefaults: { vision, reasoning }, models: models.map(model => { const { capabilityOverrides, ...rest } = model; return mode === 'preserve' ? { ...rest, capabilityOverrides: { vision: 'original', reasoning: 'original' } } : rest; }) }), { 'data-capability-enable': true })\n ] }) : hs(react_jsx_runtime.Fragment, { children: [\n h('p', { 'data-capability-count': true, className: css.advancedHint, children: t('capabilityCounts').replace('{follow}', String(models.length - exceptions)).replace('{exceptions}', String(exceptions)) }),\n confirm ? hs('div', { 'data-capability-reset-confirm': true, role: 'group', style: { display: 'flex', flexDirection: 'column', gap: 8 }, children: [\n h('p', { className: css.advancedHint, children: t('capabilityResetHelp').replace('{count}', String(exceptions)) }),\n button('capabilityResetConfirm', () => { onChange({ ...entry, models: models.map(model => { const { capabilityOverrides, ...rest } = model; return rest; }) }); setConfirm(false); }, { 'data-capability-reset-accept': true }),\n button('cancel', () => setConfirm(false), { 'data-capability-reset-cancel': true })\n ] }) : button('capabilityReset', () => setConfirm(true), { 'data-capability-reset': true, disabled: disabled || exceptions === 0 })\n ] })\n ] });\n}\nfunction ModelCapabilityChoices({ model, defaults, inputFallback, position, disabled, t, onChange, expanded }) {\n if (!defaults) return null;\n const h = react_jsx_runtime.jsx, hs = react_jsx_runtime.jsxs;\n const effective = applyModelCapabilities(model, defaults);\n const state = key => key === 'vision' ? effective.input === void 0 && inputFallback === void 0 ? void 0 : (effective.input ?? inputFallback).includes('image') : effective.reasoningEfforts === void 0 ? void 0 : effective.reasoningEfforts !== false;\n const actual = key => t(state(key) === void 0 ? 'capabilityCatalog' : state(key) ? 'capabilityEnabled' : 'capabilityDisabled');\n const text = key => {\n const value = model.capabilityOverrides?.[key];\n return t(value === 'original' ? 'capabilityOriginal' : value === void 0 ? 'capabilityFollow' : value ? 'capabilityOn' : 'capabilityOff') + ' · ' + actual(key);\n };\n return hs('div', { 'data-model-capabilities': true, style: { gridColumn: '1 / -1', display: 'flex', flexDirection: 'column', gap: 6, minWidth: 0 }, children: ['vision', 'reasoning'].map(key => expanded ? hs('label', { className: ModelsSection_module_css_default.field, children: [h('span', { children: t(key === 'vision' ? 'capabilityVision' : 'capabilityReasoning') + ' · ' + actual(key) }), hs('select', { 'data-model-capability': key, 'aria-label': t(key === 'vision' ? 'capabilityVision' : 'capabilityReasoning') + ' ' + position, className: ModelsSection_module_css_default.input + ' ' + ModelsSection_module_css_default.selectInput, value: model.capabilityOverrides?.[key] === void 0 ? 'follow' : String(model.capabilityOverrides[key]), disabled, onChange: event => {\n if (disabled || !['follow', 'true', 'false', 'original'].includes(event.target.value)) return;\n if (event.target.value === 'original' && model.capabilityOverrides?.[key] !== 'original') return;\n const overrides = { ...model.capabilityOverrides };\n if (event.target.value === 'follow') delete overrides[key]; else overrides[key] = event.target.value === 'original' ? 'original' : event.target.value === 'true';\n const { capabilityOverrides, ...rest } = model;\n onChange(Object.keys(overrides).length ? { ...rest, capabilityOverrides: overrides } : rest);\n }, children: [h('option', { value: 'follow', children: t('capabilityFollow') }), h('option', { value: 'true', children: t('capabilityOn') }), h('option', { value: 'false', children: t('capabilityOff') }), model.capabilityOverrides?.[key] === 'original' ? h('option', { value: 'original', children: t('capabilityOriginal') }) : null] })] }, key) : h('span', { className: ModelsSection_module_css_default.advancedHint, children: t(key === 'vision' ? 'capabilityVision' : 'capabilityReasoning') + ': ' + text(key) }, key)) });\n}\n\t\tconst MULTI_KEY_PROTOCOLS ="
1652
+ },
1653
+ {
1654
+ "before": "(0, react_jsx_runtime.jsx)(ModelListEditor, {\n\t\t\t\t\t\t\t\tmodels: modelDrafts(entry.models),",
1655
+ "after": "(0, react_jsx_runtime.jsx)(GroupCapabilityDefaults, { entry, t, disabled: disabled || anyBusy, onChange: (next) => { if (!disabled && !anyBusy) update(id, next); } }), (0, react_jsx_runtime.jsx)(ModelListEditor, {\n\t\t\t\t\t\t\t\tcapabilityDefaults: entry.capabilityDefaults, models: modelDrafts(entry.models),"
1656
+ },
1657
+ {
1658
+ "before": "const { model, position, t, disabled } = props;",
1659
+ "after": "const { model, position, t } = props;\n\t\t\tconst disabled = props.disabled || props.capabilityBusy === true;\n\t\t\tconst capabilityDefaults = props.capabilityDefaults;\n\t\t\tconst effectiveCapabilities = capabilityDefaults ? applyModelCapabilities(model, capabilityDefaults) : model;\n\t\t\tconst capabilityNative = (key) => !capabilityDefaults || model.capabilityOverrides?.[key] === \"original\" || model.capabilityOverrides?.[key] === true;\n\t\t\tconst capabilityChange = (key, next) => {\n\t\t\t\tif (disabled) return;\n\t\t\t\tif (!capabilityDefaults) { props.onChange(next); return; }\n\t\t\t\tconst field = key === \"vision\" ? \"input\" : \"reasoningEfforts\";\n\t\t\t\tconst keepRawReasoning = key === \"reasoning\" && (next.reasoningEfforts === false || next.reasoningEfforts === void 0);\n\t\t\t\tconst changed = { ...model, ...keepRawReasoning ? {} : { [field]: next[field] }, capabilityOverrides: { ...model.capabilityOverrides, [key]: key === \"vision\" ? (next.input ?? props.inputFallback ?? [\"text\"]).includes(\"image\") : next.reasoningEfforts !== false && next.reasoningEfforts !== void 0 } };\n\t\t\t\tif (!keepRawReasoning && next[field] === void 0) delete changed[field];\n\t\t\t\tprops.onChange(changed);\n\t\t\t};"
1660
+ },
1661
+ {
1662
+ "before": "modelField(\"name\"),\n\t\t\t\t\t\tprops.expanded ?",
1663
+ "after": "modelField(\"name\"),\n\t\t\t\t\t\t(0, react_jsx_runtime.jsx)(ModelCapabilityChoices, { model, defaults: capabilityDefaults, inputFallback: props.inputFallback, position, disabled, t, onChange: props.onChange, expanded: props.expanded }),\n\t\t\t\t\t\tprops.expanded ?"
1664
+ },
1665
+ {
1666
+ "before": "(0, react_jsx_runtime.jsx)(ModelInputTypes, {\n\t\t\t\t\t\t\t\t\tmodel,",
1667
+ "after": "capabilityNative(\"vision\") ? (0, react_jsx_runtime.jsx)(ModelInputTypes, {\n\t\t\t\t\t\t\t\t\tmodel: effectiveCapabilities,"
1668
+ },
1669
+ {
1670
+ "before": "onChange: props.onChange\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\tprops.reasoningLevels",
1671
+ "after": "onChange: (next) => capabilityChange(\"vision\", next)\n\t\t\t\t\t\t\t\t}) : null,\n\t\t\t\t\t\t\t\tprops.reasoningLevels"
1672
+ },
1673
+ {
1674
+ "before": "props.reasoningLevels !== void 0 && props.reasoningLevels.length > 0 ?",
1675
+ "after": "capabilityNative(\"reasoning\") && props.reasoningLevels !== void 0 && props.reasoningLevels.length > 0 ?"
1676
+ },
1677
+ {
1678
+ "before": "(0, react_jsx_runtime.jsx)(ModelReasoningEfforts, {\n\t\t\t\t\t\t\t\t\tmodel,",
1679
+ "after": "(0, react_jsx_runtime.jsx)(ModelReasoningEfforts, {\n\t\t\t\t\t\t\t\t\tmodel: effectiveCapabilities,"
1680
+ },
1681
+ {
1682
+ "before": "onChange: props.onChange\n\t\t\t\t\t\t\t\t}) : null",
1683
+ "after": "onChange: (next) => capabilityChange(\"reasoning\", next)\n\t\t\t\t\t\t\t\t}) : null"
1684
+ },
1685
+ {
1686
+ "before": "children: rowState.rows.map(({ model, key, expanded, order }, index) => (0, react_jsx_runtime.jsx)(ModelRow, {\n\t\t\t\t\t\t\trowKey: key,",
1687
+ "after": "children: rowState.rows.map(({ model, key, expanded, order }, index) => (0, react_jsx_runtime.jsx)(ModelRow, {\n\t\t\t\t\t\t\tcapabilityDefaults: props.capabilityDefaults, capabilityBusy: busy,\n\t\t\t\t\t\t\trowKey: key,"
1688
+ },
1689
+ {
1690
+ "before": "const en = {\n",
1691
+ "after": "const en = {\n\t\t\tcapabilityDefaultsTitle: \"Model capability defaults\",\n\t\t\tcapabilityVision: \"Image input\",\n\t\t\tcapabilityReasoning: \"Reasoning effort selection\",\n\t\t\tcapabilityDefaultsHelp: \"New models follow these defaults. Individual settings stay unchanged. Save with the existing Apply button.\",\n\t\t\tcapabilityEnableHelp: \"Enable group defaults explicitly. This advertises capabilities; your relay must support them.\",\n\t\t\tcapabilityExisting: \"Existing models\",\n\t\t\tcapabilityPreserve: \"Keep existing settings (recommended)\",\n\t\t\tcapabilityAllFollow: \"Make all follow this group\",\n\t\t\tcapabilityEnable: \"Enable group defaults\",\n\t\t\tcapabilityCounts: \"{follow} follow group · {exceptions} have individual settings\",\n\t\t\tcapabilityReset: \"Make all follow group\",\n\t\t\tcapabilityResetHelp: \"Clear individual settings on {count} models? Raw model fields are retained. This edits the draft only.\",\n\t\t\tcapabilityResetConfirm: \"Confirm follow group\",\n\t\t\tcapabilityOriginal: \"Keep original settings\",\n\t\t\tcapabilityFollow: \"Follow group\",\n\t\t\tcapabilityOn: \"Individually enabled\",\n\t\t\tcapabilityOff: \"Individually disabled\",\n\t\t\tcapabilityEnabled: \"Enabled\",\n\t\t\tcapabilityCatalog: \"Uses original model configuration\",\n\t\t\tcapabilityDisabled: \"Disabled\",\n"
1692
+ },
1693
+ {
1694
+ "before": "const zh = {\n",
1695
+ "after": "const zh = {\n\t\t\tcapabilityDefaultsTitle: \"模型能力默认设置\",\n\t\t\tcapabilityVision: \"识图\",\n\t\t\tcapabilityReasoning: \"思考强度设置\",\n\t\t\tcapabilityDefaultsHelp: \"新加入的模型自动跟随;单独设置过的模型保持原设置。仍由原来的保存按钮提交。\",\n\t\t\tcapabilityEnableHelp: \"启用分组规则前先选择已有模型如何处理。此设置声明可用能力,中转站本身仍需支持。\",\n\t\t\tcapabilityExisting: \"已有模型如何处理\",\n\t\t\tcapabilityPreserve: \"保留现有模型设置(推荐)\",\n\t\t\tcapabilityAllFollow: \"现有模型全部跟随分组\",\n\t\t\tcapabilityEnable: \"启用分组默认规则\",\n\t\t\tcapabilityCounts: \"{follow} 个模型跟随分组 · {exceptions} 个模型有单独设置\",\n\t\t\tcapabilityReset: \"全部恢复跟随分组\",\n\t\t\tcapabilityResetHelp: \"清除 {count} 个模型的单独设置?原始模型字段保留;此操作只修改草稿。\",\n\t\t\tcapabilityResetConfirm: \"确认全部跟随\",\n\t\t\tcapabilityOriginal: \"保留原设置\",\n\t\t\tcapabilityFollow: \"跟随分组\",\n\t\t\tcapabilityOn: \"单独开启\",\n\t\t\tcapabilityOff: \"单独关闭\",\n\t\t\tcapabilityEnabled: \"已开启\",\n\t\t\tcapabilityCatalog: \"按模型原配置\",\n\t\t\tcapabilityDisabled: \"已关闭\",\n"
1696
+ }
1697
+ ]
1086
1698
  }
1087
1699
  ]
1088
1700
  }